@appwrite.io/console 2.1.0 → 2.1.2
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 +8 -0
- package/README.md +2 -2
- package/dist/cjs/sdk.js +153 -22
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +150 -23
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +3910 -22
- package/docs/examples/domains/list-suggestions.md +18 -0
- package/docs/examples/health/get-queue-audits.md +13 -0
- package/docs/examples/organizations/create.md +2 -2
- package/docs/examples/organizations/estimation-create-organization.md +2 -2
- package/docs/examples/organizations/estimation-update-plan.md +2 -2
- package/docs/examples/organizations/update-plan.md +2 -2
- package/docs/examples/projects/update-labels.md +14 -0
- package/package.json +7 -1
- package/rollup.config.js +40 -24
- package/src/client.ts +20 -10
- package/src/enums/billing-plan.ts +17 -0
- package/src/enums/filter-type.ts +4 -0
- package/src/enums/name.ts +1 -0
- package/src/enums/o-auth-provider.ts +0 -2
- package/src/index.ts +2 -0
- package/src/models.ts +129 -59
- package/src/query.ts +14 -11
- package/src/services/databases.ts +30 -30
- package/src/services/domains.ts +91 -0
- package/src/services/health.ts +55 -6
- package/src/services/organizations.ts +37 -36
- package/src/services/projects.ts +65 -2
- package/src/services/storage.ts +4 -4
- package/src/services/tables-db.ts +30 -30
- package/types/client.d.ts +8 -1
- package/types/enums/billing-plan.d.ts +17 -0
- package/types/enums/filter-type.d.ts +4 -0
- package/types/enums/name.d.ts +1 -0
- package/types/enums/o-auth-provider.d.ts +0 -2
- package/types/index.d.ts +2 -0
- package/types/models.d.ts +126 -59
- package/types/query.d.ts +8 -8
- package/types/services/databases.d.ts +20 -20
- package/types/services/domains.d.ts +35 -0
- package/types/services/health.d.ts +23 -6
- package/types/services/organizations.d.ts +17 -16
- package/types/services/projects.d.ts +24 -2
- package/types/services/storage.d.ts +4 -4
- package/types/services/tables-db.d.ts +20 -20
package/src/models.ts
CHANGED
|
@@ -566,6 +566,20 @@ export namespace Models {
|
|
|
566
566
|
variables: Variable[];
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
+
/**
|
|
570
|
+
* Status List
|
|
571
|
+
*/
|
|
572
|
+
export type HealthStatusList = {
|
|
573
|
+
/**
|
|
574
|
+
* Total number of statuses that matched your query.
|
|
575
|
+
*/
|
|
576
|
+
total: number;
|
|
577
|
+
/**
|
|
578
|
+
* List of statuses.
|
|
579
|
+
*/
|
|
580
|
+
statuses: HealthStatus[];
|
|
581
|
+
}
|
|
582
|
+
|
|
569
583
|
/**
|
|
570
584
|
* Rule List
|
|
571
585
|
*/
|
|
@@ -907,11 +921,11 @@ export namespace Models {
|
|
|
907
921
|
/**
|
|
908
922
|
* Minimum value to enforce for new documents.
|
|
909
923
|
*/
|
|
910
|
-
min?: number;
|
|
924
|
+
min?: number | bigint;
|
|
911
925
|
/**
|
|
912
926
|
* Maximum value to enforce for new documents.
|
|
913
927
|
*/
|
|
914
|
-
max?: number;
|
|
928
|
+
max?: number | bigint;
|
|
915
929
|
/**
|
|
916
930
|
* Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
917
931
|
*/
|
|
@@ -1581,11 +1595,11 @@ export namespace Models {
|
|
|
1581
1595
|
/**
|
|
1582
1596
|
* Minimum value to enforce for new documents.
|
|
1583
1597
|
*/
|
|
1584
|
-
min?: number;
|
|
1598
|
+
min?: number | bigint;
|
|
1585
1599
|
/**
|
|
1586
1600
|
* Maximum value to enforce for new documents.
|
|
1587
1601
|
*/
|
|
1588
|
-
max?: number;
|
|
1602
|
+
max?: number | bigint;
|
|
1589
1603
|
/**
|
|
1590
1604
|
* Default value for column when not provided. Cannot be set when column is required.
|
|
1591
1605
|
*/
|
|
@@ -2873,6 +2887,14 @@ export namespace Models {
|
|
|
2873
2887
|
* Total number of chunks uploaded
|
|
2874
2888
|
*/
|
|
2875
2889
|
chunksUploaded: number;
|
|
2890
|
+
/**
|
|
2891
|
+
* Whether file contents are encrypted at rest.
|
|
2892
|
+
*/
|
|
2893
|
+
encryption: boolean;
|
|
2894
|
+
/**
|
|
2895
|
+
* Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
|
|
2896
|
+
*/
|
|
2897
|
+
compression: string;
|
|
2876
2898
|
}
|
|
2877
2899
|
|
|
2878
2900
|
/**
|
|
@@ -2916,7 +2938,7 @@ export namespace Models {
|
|
|
2916
2938
|
*/
|
|
2917
2939
|
allowedFileExtensions: string[];
|
|
2918
2940
|
/**
|
|
2919
|
-
* Compression algorithm
|
|
2941
|
+
* Compression algorithm chosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
|
|
2920
2942
|
*/
|
|
2921
2943
|
compression: string;
|
|
2922
2944
|
/**
|
|
@@ -2931,6 +2953,10 @@ export namespace Models {
|
|
|
2931
2953
|
* Image transformations are enabled.
|
|
2932
2954
|
*/
|
|
2933
2955
|
transformations: boolean;
|
|
2956
|
+
/**
|
|
2957
|
+
* Total size of this bucket in bytes.
|
|
2958
|
+
*/
|
|
2959
|
+
totalSize: number;
|
|
2934
2960
|
}
|
|
2935
2961
|
|
|
2936
2962
|
/**
|
|
@@ -4221,6 +4247,10 @@ export namespace Models {
|
|
|
4221
4247
|
* Last ping datetime in ISO 8601 format.
|
|
4222
4248
|
*/
|
|
4223
4249
|
pingedAt: string;
|
|
4250
|
+
/**
|
|
4251
|
+
* Labels for the project.
|
|
4252
|
+
*/
|
|
4253
|
+
labels: string[];
|
|
4224
4254
|
/**
|
|
4225
4255
|
* Email/Password auth method status
|
|
4226
4256
|
*/
|
|
@@ -5292,125 +5322,125 @@ export namespace Models {
|
|
|
5292
5322
|
*/
|
|
5293
5323
|
range: string;
|
|
5294
5324
|
/**
|
|
5295
|
-
* Total aggregated number of
|
|
5325
|
+
* Total aggregated number of sites.
|
|
5326
|
+
*/
|
|
5327
|
+
sitesTotal: number;
|
|
5328
|
+
/**
|
|
5329
|
+
* Aggregated number of sites per period.
|
|
5330
|
+
*/
|
|
5331
|
+
sites: Metric[];
|
|
5332
|
+
/**
|
|
5333
|
+
* Total aggregated number of sites deployments.
|
|
5296
5334
|
*/
|
|
5297
5335
|
deploymentsTotal: number;
|
|
5298
5336
|
/**
|
|
5299
|
-
* Total aggregated sum of
|
|
5337
|
+
* Total aggregated sum of sites deployment storage.
|
|
5300
5338
|
*/
|
|
5301
5339
|
deploymentsStorageTotal: number;
|
|
5302
5340
|
/**
|
|
5303
|
-
* Total aggregated number of
|
|
5341
|
+
* Total aggregated number of sites build.
|
|
5304
5342
|
*/
|
|
5305
5343
|
buildsTotal: number;
|
|
5306
5344
|
/**
|
|
5307
|
-
* total aggregated sum of
|
|
5345
|
+
* total aggregated sum of sites build storage.
|
|
5308
5346
|
*/
|
|
5309
5347
|
buildsStorageTotal: number;
|
|
5310
5348
|
/**
|
|
5311
|
-
* Total aggregated sum of
|
|
5349
|
+
* Total aggregated sum of sites build compute time.
|
|
5312
5350
|
*/
|
|
5313
5351
|
buildsTimeTotal: number;
|
|
5314
5352
|
/**
|
|
5315
|
-
* Total aggregated sum of
|
|
5353
|
+
* Total aggregated sum of sites build mbSeconds.
|
|
5316
5354
|
*/
|
|
5317
5355
|
buildsMbSecondsTotal: number;
|
|
5318
5356
|
/**
|
|
5319
|
-
* Total aggregated number of
|
|
5357
|
+
* Total aggregated number of sites execution.
|
|
5320
5358
|
*/
|
|
5321
5359
|
executionsTotal: number;
|
|
5322
5360
|
/**
|
|
5323
|
-
* Total aggregated sum of
|
|
5361
|
+
* Total aggregated sum of sites execution compute time.
|
|
5324
5362
|
*/
|
|
5325
5363
|
executionsTimeTotal: number;
|
|
5326
5364
|
/**
|
|
5327
|
-
* Total aggregated sum of
|
|
5365
|
+
* Total aggregated sum of sites execution mbSeconds.
|
|
5328
5366
|
*/
|
|
5329
5367
|
executionsMbSecondsTotal: number;
|
|
5330
5368
|
/**
|
|
5331
|
-
*
|
|
5369
|
+
* Total aggregated number of requests.
|
|
5370
|
+
*/
|
|
5371
|
+
requestsTotal: number;
|
|
5372
|
+
/**
|
|
5373
|
+
* Aggregated number of requests per period.
|
|
5374
|
+
*/
|
|
5375
|
+
requests: Metric[];
|
|
5376
|
+
/**
|
|
5377
|
+
* Total aggregated inbound bandwidth.
|
|
5378
|
+
*/
|
|
5379
|
+
inboundTotal: number;
|
|
5380
|
+
/**
|
|
5381
|
+
* Aggregated number of inbound bandwidth per period.
|
|
5382
|
+
*/
|
|
5383
|
+
inbound: Metric[];
|
|
5384
|
+
/**
|
|
5385
|
+
* Total aggregated outbound bandwidth.
|
|
5386
|
+
*/
|
|
5387
|
+
outboundTotal: number;
|
|
5388
|
+
/**
|
|
5389
|
+
* Aggregated number of outbound bandwidth per period.
|
|
5390
|
+
*/
|
|
5391
|
+
outbound: Metric[];
|
|
5392
|
+
/**
|
|
5393
|
+
* Aggregated number of sites deployment per period.
|
|
5332
5394
|
*/
|
|
5333
5395
|
deployments: Metric[];
|
|
5334
5396
|
/**
|
|
5335
|
-
* Aggregated number of
|
|
5397
|
+
* Aggregated number of sites deployment storage per period.
|
|
5336
5398
|
*/
|
|
5337
5399
|
deploymentsStorage: Metric[];
|
|
5338
5400
|
/**
|
|
5339
|
-
* Total aggregated number of successful
|
|
5401
|
+
* Total aggregated number of successful site builds.
|
|
5340
5402
|
*/
|
|
5341
5403
|
buildsSuccessTotal: number;
|
|
5342
5404
|
/**
|
|
5343
|
-
* Total aggregated number of failed
|
|
5405
|
+
* Total aggregated number of failed site builds.
|
|
5344
5406
|
*/
|
|
5345
5407
|
buildsFailedTotal: number;
|
|
5346
5408
|
/**
|
|
5347
|
-
* Aggregated number of
|
|
5409
|
+
* Aggregated number of sites build per period.
|
|
5348
5410
|
*/
|
|
5349
5411
|
builds: Metric[];
|
|
5350
5412
|
/**
|
|
5351
|
-
* Aggregated sum of
|
|
5413
|
+
* Aggregated sum of sites build storage per period.
|
|
5352
5414
|
*/
|
|
5353
5415
|
buildsStorage: Metric[];
|
|
5354
5416
|
/**
|
|
5355
|
-
* Aggregated sum of
|
|
5417
|
+
* Aggregated sum of sites build compute time per period.
|
|
5356
5418
|
*/
|
|
5357
5419
|
buildsTime: Metric[];
|
|
5358
5420
|
/**
|
|
5359
|
-
* Aggregated sum of
|
|
5421
|
+
* Aggregated sum of sites build mbSeconds per period.
|
|
5360
5422
|
*/
|
|
5361
5423
|
buildsMbSeconds: Metric[];
|
|
5362
5424
|
/**
|
|
5363
|
-
* Aggregated number of
|
|
5425
|
+
* Aggregated number of sites execution per period.
|
|
5364
5426
|
*/
|
|
5365
5427
|
executions: Metric[];
|
|
5366
5428
|
/**
|
|
5367
|
-
* Aggregated number of
|
|
5429
|
+
* Aggregated number of sites execution compute time per period.
|
|
5368
5430
|
*/
|
|
5369
5431
|
executionsTime: Metric[];
|
|
5370
5432
|
/**
|
|
5371
|
-
* Aggregated number of
|
|
5433
|
+
* Aggregated number of sites mbSeconds per period.
|
|
5372
5434
|
*/
|
|
5373
5435
|
executionsMbSeconds: Metric[];
|
|
5374
5436
|
/**
|
|
5375
|
-
* Aggregated number of successful
|
|
5437
|
+
* Aggregated number of successful site builds per period.
|
|
5376
5438
|
*/
|
|
5377
5439
|
buildsSuccess: Metric[];
|
|
5378
5440
|
/**
|
|
5379
|
-
* Aggregated number of failed
|
|
5441
|
+
* Aggregated number of failed site builds per period.
|
|
5380
5442
|
*/
|
|
5381
5443
|
buildsFailed: Metric[];
|
|
5382
|
-
/**
|
|
5383
|
-
* Total aggregated number of sites.
|
|
5384
|
-
*/
|
|
5385
|
-
sitesTotal: number;
|
|
5386
|
-
/**
|
|
5387
|
-
* Aggregated number of sites per period.
|
|
5388
|
-
*/
|
|
5389
|
-
sites: Metric[];
|
|
5390
|
-
/**
|
|
5391
|
-
* Total aggregated number of requests.
|
|
5392
|
-
*/
|
|
5393
|
-
requestsTotal: number;
|
|
5394
|
-
/**
|
|
5395
|
-
* Aggregated number of requests per period.
|
|
5396
|
-
*/
|
|
5397
|
-
requests: Metric[];
|
|
5398
|
-
/**
|
|
5399
|
-
* Total aggregated inbound bandwidth.
|
|
5400
|
-
*/
|
|
5401
|
-
inboundTotal: number;
|
|
5402
|
-
/**
|
|
5403
|
-
* Aggregated number of inbound bandwidth per period.
|
|
5404
|
-
*/
|
|
5405
|
-
inbound: Metric[];
|
|
5406
|
-
/**
|
|
5407
|
-
* Total aggregated outbound bandwidth.
|
|
5408
|
-
*/
|
|
5409
|
-
outboundTotal: number;
|
|
5410
|
-
/**
|
|
5411
|
-
* Aggregated number of outbound bandwidth per period.
|
|
5412
|
-
*/
|
|
5413
|
-
outbound: Metric[];
|
|
5414
5444
|
}
|
|
5415
5445
|
|
|
5416
5446
|
/**
|
|
@@ -6699,6 +6729,10 @@ export namespace Models {
|
|
|
6699
6729
|
* Function executions
|
|
6700
6730
|
*/
|
|
6701
6731
|
executions: number;
|
|
6732
|
+
/**
|
|
6733
|
+
* Rolling max executions retained per function/site
|
|
6734
|
+
*/
|
|
6735
|
+
executionsRetentionCount: number;
|
|
6702
6736
|
/**
|
|
6703
6737
|
* GB hours for functions
|
|
6704
6738
|
*/
|
|
@@ -8199,6 +8233,28 @@ export namespace Models {
|
|
|
8199
8233
|
value: number;
|
|
8200
8234
|
}
|
|
8201
8235
|
|
|
8236
|
+
/**
|
|
8237
|
+
* DomainSuggestion
|
|
8238
|
+
*/
|
|
8239
|
+
export type DomainSuggestion = {
|
|
8240
|
+
/**
|
|
8241
|
+
* Domain suggestion.
|
|
8242
|
+
*/
|
|
8243
|
+
domain: string;
|
|
8244
|
+
/**
|
|
8245
|
+
* Is the domain premium?
|
|
8246
|
+
*/
|
|
8247
|
+
premium: boolean;
|
|
8248
|
+
/**
|
|
8249
|
+
* Domain price.
|
|
8250
|
+
*/
|
|
8251
|
+
price?: number;
|
|
8252
|
+
/**
|
|
8253
|
+
* Is the domain available?
|
|
8254
|
+
*/
|
|
8255
|
+
available: boolean;
|
|
8256
|
+
}
|
|
8257
|
+
|
|
8202
8258
|
/**
|
|
8203
8259
|
* Aggregation team list
|
|
8204
8260
|
*/
|
|
@@ -8366,4 +8422,18 @@ export namespace Models {
|
|
|
8366
8422
|
*/
|
|
8367
8423
|
dnsRecords: DnsRecord[];
|
|
8368
8424
|
}
|
|
8425
|
+
|
|
8426
|
+
/**
|
|
8427
|
+
* Domain suggestions list
|
|
8428
|
+
*/
|
|
8429
|
+
export type DomainSuggestionsList = {
|
|
8430
|
+
/**
|
|
8431
|
+
* Total number of suggestions that matched your query.
|
|
8432
|
+
*/
|
|
8433
|
+
total: number;
|
|
8434
|
+
/**
|
|
8435
|
+
* List of suggestions.
|
|
8436
|
+
*/
|
|
8437
|
+
suggestions: DomainSuggestion[];
|
|
8438
|
+
}
|
|
8369
8439
|
}
|
package/src/query.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import JSONbigModule from 'json-bigint';
|
|
2
|
+
const JSONbig = JSONbigModule({ useNativeBigInt: true });
|
|
3
|
+
|
|
4
|
+
type QueryTypesSingle = string | number | bigint | boolean;
|
|
5
|
+
export type QueryTypesList = string[] | number[] | bigint[] | boolean[] | Query[] | any[];
|
|
3
6
|
export type QueryTypes = QueryTypesSingle | QueryTypesList;
|
|
4
7
|
type AttributesTypes = string | string[];
|
|
5
8
|
|
|
@@ -41,7 +44,7 @@ export class Query {
|
|
|
41
44
|
* @returns {string}
|
|
42
45
|
*/
|
|
43
46
|
toString(): string {
|
|
44
|
-
return
|
|
47
|
+
return JSONbig.stringify({
|
|
45
48
|
method: this.method,
|
|
46
49
|
attribute: this.attribute,
|
|
47
50
|
values: this.values,
|
|
@@ -130,11 +133,11 @@ export class Query {
|
|
|
130
133
|
* Filter resources where attribute is between start and end (inclusive).
|
|
131
134
|
*
|
|
132
135
|
* @param {string} attribute
|
|
133
|
-
* @param {string | number} start
|
|
134
|
-
* @param {string | number} end
|
|
136
|
+
* @param {string | number | bigint} start
|
|
137
|
+
* @param {string | number | bigint} end
|
|
135
138
|
* @returns {string}
|
|
136
139
|
*/
|
|
137
|
-
static between = (attribute: string, start: string | number, end: string | number): string =>
|
|
140
|
+
static between = (attribute: string, start: string | number | bigint, end: string | number | bigint): string =>
|
|
138
141
|
new Query("between", attribute, [start, end] as QueryTypesList).toString();
|
|
139
142
|
|
|
140
143
|
/**
|
|
@@ -274,11 +277,11 @@ export class Query {
|
|
|
274
277
|
* Filter resources where attribute is not between start and end (exclusive).
|
|
275
278
|
*
|
|
276
279
|
* @param {string} attribute
|
|
277
|
-
* @param {string | number} start
|
|
278
|
-
* @param {string | number} end
|
|
280
|
+
* @param {string | number | bigint} start
|
|
281
|
+
* @param {string | number | bigint} end
|
|
279
282
|
* @returns {string}
|
|
280
283
|
*/
|
|
281
|
-
static notBetween = (attribute: string, start: string | number, end: string | number): string =>
|
|
284
|
+
static notBetween = (attribute: string, start: string | number | bigint, end: string | number | bigint): string =>
|
|
282
285
|
new Query("notBetween", attribute, [start, end] as QueryTypesList).toString();
|
|
283
286
|
|
|
284
287
|
/**
|
|
@@ -364,7 +367,7 @@ export class Query {
|
|
|
364
367
|
* @returns {string}
|
|
365
368
|
*/
|
|
366
369
|
static or = (queries: string[]) =>
|
|
367
|
-
new Query("or", undefined, queries.map((query) =>
|
|
370
|
+
new Query("or", undefined, queries.map((query) => JSONbig.parse(query))).toString();
|
|
368
371
|
|
|
369
372
|
/**
|
|
370
373
|
* Combine multiple queries using logical AND operator.
|
|
@@ -373,7 +376,7 @@ export class Query {
|
|
|
373
376
|
* @returns {string}
|
|
374
377
|
*/
|
|
375
378
|
static and = (queries: string[]) =>
|
|
376
|
-
new Query("and", undefined, queries.map((query) =>
|
|
379
|
+
new Query("and", undefined, queries.map((query) => JSONbig.parse(query))).toString();
|
|
377
380
|
|
|
378
381
|
/**
|
|
379
382
|
* Filter resources where attribute is at a specific distance from the given coordinates.
|
|
@@ -2208,15 +2208,15 @@ export class Databases {
|
|
|
2208
2208
|
* @param {string} params.collectionId - Collection ID.
|
|
2209
2209
|
* @param {string} params.key - Attribute Key.
|
|
2210
2210
|
* @param {boolean} params.required - Is attribute required?
|
|
2211
|
-
* @param {number} params.min - Minimum value
|
|
2212
|
-
* @param {number} params.max - Maximum value
|
|
2213
|
-
* @param {number} params.xdefault - Default value. Cannot be set when attribute is required.
|
|
2211
|
+
* @param {number | bigint} params.min - Minimum value
|
|
2212
|
+
* @param {number | bigint} params.max - Maximum value
|
|
2213
|
+
* @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required.
|
|
2214
2214
|
* @param {boolean} params.array - Is attribute an array?
|
|
2215
2215
|
* @throws {AppwriteException}
|
|
2216
2216
|
* @returns {Promise<Models.AttributeInteger>}
|
|
2217
2217
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead.
|
|
2218
2218
|
*/
|
|
2219
|
-
createIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise<Models.AttributeInteger>;
|
|
2219
|
+
createIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise<Models.AttributeInteger>;
|
|
2220
2220
|
/**
|
|
2221
2221
|
* Create an integer attribute. Optionally, minimum and maximum values can be provided.
|
|
2222
2222
|
*
|
|
@@ -2225,32 +2225,32 @@ export class Databases {
|
|
|
2225
2225
|
* @param {string} collectionId - Collection ID.
|
|
2226
2226
|
* @param {string} key - Attribute Key.
|
|
2227
2227
|
* @param {boolean} required - Is attribute required?
|
|
2228
|
-
* @param {number} min - Minimum value
|
|
2229
|
-
* @param {number} max - Maximum value
|
|
2230
|
-
* @param {number} xdefault - Default value. Cannot be set when attribute is required.
|
|
2228
|
+
* @param {number | bigint} min - Minimum value
|
|
2229
|
+
* @param {number | bigint} max - Maximum value
|
|
2230
|
+
* @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required.
|
|
2231
2231
|
* @param {boolean} array - Is attribute an array?
|
|
2232
2232
|
* @throws {AppwriteException}
|
|
2233
2233
|
* @returns {Promise<Models.AttributeInteger>}
|
|
2234
2234
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2235
2235
|
*/
|
|
2236
|
-
createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
|
|
2236
|
+
createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise<Models.AttributeInteger>;
|
|
2237
2237
|
createIntegerAttribute(
|
|
2238
|
-
paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean } | string,
|
|
2239
|
-
...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (boolean)?]
|
|
2238
|
+
paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string,
|
|
2239
|
+
...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?]
|
|
2240
2240
|
): Promise<Models.AttributeInteger> {
|
|
2241
|
-
let params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean };
|
|
2241
|
+
let params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean };
|
|
2242
2242
|
|
|
2243
2243
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2244
|
-
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean };
|
|
2244
|
+
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean };
|
|
2245
2245
|
} else {
|
|
2246
2246
|
params = {
|
|
2247
2247
|
databaseId: paramsOrFirst as string,
|
|
2248
2248
|
collectionId: rest[0] as string,
|
|
2249
2249
|
key: rest[1] as string,
|
|
2250
2250
|
required: rest[2] as boolean,
|
|
2251
|
-
min: rest[3] as number,
|
|
2252
|
-
max: rest[4] as number,
|
|
2253
|
-
xdefault: rest[5] as number,
|
|
2251
|
+
min: rest[3] as number | bigint,
|
|
2252
|
+
max: rest[4] as number | bigint,
|
|
2253
|
+
xdefault: rest[5] as number | bigint,
|
|
2254
2254
|
array: rest[6] as boolean
|
|
2255
2255
|
};
|
|
2256
2256
|
}
|
|
@@ -2319,15 +2319,15 @@ export class Databases {
|
|
|
2319
2319
|
* @param {string} params.collectionId - Collection ID.
|
|
2320
2320
|
* @param {string} params.key - Attribute Key.
|
|
2321
2321
|
* @param {boolean} params.required - Is attribute required?
|
|
2322
|
-
* @param {number} params.xdefault - Default value. Cannot be set when attribute is required.
|
|
2323
|
-
* @param {number} params.min - Minimum value
|
|
2324
|
-
* @param {number} params.max - Maximum value
|
|
2322
|
+
* @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required.
|
|
2323
|
+
* @param {number | bigint} params.min - Minimum value
|
|
2324
|
+
* @param {number | bigint} params.max - Maximum value
|
|
2325
2325
|
* @param {string} params.newKey - New Attribute Key.
|
|
2326
2326
|
* @throws {AppwriteException}
|
|
2327
2327
|
* @returns {Promise<Models.AttributeInteger>}
|
|
2328
2328
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead.
|
|
2329
2329
|
*/
|
|
2330
|
-
updateIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise<Models.AttributeInteger>;
|
|
2330
|
+
updateIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise<Models.AttributeInteger>;
|
|
2331
2331
|
/**
|
|
2332
2332
|
* Update an integer attribute. Changing the `default` value will not update already existing documents.
|
|
2333
2333
|
*
|
|
@@ -2336,32 +2336,32 @@ export class Databases {
|
|
|
2336
2336
|
* @param {string} collectionId - Collection ID.
|
|
2337
2337
|
* @param {string} key - Attribute Key.
|
|
2338
2338
|
* @param {boolean} required - Is attribute required?
|
|
2339
|
-
* @param {number} xdefault - Default value. Cannot be set when attribute is required.
|
|
2340
|
-
* @param {number} min - Minimum value
|
|
2341
|
-
* @param {number} max - Maximum value
|
|
2339
|
+
* @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required.
|
|
2340
|
+
* @param {number | bigint} min - Minimum value
|
|
2341
|
+
* @param {number | bigint} max - Maximum value
|
|
2342
2342
|
* @param {string} newKey - New Attribute Key.
|
|
2343
2343
|
* @throws {AppwriteException}
|
|
2344
2344
|
* @returns {Promise<Models.AttributeInteger>}
|
|
2345
2345
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2346
2346
|
*/
|
|
2347
|
-
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger>;
|
|
2347
|
+
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise<Models.AttributeInteger>;
|
|
2348
2348
|
updateIntegerAttribute(
|
|
2349
|
-
paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string } | string,
|
|
2350
|
-
...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (string)?]
|
|
2349
|
+
paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string,
|
|
2350
|
+
...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?]
|
|
2351
2351
|
): Promise<Models.AttributeInteger> {
|
|
2352
|
-
let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string };
|
|
2352
|
+
let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string };
|
|
2353
2353
|
|
|
2354
2354
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2355
|
-
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string };
|
|
2355
|
+
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string };
|
|
2356
2356
|
} else {
|
|
2357
2357
|
params = {
|
|
2358
2358
|
databaseId: paramsOrFirst as string,
|
|
2359
2359
|
collectionId: rest[0] as string,
|
|
2360
2360
|
key: rest[1] as string,
|
|
2361
2361
|
required: rest[2] as boolean,
|
|
2362
|
-
xdefault: rest[3] as number,
|
|
2363
|
-
min: rest[4] as number,
|
|
2364
|
-
max: rest[5] as number,
|
|
2362
|
+
xdefault: rest[3] as number | bigint,
|
|
2363
|
+
min: rest[4] as number | bigint,
|
|
2364
|
+
max: rest[5] as number | bigint,
|
|
2365
2365
|
newKey: rest[6] as string
|
|
2366
2366
|
};
|
|
2367
2367
|
}
|
package/src/services/domains.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
|
|
5
|
+
import { FilterType } from '../enums/filter-type';
|
|
5
6
|
|
|
6
7
|
export class Domains {
|
|
7
8
|
client: Client;
|
|
@@ -135,6 +136,96 @@ export class Domains {
|
|
|
135
136
|
);
|
|
136
137
|
}
|
|
137
138
|
|
|
139
|
+
/**
|
|
140
|
+
* List domain suggestions.
|
|
141
|
+
*
|
|
142
|
+
* @param {string} params.query - Query to find available domains and suggestions. Max length: 256 chars.
|
|
143
|
+
* @param {string[]} params.tlds - TLDs to suggest.
|
|
144
|
+
* @param {number} params.limit - Maximum number of suggestions to return.
|
|
145
|
+
* @param {FilterType} params.filterType - Filter type: premium, suggestion.
|
|
146
|
+
* @param {number} params.priceMax - Filter premium domains by maximum price. Only premium domains at or below this price will be returned. Does not affect regular domain suggestions.
|
|
147
|
+
* @param {number} params.priceMin - Filter premium domains by minimum price. Only premium domains at or above this price will be returned. Does not affect regular domain suggestions.
|
|
148
|
+
* @throws {AppwriteException}
|
|
149
|
+
* @returns {Promise<Models.DomainSuggestionsList>}
|
|
150
|
+
*/
|
|
151
|
+
listSuggestions(params: { query: string, tlds?: string[], limit?: number, filterType?: FilterType, priceMax?: number, priceMin?: number }): Promise<Models.DomainSuggestionsList>;
|
|
152
|
+
/**
|
|
153
|
+
* List domain suggestions.
|
|
154
|
+
*
|
|
155
|
+
* @param {string} query - Query to find available domains and suggestions. Max length: 256 chars.
|
|
156
|
+
* @param {string[]} tlds - TLDs to suggest.
|
|
157
|
+
* @param {number} limit - Maximum number of suggestions to return.
|
|
158
|
+
* @param {FilterType} filterType - Filter type: premium, suggestion.
|
|
159
|
+
* @param {number} priceMax - Filter premium domains by maximum price. Only premium domains at or below this price will be returned. Does not affect regular domain suggestions.
|
|
160
|
+
* @param {number} priceMin - Filter premium domains by minimum price. Only premium domains at or above this price will be returned. Does not affect regular domain suggestions.
|
|
161
|
+
* @throws {AppwriteException}
|
|
162
|
+
* @returns {Promise<Models.DomainSuggestionsList>}
|
|
163
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
164
|
+
*/
|
|
165
|
+
listSuggestions(query: string, tlds?: string[], limit?: number, filterType?: FilterType, priceMax?: number, priceMin?: number): Promise<Models.DomainSuggestionsList>;
|
|
166
|
+
listSuggestions(
|
|
167
|
+
paramsOrFirst: { query: string, tlds?: string[], limit?: number, filterType?: FilterType, priceMax?: number, priceMin?: number } | string,
|
|
168
|
+
...rest: [(string[])?, (number)?, (FilterType)?, (number)?, (number)?]
|
|
169
|
+
): Promise<Models.DomainSuggestionsList> {
|
|
170
|
+
let params: { query: string, tlds?: string[], limit?: number, filterType?: FilterType, priceMax?: number, priceMin?: number };
|
|
171
|
+
|
|
172
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
173
|
+
params = (paramsOrFirst || {}) as { query: string, tlds?: string[], limit?: number, filterType?: FilterType, priceMax?: number, priceMin?: number };
|
|
174
|
+
} else {
|
|
175
|
+
params = {
|
|
176
|
+
query: paramsOrFirst as string,
|
|
177
|
+
tlds: rest[0] as string[],
|
|
178
|
+
limit: rest[1] as number,
|
|
179
|
+
filterType: rest[2] as FilterType,
|
|
180
|
+
priceMax: rest[3] as number,
|
|
181
|
+
priceMin: rest[4] as number
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const query = params.query;
|
|
186
|
+
const tlds = params.tlds;
|
|
187
|
+
const limit = params.limit;
|
|
188
|
+
const filterType = params.filterType;
|
|
189
|
+
const priceMax = params.priceMax;
|
|
190
|
+
const priceMin = params.priceMin;
|
|
191
|
+
|
|
192
|
+
if (typeof query === 'undefined') {
|
|
193
|
+
throw new AppwriteException('Missing required parameter: "query"');
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const apiPath = '/domains/suggestions';
|
|
197
|
+
const payload: Payload = {};
|
|
198
|
+
if (typeof query !== 'undefined') {
|
|
199
|
+
payload['query'] = query;
|
|
200
|
+
}
|
|
201
|
+
if (typeof tlds !== 'undefined') {
|
|
202
|
+
payload['tlds'] = tlds;
|
|
203
|
+
}
|
|
204
|
+
if (typeof limit !== 'undefined') {
|
|
205
|
+
payload['limit'] = limit;
|
|
206
|
+
}
|
|
207
|
+
if (typeof filterType !== 'undefined') {
|
|
208
|
+
payload['filterType'] = filterType;
|
|
209
|
+
}
|
|
210
|
+
if (typeof priceMax !== 'undefined') {
|
|
211
|
+
payload['priceMax'] = priceMax;
|
|
212
|
+
}
|
|
213
|
+
if (typeof priceMin !== 'undefined') {
|
|
214
|
+
payload['priceMin'] = priceMin;
|
|
215
|
+
}
|
|
216
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
217
|
+
|
|
218
|
+
const apiHeaders: { [header: string]: string } = {
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return this.client.call(
|
|
222
|
+
'get',
|
|
223
|
+
uri,
|
|
224
|
+
apiHeaders,
|
|
225
|
+
payload
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
138
229
|
/**
|
|
139
230
|
* Get a domain by its unique ID.
|
|
140
231
|
*
|