isc-transforms-mcp 1.0.6 → 1.0.7

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.
@@ -28,14 +28,34 @@
28
28
  "additionalProperties": false,
29
29
  "properties": {
30
30
  "inputFormat": {
31
- "type": "string",
32
31
  "default": "ISO8601",
33
- "description": "Format of the incoming date. Java SimpleDateFormat pattern or built-in named format."
32
+ "description": "Format of the incoming date. Must be one of the 5 named formats or a Java SimpleDateFormat pattern.",
33
+ "anyOf": [
34
+ {
35
+ "enum": ["ISO8601", "LDAP", "PEOPLE_SOFT", "EPOCH_TIME_JAVA", "EPOCH_TIME_WIN32"],
36
+ "description": "Built-in named format."
37
+ },
38
+ {
39
+ "type": "string",
40
+ "not": { "pattern": "^[A-Z][A-Z0-9_]+$" },
41
+ "description": "Java SimpleDateFormat pattern (e.g. dd-MM-yyyy, yyyy-MM-dd'T'HH:mm:ssZ)."
42
+ }
43
+ ]
34
44
  },
35
45
  "outputFormat": {
36
- "type": "string",
37
46
  "default": "ISO8601",
38
- "description": "Desired output format. Java SimpleDateFormat pattern or built-in named format."
47
+ "description": "Desired output format. Must be one of the 5 named formats or a Java SimpleDateFormat pattern.",
48
+ "anyOf": [
49
+ {
50
+ "enum": ["ISO8601", "LDAP", "PEOPLE_SOFT", "EPOCH_TIME_JAVA", "EPOCH_TIME_WIN32"],
51
+ "description": "Built-in named format."
52
+ },
53
+ {
54
+ "type": "string",
55
+ "not": { "pattern": "^[A-Z][A-Z0-9_]+$" },
56
+ "description": "Java SimpleDateFormat pattern (e.g. dd-MM-yyyy, yyyy-MM-dd'T'HH:mm:ssZ)."
57
+ }
58
+ ]
39
59
  },
40
60
  "input": {
41
61
  "description": "Explicitly defines the input data passed into the transform. Docs specify an object; in practice this is a nested transform object. If omitted, the transform uses the UI-configured source+attribute input.",
@@ -457,7 +457,10 @@ function lintDateCompare(attrs) {
457
457
  // ---------------------------------------------------------------------------
458
458
  function lintDateFormat(attrs) {
459
459
  const msgs = [];
460
- const NAMED_FORMATS = new Set(["ISO8601", "EPOCH_TIME_JAVA", "EPOCH_TIME_WIN32", "LDAP_GENERALIZED_TIME"]);
460
+ // Exact set of named formats per SailPoint docs — no variants accepted.
461
+ const NAMED_FORMATS = new Set(["ISO8601", "LDAP", "PEOPLE_SOFT", "EPOCH_TIME_JAVA", "EPOCH_TIME_WIN32"]);
462
+ // A value that is ALL_CAPS_WITH_UNDERSCORES is clearly intended as a named constant, not a pattern.
463
+ const looksLikeNamedConstant = (s) => /^[A-Z][A-Z0-9_]+$/.test(s);
461
464
  const isLikelyPattern = (s) => /[yMdHhmsSZ]/.test(s);
462
465
  const checkFmt = (field) => {
463
466
  const raw = attrs?.[field];
@@ -468,15 +471,20 @@ function lintDateFormat(attrs) {
468
471
  return;
469
472
  }
470
473
  const t = raw.trim();
471
- const lower = t.toLowerCase();
472
- if (lower === "epoch" || lower === "unix" || lower === "unixtime" || lower === "javaepoch") {
473
- push(msgs, "error", `Unsupported ${field} '${t}'. Use a documented named format: ${Array.from(NAMED_FORMATS).join(", ")}.`, `attributes.${field}`);
474
+ // If the value looks like a named constant (ALL_CAPS_UNDERSCORES), validate strictly.
475
+ // Do NOT fall through to isLikelyPattern e.g. EPOCH_TIME_JAVA_IN_MILLIS contains
476
+ // 'H' and 'M' and would falsely pass the pattern check.
477
+ if (looksLikeNamedConstant(t)) {
478
+ if (!NAMED_FORMATS.has(t)) {
479
+ push(msgs, "error", `'${t}' is not a valid named format for ${field}. ` +
480
+ `Allowed named formats: ${Array.from(NAMED_FORMATS).join(", ")}. ` +
481
+ `Alternatively, use a Java SimpleDateFormat pattern (e.g. dd-MM-yyyy, yyyy-MM-dd'T'HH:mm:ssZ).`, `attributes.${field}`);
482
+ }
474
483
  return;
475
484
  }
476
- if (NAMED_FORMATS.has(t.toUpperCase()))
477
- return;
485
+ // Value looks like a date pattern — check it has at least one date token.
478
486
  if (!isLikelyPattern(t)) {
479
- push(msgs, "warn", `${field} '${t}' doesn't match a known named format and doesn't look like a date pattern (missing date tokens like y/M/d/H).`, `attributes.${field}`);
487
+ push(msgs, "warn", `${field} '${t}' doesn't match a known named format and doesn't look like a date pattern (missing tokens like y/M/d/H).`, `attributes.${field}`);
480
488
  }
481
489
  };
482
490
  checkFmt("inputFormat");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isc-transforms-mcp",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "description": "MCP server for SailPoint Identity Security Cloud (ISC) Transform authoring — scaffold, strict lint, catalog, and safe upsert to live tenants.",
6
6
  "author": {