@appwrite.io/console 3.1.0 → 23.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/CHANGELOG.md +19 -0
- package/README.md +2 -2
- package/dist/cjs/sdk.js +345 -86
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +346 -87
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +345 -86
- package/docs/examples/databases/list-documents.md +2 -1
- package/docs/examples/domains/create-purchase.md +1 -1
- package/docs/examples/domains/create-transfer-in.md +18 -0
- package/docs/examples/domains/create-transfer-out.md +16 -0
- package/docs/examples/domains/get-transfer-status.md +15 -0
- package/docs/examples/health/get-console-pausing.md +16 -0
- package/docs/examples/migrations/create-appwrite-migration.md +2 -2
- package/docs/examples/migrations/create-firebase-migration.md +2 -2
- package/docs/examples/migrations/create-n-host-migration.md +2 -2
- package/docs/examples/migrations/create-supabase-migration.md +2 -2
- package/docs/examples/migrations/get-appwrite-report.md +2 -2
- package/docs/examples/migrations/get-firebase-report.md +2 -2
- package/docs/examples/migrations/get-n-host-report.md +2 -2
- package/docs/examples/migrations/get-supabase-report.md +2 -2
- package/docs/examples/projects/update-console-access.md +15 -0
- package/docs/examples/projects/update-status.md +16 -0
- package/docs/examples/sites/create-deployment.md +2 -2
- package/docs/examples/tablesdb/list-rows.md +2 -1
- package/package.json +1 -1
- package/src/channel.ts +19 -15
- package/src/client.ts +1 -1
- package/src/enums/appwrite-migration-resource.ts +21 -0
- package/src/enums/domain-transfer-status-status.ts +10 -0
- package/src/enums/firebase-migration-resource.ts +12 -0
- package/src/enums/{resources.ts → n-host-migration-resource.ts} +1 -1
- package/src/enums/status.ts +3 -0
- package/src/enums/supabase-migration-resource.ts +13 -0
- package/src/index.ts +6 -1
- package/src/models.ts +119 -2
- package/src/services/account.ts +2 -2
- package/src/services/databases.ts +100 -93
- package/src/services/domains.ts +216 -13
- package/src/services/health.ts +61 -0
- package/src/services/messaging.ts +2 -2
- package/src/services/migrations.ts +68 -65
- package/src/services/projects.ts +120 -0
- package/src/services/sites.ts +13 -16
- package/src/services/tables-db.ts +14 -7
- package/src/services/teams.ts +4 -4
- package/types/channel.d.ts +9 -9
- package/types/enums/appwrite-migration-resource.d.ts +21 -0
- package/types/enums/domain-transfer-status-status.d.ts +10 -0
- package/types/enums/firebase-migration-resource.d.ts +12 -0
- package/types/enums/{resources.d.ts → n-host-migration-resource.d.ts} +1 -1
- package/types/enums/status.d.ts +3 -0
- package/types/enums/supabase-migration-resource.d.ts +13 -0
- package/types/index.d.ts +6 -1
- package/types/models.d.ts +117 -2
- package/types/services/databases.d.ts +40 -37
- package/types/services/domains.d.ts +73 -4
- package/types/services/health.d.ts +24 -0
- package/types/services/messaging.d.ts +2 -2
- package/types/services/migrations.d.ts +36 -33
- package/types/services/projects.d.ts +46 -0
- package/types/services/sites.d.ts +4 -4
- package/types/services/tables-db.d.ts +4 -1
- package/types/services/teams.d.ts +4 -4
package/src/services/account.ts
CHANGED
|
@@ -835,7 +835,7 @@ export class Account {
|
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
/**
|
|
838
|
-
* Get a list of all API keys from the current account.
|
|
838
|
+
* Get a list of all API keys from the current account.
|
|
839
839
|
*
|
|
840
840
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
841
841
|
* @throws {AppwriteException}
|
|
@@ -843,7 +843,7 @@ export class Account {
|
|
|
843
843
|
*/
|
|
844
844
|
listKeys(params?: { total?: boolean }): Promise<Models.KeyList>;
|
|
845
845
|
/**
|
|
846
|
-
* Get a list of all API keys from the current account.
|
|
846
|
+
* Get a list of all API keys from the current account.
|
|
847
847
|
*
|
|
848
848
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
849
849
|
* @throws {AppwriteException}
|
|
@@ -1188,7 +1188,7 @@ export class Databases {
|
|
|
1188
1188
|
*
|
|
1189
1189
|
*
|
|
1190
1190
|
* @param {string} params.databaseId - Database ID.
|
|
1191
|
-
* @param {string} params.collectionId - Collection ID. You can create a new
|
|
1191
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1192
1192
|
* @param {string} params.key - Attribute Key.
|
|
1193
1193
|
* @param {boolean} params.required - Is attribute required?
|
|
1194
1194
|
* @param {boolean} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
@@ -1203,7 +1203,7 @@ export class Databases {
|
|
|
1203
1203
|
*
|
|
1204
1204
|
*
|
|
1205
1205
|
* @param {string} databaseId - Database ID.
|
|
1206
|
-
* @param {string} collectionId - Collection ID. You can create a new
|
|
1206
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1207
1207
|
* @param {string} key - Attribute Key.
|
|
1208
1208
|
* @param {boolean} required - Is attribute required?
|
|
1209
1209
|
* @param {boolean} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
@@ -3660,6 +3660,90 @@ export class Databases {
|
|
|
3660
3660
|
);
|
|
3661
3661
|
}
|
|
3662
3662
|
|
|
3663
|
+
/**
|
|
3664
|
+
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
3665
|
+
*
|
|
3666
|
+
*
|
|
3667
|
+
* @param {string} params.databaseId - Database ID.
|
|
3668
|
+
* @param {string} params.collectionId - Collection ID.
|
|
3669
|
+
* @param {string} params.key - Attribute Key.
|
|
3670
|
+
* @param {RelationMutate} params.onDelete - Constraints option
|
|
3671
|
+
* @param {string} params.newKey - New Attribute Key.
|
|
3672
|
+
* @throws {AppwriteException}
|
|
3673
|
+
* @returns {Promise<Models.AttributeRelationship>}
|
|
3674
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.
|
|
3675
|
+
*/
|
|
3676
|
+
updateRelationshipAttribute(params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string }): Promise<Models.AttributeRelationship>;
|
|
3677
|
+
/**
|
|
3678
|
+
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
3679
|
+
*
|
|
3680
|
+
*
|
|
3681
|
+
* @param {string} databaseId - Database ID.
|
|
3682
|
+
* @param {string} collectionId - Collection ID.
|
|
3683
|
+
* @param {string} key - Attribute Key.
|
|
3684
|
+
* @param {RelationMutate} onDelete - Constraints option
|
|
3685
|
+
* @param {string} newKey - New Attribute Key.
|
|
3686
|
+
* @throws {AppwriteException}
|
|
3687
|
+
* @returns {Promise<Models.AttributeRelationship>}
|
|
3688
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
3689
|
+
*/
|
|
3690
|
+
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship>;
|
|
3691
|
+
updateRelationshipAttribute(
|
|
3692
|
+
paramsOrFirst: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string } | string,
|
|
3693
|
+
...rest: [(string)?, (string)?, (RelationMutate)?, (string)?]
|
|
3694
|
+
): Promise<Models.AttributeRelationship> {
|
|
3695
|
+
let params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string };
|
|
3696
|
+
|
|
3697
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3698
|
+
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string };
|
|
3699
|
+
} else {
|
|
3700
|
+
params = {
|
|
3701
|
+
databaseId: paramsOrFirst as string,
|
|
3702
|
+
collectionId: rest[0] as string,
|
|
3703
|
+
key: rest[1] as string,
|
|
3704
|
+
onDelete: rest[2] as RelationMutate,
|
|
3705
|
+
newKey: rest[3] as string
|
|
3706
|
+
};
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3709
|
+
const databaseId = params.databaseId;
|
|
3710
|
+
const collectionId = params.collectionId;
|
|
3711
|
+
const key = params.key;
|
|
3712
|
+
const onDelete = params.onDelete;
|
|
3713
|
+
const newKey = params.newKey;
|
|
3714
|
+
|
|
3715
|
+
if (typeof databaseId === 'undefined') {
|
|
3716
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3717
|
+
}
|
|
3718
|
+
if (typeof collectionId === 'undefined') {
|
|
3719
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
3720
|
+
}
|
|
3721
|
+
if (typeof key === 'undefined') {
|
|
3722
|
+
throw new AppwriteException('Missing required parameter: "key"');
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3725
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
3726
|
+
const payload: Payload = {};
|
|
3727
|
+
if (typeof onDelete !== 'undefined') {
|
|
3728
|
+
payload['onDelete'] = onDelete;
|
|
3729
|
+
}
|
|
3730
|
+
if (typeof newKey !== 'undefined') {
|
|
3731
|
+
payload['newKey'] = newKey;
|
|
3732
|
+
}
|
|
3733
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3734
|
+
|
|
3735
|
+
const apiHeaders: { [header: string]: string } = {
|
|
3736
|
+
'content-type': 'application/json',
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
return this.client.call(
|
|
3740
|
+
'patch',
|
|
3741
|
+
uri,
|
|
3742
|
+
apiHeaders,
|
|
3743
|
+
payload
|
|
3744
|
+
);
|
|
3745
|
+
}
|
|
3746
|
+
|
|
3663
3747
|
/**
|
|
3664
3748
|
* Create a string attribute.
|
|
3665
3749
|
*
|
|
@@ -4622,90 +4706,6 @@ export class Databases {
|
|
|
4622
4706
|
);
|
|
4623
4707
|
}
|
|
4624
4708
|
|
|
4625
|
-
/**
|
|
4626
|
-
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
4627
|
-
*
|
|
4628
|
-
*
|
|
4629
|
-
* @param {string} params.databaseId - Database ID.
|
|
4630
|
-
* @param {string} params.collectionId - Collection ID.
|
|
4631
|
-
* @param {string} params.key - Attribute Key.
|
|
4632
|
-
* @param {RelationMutate} params.onDelete - Constraints option
|
|
4633
|
-
* @param {string} params.newKey - New Attribute Key.
|
|
4634
|
-
* @throws {AppwriteException}
|
|
4635
|
-
* @returns {Promise<Models.AttributeRelationship>}
|
|
4636
|
-
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.
|
|
4637
|
-
*/
|
|
4638
|
-
updateRelationshipAttribute(params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string }): Promise<Models.AttributeRelationship>;
|
|
4639
|
-
/**
|
|
4640
|
-
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
4641
|
-
*
|
|
4642
|
-
*
|
|
4643
|
-
* @param {string} databaseId - Database ID.
|
|
4644
|
-
* @param {string} collectionId - Collection ID.
|
|
4645
|
-
* @param {string} key - Attribute Key.
|
|
4646
|
-
* @param {RelationMutate} onDelete - Constraints option
|
|
4647
|
-
* @param {string} newKey - New Attribute Key.
|
|
4648
|
-
* @throws {AppwriteException}
|
|
4649
|
-
* @returns {Promise<Models.AttributeRelationship>}
|
|
4650
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4651
|
-
*/
|
|
4652
|
-
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship>;
|
|
4653
|
-
updateRelationshipAttribute(
|
|
4654
|
-
paramsOrFirst: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string } | string,
|
|
4655
|
-
...rest: [(string)?, (string)?, (RelationMutate)?, (string)?]
|
|
4656
|
-
): Promise<Models.AttributeRelationship> {
|
|
4657
|
-
let params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string };
|
|
4658
|
-
|
|
4659
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4660
|
-
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string };
|
|
4661
|
-
} else {
|
|
4662
|
-
params = {
|
|
4663
|
-
databaseId: paramsOrFirst as string,
|
|
4664
|
-
collectionId: rest[0] as string,
|
|
4665
|
-
key: rest[1] as string,
|
|
4666
|
-
onDelete: rest[2] as RelationMutate,
|
|
4667
|
-
newKey: rest[3] as string
|
|
4668
|
-
};
|
|
4669
|
-
}
|
|
4670
|
-
|
|
4671
|
-
const databaseId = params.databaseId;
|
|
4672
|
-
const collectionId = params.collectionId;
|
|
4673
|
-
const key = params.key;
|
|
4674
|
-
const onDelete = params.onDelete;
|
|
4675
|
-
const newKey = params.newKey;
|
|
4676
|
-
|
|
4677
|
-
if (typeof databaseId === 'undefined') {
|
|
4678
|
-
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
4679
|
-
}
|
|
4680
|
-
if (typeof collectionId === 'undefined') {
|
|
4681
|
-
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
4682
|
-
}
|
|
4683
|
-
if (typeof key === 'undefined') {
|
|
4684
|
-
throw new AppwriteException('Missing required parameter: "key"');
|
|
4685
|
-
}
|
|
4686
|
-
|
|
4687
|
-
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
4688
|
-
const payload: Payload = {};
|
|
4689
|
-
if (typeof onDelete !== 'undefined') {
|
|
4690
|
-
payload['onDelete'] = onDelete;
|
|
4691
|
-
}
|
|
4692
|
-
if (typeof newKey !== 'undefined') {
|
|
4693
|
-
payload['newKey'] = newKey;
|
|
4694
|
-
}
|
|
4695
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4696
|
-
|
|
4697
|
-
const apiHeaders: { [header: string]: string } = {
|
|
4698
|
-
'content-type': 'application/json',
|
|
4699
|
-
}
|
|
4700
|
-
|
|
4701
|
-
return this.client.call(
|
|
4702
|
-
'patch',
|
|
4703
|
-
uri,
|
|
4704
|
-
apiHeaders,
|
|
4705
|
-
payload
|
|
4706
|
-
);
|
|
4707
|
-
}
|
|
4708
|
-
|
|
4709
4709
|
/**
|
|
4710
4710
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
4711
4711
|
*
|
|
@@ -4714,11 +4714,12 @@ export class Databases {
|
|
|
4714
4714
|
* @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.
|
|
4715
4715
|
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
4716
4716
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4717
|
+
* @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
4717
4718
|
* @throws {AppwriteException}
|
|
4718
4719
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
4719
4720
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
|
|
4720
4721
|
*/
|
|
4721
|
-
listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean }): Promise<Models.DocumentList<Document>>;
|
|
4722
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }): Promise<Models.DocumentList<Document>>;
|
|
4722
4723
|
/**
|
|
4723
4724
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
4724
4725
|
*
|
|
@@ -4727,26 +4728,28 @@ export class Databases {
|
|
|
4727
4728
|
* @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.
|
|
4728
4729
|
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
4729
4730
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4731
|
+
* @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
4730
4732
|
* @throws {AppwriteException}
|
|
4731
4733
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
4732
4734
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4733
4735
|
*/
|
|
4734
|
-
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean): Promise<Models.DocumentList<Document>>;
|
|
4736
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise<Models.DocumentList<Document>>;
|
|
4735
4737
|
listDocuments<Document extends Models.Document = Models.DefaultDocument>(
|
|
4736
|
-
paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean } | string,
|
|
4737
|
-
...rest: [(string)?, (string[])?, (string)?, (boolean)?]
|
|
4738
|
+
paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number } | string,
|
|
4739
|
+
...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?]
|
|
4738
4740
|
): Promise<Models.DocumentList<Document>> {
|
|
4739
|
-
let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean };
|
|
4741
|
+
let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number };
|
|
4740
4742
|
|
|
4741
4743
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4742
|
-
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean };
|
|
4744
|
+
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number };
|
|
4743
4745
|
} else {
|
|
4744
4746
|
params = {
|
|
4745
4747
|
databaseId: paramsOrFirst as string,
|
|
4746
4748
|
collectionId: rest[0] as string,
|
|
4747
4749
|
queries: rest[1] as string[],
|
|
4748
4750
|
transactionId: rest[2] as string,
|
|
4749
|
-
total: rest[3] as boolean
|
|
4751
|
+
total: rest[3] as boolean,
|
|
4752
|
+
ttl: rest[4] as number
|
|
4750
4753
|
};
|
|
4751
4754
|
}
|
|
4752
4755
|
|
|
@@ -4755,6 +4758,7 @@ export class Databases {
|
|
|
4755
4758
|
const queries = params.queries;
|
|
4756
4759
|
const transactionId = params.transactionId;
|
|
4757
4760
|
const total = params.total;
|
|
4761
|
+
const ttl = params.ttl;
|
|
4758
4762
|
|
|
4759
4763
|
if (typeof databaseId === 'undefined') {
|
|
4760
4764
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -4774,6 +4778,9 @@ export class Databases {
|
|
|
4774
4778
|
if (typeof total !== 'undefined') {
|
|
4775
4779
|
payload['total'] = total;
|
|
4776
4780
|
}
|
|
4781
|
+
if (typeof ttl !== 'undefined') {
|
|
4782
|
+
payload['ttl'] = ttl;
|
|
4783
|
+
}
|
|
4777
4784
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4778
4785
|
|
|
4779
4786
|
const apiHeaders: { [header: string]: string } = {
|
package/src/services/domains.ts
CHANGED
|
@@ -210,7 +210,7 @@ export class Domains {
|
|
|
210
210
|
* Create a domain purchase with registrant information.
|
|
211
211
|
*
|
|
212
212
|
* @param {string} params.domain - Fully qualified domain name to purchase (for example, example.com).
|
|
213
|
-
* @param {string} params.
|
|
213
|
+
* @param {string} params.organizationId - Team ID that will own the domain.
|
|
214
214
|
* @param {string} params.firstName - Registrant first name used for domain registration.
|
|
215
215
|
* @param {string} params.lastName - Registrant last name used for domain registration.
|
|
216
216
|
* @param {string} params.email - Registrant email address for registration and notices.
|
|
@@ -223,12 +223,12 @@ export class Domains {
|
|
|
223
223
|
* @throws {AppwriteException}
|
|
224
224
|
* @returns {Promise<Models.Domain>}
|
|
225
225
|
*/
|
|
226
|
-
createPurchase(params: { domain: string,
|
|
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.Domain>;
|
|
227
227
|
/**
|
|
228
228
|
* Create a domain purchase with registrant information.
|
|
229
229
|
*
|
|
230
230
|
* @param {string} domain - Fully qualified domain name to purchase (for example, example.com).
|
|
231
|
-
* @param {string}
|
|
231
|
+
* @param {string} organizationId - Team ID that will own the domain.
|
|
232
232
|
* @param {string} firstName - Registrant first name used for domain registration.
|
|
233
233
|
* @param {string} lastName - Registrant last name used for domain registration.
|
|
234
234
|
* @param {string} email - Registrant email address for registration and notices.
|
|
@@ -242,19 +242,19 @@ export class Domains {
|
|
|
242
242
|
* @returns {Promise<Models.Domain>}
|
|
243
243
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
244
244
|
*/
|
|
245
|
-
createPurchase(domain: string,
|
|
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.Domain>;
|
|
246
246
|
createPurchase(
|
|
247
|
-
paramsOrFirst: { domain: string,
|
|
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
248
|
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
|
|
249
249
|
): Promise<Models.Domain> {
|
|
250
|
-
let params: { domain: string,
|
|
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 };
|
|
251
251
|
|
|
252
252
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
253
|
-
params = (paramsOrFirst || {}) as { domain: string,
|
|
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 };
|
|
254
254
|
} else {
|
|
255
255
|
params = {
|
|
256
256
|
domain: paramsOrFirst as string,
|
|
257
|
-
|
|
257
|
+
organizationId: rest[0] as string,
|
|
258
258
|
firstName: rest[1] as string,
|
|
259
259
|
lastName: rest[2] as string,
|
|
260
260
|
email: rest[3] as string,
|
|
@@ -268,7 +268,7 @@ export class Domains {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
const domain = params.domain;
|
|
271
|
-
const
|
|
271
|
+
const organizationId = params.organizationId;
|
|
272
272
|
const firstName = params.firstName;
|
|
273
273
|
const lastName = params.lastName;
|
|
274
274
|
const email = params.email;
|
|
@@ -282,8 +282,8 @@ export class Domains {
|
|
|
282
282
|
if (typeof domain === 'undefined') {
|
|
283
283
|
throw new AppwriteException('Missing required parameter: "domain"');
|
|
284
284
|
}
|
|
285
|
-
if (typeof
|
|
286
|
-
throw new AppwriteException('Missing required parameter: "
|
|
285
|
+
if (typeof organizationId === 'undefined') {
|
|
286
|
+
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
287
287
|
}
|
|
288
288
|
if (typeof firstName === 'undefined') {
|
|
289
289
|
throw new AppwriteException('Missing required parameter: "firstName"');
|
|
@@ -309,8 +309,8 @@ export class Domains {
|
|
|
309
309
|
if (typeof domain !== 'undefined') {
|
|
310
310
|
payload['domain'] = domain;
|
|
311
311
|
}
|
|
312
|
-
if (typeof
|
|
313
|
-
payload['
|
|
312
|
+
if (typeof organizationId !== 'undefined') {
|
|
313
|
+
payload['organizationId'] = organizationId;
|
|
314
314
|
}
|
|
315
315
|
if (typeof firstName !== 'undefined') {
|
|
316
316
|
payload['firstName'] = firstName;
|
|
@@ -443,6 +443,158 @@ export class Domains {
|
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Create a domain transfer in with authorization code and registrant information.
|
|
448
|
+
*
|
|
449
|
+
* @param {string} params.domain - Domain name to transfer in.
|
|
450
|
+
* @param {string} params.organizationId - Organization ID that this domain will belong to.
|
|
451
|
+
* @param {string} params.authCode - Authorization code for the domain transfer.
|
|
452
|
+
* @param {string} params.paymentMethodId - Payment method ID to authorize and capture the transfer.
|
|
453
|
+
* @throws {AppwriteException}
|
|
454
|
+
* @returns {Promise<Models.Domain>}
|
|
455
|
+
*/
|
|
456
|
+
createTransferIn(params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string }): Promise<Models.Domain>;
|
|
457
|
+
/**
|
|
458
|
+
* Create a domain transfer in with authorization code and registrant information.
|
|
459
|
+
*
|
|
460
|
+
* @param {string} domain - Domain name to transfer in.
|
|
461
|
+
* @param {string} organizationId - Organization ID that this domain will belong to.
|
|
462
|
+
* @param {string} authCode - Authorization code for the domain transfer.
|
|
463
|
+
* @param {string} paymentMethodId - Payment method ID to authorize and capture the transfer.
|
|
464
|
+
* @throws {AppwriteException}
|
|
465
|
+
* @returns {Promise<Models.Domain>}
|
|
466
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
467
|
+
*/
|
|
468
|
+
createTransferIn(domain: string, organizationId: string, authCode: string, paymentMethodId: string): Promise<Models.Domain>;
|
|
469
|
+
createTransferIn(
|
|
470
|
+
paramsOrFirst: { domain: string, organizationId: string, authCode: string, paymentMethodId: string } | string,
|
|
471
|
+
...rest: [(string)?, (string)?, (string)?]
|
|
472
|
+
): Promise<Models.Domain> {
|
|
473
|
+
let params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string };
|
|
474
|
+
|
|
475
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
476
|
+
params = (paramsOrFirst || {}) as { domain: string, organizationId: string, authCode: string, paymentMethodId: string };
|
|
477
|
+
} else {
|
|
478
|
+
params = {
|
|
479
|
+
domain: paramsOrFirst as string,
|
|
480
|
+
organizationId: rest[0] as string,
|
|
481
|
+
authCode: rest[1] as string,
|
|
482
|
+
paymentMethodId: rest[2] as string
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const domain = params.domain;
|
|
487
|
+
const organizationId = params.organizationId;
|
|
488
|
+
const authCode = params.authCode;
|
|
489
|
+
const paymentMethodId = params.paymentMethodId;
|
|
490
|
+
|
|
491
|
+
if (typeof domain === 'undefined') {
|
|
492
|
+
throw new AppwriteException('Missing required parameter: "domain"');
|
|
493
|
+
}
|
|
494
|
+
if (typeof organizationId === 'undefined') {
|
|
495
|
+
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
496
|
+
}
|
|
497
|
+
if (typeof authCode === 'undefined') {
|
|
498
|
+
throw new AppwriteException('Missing required parameter: "authCode"');
|
|
499
|
+
}
|
|
500
|
+
if (typeof paymentMethodId === 'undefined') {
|
|
501
|
+
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
const apiPath = '/domains/transfers/in';
|
|
505
|
+
const payload: Payload = {};
|
|
506
|
+
if (typeof domain !== 'undefined') {
|
|
507
|
+
payload['domain'] = domain;
|
|
508
|
+
}
|
|
509
|
+
if (typeof organizationId !== 'undefined') {
|
|
510
|
+
payload['organizationId'] = organizationId;
|
|
511
|
+
}
|
|
512
|
+
if (typeof authCode !== 'undefined') {
|
|
513
|
+
payload['authCode'] = authCode;
|
|
514
|
+
}
|
|
515
|
+
if (typeof paymentMethodId !== 'undefined') {
|
|
516
|
+
payload['paymentMethodId'] = paymentMethodId;
|
|
517
|
+
}
|
|
518
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
519
|
+
|
|
520
|
+
const apiHeaders: { [header: string]: string } = {
|
|
521
|
+
'content-type': 'application/json',
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
return this.client.call(
|
|
525
|
+
'post',
|
|
526
|
+
uri,
|
|
527
|
+
apiHeaders,
|
|
528
|
+
payload
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Create a domain transfer out and return the authorization code.
|
|
534
|
+
*
|
|
535
|
+
* @param {string} params.domainId - Domain unique ID.
|
|
536
|
+
* @param {string} params.organizationId - Organization ID that this domain belongs to.
|
|
537
|
+
* @throws {AppwriteException}
|
|
538
|
+
* @returns {Promise<Models.DomainTransferOut>}
|
|
539
|
+
*/
|
|
540
|
+
createTransferOut(params: { domainId: string, organizationId: string }): Promise<Models.DomainTransferOut>;
|
|
541
|
+
/**
|
|
542
|
+
* Create a domain transfer out and return the authorization code.
|
|
543
|
+
*
|
|
544
|
+
* @param {string} domainId - Domain unique ID.
|
|
545
|
+
* @param {string} organizationId - Organization ID that this domain belongs to.
|
|
546
|
+
* @throws {AppwriteException}
|
|
547
|
+
* @returns {Promise<Models.DomainTransferOut>}
|
|
548
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
549
|
+
*/
|
|
550
|
+
createTransferOut(domainId: string, organizationId: string): Promise<Models.DomainTransferOut>;
|
|
551
|
+
createTransferOut(
|
|
552
|
+
paramsOrFirst: { domainId: string, organizationId: string } | string,
|
|
553
|
+
...rest: [(string)?]
|
|
554
|
+
): Promise<Models.DomainTransferOut> {
|
|
555
|
+
let params: { domainId: string, organizationId: string };
|
|
556
|
+
|
|
557
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
558
|
+
params = (paramsOrFirst || {}) as { domainId: string, organizationId: string };
|
|
559
|
+
} else {
|
|
560
|
+
params = {
|
|
561
|
+
domainId: paramsOrFirst as string,
|
|
562
|
+
organizationId: rest[0] as string
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
const domainId = params.domainId;
|
|
567
|
+
const organizationId = params.organizationId;
|
|
568
|
+
|
|
569
|
+
if (typeof domainId === 'undefined') {
|
|
570
|
+
throw new AppwriteException('Missing required parameter: "domainId"');
|
|
571
|
+
}
|
|
572
|
+
if (typeof organizationId === 'undefined') {
|
|
573
|
+
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
const apiPath = '/domains/transfers/out';
|
|
577
|
+
const payload: Payload = {};
|
|
578
|
+
if (typeof domainId !== 'undefined') {
|
|
579
|
+
payload['domainId'] = domainId;
|
|
580
|
+
}
|
|
581
|
+
if (typeof organizationId !== 'undefined') {
|
|
582
|
+
payload['organizationId'] = organizationId;
|
|
583
|
+
}
|
|
584
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
585
|
+
|
|
586
|
+
const apiHeaders: { [header: string]: string } = {
|
|
587
|
+
'content-type': 'application/json',
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
return this.client.call(
|
|
591
|
+
'post',
|
|
592
|
+
uri,
|
|
593
|
+
apiHeaders,
|
|
594
|
+
payload
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
|
|
446
598
|
/**
|
|
447
599
|
* Get a domain by its unique ID.
|
|
448
600
|
*
|
|
@@ -3538,6 +3690,57 @@ export class Domains {
|
|
|
3538
3690
|
);
|
|
3539
3691
|
}
|
|
3540
3692
|
|
|
3693
|
+
/**
|
|
3694
|
+
* Get the transfer status for a domain.
|
|
3695
|
+
*
|
|
3696
|
+
* @param {string} params.domainId - Domain unique ID.
|
|
3697
|
+
* @throws {AppwriteException}
|
|
3698
|
+
* @returns {Promise<Models.DomainTransferStatus>}
|
|
3699
|
+
*/
|
|
3700
|
+
getTransferStatus(params: { domainId: string }): Promise<Models.DomainTransferStatus>;
|
|
3701
|
+
/**
|
|
3702
|
+
* Get the transfer status for a domain.
|
|
3703
|
+
*
|
|
3704
|
+
* @param {string} domainId - Domain unique ID.
|
|
3705
|
+
* @throws {AppwriteException}
|
|
3706
|
+
* @returns {Promise<Models.DomainTransferStatus>}
|
|
3707
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
3708
|
+
*/
|
|
3709
|
+
getTransferStatus(domainId: string): Promise<Models.DomainTransferStatus>;
|
|
3710
|
+
getTransferStatus(
|
|
3711
|
+
paramsOrFirst: { domainId: string } | string
|
|
3712
|
+
): Promise<Models.DomainTransferStatus> {
|
|
3713
|
+
let params: { domainId: string };
|
|
3714
|
+
|
|
3715
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3716
|
+
params = (paramsOrFirst || {}) as { domainId: string };
|
|
3717
|
+
} else {
|
|
3718
|
+
params = {
|
|
3719
|
+
domainId: paramsOrFirst as string
|
|
3720
|
+
};
|
|
3721
|
+
}
|
|
3722
|
+
|
|
3723
|
+
const domainId = params.domainId;
|
|
3724
|
+
|
|
3725
|
+
if (typeof domainId === 'undefined') {
|
|
3726
|
+
throw new AppwriteException('Missing required parameter: "domainId"');
|
|
3727
|
+
}
|
|
3728
|
+
|
|
3729
|
+
const apiPath = '/domains/{domainId}/transfers/status'.replace('{domainId}', domainId);
|
|
3730
|
+
const payload: Payload = {};
|
|
3731
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3732
|
+
|
|
3733
|
+
const apiHeaders: { [header: string]: string } = {
|
|
3734
|
+
}
|
|
3735
|
+
|
|
3736
|
+
return this.client.call(
|
|
3737
|
+
'get',
|
|
3738
|
+
uri,
|
|
3739
|
+
apiHeaders,
|
|
3740
|
+
payload
|
|
3741
|
+
);
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3541
3744
|
/**
|
|
3542
3745
|
* Retrieve the DNS zone file for the given domain. This endpoint will return the DNS
|
|
3543
3746
|
* zone file in a standardized format that can be used to configure DNS servers.
|
package/src/services/health.ts
CHANGED
|
@@ -131,6 +131,67 @@ export class Health {
|
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Get console pausing health status. Monitors projects approaching the pause threshold to detect potential issues with console access tracking.
|
|
136
|
+
*
|
|
137
|
+
*
|
|
138
|
+
* @param {number} params.threshold - Percentage threshold of projects approaching pause. When hit (equal or higher), endpoint returns server error. Default value is 10.
|
|
139
|
+
* @param {number} params.inactivityDays - Number of days of inactivity before a project is paused. Should match the plan's projectInactivityDays setting. Default value is 7.
|
|
140
|
+
* @throws {AppwriteException}
|
|
141
|
+
* @returns {Promise<Models.HealthStatus>}
|
|
142
|
+
*/
|
|
143
|
+
getConsolePausing(params?: { threshold?: number, inactivityDays?: number }): Promise<Models.HealthStatus>;
|
|
144
|
+
/**
|
|
145
|
+
* Get console pausing health status. Monitors projects approaching the pause threshold to detect potential issues with console access tracking.
|
|
146
|
+
*
|
|
147
|
+
*
|
|
148
|
+
* @param {number} threshold - Percentage threshold of projects approaching pause. When hit (equal or higher), endpoint returns server error. Default value is 10.
|
|
149
|
+
* @param {number} inactivityDays - Number of days of inactivity before a project is paused. Should match the plan's projectInactivityDays setting. Default value is 7.
|
|
150
|
+
* @throws {AppwriteException}
|
|
151
|
+
* @returns {Promise<Models.HealthStatus>}
|
|
152
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
153
|
+
*/
|
|
154
|
+
getConsolePausing(threshold?: number, inactivityDays?: number): Promise<Models.HealthStatus>;
|
|
155
|
+
getConsolePausing(
|
|
156
|
+
paramsOrFirst?: { threshold?: number, inactivityDays?: number } | number,
|
|
157
|
+
...rest: [(number)?]
|
|
158
|
+
): Promise<Models.HealthStatus> {
|
|
159
|
+
let params: { threshold?: number, inactivityDays?: number };
|
|
160
|
+
|
|
161
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
162
|
+
params = (paramsOrFirst || {}) as { threshold?: number, inactivityDays?: number };
|
|
163
|
+
} else {
|
|
164
|
+
params = {
|
|
165
|
+
threshold: paramsOrFirst as number,
|
|
166
|
+
inactivityDays: rest[0] as number
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const threshold = params.threshold;
|
|
171
|
+
const inactivityDays = params.inactivityDays;
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
const apiPath = '/health/console-pausing';
|
|
175
|
+
const payload: Payload = {};
|
|
176
|
+
if (typeof threshold !== 'undefined') {
|
|
177
|
+
payload['threshold'] = threshold;
|
|
178
|
+
}
|
|
179
|
+
if (typeof inactivityDays !== 'undefined') {
|
|
180
|
+
payload['inactivityDays'] = inactivityDays;
|
|
181
|
+
}
|
|
182
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
183
|
+
|
|
184
|
+
const apiHeaders: { [header: string]: string } = {
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return this.client.call(
|
|
188
|
+
'get',
|
|
189
|
+
uri,
|
|
190
|
+
apiHeaders,
|
|
191
|
+
payload
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
134
195
|
/**
|
|
135
196
|
* Check the Appwrite database servers are up and connection is successful.
|
|
136
197
|
*
|
|
@@ -4929,7 +4929,7 @@ export class Messaging {
|
|
|
4929
4929
|
* Get a list of all subscribers from the current Appwrite project.
|
|
4930
4930
|
*
|
|
4931
4931
|
* @param {string} params.topicId - Topic ID. The topic ID subscribed to.
|
|
4932
|
-
* @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:
|
|
4932
|
+
* @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: targetId, topicId, userId, providerType
|
|
4933
4933
|
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
4934
4934
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4935
4935
|
* @throws {AppwriteException}
|
|
@@ -4940,7 +4940,7 @@ export class Messaging {
|
|
|
4940
4940
|
* Get a list of all subscribers from the current Appwrite project.
|
|
4941
4941
|
*
|
|
4942
4942
|
* @param {string} topicId - Topic ID. The topic ID subscribed to.
|
|
4943
|
-
* @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:
|
|
4943
|
+
* @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: targetId, topicId, userId, providerType
|
|
4944
4944
|
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
4945
4945
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4946
4946
|
* @throws {AppwriteException}
|