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