@appwrite.io/console 1.1.0-rc.2 → 1.1.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 (115) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +2196 -3306
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +2197 -3305
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +2196 -3306
  7. package/docs/examples/account/delete-mfa-authenticator.md +1 -2
  8. package/docs/examples/databases/update-boolean-attribute.md +2 -1
  9. package/docs/examples/databases/update-datetime-attribute.md +2 -1
  10. package/docs/examples/databases/update-email-attribute.md +2 -1
  11. package/docs/examples/databases/update-enum-attribute.md +2 -1
  12. package/docs/examples/databases/update-float-attribute.md +2 -1
  13. package/docs/examples/databases/update-integer-attribute.md +2 -1
  14. package/docs/examples/databases/update-ip-attribute.md +2 -1
  15. package/docs/examples/databases/update-relationship-attribute.md +2 -1
  16. package/docs/examples/databases/update-string-attribute.md +3 -1
  17. package/docs/examples/databases/update-url-attribute.md +2 -1
  18. package/docs/examples/functions/create-build.md +1 -1
  19. package/docs/examples/functions/create-execution.md +2 -1
  20. package/docs/examples/functions/create.md +3 -1
  21. package/docs/examples/functions/delete-execution.md +14 -0
  22. package/docs/examples/functions/{download-deployment.md → get-deployment-download.md} +1 -1
  23. package/docs/examples/{account/list-billing-addresses.md → functions/get-template.md} +4 -4
  24. package/docs/examples/{account/create-payment-method.md → functions/list-specifications.md} +3 -3
  25. package/docs/examples/functions/list-templates.md +16 -0
  26. package/docs/examples/functions/update-deployment-build.md +14 -0
  27. package/docs/examples/functions/update.md +3 -1
  28. package/docs/examples/projects/create-j-w-t.md +15 -0
  29. package/docs/examples/projects/update-mock-numbers.md +14 -0
  30. package/docs/examples/projects/update-session-alerts.md +14 -0
  31. package/docs/examples/users/create-j-w-t.md +15 -0
  32. package/docs/examples/vcs/get-repository-contents.md +15 -0
  33. package/package.json +1 -1
  34. package/src/client.ts +2 -2
  35. package/src/enums/email-template-type.ts +2 -0
  36. package/src/enums/platform-type.ts +2 -0
  37. package/src/enums/runtime.ts +1 -0
  38. package/src/index.ts +1 -4
  39. package/src/models.ts +286 -960
  40. package/src/services/account.ts +2 -345
  41. package/src/services/console.ts +0 -120
  42. package/src/services/databases.ts +54 -10
  43. package/src/services/functions.ts +195 -14
  44. package/src/services/projects.ts +110 -1
  45. package/src/services/users.ts +37 -0
  46. package/src/services/vcs.ts +36 -0
  47. package/types/enums/email-template-type.d.ts +3 -1
  48. package/types/enums/platform-type.d.ts +3 -1
  49. package/types/enums/runtime.d.ts +2 -1
  50. package/types/index.d.ts +1 -4
  51. package/types/models.d.ts +286 -960
  52. package/types/services/account.d.ts +1 -105
  53. package/types/services/console.d.ts +0 -38
  54. package/types/services/databases.d.ts +21 -10
  55. package/types/services/functions.d.ts +67 -8
  56. package/types/services/projects.d.ts +32 -1
  57. package/types/services/users.d.ts +12 -0
  58. package/types/services/vcs.d.ts +11 -0
  59. package/docs/examples/account/delete-payment-method.md +0 -13
  60. package/docs/examples/account/get-billing-address.md +0 -13
  61. package/docs/examples/account/get-payment-method.md +0 -13
  62. package/docs/examples/account/list-credits.md +0 -14
  63. package/docs/examples/account/list-invoices.md +0 -13
  64. package/docs/examples/account/list-payment-methods.md +0 -13
  65. package/docs/examples/account/update-payment-method-mandate-options.md +0 -13
  66. package/docs/examples/account/update-payment-method-provider.md +0 -15
  67. package/docs/examples/account/update-payment-method.md +0 -15
  68. package/docs/examples/backups/create-archive.md +0 -14
  69. package/docs/examples/backups/create-policy.md +0 -19
  70. package/docs/examples/backups/create-restoration.md +0 -16
  71. package/docs/examples/backups/delete-archive.md +0 -13
  72. package/docs/examples/backups/delete-policy.md +0 -13
  73. package/docs/examples/backups/get-archive.md +0 -13
  74. package/docs/examples/backups/get-policy.md +0 -13
  75. package/docs/examples/backups/get-restoration.md +0 -13
  76. package/docs/examples/backups/list-archives.md +0 -13
  77. package/docs/examples/backups/list-policies.md +0 -13
  78. package/docs/examples/backups/list-restorations.md +0 -13
  79. package/docs/examples/backups/update-policy.md +0 -17
  80. package/docs/examples/console/create-source.md +0 -17
  81. package/docs/examples/console/get-copon.md +0 -13
  82. package/docs/examples/console/plans.md +0 -11
  83. package/docs/examples/console/regions.md +0 -11
  84. package/docs/examples/organizations/add-credit.md +0 -14
  85. package/docs/examples/organizations/create-invoice-payment.md +0 -15
  86. package/docs/examples/organizations/create.md +0 -17
  87. package/docs/examples/organizations/delete-backup-payment-method.md +0 -13
  88. package/docs/examples/organizations/delete-billing-address.md +0 -13
  89. package/docs/examples/organizations/delete-default-payment-method.md +0 -13
  90. package/docs/examples/organizations/delete.md +0 -13
  91. package/docs/examples/organizations/get-aggregation.md +0 -14
  92. package/docs/examples/organizations/get-billing-address.md +0 -14
  93. package/docs/examples/organizations/get-credit.md +0 -14
  94. package/docs/examples/organizations/get-invoice-download.md +0 -14
  95. package/docs/examples/organizations/get-invoice-view.md +0 -14
  96. package/docs/examples/organizations/get-invoice.md +0 -14
  97. package/docs/examples/organizations/get-payment-method.md +0 -14
  98. package/docs/examples/organizations/get-plan.md +0 -13
  99. package/docs/examples/organizations/get-usage.md +0 -15
  100. package/docs/examples/organizations/list-aggregations.md +0 -14
  101. package/docs/examples/organizations/list-invoices.md +0 -14
  102. package/docs/examples/organizations/list.md +0 -14
  103. package/docs/examples/organizations/set-backup-payment-method.md +0 -14
  104. package/docs/examples/organizations/set-billing-address.md +0 -14
  105. package/docs/examples/organizations/set-billing-email.md +0 -14
  106. package/docs/examples/organizations/set-billing-tax-id.md +0 -14
  107. package/docs/examples/organizations/set-default-payment-method.md +0 -14
  108. package/docs/examples/organizations/update-budget.md +0 -15
  109. package/docs/examples/organizations/update-plan.md +0 -16
  110. package/src/enums/billing-plan.ts +0 -5
  111. package/src/services/backups.ts +0 -425
  112. package/src/services/organizations.ts +0 -896
  113. package/types/enums/billing-plan.d.ts +0 -5
  114. package/types/services/backups.d.ts +0 -128
  115. package/types/services/organizations.d.ts +0 -273
@@ -529,10 +529,11 @@ export class Databases {
529
529
  * @param {string} key
530
530
  * @param {boolean} required
531
531
  * @param {boolean} xdefault
532
+ * @param {string} newKey
532
533
  * @throws {AppwriteException}
533
534
  * @returns {Promise<Models.AttributeBoolean>}
534
535
  */
535
- async updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean): Promise<Models.AttributeBoolean> {
536
+ async updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, newKey?: string): Promise<Models.AttributeBoolean> {
536
537
  if (typeof databaseId === 'undefined') {
537
538
  throw new AppwriteException('Missing required parameter: "databaseId"');
538
539
  }
@@ -556,6 +557,9 @@ export class Databases {
556
557
  if (typeof xdefault !== 'undefined') {
557
558
  payload['default'] = xdefault;
558
559
  }
560
+ if (typeof newKey !== 'undefined') {
561
+ payload['newKey'] = newKey;
562
+ }
559
563
  const uri = new URL(this.client.config.endpoint + apiPath);
560
564
 
561
565
  const apiHeaders: { [header: string]: string } = {
@@ -635,10 +639,11 @@ export class Databases {
635
639
  * @param {string} key
636
640
  * @param {boolean} required
637
641
  * @param {string} xdefault
642
+ * @param {string} newKey
638
643
  * @throws {AppwriteException}
639
644
  * @returns {Promise<Models.AttributeDatetime>}
640
645
  */
641
- async updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeDatetime> {
646
+ async updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeDatetime> {
642
647
  if (typeof databaseId === 'undefined') {
643
648
  throw new AppwriteException('Missing required parameter: "databaseId"');
644
649
  }
@@ -662,6 +667,9 @@ export class Databases {
662
667
  if (typeof xdefault !== 'undefined') {
663
668
  payload['default'] = xdefault;
664
669
  }
670
+ if (typeof newKey !== 'undefined') {
671
+ payload['newKey'] = newKey;
672
+ }
665
673
  const uri = new URL(this.client.config.endpoint + apiPath);
666
674
 
667
675
  const apiHeaders: { [header: string]: string } = {
@@ -743,10 +751,11 @@ export class Databases {
743
751
  * @param {string} key
744
752
  * @param {boolean} required
745
753
  * @param {string} xdefault
754
+ * @param {string} newKey
746
755
  * @throws {AppwriteException}
747
756
  * @returns {Promise<Models.AttributeEmail>}
748
757
  */
749
- async updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeEmail> {
758
+ async updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEmail> {
750
759
  if (typeof databaseId === 'undefined') {
751
760
  throw new AppwriteException('Missing required parameter: "databaseId"');
752
761
  }
@@ -770,6 +779,9 @@ export class Databases {
770
779
  if (typeof xdefault !== 'undefined') {
771
780
  payload['default'] = xdefault;
772
781
  }
782
+ if (typeof newKey !== 'undefined') {
783
+ payload['newKey'] = newKey;
784
+ }
773
785
  const uri = new URL(this.client.config.endpoint + apiPath);
774
786
 
775
787
  const apiHeaders: { [header: string]: string } = {
@@ -859,10 +871,11 @@ export class Databases {
859
871
  * @param {string[]} elements
860
872
  * @param {boolean} required
861
873
  * @param {string} xdefault
874
+ * @param {string} newKey
862
875
  * @throws {AppwriteException}
863
876
  * @returns {Promise<Models.AttributeEnum>}
864
877
  */
865
- async updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string): Promise<Models.AttributeEnum> {
878
+ async updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEnum> {
866
879
  if (typeof databaseId === 'undefined') {
867
880
  throw new AppwriteException('Missing required parameter: "databaseId"');
868
881
  }
@@ -892,6 +905,9 @@ export class Databases {
892
905
  if (typeof xdefault !== 'undefined') {
893
906
  payload['default'] = xdefault;
894
907
  }
908
+ if (typeof newKey !== 'undefined') {
909
+ payload['newKey'] = newKey;
910
+ }
895
911
  const uri = new URL(this.client.config.endpoint + apiPath);
896
912
 
897
913
  const apiHeaders: { [header: string]: string } = {
@@ -983,10 +999,11 @@ export class Databases {
983
999
  * @param {number} min
984
1000
  * @param {number} max
985
1001
  * @param {number} xdefault
1002
+ * @param {string} newKey
986
1003
  * @throws {AppwriteException}
987
1004
  * @returns {Promise<Models.AttributeFloat>}
988
1005
  */
989
- async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number): Promise<Models.AttributeFloat> {
1006
+ async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number, newKey?: string): Promise<Models.AttributeFloat> {
990
1007
  if (typeof databaseId === 'undefined') {
991
1008
  throw new AppwriteException('Missing required parameter: "databaseId"');
992
1009
  }
@@ -1022,6 +1039,9 @@ export class Databases {
1022
1039
  if (typeof xdefault !== 'undefined') {
1023
1040
  payload['default'] = xdefault;
1024
1041
  }
1042
+ if (typeof newKey !== 'undefined') {
1043
+ payload['newKey'] = newKey;
1044
+ }
1025
1045
  const uri = new URL(this.client.config.endpoint + apiPath);
1026
1046
 
1027
1047
  const apiHeaders: { [header: string]: string } = {
@@ -1113,10 +1133,11 @@ export class Databases {
1113
1133
  * @param {number} min
1114
1134
  * @param {number} max
1115
1135
  * @param {number} xdefault
1136
+ * @param {string} newKey
1116
1137
  * @throws {AppwriteException}
1117
1138
  * @returns {Promise<Models.AttributeInteger>}
1118
1139
  */
1119
- async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number): Promise<Models.AttributeInteger> {
1140
+ async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number, newKey?: string): Promise<Models.AttributeInteger> {
1120
1141
  if (typeof databaseId === 'undefined') {
1121
1142
  throw new AppwriteException('Missing required parameter: "databaseId"');
1122
1143
  }
@@ -1152,6 +1173,9 @@ export class Databases {
1152
1173
  if (typeof xdefault !== 'undefined') {
1153
1174
  payload['default'] = xdefault;
1154
1175
  }
1176
+ if (typeof newKey !== 'undefined') {
1177
+ payload['newKey'] = newKey;
1178
+ }
1155
1179
  const uri = new URL(this.client.config.endpoint + apiPath);
1156
1180
 
1157
1181
  const apiHeaders: { [header: string]: string } = {
@@ -1233,10 +1257,11 @@ export class Databases {
1233
1257
  * @param {string} key
1234
1258
  * @param {boolean} required
1235
1259
  * @param {string} xdefault
1260
+ * @param {string} newKey
1236
1261
  * @throws {AppwriteException}
1237
1262
  * @returns {Promise<Models.AttributeIp>}
1238
1263
  */
1239
- async updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeIp> {
1264
+ async updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp> {
1240
1265
  if (typeof databaseId === 'undefined') {
1241
1266
  throw new AppwriteException('Missing required parameter: "databaseId"');
1242
1267
  }
@@ -1260,6 +1285,9 @@ export class Databases {
1260
1285
  if (typeof xdefault !== 'undefined') {
1261
1286
  payload['default'] = xdefault;
1262
1287
  }
1288
+ if (typeof newKey !== 'undefined') {
1289
+ payload['newKey'] = newKey;
1290
+ }
1263
1291
  const uri = new URL(this.client.config.endpoint + apiPath);
1264
1292
 
1265
1293
  const apiHeaders: { [header: string]: string } = {
@@ -1416,10 +1444,12 @@ export class Databases {
1416
1444
  * @param {string} key
1417
1445
  * @param {boolean} required
1418
1446
  * @param {string} xdefault
1447
+ * @param {number} size
1448
+ * @param {string} newKey
1419
1449
  * @throws {AppwriteException}
1420
1450
  * @returns {Promise<Models.AttributeString>}
1421
1451
  */
1422
- async updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeString> {
1452
+ async updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString> {
1423
1453
  if (typeof databaseId === 'undefined') {
1424
1454
  throw new AppwriteException('Missing required parameter: "databaseId"');
1425
1455
  }
@@ -1443,6 +1473,12 @@ export class Databases {
1443
1473
  if (typeof xdefault !== 'undefined') {
1444
1474
  payload['default'] = xdefault;
1445
1475
  }
1476
+ if (typeof size !== 'undefined') {
1477
+ payload['size'] = size;
1478
+ }
1479
+ if (typeof newKey !== 'undefined') {
1480
+ payload['newKey'] = newKey;
1481
+ }
1446
1482
  const uri = new URL(this.client.config.endpoint + apiPath);
1447
1483
 
1448
1484
  const apiHeaders: { [header: string]: string } = {
@@ -1524,10 +1560,11 @@ export class Databases {
1524
1560
  * @param {string} key
1525
1561
  * @param {boolean} required
1526
1562
  * @param {string} xdefault
1563
+ * @param {string} newKey
1527
1564
  * @throws {AppwriteException}
1528
1565
  * @returns {Promise<Models.AttributeUrl>}
1529
1566
  */
1530
- async updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeUrl> {
1567
+ async updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeUrl> {
1531
1568
  if (typeof databaseId === 'undefined') {
1532
1569
  throw new AppwriteException('Missing required parameter: "databaseId"');
1533
1570
  }
@@ -1551,6 +1588,9 @@ export class Databases {
1551
1588
  if (typeof xdefault !== 'undefined') {
1552
1589
  payload['default'] = xdefault;
1553
1590
  }
1591
+ if (typeof newKey !== 'undefined') {
1592
+ payload['newKey'] = newKey;
1593
+ }
1554
1594
  const uri = new URL(this.client.config.endpoint + apiPath);
1555
1595
 
1556
1596
  const apiHeaders: { [header: string]: string } = {
@@ -1649,10 +1689,11 @@ export class Databases {
1649
1689
  * @param {string} collectionId
1650
1690
  * @param {string} key
1651
1691
  * @param {RelationMutate} onDelete
1692
+ * @param {string} newKey
1652
1693
  * @throws {AppwriteException}
1653
1694
  * @returns {Promise<Models.AttributeRelationship>}
1654
1695
  */
1655
- async updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship> {
1696
+ async updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship> {
1656
1697
  if (typeof databaseId === 'undefined') {
1657
1698
  throw new AppwriteException('Missing required parameter: "databaseId"');
1658
1699
  }
@@ -1667,6 +1708,9 @@ export class Databases {
1667
1708
  if (typeof onDelete !== 'undefined') {
1668
1709
  payload['onDelete'] = onDelete;
1669
1710
  }
1711
+ if (typeof newKey !== 'undefined') {
1712
+ payload['newKey'] = newKey;
1713
+ }
1670
1714
  const uri = new URL(this.client.config.endpoint + apiPath);
1671
1715
 
1672
1716
  const apiHeaders: { [header: string]: string } = {
@@ -61,6 +61,7 @@ export class Functions {
61
61
  * @param {boolean} logging
62
62
  * @param {string} entrypoint
63
63
  * @param {string} commands
64
+ * @param {string[]} scopes
64
65
  * @param {string} installationId
65
66
  * @param {string} providerRepositoryId
66
67
  * @param {string} providerBranch
@@ -69,11 +70,12 @@ export class Functions {
69
70
  * @param {string} templateRepository
70
71
  * @param {string} templateOwner
71
72
  * @param {string} templateRootDirectory
72
- * @param {string} templateBranch
73
+ * @param {string} templateVersion
74
+ * @param {string} specification
73
75
  * @throws {AppwriteException}
74
76
  * @returns {Promise<Models.Function>}
75
77
  */
76
- async create(functionId: string, name: string, runtime: Runtime, 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, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateBranch?: string): Promise<Models.Function> {
78
+ async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateVersion?: string, specification?: string): Promise<Models.Function> {
77
79
  if (typeof functionId === 'undefined') {
78
80
  throw new AppwriteException('Missing required parameter: "functionId"');
79
81
  }
@@ -118,6 +120,9 @@ export class Functions {
118
120
  if (typeof commands !== 'undefined') {
119
121
  payload['commands'] = commands;
120
122
  }
123
+ if (typeof scopes !== 'undefined') {
124
+ payload['scopes'] = scopes;
125
+ }
121
126
  if (typeof installationId !== 'undefined') {
122
127
  payload['installationId'] = installationId;
123
128
  }
@@ -142,8 +147,11 @@ export class Functions {
142
147
  if (typeof templateRootDirectory !== 'undefined') {
143
148
  payload['templateRootDirectory'] = templateRootDirectory;
144
149
  }
145
- if (typeof templateBranch !== 'undefined') {
146
- payload['templateBranch'] = templateBranch;
150
+ if (typeof templateVersion !== 'undefined') {
151
+ payload['templateVersion'] = templateVersion;
152
+ }
153
+ if (typeof specification !== 'undefined') {
154
+ payload['specification'] = specification;
147
155
  }
148
156
  const uri = new URL(this.client.config.endpoint + apiPath);
149
157
 
@@ -177,6 +185,102 @@ export class Functions {
177
185
  }
178
186
 
179
187
 
188
+ return await this.client.call(
189
+ 'get',
190
+ uri,
191
+ apiHeaders,
192
+ payload
193
+ );
194
+ }
195
+ /**
196
+ * List available function runtime specifications
197
+ *
198
+ * List allowed function specifications for this instance.
199
+
200
+ *
201
+ * @throws {AppwriteException}
202
+ * @returns {Promise<Models.SpecificationList>}
203
+ */
204
+ async listSpecifications(): Promise<Models.SpecificationList> {
205
+ const apiPath = '/functions/specifications';
206
+ const payload: Payload = {};
207
+ const uri = new URL(this.client.config.endpoint + apiPath);
208
+
209
+ const apiHeaders: { [header: string]: string } = {
210
+ 'content-type': 'application/json',
211
+ }
212
+
213
+
214
+ return await this.client.call(
215
+ 'get',
216
+ uri,
217
+ apiHeaders,
218
+ payload
219
+ );
220
+ }
221
+ /**
222
+ * List function templates
223
+ *
224
+ * List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
225
+ *
226
+ * @param {string[]} runtimes
227
+ * @param {string[]} useCases
228
+ * @param {number} limit
229
+ * @param {number} offset
230
+ * @throws {AppwriteException}
231
+ * @returns {Promise<Models.TemplateFunctionList>}
232
+ */
233
+ async listTemplates(runtimes?: string[], useCases?: string[], limit?: number, offset?: number): Promise<Models.TemplateFunctionList> {
234
+ const apiPath = '/functions/templates';
235
+ const payload: Payload = {};
236
+ if (typeof runtimes !== 'undefined') {
237
+ payload['runtimes'] = runtimes;
238
+ }
239
+ if (typeof useCases !== 'undefined') {
240
+ payload['useCases'] = useCases;
241
+ }
242
+ if (typeof limit !== 'undefined') {
243
+ payload['limit'] = limit;
244
+ }
245
+ if (typeof offset !== 'undefined') {
246
+ payload['offset'] = offset;
247
+ }
248
+ const uri = new URL(this.client.config.endpoint + apiPath);
249
+
250
+ const apiHeaders: { [header: string]: string } = {
251
+ 'content-type': 'application/json',
252
+ }
253
+
254
+
255
+ return await this.client.call(
256
+ 'get',
257
+ uri,
258
+ apiHeaders,
259
+ payload
260
+ );
261
+ }
262
+ /**
263
+ * Get function template
264
+ *
265
+ * Get a function template using ID. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
266
+ *
267
+ * @param {string} templateId
268
+ * @throws {AppwriteException}
269
+ * @returns {Promise<Models.TemplateFunction>}
270
+ */
271
+ async getTemplate(templateId: string): Promise<Models.TemplateFunction> {
272
+ if (typeof templateId === 'undefined') {
273
+ throw new AppwriteException('Missing required parameter: "templateId"');
274
+ }
275
+ const apiPath = '/functions/templates/{templateId}'.replace('{templateId}', templateId);
276
+ const payload: Payload = {};
277
+ const uri = new URL(this.client.config.endpoint + apiPath);
278
+
279
+ const apiHeaders: { [header: string]: string } = {
280
+ 'content-type': 'application/json',
281
+ }
282
+
283
+
180
284
  return await this.client.call(
181
285
  'get',
182
286
  uri,
@@ -257,15 +361,17 @@ export class Functions {
257
361
  * @param {boolean} logging
258
362
  * @param {string} entrypoint
259
363
  * @param {string} commands
364
+ * @param {string[]} scopes
260
365
  * @param {string} installationId
261
366
  * @param {string} providerRepositoryId
262
367
  * @param {string} providerBranch
263
368
  * @param {boolean} providerSilentMode
264
369
  * @param {string} providerRootDirectory
370
+ * @param {string} specification
265
371
  * @throws {AppwriteException}
266
372
  * @returns {Promise<Models.Function>}
267
373
  */
268
- async update(functionId: string, name: string, runtime?: Runtime, 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> {
374
+ async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function> {
269
375
  if (typeof functionId === 'undefined') {
270
376
  throw new AppwriteException('Missing required parameter: "functionId"');
271
377
  }
@@ -304,6 +410,9 @@ export class Functions {
304
410
  if (typeof commands !== 'undefined') {
305
411
  payload['commands'] = commands;
306
412
  }
413
+ if (typeof scopes !== 'undefined') {
414
+ payload['scopes'] = scopes;
415
+ }
307
416
  if (typeof installationId !== 'undefined') {
308
417
  payload['installationId'] = installationId;
309
418
  }
@@ -319,6 +428,9 @@ export class Functions {
319
428
  if (typeof providerRootDirectory !== 'undefined') {
320
429
  payload['providerRootDirectory'] = providerRootDirectory;
321
430
  }
431
+ if (typeof specification !== 'undefined') {
432
+ payload['specification'] = specification;
433
+ }
322
434
  const uri = new URL(this.client.config.endpoint + apiPath);
323
435
 
324
436
  const apiHeaders: { [header: string]: string } = {
@@ -555,9 +667,8 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
555
667
  );
556
668
  }
557
669
  /**
558
- * Create build
670
+ * Rebuild deployment
559
671
  *
560
- * Create a new build for an Appwrite Function deployment. This endpoint can be used to retry a failed build.
561
672
  *
562
673
  * @param {string} functionId
563
674
  * @param {string} deploymentId
@@ -565,18 +676,18 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
565
676
  * @throws {AppwriteException}
566
677
  * @returns {Promise<{}>}
567
678
  */
568
- async createBuild(functionId: string, deploymentId: string, buildId: string): Promise<{}> {
679
+ async createBuild(functionId: string, deploymentId: string, buildId?: string): Promise<{}> {
569
680
  if (typeof functionId === 'undefined') {
570
681
  throw new AppwriteException('Missing required parameter: "functionId"');
571
682
  }
572
683
  if (typeof deploymentId === 'undefined') {
573
684
  throw new AppwriteException('Missing required parameter: "deploymentId"');
574
685
  }
575
- if (typeof buildId === 'undefined') {
576
- throw new AppwriteException('Missing required parameter: "buildId"');
577
- }
578
- const apiPath = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId).replace('{buildId}', buildId);
686
+ const apiPath = '/functions/{functionId}/deployments/{deploymentId}/build'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
579
687
  const payload: Payload = {};
688
+ if (typeof buildId !== 'undefined') {
689
+ payload['buildId'] = buildId;
690
+ }
580
691
  const uri = new URL(this.client.config.endpoint + apiPath);
581
692
 
582
693
  const apiHeaders: { [header: string]: string } = {
@@ -591,6 +702,38 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
591
702
  payload
592
703
  );
593
704
  }
705
+ /**
706
+ * Cancel deployment
707
+ *
708
+ *
709
+ * @param {string} functionId
710
+ * @param {string} deploymentId
711
+ * @throws {AppwriteException}
712
+ * @returns {Promise<Models.Build>}
713
+ */
714
+ async updateDeploymentBuild(functionId: string, deploymentId: string): Promise<Models.Build> {
715
+ if (typeof functionId === 'undefined') {
716
+ throw new AppwriteException('Missing required parameter: "functionId"');
717
+ }
718
+ if (typeof deploymentId === 'undefined') {
719
+ throw new AppwriteException('Missing required parameter: "deploymentId"');
720
+ }
721
+ const apiPath = '/functions/{functionId}/deployments/{deploymentId}/build'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
722
+ const payload: Payload = {};
723
+ const uri = new URL(this.client.config.endpoint + apiPath);
724
+
725
+ const apiHeaders: { [header: string]: string } = {
726
+ 'content-type': 'application/json',
727
+ }
728
+
729
+
730
+ return await this.client.call(
731
+ 'patch',
732
+ uri,
733
+ apiHeaders,
734
+ payload
735
+ );
736
+ }
594
737
  /**
595
738
  * Download deployment
596
739
  *
@@ -601,7 +744,7 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
601
744
  * @throws {AppwriteException}
602
745
  * @returns {string}
603
746
  */
604
- downloadDeployment(functionId: string, deploymentId: string): string {
747
+ getDeploymentDownload(functionId: string, deploymentId: string): string {
605
748
  if (typeof functionId === 'undefined') {
606
749
  throw new AppwriteException('Missing required parameter: "functionId"');
607
750
  }
@@ -677,10 +820,11 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
677
820
  * @param {string} xpath
678
821
  * @param {ExecutionMethod} method
679
822
  * @param {object} headers
823
+ * @param {string} scheduledAt
680
824
  * @throws {AppwriteException}
681
825
  * @returns {Promise<Models.Execution>}
682
826
  */
683
- async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object): Promise<Models.Execution> {
827
+ async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution> {
684
828
  if (typeof functionId === 'undefined') {
685
829
  throw new AppwriteException('Missing required parameter: "functionId"');
686
830
  }
@@ -701,6 +845,9 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
701
845
  if (typeof headers !== 'undefined') {
702
846
  payload['headers'] = headers;
703
847
  }
848
+ if (typeof scheduledAt !== 'undefined') {
849
+ payload['scheduledAt'] = scheduledAt;
850
+ }
704
851
  const uri = new URL(this.client.config.endpoint + apiPath);
705
852
 
706
853
  const apiHeaders: { [header: string]: string } = {
@@ -748,6 +895,40 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
748
895
  payload
749
896
  );
750
897
  }
898
+ /**
899
+ * Delete execution
900
+ *
901
+ * Delete a function execution by its unique ID.
902
+
903
+ *
904
+ * @param {string} functionId
905
+ * @param {string} executionId
906
+ * @throws {AppwriteException}
907
+ * @returns {Promise<{}>}
908
+ */
909
+ async deleteExecution(functionId: string, executionId: string): Promise<{}> {
910
+ if (typeof functionId === 'undefined') {
911
+ throw new AppwriteException('Missing required parameter: "functionId"');
912
+ }
913
+ if (typeof executionId === 'undefined') {
914
+ throw new AppwriteException('Missing required parameter: "executionId"');
915
+ }
916
+ const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
917
+ const payload: Payload = {};
918
+ const uri = new URL(this.client.config.endpoint + apiPath);
919
+
920
+ const apiHeaders: { [header: string]: string } = {
921
+ 'content-type': 'application/json',
922
+ }
923
+
924
+
925
+ return await this.client.call(
926
+ 'delete',
927
+ uri,
928
+ apiHeaders,
929
+ payload
930
+ );
931
+ }
751
932
  /**
752
933
  * Get function usage
753
934
  *