@appwrite.io/console 7.0.0-rc.1 → 8.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 (136) hide show
  1. package/.github/workflows/autoclose.yml +11 -0
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +2 -2
  4. package/dist/cjs/sdk.js +10580 -13225
  5. package/dist/cjs/sdk.js.map +1 -1
  6. package/dist/esm/sdk.js +10709 -13348
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +10304 -12936
  9. package/docs/examples/domains/create-purchase.md +2 -1
  10. package/docs/examples/domains/create-transfer-in.md +2 -1
  11. package/docs/examples/domains/{confirm-purchase.md → update-auto-renewal.md} +2 -2
  12. package/docs/examples/project/create-variable.md +1 -0
  13. package/docs/examples/project/list-variables.md +4 -1
  14. package/docs/examples/project/update-variable.md +1 -1
  15. package/docs/examples/{documentsdb/delete.md → users/update-impersonator.md} +5 -4
  16. package/package.json +7 -7
  17. package/rollup.config.js +2 -1
  18. package/src/client.ts +50 -2
  19. package/src/enums/build-runtime.ts +0 -92
  20. package/src/enums/runtime.ts +0 -92
  21. package/src/enums/runtimes.ts +0 -92
  22. package/src/enums/scopes.ts +13 -2
  23. package/src/enums/template-reference-type.ts +1 -1
  24. package/src/enums/use-cases.ts +7 -2
  25. package/src/index.ts +0 -5
  26. package/src/models.ts +23 -435
  27. package/src/services/domains.ts +103 -26
  28. package/src/services/project.ts +76 -33
  29. package/src/services/users.ts +67 -2
  30. package/types/channel.d.ts +3 -3
  31. package/types/client.d.ts +37 -4
  32. package/types/enums/build-runtime.d.ts +1 -93
  33. package/types/enums/runtime.d.ts +1 -93
  34. package/types/enums/runtimes.d.ts +1 -93
  35. package/types/enums/scopes.d.ts +14 -3
  36. package/types/enums/template-reference-type.d.ts +1 -1
  37. package/types/enums/use-cases.d.ts +7 -2
  38. package/types/index.d.ts +0 -5
  39. package/types/models.d.ts +23 -423
  40. package/types/operator.d.ts +3 -3
  41. package/types/query.d.ts +4 -4
  42. package/types/services/domains.d.ts +42 -14
  43. package/types/services/project.d.ts +37 -19
  44. package/types/services/realtime.d.ts +6 -6
  45. package/types/services/users.d.ts +26 -2
  46. package/docs/examples/documentsdb/create-collection.md +0 -22
  47. package/docs/examples/documentsdb/create-document.md +0 -25
  48. package/docs/examples/documentsdb/create-documents.md +0 -17
  49. package/docs/examples/documentsdb/create-index.md +0 -21
  50. package/docs/examples/documentsdb/create-transaction.md +0 -15
  51. package/docs/examples/documentsdb/create.md +0 -17
  52. package/docs/examples/documentsdb/decrement-document-attribute.md +0 -21
  53. package/docs/examples/documentsdb/delete-collection.md +0 -16
  54. package/docs/examples/documentsdb/delete-document.md +0 -18
  55. package/docs/examples/documentsdb/delete-documents.md +0 -18
  56. package/docs/examples/documentsdb/delete-index.md +0 -17
  57. package/docs/examples/documentsdb/delete-transaction.md +0 -15
  58. package/docs/examples/documentsdb/get-collection-usage.md +0 -17
  59. package/docs/examples/documentsdb/get-collection.md +0 -16
  60. package/docs/examples/documentsdb/get-document.md +0 -19
  61. package/docs/examples/documentsdb/get-index.md +0 -17
  62. package/docs/examples/documentsdb/get-transaction.md +0 -15
  63. package/docs/examples/documentsdb/get-usage.md +0 -16
  64. package/docs/examples/documentsdb/get.md +0 -15
  65. package/docs/examples/documentsdb/increment-document-attribute.md +0 -21
  66. package/docs/examples/documentsdb/list-collection-logs.md +0 -17
  67. package/docs/examples/documentsdb/list-collections.md +0 -18
  68. package/docs/examples/documentsdb/list-document-logs.md +0 -18
  69. package/docs/examples/documentsdb/list-documents.md +0 -20
  70. package/docs/examples/documentsdb/list-indexes.md +0 -18
  71. package/docs/examples/documentsdb/list-transactions.md +0 -15
  72. package/docs/examples/documentsdb/list-usage.md +0 -15
  73. package/docs/examples/documentsdb/list.md +0 -17
  74. package/docs/examples/documentsdb/update-collection.md +0 -20
  75. package/docs/examples/documentsdb/update-document.md +0 -20
  76. package/docs/examples/documentsdb/update-documents.md +0 -19
  77. package/docs/examples/documentsdb/update-transaction.md +0 -17
  78. package/docs/examples/documentsdb/update.md +0 -17
  79. package/docs/examples/documentsdb/upsert-document.md +0 -20
  80. package/docs/examples/documentsdb/upsert-documents.md +0 -18
  81. package/docs/examples/domains/confirm-transfer-in.md +0 -16
  82. package/docs/examples/projects/create-webhook.md +0 -22
  83. package/docs/examples/projects/delete-webhook.md +0 -16
  84. package/docs/examples/projects/get-webhook.md +0 -16
  85. package/docs/examples/projects/list-webhooks.md +0 -16
  86. package/docs/examples/projects/update-webhook-signature.md +0 -16
  87. package/docs/examples/projects/update-webhook.md +0 -23
  88. package/docs/examples/vectorsdb/create-collection.md +0 -21
  89. package/docs/examples/vectorsdb/create-document.md +0 -29
  90. package/docs/examples/vectorsdb/create-documents.md +0 -17
  91. package/docs/examples/vectorsdb/create-index.md +0 -21
  92. package/docs/examples/vectorsdb/create-operations.md +0 -26
  93. package/docs/examples/vectorsdb/create-text-embeddings.md +0 -16
  94. package/docs/examples/vectorsdb/create-transaction.md +0 -15
  95. package/docs/examples/vectorsdb/create.md +0 -17
  96. package/docs/examples/vectorsdb/delete-collection.md +0 -16
  97. package/docs/examples/vectorsdb/delete-document.md +0 -18
  98. package/docs/examples/vectorsdb/delete-documents.md +0 -18
  99. package/docs/examples/vectorsdb/delete-index.md +0 -17
  100. package/docs/examples/vectorsdb/delete-transaction.md +0 -15
  101. package/docs/examples/vectorsdb/delete.md +0 -15
  102. package/docs/examples/vectorsdb/get-collection-usage.md +0 -17
  103. package/docs/examples/vectorsdb/get-collection.md +0 -16
  104. package/docs/examples/vectorsdb/get-document.md +0 -19
  105. package/docs/examples/vectorsdb/get-index.md +0 -17
  106. package/docs/examples/vectorsdb/get-transaction.md +0 -15
  107. package/docs/examples/vectorsdb/get-usage.md +0 -16
  108. package/docs/examples/vectorsdb/get.md +0 -15
  109. package/docs/examples/vectorsdb/list-collection-logs.md +0 -17
  110. package/docs/examples/vectorsdb/list-collections.md +0 -18
  111. package/docs/examples/vectorsdb/list-documents.md +0 -20
  112. package/docs/examples/vectorsdb/list-indexes.md +0 -18
  113. package/docs/examples/vectorsdb/list-transactions.md +0 -15
  114. package/docs/examples/vectorsdb/list-usage.md +0 -15
  115. package/docs/examples/vectorsdb/list.md +0 -17
  116. package/docs/examples/vectorsdb/update-collection.md +0 -21
  117. package/docs/examples/vectorsdb/update-document.md +0 -20
  118. package/docs/examples/vectorsdb/update-documents.md +0 -19
  119. package/docs/examples/vectorsdb/update-transaction.md +0 -17
  120. package/docs/examples/vectorsdb/update.md +0 -17
  121. package/docs/examples/vectorsdb/upsert-document.md +0 -20
  122. package/docs/examples/vectorsdb/upsert-documents.md +0 -18
  123. package/src/enums/documents-db-index-type.ts +0 -6
  124. package/src/enums/domain-purchase-payment-status.ts +0 -10
  125. package/src/enums/domain-transfer-status-status.ts +0 -10
  126. package/src/enums/model.ts +0 -3
  127. package/src/enums/vectors-db-index-type.ts +0 -8
  128. package/src/services/documents-db.ts +0 -2608
  129. package/src/services/vectors-db.ts +0 -2406
  130. package/types/enums/documents-db-index-type.d.ts +0 -6
  131. package/types/enums/domain-purchase-payment-status.d.ts +0 -10
  132. package/types/enums/domain-transfer-status-status.d.ts +0 -10
  133. package/types/enums/model.d.ts +0 -3
  134. package/types/enums/vectors-db-index-type.d.ts +0 -8
  135. package/types/services/documents-db.d.ts +0 -977
  136. package/types/services/vectors-db.d.ts +0 -854
@@ -75,7 +75,7 @@ export declare class Domains {
75
75
  */
76
76
  getPrice(domain: string, periodYears?: number, registrationType?: RegistrationType): Promise<Models.DomainPrice>;
77
77
  /**
78
- * Create a domain purchase with registrant information.
78
+ * Initiate a domain purchase by providing registrant details and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Purchase endpoint to capture the payment and finalize the purchase.
79
79
  *
80
80
  * @param {string} params.domain - Fully qualified domain name to purchase (for example, example.com).
81
81
  * @param {string} params.organizationId - Team ID that will own the domain.
@@ -88,6 +88,7 @@ export declare class Domains {
88
88
  * @param {string} params.addressLine3 - Additional address line for the registrant (line 3).
89
89
  * @param {string} params.companyName - Company or organization name for the registrant.
90
90
  * @param {number} params.periodYears - Registration term in years (1-10).
91
+ * @param {boolean} params.autoRenewal - Whether the domain should renew automatically after purchase.
91
92
  * @throws {AppwriteException}
92
93
  * @returns {Promise<Models.DomainPurchase>}
93
94
  */
@@ -103,9 +104,10 @@ export declare class Domains {
103
104
  addressLine3?: string;
104
105
  companyName?: string;
105
106
  periodYears?: number;
107
+ autoRenewal?: boolean;
106
108
  }): Promise<Models.DomainPurchase>;
107
109
  /**
108
- * Create a domain purchase with registrant information.
110
+ * Initiate a domain purchase by providing registrant details and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Purchase endpoint to capture the payment and finalize the purchase.
109
111
  *
110
112
  * @param {string} domain - Fully qualified domain name to purchase (for example, example.com).
111
113
  * @param {string} organizationId - Team ID that will own the domain.
@@ -118,13 +120,14 @@ export declare class Domains {
118
120
  * @param {string} addressLine3 - Additional address line for the registrant (line 3).
119
121
  * @param {string} companyName - Company or organization name for the registrant.
120
122
  * @param {number} periodYears - Registration term in years (1-10).
123
+ * @param {boolean} autoRenewal - Whether the domain should renew automatically after purchase.
121
124
  * @throws {AppwriteException}
122
125
  * @returns {Promise<Models.DomainPurchase>}
123
126
  * @deprecated Use the object parameter style method for a better developer experience.
124
127
  */
125
- createPurchase(domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number): Promise<Models.DomainPurchase>;
128
+ createPurchase(domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number, autoRenewal?: boolean): Promise<Models.DomainPurchase>;
126
129
  /**
127
- * Confirm and complete a domain purchase after payment authentication.
130
+ * Finalize a domain purchase initiated with Create Purchase. Verifies that any required 3D Secure authentication is complete, registers the domain, captures the payment, and provisions default DNS records. Returns a 402 error if authentication is still pending.
128
131
  *
129
132
  * @param {string} params.domainId - Domain ID to confirm purchase for.
130
133
  * @param {string} params.organizationId - Team ID that owns the domain.
@@ -136,7 +139,7 @@ export declare class Domains {
136
139
  organizationId: string;
137
140
  }): Promise<Models.DomainPurchase>;
138
141
  /**
139
- * Confirm and complete a domain purchase after payment authentication.
142
+ * Finalize a domain purchase initiated with Create Purchase. Verifies that any required 3D Secure authentication is complete, registers the domain, captures the payment, and provisions default DNS records. Returns a 402 error if authentication is still pending.
140
143
  *
141
144
  * @param {string} domainId - Domain ID to confirm purchase for.
142
145
  * @param {string} organizationId - Team ID that owns the domain.
@@ -180,12 +183,13 @@ export declare class Domains {
180
183
  */
181
184
  listSuggestions(query: string, tlds?: string[], limit?: number, filterType?: FilterType, priceMax?: number, priceMin?: number): Promise<Models.DomainSuggestionsList>;
182
185
  /**
183
- * Create a domain transfer in with authorization code and registrant information.
186
+ * Initiate a domain transfer-in by providing an authorization code, registrant details, and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Transfer In endpoint to capture the payment and submit the transfer.
184
187
  *
185
188
  * @param {string} params.domain - Domain name to transfer in.
186
189
  * @param {string} params.organizationId - Organization ID that this domain will belong to.
187
190
  * @param {string} params.authCode - Authorization code for the domain transfer.
188
191
  * @param {string} params.paymentMethodId - Payment method ID to authorize and capture the transfer.
192
+ * @param {boolean} params.autoRenewal - Whether the domain should renew automatically after transfer.
189
193
  * @throws {AppwriteException}
190
194
  * @returns {Promise<Models.DomainPurchase>}
191
195
  */
@@ -194,21 +198,23 @@ export declare class Domains {
194
198
  organizationId: string;
195
199
  authCode: string;
196
200
  paymentMethodId: string;
201
+ autoRenewal?: boolean;
197
202
  }): Promise<Models.DomainPurchase>;
198
203
  /**
199
- * Create a domain transfer in with authorization code and registrant information.
204
+ * Initiate a domain transfer-in by providing an authorization code, registrant details, and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Transfer In endpoint to capture the payment and submit the transfer.
200
205
  *
201
206
  * @param {string} domain - Domain name to transfer in.
202
207
  * @param {string} organizationId - Organization ID that this domain will belong to.
203
208
  * @param {string} authCode - Authorization code for the domain transfer.
204
209
  * @param {string} paymentMethodId - Payment method ID to authorize and capture the transfer.
210
+ * @param {boolean} autoRenewal - Whether the domain should renew automatically after transfer.
205
211
  * @throws {AppwriteException}
206
212
  * @returns {Promise<Models.DomainPurchase>}
207
213
  * @deprecated Use the object parameter style method for a better developer experience.
208
214
  */
209
- createTransferIn(domain: string, organizationId: string, authCode: string, paymentMethodId: string): Promise<Models.DomainPurchase>;
215
+ createTransferIn(domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean): Promise<Models.DomainPurchase>;
210
216
  /**
211
- * Confirm and complete a domain transfer in after payment authentication.
217
+ * Finalize a domain transfer-in initiated with Create Transfer In. Verifies that any required 3D Secure authentication is complete, submits the transfer with the authorization code, captures the payment, and sends a confirmation email. Returns a 402 error if authentication is still pending.
212
218
  *
213
219
  * @param {string} params.domainId - Domain ID to confirm transfer for.
214
220
  * @param {string} params.organizationId - Team ID that owns the domain.
@@ -220,7 +226,7 @@ export declare class Domains {
220
226
  organizationId: string;
221
227
  }): Promise<Models.DomainPurchase>;
222
228
  /**
223
- * Confirm and complete a domain transfer in after payment authentication.
229
+ * Finalize a domain transfer-in initiated with Create Transfer In. Verifies that any required 3D Secure authentication is complete, submits the transfer with the authorization code, captures the payment, and sends a confirmation email. Returns a 402 error if authentication is still pending.
224
230
  *
225
231
  * @param {string} domainId - Domain ID to confirm transfer for.
226
232
  * @param {string} organizationId - Team ID that owns the domain.
@@ -230,7 +236,7 @@ export declare class Domains {
230
236
  */
231
237
  updateTransferIn(domainId: string, organizationId: string): Promise<Models.DomainPurchase>;
232
238
  /**
233
- * Create a domain transfer out and return the authorization code.
239
+ * Initiate a domain transfer-out by generating an authorization code for the specified domain. The returned `authCode` should be provided to the gaining provider to complete the transfer. If the domain has auto-renewal enabled, it will be automatically disabled as part of this operation.
234
240
  *
235
241
  * @param {string} params.domainId - Domain unique ID.
236
242
  * @param {string} params.organizationId - Organization ID that this domain belongs to.
@@ -242,7 +248,7 @@ export declare class Domains {
242
248
  organizationId: string;
243
249
  }): Promise<Models.DomainTransferOut>;
244
250
  /**
245
- * Create a domain transfer out and return the authorization code.
251
+ * Initiate a domain transfer-out by generating an authorization code for the specified domain. The returned `authCode` should be provided to the gaining provider to complete the transfer. If the domain has auto-renewal enabled, it will be automatically disabled as part of this operation.
246
252
  *
247
253
  * @param {string} domainId - Domain unique ID.
248
254
  * @param {string} organizationId - Organization ID that this domain belongs to.
@@ -291,6 +297,28 @@ export declare class Domains {
291
297
  * @deprecated Use the object parameter style method for a better developer experience.
292
298
  */
293
299
  delete(domainId: string): Promise<{}>;
300
+ /**
301
+ * Enable or disable auto-renewal for a domain.
302
+ *
303
+ * @param {string} params.domainId - Domain unique ID.
304
+ * @param {boolean} params.autoRenewal - Whether the domain should renew automatically.
305
+ * @throws {AppwriteException}
306
+ * @returns {Promise<Models.Domain>}
307
+ */
308
+ updateAutoRenewal(params: {
309
+ domainId: string;
310
+ autoRenewal: boolean;
311
+ }): Promise<Models.Domain>;
312
+ /**
313
+ * Enable or disable auto-renewal for a domain.
314
+ *
315
+ * @param {string} domainId - Domain unique ID.
316
+ * @param {boolean} autoRenewal - Whether the domain should renew automatically.
317
+ * @throws {AppwriteException}
318
+ * @returns {Promise<Models.Domain>}
319
+ * @deprecated Use the object parameter style method for a better developer experience.
320
+ */
321
+ updateAutoRenewal(domainId: string, autoRenewal: boolean): Promise<Models.Domain>;
294
322
  /**
295
323
  * Verify which NS records are used and update the domain accordingly. This will check the domain's
296
324
  * nameservers and update the domain's status based on whether the nameservers match the expected
@@ -1433,7 +1461,7 @@ export declare class Domains {
1433
1461
  */
1434
1462
  updateTeam(domainId: string, teamId: string): Promise<Models.Domain>;
1435
1463
  /**
1436
- * Get the transfer status for a domain.
1464
+ * Retrieve the current transfer status for a domain. Returns the status, an optional reason, and a timestamp of the last status change.
1437
1465
  *
1438
1466
  * @param {string} params.domainId - Domain unique ID.
1439
1467
  * @throws {AppwriteException}
@@ -1443,7 +1471,7 @@ export declare class Domains {
1443
1471
  domainId: string;
1444
1472
  }): Promise<Models.DomainTransferStatus>;
1445
1473
  /**
1446
- * Get the transfer status for a domain.
1474
+ * Retrieve the current transfer status for a domain. Returns the status, an optional reason, and a timestamp of the last status change.
1447
1475
  *
1448
1476
  * @param {string} domainId - Domain unique ID.
1449
1477
  * @throws {AppwriteException}
@@ -30,15 +30,31 @@ export declare class Project {
30
30
  */
31
31
  getUsage(startDate: string, endDate: string, period?: ProjectUsageRange): Promise<Models.UsageProject>;
32
32
  /**
33
- * Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime.
33
+ * Get a list of all project environment variables.
34
34
  *
35
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret
36
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
35
37
  * @throws {AppwriteException}
36
38
  * @returns {Promise<Models.VariableList>}
37
39
  */
38
- listVariables(): Promise<Models.VariableList>;
40
+ listVariables(params?: {
41
+ queries?: string[];
42
+ total?: boolean;
43
+ }): Promise<Models.VariableList>;
39
44
  /**
40
- * Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.
45
+ * Get a list of all project environment variables.
41
46
  *
47
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret
48
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
49
+ * @throws {AppwriteException}
50
+ * @returns {Promise<Models.VariableList>}
51
+ * @deprecated Use the object parameter style method for a better developer experience.
52
+ */
53
+ listVariables(queries?: string[], total?: boolean): Promise<Models.VariableList>;
54
+ /**
55
+ * Create a new project environment variable. These variables can be accessed by all functions and sites in the project.
56
+ *
57
+ * @param {string} params.variableId - Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
42
58
  * @param {string} params.key - Variable key. Max length: 255 chars.
43
59
  * @param {string} params.value - Variable value. Max length: 8192 chars.
44
60
  * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
@@ -46,13 +62,15 @@ export declare class Project {
46
62
  * @returns {Promise<Models.Variable>}
47
63
  */
48
64
  createVariable(params: {
65
+ variableId: string;
49
66
  key: string;
50
67
  value: string;
51
68
  secret?: boolean;
52
69
  }): Promise<Models.Variable>;
53
70
  /**
54
- * Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.
71
+ * Create a new project environment variable. These variables can be accessed by all functions and sites in the project.
55
72
  *
73
+ * @param {string} variableId - Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
56
74
  * @param {string} key - Variable key. Max length: 255 chars.
57
75
  * @param {string} value - Variable value. Max length: 8192 chars.
58
76
  * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
@@ -60,11 +78,11 @@ export declare class Project {
60
78
  * @returns {Promise<Models.Variable>}
61
79
  * @deprecated Use the object parameter style method for a better developer experience.
62
80
  */
63
- createVariable(key: string, value: string, secret?: boolean): Promise<Models.Variable>;
81
+ createVariable(variableId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
64
82
  /**
65
- * Get a project variable by its unique ID.
83
+ * Get a variable by its unique ID.
66
84
  *
67
- * @param {string} params.variableId - Variable unique ID.
85
+ * @param {string} params.variableId - Variable ID.
68
86
  * @throws {AppwriteException}
69
87
  * @returns {Promise<Models.Variable>}
70
88
  */
@@ -72,18 +90,18 @@ export declare class Project {
72
90
  variableId: string;
73
91
  }): Promise<Models.Variable>;
74
92
  /**
75
- * Get a project variable by its unique ID.
93
+ * Get a variable by its unique ID.
76
94
  *
77
- * @param {string} variableId - Variable unique ID.
95
+ * @param {string} variableId - Variable ID.
78
96
  * @throws {AppwriteException}
79
97
  * @returns {Promise<Models.Variable>}
80
98
  * @deprecated Use the object parameter style method for a better developer experience.
81
99
  */
82
100
  getVariable(variableId: string): Promise<Models.Variable>;
83
101
  /**
84
- * Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime.
102
+ * Update variable by its unique ID.
85
103
  *
86
- * @param {string} params.variableId - Variable unique ID.
104
+ * @param {string} params.variableId - Variable ID.
87
105
  * @param {string} params.key - Variable key. Max length: 255 chars.
88
106
  * @param {string} params.value - Variable value. Max length: 8192 chars.
89
107
  * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
@@ -92,14 +110,14 @@ export declare class Project {
92
110
  */
93
111
  updateVariable(params: {
94
112
  variableId: string;
95
- key: string;
113
+ key?: string;
96
114
  value?: string;
97
115
  secret?: boolean;
98
116
  }): Promise<Models.Variable>;
99
117
  /**
100
- * Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime.
118
+ * Update variable by its unique ID.
101
119
  *
102
- * @param {string} variableId - Variable unique ID.
120
+ * @param {string} variableId - Variable ID.
103
121
  * @param {string} key - Variable key. Max length: 255 chars.
104
122
  * @param {string} value - Variable value. Max length: 8192 chars.
105
123
  * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
@@ -107,11 +125,11 @@ export declare class Project {
107
125
  * @returns {Promise<Models.Variable>}
108
126
  * @deprecated Use the object parameter style method for a better developer experience.
109
127
  */
110
- updateVariable(variableId: string, key: string, value?: string, secret?: boolean): Promise<Models.Variable>;
128
+ updateVariable(variableId: string, key?: string, value?: string, secret?: boolean): Promise<Models.Variable>;
111
129
  /**
112
- * Delete a project variable by its unique ID.
130
+ * Delete a variable by its unique ID.
113
131
  *
114
- * @param {string} params.variableId - Variable unique ID.
132
+ * @param {string} params.variableId - Variable ID.
115
133
  * @throws {AppwriteException}
116
134
  * @returns {Promise<{}>}
117
135
  */
@@ -119,9 +137,9 @@ export declare class Project {
119
137
  variableId: string;
120
138
  }): Promise<{}>;
121
139
  /**
122
- * Delete a project variable by its unique ID.
140
+ * Delete a variable by its unique ID.
123
141
  *
124
- * @param {string} variableId - Variable unique ID.
142
+ * @param {string} variableId - Variable ID.
125
143
  * @throws {AppwriteException}
126
144
  * @returns {Promise<{}>}
127
145
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -1,33 +1,33 @@
1
1
  import { Client } from '../client';
2
2
  import { Channel, ActionableChannel, ResolvedChannel } from '../channel';
3
3
  import { Query } from '../query';
4
- export declare type RealtimeSubscription = {
4
+ export type RealtimeSubscription = {
5
5
  close: () => Promise<void>;
6
6
  };
7
- export declare type RealtimeCallback<T = any> = {
7
+ export type RealtimeCallback<T = any> = {
8
8
  channels: Set<string>;
9
9
  queries: string[];
10
10
  callback: (event: RealtimeResponseEvent<T>) => void;
11
11
  };
12
- export declare type RealtimeResponse = {
12
+ export type RealtimeResponse = {
13
13
  type: string;
14
14
  data?: any;
15
15
  };
16
- export declare type RealtimeResponseEvent<T = any> = {
16
+ export type RealtimeResponseEvent<T = any> = {
17
17
  events: string[];
18
18
  channels: string[];
19
19
  timestamp: string;
20
20
  payload: T;
21
21
  subscriptions: string[];
22
22
  };
23
- export declare type RealtimeResponseConnected = {
23
+ export type RealtimeResponseConnected = {
24
24
  channels: string[];
25
25
  user?: object;
26
26
  subscriptions?: {
27
27
  [slot: string]: string;
28
28
  };
29
29
  };
30
- export declare type RealtimeRequest = {
30
+ export type RealtimeRequest = {
31
31
  type: 'authentication';
32
32
  data: {
33
33
  session: string;
@@ -10,7 +10,7 @@ export declare class Users {
10
10
  /**
11
11
  * Get a list of all the project's users. You can use the query params to filter your results.
12
12
  *
13
- * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels
13
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator
14
14
  * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
15
15
  * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
16
16
  * @throws {AppwriteException}
@@ -24,7 +24,7 @@ export declare class Users {
24
24
  /**
25
25
  * Get a list of all the project's users. You can use the query params to filter your results.
26
26
  *
27
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels
27
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator
28
28
  * @param {string} search - Search term to filter your list results. Max length: 256 chars.
29
29
  * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
30
30
  * @throws {AppwriteException}
@@ -411,6 +411,30 @@ export declare class Users {
411
411
  * @deprecated Use the object parameter style method for a better developer experience.
412
412
  */
413
413
  updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string): Promise<Models.User<Preferences>>;
414
+ /**
415
+ * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.
416
+ *
417
+ *
418
+ * @param {string} params.userId - User ID.
419
+ * @param {boolean} params.impersonator - Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.
420
+ * @throws {AppwriteException}
421
+ * @returns {Promise<Models.User<Preferences>>}
422
+ */
423
+ updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
424
+ userId: string;
425
+ impersonator: boolean;
426
+ }): Promise<Models.User<Preferences>>;
427
+ /**
428
+ * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.
429
+ *
430
+ *
431
+ * @param {string} userId - User ID.
432
+ * @param {boolean} impersonator - Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.
433
+ * @throws {AppwriteException}
434
+ * @returns {Promise<Models.User<Preferences>>}
435
+ * @deprecated Use the object parameter style method for a better developer experience.
436
+ */
437
+ updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, impersonator: boolean): Promise<Models.User<Preferences>>;
414
438
  /**
415
439
  * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
416
440
  *
@@ -1,22 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.createCollection({
11
- databaseId: '<DATABASE_ID>',
12
- collectionId: '<COLLECTION_ID>',
13
- name: '<NAME>',
14
- permissions: [Permission.read(Role.any())], // optional
15
- documentSecurity: false, // optional
16
- enabled: false, // optional
17
- attributes: [], // optional
18
- indexes: [] // optional
19
- });
20
-
21
- console.log(result);
22
- ```
@@ -1,25 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.createDocument({
11
- databaseId: '<DATABASE_ID>',
12
- collectionId: '<COLLECTION_ID>',
13
- documentId: '<DOCUMENT_ID>',
14
- data: {
15
- "username": "walter.obrien",
16
- "email": "walter.obrien@example.com",
17
- "fullName": "Walter O'Brien",
18
- "age": 30,
19
- "isAdmin": false
20
- },
21
- permissions: [Permission.read(Role.any())] // optional
22
- });
23
-
24
- console.log(result);
25
- ```
@@ -1,17 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.createDocuments({
11
- databaseId: '<DATABASE_ID>',
12
- collectionId: '<COLLECTION_ID>',
13
- documents: []
14
- });
15
-
16
- console.log(result);
17
- ```
@@ -1,21 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB, DocumentsDBIndexType, OrderBy } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.createIndex({
11
- databaseId: '<DATABASE_ID>',
12
- collectionId: '<COLLECTION_ID>',
13
- key: '',
14
- type: DocumentsDBIndexType.Key,
15
- attributes: [],
16
- orders: [OrderBy.Asc], // optional
17
- lengths: [] // optional
18
- });
19
-
20
- console.log(result);
21
- ```
@@ -1,15 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.createTransaction({
11
- ttl: 60 // optional
12
- });
13
-
14
- console.log(result);
15
- ```
@@ -1,17 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.create({
11
- databaseId: '<DATABASE_ID>',
12
- name: '<NAME>',
13
- enabled: false // optional
14
- });
15
-
16
- console.log(result);
17
- ```
@@ -1,21 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.decrementDocumentAttribute({
11
- databaseId: '<DATABASE_ID>',
12
- collectionId: '<COLLECTION_ID>',
13
- documentId: '<DOCUMENT_ID>',
14
- attribute: '',
15
- value: null, // optional
16
- min: null, // optional
17
- transactionId: '<TRANSACTION_ID>' // optional
18
- });
19
-
20
- console.log(result);
21
- ```
@@ -1,16 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.deleteCollection({
11
- databaseId: '<DATABASE_ID>',
12
- collectionId: '<COLLECTION_ID>'
13
- });
14
-
15
- console.log(result);
16
- ```
@@ -1,18 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.deleteDocument({
11
- databaseId: '<DATABASE_ID>',
12
- collectionId: '<COLLECTION_ID>',
13
- documentId: '<DOCUMENT_ID>',
14
- transactionId: '<TRANSACTION_ID>' // optional
15
- });
16
-
17
- console.log(result);
18
- ```
@@ -1,18 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.deleteDocuments({
11
- databaseId: '<DATABASE_ID>',
12
- collectionId: '<COLLECTION_ID>',
13
- queries: [], // optional
14
- transactionId: '<TRANSACTION_ID>' // optional
15
- });
16
-
17
- console.log(result);
18
- ```
@@ -1,17 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.deleteIndex({
11
- databaseId: '<DATABASE_ID>',
12
- collectionId: '<COLLECTION_ID>',
13
- key: ''
14
- });
15
-
16
- console.log(result);
17
- ```
@@ -1,15 +0,0 @@
1
- ```javascript
2
- import { Client, DocumentsDB } from "@appwrite.io/console";
3
-
4
- const client = new Client()
5
- .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
- .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
-
8
- const documentsDB = new DocumentsDB(client);
9
-
10
- const result = await documentsDB.deleteTransaction({
11
- transactionId: '<TRANSACTION_ID>'
12
- });
13
-
14
- console.log(result);
15
- ```