node-appwrite 10.0.1 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/examples/functions/create.md +1 -1
- package/docs/examples/functions/update.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/index.d.ts +3 -3
- package/lib/client.js +2 -2
- package/lib/services/functions.js +0 -4
- package/lib/services/teams.js +2 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Appwrite Node.js SDK
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
5
|
[](https://travis-ci.com/appwrite/sdk-generator)
|
|
6
6
|
[](https://twitter.com/appwrite)
|
|
7
7
|
[](https://appwrite.io/discord)
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
const promise = functions.create('[FUNCTION_ID]', '[NAME]', 'node-
|
|
14
|
+
const promise = functions.create('[FUNCTION_ID]', '[NAME]', 'node-18.0');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
const promise = functions.update('[FUNCTION_ID]', '[NAME]'
|
|
14
|
+
const promise = functions.update('[FUNCTION_ID]', '[NAME]');
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
|
@@ -11,7 +11,7 @@ client
|
|
|
11
11
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
|
12
12
|
;
|
|
13
13
|
|
|
14
|
-
const promise = teams.createMembership('[TEAM_ID]', []
|
|
14
|
+
const promise = teams.createMembership('[TEAM_ID]', []);
|
|
15
15
|
|
|
16
16
|
promise.then(function (response) {
|
|
17
17
|
console.log(response);
|
package/index.d.ts
CHANGED
|
@@ -3279,7 +3279,7 @@ declare module "node-appwrite" {
|
|
|
3279
3279
|
* @throws {AppwriteException}
|
|
3280
3280
|
* @returns {Promise}
|
|
3281
3281
|
*/
|
|
3282
|
-
update(functionId: string, name: string, runtime
|
|
3282
|
+
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>;
|
|
3283
3283
|
/**
|
|
3284
3284
|
* Delete Function
|
|
3285
3285
|
*
|
|
@@ -4028,15 +4028,15 @@ declare module "node-appwrite" {
|
|
|
4028
4028
|
*
|
|
4029
4029
|
* @param {string} teamId
|
|
4030
4030
|
* @param {string[]} roles
|
|
4031
|
-
* @param {string} url
|
|
4032
4031
|
* @param {string} email
|
|
4033
4032
|
* @param {string} userId
|
|
4034
4033
|
* @param {string} phone
|
|
4034
|
+
* @param {string} url
|
|
4035
4035
|
* @param {string} name
|
|
4036
4036
|
* @throws {AppwriteException}
|
|
4037
4037
|
* @returns {Promise}
|
|
4038
4038
|
*/
|
|
4039
|
-
createMembership(teamId: string, roles: string[],
|
|
4039
|
+
createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
|
|
4040
4040
|
/**
|
|
4041
4041
|
* Get Team Membership
|
|
4042
4042
|
*
|
package/lib/client.js
CHANGED
|
@@ -12,11 +12,11 @@ class Client {
|
|
|
12
12
|
this.headers = {
|
|
13
13
|
'accept-encoding': '*',
|
|
14
14
|
'content-type': '',
|
|
15
|
-
'user-agent' : `AppwriteNodeJSSDK/
|
|
15
|
+
'user-agent' : `AppwriteNodeJSSDK/11.0.0 (${os.type()}; ${os.version()}; ${os.arch()})`,
|
|
16
16
|
'x-sdk-name': 'Node.js',
|
|
17
17
|
'x-sdk-platform': 'server',
|
|
18
18
|
'x-sdk-language': 'nodejs',
|
|
19
|
-
'x-sdk-version': '
|
|
19
|
+
'x-sdk-version': '11.0.0',
|
|
20
20
|
'X-Appwrite-Response-Format' : '1.4.0',
|
|
21
21
|
};
|
|
22
22
|
this.selfSigned = false;
|
|
@@ -247,10 +247,6 @@ class Functions extends Service {
|
|
|
247
247
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
if (typeof runtime === 'undefined') {
|
|
251
|
-
throw new AppwriteException('Missing required parameter: "runtime"');
|
|
252
|
-
}
|
|
253
|
-
|
|
254
250
|
|
|
255
251
|
if (typeof name !== 'undefined') {
|
|
256
252
|
payload['name'] = name;
|
package/lib/services/teams.js
CHANGED
|
@@ -220,15 +220,15 @@ class Teams extends Service {
|
|
|
220
220
|
*
|
|
221
221
|
* @param {string} teamId
|
|
222
222
|
* @param {string[]} roles
|
|
223
|
-
* @param {string} url
|
|
224
223
|
* @param {string} email
|
|
225
224
|
* @param {string} userId
|
|
226
225
|
* @param {string} phone
|
|
226
|
+
* @param {string} url
|
|
227
227
|
* @param {string} name
|
|
228
228
|
* @throws {AppwriteException}
|
|
229
229
|
* @returns {Promise}
|
|
230
230
|
*/
|
|
231
|
-
async createMembership(teamId, roles,
|
|
231
|
+
async createMembership(teamId, roles, email, userId, phone, url, name) {
|
|
232
232
|
const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
|
|
233
233
|
let payload = {};
|
|
234
234
|
if (typeof teamId === 'undefined') {
|
|
@@ -239,10 +239,6 @@ class Teams extends Service {
|
|
|
239
239
|
throw new AppwriteException('Missing required parameter: "roles"');
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
if (typeof url === 'undefined') {
|
|
243
|
-
throw new AppwriteException('Missing required parameter: "url"');
|
|
244
|
-
}
|
|
245
|
-
|
|
246
242
|
|
|
247
243
|
if (typeof email !== 'undefined') {
|
|
248
244
|
payload['email'] = email;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "node-appwrite",
|
|
3
3
|
"homepage": "https://appwrite.io/support",
|
|
4
4
|
"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",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "11.0.0",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./index.d.ts",
|