Skip to content

Commit

Permalink
chore: bug fixes for Apwrite 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
christyjacob4 committed Sep 7, 2023
1 parent c3126b7 commit 7fa595b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Appwrite Node.js SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-node.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 @@ -11,7 +11,7 @@ client
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

const promise = functions.create('[FUNCTION_ID]', '[NAME]', 'node-14.5');
const 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 @@ -11,7 +11,7 @@ client
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

const promise = functions.update('[FUNCTION_ID]', '[NAME]', 'node-14.5');
const 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 @@ -11,7 +11,7 @@ client
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

const promise = teams.createMembership('[TEAM_ID]', [], 'https://example.com');
const promise = teams.createMembership('[TEAM_ID]', []);

promise.then(function (response) {
console.log(response);
Expand Down
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3279,7 +3279,7 @@ declare module "node-appwrite" {
* @throws {AppwriteException}
* @returns {Promise}
*/
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>;
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>;
/**
* Delete Function
*
Expand Down Expand Up @@ -4028,15 +4028,15 @@ declare module "node-appwrite" {
*
* @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}
*/
createMembership(teamId: string, roles: string[], url: string, email?: string, userId?: string, phone?: string, name?: string): Promise<Models.Membership>;
createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
/**
* Get Team Membership
*
Expand Down
4 changes: 0 additions & 4 deletions lib/services/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ class Functions extends Service {
throw new AppwriteException('Missing required parameter: "name"');
}

if (typeof runtime === 'undefined') {
throw new AppwriteException('Missing required parameter: "runtime"');
}


if (typeof name !== 'undefined') {
payload['name'] = name;
Expand Down
8 changes: 2 additions & 6 deletions lib/services/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ 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, roles, url, email, userId, phone, name) {
async createMembership(teamId, roles, email, userId, phone, url, name) {
const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
let payload = {};
if (typeof teamId === 'undefined') {
Expand All @@ -239,10 +239,6 @@ class Teams extends Service {
throw new AppwriteException('Missing required parameter: "roles"');
}

if (typeof url === 'undefined') {
throw new AppwriteException('Missing required parameter: "url"');
}


if (typeof email !== 'undefined') {
payload['email'] = email;
Expand Down

0 comments on commit 7fa595b

Please sign in to comment.