appwrite-cli 2.0.2 → 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.
Files changed (106) hide show
  1. package/README.md +11 -6
  2. package/docs/examples/account/delete-identity.md +2 -0
  3. package/docs/examples/account/list-identities.md +2 -0
  4. package/docs/examples/assistant/chat.md +2 -0
  5. package/docs/examples/databases/create-collection.md +1 -0
  6. package/docs/examples/databases/create-string-attribute.md +1 -0
  7. package/docs/examples/databases/create.md +2 -1
  8. package/docs/examples/databases/list-attributes.md +2 -1
  9. package/docs/examples/databases/list-indexes.md +2 -1
  10. package/docs/examples/databases/update.md +2 -1
  11. package/docs/examples/functions/create-deployment.md +3 -2
  12. package/docs/examples/functions/create-execution.md +3 -0
  13. package/docs/examples/functions/create.md +13 -1
  14. package/docs/examples/functions/download-deployment.md +3 -0
  15. package/docs/examples/functions/update.md +9 -0
  16. package/docs/examples/health/get-pub-sub.md +1 -0
  17. package/docs/examples/health/get-queue.md +1 -0
  18. package/docs/examples/locale/list-codes.md +1 -0
  19. package/docs/examples/migrations/create-appwrite-migration.md +5 -0
  20. package/docs/examples/migrations/create-firebase-migration.md +3 -0
  21. package/docs/examples/migrations/create-firebase-o-auth-migration.md +3 -0
  22. package/docs/examples/migrations/create-n-host-migration.md +9 -0
  23. package/docs/examples/migrations/create-supabase-migration.md +8 -0
  24. package/docs/examples/migrations/delete-firebase-auth.md +1 -0
  25. package/docs/examples/migrations/delete.md +2 -0
  26. package/docs/examples/migrations/get-appwrite-report.md +5 -0
  27. package/docs/examples/migrations/get-firebase-report-o-auth.md +3 -0
  28. package/docs/examples/migrations/get-firebase-report.md +3 -0
  29. package/docs/examples/migrations/get-n-host-report.md +9 -0
  30. package/docs/examples/migrations/get-supabase-report.md +8 -0
  31. package/docs/examples/migrations/get.md +2 -0
  32. package/docs/examples/migrations/list-firebase-projects.md +1 -0
  33. package/docs/examples/migrations/list.md +3 -0
  34. package/docs/examples/migrations/retry.md +2 -0
  35. package/docs/examples/project/create-variable.md +3 -0
  36. package/docs/examples/project/delete-variable.md +2 -0
  37. package/docs/examples/project/get-usage.md +2 -0
  38. package/docs/examples/project/get-variable.md +2 -0
  39. package/docs/examples/project/list-variables.md +1 -0
  40. package/docs/examples/project/update-variable.md +4 -0
  41. package/docs/examples/projects/create.md +1 -1
  42. package/docs/examples/projects/delete-email-template.md +4 -0
  43. package/docs/examples/projects/delete-sms-template.md +4 -0
  44. package/docs/examples/projects/delete.md +1 -2
  45. package/docs/examples/projects/get-email-template.md +4 -0
  46. package/docs/examples/projects/get-sms-template.md +4 -0
  47. package/docs/examples/projects/update-email-template.md +9 -0
  48. package/docs/examples/projects/update-personal-data-check.md +3 -0
  49. package/docs/examples/projects/update-service-status-all.md +3 -0
  50. package/docs/examples/projects/update-sms-template.md +5 -0
  51. package/docs/examples/projects/update-smtp-configuration.md +11 -0
  52. package/docs/examples/projects/update-team.md +3 -0
  53. package/docs/examples/proxy/create-rule.md +4 -0
  54. package/docs/examples/proxy/delete-rule.md +2 -0
  55. package/docs/examples/proxy/get-rule.md +2 -0
  56. package/docs/examples/proxy/list-rules.md +3 -0
  57. package/docs/examples/proxy/update-rule-verification.md +2 -0
  58. package/docs/examples/storage/update-file.md +1 -0
  59. package/docs/examples/teams/create-membership.md +1 -1
  60. package/docs/examples/teams/{update-membership-roles.md → update-membership.md} +1 -1
  61. package/docs/examples/users/delete-identity.md +2 -0
  62. package/docs/examples/users/list-identities.md +3 -0
  63. package/docs/examples/users/update-labels.md +3 -0
  64. package/docs/examples/vcs/create-repository-detection.md +4 -0
  65. package/docs/examples/vcs/create-repository.md +4 -0
  66. package/docs/examples/vcs/delete-installation.md +2 -0
  67. package/docs/examples/vcs/get-installation.md +2 -0
  68. package/docs/examples/vcs/get-repository.md +3 -0
  69. package/docs/examples/vcs/list-installations.md +3 -0
  70. package/docs/examples/vcs/list-repositories.md +3 -0
  71. package/docs/examples/vcs/list-repository-branches.md +3 -0
  72. package/docs/examples/vcs/update-external-deployments.md +4 -0
  73. package/index.js +10 -0
  74. package/install.ps1 +2 -2
  75. package/install.sh +1 -1
  76. package/lib/client.js +3 -3
  77. package/lib/commands/account.js +122 -67
  78. package/lib/commands/assistant.js +53 -0
  79. package/lib/commands/avatars.js +21 -21
  80. package/lib/commands/console.js +2 -2
  81. package/lib/commands/databases.js +146 -104
  82. package/lib/commands/deploy.js +11 -2
  83. package/lib/commands/functions.js +292 -94
  84. package/lib/commands/generic.js +1 -0
  85. package/lib/commands/graphql.js +4 -4
  86. package/lib/commands/health.js +68 -22
  87. package/lib/commands/init.js +13 -4
  88. package/lib/commands/locale.js +37 -14
  89. package/lib/commands/migrations.js +708 -0
  90. package/lib/commands/project.js +204 -0
  91. package/lib/commands/projects.js +459 -196
  92. package/lib/commands/proxy.js +177 -0
  93. package/lib/commands/storage.js +63 -65
  94. package/lib/commands/teams.js +36 -36
  95. package/lib/commands/users.js +147 -52
  96. package/lib/commands/vcs.js +305 -0
  97. package/lib/config.js +1 -2
  98. package/lib/parser.js +7 -2
  99. package/lib/questions.js +45 -10
  100. package/package.json +2 -2
  101. package/scoop/appwrite.json +30 -0
  102. package/docs/examples/projects/create-domain.md +0 -3
  103. package/docs/examples/projects/delete-domain.md +0 -3
  104. package/docs/examples/projects/get-domain.md +0 -3
  105. package/docs/examples/projects/list-domains.md +0 -2
  106. package/docs/examples/projects/update-domain-verification.md +0 -3
@@ -0,0 +1,708 @@
1
+ const fs = require('fs');
2
+ const pathLib = require('path');
3
+ const tar = require("tar");
4
+ const ignore = require("ignore");
5
+ const { promisify } = require('util');
6
+ const libClient = require('../client.js');
7
+ const { getAllFiles } = require('../utils.js');
8
+ const { Command } = require('commander');
9
+ const { sdkForProject, sdkForConsole } = require('../sdks')
10
+ const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser')
11
+ const { localConfig, globalConfig } = require("../config");
12
+
13
+ const migrations = new Command("migrations").description(commandDescriptions['migrations']).configureHelp({
14
+ helpWidth: process.stdout.columns || 80
15
+ })
16
+
17
+ const migrationsList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
18
+ /* @param {string} queries */
19
+ /* @param {string} search */
20
+
21
+ let client = !sdk ? await sdkForProject() : sdk;
22
+ let apiPath = '/migrations';
23
+ let payload = {};
24
+
25
+ /** Query Params */
26
+ if (typeof queries !== 'undefined') {
27
+ payload['queries'] = queries;
28
+ }
29
+ if (typeof search !== 'undefined') {
30
+ payload['search'] = search;
31
+ }
32
+ let response = undefined;
33
+ response = await client.call('get', apiPath, {
34
+ 'content-type': 'application/json',
35
+ }, payload);
36
+
37
+ if (parseOutput) {
38
+ parse(response)
39
+ success()
40
+ }
41
+ return response;
42
+ }
43
+
44
+ const migrationsCreateAppwriteMigration = async ({ resources, endpoint, projectId, apiKey, parseOutput = true, sdk = undefined}) => {
45
+ /* @param {string[]} resources */
46
+ /* @param {string} endpoint */
47
+ /* @param {string} projectId */
48
+ /* @param {string} apiKey */
49
+
50
+ let client = !sdk ? await sdkForProject() : sdk;
51
+ let apiPath = '/migrations/appwrite';
52
+ let payload = {};
53
+
54
+ /** Body Params */
55
+ resources = resources === true ? [] : resources;
56
+
57
+ if (typeof resources !== 'undefined') {
58
+ payload['resources'] = resources;
59
+ }
60
+
61
+
62
+ if (typeof endpoint !== 'undefined') {
63
+ payload['endpoint'] = endpoint;
64
+ }
65
+
66
+
67
+ if (typeof projectId !== 'undefined') {
68
+ payload['projectId'] = projectId;
69
+ }
70
+
71
+
72
+ if (typeof apiKey !== 'undefined') {
73
+ payload['apiKey'] = apiKey;
74
+ }
75
+
76
+ let response = undefined;
77
+ response = await client.call('post', apiPath, {
78
+ 'content-type': 'application/json',
79
+ }, payload);
80
+
81
+ if (parseOutput) {
82
+ parse(response)
83
+ success()
84
+ }
85
+ return response;
86
+ }
87
+
88
+ const migrationsGetAppwriteReport = async ({ resources, endpoint, projectID, key, parseOutput = true, sdk = undefined}) => {
89
+ /* @param {string[]} resources */
90
+ /* @param {string} endpoint */
91
+ /* @param {string} projectID */
92
+ /* @param {string} key */
93
+
94
+ let client = !sdk ? await sdkForProject() : sdk;
95
+ let apiPath = '/migrations/appwrite/report';
96
+ let payload = {};
97
+
98
+ /** Query Params */
99
+ if (typeof resources !== 'undefined') {
100
+ payload['resources'] = resources;
101
+ }
102
+ if (typeof endpoint !== 'undefined') {
103
+ payload['endpoint'] = endpoint;
104
+ }
105
+ if (typeof projectID !== 'undefined') {
106
+ payload['projectID'] = projectID;
107
+ }
108
+ if (typeof key !== 'undefined') {
109
+ payload['key'] = key;
110
+ }
111
+ let response = undefined;
112
+ response = await client.call('get', apiPath, {
113
+ 'content-type': 'application/json',
114
+ }, payload);
115
+
116
+ if (parseOutput) {
117
+ parse(response)
118
+ success()
119
+ }
120
+ return response;
121
+ }
122
+
123
+ const migrationsCreateFirebaseMigration = async ({ resources, serviceAccount, parseOutput = true, sdk = undefined}) => {
124
+ /* @param {string[]} resources */
125
+ /* @param {string} serviceAccount */
126
+
127
+ let client = !sdk ? await sdkForProject() : sdk;
128
+ let apiPath = '/migrations/firebase';
129
+ let payload = {};
130
+
131
+ /** Body Params */
132
+ resources = resources === true ? [] : resources;
133
+
134
+ if (typeof resources !== 'undefined') {
135
+ payload['resources'] = resources;
136
+ }
137
+
138
+
139
+ if (typeof serviceAccount !== 'undefined') {
140
+ payload['serviceAccount'] = serviceAccount;
141
+ }
142
+
143
+ let response = undefined;
144
+ response = await client.call('post', apiPath, {
145
+ 'content-type': 'application/json',
146
+ }, payload);
147
+
148
+ if (parseOutput) {
149
+ parse(response)
150
+ success()
151
+ }
152
+ return response;
153
+ }
154
+
155
+ const migrationsDeleteFirebaseAuth = async ({ parseOutput = true, sdk = undefined}) => {
156
+
157
+ let client = !sdk ? await sdkForProject() : sdk;
158
+ let apiPath = '/migrations/firebase/deauthorize';
159
+ let payload = {};
160
+ let response = undefined;
161
+ response = await client.call('get', apiPath, {
162
+ 'content-type': 'application/json',
163
+ }, payload);
164
+
165
+ if (parseOutput) {
166
+ parse(response)
167
+ success()
168
+ }
169
+ return response;
170
+ }
171
+
172
+ const migrationsCreateFirebaseOAuthMigration = async ({ resources, projectId, parseOutput = true, sdk = undefined}) => {
173
+ /* @param {string[]} resources */
174
+ /* @param {string} projectId */
175
+
176
+ let client = !sdk ? await sdkForProject() : sdk;
177
+ let apiPath = '/migrations/firebase/oauth';
178
+ let payload = {};
179
+
180
+ /** Body Params */
181
+ resources = resources === true ? [] : resources;
182
+
183
+ if (typeof resources !== 'undefined') {
184
+ payload['resources'] = resources;
185
+ }
186
+
187
+
188
+ if (typeof projectId !== 'undefined') {
189
+ payload['projectId'] = projectId;
190
+ }
191
+
192
+ let response = undefined;
193
+ response = await client.call('post', apiPath, {
194
+ 'content-type': 'application/json',
195
+ }, payload);
196
+
197
+ if (parseOutput) {
198
+ parse(response)
199
+ success()
200
+ }
201
+ return response;
202
+ }
203
+
204
+ const migrationsListFirebaseProjects = async ({ parseOutput = true, sdk = undefined}) => {
205
+
206
+ let client = !sdk ? await sdkForProject() : sdk;
207
+ let apiPath = '/migrations/firebase/projects';
208
+ let payload = {};
209
+ let response = undefined;
210
+ response = await client.call('get', apiPath, {
211
+ 'content-type': 'application/json',
212
+ }, payload);
213
+
214
+ if (parseOutput) {
215
+ parse(response)
216
+ success()
217
+ }
218
+ return response;
219
+ }
220
+
221
+ const migrationsGetFirebaseReport = async ({ resources, serviceAccount, parseOutput = true, sdk = undefined}) => {
222
+ /* @param {string[]} resources */
223
+ /* @param {string} serviceAccount */
224
+
225
+ let client = !sdk ? await sdkForProject() : sdk;
226
+ let apiPath = '/migrations/firebase/report';
227
+ let payload = {};
228
+
229
+ /** Query Params */
230
+ if (typeof resources !== 'undefined') {
231
+ payload['resources'] = resources;
232
+ }
233
+ if (typeof serviceAccount !== 'undefined') {
234
+ payload['serviceAccount'] = serviceAccount;
235
+ }
236
+ let response = undefined;
237
+ response = await client.call('get', apiPath, {
238
+ 'content-type': 'application/json',
239
+ }, payload);
240
+
241
+ if (parseOutput) {
242
+ parse(response)
243
+ success()
244
+ }
245
+ return response;
246
+ }
247
+
248
+ const migrationsGetFirebaseReportOAuth = async ({ resources, projectId, parseOutput = true, sdk = undefined}) => {
249
+ /* @param {string[]} resources */
250
+ /* @param {string} projectId */
251
+
252
+ let client = !sdk ? await sdkForProject() : sdk;
253
+ let apiPath = '/migrations/firebase/report/oauth';
254
+ let payload = {};
255
+
256
+ /** Query Params */
257
+ if (typeof resources !== 'undefined') {
258
+ payload['resources'] = resources;
259
+ }
260
+ if (typeof projectId !== 'undefined') {
261
+ payload['projectId'] = projectId;
262
+ }
263
+ let response = undefined;
264
+ response = await client.call('get', apiPath, {
265
+ 'content-type': 'application/json',
266
+ }, payload);
267
+
268
+ if (parseOutput) {
269
+ parse(response)
270
+ success()
271
+ }
272
+ return response;
273
+ }
274
+
275
+ const migrationsCreateNHostMigration = async ({ resources, subdomain, region, adminSecret, database, username, password, port, parseOutput = true, sdk = undefined}) => {
276
+ /* @param {string[]} resources */
277
+ /* @param {string} subdomain */
278
+ /* @param {string} region */
279
+ /* @param {string} adminSecret */
280
+ /* @param {string} database */
281
+ /* @param {string} username */
282
+ /* @param {string} password */
283
+ /* @param {number} port */
284
+
285
+ let client = !sdk ? await sdkForProject() : sdk;
286
+ let apiPath = '/migrations/nhost';
287
+ let payload = {};
288
+
289
+ /** Body Params */
290
+ resources = resources === true ? [] : resources;
291
+
292
+ if (typeof resources !== 'undefined') {
293
+ payload['resources'] = resources;
294
+ }
295
+
296
+
297
+ if (typeof subdomain !== 'undefined') {
298
+ payload['subdomain'] = subdomain;
299
+ }
300
+
301
+
302
+ if (typeof region !== 'undefined') {
303
+ payload['region'] = region;
304
+ }
305
+
306
+
307
+ if (typeof adminSecret !== 'undefined') {
308
+ payload['adminSecret'] = adminSecret;
309
+ }
310
+
311
+
312
+ if (typeof database !== 'undefined') {
313
+ payload['database'] = database;
314
+ }
315
+
316
+
317
+ if (typeof username !== 'undefined') {
318
+ payload['username'] = username;
319
+ }
320
+
321
+
322
+ if (typeof password !== 'undefined') {
323
+ payload['password'] = password;
324
+ }
325
+
326
+
327
+ if (typeof port !== 'undefined') {
328
+ payload['port'] = port;
329
+ }
330
+
331
+ let response = undefined;
332
+ response = await client.call('post', apiPath, {
333
+ 'content-type': 'application/json',
334
+ }, payload);
335
+
336
+ if (parseOutput) {
337
+ parse(response)
338
+ success()
339
+ }
340
+ return response;
341
+ }
342
+
343
+ const migrationsGetNHostReport = async ({ resources, subdomain, region, adminSecret, database, username, password, port, parseOutput = true, sdk = undefined}) => {
344
+ /* @param {string[]} resources */
345
+ /* @param {string} subdomain */
346
+ /* @param {string} region */
347
+ /* @param {string} adminSecret */
348
+ /* @param {string} database */
349
+ /* @param {string} username */
350
+ /* @param {string} password */
351
+ /* @param {number} port */
352
+
353
+ let client = !sdk ? await sdkForProject() : sdk;
354
+ let apiPath = '/migrations/nhost/report';
355
+ let payload = {};
356
+
357
+ /** Query Params */
358
+ if (typeof resources !== 'undefined') {
359
+ payload['resources'] = resources;
360
+ }
361
+ if (typeof subdomain !== 'undefined') {
362
+ payload['subdomain'] = subdomain;
363
+ }
364
+ if (typeof region !== 'undefined') {
365
+ payload['region'] = region;
366
+ }
367
+ if (typeof adminSecret !== 'undefined') {
368
+ payload['adminSecret'] = adminSecret;
369
+ }
370
+ if (typeof database !== 'undefined') {
371
+ payload['database'] = database;
372
+ }
373
+ if (typeof username !== 'undefined') {
374
+ payload['username'] = username;
375
+ }
376
+ if (typeof password !== 'undefined') {
377
+ payload['password'] = password;
378
+ }
379
+ if (typeof port !== 'undefined') {
380
+ payload['port'] = port;
381
+ }
382
+ let response = undefined;
383
+ response = await client.call('get', apiPath, {
384
+ 'content-type': 'application/json',
385
+ }, payload);
386
+
387
+ if (parseOutput) {
388
+ parse(response)
389
+ success()
390
+ }
391
+ return response;
392
+ }
393
+
394
+ const migrationsCreateSupabaseMigration = async ({ resources, endpoint, apiKey, databaseHost, username, password, port, parseOutput = true, sdk = undefined}) => {
395
+ /* @param {string[]} resources */
396
+ /* @param {string} endpoint */
397
+ /* @param {string} apiKey */
398
+ /* @param {string} databaseHost */
399
+ /* @param {string} username */
400
+ /* @param {string} password */
401
+ /* @param {number} port */
402
+
403
+ let client = !sdk ? await sdkForProject() : sdk;
404
+ let apiPath = '/migrations/supabase';
405
+ let payload = {};
406
+
407
+ /** Body Params */
408
+ resources = resources === true ? [] : resources;
409
+
410
+ if (typeof resources !== 'undefined') {
411
+ payload['resources'] = resources;
412
+ }
413
+
414
+
415
+ if (typeof endpoint !== 'undefined') {
416
+ payload['endpoint'] = endpoint;
417
+ }
418
+
419
+
420
+ if (typeof apiKey !== 'undefined') {
421
+ payload['apiKey'] = apiKey;
422
+ }
423
+
424
+
425
+ if (typeof databaseHost !== 'undefined') {
426
+ payload['databaseHost'] = databaseHost;
427
+ }
428
+
429
+
430
+ if (typeof username !== 'undefined') {
431
+ payload['username'] = username;
432
+ }
433
+
434
+
435
+ if (typeof password !== 'undefined') {
436
+ payload['password'] = password;
437
+ }
438
+
439
+
440
+ if (typeof port !== 'undefined') {
441
+ payload['port'] = port;
442
+ }
443
+
444
+ let response = undefined;
445
+ response = await client.call('post', apiPath, {
446
+ 'content-type': 'application/json',
447
+ }, payload);
448
+
449
+ if (parseOutput) {
450
+ parse(response)
451
+ success()
452
+ }
453
+ return response;
454
+ }
455
+
456
+ const migrationsGetSupabaseReport = async ({ resources, endpoint, apiKey, databaseHost, username, password, port, parseOutput = true, sdk = undefined}) => {
457
+ /* @param {string[]} resources */
458
+ /* @param {string} endpoint */
459
+ /* @param {string} apiKey */
460
+ /* @param {string} databaseHost */
461
+ /* @param {string} username */
462
+ /* @param {string} password */
463
+ /* @param {number} port */
464
+
465
+ let client = !sdk ? await sdkForProject() : sdk;
466
+ let apiPath = '/migrations/supabase/report';
467
+ let payload = {};
468
+
469
+ /** Query Params */
470
+ if (typeof resources !== 'undefined') {
471
+ payload['resources'] = resources;
472
+ }
473
+ if (typeof endpoint !== 'undefined') {
474
+ payload['endpoint'] = endpoint;
475
+ }
476
+ if (typeof apiKey !== 'undefined') {
477
+ payload['apiKey'] = apiKey;
478
+ }
479
+ if (typeof databaseHost !== 'undefined') {
480
+ payload['databaseHost'] = databaseHost;
481
+ }
482
+ if (typeof username !== 'undefined') {
483
+ payload['username'] = username;
484
+ }
485
+ if (typeof password !== 'undefined') {
486
+ payload['password'] = password;
487
+ }
488
+ if (typeof port !== 'undefined') {
489
+ payload['port'] = port;
490
+ }
491
+ let response = undefined;
492
+ response = await client.call('get', apiPath, {
493
+ 'content-type': 'application/json',
494
+ }, payload);
495
+
496
+ if (parseOutput) {
497
+ parse(response)
498
+ success()
499
+ }
500
+ return response;
501
+ }
502
+
503
+ const migrationsGet = async ({ migrationId, parseOutput = true, sdk = undefined}) => {
504
+ /* @param {string} migrationId */
505
+
506
+ let client = !sdk ? await sdkForProject() : sdk;
507
+ let apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
508
+ let payload = {};
509
+ let response = undefined;
510
+ response = await client.call('get', apiPath, {
511
+ 'content-type': 'application/json',
512
+ }, payload);
513
+
514
+ if (parseOutput) {
515
+ parse(response)
516
+ success()
517
+ }
518
+ return response;
519
+ }
520
+
521
+ const migrationsRetry = async ({ migrationId, parseOutput = true, sdk = undefined}) => {
522
+ /* @param {string} migrationId */
523
+
524
+ let client = !sdk ? await sdkForProject() : sdk;
525
+ let apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
526
+ let payload = {};
527
+ let response = undefined;
528
+ response = await client.call('patch', apiPath, {
529
+ 'content-type': 'application/json',
530
+ }, payload);
531
+
532
+ if (parseOutput) {
533
+ parse(response)
534
+ success()
535
+ }
536
+ return response;
537
+ }
538
+
539
+ const migrationsDelete = async ({ migrationId, parseOutput = true, sdk = undefined}) => {
540
+ /* @param {string} migrationId */
541
+
542
+ let client = !sdk ? await sdkForProject() : sdk;
543
+ let apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
544
+ let payload = {};
545
+ let response = undefined;
546
+ response = await client.call('delete', apiPath, {
547
+ 'content-type': 'application/json',
548
+ }, payload);
549
+
550
+ if (parseOutput) {
551
+ parse(response)
552
+ success()
553
+ }
554
+ return response;
555
+ }
556
+
557
+
558
+ migrations
559
+ .command(`list`)
560
+ .description(``)
561
+ .option(`--queries <queries>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors`)
562
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
563
+ .action(actionRunner(migrationsList))
564
+
565
+ migrations
566
+ .command(`createAppwriteMigration`)
567
+ .description(``)
568
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
569
+ .requiredOption(`--endpoint <endpoint>`, `Source's Appwrite Endpoint`)
570
+ .requiredOption(`--projectId <projectId>`, `Source's Project ID`)
571
+ .requiredOption(`--apiKey <apiKey>`, `Source's API Key`)
572
+ .action(actionRunner(migrationsCreateAppwriteMigration))
573
+
574
+ migrations
575
+ .command(`getAppwriteReport`)
576
+ .description(``)
577
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
578
+ .requiredOption(`--endpoint <endpoint>`, `Source's Appwrite Endpoint`)
579
+ .requiredOption(`--projectID <projectID>`, `Source's Project ID`)
580
+ .requiredOption(`--key <key>`, `Source's API Key`)
581
+ .action(actionRunner(migrationsGetAppwriteReport))
582
+
583
+ migrations
584
+ .command(`createFirebaseMigration`)
585
+ .description(``)
586
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
587
+ .requiredOption(`--serviceAccount <serviceAccount>`, `JSON of the Firebase service account credentials`)
588
+ .action(actionRunner(migrationsCreateFirebaseMigration))
589
+
590
+ migrations
591
+ .command(`deleteFirebaseAuth`)
592
+ .description(``)
593
+ .action(actionRunner(migrationsDeleteFirebaseAuth))
594
+
595
+ migrations
596
+ .command(`createFirebaseOAuthMigration`)
597
+ .description(``)
598
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
599
+ .requiredOption(`--projectId <projectId>`, `Project ID of the Firebase Project`)
600
+ .action(actionRunner(migrationsCreateFirebaseOAuthMigration))
601
+
602
+ migrations
603
+ .command(`listFirebaseProjects`)
604
+ .description(``)
605
+ .action(actionRunner(migrationsListFirebaseProjects))
606
+
607
+ migrations
608
+ .command(`getFirebaseReport`)
609
+ .description(``)
610
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
611
+ .requiredOption(`--serviceAccount <serviceAccount>`, `JSON of the Firebase service account credentials`)
612
+ .action(actionRunner(migrationsGetFirebaseReport))
613
+
614
+ migrations
615
+ .command(`getFirebaseReportOAuth`)
616
+ .description(``)
617
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
618
+ .requiredOption(`--projectId <projectId>`, `Project ID`)
619
+ .action(actionRunner(migrationsGetFirebaseReportOAuth))
620
+
621
+ migrations
622
+ .command(`createNHostMigration`)
623
+ .description(``)
624
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
625
+ .requiredOption(`--subdomain <subdomain>`, `Source's Subdomain`)
626
+ .requiredOption(`--region <region>`, `Source's Region`)
627
+ .requiredOption(`--adminSecret <adminSecret>`, `Source's Admin Secret`)
628
+ .requiredOption(`--database <database>`, `Source's Database Name`)
629
+ .requiredOption(`--username <username>`, `Source's Database Username`)
630
+ .requiredOption(`--password <password>`, `Source's Database Password`)
631
+ .option(`--port <port>`, `Source's Database Port`, parseInteger)
632
+ .action(actionRunner(migrationsCreateNHostMigration))
633
+
634
+ migrations
635
+ .command(`getNHostReport`)
636
+ .description(``)
637
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate.`)
638
+ .requiredOption(`--subdomain <subdomain>`, `Source's Subdomain.`)
639
+ .requiredOption(`--region <region>`, `Source's Region.`)
640
+ .requiredOption(`--adminSecret <adminSecret>`, `Source's Admin Secret.`)
641
+ .requiredOption(`--database <database>`, `Source's Database Name.`)
642
+ .requiredOption(`--username <username>`, `Source's Database Username.`)
643
+ .requiredOption(`--password <password>`, `Source's Database Password.`)
644
+ .option(`--port <port>`, `Source's Database Port.`, parseInteger)
645
+ .action(actionRunner(migrationsGetNHostReport))
646
+
647
+ migrations
648
+ .command(`createSupabaseMigration`)
649
+ .description(``)
650
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
651
+ .requiredOption(`--endpoint <endpoint>`, `Source's Supabase Endpoint`)
652
+ .requiredOption(`--apiKey <apiKey>`, `Source's API Key`)
653
+ .requiredOption(`--databaseHost <databaseHost>`, `Source's Database Host`)
654
+ .requiredOption(`--username <username>`, `Source's Database Username`)
655
+ .requiredOption(`--password <password>`, `Source's Database Password`)
656
+ .option(`--port <port>`, `Source's Database Port`, parseInteger)
657
+ .action(actionRunner(migrationsCreateSupabaseMigration))
658
+
659
+ migrations
660
+ .command(`getSupabaseReport`)
661
+ .description(``)
662
+ .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
663
+ .requiredOption(`--endpoint <endpoint>`, `Source's Supabase Endpoint.`)
664
+ .requiredOption(`--apiKey <apiKey>`, `Source's API Key.`)
665
+ .requiredOption(`--databaseHost <databaseHost>`, `Source's Database Host.`)
666
+ .requiredOption(`--username <username>`, `Source's Database Username.`)
667
+ .requiredOption(`--password <password>`, `Source's Database Password.`)
668
+ .option(`--port <port>`, `Source's Database Port.`, parseInteger)
669
+ .action(actionRunner(migrationsGetSupabaseReport))
670
+
671
+ migrations
672
+ .command(`get`)
673
+ .description(``)
674
+ .requiredOption(`--migrationId <migrationId>`, `Migration unique ID.`)
675
+ .action(actionRunner(migrationsGet))
676
+
677
+ migrations
678
+ .command(`retry`)
679
+ .description(``)
680
+ .requiredOption(`--migrationId <migrationId>`, `Migration unique ID.`)
681
+ .action(actionRunner(migrationsRetry))
682
+
683
+ migrations
684
+ .command(`delete`)
685
+ .description(``)
686
+ .requiredOption(`--migrationId <migrationId>`, `Migration ID.`)
687
+ .action(actionRunner(migrationsDelete))
688
+
689
+
690
+ module.exports = {
691
+ migrations,
692
+ migrationsList,
693
+ migrationsCreateAppwriteMigration,
694
+ migrationsGetAppwriteReport,
695
+ migrationsCreateFirebaseMigration,
696
+ migrationsDeleteFirebaseAuth,
697
+ migrationsCreateFirebaseOAuthMigration,
698
+ migrationsListFirebaseProjects,
699
+ migrationsGetFirebaseReport,
700
+ migrationsGetFirebaseReportOAuth,
701
+ migrationsCreateNHostMigration,
702
+ migrationsGetNHostReport,
703
+ migrationsCreateSupabaseMigration,
704
+ migrationsGetSupabaseReport,
705
+ migrationsGet,
706
+ migrationsRetry,
707
+ migrationsDelete
708
+ };