@appwrite.io/console 2.1.3 → 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.
Files changed (132) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +1564 -187
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +1565 -188
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +1564 -187
  8. package/docs/examples/account/create-key.md +15 -0
  9. package/docs/examples/account/delete-key.md +13 -0
  10. package/docs/examples/account/get-key.md +13 -0
  11. package/docs/examples/account/list-keys.md +13 -0
  12. package/docs/examples/account/update-key.md +16 -0
  13. package/docs/examples/avatars/get-screenshot.md +5 -5
  14. package/docs/examples/backups/create-archive.md +2 -2
  15. package/docs/examples/backups/create-policy.md +2 -2
  16. package/docs/examples/backups/create-restoration.md +2 -2
  17. package/docs/examples/console/{get-regions.md → list-regions.md} +1 -3
  18. package/docs/examples/databases/create-index.md +2 -2
  19. package/docs/examples/databases/create-longtext-attribute.md +18 -0
  20. package/docs/examples/databases/create-mediumtext-attribute.md +18 -0
  21. package/docs/examples/databases/create-text-attribute.md +18 -0
  22. package/docs/examples/databases/create-varchar-attribute.md +19 -0
  23. package/docs/examples/databases/update-collection.md +1 -1
  24. package/docs/examples/databases/update-longtext-attribute.md +18 -0
  25. package/docs/examples/databases/update-mediumtext-attribute.md +18 -0
  26. package/docs/examples/databases/update-text-attribute.md +18 -0
  27. package/docs/examples/databases/update-varchar-attribute.md +19 -0
  28. package/docs/examples/databases/update.md +1 -1
  29. package/docs/examples/functions/create.md +2 -2
  30. package/docs/examples/functions/list-templates.md +3 -3
  31. package/docs/examples/functions/update.md +2 -2
  32. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  33. package/docs/examples/migrations/create-firebase-migration.md +2 -2
  34. package/docs/examples/migrations/create-n-host-migration.md +2 -2
  35. package/docs/examples/migrations/create-supabase-migration.md +2 -2
  36. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  37. package/docs/examples/migrations/get-firebase-report.md +2 -2
  38. package/docs/examples/migrations/get-n-host-report.md +2 -2
  39. package/docs/examples/migrations/get-supabase-report.md +2 -2
  40. package/docs/examples/organizations/create-key.md +16 -0
  41. package/docs/examples/organizations/create.md +2 -2
  42. package/docs/examples/organizations/delete-key.md +14 -0
  43. package/docs/examples/organizations/estimation-create-organization.md +2 -2
  44. package/docs/examples/organizations/estimation-update-plan.md +2 -2
  45. package/docs/examples/organizations/get-key.md +14 -0
  46. package/docs/examples/organizations/list-keys.md +14 -0
  47. package/docs/examples/organizations/list-regions.md +13 -0
  48. package/docs/examples/organizations/update-key.md +17 -0
  49. package/docs/examples/organizations/update-plan.md +2 -2
  50. package/docs/examples/projects/create-jwt.md +2 -2
  51. package/docs/examples/projects/create-key.md +2 -2
  52. package/docs/examples/projects/update-key.md +2 -2
  53. package/docs/examples/sites/list-templates.md +3 -3
  54. package/docs/examples/tablesdb/create-index.md +2 -2
  55. package/docs/examples/tablesdb/create-longtext-column.md +18 -0
  56. package/docs/examples/tablesdb/create-mediumtext-column.md +18 -0
  57. package/docs/examples/tablesdb/create-text-column.md +18 -0
  58. package/docs/examples/tablesdb/create-varchar-column.md +19 -0
  59. package/docs/examples/tablesdb/update-longtext-column.md +18 -0
  60. package/docs/examples/tablesdb/update-mediumtext-column.md +18 -0
  61. package/docs/examples/tablesdb/update-table.md +1 -1
  62. package/docs/examples/tablesdb/update-text-column.md +18 -0
  63. package/docs/examples/tablesdb/update-varchar-column.md +19 -0
  64. package/docs/examples/tablesdb/update.md +1 -1
  65. package/docs/examples/teams/create-membership.md +2 -2
  66. package/docs/examples/teams/update-membership.md +2 -2
  67. package/package.json +1 -1
  68. package/src/channel.ts +8 -4
  69. package/src/client.ts +3 -28
  70. package/src/enums/browser-permission.ts +22 -0
  71. package/src/enums/deployment-status.ts +1 -0
  72. package/src/enums/frameworks.ts +17 -0
  73. package/src/enums/order-by.ts +4 -0
  74. package/src/enums/resources.ts +13 -0
  75. package/src/enums/roles.ts +7 -0
  76. package/src/enums/runtimes.ts +66 -0
  77. package/src/enums/scopes.ts +65 -0
  78. package/src/enums/services.ts +5 -0
  79. package/src/enums/use-cases.ts +11 -0
  80. package/src/index.ts +9 -1
  81. package/src/models.ts +349 -1
  82. package/src/services/account.ts +364 -56
  83. package/src/services/assistant.ts +1 -1
  84. package/src/services/avatars.ts +17 -16
  85. package/src/services/backups.ts +37 -36
  86. package/src/services/console.ts +11 -42
  87. package/src/services/databases.ts +1060 -280
  88. package/src/services/domains.ts +44 -44
  89. package/src/services/functions.ts +60 -57
  90. package/src/services/graphql.ts +2 -2
  91. package/src/services/health.ts +22 -20
  92. package/src/services/messaging.ts +56 -56
  93. package/src/services/migrations.ts +79 -78
  94. package/src/services/organizations.ts +466 -70
  95. package/src/services/project.ts +5 -5
  96. package/src/services/projects.ts +86 -85
  97. package/src/services/proxy.ts +8 -8
  98. package/src/services/sites.ts +42 -40
  99. package/src/services/storage.ts +16 -16
  100. package/src/services/tables-db.ts +1050 -268
  101. package/src/services/teams.ts +31 -30
  102. package/src/services/tokens.ts +5 -5
  103. package/src/services/users.ts +49 -49
  104. package/src/services/vcs.ts +10 -10
  105. package/types/channel.d.ts +5 -4
  106. package/types/enums/browser-permission.d.ts +22 -0
  107. package/types/enums/deployment-status.d.ts +1 -0
  108. package/types/enums/frameworks.d.ts +17 -0
  109. package/types/enums/order-by.d.ts +4 -0
  110. package/types/enums/resources.d.ts +13 -0
  111. package/types/enums/roles.d.ts +7 -0
  112. package/types/enums/runtimes.d.ts +66 -0
  113. package/types/enums/scopes.d.ts +65 -0
  114. package/types/enums/services.d.ts +5 -0
  115. package/types/enums/use-cases.d.ts +11 -0
  116. package/types/index.d.ts +9 -1
  117. package/types/models.d.ts +341 -1
  118. package/types/services/account.d.ts +111 -0
  119. package/types/services/avatars.d.ts +5 -4
  120. package/types/services/backups.d.ts +13 -12
  121. package/types/services/console.d.ts +1 -13
  122. package/types/services/databases.d.ts +303 -8
  123. package/types/services/functions.d.ts +18 -15
  124. package/types/services/health.d.ts +2 -0
  125. package/types/services/migrations.d.ts +33 -32
  126. package/types/services/organizations.d.ts +161 -17
  127. package/types/services/projects.d.ts +13 -12
  128. package/types/services/sites.d.ts +9 -7
  129. package/types/services/tables-db.d.ts +305 -8
  130. package/types/services/teams.d.ts +9 -8
  131. package/src/enums/billing-plan.ts +0 -17
  132. package/types/enums/billing-plan.d.ts +0 -17
@@ -0,0 +1,15 @@
1
+ import { Client, Account, Scopes } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const account = new Account(client);
8
+
9
+ const result = await account.createKey({
10
+ name: '<NAME>',
11
+ scopes: [Scopes.Account],
12
+ expire: '' // optional
13
+ });
14
+
15
+ console.log(result);
@@ -0,0 +1,13 @@
1
+ import { Client, Account } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const account = new Account(client);
8
+
9
+ const result = await account.deleteKey({
10
+ keyId: '<KEY_ID>'
11
+ });
12
+
13
+ console.log(result);
@@ -0,0 +1,13 @@
1
+ import { Client, Account } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const account = new Account(client);
8
+
9
+ const result = await account.getKey({
10
+ keyId: '<KEY_ID>'
11
+ });
12
+
13
+ console.log(result);
@@ -0,0 +1,13 @@
1
+ import { Client, Account } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const account = new Account(client);
8
+
9
+ const result = await account.listKeys({
10
+ total: false // optional
11
+ });
12
+
13
+ console.log(result);
@@ -0,0 +1,16 @@
1
+ import { Client, Account, Scopes } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const account = new Account(client);
8
+
9
+ const result = await account.updateKey({
10
+ keyId: '<KEY_ID>',
11
+ name: '<NAME>',
12
+ scopes: [Scopes.Account],
13
+ expire: '' // optional
14
+ });
15
+
16
+ console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Avatars, Theme, Timezone, ImageFormat } from "@appwrite.io/console";
1
+ import { Client, Avatars, Theme, Timezone, BrowserPermission, ImageFormat } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -15,21 +15,21 @@ const result = avatars.getScreenshot({
15
15
  viewportWidth: 1920, // optional
16
16
  viewportHeight: 1080, // optional
17
17
  scale: 2, // optional
18
- theme: Theme.Light, // optional
18
+ theme: Theme.Dark, // optional
19
19
  userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
20
20
  fullpage: true, // optional
21
21
  locale: 'en-US', // optional
22
- timezone: Timezone.AfricaAbidjan, // optional
22
+ timezone: Timezone.AmericaNewYork, // optional
23
23
  latitude: 37.7749, // optional
24
24
  longitude: -122.4194, // optional
25
25
  accuracy: 100, // optional
26
26
  touch: true, // optional
27
- permissions: ["geolocation","notifications"], // optional
27
+ permissions: [BrowserPermission.Geolocation, BrowserPermission.Notifications], // optional
28
28
  sleep: 3, // optional
29
29
  width: 800, // optional
30
30
  height: 600, // optional
31
31
  quality: 85, // optional
32
- output: ImageFormat.Jpg // optional
32
+ output: ImageFormat.Jpeg // optional
33
33
  });
34
34
 
35
35
  console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Backups } from "@appwrite.io/console";
1
+ import { Client, Backups, Services } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const backups = new Backups(client);
8
8
 
9
9
  const result = await backups.createArchive({
10
- services: [],
10
+ services: [Services.Databases],
11
11
  resourceId: '<RESOURCE_ID>' // optional
12
12
  });
13
13
 
@@ -1,4 +1,4 @@
1
- import { Client, Backups } from "@appwrite.io/console";
1
+ import { Client, Backups, Services } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const backups = new Backups(client);
8
8
 
9
9
  const result = await backups.createPolicy({
10
10
  policyId: '<POLICY_ID>',
11
- services: [],
11
+ services: [Services.Databases],
12
12
  retention: 1,
13
13
  schedule: '',
14
14
  name: '<NAME>', // optional
@@ -1,4 +1,4 @@
1
- import { Client, Backups } from "@appwrite.io/console";
1
+ import { Client, Backups, Services } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const backups = new Backups(client);
8
8
 
9
9
  const result = await backups.createRestoration({
10
10
  archiveId: '<ARCHIVE_ID>',
11
- services: [],
11
+ services: [Services.Databases],
12
12
  newResourceId: '<NEW_RESOURCE_ID>', // optional
13
13
  newResourceName: '<NEW_RESOURCE_NAME>' // optional
14
14
  });
@@ -6,8 +6,6 @@ const client = new Client()
6
6
 
7
7
  const console = new Console(client);
8
8
 
9
- const result = await console.getRegions({
10
- organizationId: '<ORGANIZATION_ID>'
11
- });
9
+ const result = await console.listRegions();
12
10
 
13
11
  console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Databases, IndexType } from "@appwrite.io/console";
1
+ import { Client, Databases, IndexType, OrderBy } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -12,7 +12,7 @@ const result = await databases.createIndex({
12
12
  key: '',
13
13
  type: IndexType.Key,
14
14
  attributes: [],
15
- orders: [], // optional
15
+ orders: [OrderBy.Asc], // optional
16
16
  lengths: [] // optional
17
17
  });
18
18
 
@@ -0,0 +1,18 @@
1
+ import { Client, Databases } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const databases = new Databases(client);
8
+
9
+ const result = await databases.createLongtextAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ key: '',
13
+ required: false,
14
+ default: '<DEFAULT>', // optional
15
+ array: false // optional
16
+ });
17
+
18
+ console.log(result);
@@ -0,0 +1,18 @@
1
+ import { Client, Databases } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const databases = new Databases(client);
8
+
9
+ const result = await databases.createMediumtextAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ key: '',
13
+ required: false,
14
+ default: '<DEFAULT>', // optional
15
+ array: false // optional
16
+ });
17
+
18
+ console.log(result);
@@ -0,0 +1,18 @@
1
+ import { Client, Databases } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const databases = new Databases(client);
8
+
9
+ const result = await databases.createTextAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ key: '',
13
+ required: false,
14
+ default: '<DEFAULT>', // optional
15
+ array: false // optional
16
+ });
17
+
18
+ console.log(result);
@@ -0,0 +1,19 @@
1
+ import { Client, Databases } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const databases = new Databases(client);
8
+
9
+ const result = await databases.createVarcharAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ key: '',
13
+ size: 1,
14
+ required: false,
15
+ default: '<DEFAULT>', // optional
16
+ array: false // optional
17
+ });
18
+
19
+ console.log(result);
@@ -9,7 +9,7 @@ const databases = new Databases(client);
9
9
  const result = await databases.updateCollection({
10
10
  databaseId: '<DATABASE_ID>',
11
11
  collectionId: '<COLLECTION_ID>',
12
- name: '<NAME>',
12
+ name: '<NAME>', // optional
13
13
  permissions: [Permission.read(Role.any())], // optional
14
14
  documentSecurity: false, // optional
15
15
  enabled: false // optional
@@ -0,0 +1,18 @@
1
+ import { Client, Databases } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const databases = new Databases(client);
8
+
9
+ const result = await databases.updateLongtextAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ key: '',
13
+ required: false,
14
+ default: '<DEFAULT>',
15
+ newKey: '' // optional
16
+ });
17
+
18
+ console.log(result);
@@ -0,0 +1,18 @@
1
+ import { Client, Databases } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const databases = new Databases(client);
8
+
9
+ const result = await databases.updateMediumtextAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ key: '',
13
+ required: false,
14
+ default: '<DEFAULT>',
15
+ newKey: '' // optional
16
+ });
17
+
18
+ console.log(result);
@@ -0,0 +1,18 @@
1
+ import { Client, Databases } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const databases = new Databases(client);
8
+
9
+ const result = await databases.updateTextAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ key: '',
13
+ required: false,
14
+ default: '<DEFAULT>',
15
+ newKey: '' // optional
16
+ });
17
+
18
+ console.log(result);
@@ -0,0 +1,19 @@
1
+ import { Client, Databases } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const databases = new Databases(client);
8
+
9
+ const result = await databases.updateVarcharAttribute({
10
+ databaseId: '<DATABASE_ID>',
11
+ collectionId: '<COLLECTION_ID>',
12
+ key: '',
13
+ required: false,
14
+ default: '<DEFAULT>',
15
+ size: 1, // optional
16
+ newKey: '' // optional
17
+ });
18
+
19
+ console.log(result);
@@ -8,7 +8,7 @@ const databases = new Databases(client);
8
8
 
9
9
  const result = await databases.update({
10
10
  databaseId: '<DATABASE_ID>',
11
- name: '<NAME>',
11
+ name: '<NAME>', // optional
12
12
  enabled: false // optional
13
13
  });
14
14
 
@@ -1,4 +1,4 @@
1
- import { Client, Functions, Runtime } from "@appwrite.io/console";
1
+ import { Client, Functions, Runtime, Scopes } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -18,7 +18,7 @@ const result = await functions.create({
18
18
  logging: false, // optional
19
19
  entrypoint: '<ENTRYPOINT>', // optional
20
20
  commands: '<COMMANDS>', // optional
21
- scopes: [], // optional
21
+ scopes: [Scopes.SessionsWrite], // optional
22
22
  installationId: '<INSTALLATION_ID>', // optional
23
23
  providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional
24
24
  providerBranch: '<PROVIDER_BRANCH>', // optional
@@ -1,4 +1,4 @@
1
- import { Client, Functions } from "@appwrite.io/console";
1
+ import { Client, Functions, Runtimes, UseCases } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,8 +7,8 @@ const client = new Client()
7
7
  const functions = new Functions(client);
8
8
 
9
9
  const result = await functions.listTemplates({
10
- runtimes: [], // optional
11
- useCases: [], // optional
10
+ runtimes: [Runtimes.Node145], // optional
11
+ useCases: [UseCases.Starter], // optional
12
12
  limit: 1, // optional
13
13
  offset: 0, // optional
14
14
  total: false // optional
@@ -1,4 +1,4 @@
1
- import { Client, Functions, Runtime } from "@appwrite.io/console";
1
+ import { Client, Functions, Runtime, Scopes } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -18,7 +18,7 @@ const result = await functions.update({
18
18
  logging: false, // optional
19
19
  entrypoint: '<ENTRYPOINT>', // optional
20
20
  commands: '<COMMANDS>', // optional
21
- scopes: [], // optional
21
+ scopes: [Scopes.SessionsWrite], // optional
22
22
  installationId: '<INSTALLATION_ID>', // optional
23
23
  providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional
24
24
  providerBranch: '<PROVIDER_BRANCH>', // optional
@@ -1,4 +1,4 @@
1
- import { Client, Migrations } from "@appwrite.io/console";
1
+ import { Client, Migrations, Resources } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const migrations = new Migrations(client);
8
8
 
9
9
  const result = await migrations.createAppwriteMigration({
10
- resources: [],
10
+ resources: [Resources.User],
11
11
  endpoint: 'https://example.com',
12
12
  projectId: '<PROJECT_ID>',
13
13
  apiKey: '<API_KEY>'
@@ -1,4 +1,4 @@
1
- import { Client, Migrations } from "@appwrite.io/console";
1
+ import { Client, Migrations, Resources } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const migrations = new Migrations(client);
8
8
 
9
9
  const result = await migrations.createFirebaseMigration({
10
- resources: [],
10
+ resources: [Resources.User],
11
11
  serviceAccount: '<SERVICE_ACCOUNT>'
12
12
  });
13
13
 
@@ -1,4 +1,4 @@
1
- import { Client, Migrations } from "@appwrite.io/console";
1
+ import { Client, Migrations, Resources } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const migrations = new Migrations(client);
8
8
 
9
9
  const result = await migrations.createNHostMigration({
10
- resources: [],
10
+ resources: [Resources.User],
11
11
  subdomain: '<SUBDOMAIN>',
12
12
  region: '<REGION>',
13
13
  adminSecret: '<ADMIN_SECRET>',
@@ -1,4 +1,4 @@
1
- import { Client, Migrations } from "@appwrite.io/console";
1
+ import { Client, Migrations, Resources } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const migrations = new Migrations(client);
8
8
 
9
9
  const result = await migrations.createSupabaseMigration({
10
- resources: [],
10
+ resources: [Resources.User],
11
11
  endpoint: 'https://example.com',
12
12
  apiKey: '<API_KEY>',
13
13
  databaseHost: '<DATABASE_HOST>',
@@ -1,4 +1,4 @@
1
- import { Client, Migrations } from "@appwrite.io/console";
1
+ import { Client, Migrations, Resources } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const migrations = new Migrations(client);
8
8
 
9
9
  const result = await migrations.getAppwriteReport({
10
- resources: [],
10
+ resources: [Resources.User],
11
11
  endpoint: 'https://example.com',
12
12
  projectID: '<PROJECT_ID>',
13
13
  key: '<KEY>'
@@ -1,4 +1,4 @@
1
- import { Client, Migrations } from "@appwrite.io/console";
1
+ import { Client, Migrations, Resources } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const migrations = new Migrations(client);
8
8
 
9
9
  const result = await migrations.getFirebaseReport({
10
- resources: [],
10
+ resources: [Resources.User],
11
11
  serviceAccount: '<SERVICE_ACCOUNT>'
12
12
  });
13
13
 
@@ -1,4 +1,4 @@
1
- import { Client, Migrations } from "@appwrite.io/console";
1
+ import { Client, Migrations, Resources } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const migrations = new Migrations(client);
8
8
 
9
9
  const result = await migrations.getNHostReport({
10
- resources: [],
10
+ resources: [Resources.User],
11
11
  subdomain: '<SUBDOMAIN>',
12
12
  region: '<REGION>',
13
13
  adminSecret: '<ADMIN_SECRET>',
@@ -1,4 +1,4 @@
1
- import { Client, Migrations } from "@appwrite.io/console";
1
+ import { Client, Migrations, Resources } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const migrations = new Migrations(client);
8
8
 
9
9
  const result = await migrations.getSupabaseReport({
10
- resources: [],
10
+ resources: [Resources.User],
11
11
  endpoint: 'https://example.com',
12
12
  apiKey: '<API_KEY>',
13
13
  databaseHost: '<DATABASE_HOST>',
@@ -0,0 +1,16 @@
1
+ import { Client, Organizations, Scopes } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.createKey({
10
+ organizationId: '<ORGANIZATION_ID>',
11
+ name: '<NAME>',
12
+ scopes: [Scopes.PlatformsRead],
13
+ expire: '' // optional
14
+ });
15
+
16
+ console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Organizations, BillingPlan, Platform } from "@appwrite.io/console";
1
+ import { Client, Organizations, Platform } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -9,7 +9,7 @@ const organizations = new Organizations(client);
9
9
  const result = await organizations.create({
10
10
  organizationId: '<ORGANIZATION_ID>',
11
11
  name: '<NAME>',
12
- billingPlan: BillingPlan.Tier0,
12
+ billingPlan: 'tier-0',
13
13
  paymentMethodId: '<PAYMENT_METHOD_ID>', // optional
14
14
  billingAddressId: '<BILLING_ADDRESS_ID>', // optional
15
15
  invites: [], // optional
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.deleteKey({
10
+ organizationId: '<ORGANIZATION_ID>',
11
+ keyId: '<KEY_ID>'
12
+ });
13
+
14
+ console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Organizations, BillingPlan, Platform } from "@appwrite.io/console";
1
+ import { Client, Organizations, Platform } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
7
7
  const organizations = new Organizations(client);
8
8
 
9
9
  const result = await organizations.estimationCreateOrganization({
10
- billingPlan: BillingPlan.Tier0,
10
+ billingPlan: 'tier-0',
11
11
  paymentMethodId: '<PAYMENT_METHOD_ID>', // optional
12
12
  invites: [], // optional
13
13
  couponId: '<COUPON_ID>', // optional
@@ -1,4 +1,4 @@
1
- import { Client, Organizations, BillingPlan } from "@appwrite.io/console";
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const organizations = new Organizations(client);
8
8
 
9
9
  const result = await organizations.estimationUpdatePlan({
10
10
  organizationId: '<ORGANIZATION_ID>',
11
- billingPlan: BillingPlan.Tier0,
11
+ billingPlan: 'tier-0',
12
12
  invites: [], // optional
13
13
  couponId: '<COUPON_ID>' // optional
14
14
  });
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.getKey({
10
+ organizationId: '<ORGANIZATION_ID>',
11
+ keyId: '<KEY_ID>'
12
+ });
13
+
14
+ console.log(result);
@@ -0,0 +1,14 @@
1
+ import { Client, Organizations } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const organizations = new Organizations(client);
8
+
9
+ const result = await organizations.listKeys({
10
+ organizationId: '<ORGANIZATION_ID>',
11
+ total: false // optional
12
+ });
13
+
14
+ console.log(result);