zapier-platform-cli 17.7.2 → 17.8.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 +187 -176
- package/package.json +1 -2
- package/src/oclif/commands/migrate.js +2 -2
- package/src/oclif/commands/push.js +15 -1
- package/src/utils/api.js +4 -3
- package/src/utils/build.js +2 -1
- package/src/utils/credentials.js +0 -1
- package/src/utils/npm.js +0 -2
- package/src/utils/example-apps.js +0 -89
- package/src/utils/xdg.js +0 -59
package/oclif.manifest.json
CHANGED
|
@@ -1051,14 +1051,14 @@
|
|
|
1051
1051
|
],
|
|
1052
1052
|
"flags": {
|
|
1053
1053
|
"user": {
|
|
1054
|
-
"description": "Migrates
|
|
1054
|
+
"description": "Migrates a user's private Zaps under the user's individual account, excluding organization accounts",
|
|
1055
1055
|
"name": "user",
|
|
1056
1056
|
"hasDynamicHelp": false,
|
|
1057
1057
|
"multiple": false,
|
|
1058
1058
|
"type": "option"
|
|
1059
1059
|
},
|
|
1060
1060
|
"account": {
|
|
1061
|
-
"description": "Migrates
|
|
1061
|
+
"description": "Migrates a user's private and shared Zaps under the user's individual and organization accounts",
|
|
1062
1062
|
"name": "account",
|
|
1063
1063
|
"hasDynamicHelp": false,
|
|
1064
1064
|
"multiple": false,
|
|
@@ -1194,6 +1194,10 @@
|
|
|
1194
1194
|
"aliases": [],
|
|
1195
1195
|
"args": {},
|
|
1196
1196
|
"description": "Build and upload the current integration.\n\nThis command is the same as running `zapier build` and `zapier upload` in sequence. See those for more info.",
|
|
1197
|
+
"examples": [
|
|
1198
|
+
"zapier push",
|
|
1199
|
+
"zapier push --snapshot MY-LABEL"
|
|
1200
|
+
],
|
|
1197
1201
|
"flags": {
|
|
1198
1202
|
"disable-dependency-detection": {
|
|
1199
1203
|
"description": "Disable \"smart\" file inclusion. By default, Zapier only includes files that are required by your entry point (`index.js` by default). If you (or your dependencies) require files dynamically (such as with `require(someVar)`), then you may see \"Cannot find module\" errors. Disabling this may make your `build.zip` too large. If that's the case, try using the `includeInBuild` option in your `.zapierapprc`. See the docs about `includeInBuild` for more info.",
|
|
@@ -1233,6 +1237,13 @@
|
|
|
1233
1237
|
"name": "overwrite-partner-changes",
|
|
1234
1238
|
"allowNo": false,
|
|
1235
1239
|
"type": "boolean"
|
|
1240
|
+
},
|
|
1241
|
+
"snapshot": {
|
|
1242
|
+
"description": "Pass in a label to create a snapshot version of this integration for development and testing purposes. The version will be created as: 0.0.0-MY-LABEL",
|
|
1243
|
+
"name": "snapshot",
|
|
1244
|
+
"hasDynamicHelp": false,
|
|
1245
|
+
"multiple": false,
|
|
1246
|
+
"type": "option"
|
|
1236
1247
|
}
|
|
1237
1248
|
},
|
|
1238
1249
|
"hasDynamicHelp": false,
|
|
@@ -1719,69 +1730,20 @@
|
|
|
1719
1730
|
"clear.js"
|
|
1720
1731
|
]
|
|
1721
1732
|
},
|
|
1722
|
-
"
|
|
1733
|
+
"env:get": {
|
|
1723
1734
|
"aliases": [],
|
|
1724
1735
|
"args": {
|
|
1725
|
-
"
|
|
1726
|
-
"description": "
|
|
1727
|
-
"name": "
|
|
1728
|
-
"required": true
|
|
1729
|
-
},
|
|
1730
|
-
"versionTo": {
|
|
1731
|
-
"description": "Version to canary traffic to",
|
|
1732
|
-
"name": "versionTo",
|
|
1736
|
+
"version": {
|
|
1737
|
+
"description": "The version to get the environment for.",
|
|
1738
|
+
"name": "version",
|
|
1733
1739
|
"required": true
|
|
1734
1740
|
}
|
|
1735
1741
|
},
|
|
1736
|
-
"description": "
|
|
1742
|
+
"description": "Get environment variables for a version.",
|
|
1737
1743
|
"examples": [
|
|
1738
|
-
"zapier
|
|
1739
|
-
"zapier canary:create 2.0.0 2.1.0 --percent 25 --duration 1800 --user user@example.com",
|
|
1740
|
-
"zapier canary:create 2.0.0 2.1.0 -p 15 -d 7200 -a 12345 -u user@example.com",
|
|
1741
|
-
"zapier canary:create 2.0.0 2.1.0 -p 15 -d 7200 -a 12345"
|
|
1744
|
+
"zapier env:get 1.2.3"
|
|
1742
1745
|
],
|
|
1743
1746
|
"flags": {
|
|
1744
|
-
"percent": {
|
|
1745
|
-
"char": "p",
|
|
1746
|
-
"description": "Percent of traffic to route to new version",
|
|
1747
|
-
"name": "percent",
|
|
1748
|
-
"required": true,
|
|
1749
|
-
"hasDynamicHelp": false,
|
|
1750
|
-
"multiple": false,
|
|
1751
|
-
"type": "option"
|
|
1752
|
-
},
|
|
1753
|
-
"duration": {
|
|
1754
|
-
"char": "d",
|
|
1755
|
-
"description": "Duration of the canary in seconds",
|
|
1756
|
-
"name": "duration",
|
|
1757
|
-
"required": true,
|
|
1758
|
-
"hasDynamicHelp": false,
|
|
1759
|
-
"multiple": false,
|
|
1760
|
-
"type": "option"
|
|
1761
|
-
},
|
|
1762
|
-
"user": {
|
|
1763
|
-
"char": "u",
|
|
1764
|
-
"description": "Canary this user (email) across all accounts, unless `account-id` is specified.",
|
|
1765
|
-
"name": "user",
|
|
1766
|
-
"hasDynamicHelp": false,
|
|
1767
|
-
"multiple": false,
|
|
1768
|
-
"type": "option"
|
|
1769
|
-
},
|
|
1770
|
-
"account-id": {
|
|
1771
|
-
"char": "a",
|
|
1772
|
-
"description": "The account ID to target. If user is specified, only canary the user within this account. If user is not specified, then this argument is only permitted for Zapier staff.",
|
|
1773
|
-
"name": "account-id",
|
|
1774
|
-
"hasDynamicHelp": false,
|
|
1775
|
-
"multiple": false,
|
|
1776
|
-
"type": "option"
|
|
1777
|
-
},
|
|
1778
|
-
"force-include-all": {
|
|
1779
|
-
"char": "f",
|
|
1780
|
-
"description": "Overrides any default filters the canary system imposes. This argument is only permitted for Zapier staff.",
|
|
1781
|
-
"name": "force-include-all",
|
|
1782
|
-
"allowNo": false,
|
|
1783
|
-
"type": "boolean"
|
|
1784
|
-
},
|
|
1785
1747
|
"debug": {
|
|
1786
1748
|
"char": "d",
|
|
1787
1749
|
"description": "Show extra debugging output.",
|
|
@@ -1789,6 +1751,22 @@
|
|
|
1789
1751
|
"allowNo": false,
|
|
1790
1752
|
"type": "boolean"
|
|
1791
1753
|
},
|
|
1754
|
+
"format": {
|
|
1755
|
+
"char": "f",
|
|
1756
|
+
"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.",
|
|
1757
|
+
"name": "format",
|
|
1758
|
+
"default": "table",
|
|
1759
|
+
"hasDynamicHelp": false,
|
|
1760
|
+
"multiple": false,
|
|
1761
|
+
"options": [
|
|
1762
|
+
"plain",
|
|
1763
|
+
"json",
|
|
1764
|
+
"raw",
|
|
1765
|
+
"row",
|
|
1766
|
+
"table"
|
|
1767
|
+
],
|
|
1768
|
+
"type": "option"
|
|
1769
|
+
},
|
|
1792
1770
|
"invokedFromAnotherCommand": {
|
|
1793
1771
|
"hidden": true,
|
|
1794
1772
|
"name": "invokedFromAnotherCommand",
|
|
@@ -1798,7 +1776,7 @@
|
|
|
1798
1776
|
},
|
|
1799
1777
|
"hasDynamicHelp": false,
|
|
1800
1778
|
"hiddenAliases": [],
|
|
1801
|
-
"id": "
|
|
1779
|
+
"id": "env:get",
|
|
1802
1780
|
"pluginAlias": "zapier-platform-cli",
|
|
1803
1781
|
"pluginName": "zapier-platform-cli",
|
|
1804
1782
|
"pluginType": "core",
|
|
@@ -1810,55 +1788,35 @@
|
|
|
1810
1788
|
"src",
|
|
1811
1789
|
"oclif",
|
|
1812
1790
|
"commands",
|
|
1813
|
-
"
|
|
1814
|
-
"
|
|
1791
|
+
"env",
|
|
1792
|
+
"get.js"
|
|
1815
1793
|
]
|
|
1816
1794
|
},
|
|
1817
|
-
"
|
|
1795
|
+
"env:set": {
|
|
1818
1796
|
"aliases": [],
|
|
1819
1797
|
"args": {
|
|
1820
|
-
"
|
|
1821
|
-
"description": "
|
|
1822
|
-
"name": "
|
|
1798
|
+
"version": {
|
|
1799
|
+
"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.",
|
|
1800
|
+
"name": "version",
|
|
1823
1801
|
"required": true
|
|
1824
1802
|
},
|
|
1825
|
-
"
|
|
1826
|
-
"description": "
|
|
1827
|
-
"name": "
|
|
1828
|
-
"required": true
|
|
1803
|
+
"key-value pairs...": {
|
|
1804
|
+
"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`",
|
|
1805
|
+
"name": "key-value pairs..."
|
|
1829
1806
|
}
|
|
1830
1807
|
},
|
|
1831
|
-
"description": "
|
|
1832
|
-
"examples": [
|
|
1833
|
-
"zapier canary:delete 1.0.0 1.1.0"
|
|
1834
|
-
],
|
|
1835
|
-
"flags": {},
|
|
1836
|
-
"hasDynamicHelp": false,
|
|
1837
|
-
"hiddenAliases": [],
|
|
1838
|
-
"id": "canary:delete",
|
|
1839
|
-
"pluginAlias": "zapier-platform-cli",
|
|
1840
|
-
"pluginName": "zapier-platform-cli",
|
|
1841
|
-
"pluginType": "core",
|
|
1842
|
-
"strict": true,
|
|
1843
|
-
"enableJsonFlag": false,
|
|
1844
|
-
"skipValidInstallCheck": true,
|
|
1845
|
-
"isESM": false,
|
|
1846
|
-
"relativePath": [
|
|
1847
|
-
"src",
|
|
1848
|
-
"oclif",
|
|
1849
|
-
"commands",
|
|
1850
|
-
"canary",
|
|
1851
|
-
"delete.js"
|
|
1852
|
-
]
|
|
1853
|
-
},
|
|
1854
|
-
"canary:list": {
|
|
1855
|
-
"aliases": [],
|
|
1856
|
-
"args": {},
|
|
1857
|
-
"description": "List all active canary deployments",
|
|
1808
|
+
"description": "Set environment variables for a version.",
|
|
1858
1809
|
"examples": [
|
|
1859
|
-
"zapier
|
|
1810
|
+
"zapier env:set 1.2.3 SECRET=12345 OTHER=4321"
|
|
1860
1811
|
],
|
|
1861
1812
|
"flags": {
|
|
1813
|
+
"force": {
|
|
1814
|
+
"char": "f",
|
|
1815
|
+
"description": "Force the update of environment variables regardless if the app version is production or not. Use with caution.",
|
|
1816
|
+
"name": "force",
|
|
1817
|
+
"allowNo": false,
|
|
1818
|
+
"type": "boolean"
|
|
1819
|
+
},
|
|
1862
1820
|
"debug": {
|
|
1863
1821
|
"char": "d",
|
|
1864
1822
|
"description": "Show extra debugging output.",
|
|
@@ -1866,22 +1824,6 @@
|
|
|
1866
1824
|
"allowNo": false,
|
|
1867
1825
|
"type": "boolean"
|
|
1868
1826
|
},
|
|
1869
|
-
"format": {
|
|
1870
|
-
"char": "f",
|
|
1871
|
-
"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.",
|
|
1872
|
-
"name": "format",
|
|
1873
|
-
"default": "table",
|
|
1874
|
-
"hasDynamicHelp": false,
|
|
1875
|
-
"multiple": false,
|
|
1876
|
-
"options": [
|
|
1877
|
-
"plain",
|
|
1878
|
-
"json",
|
|
1879
|
-
"raw",
|
|
1880
|
-
"row",
|
|
1881
|
-
"table"
|
|
1882
|
-
],
|
|
1883
|
-
"type": "option"
|
|
1884
|
-
},
|
|
1885
1827
|
"invokedFromAnotherCommand": {
|
|
1886
1828
|
"hidden": true,
|
|
1887
1829
|
"name": "invokedFromAnotherCommand",
|
|
@@ -1891,11 +1833,11 @@
|
|
|
1891
1833
|
},
|
|
1892
1834
|
"hasDynamicHelp": false,
|
|
1893
1835
|
"hiddenAliases": [],
|
|
1894
|
-
"id": "
|
|
1836
|
+
"id": "env:set",
|
|
1895
1837
|
"pluginAlias": "zapier-platform-cli",
|
|
1896
1838
|
"pluginName": "zapier-platform-cli",
|
|
1897
1839
|
"pluginType": "core",
|
|
1898
|
-
"strict":
|
|
1840
|
+
"strict": false,
|
|
1899
1841
|
"enableJsonFlag": false,
|
|
1900
1842
|
"skipValidInstallCheck": true,
|
|
1901
1843
|
"isESM": false,
|
|
@@ -1903,24 +1845,35 @@
|
|
|
1903
1845
|
"src",
|
|
1904
1846
|
"oclif",
|
|
1905
1847
|
"commands",
|
|
1906
|
-
"
|
|
1907
|
-
"
|
|
1848
|
+
"env",
|
|
1849
|
+
"set.js"
|
|
1908
1850
|
]
|
|
1909
1851
|
},
|
|
1910
|
-
"env:
|
|
1852
|
+
"env:unset": {
|
|
1911
1853
|
"aliases": [],
|
|
1912
1854
|
"args": {
|
|
1913
1855
|
"version": {
|
|
1914
|
-
"description": "The version to
|
|
1856
|
+
"description": "The version to set the environment for.",
|
|
1915
1857
|
"name": "version",
|
|
1916
1858
|
"required": true
|
|
1859
|
+
},
|
|
1860
|
+
"keys...": {
|
|
1861
|
+
"description": "The keys to unset. Keys are case-insensitive.",
|
|
1862
|
+
"name": "keys..."
|
|
1917
1863
|
}
|
|
1918
1864
|
},
|
|
1919
|
-
"description": "
|
|
1865
|
+
"description": "Unset environment variables for a version.",
|
|
1920
1866
|
"examples": [
|
|
1921
|
-
"zapier env:
|
|
1867
|
+
"zapier env:unset 1.2.3 SECRET OTHER"
|
|
1922
1868
|
],
|
|
1923
1869
|
"flags": {
|
|
1870
|
+
"force": {
|
|
1871
|
+
"char": "f",
|
|
1872
|
+
"description": "Force the update of environment variables regardless if the app version is production or not. Use with caution.",
|
|
1873
|
+
"name": "force",
|
|
1874
|
+
"allowNo": false,
|
|
1875
|
+
"type": "boolean"
|
|
1876
|
+
},
|
|
1924
1877
|
"debug": {
|
|
1925
1878
|
"char": "d",
|
|
1926
1879
|
"description": "Show extra debugging output.",
|
|
@@ -1928,22 +1881,6 @@
|
|
|
1928
1881
|
"allowNo": false,
|
|
1929
1882
|
"type": "boolean"
|
|
1930
1883
|
},
|
|
1931
|
-
"format": {
|
|
1932
|
-
"char": "f",
|
|
1933
|
-
"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.",
|
|
1934
|
-
"name": "format",
|
|
1935
|
-
"default": "table",
|
|
1936
|
-
"hasDynamicHelp": false,
|
|
1937
|
-
"multiple": false,
|
|
1938
|
-
"options": [
|
|
1939
|
-
"plain",
|
|
1940
|
-
"json",
|
|
1941
|
-
"raw",
|
|
1942
|
-
"row",
|
|
1943
|
-
"table"
|
|
1944
|
-
],
|
|
1945
|
-
"type": "option"
|
|
1946
|
-
},
|
|
1947
1884
|
"invokedFromAnotherCommand": {
|
|
1948
1885
|
"hidden": true,
|
|
1949
1886
|
"name": "invokedFromAnotherCommand",
|
|
@@ -1953,11 +1890,11 @@
|
|
|
1953
1890
|
},
|
|
1954
1891
|
"hasDynamicHelp": false,
|
|
1955
1892
|
"hiddenAliases": [],
|
|
1956
|
-
"id": "env:
|
|
1893
|
+
"id": "env:unset",
|
|
1957
1894
|
"pluginAlias": "zapier-platform-cli",
|
|
1958
1895
|
"pluginName": "zapier-platform-cli",
|
|
1959
1896
|
"pluginType": "core",
|
|
1960
|
-
"strict":
|
|
1897
|
+
"strict": false,
|
|
1961
1898
|
"enableJsonFlag": false,
|
|
1962
1899
|
"skipValidInstallCheck": true,
|
|
1963
1900
|
"isESM": false,
|
|
@@ -1966,31 +1903,69 @@
|
|
|
1966
1903
|
"oclif",
|
|
1967
1904
|
"commands",
|
|
1968
1905
|
"env",
|
|
1969
|
-
"
|
|
1906
|
+
"unset.js"
|
|
1970
1907
|
]
|
|
1971
1908
|
},
|
|
1972
|
-
"
|
|
1909
|
+
"canary:create": {
|
|
1973
1910
|
"aliases": [],
|
|
1974
1911
|
"args": {
|
|
1975
|
-
"
|
|
1976
|
-
"description": "
|
|
1977
|
-
"name": "
|
|
1912
|
+
"versionFrom": {
|
|
1913
|
+
"description": "Version to route traffic from",
|
|
1914
|
+
"name": "versionFrom",
|
|
1978
1915
|
"required": true
|
|
1979
1916
|
},
|
|
1980
|
-
"
|
|
1981
|
-
"description": "
|
|
1982
|
-
"name": "
|
|
1917
|
+
"versionTo": {
|
|
1918
|
+
"description": "Version to canary traffic to",
|
|
1919
|
+
"name": "versionTo",
|
|
1920
|
+
"required": true
|
|
1983
1921
|
}
|
|
1984
1922
|
},
|
|
1985
|
-
"description": "
|
|
1923
|
+
"description": "Create a new canary deployment, diverting a specified percentage of traffic from one version to another for a specified duration.\n\nOnly one canary can be active at the same time. You can run `zapier canary:list` to check. If you would like to create a new canary with different parameters, you can wait for the canary to finish, or delete it using `zapier canary:delete a.b.c x.y.z`.\n\nTo canary traffic for a specific user, use the --user flag.\n\nTo canary traffic for an entire account, use the --account-id. Note: this scenario is only permitted for Zapier staff.\n\nTo canary traffic for a specific user within a specific account, use both --user and --account-id flags.\n\nNote: this is similar to `zapier migrate` but different in that this is temporary and will \"revert\" the changes once the specified duration is expired.\n\n**Only use this command to canary traffic between non-breaking versions!**",
|
|
1986
1924
|
"examples": [
|
|
1987
|
-
"zapier
|
|
1925
|
+
"zapier canary:create 1.0.0 1.1.0 -p 10 -d 3600",
|
|
1926
|
+
"zapier canary:create 2.0.0 2.1.0 --percent 25 --duration 1800 --user user@example.com",
|
|
1927
|
+
"zapier canary:create 2.0.0 2.1.0 -p 15 -d 7200 -a 12345 -u user@example.com",
|
|
1928
|
+
"zapier canary:create 2.0.0 2.1.0 -p 15 -d 7200 -a 12345"
|
|
1988
1929
|
],
|
|
1989
1930
|
"flags": {
|
|
1990
|
-
"
|
|
1931
|
+
"percent": {
|
|
1932
|
+
"char": "p",
|
|
1933
|
+
"description": "Percent of traffic to route to new version",
|
|
1934
|
+
"name": "percent",
|
|
1935
|
+
"required": true,
|
|
1936
|
+
"hasDynamicHelp": false,
|
|
1937
|
+
"multiple": false,
|
|
1938
|
+
"type": "option"
|
|
1939
|
+
},
|
|
1940
|
+
"duration": {
|
|
1941
|
+
"char": "d",
|
|
1942
|
+
"description": "Duration of the canary in seconds",
|
|
1943
|
+
"name": "duration",
|
|
1944
|
+
"required": true,
|
|
1945
|
+
"hasDynamicHelp": false,
|
|
1946
|
+
"multiple": false,
|
|
1947
|
+
"type": "option"
|
|
1948
|
+
},
|
|
1949
|
+
"user": {
|
|
1950
|
+
"char": "u",
|
|
1951
|
+
"description": "Canary this user (email) across all accounts, unless `account-id` is specified.",
|
|
1952
|
+
"name": "user",
|
|
1953
|
+
"hasDynamicHelp": false,
|
|
1954
|
+
"multiple": false,
|
|
1955
|
+
"type": "option"
|
|
1956
|
+
},
|
|
1957
|
+
"account-id": {
|
|
1958
|
+
"char": "a",
|
|
1959
|
+
"description": "The account ID to target. If user is specified, only canary the user within this account. If user is not specified, then this argument is only permitted for Zapier staff.",
|
|
1960
|
+
"name": "account-id",
|
|
1961
|
+
"hasDynamicHelp": false,
|
|
1962
|
+
"multiple": false,
|
|
1963
|
+
"type": "option"
|
|
1964
|
+
},
|
|
1965
|
+
"force-include-all": {
|
|
1991
1966
|
"char": "f",
|
|
1992
|
-
"description": "
|
|
1993
|
-
"name": "force",
|
|
1967
|
+
"description": "Overrides any default filters the canary system imposes. This argument is only permitted for Zapier staff.",
|
|
1968
|
+
"name": "force-include-all",
|
|
1994
1969
|
"allowNo": false,
|
|
1995
1970
|
"type": "boolean"
|
|
1996
1971
|
},
|
|
@@ -2010,11 +1985,11 @@
|
|
|
2010
1985
|
},
|
|
2011
1986
|
"hasDynamicHelp": false,
|
|
2012
1987
|
"hiddenAliases": [],
|
|
2013
|
-
"id": "
|
|
1988
|
+
"id": "canary:create",
|
|
2014
1989
|
"pluginAlias": "zapier-platform-cli",
|
|
2015
1990
|
"pluginName": "zapier-platform-cli",
|
|
2016
1991
|
"pluginType": "core",
|
|
2017
|
-
"strict":
|
|
1992
|
+
"strict": true,
|
|
2018
1993
|
"enableJsonFlag": false,
|
|
2019
1994
|
"skipValidInstallCheck": true,
|
|
2020
1995
|
"isESM": false,
|
|
@@ -2022,35 +1997,55 @@
|
|
|
2022
1997
|
"src",
|
|
2023
1998
|
"oclif",
|
|
2024
1999
|
"commands",
|
|
2025
|
-
"
|
|
2026
|
-
"
|
|
2000
|
+
"canary",
|
|
2001
|
+
"create.js"
|
|
2027
2002
|
]
|
|
2028
2003
|
},
|
|
2029
|
-
"
|
|
2004
|
+
"canary:delete": {
|
|
2030
2005
|
"aliases": [],
|
|
2031
2006
|
"args": {
|
|
2032
|
-
"
|
|
2033
|
-
"description": "
|
|
2034
|
-
"name": "
|
|
2007
|
+
"versionFrom": {
|
|
2008
|
+
"description": "Version to route traffic from",
|
|
2009
|
+
"name": "versionFrom",
|
|
2035
2010
|
"required": true
|
|
2036
2011
|
},
|
|
2037
|
-
"
|
|
2038
|
-
"description": "
|
|
2039
|
-
"name": "
|
|
2012
|
+
"versionTo": {
|
|
2013
|
+
"description": "Version canary traffic is routed to",
|
|
2014
|
+
"name": "versionTo",
|
|
2015
|
+
"required": true
|
|
2040
2016
|
}
|
|
2041
2017
|
},
|
|
2042
|
-
"description": "
|
|
2018
|
+
"description": "Delete an active canary deployment",
|
|
2043
2019
|
"examples": [
|
|
2044
|
-
"zapier
|
|
2020
|
+
"zapier canary:delete 1.0.0 1.1.0"
|
|
2021
|
+
],
|
|
2022
|
+
"flags": {},
|
|
2023
|
+
"hasDynamicHelp": false,
|
|
2024
|
+
"hiddenAliases": [],
|
|
2025
|
+
"id": "canary:delete",
|
|
2026
|
+
"pluginAlias": "zapier-platform-cli",
|
|
2027
|
+
"pluginName": "zapier-platform-cli",
|
|
2028
|
+
"pluginType": "core",
|
|
2029
|
+
"strict": true,
|
|
2030
|
+
"enableJsonFlag": false,
|
|
2031
|
+
"skipValidInstallCheck": true,
|
|
2032
|
+
"isESM": false,
|
|
2033
|
+
"relativePath": [
|
|
2034
|
+
"src",
|
|
2035
|
+
"oclif",
|
|
2036
|
+
"commands",
|
|
2037
|
+
"canary",
|
|
2038
|
+
"delete.js"
|
|
2039
|
+
]
|
|
2040
|
+
},
|
|
2041
|
+
"canary:list": {
|
|
2042
|
+
"aliases": [],
|
|
2043
|
+
"args": {},
|
|
2044
|
+
"description": "List all active canary deployments",
|
|
2045
|
+
"examples": [
|
|
2046
|
+
"zapier canary:list"
|
|
2045
2047
|
],
|
|
2046
2048
|
"flags": {
|
|
2047
|
-
"force": {
|
|
2048
|
-
"char": "f",
|
|
2049
|
-
"description": "Force the update of environment variables regardless if the app version is production or not. Use with caution.",
|
|
2050
|
-
"name": "force",
|
|
2051
|
-
"allowNo": false,
|
|
2052
|
-
"type": "boolean"
|
|
2053
|
-
},
|
|
2054
2049
|
"debug": {
|
|
2055
2050
|
"char": "d",
|
|
2056
2051
|
"description": "Show extra debugging output.",
|
|
@@ -2058,6 +2053,22 @@
|
|
|
2058
2053
|
"allowNo": false,
|
|
2059
2054
|
"type": "boolean"
|
|
2060
2055
|
},
|
|
2056
|
+
"format": {
|
|
2057
|
+
"char": "f",
|
|
2058
|
+
"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.",
|
|
2059
|
+
"name": "format",
|
|
2060
|
+
"default": "table",
|
|
2061
|
+
"hasDynamicHelp": false,
|
|
2062
|
+
"multiple": false,
|
|
2063
|
+
"options": [
|
|
2064
|
+
"plain",
|
|
2065
|
+
"json",
|
|
2066
|
+
"raw",
|
|
2067
|
+
"row",
|
|
2068
|
+
"table"
|
|
2069
|
+
],
|
|
2070
|
+
"type": "option"
|
|
2071
|
+
},
|
|
2061
2072
|
"invokedFromAnotherCommand": {
|
|
2062
2073
|
"hidden": true,
|
|
2063
2074
|
"name": "invokedFromAnotherCommand",
|
|
@@ -2067,11 +2078,11 @@
|
|
|
2067
2078
|
},
|
|
2068
2079
|
"hasDynamicHelp": false,
|
|
2069
2080
|
"hiddenAliases": [],
|
|
2070
|
-
"id": "
|
|
2081
|
+
"id": "canary:list",
|
|
2071
2082
|
"pluginAlias": "zapier-platform-cli",
|
|
2072
2083
|
"pluginName": "zapier-platform-cli",
|
|
2073
2084
|
"pluginType": "core",
|
|
2074
|
-
"strict":
|
|
2085
|
+
"strict": true,
|
|
2075
2086
|
"enableJsonFlag": false,
|
|
2076
2087
|
"skipValidInstallCheck": true,
|
|
2077
2088
|
"isESM": false,
|
|
@@ -2079,8 +2090,8 @@
|
|
|
2079
2090
|
"src",
|
|
2080
2091
|
"oclif",
|
|
2081
2092
|
"commands",
|
|
2082
|
-
"
|
|
2083
|
-
"
|
|
2093
|
+
"canary",
|
|
2094
|
+
"list.js"
|
|
2084
2095
|
]
|
|
2085
2096
|
},
|
|
2086
2097
|
"delete:integration": {
|
|
@@ -2544,5 +2555,5 @@
|
|
|
2544
2555
|
]
|
|
2545
2556
|
}
|
|
2546
2557
|
},
|
|
2547
|
-
"version": "17.
|
|
2558
|
+
"version": "17.8.0"
|
|
2548
2559
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zapier-platform-cli",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.8.0",
|
|
4
4
|
"description": "The CLI for managing integrations in Zapier Developer Platform.",
|
|
5
5
|
"repository": "zapier/zapier-platform",
|
|
6
6
|
"homepage": "https://platform.zapier.com/",
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"luxon": "3.6.1",
|
|
65
65
|
"marked": "14.1.4",
|
|
66
66
|
"marked-terminal": "7.2.1",
|
|
67
|
-
"node-fetch": "2.7.0",
|
|
68
67
|
"open": "10.1.2",
|
|
69
68
|
"ora": "5.4.0",
|
|
70
69
|
"parse-gitignore": "0.5.1",
|
|
@@ -152,11 +152,11 @@ MigrateCommand.flags = buildFlags({
|
|
|
152
152
|
commandFlags: {
|
|
153
153
|
user: Flags.string({
|
|
154
154
|
description:
|
|
155
|
-
"Migrates
|
|
155
|
+
"Migrates a user's private Zaps under the user's individual account, excluding organization accounts",
|
|
156
156
|
}),
|
|
157
157
|
account: Flags.string({
|
|
158
158
|
description:
|
|
159
|
-
"Migrates
|
|
159
|
+
"Migrates a user's private and shared Zaps under the user's individual and organization accounts",
|
|
160
160
|
}),
|
|
161
161
|
yes: Flags.boolean({
|
|
162
162
|
char: 'y',
|
|
@@ -12,7 +12,15 @@ class PushCommand extends ZapierBaseCommand {
|
|
|
12
12
|
async perform() {
|
|
13
13
|
const skipNpmInstall = this.flags['skip-npm-install'];
|
|
14
14
|
const definition = await localAppCommand({ command: 'definition' });
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
const snapshotLabel = this.flags.snapshot;
|
|
17
|
+
if (snapshotLabel && snapshotLabel.length > 18) {
|
|
18
|
+
throw new Error('Snapshot label cannot exceed 18 characters');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const version = snapshotLabel
|
|
22
|
+
? `0.0.0-${snapshotLabel}`
|
|
23
|
+
: definition.version;
|
|
16
24
|
this.throwForInvalidVersion(version);
|
|
17
25
|
|
|
18
26
|
await buildAndOrUpload(
|
|
@@ -23,6 +31,7 @@ class PushCommand extends ZapierBaseCommand {
|
|
|
23
31
|
skipValidation: this.flags['skip-validation'],
|
|
24
32
|
overwritePartnerChanges: this.flags['overwrite-partner-changes'],
|
|
25
33
|
},
|
|
34
|
+
version,
|
|
26
35
|
);
|
|
27
36
|
this.log(
|
|
28
37
|
`\nPush complete! Built ${BUILD_PATH} and ${SOURCE_PATH} and uploaded them to Zapier.`,
|
|
@@ -43,7 +52,12 @@ PushCommand.flags = {
|
|
|
43
52
|
'(Internal Use Only) Allows Zapier Staff to push changes to integrations in certain situations.',
|
|
44
53
|
hidden: true,
|
|
45
54
|
}),
|
|
55
|
+
snapshot: Flags.string({
|
|
56
|
+
description:
|
|
57
|
+
'Pass in a label to create a snapshot version of this integration for development and testing purposes. The version will be created as: 0.0.0-MY-LABEL',
|
|
58
|
+
}),
|
|
46
59
|
};
|
|
60
|
+
PushCommand.examples = ['zapier push', 'zapier push --snapshot MY-LABEL'];
|
|
47
61
|
PushCommand.description = `Build and upload the current integration.
|
|
48
62
|
|
|
49
63
|
This command is the same as running \`zapier build\` and \`zapier upload\` in sequence. See those for more info.`;
|
package/src/utils/api.js
CHANGED
|
@@ -11,7 +11,6 @@ const qs = require('querystring');
|
|
|
11
11
|
|
|
12
12
|
const fs = require('fs');
|
|
13
13
|
const AdmZip = require('adm-zip');
|
|
14
|
-
const fetch = require('node-fetch');
|
|
15
14
|
const path = require('path');
|
|
16
15
|
|
|
17
16
|
const { writeFile, readFile } = require('./files');
|
|
@@ -429,6 +428,7 @@ const downloadSourceZip = async (dst) => {
|
|
|
429
428
|
const upload = async (
|
|
430
429
|
app,
|
|
431
430
|
{ skipValidation = false, overwritePartnerChanges = false } = {},
|
|
431
|
+
versionOverride,
|
|
432
432
|
) => {
|
|
433
433
|
const zipPath = constants.BUILD_PATH;
|
|
434
434
|
const sourceZipPath = constants.SOURCE_PATH;
|
|
@@ -461,10 +461,11 @@ const upload = async (
|
|
|
461
461
|
headers['X-Overwrite-Partner-Changes'] = 'true';
|
|
462
462
|
}
|
|
463
463
|
|
|
464
|
-
|
|
464
|
+
const version = versionOverride ?? definition.version;
|
|
465
|
+
startSpinner(`Uploading version ${version}`);
|
|
465
466
|
try {
|
|
466
467
|
await callAPI(
|
|
467
|
-
`/apps/${app.id}/versions/${
|
|
468
|
+
`/apps/${app.id}/versions/${version}`,
|
|
468
469
|
{
|
|
469
470
|
method: 'PUT',
|
|
470
471
|
body: {
|
package/src/utils/build.js
CHANGED
|
@@ -761,6 +761,7 @@ const _buildFunc = async ({
|
|
|
761
761
|
const buildAndOrUpload = async (
|
|
762
762
|
{ build = false, upload = false } = {},
|
|
763
763
|
buildOpts,
|
|
764
|
+
versionOverride,
|
|
764
765
|
) => {
|
|
765
766
|
if (!(build || upload)) {
|
|
766
767
|
throw new Error('must either build or upload');
|
|
@@ -777,7 +778,7 @@ const buildAndOrUpload = async (
|
|
|
777
778
|
await _buildFunc(buildOpts);
|
|
778
779
|
}
|
|
779
780
|
if (upload) {
|
|
780
|
-
await _uploadFunc(app, buildOpts);
|
|
781
|
+
await _uploadFunc(app, buildOpts, versionOverride);
|
|
781
782
|
}
|
|
782
783
|
};
|
|
783
784
|
|
package/src/utils/credentials.js
CHANGED
package/src/utils/npm.js
CHANGED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
const fetch = require('node-fetch');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const fse = require('fs-extra');
|
|
4
|
-
const AdmZip = require('adm-zip');
|
|
5
|
-
const debug = require('debug')('zapier:example-apps');
|
|
6
|
-
|
|
7
|
-
const xdg = require('./xdg');
|
|
8
|
-
const { copyDir } = require('./files');
|
|
9
|
-
const { PACKAGE_VERSION } = require('../constants');
|
|
10
|
-
|
|
11
|
-
const REPO_ZIP_URL = `https://codeload.github.com/zapier/zapier-platform/zip/zapier-platform-cli%40${PACKAGE_VERSION}`;
|
|
12
|
-
const zipName = `zapier-platform-zapier-platform-cli-${PACKAGE_VERSION}`;
|
|
13
|
-
const folderName = `zapier-platform-cached`; // version independant
|
|
14
|
-
|
|
15
|
-
const checkCacheUpToDate = async (repoDir) => {
|
|
16
|
-
const etagPath = path.join(repoDir, 'etag');
|
|
17
|
-
let currentEtag;
|
|
18
|
-
try {
|
|
19
|
-
currentEtag = await fse.readFile(etagPath, { encoding: 'utf8' });
|
|
20
|
-
} catch (err) {
|
|
21
|
-
currentEtag = '';
|
|
22
|
-
}
|
|
23
|
-
const res = await fetch(REPO_ZIP_URL, { method: 'HEAD' });
|
|
24
|
-
const latestEtag = res.headers.get('etag');
|
|
25
|
-
|
|
26
|
-
return currentEtag === latestEtag;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const downloadRepo = async (destDir) => {
|
|
30
|
-
const destZipPath = path.join(destDir, `${zipName}.zip`);
|
|
31
|
-
|
|
32
|
-
const res = await fetch(REPO_ZIP_URL);
|
|
33
|
-
const dest = fse.createWriteStream(destZipPath);
|
|
34
|
-
res.body.pipe(dest);
|
|
35
|
-
|
|
36
|
-
await new Promise((resolve, reject) => {
|
|
37
|
-
dest.on('finish', () => {
|
|
38
|
-
resolve();
|
|
39
|
-
});
|
|
40
|
-
dest.on('error', reject);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const zip = new AdmZip(destZipPath);
|
|
44
|
-
zip.extractAllTo(destDir, true);
|
|
45
|
-
|
|
46
|
-
// Save etag for cache validation
|
|
47
|
-
// this could probably just be cli version, but this is fine too
|
|
48
|
-
const etagPath = path.join(destDir, zipName, 'etag');
|
|
49
|
-
fse.writeFileSync(etagPath, res.headers.get('etag'));
|
|
50
|
-
|
|
51
|
-
fse.removeSync(destZipPath);
|
|
52
|
-
fse.renameSync(path.join(destDir, zipName), path.join(destDir, folderName));
|
|
53
|
-
|
|
54
|
-
return destZipPath;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const ensureRepoCached = async () => {
|
|
58
|
-
const cacheDir = xdg.ensureCacheDir();
|
|
59
|
-
const repoDir = path.join(cacheDir, folderName);
|
|
60
|
-
|
|
61
|
-
if (fse.existsSync(repoDir)) {
|
|
62
|
-
debug('repo exists');
|
|
63
|
-
if (!(await checkCacheUpToDate(repoDir))) {
|
|
64
|
-
debug('cached repo is stale, re-downloading');
|
|
65
|
-
await fse.remove(repoDir);
|
|
66
|
-
await downloadRepo(cacheDir);
|
|
67
|
-
}
|
|
68
|
-
} else {
|
|
69
|
-
debug('no cached repo, downloading');
|
|
70
|
-
await downloadRepo(cacheDir);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return repoDir;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const downloadExampleAppTo = async (exampleName, destDir) => {
|
|
77
|
-
const repoDir = await ensureRepoCached();
|
|
78
|
-
const cachedExampleDir = path.join(repoDir, 'example-apps', exampleName);
|
|
79
|
-
await copyDir(cachedExampleDir, destDir);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const removeReadme = (dir) => {
|
|
83
|
-
return fse.remove(path.join(dir, 'README.md'));
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
module.exports = {
|
|
87
|
-
downloadExampleAppTo,
|
|
88
|
-
removeReadme,
|
|
89
|
-
};
|
package/src/utils/xdg.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// XDG Base Directory Specification
|
|
2
|
-
// See: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
|
3
|
-
|
|
4
|
-
const fse = require('fs-extra');
|
|
5
|
-
const os = require('os');
|
|
6
|
-
const path = require('path');
|
|
7
|
-
|
|
8
|
-
const ensureDir = (envVarName, defaultDir, extraPath = []) => {
|
|
9
|
-
const baseDir = process.env[envVarName] || defaultDir;
|
|
10
|
-
let appDir = path.join(baseDir, 'zapier');
|
|
11
|
-
fse.ensureDirSync(appDir, 0o700);
|
|
12
|
-
|
|
13
|
-
if (extraPath.length > 0) {
|
|
14
|
-
const dirParts = [appDir].concat(extraPath);
|
|
15
|
-
appDir = path.join.apply(null, dirParts);
|
|
16
|
-
fse.ensureDirSync(appDir);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return appDir;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const HOME_DIR = os.homedir();
|
|
23
|
-
|
|
24
|
-
let ensureDataDir, ensureCacheDir, ensureConfigDir;
|
|
25
|
-
|
|
26
|
-
if (process.platform === 'win32') {
|
|
27
|
-
const defaultAppDir = path.join(HOME_DIR, 'AppData', 'Local');
|
|
28
|
-
|
|
29
|
-
// NOTE: LOCALAPPDATA is not available on Windows XP
|
|
30
|
-
ensureDataDir = ensureDir.bind(null, 'LOCALAPPDATA', defaultAppDir, ['data']);
|
|
31
|
-
ensureCacheDir = ensureDir.bind(null, 'LOCALAPPDATA', defaultAppDir, [
|
|
32
|
-
'cache',
|
|
33
|
-
]);
|
|
34
|
-
ensureConfigDir = ensureDir.bind(null, 'LOCALAPPDATA', defaultAppDir, [
|
|
35
|
-
'config',
|
|
36
|
-
]);
|
|
37
|
-
} else {
|
|
38
|
-
ensureDataDir = ensureDir.bind(
|
|
39
|
-
null,
|
|
40
|
-
'XDG_DATA_HOME',
|
|
41
|
-
path.join(HOME_DIR, '.local', 'share'),
|
|
42
|
-
);
|
|
43
|
-
ensureCacheDir = ensureDir.bind(
|
|
44
|
-
null,
|
|
45
|
-
'XDG_CACHE_HOME',
|
|
46
|
-
path.join(HOME_DIR, '.cache'),
|
|
47
|
-
);
|
|
48
|
-
ensureConfigDir = ensureDir.bind(
|
|
49
|
-
null,
|
|
50
|
-
'XDG_CONFIG_HOME',
|
|
51
|
-
path.join(HOME_DIR, '.config'),
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports = {
|
|
56
|
-
ensureDataDir,
|
|
57
|
-
ensureCacheDir,
|
|
58
|
-
ensureConfigDir,
|
|
59
|
-
};
|