@workbench-kit/field-remap 0.0.1-prototype.0 → 0.0.2-prototype.0.2.5
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/README.md +115 -115
- package/package.json +1 -1
- package/src/domain/constants.ts +14 -14
- package/src/domain/document/fieldRemapDocument.ts +129 -129
- package/src/domain/document/mappingEdge.ts +136 -136
- package/src/domain/ingest/sourceFieldsFromPlainObject.ts +103 -103
- package/src/domain/ingest/targetSlotsFromPlainObject.ts +41 -41
- package/src/domain/mapping/convertItemEdges.ts +93 -93
- package/src/domain/mapping/dateFormat.ts +102 -102
- package/src/domain/mapping/mappingConflicts.ts +90 -90
- package/src/domain/mapping/pathUtils.ts +156 -156
- package/src/domain/mapping/resolveMappedValue.ts +96 -96
- package/src/domain/mapping/transformOptions.ts +184 -184
- package/src/domain/mapping/treeUtils.ts +32 -32
- package/src/domain/shapes/conversionDefinition.ts +95 -95
- package/src/domain/shapes/convertToShape.ts +187 -187
- package/src/domain/shapes/dataShape.ts +109 -109
- package/src/domain/types.ts +182 -182
- package/src/index.ts +137 -137
- package/src/registry/builtinTransforms.ts +243 -243
- package/src/registry/createValueTransformRegistry.ts +194 -194
package/src/domain/types.ts
CHANGED
|
@@ -1,182 +1,182 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared field / slot / edge types for field-remap UIs.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export type FieldDataType =
|
|
6
|
-
| 'string'
|
|
7
|
-
| 'number'
|
|
8
|
-
| 'boolean'
|
|
9
|
-
| 'date'
|
|
10
|
-
| 'time'
|
|
11
|
-
| 'datetime'
|
|
12
|
-
/**
|
|
13
|
-
* Plain object (record) — e.g. for `string:template` object → string.
|
|
14
|
-
*/
|
|
15
|
-
| 'object'
|
|
16
|
-
/**
|
|
17
|
-
* Collection hint — badge + array→array wiring.
|
|
18
|
-
* Optional per-item projection via `MappingEdge.itemSourcePath`.
|
|
19
|
-
*/
|
|
20
|
-
| 'array'
|
|
21
|
-
| 'unknown';
|
|
22
|
-
|
|
23
|
-
export interface SourceField {
|
|
24
|
-
readonly id: string;
|
|
25
|
-
readonly label: string;
|
|
26
|
-
/** Dot-path or capability path hint for hosts. */
|
|
27
|
-
readonly path?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Owning managed shape id when fields are merged from multiple source shapes.
|
|
30
|
-
* Used by `convertToShape` to pick the correct named input bag.
|
|
31
|
-
*/
|
|
32
|
-
readonly shapeId?: string;
|
|
33
|
-
readonly dataType?: FieldDataType;
|
|
34
|
-
/** Optional sample used by live preview / transform labels. */
|
|
35
|
-
readonly sampleValue?: unknown;
|
|
36
|
-
readonly group?: string;
|
|
37
|
-
readonly children?: readonly SourceField[];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface TargetSlot {
|
|
41
|
-
readonly id: string;
|
|
42
|
-
readonly label: string;
|
|
43
|
-
/**
|
|
44
|
-
* Dot-path used when assembling nested JSON output via `convertToShape`.
|
|
45
|
-
* When omitted, hosts may fall back to slot id / label.
|
|
46
|
-
*/
|
|
47
|
-
readonly path?: string;
|
|
48
|
-
readonly dataType?: FieldDataType;
|
|
49
|
-
readonly required?: boolean;
|
|
50
|
-
readonly description?: string;
|
|
51
|
-
/** Nested slot groups (expand/collapse in the mapper tree). */
|
|
52
|
-
readonly children?: readonly TargetSlot[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface MappingEdge {
|
|
56
|
-
readonly id: string;
|
|
57
|
-
readonly sourceFieldId: string;
|
|
58
|
-
readonly targetSlotId: string;
|
|
59
|
-
/**
|
|
60
|
-
* Ordered transform chain (max 3). Empty / omitted means identity.
|
|
61
|
-
* Prefer this over `transformId` for new writers.
|
|
62
|
-
* For arrays: use reduce builtins (`array:join`, `array:first`, …) here after
|
|
63
|
-
* optional item projection / item transforms.
|
|
64
|
-
*/
|
|
65
|
-
readonly transformIds?: readonly string[];
|
|
66
|
-
/**
|
|
67
|
-
* Legacy single transform. Prefer `transformIds`.
|
|
68
|
-
* Readers should use `edgeTransformIds` / `normalizeMappingEdge`.
|
|
69
|
-
* `null` / omitted (with no `transformIds`) means identity (pass-through).
|
|
70
|
-
*/
|
|
71
|
-
readonly transformId?: string | null;
|
|
72
|
-
/**
|
|
73
|
-
* Per-step options aligned with `transformIds` (index N applies to step N).
|
|
74
|
-
* Prefer this when steps need different bags (e.g. `showSeconds` then `maxLength`).
|
|
75
|
-
*/
|
|
76
|
-
readonly transformOptionSteps?: readonly (Readonly<Record<string, unknown>> | undefined)[];
|
|
77
|
-
/**
|
|
78
|
-
* Shared options for all `transformIds` steps (legacy / apply-to-all).
|
|
79
|
-
* Used when `transformOptionSteps` is omitted. Still written as a back-compat
|
|
80
|
-
* summary of step 0 (or the first non-empty step) by `normalizeMappingEdge`.
|
|
81
|
-
*/
|
|
82
|
-
readonly transformOptions?: Readonly<Record<string, unknown>>;
|
|
83
|
-
/**
|
|
84
|
-
* When the source is an array of objects, optional dotted path into each item
|
|
85
|
-
* (e.g. `name` or `meta.label`) before the value is written to the target.
|
|
86
|
-
* Omit / empty for whole-array pass-through (or reduce on the full array).
|
|
87
|
-
*/
|
|
88
|
-
readonly itemSourcePath?: string;
|
|
89
|
-
/**
|
|
90
|
-
* Ordered per-item transform chain (max 3) applied after `itemSourcePath`
|
|
91
|
-
* projection (or to each element when projecting is a no-op). Empty / omitted
|
|
92
|
-
* means identity per item. Independent of `transformIds` (which run on the
|
|
93
|
-
* whole collection afterward — e.g. reduce).
|
|
94
|
-
*/
|
|
95
|
-
readonly itemTransformIds?: readonly string[];
|
|
96
|
-
/**
|
|
97
|
-
* Per-step options aligned with `itemTransformIds`.
|
|
98
|
-
*/
|
|
99
|
-
readonly itemTransformOptionSteps?: readonly (Readonly<Record<string, unknown>> | undefined)[];
|
|
100
|
-
/**
|
|
101
|
-
* Shared options for all `itemTransformIds` steps (legacy / apply-to-all).
|
|
102
|
-
* Independent of `transformOptions` / `transformOptionSteps`.
|
|
103
|
-
*/
|
|
104
|
-
readonly itemTransformOptions?: Readonly<Record<string, unknown>>;
|
|
105
|
-
/**
|
|
106
|
-
* List-context child bindings (Stedi-style): when source is an array of objects,
|
|
107
|
-
* each element is converted through these edges into a target item object.
|
|
108
|
-
* Child `sourceFieldId` / `targetSlotId` should resolve to item-schema fields
|
|
109
|
-
* (ingest ids like `a.tags.item.name`) whose `path` is item-relative.
|
|
110
|
-
*
|
|
111
|
-
* Takes precedence over `itemSourcePath` / `itemTransformIds` for the outer edge.
|
|
112
|
-
* Nested `itemEdges` on children are ignored (one collection level per edge).
|
|
113
|
-
*/
|
|
114
|
-
readonly itemEdges?: readonly MappingEdge[];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Minimal JSON-serializable mapping document for host persistence.
|
|
119
|
-
* Hosts own schema trees; this document stores the binding graph only.
|
|
120
|
-
*/
|
|
121
|
-
export interface FieldRemapDocument {
|
|
122
|
-
readonly version: 1;
|
|
123
|
-
readonly edges: readonly MappingEdge[];
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export interface TransformContext {
|
|
127
|
-
readonly locale?: string;
|
|
128
|
-
/** Reference instant for time/date presets; defaults to `new Date()`. */
|
|
129
|
-
readonly now?: Date;
|
|
130
|
-
readonly sampleValue?: unknown;
|
|
131
|
-
/**
|
|
132
|
-
* Optional plain object for `string:template` placeholder resolution when the
|
|
133
|
-
* transform input is not itself an object (hosts / demos).
|
|
134
|
-
*/
|
|
135
|
-
readonly record?: Readonly<Record<string, unknown>>;
|
|
136
|
-
readonly options?: Readonly<Record<string, unknown>>;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/** Declares a host-editable option consumed via `context.options[key]`. */
|
|
140
|
-
export interface TransformOptionField {
|
|
141
|
-
readonly key: string;
|
|
142
|
-
readonly label: string;
|
|
143
|
-
/**
|
|
144
|
-
* - `string` / `number` / `boolean` — single scalar inputs
|
|
145
|
-
* - `stringMap` — key/value row editor for string→string maps (e.g. `codeLabels`),
|
|
146
|
-
* with an optional List / JSON view toggle in `TransformOptionsEditor`
|
|
147
|
-
* - `json` — validated JSON textarea for plain objects (advanced / free-form);
|
|
148
|
-
* drafts commit when parseable and pretty-print on blur
|
|
149
|
-
*/
|
|
150
|
-
readonly kind: 'string' | 'number' | 'boolean' | 'stringMap' | 'json';
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export interface ValueTransformDefinition {
|
|
154
|
-
readonly id: string;
|
|
155
|
-
readonly label: string;
|
|
156
|
-
readonly description?: string;
|
|
157
|
-
readonly category?: string;
|
|
158
|
-
readonly inputTypes?: readonly FieldDataType[];
|
|
159
|
-
readonly outputType?: FieldDataType;
|
|
160
|
-
readonly apply: (value: unknown, context: TransformContext) => unknown;
|
|
161
|
-
/** Optional picker label that includes a live format sample. */
|
|
162
|
-
readonly formatSampleLabel?: (context: TransformContext) => string;
|
|
163
|
-
/**
|
|
164
|
-
* Data-driven option editors (mapped rows / convert panel).
|
|
165
|
-
* Values are stored per step (`transformOptionSteps` / `itemTransformOptionSteps`)
|
|
166
|
-
* or as a shared bag (`transformOptions` / `itemTransformOptions`), or on host
|
|
167
|
-
* `TransformContext.options`.
|
|
168
|
-
*/
|
|
169
|
-
readonly optionFields?: readonly TransformOptionField[];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export interface ValueTransformListFilter {
|
|
173
|
-
readonly inputType?: FieldDataType;
|
|
174
|
-
readonly category?: string;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export interface ValueTransformRegistry {
|
|
178
|
-
list(filter?: ValueTransformListFilter): ValueTransformDefinition[];
|
|
179
|
-
get(id: string): ValueTransformDefinition | undefined;
|
|
180
|
-
apply(id: string, value: unknown, context?: TransformContext): unknown;
|
|
181
|
-
register(definition: ValueTransformDefinition): void;
|
|
182
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Shared field / slot / edge types for field-remap UIs.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type FieldDataType =
|
|
6
|
+
| 'string'
|
|
7
|
+
| 'number'
|
|
8
|
+
| 'boolean'
|
|
9
|
+
| 'date'
|
|
10
|
+
| 'time'
|
|
11
|
+
| 'datetime'
|
|
12
|
+
/**
|
|
13
|
+
* Plain object (record) — e.g. for `string:template` object → string.
|
|
14
|
+
*/
|
|
15
|
+
| 'object'
|
|
16
|
+
/**
|
|
17
|
+
* Collection hint — badge + array→array wiring.
|
|
18
|
+
* Optional per-item projection via `MappingEdge.itemSourcePath`.
|
|
19
|
+
*/
|
|
20
|
+
| 'array'
|
|
21
|
+
| 'unknown';
|
|
22
|
+
|
|
23
|
+
export interface SourceField {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly label: string;
|
|
26
|
+
/** Dot-path or capability path hint for hosts. */
|
|
27
|
+
readonly path?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Owning managed shape id when fields are merged from multiple source shapes.
|
|
30
|
+
* Used by `convertToShape` to pick the correct named input bag.
|
|
31
|
+
*/
|
|
32
|
+
readonly shapeId?: string;
|
|
33
|
+
readonly dataType?: FieldDataType;
|
|
34
|
+
/** Optional sample used by live preview / transform labels. */
|
|
35
|
+
readonly sampleValue?: unknown;
|
|
36
|
+
readonly group?: string;
|
|
37
|
+
readonly children?: readonly SourceField[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface TargetSlot {
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly label: string;
|
|
43
|
+
/**
|
|
44
|
+
* Dot-path used when assembling nested JSON output via `convertToShape`.
|
|
45
|
+
* When omitted, hosts may fall back to slot id / label.
|
|
46
|
+
*/
|
|
47
|
+
readonly path?: string;
|
|
48
|
+
readonly dataType?: FieldDataType;
|
|
49
|
+
readonly required?: boolean;
|
|
50
|
+
readonly description?: string;
|
|
51
|
+
/** Nested slot groups (expand/collapse in the mapper tree). */
|
|
52
|
+
readonly children?: readonly TargetSlot[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface MappingEdge {
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly sourceFieldId: string;
|
|
58
|
+
readonly targetSlotId: string;
|
|
59
|
+
/**
|
|
60
|
+
* Ordered transform chain (max 3). Empty / omitted means identity.
|
|
61
|
+
* Prefer this over `transformId` for new writers.
|
|
62
|
+
* For arrays: use reduce builtins (`array:join`, `array:first`, …) here after
|
|
63
|
+
* optional item projection / item transforms.
|
|
64
|
+
*/
|
|
65
|
+
readonly transformIds?: readonly string[];
|
|
66
|
+
/**
|
|
67
|
+
* Legacy single transform. Prefer `transformIds`.
|
|
68
|
+
* Readers should use `edgeTransformIds` / `normalizeMappingEdge`.
|
|
69
|
+
* `null` / omitted (with no `transformIds`) means identity (pass-through).
|
|
70
|
+
*/
|
|
71
|
+
readonly transformId?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Per-step options aligned with `transformIds` (index N applies to step N).
|
|
74
|
+
* Prefer this when steps need different bags (e.g. `showSeconds` then `maxLength`).
|
|
75
|
+
*/
|
|
76
|
+
readonly transformOptionSteps?: readonly (Readonly<Record<string, unknown>> | undefined)[];
|
|
77
|
+
/**
|
|
78
|
+
* Shared options for all `transformIds` steps (legacy / apply-to-all).
|
|
79
|
+
* Used when `transformOptionSteps` is omitted. Still written as a back-compat
|
|
80
|
+
* summary of step 0 (or the first non-empty step) by `normalizeMappingEdge`.
|
|
81
|
+
*/
|
|
82
|
+
readonly transformOptions?: Readonly<Record<string, unknown>>;
|
|
83
|
+
/**
|
|
84
|
+
* When the source is an array of objects, optional dotted path into each item
|
|
85
|
+
* (e.g. `name` or `meta.label`) before the value is written to the target.
|
|
86
|
+
* Omit / empty for whole-array pass-through (or reduce on the full array).
|
|
87
|
+
*/
|
|
88
|
+
readonly itemSourcePath?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Ordered per-item transform chain (max 3) applied after `itemSourcePath`
|
|
91
|
+
* projection (or to each element when projecting is a no-op). Empty / omitted
|
|
92
|
+
* means identity per item. Independent of `transformIds` (which run on the
|
|
93
|
+
* whole collection afterward — e.g. reduce).
|
|
94
|
+
*/
|
|
95
|
+
readonly itemTransformIds?: readonly string[];
|
|
96
|
+
/**
|
|
97
|
+
* Per-step options aligned with `itemTransformIds`.
|
|
98
|
+
*/
|
|
99
|
+
readonly itemTransformOptionSteps?: readonly (Readonly<Record<string, unknown>> | undefined)[];
|
|
100
|
+
/**
|
|
101
|
+
* Shared options for all `itemTransformIds` steps (legacy / apply-to-all).
|
|
102
|
+
* Independent of `transformOptions` / `transformOptionSteps`.
|
|
103
|
+
*/
|
|
104
|
+
readonly itemTransformOptions?: Readonly<Record<string, unknown>>;
|
|
105
|
+
/**
|
|
106
|
+
* List-context child bindings (Stedi-style): when source is an array of objects,
|
|
107
|
+
* each element is converted through these edges into a target item object.
|
|
108
|
+
* Child `sourceFieldId` / `targetSlotId` should resolve to item-schema fields
|
|
109
|
+
* (ingest ids like `a.tags.item.name`) whose `path` is item-relative.
|
|
110
|
+
*
|
|
111
|
+
* Takes precedence over `itemSourcePath` / `itemTransformIds` for the outer edge.
|
|
112
|
+
* Nested `itemEdges` on children are ignored (one collection level per edge).
|
|
113
|
+
*/
|
|
114
|
+
readonly itemEdges?: readonly MappingEdge[];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Minimal JSON-serializable mapping document for host persistence.
|
|
119
|
+
* Hosts own schema trees; this document stores the binding graph only.
|
|
120
|
+
*/
|
|
121
|
+
export interface FieldRemapDocument {
|
|
122
|
+
readonly version: 1;
|
|
123
|
+
readonly edges: readonly MappingEdge[];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface TransformContext {
|
|
127
|
+
readonly locale?: string;
|
|
128
|
+
/** Reference instant for time/date presets; defaults to `new Date()`. */
|
|
129
|
+
readonly now?: Date;
|
|
130
|
+
readonly sampleValue?: unknown;
|
|
131
|
+
/**
|
|
132
|
+
* Optional plain object for `string:template` placeholder resolution when the
|
|
133
|
+
* transform input is not itself an object (hosts / demos).
|
|
134
|
+
*/
|
|
135
|
+
readonly record?: Readonly<Record<string, unknown>>;
|
|
136
|
+
readonly options?: Readonly<Record<string, unknown>>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Declares a host-editable option consumed via `context.options[key]`. */
|
|
140
|
+
export interface TransformOptionField {
|
|
141
|
+
readonly key: string;
|
|
142
|
+
readonly label: string;
|
|
143
|
+
/**
|
|
144
|
+
* - `string` / `number` / `boolean` — single scalar inputs
|
|
145
|
+
* - `stringMap` — key/value row editor for string→string maps (e.g. `codeLabels`),
|
|
146
|
+
* with an optional List / JSON view toggle in `TransformOptionsEditor`
|
|
147
|
+
* - `json` — validated JSON textarea for plain objects (advanced / free-form);
|
|
148
|
+
* drafts commit when parseable and pretty-print on blur
|
|
149
|
+
*/
|
|
150
|
+
readonly kind: 'string' | 'number' | 'boolean' | 'stringMap' | 'json';
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface ValueTransformDefinition {
|
|
154
|
+
readonly id: string;
|
|
155
|
+
readonly label: string;
|
|
156
|
+
readonly description?: string;
|
|
157
|
+
readonly category?: string;
|
|
158
|
+
readonly inputTypes?: readonly FieldDataType[];
|
|
159
|
+
readonly outputType?: FieldDataType;
|
|
160
|
+
readonly apply: (value: unknown, context: TransformContext) => unknown;
|
|
161
|
+
/** Optional picker label that includes a live format sample. */
|
|
162
|
+
readonly formatSampleLabel?: (context: TransformContext) => string;
|
|
163
|
+
/**
|
|
164
|
+
* Data-driven option editors (mapped rows / convert panel).
|
|
165
|
+
* Values are stored per step (`transformOptionSteps` / `itemTransformOptionSteps`)
|
|
166
|
+
* or as a shared bag (`transformOptions` / `itemTransformOptions`), or on host
|
|
167
|
+
* `TransformContext.options`.
|
|
168
|
+
*/
|
|
169
|
+
readonly optionFields?: readonly TransformOptionField[];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface ValueTransformListFilter {
|
|
173
|
+
readonly inputType?: FieldDataType;
|
|
174
|
+
readonly category?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface ValueTransformRegistry {
|
|
178
|
+
list(filter?: ValueTransformListFilter): ValueTransformDefinition[];
|
|
179
|
+
get(id: string): ValueTransformDefinition | undefined;
|
|
180
|
+
apply(id: string, value: unknown, context?: TransformContext): unknown;
|
|
181
|
+
register(definition: ValueTransformDefinition): void;
|
|
182
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
FieldDataType,
|
|
3
|
-
MappingEdge,
|
|
4
|
-
FieldRemapDocument,
|
|
5
|
-
SourceField,
|
|
6
|
-
TargetSlot,
|
|
7
|
-
TransformContext,
|
|
8
|
-
TransformOptionField,
|
|
9
|
-
ValueTransformDefinition,
|
|
10
|
-
ValueTransformListFilter,
|
|
11
|
-
ValueTransformRegistry,
|
|
12
|
-
} from './domain/types.js';
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
canonicalizeTransformId,
|
|
16
|
-
IDENTITY_TRANSFORM_ID,
|
|
17
|
-
MAX_TRANSFORM_CHAIN,
|
|
18
|
-
TRANSFORM_ID_ALIASES,
|
|
19
|
-
} from './domain/constants.js';
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
createMappingEdge,
|
|
23
|
-
edgeItemTransformIds,
|
|
24
|
-
edgeTransformIds,
|
|
25
|
-
normalizeMappingEdge,
|
|
26
|
-
normalizeMappingEdges,
|
|
27
|
-
} from './domain/document/mappingEdge.js';
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
createFieldRemapDocument,
|
|
31
|
-
deserializeFieldRemapDocument,
|
|
32
|
-
InvalidFieldRemapDocumentError,
|
|
33
|
-
migrateFieldRemapDocument,
|
|
34
|
-
normalizeFieldRemapDocument,
|
|
35
|
-
parseFieldRemapDocument,
|
|
36
|
-
FIELD_REMAP_DOCUMENT_VERSION,
|
|
37
|
-
serializeFieldRemapDocument,
|
|
38
|
-
UnsupportedFieldRemapDocumentVersionError,
|
|
39
|
-
} from './domain/document/fieldRemapDocument.js';
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
applyStringTemplate,
|
|
43
|
-
isPlainObject,
|
|
44
|
-
isSafeObjectPath,
|
|
45
|
-
listArrayItemProjectionOptions,
|
|
46
|
-
projectCollectionItems,
|
|
47
|
-
readObjectPath,
|
|
48
|
-
writeObjectPath,
|
|
49
|
-
} from './domain/mapping/pathUtils.js';
|
|
50
|
-
export type { ArrayItemProjectionOption } from './domain/mapping/pathUtils.js';
|
|
51
|
-
|
|
52
|
-
export {
|
|
53
|
-
formatDateParts,
|
|
54
|
-
parseDateParts,
|
|
55
|
-
reformatDateString,
|
|
56
|
-
splitDateTimeString,
|
|
57
|
-
} from './domain/mapping/dateFormat.js';
|
|
58
|
-
export type { DateParts } from './domain/mapping/dateFormat.js';
|
|
59
|
-
|
|
60
|
-
export { convertArrayWithItemEdges } from './domain/mapping/convertItemEdges.js';
|
|
61
|
-
export { findParentChildMappingConflicts } from './domain/mapping/mappingConflicts.js';
|
|
62
|
-
export type { MappingConflict } from './domain/mapping/mappingConflicts.js';
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
collectOptionFields,
|
|
66
|
-
contextWithEdgeOptions,
|
|
67
|
-
mergeOptionSteps,
|
|
68
|
-
optionFieldsForStep,
|
|
69
|
-
patchOptionRecord,
|
|
70
|
-
patchOptionStep,
|
|
71
|
-
resolveOptionSteps,
|
|
72
|
-
resizeOptionSteps,
|
|
73
|
-
sanitizeOptionRecord,
|
|
74
|
-
sanitizeOptionSteps,
|
|
75
|
-
sharedOptionsFromSteps,
|
|
76
|
-
} from './domain/mapping/transformOptions.js';
|
|
77
|
-
|
|
78
|
-
export {
|
|
79
|
-
findSourceField,
|
|
80
|
-
findTargetSlot,
|
|
81
|
-
flattenSourceFields,
|
|
82
|
-
flattenTargetSlots,
|
|
83
|
-
resolveAllEdgePreviews,
|
|
84
|
-
resolveEdgePreview,
|
|
85
|
-
resolveMappedValue,
|
|
86
|
-
} from './domain/mapping/resolveMappedValue.js';
|
|
87
|
-
|
|
88
|
-
export {
|
|
89
|
-
attachShapeIdToSourceFields,
|
|
90
|
-
createDataShapeRegistry,
|
|
91
|
-
defineDataShape,
|
|
92
|
-
mergeSourceShapes,
|
|
93
|
-
targetSlotsFromShape,
|
|
94
|
-
} from './domain/shapes/dataShape.js';
|
|
95
|
-
export type { DataShape, DataShapeRegistry, DataShapeRole } from './domain/shapes/dataShape.js';
|
|
96
|
-
|
|
97
|
-
export {
|
|
98
|
-
createConversionRegistry,
|
|
99
|
-
defineConversion,
|
|
100
|
-
withConversionEdges,
|
|
101
|
-
} from './domain/shapes/conversionDefinition.js';
|
|
102
|
-
export type {
|
|
103
|
-
ConversionDefinition,
|
|
104
|
-
ConversionRegistry,
|
|
105
|
-
DefineConversionInput,
|
|
106
|
-
} from './domain/shapes/conversionDefinition.js';
|
|
107
|
-
|
|
108
|
-
export { convertToShape } from './domain/shapes/convertToShape.js';
|
|
109
|
-
export type {
|
|
110
|
-
ConvertToShapeInput,
|
|
111
|
-
ConvertToShapeResult,
|
|
112
|
-
ConvertToShapeSlotResult,
|
|
113
|
-
} from './domain/shapes/convertToShape.js';
|
|
114
|
-
|
|
115
|
-
export { sourceFieldsFromPlainObject } from './domain/ingest/sourceFieldsFromPlainObject.js';
|
|
116
|
-
export type { SourceFieldsFromPlainObjectOptions } from './domain/ingest/sourceFieldsFromPlainObject.js';
|
|
117
|
-
|
|
118
|
-
export { targetSlotsFromPlainObject } from './domain/ingest/targetSlotsFromPlainObject.js';
|
|
119
|
-
export type { TargetSlotsFromPlainObjectOptions } from './domain/ingest/targetSlotsFromPlainObject.js';
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
-
applyTransformChain,
|
|
123
|
-
createValueTransformRegistry,
|
|
124
|
-
isTransformChainCompatible,
|
|
125
|
-
isTransformCompatible,
|
|
126
|
-
} from './registry/createValueTransformRegistry.js';
|
|
127
|
-
|
|
128
|
-
export {
|
|
129
|
-
ARRAY_REDUCE_TRANSFORM_IDS,
|
|
130
|
-
BUILTIN_TRANSFORM_IDS,
|
|
131
|
-
DATE_STYLE_TRANSFORM_IDS,
|
|
132
|
-
STRING_FORMAT_TRANSFORM_IDS,
|
|
133
|
-
TIME_FORMAT_TRANSFORM_IDS,
|
|
134
|
-
builtinValueTransforms,
|
|
135
|
-
createBuiltinValueTransformRegistry,
|
|
136
|
-
} from './registry/builtinTransforms.js';
|
|
137
|
-
export type { CreateBuiltinValueTransformRegistryOptions } from './registry/builtinTransforms.js';
|
|
1
|
+
export type {
|
|
2
|
+
FieldDataType,
|
|
3
|
+
MappingEdge,
|
|
4
|
+
FieldRemapDocument,
|
|
5
|
+
SourceField,
|
|
6
|
+
TargetSlot,
|
|
7
|
+
TransformContext,
|
|
8
|
+
TransformOptionField,
|
|
9
|
+
ValueTransformDefinition,
|
|
10
|
+
ValueTransformListFilter,
|
|
11
|
+
ValueTransformRegistry,
|
|
12
|
+
} from './domain/types.js';
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
canonicalizeTransformId,
|
|
16
|
+
IDENTITY_TRANSFORM_ID,
|
|
17
|
+
MAX_TRANSFORM_CHAIN,
|
|
18
|
+
TRANSFORM_ID_ALIASES,
|
|
19
|
+
} from './domain/constants.js';
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
createMappingEdge,
|
|
23
|
+
edgeItemTransformIds,
|
|
24
|
+
edgeTransformIds,
|
|
25
|
+
normalizeMappingEdge,
|
|
26
|
+
normalizeMappingEdges,
|
|
27
|
+
} from './domain/document/mappingEdge.js';
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
createFieldRemapDocument,
|
|
31
|
+
deserializeFieldRemapDocument,
|
|
32
|
+
InvalidFieldRemapDocumentError,
|
|
33
|
+
migrateFieldRemapDocument,
|
|
34
|
+
normalizeFieldRemapDocument,
|
|
35
|
+
parseFieldRemapDocument,
|
|
36
|
+
FIELD_REMAP_DOCUMENT_VERSION,
|
|
37
|
+
serializeFieldRemapDocument,
|
|
38
|
+
UnsupportedFieldRemapDocumentVersionError,
|
|
39
|
+
} from './domain/document/fieldRemapDocument.js';
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
applyStringTemplate,
|
|
43
|
+
isPlainObject,
|
|
44
|
+
isSafeObjectPath,
|
|
45
|
+
listArrayItemProjectionOptions,
|
|
46
|
+
projectCollectionItems,
|
|
47
|
+
readObjectPath,
|
|
48
|
+
writeObjectPath,
|
|
49
|
+
} from './domain/mapping/pathUtils.js';
|
|
50
|
+
export type { ArrayItemProjectionOption } from './domain/mapping/pathUtils.js';
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
formatDateParts,
|
|
54
|
+
parseDateParts,
|
|
55
|
+
reformatDateString,
|
|
56
|
+
splitDateTimeString,
|
|
57
|
+
} from './domain/mapping/dateFormat.js';
|
|
58
|
+
export type { DateParts } from './domain/mapping/dateFormat.js';
|
|
59
|
+
|
|
60
|
+
export { convertArrayWithItemEdges } from './domain/mapping/convertItemEdges.js';
|
|
61
|
+
export { findParentChildMappingConflicts } from './domain/mapping/mappingConflicts.js';
|
|
62
|
+
export type { MappingConflict } from './domain/mapping/mappingConflicts.js';
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
collectOptionFields,
|
|
66
|
+
contextWithEdgeOptions,
|
|
67
|
+
mergeOptionSteps,
|
|
68
|
+
optionFieldsForStep,
|
|
69
|
+
patchOptionRecord,
|
|
70
|
+
patchOptionStep,
|
|
71
|
+
resolveOptionSteps,
|
|
72
|
+
resizeOptionSteps,
|
|
73
|
+
sanitizeOptionRecord,
|
|
74
|
+
sanitizeOptionSteps,
|
|
75
|
+
sharedOptionsFromSteps,
|
|
76
|
+
} from './domain/mapping/transformOptions.js';
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
findSourceField,
|
|
80
|
+
findTargetSlot,
|
|
81
|
+
flattenSourceFields,
|
|
82
|
+
flattenTargetSlots,
|
|
83
|
+
resolveAllEdgePreviews,
|
|
84
|
+
resolveEdgePreview,
|
|
85
|
+
resolveMappedValue,
|
|
86
|
+
} from './domain/mapping/resolveMappedValue.js';
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
attachShapeIdToSourceFields,
|
|
90
|
+
createDataShapeRegistry,
|
|
91
|
+
defineDataShape,
|
|
92
|
+
mergeSourceShapes,
|
|
93
|
+
targetSlotsFromShape,
|
|
94
|
+
} from './domain/shapes/dataShape.js';
|
|
95
|
+
export type { DataShape, DataShapeRegistry, DataShapeRole } from './domain/shapes/dataShape.js';
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
createConversionRegistry,
|
|
99
|
+
defineConversion,
|
|
100
|
+
withConversionEdges,
|
|
101
|
+
} from './domain/shapes/conversionDefinition.js';
|
|
102
|
+
export type {
|
|
103
|
+
ConversionDefinition,
|
|
104
|
+
ConversionRegistry,
|
|
105
|
+
DefineConversionInput,
|
|
106
|
+
} from './domain/shapes/conversionDefinition.js';
|
|
107
|
+
|
|
108
|
+
export { convertToShape } from './domain/shapes/convertToShape.js';
|
|
109
|
+
export type {
|
|
110
|
+
ConvertToShapeInput,
|
|
111
|
+
ConvertToShapeResult,
|
|
112
|
+
ConvertToShapeSlotResult,
|
|
113
|
+
} from './domain/shapes/convertToShape.js';
|
|
114
|
+
|
|
115
|
+
export { sourceFieldsFromPlainObject } from './domain/ingest/sourceFieldsFromPlainObject.js';
|
|
116
|
+
export type { SourceFieldsFromPlainObjectOptions } from './domain/ingest/sourceFieldsFromPlainObject.js';
|
|
117
|
+
|
|
118
|
+
export { targetSlotsFromPlainObject } from './domain/ingest/targetSlotsFromPlainObject.js';
|
|
119
|
+
export type { TargetSlotsFromPlainObjectOptions } from './domain/ingest/targetSlotsFromPlainObject.js';
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
applyTransformChain,
|
|
123
|
+
createValueTransformRegistry,
|
|
124
|
+
isTransformChainCompatible,
|
|
125
|
+
isTransformCompatible,
|
|
126
|
+
} from './registry/createValueTransformRegistry.js';
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
ARRAY_REDUCE_TRANSFORM_IDS,
|
|
130
|
+
BUILTIN_TRANSFORM_IDS,
|
|
131
|
+
DATE_STYLE_TRANSFORM_IDS,
|
|
132
|
+
STRING_FORMAT_TRANSFORM_IDS,
|
|
133
|
+
TIME_FORMAT_TRANSFORM_IDS,
|
|
134
|
+
builtinValueTransforms,
|
|
135
|
+
createBuiltinValueTransformRegistry,
|
|
136
|
+
} from './registry/builtinTransforms.js';
|
|
137
|
+
export type { CreateBuiltinValueTransformRegistryOptions } from './registry/builtinTransforms.js';
|