@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.
- package/.github/workflows/autoclose.yml +11 -0
- package/CHANGELOG.md +23 -0
- package/README.md +2 -2
- package/dist/cjs/sdk.js +10580 -13225
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +10709 -13348
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +10304 -12936
- package/docs/examples/domains/create-purchase.md +2 -1
- package/docs/examples/domains/create-transfer-in.md +2 -1
- package/docs/examples/domains/{confirm-purchase.md → update-auto-renewal.md} +2 -2
- package/docs/examples/project/create-variable.md +1 -0
- package/docs/examples/project/list-variables.md +4 -1
- package/docs/examples/project/update-variable.md +1 -1
- package/docs/examples/{documentsdb/delete.md → users/update-impersonator.md} +5 -4
- package/package.json +7 -7
- package/rollup.config.js +2 -1
- package/src/client.ts +50 -2
- package/src/enums/build-runtime.ts +0 -92
- package/src/enums/runtime.ts +0 -92
- package/src/enums/runtimes.ts +0 -92
- package/src/enums/scopes.ts +13 -2
- package/src/enums/template-reference-type.ts +1 -1
- package/src/enums/use-cases.ts +7 -2
- package/src/index.ts +0 -5
- package/src/models.ts +23 -435
- package/src/services/domains.ts +103 -26
- package/src/services/project.ts +76 -33
- package/src/services/users.ts +67 -2
- package/types/channel.d.ts +3 -3
- package/types/client.d.ts +37 -4
- package/types/enums/build-runtime.d.ts +1 -93
- package/types/enums/runtime.d.ts +1 -93
- package/types/enums/runtimes.d.ts +1 -93
- package/types/enums/scopes.d.ts +14 -3
- package/types/enums/template-reference-type.d.ts +1 -1
- package/types/enums/use-cases.d.ts +7 -2
- package/types/index.d.ts +0 -5
- package/types/models.d.ts +23 -423
- package/types/operator.d.ts +3 -3
- package/types/query.d.ts +4 -4
- package/types/services/domains.d.ts +42 -14
- package/types/services/project.d.ts +37 -19
- package/types/services/realtime.d.ts +6 -6
- package/types/services/users.d.ts +26 -2
- package/docs/examples/documentsdb/create-collection.md +0 -22
- package/docs/examples/documentsdb/create-document.md +0 -25
- package/docs/examples/documentsdb/create-documents.md +0 -17
- package/docs/examples/documentsdb/create-index.md +0 -21
- package/docs/examples/documentsdb/create-transaction.md +0 -15
- package/docs/examples/documentsdb/create.md +0 -17
- package/docs/examples/documentsdb/decrement-document-attribute.md +0 -21
- package/docs/examples/documentsdb/delete-collection.md +0 -16
- package/docs/examples/documentsdb/delete-document.md +0 -18
- package/docs/examples/documentsdb/delete-documents.md +0 -18
- package/docs/examples/documentsdb/delete-index.md +0 -17
- package/docs/examples/documentsdb/delete-transaction.md +0 -15
- package/docs/examples/documentsdb/get-collection-usage.md +0 -17
- package/docs/examples/documentsdb/get-collection.md +0 -16
- package/docs/examples/documentsdb/get-document.md +0 -19
- package/docs/examples/documentsdb/get-index.md +0 -17
- package/docs/examples/documentsdb/get-transaction.md +0 -15
- package/docs/examples/documentsdb/get-usage.md +0 -16
- package/docs/examples/documentsdb/get.md +0 -15
- package/docs/examples/documentsdb/increment-document-attribute.md +0 -21
- package/docs/examples/documentsdb/list-collection-logs.md +0 -17
- package/docs/examples/documentsdb/list-collections.md +0 -18
- package/docs/examples/documentsdb/list-document-logs.md +0 -18
- package/docs/examples/documentsdb/list-documents.md +0 -20
- package/docs/examples/documentsdb/list-indexes.md +0 -18
- package/docs/examples/documentsdb/list-transactions.md +0 -15
- package/docs/examples/documentsdb/list-usage.md +0 -15
- package/docs/examples/documentsdb/list.md +0 -17
- package/docs/examples/documentsdb/update-collection.md +0 -20
- package/docs/examples/documentsdb/update-document.md +0 -20
- package/docs/examples/documentsdb/update-documents.md +0 -19
- package/docs/examples/documentsdb/update-transaction.md +0 -17
- package/docs/examples/documentsdb/update.md +0 -17
- package/docs/examples/documentsdb/upsert-document.md +0 -20
- package/docs/examples/documentsdb/upsert-documents.md +0 -18
- package/docs/examples/domains/confirm-transfer-in.md +0 -16
- package/docs/examples/projects/create-webhook.md +0 -22
- package/docs/examples/projects/delete-webhook.md +0 -16
- package/docs/examples/projects/get-webhook.md +0 -16
- package/docs/examples/projects/list-webhooks.md +0 -16
- package/docs/examples/projects/update-webhook-signature.md +0 -16
- package/docs/examples/projects/update-webhook.md +0 -23
- package/docs/examples/vectorsdb/create-collection.md +0 -21
- package/docs/examples/vectorsdb/create-document.md +0 -29
- package/docs/examples/vectorsdb/create-documents.md +0 -17
- package/docs/examples/vectorsdb/create-index.md +0 -21
- package/docs/examples/vectorsdb/create-operations.md +0 -26
- package/docs/examples/vectorsdb/create-text-embeddings.md +0 -16
- package/docs/examples/vectorsdb/create-transaction.md +0 -15
- package/docs/examples/vectorsdb/create.md +0 -17
- package/docs/examples/vectorsdb/delete-collection.md +0 -16
- package/docs/examples/vectorsdb/delete-document.md +0 -18
- package/docs/examples/vectorsdb/delete-documents.md +0 -18
- package/docs/examples/vectorsdb/delete-index.md +0 -17
- package/docs/examples/vectorsdb/delete-transaction.md +0 -15
- package/docs/examples/vectorsdb/delete.md +0 -15
- package/docs/examples/vectorsdb/get-collection-usage.md +0 -17
- package/docs/examples/vectorsdb/get-collection.md +0 -16
- package/docs/examples/vectorsdb/get-document.md +0 -19
- package/docs/examples/vectorsdb/get-index.md +0 -17
- package/docs/examples/vectorsdb/get-transaction.md +0 -15
- package/docs/examples/vectorsdb/get-usage.md +0 -16
- package/docs/examples/vectorsdb/get.md +0 -15
- package/docs/examples/vectorsdb/list-collection-logs.md +0 -17
- package/docs/examples/vectorsdb/list-collections.md +0 -18
- package/docs/examples/vectorsdb/list-documents.md +0 -20
- package/docs/examples/vectorsdb/list-indexes.md +0 -18
- package/docs/examples/vectorsdb/list-transactions.md +0 -15
- package/docs/examples/vectorsdb/list-usage.md +0 -15
- package/docs/examples/vectorsdb/list.md +0 -17
- package/docs/examples/vectorsdb/update-collection.md +0 -21
- package/docs/examples/vectorsdb/update-document.md +0 -20
- package/docs/examples/vectorsdb/update-documents.md +0 -19
- package/docs/examples/vectorsdb/update-transaction.md +0 -17
- package/docs/examples/vectorsdb/update.md +0 -17
- package/docs/examples/vectorsdb/upsert-document.md +0 -20
- package/docs/examples/vectorsdb/upsert-documents.md +0 -18
- package/src/enums/documents-db-index-type.ts +0 -6
- package/src/enums/domain-purchase-payment-status.ts +0 -10
- package/src/enums/domain-transfer-status-status.ts +0 -10
- package/src/enums/model.ts +0 -3
- package/src/enums/vectors-db-index-type.ts +0 -8
- package/src/services/documents-db.ts +0 -2608
- package/src/services/vectors-db.ts +0 -2406
- package/types/enums/documents-db-index-type.d.ts +0 -6
- package/types/enums/domain-purchase-payment-status.d.ts +0 -10
- package/types/enums/domain-transfer-status-status.d.ts +0 -10
- package/types/enums/model.d.ts +0 -3
- package/types/enums/vectors-db-index-type.d.ts +0 -8
- package/types/services/documents-db.d.ts +0 -977
- package/types/services/vectors-db.d.ts +0 -854
package/src/services/domains.ts
CHANGED
|
@@ -207,7 +207,7 @@ export class Domains {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
|
-
*
|
|
210
|
+
* 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.
|
|
211
211
|
*
|
|
212
212
|
* @param {string} params.domain - Fully qualified domain name to purchase (for example, example.com).
|
|
213
213
|
* @param {string} params.organizationId - Team ID that will own the domain.
|
|
@@ -220,12 +220,13 @@ export class Domains {
|
|
|
220
220
|
* @param {string} params.addressLine3 - Additional address line for the registrant (line 3).
|
|
221
221
|
* @param {string} params.companyName - Company or organization name for the registrant.
|
|
222
222
|
* @param {number} params.periodYears - Registration term in years (1-10).
|
|
223
|
+
* @param {boolean} params.autoRenewal - Whether the domain should renew automatically after purchase.
|
|
223
224
|
* @throws {AppwriteException}
|
|
224
225
|
* @returns {Promise<Models.DomainPurchase>}
|
|
225
226
|
*/
|
|
226
|
-
createPurchase(params: { 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>;
|
|
227
|
+
createPurchase(params: { 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>;
|
|
227
228
|
/**
|
|
228
|
-
*
|
|
229
|
+
* 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.
|
|
229
230
|
*
|
|
230
231
|
* @param {string} domain - Fully qualified domain name to purchase (for example, example.com).
|
|
231
232
|
* @param {string} organizationId - Team ID that will own the domain.
|
|
@@ -238,19 +239,20 @@ export class Domains {
|
|
|
238
239
|
* @param {string} addressLine3 - Additional address line for the registrant (line 3).
|
|
239
240
|
* @param {string} companyName - Company or organization name for the registrant.
|
|
240
241
|
* @param {number} periodYears - Registration term in years (1-10).
|
|
242
|
+
* @param {boolean} autoRenewal - Whether the domain should renew automatically after purchase.
|
|
241
243
|
* @throws {AppwriteException}
|
|
242
244
|
* @returns {Promise<Models.DomainPurchase>}
|
|
243
245
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
244
246
|
*/
|
|
245
|
-
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>;
|
|
247
|
+
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>;
|
|
246
248
|
createPurchase(
|
|
247
|
-
paramsOrFirst: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number } | string,
|
|
248
|
-
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
|
|
249
|
+
paramsOrFirst: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number, autoRenewal?: boolean } | string,
|
|
250
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (boolean)?]
|
|
249
251
|
): Promise<Models.DomainPurchase> {
|
|
250
|
-
let params: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number };
|
|
252
|
+
let params: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number, autoRenewal?: boolean };
|
|
251
253
|
|
|
252
254
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
253
|
-
params = (paramsOrFirst || {}) as { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number };
|
|
255
|
+
params = (paramsOrFirst || {}) as { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number, autoRenewal?: boolean };
|
|
254
256
|
} else {
|
|
255
257
|
params = {
|
|
256
258
|
domain: paramsOrFirst as string,
|
|
@@ -263,7 +265,8 @@ export class Domains {
|
|
|
263
265
|
paymentMethodId: rest[6] as string,
|
|
264
266
|
addressLine3: rest[7] as string,
|
|
265
267
|
companyName: rest[8] as string,
|
|
266
|
-
periodYears: rest[9] as number
|
|
268
|
+
periodYears: rest[9] as number,
|
|
269
|
+
autoRenewal: rest[10] as boolean
|
|
267
270
|
};
|
|
268
271
|
}
|
|
269
272
|
|
|
@@ -278,6 +281,7 @@ export class Domains {
|
|
|
278
281
|
const addressLine3 = params.addressLine3;
|
|
279
282
|
const companyName = params.companyName;
|
|
280
283
|
const periodYears = params.periodYears;
|
|
284
|
+
const autoRenewal = params.autoRenewal;
|
|
281
285
|
|
|
282
286
|
if (typeof domain === 'undefined') {
|
|
283
287
|
throw new AppwriteException('Missing required parameter: "domain"');
|
|
@@ -336,6 +340,9 @@ export class Domains {
|
|
|
336
340
|
if (typeof periodYears !== 'undefined') {
|
|
337
341
|
payload['periodYears'] = periodYears;
|
|
338
342
|
}
|
|
343
|
+
if (typeof autoRenewal !== 'undefined') {
|
|
344
|
+
payload['autoRenewal'] = autoRenewal;
|
|
345
|
+
}
|
|
339
346
|
if (typeof paymentMethodId !== 'undefined') {
|
|
340
347
|
payload['paymentMethodId'] = paymentMethodId;
|
|
341
348
|
}
|
|
@@ -354,7 +361,7 @@ export class Domains {
|
|
|
354
361
|
}
|
|
355
362
|
|
|
356
363
|
/**
|
|
357
|
-
*
|
|
364
|
+
* 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.
|
|
358
365
|
*
|
|
359
366
|
* @param {string} params.domainId - Domain ID to confirm purchase for.
|
|
360
367
|
* @param {string} params.organizationId - Team ID that owns the domain.
|
|
@@ -363,7 +370,7 @@ export class Domains {
|
|
|
363
370
|
*/
|
|
364
371
|
updatePurchase(params: { domainId: string, organizationId: string }): Promise<Models.DomainPurchase>;
|
|
365
372
|
/**
|
|
366
|
-
*
|
|
373
|
+
* 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.
|
|
367
374
|
*
|
|
368
375
|
* @param {string} domainId - Domain ID to confirm purchase for.
|
|
369
376
|
* @param {string} organizationId - Team ID that owns the domain.
|
|
@@ -507,42 +514,45 @@ export class Domains {
|
|
|
507
514
|
}
|
|
508
515
|
|
|
509
516
|
/**
|
|
510
|
-
*
|
|
517
|
+
* 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.
|
|
511
518
|
*
|
|
512
519
|
* @param {string} params.domain - Domain name to transfer in.
|
|
513
520
|
* @param {string} params.organizationId - Organization ID that this domain will belong to.
|
|
514
521
|
* @param {string} params.authCode - Authorization code for the domain transfer.
|
|
515
522
|
* @param {string} params.paymentMethodId - Payment method ID to authorize and capture the transfer.
|
|
523
|
+
* @param {boolean} params.autoRenewal - Whether the domain should renew automatically after transfer.
|
|
516
524
|
* @throws {AppwriteException}
|
|
517
525
|
* @returns {Promise<Models.DomainPurchase>}
|
|
518
526
|
*/
|
|
519
|
-
createTransferIn(params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string }): Promise<Models.DomainPurchase>;
|
|
527
|
+
createTransferIn(params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean }): Promise<Models.DomainPurchase>;
|
|
520
528
|
/**
|
|
521
|
-
*
|
|
529
|
+
* 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.
|
|
522
530
|
*
|
|
523
531
|
* @param {string} domain - Domain name to transfer in.
|
|
524
532
|
* @param {string} organizationId - Organization ID that this domain will belong to.
|
|
525
533
|
* @param {string} authCode - Authorization code for the domain transfer.
|
|
526
534
|
* @param {string} paymentMethodId - Payment method ID to authorize and capture the transfer.
|
|
535
|
+
* @param {boolean} autoRenewal - Whether the domain should renew automatically after transfer.
|
|
527
536
|
* @throws {AppwriteException}
|
|
528
537
|
* @returns {Promise<Models.DomainPurchase>}
|
|
529
538
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
530
539
|
*/
|
|
531
|
-
createTransferIn(domain: string, organizationId: string, authCode: string, paymentMethodId: string): Promise<Models.DomainPurchase>;
|
|
540
|
+
createTransferIn(domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean): Promise<Models.DomainPurchase>;
|
|
532
541
|
createTransferIn(
|
|
533
|
-
paramsOrFirst: { domain: string, organizationId: string, authCode: string, paymentMethodId: string } | string,
|
|
534
|
-
...rest: [(string)?, (string)?, (string)?]
|
|
542
|
+
paramsOrFirst: { domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean } | string,
|
|
543
|
+
...rest: [(string)?, (string)?, (string)?, (boolean)?]
|
|
535
544
|
): Promise<Models.DomainPurchase> {
|
|
536
|
-
let params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string };
|
|
545
|
+
let params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean };
|
|
537
546
|
|
|
538
547
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
539
|
-
params = (paramsOrFirst || {}) as { domain: string, organizationId: string, authCode: string, paymentMethodId: string };
|
|
548
|
+
params = (paramsOrFirst || {}) as { domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean };
|
|
540
549
|
} else {
|
|
541
550
|
params = {
|
|
542
551
|
domain: paramsOrFirst as string,
|
|
543
552
|
organizationId: rest[0] as string,
|
|
544
553
|
authCode: rest[1] as string,
|
|
545
|
-
paymentMethodId: rest[2] as string
|
|
554
|
+
paymentMethodId: rest[2] as string,
|
|
555
|
+
autoRenewal: rest[3] as boolean
|
|
546
556
|
};
|
|
547
557
|
}
|
|
548
558
|
|
|
@@ -550,6 +560,7 @@ export class Domains {
|
|
|
550
560
|
const organizationId = params.organizationId;
|
|
551
561
|
const authCode = params.authCode;
|
|
552
562
|
const paymentMethodId = params.paymentMethodId;
|
|
563
|
+
const autoRenewal = params.autoRenewal;
|
|
553
564
|
|
|
554
565
|
if (typeof domain === 'undefined') {
|
|
555
566
|
throw new AppwriteException('Missing required parameter: "domain"');
|
|
@@ -575,6 +586,9 @@ export class Domains {
|
|
|
575
586
|
if (typeof authCode !== 'undefined') {
|
|
576
587
|
payload['authCode'] = authCode;
|
|
577
588
|
}
|
|
589
|
+
if (typeof autoRenewal !== 'undefined') {
|
|
590
|
+
payload['autoRenewal'] = autoRenewal;
|
|
591
|
+
}
|
|
578
592
|
if (typeof paymentMethodId !== 'undefined') {
|
|
579
593
|
payload['paymentMethodId'] = paymentMethodId;
|
|
580
594
|
}
|
|
@@ -593,7 +607,7 @@ export class Domains {
|
|
|
593
607
|
}
|
|
594
608
|
|
|
595
609
|
/**
|
|
596
|
-
*
|
|
610
|
+
* 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.
|
|
597
611
|
*
|
|
598
612
|
* @param {string} params.domainId - Domain ID to confirm transfer for.
|
|
599
613
|
* @param {string} params.organizationId - Team ID that owns the domain.
|
|
@@ -602,7 +616,7 @@ export class Domains {
|
|
|
602
616
|
*/
|
|
603
617
|
updateTransferIn(params: { domainId: string, organizationId: string }): Promise<Models.DomainPurchase>;
|
|
604
618
|
/**
|
|
605
|
-
*
|
|
619
|
+
* 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.
|
|
606
620
|
*
|
|
607
621
|
* @param {string} domainId - Domain ID to confirm transfer for.
|
|
608
622
|
* @param {string} organizationId - Team ID that owns the domain.
|
|
@@ -656,7 +670,7 @@ export class Domains {
|
|
|
656
670
|
}
|
|
657
671
|
|
|
658
672
|
/**
|
|
659
|
-
*
|
|
673
|
+
* 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.
|
|
660
674
|
*
|
|
661
675
|
* @param {string} params.domainId - Domain unique ID.
|
|
662
676
|
* @param {string} params.organizationId - Organization ID that this domain belongs to.
|
|
@@ -665,7 +679,7 @@ export class Domains {
|
|
|
665
679
|
*/
|
|
666
680
|
createTransferOut(params: { domainId: string, organizationId: string }): Promise<Models.DomainTransferOut>;
|
|
667
681
|
/**
|
|
668
|
-
*
|
|
682
|
+
* 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.
|
|
669
683
|
*
|
|
670
684
|
* @param {string} domainId - Domain unique ID.
|
|
671
685
|
* @param {string} organizationId - Organization ID that this domain belongs to.
|
|
@@ -826,6 +840,69 @@ export class Domains {
|
|
|
826
840
|
);
|
|
827
841
|
}
|
|
828
842
|
|
|
843
|
+
/**
|
|
844
|
+
* Enable or disable auto-renewal for a domain.
|
|
845
|
+
*
|
|
846
|
+
* @param {string} params.domainId - Domain unique ID.
|
|
847
|
+
* @param {boolean} params.autoRenewal - Whether the domain should renew automatically.
|
|
848
|
+
* @throws {AppwriteException}
|
|
849
|
+
* @returns {Promise<Models.Domain>}
|
|
850
|
+
*/
|
|
851
|
+
updateAutoRenewal(params: { domainId: string, autoRenewal: boolean }): Promise<Models.Domain>;
|
|
852
|
+
/**
|
|
853
|
+
* Enable or disable auto-renewal for a domain.
|
|
854
|
+
*
|
|
855
|
+
* @param {string} domainId - Domain unique ID.
|
|
856
|
+
* @param {boolean} autoRenewal - Whether the domain should renew automatically.
|
|
857
|
+
* @throws {AppwriteException}
|
|
858
|
+
* @returns {Promise<Models.Domain>}
|
|
859
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
860
|
+
*/
|
|
861
|
+
updateAutoRenewal(domainId: string, autoRenewal: boolean): Promise<Models.Domain>;
|
|
862
|
+
updateAutoRenewal(
|
|
863
|
+
paramsOrFirst: { domainId: string, autoRenewal: boolean } | string,
|
|
864
|
+
...rest: [(boolean)?]
|
|
865
|
+
): Promise<Models.Domain> {
|
|
866
|
+
let params: { domainId: string, autoRenewal: boolean };
|
|
867
|
+
|
|
868
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
869
|
+
params = (paramsOrFirst || {}) as { domainId: string, autoRenewal: boolean };
|
|
870
|
+
} else {
|
|
871
|
+
params = {
|
|
872
|
+
domainId: paramsOrFirst as string,
|
|
873
|
+
autoRenewal: rest[0] as boolean
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
const domainId = params.domainId;
|
|
878
|
+
const autoRenewal = params.autoRenewal;
|
|
879
|
+
|
|
880
|
+
if (typeof domainId === 'undefined') {
|
|
881
|
+
throw new AppwriteException('Missing required parameter: "domainId"');
|
|
882
|
+
}
|
|
883
|
+
if (typeof autoRenewal === 'undefined') {
|
|
884
|
+
throw new AppwriteException('Missing required parameter: "autoRenewal"');
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
const apiPath = '/domains/{domainId}/auto-renewal'.replace('{domainId}', domainId);
|
|
888
|
+
const payload: Payload = {};
|
|
889
|
+
if (typeof autoRenewal !== 'undefined') {
|
|
890
|
+
payload['autoRenewal'] = autoRenewal;
|
|
891
|
+
}
|
|
892
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
893
|
+
|
|
894
|
+
const apiHeaders: { [header: string]: string } = {
|
|
895
|
+
'content-type': 'application/json',
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
return this.client.call(
|
|
899
|
+
'patch',
|
|
900
|
+
uri,
|
|
901
|
+
apiHeaders,
|
|
902
|
+
payload
|
|
903
|
+
);
|
|
904
|
+
}
|
|
905
|
+
|
|
829
906
|
/**
|
|
830
907
|
* Verify which NS records are used and update the domain accordingly. This will check the domain's
|
|
831
908
|
* nameservers and update the domain's status based on whether the nameservers match the expected
|
|
@@ -3817,7 +3894,7 @@ export class Domains {
|
|
|
3817
3894
|
}
|
|
3818
3895
|
|
|
3819
3896
|
/**
|
|
3820
|
-
*
|
|
3897
|
+
* Retrieve the current transfer status for a domain. Returns the status, an optional reason, and a timestamp of the last status change.
|
|
3821
3898
|
*
|
|
3822
3899
|
* @param {string} params.domainId - Domain unique ID.
|
|
3823
3900
|
* @throws {AppwriteException}
|
|
@@ -3825,7 +3902,7 @@ export class Domains {
|
|
|
3825
3902
|
*/
|
|
3826
3903
|
getTransferStatus(params: { domainId: string }): Promise<Models.DomainTransferStatus>;
|
|
3827
3904
|
/**
|
|
3828
|
-
*
|
|
3905
|
+
* Retrieve the current transfer status for a domain. Returns the status, an optional reason, and a timestamp of the last status change.
|
|
3829
3906
|
*
|
|
3830
3907
|
* @param {string} domainId - Domain unique ID.
|
|
3831
3908
|
* @throws {AppwriteException}
|
package/src/services/project.ts
CHANGED
|
@@ -84,15 +84,51 @@ export class Project {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
* Get a list of all project
|
|
87
|
+
* Get a list of all project environment variables.
|
|
88
88
|
*
|
|
89
|
+
* @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
|
|
90
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
89
91
|
* @throws {AppwriteException}
|
|
90
92
|
* @returns {Promise<Models.VariableList>}
|
|
91
93
|
*/
|
|
92
|
-
listVariables(): Promise<Models.VariableList
|
|
94
|
+
listVariables(params?: { queries?: string[], total?: boolean }): Promise<Models.VariableList>;
|
|
95
|
+
/**
|
|
96
|
+
* Get a list of all project environment variables.
|
|
97
|
+
*
|
|
98
|
+
* @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
|
|
99
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
100
|
+
* @throws {AppwriteException}
|
|
101
|
+
* @returns {Promise<Models.VariableList>}
|
|
102
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
103
|
+
*/
|
|
104
|
+
listVariables(queries?: string[], total?: boolean): Promise<Models.VariableList>;
|
|
105
|
+
listVariables(
|
|
106
|
+
paramsOrFirst?: { queries?: string[], total?: boolean } | string[],
|
|
107
|
+
...rest: [(boolean)?]
|
|
108
|
+
): Promise<Models.VariableList> {
|
|
109
|
+
let params: { queries?: string[], total?: boolean };
|
|
110
|
+
|
|
111
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
112
|
+
params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean };
|
|
113
|
+
} else {
|
|
114
|
+
params = {
|
|
115
|
+
queries: paramsOrFirst as string[],
|
|
116
|
+
total: rest[0] as boolean
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const queries = params.queries;
|
|
121
|
+
const total = params.total;
|
|
122
|
+
|
|
93
123
|
|
|
94
124
|
const apiPath = '/project/variables';
|
|
95
125
|
const payload: Payload = {};
|
|
126
|
+
if (typeof queries !== 'undefined') {
|
|
127
|
+
payload['queries'] = queries;
|
|
128
|
+
}
|
|
129
|
+
if (typeof total !== 'undefined') {
|
|
130
|
+
payload['total'] = total;
|
|
131
|
+
}
|
|
96
132
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
97
133
|
|
|
98
134
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -107,18 +143,20 @@ export class Project {
|
|
|
107
143
|
}
|
|
108
144
|
|
|
109
145
|
/**
|
|
110
|
-
* Create a new project variable.
|
|
146
|
+
* Create a new project environment variable. These variables can be accessed by all functions and sites in the project.
|
|
111
147
|
*
|
|
148
|
+
* @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.
|
|
112
149
|
* @param {string} params.key - Variable key. Max length: 255 chars.
|
|
113
150
|
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
|
114
151
|
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
115
152
|
* @throws {AppwriteException}
|
|
116
153
|
* @returns {Promise<Models.Variable>}
|
|
117
154
|
*/
|
|
118
|
-
createVariable(params: { key: string, value: string, secret?: boolean }): Promise<Models.Variable>;
|
|
155
|
+
createVariable(params: { variableId: string, key: string, value: string, secret?: boolean }): Promise<Models.Variable>;
|
|
119
156
|
/**
|
|
120
|
-
* Create a new project variable.
|
|
157
|
+
* Create a new project environment variable. These variables can be accessed by all functions and sites in the project.
|
|
121
158
|
*
|
|
159
|
+
* @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.
|
|
122
160
|
* @param {string} key - Variable key. Max length: 255 chars.
|
|
123
161
|
* @param {string} value - Variable value. Max length: 8192 chars.
|
|
124
162
|
* @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
@@ -126,27 +164,32 @@ export class Project {
|
|
|
126
164
|
* @returns {Promise<Models.Variable>}
|
|
127
165
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
128
166
|
*/
|
|
129
|
-
createVariable(key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
|
167
|
+
createVariable(variableId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
|
130
168
|
createVariable(
|
|
131
|
-
paramsOrFirst: { key: string, value: string, secret?: boolean } | string,
|
|
132
|
-
...rest: [(string)?, (boolean)?]
|
|
169
|
+
paramsOrFirst: { variableId: string, key: string, value: string, secret?: boolean } | string,
|
|
170
|
+
...rest: [(string)?, (string)?, (boolean)?]
|
|
133
171
|
): Promise<Models.Variable> {
|
|
134
|
-
let params: { key: string, value: string, secret?: boolean };
|
|
172
|
+
let params: { variableId: string, key: string, value: string, secret?: boolean };
|
|
135
173
|
|
|
136
174
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
137
|
-
params = (paramsOrFirst || {}) as { key: string, value: string, secret?: boolean };
|
|
175
|
+
params = (paramsOrFirst || {}) as { variableId: string, key: string, value: string, secret?: boolean };
|
|
138
176
|
} else {
|
|
139
177
|
params = {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
178
|
+
variableId: paramsOrFirst as string,
|
|
179
|
+
key: rest[0] as string,
|
|
180
|
+
value: rest[1] as string,
|
|
181
|
+
secret: rest[2] as boolean
|
|
143
182
|
};
|
|
144
183
|
}
|
|
145
184
|
|
|
185
|
+
const variableId = params.variableId;
|
|
146
186
|
const key = params.key;
|
|
147
187
|
const value = params.value;
|
|
148
188
|
const secret = params.secret;
|
|
149
189
|
|
|
190
|
+
if (typeof variableId === 'undefined') {
|
|
191
|
+
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
192
|
+
}
|
|
150
193
|
if (typeof key === 'undefined') {
|
|
151
194
|
throw new AppwriteException('Missing required parameter: "key"');
|
|
152
195
|
}
|
|
@@ -156,6 +199,9 @@ export class Project {
|
|
|
156
199
|
|
|
157
200
|
const apiPath = '/project/variables';
|
|
158
201
|
const payload: Payload = {};
|
|
202
|
+
if (typeof variableId !== 'undefined') {
|
|
203
|
+
payload['variableId'] = variableId;
|
|
204
|
+
}
|
|
159
205
|
if (typeof key !== 'undefined') {
|
|
160
206
|
payload['key'] = key;
|
|
161
207
|
}
|
|
@@ -180,17 +226,17 @@ export class Project {
|
|
|
180
226
|
}
|
|
181
227
|
|
|
182
228
|
/**
|
|
183
|
-
* Get a
|
|
229
|
+
* Get a variable by its unique ID.
|
|
184
230
|
*
|
|
185
|
-
* @param {string} params.variableId - Variable
|
|
231
|
+
* @param {string} params.variableId - Variable ID.
|
|
186
232
|
* @throws {AppwriteException}
|
|
187
233
|
* @returns {Promise<Models.Variable>}
|
|
188
234
|
*/
|
|
189
235
|
getVariable(params: { variableId: string }): Promise<Models.Variable>;
|
|
190
236
|
/**
|
|
191
|
-
* Get a
|
|
237
|
+
* Get a variable by its unique ID.
|
|
192
238
|
*
|
|
193
|
-
* @param {string} variableId - Variable
|
|
239
|
+
* @param {string} variableId - Variable ID.
|
|
194
240
|
* @throws {AppwriteException}
|
|
195
241
|
* @returns {Promise<Models.Variable>}
|
|
196
242
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
@@ -231,20 +277,20 @@ export class Project {
|
|
|
231
277
|
}
|
|
232
278
|
|
|
233
279
|
/**
|
|
234
|
-
* Update
|
|
280
|
+
* Update variable by its unique ID.
|
|
235
281
|
*
|
|
236
|
-
* @param {string} params.variableId - Variable
|
|
282
|
+
* @param {string} params.variableId - Variable ID.
|
|
237
283
|
* @param {string} params.key - Variable key. Max length: 255 chars.
|
|
238
284
|
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
|
239
285
|
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
240
286
|
* @throws {AppwriteException}
|
|
241
287
|
* @returns {Promise<Models.Variable>}
|
|
242
288
|
*/
|
|
243
|
-
updateVariable(params: { variableId: string, key
|
|
289
|
+
updateVariable(params: { variableId: string, key?: string, value?: string, secret?: boolean }): Promise<Models.Variable>;
|
|
244
290
|
/**
|
|
245
|
-
* Update
|
|
291
|
+
* Update variable by its unique ID.
|
|
246
292
|
*
|
|
247
|
-
* @param {string} variableId - Variable
|
|
293
|
+
* @param {string} variableId - Variable ID.
|
|
248
294
|
* @param {string} key - Variable key. Max length: 255 chars.
|
|
249
295
|
* @param {string} value - Variable value. Max length: 8192 chars.
|
|
250
296
|
* @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
@@ -252,15 +298,15 @@ export class Project {
|
|
|
252
298
|
* @returns {Promise<Models.Variable>}
|
|
253
299
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
254
300
|
*/
|
|
255
|
-
updateVariable(variableId: string, key
|
|
301
|
+
updateVariable(variableId: string, key?: string, value?: string, secret?: boolean): Promise<Models.Variable>;
|
|
256
302
|
updateVariable(
|
|
257
|
-
paramsOrFirst: { variableId: string, key
|
|
303
|
+
paramsOrFirst: { variableId: string, key?: string, value?: string, secret?: boolean } | string,
|
|
258
304
|
...rest: [(string)?, (string)?, (boolean)?]
|
|
259
305
|
): Promise<Models.Variable> {
|
|
260
|
-
let params: { variableId: string, key
|
|
306
|
+
let params: { variableId: string, key?: string, value?: string, secret?: boolean };
|
|
261
307
|
|
|
262
308
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
263
|
-
params = (paramsOrFirst || {}) as { variableId: string, key
|
|
309
|
+
params = (paramsOrFirst || {}) as { variableId: string, key?: string, value?: string, secret?: boolean };
|
|
264
310
|
} else {
|
|
265
311
|
params = {
|
|
266
312
|
variableId: paramsOrFirst as string,
|
|
@@ -278,9 +324,6 @@ export class Project {
|
|
|
278
324
|
if (typeof variableId === 'undefined') {
|
|
279
325
|
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
280
326
|
}
|
|
281
|
-
if (typeof key === 'undefined') {
|
|
282
|
-
throw new AppwriteException('Missing required parameter: "key"');
|
|
283
|
-
}
|
|
284
327
|
|
|
285
328
|
const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
|
|
286
329
|
const payload: Payload = {};
|
|
@@ -308,17 +351,17 @@ export class Project {
|
|
|
308
351
|
}
|
|
309
352
|
|
|
310
353
|
/**
|
|
311
|
-
* Delete a
|
|
354
|
+
* Delete a variable by its unique ID.
|
|
312
355
|
*
|
|
313
|
-
* @param {string} params.variableId - Variable
|
|
356
|
+
* @param {string} params.variableId - Variable ID.
|
|
314
357
|
* @throws {AppwriteException}
|
|
315
358
|
* @returns {Promise<{}>}
|
|
316
359
|
*/
|
|
317
360
|
deleteVariable(params: { variableId: string }): Promise<{}>;
|
|
318
361
|
/**
|
|
319
|
-
* Delete a
|
|
362
|
+
* Delete a variable by its unique ID.
|
|
320
363
|
*
|
|
321
|
-
* @param {string} variableId - Variable
|
|
364
|
+
* @param {string} variableId - Variable ID.
|
|
322
365
|
* @throws {AppwriteException}
|
|
323
366
|
* @returns {Promise<{}>}
|
|
324
367
|
* @deprecated Use the object parameter style method for a better developer experience.
|
package/src/services/users.ts
CHANGED
|
@@ -17,7 +17,7 @@ export class Users {
|
|
|
17
17
|
/**
|
|
18
18
|
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
19
19
|
*
|
|
20
|
-
* @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
|
|
20
|
+
* @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
|
|
21
21
|
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
22
22
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
23
23
|
* @throws {AppwriteException}
|
|
@@ -27,7 +27,7 @@ export class Users {
|
|
|
27
27
|
/**
|
|
28
28
|
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
29
29
|
*
|
|
30
|
-
* @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
|
|
30
|
+
* @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
|
|
31
31
|
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
32
32
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
33
33
|
* @throws {AppwriteException}
|
|
@@ -1169,6 +1169,71 @@ export class Users {
|
|
|
1169
1169
|
);
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
|
+
/**
|
|
1173
|
+
* 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.
|
|
1174
|
+
*
|
|
1175
|
+
*
|
|
1176
|
+
* @param {string} params.userId - User ID.
|
|
1177
|
+
* @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.
|
|
1178
|
+
* @throws {AppwriteException}
|
|
1179
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1180
|
+
*/
|
|
1181
|
+
updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, impersonator: boolean }): Promise<Models.User<Preferences>>;
|
|
1182
|
+
/**
|
|
1183
|
+
* 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.
|
|
1184
|
+
*
|
|
1185
|
+
*
|
|
1186
|
+
* @param {string} userId - User ID.
|
|
1187
|
+
* @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.
|
|
1188
|
+
* @throws {AppwriteException}
|
|
1189
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1190
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1191
|
+
*/
|
|
1192
|
+
updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, impersonator: boolean): Promise<Models.User<Preferences>>;
|
|
1193
|
+
updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
1194
|
+
paramsOrFirst: { userId: string, impersonator: boolean } | string,
|
|
1195
|
+
...rest: [(boolean)?]
|
|
1196
|
+
): Promise<Models.User<Preferences>> {
|
|
1197
|
+
let params: { userId: string, impersonator: boolean };
|
|
1198
|
+
|
|
1199
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1200
|
+
params = (paramsOrFirst || {}) as { userId: string, impersonator: boolean };
|
|
1201
|
+
} else {
|
|
1202
|
+
params = {
|
|
1203
|
+
userId: paramsOrFirst as string,
|
|
1204
|
+
impersonator: rest[0] as boolean
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
const userId = params.userId;
|
|
1209
|
+
const impersonator = params.impersonator;
|
|
1210
|
+
|
|
1211
|
+
if (typeof userId === 'undefined') {
|
|
1212
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1213
|
+
}
|
|
1214
|
+
if (typeof impersonator === 'undefined') {
|
|
1215
|
+
throw new AppwriteException('Missing required parameter: "impersonator"');
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
const apiPath = '/users/{userId}/impersonator'.replace('{userId}', userId);
|
|
1219
|
+
const payload: Payload = {};
|
|
1220
|
+
if (typeof impersonator !== 'undefined') {
|
|
1221
|
+
payload['impersonator'] = impersonator;
|
|
1222
|
+
}
|
|
1223
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1224
|
+
|
|
1225
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1226
|
+
'content-type': 'application/json',
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
return this.client.call(
|
|
1230
|
+
'patch',
|
|
1231
|
+
uri,
|
|
1232
|
+
apiHeaders,
|
|
1233
|
+
payload
|
|
1234
|
+
);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1172
1237
|
/**
|
|
1173
1238
|
* 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.
|
|
1174
1239
|
*
|
package/types/channel.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ interface Membership {
|
|
|
37
37
|
interface Resolved {
|
|
38
38
|
_res: any;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
type Actionable = Document | Row | File | Team | Membership;
|
|
41
41
|
export declare class Channel<T> {
|
|
42
42
|
private readonly segments;
|
|
43
43
|
_type: T;
|
|
@@ -69,6 +69,6 @@ export declare class Channel<T> {
|
|
|
69
69
|
static teams(): string;
|
|
70
70
|
static memberships(): string;
|
|
71
71
|
}
|
|
72
|
-
export
|
|
73
|
-
export
|
|
72
|
+
export type ActionableChannel = Channel<Document> | Channel<Row> | Channel<File> | Channel<Execution> | Channel<Team> | Channel<Membership>;
|
|
73
|
+
export type ResolvedChannel = Channel<Resolved>;
|
|
74
74
|
export {};
|