@epilot/entity-mapping-client 0.10.4-alpha → 0.10.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 epilot GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/dist/client.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { Client } from './openapi';
1
+ import type { Client } from './openapi';
2
2
  export declare const getClient: () => Client;
3
3
  export declare const createClient: () => Client;
@@ -1 +1 @@
1
- (()=>{"use strict";var e={466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v1/mappings":{"post":{"operationId":"storeConfig","parameters":[{"name":"with_id","in":"query","required":false}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/mappings/{id}":{"get":{"operationId":"getConfig","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"delete":{"operationId":"deleteConfig","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/mappings/{id}/versions":{"get":{"operationId":"getAllVersions","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"post":{"operationId":"storeNewVersion","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/mappings/{id}/versions/{version}":{"get":{"operationId":"getConfigVersion","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}}},"/v1/mappings:execute":{"post":{"operationId":"executeMapping","parameters":[{"name":"preview_mode","in":"query","required":false}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/mappings:search":{"post":{"operationId":"searchConfigs","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/mappings/history":{"get":{"operationId":"queryMappingHistory","parameters":[{"in":"query","name":"from","required":false},{"in":"query","name":"to","required":false},{"in":"query","name":"targetEntityId"},{"in":"query","name":"sourceEntityId"}],"responses":{}}},"/v1/relations:execute":{"post":{"operationId":"executeRelations","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/mappings/{id}":{"get":{"operationId":"getMappingConfig","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"put":{"operationId":"putMappingConfig","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}}},"components":{},"servers":[{"url":"https://entity-mapping.sls.epilot.io"}]}')},757:function(e,r,t){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var s=n(t(466));r.default=s.default}},r={},t=function t(n){var s=r[n];if(void 0!==s)return s.exports;var i=r[n]={exports:{}};return e[n].call(i.exports,i,i.exports,t),i.exports}(757),n=exports;for(var s in t)n[s]=t[s];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={438(e,r,t){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var s=n(t(466));r.default=s.default},466(e){e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v1/mappings":{"post":{"operationId":"storeConfig","parameters":[{"name":"with_id","in":"query","required":false}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/mappings/{id}":{"get":{"operationId":"getConfig","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"delete":{"operationId":"deleteConfig","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/mappings/{id}/versions":{"get":{"operationId":"getAllVersions","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"post":{"operationId":"storeNewVersion","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/mappings/{id}/versions/{version}":{"get":{"operationId":"getConfigVersion","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}}},"/v1/mappings:execute":{"post":{"operationId":"executeMapping","parameters":[{"name":"preview_mode","in":"query","required":false}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/mappings:search":{"post":{"operationId":"searchConfigs","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/mappings/history":{"get":{"operationId":"queryMappingHistory","parameters":[{"in":"query","name":"from","required":false},{"in":"query","name":"to","required":false},{"in":"query","name":"targetEntityId"},{"in":"query","name":"sourceEntityId"}],"responses":{}}},"/v1/relations:execute":{"post":{"operationId":"executeRelations","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/mappings/{id}":{"get":{"operationId":"getMappingConfig","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"put":{"operationId":"putMappingConfig","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}}},"components":{},"servers":[{"url":"https://entity-mapping.sls.epilot.io"}]}')}},r={},t=function t(n){var s=r[n];if(void 0!==s)return s.exports;var i=r[n]={exports:{}};return e[n].call(i.exports,i,i.exports,t),i.exports}(438),n=exports;for(var s in t)n[s]=t[s];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
package/dist/openapi.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-disable */
2
-
3
1
  import type {
4
2
  OpenAPIClient,
5
3
  Parameters,
@@ -95,6 +93,14 @@ declare namespace Components {
95
93
  * A reference (id and schema) to the entity to be used as source.
96
94
  */
97
95
  source_ref: EntityRef;
96
+ /**
97
+ * Reference to the current iteration's entity when running inside a flow loop.
98
+ * When set, its fields and relations are merged into the source context;
99
+ * on schema conflicts the loop entity wins, so paths like `<schema>._id` resolve
100
+ * to the iteration entity rather than to a same-schema relation of the source.
101
+ *
102
+ */
103
+ loop_ref?: EntityRef;
98
104
  /**
99
105
  * Mapping Configuration to apply.
100
106
  */
@@ -142,6 +148,127 @@ declare namespace Components {
142
148
  export interface ExecuteRelationsResp {
143
149
  relations?: NewRelationItem[];
144
150
  }
151
+ /**
152
+ * One multi-hop graph lookup against entity-api's `POST /v1/entity:graph`, resolved during
153
+ * graph_context enrichment (before mapping_attributes are evaluated). Every node in `graph.nodes`
154
+ * is merged into sourceContext under its own `id`, so listing several nodes here costs one
155
+ * entity-api call, not one per node.
156
+ *
157
+ * If a node's `cardinality` is "one" (or it is the seed node), exactly one entity must be found
158
+ * for it: zero or multiple matches fail the mapping execution instead of silently mapping
159
+ * missing/wrong data. If "many" (the default), it resolves to an array - possibly empty - with no
160
+ * such failure. Each node's cardinality is validated independently.
161
+ *
162
+ * `seed.entity_id` and any `graph.nodes[].filter[].value` may contain `{{handlebars}}` placeholders
163
+ * (e.g. `{{contract._id}}`, `{{contract.origin_order}}`), resolved against the in-progress
164
+ * sourceContext (the source entity, its 1-hop relations, and any custom variables already
165
+ * resolved) before the graph query is sent.
166
+ *
167
+ */
168
+ export interface GraphContextEntry {
169
+ seed: /* Mirrors entity-api's GraphSeed (see entity-api openapi.yml) - the entity the graph traversal starts from. */ GraphSeed;
170
+ graph: /* Mirrors entity-api's GraphDefinition (see entity-api openapi.yml) - the shape of the graph to traverse. */ GraphDefinition;
171
+ }
172
+ /**
173
+ * Mirrors entity-api's GraphDefinition (see entity-api openapi.yml) - the shape of the graph to traverse.
174
+ */
175
+ export interface GraphDefinition {
176
+ nodes: /* Mirrors entity-api's GraphNode (see entity-api openapi.yml). */ GraphNode[];
177
+ edges: /* Mirrors entity-api's GraphEdge (see entity-api openapi.yml). */ GraphEdge[];
178
+ }
179
+ /**
180
+ * Mirrors entity-api's GraphEdge (see entity-api openapi.yml).
181
+ */
182
+ export interface GraphEdge {
183
+ /**
184
+ * Source node ID.
185
+ * example:
186
+ * contact
187
+ */
188
+ from: string;
189
+ /**
190
+ * Target node ID.
191
+ * example:
192
+ * order
193
+ */
194
+ to: string;
195
+ }
196
+ /**
197
+ * Mirrors entity-api's GraphNode (see entity-api openapi.yml).
198
+ */
199
+ export interface GraphNode {
200
+ /**
201
+ * Unique identifier for this node in the graph definition.
202
+ * example:
203
+ * contact
204
+ */
205
+ id: string;
206
+ /**
207
+ * Entity schema slug for this node.
208
+ * example:
209
+ * contact
210
+ */
211
+ schema: string;
212
+ /**
213
+ * "one": this node resolves to a single entity. "many" (default if unset): this node
214
+ * resolves to an array of entities.
215
+ *
216
+ */
217
+ cardinality?: "one" | "many";
218
+ /**
219
+ * Optional entity fields to include in the hydrated response for this node.
220
+ */
221
+ fields?: string[];
222
+ /**
223
+ * Narrows this node's traversal results to entities matching every filter (AND semantics).
224
+ * Useful for disambiguating among multiple entities reachable via the same graph edge.
225
+ *
226
+ */
227
+ filter?: /* Mirrors entity-api's GraphNodeFilter (see entity-api openapi.yml). */ GraphNodeFilter[];
228
+ }
229
+ /**
230
+ * Mirrors entity-api's GraphNodeFilter (see entity-api openapi.yml).
231
+ */
232
+ export interface GraphNodeFilter {
233
+ /**
234
+ * Entity attribute name to match against.
235
+ * example:
236
+ * order_number
237
+ */
238
+ attribute: string;
239
+ /**
240
+ * Literal value the attribute must exactly equal. Supports `{{handlebars}}` placeholders
241
+ * resolved against sourceContext when given as a string.
242
+ *
243
+ * example:
244
+ * {{contract.origin_order}}
245
+ */
246
+ value: /**
247
+ * Literal value the attribute must exactly equal. Supports `{{handlebars}}` placeholders
248
+ * resolved against sourceContext when given as a string.
249
+ *
250
+ * example:
251
+ * {{contract.origin_order}}
252
+ */
253
+ (string | null) | number | boolean;
254
+ }
255
+ /**
256
+ * Mirrors entity-api's GraphSeed (see entity-api openapi.yml) - the entity the graph traversal starts from.
257
+ */
258
+ export interface GraphSeed {
259
+ /**
260
+ * The id of the seed entity. Supports `{{handlebars}}` placeholders resolved against sourceContext.
261
+ * example:
262
+ * {{contract._id}}
263
+ */
264
+ entity_id: string;
265
+ /**
266
+ * The node ID in `graph.nodes` that corresponds to the seed entity.
267
+ * example:
268
+ * contact
269
+ */
270
+ node_id: string;
271
+ }
145
272
  export interface JourneyRef {
146
273
  journey_id?: string;
147
274
  }
@@ -399,6 +526,31 @@ declare namespace Components {
399
526
  * Generate random ids / numbers
400
527
  */
401
528
  _random?: RandomOperation;
529
+ /**
530
+ * Iterate over a source array. Use with _as and _map.
531
+ * The value is a path to resolve from the source entity context.
532
+ * Example: "submission.meterReadings"
533
+ *
534
+ * example:
535
+ * submission.meterReadings
536
+ */
537
+ _each?: string;
538
+ /**
539
+ * Name for the current iteration item in _each.
540
+ * Accessed as $<name> in _copy paths within _map.
541
+ * Example: "reading" (accessed as $reading)
542
+ *
543
+ * example:
544
+ * reading
545
+ */
546
+ _as?: string;
547
+ /**
548
+ * Operation to evaluate per _each iteration item.
549
+ * Can be any OperationNode, typically an object with _copy
550
+ * references to the $<_as name> alias.
551
+ *
552
+ */
553
+ _map?: /* Mapping operation nodes are either primitive values or operation node objects */ OperationNode;
402
554
  }
403
555
  export interface Owner {
404
556
  type: "user" | "internal_service";
@@ -431,6 +583,10 @@ declare namespace Components {
431
583
  * Include all relation tags (labels) present on the main entity relation
432
584
  */
433
585
  target_tags_include_source?: boolean;
586
+ /**
587
+ * Tags to add to the matched target entity's _tags array during mapping. Useful for assigning file collections to file entities.
588
+ */
589
+ target_entity_tags?: string[];
434
590
  /**
435
591
  * Whether to override the relation source_filter with the specified one
436
592
  */
@@ -518,6 +674,11 @@ declare namespace Components {
518
674
  * Unique key for target entity (see upsertEntity of Entity API)
519
675
  */
520
676
  target_unique?: string[];
677
+ /**
678
+ * Execution wire flag set per automation by automation-workers: resolve the target entity via the organization's global uniqueness criteria (deduplication-api) instead of target_unique. Never persisted in stored mapping configs.
679
+ *
680
+ */
681
+ use_uniqueness_criteria?: boolean;
521
682
  /**
522
683
  * contains config in case of running in loop mode
523
684
  */
@@ -569,6 +730,32 @@ declare namespace Components {
569
730
  * Relation tags (labels) to include in main entity linkback relation attribute
570
731
  */
571
732
  linkback_relation_tags?: string[];
733
+ /**
734
+ * Multi-hop entity graph lookups resolved before any mapping_attribute is evaluated. Each
735
+ * entry queries entity-api's `POST /v1/entity:graph` and merges every node's result into
736
+ * sourceContext under its own `graph.nodes[].id`, so mapping_attributes can `_copy`/`_template`
737
+ * from `<node id>.<field>`. A graph node's value overwrites any existing sourceContext key of
738
+ * the same name (a source entity field, a 1-hop relation, or another graph node).
739
+ *
740
+ */
741
+ graph_context?: /**
742
+ * One multi-hop graph lookup against entity-api's `POST /v1/entity:graph`, resolved during
743
+ * graph_context enrichment (before mapping_attributes are evaluated). Every node in `graph.nodes`
744
+ * is merged into sourceContext under its own `id`, so listing several nodes here costs one
745
+ * entity-api call, not one per node.
746
+ *
747
+ * If a node's `cardinality` is "one" (or it is the seed node), exactly one entity must be found
748
+ * for it: zero or multiple matches fail the mapping execution instead of silently mapping
749
+ * missing/wrong data. If "many" (the default), it resolves to an array - possibly empty - with no
750
+ * such failure. Each node's cardinality is validated independently.
751
+ *
752
+ * `seed.entity_id` and any `graph.nodes[].filter[].value` may contain `{{handlebars}}` placeholders
753
+ * (e.g. `{{contract._id}}`, `{{contract.origin_order}}`), resolved against the in-progress
754
+ * sourceContext (the source entity, its 1-hop relations, and any custom variables already
755
+ * resolved) before the graph query is sent.
756
+ *
757
+ */
758
+ GraphContextEntry[];
572
759
  }
573
760
  }
574
761
  }
@@ -1061,6 +1248,12 @@ export type ExecuteMappingReq = Components.Schemas.ExecuteMappingReq;
1061
1248
  export type ExecuteMappingResp = Components.Schemas.ExecuteMappingResp;
1062
1249
  export type ExecuteRelationsReq = Components.Schemas.ExecuteRelationsReq;
1063
1250
  export type ExecuteRelationsResp = Components.Schemas.ExecuteRelationsResp;
1251
+ export type GraphContextEntry = Components.Schemas.GraphContextEntry;
1252
+ export type GraphDefinition = Components.Schemas.GraphDefinition;
1253
+ export type GraphEdge = Components.Schemas.GraphEdge;
1254
+ export type GraphNode = Components.Schemas.GraphNode;
1255
+ export type GraphNodeFilter = Components.Schemas.GraphNodeFilter;
1256
+ export type GraphSeed = Components.Schemas.GraphSeed;
1064
1257
  export type JourneyRef = Components.Schemas.JourneyRef;
1065
1258
  export type Loop_Index_String = Components.Schemas.LoopIndexString;
1066
1259
  export type MapCondition = Components.Schemas.MapCondition;
package/dist/openapi.json CHANGED
@@ -763,6 +763,10 @@
763
763
  "$ref": "#/components/schemas/EntityRef",
764
764
  "description": "A reference (id and schema) to the entity to be used as source."
765
765
  },
766
+ "loop_ref": {
767
+ "$ref": "#/components/schemas/EntityRef",
768
+ "description": "Reference to the current iteration's entity when running inside a flow loop.\nWhen set, its fields and relations are merged into the source context;\non schema conflicts the loop entity wins, so paths like `<schema>._id` resolve\nto the iteration entity rather than to a same-schema relation of the source.\n"
769
+ },
766
770
  "targets": {
767
771
  "type": "array",
768
772
  "items": {
@@ -960,6 +964,11 @@
960
964
  "type": "string"
961
965
  }
962
966
  },
967
+ "use_uniqueness_criteria": {
968
+ "type": "boolean",
969
+ "default": false,
970
+ "description": "Execution wire flag set per automation by automation-workers: resolve the target entity via the organization's global uniqueness criteria (deduplication-api) instead of target_unique. Never persisted in stored mapping configs.\n"
971
+ },
963
972
  "loop_config": {
964
973
  "type": "object",
965
974
  "description": "contains config in case of running in loop mode",
@@ -970,8 +979,7 @@
970
979
  },
971
980
  "length": {
972
981
  "type": "number",
973
- "description": "a hard limit of how many times the loop is allowed to run.",
974
- "default": "the length of the array"
982
+ "description": "a hard limit of how many times the loop is allowed to run."
975
983
  }
976
984
  }
977
985
  },
@@ -1023,6 +1031,13 @@
1023
1031
  "items": {
1024
1032
  "type": "string"
1025
1033
  }
1034
+ },
1035
+ "graph_context": {
1036
+ "type": "array",
1037
+ "description": "Multi-hop entity graph lookups resolved before any mapping_attribute is evaluated. Each\nentry queries entity-api's `POST /v1/entity:graph` and merges every node's result into\nsourceContext under its own `graph.nodes[].id`, so mapping_attributes can `_copy`/`_template`\nfrom `<node id>.<field>`. A graph node's value overwrites any existing sourceContext key of\nthe same name (a source entity field, a 1-hop relation, or another graph node).\n",
1038
+ "items": {
1039
+ "$ref": "#/components/schemas/GraphContextEntry"
1040
+ }
1026
1041
  }
1027
1042
  },
1028
1043
  "required": [
@@ -1093,6 +1108,13 @@
1093
1108
  "description": "Include all relation tags (labels) present on the main entity relation",
1094
1109
  "default": false
1095
1110
  },
1111
+ "target_entity_tags": {
1112
+ "type": "array",
1113
+ "description": "Tags to add to the matched target entity's _tags array during mapping. Useful for assigning file collections to file entities.",
1114
+ "items": {
1115
+ "type": "string"
1116
+ }
1117
+ },
1096
1118
  "override_with_source_filter": {
1097
1119
  "type": "boolean",
1098
1120
  "description": "Whether to override the relation source_filter with the specified one",
@@ -1152,6 +1174,157 @@
1152
1174
  "mode"
1153
1175
  ]
1154
1176
  },
1177
+ "GraphContextEntry": {
1178
+ "type": "object",
1179
+ "description": "One multi-hop graph lookup against entity-api's `POST /v1/entity:graph`, resolved during\ngraph_context enrichment (before mapping_attributes are evaluated). Every node in `graph.nodes`\nis merged into sourceContext under its own `id`, so listing several nodes here costs one\nentity-api call, not one per node.\n\nIf a node's `cardinality` is \"one\" (or it is the seed node), exactly one entity must be found\nfor it: zero or multiple matches fail the mapping execution instead of silently mapping\nmissing/wrong data. If \"many\" (the default), it resolves to an array - possibly empty - with no\nsuch failure. Each node's cardinality is validated independently.\n\n`seed.entity_id` and any `graph.nodes[].filter[].value` may contain `{{handlebars}}` placeholders\n(e.g. `{{contract._id}}`, `{{contract.origin_order}}`), resolved against the in-progress\nsourceContext (the source entity, its 1-hop relations, and any custom variables already\nresolved) before the graph query is sent.\n",
1180
+ "properties": {
1181
+ "seed": {
1182
+ "$ref": "#/components/schemas/GraphSeed"
1183
+ },
1184
+ "graph": {
1185
+ "$ref": "#/components/schemas/GraphDefinition"
1186
+ }
1187
+ },
1188
+ "required": [
1189
+ "seed",
1190
+ "graph"
1191
+ ]
1192
+ },
1193
+ "GraphSeed": {
1194
+ "description": "Mirrors entity-api's GraphSeed (see entity-api openapi.yml) - the entity the graph traversal starts from.",
1195
+ "type": "object",
1196
+ "properties": {
1197
+ "entity_id": {
1198
+ "type": "string",
1199
+ "description": "The id of the seed entity. Supports `{{handlebars}}` placeholders resolved against sourceContext.",
1200
+ "example": "{{contract._id}}"
1201
+ },
1202
+ "node_id": {
1203
+ "type": "string",
1204
+ "description": "The node ID in `graph.nodes` that corresponds to the seed entity.",
1205
+ "example": "contact"
1206
+ }
1207
+ },
1208
+ "required": [
1209
+ "entity_id",
1210
+ "node_id"
1211
+ ]
1212
+ },
1213
+ "GraphDefinition": {
1214
+ "description": "Mirrors entity-api's GraphDefinition (see entity-api openapi.yml) - the shape of the graph to traverse.",
1215
+ "type": "object",
1216
+ "properties": {
1217
+ "nodes": {
1218
+ "type": "array",
1219
+ "items": {
1220
+ "$ref": "#/components/schemas/GraphNode"
1221
+ }
1222
+ },
1223
+ "edges": {
1224
+ "type": "array",
1225
+ "items": {
1226
+ "$ref": "#/components/schemas/GraphEdge"
1227
+ }
1228
+ }
1229
+ },
1230
+ "required": [
1231
+ "nodes",
1232
+ "edges"
1233
+ ]
1234
+ },
1235
+ "GraphNode": {
1236
+ "description": "Mirrors entity-api's GraphNode (see entity-api openapi.yml).",
1237
+ "type": "object",
1238
+ "properties": {
1239
+ "id": {
1240
+ "type": "string",
1241
+ "description": "Unique identifier for this node in the graph definition.",
1242
+ "example": "contact"
1243
+ },
1244
+ "schema": {
1245
+ "type": "string",
1246
+ "description": "Entity schema slug for this node.",
1247
+ "example": "contact"
1248
+ },
1249
+ "cardinality": {
1250
+ "type": "string",
1251
+ "enum": [
1252
+ "one",
1253
+ "many"
1254
+ ],
1255
+ "description": "\"one\": this node resolves to a single entity. \"many\" (default if unset): this node\nresolves to an array of entities.\n"
1256
+ },
1257
+ "fields": {
1258
+ "type": "array",
1259
+ "description": "Optional entity fields to include in the hydrated response for this node.",
1260
+ "items": {
1261
+ "type": "string"
1262
+ }
1263
+ },
1264
+ "filter": {
1265
+ "type": "array",
1266
+ "description": "Narrows this node's traversal results to entities matching every filter (AND semantics).\nUseful for disambiguating among multiple entities reachable via the same graph edge.\n",
1267
+ "items": {
1268
+ "$ref": "#/components/schemas/GraphNodeFilter"
1269
+ }
1270
+ }
1271
+ },
1272
+ "required": [
1273
+ "id",
1274
+ "schema"
1275
+ ]
1276
+ },
1277
+ "GraphNodeFilter": {
1278
+ "description": "Mirrors entity-api's GraphNodeFilter (see entity-api openapi.yml).",
1279
+ "type": "object",
1280
+ "properties": {
1281
+ "attribute": {
1282
+ "type": "string",
1283
+ "description": "Entity attribute name to match against.",
1284
+ "example": "order_number"
1285
+ },
1286
+ "value": {
1287
+ "description": "Literal value the attribute must exactly equal. Supports `{{handlebars}}` placeholders\nresolved against sourceContext when given as a string.\n",
1288
+ "oneOf": [
1289
+ {
1290
+ "type": "string",
1291
+ "nullable": true
1292
+ },
1293
+ {
1294
+ "type": "number"
1295
+ },
1296
+ {
1297
+ "type": "boolean"
1298
+ }
1299
+ ],
1300
+ "example": "{{contract.origin_order}}"
1301
+ }
1302
+ },
1303
+ "required": [
1304
+ "attribute",
1305
+ "value"
1306
+ ]
1307
+ },
1308
+ "GraphEdge": {
1309
+ "description": "Mirrors entity-api's GraphEdge (see entity-api openapi.yml).",
1310
+ "type": "object",
1311
+ "properties": {
1312
+ "from": {
1313
+ "type": "string",
1314
+ "description": "Source node ID.",
1315
+ "example": "contact"
1316
+ },
1317
+ "to": {
1318
+ "type": "string",
1319
+ "description": "Target node ID.",
1320
+ "example": "order"
1321
+ }
1322
+ },
1323
+ "required": [
1324
+ "from",
1325
+ "to"
1326
+ ]
1327
+ },
1155
1328
  "MappingAttributeV2": {
1156
1329
  "type": "object",
1157
1330
  "properties": {
@@ -1256,6 +1429,20 @@
1256
1429
  "_random": {
1257
1430
  "description": "Generate random ids / numbers",
1258
1431
  "$ref": "#/components/schemas/RandomOperation"
1432
+ },
1433
+ "_each": {
1434
+ "description": "Iterate over a source array. Use with _as and _map.\nThe value is a path to resolve from the source entity context.\nExample: \"submission.meterReadings\"\n",
1435
+ "type": "string",
1436
+ "example": "submission.meterReadings"
1437
+ },
1438
+ "_as": {
1439
+ "description": "Name for the current iteration item in _each.\nAccessed as $<name> in _copy paths within _map.\nExample: \"reading\" (accessed as $reading)\n",
1440
+ "type": "string",
1441
+ "example": "reading"
1442
+ },
1443
+ "_map": {
1444
+ "description": "Operation to evaluate per _each iteration item.\nCan be any OperationNode, typically an object with _copy\nreferences to the $<_as name> alias.\n",
1445
+ "$ref": "#/components/schemas/OperationNode"
1259
1446
  }
1260
1447
  },
1261
1448
  "additionalProperties": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/entity-mapping-client",
3
- "version": "0.10.4-alpha",
3
+ "version": "0.10.4",
4
4
  "description": "JavaScript client library for the ePilot Entity Mapping API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,17 +23,17 @@
23
23
  "entity-mapping"
24
24
  ],
25
25
  "scripts": {
26
- "test": "jest",
26
+ "test": "vitest",
27
27
  "typescript": "tsc",
28
28
  "bundle-definition": "webpack",
29
29
  "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/entity-mapping-api.yaml",
30
- "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
30
+ "typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
31
31
  "build": "tsc && npm run build:patch && npm run bundle-definition",
32
32
  "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
33
33
  "build:watch": "npm run build && tsc -w",
34
34
  "prepublishOnly": "npm run typegen && npm run build",
35
35
  "release-alpha": "npm version prerelease --preid alpha",
36
- "lint": "pnpm exec eslint src"
36
+ "lint": "biome check src"
37
37
  },
38
38
  "files": [
39
39
  "*.js",
@@ -61,13 +61,10 @@
61
61
  "util": "^0.12.3"
62
62
  },
63
63
  "devDependencies": {
64
- "@types/jest": "^28.1.3",
65
64
  "axios": "^1.11.0",
66
65
  "copy-webpack-plugin": "^7.0.0",
67
- "jest": "^29.6.2",
68
66
  "json-loader": "^0.5.7",
69
- "openapicmd": "^2.7.0",
70
- "ts-jest": "^29.4.1",
67
+ "openapicmd": "^2.9.2",
71
68
  "ts-loader": "^8.0.14",
72
69
  "ts-node": "^10.9.1",
73
70
  "typescript": "^4.1.3",