Skip to content
New issue

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

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

Already on GitHub? # to your account

chore: bug fixes for Apwrite 1.4.2 #61

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 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: 2 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class Client {
this.headers = {
'accept-encoding': '*',
'content-type': '',
'user-agent' : `AppwriteNodeJSSDK/10.0.1 (${os.type()}; ${os.version()}; ${os.arch()})`,
'user-agent' : `AppwriteNodeJSSDK/11.0.0 (${os.type()}; ${os.version()}; ${os.arch()})`,
'x-sdk-name': 'Node.js',
'x-sdk-platform': 'server',
'x-sdk-language': 'nodejs',
'x-sdk-version': '10.0.1',
'x-sdk-version': '11.0.0',
'X-Appwrite-Response-Format' : '1.4.0',
};
this.selfSigned = false;
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "node-appwrite",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
"version": "10.0.1",
"version": "11.0.0",
"license": "BSD-3-Clause",
"main": "./index.js",
"types": "./index.d.ts",
Expand Down