zapier-platform-cli 16.5.0 → 16.5.1

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.
@@ -1515,6 +1515,13 @@
1515
1515
  "args": {},
1516
1516
  "description": "List the versions of your integration available for use in Zapier automations.",
1517
1517
  "flags": {
1518
+ "all": {
1519
+ "char": "a",
1520
+ "description": "List all versions, including deprecated versions.",
1521
+ "name": "all",
1522
+ "allowNo": false,
1523
+ "type": "boolean"
1524
+ },
1518
1525
  "debug": {
1519
1526
  "char": "d",
1520
1527
  "description": "Show extra debugging output.",
@@ -1562,6 +1569,54 @@
1562
1569
  "versions.js"
1563
1570
  ]
1564
1571
  },
1572
+ "cache:clear": {
1573
+ "aliases": [],
1574
+ "args": {
1575
+ "majorVersion": {
1576
+ "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.",
1577
+ "name": "majorVersion",
1578
+ "required": false
1579
+ }
1580
+ },
1581
+ "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",
1582
+ "examples": [
1583
+ "zapier cache:clear",
1584
+ "zapier cache:clear 2"
1585
+ ],
1586
+ "flags": {
1587
+ "debug": {
1588
+ "char": "d",
1589
+ "description": "Show extra debugging output.",
1590
+ "name": "debug",
1591
+ "allowNo": false,
1592
+ "type": "boolean"
1593
+ },
1594
+ "invokedFromAnotherCommand": {
1595
+ "hidden": true,
1596
+ "name": "invokedFromAnotherCommand",
1597
+ "allowNo": false,
1598
+ "type": "boolean"
1599
+ }
1600
+ },
1601
+ "hasDynamicHelp": false,
1602
+ "hiddenAliases": [],
1603
+ "id": "cache:clear",
1604
+ "pluginAlias": "zapier-platform-cli",
1605
+ "pluginName": "zapier-platform-cli",
1606
+ "pluginType": "core",
1607
+ "strict": true,
1608
+ "enableJsonFlag": false,
1609
+ "skipValidInstallCheck": true,
1610
+ "hide": true,
1611
+ "isESM": false,
1612
+ "relativePath": [
1613
+ "src",
1614
+ "oclif",
1615
+ "commands",
1616
+ "cache",
1617
+ "clear.js"
1618
+ ]
1619
+ },
1565
1620
  "canary:create": {
1566
1621
  "aliases": [],
1567
1622
  "args": {
@@ -1725,54 +1780,6 @@
1725
1780
  "list.js"
1726
1781
  ]
1727
1782
  },
1728
- "cache:clear": {
1729
- "aliases": [],
1730
- "args": {
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
1735
- }
1736
- },
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",
1738
- "examples": [
1739
- "zapier cache:clear",
1740
- "zapier cache:clear 2"
1741
- ],
1742
- "flags": {
1743
- "debug": {
1744
- "char": "d",
1745
- "description": "Show extra debugging output.",
1746
- "name": "debug",
1747
- "allowNo": false,
1748
- "type": "boolean"
1749
- },
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
1783
  "delete:integration": {
1777
1784
  "aliases": [
1778
1785
  "delete:app"
@@ -2410,5 +2417,5 @@
2410
2417
  ]
2411
2418
  }
2412
2419
  },
2413
- "version": "16.5.0"
2420
+ "version": "16.5.1"
2414
2421
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zapier-platform-cli",
3
- "version": "16.5.0",
3
+ "version": "16.5.1",
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/",
@@ -1,29 +1,10 @@
1
1
  const colors = require('colors/safe');
2
-
2
+ const { Flags } = require('@oclif/core');
3
3
  const BaseCommand = require('../ZapierBaseCommand');
4
4
  const { buildFlags } = require('../buildFlags');
5
5
 
6
6
  const { listVersions } = require('../../utils/api');
7
7
 
8
- const deploymentToLifecycleState = (deployment) => {
9
- switch (deployment) {
10
- case 'non-production':
11
- return 'private';
12
- case 'production':
13
- return 'promoted';
14
- case 'demoted':
15
- return 'available';
16
- case 'legacy':
17
- return 'legacy';
18
- case 'deprecating':
19
- return 'deprecating';
20
- case 'deprecated':
21
- return 'deprecated';
22
- default:
23
- return deployment;
24
- }
25
- };
26
-
27
8
  class VersionCommand extends BaseCommand {
28
9
  async perform() {
29
10
  this.startSpinner('Loading versions');
@@ -31,11 +12,15 @@ class VersionCommand extends BaseCommand {
31
12
  this.stopSpinner();
32
13
  const rows = versions.map((v) => ({
33
14
  ...v,
34
- state: deploymentToLifecycleState(v.lifecycle.status),
15
+ state: v.lifecycle.status,
35
16
  }));
36
17
 
18
+ const visibleVersions = this.flags.all
19
+ ? rows
20
+ : rows.filter((v) => v.state !== 'deprecated');
21
+
37
22
  this.logTable({
38
- rows,
23
+ rows: visibleVersions,
39
24
  headers: [
40
25
  ['Version', 'version'],
41
26
  ['Platform', 'platform_version'],
@@ -81,7 +66,15 @@ class VersionCommand extends BaseCommand {
81
66
  }
82
67
 
83
68
  VersionCommand.skipValidInstallCheck = true;
84
- VersionCommand.flags = buildFlags({ opts: { format: true } });
69
+ VersionCommand.flags = buildFlags({
70
+ commandFlags: {
71
+ all: Flags.boolean({
72
+ char: 'a',
73
+ description: `List all versions, including deprecated versions.`,
74
+ }),
75
+ },
76
+ opts: { format: true },
77
+ });
85
78
  VersionCommand.description = `List the versions of your integration available for use in Zapier automations.`;
86
79
 
87
80
  module.exports = VersionCommand;