jiradc-cli 1.0.25-gc990f41.1 → 1.0.26
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/dist/index.js +10 -13
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -25,10 +25,10 @@ function intInRange(min, max) {
|
|
|
25
25
|
return (raw) => {
|
|
26
26
|
const n = parseInt(raw, 10);
|
|
27
27
|
if (Number.isNaN(n) || !Number.isFinite(n)) {
|
|
28
|
-
throw new InvalidArgumentError(
|
|
28
|
+
throw new InvalidArgumentError("Must be an integer.");
|
|
29
29
|
}
|
|
30
30
|
if (n < min || n > max) {
|
|
31
|
-
throw new InvalidArgumentError(`Must be between ${min} and ${max}
|
|
31
|
+
throw new InvalidArgumentError(`Must be between ${min} and ${max}.`);
|
|
32
32
|
}
|
|
33
33
|
return n;
|
|
34
34
|
};
|
|
@@ -36,14 +36,14 @@ function intInRange(min, max) {
|
|
|
36
36
|
function nonNegativeInt(raw) {
|
|
37
37
|
const n = parseInt(raw, 10);
|
|
38
38
|
if (Number.isNaN(n) || n < 0) {
|
|
39
|
-
throw new InvalidArgumentError(
|
|
39
|
+
throw new InvalidArgumentError("Must be a non-negative integer.");
|
|
40
40
|
}
|
|
41
41
|
return n;
|
|
42
42
|
}
|
|
43
43
|
function positiveInt(raw) {
|
|
44
44
|
const n = parseInt(raw, 10);
|
|
45
45
|
if (Number.isNaN(n) || n < 1) {
|
|
46
|
-
throw new InvalidArgumentError(
|
|
46
|
+
throw new InvalidArgumentError("Must be a positive integer.");
|
|
47
47
|
}
|
|
48
48
|
return n;
|
|
49
49
|
}
|
|
@@ -53,7 +53,7 @@ function text(raw) {
|
|
|
53
53
|
function date(raw) {
|
|
54
54
|
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(raw);
|
|
55
55
|
if (!m) {
|
|
56
|
-
throw new InvalidArgumentError(
|
|
56
|
+
throw new InvalidArgumentError("Must be a date in YYYY-MM-DD format.");
|
|
57
57
|
}
|
|
58
58
|
const [, y, mo, d] = m;
|
|
59
59
|
const year = Number(y);
|
|
@@ -61,29 +61,26 @@ function date(raw) {
|
|
|
61
61
|
const day = Number(d);
|
|
62
62
|
const dt = new Date(Date.UTC(year, month - 1, day));
|
|
63
63
|
if (dt.getUTCFullYear() !== year || dt.getUTCMonth() !== month - 1 || dt.getUTCDate() !== day) {
|
|
64
|
-
throw new InvalidArgumentError(
|
|
64
|
+
throw new InvalidArgumentError("Not a real calendar date.");
|
|
65
65
|
}
|
|
66
66
|
return raw;
|
|
67
67
|
}
|
|
68
68
|
function dateTime(raw) {
|
|
69
69
|
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(raw) || Number.isNaN(Date.parse(raw))) {
|
|
70
|
-
throw new InvalidArgumentError(
|
|
70
|
+
throw new InvalidArgumentError("Must be an ISO 8601 date-time, e.g. 2026-06-08T14:30:00Z.");
|
|
71
71
|
}
|
|
72
72
|
return raw;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// ../../cli-utils/dist/json.js
|
|
76
76
|
import { InvalidArgumentError as InvalidArgumentError2 } from "commander";
|
|
77
|
-
function truncate(s, max = 80) {
|
|
78
|
-
return s.length > max ? `${s.slice(0, max)}\u2026` : s;
|
|
79
|
-
}
|
|
80
77
|
function jsonShape(schema) {
|
|
81
78
|
return (raw) => {
|
|
82
79
|
let parsed;
|
|
83
80
|
try {
|
|
84
81
|
parsed = JSON.parse(raw);
|
|
85
82
|
} catch {
|
|
86
|
-
throw new InvalidArgumentError2(
|
|
83
|
+
throw new InvalidArgumentError2("Must be valid JSON.");
|
|
87
84
|
}
|
|
88
85
|
const result = schema.safeParse(parsed);
|
|
89
86
|
if (!result.success) {
|
|
@@ -993,8 +990,8 @@ async function resolveUserToken(token) {
|
|
|
993
990
|
// src/utils/validators.ts
|
|
994
991
|
import { InvalidArgumentError as InvalidArgumentError4 } from "commander";
|
|
995
992
|
function issueKey(raw) {
|
|
996
|
-
if (!/^[A-Z][A-Z0-9]+-\d
|
|
997
|
-
throw new InvalidArgumentError4(
|
|
993
|
+
if (!/^(\d+|[A-Z][A-Z0-9]+-\d+)$/.test(raw)) {
|
|
994
|
+
throw new InvalidArgumentError4("Must be a Jira issue key (e.g. PROJ-123) or a numeric issue id.");
|
|
998
995
|
}
|
|
999
996
|
return raw;
|
|
1000
997
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jiradc-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"publish": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"commander": "^13.1.0",
|
|
15
15
|
"zod": "^3.25.67",
|
|
16
|
-
"jira-data-center-client": "1.0.39
|
|
16
|
+
"jira-data-center-client": "1.0.39"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "24.10.4",
|