@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
|
@@ -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.
|
|
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.
|
|
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: [
|
|
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.
|
|
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
|
});
|
|
@@ -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);
|
|
@@ -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,
|
|
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:
|
|
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,
|
|
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:
|
|
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
|
|
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:
|
|
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);
|