From 981dd87eb942cd1add1d9c2b4f01bdc334c75b36 Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Mon, 7 Oct 2024 19:34:09 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/content/docs/SDK/IPFS/index.md | 1 + src/content/docs/SDK/IPNS/index.md | 6 +-- src/content/docs/SDK/Projects/index.md | 71 +++++++++++++------------- src/content/docs/SDK/Storage/index.md | 2 +- src/content/docs/SDK/index.md | 2 + 5 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/content/docs/SDK/IPFS/index.md b/src/content/docs/SDK/IPFS/index.md index 38297dfc..78efdfb6 100644 --- a/src/content/docs/SDK/IPFS/index.md +++ b/src/content/docs/SDK/IPFS/index.md @@ -25,6 +25,7 @@ When importing the SDK (version 3 and above), you should explicitly specify the ```ts import { FleekSdk, PersonalAccessTokenService } from '@fleek-platform/sdk/node'; ``` + ::: ## Methods diff --git a/src/content/docs/SDK/IPNS/index.md b/src/content/docs/SDK/IPNS/index.md index 991782ae..d2013a6f 100644 --- a/src/content/docs/SDK/IPNS/index.md +++ b/src/content/docs/SDK/IPNS/index.md @@ -25,6 +25,7 @@ When importing the SDK (version 3 and above), you should explicitly specify the ```ts import { FleekSdk, PersonalAccessTokenService } from '@fleek-platform/sdk/node'; ``` + ::: ## Methods @@ -150,7 +151,7 @@ To publish an IPNS record, you need to provide the IPNS record name and the IPFS ### Function Signature ```typescript -async ({ hash, id }: PublishRecordArgs): Promise +async ({ hash, id }: PublishRecordArgs): Promise ``` ### Parameters @@ -159,12 +160,11 @@ async ({ hash, id }: PublishRecordArgs): Promise type PublishRecordArgs = { id: string; hash: string; -} +}; ``` ### Returns - Returns a Promise which resolves to a IpnsRecord type, containing an id, name and the hash. ```typescript diff --git a/src/content/docs/SDK/Projects/index.md b/src/content/docs/SDK/Projects/index.md index 710bc19c..2f6a046a 100644 --- a/src/content/docs/SDK/Projects/index.md +++ b/src/content/docs/SDK/Projects/index.md @@ -21,6 +21,7 @@ When importing the SDK (version 3 and above), you should explicitly specify the ```ts import { FleekSdk, PersonalAccessTokenService } from '@fleek-platform/sdk/node'; ``` + ::: ## Create @@ -38,7 +39,7 @@ async ({ name }: CreateProjectArgs): Promise ```typescript type CreateProjectArgs = { name: string; -} +}; ``` ### Returns @@ -47,14 +48,14 @@ Returns a Promise which resolves to a Project type, to name a few, containing an ```typescript type Project = { - avatar: File; - backupStorageOnArweave: boolean; - backupStorageOnFilecoin: boolean; - createdAt: Date; - id: string; - name: string; - updatedAt: Date; -} + avatar: File; + backupStorageOnArweave: boolean; + backupStorageOnFilecoin: boolean; + createdAt: Date; + id: string; + name: string; + updatedAt: Date; +}; ``` ### Usage Example @@ -98,13 +99,13 @@ Returns a Promise which resolves to a list of Project type, to name a few, conta ```typescript type Project = { - avatar: File; - backupStorageOnArweave: boolean; - backupStorageOnFilecoin: boolean; - createdAt: Date; - id: string; - name: string; - updatedAt: Date; + avatar: File; + backupStorageOnArweave: boolean; + backupStorageOnFilecoin: boolean; + createdAt: Date; + id: string; + name: string; + updatedAt: Date; }[]; ``` @@ -134,7 +135,7 @@ Use the `get` method to retrieve a `Project` by its `id`. ### Function Signature ```typescript -async ({ id }: GetProjectArgs): Promise +async ({ id }: GetProjectArgs): Promise ``` ### Parameters @@ -142,7 +143,7 @@ async ({ id }: GetProjectArgs): Promise ```typescript type GetProjectArgs = { id: string; -} +}; ``` ### Returns @@ -151,13 +152,13 @@ Returns a Promise which resolves to a Project type, to name a few, containing an ```typescript type Project = { - avatar: File; - backupStorageOnArweave: boolean; - backupStorageOnFilecoin: boolean; - createdAt: Date; - id: string; - name: string; - updatedAt: Date; + avatar: File; + backupStorageOnArweave: boolean; + backupStorageOnFilecoin: boolean; + createdAt: Date; + id: string; + name: string; + updatedAt: Date; }; ``` @@ -189,7 +190,7 @@ Use the `update` method by: ### Function Signature ```typescript -async ({ id }: GetProjectArgs): Promise +async ({ id }: GetProjectArgs): Promise ``` ### Parameters @@ -197,13 +198,13 @@ async ({ id }: GetProjectArgs): Promise ```typescript type UpdateProjectArgs = { where: { - id: string, + id: string; }; data: { name?: string; avatar?: File; backupStorageOnArweave?: boolean; - backupStorageOnFilecoin?: boolean, + backupStorageOnFilecoin?: boolean; }; }; ``` @@ -214,13 +215,13 @@ Returns a Promise which resolves to a Project type, to name a few, containing an ```typescript type Project = { - avatar: File; - backupStorageOnArweave: boolean; - backupStorageOnFilecoin: boolean; - createdAt: Date; - id: string; - name: string; - updatedAt: Date; + avatar: File; + backupStorageOnArweave: boolean; + backupStorageOnFilecoin: boolean; + createdAt: Date; + id: string; + name: string; + updatedAt: Date; }; ``` diff --git a/src/content/docs/SDK/Storage/index.md b/src/content/docs/SDK/Storage/index.md index 45010754..bffca0c8 100644 --- a/src/content/docs/SDK/Storage/index.md +++ b/src/content/docs/SDK/Storage/index.md @@ -25,6 +25,7 @@ When importing the SDK (version 3 and above), you should explicitly specify the ```ts import { FleekSdk, PersonalAccessTokenService } from '@fleek-platform/sdk/node'; ``` + ::: ## Methods @@ -288,7 +289,6 @@ const res = await fleekSdk.storage().getByFilename({ }); ``` - ## Delete The `delete` is an asynchronous function designed to delete a storage file by it's CID. diff --git a/src/content/docs/SDK/index.md b/src/content/docs/SDK/index.md index 18711cc5..b9206145 100644 --- a/src/content/docs/SDK/index.md +++ b/src/content/docs/SDK/index.md @@ -30,6 +30,7 @@ npm install @fleek-platform/sdk ## Authentication Authentication requires providing an access token. There are currently two methods available: + - The [ApplicationAccessTokenService](#applicationaccesstokenservice): For public-facing applications, which tokens are generated via the Fleek Platform user account's [dashboard](https://app.fleek.xyz) - The [PersonalAccessTokenService](#personalaccesstokenservice): Used typically for server-side applications, which tokens are managed via [CLI](/docs/cli). You must keep these tokens secure and hidden @@ -75,6 +76,7 @@ const fleekSdkInstanceB = new FleekSdk({ :::note When importing the SDK (version 3 and above), you can explicitly specify the environment: + - For server-side (Node.js): Use @fleek-platform/sdk/node in the import statement - For client-side (Browser): USe @fleek-platform/sdk/browser in the import statement