appwrite-cli 4.2.1 → 4.2.2

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.
@@ -37,7 +37,7 @@ function convertReadStreamToReadableStream(readStream) {
37
37
 
38
38
  const migrations = new Command("migrations").description(commandDescriptions['migrations']).configureHelp({
39
39
  helpWidth: process.stdout.columns || 80
40
- })
40
+ })
41
41
 
42
42
  /**
43
43
  * @typedef {Object} MigrationsListRequestParams
@@ -52,7 +52,6 @@ const migrations = new Command("migrations").description(commandDescriptions['mi
52
52
  */
53
53
  const migrationsList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
54
54
  let client = !sdk ? await sdkForProject() : sdk;
55
-
56
55
  let apiPath = '/migrations';
57
56
  let payload = {};
58
57
  if (typeof queries !== 'undefined') {
@@ -62,14 +61,12 @@ const migrationsList = async ({ queries, search, parseOutput = true, sdk = undef
62
61
  payload['search'] = search;
63
62
  }
64
63
 
65
-
66
64
  let response = undefined;
67
-
65
+
68
66
  response = await client.call('get', apiPath, {
69
67
  'content-type': 'application/json',
70
68
  }, payload);
71
69
 
72
-
73
70
  if (parseOutput) {
74
71
  parse(response)
75
72
  success()
@@ -93,7 +90,6 @@ const migrationsList = async ({ queries, search, parseOutput = true, sdk = undef
93
90
  */
94
91
  const migrationsCreateAppwriteMigration = async ({ resources, endpoint, projectId, apiKey, parseOutput = true, sdk = undefined}) => {
95
92
  let client = !sdk ? await sdkForProject() : sdk;
96
-
97
93
  let apiPath = '/migrations/appwrite';
98
94
  let payload = {};
99
95
  resources = resources === true ? [] : resources;
@@ -110,14 +106,12 @@ const migrationsCreateAppwriteMigration = async ({ resources, endpoint, projectI
110
106
  payload['apiKey'] = apiKey;
111
107
  }
112
108
 
113
-
114
109
  let response = undefined;
115
-
110
+
116
111
  response = await client.call('post', apiPath, {
117
112
  'content-type': 'application/json',
118
113
  }, payload);
119
114
 
120
-
121
115
  if (parseOutput) {
122
116
  parse(response)
123
117
  success()
@@ -141,7 +135,6 @@ const migrationsCreateAppwriteMigration = async ({ resources, endpoint, projectI
141
135
  */
142
136
  const migrationsGetAppwriteReport = async ({ resources, endpoint, projectID, key, parseOutput = true, sdk = undefined}) => {
143
137
  let client = !sdk ? await sdkForProject() : sdk;
144
-
145
138
  let apiPath = '/migrations/appwrite/report';
146
139
  let payload = {};
147
140
  if (typeof resources !== 'undefined') {
@@ -157,14 +150,12 @@ const migrationsGetAppwriteReport = async ({ resources, endpoint, projectID, key
157
150
  payload['key'] = key;
158
151
  }
159
152
 
160
-
161
153
  let response = undefined;
162
-
154
+
163
155
  response = await client.call('get', apiPath, {
164
156
  'content-type': 'application/json',
165
157
  }, payload);
166
158
 
167
-
168
159
  if (parseOutput) {
169
160
  parse(response)
170
161
  success()
@@ -186,7 +177,6 @@ const migrationsGetAppwriteReport = async ({ resources, endpoint, projectID, key
186
177
  */
187
178
  const migrationsCreateFirebaseMigration = async ({ resources, serviceAccount, parseOutput = true, sdk = undefined}) => {
188
179
  let client = !sdk ? await sdkForProject() : sdk;
189
-
190
180
  let apiPath = '/migrations/firebase';
191
181
  let payload = {};
192
182
  resources = resources === true ? [] : resources;
@@ -197,14 +187,12 @@ const migrationsCreateFirebaseMigration = async ({ resources, serviceAccount, pa
197
187
  payload['serviceAccount'] = serviceAccount;
198
188
  }
199
189
 
200
-
201
190
  let response = undefined;
202
-
191
+
203
192
  response = await client.call('post', apiPath, {
204
193
  'content-type': 'application/json',
205
194
  }, payload);
206
195
 
207
-
208
196
  if (parseOutput) {
209
197
  parse(response)
210
198
  success()
@@ -224,18 +212,15 @@ const migrationsCreateFirebaseMigration = async ({ resources, serviceAccount, pa
224
212
  */
225
213
  const migrationsDeleteFirebaseAuth = async ({ parseOutput = true, sdk = undefined}) => {
226
214
  let client = !sdk ? await sdkForProject() : sdk;
227
-
228
215
  let apiPath = '/migrations/firebase/deauthorize';
229
216
  let payload = {};
230
217
 
231
-
232
218
  let response = undefined;
233
-
219
+
234
220
  response = await client.call('get', apiPath, {
235
221
  'content-type': 'application/json',
236
222
  }, payload);
237
223
 
238
-
239
224
  if (parseOutput) {
240
225
  parse(response)
241
226
  success()
@@ -257,7 +242,6 @@ const migrationsDeleteFirebaseAuth = async ({ parseOutput = true, sdk = undefine
257
242
  */
258
243
  const migrationsCreateFirebaseOAuthMigration = async ({ resources, projectId, parseOutput = true, sdk = undefined}) => {
259
244
  let client = !sdk ? await sdkForProject() : sdk;
260
-
261
245
  let apiPath = '/migrations/firebase/oauth';
262
246
  let payload = {};
263
247
  resources = resources === true ? [] : resources;
@@ -268,14 +252,12 @@ const migrationsCreateFirebaseOAuthMigration = async ({ resources, projectId, pa
268
252
  payload['projectId'] = projectId;
269
253
  }
270
254
 
271
-
272
255
  let response = undefined;
273
-
256
+
274
257
  response = await client.call('post', apiPath, {
275
258
  'content-type': 'application/json',
276
259
  }, payload);
277
260
 
278
-
279
261
  if (parseOutput) {
280
262
  parse(response)
281
263
  success()
@@ -295,18 +277,15 @@ const migrationsCreateFirebaseOAuthMigration = async ({ resources, projectId, pa
295
277
  */
296
278
  const migrationsListFirebaseProjects = async ({ parseOutput = true, sdk = undefined}) => {
297
279
  let client = !sdk ? await sdkForProject() : sdk;
298
-
299
280
  let apiPath = '/migrations/firebase/projects';
300
281
  let payload = {};
301
282
 
302
-
303
283
  let response = undefined;
304
-
284
+
305
285
  response = await client.call('get', apiPath, {
306
286
  'content-type': 'application/json',
307
287
  }, payload);
308
288
 
309
-
310
289
  if (parseOutput) {
311
290
  parse(response)
312
291
  success()
@@ -328,7 +307,6 @@ const migrationsListFirebaseProjects = async ({ parseOutput = true, sdk = undefi
328
307
  */
329
308
  const migrationsGetFirebaseReport = async ({ resources, serviceAccount, parseOutput = true, sdk = undefined}) => {
330
309
  let client = !sdk ? await sdkForProject() : sdk;
331
-
332
310
  let apiPath = '/migrations/firebase/report';
333
311
  let payload = {};
334
312
  if (typeof resources !== 'undefined') {
@@ -338,14 +316,12 @@ const migrationsGetFirebaseReport = async ({ resources, serviceAccount, parseOut
338
316
  payload['serviceAccount'] = serviceAccount;
339
317
  }
340
318
 
341
-
342
319
  let response = undefined;
343
-
320
+
344
321
  response = await client.call('get', apiPath, {
345
322
  'content-type': 'application/json',
346
323
  }, payload);
347
324
 
348
-
349
325
  if (parseOutput) {
350
326
  parse(response)
351
327
  success()
@@ -367,7 +343,6 @@ const migrationsGetFirebaseReport = async ({ resources, serviceAccount, parseOut
367
343
  */
368
344
  const migrationsGetFirebaseReportOAuth = async ({ resources, projectId, parseOutput = true, sdk = undefined}) => {
369
345
  let client = !sdk ? await sdkForProject() : sdk;
370
-
371
346
  let apiPath = '/migrations/firebase/report/oauth';
372
347
  let payload = {};
373
348
  if (typeof resources !== 'undefined') {
@@ -377,14 +352,12 @@ const migrationsGetFirebaseReportOAuth = async ({ resources, projectId, parseOut
377
352
  payload['projectId'] = projectId;
378
353
  }
379
354
 
380
-
381
355
  let response = undefined;
382
-
356
+
383
357
  response = await client.call('get', apiPath, {
384
358
  'content-type': 'application/json',
385
359
  }, payload);
386
360
 
387
-
388
361
  if (parseOutput) {
389
362
  parse(response)
390
363
  success()
@@ -412,7 +385,6 @@ const migrationsGetFirebaseReportOAuth = async ({ resources, projectId, parseOut
412
385
  */
413
386
  const migrationsCreateNHostMigration = async ({ resources, subdomain, region, adminSecret, database, username, password, port, parseOutput = true, sdk = undefined}) => {
414
387
  let client = !sdk ? await sdkForProject() : sdk;
415
-
416
388
  let apiPath = '/migrations/nhost';
417
389
  let payload = {};
418
390
  resources = resources === true ? [] : resources;
@@ -441,14 +413,12 @@ const migrationsCreateNHostMigration = async ({ resources, subdomain, region, ad
441
413
  payload['port'] = port;
442
414
  }
443
415
 
444
-
445
416
  let response = undefined;
446
-
417
+
447
418
  response = await client.call('post', apiPath, {
448
419
  'content-type': 'application/json',
449
420
  }, payload);
450
421
 
451
-
452
422
  if (parseOutput) {
453
423
  parse(response)
454
424
  success()
@@ -476,7 +446,6 @@ const migrationsCreateNHostMigration = async ({ resources, subdomain, region, ad
476
446
  */
477
447
  const migrationsGetNHostReport = async ({ resources, subdomain, region, adminSecret, database, username, password, port, parseOutput = true, sdk = undefined}) => {
478
448
  let client = !sdk ? await sdkForProject() : sdk;
479
-
480
449
  let apiPath = '/migrations/nhost/report';
481
450
  let payload = {};
482
451
  if (typeof resources !== 'undefined') {
@@ -504,14 +473,12 @@ const migrationsGetNHostReport = async ({ resources, subdomain, region, adminSec
504
473
  payload['port'] = port;
505
474
  }
506
475
 
507
-
508
476
  let response = undefined;
509
-
477
+
510
478
  response = await client.call('get', apiPath, {
511
479
  'content-type': 'application/json',
512
480
  }, payload);
513
481
 
514
-
515
482
  if (parseOutput) {
516
483
  parse(response)
517
484
  success()
@@ -538,7 +505,6 @@ const migrationsGetNHostReport = async ({ resources, subdomain, region, adminSec
538
505
  */
539
506
  const migrationsCreateSupabaseMigration = async ({ resources, endpoint, apiKey, databaseHost, username, password, port, parseOutput = true, sdk = undefined}) => {
540
507
  let client = !sdk ? await sdkForProject() : sdk;
541
-
542
508
  let apiPath = '/migrations/supabase';
543
509
  let payload = {};
544
510
  resources = resources === true ? [] : resources;
@@ -564,14 +530,12 @@ const migrationsCreateSupabaseMigration = async ({ resources, endpoint, apiKey,
564
530
  payload['port'] = port;
565
531
  }
566
532
 
567
-
568
533
  let response = undefined;
569
-
534
+
570
535
  response = await client.call('post', apiPath, {
571
536
  'content-type': 'application/json',
572
537
  }, payload);
573
538
 
574
-
575
539
  if (parseOutput) {
576
540
  parse(response)
577
541
  success()
@@ -598,7 +562,6 @@ const migrationsCreateSupabaseMigration = async ({ resources, endpoint, apiKey,
598
562
  */
599
563
  const migrationsGetSupabaseReport = async ({ resources, endpoint, apiKey, databaseHost, username, password, port, parseOutput = true, sdk = undefined}) => {
600
564
  let client = !sdk ? await sdkForProject() : sdk;
601
-
602
565
  let apiPath = '/migrations/supabase/report';
603
566
  let payload = {};
604
567
  if (typeof resources !== 'undefined') {
@@ -623,14 +586,12 @@ const migrationsGetSupabaseReport = async ({ resources, endpoint, apiKey, databa
623
586
  payload['port'] = port;
624
587
  }
625
588
 
626
-
627
589
  let response = undefined;
628
-
590
+
629
591
  response = await client.call('get', apiPath, {
630
592
  'content-type': 'application/json',
631
593
  }, payload);
632
594
 
633
-
634
595
  if (parseOutput) {
635
596
  parse(response)
636
597
  success()
@@ -651,18 +612,15 @@ const migrationsGetSupabaseReport = async ({ resources, endpoint, apiKey, databa
651
612
  */
652
613
  const migrationsGet = async ({ migrationId, parseOutput = true, sdk = undefined}) => {
653
614
  let client = !sdk ? await sdkForProject() : sdk;
654
-
655
615
  let apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
656
616
  let payload = {};
657
617
 
658
-
659
618
  let response = undefined;
660
-
619
+
661
620
  response = await client.call('get', apiPath, {
662
621
  'content-type': 'application/json',
663
622
  }, payload);
664
623
 
665
-
666
624
  if (parseOutput) {
667
625
  parse(response)
668
626
  success()
@@ -683,18 +641,15 @@ const migrationsGet = async ({ migrationId, parseOutput = true, sdk = undefined}
683
641
  */
684
642
  const migrationsRetry = async ({ migrationId, parseOutput = true, sdk = undefined}) => {
685
643
  let client = !sdk ? await sdkForProject() : sdk;
686
-
687
644
  let apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
688
645
  let payload = {};
689
646
 
690
-
691
647
  let response = undefined;
692
-
648
+
693
649
  response = await client.call('patch', apiPath, {
694
650
  'content-type': 'application/json',
695
651
  }, payload);
696
652
 
697
-
698
653
  if (parseOutput) {
699
654
  parse(response)
700
655
  success()
@@ -715,18 +670,15 @@ const migrationsRetry = async ({ migrationId, parseOutput = true, sdk = undefine
715
670
  */
716
671
  const migrationsDelete = async ({ migrationId, parseOutput = true, sdk = undefined}) => {
717
672
  let client = !sdk ? await sdkForProject() : sdk;
718
-
719
673
  let apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
720
674
  let payload = {};
721
675
 
722
-
723
676
  let response = undefined;
724
-
677
+
725
678
  response = await client.call('delete', apiPath, {
726
679
  'content-type': 'application/json',
727
680
  }, payload);
728
681
 
729
-
730
682
  if (parseOutput) {
731
683
  parse(response)
732
684
  success()
@@ -735,7 +687,6 @@ const migrationsDelete = async ({ migrationId, parseOutput = true, sdk = undefin
735
687
  return response;
736
688
  }
737
689
 
738
-
739
690
  migrations
740
691
  .command(`list`)
741
692
  .description(``)
@@ -867,23 +818,22 @@ migrations
867
818
  .requiredOption(`--migrationId <migrationId>`, `Migration ID.`)
868
819
  .action(actionRunner(migrationsDelete))
869
820
 
870
-
871
821
  module.exports = {
872
822
  migrations,
873
- migrationsList,
874
- migrationsCreateAppwriteMigration,
875
- migrationsGetAppwriteReport,
876
- migrationsCreateFirebaseMigration,
877
- migrationsDeleteFirebaseAuth,
878
- migrationsCreateFirebaseOAuthMigration,
879
- migrationsListFirebaseProjects,
880
- migrationsGetFirebaseReport,
881
- migrationsGetFirebaseReportOAuth,
882
- migrationsCreateNHostMigration,
883
- migrationsGetNHostReport,
884
- migrationsCreateSupabaseMigration,
885
- migrationsGetSupabaseReport,
886
- migrationsGet,
887
- migrationsRetry,
888
- migrationsDelete
823
+ migrationsList,
824
+ migrationsCreateAppwriteMigration,
825
+ migrationsGetAppwriteReport,
826
+ migrationsCreateFirebaseMigration,
827
+ migrationsDeleteFirebaseAuth,
828
+ migrationsCreateFirebaseOAuthMigration,
829
+ migrationsListFirebaseProjects,
830
+ migrationsGetFirebaseReport,
831
+ migrationsGetFirebaseReportOAuth,
832
+ migrationsCreateNHostMigration,
833
+ migrationsGetNHostReport,
834
+ migrationsCreateSupabaseMigration,
835
+ migrationsGetSupabaseReport,
836
+ migrationsGet,
837
+ migrationsRetry,
838
+ migrationsDelete
889
839
  };
@@ -37,7 +37,7 @@ function convertReadStreamToReadableStream(readStream) {
37
37
 
38
38
  const project = new Command("project").description(commandDescriptions['project']).configureHelp({
39
39
  helpWidth: process.stdout.columns || 80
40
- })
40
+ })
41
41
 
42
42
  /**
43
43
  * @typedef {Object} ProjectGetUsageRequestParams
@@ -51,21 +51,18 @@ const project = new Command("project").description(commandDescriptions['project'
51
51
  */
52
52
  const projectGetUsage = async ({ range, parseOutput = true, sdk = undefined}) => {
53
53
  let client = !sdk ? await sdkForProject() : sdk;
54
-
55
54
  let apiPath = '/project/usage';
56
55
  let payload = {};
57
56
  if (typeof range !== 'undefined') {
58
57
  payload['range'] = range;
59
58
  }
60
59
 
61
-
62
60
  let response = undefined;
63
-
61
+
64
62
  response = await client.call('get', apiPath, {
65
63
  'content-type': 'application/json',
66
64
  }, payload);
67
65
 
68
-
69
66
  if (parseOutput) {
70
67
  parse(response)
71
68
  success()
@@ -85,18 +82,15 @@ const projectGetUsage = async ({ range, parseOutput = true, sdk = undefined}) =>
85
82
  */
86
83
  const projectListVariables = async ({ parseOutput = true, sdk = undefined}) => {
87
84
  let client = !sdk ? await sdkForProject() : sdk;
88
-
89
85
  let apiPath = '/project/variables';
90
86
  let payload = {};
91
87
 
92
-
93
88
  let response = undefined;
94
-
89
+
95
90
  response = await client.call('get', apiPath, {
96
91
  'content-type': 'application/json',
97
92
  }, payload);
98
93
 
99
-
100
94
  if (parseOutput) {
101
95
  parse(response)
102
96
  success()
@@ -118,7 +112,6 @@ const projectListVariables = async ({ parseOutput = true, sdk = undefined}) => {
118
112
  */
119
113
  const projectCreateVariable = async ({ key, value, parseOutput = true, sdk = undefined}) => {
120
114
  let client = !sdk ? await sdkForProject() : sdk;
121
-
122
115
  let apiPath = '/project/variables';
123
116
  let payload = {};
124
117
  if (typeof key !== 'undefined') {
@@ -128,14 +121,12 @@ const projectCreateVariable = async ({ key, value, parseOutput = true, sdk = und
128
121
  payload['value'] = value;
129
122
  }
130
123
 
131
-
132
124
  let response = undefined;
133
-
125
+
134
126
  response = await client.call('post', apiPath, {
135
127
  'content-type': 'application/json',
136
128
  }, payload);
137
129
 
138
-
139
130
  if (parseOutput) {
140
131
  parse(response)
141
132
  success()
@@ -156,18 +147,15 @@ const projectCreateVariable = async ({ key, value, parseOutput = true, sdk = und
156
147
  */
157
148
  const projectGetVariable = async ({ variableId, parseOutput = true, sdk = undefined}) => {
158
149
  let client = !sdk ? await sdkForProject() : sdk;
159
-
160
150
  let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
161
151
  let payload = {};
162
152
 
163
-
164
153
  let response = undefined;
165
-
154
+
166
155
  response = await client.call('get', apiPath, {
167
156
  'content-type': 'application/json',
168
157
  }, payload);
169
158
 
170
-
171
159
  if (parseOutput) {
172
160
  parse(response)
173
161
  success()
@@ -190,7 +178,6 @@ const projectGetVariable = async ({ variableId, parseOutput = true, sdk = undefi
190
178
  */
191
179
  const projectUpdateVariable = async ({ variableId, key, value, parseOutput = true, sdk = undefined}) => {
192
180
  let client = !sdk ? await sdkForProject() : sdk;
193
-
194
181
  let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
195
182
  let payload = {};
196
183
  if (typeof key !== 'undefined') {
@@ -200,14 +187,12 @@ const projectUpdateVariable = async ({ variableId, key, value, parseOutput = tru
200
187
  payload['value'] = value;
201
188
  }
202
189
 
203
-
204
190
  let response = undefined;
205
-
191
+
206
192
  response = await client.call('put', apiPath, {
207
193
  'content-type': 'application/json',
208
194
  }, payload);
209
195
 
210
-
211
196
  if (parseOutput) {
212
197
  parse(response)
213
198
  success()
@@ -228,18 +213,15 @@ const projectUpdateVariable = async ({ variableId, key, value, parseOutput = tru
228
213
  */
229
214
  const projectDeleteVariable = async ({ variableId, parseOutput = true, sdk = undefined}) => {
230
215
  let client = !sdk ? await sdkForProject() : sdk;
231
-
232
216
  let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
233
217
  let payload = {};
234
218
 
235
-
236
219
  let response = undefined;
237
-
220
+
238
221
  response = await client.call('delete', apiPath, {
239
222
  'content-type': 'application/json',
240
223
  }, payload);
241
224
 
242
-
243
225
  if (parseOutput) {
244
226
  parse(response)
245
227
  success()
@@ -248,7 +230,6 @@ const projectDeleteVariable = async ({ variableId, parseOutput = true, sdk = und
248
230
  return response;
249
231
  }
250
232
 
251
-
252
233
  project
253
234
  .command(`getUsage`)
254
235
  .description(``)
@@ -287,13 +268,12 @@ project
287
268
  .requiredOption(`--variableId <variableId>`, `Variable unique ID.`)
288
269
  .action(actionRunner(projectDeleteVariable))
289
270
 
290
-
291
271
  module.exports = {
292
272
  project,
293
- projectGetUsage,
294
- projectListVariables,
295
- projectCreateVariable,
296
- projectGetVariable,
297
- projectUpdateVariable,
298
- projectDeleteVariable
273
+ projectGetUsage,
274
+ projectListVariables,
275
+ projectCreateVariable,
276
+ projectGetVariable,
277
+ projectUpdateVariable,
278
+ projectDeleteVariable
299
279
  };