@epilot/entity-mapping-client 0.8.5 → 0.8.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={914:function(e,t,r){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(r(240));t.default=n.default},240: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":{}}}}},"/v1/mappings/{id}":{"get":{"operationId":"getConfig","parameters":[{"name":"id","in":"path","required":true}]},"delete":{"operationId":"deleteConfig","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/mappings/{id}/versions":{"get":{"operationId":"getAllVersions","parameters":[{"name":"id","in":"path","required":true}]},"post":{"operationId":"storeNewVersion","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}}}},"/v1/mappings/{id}/versions/{version}":{"get":{"operationId":"getConfigVersion","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"path","required":true}]}},"/v1/mappings:execute":{"post":{"operationId":"executeMapping","parameters":[{"name":"preview_mode","in":"query","required":false}],"requestBody":{"content":{"application/json":{}}}}},"/v1/mappings:search":{"post":{"operationId":"searchConfigs","requestBody":{"content":{"application/json":{}}}}},"/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"}]}},"/v1/relations:execute":{"post":{"operationId":"executeRelations","requestBody":{"content":{"application/json":{}}}}},"/v2/mappings/{id}":{"get":{"operationId":"getMappingConfig","parameters":[{"name":"id","in":"path","required":true}]},"put":{"operationId":"putMappingConfig","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}}}}},"components":{}}')}},t={},r=function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,r),a.exports}(914),i=exports;for(var n in r)i[n]=r[n];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={914:function(e,t,r){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(r(240));t.default=n.default},240: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":{}}}}},"/v1/mappings/{id}":{"get":{"operationId":"getConfig","parameters":[{"name":"id","in":"path","required":true}]},"delete":{"operationId":"deleteConfig","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/mappings/{id}/versions":{"get":{"operationId":"getAllVersions","parameters":[{"name":"id","in":"path","required":true}]},"post":{"operationId":"storeNewVersion","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}}}},"/v1/mappings/{id}/versions/{version}":{"get":{"operationId":"getConfigVersion","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"path","required":true}]}},"/v1/mappings:execute":{"post":{"operationId":"executeMapping","parameters":[{"name":"preview_mode","in":"query","required":false}],"requestBody":{"content":{"application/json":{}}}}},"/v1/mappings:search":{"post":{"operationId":"searchConfigs","requestBody":{"content":{"application/json":{}}}}},"/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"}]}},"/v1/relations:execute":{"post":{"operationId":"executeRelations","requestBody":{"content":{"application/json":{}}}}},"/v2/mappings/{id}":{"get":{"operationId":"getMappingConfig","parameters":[{"name":"id","in":"path","required":true}]},"put":{"operationId":"putMappingConfig","parameters":[{"name":"id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}}}}},"components":{},"servers":[{"url":"https://entity-mapping.sls.epilot.io"}]}')}},t={},r=function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,r),a.exports}(914),i=exports;for(var n in r)i[n]=r[n];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
@@ -178,5 +178,10 @@
178
178
  }
179
179
  }
180
180
  },
181
- "components": {}
182
- }
181
+ "components": {},
182
+ "servers": [
183
+ {
184
+ "url": "https://entity-mapping.sls.epilot.io"
185
+ }
186
+ ]
187
+ }
package/dist/openapi.d.ts CHANGED
@@ -38,7 +38,7 @@ declare namespace Components {
38
38
  /**
39
39
  * Origin of an attribute.
40
40
  */
41
- export type AttributeOrigin = "system_recommendation" | "user_manually";
41
+ export type AttributeOrigin = "system_recommendation" | "user_manually" | "entity_updating_system_recommendation";
42
42
  export interface ConditionNode {
43
43
  source?: string;
44
44
  value?: string | number | {
@@ -144,6 +144,10 @@ declare namespace Components {
144
144
  export interface JourneyRef {
145
145
  journey_id?: string;
146
146
  }
147
+ /**
148
+ * This string value will be replaced with the value of the loop index, when mapping in loop mode
149
+ */
150
+ export type LoopIndexString = "##LOOP_INDEX##";
147
151
  export interface MapCondition {
148
152
  _exists?: ConditionNode;
149
153
  _equals?: ConditionNode;
@@ -266,6 +270,60 @@ declare namespace Components {
266
270
  export interface MappingHistoryResp {
267
271
  results: MappingHistoryEntry[];
268
272
  }
273
+ export interface MappingSource {
274
+ /**
275
+ * Key aiming to identify source
276
+ */
277
+ key: string;
278
+ /**
279
+ * Each item describes a property under the main source and a possibly, a default value for its target attribute
280
+ */
281
+ sub_properties?: MappingSourceProperty[];
282
+ /**
283
+ * Data Structure type of source
284
+ */
285
+ source_type: string;
286
+ /**
287
+ * Data Structure Type of the underlaying output value
288
+ */
289
+ possible_target_types?: MappingSourceTargetType[];
290
+ /**
291
+ * Initial value of a relation to be added
292
+ */
293
+ initial_relation?: RelationAttribute;
294
+ /**
295
+ * Human readable name of the Source
296
+ */
297
+ title: string;
298
+ /**
299
+ * Human readable type of the source
300
+ */
301
+ sub_title?: string;
302
+ target_settings?: {
303
+ /**
304
+ * Describes which actions the user can perform on each target, if specified. If not specified, all actions are allowed
305
+ */
306
+ allowed_ui_actions?: ("schema-select" | "attribute-select" | "target-delete" | "target-add" | "target")[];
307
+ /**
308
+ * Whether its a read-only ui or not. Can be each target, or only the first. Overwrites uiActions
309
+ */
310
+ locked?: "each" | "first" | "system_recommendation";
311
+ /**
312
+ * Whether all source mappings flow into a single attribute (e.g. address)
313
+ */
314
+ isSingleTarget?: boolean;
315
+ /**
316
+ * Determines whether a mapping target should be shown or not. Use if there are targets which cannot be manipulated by the UI. E.g journey_data
317
+ */
318
+ visibility?: {
319
+ mode: "hide" | "show" | "message";
320
+ if: {
321
+ [name: string]: string;
322
+ };
323
+ message?: string;
324
+ };
325
+ };
326
+ }
269
327
  export interface MappingSourceProperty {
270
328
  value: string;
271
329
  label: string;
package/dist/openapi.json CHANGED
@@ -927,6 +927,13 @@
927
927
  }
928
928
  }
929
929
  },
930
+ "Loop_Index_String": {
931
+ "type": "string",
932
+ "description": "This string value will be replaced with the value of the loop index, when mapping in loop mode",
933
+ "enum": [
934
+ "##LOOP_INDEX##"
935
+ ]
936
+ },
930
937
  "TargetConfig": {
931
938
  "type": "object",
932
939
  "properties": {
@@ -1174,7 +1181,8 @@
1174
1181
  "description": "Origin of an attribute.",
1175
1182
  "enum": [
1176
1183
  "system_recommendation",
1177
- "user_manually"
1184
+ "user_manually",
1185
+ "entity_updating_system_recommendation"
1178
1186
  ]
1179
1187
  },
1180
1188
  "OperationNode": {
@@ -1445,6 +1453,109 @@
1445
1453
  "mapped_entities_snapshot"
1446
1454
  ]
1447
1455
  },
1456
+ "MappingSource": {
1457
+ "type": "object",
1458
+ "properties": {
1459
+ "key": {
1460
+ "type": "string",
1461
+ "description": "Key aiming to identify source"
1462
+ },
1463
+ "sub_properties": {
1464
+ "description": "Each item describes a property under the main source and a possibly, a default value for its target attribute",
1465
+ "type": "array",
1466
+ "items": {
1467
+ "$ref": "#/components/schemas/MappingSourceProperty"
1468
+ }
1469
+ },
1470
+ "source_type": {
1471
+ "type": "string",
1472
+ "description": "Data Structure type of source"
1473
+ },
1474
+ "possible_target_types": {
1475
+ "type": "array",
1476
+ "items": {
1477
+ "$ref": "#/components/schemas/MappingSourceTargetType"
1478
+ },
1479
+ "description": "Data Structure Type of the underlaying output value"
1480
+ },
1481
+ "initial_relation": {
1482
+ "description": "Initial value of a relation to be added",
1483
+ "$ref": "#/components/schemas/RelationAttribute"
1484
+ },
1485
+ "title": {
1486
+ "type": "string",
1487
+ "description": "Human readable name of the Source"
1488
+ },
1489
+ "sub_title": {
1490
+ "type": "string",
1491
+ "description": "Human readable type of the source"
1492
+ },
1493
+ "target_settings": {
1494
+ "type": "object",
1495
+ "properties": {
1496
+ "allowed_ui_actions": {
1497
+ "type": "array",
1498
+ "items": {
1499
+ "type": "string",
1500
+ "enum": [
1501
+ "schema-select",
1502
+ "attribute-select",
1503
+ "target-delete",
1504
+ "target-add",
1505
+ "target"
1506
+ ]
1507
+ },
1508
+ "description": "Describes which actions the user can perform on each target, if specified. If not specified, all actions are allowed"
1509
+ },
1510
+ "locked": {
1511
+ "type": "string",
1512
+ "enum": [
1513
+ "each",
1514
+ "first",
1515
+ "system_recommendation"
1516
+ ],
1517
+ "description": "Whether its a read-only ui or not. Can be each target, or only the first. Overwrites uiActions"
1518
+ },
1519
+ "isSingleTarget": {
1520
+ "type": "boolean",
1521
+ "description": "Whether all source mappings flow into a single attribute (e.g. address)"
1522
+ },
1523
+ "visibility": {
1524
+ "description": "Determines whether a mapping target should be shown or not. Use if there are targets which cannot be manipulated by the UI. E.g journey_data",
1525
+ "type": "object",
1526
+ "properties": {
1527
+ "mode": {
1528
+ "type": "string",
1529
+ "enum": [
1530
+ "hide",
1531
+ "show",
1532
+ "message"
1533
+ ]
1534
+ },
1535
+ "if": {
1536
+ "type": "object",
1537
+ "additionalProperties": {
1538
+ "type": "string"
1539
+ }
1540
+ },
1541
+ "message": {
1542
+ "type": "string"
1543
+ }
1544
+ },
1545
+ "required": [
1546
+ "mode",
1547
+ "if"
1548
+ ]
1549
+ }
1550
+ }
1551
+ }
1552
+ },
1553
+ "required": [
1554
+ "key",
1555
+ "title",
1556
+ "source_type"
1557
+ ]
1558
+ },
1448
1559
  "MappingSourceProperty": {
1449
1560
  "type": "object",
1450
1561
  "properties": {
@@ -1492,5 +1603,10 @@
1492
1603
  ]
1493
1604
  }
1494
1605
  }
1495
- }
1496
- }
1606
+ },
1607
+ "servers": [
1608
+ {
1609
+ "url": "https://entity-mapping.sls.epilot.io"
1610
+ }
1611
+ ]
1612
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/entity-mapping-client",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
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",
@@ -73,5 +73,5 @@
73
73
  "webpack": "^5.18.0",
74
74
  "webpack-cli": "^4.4.0"
75
75
  },
76
- "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
77
- }
76
+ "gitHead": "3d3bf21ff82bd17b0d5439eebf3b27c3a6608646"
77
+ }