jiradc-cli 1.0.19 → 1.0.20

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.
Files changed (2) hide show
  1. package/dist/index.js +28 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -433,6 +433,33 @@ function transformIssueFields(fields) {
433
433
  }
434
434
 
435
435
  // src/utils/transformers/transition.ts
436
+ function slimAllowedValue(raw) {
437
+ if (!raw || typeof raw !== "object") return {};
438
+ const av = raw;
439
+ const slim = {};
440
+ if (typeof av.id === "string") slim.id = av.id;
441
+ if (typeof av.name === "string") slim.name = av.name;
442
+ if (typeof av.value === "string") slim.value = av.value;
443
+ return slim;
444
+ }
445
+ function slimField(raw) {
446
+ if (!raw || typeof raw !== "object") return {};
447
+ const field = raw;
448
+ const out = {};
449
+ if (typeof field.required === "boolean") out.required = field.required;
450
+ if (typeof field.name === "string") out.name = field.name;
451
+ if (Array.isArray(field.allowedValues)) {
452
+ out.allowedValues = field.allowedValues.map(slimAllowedValue);
453
+ }
454
+ return out;
455
+ }
456
+ function slimFields(fields) {
457
+ const out = {};
458
+ for (const [key, raw] of Object.entries(fields)) {
459
+ out[key] = slimField(raw);
460
+ }
461
+ return out;
462
+ }
436
463
  function transformTransition(t) {
437
464
  const out = {
438
465
  id: t.id,
@@ -440,7 +467,7 @@ function transformTransition(t) {
440
467
  to: t.to.name
441
468
  };
442
469
  if (t.fields && Object.keys(t.fields).length > 0) {
443
- out.fields = t.fields;
470
+ out.fields = slimFields(t.fields);
444
471
  }
445
472
  return out;
446
473
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jiradc-cli",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "publish": true,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,8 +22,8 @@
22
22
  "tsx": "^4.19.2",
23
23
  "typescript": "^5.7.2",
24
24
  "vitest": "^4.0.16",
25
- "config-eslint": "0.0.0",
26
- "config-typescript": "0.0.0"
25
+ "config-typescript": "0.0.0",
26
+ "config-eslint": "0.0.0"
27
27
  },
28
28
  "engines": {
29
29
  "node": ">=22.0.0"