@epilot/entity-mapping-client 0.8.4 → 0.8.6

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.
@@ -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":{}}}}}},"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 o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,r),o.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":{}}')}},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})})();
@@ -149,12 +149,34 @@
149
149
  }
150
150
  }
151
151
  }
152
+ },
153
+ "/v2/mappings/{id}": {
154
+ "get": {
155
+ "operationId": "getMappingConfig",
156
+ "parameters": [
157
+ {
158
+ "name": "id",
159
+ "in": "path",
160
+ "required": true
161
+ }
162
+ ]
163
+ },
164
+ "put": {
165
+ "operationId": "putMappingConfig",
166
+ "parameters": [
167
+ {
168
+ "name": "id",
169
+ "in": "path",
170
+ "required": true
171
+ }
172
+ ],
173
+ "requestBody": {
174
+ "content": {
175
+ "application/json": {}
176
+ }
177
+ }
178
+ }
152
179
  }
153
180
  },
154
- "components": {},
155
- "servers": [
156
- {
157
- "url": "https://entity-mapping.sls.epilot.io/"
158
- }
159
- ]
181
+ "components": {}
160
182
  }
package/dist/openapi.d.ts CHANGED
@@ -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;
@@ -179,8 +183,25 @@ declare namespace Components {
179
183
  }
180
184
  export interface MappingConfig {
181
185
  id: string;
186
+ source: SourceConfig;
187
+ targets: TargetConfig[];
188
+ created_at?: string; // date-time
189
+ updated_at?: string; // date-time
190
+ created_by?: Owner;
191
+ last_updated_by?: Owner;
192
+ /**
193
+ * example:
194
+ * 66
195
+ */
182
196
  org_id: string;
197
+ /**
198
+ * example:
199
+ * 2
200
+ */
183
201
  version: number;
202
+ }
203
+ export interface MappingConfigCommonFields {
204
+ id: string;
184
205
  source: SourceConfig;
185
206
  targets: TargetConfig[];
186
207
  created_at?: string; // date-time
@@ -204,6 +225,25 @@ declare namespace Components {
204
225
  */
205
226
  last_updated_by?: Owner;
206
227
  }
228
+ export interface MappingConfigV2 {
229
+ id: string;
230
+ source: SourceConfig;
231
+ targets: TargetConfig[];
232
+ created_at?: string; // date-time
233
+ updated_at?: string; // date-time
234
+ created_by?: Owner;
235
+ last_updated_by?: Owner;
236
+ /**
237
+ * example:
238
+ * 66
239
+ */
240
+ org_id?: string;
241
+ /**
242
+ * example:
243
+ * 2
244
+ */
245
+ version?: number;
246
+ }
207
247
  export type MappingConfigs = MappingConfig[];
208
248
  export interface MappingConfigsResp {
209
249
  configs: MappingConfigs;
@@ -219,7 +259,7 @@ declare namespace Components {
219
259
  export interface MappingHistoryEntry {
220
260
  /**
221
261
  * example:
222
- * uuidv4
262
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
223
263
  */
224
264
  id: string;
225
265
  timestamp: string; // ISO datetime
@@ -455,6 +495,19 @@ declare namespace Components {
455
495
  * Unique key for target entity (see upsertEntity of Entity API)
456
496
  */
457
497
  target_unique?: string[];
498
+ /**
499
+ * contains config in case of running in loop mode
500
+ */
501
+ loop_config?: {
502
+ /**
503
+ * path to the array from the entity payload
504
+ */
505
+ source_path?: string;
506
+ /**
507
+ * a hard limit of how many times the loop is allowed to run.
508
+ */
509
+ length?: number;
510
+ };
458
511
  /**
459
512
  * Mode of how conditions are considered valid
460
513
  */
@@ -501,14 +554,14 @@ declare namespace Paths {
501
554
  namespace Parameters {
502
555
  /**
503
556
  * example:
504
- * uuidv4
557
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
505
558
  */
506
559
  export type Id = string;
507
560
  }
508
561
  export interface PathParameters {
509
562
  id: /**
510
563
  * example:
511
- * uuidv4
564
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
512
565
  */
513
566
  Parameters.Id;
514
567
  }
@@ -546,14 +599,14 @@ declare namespace Paths {
546
599
  namespace Parameters {
547
600
  /**
548
601
  * example:
549
- * uuidv4
602
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
550
603
  */
551
604
  export type Id = string;
552
605
  }
553
606
  export interface PathParameters {
554
607
  id: /**
555
608
  * example:
556
- * uuidv4
609
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
557
610
  */
558
611
  Parameters.Id;
559
612
  }
@@ -565,14 +618,14 @@ declare namespace Paths {
565
618
  namespace Parameters {
566
619
  /**
567
620
  * example:
568
- * uuidv4
621
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
569
622
  */
570
623
  export type Id = string;
571
624
  }
572
625
  export interface PathParameters {
573
626
  id: /**
574
627
  * example:
575
- * uuidv4
628
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
576
629
  */
577
630
  Parameters.Id;
578
631
  }
@@ -584,7 +637,7 @@ declare namespace Paths {
584
637
  namespace Parameters {
585
638
  /**
586
639
  * example:
587
- * uuidv4
640
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
588
641
  */
589
642
  export type Id = string;
590
643
  /**
@@ -596,7 +649,7 @@ declare namespace Paths {
596
649
  export interface PathParameters {
597
650
  id: /**
598
651
  * example:
599
- * uuidv4
652
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
600
653
  */
601
654
  Parameters.Id;
602
655
  version: /**
@@ -609,6 +662,45 @@ declare namespace Paths {
609
662
  export type $200 = Components.Schemas.MappingConfig;
610
663
  }
611
664
  }
665
+ namespace GetMappingConfig {
666
+ namespace Parameters {
667
+ /**
668
+ * example:
669
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
670
+ */
671
+ export type Id = string;
672
+ }
673
+ export interface PathParameters {
674
+ id: /**
675
+ * example:
676
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
677
+ */
678
+ Parameters.Id;
679
+ }
680
+ namespace Responses {
681
+ export type $200 = Components.Schemas.MappingConfigV2;
682
+ }
683
+ }
684
+ namespace PutMappingConfig {
685
+ namespace Parameters {
686
+ /**
687
+ * example:
688
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
689
+ */
690
+ export type Id = string;
691
+ }
692
+ export interface PathParameters {
693
+ id: /**
694
+ * example:
695
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
696
+ */
697
+ Parameters.Id;
698
+ }
699
+ export type RequestBody = Components.Schemas.MappingConfigV2;
700
+ namespace Responses {
701
+ export type $200 = Components.Schemas.MappingConfigV2;
702
+ }
703
+ }
612
704
  namespace QueryMappingHistory {
613
705
  namespace Parameters {
614
706
  export type From = string; // datetime
@@ -650,14 +742,14 @@ declare namespace Paths {
650
742
  namespace Parameters {
651
743
  /**
652
744
  * example:
653
- * uuidv4
745
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
654
746
  */
655
747
  export type Id = string;
656
748
  }
657
749
  export interface PathParameters {
658
750
  id: /**
659
751
  * example:
660
- * uuidv4
752
+ * 70542580-2b38-4bfc-af8d-bb90102f9f47
661
753
  */
662
754
  Parameters.Id;
663
755
  }
@@ -769,6 +861,26 @@ export interface OperationMethods {
769
861
  data?: Paths.ExecuteRelations.RequestBody,
770
862
  config?: AxiosRequestConfig
771
863
  ): OperationResponse<Paths.ExecuteRelations.Responses.$200>
864
+ /**
865
+ * getMappingConfig - getMappingConfig
866
+ *
867
+ * Get latest version of a mapping config by id V2
868
+ */
869
+ 'getMappingConfig'(
870
+ parameters?: Parameters<Paths.GetMappingConfig.PathParameters> | null,
871
+ data?: any,
872
+ config?: AxiosRequestConfig
873
+ ): OperationResponse<Paths.GetMappingConfig.Responses.$200>
874
+ /**
875
+ * putMappingConfig - putMappingConfig
876
+ *
877
+ * Stores new version of entity mapping config
878
+ */
879
+ 'putMappingConfig'(
880
+ parameters?: Parameters<Paths.PutMappingConfig.PathParameters> | null,
881
+ data?: Paths.PutMappingConfig.RequestBody,
882
+ config?: AxiosRequestConfig
883
+ ): OperationResponse<Paths.PutMappingConfig.Responses.$200>
772
884
  }
773
885
 
774
886
  export interface PathsDictionary {
@@ -888,6 +1000,28 @@ export interface PathsDictionary {
888
1000
  config?: AxiosRequestConfig
889
1001
  ): OperationResponse<Paths.ExecuteRelations.Responses.$200>
890
1002
  }
1003
+ ['/v2/mappings/{id}']: {
1004
+ /**
1005
+ * getMappingConfig - getMappingConfig
1006
+ *
1007
+ * Get latest version of a mapping config by id V2
1008
+ */
1009
+ 'get'(
1010
+ parameters?: Parameters<Paths.GetMappingConfig.PathParameters> | null,
1011
+ data?: any,
1012
+ config?: AxiosRequestConfig
1013
+ ): OperationResponse<Paths.GetMappingConfig.Responses.$200>
1014
+ /**
1015
+ * putMappingConfig - putMappingConfig
1016
+ *
1017
+ * Stores new version of entity mapping config
1018
+ */
1019
+ 'put'(
1020
+ parameters?: Parameters<Paths.PutMappingConfig.PathParameters> | null,
1021
+ data?: Paths.PutMappingConfig.RequestBody,
1022
+ config?: AxiosRequestConfig
1023
+ ): OperationResponse<Paths.PutMappingConfig.Responses.$200>
1024
+ }
891
1025
  }
892
1026
 
893
1027
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
package/dist/openapi.json CHANGED
@@ -76,7 +76,7 @@
76
76
  "description": "Mapping Config Id",
77
77
  "schema": {
78
78
  "type": "string",
79
- "example": "uuidv4"
79
+ "example": "70542580-2b38-4bfc-af8d-bb90102f9f47"
80
80
  }
81
81
  }
82
82
  ],
@@ -108,7 +108,7 @@
108
108
  "description": "Mapping Config Id",
109
109
  "schema": {
110
110
  "type": "string",
111
- "example": "uuidv4"
111
+ "example": "70542580-2b38-4bfc-af8d-bb90102f9f47"
112
112
  }
113
113
  }
114
114
  ],
@@ -142,7 +142,7 @@
142
142
  "description": "Mapping Config Id",
143
143
  "schema": {
144
144
  "type": "string",
145
- "example": "uuidv4"
145
+ "example": "70542580-2b38-4bfc-af8d-bb90102f9f47"
146
146
  }
147
147
  }
148
148
  ],
@@ -174,7 +174,7 @@
174
174
  "description": "Mapping Config Id",
175
175
  "schema": {
176
176
  "type": "string",
177
- "example": "uuidv4"
177
+ "example": "70542580-2b38-4bfc-af8d-bb90102f9f47"
178
178
  }
179
179
  }
180
180
  ],
@@ -218,7 +218,7 @@
218
218
  "description": "Mapping Config Id",
219
219
  "schema": {
220
220
  "type": "string",
221
- "example": "uuidv4"
221
+ "example": "70542580-2b38-4bfc-af8d-bb90102f9f47"
222
222
  }
223
223
  },
224
224
  {
@@ -418,6 +418,82 @@
418
418
  }
419
419
  }
420
420
  }
421
+ },
422
+ "/v2/mappings/{id}": {
423
+ "get": {
424
+ "operationId": "getMappingConfig",
425
+ "summary": "getMappingConfig",
426
+ "description": "Get latest version of a mapping config by id V2",
427
+ "tags": [
428
+ "mappings"
429
+ ],
430
+ "parameters": [
431
+ {
432
+ "name": "id",
433
+ "in": "path",
434
+ "required": true,
435
+ "description": "Mapping Config Id",
436
+ "schema": {
437
+ "type": "string",
438
+ "example": "70542580-2b38-4bfc-af8d-bb90102f9f47"
439
+ }
440
+ }
441
+ ],
442
+ "responses": {
443
+ "200": {
444
+ "description": "Entity Mapping Config",
445
+ "content": {
446
+ "application/json": {
447
+ "schema": {
448
+ "$ref": "#/components/schemas/MappingConfigV2"
449
+ }
450
+ }
451
+ }
452
+ }
453
+ }
454
+ },
455
+ "put": {
456
+ "operationId": "putMappingConfig",
457
+ "summary": "putMappingConfig",
458
+ "description": "Stores new version of entity mapping config",
459
+ "tags": [
460
+ "mappings"
461
+ ],
462
+ "parameters": [
463
+ {
464
+ "name": "id",
465
+ "in": "path",
466
+ "required": true,
467
+ "description": "Mapping Config Id",
468
+ "schema": {
469
+ "type": "string",
470
+ "example": "70542580-2b38-4bfc-af8d-bb90102f9f47"
471
+ }
472
+ }
473
+ ],
474
+ "requestBody": {
475
+ "description": "Mapping Config to store",
476
+ "content": {
477
+ "application/json": {
478
+ "schema": {
479
+ "$ref": "#/components/schemas/MappingConfigV2"
480
+ }
481
+ }
482
+ }
483
+ },
484
+ "responses": {
485
+ "200": {
486
+ "description": "The updated entity mapping config",
487
+ "content": {
488
+ "application/json": {
489
+ "schema": {
490
+ "$ref": "#/components/schemas/MappingConfigV2"
491
+ }
492
+ }
493
+ }
494
+ }
495
+ }
496
+ }
421
497
  }
422
498
  },
423
499
  "components": {
@@ -455,17 +531,57 @@
455
531
  }
456
532
  },
457
533
  "MappingConfig": {
534
+ "allOf": [
535
+ {
536
+ "$ref": "#/components/schemas/MappingConfigCommonFields"
537
+ },
538
+ {
539
+ "type": "object",
540
+ "properties": {
541
+ "org_id": {
542
+ "type": "string",
543
+ "example": "66"
544
+ },
545
+ "version": {
546
+ "type": "integer",
547
+ "example": 2
548
+ }
549
+ }
550
+ }
551
+ ],
552
+ "required": [
553
+ "org_id",
554
+ "version"
555
+ ]
556
+ },
557
+ "MappingConfigV2": {
558
+ "allOf": [
559
+ {
560
+ "$ref": "#/components/schemas/MappingConfigCommonFields"
561
+ },
562
+ {
563
+ "type": "object",
564
+ "properties": {
565
+ "org_id": {
566
+ "type": "string",
567
+ "example": "66",
568
+ "readOnly": true
569
+ },
570
+ "version": {
571
+ "type": "integer",
572
+ "example": 2,
573
+ "readOnly": true
574
+ }
575
+ }
576
+ }
577
+ ]
578
+ },
579
+ "MappingConfigCommonFields": {
458
580
  "type": "object",
459
581
  "properties": {
460
582
  "id": {
461
583
  "type": "string"
462
584
  },
463
- "org_id": {
464
- "type": "string"
465
- },
466
- "version": {
467
- "type": "number"
468
- },
469
585
  "source": {
470
586
  "$ref": "#/components/schemas/SourceConfig"
471
587
  },
@@ -502,8 +618,6 @@
502
618
  },
503
619
  "required": [
504
620
  "id",
505
- "org_id",
506
- "version",
507
621
  "source",
508
622
  "targets"
509
623
  ]
@@ -813,6 +927,13 @@
813
927
  }
814
928
  }
815
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
+ },
816
937
  "TargetConfig": {
817
938
  "type": "object",
818
939
  "properties": {
@@ -839,6 +960,21 @@
839
960
  "type": "string"
840
961
  }
841
962
  },
963
+ "loop_config": {
964
+ "type": "object",
965
+ "description": "contains config in case of running in loop mode",
966
+ "properties": {
967
+ "source_path": {
968
+ "type": "string",
969
+ "description": "path to the array from the entity payload"
970
+ },
971
+ "length": {
972
+ "type": "number",
973
+ "description": "a hard limit of how many times the loop is allowed to run.",
974
+ "default": "the length of the array"
975
+ }
976
+ }
977
+ },
842
978
  "conditionMode": {
843
979
  "description": "Mode of how conditions are considered valid",
844
980
  "type": "string",
@@ -1286,7 +1422,7 @@
1286
1422
  "properties": {
1287
1423
  "id": {
1288
1424
  "type": "string",
1289
- "example": "uuidv4"
1425
+ "example": "70542580-2b38-4bfc-af8d-bb90102f9f47"
1290
1426
  },
1291
1427
  "timestamp": {
1292
1428
  "type": "string",
@@ -1466,10 +1602,5 @@
1466
1602
  ]
1467
1603
  }
1468
1604
  }
1469
- },
1470
- "servers": [
1471
- {
1472
- "url": "https://entity-mapping.sls.epilot.io/"
1473
- }
1474
- ]
1605
+ }
1475
1606
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/entity-mapping-client",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
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",
@@ -25,7 +25,7 @@
25
25
  "test": "jest",
26
26
  "typescript": "tsc",
27
27
  "bundle-definition": "webpack",
28
- "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/entity-mapping-api.yaml",
28
+ "openapi": "node ../../scripts/update-openapi.js /Users/mohannad/epilot/entity-mapping-api/openapi.yml",
29
29
  "typegen": "echo '/* eslint-disable */' > src/openapi.d.ts && typegen ./src/openapi.json >> src/openapi.d.ts",
30
30
  "build": "tsc && npm run bundle-definition",
31
31
  "build:watch": "npm run build && tsc -w",