Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bug fixes for Apwrite 1.4.2 #16

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/teams/create-membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/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.1',
'x-sdk-version': '9.0.0',
'X-Appwrite-Response-Format':'1.4.0',
};

Expand Down
6 changes: 1 addition & 5 deletions src/services/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Models.Function> {
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<Models.Function> {
if (typeof functionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "functionId"');
}
Expand All @@ -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 = {};

Expand Down
8 changes: 2 additions & 6 deletions src/services/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Models.Membership> {
async createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership> {
if (typeof teamId === 'undefined') {
throw new AppwriteException('Missing required parameter: "teamId"');
}
Expand All @@ -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 = {};

Expand Down