node-appwrite 15.0.0 → 15.0.1
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/dist/client.js +7 -4
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +7 -4
- package/dist/client.mjs.map +1 -1
- package/dist/models.d.mts +2 -2
- package/dist/models.d.ts +2 -2
- package/dist/services/account.d.mts +0 -86
- package/dist/services/account.d.ts +0 -86
- package/dist/services/account.js +86 -172
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +86 -172
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +0 -14
- package/dist/services/avatars.d.ts +0 -14
- package/dist/services/avatars.js +14 -28
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs +14 -28
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +0 -84
- package/dist/services/databases.d.ts +0 -84
- package/dist/services/databases.js +84 -168
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +84 -168
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +0 -48
- package/dist/services/functions.d.ts +0 -48
- package/dist/services/functions.js +48 -96
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +48 -96
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/graphql.d.mts +0 -4
- package/dist/services/graphql.d.ts +0 -4
- package/dist/services/graphql.js +4 -8
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/graphql.mjs +4 -8
- package/dist/services/graphql.mjs.map +1 -1
- package/dist/services/health.d.mts +0 -46
- package/dist/services/health.d.ts +0 -46
- package/dist/services/health.js +46 -92
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +46 -92
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/locale.d.mts +0 -16
- package/dist/services/locale.d.ts +0 -16
- package/dist/services/locale.js +16 -32
- package/dist/services/locale.js.map +1 -1
- package/dist/services/locale.mjs +16 -32
- package/dist/services/locale.mjs.map +1 -1
- package/dist/services/messaging.d.mts +3 -95
- package/dist/services/messaging.d.ts +3 -95
- package/dist/services/messaging.js +95 -187
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs +95 -187
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/storage.d.mts +0 -26
- package/dist/services/storage.d.ts +0 -26
- package/dist/services/storage.js +26 -52
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +26 -52
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/teams.d.mts +0 -26
- package/dist/services/teams.d.ts +0 -26
- package/dist/services/teams.js +26 -52
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs +26 -52
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/users.d.mts +0 -84
- package/dist/services/users.d.ts +0 -84
- package/dist/services/users.js +84 -168
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +84 -168
- package/dist/services/users.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -7,8 +7,6 @@ class Functions {
|
|
|
7
7
|
this.client = client;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* List functions
|
|
11
|
-
*
|
|
12
10
|
* Get a list of all the project's functions. You can use the query params to filter your results.
|
|
13
11
|
*
|
|
14
12
|
* @param {string[]} queries
|
|
@@ -16,7 +14,7 @@ class Functions {
|
|
|
16
14
|
* @throws {AppwriteException}
|
|
17
15
|
* @returns {Promise<Models.FunctionList>}
|
|
18
16
|
*/
|
|
19
|
-
|
|
17
|
+
list(queries, search) {
|
|
20
18
|
const apiPath = "/functions";
|
|
21
19
|
const payload = {};
|
|
22
20
|
if (typeof queries !== "undefined") {
|
|
@@ -29,7 +27,7 @@ class Functions {
|
|
|
29
27
|
const apiHeaders = {
|
|
30
28
|
"content-type": "application/json"
|
|
31
29
|
};
|
|
32
|
-
return
|
|
30
|
+
return this.client.call(
|
|
33
31
|
"get",
|
|
34
32
|
uri,
|
|
35
33
|
apiHeaders,
|
|
@@ -37,8 +35,6 @@ class Functions {
|
|
|
37
35
|
);
|
|
38
36
|
}
|
|
39
37
|
/**
|
|
40
|
-
* Create function
|
|
41
|
-
*
|
|
42
38
|
* Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
|
|
43
39
|
*
|
|
44
40
|
* @param {string} functionId
|
|
@@ -66,7 +62,7 @@ class Functions {
|
|
|
66
62
|
* @throws {AppwriteException}
|
|
67
63
|
* @returns {Promise<Models.Function>}
|
|
68
64
|
*/
|
|
69
|
-
|
|
65
|
+
create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateVersion, specification) {
|
|
70
66
|
if (typeof functionId === "undefined") {
|
|
71
67
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
72
68
|
}
|
|
@@ -148,7 +144,7 @@ class Functions {
|
|
|
148
144
|
const apiHeaders = {
|
|
149
145
|
"content-type": "application/json"
|
|
150
146
|
};
|
|
151
|
-
return
|
|
147
|
+
return this.client.call(
|
|
152
148
|
"post",
|
|
153
149
|
uri,
|
|
154
150
|
apiHeaders,
|
|
@@ -156,21 +152,19 @@ class Functions {
|
|
|
156
152
|
);
|
|
157
153
|
}
|
|
158
154
|
/**
|
|
159
|
-
* List runtimes
|
|
160
|
-
*
|
|
161
155
|
* Get a list of all runtimes that are currently active on your instance.
|
|
162
156
|
*
|
|
163
157
|
* @throws {AppwriteException}
|
|
164
158
|
* @returns {Promise<Models.RuntimeList>}
|
|
165
159
|
*/
|
|
166
|
-
|
|
160
|
+
listRuntimes() {
|
|
167
161
|
const apiPath = "/functions/runtimes";
|
|
168
162
|
const payload = {};
|
|
169
163
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
170
164
|
const apiHeaders = {
|
|
171
165
|
"content-type": "application/json"
|
|
172
166
|
};
|
|
173
|
-
return
|
|
167
|
+
return this.client.call(
|
|
174
168
|
"get",
|
|
175
169
|
uri,
|
|
176
170
|
apiHeaders,
|
|
@@ -178,22 +172,20 @@ class Functions {
|
|
|
178
172
|
);
|
|
179
173
|
}
|
|
180
174
|
/**
|
|
181
|
-
* List available function runtime specifications
|
|
182
|
-
*
|
|
183
175
|
* List allowed function specifications for this instance.
|
|
184
176
|
|
|
185
177
|
*
|
|
186
178
|
* @throws {AppwriteException}
|
|
187
179
|
* @returns {Promise<Models.SpecificationList>}
|
|
188
180
|
*/
|
|
189
|
-
|
|
181
|
+
listSpecifications() {
|
|
190
182
|
const apiPath = "/functions/specifications";
|
|
191
183
|
const payload = {};
|
|
192
184
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
193
185
|
const apiHeaders = {
|
|
194
186
|
"content-type": "application/json"
|
|
195
187
|
};
|
|
196
|
-
return
|
|
188
|
+
return this.client.call(
|
|
197
189
|
"get",
|
|
198
190
|
uri,
|
|
199
191
|
apiHeaders,
|
|
@@ -201,15 +193,13 @@ class Functions {
|
|
|
201
193
|
);
|
|
202
194
|
}
|
|
203
195
|
/**
|
|
204
|
-
* Get function
|
|
205
|
-
*
|
|
206
196
|
* Get a function by its unique ID.
|
|
207
197
|
*
|
|
208
198
|
* @param {string} functionId
|
|
209
199
|
* @throws {AppwriteException}
|
|
210
200
|
* @returns {Promise<Models.Function>}
|
|
211
201
|
*/
|
|
212
|
-
|
|
202
|
+
get(functionId) {
|
|
213
203
|
if (typeof functionId === "undefined") {
|
|
214
204
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
215
205
|
}
|
|
@@ -219,7 +209,7 @@ class Functions {
|
|
|
219
209
|
const apiHeaders = {
|
|
220
210
|
"content-type": "application/json"
|
|
221
211
|
};
|
|
222
|
-
return
|
|
212
|
+
return this.client.call(
|
|
223
213
|
"get",
|
|
224
214
|
uri,
|
|
225
215
|
apiHeaders,
|
|
@@ -227,8 +217,6 @@ class Functions {
|
|
|
227
217
|
);
|
|
228
218
|
}
|
|
229
219
|
/**
|
|
230
|
-
* Update function
|
|
231
|
-
*
|
|
232
220
|
* Update function by its unique ID.
|
|
233
221
|
*
|
|
234
222
|
* @param {string} functionId
|
|
@@ -252,7 +240,7 @@ class Functions {
|
|
|
252
240
|
* @throws {AppwriteException}
|
|
253
241
|
* @returns {Promise<Models.Function>}
|
|
254
242
|
*/
|
|
255
|
-
|
|
243
|
+
update(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, specification) {
|
|
256
244
|
if (typeof functionId === "undefined") {
|
|
257
245
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
258
246
|
}
|
|
@@ -316,7 +304,7 @@ class Functions {
|
|
|
316
304
|
const apiHeaders = {
|
|
317
305
|
"content-type": "application/json"
|
|
318
306
|
};
|
|
319
|
-
return
|
|
307
|
+
return this.client.call(
|
|
320
308
|
"put",
|
|
321
309
|
uri,
|
|
322
310
|
apiHeaders,
|
|
@@ -324,15 +312,13 @@ class Functions {
|
|
|
324
312
|
);
|
|
325
313
|
}
|
|
326
314
|
/**
|
|
327
|
-
* Delete function
|
|
328
|
-
*
|
|
329
315
|
* Delete a function by its unique ID.
|
|
330
316
|
*
|
|
331
317
|
* @param {string} functionId
|
|
332
318
|
* @throws {AppwriteException}
|
|
333
319
|
* @returns {Promise<{}>}
|
|
334
320
|
*/
|
|
335
|
-
|
|
321
|
+
delete(functionId) {
|
|
336
322
|
if (typeof functionId === "undefined") {
|
|
337
323
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
338
324
|
}
|
|
@@ -342,7 +328,7 @@ class Functions {
|
|
|
342
328
|
const apiHeaders = {
|
|
343
329
|
"content-type": "application/json"
|
|
344
330
|
};
|
|
345
|
-
return
|
|
331
|
+
return this.client.call(
|
|
346
332
|
"delete",
|
|
347
333
|
uri,
|
|
348
334
|
apiHeaders,
|
|
@@ -350,8 +336,6 @@ class Functions {
|
|
|
350
336
|
);
|
|
351
337
|
}
|
|
352
338
|
/**
|
|
353
|
-
* List deployments
|
|
354
|
-
*
|
|
355
339
|
* Get a list of all the project's code deployments. You can use the query params to filter your results.
|
|
356
340
|
*
|
|
357
341
|
* @param {string} functionId
|
|
@@ -360,7 +344,7 @@ class Functions {
|
|
|
360
344
|
* @throws {AppwriteException}
|
|
361
345
|
* @returns {Promise<Models.DeploymentList>}
|
|
362
346
|
*/
|
|
363
|
-
|
|
347
|
+
listDeployments(functionId, queries, search) {
|
|
364
348
|
if (typeof functionId === "undefined") {
|
|
365
349
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
366
350
|
}
|
|
@@ -376,7 +360,7 @@ class Functions {
|
|
|
376
360
|
const apiHeaders = {
|
|
377
361
|
"content-type": "application/json"
|
|
378
362
|
};
|
|
379
|
-
return
|
|
363
|
+
return this.client.call(
|
|
380
364
|
"get",
|
|
381
365
|
uri,
|
|
382
366
|
apiHeaders,
|
|
@@ -384,8 +368,6 @@ class Functions {
|
|
|
384
368
|
);
|
|
385
369
|
}
|
|
386
370
|
/**
|
|
387
|
-
* Create deployment
|
|
388
|
-
*
|
|
389
371
|
* Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
|
|
390
372
|
|
|
391
373
|
This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
|
|
@@ -400,7 +382,7 @@ class Functions {
|
|
|
400
382
|
* @throws {AppwriteException}
|
|
401
383
|
* @returns {Promise<Models.Deployment>}
|
|
402
384
|
*/
|
|
403
|
-
|
|
385
|
+
createDeployment(functionId, code, activate, entrypoint, commands, onProgress = (progress) => {
|
|
404
386
|
}) {
|
|
405
387
|
if (typeof functionId === "undefined") {
|
|
406
388
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -429,7 +411,7 @@ class Functions {
|
|
|
429
411
|
const apiHeaders = {
|
|
430
412
|
"content-type": "multipart/form-data"
|
|
431
413
|
};
|
|
432
|
-
return
|
|
414
|
+
return this.client.chunkedUpload(
|
|
433
415
|
"post",
|
|
434
416
|
uri,
|
|
435
417
|
apiHeaders,
|
|
@@ -438,8 +420,6 @@ class Functions {
|
|
|
438
420
|
);
|
|
439
421
|
}
|
|
440
422
|
/**
|
|
441
|
-
* Get deployment
|
|
442
|
-
*
|
|
443
423
|
* Get a code deployment by its unique ID.
|
|
444
424
|
*
|
|
445
425
|
* @param {string} functionId
|
|
@@ -447,7 +427,7 @@ class Functions {
|
|
|
447
427
|
* @throws {AppwriteException}
|
|
448
428
|
* @returns {Promise<Models.Deployment>}
|
|
449
429
|
*/
|
|
450
|
-
|
|
430
|
+
getDeployment(functionId, deploymentId) {
|
|
451
431
|
if (typeof functionId === "undefined") {
|
|
452
432
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
453
433
|
}
|
|
@@ -460,7 +440,7 @@ class Functions {
|
|
|
460
440
|
const apiHeaders = {
|
|
461
441
|
"content-type": "application/json"
|
|
462
442
|
};
|
|
463
|
-
return
|
|
443
|
+
return this.client.call(
|
|
464
444
|
"get",
|
|
465
445
|
uri,
|
|
466
446
|
apiHeaders,
|
|
@@ -468,8 +448,6 @@ class Functions {
|
|
|
468
448
|
);
|
|
469
449
|
}
|
|
470
450
|
/**
|
|
471
|
-
* Update deployment
|
|
472
|
-
*
|
|
473
451
|
* Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.
|
|
474
452
|
*
|
|
475
453
|
* @param {string} functionId
|
|
@@ -477,7 +455,7 @@ class Functions {
|
|
|
477
455
|
* @throws {AppwriteException}
|
|
478
456
|
* @returns {Promise<Models.Function>}
|
|
479
457
|
*/
|
|
480
|
-
|
|
458
|
+
updateDeployment(functionId, deploymentId) {
|
|
481
459
|
if (typeof functionId === "undefined") {
|
|
482
460
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
483
461
|
}
|
|
@@ -490,7 +468,7 @@ class Functions {
|
|
|
490
468
|
const apiHeaders = {
|
|
491
469
|
"content-type": "application/json"
|
|
492
470
|
};
|
|
493
|
-
return
|
|
471
|
+
return this.client.call(
|
|
494
472
|
"patch",
|
|
495
473
|
uri,
|
|
496
474
|
apiHeaders,
|
|
@@ -498,8 +476,6 @@ class Functions {
|
|
|
498
476
|
);
|
|
499
477
|
}
|
|
500
478
|
/**
|
|
501
|
-
* Delete deployment
|
|
502
|
-
*
|
|
503
479
|
* Delete a code deployment by its unique ID.
|
|
504
480
|
*
|
|
505
481
|
* @param {string} functionId
|
|
@@ -507,7 +483,7 @@ class Functions {
|
|
|
507
483
|
* @throws {AppwriteException}
|
|
508
484
|
* @returns {Promise<{}>}
|
|
509
485
|
*/
|
|
510
|
-
|
|
486
|
+
deleteDeployment(functionId, deploymentId) {
|
|
511
487
|
if (typeof functionId === "undefined") {
|
|
512
488
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
513
489
|
}
|
|
@@ -520,7 +496,7 @@ class Functions {
|
|
|
520
496
|
const apiHeaders = {
|
|
521
497
|
"content-type": "application/json"
|
|
522
498
|
};
|
|
523
|
-
return
|
|
499
|
+
return this.client.call(
|
|
524
500
|
"delete",
|
|
525
501
|
uri,
|
|
526
502
|
apiHeaders,
|
|
@@ -528,8 +504,6 @@ class Functions {
|
|
|
528
504
|
);
|
|
529
505
|
}
|
|
530
506
|
/**
|
|
531
|
-
* Rebuild deployment
|
|
532
|
-
*
|
|
533
507
|
* Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
|
534
508
|
*
|
|
535
509
|
* @param {string} functionId
|
|
@@ -538,7 +512,7 @@ class Functions {
|
|
|
538
512
|
* @throws {AppwriteException}
|
|
539
513
|
* @returns {Promise<{}>}
|
|
540
514
|
*/
|
|
541
|
-
|
|
515
|
+
createBuild(functionId, deploymentId, buildId) {
|
|
542
516
|
if (typeof functionId === "undefined") {
|
|
543
517
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
544
518
|
}
|
|
@@ -554,7 +528,7 @@ class Functions {
|
|
|
554
528
|
const apiHeaders = {
|
|
555
529
|
"content-type": "application/json"
|
|
556
530
|
};
|
|
557
|
-
return
|
|
531
|
+
return this.client.call(
|
|
558
532
|
"post",
|
|
559
533
|
uri,
|
|
560
534
|
apiHeaders,
|
|
@@ -562,8 +536,6 @@ class Functions {
|
|
|
562
536
|
);
|
|
563
537
|
}
|
|
564
538
|
/**
|
|
565
|
-
* Cancel deployment
|
|
566
|
-
*
|
|
567
539
|
* Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
|
568
540
|
*
|
|
569
541
|
* @param {string} functionId
|
|
@@ -571,7 +543,7 @@ class Functions {
|
|
|
571
543
|
* @throws {AppwriteException}
|
|
572
544
|
* @returns {Promise<Models.Build>}
|
|
573
545
|
*/
|
|
574
|
-
|
|
546
|
+
updateDeploymentBuild(functionId, deploymentId) {
|
|
575
547
|
if (typeof functionId === "undefined") {
|
|
576
548
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
577
549
|
}
|
|
@@ -584,7 +556,7 @@ class Functions {
|
|
|
584
556
|
const apiHeaders = {
|
|
585
557
|
"content-type": "application/json"
|
|
586
558
|
};
|
|
587
|
-
return
|
|
559
|
+
return this.client.call(
|
|
588
560
|
"patch",
|
|
589
561
|
uri,
|
|
590
562
|
apiHeaders,
|
|
@@ -592,8 +564,6 @@ class Functions {
|
|
|
592
564
|
);
|
|
593
565
|
}
|
|
594
566
|
/**
|
|
595
|
-
* Download deployment
|
|
596
|
-
*
|
|
597
567
|
* Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download.
|
|
598
568
|
*
|
|
599
569
|
* @param {string} functionId
|
|
@@ -601,7 +571,7 @@ class Functions {
|
|
|
601
571
|
* @throws {AppwriteException}
|
|
602
572
|
* @returns {Promise<ArrayBuffer>}
|
|
603
573
|
*/
|
|
604
|
-
|
|
574
|
+
getDeploymentDownload(functionId, deploymentId) {
|
|
605
575
|
if (typeof functionId === "undefined") {
|
|
606
576
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
607
577
|
}
|
|
@@ -614,7 +584,7 @@ class Functions {
|
|
|
614
584
|
const apiHeaders = {
|
|
615
585
|
"content-type": "application/json"
|
|
616
586
|
};
|
|
617
|
-
return
|
|
587
|
+
return this.client.call(
|
|
618
588
|
"get",
|
|
619
589
|
uri,
|
|
620
590
|
apiHeaders,
|
|
@@ -623,8 +593,6 @@ class Functions {
|
|
|
623
593
|
);
|
|
624
594
|
}
|
|
625
595
|
/**
|
|
626
|
-
* List executions
|
|
627
|
-
*
|
|
628
596
|
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
|
629
597
|
*
|
|
630
598
|
* @param {string} functionId
|
|
@@ -633,7 +601,7 @@ class Functions {
|
|
|
633
601
|
* @throws {AppwriteException}
|
|
634
602
|
* @returns {Promise<Models.ExecutionList>}
|
|
635
603
|
*/
|
|
636
|
-
|
|
604
|
+
listExecutions(functionId, queries, search) {
|
|
637
605
|
if (typeof functionId === "undefined") {
|
|
638
606
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
639
607
|
}
|
|
@@ -649,7 +617,7 @@ class Functions {
|
|
|
649
617
|
const apiHeaders = {
|
|
650
618
|
"content-type": "application/json"
|
|
651
619
|
};
|
|
652
|
-
return
|
|
620
|
+
return this.client.call(
|
|
653
621
|
"get",
|
|
654
622
|
uri,
|
|
655
623
|
apiHeaders,
|
|
@@ -657,8 +625,6 @@ class Functions {
|
|
|
657
625
|
);
|
|
658
626
|
}
|
|
659
627
|
/**
|
|
660
|
-
* Create execution
|
|
661
|
-
*
|
|
662
628
|
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
|
663
629
|
*
|
|
664
630
|
* @param {string} functionId
|
|
@@ -671,7 +637,7 @@ class Functions {
|
|
|
671
637
|
* @throws {AppwriteException}
|
|
672
638
|
* @returns {Promise<Models.Execution>}
|
|
673
639
|
*/
|
|
674
|
-
|
|
640
|
+
createExecution(functionId, body, async, xpath, method, headers, scheduledAt) {
|
|
675
641
|
if (typeof functionId === "undefined") {
|
|
676
642
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
677
643
|
}
|
|
@@ -699,7 +665,7 @@ class Functions {
|
|
|
699
665
|
const apiHeaders = {
|
|
700
666
|
"content-type": "application/json"
|
|
701
667
|
};
|
|
702
|
-
return
|
|
668
|
+
return this.client.call(
|
|
703
669
|
"post",
|
|
704
670
|
uri,
|
|
705
671
|
apiHeaders,
|
|
@@ -707,8 +673,6 @@ class Functions {
|
|
|
707
673
|
);
|
|
708
674
|
}
|
|
709
675
|
/**
|
|
710
|
-
* Get execution
|
|
711
|
-
*
|
|
712
676
|
* Get a function execution log by its unique ID.
|
|
713
677
|
*
|
|
714
678
|
* @param {string} functionId
|
|
@@ -716,7 +680,7 @@ class Functions {
|
|
|
716
680
|
* @throws {AppwriteException}
|
|
717
681
|
* @returns {Promise<Models.Execution>}
|
|
718
682
|
*/
|
|
719
|
-
|
|
683
|
+
getExecution(functionId, executionId) {
|
|
720
684
|
if (typeof functionId === "undefined") {
|
|
721
685
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
722
686
|
}
|
|
@@ -729,7 +693,7 @@ class Functions {
|
|
|
729
693
|
const apiHeaders = {
|
|
730
694
|
"content-type": "application/json"
|
|
731
695
|
};
|
|
732
|
-
return
|
|
696
|
+
return this.client.call(
|
|
733
697
|
"get",
|
|
734
698
|
uri,
|
|
735
699
|
apiHeaders,
|
|
@@ -737,8 +701,6 @@ class Functions {
|
|
|
737
701
|
);
|
|
738
702
|
}
|
|
739
703
|
/**
|
|
740
|
-
* Delete execution
|
|
741
|
-
*
|
|
742
704
|
* Delete a function execution by its unique ID.
|
|
743
705
|
|
|
744
706
|
*
|
|
@@ -747,7 +709,7 @@ class Functions {
|
|
|
747
709
|
* @throws {AppwriteException}
|
|
748
710
|
* @returns {Promise<{}>}
|
|
749
711
|
*/
|
|
750
|
-
|
|
712
|
+
deleteExecution(functionId, executionId) {
|
|
751
713
|
if (typeof functionId === "undefined") {
|
|
752
714
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
753
715
|
}
|
|
@@ -760,7 +722,7 @@ class Functions {
|
|
|
760
722
|
const apiHeaders = {
|
|
761
723
|
"content-type": "application/json"
|
|
762
724
|
};
|
|
763
|
-
return
|
|
725
|
+
return this.client.call(
|
|
764
726
|
"delete",
|
|
765
727
|
uri,
|
|
766
728
|
apiHeaders,
|
|
@@ -768,15 +730,13 @@ class Functions {
|
|
|
768
730
|
);
|
|
769
731
|
}
|
|
770
732
|
/**
|
|
771
|
-
* List variables
|
|
772
|
-
*
|
|
773
733
|
* Get a list of all variables of a specific function.
|
|
774
734
|
*
|
|
775
735
|
* @param {string} functionId
|
|
776
736
|
* @throws {AppwriteException}
|
|
777
737
|
* @returns {Promise<Models.VariableList>}
|
|
778
738
|
*/
|
|
779
|
-
|
|
739
|
+
listVariables(functionId) {
|
|
780
740
|
if (typeof functionId === "undefined") {
|
|
781
741
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
782
742
|
}
|
|
@@ -786,7 +746,7 @@ class Functions {
|
|
|
786
746
|
const apiHeaders = {
|
|
787
747
|
"content-type": "application/json"
|
|
788
748
|
};
|
|
789
|
-
return
|
|
749
|
+
return this.client.call(
|
|
790
750
|
"get",
|
|
791
751
|
uri,
|
|
792
752
|
apiHeaders,
|
|
@@ -794,8 +754,6 @@ class Functions {
|
|
|
794
754
|
);
|
|
795
755
|
}
|
|
796
756
|
/**
|
|
797
|
-
* Create variable
|
|
798
|
-
*
|
|
799
757
|
* Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
|
|
800
758
|
*
|
|
801
759
|
* @param {string} functionId
|
|
@@ -804,7 +762,7 @@ class Functions {
|
|
|
804
762
|
* @throws {AppwriteException}
|
|
805
763
|
* @returns {Promise<Models.Variable>}
|
|
806
764
|
*/
|
|
807
|
-
|
|
765
|
+
createVariable(functionId, key, value) {
|
|
808
766
|
if (typeof functionId === "undefined") {
|
|
809
767
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
810
768
|
}
|
|
@@ -826,7 +784,7 @@ class Functions {
|
|
|
826
784
|
const apiHeaders = {
|
|
827
785
|
"content-type": "application/json"
|
|
828
786
|
};
|
|
829
|
-
return
|
|
787
|
+
return this.client.call(
|
|
830
788
|
"post",
|
|
831
789
|
uri,
|
|
832
790
|
apiHeaders,
|
|
@@ -834,8 +792,6 @@ class Functions {
|
|
|
834
792
|
);
|
|
835
793
|
}
|
|
836
794
|
/**
|
|
837
|
-
* Get variable
|
|
838
|
-
*
|
|
839
795
|
* Get a variable by its unique ID.
|
|
840
796
|
*
|
|
841
797
|
* @param {string} functionId
|
|
@@ -843,7 +799,7 @@ class Functions {
|
|
|
843
799
|
* @throws {AppwriteException}
|
|
844
800
|
* @returns {Promise<Models.Variable>}
|
|
845
801
|
*/
|
|
846
|
-
|
|
802
|
+
getVariable(functionId, variableId) {
|
|
847
803
|
if (typeof functionId === "undefined") {
|
|
848
804
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
849
805
|
}
|
|
@@ -856,7 +812,7 @@ class Functions {
|
|
|
856
812
|
const apiHeaders = {
|
|
857
813
|
"content-type": "application/json"
|
|
858
814
|
};
|
|
859
|
-
return
|
|
815
|
+
return this.client.call(
|
|
860
816
|
"get",
|
|
861
817
|
uri,
|
|
862
818
|
apiHeaders,
|
|
@@ -864,8 +820,6 @@ class Functions {
|
|
|
864
820
|
);
|
|
865
821
|
}
|
|
866
822
|
/**
|
|
867
|
-
* Update variable
|
|
868
|
-
*
|
|
869
823
|
* Update variable by its unique ID.
|
|
870
824
|
*
|
|
871
825
|
* @param {string} functionId
|
|
@@ -875,7 +829,7 @@ class Functions {
|
|
|
875
829
|
* @throws {AppwriteException}
|
|
876
830
|
* @returns {Promise<Models.Variable>}
|
|
877
831
|
*/
|
|
878
|
-
|
|
832
|
+
updateVariable(functionId, variableId, key, value) {
|
|
879
833
|
if (typeof functionId === "undefined") {
|
|
880
834
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
881
835
|
}
|
|
@@ -897,7 +851,7 @@ class Functions {
|
|
|
897
851
|
const apiHeaders = {
|
|
898
852
|
"content-type": "application/json"
|
|
899
853
|
};
|
|
900
|
-
return
|
|
854
|
+
return this.client.call(
|
|
901
855
|
"put",
|
|
902
856
|
uri,
|
|
903
857
|
apiHeaders,
|
|
@@ -905,8 +859,6 @@ class Functions {
|
|
|
905
859
|
);
|
|
906
860
|
}
|
|
907
861
|
/**
|
|
908
|
-
* Delete variable
|
|
909
|
-
*
|
|
910
862
|
* Delete a variable by its unique ID.
|
|
911
863
|
*
|
|
912
864
|
* @param {string} functionId
|
|
@@ -914,7 +866,7 @@ class Functions {
|
|
|
914
866
|
* @throws {AppwriteException}
|
|
915
867
|
* @returns {Promise<{}>}
|
|
916
868
|
*/
|
|
917
|
-
|
|
869
|
+
deleteVariable(functionId, variableId) {
|
|
918
870
|
if (typeof functionId === "undefined") {
|
|
919
871
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
920
872
|
}
|
|
@@ -927,7 +879,7 @@ class Functions {
|
|
|
927
879
|
const apiHeaders = {
|
|
928
880
|
"content-type": "application/json"
|
|
929
881
|
};
|
|
930
|
-
return
|
|
882
|
+
return this.client.call(
|
|
931
883
|
"delete",
|
|
932
884
|
uri,
|
|
933
885
|
apiHeaders,
|