@appwrite.io/console 1.8.0 → 1.9.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/README.md +3 -3
- package/dist/cjs/sdk.js +287 -8
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +288 -9
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +287 -8
- package/docs/examples/databases/decrement-document-attribute.md +18 -0
- package/docs/examples/databases/increment-document-attribute.md +18 -0
- package/docs/examples/databases/upsert-documents.md +1 -1
- package/docs/examples/domains/create-record-a-a-a-a.md +1 -1
- package/docs/examples/domains/create-record-a.md +1 -1
- package/docs/examples/domains/create-record-alias.md +1 -1
- package/docs/examples/domains/create-record-c-a-a.md +1 -1
- package/docs/examples/domains/create-record-c-n-a-m-e.md +1 -1
- package/docs/examples/domains/create-record-h-t-t-p-s.md +1 -1
- package/docs/examples/domains/create-record-m-x.md +1 -1
- package/docs/examples/domains/create-record-n-s.md +1 -1
- package/docs/examples/domains/create-record-s-r-v.md +1 -1
- package/docs/examples/domains/create-record-t-x-t.md +1 -1
- package/docs/examples/domains/update-record-a-a-a-a.md +1 -1
- package/docs/examples/domains/update-record-a.md +1 -1
- package/docs/examples/domains/update-record-alias.md +1 -1
- package/docs/examples/domains/update-record-c-a-a.md +1 -1
- package/docs/examples/domains/update-record-c-n-a-m-e.md +1 -1
- package/docs/examples/domains/update-record-h-t-t-p-s.md +1 -1
- package/docs/examples/domains/update-record-m-x.md +1 -1
- package/docs/examples/domains/update-record-n-s.md +1 -1
- package/docs/examples/domains/update-record-s-r-v.md +1 -1
- package/docs/examples/domains/update-record-t-x-t.md +1 -1
- package/docs/examples/health/{get-queue-stats-usage-dump.md → get-queue-billing-project-aggregation.md} +2 -2
- package/docs/examples/health/{get-queue-billing-aggregation.md → get-queue-billing-team-aggregation.md} +1 -1
- package/docs/examples/organizations/cancel-downgrade.md +13 -0
- package/docs/examples/organizations/estimation-create-organization.md +16 -0
- package/docs/examples/organizations/estimation-delete-organization.md +13 -0
- package/docs/examples/organizations/estimation-update-plan.md +16 -0
- package/docs/examples/organizations/get-usage.md +1 -1
- package/docs/examples/organizations/validate-payment.md +14 -0
- package/docs/examples/proxy/create-redirect-rule.md +4 -2
- package/package.json +1 -1
- package/src/client.ts +5 -4
- package/src/enums/build-runtime.ts +2 -0
- package/src/enums/image-format.ts +1 -0
- package/src/enums/proxy-resource-type.ts +4 -0
- package/src/enums/runtime.ts +2 -0
- package/src/index.ts +1 -0
- package/src/models.ts +272 -2
- package/src/services/databases.ts +96 -1
- package/src/services/health.ts +28 -3
- package/src/services/organizations.ts +197 -0
- package/src/services/proxy.ts +16 -1
- package/types/enums/build-runtime.d.ts +3 -1
- package/types/enums/image-format.d.ts +2 -1
- package/types/enums/proxy-resource-type.d.ts +4 -0
- package/types/enums/runtime.d.ts +3 -1
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +272 -2
- package/types/services/databases.d.ts +27 -1
- package/types/services/health.d.ts +10 -2
- package/types/services/organizations.d.ts +57 -0
- package/types/services/proxy.d.ts +4 -1
- package/docs/examples/functions/create-build.md +0 -15
- package/docs/examples/functions/get-function-usage.md +0 -14
- package/docs/examples/functions/update-deployment-build.md +0 -14
- package/docs/examples/functions/update-deployment.md +0 -14
- package/docs/examples/proxy/create-rule.md +0 -15
- package/src/enums/resource-type.ts +0 -4
- package/types/enums/resource-type.d.ts +0 -4
package/dist/iife/sdk.js
CHANGED
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
'x-sdk-name': 'Console',
|
|
282
282
|
'x-sdk-platform': 'console',
|
|
283
283
|
'x-sdk-language': 'web',
|
|
284
|
-
'x-sdk-version': '1.
|
|
284
|
+
'x-sdk-version': '1.9.0',
|
|
285
285
|
'X-Appwrite-Response-Format': '1.7.0',
|
|
286
286
|
};
|
|
287
287
|
this.realtime = {
|
|
@@ -616,9 +616,10 @@
|
|
|
616
616
|
return { uri: url.toString(), options };
|
|
617
617
|
}
|
|
618
618
|
chunkedUpload(method, url, headers = {}, originalPayload = {}, onProgress) {
|
|
619
|
+
var _a;
|
|
619
620
|
return __awaiter(this, void 0, void 0, function* () {
|
|
620
|
-
const file = Object.
|
|
621
|
-
if (!file) {
|
|
621
|
+
const [fileParam, file] = (_a = Object.entries(originalPayload).find(([_, value]) => value instanceof File)) !== null && _a !== void 0 ? _a : [];
|
|
622
|
+
if (!file || !fileParam) {
|
|
622
623
|
throw new Error('File not found in payload');
|
|
623
624
|
}
|
|
624
625
|
if (file.size <= Client.CHUNK_SIZE) {
|
|
@@ -633,7 +634,8 @@
|
|
|
633
634
|
}
|
|
634
635
|
headers['content-range'] = `bytes ${start}-${end - 1}/${file.size}`;
|
|
635
636
|
const chunk = file.slice(start, end);
|
|
636
|
-
let payload = Object.assign(
|
|
637
|
+
let payload = Object.assign({}, originalPayload);
|
|
638
|
+
payload[fileParam] = new File([chunk], file.name);
|
|
637
639
|
response = yield this.call(method, url, headers, payload);
|
|
638
640
|
if (onProgress && typeof onProgress === 'function') {
|
|
639
641
|
onProgress({
|
|
@@ -4422,6 +4424,9 @@
|
|
|
4422
4424
|
if (typeof collectionId === 'undefined') {
|
|
4423
4425
|
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
4424
4426
|
}
|
|
4427
|
+
if (typeof documents === 'undefined') {
|
|
4428
|
+
throw new AppwriteException('Missing required parameter: "documents"');
|
|
4429
|
+
}
|
|
4425
4430
|
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
4426
4431
|
const payload = {};
|
|
4427
4432
|
if (typeof documents !== 'undefined') {
|
|
@@ -4649,6 +4654,84 @@
|
|
|
4649
4654
|
const apiHeaders = {};
|
|
4650
4655
|
return this.client.call('get', uri, apiHeaders, payload);
|
|
4651
4656
|
}
|
|
4657
|
+
/**
|
|
4658
|
+
* Decrement a specific attribute of a document by a given value.
|
|
4659
|
+
*
|
|
4660
|
+
* @param {string} databaseId
|
|
4661
|
+
* @param {string} collectionId
|
|
4662
|
+
* @param {string} documentId
|
|
4663
|
+
* @param {string} attribute
|
|
4664
|
+
* @param {number} value
|
|
4665
|
+
* @param {number} min
|
|
4666
|
+
* @throws {AppwriteException}
|
|
4667
|
+
* @returns {Promise<Document>}
|
|
4668
|
+
*/
|
|
4669
|
+
decrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, min) {
|
|
4670
|
+
if (typeof databaseId === 'undefined') {
|
|
4671
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
4672
|
+
}
|
|
4673
|
+
if (typeof collectionId === 'undefined') {
|
|
4674
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
4675
|
+
}
|
|
4676
|
+
if (typeof documentId === 'undefined') {
|
|
4677
|
+
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
4678
|
+
}
|
|
4679
|
+
if (typeof attribute === 'undefined') {
|
|
4680
|
+
throw new AppwriteException('Missing required parameter: "attribute"');
|
|
4681
|
+
}
|
|
4682
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
|
|
4683
|
+
const payload = {};
|
|
4684
|
+
if (typeof value !== 'undefined') {
|
|
4685
|
+
payload['value'] = value;
|
|
4686
|
+
}
|
|
4687
|
+
if (typeof min !== 'undefined') {
|
|
4688
|
+
payload['min'] = min;
|
|
4689
|
+
}
|
|
4690
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4691
|
+
const apiHeaders = {
|
|
4692
|
+
'content-type': 'application/json',
|
|
4693
|
+
};
|
|
4694
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
4695
|
+
}
|
|
4696
|
+
/**
|
|
4697
|
+
* Increment a specific attribute of a document by a given value.
|
|
4698
|
+
*
|
|
4699
|
+
* @param {string} databaseId
|
|
4700
|
+
* @param {string} collectionId
|
|
4701
|
+
* @param {string} documentId
|
|
4702
|
+
* @param {string} attribute
|
|
4703
|
+
* @param {number} value
|
|
4704
|
+
* @param {number} max
|
|
4705
|
+
* @throws {AppwriteException}
|
|
4706
|
+
* @returns {Promise<Document>}
|
|
4707
|
+
*/
|
|
4708
|
+
incrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, max) {
|
|
4709
|
+
if (typeof databaseId === 'undefined') {
|
|
4710
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
4711
|
+
}
|
|
4712
|
+
if (typeof collectionId === 'undefined') {
|
|
4713
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
4714
|
+
}
|
|
4715
|
+
if (typeof documentId === 'undefined') {
|
|
4716
|
+
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
4717
|
+
}
|
|
4718
|
+
if (typeof attribute === 'undefined') {
|
|
4719
|
+
throw new AppwriteException('Missing required parameter: "attribute"');
|
|
4720
|
+
}
|
|
4721
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
|
|
4722
|
+
const payload = {};
|
|
4723
|
+
if (typeof value !== 'undefined') {
|
|
4724
|
+
payload['value'] = value;
|
|
4725
|
+
}
|
|
4726
|
+
if (typeof max !== 'undefined') {
|
|
4727
|
+
payload['max'] = max;
|
|
4728
|
+
}
|
|
4729
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4730
|
+
const apiHeaders = {
|
|
4731
|
+
'content-type': 'application/json',
|
|
4732
|
+
};
|
|
4733
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
4734
|
+
}
|
|
4652
4735
|
/**
|
|
4653
4736
|
* List indexes in the collection.
|
|
4654
4737
|
*
|
|
@@ -7431,14 +7514,31 @@
|
|
|
7431
7514
|
return this.client.call('get', uri, apiHeaders, payload);
|
|
7432
7515
|
}
|
|
7433
7516
|
/**
|
|
7434
|
-
* Get billing aggregation queue
|
|
7517
|
+
* Get billing project aggregation queue
|
|
7518
|
+
*
|
|
7519
|
+
* @param {number} threshold
|
|
7520
|
+
* @throws {AppwriteException}
|
|
7521
|
+
* @returns {Promise<Models.HealthQueue>}
|
|
7522
|
+
*/
|
|
7523
|
+
getQueueBillingProjectAggregation(threshold) {
|
|
7524
|
+
const apiPath = '/health/queue/billing-project-aggregation';
|
|
7525
|
+
const payload = {};
|
|
7526
|
+
if (typeof threshold !== 'undefined') {
|
|
7527
|
+
payload['threshold'] = threshold;
|
|
7528
|
+
}
|
|
7529
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
7530
|
+
const apiHeaders = {};
|
|
7531
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
7532
|
+
}
|
|
7533
|
+
/**
|
|
7534
|
+
* Get billing team aggregation queue
|
|
7435
7535
|
*
|
|
7436
7536
|
* @param {number} threshold
|
|
7437
7537
|
* @throws {AppwriteException}
|
|
7438
7538
|
* @returns {Promise<Models.HealthQueue>}
|
|
7439
7539
|
*/
|
|
7440
|
-
|
|
7441
|
-
const apiPath = '/health/queue/billing-aggregation';
|
|
7540
|
+
getQueueBillingTeamAggregation(threshold) {
|
|
7541
|
+
const apiPath = '/health/queue/billing-team-aggregation';
|
|
7442
7542
|
const payload = {};
|
|
7443
7543
|
if (typeof threshold !== 'undefined') {
|
|
7444
7544
|
payload['threshold'] = threshold;
|
|
@@ -10281,6 +10381,40 @@
|
|
|
10281
10381
|
};
|
|
10282
10382
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
10283
10383
|
}
|
|
10384
|
+
/**
|
|
10385
|
+
* Get estimation for creating an organization.
|
|
10386
|
+
*
|
|
10387
|
+
* @param {BillingPlan} billingPlan
|
|
10388
|
+
* @param {string} paymentMethodId
|
|
10389
|
+
* @param {string[]} invites
|
|
10390
|
+
* @param {string} couponId
|
|
10391
|
+
* @throws {AppwriteException}
|
|
10392
|
+
* @returns {Promise<Models.Estimation>}
|
|
10393
|
+
*/
|
|
10394
|
+
estimationCreateOrganization(billingPlan, paymentMethodId, invites, couponId) {
|
|
10395
|
+
if (typeof billingPlan === 'undefined') {
|
|
10396
|
+
throw new AppwriteException('Missing required parameter: "billingPlan"');
|
|
10397
|
+
}
|
|
10398
|
+
const apiPath = '/organizations/estimations/create-organization';
|
|
10399
|
+
const payload = {};
|
|
10400
|
+
if (typeof billingPlan !== 'undefined') {
|
|
10401
|
+
payload['billingPlan'] = billingPlan;
|
|
10402
|
+
}
|
|
10403
|
+
if (typeof paymentMethodId !== 'undefined') {
|
|
10404
|
+
payload['paymentMethodId'] = paymentMethodId;
|
|
10405
|
+
}
|
|
10406
|
+
if (typeof invites !== 'undefined') {
|
|
10407
|
+
payload['invites'] = invites;
|
|
10408
|
+
}
|
|
10409
|
+
if (typeof couponId !== 'undefined') {
|
|
10410
|
+
payload['couponId'] = couponId;
|
|
10411
|
+
}
|
|
10412
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10413
|
+
const apiHeaders = {
|
|
10414
|
+
'content-type': 'application/json',
|
|
10415
|
+
};
|
|
10416
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
10417
|
+
}
|
|
10284
10418
|
/**
|
|
10285
10419
|
* Delete an organization.
|
|
10286
10420
|
*
|
|
@@ -10533,6 +10667,59 @@
|
|
|
10533
10667
|
const apiHeaders = {};
|
|
10534
10668
|
return this.client.call('get', uri, apiHeaders, payload);
|
|
10535
10669
|
}
|
|
10670
|
+
/**
|
|
10671
|
+
* Get estimation for deleting an organization.
|
|
10672
|
+
*
|
|
10673
|
+
* @param {string} organizationId
|
|
10674
|
+
* @throws {AppwriteException}
|
|
10675
|
+
* @returns {Promise<Models.EstimationDeleteOrganization>}
|
|
10676
|
+
*/
|
|
10677
|
+
estimationDeleteOrganization(organizationId) {
|
|
10678
|
+
if (typeof organizationId === 'undefined') {
|
|
10679
|
+
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
10680
|
+
}
|
|
10681
|
+
const apiPath = '/organizations/{organizationId}/estimations/delete-organization'.replace('{organizationId}', organizationId);
|
|
10682
|
+
const payload = {};
|
|
10683
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10684
|
+
const apiHeaders = {
|
|
10685
|
+
'content-type': 'application/json',
|
|
10686
|
+
};
|
|
10687
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
10688
|
+
}
|
|
10689
|
+
/**
|
|
10690
|
+
* Get estimation for updating the organization plan.
|
|
10691
|
+
*
|
|
10692
|
+
* @param {string} organizationId
|
|
10693
|
+
* @param {BillingPlan} billingPlan
|
|
10694
|
+
* @param {string[]} invites
|
|
10695
|
+
* @param {string} couponId
|
|
10696
|
+
* @throws {AppwriteException}
|
|
10697
|
+
* @returns {Promise<Models.EstimationUpdatePlan>}
|
|
10698
|
+
*/
|
|
10699
|
+
estimationUpdatePlan(organizationId, billingPlan, invites, couponId) {
|
|
10700
|
+
if (typeof organizationId === 'undefined') {
|
|
10701
|
+
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
10702
|
+
}
|
|
10703
|
+
if (typeof billingPlan === 'undefined') {
|
|
10704
|
+
throw new AppwriteException('Missing required parameter: "billingPlan"');
|
|
10705
|
+
}
|
|
10706
|
+
const apiPath = '/organizations/{organizationId}/estimations/update-plan'.replace('{organizationId}', organizationId);
|
|
10707
|
+
const payload = {};
|
|
10708
|
+
if (typeof billingPlan !== 'undefined') {
|
|
10709
|
+
payload['billingPlan'] = billingPlan;
|
|
10710
|
+
}
|
|
10711
|
+
if (typeof invites !== 'undefined') {
|
|
10712
|
+
payload['invites'] = invites;
|
|
10713
|
+
}
|
|
10714
|
+
if (typeof couponId !== 'undefined') {
|
|
10715
|
+
payload['couponId'] = couponId;
|
|
10716
|
+
}
|
|
10717
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10718
|
+
const apiHeaders = {
|
|
10719
|
+
'content-type': 'application/json',
|
|
10720
|
+
};
|
|
10721
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
10722
|
+
}
|
|
10536
10723
|
/**
|
|
10537
10724
|
* List all invoices for an organization.
|
|
10538
10725
|
*
|
|
@@ -10849,6 +11036,25 @@
|
|
|
10849
11036
|
};
|
|
10850
11037
|
return this.client.call('patch', uri, apiHeaders, payload);
|
|
10851
11038
|
}
|
|
11039
|
+
/**
|
|
11040
|
+
* Cancel the downgrade initiated for an organization.
|
|
11041
|
+
*
|
|
11042
|
+
* @param {string} organizationId
|
|
11043
|
+
* @throws {AppwriteException}
|
|
11044
|
+
* @returns {Promise<Models.Organization<Preferences>>}
|
|
11045
|
+
*/
|
|
11046
|
+
cancelDowngrade(organizationId) {
|
|
11047
|
+
if (typeof organizationId === 'undefined') {
|
|
11048
|
+
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
11049
|
+
}
|
|
11050
|
+
const apiPath = '/organizations/{organizationId}/plan/cancel'.replace('{organizationId}', organizationId);
|
|
11051
|
+
const payload = {};
|
|
11052
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11053
|
+
const apiHeaders = {
|
|
11054
|
+
'content-type': 'application/json',
|
|
11055
|
+
};
|
|
11056
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
11057
|
+
}
|
|
10852
11058
|
/**
|
|
10853
11059
|
* Get Scopes
|
|
10854
11060
|
*
|
|
@@ -10892,6 +11098,54 @@
|
|
|
10892
11098
|
};
|
|
10893
11099
|
return this.client.call('patch', uri, apiHeaders, payload);
|
|
10894
11100
|
}
|
|
11101
|
+
/**
|
|
11102
|
+
* Get the usage data for an organization.
|
|
11103
|
+
*
|
|
11104
|
+
* @param {string} organizationId
|
|
11105
|
+
* @param {string} startDate
|
|
11106
|
+
* @param {string} endDate
|
|
11107
|
+
* @throws {AppwriteException}
|
|
11108
|
+
* @returns {Promise<Models.UsageOrganization>}
|
|
11109
|
+
*/
|
|
11110
|
+
getUsage(organizationId, startDate, endDate) {
|
|
11111
|
+
if (typeof organizationId === 'undefined') {
|
|
11112
|
+
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
11113
|
+
}
|
|
11114
|
+
const apiPath = '/organizations/{organizationId}/usage'.replace('{organizationId}', organizationId);
|
|
11115
|
+
const payload = {};
|
|
11116
|
+
if (typeof startDate !== 'undefined') {
|
|
11117
|
+
payload['startDate'] = startDate;
|
|
11118
|
+
}
|
|
11119
|
+
if (typeof endDate !== 'undefined') {
|
|
11120
|
+
payload['endDate'] = endDate;
|
|
11121
|
+
}
|
|
11122
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11123
|
+
const apiHeaders = {};
|
|
11124
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
11125
|
+
}
|
|
11126
|
+
/**
|
|
11127
|
+
* Validate payment for team after creation or upgrade.
|
|
11128
|
+
*
|
|
11129
|
+
* @param {string} organizationId
|
|
11130
|
+
* @param {string[]} invites
|
|
11131
|
+
* @throws {AppwriteException}
|
|
11132
|
+
* @returns {Promise<Models.Organization<Preferences>>}
|
|
11133
|
+
*/
|
|
11134
|
+
validatePayment(organizationId, invites) {
|
|
11135
|
+
if (typeof organizationId === 'undefined') {
|
|
11136
|
+
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
11137
|
+
}
|
|
11138
|
+
const apiPath = '/organizations/{organizationId}/validate'.replace('{organizationId}', organizationId);
|
|
11139
|
+
const payload = {};
|
|
11140
|
+
if (typeof invites !== 'undefined') {
|
|
11141
|
+
payload['invites'] = invites;
|
|
11142
|
+
}
|
|
11143
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11144
|
+
const apiHeaders = {
|
|
11145
|
+
'content-type': 'application/json',
|
|
11146
|
+
};
|
|
11147
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
11148
|
+
}
|
|
10895
11149
|
}
|
|
10896
11150
|
|
|
10897
11151
|
class Project {
|
|
@@ -12768,10 +13022,12 @@
|
|
|
12768
13022
|
* @param {string} domain
|
|
12769
13023
|
* @param {string} url
|
|
12770
13024
|
* @param {StatusCode} statusCode
|
|
13025
|
+
* @param {string} resourceId
|
|
13026
|
+
* @param {ProxyResourceType} resourceType
|
|
12771
13027
|
* @throws {AppwriteException}
|
|
12772
13028
|
* @returns {Promise<Models.ProxyRule>}
|
|
12773
13029
|
*/
|
|
12774
|
-
createRedirectRule(domain, url, statusCode) {
|
|
13030
|
+
createRedirectRule(domain, url, statusCode, resourceId, resourceType) {
|
|
12775
13031
|
if (typeof domain === 'undefined') {
|
|
12776
13032
|
throw new AppwriteException('Missing required parameter: "domain"');
|
|
12777
13033
|
}
|
|
@@ -12781,6 +13037,12 @@
|
|
|
12781
13037
|
if (typeof statusCode === 'undefined') {
|
|
12782
13038
|
throw new AppwriteException('Missing required parameter: "statusCode"');
|
|
12783
13039
|
}
|
|
13040
|
+
if (typeof resourceId === 'undefined') {
|
|
13041
|
+
throw new AppwriteException('Missing required parameter: "resourceId"');
|
|
13042
|
+
}
|
|
13043
|
+
if (typeof resourceType === 'undefined') {
|
|
13044
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
13045
|
+
}
|
|
12784
13046
|
const apiPath = '/proxy/rules/redirect';
|
|
12785
13047
|
const payload = {};
|
|
12786
13048
|
if (typeof domain !== 'undefined') {
|
|
@@ -12792,6 +13054,12 @@
|
|
|
12792
13054
|
if (typeof statusCode !== 'undefined') {
|
|
12793
13055
|
payload['statusCode'] = statusCode;
|
|
12794
13056
|
}
|
|
13057
|
+
if (typeof resourceId !== 'undefined') {
|
|
13058
|
+
payload['resourceId'] = resourceId;
|
|
13059
|
+
}
|
|
13060
|
+
if (typeof resourceType !== 'undefined') {
|
|
13061
|
+
payload['resourceType'] = resourceType;
|
|
13062
|
+
}
|
|
12795
13063
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12796
13064
|
const apiHeaders = {
|
|
12797
13065
|
'content-type': 'application/json',
|
|
@@ -16769,6 +17037,7 @@
|
|
|
16769
17037
|
Runtime["Dart31"] = "dart-3.1";
|
|
16770
17038
|
Runtime["Dart33"] = "dart-3.3";
|
|
16771
17039
|
Runtime["Dart35"] = "dart-3.5";
|
|
17040
|
+
Runtime["Dart38"] = "dart-3.8";
|
|
16772
17041
|
Runtime["Dotnet60"] = "dotnet-6.0";
|
|
16773
17042
|
Runtime["Dotnet70"] = "dotnet-7.0";
|
|
16774
17043
|
Runtime["Dotnet80"] = "dotnet-8.0";
|
|
@@ -16795,6 +17064,7 @@
|
|
|
16795
17064
|
Runtime["Flutter324"] = "flutter-3.24";
|
|
16796
17065
|
Runtime["Flutter327"] = "flutter-3.27";
|
|
16797
17066
|
Runtime["Flutter329"] = "flutter-3.29";
|
|
17067
|
+
Runtime["Flutter332"] = "flutter-3.32";
|
|
16798
17068
|
})(exports.Runtime || (exports.Runtime = {}));
|
|
16799
17069
|
|
|
16800
17070
|
exports.FunctionUsageRange = void 0;
|
|
@@ -17232,6 +17502,12 @@
|
|
|
17232
17502
|
StatusCode["PermanentRedirect308"] = "308";
|
|
17233
17503
|
})(exports.StatusCode || (exports.StatusCode = {}));
|
|
17234
17504
|
|
|
17505
|
+
exports.ProxyResourceType = void 0;
|
|
17506
|
+
(function (ProxyResourceType) {
|
|
17507
|
+
ProxyResourceType["Site"] = "site";
|
|
17508
|
+
ProxyResourceType["Function"] = "function";
|
|
17509
|
+
})(exports.ProxyResourceType || (exports.ProxyResourceType = {}));
|
|
17510
|
+
|
|
17235
17511
|
exports.Framework = void 0;
|
|
17236
17512
|
(function (Framework) {
|
|
17237
17513
|
Framework["Analog"] = "analog";
|
|
@@ -17286,6 +17562,7 @@
|
|
|
17286
17562
|
BuildRuntime["Dart31"] = "dart-3.1";
|
|
17287
17563
|
BuildRuntime["Dart33"] = "dart-3.3";
|
|
17288
17564
|
BuildRuntime["Dart35"] = "dart-3.5";
|
|
17565
|
+
BuildRuntime["Dart38"] = "dart-3.8";
|
|
17289
17566
|
BuildRuntime["Dotnet60"] = "dotnet-6.0";
|
|
17290
17567
|
BuildRuntime["Dotnet70"] = "dotnet-7.0";
|
|
17291
17568
|
BuildRuntime["Dotnet80"] = "dotnet-8.0";
|
|
@@ -17312,6 +17589,7 @@
|
|
|
17312
17589
|
BuildRuntime["Flutter324"] = "flutter-3.24";
|
|
17313
17590
|
BuildRuntime["Flutter327"] = "flutter-3.27";
|
|
17314
17591
|
BuildRuntime["Flutter329"] = "flutter-3.29";
|
|
17592
|
+
BuildRuntime["Flutter332"] = "flutter-3.32";
|
|
17315
17593
|
})(exports.BuildRuntime || (exports.BuildRuntime = {}));
|
|
17316
17594
|
|
|
17317
17595
|
exports.Adapter = void 0;
|
|
@@ -17355,6 +17633,7 @@
|
|
|
17355
17633
|
ImageFormat["Webp"] = "webp";
|
|
17356
17634
|
ImageFormat["Heic"] = "heic";
|
|
17357
17635
|
ImageFormat["Avif"] = "avif";
|
|
17636
|
+
ImageFormat["Gif"] = "gif";
|
|
17358
17637
|
})(exports.ImageFormat || (exports.ImageFormat = {}));
|
|
17359
17638
|
|
|
17360
17639
|
exports.StorageUsageRange = void 0;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Databases } 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 databases = new Databases(client);
|
|
8
|
+
|
|
9
|
+
const result = await databases.decrementDocumentAttribute(
|
|
10
|
+
'<DATABASE_ID>', // databaseId
|
|
11
|
+
'<COLLECTION_ID>', // collectionId
|
|
12
|
+
'<DOCUMENT_ID>', // documentId
|
|
13
|
+
'', // attribute
|
|
14
|
+
null, // value (optional)
|
|
15
|
+
null // min (optional)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
console.log(result);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Databases } 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 databases = new Databases(client);
|
|
8
|
+
|
|
9
|
+
const result = await databases.incrementDocumentAttribute(
|
|
10
|
+
'<DATABASE_ID>', // databaseId
|
|
11
|
+
'<COLLECTION_ID>', // collectionId
|
|
12
|
+
'<DOCUMENT_ID>', // documentId
|
|
13
|
+
'', // attribute
|
|
14
|
+
null, // value (optional)
|
|
15
|
+
null // max (optional)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
console.log(result);
|