@appwrite.io/console 2.1.2 → 2.2.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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +2099 -520
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +2098 -521
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +2003 -444
- package/docs/examples/account/create-key.md +15 -0
- package/docs/examples/account/delete-key.md +13 -0
- package/docs/examples/account/get-key.md +13 -0
- package/docs/examples/account/list-keys.md +13 -0
- package/docs/examples/account/update-key.md +16 -0
- package/docs/examples/avatars/get-screenshot.md +5 -5
- package/docs/examples/backups/create-archive.md +2 -2
- package/docs/examples/backups/create-policy.md +2 -2
- package/docs/examples/backups/create-restoration.md +2 -2
- package/docs/examples/console/{get-regions.md → list-regions.md} +1 -3
- package/docs/examples/databases/create-index.md +2 -2
- package/docs/examples/databases/create-longtext-attribute.md +18 -0
- package/docs/examples/databases/create-mediumtext-attribute.md +18 -0
- package/docs/examples/databases/create-text-attribute.md +18 -0
- package/docs/examples/databases/create-varchar-attribute.md +19 -0
- package/docs/examples/databases/update-collection.md +1 -1
- package/docs/examples/databases/update-longtext-attribute.md +18 -0
- package/docs/examples/databases/update-mediumtext-attribute.md +18 -0
- package/docs/examples/databases/update-text-attribute.md +18 -0
- package/docs/examples/databases/update-varchar-attribute.md +19 -0
- package/docs/examples/databases/update.md +1 -1
- package/docs/examples/functions/create.md +2 -2
- package/docs/examples/functions/list-templates.md +3 -3
- package/docs/examples/functions/update.md +2 -2
- package/docs/examples/migrations/create-appwrite-migration.md +2 -2
- package/docs/examples/migrations/create-firebase-migration.md +2 -2
- package/docs/examples/migrations/create-n-host-migration.md +2 -2
- package/docs/examples/migrations/create-supabase-migration.md +2 -2
- package/docs/examples/migrations/get-appwrite-report.md +2 -2
- package/docs/examples/migrations/get-firebase-report.md +2 -2
- package/docs/examples/migrations/get-n-host-report.md +2 -2
- package/docs/examples/migrations/get-supabase-report.md +2 -2
- package/docs/examples/organizations/create-key.md +16 -0
- package/docs/examples/organizations/create.md +2 -2
- package/docs/examples/organizations/delete-key.md +14 -0
- package/docs/examples/organizations/estimation-create-organization.md +2 -2
- package/docs/examples/organizations/estimation-update-plan.md +2 -2
- package/docs/examples/organizations/get-key.md +14 -0
- package/docs/examples/organizations/list-keys.md +14 -0
- package/docs/examples/organizations/list-regions.md +13 -0
- package/docs/examples/organizations/update-key.md +17 -0
- package/docs/examples/organizations/update-plan.md +2 -2
- package/docs/examples/projects/create-jwt.md +2 -2
- package/docs/examples/projects/create-key.md +2 -2
- package/docs/examples/projects/update-key.md +2 -2
- package/docs/examples/sites/list-templates.md +3 -3
- package/docs/examples/tablesdb/create-index.md +2 -2
- package/docs/examples/tablesdb/create-longtext-column.md +18 -0
- package/docs/examples/tablesdb/create-mediumtext-column.md +18 -0
- package/docs/examples/tablesdb/create-text-column.md +18 -0
- package/docs/examples/tablesdb/create-varchar-column.md +19 -0
- package/docs/examples/tablesdb/update-longtext-column.md +18 -0
- package/docs/examples/tablesdb/update-mediumtext-column.md +18 -0
- package/docs/examples/tablesdb/update-table.md +1 -1
- package/docs/examples/tablesdb/update-text-column.md +18 -0
- package/docs/examples/tablesdb/update-varchar-column.md +19 -0
- package/docs/examples/tablesdb/update.md +1 -1
- package/docs/examples/teams/create-membership.md +2 -2
- package/docs/examples/teams/update-membership.md +2 -2
- package/package.json +3 -2
- package/src/channel.ts +138 -0
- package/src/client.ts +54 -9
- package/src/enums/browser-permission.ts +22 -0
- package/src/enums/deployment-status.ts +1 -0
- package/src/enums/frameworks.ts +17 -0
- package/src/enums/order-by.ts +4 -0
- package/src/enums/resources.ts +13 -0
- package/src/enums/roles.ts +7 -0
- package/src/enums/runtimes.ts +66 -0
- package/src/enums/scopes.ts +65 -0
- package/src/enums/services.ts +5 -0
- package/src/enums/use-cases.ts +11 -0
- package/src/index.ts +10 -1
- package/src/models.ts +349 -1
- package/src/query.ts +42 -0
- package/src/services/account.ts +364 -56
- package/src/services/assistant.ts +1 -1
- package/src/services/avatars.ts +17 -16
- package/src/services/backups.ts +37 -36
- package/src/services/console.ts +11 -42
- package/src/services/databases.ts +1060 -280
- package/src/services/domains.ts +44 -44
- package/src/services/functions.ts +60 -57
- package/src/services/graphql.ts +2 -2
- package/src/services/health.ts +22 -20
- package/src/services/messaging.ts +56 -56
- package/src/services/migrations.ts +79 -78
- package/src/services/organizations.ts +466 -70
- package/src/services/project.ts +5 -5
- package/src/services/projects.ts +86 -85
- package/src/services/proxy.ts +8 -8
- package/src/services/realtime.ts +35 -12
- package/src/services/sites.ts +42 -40
- package/src/services/storage.ts +16 -16
- package/src/services/tables-db.ts +1050 -268
- package/src/services/teams.ts +31 -30
- package/src/services/tokens.ts +5 -5
- package/src/services/users.ts +49 -49
- package/src/services/vcs.ts +10 -10
- package/types/channel.d.ts +72 -0
- package/types/client.d.ts +11 -3
- package/types/enums/browser-permission.d.ts +22 -0
- package/types/enums/deployment-status.d.ts +1 -0
- package/types/enums/frameworks.d.ts +17 -0
- package/types/enums/order-by.d.ts +4 -0
- package/types/enums/resources.d.ts +13 -0
- package/types/enums/roles.d.ts +7 -0
- package/types/enums/runtimes.d.ts +66 -0
- package/types/enums/scopes.d.ts +65 -0
- package/types/enums/services.d.ts +5 -0
- package/types/enums/use-cases.d.ts +11 -0
- package/types/index.d.ts +10 -1
- package/types/models.d.ts +341 -1
- package/types/query.d.ts +30 -0
- package/types/services/account.d.ts +111 -0
- package/types/services/avatars.d.ts +5 -4
- package/types/services/backups.d.ts +13 -12
- package/types/services/console.d.ts +1 -13
- package/types/services/databases.d.ts +303 -8
- package/types/services/functions.d.ts +18 -15
- package/types/services/health.d.ts +2 -0
- package/types/services/migrations.d.ts +33 -32
- package/types/services/organizations.d.ts +161 -17
- package/types/services/projects.d.ts +13 -12
- package/types/services/realtime.d.ts +17 -8
- package/types/services/sites.d.ts +9 -7
- package/types/services/tables-db.d.ts +305 -8
- package/types/services/teams.d.ts +9 -8
- package/src/enums/billing-plan.ts +0 -17
- package/types/enums/billing-plan.d.ts +0 -17
|
@@ -17,7 +17,7 @@ export class Assistant {
|
|
|
17
17
|
* @throws {AppwriteException}
|
|
18
18
|
* @returns {Promise<{}>}
|
|
19
19
|
*/
|
|
20
|
-
chat(params: { prompt: string
|
|
20
|
+
chat(params: { prompt: string }): Promise<{}>;
|
|
21
21
|
/**
|
|
22
22
|
* Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream.
|
|
23
23
|
*
|
package/src/services/avatars.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { CreditCard } from '../enums/credit-card';
|
|
|
7
7
|
import { Flag } from '../enums/flag';
|
|
8
8
|
import { Theme } from '../enums/theme';
|
|
9
9
|
import { Timezone } from '../enums/timezone';
|
|
10
|
+
import { BrowserPermission } from '../enums/browser-permission';
|
|
10
11
|
import { ImageFormat } from '../enums/image-format';
|
|
11
12
|
|
|
12
13
|
export class Avatars {
|
|
@@ -28,7 +29,7 @@ export class Avatars {
|
|
|
28
29
|
* @throws {AppwriteException}
|
|
29
30
|
* @returns {string}
|
|
30
31
|
*/
|
|
31
|
-
getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number
|
|
32
|
+
getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number }): string;
|
|
32
33
|
/**
|
|
33
34
|
* You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
|
|
34
35
|
*
|
|
@@ -107,7 +108,7 @@ export class Avatars {
|
|
|
107
108
|
* @throws {AppwriteException}
|
|
108
109
|
* @returns {string}
|
|
109
110
|
*/
|
|
110
|
-
getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number
|
|
111
|
+
getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number }): string;
|
|
111
112
|
/**
|
|
112
113
|
* The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
|
|
113
114
|
*
|
|
@@ -183,7 +184,7 @@ export class Avatars {
|
|
|
183
184
|
* @throws {AppwriteException}
|
|
184
185
|
* @returns {string}
|
|
185
186
|
*/
|
|
186
|
-
getFavicon(params: { url: string
|
|
187
|
+
getFavicon(params: { url: string }): string;
|
|
187
188
|
/**
|
|
188
189
|
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
|
|
189
190
|
*
|
|
@@ -246,7 +247,7 @@ export class Avatars {
|
|
|
246
247
|
* @throws {AppwriteException}
|
|
247
248
|
* @returns {string}
|
|
248
249
|
*/
|
|
249
|
-
getFlag(params: { code: Flag, width?: number, height?: number, quality?: number
|
|
250
|
+
getFlag(params: { code: Flag, width?: number, height?: number, quality?: number }): string;
|
|
250
251
|
/**
|
|
251
252
|
* You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
|
252
253
|
*
|
|
@@ -326,7 +327,7 @@ export class Avatars {
|
|
|
326
327
|
* @throws {AppwriteException}
|
|
327
328
|
* @returns {string}
|
|
328
329
|
*/
|
|
329
|
-
getImage(params: { url: string, width?: number, height?: number
|
|
330
|
+
getImage(params: { url: string, width?: number, height?: number }): string;
|
|
330
331
|
/**
|
|
331
332
|
* Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
|
|
332
333
|
*
|
|
@@ -406,7 +407,7 @@ export class Avatars {
|
|
|
406
407
|
* @throws {AppwriteException}
|
|
407
408
|
* @returns {string}
|
|
408
409
|
*/
|
|
409
|
-
getInitials(params?: { name?: string, width?: number, height?: number, background?: string
|
|
410
|
+
getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): string;
|
|
410
411
|
/**
|
|
411
412
|
* Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
|
|
412
413
|
*
|
|
@@ -486,7 +487,7 @@ export class Avatars {
|
|
|
486
487
|
* @throws {AppwriteException}
|
|
487
488
|
* @returns {string}
|
|
488
489
|
*/
|
|
489
|
-
getQR(params: { text: string, size?: number, margin?: number, download?: boolean
|
|
490
|
+
getQR(params: { text: string, size?: number, margin?: number, download?: boolean }): string;
|
|
490
491
|
/**
|
|
491
492
|
* Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
|
|
492
493
|
*
|
|
@@ -575,7 +576,7 @@ export class Avatars {
|
|
|
575
576
|
* @param {number} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
|
|
576
577
|
* @param {number} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
|
|
577
578
|
* @param {boolean} params.touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
|
|
578
|
-
* @param {
|
|
579
|
+
* @param {BrowserPermission[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
|
|
579
580
|
* @param {number} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
|
|
580
581
|
* @param {number} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
|
|
581
582
|
* @param {number} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
|
|
@@ -584,7 +585,7 @@ export class Avatars {
|
|
|
584
585
|
* @throws {AppwriteException}
|
|
585
586
|
* @returns {string}
|
|
586
587
|
*/
|
|
587
|
-
getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?:
|
|
588
|
+
getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }): string;
|
|
588
589
|
/**
|
|
589
590
|
* Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
|
|
590
591
|
*
|
|
@@ -606,7 +607,7 @@ export class Avatars {
|
|
|
606
607
|
* @param {number} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
|
|
607
608
|
* @param {number} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
|
|
608
609
|
* @param {boolean} touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
|
|
609
|
-
* @param {
|
|
610
|
+
* @param {BrowserPermission[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty.
|
|
610
611
|
* @param {number} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
|
|
611
612
|
* @param {number} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
|
|
612
613
|
* @param {number} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
|
|
@@ -616,15 +617,15 @@ export class Avatars {
|
|
|
616
617
|
* @returns {string}
|
|
617
618
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
618
619
|
*/
|
|
619
|
-
getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?:
|
|
620
|
+
getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): string;
|
|
620
621
|
getScreenshot(
|
|
621
|
-
paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?:
|
|
622
|
-
...rest: [(object)?, (number)?, (number)?, (number)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (
|
|
622
|
+
paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat } | string,
|
|
623
|
+
...rest: [(object)?, (number)?, (number)?, (number)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (BrowserPermission[])?, (number)?, (number)?, (number)?, (number)?, (ImageFormat)?]
|
|
623
624
|
): string {
|
|
624
|
-
let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?:
|
|
625
|
+
let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat };
|
|
625
626
|
|
|
626
627
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
627
|
-
params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?:
|
|
628
|
+
params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat };
|
|
628
629
|
} else {
|
|
629
630
|
params = {
|
|
630
631
|
url: paramsOrFirst as string,
|
|
@@ -641,7 +642,7 @@ export class Avatars {
|
|
|
641
642
|
longitude: rest[10] as number,
|
|
642
643
|
accuracy: rest[11] as number,
|
|
643
644
|
touch: rest[12] as boolean,
|
|
644
|
-
permissions: rest[13] as
|
|
645
|
+
permissions: rest[13] as BrowserPermission[],
|
|
645
646
|
sleep: rest[14] as number,
|
|
646
647
|
width: rest[15] as number,
|
|
647
648
|
height: rest[16] as number,
|
package/src/services/backups.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 { Services } from '../enums/services';
|
|
5
6
|
|
|
6
7
|
export class Backups {
|
|
7
8
|
client: Client;
|
|
@@ -17,7 +18,7 @@ export class Backups {
|
|
|
17
18
|
* @throws {AppwriteException}
|
|
18
19
|
* @returns {Promise<Models.BackupArchiveList>}
|
|
19
20
|
*/
|
|
20
|
-
listArchives(params?: { queries?: string[]
|
|
21
|
+
listArchives(params?: { queries?: string[] }): Promise<Models.BackupArchiveList>;
|
|
21
22
|
/**
|
|
22
23
|
* List all archives for a project.
|
|
23
24
|
*
|
|
@@ -64,33 +65,33 @@ export class Backups {
|
|
|
64
65
|
/**
|
|
65
66
|
* Create a new archive asynchronously for a project.
|
|
66
67
|
*
|
|
67
|
-
* @param {
|
|
68
|
+
* @param {Services[]} params.services - Array of services to backup
|
|
68
69
|
* @param {string} params.resourceId - Resource ID. When set, only this single resource will be backed up.
|
|
69
70
|
* @throws {AppwriteException}
|
|
70
71
|
* @returns {Promise<Models.BackupArchive>}
|
|
71
72
|
*/
|
|
72
|
-
createArchive(params: { services:
|
|
73
|
+
createArchive(params: { services: Services[], resourceId?: string }): Promise<Models.BackupArchive>;
|
|
73
74
|
/**
|
|
74
75
|
* Create a new archive asynchronously for a project.
|
|
75
76
|
*
|
|
76
|
-
* @param {
|
|
77
|
+
* @param {Services[]} services - Array of services to backup
|
|
77
78
|
* @param {string} resourceId - Resource ID. When set, only this single resource will be backed up.
|
|
78
79
|
* @throws {AppwriteException}
|
|
79
80
|
* @returns {Promise<Models.BackupArchive>}
|
|
80
81
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
81
82
|
*/
|
|
82
|
-
createArchive(services:
|
|
83
|
+
createArchive(services: Services[], resourceId?: string): Promise<Models.BackupArchive>;
|
|
83
84
|
createArchive(
|
|
84
|
-
paramsOrFirst: { services:
|
|
85
|
+
paramsOrFirst: { services: Services[], resourceId?: string } | Services[],
|
|
85
86
|
...rest: [(string)?]
|
|
86
87
|
): Promise<Models.BackupArchive> {
|
|
87
|
-
let params: { services:
|
|
88
|
+
let params: { services: Services[], resourceId?: string };
|
|
88
89
|
|
|
89
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
90
|
-
params = (paramsOrFirst || {}) as { services:
|
|
90
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'services' in paramsOrFirst)) {
|
|
91
|
+
params = (paramsOrFirst || {}) as { services: Services[], resourceId?: string };
|
|
91
92
|
} else {
|
|
92
93
|
params = {
|
|
93
|
-
services: paramsOrFirst as
|
|
94
|
+
services: paramsOrFirst as Services[],
|
|
94
95
|
resourceId: rest[0] as string
|
|
95
96
|
};
|
|
96
97
|
}
|
|
@@ -131,7 +132,7 @@ export class Backups {
|
|
|
131
132
|
* @throws {AppwriteException}
|
|
132
133
|
* @returns {Promise<Models.BackupArchive>}
|
|
133
134
|
*/
|
|
134
|
-
getArchive(params: { archiveId: string
|
|
135
|
+
getArchive(params: { archiveId: string }): Promise<Models.BackupArchive>;
|
|
135
136
|
/**
|
|
136
137
|
* Get a backup archive using it's ID.
|
|
137
138
|
*
|
|
@@ -182,7 +183,7 @@ export class Backups {
|
|
|
182
183
|
* @throws {AppwriteException}
|
|
183
184
|
* @returns {Promise<{}>}
|
|
184
185
|
*/
|
|
185
|
-
deleteArchive(params: { archiveId: string
|
|
186
|
+
deleteArchive(params: { archiveId: string }): Promise<{}>;
|
|
186
187
|
/**
|
|
187
188
|
* Delete an existing archive for a project.
|
|
188
189
|
*
|
|
@@ -234,7 +235,7 @@ export class Backups {
|
|
|
234
235
|
* @throws {AppwriteException}
|
|
235
236
|
* @returns {Promise<Models.BackupPolicyList>}
|
|
236
237
|
*/
|
|
237
|
-
listPolicies(params?: { queries?: string[]
|
|
238
|
+
listPolicies(params?: { queries?: string[] }): Promise<Models.BackupPolicyList>;
|
|
238
239
|
/**
|
|
239
240
|
* List all policies for a project.
|
|
240
241
|
*
|
|
@@ -282,7 +283,7 @@ export class Backups {
|
|
|
282
283
|
* Create a new backup policy.
|
|
283
284
|
*
|
|
284
285
|
* @param {string} params.policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
285
|
-
* @param {
|
|
286
|
+
* @param {Services[]} params.services - Array of services to backup
|
|
286
287
|
* @param {number} params.retention - Days to keep backups before deletion
|
|
287
288
|
* @param {string} params.schedule - Schedule CRON syntax.
|
|
288
289
|
* @param {string} params.name - Policy name. Max length: 128 chars.
|
|
@@ -291,12 +292,12 @@ export class Backups {
|
|
|
291
292
|
* @throws {AppwriteException}
|
|
292
293
|
* @returns {Promise<Models.BackupPolicy>}
|
|
293
294
|
*/
|
|
294
|
-
createPolicy(params: { policyId: string, services:
|
|
295
|
+
createPolicy(params: { policyId: string, services: Services[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean }): Promise<Models.BackupPolicy>;
|
|
295
296
|
/**
|
|
296
297
|
* Create a new backup policy.
|
|
297
298
|
*
|
|
298
299
|
* @param {string} policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
299
|
-
* @param {
|
|
300
|
+
* @param {Services[]} services - Array of services to backup
|
|
300
301
|
* @param {number} retention - Days to keep backups before deletion
|
|
301
302
|
* @param {string} schedule - Schedule CRON syntax.
|
|
302
303
|
* @param {string} name - Policy name. Max length: 128 chars.
|
|
@@ -306,19 +307,19 @@ export class Backups {
|
|
|
306
307
|
* @returns {Promise<Models.BackupPolicy>}
|
|
307
308
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
308
309
|
*/
|
|
309
|
-
createPolicy(policyId: string, services:
|
|
310
|
+
createPolicy(policyId: string, services: Services[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean): Promise<Models.BackupPolicy>;
|
|
310
311
|
createPolicy(
|
|
311
|
-
paramsOrFirst: { policyId: string, services:
|
|
312
|
-
...rest: [(
|
|
312
|
+
paramsOrFirst: { policyId: string, services: Services[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean } | string,
|
|
313
|
+
...rest: [(Services[])?, (number)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
313
314
|
): Promise<Models.BackupPolicy> {
|
|
314
|
-
let params: { policyId: string, services:
|
|
315
|
+
let params: { policyId: string, services: Services[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean };
|
|
315
316
|
|
|
316
317
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
317
|
-
params = (paramsOrFirst || {}) as { policyId: string, services:
|
|
318
|
+
params = (paramsOrFirst || {}) as { policyId: string, services: Services[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean };
|
|
318
319
|
} else {
|
|
319
320
|
params = {
|
|
320
321
|
policyId: paramsOrFirst as string,
|
|
321
|
-
services: rest[0] as
|
|
322
|
+
services: rest[0] as Services[],
|
|
322
323
|
retention: rest[1] as number,
|
|
323
324
|
schedule: rest[2] as string,
|
|
324
325
|
name: rest[3] as string,
|
|
@@ -392,7 +393,7 @@ export class Backups {
|
|
|
392
393
|
* @throws {AppwriteException}
|
|
393
394
|
* @returns {Promise<Models.BackupPolicy>}
|
|
394
395
|
*/
|
|
395
|
-
getPolicy(params: { policyId: string
|
|
396
|
+
getPolicy(params: { policyId: string }): Promise<Models.BackupPolicy>;
|
|
396
397
|
/**
|
|
397
398
|
* Get a backup policy using it's ID.
|
|
398
399
|
*
|
|
@@ -447,7 +448,7 @@ export class Backups {
|
|
|
447
448
|
* @throws {AppwriteException}
|
|
448
449
|
* @returns {Promise<Models.BackupPolicy>}
|
|
449
450
|
*/
|
|
450
|
-
updatePolicy(params: { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean
|
|
451
|
+
updatePolicy(params: { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean }): Promise<Models.BackupPolicy>;
|
|
451
452
|
/**
|
|
452
453
|
* Update an existing policy using it's ID.
|
|
453
454
|
*
|
|
@@ -524,7 +525,7 @@ export class Backups {
|
|
|
524
525
|
* @throws {AppwriteException}
|
|
525
526
|
* @returns {Promise<{}>}
|
|
526
527
|
*/
|
|
527
|
-
deletePolicy(params: { policyId: string
|
|
528
|
+
deletePolicy(params: { policyId: string }): Promise<{}>;
|
|
528
529
|
/**
|
|
529
530
|
* Delete a policy using it's ID.
|
|
530
531
|
*
|
|
@@ -573,37 +574,37 @@ export class Backups {
|
|
|
573
574
|
* Create and trigger a new restoration for a backup on a project.
|
|
574
575
|
*
|
|
575
576
|
* @param {string} params.archiveId - Backup archive ID to restore
|
|
576
|
-
* @param {
|
|
577
|
+
* @param {Services[]} params.services - Array of services to restore
|
|
577
578
|
* @param {string} params.newResourceId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
578
579
|
* @param {string} params.newResourceName - Database name. Max length: 128 chars.
|
|
579
580
|
* @throws {AppwriteException}
|
|
580
581
|
* @returns {Promise<Models.BackupRestoration>}
|
|
581
582
|
*/
|
|
582
|
-
createRestoration(params: { archiveId: string, services:
|
|
583
|
+
createRestoration(params: { archiveId: string, services: Services[], newResourceId?: string, newResourceName?: string }): Promise<Models.BackupRestoration>;
|
|
583
584
|
/**
|
|
584
585
|
* Create and trigger a new restoration for a backup on a project.
|
|
585
586
|
*
|
|
586
587
|
* @param {string} archiveId - Backup archive ID to restore
|
|
587
|
-
* @param {
|
|
588
|
+
* @param {Services[]} services - Array of services to restore
|
|
588
589
|
* @param {string} newResourceId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
589
590
|
* @param {string} newResourceName - Database name. Max length: 128 chars.
|
|
590
591
|
* @throws {AppwriteException}
|
|
591
592
|
* @returns {Promise<Models.BackupRestoration>}
|
|
592
593
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
593
594
|
*/
|
|
594
|
-
createRestoration(archiveId: string, services:
|
|
595
|
+
createRestoration(archiveId: string, services: Services[], newResourceId?: string, newResourceName?: string): Promise<Models.BackupRestoration>;
|
|
595
596
|
createRestoration(
|
|
596
|
-
paramsOrFirst: { archiveId: string, services:
|
|
597
|
-
...rest: [(
|
|
597
|
+
paramsOrFirst: { archiveId: string, services: Services[], newResourceId?: string, newResourceName?: string } | string,
|
|
598
|
+
...rest: [(Services[])?, (string)?, (string)?]
|
|
598
599
|
): Promise<Models.BackupRestoration> {
|
|
599
|
-
let params: { archiveId: string, services:
|
|
600
|
+
let params: { archiveId: string, services: Services[], newResourceId?: string, newResourceName?: string };
|
|
600
601
|
|
|
601
602
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
602
|
-
params = (paramsOrFirst || {}) as { archiveId: string, services:
|
|
603
|
+
params = (paramsOrFirst || {}) as { archiveId: string, services: Services[], newResourceId?: string, newResourceName?: string };
|
|
603
604
|
} else {
|
|
604
605
|
params = {
|
|
605
606
|
archiveId: paramsOrFirst as string,
|
|
606
|
-
services: rest[0] as
|
|
607
|
+
services: rest[0] as Services[],
|
|
607
608
|
newResourceId: rest[1] as string,
|
|
608
609
|
newResourceName: rest[2] as string
|
|
609
610
|
};
|
|
@@ -656,7 +657,7 @@ export class Backups {
|
|
|
656
657
|
* @throws {AppwriteException}
|
|
657
658
|
* @returns {Promise<Models.BackupRestorationList>}
|
|
658
659
|
*/
|
|
659
|
-
listRestorations(params?: { queries?: string[]
|
|
660
|
+
listRestorations(params?: { queries?: string[] }): Promise<Models.BackupRestorationList>;
|
|
660
661
|
/**
|
|
661
662
|
* List all backup restorations for a project.
|
|
662
663
|
*
|
|
@@ -707,7 +708,7 @@ export class Backups {
|
|
|
707
708
|
* @throws {AppwriteException}
|
|
708
709
|
* @returns {Promise<Models.BackupRestoration>}
|
|
709
710
|
*/
|
|
710
|
-
getRestoration(params: { restorationId: string
|
|
711
|
+
getRestoration(params: { restorationId: string }): Promise<Models.BackupRestoration>;
|
|
711
712
|
/**
|
|
712
713
|
* Get the current status of a backup restoration.
|
|
713
714
|
*
|
package/src/services/console.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class Console {
|
|
|
19
19
|
* @throws {AppwriteException}
|
|
20
20
|
* @returns {Promise<Models.Campaign>}
|
|
21
21
|
*/
|
|
22
|
-
getCampaign(params: { campaignId: string
|
|
22
|
+
getCampaign(params: { campaignId: string }): Promise<Models.Campaign>;
|
|
23
23
|
/**
|
|
24
24
|
* Receive the details of a campaign using its ID.
|
|
25
25
|
*
|
|
@@ -70,7 +70,7 @@ export class Console {
|
|
|
70
70
|
* @throws {AppwriteException}
|
|
71
71
|
* @returns {Promise<Models.Coupon>}
|
|
72
72
|
*/
|
|
73
|
-
getCoupon(params: { couponId: string
|
|
73
|
+
getCoupon(params: { couponId: string }): Promise<Models.Coupon>;
|
|
74
74
|
/**
|
|
75
75
|
* Get the details of a coupon using it's coupon ID.
|
|
76
76
|
*
|
|
@@ -121,7 +121,7 @@ export class Console {
|
|
|
121
121
|
* @throws {AppwriteException}
|
|
122
122
|
* @returns {Promise<Models.BillingPlanList>}
|
|
123
123
|
*/
|
|
124
|
-
getPlans(params?: { platform?: Platform
|
|
124
|
+
getPlans(params?: { platform?: Platform }): Promise<Models.BillingPlanList>;
|
|
125
125
|
/**
|
|
126
126
|
* Return a list of all available plans.
|
|
127
127
|
*
|
|
@@ -172,7 +172,7 @@ export class Console {
|
|
|
172
172
|
* @throws {AppwriteException}
|
|
173
173
|
* @returns {Promise<Models.BillingPlan>}
|
|
174
174
|
*/
|
|
175
|
-
getPlan(params: { planId: string
|
|
175
|
+
getPlan(params: { planId: string }): Promise<Models.BillingPlan>;
|
|
176
176
|
/**
|
|
177
177
|
* Get the details of a plan using its plan ID.
|
|
178
178
|
*
|
|
@@ -223,7 +223,7 @@ export class Console {
|
|
|
223
223
|
* @throws {AppwriteException}
|
|
224
224
|
* @returns {Promise<Models.Program>}
|
|
225
225
|
*/
|
|
226
|
-
getProgram(params: { programId: string
|
|
226
|
+
getProgram(params: { programId: string }): Promise<Models.Program>;
|
|
227
227
|
/**
|
|
228
228
|
* Receive the details of a program using its ID.
|
|
229
229
|
*
|
|
@@ -274,7 +274,7 @@ export class Console {
|
|
|
274
274
|
* @throws {AppwriteException}
|
|
275
275
|
* @returns {Promise<Models.Organization<Preferences>>}
|
|
276
276
|
*/
|
|
277
|
-
createProgramMembership<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { programId: string
|
|
277
|
+
createProgramMembership<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { programId: string }): Promise<Models.Organization<Preferences>>;
|
|
278
278
|
/**
|
|
279
279
|
* Create a new membership for an account to a program.
|
|
280
280
|
*
|
|
@@ -322,44 +322,13 @@ export class Console {
|
|
|
322
322
|
/**
|
|
323
323
|
* Get all available regions for the console.
|
|
324
324
|
*
|
|
325
|
-
* @param {string} params.organizationId - Team ID.
|
|
326
325
|
* @throws {AppwriteException}
|
|
327
326
|
* @returns {Promise<Models.ConsoleRegionList>}
|
|
328
327
|
*/
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Get all available regions for the console.
|
|
332
|
-
*
|
|
333
|
-
* @param {string} organizationId - Team ID.
|
|
334
|
-
* @throws {AppwriteException}
|
|
335
|
-
* @returns {Promise<Models.ConsoleRegionList>}
|
|
336
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
337
|
-
*/
|
|
338
|
-
getRegions(organizationId: string): Promise<Models.ConsoleRegionList>;
|
|
339
|
-
getRegions(
|
|
340
|
-
paramsOrFirst: { organizationId: string } | string
|
|
341
|
-
): Promise<Models.ConsoleRegionList> {
|
|
342
|
-
let params: { organizationId: string };
|
|
343
|
-
|
|
344
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
345
|
-
params = (paramsOrFirst || {}) as { organizationId: string };
|
|
346
|
-
} else {
|
|
347
|
-
params = {
|
|
348
|
-
organizationId: paramsOrFirst as string
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
const organizationId = params.organizationId;
|
|
353
|
-
|
|
354
|
-
if (typeof organizationId === 'undefined') {
|
|
355
|
-
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
356
|
-
}
|
|
328
|
+
listRegions(): Promise<Models.ConsoleRegionList> {
|
|
357
329
|
|
|
358
330
|
const apiPath = '/console/regions';
|
|
359
331
|
const payload: Payload = {};
|
|
360
|
-
if (typeof organizationId !== 'undefined') {
|
|
361
|
-
payload['organizationId'] = organizationId;
|
|
362
|
-
}
|
|
363
332
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
364
333
|
|
|
365
334
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -381,7 +350,7 @@ export class Console {
|
|
|
381
350
|
* @throws {AppwriteException}
|
|
382
351
|
* @returns {Promise<{}>}
|
|
383
352
|
*/
|
|
384
|
-
getResource(params: { value: string, type: ConsoleResourceType
|
|
353
|
+
getResource(params: { value: string, type: ConsoleResourceType }): Promise<{}>;
|
|
385
354
|
/**
|
|
386
355
|
* Check if a resource ID is available.
|
|
387
356
|
*
|
|
@@ -449,7 +418,7 @@ export class Console {
|
|
|
449
418
|
* @throws {AppwriteException}
|
|
450
419
|
* @returns {Promise<{}>}
|
|
451
420
|
*/
|
|
452
|
-
createSource(params?: { ref?: string, referrer?: string, utmSource?: string, utmCampaign?: string, utmMedium?: string
|
|
421
|
+
createSource(params?: { ref?: string, referrer?: string, utmSource?: string, utmCampaign?: string, utmMedium?: string }): Promise<{}>;
|
|
453
422
|
/**
|
|
454
423
|
* Create a new source.
|
|
455
424
|
*
|
|
@@ -530,7 +499,7 @@ export class Console {
|
|
|
530
499
|
* @throws {AppwriteException}
|
|
531
500
|
* @returns {Promise<Models.ColumnList>}
|
|
532
501
|
*/
|
|
533
|
-
suggestColumns(params: { databaseId: string, tableId: string, context?: string, min?: number, max?: number
|
|
502
|
+
suggestColumns(params: { databaseId: string, tableId: string, context?: string, min?: number, max?: number }): Promise<Models.ColumnList>;
|
|
534
503
|
/**
|
|
535
504
|
* Suggests column names and their size limits based on the provided table name. The API will also analyze other tables in the same database to provide context-aware suggestions, ensuring consistency across schema design. Users may optionally provide custom context to further refine the suggestions.
|
|
536
505
|
*
|
|
@@ -615,7 +584,7 @@ export class Console {
|
|
|
615
584
|
* @throws {AppwriteException}
|
|
616
585
|
* @returns {Promise<Models.ColumnIndexList>}
|
|
617
586
|
*/
|
|
618
|
-
suggestIndexes(params: { databaseId: string, tableId: string, min?: number, max?: number
|
|
587
|
+
suggestIndexes(params: { databaseId: string, tableId: string, min?: number, max?: number }): Promise<Models.ColumnIndexList>;
|
|
619
588
|
/**
|
|
620
589
|
* Suggests database indexes for table columns based on the provided table structure and existing columns. The API will also analyze the table's column types, names, and patterns to recommend optimal indexes that improve query performance for common database operations like filtering, sorting, and searching.
|
|
621
590
|
*
|