From a17de895e5af6d5a5528d98cbc5a15984a32212e Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 7 Sep 2023 21:24:51 +0000 Subject: [PATCH 1/3] chore: bug fixes for Apwrite 1.4.2 --- README.md | 2 +- docs/examples/functions/create.md | 2 +- docs/examples/functions/update.md | 2 +- docs/examples/teams/create-membership.md | 2 +- src/services/functions.ts | 6 +----- src/services/teams.ts | 8 ++------ 6 files changed, 7 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c396d02..a3270d4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Deno SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.4.1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.4.2-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 0c5ff2c..cd9c150 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -12,7 +12,7 @@ client ; -let promise = functions.create('[FUNCTION_ID]', '[NAME]', 'node-14.5'); +let promise = functions.create('[FUNCTION_ID]', '[NAME]', 'node-18.0'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 360e7ab..8ed2663 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -12,7 +12,7 @@ client ; -let promise = functions.update('[FUNCTION_ID]', '[NAME]', 'node-14.5'); +let promise = functions.update('[FUNCTION_ID]', '[NAME]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index c4169a3..afb6b91 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -12,7 +12,7 @@ client ; -let promise = teams.createMembership('[TEAM_ID]', [], 'https://example.com'); +let promise = teams.createMembership('[TEAM_ID]', []); promise.then(function (response) { console.log(response); diff --git a/src/services/functions.ts b/src/services/functions.ts index 44f689e..66a2bb5 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -218,7 +218,7 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async update(functionId: string, name: string, runtime: string, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string): Promise { + async update(functionId: string, name: string, runtime?: string, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -227,10 +227,6 @@ export class Functions extends Service { throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof runtime === 'undefined') { - throw new AppwriteException('Missing required parameter: "runtime"'); - } - const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); const payload: Payload = {}; diff --git a/src/services/teams.ts b/src/services/teams.ts index 18ca432..efaf137 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -216,15 +216,15 @@ export class Teams extends Service { * * @param {string} teamId * @param {string[]} roles - * @param {string} url * @param {string} email * @param {string} userId * @param {string} phone + * @param {string} url * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ - async createMembership(teamId: string, roles: string[], url: string, email?: string, userId?: string, phone?: string, name?: string): Promise { + async createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -233,10 +233,6 @@ export class Teams extends Service { throw new AppwriteException('Missing required parameter: "roles"'); } - if (typeof url === 'undefined') { - throw new AppwriteException('Missing required parameter: "url"'); - } - const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId); const payload: Payload = {}; From 94c625b7e6868e190d24cf3e210fa2e993e6a3b3 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 7 Sep 2023 21:35:00 +0000 Subject: [PATCH 2/3] chore: updates for appwrite 1.4.2 --- src/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.ts b/src/client.ts index 40753b1..1dccb35 100644 --- a/src/client.ts +++ b/src/client.ts @@ -11,11 +11,11 @@ export class Client { endpoint: string = 'https://HOSTNAME/v1'; headers: Payload = { 'content-type': '', - 'user-agent' : `AppwriteDenoSDK/8.0.1 (${Deno.build.os}; ${Deno.build.arch})`, + 'user-agent' : `AppwriteDenoSDK/8.0.2 (${Deno.build.os}; ${Deno.build.arch})`, 'x-sdk-name': 'Deno', 'x-sdk-platform': 'server', 'x-sdk-language': 'deno', - 'x-sdk-version': '8.0.1', + 'x-sdk-version': '8.0.2', 'X-Appwrite-Response-Format':'1.4.0', }; From 438e08ce03961a04f2b9a5f5fef7a15ba62c3162 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 7 Sep 2023 21:51:53 +0000 Subject: [PATCH 3/3] chore: updates for appwrite 1.4.2 --- src/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.ts b/src/client.ts index 1dccb35..e6db0f3 100644 --- a/src/client.ts +++ b/src/client.ts @@ -11,11 +11,11 @@ export class Client { endpoint: string = 'https://HOSTNAME/v1'; headers: Payload = { 'content-type': '', - 'user-agent' : `AppwriteDenoSDK/8.0.2 (${Deno.build.os}; ${Deno.build.arch})`, + 'user-agent' : `AppwriteDenoSDK/9.0.0 (${Deno.build.os}; ${Deno.build.arch})`, 'x-sdk-name': 'Deno', 'x-sdk-platform': 'server', 'x-sdk-language': 'deno', - 'x-sdk-version': '8.0.2', + 'x-sdk-version': '9.0.0', 'X-Appwrite-Response-Format':'1.4.0', };