zapier-platform-cli 16.3.1 → 16.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/oclif.manifest.json +203 -134
- package/package.json +1 -1
- package/src/oclif/ZapierBaseCommand.js +1 -1
- package/src/oclif/commands/deprecate.js +42 -8
- package/src/oclif/commands/invoke.js +278 -14
- package/src/oclif/commands/legacy.js +61 -0
- package/src/oclif/commands/promote.js +0 -5
- package/src/oclif/commands/versions.js +28 -4
- package/src/oclif/oCommands.js +1 -0
- package/src/utils/api.js +9 -0
- package/src/utils/local.js +266 -2
package/oclif.manifest.json
CHANGED
|
@@ -178,11 +178,18 @@
|
|
|
178
178
|
"required": true
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
|
-
"description": "Mark a non-production version of your integration as deprecated, with removal by a certain date.\n\nUse this when an integration version will not be supported or start breaking at a known date.\n\nZapier will send
|
|
181
|
+
"description": "Mark a non-production version of your integration as deprecated, with removal by a certain date.\n\nUse this when an integration version will not be supported or start breaking at a known date.\n\nZapier will immediately send emails warning users of the deprecation if a date less than 30 days in the future is set, otherwise the emails will be sent exactly 30 days before the configured deprecation date.\n\nThere are other side effects: they'll start seeing it as \"Deprecated\" in the UI, and once the deprecation date arrives, if the Zaps weren't updated, they'll be paused and the users will be emailed again explaining what happened.\n\nDo not use deprecation if you only have non-breaking changes, such as:\n- Fixing help text\n- Adding new triggers/actions\n- Improving existing functionality\n- other bug fixes that don't break existing automations.",
|
|
182
182
|
"examples": [
|
|
183
183
|
"zapier deprecate 1.2.3 2011-10-01"
|
|
184
184
|
],
|
|
185
185
|
"flags": {
|
|
186
|
+
"force": {
|
|
187
|
+
"char": "f",
|
|
188
|
+
"description": "Skip confirmation prompt. Use with caution.",
|
|
189
|
+
"name": "force",
|
|
190
|
+
"allowNo": false,
|
|
191
|
+
"type": "boolean"
|
|
192
|
+
},
|
|
186
193
|
"debug": {
|
|
187
194
|
"char": "d",
|
|
188
195
|
"description": "Show extra debugging output.",
|
|
@@ -459,7 +466,7 @@
|
|
|
459
466
|
"name": "actionKey"
|
|
460
467
|
}
|
|
461
468
|
},
|
|
462
|
-
"description": "Invoke an auth operation, a trigger, or a create/search action locally.\n\nThis command emulates how Zapier production environment would invoke your integration. It runs code locally, so you can use this command to quickly test your integration without deploying it to Zapier. This is especially useful for debugging and development.\n\nThis command loads environment variables and `authData` from the `.env` file in the current directory. If you don't have a `.env` file yet, you can use the `zapier invoke auth start` command to help you initialize it, or you can manually create it.\n\nThe `zapier invoke auth start` subcommand will prompt you for the necessary auth fields and save them to the `.env` file. For OAuth2, it will start a local HTTP server, open the authorization URL in the browser, wait for the OAuth2 redirect, and get the access token.\n\nEach line in the `.env` file should follow one of these formats:\n\n* `VAR_NAME=VALUE` for environment variables\n* `authData_FIELD_KEY=VALUE` for auth data fields\n\nFor example, a `.env` file for an OAuth2 integration might look like this:\n\n```\nCLIENT_ID='your_client_id'\nCLIENT_SECRET='your_client_secret'\nauthData_access_token='1234567890'\nauthData_refresh_token='abcdefg'\nauthData_account_name='zapier'\n```\n\nTo test if the auth data is correct, run either one of these:\n\n```\nzapier invoke auth test # invokes authentication.test method\nzapier invoke auth label # invokes authentication.test and renders connection label\n```\n\nTo refresh stale auth data for OAuth2 or session auth, run `zapier invoke auth refresh
|
|
469
|
+
"description": "Invoke an auth operation, a trigger, or a create/search action locally.\n\nThis command emulates how Zapier production environment would invoke your integration. It runs code locally, so you can use this command to quickly test your integration without deploying it to Zapier. This is especially useful for debugging and development.\n\nWhy use this command?\n\n* Fast feedback loop: Write code and run this command to verify if it works immediately\n* Step-by-step debugging: Running locally means you can use a debugger to step through your code\n* Untruncated logs: View complete logs and errors in your terminal\n\n### Authentication\n\nYou can supply the authentcation data in two ways: Load from the local `.env` file or use the (experimental) `--authentication-id` flag.\n\n#### The local `.env` file\n\nThis command loads environment variables and `authData` from the `.env` file in the current directory. If you don't have a `.env` file yet, you can use the `zapier invoke auth start` command to help you initialize it, or you can manually create it.\n\nThe `zapier invoke auth start` subcommand will prompt you for the necessary auth fields and save them to the `.env` file. For OAuth2, it will start a local HTTP server, open the authorization URL in the browser, wait for the OAuth2 redirect, and get the access token.\n\nEach line in the `.env` file should follow one of these formats:\n\n* `VAR_NAME=VALUE` for environment variables\n* `authData_FIELD_KEY=VALUE` for auth data fields\n\nFor example, a `.env` file for an OAuth2 integration might look like this:\n\n```\nCLIENT_ID='your_client_id'\nCLIENT_SECRET='your_client_secret'\nauthData_access_token='1234567890'\nauthData_refresh_token='abcdefg'\nauthData_account_name='zapier'\n```\n\n\n#### The `--authentication-id` flag (EXPERIMENTAL)\n\nSetting up local auth data can be troublesome. You'd have to configure your app server to allow localhost redirect URIs or use a port forwarding tool. This is sometimes not easy to get right.\n\nThe `--authentication-id` flag (`-a` for short) gives you an alternative (and perhaps easier) way to supply your auth data. You can use `-a` to specify an existing production authentication/connection. The available authentications can be found at https://zapier.com/app/assets/connections. Check https://zpr.io/z8SjFTdnTFZ2 for more instructions.\n\nWhen `-a -` is specified, such as `zapier invoke auth test -a -`, the command will interactively prompt you to select one of your available authentications.\n\nIf you know your authentication ID, you can specify it directly, such as `zapier invoke auth test -a 123456`.\n\n#### Testing authentication\n\nTo test if the auth data is correct, run either one of these:\n\n```\nzapier invoke auth test # invokes authentication.test method\nzapier invoke auth label # invokes authentication.test and renders connection label\n```\n\nTo refresh stale auth data for OAuth2 or session auth, run `zapier invoke auth refresh`. Note that refreshing is only applicable for local auth data in the `.env` file.\n\n### Invoking a trigger or an action\n\nOnce you have the correct auth data, you can test an trigger, a search, or a create action. For example, here's how you invoke a trigger with the key `new_recipe`:\n\n```\nzapier invoke trigger new_recipe\n```\n\nTo add input data, use the `--inputData` flag (`-i` for short). The input data can come from the command directly, a file, or stdin. See **EXAMPLES** below.\n\nWhen you miss any command arguments, such as ACTIONTYPE or ACTIONKEY, the command will prompt you interactively. If you don't want to get interactive prompts, use the `--non-interactive` flag.\n\nThe `--debug` flag will show you the HTTP request logs and any console logs you have in your code.\n\n### Limitations\n\nThe following is a non-exhaustive list of current limitations and may be supported in the future:\n\n- Hook triggers, including REST hook subscribe/unsubscribe\n- Line items\n- Output hydration\n- File upload\n- Dynamic dropdown pagination\n- Function-based connection label\n- Buffered create actions\n- Search-or-create actions\n- Search-powered fields\n- Field choices\n- autoRefresh for OAuth2 and session auth\n",
|
|
463
470
|
"examples": [
|
|
464
471
|
"zapier invoke",
|
|
465
472
|
"zapier invoke auth start",
|
|
@@ -468,8 +475,10 @@
|
|
|
468
475
|
"zapier invoke auth label",
|
|
469
476
|
"zapier invoke trigger new_recipe",
|
|
470
477
|
"zapier invoke create add_recipe --inputData '{\"title\": \"Pancakes\"}'",
|
|
471
|
-
"zapier invoke search find_recipe -i @file.json",
|
|
472
|
-
"cat file.json | zapier invoke trigger new_recipe -i @-"
|
|
478
|
+
"zapier invoke search find_recipe -i @file.json --non-interactive",
|
|
479
|
+
"cat file.json | zapier invoke trigger new_recipe -i @-",
|
|
480
|
+
"zapier invoke search find_ticket --authentication-id 12345",
|
|
481
|
+
"zapier invoke create add_ticket -a -"
|
|
473
482
|
],
|
|
474
483
|
"flags": {
|
|
475
484
|
"inputData": {
|
|
@@ -546,6 +555,14 @@
|
|
|
546
555
|
"multiple": false,
|
|
547
556
|
"type": "option"
|
|
548
557
|
},
|
|
558
|
+
"authentication-id": {
|
|
559
|
+
"char": "a",
|
|
560
|
+
"description": "EXPERIMENTAL: Instead of using the local .env file, use the production authentication data with the given authentication ID (aka the \"app connection\" on Zapier). Find them at https://zapier.com/app/assets/connections (https://zpr.io/z8SjFTdnTFZ2 for instructions) or specify '-' to interactively select one from your available authentications. When specified, the code will still run locally, but all outgoing requests will be proxied through Zapier with the production auth data.",
|
|
561
|
+
"name": "authentication-id",
|
|
562
|
+
"hasDynamicHelp": false,
|
|
563
|
+
"multiple": false,
|
|
564
|
+
"type": "option"
|
|
565
|
+
},
|
|
549
566
|
"debug": {
|
|
550
567
|
"char": "d",
|
|
551
568
|
"description": "Show extra debugging output.",
|
|
@@ -632,6 +649,58 @@
|
|
|
632
649
|
"jobs.js"
|
|
633
650
|
]
|
|
634
651
|
},
|
|
652
|
+
"legacy": {
|
|
653
|
+
"aliases": [],
|
|
654
|
+
"args": {
|
|
655
|
+
"version": {
|
|
656
|
+
"description": "The version to mark as legacy.",
|
|
657
|
+
"name": "version",
|
|
658
|
+
"required": true
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
"description": "Mark a non-production version of your integration as legacy.\n\nUse this when an integration version is no longer recommended for new users, but you don't want to block existing users from using it.\n\nReasons why you might want to mark a version as legacy:\n- this version may be discontinued in the future\n- this version has bugs\n- a newer version has been released and you want to encourage users to upgrade\n\n",
|
|
662
|
+
"examples": [
|
|
663
|
+
"zapier legacy 1.2.3"
|
|
664
|
+
],
|
|
665
|
+
"flags": {
|
|
666
|
+
"force": {
|
|
667
|
+
"char": "f",
|
|
668
|
+
"description": "Skip confirmation prompt. Use with caution.",
|
|
669
|
+
"name": "force",
|
|
670
|
+
"allowNo": false,
|
|
671
|
+
"type": "boolean"
|
|
672
|
+
},
|
|
673
|
+
"debug": {
|
|
674
|
+
"char": "d",
|
|
675
|
+
"description": "Show extra debugging output.",
|
|
676
|
+
"name": "debug",
|
|
677
|
+
"allowNo": false,
|
|
678
|
+
"type": "boolean"
|
|
679
|
+
},
|
|
680
|
+
"invokedFromAnotherCommand": {
|
|
681
|
+
"hidden": true,
|
|
682
|
+
"name": "invokedFromAnotherCommand",
|
|
683
|
+
"allowNo": false,
|
|
684
|
+
"type": "boolean"
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
"hasDynamicHelp": false,
|
|
688
|
+
"hiddenAliases": [],
|
|
689
|
+
"id": "legacy",
|
|
690
|
+
"pluginAlias": "zapier-platform-cli",
|
|
691
|
+
"pluginName": "zapier-platform-cli",
|
|
692
|
+
"pluginType": "core",
|
|
693
|
+
"strict": true,
|
|
694
|
+
"enableJsonFlag": false,
|
|
695
|
+
"skipValidInstallCheck": true,
|
|
696
|
+
"isESM": false,
|
|
697
|
+
"relativePath": [
|
|
698
|
+
"src",
|
|
699
|
+
"oclif",
|
|
700
|
+
"commands",
|
|
701
|
+
"legacy.js"
|
|
702
|
+
]
|
|
703
|
+
},
|
|
635
704
|
"link": {
|
|
636
705
|
"aliases": [],
|
|
637
706
|
"args": {},
|
|
@@ -1444,7 +1513,7 @@
|
|
|
1444
1513
|
"versions": {
|
|
1445
1514
|
"aliases": [],
|
|
1446
1515
|
"args": {},
|
|
1447
|
-
"description": "List the versions of your integration available for use in
|
|
1516
|
+
"description": "List the versions of your integration available for use in Zapier automations.",
|
|
1448
1517
|
"flags": {
|
|
1449
1518
|
"debug": {
|
|
1450
1519
|
"char": "d",
|
|
@@ -1493,54 +1562,6 @@
|
|
|
1493
1562
|
"versions.js"
|
|
1494
1563
|
]
|
|
1495
1564
|
},
|
|
1496
|
-
"cache:clear": {
|
|
1497
|
-
"aliases": [],
|
|
1498
|
-
"args": {
|
|
1499
|
-
"majorVersion": {
|
|
1500
|
-
"description": "(Optional) The cache data will be deleted for this major version. If not provided, you must pick from a list of major versions for this integration.",
|
|
1501
|
-
"name": "majorVersion",
|
|
1502
|
-
"required": false
|
|
1503
|
-
}
|
|
1504
|
-
},
|
|
1505
|
-
"description": "Clear the cache data for a major version. \n\nThis command clears the cache data for a major version of your integration.\nThe job will be run in the background and may take some time to complete.\nYou can check `zapier history` to see the job status.\n",
|
|
1506
|
-
"examples": [
|
|
1507
|
-
"zapier cache:clear",
|
|
1508
|
-
"zapier cache:clear 2"
|
|
1509
|
-
],
|
|
1510
|
-
"flags": {
|
|
1511
|
-
"debug": {
|
|
1512
|
-
"char": "d",
|
|
1513
|
-
"description": "Show extra debugging output.",
|
|
1514
|
-
"name": "debug",
|
|
1515
|
-
"allowNo": false,
|
|
1516
|
-
"type": "boolean"
|
|
1517
|
-
},
|
|
1518
|
-
"invokedFromAnotherCommand": {
|
|
1519
|
-
"hidden": true,
|
|
1520
|
-
"name": "invokedFromAnotherCommand",
|
|
1521
|
-
"allowNo": false,
|
|
1522
|
-
"type": "boolean"
|
|
1523
|
-
}
|
|
1524
|
-
},
|
|
1525
|
-
"hasDynamicHelp": false,
|
|
1526
|
-
"hiddenAliases": [],
|
|
1527
|
-
"id": "cache:clear",
|
|
1528
|
-
"pluginAlias": "zapier-platform-cli",
|
|
1529
|
-
"pluginName": "zapier-platform-cli",
|
|
1530
|
-
"pluginType": "core",
|
|
1531
|
-
"strict": true,
|
|
1532
|
-
"enableJsonFlag": false,
|
|
1533
|
-
"skipValidInstallCheck": true,
|
|
1534
|
-
"hide": true,
|
|
1535
|
-
"isESM": false,
|
|
1536
|
-
"relativePath": [
|
|
1537
|
-
"src",
|
|
1538
|
-
"oclif",
|
|
1539
|
-
"commands",
|
|
1540
|
-
"cache",
|
|
1541
|
-
"clear.js"
|
|
1542
|
-
]
|
|
1543
|
-
},
|
|
1544
1565
|
"canary:create": {
|
|
1545
1566
|
"aliases": [],
|
|
1546
1567
|
"args": {
|
|
@@ -1704,18 +1725,19 @@
|
|
|
1704
1725
|
"list.js"
|
|
1705
1726
|
]
|
|
1706
1727
|
},
|
|
1707
|
-
"
|
|
1728
|
+
"cache:clear": {
|
|
1708
1729
|
"aliases": [],
|
|
1709
1730
|
"args": {
|
|
1710
|
-
"
|
|
1711
|
-
"description": "The version
|
|
1712
|
-
"name": "
|
|
1713
|
-
"required":
|
|
1731
|
+
"majorVersion": {
|
|
1732
|
+
"description": "(Optional) The cache data will be deleted for this major version. If not provided, you must pick from a list of major versions for this integration.",
|
|
1733
|
+
"name": "majorVersion",
|
|
1734
|
+
"required": false
|
|
1714
1735
|
}
|
|
1715
1736
|
},
|
|
1716
|
-
"description": "
|
|
1737
|
+
"description": "Clear the cache data for a major version. \n\nThis command clears the cache data for a major version of your integration.\nThe job will be run in the background and may take some time to complete.\nYou can check `zapier history` to see the job status.\n",
|
|
1717
1738
|
"examples": [
|
|
1718
|
-
"zapier
|
|
1739
|
+
"zapier cache:clear",
|
|
1740
|
+
"zapier cache:clear 2"
|
|
1719
1741
|
],
|
|
1720
1742
|
"flags": {
|
|
1721
1743
|
"debug": {
|
|
@@ -1725,21 +1747,45 @@
|
|
|
1725
1747
|
"allowNo": false,
|
|
1726
1748
|
"type": "boolean"
|
|
1727
1749
|
},
|
|
1728
|
-
"
|
|
1729
|
-
"
|
|
1730
|
-
"
|
|
1731
|
-
"
|
|
1732
|
-
"
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1750
|
+
"invokedFromAnotherCommand": {
|
|
1751
|
+
"hidden": true,
|
|
1752
|
+
"name": "invokedFromAnotherCommand",
|
|
1753
|
+
"allowNo": false,
|
|
1754
|
+
"type": "boolean"
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1757
|
+
"hasDynamicHelp": false,
|
|
1758
|
+
"hiddenAliases": [],
|
|
1759
|
+
"id": "cache:clear",
|
|
1760
|
+
"pluginAlias": "zapier-platform-cli",
|
|
1761
|
+
"pluginName": "zapier-platform-cli",
|
|
1762
|
+
"pluginType": "core",
|
|
1763
|
+
"strict": true,
|
|
1764
|
+
"enableJsonFlag": false,
|
|
1765
|
+
"skipValidInstallCheck": true,
|
|
1766
|
+
"hide": true,
|
|
1767
|
+
"isESM": false,
|
|
1768
|
+
"relativePath": [
|
|
1769
|
+
"src",
|
|
1770
|
+
"oclif",
|
|
1771
|
+
"commands",
|
|
1772
|
+
"cache",
|
|
1773
|
+
"clear.js"
|
|
1774
|
+
]
|
|
1775
|
+
},
|
|
1776
|
+
"delete:integration": {
|
|
1777
|
+
"aliases": [
|
|
1778
|
+
"delete:app"
|
|
1779
|
+
],
|
|
1780
|
+
"args": {},
|
|
1781
|
+
"description": "Delete your integration (including all versions).\n\nThis only works if there are no active users or Zaps on any version. If you only want to delete certain versions, use the `zapier delete:version` command instead. It's unlikely that you'll be able to run this on an app that you've pushed publicly, since there are usually still users.",
|
|
1782
|
+
"flags": {
|
|
1783
|
+
"debug": {
|
|
1784
|
+
"char": "d",
|
|
1785
|
+
"description": "Show extra debugging output.",
|
|
1786
|
+
"name": "debug",
|
|
1787
|
+
"allowNo": false,
|
|
1788
|
+
"type": "boolean"
|
|
1743
1789
|
},
|
|
1744
1790
|
"invokedFromAnotherCommand": {
|
|
1745
1791
|
"hidden": true,
|
|
@@ -1750,7 +1796,7 @@
|
|
|
1750
1796
|
},
|
|
1751
1797
|
"hasDynamicHelp": false,
|
|
1752
1798
|
"hiddenAliases": [],
|
|
1753
|
-
"id": "
|
|
1799
|
+
"id": "delete:integration",
|
|
1754
1800
|
"pluginAlias": "zapier-platform-cli",
|
|
1755
1801
|
"pluginName": "zapier-platform-cli",
|
|
1756
1802
|
"pluginType": "core",
|
|
@@ -1762,35 +1808,21 @@
|
|
|
1762
1808
|
"src",
|
|
1763
1809
|
"oclif",
|
|
1764
1810
|
"commands",
|
|
1765
|
-
"
|
|
1766
|
-
"
|
|
1811
|
+
"delete",
|
|
1812
|
+
"integration.js"
|
|
1767
1813
|
]
|
|
1768
1814
|
},
|
|
1769
|
-
"
|
|
1815
|
+
"delete:version": {
|
|
1770
1816
|
"aliases": [],
|
|
1771
1817
|
"args": {
|
|
1772
1818
|
"version": {
|
|
1773
|
-
"description": "
|
|
1819
|
+
"description": "Specify the version to delete. It must have no users or Zaps.",
|
|
1774
1820
|
"name": "version",
|
|
1775
1821
|
"required": true
|
|
1776
|
-
},
|
|
1777
|
-
"key-value pairs...": {
|
|
1778
|
-
"description": "The key-value pairs to set. Keys are case-insensitive. Each pair should be space separated and pairs should be separated by an `=`. For example: `A=123 B=456`",
|
|
1779
|
-
"name": "key-value pairs..."
|
|
1780
1822
|
}
|
|
1781
1823
|
},
|
|
1782
|
-
"description": "
|
|
1783
|
-
"examples": [
|
|
1784
|
-
"zapier env:set 1.2.3 SECRET=12345 OTHER=4321"
|
|
1785
|
-
],
|
|
1824
|
+
"description": "Delete a specific version of your integration.\n\nThis only works if there are no users or Zaps on that version. You will probably need to have run `zapier migrate` and `zapier deprecate` before this command will work.",
|
|
1786
1825
|
"flags": {
|
|
1787
|
-
"force": {
|
|
1788
|
-
"char": "f",
|
|
1789
|
-
"description": "Force the update of environment variables regardless if the app version is production or not. Use with caution.",
|
|
1790
|
-
"name": "force",
|
|
1791
|
-
"allowNo": false,
|
|
1792
|
-
"type": "boolean"
|
|
1793
|
-
},
|
|
1794
1826
|
"debug": {
|
|
1795
1827
|
"char": "d",
|
|
1796
1828
|
"description": "Show extra debugging output.",
|
|
@@ -1807,11 +1839,11 @@
|
|
|
1807
1839
|
},
|
|
1808
1840
|
"hasDynamicHelp": false,
|
|
1809
1841
|
"hiddenAliases": [],
|
|
1810
|
-
"id": "
|
|
1842
|
+
"id": "delete:version",
|
|
1811
1843
|
"pluginAlias": "zapier-platform-cli",
|
|
1812
1844
|
"pluginName": "zapier-platform-cli",
|
|
1813
1845
|
"pluginType": "core",
|
|
1814
|
-
"strict":
|
|
1846
|
+
"strict": true,
|
|
1815
1847
|
"enableJsonFlag": false,
|
|
1816
1848
|
"skipValidInstallCheck": true,
|
|
1817
1849
|
"isESM": false,
|
|
@@ -1819,35 +1851,24 @@
|
|
|
1819
1851
|
"src",
|
|
1820
1852
|
"oclif",
|
|
1821
1853
|
"commands",
|
|
1822
|
-
"
|
|
1823
|
-
"
|
|
1854
|
+
"delete",
|
|
1855
|
+
"version.js"
|
|
1824
1856
|
]
|
|
1825
1857
|
},
|
|
1826
|
-
"env:
|
|
1858
|
+
"env:get": {
|
|
1827
1859
|
"aliases": [],
|
|
1828
1860
|
"args": {
|
|
1829
1861
|
"version": {
|
|
1830
|
-
"description": "The version to
|
|
1862
|
+
"description": "The version to get the environment for.",
|
|
1831
1863
|
"name": "version",
|
|
1832
1864
|
"required": true
|
|
1833
|
-
},
|
|
1834
|
-
"keys...": {
|
|
1835
|
-
"description": "The keys to unset. Keys are case-insensitive.",
|
|
1836
|
-
"name": "keys..."
|
|
1837
1865
|
}
|
|
1838
1866
|
},
|
|
1839
|
-
"description": "
|
|
1867
|
+
"description": "Get environment variables for a version.",
|
|
1840
1868
|
"examples": [
|
|
1841
|
-
"zapier env:
|
|
1869
|
+
"zapier env:get 1.2.3"
|
|
1842
1870
|
],
|
|
1843
1871
|
"flags": {
|
|
1844
|
-
"force": {
|
|
1845
|
-
"char": "f",
|
|
1846
|
-
"description": "Force the update of environment variables regardless if the app version is production or not. Use with caution.",
|
|
1847
|
-
"name": "force",
|
|
1848
|
-
"allowNo": false,
|
|
1849
|
-
"type": "boolean"
|
|
1850
|
-
},
|
|
1851
1872
|
"debug": {
|
|
1852
1873
|
"char": "d",
|
|
1853
1874
|
"description": "Show extra debugging output.",
|
|
@@ -1855,6 +1876,22 @@
|
|
|
1855
1876
|
"allowNo": false,
|
|
1856
1877
|
"type": "boolean"
|
|
1857
1878
|
},
|
|
1879
|
+
"format": {
|
|
1880
|
+
"char": "f",
|
|
1881
|
+
"description": "Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.",
|
|
1882
|
+
"name": "format",
|
|
1883
|
+
"default": "table",
|
|
1884
|
+
"hasDynamicHelp": false,
|
|
1885
|
+
"multiple": false,
|
|
1886
|
+
"options": [
|
|
1887
|
+
"plain",
|
|
1888
|
+
"json",
|
|
1889
|
+
"raw",
|
|
1890
|
+
"row",
|
|
1891
|
+
"table"
|
|
1892
|
+
],
|
|
1893
|
+
"type": "option"
|
|
1894
|
+
},
|
|
1858
1895
|
"invokedFromAnotherCommand": {
|
|
1859
1896
|
"hidden": true,
|
|
1860
1897
|
"name": "invokedFromAnotherCommand",
|
|
@@ -1864,11 +1901,11 @@
|
|
|
1864
1901
|
},
|
|
1865
1902
|
"hasDynamicHelp": false,
|
|
1866
1903
|
"hiddenAliases": [],
|
|
1867
|
-
"id": "env:
|
|
1904
|
+
"id": "env:get",
|
|
1868
1905
|
"pluginAlias": "zapier-platform-cli",
|
|
1869
1906
|
"pluginName": "zapier-platform-cli",
|
|
1870
1907
|
"pluginType": "core",
|
|
1871
|
-
"strict":
|
|
1908
|
+
"strict": true,
|
|
1872
1909
|
"enableJsonFlag": false,
|
|
1873
1910
|
"skipValidInstallCheck": true,
|
|
1874
1911
|
"isESM": false,
|
|
@@ -1877,16 +1914,34 @@
|
|
|
1877
1914
|
"oclif",
|
|
1878
1915
|
"commands",
|
|
1879
1916
|
"env",
|
|
1880
|
-
"
|
|
1917
|
+
"get.js"
|
|
1881
1918
|
]
|
|
1882
1919
|
},
|
|
1883
|
-
"
|
|
1884
|
-
"aliases": [
|
|
1885
|
-
|
|
1920
|
+
"env:set": {
|
|
1921
|
+
"aliases": [],
|
|
1922
|
+
"args": {
|
|
1923
|
+
"version": {
|
|
1924
|
+
"description": "The version to set the environment for. Values are copied forward when a new version is created, but this command will only ever affect the specified version.",
|
|
1925
|
+
"name": "version",
|
|
1926
|
+
"required": true
|
|
1927
|
+
},
|
|
1928
|
+
"key-value pairs...": {
|
|
1929
|
+
"description": "The key-value pairs to set. Keys are case-insensitive. Each pair should be space separated and pairs should be separated by an `=`. For example: `A=123 B=456`",
|
|
1930
|
+
"name": "key-value pairs..."
|
|
1931
|
+
}
|
|
1932
|
+
},
|
|
1933
|
+
"description": "Set environment variables for a version.",
|
|
1934
|
+
"examples": [
|
|
1935
|
+
"zapier env:set 1.2.3 SECRET=12345 OTHER=4321"
|
|
1886
1936
|
],
|
|
1887
|
-
"args": {},
|
|
1888
|
-
"description": "Delete your integration (including all versions).\n\nThis only works if there are no active users or Zaps on any version. If you only want to delete certain versions, use the `zapier delete:version` command instead. It's unlikely that you'll be able to run this on an app that you've pushed publicly, since there are usually still users.",
|
|
1889
1937
|
"flags": {
|
|
1938
|
+
"force": {
|
|
1939
|
+
"char": "f",
|
|
1940
|
+
"description": "Force the update of environment variables regardless if the app version is production or not. Use with caution.",
|
|
1941
|
+
"name": "force",
|
|
1942
|
+
"allowNo": false,
|
|
1943
|
+
"type": "boolean"
|
|
1944
|
+
},
|
|
1890
1945
|
"debug": {
|
|
1891
1946
|
"char": "d",
|
|
1892
1947
|
"description": "Show extra debugging output.",
|
|
@@ -1903,11 +1958,11 @@
|
|
|
1903
1958
|
},
|
|
1904
1959
|
"hasDynamicHelp": false,
|
|
1905
1960
|
"hiddenAliases": [],
|
|
1906
|
-
"id": "
|
|
1961
|
+
"id": "env:set",
|
|
1907
1962
|
"pluginAlias": "zapier-platform-cli",
|
|
1908
1963
|
"pluginName": "zapier-platform-cli",
|
|
1909
1964
|
"pluginType": "core",
|
|
1910
|
-
"strict":
|
|
1965
|
+
"strict": false,
|
|
1911
1966
|
"enableJsonFlag": false,
|
|
1912
1967
|
"skipValidInstallCheck": true,
|
|
1913
1968
|
"isESM": false,
|
|
@@ -1915,21 +1970,35 @@
|
|
|
1915
1970
|
"src",
|
|
1916
1971
|
"oclif",
|
|
1917
1972
|
"commands",
|
|
1918
|
-
"
|
|
1919
|
-
"
|
|
1973
|
+
"env",
|
|
1974
|
+
"set.js"
|
|
1920
1975
|
]
|
|
1921
1976
|
},
|
|
1922
|
-
"
|
|
1977
|
+
"env:unset": {
|
|
1923
1978
|
"aliases": [],
|
|
1924
1979
|
"args": {
|
|
1925
1980
|
"version": {
|
|
1926
|
-
"description": "
|
|
1981
|
+
"description": "The version to set the environment for.",
|
|
1927
1982
|
"name": "version",
|
|
1928
1983
|
"required": true
|
|
1984
|
+
},
|
|
1985
|
+
"keys...": {
|
|
1986
|
+
"description": "The keys to unset. Keys are case-insensitive.",
|
|
1987
|
+
"name": "keys..."
|
|
1929
1988
|
}
|
|
1930
1989
|
},
|
|
1931
|
-
"description": "
|
|
1990
|
+
"description": "Unset environment variables for a version.",
|
|
1991
|
+
"examples": [
|
|
1992
|
+
"zapier env:unset 1.2.3 SECRET OTHER"
|
|
1993
|
+
],
|
|
1932
1994
|
"flags": {
|
|
1995
|
+
"force": {
|
|
1996
|
+
"char": "f",
|
|
1997
|
+
"description": "Force the update of environment variables regardless if the app version is production or not. Use with caution.",
|
|
1998
|
+
"name": "force",
|
|
1999
|
+
"allowNo": false,
|
|
2000
|
+
"type": "boolean"
|
|
2001
|
+
},
|
|
1933
2002
|
"debug": {
|
|
1934
2003
|
"char": "d",
|
|
1935
2004
|
"description": "Show extra debugging output.",
|
|
@@ -1946,11 +2015,11 @@
|
|
|
1946
2015
|
},
|
|
1947
2016
|
"hasDynamicHelp": false,
|
|
1948
2017
|
"hiddenAliases": [],
|
|
1949
|
-
"id": "
|
|
2018
|
+
"id": "env:unset",
|
|
1950
2019
|
"pluginAlias": "zapier-platform-cli",
|
|
1951
2020
|
"pluginName": "zapier-platform-cli",
|
|
1952
2021
|
"pluginType": "core",
|
|
1953
|
-
"strict":
|
|
2022
|
+
"strict": false,
|
|
1954
2023
|
"enableJsonFlag": false,
|
|
1955
2024
|
"skipValidInstallCheck": true,
|
|
1956
2025
|
"isESM": false,
|
|
@@ -1958,8 +2027,8 @@
|
|
|
1958
2027
|
"src",
|
|
1959
2028
|
"oclif",
|
|
1960
2029
|
"commands",
|
|
1961
|
-
"
|
|
1962
|
-
"
|
|
2030
|
+
"env",
|
|
2031
|
+
"unset.js"
|
|
1963
2032
|
]
|
|
1964
2033
|
},
|
|
1965
2034
|
"team:add": {
|
|
@@ -2341,5 +2410,5 @@
|
|
|
2341
2410
|
]
|
|
2342
2411
|
}
|
|
2343
2412
|
},
|
|
2344
|
-
"version": "16.
|
|
2413
|
+
"version": "16.5.0"
|
|
2345
2414
|
}
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ class ZapierBaseCommand extends Command {
|
|
|
18
18
|
|
|
19
19
|
if (this.flags.debug) {
|
|
20
20
|
this.debug.enabled = true; // enables this.debug on the command
|
|
21
|
-
require('debug').enable('zapier:*'); // enables all further spawned functions, like API
|
|
21
|
+
require('debug').enable('zapier:*,oclif:zapier:*'); // enables all further spawned functions, like API
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
this.debug('argv is', this.argv);
|
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
const BaseCommand = require('../ZapierBaseCommand');
|
|
2
|
-
const { Args } = require('@oclif/core');
|
|
2
|
+
const { Args, Flags } = require('@oclif/core');
|
|
3
3
|
const { buildFlags } = require('../buildFlags');
|
|
4
|
+
const colors = require('colors/safe');
|
|
4
5
|
|
|
5
|
-
const { callAPI } = require('../../utils/api');
|
|
6
|
+
const { callAPI, getSpecificVersionInfo } = require('../../utils/api');
|
|
6
7
|
|
|
7
8
|
class DeprecateCommand extends BaseCommand {
|
|
8
9
|
async perform() {
|
|
9
10
|
const app = await this.getWritableApp();
|
|
10
11
|
const { version, date } = this.args;
|
|
12
|
+
|
|
13
|
+
const versionInfo = await getSpecificVersionInfo(version);
|
|
14
|
+
const hasActiveUsers = versionInfo.user_count && versionInfo.user_count > 0;
|
|
15
|
+
|
|
16
|
+
this.log(
|
|
17
|
+
`${colors.yellow('Warning: Deprecation is an irreversible action that will eventually block access to this version.')}\n` +
|
|
18
|
+
`${colors.yellow('If all your changes are non-breaking, use `zapier migrate` instead to move users over to a newer version.')}\n`,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
if (
|
|
22
|
+
!this.flags.force &&
|
|
23
|
+
!(await this.confirm(
|
|
24
|
+
'Are you sure you want to deprecate this version? This will notify users that their Zaps or other automations will stop working after the specified date.' +
|
|
25
|
+
(hasActiveUsers
|
|
26
|
+
? `\n\nThis version has ${versionInfo.user_count} active user(s). Strongly consider migrating users to another version before deprecating!`
|
|
27
|
+
: ''),
|
|
28
|
+
))
|
|
29
|
+
) {
|
|
30
|
+
this.log('\nDeprecation cancelled.');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
11
34
|
this.log(
|
|
12
|
-
|
|
35
|
+
`\nPreparing to deprecate version ${version} your app "${app.title}".\n`,
|
|
13
36
|
);
|
|
14
37
|
const url = `/apps/${app.id}/versions/${version}/deprecate`;
|
|
15
38
|
this.startSpinner(`Deprecating ${version}`);
|
|
@@ -21,12 +44,19 @@ class DeprecateCommand extends BaseCommand {
|
|
|
21
44
|
});
|
|
22
45
|
this.stopSpinner();
|
|
23
46
|
this.log(
|
|
24
|
-
`\nWe'll let users know that this version
|
|
47
|
+
`\nWe'll let users know that this version will cease to work on ${date}.`,
|
|
25
48
|
);
|
|
26
49
|
}
|
|
27
50
|
}
|
|
28
51
|
|
|
29
|
-
DeprecateCommand.flags = buildFlags(
|
|
52
|
+
DeprecateCommand.flags = buildFlags({
|
|
53
|
+
commandFlags: {
|
|
54
|
+
force: Flags.boolean({
|
|
55
|
+
char: 'f',
|
|
56
|
+
description: 'Skip confirmation prompt. Use with caution.',
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
});
|
|
30
60
|
DeprecateCommand.args = {
|
|
31
61
|
version: Args.string({
|
|
32
62
|
description: 'The version to deprecate.',
|
|
@@ -43,11 +73,15 @@ DeprecateCommand.description = `Mark a non-production version of your integratio
|
|
|
43
73
|
|
|
44
74
|
Use this when an integration version will not be supported or start breaking at a known date.
|
|
45
75
|
|
|
46
|
-
Zapier will send
|
|
76
|
+
Zapier will immediately send emails warning users of the deprecation if a date less than 30 days in the future is set, otherwise the emails will be sent exactly 30 days before the configured deprecation date.
|
|
47
77
|
|
|
48
|
-
|
|
78
|
+
There are other side effects: they'll start seeing it as "Deprecated" in the UI, and once the deprecation date arrives, if the Zaps weren't updated, they'll be paused and the users will be emailed again explaining what happened.
|
|
49
79
|
|
|
50
|
-
Do not use
|
|
80
|
+
Do not use deprecation if you only have non-breaking changes, such as:
|
|
81
|
+
- Fixing help text
|
|
82
|
+
- Adding new triggers/actions
|
|
83
|
+
- Improving existing functionality
|
|
84
|
+
- other bug fixes that don't break existing automations.`;
|
|
51
85
|
DeprecateCommand.skipValidInstallCheck = true;
|
|
52
86
|
|
|
53
87
|
module.exports = DeprecateCommand;
|