zapier-platform-cli 16.2.0 → 16.3.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 +171 -164
- package/package.json +1 -1
- package/src/generators/pull.js +4 -1
- package/src/oclif/commands/push.js +10 -1
- package/src/utils/api.js +38 -10
package/oclif.manifest.json
CHANGED
|
@@ -1061,6 +1061,13 @@
|
|
|
1061
1061
|
"name": "invokedFromAnotherCommand",
|
|
1062
1062
|
"allowNo": false,
|
|
1063
1063
|
"type": "boolean"
|
|
1064
|
+
},
|
|
1065
|
+
"overwrite-partner-changes": {
|
|
1066
|
+
"description": "(Internal Use Only) Allows Zapier Staff to push changes to integrations in certain situations.",
|
|
1067
|
+
"hidden": true,
|
|
1068
|
+
"name": "overwrite-partner-changes",
|
|
1069
|
+
"allowNo": false,
|
|
1070
|
+
"type": "boolean"
|
|
1064
1071
|
}
|
|
1065
1072
|
},
|
|
1066
1073
|
"hasDynamicHelp": false,
|
|
@@ -1533,169 +1540,6 @@
|
|
|
1533
1540
|
"clear.js"
|
|
1534
1541
|
]
|
|
1535
1542
|
},
|
|
1536
|
-
"canary:create": {
|
|
1537
|
-
"aliases": [],
|
|
1538
|
-
"args": {
|
|
1539
|
-
"versionFrom": {
|
|
1540
|
-
"description": "Version to route traffic from",
|
|
1541
|
-
"name": "versionFrom",
|
|
1542
|
-
"required": true
|
|
1543
|
-
},
|
|
1544
|
-
"versionTo": {
|
|
1545
|
-
"description": "Version to canary traffic to",
|
|
1546
|
-
"name": "versionTo",
|
|
1547
|
-
"required": true
|
|
1548
|
-
}
|
|
1549
|
-
},
|
|
1550
|
-
"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\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!**",
|
|
1551
|
-
"examples": [
|
|
1552
|
-
"zapier canary:create 1.0.0 1.1.0 -p 25 -d 720",
|
|
1553
|
-
"zapier canary:create 2.0.0 2.1.0 --percent 50 --duration 300"
|
|
1554
|
-
],
|
|
1555
|
-
"flags": {
|
|
1556
|
-
"percent": {
|
|
1557
|
-
"char": "p",
|
|
1558
|
-
"description": "Percent of traffic to route to new version",
|
|
1559
|
-
"name": "percent",
|
|
1560
|
-
"required": true,
|
|
1561
|
-
"hasDynamicHelp": false,
|
|
1562
|
-
"multiple": false,
|
|
1563
|
-
"type": "option"
|
|
1564
|
-
},
|
|
1565
|
-
"duration": {
|
|
1566
|
-
"char": "d",
|
|
1567
|
-
"description": "Duration of the canary in seconds",
|
|
1568
|
-
"name": "duration",
|
|
1569
|
-
"required": true,
|
|
1570
|
-
"hasDynamicHelp": false,
|
|
1571
|
-
"multiple": false,
|
|
1572
|
-
"type": "option"
|
|
1573
|
-
},
|
|
1574
|
-
"debug": {
|
|
1575
|
-
"char": "d",
|
|
1576
|
-
"description": "Show extra debugging output.",
|
|
1577
|
-
"name": "debug",
|
|
1578
|
-
"allowNo": false,
|
|
1579
|
-
"type": "boolean"
|
|
1580
|
-
},
|
|
1581
|
-
"invokedFromAnotherCommand": {
|
|
1582
|
-
"hidden": true,
|
|
1583
|
-
"name": "invokedFromAnotherCommand",
|
|
1584
|
-
"allowNo": false,
|
|
1585
|
-
"type": "boolean"
|
|
1586
|
-
}
|
|
1587
|
-
},
|
|
1588
|
-
"hasDynamicHelp": false,
|
|
1589
|
-
"hiddenAliases": [],
|
|
1590
|
-
"id": "canary:create",
|
|
1591
|
-
"pluginAlias": "zapier-platform-cli",
|
|
1592
|
-
"pluginName": "zapier-platform-cli",
|
|
1593
|
-
"pluginType": "core",
|
|
1594
|
-
"strict": true,
|
|
1595
|
-
"enableJsonFlag": false,
|
|
1596
|
-
"skipValidInstallCheck": true,
|
|
1597
|
-
"isESM": false,
|
|
1598
|
-
"relativePath": [
|
|
1599
|
-
"src",
|
|
1600
|
-
"oclif",
|
|
1601
|
-
"commands",
|
|
1602
|
-
"canary",
|
|
1603
|
-
"create.js"
|
|
1604
|
-
]
|
|
1605
|
-
},
|
|
1606
|
-
"canary:delete": {
|
|
1607
|
-
"aliases": [],
|
|
1608
|
-
"args": {
|
|
1609
|
-
"versionFrom": {
|
|
1610
|
-
"description": "Version to route traffic from",
|
|
1611
|
-
"name": "versionFrom",
|
|
1612
|
-
"required": true
|
|
1613
|
-
},
|
|
1614
|
-
"versionTo": {
|
|
1615
|
-
"description": "Version canary traffic is routed to",
|
|
1616
|
-
"name": "versionTo",
|
|
1617
|
-
"required": true
|
|
1618
|
-
}
|
|
1619
|
-
},
|
|
1620
|
-
"description": "Delete an active canary deployment",
|
|
1621
|
-
"examples": [
|
|
1622
|
-
"zapier canary:delete 1.0.0 1.1.0"
|
|
1623
|
-
],
|
|
1624
|
-
"flags": {},
|
|
1625
|
-
"hasDynamicHelp": false,
|
|
1626
|
-
"hiddenAliases": [],
|
|
1627
|
-
"id": "canary:delete",
|
|
1628
|
-
"pluginAlias": "zapier-platform-cli",
|
|
1629
|
-
"pluginName": "zapier-platform-cli",
|
|
1630
|
-
"pluginType": "core",
|
|
1631
|
-
"strict": true,
|
|
1632
|
-
"enableJsonFlag": false,
|
|
1633
|
-
"skipValidInstallCheck": true,
|
|
1634
|
-
"isESM": false,
|
|
1635
|
-
"relativePath": [
|
|
1636
|
-
"src",
|
|
1637
|
-
"oclif",
|
|
1638
|
-
"commands",
|
|
1639
|
-
"canary",
|
|
1640
|
-
"delete.js"
|
|
1641
|
-
]
|
|
1642
|
-
},
|
|
1643
|
-
"canary:list": {
|
|
1644
|
-
"aliases": [],
|
|
1645
|
-
"args": {},
|
|
1646
|
-
"description": "List all active canary deployments",
|
|
1647
|
-
"examples": [
|
|
1648
|
-
"zapier canary:list"
|
|
1649
|
-
],
|
|
1650
|
-
"flags": {
|
|
1651
|
-
"debug": {
|
|
1652
|
-
"char": "d",
|
|
1653
|
-
"description": "Show extra debugging output.",
|
|
1654
|
-
"name": "debug",
|
|
1655
|
-
"allowNo": false,
|
|
1656
|
-
"type": "boolean"
|
|
1657
|
-
},
|
|
1658
|
-
"format": {
|
|
1659
|
-
"char": "f",
|
|
1660
|
-
"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.",
|
|
1661
|
-
"name": "format",
|
|
1662
|
-
"default": "table",
|
|
1663
|
-
"hasDynamicHelp": false,
|
|
1664
|
-
"multiple": false,
|
|
1665
|
-
"options": [
|
|
1666
|
-
"plain",
|
|
1667
|
-
"json",
|
|
1668
|
-
"raw",
|
|
1669
|
-
"row",
|
|
1670
|
-
"table"
|
|
1671
|
-
],
|
|
1672
|
-
"type": "option"
|
|
1673
|
-
},
|
|
1674
|
-
"invokedFromAnotherCommand": {
|
|
1675
|
-
"hidden": true,
|
|
1676
|
-
"name": "invokedFromAnotherCommand",
|
|
1677
|
-
"allowNo": false,
|
|
1678
|
-
"type": "boolean"
|
|
1679
|
-
}
|
|
1680
|
-
},
|
|
1681
|
-
"hasDynamicHelp": false,
|
|
1682
|
-
"hiddenAliases": [],
|
|
1683
|
-
"id": "canary:list",
|
|
1684
|
-
"pluginAlias": "zapier-platform-cli",
|
|
1685
|
-
"pluginName": "zapier-platform-cli",
|
|
1686
|
-
"pluginType": "core",
|
|
1687
|
-
"strict": true,
|
|
1688
|
-
"enableJsonFlag": false,
|
|
1689
|
-
"skipValidInstallCheck": true,
|
|
1690
|
-
"isESM": false,
|
|
1691
|
-
"relativePath": [
|
|
1692
|
-
"src",
|
|
1693
|
-
"oclif",
|
|
1694
|
-
"commands",
|
|
1695
|
-
"canary",
|
|
1696
|
-
"list.js"
|
|
1697
|
-
]
|
|
1698
|
-
},
|
|
1699
1543
|
"delete:integration": {
|
|
1700
1544
|
"aliases": [
|
|
1701
1545
|
"delete:app"
|
|
@@ -1954,6 +1798,169 @@
|
|
|
1954
1798
|
"unset.js"
|
|
1955
1799
|
]
|
|
1956
1800
|
},
|
|
1801
|
+
"canary:create": {
|
|
1802
|
+
"aliases": [],
|
|
1803
|
+
"args": {
|
|
1804
|
+
"versionFrom": {
|
|
1805
|
+
"description": "Version to route traffic from",
|
|
1806
|
+
"name": "versionFrom",
|
|
1807
|
+
"required": true
|
|
1808
|
+
},
|
|
1809
|
+
"versionTo": {
|
|
1810
|
+
"description": "Version to canary traffic to",
|
|
1811
|
+
"name": "versionTo",
|
|
1812
|
+
"required": true
|
|
1813
|
+
}
|
|
1814
|
+
},
|
|
1815
|
+
"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\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!**",
|
|
1816
|
+
"examples": [
|
|
1817
|
+
"zapier canary:create 1.0.0 1.1.0 -p 25 -d 720",
|
|
1818
|
+
"zapier canary:create 2.0.0 2.1.0 --percent 50 --duration 300"
|
|
1819
|
+
],
|
|
1820
|
+
"flags": {
|
|
1821
|
+
"percent": {
|
|
1822
|
+
"char": "p",
|
|
1823
|
+
"description": "Percent of traffic to route to new version",
|
|
1824
|
+
"name": "percent",
|
|
1825
|
+
"required": true,
|
|
1826
|
+
"hasDynamicHelp": false,
|
|
1827
|
+
"multiple": false,
|
|
1828
|
+
"type": "option"
|
|
1829
|
+
},
|
|
1830
|
+
"duration": {
|
|
1831
|
+
"char": "d",
|
|
1832
|
+
"description": "Duration of the canary in seconds",
|
|
1833
|
+
"name": "duration",
|
|
1834
|
+
"required": true,
|
|
1835
|
+
"hasDynamicHelp": false,
|
|
1836
|
+
"multiple": false,
|
|
1837
|
+
"type": "option"
|
|
1838
|
+
},
|
|
1839
|
+
"debug": {
|
|
1840
|
+
"char": "d",
|
|
1841
|
+
"description": "Show extra debugging output.",
|
|
1842
|
+
"name": "debug",
|
|
1843
|
+
"allowNo": false,
|
|
1844
|
+
"type": "boolean"
|
|
1845
|
+
},
|
|
1846
|
+
"invokedFromAnotherCommand": {
|
|
1847
|
+
"hidden": true,
|
|
1848
|
+
"name": "invokedFromAnotherCommand",
|
|
1849
|
+
"allowNo": false,
|
|
1850
|
+
"type": "boolean"
|
|
1851
|
+
}
|
|
1852
|
+
},
|
|
1853
|
+
"hasDynamicHelp": false,
|
|
1854
|
+
"hiddenAliases": [],
|
|
1855
|
+
"id": "canary:create",
|
|
1856
|
+
"pluginAlias": "zapier-platform-cli",
|
|
1857
|
+
"pluginName": "zapier-platform-cli",
|
|
1858
|
+
"pluginType": "core",
|
|
1859
|
+
"strict": true,
|
|
1860
|
+
"enableJsonFlag": false,
|
|
1861
|
+
"skipValidInstallCheck": true,
|
|
1862
|
+
"isESM": false,
|
|
1863
|
+
"relativePath": [
|
|
1864
|
+
"src",
|
|
1865
|
+
"oclif",
|
|
1866
|
+
"commands",
|
|
1867
|
+
"canary",
|
|
1868
|
+
"create.js"
|
|
1869
|
+
]
|
|
1870
|
+
},
|
|
1871
|
+
"canary:delete": {
|
|
1872
|
+
"aliases": [],
|
|
1873
|
+
"args": {
|
|
1874
|
+
"versionFrom": {
|
|
1875
|
+
"description": "Version to route traffic from",
|
|
1876
|
+
"name": "versionFrom",
|
|
1877
|
+
"required": true
|
|
1878
|
+
},
|
|
1879
|
+
"versionTo": {
|
|
1880
|
+
"description": "Version canary traffic is routed to",
|
|
1881
|
+
"name": "versionTo",
|
|
1882
|
+
"required": true
|
|
1883
|
+
}
|
|
1884
|
+
},
|
|
1885
|
+
"description": "Delete an active canary deployment",
|
|
1886
|
+
"examples": [
|
|
1887
|
+
"zapier canary:delete 1.0.0 1.1.0"
|
|
1888
|
+
],
|
|
1889
|
+
"flags": {},
|
|
1890
|
+
"hasDynamicHelp": false,
|
|
1891
|
+
"hiddenAliases": [],
|
|
1892
|
+
"id": "canary:delete",
|
|
1893
|
+
"pluginAlias": "zapier-platform-cli",
|
|
1894
|
+
"pluginName": "zapier-platform-cli",
|
|
1895
|
+
"pluginType": "core",
|
|
1896
|
+
"strict": true,
|
|
1897
|
+
"enableJsonFlag": false,
|
|
1898
|
+
"skipValidInstallCheck": true,
|
|
1899
|
+
"isESM": false,
|
|
1900
|
+
"relativePath": [
|
|
1901
|
+
"src",
|
|
1902
|
+
"oclif",
|
|
1903
|
+
"commands",
|
|
1904
|
+
"canary",
|
|
1905
|
+
"delete.js"
|
|
1906
|
+
]
|
|
1907
|
+
},
|
|
1908
|
+
"canary:list": {
|
|
1909
|
+
"aliases": [],
|
|
1910
|
+
"args": {},
|
|
1911
|
+
"description": "List all active canary deployments",
|
|
1912
|
+
"examples": [
|
|
1913
|
+
"zapier canary:list"
|
|
1914
|
+
],
|
|
1915
|
+
"flags": {
|
|
1916
|
+
"debug": {
|
|
1917
|
+
"char": "d",
|
|
1918
|
+
"description": "Show extra debugging output.",
|
|
1919
|
+
"name": "debug",
|
|
1920
|
+
"allowNo": false,
|
|
1921
|
+
"type": "boolean"
|
|
1922
|
+
},
|
|
1923
|
+
"format": {
|
|
1924
|
+
"char": "f",
|
|
1925
|
+
"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.",
|
|
1926
|
+
"name": "format",
|
|
1927
|
+
"default": "table",
|
|
1928
|
+
"hasDynamicHelp": false,
|
|
1929
|
+
"multiple": false,
|
|
1930
|
+
"options": [
|
|
1931
|
+
"plain",
|
|
1932
|
+
"json",
|
|
1933
|
+
"raw",
|
|
1934
|
+
"row",
|
|
1935
|
+
"table"
|
|
1936
|
+
],
|
|
1937
|
+
"type": "option"
|
|
1938
|
+
},
|
|
1939
|
+
"invokedFromAnotherCommand": {
|
|
1940
|
+
"hidden": true,
|
|
1941
|
+
"name": "invokedFromAnotherCommand",
|
|
1942
|
+
"allowNo": false,
|
|
1943
|
+
"type": "boolean"
|
|
1944
|
+
}
|
|
1945
|
+
},
|
|
1946
|
+
"hasDynamicHelp": false,
|
|
1947
|
+
"hiddenAliases": [],
|
|
1948
|
+
"id": "canary:list",
|
|
1949
|
+
"pluginAlias": "zapier-platform-cli",
|
|
1950
|
+
"pluginName": "zapier-platform-cli",
|
|
1951
|
+
"pluginType": "core",
|
|
1952
|
+
"strict": true,
|
|
1953
|
+
"enableJsonFlag": false,
|
|
1954
|
+
"skipValidInstallCheck": true,
|
|
1955
|
+
"isESM": false,
|
|
1956
|
+
"relativePath": [
|
|
1957
|
+
"src",
|
|
1958
|
+
"oclif",
|
|
1959
|
+
"commands",
|
|
1960
|
+
"canary",
|
|
1961
|
+
"list.js"
|
|
1962
|
+
]
|
|
1963
|
+
},
|
|
1957
1964
|
"team:add": {
|
|
1958
1965
|
"aliases": [
|
|
1959
1966
|
"team:invite"
|
|
@@ -2333,5 +2340,5 @@
|
|
|
2333
2340
|
]
|
|
2334
2341
|
}
|
|
2335
2342
|
},
|
|
2336
|
-
"version": "16.
|
|
2343
|
+
"version": "16.3.0"
|
|
2337
2344
|
}
|
package/package.json
CHANGED
package/src/generators/pull.js
CHANGED
|
@@ -24,7 +24,10 @@ module.exports = class PullGenerator extends Generator {
|
|
|
24
24
|
name: 'confirm',
|
|
25
25
|
message: `Warning: You are about to overwrite existing files.
|
|
26
26
|
|
|
27
|
-
Before proceeding, please make sure you have saved your work. Consider creating a backup or saving your current state in a git branch.
|
|
27
|
+
Before proceeding, please make sure you have saved your work. Consider creating a backup or saving your current state in a git branch.
|
|
28
|
+
|
|
29
|
+
If presented with a series of options ('ynarxdeiH'), you may
|
|
30
|
+
press Enter to view more details about each option. For example, 'x' will abort the process.
|
|
28
31
|
|
|
29
32
|
Do you want to continue?`,
|
|
30
33
|
default: false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const ZapierBaseCommand = require('../ZapierBaseCommand');
|
|
2
2
|
const { BUILD_PATH, SOURCE_PATH } = require('../../constants');
|
|
3
|
+
const { Flags } = require('@oclif/core');
|
|
3
4
|
|
|
4
5
|
const BuildCommand = require('./build');
|
|
5
6
|
|
|
@@ -13,6 +14,7 @@ class PushCommand extends ZapierBaseCommand {
|
|
|
13
14
|
skipNpmInstall: this.flags['skip-npm-install'],
|
|
14
15
|
disableDependencyDetection: this.flags['disable-dependency-detection'],
|
|
15
16
|
skipValidation: this.flags['skip-validation'],
|
|
17
|
+
overwritePartnerChanges: this.flags['overwrite-partner-changes'],
|
|
16
18
|
},
|
|
17
19
|
);
|
|
18
20
|
this.log(
|
|
@@ -21,7 +23,14 @@ class PushCommand extends ZapierBaseCommand {
|
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
PushCommand.flags =
|
|
26
|
+
PushCommand.flags = {
|
|
27
|
+
...BuildCommand.flags,
|
|
28
|
+
'overwrite-partner-changes': Flags.boolean({
|
|
29
|
+
description:
|
|
30
|
+
'(Internal Use Only) Allows Zapier Staff to push changes to integrations in certain situations.',
|
|
31
|
+
hidden: true,
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
25
34
|
PushCommand.description = `Build and upload the current integration.
|
|
26
35
|
|
|
27
36
|
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
|
@@ -422,7 +422,10 @@ const downloadSourceZip = async (dst) => {
|
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
424
|
|
|
425
|
-
const upload = async (
|
|
425
|
+
const upload = async (
|
|
426
|
+
app,
|
|
427
|
+
{ skipValidation = false, overwritePartnerChanges = false } = {},
|
|
428
|
+
) => {
|
|
426
429
|
const zipPath = constants.BUILD_PATH;
|
|
427
430
|
const sourceZipPath = constants.SOURCE_PATH;
|
|
428
431
|
const appDir = process.cwd();
|
|
@@ -449,17 +452,42 @@ const upload = async (app, { skipValidation = false } = {}) => {
|
|
|
449
452
|
const binarySourceZip = fs.readFileSync(fullSourceZipPath);
|
|
450
453
|
const sourceBuffer = Buffer.from(binarySourceZip).toString('base64');
|
|
451
454
|
|
|
455
|
+
const headers = {};
|
|
456
|
+
if (overwritePartnerChanges) {
|
|
457
|
+
headers['X-Overwrite-Partner-Changes'] = 'true';
|
|
458
|
+
}
|
|
459
|
+
|
|
452
460
|
startSpinner(`Uploading version ${definition.version}`);
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
+
try {
|
|
462
|
+
await callAPI(
|
|
463
|
+
`/apps/${app.id}/versions/${definition.version}`,
|
|
464
|
+
{
|
|
465
|
+
method: 'PUT',
|
|
466
|
+
body: {
|
|
467
|
+
zip_file: buffer,
|
|
468
|
+
source_zip_file: sourceBuffer,
|
|
469
|
+
skip_validation: skipValidation,
|
|
470
|
+
},
|
|
471
|
+
extraHeaders: headers,
|
|
472
|
+
},
|
|
473
|
+
true,
|
|
474
|
+
);
|
|
475
|
+
} catch (err) {
|
|
476
|
+
endSpinner({ success: false });
|
|
477
|
+
// 409 from the backend specifically signals that the last changes were from a partner
|
|
478
|
+
// and this is a staff user which could unintentionally overwrite those changes
|
|
479
|
+
if (err.status === 409) {
|
|
480
|
+
throw new Error(
|
|
481
|
+
`The latest integration changes appear to be from a partner. OK to overwrite?` +
|
|
482
|
+
` If so, run this command again using the '--overwrite-partner-changes' flag.`,
|
|
483
|
+
);
|
|
484
|
+
}
|
|
461
485
|
|
|
462
|
-
|
|
486
|
+
// Don't ignore other errors, re-throw them with a user-friendly message
|
|
487
|
+
throw new Error(err.errText);
|
|
488
|
+
} finally {
|
|
489
|
+
endSpinner();
|
|
490
|
+
}
|
|
463
491
|
};
|
|
464
492
|
|
|
465
493
|
module.exports = {
|