@appwrite.io/console 3.1.0 → 5.0.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +516 -119
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +517 -120
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +516 -119
  8. package/docs/examples/databases/list-documents.md +2 -1
  9. package/docs/examples/domains/confirm-purchase.md +16 -0
  10. package/docs/examples/domains/confirm-transfer-in.md +16 -0
  11. package/docs/examples/domains/create-purchase.md +1 -1
  12. package/docs/examples/domains/create-transfer-in.md +18 -0
  13. package/docs/examples/domains/create-transfer-out.md +16 -0
  14. package/docs/examples/domains/get-transfer-status.md +15 -0
  15. package/docs/examples/functions/create.md +3 -1
  16. package/docs/examples/functions/update.md +3 -1
  17. package/docs/examples/health/get-console-pausing.md +16 -0
  18. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  19. package/docs/examples/migrations/create-firebase-migration.md +2 -2
  20. package/docs/examples/migrations/create-n-host-migration.md +2 -2
  21. package/docs/examples/migrations/create-supabase-migration.md +2 -2
  22. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  23. package/docs/examples/migrations/get-firebase-report.md +2 -2
  24. package/docs/examples/migrations/get-n-host-report.md +2 -2
  25. package/docs/examples/migrations/get-supabase-report.md +2 -2
  26. package/docs/examples/projects/update-console-access.md +15 -0
  27. package/docs/examples/projects/update-status.md +16 -0
  28. package/docs/examples/sites/create-deployment.md +2 -2
  29. package/docs/examples/sites/create.md +4 -1
  30. package/docs/examples/sites/update.md +4 -1
  31. package/docs/examples/tablesdb/list-rows.md +2 -1
  32. package/package.json +1 -1
  33. package/src/channel.ts +19 -15
  34. package/src/client.ts +5 -1
  35. package/src/enums/appwrite-migration-resource.ts +25 -0
  36. package/src/enums/build-runtime.ts +3 -0
  37. package/src/enums/domain-purchase-payment-status.ts +10 -0
  38. package/src/enums/domain-transfer-status-status.ts +10 -0
  39. package/src/enums/firebase-migration-resource.ts +12 -0
  40. package/src/enums/{resources.ts → n-host-migration-resource.ts} +1 -1
  41. package/src/enums/runtime.ts +3 -0
  42. package/src/enums/runtimes.ts +3 -0
  43. package/src/enums/status.ts +3 -0
  44. package/src/enums/supabase-migration-resource.ts +13 -0
  45. package/src/index.ts +7 -1
  46. package/src/models.ts +209 -7
  47. package/src/services/account.ts +4 -4
  48. package/src/services/databases.ts +100 -93
  49. package/src/services/domains.ts +342 -13
  50. package/src/services/functions.ts +52 -24
  51. package/src/services/health.ts +61 -0
  52. package/src/services/messaging.ts +2 -2
  53. package/src/services/migrations.ts +68 -65
  54. package/src/services/organizations.ts +2 -2
  55. package/src/services/projects.ts +120 -0
  56. package/src/services/sites.ts +96 -57
  57. package/src/services/tables-db.ts +14 -7
  58. package/src/services/teams.ts +4 -4
  59. package/types/channel.d.ts +9 -9
  60. package/types/enums/appwrite-migration-resource.d.ts +25 -0
  61. package/types/enums/build-runtime.d.ts +3 -0
  62. package/types/enums/domain-purchase-payment-status.d.ts +10 -0
  63. package/types/enums/domain-transfer-status-status.d.ts +10 -0
  64. package/types/enums/firebase-migration-resource.d.ts +12 -0
  65. package/types/enums/{resources.d.ts → n-host-migration-resource.d.ts} +1 -1
  66. package/types/enums/runtime.d.ts +3 -0
  67. package/types/enums/runtimes.d.ts +3 -0
  68. package/types/enums/status.d.ts +3 -0
  69. package/types/enums/supabase-migration-resource.d.ts +13 -0
  70. package/types/index.d.ts +7 -1
  71. package/types/models.d.ts +207 -7
  72. package/types/services/account.d.ts +2 -2
  73. package/types/services/databases.d.ts +40 -37
  74. package/types/services/domains.d.ts +117 -4
  75. package/types/services/functions.d.ts +20 -8
  76. package/types/services/health.d.ts +24 -0
  77. package/types/services/messaging.d.ts +2 -2
  78. package/types/services/migrations.d.ts +36 -33
  79. package/types/services/organizations.d.ts +2 -2
  80. package/types/services/projects.d.ts +46 -0
  81. package/types/services/sites.d.ts +30 -12
  82. package/types/services/tables-db.d.ts +4 -1
  83. package/types/services/teams.d.ts +4 -4
@@ -12,7 +12,8 @@ const result = await databases.listDocuments({
12
12
  collectionId: '<COLLECTION_ID>',
13
13
  queries: [], // optional
14
14
  transactionId: '<TRANSACTION_ID>', // optional
15
- total: false // optional
15
+ total: false, // optional
16
+ ttl: 0 // optional
16
17
  });
17
18
 
18
19
  console.log(result);
@@ -0,0 +1,16 @@
1
+ ```javascript
2
+ import { Client, Domains } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const domains = new Domains(client);
9
+
10
+ const result = await domains.confirmPurchase({
11
+ domainId: '<DOMAIN_ID>',
12
+ organizationId: '<ORGANIZATION_ID>'
13
+ });
14
+
15
+ console.log(result);
16
+ ```
@@ -0,0 +1,16 @@
1
+ ```javascript
2
+ import { Client, Domains } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const domains = new Domains(client);
9
+
10
+ const result = await domains.confirmTransferIn({
11
+ domainId: '<DOMAIN_ID>',
12
+ organizationId: '<ORGANIZATION_ID>'
13
+ });
14
+
15
+ console.log(result);
16
+ ```
@@ -9,7 +9,7 @@ const domains = new Domains(client);
9
9
 
10
10
  const result = await domains.createPurchase({
11
11
  domain: '',
12
- teamId: '<TEAM_ID>',
12
+ organizationId: '<ORGANIZATION_ID>',
13
13
  firstName: '<FIRST_NAME>',
14
14
  lastName: '<LAST_NAME>',
15
15
  email: 'email@example.com',
@@ -0,0 +1,18 @@
1
+ ```javascript
2
+ import { Client, Domains } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const domains = new Domains(client);
9
+
10
+ const result = await domains.createTransferIn({
11
+ domain: '',
12
+ organizationId: '<ORGANIZATION_ID>',
13
+ authCode: '<AUTH_CODE>',
14
+ paymentMethodId: '<PAYMENT_METHOD_ID>'
15
+ });
16
+
17
+ console.log(result);
18
+ ```
@@ -0,0 +1,16 @@
1
+ ```javascript
2
+ import { Client, Domains } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const domains = new Domains(client);
9
+
10
+ const result = await domains.createTransferOut({
11
+ domainId: '<DOMAIN_ID>',
12
+ organizationId: '<ORGANIZATION_ID>'
13
+ });
14
+
15
+ console.log(result);
16
+ ```
@@ -0,0 +1,15 @@
1
+ ```javascript
2
+ import { Client, Domains } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const domains = new Domains(client);
9
+
10
+ const result = await domains.getTransferStatus({
11
+ domainId: '<DOMAIN_ID>'
12
+ });
13
+
14
+ console.log(result);
15
+ ```
@@ -25,7 +25,9 @@ const result = await functions.create({
25
25
  providerBranch: '<PROVIDER_BRANCH>', // optional
26
26
  providerSilentMode: false, // optional
27
27
  providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
28
- specification: '' // optional
28
+ buildSpecification: '', // optional
29
+ runtimeSpecification: '', // optional
30
+ deploymentRetention: 0 // optional
29
31
  });
30
32
 
31
33
  console.log(result);
@@ -25,7 +25,9 @@ const result = await functions.update({
25
25
  providerBranch: '<PROVIDER_BRANCH>', // optional
26
26
  providerSilentMode: false, // optional
27
27
  providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
28
- specification: '' // optional
28
+ buildSpecification: '', // optional
29
+ runtimeSpecification: '', // optional
30
+ deploymentRetention: 0 // optional
29
31
  });
30
32
 
31
33
  console.log(result);
@@ -0,0 +1,16 @@
1
+ ```javascript
2
+ import { Client, Health } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const health = new Health(client);
9
+
10
+ const result = await health.getConsolePausing({
11
+ threshold: null, // optional
12
+ inactivityDays: null // optional
13
+ });
14
+
15
+ console.log(result);
16
+ ```
@@ -1,5 +1,5 @@
1
1
  ```javascript
2
- import { Client, Migrations, Resources } from "@appwrite.io/console";
2
+ import { Client, Migrations, AppwriteMigrationResource } from "@appwrite.io/console";
3
3
 
4
4
  const client = new Client()
5
5
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
8
8
  const migrations = new Migrations(client);
9
9
 
10
10
  const result = await migrations.createAppwriteMigration({
11
- resources: [Resources.User],
11
+ resources: [AppwriteMigrationResource.User],
12
12
  endpoint: 'https://example.com',
13
13
  projectId: '<PROJECT_ID>',
14
14
  apiKey: '<API_KEY>'
@@ -1,5 +1,5 @@
1
1
  ```javascript
2
- import { Client, Migrations, Resources } from "@appwrite.io/console";
2
+ import { Client, Migrations, FirebaseMigrationResource } from "@appwrite.io/console";
3
3
 
4
4
  const client = new Client()
5
5
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
8
8
  const migrations = new Migrations(client);
9
9
 
10
10
  const result = await migrations.createFirebaseMigration({
11
- resources: [Resources.User],
11
+ resources: [FirebaseMigrationResource.User],
12
12
  serviceAccount: '<SERVICE_ACCOUNT>'
13
13
  });
14
14
 
@@ -1,5 +1,5 @@
1
1
  ```javascript
2
- import { Client, Migrations, Resources } from "@appwrite.io/console";
2
+ import { Client, Migrations, NHostMigrationResource } from "@appwrite.io/console";
3
3
 
4
4
  const client = new Client()
5
5
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
8
8
  const migrations = new Migrations(client);
9
9
 
10
10
  const result = await migrations.createNHostMigration({
11
- resources: [Resources.User],
11
+ resources: [NHostMigrationResource.User],
12
12
  subdomain: '<SUBDOMAIN>',
13
13
  region: '<REGION>',
14
14
  adminSecret: '<ADMIN_SECRET>',
@@ -1,5 +1,5 @@
1
1
  ```javascript
2
- import { Client, Migrations, Resources } from "@appwrite.io/console";
2
+ import { Client, Migrations, SupabaseMigrationResource } from "@appwrite.io/console";
3
3
 
4
4
  const client = new Client()
5
5
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
8
8
  const migrations = new Migrations(client);
9
9
 
10
10
  const result = await migrations.createSupabaseMigration({
11
- resources: [Resources.User],
11
+ resources: [SupabaseMigrationResource.User],
12
12
  endpoint: 'https://example.com',
13
13
  apiKey: '<API_KEY>',
14
14
  databaseHost: '<DATABASE_HOST>',
@@ -1,5 +1,5 @@
1
1
  ```javascript
2
- import { Client, Migrations, Resources } from "@appwrite.io/console";
2
+ import { Client, Migrations, AppwriteMigrationResource } from "@appwrite.io/console";
3
3
 
4
4
  const client = new Client()
5
5
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
8
8
  const migrations = new Migrations(client);
9
9
 
10
10
  const result = await migrations.getAppwriteReport({
11
- resources: [Resources.User],
11
+ resources: [AppwriteMigrationResource.User],
12
12
  endpoint: 'https://example.com',
13
13
  projectID: '<PROJECT_ID>',
14
14
  key: '<KEY>'
@@ -1,5 +1,5 @@
1
1
  ```javascript
2
- import { Client, Migrations, Resources } from "@appwrite.io/console";
2
+ import { Client, Migrations, FirebaseMigrationResource } from "@appwrite.io/console";
3
3
 
4
4
  const client = new Client()
5
5
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
8
8
  const migrations = new Migrations(client);
9
9
 
10
10
  const result = await migrations.getFirebaseReport({
11
- resources: [Resources.User],
11
+ resources: [FirebaseMigrationResource.User],
12
12
  serviceAccount: '<SERVICE_ACCOUNT>'
13
13
  });
14
14
 
@@ -1,5 +1,5 @@
1
1
  ```javascript
2
- import { Client, Migrations, Resources } from "@appwrite.io/console";
2
+ import { Client, Migrations, NHostMigrationResource } from "@appwrite.io/console";
3
3
 
4
4
  const client = new Client()
5
5
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
8
8
  const migrations = new Migrations(client);
9
9
 
10
10
  const result = await migrations.getNHostReport({
11
- resources: [Resources.User],
11
+ resources: [NHostMigrationResource.User],
12
12
  subdomain: '<SUBDOMAIN>',
13
13
  region: '<REGION>',
14
14
  adminSecret: '<ADMIN_SECRET>',
@@ -1,5 +1,5 @@
1
1
  ```javascript
2
- import { Client, Migrations, Resources } from "@appwrite.io/console";
2
+ import { Client, Migrations, SupabaseMigrationResource } from "@appwrite.io/console";
3
3
 
4
4
  const client = new Client()
5
5
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
8
8
  const migrations = new Migrations(client);
9
9
 
10
10
  const result = await migrations.getSupabaseReport({
11
- resources: [Resources.User],
11
+ resources: [SupabaseMigrationResource.User],
12
12
  endpoint: 'https://example.com',
13
13
  apiKey: '<API_KEY>',
14
14
  databaseHost: '<DATABASE_HOST>',
@@ -0,0 +1,15 @@
1
+ ```javascript
2
+ import { Client, Projects } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const projects = new Projects(client);
9
+
10
+ const result = await projects.updateConsoleAccess({
11
+ projectId: '<PROJECT_ID>'
12
+ });
13
+
14
+ console.log(result);
15
+ ```
@@ -0,0 +1,16 @@
1
+ ```javascript
2
+ import { Client, Projects, Status } from "@appwrite.io/console";
3
+
4
+ const client = new Client()
5
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
6
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
7
+
8
+ const projects = new Projects(client);
9
+
10
+ const result = await projects.updateStatus({
11
+ projectId: '<PROJECT_ID>',
12
+ status: Status.Active
13
+ });
14
+
15
+ console.log(result);
16
+ ```
@@ -10,10 +10,10 @@ const sites = new Sites(client);
10
10
  const result = await sites.createDeployment({
11
11
  siteId: '<SITE_ID>',
12
12
  code: document.getElementById('uploader').files[0],
13
- activate: false,
14
13
  installCommand: '<INSTALL_COMMAND>', // optional
15
14
  buildCommand: '<BUILD_COMMAND>', // optional
16
- outputDirectory: '<OUTPUT_DIRECTORY>' // optional
15
+ outputDirectory: '<OUTPUT_DIRECTORY>', // optional
16
+ activate: false // optional
17
17
  });
18
18
 
19
19
  console.log(result);
@@ -17,6 +17,7 @@ const result = await sites.create({
17
17
  timeout: 1, // optional
18
18
  installCommand: '<INSTALL_COMMAND>', // optional
19
19
  buildCommand: '<BUILD_COMMAND>', // optional
20
+ startCommand: '<START_COMMAND>', // optional
20
21
  outputDirectory: '<OUTPUT_DIRECTORY>', // optional
21
22
  adapter: Adapter.Static, // optional
22
23
  installationId: '<INSTALLATION_ID>', // optional
@@ -25,7 +26,9 @@ const result = await sites.create({
25
26
  providerBranch: '<PROVIDER_BRANCH>', // optional
26
27
  providerSilentMode: false, // optional
27
28
  providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
28
- specification: '' // optional
29
+ buildSpecification: '', // optional
30
+ runtimeSpecification: '', // optional
31
+ deploymentRetention: 0 // optional
29
32
  });
30
33
 
31
34
  console.log(result);
@@ -16,6 +16,7 @@ const result = await sites.update({
16
16
  timeout: 1, // optional
17
17
  installCommand: '<INSTALL_COMMAND>', // optional
18
18
  buildCommand: '<BUILD_COMMAND>', // optional
19
+ startCommand: '<START_COMMAND>', // optional
19
20
  outputDirectory: '<OUTPUT_DIRECTORY>', // optional
20
21
  buildRuntime: BuildRuntime.Node145, // optional
21
22
  adapter: Adapter.Static, // optional
@@ -25,7 +26,9 @@ const result = await sites.update({
25
26
  providerBranch: '<PROVIDER_BRANCH>', // optional
26
27
  providerSilentMode: false, // optional
27
28
  providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
28
- specification: '' // optional
29
+ buildSpecification: '', // optional
30
+ runtimeSpecification: '', // optional
31
+ deploymentRetention: 0 // optional
29
32
  });
30
33
 
31
34
  console.log(result);
@@ -12,7 +12,8 @@ const result = await tablesDB.listRows({
12
12
  tableId: '<TABLE_ID>',
13
13
  queries: [], // optional
14
14
  transactionId: '<TRANSACTION_ID>', // optional
15
- total: false // optional
15
+ total: false, // optional
16
+ ttl: 0 // optional
16
17
  });
17
18
 
18
19
  console.log(result);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@appwrite.io/console",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
5
- "version": "3.1.0",
5
+ "version": "5.0.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/channel.ts CHANGED
@@ -16,8 +16,14 @@ interface Resolved { _res: any }
16
16
  type Actionable = Document | Row | File | Team | Membership;
17
17
 
18
18
  function normalize(id: string): string {
19
- const trimmed = id.trim();
20
- return trimmed === "" ? "*" : trimmed;
19
+ if (id === undefined || id === null) {
20
+ throw new Error("Channel ID is required");
21
+ }
22
+ const trimmed = String(id).trim();
23
+ if (trimmed === "") {
24
+ throw new Error("Channel ID is required");
25
+ }
26
+ return trimmed;
21
27
  }
22
28
 
23
29
  export class Channel<T> {
@@ -44,9 +50,8 @@ export class Channel<T> {
44
50
 
45
51
  // --- DATABASE ROUTE ---
46
52
  // Only available on Channel<Database>
47
- collection(this: Channel<Database>, id?: string): Channel<Collection> {
48
- // Default: wildcard collection ID
49
- return this.next<Collection>("collections", id ?? "*");
53
+ collection(this: Channel<Database>, id: string): Channel<Collection> {
54
+ return this.next<Collection>("collections", id);
50
55
  }
51
56
 
52
57
  // Only available on Channel<Collection>
@@ -56,9 +61,8 @@ export class Channel<T> {
56
61
  }
57
62
 
58
63
  // --- TABLESDB ROUTE ---
59
- table(this: Channel<TablesDB>, id?: string): Channel<Table> {
60
- // Default: wildcard table ID
61
- return this.next<Table>("tables", id ?? "*");
64
+ table(this: Channel<TablesDB>, id: string): Channel<Table> {
65
+ return this.next<Table>("tables", id);
62
66
  }
63
67
 
64
68
  row(this: Channel<Table>, id?: string): Channel<Row> {
@@ -91,31 +95,31 @@ export class Channel<T> {
91
95
  }
92
96
 
93
97
  // --- ROOT FACTORIES ---
94
- static database(id: string = "*") {
98
+ static database(id: string) {
95
99
  return new Channel<Database>(["databases", normalize(id)]);
96
100
  }
97
101
 
98
- static execution(id: string = "*") {
102
+ static execution(id: string) {
99
103
  return new Channel<Execution>(["executions", normalize(id)]);
100
104
  }
101
105
 
102
- static tablesdb(id: string = "*") {
106
+ static tablesdb(id: string) {
103
107
  return new Channel<TablesDB>(["tablesdb", normalize(id)]);
104
108
  }
105
109
 
106
- static bucket(id: string = "*") {
110
+ static bucket(id: string) {
107
111
  return new Channel<Bucket>(["buckets", normalize(id)]);
108
112
  }
109
113
 
110
- static function(id: string = "*") {
114
+ static function(id: string) {
111
115
  return new Channel<Func>(["functions", normalize(id)]);
112
116
  }
113
117
 
114
- static team(id: string = "*") {
118
+ static team(id: string) {
115
119
  return new Channel<Team>(["teams", normalize(id)]);
116
120
  }
117
121
 
118
- static membership(id: string = "*") {
122
+ static membership(id: string) {
119
123
  return new Channel<Membership>(["memberships", normalize(id)]);
120
124
  }
121
125
 
package/src/client.ts CHANGED
@@ -400,7 +400,7 @@ class Client {
400
400
  'x-sdk-name': 'Console',
401
401
  'x-sdk-platform': 'console',
402
402
  'x-sdk-language': 'web',
403
- 'x-sdk-version': '3.1.0',
403
+ 'x-sdk-version': '5.0.0',
404
404
  'X-Appwrite-Response-Format': '1.8.0',
405
405
  };
406
406
 
@@ -995,6 +995,10 @@ class Client {
995
995
  window.localStorage.setItem('cookieFallback', cookieFallback);
996
996
  }
997
997
 
998
+ if (data && typeof data === 'object') {
999
+ data.toString = () => JSONbig.stringify(data);
1000
+ }
1001
+
998
1002
  return data;
999
1003
  }
1000
1004
 
@@ -0,0 +1,25 @@
1
+ export enum AppwriteMigrationResource {
2
+ User = 'user',
3
+ Team = 'team',
4
+ Membership = 'membership',
5
+ Database = 'database',
6
+ Table = 'table',
7
+ Column = 'column',
8
+ Index = 'index',
9
+ Row = 'row',
10
+ Document = 'document',
11
+ Attribute = 'attribute',
12
+ Collection = 'collection',
13
+ Bucket = 'bucket',
14
+ File = 'file',
15
+ Function = 'function',
16
+ Deployment = 'deployment',
17
+ Environmentvariable = 'environment-variable',
18
+ Provider = 'provider',
19
+ Topic = 'topic',
20
+ Subscriber = 'subscriber',
21
+ Message = 'message',
22
+ Site = 'site',
23
+ Sitedeployment = 'site-deployment',
24
+ Sitevariable = 'site-variable',
25
+ }
@@ -30,6 +30,9 @@ export enum BuildRuntime {
30
30
  Pythonml311 = 'python-ml-3.11',
31
31
  Pythonml312 = 'python-ml-3.12',
32
32
  Pythonml313 = 'python-ml-3.13',
33
+ Deno121 = 'deno-1.21',
34
+ Deno124 = 'deno-1.24',
35
+ Deno135 = 'deno-1.35',
33
36
  Deno140 = 'deno-1.40',
34
37
  Deno146 = 'deno-1.46',
35
38
  Deno20 = 'deno-2.0',
@@ -0,0 +1,10 @@
1
+ export enum DomainPurchasePaymentStatus {
2
+ Pending = 'pending',
3
+ PendingConfirmation = 'pending_confirmation',
4
+ PendingPaymentProcessing = 'pending_payment_processing',
5
+ Authorized = 'authorized',
6
+ Captured = 'captured',
7
+ Failed = 'failed',
8
+ CaptureFailed = 'capture_failed',
9
+ RenewalCaptureFailed = 'renewal_capture_failed',
10
+ }
@@ -0,0 +1,10 @@
1
+ export enum DomainTransferStatusStatus {
2
+ Transferrable = 'transferrable',
3
+ NotTransferrable = 'not_transferrable',
4
+ PendingOwner = 'pending_owner',
5
+ PendingAdmin = 'pending_admin',
6
+ PendingRegistry = 'pending_registry',
7
+ Completed = 'completed',
8
+ Cancelled = 'cancelled',
9
+ ServiceUnavailable = 'service_unavailable',
10
+ }
@@ -0,0 +1,12 @@
1
+ export enum FirebaseMigrationResource {
2
+ User = 'user',
3
+ Database = 'database',
4
+ Table = 'table',
5
+ Column = 'column',
6
+ Row = 'row',
7
+ Document = 'document',
8
+ Attribute = 'attribute',
9
+ Collection = 'collection',
10
+ Bucket = 'bucket',
11
+ File = 'file',
12
+ }
@@ -1,4 +1,4 @@
1
- export enum Resources {
1
+ export enum NHostMigrationResource {
2
2
  User = 'user',
3
3
  Database = 'database',
4
4
  Table = 'table',
@@ -30,6 +30,9 @@ export enum Runtime {
30
30
  Pythonml311 = 'python-ml-3.11',
31
31
  Pythonml312 = 'python-ml-3.12',
32
32
  Pythonml313 = 'python-ml-3.13',
33
+ Deno121 = 'deno-1.21',
34
+ Deno124 = 'deno-1.24',
35
+ Deno135 = 'deno-1.35',
33
36
  Deno140 = 'deno-1.40',
34
37
  Deno146 = 'deno-1.46',
35
38
  Deno20 = 'deno-2.0',
@@ -30,6 +30,9 @@ export enum Runtimes {
30
30
  Pythonml311 = 'python-ml-3.11',
31
31
  Pythonml312 = 'python-ml-3.12',
32
32
  Pythonml313 = 'python-ml-3.13',
33
+ Deno121 = 'deno-1.21',
34
+ Deno124 = 'deno-1.24',
35
+ Deno135 = 'deno-1.35',
33
36
  Deno140 = 'deno-1.40',
34
37
  Deno146 = 'deno-1.46',
35
38
  Deno20 = 'deno-2.0',
@@ -0,0 +1,3 @@
1
+ export enum Status {
2
+ Active = 'active',
3
+ }
@@ -0,0 +1,13 @@
1
+ export enum SupabaseMigrationResource {
2
+ User = 'user',
3
+ Database = 'database',
4
+ Table = 'table',
5
+ Column = 'column',
6
+ Index = 'index',
7
+ Row = 'row',
8
+ Document = 'document',
9
+ Attribute = 'attribute',
10
+ Collection = 'collection',
11
+ Bucket = 'bucket',
12
+ File = 'file',
13
+ }
package/src/index.ts CHANGED
@@ -71,7 +71,10 @@ export { ExecutionMethod } from './enums/execution-method';
71
71
  export { Name } from './enums/name';
72
72
  export { MessagePriority } from './enums/message-priority';
73
73
  export { SmtpEncryption } from './enums/smtp-encryption';
74
- export { Resources } from './enums/resources';
74
+ export { AppwriteMigrationResource } from './enums/appwrite-migration-resource';
75
+ export { FirebaseMigrationResource } from './enums/firebase-migration-resource';
76
+ export { NHostMigrationResource } from './enums/n-host-migration-resource';
77
+ export { SupabaseMigrationResource } from './enums/supabase-migration-resource';
75
78
  export { ProjectUsageRange } from './enums/project-usage-range';
76
79
  export { Region } from './enums/region';
77
80
  export { Api } from './enums/api';
@@ -80,6 +83,7 @@ export { PlatformType } from './enums/platform-type';
80
83
  export { ResourceType } from './enums/resource-type';
81
84
  export { ApiService } from './enums/api-service';
82
85
  export { SMTPSecure } from './enums/smtp-secure';
86
+ export { Status } from './enums/status';
83
87
  export { EmailTemplateType } from './enums/email-template-type';
84
88
  export { EmailTemplateLocale } from './enums/email-template-locale';
85
89
  export { SmsTemplateType } from './enums/sms-template-type';
@@ -108,3 +112,5 @@ export { ProxyRuleDeploymentResourceType } from './enums/proxy-rule-deployment-r
108
112
  export { ProxyRuleStatus } from './enums/proxy-rule-status';
109
113
  export { MessageStatus } from './enums/message-status';
110
114
  export { BillingPlanGroup } from './enums/billing-plan-group';
115
+ export { DomainPurchasePaymentStatus } from './enums/domain-purchase-payment-status';
116
+ export { DomainTransferStatusStatus } from './enums/domain-transfer-status-status';