From 65ebe078c6ca971cb0ed5c7b6fb35c679e5781d5 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 5 Mar 2025 04:57:22 +0000 Subject: [PATCH 1/2] chore: regenerate sdks --- README.md | 4 +- .../databases/update-float-attribute.md | 4 +- .../databases/update-integer-attribute.md | 4 +- ...-count.md => get-queue-stats-resources.md} | 2 +- ...-dump.md => get-queue-stats-usage-dump.md} | 2 +- docs/examples/health/get-queue.md | 11 --- docs/examples/organizations/create.md | 6 +- docs/examples/organizations/update-plan.md | 6 +- package.json | 2 +- src/client.ts | 2 +- src/enums/credit-card.ts | 1 + src/enums/name.ts | 5 +- src/enums/runtime.ts | 3 + src/models.ts | 87 ++++++++++++++++++- src/services/databases.ts | 21 ++--- src/services/health.ts | 47 +++------- src/services/organizations.ts | 36 +++++++- 17 files changed, 162 insertions(+), 81 deletions(-) rename docs/examples/health/{get-queue-usage-count.md => get-queue-stats-resources.md} (85%) rename docs/examples/health/{get-queue-usage-dump.md => get-queue-stats-usage-dump.md} (85%) delete mode 100644 docs/examples/health/get-queue.md diff --git a/README.md b/README.md index db339cc..4d16e87 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` @@ -108,4 +108,4 @@ This library is auto-generated by Appwrite custom [SDK Generator](https://github ## License -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. +Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 8d6d423..91e946d 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -11,9 +11,9 @@ const result = await databases.updateFloatAttribute( '', // collectionId '', // key false, // required - null, // min - null, // max null, // default + null, // min (optional) + null, // max (optional) '' // newKey (optional) ); diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 727c016..84ed165 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -11,9 +11,9 @@ const result = await databases.updateIntegerAttribute( '', // collectionId '', // key false, // required - null, // min - null, // max null, // default + null, // min (optional) + null, // max (optional) '' // newKey (optional) ); diff --git a/docs/examples/health/get-queue-usage-count.md b/docs/examples/health/get-queue-stats-resources.md similarity index 85% rename from docs/examples/health/get-queue-usage-count.md rename to docs/examples/health/get-queue-stats-resources.md index b576acf..97f4c5b 100644 --- a/docs/examples/health/get-queue-usage-count.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -6,7 +6,7 @@ const client = new Client() const health = new Health(client); -const result = await health.getQueueUsageCount( +const result = await health.getQueueStatsResources( null // threshold (optional) ); diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-stats-usage-dump.md similarity index 85% rename from docs/examples/health/get-queue-usage-dump.md rename to docs/examples/health/get-queue-stats-usage-dump.md index 4312ace..9bacb34 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-stats-usage-dump.md @@ -6,7 +6,7 @@ const client = new Client() const health = new Health(client); -const result = await health.getQueueUsageDump( +const result = await health.getQueueStatsUsageDump( null // threshold (optional) ); diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md deleted file mode 100644 index cef5e8c..0000000 --- a/docs/examples/health/get-queue.md +++ /dev/null @@ -1,11 +0,0 @@ -import { Client, Health } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const health = new Health(client); - -const result = await health.getQueue(); - -console.log(result); diff --git a/docs/examples/organizations/create.md b/docs/examples/organizations/create.md index 2244362..787343d 100644 --- a/docs/examples/organizations/create.md +++ b/docs/examples/organizations/create.md @@ -11,7 +11,11 @@ const result = await organizations.create( '', // name .Tier0, // billingPlan '', // paymentMethodId (optional) - '' // billingAddressId (optional) + '', // billingAddressId (optional) + [], // invites (optional) + '', // couponId (optional) + '', // taxId (optional) + 0 // budget (optional) ); console.log(result); diff --git a/docs/examples/organizations/update-plan.md b/docs/examples/organizations/update-plan.md index 609e602..96a1932 100644 --- a/docs/examples/organizations/update-plan.md +++ b/docs/examples/organizations/update-plan.md @@ -10,7 +10,11 @@ const result = await organizations.updatePlan( '', // organizationId .Tier0, // billingPlan '', // paymentMethodId (optional) - '' // billingAddressId (optional) + '', // billingAddressId (optional) + [], // invites (optional) + '', // couponId (optional) + '', // taxId (optional) + 0 // budget (optional) ); console.log(result); diff --git a/package.json b/package.json index 67532e0..bcfca17 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "1.5.1", + "version": "1.5.2", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index b7a4690..0103610 100644 --- a/src/client.ts +++ b/src/client.ts @@ -316,7 +316,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '1.5.1', + 'x-sdk-version': '1.5.2', 'X-Appwrite-Response-Format': '1.6.0', }; diff --git a/src/enums/credit-card.ts b/src/enums/credit-card.ts index daf43c7..a96c73a 100644 --- a/src/enums/credit-card.ts +++ b/src/enums/credit-card.ts @@ -15,4 +15,5 @@ export enum CreditCard { Visa = 'visa', MIR = 'mir', Maestro = 'maestro', + Rupay = 'rupay', } \ No newline at end of file diff --git a/src/enums/name.ts b/src/enums/name.ts index 52e91aa..08b3129 100644 --- a/src/enums/name.ts +++ b/src/enums/name.ts @@ -4,8 +4,9 @@ export enum Name { V1audits = 'v1-audits', V1mails = 'v1-mails', V1functions = 'v1-functions', - V1usage = 'v1-usage', - V1usagedump = 'v1-usage-dump', + V1statsresources = 'v1-stats-resources', + V1statsusage = 'v1-stats-usage', + V1statsusagedump = 'v1-stats-usage-dump', V1webhooks = 'v1-webhooks', V1certificates = 'v1-certificates', V1builds = 'v1-builds', diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index a97f627..a4042bb 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -20,6 +20,9 @@ export enum Runtime { Python311 = 'python-3.11', Python312 = 'python-3.12', Pythonml311 = 'python-ml-3.11', + Deno121 = 'deno-1.21', + Deno124 = 'deno-1.24', + Deno135 = 'deno-1.35', Deno140 = 'deno-1.40', Deno146 = 'deno-1.46', Deno20 = 'deno-2.0', diff --git a/src/models.ts b/src/models.ts index 0b29822..5a66d49 100644 --- a/src/models.ts +++ b/src/models.ts @@ -3316,6 +3316,14 @@ export namespace Models { * Aggregated number of bucket storage files (in bytes) per period. */ storage: Metric[]; + /** + * Aggregated number of files transformations per period. + */ + imageTransformations: Metric[]; + /** + * Total aggregated number of files transformations. + */ + imageTransformationsTotal: number; } /** * UsageFunctions @@ -3607,6 +3615,14 @@ export namespace Models { * An array of aggregated number of database writes. */ databasesWrites: Metric[]; + /** + * An array of aggregated number of image transformations. + */ + imageTransformationsTotal: number; + /** + * Total aggregated number of image transformations. + */ + imageTransformations: number; } /** * Headers @@ -4254,6 +4270,10 @@ export namespace Models { * Additional realtime usage cost */ additionalRealtimeAmount: number; + /** + * Billing plan + */ + plan: string; /** * Aggregated amount */ @@ -4357,6 +4377,10 @@ export namespace Models { * Plan name */ name: string; + /** + * Plan description + */ + desc: string; /** * Plan order */ @@ -4377,6 +4401,10 @@ export namespace Models { * Storage */ storage: number; + /** + * Image Transformations + */ + imageTransformations: number; /** * Members */ @@ -4428,7 +4456,11 @@ export namespace Models { /** * Additional resources */ - addons: AdditionalResource; + usage: AdditionalResource[]; + /** + * Addons + */ + addons: BillingPlanAddon[]; /** * Custom SMTP */ @@ -4465,6 +4497,10 @@ export namespace Models { * Does plan support mock numbers */ supportsMockNumbers: boolean; + /** + * Does plan support credit + */ + supportsCredits: boolean; /** * Does plan support backup policies. */ @@ -4474,6 +4510,35 @@ export namespace Models { */ backupPolicies: number; } + /** + * BillingPlanAddon + */ + export type BillingPlanAddon = { + /** + * Is the addon supported in the plan? + */ + supported: boolean; + /** + * Addon limit + */ + limit: number; + /** + * Addon type + */ + type: string; + /** + * Price currency + */ + currency: string; + /** + * Price + */ + price: number; + /** + * Resource value + */ + value: number; + } /** * Campaign */ @@ -4787,6 +4852,10 @@ export namespace Models { * Current active aggregation id. */ billingAggregationId: string; + /** + * Current active aggregation id. + */ + billingInvoiceId: string; /** * Default payment method. */ @@ -4799,6 +4868,14 @@ export namespace Models { * Backup payment method. */ backupPaymentMethodId: string; + /** + * Team status. + */ + status: string; + /** + * Remarks on team status. + */ + remarks: string; /** * Organization agreements */ @@ -5098,6 +5175,14 @@ export namespace Models { * Aggregated stats for database writes. */ databasesWrites: Metric[]; + /** + * Aggregated stats for file transformations. + */ + imageTransformations: Metric[]; + /** + * Aggregated stats for total file transformations. + */ + imageTransformationsTotal: number; /** * Aggregated stats for total users. */ diff --git a/src/services/databases.ts b/src/services/databases.ts index bcfdd83..bde1b15 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -1039,14 +1039,14 @@ export class Databases { * @param {string} collectionId * @param {string} key * @param {boolean} required + * @param {number} xdefault * @param {number} min * @param {number} max - * @param {number} xdefault * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} */ - async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number, newKey?: string): Promise { + async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1059,12 +1059,6 @@ export class Databases { if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof min === 'undefined') { - throw new AppwriteException('Missing required parameter: "min"'); - } - if (typeof max === 'undefined') { - throw new AppwriteException('Missing required parameter: "max"'); - } if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } @@ -1177,14 +1171,14 @@ export class Databases { * @param {string} collectionId * @param {string} key * @param {boolean} required + * @param {number} xdefault * @param {number} min * @param {number} max - * @param {number} xdefault * @param {string} newKey * @throws {AppwriteException} * @returns {Promise} */ - async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number, newKey?: string): Promise { + async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1197,12 +1191,6 @@ export class Databases { if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof min === 'undefined') { - throw new AppwriteException('Missing required parameter: "min"'); - } - if (typeof max === 'undefined') { - throw new AppwriteException('Missing required parameter: "max"'); - } if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } @@ -1837,6 +1825,7 @@ export class Databases { * Create document * * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + * * @param {string} databaseId * @param {string} collectionId diff --git a/src/services/health.ts b/src/services/health.ts index b68f2d5..707245c 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -169,33 +169,6 @@ export class Health { payload['project'] = this.client.config.project; - return await this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - /** - * Get queue - * - * Check the Appwrite queue messaging servers are up and connection is successful. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - async getQueue(): Promise { - const apiPath = '/health/queue'; - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - payload['project'] = this.client.config.project; - - return await this.client.call( 'get', uri, @@ -585,16 +558,16 @@ export class Health { ); } /** - * Get usage queue + * Get stats resources queue * - * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. + * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * * @param {number} threshold * @throws {AppwriteException} * @returns {Promise} */ - async getQueueUsage(threshold?: number): Promise { - const apiPath = '/health/queue/usage'; + async getQueueStatsResources(threshold?: number): Promise { + const apiPath = '/health/queue/stats-resources'; const payload: Payload = {}; if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; @@ -616,16 +589,16 @@ export class Health { ); } /** - * Get usage count aggregation queue + * Get stats usage queue * - * Get the usage count aggregation queue. + * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} * @returns {Promise} */ - async getQueueUsageCount(threshold?: number): Promise { - const apiPath = '/health/queue/usage-count'; + async getQueueUsage(threshold?: number): Promise { + const apiPath = '/health/queue/stats-usage'; const payload: Payload = {}; if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; @@ -655,8 +628,8 @@ export class Health { * @throws {AppwriteException} * @returns {Promise} */ - async getQueueUsageDump(threshold?: number): Promise { - const apiPath = '/health/queue/usage-dump'; + async getQueueStatsUsageDump(threshold?: number): Promise { + const apiPath = '/health/queue/stats-usage-dump'; const payload: Payload = {}; if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; diff --git a/src/services/organizations.ts b/src/services/organizations.ts index 76195b4..4661a26 100644 --- a/src/services/organizations.ts +++ b/src/services/organizations.ts @@ -56,10 +56,14 @@ export class Organizations { * @param {BillingPlan} billingPlan * @param {string} paymentMethodId * @param {string} billingAddressId + * @param {string[]} invites + * @param {string} couponId + * @param {string} taxId + * @param {number} budget * @throws {AppwriteException} * @returns {Promise>} */ - async create(organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string): Promise> { + async create(organizationId: string, name: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number): Promise> { if (typeof organizationId === 'undefined') { throw new AppwriteException('Missing required parameter: "organizationId"'); } @@ -86,6 +90,18 @@ export class Organizations { if (typeof billingAddressId !== 'undefined') { payload['billingAddressId'] = billingAddressId; } + if (typeof invites !== 'undefined') { + payload['invites'] = invites; + } + if (typeof couponId !== 'undefined') { + payload['couponId'] = couponId; + } + if (typeof taxId !== 'undefined') { + payload['taxId'] = taxId; + } + if (typeof budget !== 'undefined') { + payload['budget'] = budget; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -892,10 +908,14 @@ export class Organizations { * @param {BillingPlan} billingPlan * @param {string} paymentMethodId * @param {string} billingAddressId + * @param {string[]} invites + * @param {string} couponId + * @param {string} taxId + * @param {number} budget * @throws {AppwriteException} * @returns {Promise>} */ - async updatePlan(organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string): Promise> { + async updatePlan(organizationId: string, billingPlan: BillingPlan, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number): Promise> { if (typeof organizationId === 'undefined') { throw new AppwriteException('Missing required parameter: "organizationId"'); } @@ -913,6 +933,18 @@ export class Organizations { if (typeof billingAddressId !== 'undefined') { payload['billingAddressId'] = billingAddressId; } + if (typeof invites !== 'undefined') { + payload['invites'] = invites; + } + if (typeof couponId !== 'undefined') { + payload['couponId'] = couponId; + } + if (typeof taxId !== 'undefined') { + payload['taxId'] = taxId; + } + if (typeof budget !== 'undefined') { + payload['budget'] = budget; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { From 1d5e90314e0ce6ff5f00b6ea1b2474e493784c3a Mon Sep 17 00:00:00 2001 From: root Date: Wed, 5 Mar 2025 05:12:39 +0000 Subject: [PATCH 2/2] chore: regenerate sdks --- src/models.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models.ts b/src/models.ts index 5a66d49..162b2c1 100644 --- a/src/models.ts +++ b/src/models.ts @@ -3618,11 +3618,11 @@ export namespace Models { /** * An array of aggregated number of image transformations. */ - imageTransformationsTotal: number; + imageTransformations: Metric[]; /** * Total aggregated number of image transformations. */ - imageTransformations: number; + imageTransformationsTotal: number; } /** * Headers