@appwrite.io/console 3.0.0 → 4.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.
- package/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +470 -83
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +471 -84
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +470 -83
- package/docs/examples/databases/list-documents.md +2 -1
- package/docs/examples/domains/create-purchase.md +25 -0
- package/docs/examples/domains/create-transfer-in.md +18 -0
- package/docs/examples/domains/create-transfer-out.md +16 -0
- package/docs/examples/domains/get-transfer-status.md +15 -0
- package/docs/examples/health/get-console-pausing.md +16 -0
- 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/get-scopes.md +2 -1
- package/docs/examples/projects/update-console-access.md +15 -0
- package/docs/examples/projects/update-status.md +16 -0
- package/docs/examples/sites/create-deployment.md +2 -2
- package/docs/examples/tablesdb/list-rows.md +2 -1
- package/package.json +1 -1
- package/src/channel.ts +19 -15
- package/src/client.ts +7 -2
- package/src/enums/appwrite-migration-resource.ts +21 -0
- package/src/enums/domain-transfer-status-status.ts +10 -0
- package/src/enums/firebase-migration-resource.ts +12 -0
- package/src/enums/{resources.ts → n-host-migration-resource.ts} +1 -1
- package/src/enums/status.ts +3 -0
- package/src/enums/supabase-migration-resource.ts +13 -0
- package/src/index.ts +6 -1
- package/src/models.ts +124 -3
- package/src/query.ts +26 -0
- package/src/services/account.ts +2 -2
- package/src/services/databases.ts +100 -93
- package/src/services/domains.ts +350 -0
- package/src/services/health.ts +61 -0
- package/src/services/messaging.ts +2 -2
- package/src/services/migrations.ts +68 -65
- package/src/services/organizations.ts +14 -6
- package/src/services/projects.ts +120 -0
- package/src/services/sites.ts +13 -16
- package/src/services/tables-db.ts +14 -7
- package/src/services/teams.ts +4 -4
- package/types/channel.d.ts +9 -9
- package/types/enums/appwrite-migration-resource.d.ts +21 -0
- package/types/enums/domain-transfer-status-status.d.ts +10 -0
- package/types/enums/firebase-migration-resource.d.ts +12 -0
- package/types/enums/{resources.d.ts → n-host-migration-resource.d.ts} +1 -1
- package/types/enums/status.d.ts +3 -0
- package/types/enums/supabase-migration-resource.d.ts +13 -0
- package/types/index.d.ts +6 -1
- package/types/models.d.ts +122 -3
- package/types/query.d.ts +22 -0
- package/types/services/databases.d.ts +40 -37
- package/types/services/domains.d.ts +118 -0
- package/types/services/health.d.ts +24 -0
- package/types/services/messaging.d.ts +2 -2
- package/types/services/migrations.d.ts +36 -33
- package/types/services/organizations.d.ts +4 -1
- package/types/services/projects.d.ts +46 -0
- package/types/services/sites.d.ts +4 -4
- package/types/services/tables-db.d.ts +4 -1
- 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,25 @@
|
|
|
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.createPurchase({
|
|
11
|
+
domain: '',
|
|
12
|
+
organizationId: '<ORGANIZATION_ID>',
|
|
13
|
+
firstName: '<FIRST_NAME>',
|
|
14
|
+
lastName: '<LAST_NAME>',
|
|
15
|
+
email: 'email@example.com',
|
|
16
|
+
phone: '+12065550100',
|
|
17
|
+
billingAddressId: '<BILLING_ADDRESS_ID>',
|
|
18
|
+
paymentMethodId: '<PAYMENT_METHOD_ID>',
|
|
19
|
+
addressLine3: '<ADDRESS_LINE3>', // optional
|
|
20
|
+
companyName: '<COMPANY_NAME>', // optional
|
|
21
|
+
periodYears: 1 // optional
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
console.log(result);
|
|
25
|
+
```
|
|
@@ -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
|
+
```
|
|
@@ -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,
|
|
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: [
|
|
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,
|
|
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: [
|
|
11
|
+
resources: [FirebaseMigrationResource.User],
|
|
12
12
|
serviceAccount: '<SERVICE_ACCOUNT>'
|
|
13
13
|
});
|
|
14
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
```javascript
|
|
2
|
-
import { Client, Migrations,
|
|
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: [
|
|
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,
|
|
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: [
|
|
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,
|
|
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: [
|
|
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,
|
|
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: [
|
|
11
|
+
resources: [FirebaseMigrationResource.User],
|
|
12
12
|
serviceAccount: '<SERVICE_ACCOUNT>'
|
|
13
13
|
});
|
|
14
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
```javascript
|
|
2
|
-
import { Client, Migrations,
|
|
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: [
|
|
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,
|
|
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: [
|
|
11
|
+
resources: [SupabaseMigrationResource.User],
|
|
12
12
|
endpoint: 'https://example.com',
|
|
13
13
|
apiKey: '<API_KEY>',
|
|
14
14
|
databaseHost: '<DATABASE_HOST>',
|
|
@@ -8,7 +8,8 @@ const client = new Client()
|
|
|
8
8
|
const organizations = new Organizations(client);
|
|
9
9
|
|
|
10
10
|
const result = await organizations.getScopes({
|
|
11
|
-
organizationId: '<ORGANIZATION_ID>'
|
|
11
|
+
organizationId: '<ORGANIZATION_ID>',
|
|
12
|
+
projectId: '<PROJECT_ID>' // optional
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
console.log(result);
|
|
@@ -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);
|
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": "
|
|
5
|
+
"version": "4.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
|
-
|
|
20
|
-
|
|
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
|
|
48
|
-
|
|
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
|
|
60
|
-
|
|
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
|
@@ -7,6 +7,8 @@ const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });
|
|
|
7
7
|
|
|
8
8
|
const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
|
|
9
9
|
const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
|
|
10
|
+
const MAX_INT64 = BigInt('9223372036854775807');
|
|
11
|
+
const MIN_INT64 = BigInt('-9223372036854775808');
|
|
10
12
|
|
|
11
13
|
function isBigNumber(value: any): boolean {
|
|
12
14
|
return value !== null
|
|
@@ -25,7 +27,10 @@ function reviver(_key: string, value: any): any {
|
|
|
25
27
|
if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
|
|
26
28
|
return Number(str);
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
if (bi >= MIN_INT64 && bi <= MAX_INT64) {
|
|
31
|
+
return bi;
|
|
32
|
+
}
|
|
33
|
+
return value.toNumber();
|
|
29
34
|
}
|
|
30
35
|
return value.toNumber();
|
|
31
36
|
}
|
|
@@ -395,7 +400,7 @@ class Client {
|
|
|
395
400
|
'x-sdk-name': 'Console',
|
|
396
401
|
'x-sdk-platform': 'console',
|
|
397
402
|
'x-sdk-language': 'web',
|
|
398
|
-
'x-sdk-version': '
|
|
403
|
+
'x-sdk-version': '4.0.0',
|
|
399
404
|
'X-Appwrite-Response-Format': '1.8.0',
|
|
400
405
|
};
|
|
401
406
|
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
Site = 'site',
|
|
19
|
+
Sitedeployment = 'site-deployment',
|
|
20
|
+
Sitevariable = 'site-variable',
|
|
21
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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 {
|
|
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,4 @@ 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 { DomainTransferStatusStatus } from './enums/domain-transfer-status-status';
|