From e3b946f8617ef46a3743a9f925bd42b87719411b Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Tue, 29 Oct 2024 17:03:29 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Add=20Fleek=20Function?= =?UTF-8?q?=20assets=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 🤖 copy fleek function assets * chore: 🤖 format * chore: 🤖 changeset --- .changeset/mean-rats-unite.md | 5 +++++ src/clients/functions.ts | 8 +++----- src/clients/user.test.ts | 8 +++----- 3 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 .changeset/mean-rats-unite.md diff --git a/.changeset/mean-rats-unite.md b/.changeset/mean-rats-unite.md new file mode 100644 index 0000000..99616c5 --- /dev/null +++ b/.changeset/mean-rats-unite.md @@ -0,0 +1,5 @@ +--- +"Examples": minor +--- + +Add Fleek Function assets. diff --git a/src/clients/functions.ts b/src/clients/functions.ts index 1f95bd1..2ee0416 100644 --- a/src/clients/functions.ts +++ b/src/clients/functions.ts @@ -33,6 +33,7 @@ export type DeployFleekFunctionArgs = { cid: string; sgx?: boolean; blake3Hash?: string; + assetsCid?: string; }; export type ListFleekFunctionArgs = { functionId: string; @@ -70,7 +71,6 @@ export class FunctionsClient { public get = async ({ name }: GetFleekFunctionArgs) => { const response = await this.graphqlClient.query({ - __name: 'GetFleekFunctionByName', fleekFunctionByName: { __args: { where: { @@ -86,7 +86,6 @@ export class FunctionsClient { public list = async () => { const response = await this.graphqlClient.query({ - __name: 'GetFleekFunctions', fleekFunctions: { __args: {}, data: { @@ -119,7 +118,6 @@ export class FunctionsClient { public create = async ({ name }: CreateFleekFunctionArgs) => { const response = await this.graphqlClient.mutation({ - __name: 'CreateFleekFunction', createFleekFunction: { __args: { data: { @@ -138,6 +136,7 @@ export class FunctionsClient { cid, sgx, blake3Hash, + assetsCid, }: DeployFleekFunctionArgs): Promise => { const response = await this.graphqlClient.mutation({ triggerFleekFunctionDeployment: { @@ -146,7 +145,7 @@ export class FunctionsClient { functionId, cid, }, - data: { sgx, blake3Hash }, + data: { sgx, blake3Hash, assetsCid }, }, ...FunctionsClient.Deployment_MAPPED_PROPERTIES, }, @@ -157,7 +156,6 @@ export class FunctionsClient { public delete = async ({ id }: DeleteFleekFunctionArgs) => { const response = await this.graphqlClient.mutation({ - __name: 'DeleteFleekFunction', deleteFleekFunction: { __args: { where: { diff --git a/src/clients/user.test.ts b/src/clients/user.test.ts index a389c24..0bdb17e 100644 --- a/src/clients/user.test.ts +++ b/src/clients/user.test.ts @@ -30,11 +30,9 @@ describe('User', () => { }); it('should delete personal access token', async () => { - const response = await sdk - .user() - .deletePersonalAccessToken({ - id: state.auth.personalAccessToken.joshOwnedToken.id, - }); + const response = await sdk.user().deletePersonalAccessToken({ + id: state.auth.personalAccessToken.joshOwnedToken.id, + }); expect(response).toMatchInlineSnapshot(` Object {