@appwrite.io/console 2.1.1 → 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 +4 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +99 -7
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +100 -8
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +99 -7
- 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/package.json +1 -1
- package/src/client.ts +1 -1
- 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 +437 -375
- package/src/services/account.ts +20 -20
- package/src/services/avatars.ts +117 -117
- package/src/services/backups.ts +18 -18
- package/src/services/console.ts +24 -24
- package/src/services/databases.ts +89 -89
- package/src/services/domains.ts +295 -204
- package/src/services/functions.ts +30 -30
- package/src/services/health.ts +201 -152
- package/src/services/messaging.ts +54 -54
- package/src/services/migrations.ts +36 -36
- package/src/services/organizations.ts +67 -66
- package/src/services/projects.ts +81 -81
- package/src/services/sites.ts +30 -30
- package/src/services/storage.ts +45 -45
- package/src/services/tables-db.ts +89 -89
- package/src/services/users.ts +39 -39
- 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 +434 -375
- package/types/services/account.d.ts +11 -11
- package/types/services/avatars.d.ts +82 -82
- package/types/services/backups.d.ts +8 -8
- package/types/services/console.d.ts +14 -14
- package/types/services/databases.d.ts +50 -50
- package/types/services/domains.d.ts +139 -104
- package/types/services/functions.d.ts +15 -15
- package/types/services/health.d.ts +95 -78
- package/types/services/messaging.d.ts +24 -24
- package/types/services/migrations.d.ts +16 -16
- package/types/services/organizations.d.ts +37 -36
- package/types/services/projects.d.ts +36 -36
- package/types/services/sites.d.ts +15 -15
- package/types/services/storage.d.ts +30 -30
- package/types/services/tables-db.d.ts +50 -50
- package/types/services/users.d.ts +24 -24
package/dist/iife/sdk.js
CHANGED
|
@@ -4246,7 +4246,7 @@
|
|
|
4246
4246
|
'x-sdk-name': 'Console',
|
|
4247
4247
|
'x-sdk-platform': 'console',
|
|
4248
4248
|
'x-sdk-language': 'web',
|
|
4249
|
-
'x-sdk-version': '2.1.
|
|
4249
|
+
'x-sdk-version': '2.1.2',
|
|
4250
4250
|
'X-Appwrite-Response-Format': '1.8.0',
|
|
4251
4251
|
};
|
|
4252
4252
|
this.realtime = {
|
|
@@ -10701,6 +10701,54 @@
|
|
|
10701
10701
|
};
|
|
10702
10702
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
10703
10703
|
}
|
|
10704
|
+
listSuggestions(paramsOrFirst, ...rest) {
|
|
10705
|
+
let params;
|
|
10706
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10707
|
+
params = (paramsOrFirst || {});
|
|
10708
|
+
}
|
|
10709
|
+
else {
|
|
10710
|
+
params = {
|
|
10711
|
+
query: paramsOrFirst,
|
|
10712
|
+
tlds: rest[0],
|
|
10713
|
+
limit: rest[1],
|
|
10714
|
+
filterType: rest[2],
|
|
10715
|
+
priceMax: rest[3],
|
|
10716
|
+
priceMin: rest[4]
|
|
10717
|
+
};
|
|
10718
|
+
}
|
|
10719
|
+
const query = params.query;
|
|
10720
|
+
const tlds = params.tlds;
|
|
10721
|
+
const limit = params.limit;
|
|
10722
|
+
const filterType = params.filterType;
|
|
10723
|
+
const priceMax = params.priceMax;
|
|
10724
|
+
const priceMin = params.priceMin;
|
|
10725
|
+
if (typeof query === 'undefined') {
|
|
10726
|
+
throw new AppwriteException('Missing required parameter: "query"');
|
|
10727
|
+
}
|
|
10728
|
+
const apiPath = '/domains/suggestions';
|
|
10729
|
+
const payload = {};
|
|
10730
|
+
if (typeof query !== 'undefined') {
|
|
10731
|
+
payload['query'] = query;
|
|
10732
|
+
}
|
|
10733
|
+
if (typeof tlds !== 'undefined') {
|
|
10734
|
+
payload['tlds'] = tlds;
|
|
10735
|
+
}
|
|
10736
|
+
if (typeof limit !== 'undefined') {
|
|
10737
|
+
payload['limit'] = limit;
|
|
10738
|
+
}
|
|
10739
|
+
if (typeof filterType !== 'undefined') {
|
|
10740
|
+
payload['filterType'] = filterType;
|
|
10741
|
+
}
|
|
10742
|
+
if (typeof priceMax !== 'undefined') {
|
|
10743
|
+
payload['priceMax'] = priceMax;
|
|
10744
|
+
}
|
|
10745
|
+
if (typeof priceMin !== 'undefined') {
|
|
10746
|
+
payload['priceMin'] = priceMin;
|
|
10747
|
+
}
|
|
10748
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10749
|
+
const apiHeaders = {};
|
|
10750
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
10751
|
+
}
|
|
10704
10752
|
get(paramsOrFirst) {
|
|
10705
10753
|
let params;
|
|
10706
10754
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -13501,7 +13549,7 @@
|
|
|
13501
13549
|
* Check the Appwrite in-memory cache servers are up and connection is successful.
|
|
13502
13550
|
*
|
|
13503
13551
|
* @throws {AppwriteException}
|
|
13504
|
-
* @returns {Promise<Models.
|
|
13552
|
+
* @returns {Promise<Models.HealthStatusList>}
|
|
13505
13553
|
*/
|
|
13506
13554
|
getCache() {
|
|
13507
13555
|
const apiPath = '/health/cache';
|
|
@@ -13534,7 +13582,7 @@
|
|
|
13534
13582
|
* Check the Appwrite database servers are up and connection is successful.
|
|
13535
13583
|
*
|
|
13536
13584
|
* @throws {AppwriteException}
|
|
13537
|
-
* @returns {Promise<Models.
|
|
13585
|
+
* @returns {Promise<Models.HealthStatusList>}
|
|
13538
13586
|
*/
|
|
13539
13587
|
getDB() {
|
|
13540
13588
|
const apiPath = '/health/db';
|
|
@@ -13547,7 +13595,7 @@
|
|
|
13547
13595
|
* Check the Appwrite pub-sub servers are up and connection is successful.
|
|
13548
13596
|
*
|
|
13549
13597
|
* @throws {AppwriteException}
|
|
13550
|
-
* @returns {Promise<Models.
|
|
13598
|
+
* @returns {Promise<Models.HealthStatusList>}
|
|
13551
13599
|
*/
|
|
13552
13600
|
getPubSub() {
|
|
13553
13601
|
const apiPath = '/health/pubsub';
|
|
@@ -13556,6 +13604,26 @@
|
|
|
13556
13604
|
const apiHeaders = {};
|
|
13557
13605
|
return this.client.call('get', uri, apiHeaders, payload);
|
|
13558
13606
|
}
|
|
13607
|
+
getQueueAudits(paramsOrFirst) {
|
|
13608
|
+
let params;
|
|
13609
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
13610
|
+
params = (paramsOrFirst || {});
|
|
13611
|
+
}
|
|
13612
|
+
else {
|
|
13613
|
+
params = {
|
|
13614
|
+
threshold: paramsOrFirst
|
|
13615
|
+
};
|
|
13616
|
+
}
|
|
13617
|
+
const threshold = params.threshold;
|
|
13618
|
+
const apiPath = '/health/queue/audits';
|
|
13619
|
+
const payload = {};
|
|
13620
|
+
if (typeof threshold !== 'undefined') {
|
|
13621
|
+
payload['threshold'] = threshold;
|
|
13622
|
+
}
|
|
13623
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13624
|
+
const apiHeaders = {};
|
|
13625
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
13626
|
+
}
|
|
13559
13627
|
getQueueBillingProjectAggregation(paramsOrFirst) {
|
|
13560
13628
|
let params;
|
|
13561
13629
|
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -17675,7 +17743,7 @@
|
|
|
17675
17743
|
}
|
|
17676
17744
|
estimationCreateOrganization(paramsOrFirst, ...rest) {
|
|
17677
17745
|
let params;
|
|
17678
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
17746
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'billingPlan' in paramsOrFirst)) {
|
|
17679
17747
|
params = (paramsOrFirst || {});
|
|
17680
17748
|
}
|
|
17681
17749
|
else {
|
|
@@ -29240,8 +29308,6 @@
|
|
|
29240
29308
|
OAuthProvider["Yandex"] = "yandex";
|
|
29241
29309
|
OAuthProvider["Zoho"] = "zoho";
|
|
29242
29310
|
OAuthProvider["Zoom"] = "zoom";
|
|
29243
|
-
OAuthProvider["Mock"] = "mock";
|
|
29244
|
-
OAuthProvider["Mockunverified"] = "mock-unverified";
|
|
29245
29311
|
OAuthProvider["GithubImagine"] = "githubImagine";
|
|
29246
29312
|
OAuthProvider["GoogleImagine"] = "googleImagine";
|
|
29247
29313
|
})(exports.OAuthProvider || (exports.OAuthProvider = {}));
|
|
@@ -29965,6 +30031,12 @@
|
|
|
29965
30031
|
IndexType["Spatial"] = "spatial";
|
|
29966
30032
|
})(exports.IndexType || (exports.IndexType = {}));
|
|
29967
30033
|
|
|
30034
|
+
exports.FilterType = void 0;
|
|
30035
|
+
(function (FilterType) {
|
|
30036
|
+
FilterType["Premium"] = "premium";
|
|
30037
|
+
FilterType["Suggestion"] = "suggestion";
|
|
30038
|
+
})(exports.FilterType || (exports.FilterType = {}));
|
|
30039
|
+
|
|
29968
30040
|
exports.Runtime = void 0;
|
|
29969
30041
|
(function (Runtime) {
|
|
29970
30042
|
Runtime["Node145"] = "node-14.5";
|
|
@@ -30076,6 +30148,7 @@
|
|
|
30076
30148
|
Name["V1webhooks"] = "v1-webhooks";
|
|
30077
30149
|
Name["V1certificates"] = "v1-certificates";
|
|
30078
30150
|
Name["V1builds"] = "v1-builds";
|
|
30151
|
+
Name["V1screenshots"] = "v1-screenshots";
|
|
30079
30152
|
Name["V1messaging"] = "v1-messaging";
|
|
30080
30153
|
Name["V1migrations"] = "v1-migrations";
|
|
30081
30154
|
})(exports.Name || (exports.Name = {}));
|
|
@@ -30093,6 +30166,25 @@
|
|
|
30093
30166
|
SmtpEncryption["Tls"] = "tls";
|
|
30094
30167
|
})(exports.SmtpEncryption || (exports.SmtpEncryption = {}));
|
|
30095
30168
|
|
|
30169
|
+
exports.BillingPlan = void 0;
|
|
30170
|
+
(function (BillingPlan) {
|
|
30171
|
+
BillingPlan["Tier0"] = "tier-0";
|
|
30172
|
+
BillingPlan["Tier1"] = "tier-1";
|
|
30173
|
+
BillingPlan["Tier2"] = "tier-2";
|
|
30174
|
+
BillingPlan["Imaginetier0"] = "imagine-tier-0";
|
|
30175
|
+
BillingPlan["Imaginetier1"] = "imagine-tier-1";
|
|
30176
|
+
BillingPlan["Imaginetier150"] = "imagine-tier-1-50";
|
|
30177
|
+
BillingPlan["Imaginetier1100"] = "imagine-tier-1-100";
|
|
30178
|
+
BillingPlan["Imaginetier1200"] = "imagine-tier-1-200";
|
|
30179
|
+
BillingPlan["Imaginetier1290"] = "imagine-tier-1-290";
|
|
30180
|
+
BillingPlan["Imaginetier1480"] = "imagine-tier-1-480";
|
|
30181
|
+
BillingPlan["Imaginetier1700"] = "imagine-tier-1-700";
|
|
30182
|
+
BillingPlan["Imaginetier1900"] = "imagine-tier-1-900";
|
|
30183
|
+
BillingPlan["Imaginetier11100"] = "imagine-tier-1-1100";
|
|
30184
|
+
BillingPlan["Imaginetier11650"] = "imagine-tier-1-1650";
|
|
30185
|
+
BillingPlan["Imaginetier12200"] = "imagine-tier-1-2200";
|
|
30186
|
+
})(exports.BillingPlan || (exports.BillingPlan = {}));
|
|
30187
|
+
|
|
30096
30188
|
exports.ProjectUsageRange = void 0;
|
|
30097
30189
|
(function (ProjectUsageRange) {
|
|
30098
30190
|
ProjectUsageRange["OneHour"] = "1h";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Domains, FilterType } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const domains = new Domains(client);
|
|
8
|
+
|
|
9
|
+
const result = await domains.listSuggestions({
|
|
10
|
+
query: '<QUERY>',
|
|
11
|
+
tlds: [], // optional
|
|
12
|
+
limit: null, // optional
|
|
13
|
+
filterType: FilterType.Premium, // optional
|
|
14
|
+
priceMax: null, // optional
|
|
15
|
+
priceMin: null // optional
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
console.log(result);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Client, Health } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const health = new Health(client);
|
|
8
|
+
|
|
9
|
+
const result = await health.getQueueAudits({
|
|
10
|
+
threshold: null // optional
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
console.log(result);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, Organizations, Platform } from "@appwrite.io/console";
|
|
1
|
+
import { Client, Organizations, BillingPlan, Platform } from "@appwrite.io/console";
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
@@ -9,7 +9,7 @@ const organizations = new Organizations(client);
|
|
|
9
9
|
const result = await organizations.create({
|
|
10
10
|
organizationId: '<ORGANIZATION_ID>',
|
|
11
11
|
name: '<NAME>',
|
|
12
|
-
billingPlan:
|
|
12
|
+
billingPlan: BillingPlan.Tier0,
|
|
13
13
|
paymentMethodId: '<PAYMENT_METHOD_ID>', // optional
|
|
14
14
|
billingAddressId: '<BILLING_ADDRESS_ID>', // optional
|
|
15
15
|
invites: [], // optional
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, Organizations, Platform } from "@appwrite.io/console";
|
|
1
|
+
import { Client, Organizations, BillingPlan, Platform } from "@appwrite.io/console";
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
@@ -7,7 +7,7 @@ const client = new Client()
|
|
|
7
7
|
const organizations = new Organizations(client);
|
|
8
8
|
|
|
9
9
|
const result = await organizations.estimationCreateOrganization({
|
|
10
|
-
billingPlan:
|
|
10
|
+
billingPlan: BillingPlan.Tier0,
|
|
11
11
|
paymentMethodId: '<PAYMENT_METHOD_ID>', // optional
|
|
12
12
|
invites: [], // optional
|
|
13
13
|
couponId: '<COUPON_ID>', // optional
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, Organizations } from "@appwrite.io/console";
|
|
1
|
+
import { Client, Organizations, BillingPlan } from "@appwrite.io/console";
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
@@ -8,7 +8,7 @@ const organizations = new Organizations(client);
|
|
|
8
8
|
|
|
9
9
|
const result = await organizations.estimationUpdatePlan({
|
|
10
10
|
organizationId: '<ORGANIZATION_ID>',
|
|
11
|
-
billingPlan:
|
|
11
|
+
billingPlan: BillingPlan.Tier0,
|
|
12
12
|
invites: [], // optional
|
|
13
13
|
couponId: '<COUPON_ID>' // optional
|
|
14
14
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, Organizations } from "@appwrite.io/console";
|
|
1
|
+
import { Client, Organizations, BillingPlan } from "@appwrite.io/console";
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
@@ -8,7 +8,7 @@ const organizations = new Organizations(client);
|
|
|
8
8
|
|
|
9
9
|
const result = await organizations.updatePlan({
|
|
10
10
|
organizationId: '<ORGANIZATION_ID>',
|
|
11
|
-
billingPlan:
|
|
11
|
+
billingPlan: BillingPlan.Tier0,
|
|
12
12
|
paymentMethodId: '<PAYMENT_METHOD_ID>', // optional
|
|
13
13
|
billingAddressId: '<BILLING_ADDRESS_ID>', // optional
|
|
14
14
|
invites: [], // optional
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@appwrite.io/console",
|
|
3
3
|
"homepage": "https://appwrite.io/support",
|
|
4
4
|
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
|
|
5
|
-
"version": "2.1.
|
|
5
|
+
"version": "2.1.2",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
package/src/client.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export enum BillingPlan {
|
|
2
|
+
Tier0 = 'tier-0',
|
|
3
|
+
Tier1 = 'tier-1',
|
|
4
|
+
Tier2 = 'tier-2',
|
|
5
|
+
Imaginetier0 = 'imagine-tier-0',
|
|
6
|
+
Imaginetier1 = 'imagine-tier-1',
|
|
7
|
+
Imaginetier150 = 'imagine-tier-1-50',
|
|
8
|
+
Imaginetier1100 = 'imagine-tier-1-100',
|
|
9
|
+
Imaginetier1200 = 'imagine-tier-1-200',
|
|
10
|
+
Imaginetier1290 = 'imagine-tier-1-290',
|
|
11
|
+
Imaginetier1480 = 'imagine-tier-1-480',
|
|
12
|
+
Imaginetier1700 = 'imagine-tier-1-700',
|
|
13
|
+
Imaginetier1900 = 'imagine-tier-1-900',
|
|
14
|
+
Imaginetier11100 = 'imagine-tier-1-1100',
|
|
15
|
+
Imaginetier11650 = 'imagine-tier-1-1650',
|
|
16
|
+
Imaginetier12200 = 'imagine-tier-1-2200',
|
|
17
|
+
}
|
package/src/enums/name.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -52,6 +52,7 @@ export { UsageRange } from './enums/usage-range';
|
|
|
52
52
|
export { RelationshipType } from './enums/relationship-type';
|
|
53
53
|
export { RelationMutate } from './enums/relation-mutate';
|
|
54
54
|
export { IndexType } from './enums/index-type';
|
|
55
|
+
export { FilterType } from './enums/filter-type';
|
|
55
56
|
export { Runtime } from './enums/runtime';
|
|
56
57
|
export { TemplateReferenceType } from './enums/template-reference-type';
|
|
57
58
|
export { VCSReferenceType } from './enums/vcs-reference-type';
|
|
@@ -60,6 +61,7 @@ export { ExecutionMethod } from './enums/execution-method';
|
|
|
60
61
|
export { Name } from './enums/name';
|
|
61
62
|
export { MessagePriority } from './enums/message-priority';
|
|
62
63
|
export { SmtpEncryption } from './enums/smtp-encryption';
|
|
64
|
+
export { BillingPlan } from './enums/billing-plan';
|
|
63
65
|
export { ProjectUsageRange } from './enums/project-usage-range';
|
|
64
66
|
export { Region } from './enums/region';
|
|
65
67
|
export { Api } from './enums/api';
|