node-appwrite 16.0.0 → 17.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 +2 -2
- package/dist/client.js +3 -3
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +3 -3
- package/dist/client.mjs.map +1 -1
- package/dist/enums/adapter.d.mts +6 -0
- package/dist/enums/adapter.d.ts +6 -0
- package/dist/enums/adapter.js +11 -0
- package/dist/enums/adapter.js.map +1 -0
- package/dist/enums/adapter.mjs +10 -0
- package/dist/enums/adapter.mjs.map +1 -0
- package/dist/enums/build-runtime.d.mts +67 -0
- package/dist/enums/build-runtime.d.ts +67 -0
- package/dist/enums/build-runtime.js +72 -0
- package/dist/enums/build-runtime.js.map +1 -0
- package/dist/enums/build-runtime.mjs +71 -0
- package/dist/enums/build-runtime.mjs.map +1 -0
- package/dist/enums/deployment-download-type.d.mts +6 -0
- package/dist/enums/deployment-download-type.d.ts +6 -0
- package/dist/enums/deployment-download-type.js +11 -0
- package/dist/enums/deployment-download-type.js.map +1 -0
- package/dist/enums/deployment-download-type.mjs +10 -0
- package/dist/enums/deployment-download-type.mjs.map +1 -0
- package/dist/enums/framework.d.mts +18 -0
- package/dist/enums/framework.d.ts +18 -0
- package/dist/enums/framework.js +23 -0
- package/dist/enums/framework.js.map +1 -0
- package/dist/enums/framework.mjs +22 -0
- package/dist/enums/framework.mjs.map +1 -0
- package/dist/enums/image-format.d.mts +0 -1
- package/dist/enums/image-format.d.ts +0 -1
- package/dist/enums/image-format.js +0 -1
- package/dist/enums/image-format.js.map +1 -1
- package/dist/enums/image-format.mjs +0 -1
- package/dist/enums/image-format.mjs.map +1 -1
- package/dist/enums/runtime.d.mts +5 -1
- package/dist/enums/runtime.d.ts +5 -1
- package/dist/enums/runtime.js +4 -0
- package/dist/enums/runtime.js.map +1 -1
- package/dist/enums/runtime.mjs +4 -0
- package/dist/enums/runtime.mjs.map +1 -1
- package/dist/enums/v-c-s-deployment-type.d.mts +7 -0
- package/dist/enums/v-c-s-deployment-type.d.ts +7 -0
- package/dist/enums/v-c-s-deployment-type.js +12 -0
- package/dist/enums/v-c-s-deployment-type.js.map +1 -0
- package/dist/enums/v-c-s-deployment-type.mjs +11 -0
- package/dist/enums/v-c-s-deployment-type.mjs.map +1 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +286 -48
- package/dist/models.d.ts +286 -48
- package/dist/services/databases.d.mts +44 -2
- package/dist/services/databases.d.ts +44 -2
- package/dist/services/databases.js +151 -12
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +151 -12
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +56 -30
- package/dist/services/functions.d.ts +56 -30
- package/dist/services/functions.js +185 -87
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +185 -87
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/sites.d.mts +286 -0
- package/dist/services/sites.d.ts +286 -0
- package/dist/services/sites.js +923 -0
- package/dist/services/sites.js.map +1 -0
- package/dist/services/sites.mjs +922 -0
- package/dist/services/sites.mjs.map +1 -0
- package/dist/services/storage.d.mts +6 -3
- package/dist/services/storage.d.ts +6 -3
- package/dist/services/storage.js +15 -3
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +15 -3
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/tokens.d.mts +55 -0
- package/dist/services/tokens.d.ts +55 -0
- package/dist/services/tokens.js +149 -0
- package/dist/services/tokens.js.map +1 -0
- package/dist/services/tokens.mjs +148 -0
- package/dist/services/tokens.mjs.map +1 -0
- package/dist/services/users.d.mts +3 -1
- package/dist/services/users.d.ts +3 -1
- package/dist/services/users.js +9 -1
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +9 -1
- package/dist/services/users.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -52,15 +52,11 @@ class Functions {
|
|
|
52
52
|
* @param {string} providerBranch
|
|
53
53
|
* @param {boolean} providerSilentMode
|
|
54
54
|
* @param {string} providerRootDirectory
|
|
55
|
-
* @param {string} templateRepository
|
|
56
|
-
* @param {string} templateOwner
|
|
57
|
-
* @param {string} templateRootDirectory
|
|
58
|
-
* @param {string} templateVersion
|
|
59
55
|
* @param {string} specification
|
|
60
56
|
* @throws {AppwriteException}
|
|
61
57
|
* @returns {Promise<Models.Function>}
|
|
62
58
|
*/
|
|
63
|
-
create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory,
|
|
59
|
+
create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, specification) {
|
|
64
60
|
if (typeof functionId === "undefined") {
|
|
65
61
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
66
62
|
}
|
|
@@ -123,18 +119,6 @@ class Functions {
|
|
|
123
119
|
if (typeof providerRootDirectory !== "undefined") {
|
|
124
120
|
payload["providerRootDirectory"] = providerRootDirectory;
|
|
125
121
|
}
|
|
126
|
-
if (typeof templateRepository !== "undefined") {
|
|
127
|
-
payload["templateRepository"] = templateRepository;
|
|
128
|
-
}
|
|
129
|
-
if (typeof templateOwner !== "undefined") {
|
|
130
|
-
payload["templateOwner"] = templateOwner;
|
|
131
|
-
}
|
|
132
|
-
if (typeof templateRootDirectory !== "undefined") {
|
|
133
|
-
payload["templateRootDirectory"] = templateRootDirectory;
|
|
134
|
-
}
|
|
135
|
-
if (typeof templateVersion !== "undefined") {
|
|
136
|
-
payload["templateVersion"] = templateVersion;
|
|
137
|
-
}
|
|
138
122
|
if (typeof specification !== "undefined") {
|
|
139
123
|
payload["specification"] = specification;
|
|
140
124
|
}
|
|
@@ -168,12 +152,11 @@ class Functions {
|
|
|
168
152
|
);
|
|
169
153
|
}
|
|
170
154
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
*/
|
|
155
|
+
* List allowed function specifications for this instance.
|
|
156
|
+
*
|
|
157
|
+
* @throws {AppwriteException}
|
|
158
|
+
* @returns {Promise<Models.SpecificationList>}
|
|
159
|
+
*/
|
|
177
160
|
listSpecifications() {
|
|
178
161
|
const apiPath = "/functions/specifications";
|
|
179
162
|
const payload = {};
|
|
@@ -328,7 +311,38 @@ class Functions {
|
|
|
328
311
|
);
|
|
329
312
|
}
|
|
330
313
|
/**
|
|
331
|
-
*
|
|
314
|
+
* Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
|
|
315
|
+
*
|
|
316
|
+
* @param {string} functionId
|
|
317
|
+
* @param {string} deploymentId
|
|
318
|
+
* @throws {AppwriteException}
|
|
319
|
+
* @returns {Promise<Models.Function>}
|
|
320
|
+
*/
|
|
321
|
+
updateFunctionDeployment(functionId, deploymentId) {
|
|
322
|
+
if (typeof functionId === "undefined") {
|
|
323
|
+
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
324
|
+
}
|
|
325
|
+
if (typeof deploymentId === "undefined") {
|
|
326
|
+
throw new client.AppwriteException('Missing required parameter: "deploymentId"');
|
|
327
|
+
}
|
|
328
|
+
const apiPath = "/functions/{functionId}/deployment".replace("{functionId}", functionId);
|
|
329
|
+
const payload = {};
|
|
330
|
+
if (typeof deploymentId !== "undefined") {
|
|
331
|
+
payload["deploymentId"] = deploymentId;
|
|
332
|
+
}
|
|
333
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
334
|
+
const apiHeaders = {
|
|
335
|
+
"content-type": "application/json"
|
|
336
|
+
};
|
|
337
|
+
return this.client.call(
|
|
338
|
+
"patch",
|
|
339
|
+
uri,
|
|
340
|
+
apiHeaders,
|
|
341
|
+
payload
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Get a list of all the function's code deployments. You can use the query params to filter your results.
|
|
332
346
|
*
|
|
333
347
|
* @param {string} functionId
|
|
334
348
|
* @param {string[]} queries
|
|
@@ -410,156 +424,206 @@ class Functions {
|
|
|
410
424
|
);
|
|
411
425
|
}
|
|
412
426
|
/**
|
|
413
|
-
*
|
|
427
|
+
* 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.
|
|
414
428
|
*
|
|
415
429
|
* @param {string} functionId
|
|
416
430
|
* @param {string} deploymentId
|
|
431
|
+
* @param {string} buildId
|
|
417
432
|
* @throws {AppwriteException}
|
|
418
433
|
* @returns {Promise<Models.Deployment>}
|
|
419
434
|
*/
|
|
420
|
-
|
|
435
|
+
createDuplicateDeployment(functionId, deploymentId, buildId) {
|
|
421
436
|
if (typeof functionId === "undefined") {
|
|
422
437
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
423
438
|
}
|
|
424
439
|
if (typeof deploymentId === "undefined") {
|
|
425
440
|
throw new client.AppwriteException('Missing required parameter: "deploymentId"');
|
|
426
441
|
}
|
|
427
|
-
const apiPath = "/functions/{functionId}/deployments/
|
|
442
|
+
const apiPath = "/functions/{functionId}/deployments/duplicate".replace("{functionId}", functionId);
|
|
428
443
|
const payload = {};
|
|
444
|
+
if (typeof deploymentId !== "undefined") {
|
|
445
|
+
payload["deploymentId"] = deploymentId;
|
|
446
|
+
}
|
|
447
|
+
if (typeof buildId !== "undefined") {
|
|
448
|
+
payload["buildId"] = buildId;
|
|
449
|
+
}
|
|
429
450
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
430
|
-
const apiHeaders = {
|
|
451
|
+
const apiHeaders = {
|
|
452
|
+
"content-type": "application/json"
|
|
453
|
+
};
|
|
431
454
|
return this.client.call(
|
|
432
|
-
"
|
|
455
|
+
"post",
|
|
433
456
|
uri,
|
|
434
457
|
apiHeaders,
|
|
435
458
|
payload
|
|
436
459
|
);
|
|
437
460
|
}
|
|
438
461
|
/**
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
462
|
+
* Create a deployment based on a template.
|
|
463
|
+
|
|
464
|
+
Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details.
|
|
465
|
+
*
|
|
466
|
+
* @param {string} functionId
|
|
467
|
+
* @param {string} repository
|
|
468
|
+
* @param {string} owner
|
|
469
|
+
* @param {string} rootDirectory
|
|
470
|
+
* @param {string} version
|
|
471
|
+
* @param {boolean} activate
|
|
472
|
+
* @throws {AppwriteException}
|
|
473
|
+
* @returns {Promise<Models.Deployment>}
|
|
474
|
+
*/
|
|
475
|
+
createTemplateDeployment(functionId, repository, owner, rootDirectory, version, activate) {
|
|
447
476
|
if (typeof functionId === "undefined") {
|
|
448
477
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
449
478
|
}
|
|
450
|
-
if (typeof
|
|
451
|
-
throw new client.AppwriteException('Missing required parameter: "
|
|
479
|
+
if (typeof repository === "undefined") {
|
|
480
|
+
throw new client.AppwriteException('Missing required parameter: "repository"');
|
|
452
481
|
}
|
|
453
|
-
|
|
482
|
+
if (typeof owner === "undefined") {
|
|
483
|
+
throw new client.AppwriteException('Missing required parameter: "owner"');
|
|
484
|
+
}
|
|
485
|
+
if (typeof rootDirectory === "undefined") {
|
|
486
|
+
throw new client.AppwriteException('Missing required parameter: "rootDirectory"');
|
|
487
|
+
}
|
|
488
|
+
if (typeof version === "undefined") {
|
|
489
|
+
throw new client.AppwriteException('Missing required parameter: "version"');
|
|
490
|
+
}
|
|
491
|
+
const apiPath = "/functions/{functionId}/deployments/template".replace("{functionId}", functionId);
|
|
454
492
|
const payload = {};
|
|
493
|
+
if (typeof repository !== "undefined") {
|
|
494
|
+
payload["repository"] = repository;
|
|
495
|
+
}
|
|
496
|
+
if (typeof owner !== "undefined") {
|
|
497
|
+
payload["owner"] = owner;
|
|
498
|
+
}
|
|
499
|
+
if (typeof rootDirectory !== "undefined") {
|
|
500
|
+
payload["rootDirectory"] = rootDirectory;
|
|
501
|
+
}
|
|
502
|
+
if (typeof version !== "undefined") {
|
|
503
|
+
payload["version"] = version;
|
|
504
|
+
}
|
|
505
|
+
if (typeof activate !== "undefined") {
|
|
506
|
+
payload["activate"] = activate;
|
|
507
|
+
}
|
|
455
508
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
456
509
|
const apiHeaders = {
|
|
457
510
|
"content-type": "application/json"
|
|
458
511
|
};
|
|
459
512
|
return this.client.call(
|
|
460
|
-
"
|
|
513
|
+
"post",
|
|
461
514
|
uri,
|
|
462
515
|
apiHeaders,
|
|
463
516
|
payload
|
|
464
517
|
);
|
|
465
518
|
}
|
|
466
519
|
/**
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
520
|
+
* Create a deployment when a function is connected to VCS.
|
|
521
|
+
|
|
522
|
+
This endpoint lets you create deployment from a branch, commit, or a tag.
|
|
523
|
+
*
|
|
524
|
+
* @param {string} functionId
|
|
525
|
+
* @param {VCSDeploymentType} type
|
|
526
|
+
* @param {string} reference
|
|
527
|
+
* @param {boolean} activate
|
|
528
|
+
* @throws {AppwriteException}
|
|
529
|
+
* @returns {Promise<Models.Deployment>}
|
|
530
|
+
*/
|
|
531
|
+
createVcsDeployment(functionId, type, reference, activate) {
|
|
475
532
|
if (typeof functionId === "undefined") {
|
|
476
533
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
477
534
|
}
|
|
478
|
-
if (typeof
|
|
479
|
-
throw new client.AppwriteException('Missing required parameter: "
|
|
535
|
+
if (typeof type === "undefined") {
|
|
536
|
+
throw new client.AppwriteException('Missing required parameter: "type"');
|
|
480
537
|
}
|
|
481
|
-
|
|
538
|
+
if (typeof reference === "undefined") {
|
|
539
|
+
throw new client.AppwriteException('Missing required parameter: "reference"');
|
|
540
|
+
}
|
|
541
|
+
const apiPath = "/functions/{functionId}/deployments/vcs".replace("{functionId}", functionId);
|
|
482
542
|
const payload = {};
|
|
543
|
+
if (typeof type !== "undefined") {
|
|
544
|
+
payload["type"] = type;
|
|
545
|
+
}
|
|
546
|
+
if (typeof reference !== "undefined") {
|
|
547
|
+
payload["reference"] = reference;
|
|
548
|
+
}
|
|
549
|
+
if (typeof activate !== "undefined") {
|
|
550
|
+
payload["activate"] = activate;
|
|
551
|
+
}
|
|
483
552
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
484
553
|
const apiHeaders = {
|
|
485
554
|
"content-type": "application/json"
|
|
486
555
|
};
|
|
487
556
|
return this.client.call(
|
|
488
|
-
"
|
|
557
|
+
"post",
|
|
489
558
|
uri,
|
|
490
559
|
apiHeaders,
|
|
491
560
|
payload
|
|
492
561
|
);
|
|
493
562
|
}
|
|
494
563
|
/**
|
|
495
|
-
*
|
|
564
|
+
* Get a function deployment by its unique ID.
|
|
496
565
|
*
|
|
497
566
|
* @param {string} functionId
|
|
498
567
|
* @param {string} deploymentId
|
|
499
|
-
* @param {string} buildId
|
|
500
568
|
* @throws {AppwriteException}
|
|
501
|
-
* @returns {Promise<
|
|
569
|
+
* @returns {Promise<Models.Deployment>}
|
|
502
570
|
*/
|
|
503
|
-
|
|
571
|
+
getDeployment(functionId, deploymentId) {
|
|
504
572
|
if (typeof functionId === "undefined") {
|
|
505
573
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
506
574
|
}
|
|
507
575
|
if (typeof deploymentId === "undefined") {
|
|
508
576
|
throw new client.AppwriteException('Missing required parameter: "deploymentId"');
|
|
509
577
|
}
|
|
510
|
-
const apiPath = "/functions/{functionId}/deployments/{deploymentId}
|
|
578
|
+
const apiPath = "/functions/{functionId}/deployments/{deploymentId}".replace("{functionId}", functionId).replace("{deploymentId}", deploymentId);
|
|
511
579
|
const payload = {};
|
|
512
|
-
if (typeof buildId !== "undefined") {
|
|
513
|
-
payload["buildId"] = buildId;
|
|
514
|
-
}
|
|
515
580
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
516
|
-
const apiHeaders = {
|
|
517
|
-
"content-type": "application/json"
|
|
518
|
-
};
|
|
581
|
+
const apiHeaders = {};
|
|
519
582
|
return this.client.call(
|
|
520
|
-
"
|
|
583
|
+
"get",
|
|
521
584
|
uri,
|
|
522
585
|
apiHeaders,
|
|
523
586
|
payload
|
|
524
587
|
);
|
|
525
588
|
}
|
|
526
589
|
/**
|
|
527
|
-
*
|
|
590
|
+
* Delete a code deployment by its unique ID.
|
|
528
591
|
*
|
|
529
592
|
* @param {string} functionId
|
|
530
593
|
* @param {string} deploymentId
|
|
531
594
|
* @throws {AppwriteException}
|
|
532
|
-
* @returns {Promise<
|
|
595
|
+
* @returns {Promise<{}>}
|
|
533
596
|
*/
|
|
534
|
-
|
|
597
|
+
deleteDeployment(functionId, deploymentId) {
|
|
535
598
|
if (typeof functionId === "undefined") {
|
|
536
599
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
537
600
|
}
|
|
538
601
|
if (typeof deploymentId === "undefined") {
|
|
539
602
|
throw new client.AppwriteException('Missing required parameter: "deploymentId"');
|
|
540
603
|
}
|
|
541
|
-
const apiPath = "/functions/{functionId}/deployments/{deploymentId}
|
|
604
|
+
const apiPath = "/functions/{functionId}/deployments/{deploymentId}".replace("{functionId}", functionId).replace("{deploymentId}", deploymentId);
|
|
542
605
|
const payload = {};
|
|
543
606
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
544
607
|
const apiHeaders = {
|
|
545
608
|
"content-type": "application/json"
|
|
546
609
|
};
|
|
547
610
|
return this.client.call(
|
|
548
|
-
"
|
|
611
|
+
"delete",
|
|
549
612
|
uri,
|
|
550
613
|
apiHeaders,
|
|
551
614
|
payload
|
|
552
615
|
);
|
|
553
616
|
}
|
|
554
617
|
/**
|
|
555
|
-
* Get a
|
|
618
|
+
* Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
556
619
|
*
|
|
557
620
|
* @param {string} functionId
|
|
558
621
|
* @param {string} deploymentId
|
|
622
|
+
* @param {DeploymentDownloadType} type
|
|
559
623
|
* @throws {AppwriteException}
|
|
560
624
|
* @returns {Promise<ArrayBuffer>}
|
|
561
625
|
*/
|
|
562
|
-
getDeploymentDownload(functionId, deploymentId) {
|
|
626
|
+
getDeploymentDownload(functionId, deploymentId, type) {
|
|
563
627
|
if (typeof functionId === "undefined") {
|
|
564
628
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
565
629
|
}
|
|
@@ -568,6 +632,9 @@ class Functions {
|
|
|
568
632
|
}
|
|
569
633
|
const apiPath = "/functions/{functionId}/deployments/{deploymentId}/download".replace("{functionId}", functionId).replace("{deploymentId}", deploymentId);
|
|
570
634
|
const payload = {};
|
|
635
|
+
if (typeof type !== "undefined") {
|
|
636
|
+
payload["type"] = type;
|
|
637
|
+
}
|
|
571
638
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
572
639
|
const apiHeaders = {};
|
|
573
640
|
return this.client.call(
|
|
@@ -578,16 +645,43 @@ class Functions {
|
|
|
578
645
|
"arrayBuffer"
|
|
579
646
|
);
|
|
580
647
|
}
|
|
648
|
+
/**
|
|
649
|
+
* 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.
|
|
650
|
+
*
|
|
651
|
+
* @param {string} functionId
|
|
652
|
+
* @param {string} deploymentId
|
|
653
|
+
* @throws {AppwriteException}
|
|
654
|
+
* @returns {Promise<Models.Deployment>}
|
|
655
|
+
*/
|
|
656
|
+
updateDeploymentStatus(functionId, deploymentId) {
|
|
657
|
+
if (typeof functionId === "undefined") {
|
|
658
|
+
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
659
|
+
}
|
|
660
|
+
if (typeof deploymentId === "undefined") {
|
|
661
|
+
throw new client.AppwriteException('Missing required parameter: "deploymentId"');
|
|
662
|
+
}
|
|
663
|
+
const apiPath = "/functions/{functionId}/deployments/{deploymentId}/status".replace("{functionId}", functionId).replace("{deploymentId}", deploymentId);
|
|
664
|
+
const payload = {};
|
|
665
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
666
|
+
const apiHeaders = {
|
|
667
|
+
"content-type": "application/json"
|
|
668
|
+
};
|
|
669
|
+
return this.client.call(
|
|
670
|
+
"patch",
|
|
671
|
+
uri,
|
|
672
|
+
apiHeaders,
|
|
673
|
+
payload
|
|
674
|
+
);
|
|
675
|
+
}
|
|
581
676
|
/**
|
|
582
677
|
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
|
583
678
|
*
|
|
584
679
|
* @param {string} functionId
|
|
585
680
|
* @param {string[]} queries
|
|
586
|
-
* @param {string} search
|
|
587
681
|
* @throws {AppwriteException}
|
|
588
682
|
* @returns {Promise<Models.ExecutionList>}
|
|
589
683
|
*/
|
|
590
|
-
listExecutions(functionId, queries
|
|
684
|
+
listExecutions(functionId, queries) {
|
|
591
685
|
if (typeof functionId === "undefined") {
|
|
592
686
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
593
687
|
}
|
|
@@ -596,9 +690,6 @@ class Functions {
|
|
|
596
690
|
if (typeof queries !== "undefined") {
|
|
597
691
|
payload["queries"] = queries;
|
|
598
692
|
}
|
|
599
|
-
if (typeof search !== "undefined") {
|
|
600
|
-
payload["search"] = search;
|
|
601
|
-
}
|
|
602
693
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
603
694
|
const apiHeaders = {};
|
|
604
695
|
return this.client.call(
|
|
@@ -683,14 +774,13 @@ class Functions {
|
|
|
683
774
|
);
|
|
684
775
|
}
|
|
685
776
|
/**
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
*/
|
|
777
|
+
* Delete a function execution by its unique ID.
|
|
778
|
+
*
|
|
779
|
+
* @param {string} functionId
|
|
780
|
+
* @param {string} executionId
|
|
781
|
+
* @throws {AppwriteException}
|
|
782
|
+
* @returns {Promise<{}>}
|
|
783
|
+
*/
|
|
694
784
|
deleteExecution(functionId, executionId) {
|
|
695
785
|
if (typeof functionId === "undefined") {
|
|
696
786
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -739,10 +829,11 @@ class Functions {
|
|
|
739
829
|
* @param {string} functionId
|
|
740
830
|
* @param {string} key
|
|
741
831
|
* @param {string} value
|
|
832
|
+
* @param {boolean} secret
|
|
742
833
|
* @throws {AppwriteException}
|
|
743
834
|
* @returns {Promise<Models.Variable>}
|
|
744
835
|
*/
|
|
745
|
-
createVariable(functionId, key, value) {
|
|
836
|
+
createVariable(functionId, key, value, secret) {
|
|
746
837
|
if (typeof functionId === "undefined") {
|
|
747
838
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
748
839
|
}
|
|
@@ -760,6 +851,9 @@ class Functions {
|
|
|
760
851
|
if (typeof value !== "undefined") {
|
|
761
852
|
payload["value"] = value;
|
|
762
853
|
}
|
|
854
|
+
if (typeof secret !== "undefined") {
|
|
855
|
+
payload["secret"] = secret;
|
|
856
|
+
}
|
|
763
857
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
764
858
|
const apiHeaders = {
|
|
765
859
|
"content-type": "application/json"
|
|
@@ -804,10 +898,11 @@ class Functions {
|
|
|
804
898
|
* @param {string} variableId
|
|
805
899
|
* @param {string} key
|
|
806
900
|
* @param {string} value
|
|
901
|
+
* @param {boolean} secret
|
|
807
902
|
* @throws {AppwriteException}
|
|
808
903
|
* @returns {Promise<Models.Variable>}
|
|
809
904
|
*/
|
|
810
|
-
updateVariable(functionId, variableId, key, value) {
|
|
905
|
+
updateVariable(functionId, variableId, key, value, secret) {
|
|
811
906
|
if (typeof functionId === "undefined") {
|
|
812
907
|
throw new client.AppwriteException('Missing required parameter: "functionId"');
|
|
813
908
|
}
|
|
@@ -825,6 +920,9 @@ class Functions {
|
|
|
825
920
|
if (typeof value !== "undefined") {
|
|
826
921
|
payload["value"] = value;
|
|
827
922
|
}
|
|
923
|
+
if (typeof secret !== "undefined") {
|
|
924
|
+
payload["secret"] = secret;
|
|
925
|
+
}
|
|
828
926
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
829
927
|
const apiHeaders = {
|
|
830
928
|
"content-type": "application/json"
|