@workbench-kit/field-remap 0.0.2-prototype.0.2.25 → 0.0.2-prototype.0.2.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workbench-kit/field-remap",
3
- "version": "0.0.2-prototype.0.2.25",
3
+ "version": "0.0.2-prototype.0.2.27",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -22,23 +22,9 @@ function sanitizeTransformIds(ids: readonly string[] | undefined): string[] {
22
22
  return cleaned.slice(0, MAX_TRANSFORM_CHAIN);
23
23
  }
24
24
 
25
- /**
26
- * Resolve the effective transform chain for an edge.
27
- * Prefers `transformIds`; falls back to legacy `transformId`.
28
- * Identity / empty / null → `[]` (pass-through).
29
- */
25
+ /** Resolve the effective transform chain for an edge. Identity / empty → pass-through. */
30
26
  export function edgeTransformIds(edge: MappingEdge): string[] {
31
- const fromList = sanitizeTransformIds(edge.transformIds);
32
- if (fromList.length > 0) {
33
- return fromList;
34
- }
35
-
36
- const legacy = edge.transformId ? canonicalizeTransformId(edge.transformId) : '';
37
- if (legacy && legacy !== IDENTITY_TRANSFORM_ID) {
38
- return [legacy];
39
- }
40
-
41
- return [];
27
+ return sanitizeTransformIds(edge.transformIds);
42
28
  }
43
29
 
44
30
  /** Per-item transform chain applied after optional `itemSourcePath` projection. */
@@ -47,9 +33,6 @@ export function edgeItemTransformIds(edge: MappingEdge): string[] {
47
33
  }
48
34
 
49
35
  /**
50
- * Normalize an edge to the `transformIds` model while keeping `transformId`
51
- * as the first chain step (or `null`) for older hosts.
52
- *
53
36
  * Option bags:
54
37
  * - Prefer `transformOptionSteps` when present (aligned to chain length).
55
38
  * - Keep `transformOptions` as the first non-empty step (or the legacy shared bag).
@@ -85,7 +68,6 @@ export function normalizeMappingEdge(edge: MappingEdge): MappingEdge {
85
68
  sourceFieldId: edge.sourceFieldId,
86
69
  targetSlotId: edge.targetSlotId,
87
70
  transformIds: ids.length > 0 ? ids : undefined,
88
- transformId: ids[0] ?? null,
89
71
  ...(transformOptionSteps ? { transformOptionSteps } : {}),
90
72
  ...(transformOptions ? { transformOptions } : {}),
91
73
  ...(itemSourcePath && !itemEdges ? { itemSourcePath } : {}),
@@ -106,8 +88,6 @@ export function createMappingEdge(input: {
106
88
  readonly sourceFieldId: string;
107
89
  readonly targetSlotId: string;
108
90
  readonly transformIds?: readonly string[];
109
- /** Legacy single id; ignored when `transformIds` is provided. */
110
- readonly transformId?: string | null;
111
91
  readonly transformOptionSteps?: readonly (Readonly<Record<string, unknown>> | undefined)[];
112
92
  readonly transformOptions?: Readonly<Record<string, unknown>>;
113
93
  /** Optional per-item projection path for array mappings. */
@@ -124,7 +104,6 @@ export function createMappingEdge(input: {
124
104
  sourceFieldId: input.sourceFieldId,
125
105
  targetSlotId: input.targetSlotId,
126
106
  transformIds: input.transformIds,
127
- transformId: input.transformId,
128
107
  transformOptionSteps: input.transformOptionSteps,
129
108
  transformOptions: input.transformOptions,
130
109
  itemSourcePath: input.itemSourcePath,
@@ -103,21 +103,6 @@ export function parseObjectPath(path: string): ObjectPathSegment[] {
103
103
  });
104
104
  }
105
105
 
106
- /**
107
- * Parse dotted path segments as plain property names (no `[index]` / `[*]`).
108
- * Rejects unsafe segments when any parts exist.
109
- */
110
- export function requireObjectPathParts(path: string): string[] {
111
- const segments = parseObjectPath(path);
112
- if (segments.some((segment) => segment.kind !== 'property')) {
113
- throw new InvalidObjectPathError(
114
- path,
115
- 'index/wildcard segments are not allowed in this context',
116
- );
117
- }
118
- return segments.map((segment) => segment.name);
119
- }
120
-
121
106
  export function isSafeObjectPath(path: string): boolean {
122
107
  const trimmed = path.trim();
123
108
  if (!SAFE_PATH_RE.test(trimmed)) {
@@ -28,7 +28,7 @@ export function findSourceField(
28
28
  * Apply order:
29
29
  * 1. Optional `itemSourcePath` projection (array of objects → projected array)
30
30
  * 2. Optional `itemTransformIds` per element (when the value is still an array)
31
- * 3. `transformIds` / legacy `transformId` on the whole value (including array reduces)
31
+ * 3. `transformIds` on the whole value (including array reduces)
32
32
  *
33
33
  * Per-step options (`transformOptionSteps` / `itemTransformOptionSteps`) win when
34
34
  * present; otherwise shared `transformOptions` / `itemTransformOptions` apply to all steps.
@@ -81,17 +81,10 @@ export interface MappingEdge {
81
81
  readonly targetSlotId: string;
82
82
  /**
83
83
  * Ordered transform chain (max 3). Empty / omitted means identity.
84
- * Prefer this over `transformId` for new writers.
85
84
  * For arrays: use reduce builtins (`array:join`, `array:first`, …) here after
86
85
  * optional item projection / item transforms.
87
86
  */
88
87
  readonly transformIds?: readonly string[];
89
- /**
90
- * Legacy single transform. Prefer `transformIds`.
91
- * Readers should use `edgeTransformIds` / `normalizeMappingEdge`.
92
- * `null` / omitted (with no `transformIds`) means identity (pass-through).
93
- */
94
- readonly transformId?: string | null;
95
88
  /**
96
89
  * Per-step options aligned with `transformIds` (index N applies to step N).
97
90
  * Prefer this when steps need different bags (e.g. `showSeconds` then `maxLength`).