From 284d587d11c5f9a8775b43746021341b51217bc4 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:15:31 +0000 Subject: [PATCH 1/5] feat: add authPhone to organisation usage --- LICENSE | 2 +- README.md | 4 +- .../get-coupon.md} | 8 +- .../examples/account/update-payment-method.md | 2 +- .../console/create-program-membership.md | 13 ++ .../create-firebase-o-auth-migration.md | 14 -- .../migrations/get-firebase-report-o-auth.md | 14 -- .../migrations/list-firebase-projects.md | 11 -- package.json | 2 +- src/client.ts | 35 ++++- src/enums/runtime.ts | 1 + src/models.ts | 62 +++++---- src/services/account.ts | 30 ++++- src/services/console.ts | 28 ++++ src/services/migrations.ts | 126 +----------------- src/services/organizations.ts | 6 +- 16 files changed, 149 insertions(+), 209 deletions(-) rename docs/examples/{migrations/delete-firebase-auth.md => account/get-coupon.md} (52%) create mode 100644 docs/examples/console/create-program-membership.md delete mode 100644 docs/examples/migrations/create-firebase-o-auth-migration.md delete mode 100644 docs/examples/migrations/get-firebase-report-o-auth.md delete mode 100644 docs/examples/migrations/list-firebase-projects.md diff --git a/LICENSE b/LICENSE index 5479bb8..c1602fc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors. +Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 21da491..3da5f87 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Console SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) @@ -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 - + ``` diff --git a/docs/examples/migrations/delete-firebase-auth.md b/docs/examples/account/get-coupon.md similarity index 52% rename from docs/examples/migrations/delete-firebase-auth.md rename to docs/examples/account/get-coupon.md index 8c7683b..356b018 100644 --- a/docs/examples/migrations/delete-firebase-auth.md +++ b/docs/examples/account/get-coupon.md @@ -1,11 +1,13 @@ -import { Client, Migrations } from "@appwrite.io/console"; +import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID -const migrations = new Migrations(client); +const account = new Account(client); -const result = await migrations.deleteFirebaseAuth(); +const result = await account.getCoupon( + '' // couponId +); console.log(result); diff --git a/docs/examples/account/update-payment-method.md b/docs/examples/account/update-payment-method.md index 2b68c3c..4a6e312 100644 --- a/docs/examples/account/update-payment-method.md +++ b/docs/examples/account/update-payment-method.md @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updatePaymentMethod( '', // paymentMethodId 1, // expiryMonth - 2024 // expiryYear + 2025 // expiryYear ); console.log(result); diff --git a/docs/examples/console/create-program-membership.md b/docs/examples/console/create-program-membership.md new file mode 100644 index 0000000..032fce9 --- /dev/null +++ b/docs/examples/console/create-program-membership.md @@ -0,0 +1,13 @@ +import { Client, Console } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const console = new Console(client); + +const result = await console.createProgramMembership( + '' // programId +); + +console.log(result); diff --git a/docs/examples/migrations/create-firebase-o-auth-migration.md b/docs/examples/migrations/create-firebase-o-auth-migration.md deleted file mode 100644 index bf57d42..0000000 --- a/docs/examples/migrations/create-firebase-o-auth-migration.md +++ /dev/null @@ -1,14 +0,0 @@ -import { Client, Migrations } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const migrations = new Migrations(client); - -const result = await migrations.createFirebaseOAuthMigration( - [], // resources - '' // projectId -); - -console.log(result); diff --git a/docs/examples/migrations/get-firebase-report-o-auth.md b/docs/examples/migrations/get-firebase-report-o-auth.md deleted file mode 100644 index 055ddfb..0000000 --- a/docs/examples/migrations/get-firebase-report-o-auth.md +++ /dev/null @@ -1,14 +0,0 @@ -import { Client, Migrations } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const migrations = new Migrations(client); - -const result = await migrations.getFirebaseReportOAuth( - [], // resources - '' // projectId -); - -console.log(result); diff --git a/docs/examples/migrations/list-firebase-projects.md b/docs/examples/migrations/list-firebase-projects.md deleted file mode 100644 index 833c05f..0000000 --- a/docs/examples/migrations/list-firebase-projects.md +++ /dev/null @@ -1,11 +0,0 @@ -import { Client, Migrations } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const migrations = new Migrations(client); - -const result = await migrations.listFirebaseProjects(); - -console.log(result); diff --git a/package.json b/package.json index 2325ca4..54756d8 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.4.4", + "version": "1.4.5", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index da0378f..4d3819f 100644 --- a/src/client.ts +++ b/src/client.ts @@ -19,9 +19,9 @@ type Headers = { */ type RealtimeResponse = { /** - * Type of the response: 'error', 'event', 'connected', or 'response'. + * Type of the response: 'error', 'event', 'connected', 'pong', or 'response'. */ - type: 'error' | 'event' | 'connected' | 'response'; + type: 'error' | 'event' | 'connected' | 'response' | 'pong'; /** * Data associated with the response based on the response type. @@ -129,6 +129,8 @@ type RealtimeRequestAuthenticate = { session: string; } +type TimeoutHandle = ReturnType | number; + /** * Realtime interface representing the structure of a realtime communication object. */ @@ -139,9 +141,14 @@ type Realtime = { socket?: WebSocket; /** - * Timeout duration for communication operations. + * Timeout for reconnect operations. */ - timeout?: number; + timeout?: TimeoutHandle; + + /** + * Heartbeat interval for the realtime connection. + */ + heartbeat?: TimeoutHandle; /** * URL for establishing the WebSocket connection. @@ -196,6 +203,11 @@ type Realtime = { */ createSocket: () => void; + /** + * Function to create a new heartbeat interval. + */ + createHeartbeat: () => void; + /** * Function to clean up resources associated with specified channels. * @@ -304,7 +316,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '1.4.4', + 'x-sdk-version': '1.4.5', 'X-Appwrite-Response-Format': '1.6.0', }; @@ -407,6 +419,7 @@ class Client { private realtime: Realtime = { socket: undefined, timeout: undefined, + heartbeat: undefined, url: '', channels: new Set(), subscriptions: new Map(), @@ -432,6 +445,17 @@ class Client { return 60_000; } }, + createHeartbeat: () => { + if (this.realtime.heartbeat) { + clearTimeout(this.realtime.heartbeat); + } + + this.realtime.heartbeat = window?.setInterval(() => { + this.realtime.socket?.send(JSON.stringify({ + type: 'ping' + })); + }, 20_000); + }, createSocket: () => { if (this.realtime.channels.size < 1) { this.realtime.reconnect = false; @@ -465,6 +489,7 @@ class Client { this.realtime.socket.addEventListener('message', this.realtime.onMessage); this.realtime.socket.addEventListener('open', _event => { this.realtime.reconnectAttempts = 0; + this.realtime.createHeartbeat(); }); this.realtime.socket.addEventListener('close', event => { if ( diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index c2b5474..a97f627 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -54,4 +54,5 @@ export enum Runtime { Bun11 = 'bun-1.1', Go123 = 'go-1.23', Static1 = 'static-1', + Flutter324 = 'flutter-3.24', } \ No newline at end of file diff --git a/src/models.ts b/src/models.ts index c5debb4..a527de7 100644 --- a/src/models.ts +++ b/src/models.ts @@ -496,19 +496,6 @@ export namespace Models { */ migrations: Migration[]; } - /** - * Migrations Firebase Projects List - */ - export type FirebaseProjectList = { - /** - * Total number of projects documents that matched your query. - */ - total: number; - /** - * List of projects. - */ - projects: FirebaseProject[]; - } /** * Specifications List */ @@ -1941,7 +1928,7 @@ export namespace Models { */ events: string[]; /** - * Function execution schedult in CRON format. + * Function execution schedule in CRON format. */ schedule: string; /** @@ -4086,19 +4073,6 @@ export namespace Models { */ version: string; } - /** - * MigrationFirebaseProject - */ - export type FirebaseProject = { - /** - * Project ID. - */ - projectId: string; - /** - * Project display name. - */ - displayName: string; - } /** * AdditionalResource */ @@ -4319,6 +4293,10 @@ export namespace Models { * Plan name */ name: string; + /** + * Plan order + */ + order: number; /** * Price */ @@ -4411,6 +4389,26 @@ export namespace Models { * Can user change the plan themselves */ selfService: boolean; + /** + * Does plan enable premium support + */ + premiumSupport: boolean; + /** + * Does plan support budget cap + */ + budgeting: boolean; + /** + * Does plan support mock numbers + */ + supportsMockNumbers: boolean; + /** + * Does plan support backup policies. + */ + backupsEnabled: boolean; + /** + * How many policies does plan support + */ + backupPolicies: number; } /** * Campaign @@ -4692,7 +4690,7 @@ export namespace Models { /** * Project budget limit */ - budgetAlerts: string[]; + budgetAlerts: number[]; /** * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. */ @@ -5028,6 +5026,10 @@ export namespace Models { * Aggregated stats for function executions. */ executions: Metric[]; + /** + * Aggregated stats for phone authentication. + */ + authPhone: Metric; /** * Aggregated stats for total users. */ @@ -5068,6 +5070,10 @@ export namespace Models { * Aggregated stats for total storage. */ storageTotal: number; + /** + * Breakdown of phone authentication stats by country code. + */ + authPhoneBreakdown: MetricBreakdown; /** * Aggregated stats for each projects. */ diff --git a/src/services/account.ts b/src/services/account.ts index bdfa576..6d0f141 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -320,6 +320,34 @@ export class Account { payload ); } + /** + * Get coupon details + * + * + * @param {string} couponId + * @throws {AppwriteException} + * @returns {Promise} + */ + async getCoupon(couponId: string): Promise { + if (typeof couponId === 'undefined') { + throw new AppwriteException('Missing required parameter: "couponId"'); + } + const apiPath = '/account/coupons/{couponId}'.replace('{couponId}', couponId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update email * @@ -1817,7 +1845,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about /** * Create magic URL token * - * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default. + * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). diff --git a/src/services/console.ts b/src/services/console.ts index eeb728f..b362a78 100644 --- a/src/services/console.ts +++ b/src/services/console.ts @@ -89,6 +89,34 @@ export class Console { payload ); } + /** + * Create program membership + * + * + * @param {string} programId + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + async createProgramMembership(programId: string): Promise<{}> { + if (typeof programId === 'undefined') { + throw new AppwriteException('Missing required parameter: "programId"'); + } + const apiPath = '/console/programs/{programId}/memberships'.replace('{programId}', programId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get Regions * diff --git a/src/services/migrations.ts b/src/services/migrations.ts index 69e5aff..b8331b8 100644 --- a/src/services/migrations.ts +++ b/src/services/migrations.ts @@ -146,7 +146,7 @@ export class Migrations { ); } /** - * Migrate Firebase data (Service Account) + * Migrate Firebase data * * * @param {string[]} resources @@ -183,92 +183,6 @@ export class Migrations { payload ); } - /** - * Revoke Appwrite's authorization to access Firebase projects - * - * - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - async deleteFirebaseAuth(): Promise<{}> { - const apiPath = '/migrations/firebase/deauthorize'; - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - - return await this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - /** - * Migrate Firebase data (OAuth) - * - * - * @param {string[]} resources - * @param {string} projectId - * @throws {AppwriteException} - * @returns {Promise} - */ - async createFirebaseOAuthMigration(resources: string[], projectId: string): Promise { - if (typeof resources === 'undefined') { - throw new AppwriteException('Missing required parameter: "resources"'); - } - if (typeof projectId === 'undefined') { - throw new AppwriteException('Missing required parameter: "projectId"'); - } - const apiPath = '/migrations/firebase/oauth'; - const payload: Payload = {}; - if (typeof resources !== 'undefined') { - payload['resources'] = resources; - } - if (typeof projectId !== 'undefined') { - payload['projectId'] = projectId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - - return await this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - /** - * List Firebase projects - * - * - * @throws {AppwriteException} - * @returns {Promise} - */ - async listFirebaseProjects(): Promise { - const apiPath = '/migrations/firebase/projects'; - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - - return await this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } /** * Generate a report on Firebase data * @@ -300,44 +214,6 @@ export class Migrations { } - return await this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - /** - * Generate a report on Firebase data using OAuth - * - * - * @param {string[]} resources - * @param {string} projectId - * @throws {AppwriteException} - * @returns {Promise} - */ - async getFirebaseReportOAuth(resources: string[], projectId: string): Promise { - if (typeof resources === 'undefined') { - throw new AppwriteException('Missing required parameter: "resources"'); - } - if (typeof projectId === 'undefined') { - throw new AppwriteException('Missing required parameter: "projectId"'); - } - const apiPath = '/migrations/firebase/report/oauth'; - const payload: Payload = {}; - if (typeof resources !== 'undefined') { - payload['resources'] = resources; - } - if (typeof projectId !== 'undefined') { - payload['projectId'] = projectId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return await this.client.call( 'get', uri, diff --git a/src/services/organizations.ts b/src/services/organizations.ts index cd46739..79ad9a7 100644 --- a/src/services/organizations.ts +++ b/src/services/organizations.ts @@ -165,9 +165,9 @@ export class Organizations { * @param {string} organizationId * @param {string} aggregationId * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - async getAggregation(organizationId: string, aggregationId: string): Promise { + async getAggregation(organizationId: string, aggregationId: string): Promise { if (typeof organizationId === 'undefined') { throw new AppwriteException('Missing required parameter: "organizationId"'); } @@ -523,7 +523,7 @@ export class Organizations { ); } /** - * View invoice in PDF + * Download invoice in PDF * * * @param {string} organizationId From 3ff866fa076ed4bc52000a64fd6ec296897839b2 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 10 Jan 2025 11:56:19 +0000 Subject: [PATCH 2/5] feat: extend project level usage with sms --- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- src/models.ts | 20 ++++++++++++++------ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3da5f87..5559686 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 - + ``` diff --git a/package.json b/package.json index 54756d8..9537bda 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.4.5", + "version": "1.2.1", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 4d3819f..1483975 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.4.5', + 'x-sdk-version': '1.2.1', 'X-Appwrite-Response-Format': '1.6.0', }; diff --git a/src/models.ts b/src/models.ts index a527de7..8091a82 100644 --- a/src/models.ts +++ b/src/models.ts @@ -5026,10 +5026,6 @@ export namespace Models { * Aggregated stats for function executions. */ executions: Metric[]; - /** - * Aggregated stats for phone authentication. - */ - authPhone: Metric; /** * Aggregated stats for total users. */ @@ -5071,9 +5067,13 @@ export namespace Models { */ storageTotal: number; /** - * Breakdown of phone authentication stats by country code. + * Aggregated stats for total phone authentication SMS. + */ + authPhoneTotal: number; + /** + * Aggregated stats for estimated phone authentication SMS cost. */ - authPhoneBreakdown: MetricBreakdown; + authPhoneEstimate: number; /** * Aggregated stats for each projects. */ @@ -5111,6 +5111,14 @@ export namespace Models { * Aggregated stats for number of documents. */ storage: number; + /** + * Aggregated stats for phone authentication. + */ + authPhoneTotal: number; + /** + * Aggregated stats for phone authentication estimated cost. + */ + authPhoneEstimate: number; } /** * Aggregation team list From b029e356bf55507e89c7f8c163c0ac2822be0789 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 10 Jan 2025 11:57:20 +0000 Subject: [PATCH 3/5] chore: set version --- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5559686..575083b 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 - + ``` diff --git a/package.json b/package.json index 9537bda..f3966e0 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.2.1", + "version": "1.4.6", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 1483975..6166a2d 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.2.1', + 'x-sdk-version': '1.4.6', 'X-Appwrite-Response-Format': '1.6.0', }; From 7426e28a9d6729baf7e0af577dac6cff133bd7b1 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:40:46 +0000 Subject: [PATCH 4/5] feat: fix specs --- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- src/models.ts | 18 +++++++++++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 575083b..5559686 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 - + ``` diff --git a/package.json b/package.json index f3966e0..9537bda 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.4.6", + "version": "1.2.1", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 6166a2d..1483975 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.4.6', + 'x-sdk-version': '1.2.1', 'X-Appwrite-Response-Format': '1.6.0', }; diff --git a/src/models.ts b/src/models.ts index 8091a82..fca92fb 100644 --- a/src/models.ts +++ b/src/models.ts @@ -3097,7 +3097,7 @@ export namespace Models { /** * Resource ID. */ - resourceId: string; + resourceId?: string; /** * Resource name. */ @@ -3106,6 +3106,10 @@ export namespace Models { * The value of this metric at the timestamp. */ value: number; + /** + * The estimated value of this metric at the end of the period. + */ + estimate?: number; } /** * UsageDatabases @@ -3543,6 +3547,18 @@ export namespace Models { * Aggregated breakdown in totals of functions storage size (in bytes). */ functionsStorageBreakdown: MetricBreakdown[]; + /** + * Total aggregated number of phone auth. + */ + authPhoneTotal: number; + /** + * Estimated total aggregated cost of phone auth. + */ + authPhoneEstimate: number; + /** + * Aggregated breakdown in totals of phone auth by country. + */ + authPhoneCountryBreakdown: MetricBreakdown[]; } /** * Headers From d31574ad250cb0a9510da4190c88b1d30bfd54d2 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:41:40 +0000 Subject: [PATCH 5/5] chore: fix version --- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5559686..575083b 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 - + ``` diff --git a/package.json b/package.json index 9537bda..f3966e0 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.2.1", + "version": "1.4.6", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 1483975..6166a2d 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.2.1', + 'x-sdk-version': '1.4.6', 'X-Appwrite-Response-Format': '1.6.0', };