@appwrite.io/console 0.1.1 → 0.3.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/.github/workflows/publish.yml +18 -0
- package/README.md +2 -2
- package/dist/cjs/sdk.js +2417 -630
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +2413 -631
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +2417 -630
- package/docs/examples/account/create-anonymous-session.md +1 -1
- package/docs/examples/account/create-email-session.md +1 -1
- package/docs/examples/account/create-j-w-t.md +1 -1
- package/docs/examples/account/create-magic-u-r-l-session.md +1 -1
- package/docs/examples/account/create-o-auth2session.md +1 -1
- package/docs/examples/account/create-phone-session.md +1 -1
- package/docs/examples/account/create-phone-verification.md +1 -1
- package/docs/examples/account/create-recovery.md +1 -1
- package/docs/examples/account/create-verification.md +1 -1
- package/docs/examples/account/create-with-invite-code.md +18 -0
- package/docs/examples/account/create.md +1 -1
- package/docs/examples/account/delete-identity.md +18 -0
- package/docs/examples/account/delete-session.md +1 -1
- package/docs/examples/account/delete-sessions.md +1 -1
- package/docs/examples/account/get-prefs.md +1 -1
- package/docs/examples/account/get-session.md +1 -1
- package/docs/examples/account/get.md +1 -1
- package/docs/examples/account/list-identities.md +18 -0
- package/docs/examples/account/list-logs.md +1 -1
- package/docs/examples/account/list-sessions.md +1 -1
- package/docs/examples/account/update-email.md +1 -1
- package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
- package/docs/examples/account/update-name.md +1 -1
- package/docs/examples/account/update-password.md +1 -1
- package/docs/examples/account/update-phone-session.md +1 -1
- package/docs/examples/account/update-phone-verification.md +1 -1
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/account/update-prefs.md +1 -1
- package/docs/examples/account/update-recovery.md +1 -1
- package/docs/examples/account/update-session.md +1 -1
- package/docs/examples/account/update-status.md +1 -1
- package/docs/examples/account/update-verification.md +1 -1
- package/docs/examples/assistant/chat.md +18 -0
- package/docs/examples/avatars/get-browser.md +1 -1
- package/docs/examples/avatars/get-credit-card.md +1 -1
- package/docs/examples/avatars/get-favicon.md +1 -1
- package/docs/examples/avatars/get-flag.md +1 -1
- package/docs/examples/avatars/get-image.md +1 -1
- package/docs/examples/avatars/get-initials.md +1 -1
- package/docs/examples/avatars/get-q-r.md +1 -1
- package/docs/examples/console/variables.md +1 -1
- package/docs/examples/databases/create-boolean-attribute.md +1 -1
- package/docs/examples/databases/create-collection.md +1 -1
- package/docs/examples/databases/create-datetime-attribute.md +1 -1
- package/docs/examples/databases/create-document.md +1 -1
- package/docs/examples/databases/create-email-attribute.md +1 -1
- package/docs/examples/databases/create-enum-attribute.md +1 -1
- package/docs/examples/databases/create-float-attribute.md +1 -1
- package/docs/examples/databases/create-index.md +1 -1
- package/docs/examples/databases/create-integer-attribute.md +1 -1
- package/docs/examples/databases/create-ip-attribute.md +1 -1
- package/docs/examples/databases/create-relationship-attribute.md +1 -1
- package/docs/examples/databases/create-string-attribute.md +1 -1
- package/docs/examples/databases/create-url-attribute.md +1 -1
- package/docs/examples/databases/create.md +1 -1
- package/docs/examples/databases/delete-attribute.md +1 -1
- package/docs/examples/databases/delete-collection.md +1 -1
- package/docs/examples/databases/delete-document.md +1 -1
- package/docs/examples/databases/delete-index.md +1 -1
- package/docs/examples/databases/delete.md +1 -1
- package/docs/examples/databases/get-attribute.md +1 -1
- package/docs/examples/databases/get-collection-usage.md +1 -1
- package/docs/examples/databases/get-collection.md +1 -1
- package/docs/examples/databases/get-database-usage.md +1 -1
- package/docs/examples/databases/get-document.md +1 -1
- package/docs/examples/databases/get-index.md +1 -1
- package/docs/examples/databases/get-usage.md +1 -1
- package/docs/examples/databases/get.md +1 -1
- package/docs/examples/databases/list-attributes.md +1 -1
- package/docs/examples/databases/list-collection-logs.md +1 -1
- package/docs/examples/databases/list-collections.md +1 -1
- package/docs/examples/databases/list-document-logs.md +1 -1
- package/docs/examples/databases/list-documents.md +1 -1
- package/docs/examples/databases/list-indexes.md +1 -1
- package/docs/examples/databases/list-logs.md +1 -1
- package/docs/examples/databases/list.md +1 -1
- package/docs/examples/databases/update-boolean-attribute.md +1 -1
- package/docs/examples/databases/update-collection.md +1 -1
- package/docs/examples/databases/update-datetime-attribute.md +1 -1
- package/docs/examples/databases/update-document.md +1 -1
- package/docs/examples/databases/update-email-attribute.md +1 -1
- package/docs/examples/databases/update-enum-attribute.md +1 -1
- package/docs/examples/databases/update-float-attribute.md +1 -1
- package/docs/examples/databases/update-integer-attribute.md +1 -1
- package/docs/examples/databases/update-ip-attribute.md +1 -1
- package/docs/examples/databases/update-relationship-attribute.md +1 -1
- package/docs/examples/databases/update-string-attribute.md +1 -1
- package/docs/examples/databases/update-url-attribute.md +1 -1
- package/docs/examples/databases/update.md +1 -1
- package/docs/examples/functions/create-build.md +1 -1
- package/docs/examples/functions/create-deployment.md +2 -2
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/functions/create-variable.md +1 -1
- package/docs/examples/functions/create.md +1 -1
- package/docs/examples/functions/delete-deployment.md +1 -1
- package/docs/examples/functions/delete-variable.md +1 -1
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/download-deployment.md +14 -0
- package/docs/examples/functions/get-deployment.md +1 -1
- package/docs/examples/functions/get-execution.md +1 -1
- package/docs/examples/functions/get-function-usage.md +1 -1
- package/docs/examples/functions/get-usage.md +1 -1
- package/docs/examples/functions/get-variable.md +1 -1
- package/docs/examples/functions/get.md +1 -1
- package/docs/examples/functions/list-deployments.md +1 -1
- package/docs/examples/functions/list-executions.md +1 -1
- package/docs/examples/functions/list-runtimes.md +1 -1
- package/docs/examples/functions/list-variables.md +1 -1
- package/docs/examples/functions/list.md +1 -1
- package/docs/examples/functions/update-deployment.md +1 -1
- package/docs/examples/functions/update-variable.md +1 -1
- package/docs/examples/functions/update.md +2 -2
- package/docs/examples/graphql/mutation.md +1 -1
- package/docs/examples/graphql/query.md +1 -1
- package/docs/examples/health/get-antivirus.md +1 -1
- package/docs/examples/health/get-cache.md +1 -1
- package/docs/examples/health/get-d-b.md +1 -1
- package/docs/examples/health/get-pub-sub.md +18 -0
- package/docs/examples/health/get-queue-certificates.md +1 -1
- package/docs/examples/health/get-queue-functions.md +1 -1
- package/docs/examples/health/get-queue-logs.md +1 -1
- package/docs/examples/health/get-queue-webhooks.md +1 -1
- package/docs/examples/health/get-queue.md +18 -0
- package/docs/examples/health/get-storage-local.md +1 -1
- package/docs/examples/health/get-time.md +1 -1
- package/docs/examples/health/get.md +1 -1
- package/docs/examples/locale/get.md +1 -1
- package/docs/examples/locale/list-codes.md +18 -0
- package/docs/examples/locale/list-continents.md +1 -1
- package/docs/examples/locale/list-countries-e-u.md +1 -1
- package/docs/examples/locale/list-countries-phones.md +1 -1
- package/docs/examples/locale/list-countries.md +1 -1
- package/docs/examples/locale/list-currencies.md +1 -1
- package/docs/examples/locale/list-languages.md +1 -1
- package/docs/examples/migrations/create-appwrite-migration.md +18 -0
- package/docs/examples/migrations/create-firebase-migration.md +18 -0
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +18 -0
- package/docs/examples/migrations/create-n-host-migration.md +18 -0
- package/docs/examples/migrations/create-supabase-migration.md +18 -0
- package/docs/examples/migrations/delete-firebase-auth.md +18 -0
- package/docs/examples/migrations/delete.md +18 -0
- package/docs/examples/migrations/get-appwrite-report.md +18 -0
- package/docs/examples/migrations/get-firebase-report-o-auth.md +18 -0
- package/docs/examples/migrations/get-firebase-report.md +18 -0
- package/docs/examples/migrations/get-n-host-report.md +18 -0
- package/docs/examples/migrations/get-supabase-report.md +18 -0
- package/docs/examples/migrations/get.md +18 -0
- package/docs/examples/migrations/list-firebase-projects.md +18 -0
- package/docs/examples/migrations/list.md +18 -0
- package/docs/examples/migrations/retry.md +18 -0
- package/docs/examples/project/create-variable.md +18 -0
- package/docs/examples/project/delete-variable.md +18 -0
- package/docs/examples/project/get-usage.md +18 -0
- package/docs/examples/project/get-variable.md +18 -0
- package/docs/examples/project/list-variables.md +18 -0
- package/docs/examples/project/update-variable.md +18 -0
- package/docs/examples/projects/create-key.md +1 -1
- package/docs/examples/projects/create-platform.md +1 -1
- package/docs/examples/projects/create-webhook.md +1 -1
- package/docs/examples/projects/create.md +2 -2
- package/docs/examples/projects/delete-email-template.md +18 -0
- package/docs/examples/projects/delete-key.md +1 -1
- package/docs/examples/projects/delete-platform.md +1 -1
- package/docs/examples/projects/delete-sms-template.md +18 -0
- package/docs/examples/projects/delete-webhook.md +1 -1
- package/docs/examples/projects/delete.md +2 -2
- package/docs/examples/projects/get-email-template.md +18 -0
- package/docs/examples/projects/get-key.md +1 -1
- package/docs/examples/projects/get-platform.md +1 -1
- package/docs/examples/projects/get-sms-template.md +18 -0
- package/docs/examples/projects/get-usage.md +1 -1
- package/docs/examples/projects/get-webhook.md +1 -1
- package/docs/examples/projects/get.md +1 -1
- package/docs/examples/projects/list-keys.md +1 -1
- package/docs/examples/projects/list-platforms.md +1 -1
- package/docs/examples/projects/list-webhooks.md +1 -1
- package/docs/examples/projects/list.md +1 -1
- package/docs/examples/projects/update-auth-duration.md +1 -1
- package/docs/examples/projects/update-auth-limit.md +1 -1
- package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
- package/docs/examples/projects/update-auth-password-history.md +1 -1
- package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
- package/docs/examples/projects/update-auth-status.md +1 -1
- package/docs/examples/projects/update-email-template.md +18 -0
- package/docs/examples/projects/update-key.md +1 -1
- package/docs/examples/projects/update-o-auth2.md +1 -1
- package/docs/examples/projects/{delete-domain.md → update-personal-data-check.md} +2 -2
- package/docs/examples/projects/update-platform.md +1 -1
- package/docs/examples/projects/{create-domain.md → update-service-status-all.md} +2 -2
- package/docs/examples/projects/update-service-status.md +1 -1
- package/docs/examples/projects/update-sms-template.md +18 -0
- package/docs/examples/projects/{get-domain.md → update-smtp-configuration.md} +2 -2
- package/docs/examples/projects/{list-domains.md → update-team.md} +2 -2
- package/docs/examples/projects/update-webhook-signature.md +1 -1
- package/docs/examples/projects/update-webhook.md +1 -1
- package/docs/examples/projects/update.md +1 -1
- package/docs/examples/proxy/create-rule.md +18 -0
- package/docs/examples/proxy/delete-rule.md +18 -0
- package/docs/examples/proxy/get-rule.md +18 -0
- package/docs/examples/proxy/list-rules.md +18 -0
- package/docs/examples/proxy/update-rule-verification.md +18 -0
- package/docs/examples/storage/create-bucket.md +1 -1
- package/docs/examples/storage/create-file.md +1 -1
- package/docs/examples/storage/delete-bucket.md +1 -1
- package/docs/examples/storage/delete-file.md +1 -1
- package/docs/examples/storage/get-bucket-usage.md +1 -1
- package/docs/examples/storage/get-bucket.md +1 -1
- package/docs/examples/storage/get-file-download.md +1 -1
- package/docs/examples/storage/get-file-preview.md +1 -1
- package/docs/examples/storage/get-file-view.md +1 -1
- package/docs/examples/storage/get-file.md +1 -1
- package/docs/examples/storage/get-usage.md +1 -1
- package/docs/examples/storage/list-buckets.md +1 -1
- package/docs/examples/storage/list-files.md +1 -1
- package/docs/examples/storage/update-bucket.md +1 -1
- package/docs/examples/storage/update-file.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/docs/examples/teams/create.md +1 -1
- package/docs/examples/teams/delete-membership.md +1 -1
- package/docs/examples/teams/delete.md +1 -1
- package/docs/examples/teams/get-membership.md +1 -1
- package/docs/examples/teams/get-prefs.md +1 -1
- package/docs/examples/teams/get.md +1 -1
- package/docs/examples/teams/list-logs.md +1 -1
- package/docs/examples/teams/list-memberships.md +1 -1
- package/docs/examples/teams/list.md +1 -1
- package/docs/examples/teams/update-membership-status.md +1 -1
- package/docs/examples/teams/{update-membership-roles.md → update-membership.md} +2 -2
- package/docs/examples/teams/update-name.md +1 -1
- package/docs/examples/teams/update-prefs.md +1 -1
- package/docs/examples/users/create-argon2user.md +1 -1
- package/docs/examples/users/create-bcrypt-user.md +1 -1
- package/docs/examples/users/create-m-d5user.md +1 -1
- package/docs/examples/users/create-p-h-pass-user.md +1 -1
- package/docs/examples/users/create-s-h-a-user.md +1 -1
- package/docs/examples/users/create-scrypt-modified-user.md +1 -1
- package/docs/examples/users/create-scrypt-user.md +1 -1
- package/docs/examples/users/create.md +1 -1
- package/docs/examples/users/delete-identity.md +18 -0
- package/docs/examples/users/delete-session.md +1 -1
- package/docs/examples/users/delete-sessions.md +1 -1
- package/docs/examples/users/delete.md +1 -1
- package/docs/examples/users/get-prefs.md +1 -1
- package/docs/examples/users/get-usage.md +1 -1
- package/docs/examples/users/get.md +1 -1
- package/docs/examples/users/list-identities.md +18 -0
- package/docs/examples/users/list-logs.md +1 -1
- package/docs/examples/users/list-memberships.md +1 -1
- package/docs/examples/users/list-sessions.md +1 -1
- package/docs/examples/users/list.md +1 -1
- package/docs/examples/users/update-email-verification.md +1 -1
- package/docs/examples/users/update-email.md +1 -1
- package/docs/examples/users/update-labels.md +18 -0
- package/docs/examples/users/update-name.md +1 -1
- package/docs/examples/users/update-password.md +1 -1
- package/docs/examples/users/update-phone-verification.md +1 -1
- package/docs/examples/users/update-phone.md +1 -1
- package/docs/examples/users/update-prefs.md +1 -1
- package/docs/examples/users/update-status.md +1 -1
- package/docs/examples/vcs/create-repository-detection.md +18 -0
- package/docs/examples/vcs/create-repository.md +18 -0
- package/docs/examples/vcs/delete-installation.md +18 -0
- package/docs/examples/vcs/get-installation.md +18 -0
- package/docs/examples/vcs/get-repository.md +18 -0
- package/docs/examples/vcs/list-installations.md +18 -0
- package/docs/examples/vcs/list-repositories.md +18 -0
- package/docs/examples/vcs/list-repository-branches.md +18 -0
- package/docs/examples/vcs/update-external-deployments.md +18 -0
- package/package.json +1 -1
- package/src/client.ts +2 -2
- package/src/index.ts +5 -0
- package/src/models.ts +750 -78
- package/src/services/account.ts +1102 -995
- package/src/services/assistant.ts +38 -0
- package/src/services/avatars.ts +337 -337
- package/src/services/console.ts +16 -16
- package/src/services/databases.ts +2170 -2140
- package/src/services/functions.ts +808 -652
- package/src/services/graphql.ts +47 -47
- package/src/services/health.ts +226 -189
- package/src/services/locale.ts +156 -137
- package/src/services/migrations.ts +707 -0
- package/src/services/project.ts +174 -0
- package/src/services/projects.ts +1538 -1283
- package/src/services/proxy.ts +150 -0
- package/src/services/storage.ts +576 -571
- package/src/services/teams.ts +502 -501
- package/src/services/users.ts +1094 -1006
- package/src/services/vcs.ts +272 -0
- package/types/index.d.ts +5 -0
- package/types/models.d.ts +750 -78
- package/types/services/account.d.ts +80 -40
- package/types/services/assistant.d.ts +14 -0
- package/types/services/avatars.d.ts +7 -7
- package/types/services/console.d.ts +1 -1
- package/types/services/databases.d.ts +60 -54
- package/types/services/functions.d.ts +66 -31
- package/types/services/graphql.d.ts +2 -2
- package/types/services/health.d.ts +31 -12
- package/types/services/locale.d.ts +17 -7
- package/types/services/migrations.d.ts +185 -0
- package/types/services/project.d.ts +70 -0
- package/types/services/projects.d.ts +150 -80
- package/types/services/proxy.d.ts +59 -0
- package/types/services/storage.d.ts +17 -16
- package/types/services/teams.d.ts +17 -16
- package/types/services/users.d.ts +63 -26
- package/types/services/vcs.d.ts +97 -0
- package/.travis.yml +0 -32
- package/docs/examples/projects/update-domain-verification.md +0 -18
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { AppwriteException, Client } from '../client';
|
|
3
|
+
import type { Models } from '../models';
|
|
4
|
+
import type { UploadProgress, Payload } from '../client';
|
|
5
|
+
|
|
6
|
+
export class Migrations extends Service {
|
|
7
|
+
|
|
8
|
+
constructor(client: Client)
|
|
9
|
+
{
|
|
10
|
+
super(client);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* List Migrations
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
* @param {string} queries
|
|
18
|
+
* @param {string} search
|
|
19
|
+
* @throws {AppwriteException}
|
|
20
|
+
* @returns {Promise}
|
|
21
|
+
*/
|
|
22
|
+
async list(queries?: string, search?: string): Promise<Models.MigrationList> {
|
|
23
|
+
let path = '/migrations';
|
|
24
|
+
let payload: Payload = {};
|
|
25
|
+
|
|
26
|
+
if (typeof queries !== 'undefined') {
|
|
27
|
+
payload['queries'] = queries;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (typeof search !== 'undefined') {
|
|
31
|
+
payload['search'] = search;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
35
|
+
return await this.client.call('get', uri, {
|
|
36
|
+
'content-type': 'application/json',
|
|
37
|
+
}, payload);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Migrate Appwrite Data
|
|
42
|
+
*
|
|
43
|
+
*
|
|
44
|
+
* @param {string[]} resources
|
|
45
|
+
* @param {string} endpoint
|
|
46
|
+
* @param {string} projectId
|
|
47
|
+
* @param {string} apiKey
|
|
48
|
+
* @throws {AppwriteException}
|
|
49
|
+
* @returns {Promise}
|
|
50
|
+
*/
|
|
51
|
+
async createAppwriteMigration(resources: string[], endpoint: string, projectId: string, apiKey: string): Promise<Models.Migration> {
|
|
52
|
+
if (typeof resources === 'undefined') {
|
|
53
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (typeof endpoint === 'undefined') {
|
|
57
|
+
throw new AppwriteException('Missing required parameter: "endpoint"');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (typeof projectId === 'undefined') {
|
|
61
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (typeof apiKey === 'undefined') {
|
|
65
|
+
throw new AppwriteException('Missing required parameter: "apiKey"');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let path = '/migrations/appwrite';
|
|
69
|
+
let payload: Payload = {};
|
|
70
|
+
|
|
71
|
+
if (typeof resources !== 'undefined') {
|
|
72
|
+
payload['resources'] = resources;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (typeof endpoint !== 'undefined') {
|
|
76
|
+
payload['endpoint'] = endpoint;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (typeof projectId !== 'undefined') {
|
|
80
|
+
payload['projectId'] = projectId;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (typeof apiKey !== 'undefined') {
|
|
84
|
+
payload['apiKey'] = apiKey;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
88
|
+
return await this.client.call('post', uri, {
|
|
89
|
+
'content-type': 'application/json',
|
|
90
|
+
}, payload);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Generate a report on Appwrite Data
|
|
95
|
+
*
|
|
96
|
+
*
|
|
97
|
+
* @param {string[]} resources
|
|
98
|
+
* @param {string} endpoint
|
|
99
|
+
* @param {string} projectID
|
|
100
|
+
* @param {string} key
|
|
101
|
+
* @throws {AppwriteException}
|
|
102
|
+
* @returns {Promise}
|
|
103
|
+
*/
|
|
104
|
+
async getAppwriteReport(resources: string[], endpoint: string, projectID: string, key: string): Promise<Models.MigrationReport> {
|
|
105
|
+
if (typeof resources === 'undefined') {
|
|
106
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (typeof endpoint === 'undefined') {
|
|
110
|
+
throw new AppwriteException('Missing required parameter: "endpoint"');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (typeof projectID === 'undefined') {
|
|
114
|
+
throw new AppwriteException('Missing required parameter: "projectID"');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (typeof key === 'undefined') {
|
|
118
|
+
throw new AppwriteException('Missing required parameter: "key"');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let path = '/migrations/appwrite/report';
|
|
122
|
+
let payload: Payload = {};
|
|
123
|
+
|
|
124
|
+
if (typeof resources !== 'undefined') {
|
|
125
|
+
payload['resources'] = resources;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (typeof endpoint !== 'undefined') {
|
|
129
|
+
payload['endpoint'] = endpoint;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (typeof projectID !== 'undefined') {
|
|
133
|
+
payload['projectID'] = projectID;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (typeof key !== 'undefined') {
|
|
137
|
+
payload['key'] = key;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
141
|
+
return await this.client.call('get', uri, {
|
|
142
|
+
'content-type': 'application/json',
|
|
143
|
+
}, payload);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Migrate Firebase Data (Service Account)
|
|
148
|
+
*
|
|
149
|
+
*
|
|
150
|
+
* @param {string[]} resources
|
|
151
|
+
* @param {string} serviceAccount
|
|
152
|
+
* @throws {AppwriteException}
|
|
153
|
+
* @returns {Promise}
|
|
154
|
+
*/
|
|
155
|
+
async createFirebaseMigration(resources: string[], serviceAccount: string): Promise<Models.Migration> {
|
|
156
|
+
if (typeof resources === 'undefined') {
|
|
157
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (typeof serviceAccount === 'undefined') {
|
|
161
|
+
throw new AppwriteException('Missing required parameter: "serviceAccount"');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
let path = '/migrations/firebase';
|
|
165
|
+
let payload: Payload = {};
|
|
166
|
+
|
|
167
|
+
if (typeof resources !== 'undefined') {
|
|
168
|
+
payload['resources'] = resources;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (typeof serviceAccount !== 'undefined') {
|
|
172
|
+
payload['serviceAccount'] = serviceAccount;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
176
|
+
return await this.client.call('post', uri, {
|
|
177
|
+
'content-type': 'application/json',
|
|
178
|
+
}, payload);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Revoke Appwrite's authorization to access Firebase Projects
|
|
183
|
+
*
|
|
184
|
+
*
|
|
185
|
+
* @throws {AppwriteException}
|
|
186
|
+
* @returns {Promise}
|
|
187
|
+
*/
|
|
188
|
+
async deleteFirebaseAuth(): Promise<{}> {
|
|
189
|
+
let path = '/migrations/firebase/deauthorize';
|
|
190
|
+
let payload: Payload = {};
|
|
191
|
+
|
|
192
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
193
|
+
return await this.client.call('get', uri, {
|
|
194
|
+
'content-type': 'application/json',
|
|
195
|
+
}, payload);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Migrate Firebase Data (OAuth)
|
|
200
|
+
*
|
|
201
|
+
*
|
|
202
|
+
* @param {string[]} resources
|
|
203
|
+
* @param {string} projectId
|
|
204
|
+
* @throws {AppwriteException}
|
|
205
|
+
* @returns {Promise}
|
|
206
|
+
*/
|
|
207
|
+
async createFirebaseOAuthMigration(resources: string[], projectId: string): Promise<Models.Migration> {
|
|
208
|
+
if (typeof resources === 'undefined') {
|
|
209
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (typeof projectId === 'undefined') {
|
|
213
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
let path = '/migrations/firebase/oauth';
|
|
217
|
+
let payload: Payload = {};
|
|
218
|
+
|
|
219
|
+
if (typeof resources !== 'undefined') {
|
|
220
|
+
payload['resources'] = resources;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (typeof projectId !== 'undefined') {
|
|
224
|
+
payload['projectId'] = projectId;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
228
|
+
return await this.client.call('post', uri, {
|
|
229
|
+
'content-type': 'application/json',
|
|
230
|
+
}, payload);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* List Firebase Projects
|
|
235
|
+
*
|
|
236
|
+
*
|
|
237
|
+
* @throws {AppwriteException}
|
|
238
|
+
* @returns {Promise}
|
|
239
|
+
*/
|
|
240
|
+
async listFirebaseProjects(): Promise<Models.FirebaseProjectList> {
|
|
241
|
+
let path = '/migrations/firebase/projects';
|
|
242
|
+
let payload: Payload = {};
|
|
243
|
+
|
|
244
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
245
|
+
return await this.client.call('get', uri, {
|
|
246
|
+
'content-type': 'application/json',
|
|
247
|
+
}, payload);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Generate a report on Firebase Data
|
|
252
|
+
*
|
|
253
|
+
*
|
|
254
|
+
* @param {string[]} resources
|
|
255
|
+
* @param {string} serviceAccount
|
|
256
|
+
* @throws {AppwriteException}
|
|
257
|
+
* @returns {Promise}
|
|
258
|
+
*/
|
|
259
|
+
async getFirebaseReport(resources: string[], serviceAccount: string): Promise<Models.MigrationReport> {
|
|
260
|
+
if (typeof resources === 'undefined') {
|
|
261
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (typeof serviceAccount === 'undefined') {
|
|
265
|
+
throw new AppwriteException('Missing required parameter: "serviceAccount"');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
let path = '/migrations/firebase/report';
|
|
269
|
+
let payload: Payload = {};
|
|
270
|
+
|
|
271
|
+
if (typeof resources !== 'undefined') {
|
|
272
|
+
payload['resources'] = resources;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (typeof serviceAccount !== 'undefined') {
|
|
276
|
+
payload['serviceAccount'] = serviceAccount;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
280
|
+
return await this.client.call('get', uri, {
|
|
281
|
+
'content-type': 'application/json',
|
|
282
|
+
}, payload);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Generate a report on Firebase Data using OAuth
|
|
287
|
+
*
|
|
288
|
+
*
|
|
289
|
+
* @param {string[]} resources
|
|
290
|
+
* @param {string} projectId
|
|
291
|
+
* @throws {AppwriteException}
|
|
292
|
+
* @returns {Promise}
|
|
293
|
+
*/
|
|
294
|
+
async getFirebaseReportOAuth(resources: string[], projectId: string): Promise<Models.MigrationReport> {
|
|
295
|
+
if (typeof resources === 'undefined') {
|
|
296
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (typeof projectId === 'undefined') {
|
|
300
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
let path = '/migrations/firebase/report/oauth';
|
|
304
|
+
let payload: Payload = {};
|
|
305
|
+
|
|
306
|
+
if (typeof resources !== 'undefined') {
|
|
307
|
+
payload['resources'] = resources;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (typeof projectId !== 'undefined') {
|
|
311
|
+
payload['projectId'] = projectId;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
315
|
+
return await this.client.call('get', uri, {
|
|
316
|
+
'content-type': 'application/json',
|
|
317
|
+
}, payload);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Migrate NHost Data
|
|
322
|
+
*
|
|
323
|
+
*
|
|
324
|
+
* @param {string[]} resources
|
|
325
|
+
* @param {string} subdomain
|
|
326
|
+
* @param {string} region
|
|
327
|
+
* @param {string} adminSecret
|
|
328
|
+
* @param {string} database
|
|
329
|
+
* @param {string} username
|
|
330
|
+
* @param {string} password
|
|
331
|
+
* @param {number} port
|
|
332
|
+
* @throws {AppwriteException}
|
|
333
|
+
* @returns {Promise}
|
|
334
|
+
*/
|
|
335
|
+
async createNHostMigration(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.Migration> {
|
|
336
|
+
if (typeof resources === 'undefined') {
|
|
337
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (typeof subdomain === 'undefined') {
|
|
341
|
+
throw new AppwriteException('Missing required parameter: "subdomain"');
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (typeof region === 'undefined') {
|
|
345
|
+
throw new AppwriteException('Missing required parameter: "region"');
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (typeof adminSecret === 'undefined') {
|
|
349
|
+
throw new AppwriteException('Missing required parameter: "adminSecret"');
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (typeof database === 'undefined') {
|
|
353
|
+
throw new AppwriteException('Missing required parameter: "database"');
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
if (typeof username === 'undefined') {
|
|
357
|
+
throw new AppwriteException('Missing required parameter: "username"');
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (typeof password === 'undefined') {
|
|
361
|
+
throw new AppwriteException('Missing required parameter: "password"');
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
let path = '/migrations/nhost';
|
|
365
|
+
let payload: Payload = {};
|
|
366
|
+
|
|
367
|
+
if (typeof resources !== 'undefined') {
|
|
368
|
+
payload['resources'] = resources;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if (typeof subdomain !== 'undefined') {
|
|
372
|
+
payload['subdomain'] = subdomain;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (typeof region !== 'undefined') {
|
|
376
|
+
payload['region'] = region;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
if (typeof adminSecret !== 'undefined') {
|
|
380
|
+
payload['adminSecret'] = adminSecret;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (typeof database !== 'undefined') {
|
|
384
|
+
payload['database'] = database;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (typeof username !== 'undefined') {
|
|
388
|
+
payload['username'] = username;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (typeof password !== 'undefined') {
|
|
392
|
+
payload['password'] = password;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
if (typeof port !== 'undefined') {
|
|
396
|
+
payload['port'] = port;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
400
|
+
return await this.client.call('post', uri, {
|
|
401
|
+
'content-type': 'application/json',
|
|
402
|
+
}, payload);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Generate a report on NHost Data
|
|
407
|
+
*
|
|
408
|
+
*
|
|
409
|
+
* @param {string[]} resources
|
|
410
|
+
* @param {string} subdomain
|
|
411
|
+
* @param {string} region
|
|
412
|
+
* @param {string} adminSecret
|
|
413
|
+
* @param {string} database
|
|
414
|
+
* @param {string} username
|
|
415
|
+
* @param {string} password
|
|
416
|
+
* @param {number} port
|
|
417
|
+
* @throws {AppwriteException}
|
|
418
|
+
* @returns {Promise}
|
|
419
|
+
*/
|
|
420
|
+
async getNHostReport(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.MigrationReport> {
|
|
421
|
+
if (typeof resources === 'undefined') {
|
|
422
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if (typeof subdomain === 'undefined') {
|
|
426
|
+
throw new AppwriteException('Missing required parameter: "subdomain"');
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (typeof region === 'undefined') {
|
|
430
|
+
throw new AppwriteException('Missing required parameter: "region"');
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
if (typeof adminSecret === 'undefined') {
|
|
434
|
+
throw new AppwriteException('Missing required parameter: "adminSecret"');
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (typeof database === 'undefined') {
|
|
438
|
+
throw new AppwriteException('Missing required parameter: "database"');
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (typeof username === 'undefined') {
|
|
442
|
+
throw new AppwriteException('Missing required parameter: "username"');
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (typeof password === 'undefined') {
|
|
446
|
+
throw new AppwriteException('Missing required parameter: "password"');
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
let path = '/migrations/nhost/report';
|
|
450
|
+
let payload: Payload = {};
|
|
451
|
+
|
|
452
|
+
if (typeof resources !== 'undefined') {
|
|
453
|
+
payload['resources'] = resources;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
if (typeof subdomain !== 'undefined') {
|
|
457
|
+
payload['subdomain'] = subdomain;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
if (typeof region !== 'undefined') {
|
|
461
|
+
payload['region'] = region;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if (typeof adminSecret !== 'undefined') {
|
|
465
|
+
payload['adminSecret'] = adminSecret;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
if (typeof database !== 'undefined') {
|
|
469
|
+
payload['database'] = database;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (typeof username !== 'undefined') {
|
|
473
|
+
payload['username'] = username;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (typeof password !== 'undefined') {
|
|
477
|
+
payload['password'] = password;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (typeof port !== 'undefined') {
|
|
481
|
+
payload['port'] = port;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
485
|
+
return await this.client.call('get', uri, {
|
|
486
|
+
'content-type': 'application/json',
|
|
487
|
+
}, payload);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Migrate Supabase Data
|
|
492
|
+
*
|
|
493
|
+
*
|
|
494
|
+
* @param {string[]} resources
|
|
495
|
+
* @param {string} endpoint
|
|
496
|
+
* @param {string} apiKey
|
|
497
|
+
* @param {string} databaseHost
|
|
498
|
+
* @param {string} username
|
|
499
|
+
* @param {string} password
|
|
500
|
+
* @param {number} port
|
|
501
|
+
* @throws {AppwriteException}
|
|
502
|
+
* @returns {Promise}
|
|
503
|
+
*/
|
|
504
|
+
async createSupabaseMigration(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.Migration> {
|
|
505
|
+
if (typeof resources === 'undefined') {
|
|
506
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (typeof endpoint === 'undefined') {
|
|
510
|
+
throw new AppwriteException('Missing required parameter: "endpoint"');
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
if (typeof apiKey === 'undefined') {
|
|
514
|
+
throw new AppwriteException('Missing required parameter: "apiKey"');
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (typeof databaseHost === 'undefined') {
|
|
518
|
+
throw new AppwriteException('Missing required parameter: "databaseHost"');
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
if (typeof username === 'undefined') {
|
|
522
|
+
throw new AppwriteException('Missing required parameter: "username"');
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
if (typeof password === 'undefined') {
|
|
526
|
+
throw new AppwriteException('Missing required parameter: "password"');
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
let path = '/migrations/supabase';
|
|
530
|
+
let payload: Payload = {};
|
|
531
|
+
|
|
532
|
+
if (typeof resources !== 'undefined') {
|
|
533
|
+
payload['resources'] = resources;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
if (typeof endpoint !== 'undefined') {
|
|
537
|
+
payload['endpoint'] = endpoint;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
if (typeof apiKey !== 'undefined') {
|
|
541
|
+
payload['apiKey'] = apiKey;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
if (typeof databaseHost !== 'undefined') {
|
|
545
|
+
payload['databaseHost'] = databaseHost;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
if (typeof username !== 'undefined') {
|
|
549
|
+
payload['username'] = username;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
if (typeof password !== 'undefined') {
|
|
553
|
+
payload['password'] = password;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (typeof port !== 'undefined') {
|
|
557
|
+
payload['port'] = port;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
561
|
+
return await this.client.call('post', uri, {
|
|
562
|
+
'content-type': 'application/json',
|
|
563
|
+
}, payload);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Generate a report on Supabase Data
|
|
568
|
+
*
|
|
569
|
+
*
|
|
570
|
+
* @param {string[]} resources
|
|
571
|
+
* @param {string} endpoint
|
|
572
|
+
* @param {string} apiKey
|
|
573
|
+
* @param {string} databaseHost
|
|
574
|
+
* @param {string} username
|
|
575
|
+
* @param {string} password
|
|
576
|
+
* @param {number} port
|
|
577
|
+
* @throws {AppwriteException}
|
|
578
|
+
* @returns {Promise}
|
|
579
|
+
*/
|
|
580
|
+
async getSupabaseReport(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.MigrationReport> {
|
|
581
|
+
if (typeof resources === 'undefined') {
|
|
582
|
+
throw new AppwriteException('Missing required parameter: "resources"');
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
if (typeof endpoint === 'undefined') {
|
|
586
|
+
throw new AppwriteException('Missing required parameter: "endpoint"');
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
if (typeof apiKey === 'undefined') {
|
|
590
|
+
throw new AppwriteException('Missing required parameter: "apiKey"');
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
if (typeof databaseHost === 'undefined') {
|
|
594
|
+
throw new AppwriteException('Missing required parameter: "databaseHost"');
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
if (typeof username === 'undefined') {
|
|
598
|
+
throw new AppwriteException('Missing required parameter: "username"');
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
if (typeof password === 'undefined') {
|
|
602
|
+
throw new AppwriteException('Missing required parameter: "password"');
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
let path = '/migrations/supabase/report';
|
|
606
|
+
let payload: Payload = {};
|
|
607
|
+
|
|
608
|
+
if (typeof resources !== 'undefined') {
|
|
609
|
+
payload['resources'] = resources;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
if (typeof endpoint !== 'undefined') {
|
|
613
|
+
payload['endpoint'] = endpoint;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
if (typeof apiKey !== 'undefined') {
|
|
617
|
+
payload['apiKey'] = apiKey;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
if (typeof databaseHost !== 'undefined') {
|
|
621
|
+
payload['databaseHost'] = databaseHost;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
if (typeof username !== 'undefined') {
|
|
625
|
+
payload['username'] = username;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if (typeof password !== 'undefined') {
|
|
629
|
+
payload['password'] = password;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
if (typeof port !== 'undefined') {
|
|
633
|
+
payload['port'] = port;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
637
|
+
return await this.client.call('get', uri, {
|
|
638
|
+
'content-type': 'application/json',
|
|
639
|
+
}, payload);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Get Migration
|
|
644
|
+
*
|
|
645
|
+
*
|
|
646
|
+
* @param {string} migrationId
|
|
647
|
+
* @throws {AppwriteException}
|
|
648
|
+
* @returns {Promise}
|
|
649
|
+
*/
|
|
650
|
+
async get(migrationId: string): Promise<Models.Migration> {
|
|
651
|
+
if (typeof migrationId === 'undefined') {
|
|
652
|
+
throw new AppwriteException('Missing required parameter: "migrationId"');
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
let path = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
|
|
656
|
+
let payload: Payload = {};
|
|
657
|
+
|
|
658
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
659
|
+
return await this.client.call('get', uri, {
|
|
660
|
+
'content-type': 'application/json',
|
|
661
|
+
}, payload);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Retry Migration
|
|
666
|
+
*
|
|
667
|
+
*
|
|
668
|
+
* @param {string} migrationId
|
|
669
|
+
* @throws {AppwriteException}
|
|
670
|
+
* @returns {Promise}
|
|
671
|
+
*/
|
|
672
|
+
async retry(migrationId: string): Promise<Models.Migration> {
|
|
673
|
+
if (typeof migrationId === 'undefined') {
|
|
674
|
+
throw new AppwriteException('Missing required parameter: "migrationId"');
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
let path = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
|
|
678
|
+
let payload: Payload = {};
|
|
679
|
+
|
|
680
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
681
|
+
return await this.client.call('patch', uri, {
|
|
682
|
+
'content-type': 'application/json',
|
|
683
|
+
}, payload);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Delete Migration
|
|
688
|
+
*
|
|
689
|
+
*
|
|
690
|
+
* @param {string} migrationId
|
|
691
|
+
* @throws {AppwriteException}
|
|
692
|
+
* @returns {Promise}
|
|
693
|
+
*/
|
|
694
|
+
async delete(migrationId: string): Promise<{}> {
|
|
695
|
+
if (typeof migrationId === 'undefined') {
|
|
696
|
+
throw new AppwriteException('Missing required parameter: "migrationId"');
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
let path = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
|
|
700
|
+
let payload: Payload = {};
|
|
701
|
+
|
|
702
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
703
|
+
return await this.client.call('delete', uri, {
|
|
704
|
+
'content-type': 'application/json',
|
|
705
|
+
}, payload);
|
|
706
|
+
}
|
|
707
|
+
};
|