@shortcut-cli/shortcut-cli 3.4.0 → 3.6.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.
@@ -1,36 +1,10 @@
1
1
  #!/usr/bin/env node
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
2
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
3
+ const require_package = require('../package.js');
4
+ const commander = require_rolldown_runtime.__toESM(require("commander"));
24
5
 
25
- // src/bin/short.ts
26
- var import_commander = __toESM(require("commander"));
27
-
28
- // package.json
29
- var version = "3.4.0";
30
- var description = "A community-driven command line tool for viewing, creating, and updating shortcut.com stories";
31
-
32
- // src/bin/short.ts
6
+ //#region src/bin/short.ts
33
7
  process.on("unhandledRejection", console.log);
34
- import_commander.default.version(version).description(description).command("install [options]", "install and configure API access").command("search [options] [SEARCH OPERATORS]", "search stories with optional query").alias("s").command("find [options] [SEARCH OPERATORS]", "[DEPRECATED] search stories with optional query").command("story ID [options]", "view or manipulate stories").alias("st").command("create [options]", "create a story").alias("c").command("members [options]", "list members").alias("m").command("workflows [options]", "list workflows and their states").alias("wf").command("epics [options]", "list epics and their states").alias("e").command("projects [options]", "list projects and their states").alias("p").command("workspace [NAME] [options]", "list stories matching saved workspace query", {
35
- isDefault: true
36
- }).alias("w").parse(process.argv);
8
+ commander.default.version(require_package.version).description(require_package.description).command("install [options]", "install and configure API access").command("search [options] [SEARCH OPERATORS]", "search stories with optional query").alias("s").command("find [options] [SEARCH OPERATORS]", "[DEPRECATED] search stories with optional query").command("story ID [options]", "view or manipulate stories").alias("st").command("create [options]", "create a story").alias("c").command("members [options]", "list members").alias("m").command("workflows [options]", "list workflows and their states").alias("wf").command("epics [options]", "list epics and their states").alias("e").command("projects [options]", "list projects and their states").alias("p").command("workspace [NAME] [options]", "list stories matching saved workspace query", { isDefault: true }).alias("w").command("api <path> [options]", "make a request to the Shortcut API").parse(process.argv);
9
+
10
+ //#endregion
@@ -1,105 +1,12 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
3
+ const require_lib_configure = require('./configure.js');
4
+ const __shortcut_client = require_rolldown_runtime.__toESM(require("@shortcut/client"));
28
5
 
29
- // src/lib/client.ts
30
- var client_exports = {};
31
- __export(client_exports, {
32
- default: () => client_default
33
- });
34
- module.exports = __toCommonJS(client_exports);
35
- var import_client = require("@shortcut/client");
36
-
37
- // src/lib/configure.ts
38
- var import_path = __toESM(require("path"));
39
- var import_fs = __toESM(require("fs"));
40
- var import_os = __toESM(require("os"));
41
- function getConfigDir(suffix) {
42
- const configBaseDir = process.env.XDG_CONFIG_HOME || import_path.default.resolve(process.env.XDG_DATA_HOME || import_os.default.homedir(), ".config");
43
- return import_path.default.resolve(configBaseDir, suffix);
44
- }
45
- var configDir = getConfigDir("shortcut-cli");
46
- var configFile = import_path.default.resolve(configDir, "config.json");
47
- var legacyConfigDirs = [
48
- getConfigDir("clubhouse-cli"),
49
- import_path.default.resolve(import_os.default.homedir(), ".clubhouse-cli")
50
- ];
51
- var CONFIG_CACHE = null;
52
- var loadConfig = () => {
53
- const config2 = loadCachedConfig();
54
- if (!config2 || config2 === {} || !config2.token) {
55
- console.error("Please run 'short install' to configure Shortcut API access.");
56
- process.exit(11);
57
- }
58
- if (!config2.urlSlug) {
59
- console.error(
60
- "Your config must be updated with data from Shortcut. Please run 'short install --refresh'."
61
- );
62
- process.exit(12);
63
- }
64
- return config2;
65
- };
66
- var loadCachedConfig = () => {
67
- if (CONFIG_CACHE) {
68
- return { ...CONFIG_CACHE };
69
- }
70
- let config2 = {};
71
- const token = process.env.SHORTCUT_API_TOKEN || process.env.CLUBHOUSE_API_TOKEN;
72
- legacyConfigDirs.forEach((dir) => {
73
- if (import_fs.default.existsSync(dir)) {
74
- createConfigDir();
75
- import_fs.default.renameSync(dir, configDir);
76
- }
77
- });
78
- if (import_fs.default.existsSync(configFile)) {
79
- try {
80
- config2 = JSON.parse(import_fs.default.readFileSync(configFile, "utf8"));
81
- } catch (e) {
82
- console.error(e);
83
- process.exit(10);
84
- }
85
- }
86
- if (token) {
87
- config2 = { token, ...config2 };
88
- }
89
- CONFIG_CACHE = { ...config2 };
90
- return config2;
91
- };
92
- var createConfigDir = () => {
93
- const dir = import_path.default.dirname(configDir);
94
- if (!import_fs.default.existsSync(dir)) {
95
- import_fs.default.mkdirSync(dir);
96
- }
97
- if (!import_fs.default.existsSync(configDir)) {
98
- import_fs.default.mkdirSync(configDir);
99
- }
100
- };
101
-
102
- // src/lib/client.ts
103
- var config = loadConfig();
104
- var client = new import_client.ShortcutClient(config.token);
6
+ //#region src/lib/client.ts
7
+ const config = require_lib_configure.loadConfig();
8
+ const client = new __shortcut_client.ShortcutClient(config.token);
105
9
  var client_default = client;
10
+
11
+ //#endregion
12
+ exports.default = client_default;
@@ -1,138 +1,105 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
3
+ const path = require_rolldown_runtime.__toESM(require("path"));
4
+ const fs = require_rolldown_runtime.__toESM(require("fs"));
5
+ const os = require_rolldown_runtime.__toESM(require("os"));
28
6
 
29
- // src/lib/configure.ts
30
- var configure_exports = {};
31
- __export(configure_exports, {
32
- default: () => configure_default,
33
- loadCachedConfig: () => loadCachedConfig,
34
- loadConfig: () => loadConfig,
35
- updateConfig: () => updateConfig
36
- });
37
- module.exports = __toCommonJS(configure_exports);
38
- var import_path = __toESM(require("path"));
39
- var import_fs = __toESM(require("fs"));
40
- var import_os = __toESM(require("os"));
7
+ //#region src/lib/configure.ts
41
8
  function getConfigDir(suffix) {
42
- const configBaseDir = process.env.XDG_CONFIG_HOME || import_path.default.resolve(process.env.XDG_DATA_HOME || import_os.default.homedir(), ".config");
43
- return import_path.default.resolve(configBaseDir, suffix);
9
+ const configBaseDir = process.env.XDG_CONFIG_HOME || path.default.resolve(process.env.XDG_DATA_HOME || os.default.homedir(), ".config");
10
+ return path.default.resolve(configBaseDir, suffix);
44
11
  }
45
- var configDir = getConfigDir("shortcut-cli");
46
- var configFile = import_path.default.resolve(configDir, "config.json");
47
- var legacyConfigDirs = [
48
- getConfigDir("clubhouse-cli"),
49
- import_path.default.resolve(import_os.default.homedir(), ".clubhouse-cli")
50
- ];
51
- var CONFIG_CACHE = null;
52
- var loadConfig = () => {
53
- const config = loadCachedConfig();
54
- if (!config || config === {} || !config.token) {
55
- console.error("Please run 'short install' to configure Shortcut API access.");
56
- process.exit(11);
57
- }
58
- if (!config.urlSlug) {
59
- console.error(
60
- "Your config must be updated with data from Shortcut. Please run 'short install --refresh'."
61
- );
62
- process.exit(12);
63
- }
64
- return config;
12
+ const configDir = getConfigDir("shortcut-cli");
13
+ const configFile = path.default.resolve(configDir, "config.json");
14
+ const legacyConfigDirs = [getConfigDir("clubhouse-cli"), path.default.resolve(os.default.homedir(), ".clubhouse-cli")];
15
+ let CONFIG_CACHE = null;
16
+ /**
17
+ * Config load function to be used in most-cases.
18
+ */
19
+ const loadConfig = () => {
20
+ const config = loadCachedConfig();
21
+ if (!config || config === {} || !config.token) {
22
+ console.error("Please run 'short install' to configure Shortcut API access.");
23
+ process.exit(11);
24
+ }
25
+ if (!config.urlSlug) {
26
+ console.error("Your config must be updated with data from Shortcut. Please run 'short install --refresh'.");
27
+ process.exit(12);
28
+ }
29
+ return config;
65
30
  };
66
- var loadCachedConfig = () => {
67
- if (CONFIG_CACHE) {
68
- return { ...CONFIG_CACHE };
69
- }
70
- let config = {};
71
- const token = process.env.SHORTCUT_API_TOKEN || process.env.CLUBHOUSE_API_TOKEN;
72
- legacyConfigDirs.forEach((dir) => {
73
- if (import_fs.default.existsSync(dir)) {
74
- createConfigDir();
75
- import_fs.default.renameSync(dir, configDir);
76
- }
77
- });
78
- if (import_fs.default.existsSync(configFile)) {
79
- try {
80
- config = JSON.parse(import_fs.default.readFileSync(configFile, "utf8"));
81
- } catch (e) {
82
- console.error(e);
83
- process.exit(10);
84
- }
85
- }
86
- if (token) {
87
- config = { token, ...config };
88
- }
89
- CONFIG_CACHE = { ...config };
90
- return config;
31
+ /**
32
+ * Only use this function directly if you need to avoid the config check.
33
+ */
34
+ const loadCachedConfig = () => {
35
+ if (CONFIG_CACHE) return { ...CONFIG_CACHE };
36
+ let config = {};
37
+ const token = process.env.SHORTCUT_API_TOKEN || process.env.CLUBHOUSE_API_TOKEN;
38
+ legacyConfigDirs.forEach((dir) => {
39
+ if (fs.default.existsSync(dir)) {
40
+ createConfigDir();
41
+ fs.default.renameSync(dir, configDir);
42
+ }
43
+ });
44
+ if (fs.default.existsSync(configFile)) try {
45
+ config = JSON.parse(fs.default.readFileSync(configFile, "utf8"));
46
+ } catch (e) {
47
+ console.error(e);
48
+ process.exit(10);
49
+ }
50
+ if (token) config = {
51
+ token,
52
+ ...config
53
+ };
54
+ CONFIG_CACHE = { ...config };
55
+ return config;
91
56
  };
92
- var createConfigDir = () => {
93
- const dir = import_path.default.dirname(configDir);
94
- if (!import_fs.default.existsSync(dir)) {
95
- import_fs.default.mkdirSync(dir);
96
- }
97
- if (!import_fs.default.existsSync(configDir)) {
98
- import_fs.default.mkdirSync(configDir);
99
- }
57
+ const createConfigDir = () => {
58
+ const dir = path.default.dirname(configDir);
59
+ if (!fs.default.existsSync(dir)) fs.default.mkdirSync(dir);
60
+ if (!fs.default.existsSync(configDir)) fs.default.mkdirSync(configDir);
100
61
  };
101
- var saveConfig = (config) => {
102
- try {
103
- createConfigDir();
104
- import_fs.default.writeFileSync(configFile, JSON.stringify(config), { flag: "w" });
105
- CONFIG_CACHE = { ...config };
106
- return true;
107
- } catch (e) {
108
- console.error(e);
109
- return false;
110
- }
62
+ const saveConfig = (config) => {
63
+ try {
64
+ createConfigDir();
65
+ fs.default.writeFileSync(configFile, JSON.stringify(config), { flag: "w" });
66
+ CONFIG_CACHE = { ...config };
67
+ return true;
68
+ } catch (e) {
69
+ console.error(e);
70
+ return false;
71
+ }
111
72
  };
112
- var updateConfig = (newConfig) => {
113
- const extantConfig = loadCachedConfig() || {};
114
- return saveConfig({ ...newConfig, ...extantConfig });
73
+ const updateConfig = (newConfig) => {
74
+ const extantConfig = loadCachedConfig() || {};
75
+ return saveConfig({
76
+ ...newConfig,
77
+ ...extantConfig
78
+ });
115
79
  };
116
- var saveWorkspace = (name, workspace) => {
117
- const extantConfig = loadCachedConfig();
118
- const workspaces = extantConfig.workspaces || {};
119
- workspaces[name] = workspace;
120
- return saveConfig({ workspaces, ...extantConfig });
80
+ const saveWorkspace = (name, workspace) => {
81
+ const extantConfig = loadCachedConfig();
82
+ const workspaces = extantConfig.workspaces || {};
83
+ workspaces[name] = workspace;
84
+ return saveConfig({
85
+ workspaces,
86
+ ...extantConfig
87
+ });
121
88
  };
122
- var removeWorkspace = (name) => {
123
- const extant = loadCachedConfig();
124
- delete extant.workspaces[name];
125
- return saveConfig(Object.assign({}, extant));
89
+ const removeWorkspace = (name) => {
90
+ const extant = loadCachedConfig();
91
+ delete extant.workspaces[name];
92
+ return saveConfig(Object.assign({}, extant));
126
93
  };
127
94
  var configure_default = {
128
- loadConfig,
129
- updateConfig,
130
- saveWorkspace,
131
- removeWorkspace
95
+ loadConfig,
96
+ updateConfig,
97
+ saveWorkspace,
98
+ removeWorkspace
132
99
  };
133
- // Annotate the CommonJS export names for ESM import in node:
134
- 0 && (module.exports = {
135
- loadCachedConfig,
136
- loadConfig,
137
- updateConfig
138
- });
100
+
101
+ //#endregion
102
+ exports.default = configure_default;
103
+ exports.loadCachedConfig = loadCachedConfig;
104
+ exports.loadConfig = loadConfig;
105
+ exports.updateConfig = updateConfig;
@@ -1,34 +1,17 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
3
+ const cli_spinner = require_rolldown_runtime.__toESM(require("cli-spinner"));
18
4
 
19
- // src/lib/spinner.ts
20
- var spinner_exports = {};
21
- __export(spinner_exports, {
22
- default: () => spinner_default
23
- });
24
- module.exports = __toCommonJS(spinner_exports);
25
- var import_cli_spinner = require("cli-spinner");
26
- var spinner = (text = "") => {
27
- const spin = new import_cli_spinner.Spinner({
28
- text: text ? text : "Loading... %s ",
29
- stream: process.stderr
30
- });
31
- spin.setSpinnerString(27);
32
- return spin;
5
+ //#region src/lib/spinner.ts
6
+ const spinner = (text = "") => {
7
+ const spin = new cli_spinner.Spinner({
8
+ text: text ? text : "Loading... %s ",
9
+ stream: process.stderr
10
+ });
11
+ spin.setSpinnerString(27);
12
+ return spin;
33
13
  };
34
14
  var spinner_default = spinner;
15
+
16
+ //#endregion
17
+ exports.default = spinner_default;