Releases: spheronFdn/sdk
storage:v1.0.11
Added
- Added methods to the
SpheronClinet
for working with IPNS records.async publishIPNS(uploadId: string): Promise<IPNSName>
- used to publish IPFS Deployment to IPNS
async updateIPNSName(ipnsNameId: string, uploadId: string): Promise<IPNSName>
- used to update IPNS name to new deployment
async getIPNSName(ipnsNameId: string): Promise<IPNSName>
- get IPNS name data by id
async getIPNSNamesForDeployment(deploymentId: string): Promise<IPNSName[]>
- get all IPNS names for a deployment
async getIPNSNamesForOrganization(organizationId: string): Promise<IPNSName[]>
- get all IPNS names for an organization
storage:v1.0.10
Updated
- Update the link to the token creation docs in the Storage README.md
cli: v1.0.7
In this release we introduced support for older versions of node. We have support for node versions greater than 12.17.0.
Added babel to compile modules in ES5.
New commands :
1. spheron get
Examples:
- get organization : options: --id
- get organizations : (all organization for your user will be returned)
- get deployment : options: --id, --skip (optional), --limit (optional), --status (optional)
- get deployments : options: --projectId
- get project : options: --id
- get projects : options: --organizationId (optional), --skip (optional), --limit (optional), --state (optional)
- get domains : options: --projectId
- get deployment-environments : options: --projectId
Note* :
deployment status field can be PreQueue,Queued,Pending,Canceled,Deployed,Failed,AuthorizationNeeded,Killing,TimedOut
project state field can be MAINTAINED,ARCHIVED
2. spheron configure [--organization ]
Enables you to switch default organization
We also added support to signup directly from CLI, no need to register to Spheron before doing spheron login on CLI.
storage: v1.0.9
Added
- Added two new methods to the
SpheronClinet
:async getOrganizationUsage(organizationId: string): Promise<UsageWithLimits>
- used to get the usage of the current active subscription of the organization.
async getTokenScope(): Promise<TokenScope>
- used to get the scope of the token.
Updated
- Updated the storage
README.md
to include a note that the package will not work on browser environment.
storage: v1.0.8
Updated
- Updated the Spheron Logo in README.md
cli: v1.0.5
Updated
- Updated the Spheron Logo in README.md
storage: v1.0.7
Added
- Added methods to the SpheronClinet for working with buckets, bucket domains and uploads.
- The
SpheronClient
instance provides several methods for working with buckets. The supported methods are:async getBucket(bucketId: string): Promise<Bucket>
- used to get the bucket information for the specified
bucketId
.
- used to get the bucket information for the specified
async getBucketDomains(bucketId: string): Promise<Domain[]>
- used to get the domains that are attached to the specified
bucketId
.
- used to get the domains that are attached to the specified
async getBucketDomain(bucketId: string, domainIdentifier: string): Promise<Domain>
- used to get the information about the specific domain. The
domainIdentifier
can ether be the id of the domain, or the name of the domain.
- used to get the information about the specific domain. The
async addBucketDomain(bucketId: string, { link: string; type: DomainTypeEnum; name: string; }): Promise<Domain>
- used to add a new domain to the specified bucket. The
link
property needs to have theprotocolLink
value of an existing bucket id. After adding a new domain, you will need to setup the record on your DNS provider:- domain: you should create a A type record with value
13.248.203.0
, and the same name as the domain you have added. - subdomain : you should create a CNAME type record with value
cname.spheron.io
, and the same name as the domain you have added. - handshake-domain: you should create a A type record with value
ipfs.namebase.io
, and@
for name. Also you should create a TXT type record withlink
for a value, and_contenthash
for name. - handshake-subdomain: you should create a A type record with value
ipfs.namebase.io
, and the same name as the domain you have added. Also you should create a TXT type record withlink
for a value, and_contenthash.<name_of_the_domain>
for name. - ens-domain: you should create a CONTENT type record with
link
for a value, and the same name as the domain you have added.
- domain: you should create a A type record with value
- After you have setup the record on your DNS provider, then you should call the
verifyBucketDomain
method to verify your domain on Spheron. After the domain is verified, the data behind the link will be cached on the Spheron CDN.
- used to add a new domain to the specified bucket. The
async updateBucketDomain(bucketId: string, domainIdentifier: string, options: { link: string; name: string; }): Promise<Domain>
- used to update an existing domain of the Bucket.
async verifyBucketDomain(bucketId: string, domainIdentifier: string): Promise<Domain>
- used to verify the domain, after which the content behind the domain will be cached on CDN.
async deleteBucketDomain(bucketId: string, domainIdentifier: string): Promise<void>
- used to delete the domain of the Bucket.
async archiveBucket(bucketId: string): Promise<void>
- used to archive the Bucket. New uploads cannot be created for an archived bucket.
async unarchiveBucket(bucketId: string): Promise<void>
- used to unarchive the Bucket.
async getBucketUploadCount(bucketId: string): Promise<{total: number; successful: number; failed: number; pending: number; }>
- used to get the number of uploads for the specified bucket.
async getBucketUploads(bucketId: string, options: { skip: number; limit: number; }): Promise<Upload[]>
- used to get the uploads of the bucket. The default value for
skip
is 0. The default value forlimit
is 6.
- used to get the uploads of the bucket. The default value for
async getUpload(uploadId: string): Promise<Upload>
- used to get the upload by its id.
Interfaces:
enum DomainTypeEnum {
DOMAIN = "domain",
SUBDOMAIN = "subdomain",
HANDSHAKE_DOMAIN = "handshake-domain",
HANDSHAKE_SUBDOMAIN = "handshake-subdomain",
ENS_DOMAIN = "ens-domain",
}
interface Domain {
id: string;
name: string;
link: string;
verified: boolean;
bucketId: string;
type: DomainTypeEnum;
}
enum BucketStateEnum {
MAINTAINED = "MAINTAINED",
ARCHIVED = "ARCHIVED",
}
interface Bucket {
id: string;
name: string;
organizationId: string;
state: BucketStateEnum;
domains: Domain[];
}
enum UploadStatusEnum {
PENDING = "Pending",
CANCELED = "Canceled",
DEPLOYED = "Deployed",
FAILED = "Failed",
TIMED_OUT = "TimedOut",
}
interface Upload {
id: string;
protocolLink: string;
buildDirectory: string[];
status: UploadStatusEnum;
memoryUsed: number;
bucketId: string;
protocol: string;
}
- Added a named export for
SpheronClient
besides the default one. Also updated the example to use the named import instead of the default one.
import { SpheronClient, ProtocolEnum } from "@spheron/storage";
storage: v1.0.6
Added
- Added an
Access Token
section to theREADME.md
with a link that points to the docs for creating an access token.
cli: v1.0.3
Created a package named @spheron/cli. This package provides support for creating dapps and deploying them on web3 storage.
storage: v1.0.5
Added
- Added an optional parameter
organizationId
to theupload
function. This parameter can be used when the token that is used is scoped to multiple organizations. - Added description and example to the
README.md
on how to use theonUploadInitiated
andonChunkUploaded
callback functions.
import SpheronClient, { ProtocolEnum } from "@spheron/storage";
const client = new SpheronClient({ token });
let currentlyUploaded = 0;
const { uploadId, bucketId, protocolLink, dynamicLinks } = await client.upload(
filePath,
{
protocol: ProtocolEnum.IPFS,
name,
onUploadInitiated: (uploadId) => {
console.log(`Upload with id ${uploadId} started...`);
},
onChunkUploaded: (uploadedSize, totalSize) => {
currentlyUploaded += uploadedSize;
console.log(`Uploaded ${currentlyUploaded} of ${totalSize} Bytes.`);
},
}
);
Fixed
- Fixed a bug in the
UploadManager
where errors that occurred when sending requests to the API were not being properly parsed and reported.