appwrite-cli 6.2.3 → 7.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 +4 -4
  2. package/docs/examples/console/get-resource.md +3 -0
  3. package/docs/examples/databases/create-documents.md +4 -0
  4. package/docs/examples/databases/create-index.md +1 -0
  5. package/docs/examples/databases/delete-documents.md +4 -0
  6. package/docs/examples/databases/update-documents.md +5 -0
  7. package/docs/examples/databases/upsert-document.md +6 -0
  8. package/docs/examples/databases/upsert-documents.md +4 -0
  9. package/docs/examples/functions/{create-build.md → create-duplicate-deployment.md} +1 -1
  10. package/docs/examples/functions/create-template-deployment.md +7 -0
  11. package/docs/examples/functions/create-variable.md +2 -1
  12. package/docs/examples/functions/create-vcs-deployment.md +5 -0
  13. package/docs/examples/functions/create.md +0 -4
  14. package/docs/examples/functions/get-deployment-download.md +2 -1
  15. package/docs/examples/functions/get-usage.md +1 -0
  16. package/docs/examples/functions/list-executions.md +0 -1
  17. package/docs/examples/functions/list-usage.md +2 -0
  18. package/docs/examples/functions/{update-deployment-build.md → update-deployment-status.md} +1 -1
  19. package/docs/examples/functions/{update-deployment.md → update-function-deployment.md} +1 -1
  20. package/docs/examples/functions/update-variable.md +1 -0
  21. package/docs/examples/migrations/create-csv-migration.md +4 -0
  22. package/docs/examples/project/create-variable.md +2 -1
  23. package/docs/examples/project/update-variable.md +1 -0
  24. package/docs/examples/projects/create-dev-key.md +4 -0
  25. package/docs/examples/projects/delete-dev-key.md +3 -0
  26. package/docs/examples/projects/get-dev-key.md +3 -0
  27. package/docs/examples/projects/list-dev-keys.md +3 -0
  28. package/docs/examples/projects/update-dev-key.md +5 -0
  29. package/docs/examples/proxy/create-a-p-i-rule.md +2 -0
  30. package/docs/examples/proxy/create-function-rule.md +4 -0
  31. package/docs/examples/proxy/create-redirect-rule.md +4 -0
  32. package/docs/examples/proxy/create-site-rule.md +4 -0
  33. package/docs/examples/sites/create-deployment.md +7 -0
  34. package/docs/examples/sites/create-duplicate-deployment.md +3 -0
  35. package/docs/examples/sites/create-template-deployment.md +7 -0
  36. package/docs/examples/sites/create-variable.md +5 -0
  37. package/docs/examples/sites/create-vcs-deployment.md +5 -0
  38. package/docs/examples/sites/create.md +19 -0
  39. package/docs/examples/sites/delete-deployment.md +3 -0
  40. package/docs/examples/sites/delete-log.md +3 -0
  41. package/docs/examples/sites/delete-variable.md +3 -0
  42. package/docs/examples/sites/delete.md +2 -0
  43. package/docs/examples/sites/get-deployment-download.md +4 -0
  44. package/docs/examples/sites/get-deployment.md +3 -0
  45. package/docs/examples/sites/get-log.md +3 -0
  46. package/docs/examples/sites/get-template.md +2 -0
  47. package/docs/examples/sites/get-usage.md +3 -0
  48. package/docs/examples/sites/get-variable.md +3 -0
  49. package/docs/examples/sites/get.md +2 -0
  50. package/docs/examples/sites/list-deployments.md +4 -0
  51. package/docs/examples/sites/list-frameworks.md +1 -0
  52. package/docs/examples/sites/list-logs.md +3 -0
  53. package/docs/examples/sites/list-specifications.md +1 -0
  54. package/docs/examples/sites/list-templates.md +5 -0
  55. package/docs/examples/sites/list-usage.md +2 -0
  56. package/docs/examples/sites/list-variables.md +2 -0
  57. package/docs/examples/sites/list.md +3 -0
  58. package/docs/examples/sites/update-deployment-status.md +3 -0
  59. package/docs/examples/sites/update-site-deployment.md +3 -0
  60. package/docs/examples/sites/update-variable.md +6 -0
  61. package/docs/examples/sites/update.md +19 -0
  62. package/docs/examples/storage/get-file-download.md +2 -1
  63. package/docs/examples/storage/get-file-preview.md +1 -0
  64. package/docs/examples/storage/get-file-view.md +2 -1
  65. package/docs/examples/tokens/create-file-token.md +4 -0
  66. package/docs/examples/tokens/delete.md +2 -0
  67. package/docs/examples/tokens/get.md +2 -0
  68. package/docs/examples/tokens/list.md +4 -0
  69. package/docs/examples/tokens/update.md +3 -0
  70. package/docs/examples/users/list-memberships.md +3 -1
  71. package/docs/examples/vcs/create-repository-detection.md +1 -0
  72. package/docs/examples/vcs/list-repositories.md +1 -0
  73. package/index.js +4 -0
  74. package/install.ps1 +2 -2
  75. package/install.sh +1 -1
  76. package/lib/client.js +8 -4
  77. package/lib/commands/account.js +7 -17
  78. package/lib/commands/avatars.js +7 -14
  79. package/lib/commands/console.js +50 -1
  80. package/lib/commands/databases.js +287 -55
  81. package/lib/commands/functions.js +244 -146
  82. package/lib/commands/generic.js +1 -1
  83. package/lib/commands/health.js +0 -63
  84. package/lib/commands/init.js +191 -0
  85. package/lib/commands/locale.js +0 -8
  86. package/lib/commands/messaging.js +38 -51
  87. package/lib/commands/migrations.js +50 -5
  88. package/lib/commands/project.js +12 -5
  89. package/lib/commands/projects.js +246 -27
  90. package/lib/commands/proxy.js +160 -19
  91. package/lib/commands/pull.js +124 -1
  92. package/lib/commands/push.js +338 -5
  93. package/lib/commands/sites.js +1663 -0
  94. package/lib/commands/storage.js +28 -22
  95. package/lib/commands/teams.js +2 -8
  96. package/lib/commands/tokens.js +261 -0
  97. package/lib/commands/users.js +15 -17
  98. package/lib/commands/vcs.js +60 -53
  99. package/lib/config.js +50 -0
  100. package/lib/parser.js +2 -1
  101. package/lib/questions.js +110 -1
  102. package/package.json +1 -1
  103. package/scoop/appwrite.json +3 -3
  104. package/docs/examples/functions/get-function-usage.md +0 -3
  105. package/docs/examples/health/get-queue-stats-usage-dump.md +0 -2
  106. package/docs/examples/proxy/create-rule.md +0 -4
@@ -66,7 +66,6 @@ const messagingListMessages = async ({queries,search,parseOutput = true, overrid
66
66
  let response = undefined;
67
67
 
68
68
  response = await client.call('get', apiPath, {
69
- 'content-type': 'application/json',
70
69
  }, payload);
71
70
 
72
71
  if (parseOutput) {
@@ -600,7 +599,6 @@ const messagingGetMessage = async ({messageId,parseOutput = true, overrideForCli
600
599
  let response = undefined;
601
600
 
602
601
  response = await client.call('get', apiPath, {
603
- 'content-type': 'application/json',
604
602
  }, payload);
605
603
 
606
604
  if (parseOutput) {
@@ -670,7 +668,6 @@ const messagingListMessageLogs = async ({messageId,queries,parseOutput = true, o
670
668
  let response = undefined;
671
669
 
672
670
  response = await client.call('get', apiPath, {
673
- 'content-type': 'application/json',
674
671
  }, payload);
675
672
 
676
673
  if (parseOutput) {
@@ -709,7 +706,6 @@ const messagingListTargets = async ({messageId,queries,parseOutput = true, overr
709
706
  let response = undefined;
710
707
 
711
708
  response = await client.call('get', apiPath, {
712
- 'content-type': 'application/json',
713
709
  }, payload);
714
710
 
715
711
  if (parseOutput) {
@@ -747,7 +743,6 @@ const messagingListProviders = async ({queries,search,parseOutput = true, overri
747
743
  let response = undefined;
748
744
 
749
745
  response = await client.call('get', apiPath, {
750
- 'content-type': 'application/json',
751
746
  }, payload);
752
747
 
753
748
  if (parseOutput) {
@@ -1944,7 +1939,6 @@ const messagingGetProvider = async ({providerId,parseOutput = true, overrideForC
1944
1939
  let response = undefined;
1945
1940
 
1946
1941
  response = await client.call('get', apiPath, {
1947
- 'content-type': 'application/json',
1948
1942
  }, payload);
1949
1943
 
1950
1944
  if (parseOutput) {
@@ -2014,7 +2008,6 @@ const messagingListProviderLogs = async ({providerId,queries,parseOutput = true,
2014
2008
  let response = undefined;
2015
2009
 
2016
2010
  response = await client.call('get', apiPath, {
2017
- 'content-type': 'application/json',
2018
2011
  }, payload);
2019
2012
 
2020
2013
  if (parseOutput) {
@@ -2049,7 +2042,6 @@ const messagingListSubscriberLogs = async ({subscriberId,queries,parseOutput = t
2049
2042
  let response = undefined;
2050
2043
 
2051
2044
  response = await client.call('get', apiPath, {
2052
- 'content-type': 'application/json',
2053
2045
  }, payload);
2054
2046
 
2055
2047
  if (parseOutput) {
@@ -2087,7 +2079,6 @@ const messagingListTopics = async ({queries,search,parseOutput = true, overrideF
2087
2079
  let response = undefined;
2088
2080
 
2089
2081
  response = await client.call('get', apiPath, {
2090
- 'content-type': 'application/json',
2091
2082
  }, payload);
2092
2083
 
2093
2084
  if (parseOutput) {
@@ -2165,7 +2156,6 @@ const messagingGetTopic = async ({topicId,parseOutput = true, overrideForCli = f
2165
2156
  let response = undefined;
2166
2157
 
2167
2158
  response = await client.call('get', apiPath, {
2168
- 'content-type': 'application/json',
2169
2159
  }, payload);
2170
2160
 
2171
2161
  if (parseOutput) {
@@ -2275,7 +2265,6 @@ const messagingListTopicLogs = async ({topicId,queries,parseOutput = true, overr
2275
2265
  let response = undefined;
2276
2266
 
2277
2267
  response = await client.call('get', apiPath, {
2278
- 'content-type': 'application/json',
2279
2268
  }, payload);
2280
2269
 
2281
2270
  if (parseOutput) {
@@ -2314,7 +2303,6 @@ const messagingListSubscribers = async ({topicId,queries,search,parseOutput = tr
2314
2303
  let response = undefined;
2315
2304
 
2316
2305
  response = await client.call('get', apiPath, {
2317
- 'content-type': 'application/json',
2318
2306
  }, payload);
2319
2307
 
2320
2308
  if (parseOutput) {
@@ -2389,7 +2377,6 @@ const messagingGetSubscriber = async ({topicId,subscriberId,parseOutput = true,
2389
2377
  let response = undefined;
2390
2378
 
2391
2379
  response = await client.call('get', apiPath, {
2392
- 'content-type': 'application/json',
2393
2380
  }, payload);
2394
2381
 
2395
2382
  if (parseOutput) {
@@ -2452,8 +2439,8 @@ messaging
2452
2439
  .option(`--cc [cc...]`, `Array of target IDs to be added as CC.`)
2453
2440
  .option(`--bcc [bcc...]`, `Array of target IDs to be added as BCC.`)
2454
2441
  .option(`--attachments [attachments...]`, `Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.`)
2455
- .option(`--draft <draft>`, `Is message a draft`, parseBool)
2456
- .option(`--html <html>`, `Is content of type HTML`, parseBool)
2442
+ .option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
2443
+ .option(`--html [value]`, `Is content of type HTML`, (value) => value === undefined ? true : parseBool(value))
2457
2444
  .option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2458
2445
  .action(actionRunner(messagingCreateEmail))
2459
2446
 
@@ -2466,8 +2453,8 @@ messaging
2466
2453
  .option(`--targets [targets...]`, `List of Targets IDs.`)
2467
2454
  .option(`--subject <subject>`, `Email Subject.`)
2468
2455
  .option(`--content <content>`, `Email Content.`)
2469
- .option(`--draft <draft>`, `Is message a draft`, parseBool)
2470
- .option(`--html <html>`, `Is content of type HTML`, parseBool)
2456
+ .option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
2457
+ .option(`--html [value]`, `Is content of type HTML`, (value) => value === undefined ? true : parseBool(value))
2471
2458
  .option(`--cc [cc...]`, `Array of target IDs to be added as CC.`)
2472
2459
  .option(`--bcc [bcc...]`, `Array of target IDs to be added as BCC.`)
2473
2460
  .option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
@@ -2491,10 +2478,10 @@ messaging
2491
2478
  .option(`--color <color>`, `Color for push notification. Available only for Android Platform.`)
2492
2479
  .option(`--tag <tag>`, `Tag for push notification. Available only for Android Platform.`)
2493
2480
  .option(`--badge <badge>`, `Badge for push notification. Available only for iOS Platform.`, parseInteger)
2494
- .option(`--draft <draft>`, `Is message a draft`, parseBool)
2481
+ .option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
2495
2482
  .option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2496
- .option(`--content-available <content-available>`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, parseBool)
2497
- .option(`--critical <critical>`, `If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.`, parseBool)
2483
+ .option(`--content-available [value]`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, (value) => value === undefined ? true : parseBool(value))
2484
+ .option(`--critical [value]`, `If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.`, (value) => value === undefined ? true : parseBool(value))
2498
2485
  .option(`--priority <priority>`, `Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.`)
2499
2486
  .action(actionRunner(messagingCreatePush))
2500
2487
 
@@ -2515,10 +2502,10 @@ messaging
2515
2502
  .option(`--color <color>`, `Color for push notification. Available only for Android platforms.`)
2516
2503
  .option(`--tag <tag>`, `Tag for push notification. Available only for Android platforms.`)
2517
2504
  .option(`--badge <badge>`, `Badge for push notification. Available only for iOS platforms.`, parseInteger)
2518
- .option(`--draft <draft>`, `Is message a draft`, parseBool)
2505
+ .option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
2519
2506
  .option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2520
- .option(`--content-available <content-available>`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, parseBool)
2521
- .option(`--critical <critical>`, `If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.`, parseBool)
2507
+ .option(`--content-available [value]`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, (value) => value === undefined ? true : parseBool(value))
2508
+ .option(`--critical [value]`, `If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.`, (value) => value === undefined ? true : parseBool(value))
2522
2509
  .option(`--priority <priority>`, `Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.`)
2523
2510
  .action(actionRunner(messagingUpdatePush))
2524
2511
 
@@ -2530,7 +2517,7 @@ messaging
2530
2517
  .option(`--topics [topics...]`, `List of Topic IDs.`)
2531
2518
  .option(`--users [users...]`, `List of User IDs.`)
2532
2519
  .option(`--targets [targets...]`, `List of Targets IDs.`)
2533
- .option(`--draft <draft>`, `Is message a draft`, parseBool)
2520
+ .option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
2534
2521
  .option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2535
2522
  .action(actionRunner(messagingCreateSms))
2536
2523
 
@@ -2542,7 +2529,7 @@ messaging
2542
2529
  .option(`--users [users...]`, `List of User IDs.`)
2543
2530
  .option(`--targets [targets...]`, `List of Targets IDs.`)
2544
2531
  .option(`--content <content>`, `Email Content.`)
2545
- .option(`--draft <draft>`, `Is message a draft`, parseBool)
2532
+ .option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
2546
2533
  .option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2547
2534
  .action(actionRunner(messagingUpdateSms))
2548
2535
 
@@ -2591,8 +2578,8 @@ messaging
2591
2578
  .option(`--auth-key-id <auth-key-id>`, `APNS authentication key ID.`)
2592
2579
  .option(`--team-id <team-id>`, `APNS team ID.`)
2593
2580
  .option(`--bundle-id <bundle-id>`, `APNS bundle ID.`)
2594
- .option(`--sandbox <sandbox>`, `Use APNS sandbox environment.`, parseBool)
2595
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2581
+ .option(`--sandbox [value]`, `Use APNS sandbox environment.`, (value) => value === undefined ? true : parseBool(value))
2582
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2596
2583
  .action(actionRunner(messagingCreateApnsProvider))
2597
2584
 
2598
2585
  messaging
@@ -2600,12 +2587,12 @@ messaging
2600
2587
  .description(`Update a Apple Push Notification service provider by its unique ID.`)
2601
2588
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
2602
2589
  .option(`--name <name>`, `Provider name.`)
2603
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2590
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2604
2591
  .option(`--auth-key <auth-key>`, `APNS authentication key.`)
2605
2592
  .option(`--auth-key-id <auth-key-id>`, `APNS authentication key ID.`)
2606
2593
  .option(`--team-id <team-id>`, `APNS team ID.`)
2607
2594
  .option(`--bundle-id <bundle-id>`, `APNS bundle ID.`)
2608
- .option(`--sandbox <sandbox>`, `Use APNS sandbox environment.`, parseBool)
2595
+ .option(`--sandbox [value]`, `Use APNS sandbox environment.`, (value) => value === undefined ? true : parseBool(value))
2609
2596
  .action(actionRunner(messagingUpdateApnsProvider))
2610
2597
 
2611
2598
  messaging
@@ -2614,7 +2601,7 @@ messaging
2614
2601
  .requiredOption(`--provider-id <provider-id>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2615
2602
  .requiredOption(`--name <name>`, `Provider name.`)
2616
2603
  .option(`--service-account-json <service-account-json>`, `FCM service account JSON.`)
2617
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2604
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2618
2605
  .action(actionRunner(messagingCreateFcmProvider))
2619
2606
 
2620
2607
  messaging
@@ -2622,7 +2609,7 @@ messaging
2622
2609
  .description(`Update a Firebase Cloud Messaging provider by its unique ID.`)
2623
2610
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
2624
2611
  .option(`--name <name>`, `Provider name.`)
2625
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2612
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2626
2613
  .option(`--service-account-json <service-account-json>`, `FCM service account JSON.`)
2627
2614
  .action(actionRunner(messagingUpdateFcmProvider))
2628
2615
 
@@ -2633,12 +2620,12 @@ messaging
2633
2620
  .requiredOption(`--name <name>`, `Provider name.`)
2634
2621
  .option(`--api-key <api-key>`, `Mailgun API Key.`)
2635
2622
  .option(`--domain <domain>`, `Mailgun Domain.`)
2636
- .option(`--is-eu-region <is-eu-region>`, `Set as EU region.`, parseBool)
2623
+ .option(`--is-eu-region [value]`, `Set as EU region.`, (value) => value === undefined ? true : parseBool(value))
2637
2624
  .option(`--from-name <from-name>`, `Sender Name.`)
2638
2625
  .option(`--from-email <from-email>`, `Sender email address.`)
2639
2626
  .option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.`)
2640
2627
  .option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.`)
2641
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2628
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2642
2629
  .action(actionRunner(messagingCreateMailgunProvider))
2643
2630
 
2644
2631
  messaging
@@ -2648,8 +2635,8 @@ messaging
2648
2635
  .option(`--name <name>`, `Provider name.`)
2649
2636
  .option(`--api-key <api-key>`, `Mailgun API Key.`)
2650
2637
  .option(`--domain <domain>`, `Mailgun Domain.`)
2651
- .option(`--is-eu-region <is-eu-region>`, `Set as EU region.`, parseBool)
2652
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2638
+ .option(`--is-eu-region [value]`, `Set as EU region.`, (value) => value === undefined ? true : parseBool(value))
2639
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2653
2640
  .option(`--from-name <from-name>`, `Sender Name.`)
2654
2641
  .option(`--from-email <from-email>`, `Sender email address.`)
2655
2642
  .option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
@@ -2664,7 +2651,7 @@ messaging
2664
2651
  .option(`--template-id <template-id>`, `Msg91 template ID`)
2665
2652
  .option(`--sender-id <sender-id>`, `Msg91 sender ID.`)
2666
2653
  .option(`--auth-key <auth-key>`, `Msg91 auth key.`)
2667
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2654
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2668
2655
  .action(actionRunner(messagingCreateMsg91Provider))
2669
2656
 
2670
2657
  messaging
@@ -2672,7 +2659,7 @@ messaging
2672
2659
  .description(`Update a MSG91 provider by its unique ID.`)
2673
2660
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
2674
2661
  .option(`--name <name>`, `Provider name.`)
2675
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2662
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2676
2663
  .option(`--template-id <template-id>`, `Msg91 template ID.`)
2677
2664
  .option(`--sender-id <sender-id>`, `Msg91 sender ID.`)
2678
2665
  .option(`--auth-key <auth-key>`, `Msg91 auth key.`)
@@ -2688,7 +2675,7 @@ messaging
2688
2675
  .option(`--from-email <from-email>`, `Sender email address.`)
2689
2676
  .option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
2690
2677
  .option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email.`)
2691
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2678
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2692
2679
  .action(actionRunner(messagingCreateSendgridProvider))
2693
2680
 
2694
2681
  messaging
@@ -2696,7 +2683,7 @@ messaging
2696
2683
  .description(`Update a Sendgrid provider by its unique ID.`)
2697
2684
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
2698
2685
  .option(`--name <name>`, `Provider name.`)
2699
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2686
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2700
2687
  .option(`--api-key <api-key>`, `Sendgrid API key.`)
2701
2688
  .option(`--from-name <from-name>`, `Sender Name.`)
2702
2689
  .option(`--from-email <from-email>`, `Sender email address.`)
@@ -2714,13 +2701,13 @@ messaging
2714
2701
  .option(`--username <username>`, `Authentication username.`)
2715
2702
  .option(`--password <password>`, `Authentication password.`)
2716
2703
  .option(`--encryption <encryption>`, `Encryption type. Can be omitted, 'ssl', or 'tls'`)
2717
- .option(`--auto-tls <auto-tls>`, `Enable SMTP AutoTLS feature.`, parseBool)
2704
+ .option(`--auto-tls [value]`, `Enable SMTP AutoTLS feature.`, (value) => value === undefined ? true : parseBool(value))
2718
2705
  .option(`--mailer <mailer>`, `The value to use for the X-Mailer header.`)
2719
2706
  .option(`--from-name <from-name>`, `Sender Name.`)
2720
2707
  .option(`--from-email <from-email>`, `Sender email address.`)
2721
2708
  .option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
2722
2709
  .option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email.`)
2723
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2710
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2724
2711
  .action(actionRunner(messagingCreateSmtpProvider))
2725
2712
 
2726
2713
  messaging
@@ -2733,13 +2720,13 @@ messaging
2733
2720
  .option(`--username <username>`, `Authentication username.`)
2734
2721
  .option(`--password <password>`, `Authentication password.`)
2735
2722
  .option(`--encryption <encryption>`, `Encryption type. Can be 'ssl' or 'tls'`)
2736
- .option(`--auto-tls <auto-tls>`, `Enable SMTP AutoTLS feature.`, parseBool)
2723
+ .option(`--auto-tls [value]`, `Enable SMTP AutoTLS feature.`, (value) => value === undefined ? true : parseBool(value))
2737
2724
  .option(`--mailer <mailer>`, `The value to use for the X-Mailer header.`)
2738
2725
  .option(`--from-name <from-name>`, `Sender Name.`)
2739
2726
  .option(`--from-email <from-email>`, `Sender email address.`)
2740
2727
  .option(`--reply-to-name <reply-to-name>`, `Name set in the Reply To field for the mail. Default value is Sender Name.`)
2741
2728
  .option(`--reply-to-email <reply-to-email>`, `Email set in the Reply To field for the mail. Default value is Sender Email.`)
2742
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2729
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2743
2730
  .action(actionRunner(messagingUpdateSmtpProvider))
2744
2731
 
2745
2732
  messaging
@@ -2750,7 +2737,7 @@ messaging
2750
2737
  .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2751
2738
  .option(`--customer-id <customer-id>`, `Telesign customer ID.`)
2752
2739
  .option(`--api-key <api-key>`, `Telesign API key.`)
2753
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2740
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2754
2741
  .action(actionRunner(messagingCreateTelesignProvider))
2755
2742
 
2756
2743
  messaging
@@ -2758,7 +2745,7 @@ messaging
2758
2745
  .description(`Update a Telesign provider by its unique ID.`)
2759
2746
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
2760
2747
  .option(`--name <name>`, `Provider name.`)
2761
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2748
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2762
2749
  .option(`--customer-id <customer-id>`, `Telesign customer ID.`)
2763
2750
  .option(`--api-key <api-key>`, `Telesign API key.`)
2764
2751
  .option(`--from <from>`, `Sender number.`)
@@ -2772,7 +2759,7 @@ messaging
2772
2759
  .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2773
2760
  .option(`--username <username>`, `Textmagic username.`)
2774
2761
  .option(`--api-key <api-key>`, `Textmagic apiKey.`)
2775
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2762
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2776
2763
  .action(actionRunner(messagingCreateTextmagicProvider))
2777
2764
 
2778
2765
  messaging
@@ -2780,7 +2767,7 @@ messaging
2780
2767
  .description(`Update a Textmagic provider by its unique ID.`)
2781
2768
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
2782
2769
  .option(`--name <name>`, `Provider name.`)
2783
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2770
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2784
2771
  .option(`--username <username>`, `Textmagic username.`)
2785
2772
  .option(`--api-key <api-key>`, `Textmagic apiKey.`)
2786
2773
  .option(`--from <from>`, `Sender number.`)
@@ -2794,7 +2781,7 @@ messaging
2794
2781
  .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2795
2782
  .option(`--account-sid <account-sid>`, `Twilio account secret ID.`)
2796
2783
  .option(`--auth-token <auth-token>`, `Twilio authentication token.`)
2797
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2784
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2798
2785
  .action(actionRunner(messagingCreateTwilioProvider))
2799
2786
 
2800
2787
  messaging
@@ -2802,7 +2789,7 @@ messaging
2802
2789
  .description(`Update a Twilio provider by its unique ID.`)
2803
2790
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
2804
2791
  .option(`--name <name>`, `Provider name.`)
2805
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2792
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2806
2793
  .option(`--account-sid <account-sid>`, `Twilio account secret ID.`)
2807
2794
  .option(`--auth-token <auth-token>`, `Twilio authentication token.`)
2808
2795
  .option(`--from <from>`, `Sender number.`)
@@ -2816,7 +2803,7 @@ messaging
2816
2803
  .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2817
2804
  .option(`--api-key <api-key>`, `Vonage API key.`)
2818
2805
  .option(`--api-secret <api-secret>`, `Vonage API secret.`)
2819
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2806
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2820
2807
  .action(actionRunner(messagingCreateVonageProvider))
2821
2808
 
2822
2809
  messaging
@@ -2824,7 +2811,7 @@ messaging
2824
2811
  .description(`Update a Vonage provider by its unique ID.`)
2825
2812
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
2826
2813
  .option(`--name <name>`, `Provider name.`)
2827
- .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2814
+ .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
2828
2815
  .option(`--api-key <api-key>`, `Vonage API key.`)
2829
2816
  .option(`--api-secret <api-secret>`, `Vonage API secret.`)
2830
2817
  .option(`--from <from>`, `Sender number.`)
@@ -66,7 +66,6 @@ const migrationsList = async ({queries,search,parseOutput = true, overrideForCli
66
66
  let response = undefined;
67
67
 
68
68
  response = await client.call('get', apiPath, {
69
- 'content-type': 'application/json',
70
69
  }, payload);
71
70
 
72
71
  if (parseOutput) {
@@ -159,6 +158,47 @@ const migrationsGetAppwriteReport = async ({resources,endpoint,projectID,key,par
159
158
  let response = undefined;
160
159
 
161
160
  response = await client.call('get', apiPath, {
161
+ }, payload);
162
+
163
+ if (parseOutput) {
164
+ parse(response)
165
+ }
166
+
167
+ return response;
168
+
169
+ }
170
+
171
+ /**
172
+ * @typedef {Object} MigrationsCreateCsvMigrationRequestParams
173
+ * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
174
+ * @property {string} fileId File ID.
175
+ * @property {string} resourceId Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.
176
+ * @property {boolean} overrideForCli
177
+ * @property {boolean} parseOutput
178
+ * @property {libClient | undefined} sdk
179
+ */
180
+
181
+ /**
182
+ * @param {MigrationsCreateCsvMigrationRequestParams} params
183
+ */
184
+ const migrationsCreateCsvMigration = async ({bucketId,fileId,resourceId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
185
+ let client = !sdk ? await sdkForProject() :
186
+ sdk;
187
+ let apiPath = '/migrations/csv';
188
+ let payload = {};
189
+ if (typeof bucketId !== 'undefined') {
190
+ payload['bucketId'] = bucketId;
191
+ }
192
+ if (typeof fileId !== 'undefined') {
193
+ payload['fileId'] = fileId;
194
+ }
195
+ if (typeof resourceId !== 'undefined') {
196
+ payload['resourceId'] = resourceId;
197
+ }
198
+
199
+ let response = undefined;
200
+
201
+ response = await client.call('post', apiPath, {
162
202
  'content-type': 'application/json',
163
203
  }, payload);
164
204
 
@@ -236,7 +276,6 @@ const migrationsGetFirebaseReport = async ({resources,serviceAccount,parseOutput
236
276
  let response = undefined;
237
277
 
238
278
  response = await client.call('get', apiPath, {
239
- 'content-type': 'application/json',
240
279
  }, payload);
241
280
 
242
281
  if (parseOutput) {
@@ -361,7 +400,6 @@ const migrationsGetNHostReport = async ({resources,subdomain,region,adminSecret,
361
400
  let response = undefined;
362
401
 
363
402
  response = await client.call('get', apiPath, {
364
- 'content-type': 'application/json',
365
403
  }, payload);
366
404
 
367
405
  if (parseOutput) {
@@ -478,7 +516,6 @@ const migrationsGetSupabaseReport = async ({resources,endpoint,apiKey,databaseHo
478
516
  let response = undefined;
479
517
 
480
518
  response = await client.call('get', apiPath, {
481
- 'content-type': 'application/json',
482
519
  }, payload);
483
520
 
484
521
  if (parseOutput) {
@@ -509,7 +546,6 @@ const migrationsGet = async ({migrationId,parseOutput = true, overrideForCli = f
509
546
  let response = undefined;
510
547
 
511
548
  response = await client.call('get', apiPath, {
512
- 'content-type': 'application/json',
513
549
  }, payload);
514
550
 
515
551
  if (parseOutput) {
@@ -607,6 +643,14 @@ migrations
607
643
  .requiredOption(`--key <key>`, `Source's API Key`)
608
644
  .action(actionRunner(migrationsGetAppwriteReport))
609
645
 
646
+ migrations
647
+ .command(`create-csv-migration`)
648
+ .description(`Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.`)
649
+ .requiredOption(`--bucket-id <bucket-id>`, `Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).`)
650
+ .requiredOption(`--file-id <file-id>`, `File ID.`)
651
+ .requiredOption(`--resource-id <resource-id>`, `Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.`)
652
+ .action(actionRunner(migrationsCreateCsvMigration))
653
+
610
654
  migrations
611
655
  .command(`create-firebase-migration`)
612
656
  .description(`Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. `)
@@ -694,6 +738,7 @@ module.exports = {
694
738
  migrationsList,
695
739
  migrationsCreateAppwriteMigration,
696
740
  migrationsGetAppwriteReport,
741
+ migrationsCreateCsvMigration,
697
742
  migrationsCreateFirebaseMigration,
698
743
  migrationsGetFirebaseReport,
699
744
  migrationsCreateNHostMigration,
@@ -70,7 +70,6 @@ const projectGetUsage = async ({startDate,endDate,period,parseOutput = true, ove
70
70
  let response = undefined;
71
71
 
72
72
  response = await client.call('get', apiPath, {
73
- 'content-type': 'application/json',
74
73
  }, payload);
75
74
 
76
75
  if (parseOutput) {
@@ -100,7 +99,6 @@ const projectListVariables = async ({parseOutput = true, overrideForCli = false,
100
99
  let response = undefined;
101
100
 
102
101
  response = await client.call('get', apiPath, {
103
- 'content-type': 'application/json',
104
102
  }, payload);
105
103
 
106
104
  if (parseOutput) {
@@ -115,6 +113,7 @@ const projectListVariables = async ({parseOutput = true, overrideForCli = false,
115
113
  * @typedef {Object} ProjectCreateVariableRequestParams
116
114
  * @property {string} key Variable key. Max length: 255 chars.
117
115
  * @property {string} value Variable value. Max length: 8192 chars.
116
+ * @property {boolean} secret Secret variables can be updated or deleted, but only projects can read them during build and runtime.
118
117
  * @property {boolean} overrideForCli
119
118
  * @property {boolean} parseOutput
120
119
  * @property {libClient | undefined} sdk
@@ -123,7 +122,7 @@ const projectListVariables = async ({parseOutput = true, overrideForCli = false,
123
122
  /**
124
123
  * @param {ProjectCreateVariableRequestParams} params
125
124
  */
126
- const projectCreateVariable = async ({key,value,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
125
+ const projectCreateVariable = async ({key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
127
126
  let client = !sdk ? await sdkForProject() :
128
127
  sdk;
129
128
  let apiPath = '/project/variables';
@@ -134,6 +133,9 @@ const projectCreateVariable = async ({key,value,parseOutput = true, overrideForC
134
133
  if (typeof value !== 'undefined') {
135
134
  payload['value'] = value;
136
135
  }
136
+ if (typeof secret !== 'undefined') {
137
+ payload['secret'] = secret;
138
+ }
137
139
 
138
140
  let response = undefined;
139
141
 
@@ -169,7 +171,6 @@ const projectGetVariable = async ({variableId,parseOutput = true, overrideForCli
169
171
  let response = undefined;
170
172
 
171
173
  response = await client.call('get', apiPath, {
172
- 'content-type': 'application/json',
173
174
  }, payload);
174
175
 
175
176
  if (parseOutput) {
@@ -185,6 +186,7 @@ const projectGetVariable = async ({variableId,parseOutput = true, overrideForCli
185
186
  * @property {string} variableId Variable unique ID.
186
187
  * @property {string} key Variable key. Max length: 255 chars.
187
188
  * @property {string} value Variable value. Max length: 8192 chars.
189
+ * @property {boolean} secret Secret variables can be updated or deleted, but only projects can read them during build and runtime.
188
190
  * @property {boolean} overrideForCli
189
191
  * @property {boolean} parseOutput
190
192
  * @property {libClient | undefined} sdk
@@ -193,7 +195,7 @@ const projectGetVariable = async ({variableId,parseOutput = true, overrideForCli
193
195
  /**
194
196
  * @param {ProjectUpdateVariableRequestParams} params
195
197
  */
196
- const projectUpdateVariable = async ({variableId,key,value,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
198
+ const projectUpdateVariable = async ({variableId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
197
199
  let client = !sdk ? await sdkForProject() :
198
200
  sdk;
199
201
  let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
@@ -204,6 +206,9 @@ const projectUpdateVariable = async ({variableId,key,value,parseOutput = true, o
204
206
  if (typeof value !== 'undefined') {
205
207
  payload['value'] = value;
206
208
  }
209
+ if (typeof secret !== 'undefined') {
210
+ payload['secret'] = secret;
211
+ }
207
212
 
208
213
  let response = undefined;
209
214
 
@@ -268,6 +273,7 @@ project
268
273
  .description(`Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.`)
269
274
  .requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
270
275
  .requiredOption(`--value <value>`, `Variable value. Max length: 8192 chars.`)
276
+ .option(`--secret [value]`, `Secret variables can be updated or deleted, but only projects can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
271
277
  .action(actionRunner(projectCreateVariable))
272
278
 
273
279
  project
@@ -282,6 +288,7 @@ project
282
288
  .requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
283
289
  .requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
284
290
  .option(`--value <value>`, `Variable value. Max length: 8192 chars.`)
291
+ .option(`--secret [value]`, `Secret variables can be updated or deleted, but only projects can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
285
292
  .action(actionRunner(projectUpdateVariable))
286
293
 
287
294
  project