@appwrite.io/console 7.0.0 → 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/CHANGELOG.md +22 -6
- package/README.md +2 -2
- package/dist/cjs/sdk.js +211 -303
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +209 -297
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +227 -306
- package/docs/examples/databases/create-index.md +2 -2
- package/docs/examples/domains/create-purchase.md +2 -1
- package/docs/examples/domains/create-transfer-in.md +2 -1
- package/docs/examples/domains/update-auto-renewal.md +16 -0
- 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/tablesdb/create-index.md +2 -2
- package/docs/examples/users/update-impersonator.md +16 -0
- package/package.json +7 -7
- package/rollup.config.js +2 -1
- package/src/client.ts +49 -1
- package/src/enums/appwrite-migration-resource.ts +2 -0
- package/src/enums/backup-services.ts +3 -0
- package/src/enums/build-runtime.ts +0 -86
- package/src/enums/database-type.ts +2 -0
- package/src/enums/databases-index-type.ts +6 -0
- package/src/enums/runtime.ts +0 -86
- package/src/enums/runtimes.ts +0 -86
- package/src/enums/scopes.ts +13 -2
- package/src/enums/{index-type.ts → tables-db-index-type.ts} +1 -1
- package/src/enums/template-reference-type.ts +1 -1
- package/src/enums/use-cases.ts +7 -2
- package/src/index.ts +2 -1
- package/src/models.ts +136 -90
- package/src/services/databases.ts +10 -10
- package/src/services/domains.ts +103 -26
- package/src/services/project.ts +76 -33
- package/src/services/tables-db.ts +10 -10
- package/src/services/users.ts +67 -2
- package/types/channel.d.ts +3 -3
- package/types/client.d.ts +37 -4
- package/types/enums/appwrite-migration-resource.d.ts +2 -0
- package/types/enums/backup-services.d.ts +3 -0
- package/types/enums/build-runtime.d.ts +1 -87
- package/types/enums/database-type.d.ts +3 -1
- package/types/enums/databases-index-type.d.ts +6 -0
- package/types/enums/runtime.d.ts +1 -87
- package/types/enums/runtimes.d.ts +1 -87
- package/types/enums/scopes.d.ts +14 -3
- package/types/enums/{index-type.d.ts → tables-db-index-type.d.ts} +1 -1
- package/types/enums/template-reference-type.d.ts +1 -1
- package/types/enums/use-cases.d.ts +7 -2
- package/types/index.d.ts +2 -1
- package/types/models.d.ts +136 -87
- package/types/operator.d.ts +3 -3
- package/types/query.d.ts +4 -4
- package/types/services/databases.d.ts +5 -5
- 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/tables-db.d.ts +5 -5
- package/types/services/users.d.ts +26 -2
package/src/models.ts
CHANGED
|
@@ -330,20 +330,6 @@ export namespace Models {
|
|
|
330
330
|
frameworkProviderRepositories: ProviderRepositoryFramework[];
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
/**
|
|
334
|
-
* Runtime Provider Repositories List
|
|
335
|
-
*/
|
|
336
|
-
export type ProviderRepositoryRuntimeList = {
|
|
337
|
-
/**
|
|
338
|
-
* Total number of runtimeProviderRepositories that matched your query.
|
|
339
|
-
*/
|
|
340
|
-
total: number;
|
|
341
|
-
/**
|
|
342
|
-
* List of runtimeProviderRepositories.
|
|
343
|
-
*/
|
|
344
|
-
runtimeProviderRepositories: ProviderRepositoryRuntime[];
|
|
345
|
-
}
|
|
346
|
-
|
|
347
333
|
/**
|
|
348
334
|
* Branches List
|
|
349
335
|
*/
|
|
@@ -2707,15 +2693,15 @@ export namespace Models {
|
|
|
2707
2693
|
*/
|
|
2708
2694
|
event: string;
|
|
2709
2695
|
/**
|
|
2710
|
-
* User ID.
|
|
2696
|
+
* User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user.
|
|
2711
2697
|
*/
|
|
2712
2698
|
userId: string;
|
|
2713
2699
|
/**
|
|
2714
|
-
* User
|
|
2700
|
+
* User email of the actor recorded for this log. During impersonation, this is the original impersonator.
|
|
2715
2701
|
*/
|
|
2716
2702
|
userEmail: string;
|
|
2717
2703
|
/**
|
|
2718
|
-
* User
|
|
2704
|
+
* User name of the actor recorded for this log. During impersonation, this is the original impersonator.
|
|
2719
2705
|
*/
|
|
2720
2706
|
userName: string;
|
|
2721
2707
|
/**
|
|
@@ -2868,6 +2854,14 @@ export namespace Models {
|
|
|
2868
2854
|
* Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.
|
|
2869
2855
|
*/
|
|
2870
2856
|
accessedAt: string;
|
|
2857
|
+
/**
|
|
2858
|
+
* Whether the user can impersonate other users.
|
|
2859
|
+
*/
|
|
2860
|
+
impersonator?: boolean;
|
|
2861
|
+
/**
|
|
2862
|
+
* ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data.
|
|
2863
|
+
*/
|
|
2864
|
+
impersonatorUserId?: string;
|
|
2871
2865
|
}
|
|
2872
2866
|
|
|
2873
2867
|
/**
|
|
@@ -4105,56 +4099,6 @@ export namespace Models {
|
|
|
4105
4099
|
framework: string;
|
|
4106
4100
|
}
|
|
4107
4101
|
|
|
4108
|
-
/**
|
|
4109
|
-
* ProviderRepositoryRuntime
|
|
4110
|
-
*/
|
|
4111
|
-
export type ProviderRepositoryRuntime = {
|
|
4112
|
-
/**
|
|
4113
|
-
* VCS (Version Control System) repository ID.
|
|
4114
|
-
*/
|
|
4115
|
-
id: string;
|
|
4116
|
-
/**
|
|
4117
|
-
* VCS (Version Control System) repository name.
|
|
4118
|
-
*/
|
|
4119
|
-
name: string;
|
|
4120
|
-
/**
|
|
4121
|
-
* VCS (Version Control System) organization name
|
|
4122
|
-
*/
|
|
4123
|
-
organization: string;
|
|
4124
|
-
/**
|
|
4125
|
-
* VCS (Version Control System) provider name.
|
|
4126
|
-
*/
|
|
4127
|
-
provider: string;
|
|
4128
|
-
/**
|
|
4129
|
-
* Is VCS (Version Control System) repository private?
|
|
4130
|
-
*/
|
|
4131
|
-
private: boolean;
|
|
4132
|
-
/**
|
|
4133
|
-
* VCS (Version Control System) repository's default branch name.
|
|
4134
|
-
*/
|
|
4135
|
-
defaultBranch: string;
|
|
4136
|
-
/**
|
|
4137
|
-
* VCS (Version Control System) installation ID.
|
|
4138
|
-
*/
|
|
4139
|
-
providerInstallationId: string;
|
|
4140
|
-
/**
|
|
4141
|
-
* Is VCS (Version Control System) repository authorized for the installation?
|
|
4142
|
-
*/
|
|
4143
|
-
authorized: boolean;
|
|
4144
|
-
/**
|
|
4145
|
-
* Last commit date in ISO 8601 format.
|
|
4146
|
-
*/
|
|
4147
|
-
pushedAt: string;
|
|
4148
|
-
/**
|
|
4149
|
-
* Environment variables found in .env files
|
|
4150
|
-
*/
|
|
4151
|
-
variables: string[];
|
|
4152
|
-
/**
|
|
4153
|
-
* Auto-detected runtime. Empty if type is not "runtime".
|
|
4154
|
-
*/
|
|
4155
|
-
runtime: string;
|
|
4156
|
-
}
|
|
4157
|
-
|
|
4158
4102
|
/**
|
|
4159
4103
|
* DetectionFramework
|
|
4160
4104
|
*/
|
|
@@ -4181,28 +4125,6 @@ export namespace Models {
|
|
|
4181
4125
|
outputDirectory: string;
|
|
4182
4126
|
}
|
|
4183
4127
|
|
|
4184
|
-
/**
|
|
4185
|
-
* DetectionRuntime
|
|
4186
|
-
*/
|
|
4187
|
-
export type DetectionRuntime = {
|
|
4188
|
-
/**
|
|
4189
|
-
* Environment variables found in .env files
|
|
4190
|
-
*/
|
|
4191
|
-
variables?: DetectionVariable[];
|
|
4192
|
-
/**
|
|
4193
|
-
* Runtime
|
|
4194
|
-
*/
|
|
4195
|
-
runtime: string;
|
|
4196
|
-
/**
|
|
4197
|
-
* Function Entrypoint
|
|
4198
|
-
*/
|
|
4199
|
-
entrypoint: string;
|
|
4200
|
-
/**
|
|
4201
|
-
* Function install and build commands
|
|
4202
|
-
*/
|
|
4203
|
-
commands: string;
|
|
4204
|
-
}
|
|
4205
|
-
|
|
4206
4128
|
/**
|
|
4207
4129
|
* DetectionVariable
|
|
4208
4130
|
*/
|
|
@@ -6034,9 +5956,13 @@ export namespace Models {
|
|
|
6034
5956
|
*/
|
|
6035
5957
|
executionsTotal: number;
|
|
6036
5958
|
/**
|
|
6037
|
-
* Total aggregated number of documents.
|
|
5959
|
+
* Total aggregated number of documents in legacy/tablesdb.
|
|
6038
5960
|
*/
|
|
6039
5961
|
documentsTotal: number;
|
|
5962
|
+
/**
|
|
5963
|
+
* Total aggregated number of documents in documentsdb.
|
|
5964
|
+
*/
|
|
5965
|
+
documentsdbDocumentsTotal: number;
|
|
6040
5966
|
/**
|
|
6041
5967
|
* Total aggregated number of rows.
|
|
6042
5968
|
*/
|
|
@@ -6045,10 +5971,18 @@ export namespace Models {
|
|
|
6045
5971
|
* Total aggregated number of databases.
|
|
6046
5972
|
*/
|
|
6047
5973
|
databasesTotal: number;
|
|
5974
|
+
/**
|
|
5975
|
+
* Total aggregated number of documentsdb.
|
|
5976
|
+
*/
|
|
5977
|
+
documentsdbTotal: number;
|
|
6048
5978
|
/**
|
|
6049
5979
|
* Total aggregated sum of databases storage size (in bytes).
|
|
6050
5980
|
*/
|
|
6051
5981
|
databasesStorageTotal: number;
|
|
5982
|
+
/**
|
|
5983
|
+
* Total aggregated sum of documentsdb databases storage size (in bytes).
|
|
5984
|
+
*/
|
|
5985
|
+
documentsdbDatabasesStorageTotal: number;
|
|
6052
5986
|
/**
|
|
6053
5987
|
* Total aggregated number of users.
|
|
6054
5988
|
*/
|
|
@@ -6089,6 +6023,14 @@ export namespace Models {
|
|
|
6089
6023
|
* Aggregated stats for total databases writes.
|
|
6090
6024
|
*/
|
|
6091
6025
|
databasesWritesTotal: number;
|
|
6026
|
+
/**
|
|
6027
|
+
* Total number of documentsdb databases reads.
|
|
6028
|
+
*/
|
|
6029
|
+
documentsdbDatabasesReadsTotal: number;
|
|
6030
|
+
/**
|
|
6031
|
+
* Total number of documentsdb databases writes.
|
|
6032
|
+
*/
|
|
6033
|
+
documentsdbDatabasesWritesTotal: number;
|
|
6092
6034
|
/**
|
|
6093
6035
|
* Aggregated number of requests per period.
|
|
6094
6036
|
*/
|
|
@@ -6149,6 +6091,18 @@ export namespace Models {
|
|
|
6149
6091
|
* Aggregated stats for database writes.
|
|
6150
6092
|
*/
|
|
6151
6093
|
databasesWrites: Metric[];
|
|
6094
|
+
/**
|
|
6095
|
+
* An array of aggregated number of documentsdb database reads.
|
|
6096
|
+
*/
|
|
6097
|
+
documentsdbDatabasesReads: Metric[];
|
|
6098
|
+
/**
|
|
6099
|
+
* An array of aggregated number of documentsdb database writes.
|
|
6100
|
+
*/
|
|
6101
|
+
documentsdbDatabasesWrites: Metric[];
|
|
6102
|
+
/**
|
|
6103
|
+
* An array of aggregated sum of documentsdb databases storage size (in bytes) per period.
|
|
6104
|
+
*/
|
|
6105
|
+
documentsdbDatabasesStorage: Metric[];
|
|
6152
6106
|
/**
|
|
6153
6107
|
* An array of aggregated number of image transformations.
|
|
6154
6108
|
*/
|
|
@@ -6157,6 +6111,86 @@ export namespace Models {
|
|
|
6157
6111
|
* Total aggregated number of image transformations.
|
|
6158
6112
|
*/
|
|
6159
6113
|
imageTransformationsTotal: number;
|
|
6114
|
+
/**
|
|
6115
|
+
* Total aggregated number of VectorsDB databases.
|
|
6116
|
+
*/
|
|
6117
|
+
vectorsdbDatabasesTotal: number;
|
|
6118
|
+
/**
|
|
6119
|
+
* Total aggregated number of VectorsDB collections.
|
|
6120
|
+
*/
|
|
6121
|
+
vectorsdbCollectionsTotal: number;
|
|
6122
|
+
/**
|
|
6123
|
+
* Total aggregated number of VectorsDB documents.
|
|
6124
|
+
*/
|
|
6125
|
+
vectorsdbDocumentsTotal: number;
|
|
6126
|
+
/**
|
|
6127
|
+
* Total aggregated VectorsDB storage (bytes).
|
|
6128
|
+
*/
|
|
6129
|
+
vectorsdbDatabasesStorageTotal: number;
|
|
6130
|
+
/**
|
|
6131
|
+
* Total aggregated number of VectorsDB reads.
|
|
6132
|
+
*/
|
|
6133
|
+
vectorsdbDatabasesReadsTotal: number;
|
|
6134
|
+
/**
|
|
6135
|
+
* Total aggregated number of VectorsDB writes.
|
|
6136
|
+
*/
|
|
6137
|
+
vectorsdbDatabasesWritesTotal: number;
|
|
6138
|
+
/**
|
|
6139
|
+
* Aggregated VectorsDB databases per period.
|
|
6140
|
+
*/
|
|
6141
|
+
vectorsdbDatabases: Metric[];
|
|
6142
|
+
/**
|
|
6143
|
+
* Aggregated VectorsDB collections per period.
|
|
6144
|
+
*/
|
|
6145
|
+
vectorsdbCollections: Metric[];
|
|
6146
|
+
/**
|
|
6147
|
+
* Aggregated VectorsDB documents per period.
|
|
6148
|
+
*/
|
|
6149
|
+
vectorsdbDocuments: Metric[];
|
|
6150
|
+
/**
|
|
6151
|
+
* Aggregated VectorsDB storage per period.
|
|
6152
|
+
*/
|
|
6153
|
+
vectorsdbDatabasesStorage: Metric[];
|
|
6154
|
+
/**
|
|
6155
|
+
* Aggregated VectorsDB reads per period.
|
|
6156
|
+
*/
|
|
6157
|
+
vectorsdbDatabasesReads: Metric[];
|
|
6158
|
+
/**
|
|
6159
|
+
* Aggregated VectorsDB writes per period.
|
|
6160
|
+
*/
|
|
6161
|
+
vectorsdbDatabasesWrites: Metric[];
|
|
6162
|
+
/**
|
|
6163
|
+
* Aggregated number of text embedding calls per period.
|
|
6164
|
+
*/
|
|
6165
|
+
embeddingsText: Metric;
|
|
6166
|
+
/**
|
|
6167
|
+
* Aggregated number of tokens processed by text embeddings per period.
|
|
6168
|
+
*/
|
|
6169
|
+
embeddingsTextTokens: Metric;
|
|
6170
|
+
/**
|
|
6171
|
+
* Aggregated duration spent generating text embeddings per period.
|
|
6172
|
+
*/
|
|
6173
|
+
embeddingsTextDuration: Metric;
|
|
6174
|
+
/**
|
|
6175
|
+
* Aggregated number of errors while generating text embeddings per period.
|
|
6176
|
+
*/
|
|
6177
|
+
embeddingsTextErrors: Metric;
|
|
6178
|
+
/**
|
|
6179
|
+
* Total aggregated number of text embedding calls.
|
|
6180
|
+
*/
|
|
6181
|
+
embeddingsTextTotal: Metric;
|
|
6182
|
+
/**
|
|
6183
|
+
* Total aggregated number of tokens processed by text.
|
|
6184
|
+
*/
|
|
6185
|
+
embeddingsTextTokensTotal: Metric;
|
|
6186
|
+
/**
|
|
6187
|
+
* Total aggregated duration spent generating text embeddings.
|
|
6188
|
+
*/
|
|
6189
|
+
embeddingsTextDurationTotal: Metric;
|
|
6190
|
+
/**
|
|
6191
|
+
* Total aggregated number of errors while generating text embeddings.
|
|
6192
|
+
*/
|
|
6193
|
+
embeddingsTextErrorsTotal: Metric;
|
|
6160
6194
|
/**
|
|
6161
6195
|
* Aggregated number of function executions per period.
|
|
6162
6196
|
*/
|
|
@@ -7497,6 +7531,10 @@ export namespace Models {
|
|
|
7497
7531
|
* Realtime connections
|
|
7498
7532
|
*/
|
|
7499
7533
|
realtime: number;
|
|
7534
|
+
/**
|
|
7535
|
+
* Realtime messages
|
|
7536
|
+
*/
|
|
7537
|
+
realtimeMessages: number;
|
|
7500
7538
|
/**
|
|
7501
7539
|
* Messages per month
|
|
7502
7540
|
*/
|
|
@@ -8917,6 +8955,14 @@ export namespace Models {
|
|
|
8917
8955
|
* Realtime additional resources
|
|
8918
8956
|
*/
|
|
8919
8957
|
realtime: AdditionalResource;
|
|
8958
|
+
/**
|
|
8959
|
+
* Realtime messages additional resources
|
|
8960
|
+
*/
|
|
8961
|
+
realtimeMessages: AdditionalResource;
|
|
8962
|
+
/**
|
|
8963
|
+
* Realtime bandwidth additional resources
|
|
8964
|
+
*/
|
|
8965
|
+
realtimeBandwidth: AdditionalResource;
|
|
8920
8966
|
/**
|
|
8921
8967
|
* Storage additional resources
|
|
8922
8968
|
*/
|
|
@@ -5,7 +5,7 @@ import type { Models } from '../models';
|
|
|
5
5
|
import { UsageRange } from '../enums/usage-range';
|
|
6
6
|
import { RelationshipType } from '../enums/relationship-type';
|
|
7
7
|
import { RelationMutate } from '../enums/relation-mutate';
|
|
8
|
-
import {
|
|
8
|
+
import { DatabasesIndexType } from '../enums/databases-index-type';
|
|
9
9
|
import { OrderBy } from '../enums/order-by';
|
|
10
10
|
|
|
11
11
|
export class Databases {
|
|
@@ -5885,7 +5885,7 @@ export class Databases {
|
|
|
5885
5885
|
* @param {string} params.databaseId - Database ID.
|
|
5886
5886
|
* @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).
|
|
5887
5887
|
* @param {string} params.key - Index Key.
|
|
5888
|
-
* @param {
|
|
5888
|
+
* @param {DatabasesIndexType} params.type - Index type.
|
|
5889
5889
|
* @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
|
|
5890
5890
|
* @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
|
|
5891
5891
|
* @param {number[]} params.lengths - Length of index. Maximum of 100
|
|
@@ -5893,7 +5893,7 @@ export class Databases {
|
|
|
5893
5893
|
* @returns {Promise<Models.Index>}
|
|
5894
5894
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead.
|
|
5895
5895
|
*/
|
|
5896
|
-
createIndex(params: { databaseId: string, collectionId: string, key: string, type:
|
|
5896
|
+
createIndex(params: { databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }): Promise<Models.Index>;
|
|
5897
5897
|
/**
|
|
5898
5898
|
* Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
|
|
5899
5899
|
* Attributes can be `key`, `fulltext`, and `unique`.
|
|
@@ -5901,7 +5901,7 @@ export class Databases {
|
|
|
5901
5901
|
* @param {string} databaseId - Database ID.
|
|
5902
5902
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
5903
5903
|
* @param {string} key - Index Key.
|
|
5904
|
-
* @param {
|
|
5904
|
+
* @param {DatabasesIndexType} type - Index type.
|
|
5905
5905
|
* @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
|
|
5906
5906
|
* @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed.
|
|
5907
5907
|
* @param {number[]} lengths - Length of index. Maximum of 100
|
|
@@ -5909,21 +5909,21 @@ export class Databases {
|
|
|
5909
5909
|
* @returns {Promise<Models.Index>}
|
|
5910
5910
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
5911
5911
|
*/
|
|
5912
|
-
createIndex(databaseId: string, collectionId: string, key: string, type:
|
|
5912
|
+
createIndex(databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.Index>;
|
|
5913
5913
|
createIndex(
|
|
5914
|
-
paramsOrFirst: { databaseId: string, collectionId: string, key: string, type:
|
|
5915
|
-
...rest: [(string)?, (string)?, (
|
|
5914
|
+
paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] } | string,
|
|
5915
|
+
...rest: [(string)?, (string)?, (DatabasesIndexType)?, (string[])?, (OrderBy[])?, (number[])?]
|
|
5916
5916
|
): Promise<Models.Index> {
|
|
5917
|
-
let params: { databaseId: string, collectionId: string, key: string, type:
|
|
5917
|
+
let params: { databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] };
|
|
5918
5918
|
|
|
5919
5919
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
5920
|
-
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type:
|
|
5920
|
+
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] };
|
|
5921
5921
|
} else {
|
|
5922
5922
|
params = {
|
|
5923
5923
|
databaseId: paramsOrFirst as string,
|
|
5924
5924
|
collectionId: rest[0] as string,
|
|
5925
5925
|
key: rest[1] as string,
|
|
5926
|
-
type: rest[2] as
|
|
5926
|
+
type: rest[2] as DatabasesIndexType,
|
|
5927
5927
|
attributes: rest[3] as string[],
|
|
5928
5928
|
orders: rest[4] as OrderBy[],
|
|
5929
5929
|
lengths: rest[5] as number[]
|
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}
|