Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@epilot/entity-mapping-client

Package Overview
Dependencies
Maintainers
24
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@epilot/entity-mapping-client - npm Package Compare versions

Comparing version 0.0.1-alpha.0 to 0.0.1-alpha.1

2

dist/definition.js

@@ -1,1 +0,1 @@

(()=>{"use strict";var e={914:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(i(534));t.default=r.default},534:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Entity Mapping API","description":"API Backend for mapping source entity into target entities","version":"1.0.0"},"tags":[{"name":"mappings","description":"Entity Mapping Configs"}],"security":[{"EpilotAuth":[]}],"paths":{"/v1/mappings":{"post":{"operationId":"storeConfig","summary":"storeConfig","description":"Store new MappingConfig","tags":["mappings"],"requestBody":{"description":"Mapping Config to store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}},"responses":{"201":{"description":"The updated entity mapping config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}}},"/v1/mappings/{id}":{"get":{"operationId":"getConfig","summary":"getConfig","description":"Get latest version of a mapping config by id","tags":["mappings"],"parameters":[{"name":"id","in":"path","required":true,"description":"Mapping Config Id","schema":{"type":"string","example":"uuidv4"}}],"responses":{"200":{"description":"Entity Mapping Config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}},"delete":{"operationId":"deleteConfig","summary":"deleteConfig","description":"Delete entity mapping config","tags":["mappings"],"parameters":[{"name":"id","in":"path","required":true,"description":"Mapping Config Id","schema":{"type":"string","example":"uuidv4"}}],"responses":{"200":{"description":"The deleted mapping config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}}},"/v1/mappings/{id}/versions":{"get":{"operationId":"getAllVersions","summary":"getAllVersions","description":"Get all version of MappingConfig","tags":["mappings"],"parameters":[{"name":"id","in":"path","required":true,"description":"Mapping Config Id","schema":{"type":"string","example":"uuidv4"}}],"responses":{"200":{"description":"All versions of a MappingConfig","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfigsResp"}}}}}},"post":{"operationId":"storeNewVersion","summary":"storeNewVersion","description":"Store new version of MappingConfig","tags":["mappings"],"parameters":[{"name":"id","in":"path","required":true,"description":"Mapping Config Id","schema":{"type":"string","example":"uuidv4"}}],"requestBody":{"description":"Mapping Config to store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}},"responses":{"200":{"description":"The updated entity mapping config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}}},"/v1/mappings/{id}:execute":{"post":{"operationId":"executeMapping","summary":"executeMapping","description":"Execute entity mapping based on a config","parameters":[{"name":"id","in":"path","required":true,"description":"Mapping Config Id","schema":{"type":"string","example":"uuidv4"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteMappingReq"}}}},"tags":["mappings"],"responses":{"200":{"description":"The target entities which were mapped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteMappingResp"}}}}}}},"/v1/mappings:search":{"post":{"operationId":"searchConfigs","summary":"searchConfigs","description":"Search mapping configs","tags":["mappings"],"requestBody":{"description":"Search Mapping Configs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchMappingReq"}}}},"responses":{"200":{"description":"Entity Mapping Config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"}},"schemas":{"SearchMappingReq":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/SourceConfig"}}},"MappingConfigsResp":{"type":"object","properties":{"configs":{"$ref":"#/components/schemas/MappingConfigs"}},"required":["configs"]},"MappingConfigs":{"type":"array","items":{"$ref":"#/components/schemas/MappingConfig"}},"MappingConfig":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"version":{"type":"number"},"source":{"$ref":"#/components/schemas/SourceConfig"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TargetConfig"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/Owner","description":"User / service who created the entity mapping config","example":{"type":"internal_service"}},"last_updated_by":{"$ref":"#/components/schemas/Owner","description":"User / service who last updated entity mapping config","example":{"type":"user","org_id":255151,"user_id":99252}}},"required":["id","org_id","version","source","targets"]},"Owner":{"type":"object","properties":{"type":{"type":"string","enum":["user","internal_service"]},"org_id":{"type":"string"},"user_id":{"type":"string"}},"required":["type"]},"ExecuteMappingReq":{"type":"object","description":"Pass either source or source_entity","properties":{"source":{"$ref":"#/components/schemas/EntityRef"},"source_entity":{"$ref":"#/components/schemas/Entity"}}},"ExecuteMappingResp":{"type":"object","properties":{"mapped_entities":{"type":"array","items":{"$ref":"#/components/schemas/Entity"}}}},"Entity":{"type":"object","properties":{"_id":{"type":"string"},"_schema":{"type":"string"}},"additionalProperties":true},"EntityRef":{"type":"object","properties":{"entity_id":{"type":"string","description":"id of the source entity to be mapped"},"entity_schema":{"description":"schema of the source entity","type":"string","example":"submission"}},"required":["entity_id"]},"SourceConfig":{"type":"object","properties":{"type":{"type":"string","enum":["journey","entity"]},"config":{"anyOf":[{"$ref":"#/components/schemas/JourneyRef"},{"$ref":"#/components/schemas/EntityRef"}]}}},"JourneyRef":{"type":"object","properties":{"journey_id":{"type":"string"}}},"TargetConfig":{"type":"object","properties":{"name":{"type":"string","description":"A name for this configuration"},"target_schema":{"type":"string","description":"Schema of target entity"},"target_unique":{"type":"array","description":"Unique key for target entity (see upsertEntity of Entity API)","items":{"type":"string"}},"conditions":{"type":"array","description":"Conditions necessary to hold for the target entity to be mapped","items":{"$ref":"#/components/schemas/MapCondition"}},"mapping_attributes":{"type":"array","description":"Attribute mappings","items":{"anyOf":[{"$ref":"#/components/schemas/MappingAttributeV2"},{"$ref":"#/components/schemas/MappingAttribute"}]}},"relation_attributes":{"type":"array","description":"Relation mappings","items":{"$ref":"#/components/schemas/RelationAttribute"}},"linkback_relation_attribute":{"type":"string","default":"mapped_entities","description":"Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\\n"},"linkback_relation_tags":{"type":"array","description":"Relation tags (labels) to include in main entity linkback relation attribute","items":{"type":"string"}}},"required":["target_schema"]},"MapCondition":{"type":"object","properties":{"_exists":{"$ref":"#/components/schemas/ConditionNode"},"_equals":{"$ref":"#/components/schemas/ConditionNode"},"_not_exists":{"$ref":"#/components/schemas/ConditionNode"},"_any_of":{"$ref":"#/components/schemas/ConditionNode"}}},"ConditionNode":{"type":"object","properties":{"source":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object"},{"type":"array","items":{"type":"object"}}]}}},"RelationAttribute":{"type":"object","properties":{"target":{"type":"string","description":"Target attribute to store the relation in"},"target_tags":{"type":"array","description":"Relation tags (labels) to set for the stored relations","items":{"type":"string"}},"target_tags_include_source":{"type":"boolean","description":"Include all relation tags (labels) present on the main entity relation","default":false},"source_filter":{"type":"object","description":"A filter to identify which source entities to pick as relations from main entity","properties":{"limit":{"type":"integer","description":"Limit relations to maximum number (default, all matched relations)","minimum":0},"schema":{"type":"string","description":"Filter by specific schema"},"attribute":{"type":"string","description":"Filter by a specific relation attribute on the main entity"},"relation_tag":{"type":"string","description":"Filter by relation tag (label) on the main entity"},"tag":{"type":"string","description":"Filter by a specific tag on the related entity"},"self":{"type":"boolean","description":"Picks main entity as relation (overrides other filters)","default":false}}},"related_to":{"type":"object","additionalProperties":true,"deprecated":true},"mode":{"type":"string","enum":["append","prepend","set"]}},"required":["target","mode"]},"MappingAttributeV2":{"type":"object","properties":{"target":{"type":"string","description":"Target JSON path for the attribute to set"},"operation":{"$ref":"#/components/schemas/OperationNode"}},"required":["targetPath","operation"],"example":{"target":"_tags","operation":{"_append":["new","tags"],"_uniq":true}}},"OperationNode":{"description":"Mapping operation nodes are either primitive values or operation node objects","oneOf":[{"$ref":"#/components/schemas/OperationObjectNode"},{"$ref":"#/components/schemas/PrimitiveJSONValue"}]},"OperationObjectNode":{"type":"object","properties":{"_set":{"$ref":"#/components/schemas/PrimitiveJSONValue"},"_append":{"description":"Append to array","items":{"$ref":"#/components/schemas/PrimitiveJSONValue"}},"_uniq":{"description":"Unique array","oneOf":[{"type":"boolean","example":true},{"type":"array","description":"Unique key consisting of object keys","example":["email"],"items":{"type":"string"}}]},"_copy":{"description":"Copy JSONPath value from source entity context","type":"string","example":"contact.first_name"}},"additionalProperties":true},"PrimitiveJSONValue":{"description":"Represents any primitive JSON value","anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"type":"object","additionalProperties":true},{"type":"array"}]},"MappingAttribute":{"anyOf":[{"$ref":"#/components/schemas/SetValueMapper"},{"$ref":"#/components/schemas/CopyValueMapper"},{"$ref":"#/components/schemas/AppendValueMapper"}]},"MappingAttributeMode":{"type":"string","enum":["copy_if_exists","append_if_exists","set_value"],"description":"- copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property.\\n"},"SetValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"value":{"description":"Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any.\\n"}},"required":["mode","target","value"]},"CopyValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"source":{"type":"string","description":"JSON source path for the value to be extracted from the main entity. Eg: steps[1].[\'Product Info\'].price\\n"}},"required":["mode","target","source"]},"AppendValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"source":{"type":"string","description":"JSON source path for the value to be extracted from the main entity. Eg: steps[1].[\'Product Info\'].price\\n"},"value_json":{"type":"string","description":"To be provided only when mapping json objects into a target attribute. Eg array of addresses.\\n"},"target_unique":{"type":"array","items":{"type":"string"},"description":"Array of keys which should be used when checking for uniqueness. Eg: [country, city, postal_code]\\n"}},"required":["mode","target","value_json"]}}},"servers":[{"url":"null"}]}')}},t={},i=function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}(914),n=exports;for(var r in i)n[r]=i[r];i.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
(()=>{"use strict";var e={914:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(i(534));t.default=r.default},534:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Entity Mapping API","description":"API Backend for mapping source entity into target entities","version":"1.0.0"},"tags":[{"name":"mappings","description":"Entity Mapping Configs"}],"security":[{"EpilotAuth":[]}],"paths":{"/v1/mappings":{"post":{"operationId":"storeConfig","summary":"storeConfig","description":"Store new MappingConfig","tags":["mappings"],"requestBody":{"description":"Mapping Config to store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}},"responses":{"201":{"description":"The updated entity mapping config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}}},"/v1/mappings/{id}":{"get":{"operationId":"getConfig","summary":"getConfig","description":"Get latest version of a mapping config by id","tags":["mappings"],"parameters":[{"name":"id","in":"path","required":true,"description":"Mapping Config Id","schema":{"type":"string","example":"uuidv4"}}],"responses":{"200":{"description":"Entity Mapping Config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}},"delete":{"operationId":"deleteConfig","summary":"deleteConfig","description":"Delete entity mapping config","tags":["mappings"],"parameters":[{"name":"id","in":"path","required":true,"description":"Mapping Config Id","schema":{"type":"string","example":"uuidv4"}}],"responses":{"200":{"description":"The deleted mapping config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}}},"/v1/mappings/{id}/versions":{"get":{"operationId":"getAllVersions","summary":"getAllVersions","description":"Get all version of MappingConfig","tags":["mappings"],"parameters":[{"name":"id","in":"path","required":true,"description":"Mapping Config Id","schema":{"type":"string","example":"uuidv4"}}],"responses":{"200":{"description":"All versions of a MappingConfig","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfigsResp"}}}}}},"post":{"operationId":"storeNewVersion","summary":"storeNewVersion","description":"Store new version of MappingConfig","tags":["mappings"],"parameters":[{"name":"id","in":"path","required":true,"description":"Mapping Config Id","schema":{"type":"string","example":"uuidv4"}}],"requestBody":{"description":"Mapping Config to store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}},"responses":{"200":{"description":"The updated entity mapping config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}}},"/v1/mappings:execute":{"post":{"operationId":"executeMapping","summary":"executeMapping","description":"Execute entity mapping based on a config","parameters":[{"name":"preview_mode","in":"query","required":false,"description":"True, if you want to preview the entities which will result","schema":{"type":"boolean","example":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteMappingReq"}}}},"tags":["mappings"],"responses":{"200":{"description":"The target entities which were mapped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteMappingResp"}}}}}}},"/v1/mappings:search":{"post":{"operationId":"searchConfigs","summary":"searchConfigs","description":"Search mapping configs","tags":["mappings"],"requestBody":{"description":"Search Mapping Configs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchMappingReq"}}}},"responses":{"200":{"description":"Entity Mapping Config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingConfig"}}}}}}},"/v1/mappings/{id}/history":{"get":{"operationId":"getMappingHistory","summary":"getMappingHistory","description":"Get the Mapping History","tags":["history"],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true,"description":"the id of the mapping"},{"in":"query","name":"from","schema":{"type":"string","format":"datetime"},"required":false,"description":"filter the history from this date on"},{"in":"query","name":"to","schema":{"type":"string","format":"datetime"},"required":false,"description":"filter the history to this date on"}],"responses":{"200":{"description":"Query result of mapping history","content":{"application/json":{"schema":{"properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/MappingHistoryResponse"}}}}}}}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"}},"schemas":{"SearchMappingReq":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/SourceConfig"}}},"MappingConfigsResp":{"type":"object","properties":{"configs":{"$ref":"#/components/schemas/MappingConfigs"}},"required":["configs"]},"MappingConfigs":{"type":"array","items":{"$ref":"#/components/schemas/MappingConfig"}},"MappingConfig":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"version":{"type":"number"},"source":{"$ref":"#/components/schemas/SourceConfig"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TargetConfig"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"$ref":"#/components/schemas/Owner","description":"User / service who created the entity mapping config","example":{"type":"internal_service"}},"last_updated_by":{"$ref":"#/components/schemas/Owner","description":"User / service who last updated entity mapping config","example":{"type":"user","org_id":255151,"user_id":99252}}},"required":["id","org_id","version","source","targets"]},"Owner":{"type":"object","properties":{"type":{"type":"string","enum":["user","internal_service"]},"org_id":{"type":"string"},"user_id":{"type":"string"}},"required":["type"]},"ExecuteMappingReq":{"type":"object","description":"Pass either source or source_entity","properties":{"source_ref":{"$ref":"#/components/schemas/EntityRef","description":"A reference (id and schema) to the entity to be used as source."},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TargetConfig"},"description":"Mapping Configuration to apply."}},"required":["source_ref","targets"]},"ExecuteMappingResp":{"type":"object","properties":{"mapped_entities":{"type":"array","items":{"$ref":"#/components/schemas/Entity"}},"failures":{"type":"array","items":{"$ref":"#/components/schemas/MappingFailure"}}},"required":["mapped_entities"]},"MappingFailure":{"type":"object","properties":{"target":{"$ref":"#/components/schemas/TargetConfig"},"error":{"type":"object","properties":{"message":{"type":"string"}},"additionalProperties":true}}},"Entity":{"type":"object","properties":{"_id":{"type":"string"},"_schema":{"type":"string"},"_title":{"type":"string"},"_org":{"type":"string"},"_tags":{"type":"array","items":{"type":"string"}},"_created_at":{"type":"string"},"_updated_at":{"type":"string"}},"additionalProperties":true},"EntityRef":{"type":"object","properties":{"entity_id":{"type":"string","description":"id of the source entity to be mapped"},"entity_schema":{"description":"schema of the source entity","type":"string","example":"submission"}},"required":["entity_id"]},"SourceConfig":{"type":"object","properties":{"type":{"type":"string","enum":["journey","entity"]},"config":{"anyOf":[{"$ref":"#/components/schemas/JourneyRef"},{"$ref":"#/components/schemas/EntityRef"}]}}},"JourneyRef":{"type":"object","properties":{"journey_id":{"type":"string"}}},"TargetConfig":{"type":"object","properties":{"id":{"type":"string","description":"Identifier for target configuration. Useful for later usages when trying to identify which target config to map to."},"name":{"type":"string","description":"A name for this configuration"},"allow_failure":{"type":"boolean","description":"Pass it as true, when you don\'t want failures to interrupt the mapping process."},"target_schema":{"type":"string","description":"Schema of target entity"},"target_unique":{"type":"array","description":"Unique key for target entity (see upsertEntity of Entity API)","items":{"type":"string"}},"conditions":{"type":"array","description":"Conditions necessary to hold for the target entity to be mapped","items":{"$ref":"#/components/schemas/MapCondition"}},"mapping_attributes":{"type":"array","description":"Attribute mappings","items":{"anyOf":[{"$ref":"#/components/schemas/MappingAttributeV2"},{"$ref":"#/components/schemas/MappingAttribute"}]}},"relation_attributes":{"type":"array","description":"Relation mappings","items":{"$ref":"#/components/schemas/RelationAttribute"}},"linkback_relation_attribute":{"type":"string","default":"mapped_entities","description":"Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\\n"},"linkback_relation_tags":{"type":"array","description":"Relation tags (labels) to include in main entity linkback relation attribute","items":{"type":"string"}}},"required":["target_schema","mapping_attributes"]},"MapCondition":{"type":"object","properties":{"_exists":{"$ref":"#/components/schemas/ConditionNode"},"_equals":{"$ref":"#/components/schemas/ConditionNode"},"_not_exists":{"$ref":"#/components/schemas/ConditionNode"},"_any_of":{"$ref":"#/components/schemas/ConditionNode"}}},"ConditionNode":{"type":"object","properties":{"source":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object"},{"type":"array","items":{"type":"object"}}]}}},"RelationAttribute":{"type":"object","properties":{"target":{"type":"string","description":"Target attribute to store the relation in"},"target_tags":{"type":"array","description":"Relation tags (labels) to set for the stored relations","items":{"type":"string"}},"target_tags_include_source":{"type":"boolean","description":"Include all relation tags (labels) present on the main entity relation","default":false},"source_filter":{"type":"object","description":"A filter to identify which source entities to pick as relations from main entity","properties":{"limit":{"type":"integer","description":"Limit relations to maximum number (default, all matched relations)","minimum":0},"schema":{"type":"string","description":"Filter by specific schema"},"attribute":{"type":"string","description":"Filter by a specific relation attribute on the main entity"},"relation_tag":{"type":"string","description":"Filter by relation tag (label) on the main entity"},"tag":{"type":"string","description":"Filter by a specific tag on the related entity"},"self":{"type":"boolean","description":"Picks main entity as relation (overrides other filters)","default":false}}},"related_to":{"type":"object","additionalProperties":true,"deprecated":true},"mode":{"type":"string","enum":["append","prepend","set"]}},"required":["target","mode"]},"MappingAttributeV2":{"type":"object","properties":{"target":{"type":"string","description":"Target JSON path for the attribute to set"},"operation":{"$ref":"#/components/schemas/OperationNode"},"origin":{"$ref":"#/components/schemas/AttributeOrigin"}},"required":["targetPath","operation"],"example":{"target":"_tags","operation":{"_append":["new","tags"],"_uniq":true}}},"AttributeOrigin":{"type":"string","description":"Origin of an attribute.","enum":["system_recommendation","user_manually"]},"OperationNode":{"description":"Mapping operation nodes are either primitive values or operation node objects","oneOf":[{"$ref":"#/components/schemas/OperationObjectNode"},{"$ref":"#/components/schemas/PrimitiveJSONValue"}]},"OperationObjectNode":{"type":"object","properties":{"_set":{"$ref":"#/components/schemas/PrimitiveJSONValue"},"_append":{"description":"Append to array","items":{"$ref":"#/components/schemas/PrimitiveJSONValue"}},"_uniq":{"description":"Unique array","oneOf":[{"type":"boolean","example":true},{"type":"array","description":"Unique key consisting of object keys","example":["email"],"items":{"type":"string"}}]},"_copy":{"description":"Copy JSONPath value from source entity context","type":"string","example":"contact.first_name"}},"additionalProperties":true},"PrimitiveJSONValue":{"description":"Represents any primitive JSON value","anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"type":"object","additionalProperties":true},{"type":"array"}]},"MappingAttribute":{"anyOf":[{"$ref":"#/components/schemas/SetValueMapper"},{"$ref":"#/components/schemas/CopyValueMapper"},{"$ref":"#/components/schemas/AppendValueMapper"}]},"MappingAttributeMode":{"type":"string","enum":["copy_if_exists","append_if_exists","set_value"],"description":"- copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property.\\n"},"SetValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"value":{"description":"Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any.\\n"}},"required":["mode","target","value"]},"CopyValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"source":{"type":"string","description":"JSON source path for the value to be extracted from the main entity. Eg: steps[1].[\'Product Info\'].price\\n"}},"required":["mode","target","source"]},"AppendValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"source":{"type":"string","description":"JSON source path for the value to be extracted from the main entity. Eg: steps[1].[\'Product Info\'].price\\n"},"value_json":{"type":"string","description":"To be provided only when mapping json objects into a target attribute. Eg array of addresses.\\n"},"target_unique":{"type":"array","items":{"type":"string"},"description":"Array of keys which should be used when checking for uniqueness. Eg: [country, city, postal_code]\\n"}},"required":["mode","target","value_json"]},"MappingHistoryResponse":{"type":"object","properties":{"configId":{"type":"string","example":"source#entity_id"},"timestamp":{"type":"string","format":"datetime"},"version":{"type":"string","example":"v1"},"attributes":{"type":"object"}}}}},"servers":[{"url":"null"}]}')}},t={},i=function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}(914),n=exports;for(var r in i)n[r]=i[r];i.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();

@@ -38,2 +38,6 @@ /* eslint-disable */

}
/**
* Origin of an attribute.
*/
export type AttributeOrigin = "system_recommendation" | "user_manually";
export interface ConditionNode {

@@ -67,2 +71,7 @@ source?: string;

_schema?: string;
_title?: string;
_org?: string;
_tags?: string[];
_created_at?: string;
_updated_at?: string;
}

@@ -85,7 +94,14 @@ export interface EntityRef {

export interface ExecuteMappingReq {
source?: EntityRef;
source_entity?: Entity;
/**
* A reference (id and schema) to the entity to be used as source.
*/
source_ref: EntityRef;
/**
* Mapping Configuration to apply.
*/
targets: TargetConfig[];
}
export interface ExecuteMappingResp {
mapped_entities?: Entity[];
mapped_entities: Entity[];
failures?: MappingFailure[];
}

@@ -126,2 +142,3 @@ export interface JourneyRef {

operation: /* Mapping operation nodes are either primitive values or operation node objects */ OperationNode;
origin?: /* Origin of an attribute. */ AttributeOrigin;
}

@@ -159,2 +176,25 @@ export interface MappingConfig {

}
export interface MappingFailure {
target?: TargetConfig;
error?: {
[name: string]: any;
message?: string;
};
}
export interface MappingHistoryResponse {
/**
* example:
* source#entity_id
*/
configId?: string;
timestamp?: string; // datetime
/**
* example:
* v1
*/
version?: string;
attributes?: {
[key: string]: any;
};
}
/**

@@ -265,2 +305,6 @@ * Mapping operation nodes are either primitive values or operation node objects

/**
* Identifier for target configuration. Useful for later usages when trying to identify which target config to map to.
*/
id?: string;
/**
* A name for this configuration

@@ -270,2 +314,6 @@ */

/**
* Pass it as true, when you don't want failures to interrupt the mapping process.
*/
allow_failure?: boolean;
/**
* Schema of target entity

@@ -285,3 +333,3 @@ */

*/
mapping_attributes?: (/**
mapping_attributes: (/**
* example:

@@ -340,12 +388,12 @@ * {

* example:
* uuidv4
* true
*/
export type Id = string;
export type PreviewMode = boolean;
}
export interface PathParameters {
id: /**
export interface QueryParameters {
preview_mode?: /**
* example:
* uuidv4
* true
*/
Parameters.Id;
Parameters.PreviewMode;
}

@@ -395,2 +443,21 @@ export type RequestBody = /* Pass either source or source_entity */ Components.Schemas.ExecuteMappingReq;

}
namespace GetMappingHistory {
namespace Parameters {
export type From = string; // datetime
export type Id = string;
export type To = string; // datetime
}
export interface PathParameters {
id: Parameters.Id;
}
export interface QueryParameters {
from?: Parameters.From /* datetime */;
to?: Parameters.To /* datetime */;
}
namespace Responses {
export interface $200 {
results?: Components.Schemas.MappingHistoryResponse[];
}
}
}
namespace SearchConfigs {

@@ -487,3 +554,3 @@ export type RequestBody = Components.Schemas.SearchMappingReq;

'executeMapping'(
parameters?: Parameters<Paths.ExecuteMapping.PathParameters> | null,
parameters?: Parameters<Paths.ExecuteMapping.QueryParameters> | null,
data?: Paths.ExecuteMapping.RequestBody,

@@ -502,2 +569,12 @@ config?: AxiosRequestConfig

): OperationResponse<Paths.SearchConfigs.Responses.$200>
/**
* getMappingHistory - getMappingHistory
*
* Get the Mapping History
*/
'getMappingHistory'(
parameters?: Parameters<Paths.GetMappingHistory.PathParameters & Paths.GetMappingHistory.QueryParameters> | null,
data?: any,
config?: AxiosRequestConfig
): OperationResponse<Paths.GetMappingHistory.Responses.$200>
}

@@ -562,3 +639,3 @@

}
['/v1/mappings/{id}:execute']: {
['/v1/mappings:execute']: {
/**

@@ -570,3 +647,3 @@ * executeMapping - executeMapping

'post'(
parameters?: Parameters<Paths.ExecuteMapping.PathParameters> | null,
parameters?: Parameters<Paths.ExecuteMapping.QueryParameters> | null,
data?: Paths.ExecuteMapping.RequestBody,

@@ -588,4 +665,16 @@ config?: AxiosRequestConfig

}
['/v1/mappings/{id}/history']: {
/**
* getMappingHistory - getMappingHistory
*
* Get the Mapping History
*/
'get'(
parameters?: Parameters<Paths.GetMappingHistory.PathParameters & Paths.GetMappingHistory.QueryParameters> | null,
data?: any,
config?: AxiosRequestConfig
): OperationResponse<Paths.GetMappingHistory.Responses.$200>
}
}
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>

@@ -194,3 +194,3 @@ {

},
"/v1/mappings/{id}:execute": {
"/v1/mappings:execute": {
"post": {

@@ -202,9 +202,9 @@ "operationId": "executeMapping",

{
"name": "id",
"in": "path",
"required": true,
"description": "Mapping Config Id",
"name": "preview_mode",
"in": "query",
"required": false,
"description": "True, if you want to preview the entities which will result",
"schema": {
"type": "string",
"example": "uuidv4"
"type": "boolean",
"example": true
}

@@ -270,2 +270,62 @@ }

}
},
"/v1/mappings/{id}/history": {
"get": {
"operationId": "getMappingHistory",
"summary": "getMappingHistory",
"description": "Get the Mapping History",
"tags": [
"history"
],
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "string"
},
"required": true,
"description": "the id of the mapping"
},
{
"in": "query",
"name": "from",
"schema": {
"type": "string",
"format": "datetime"
},
"required": false,
"description": "filter the history from this date on"
},
{
"in": "query",
"name": "to",
"schema": {
"type": "string",
"format": "datetime"
},
"required": false,
"description": "filter the history to this date on"
}
],
"responses": {
"200": {
"description": "Query result of mapping history",
"content": {
"application/json": {
"schema": {
"properties": {
"results": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MappingHistoryResponse"
}
}
}
}
}
}
}
}
}
}

@@ -386,9 +446,18 @@ },

"properties": {
"source": {
"$ref": "#/components/schemas/EntityRef"
"source_ref": {
"$ref": "#/components/schemas/EntityRef",
"description": "A reference (id and schema) to the entity to be used as source."
},
"source_entity": {
"$ref": "#/components/schemas/Entity"
"targets": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TargetConfig"
},
"description": "Mapping Configuration to apply."
}
}
},
"required": [
"source_ref",
"targets"
]
},

@@ -403,3 +472,29 @@ "ExecuteMappingResp": {

}
},
"failures": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MappingFailure"
}
}
},
"required": [
"mapped_entities"
]
},
"MappingFailure": {
"type": "object",
"properties": {
"target": {
"$ref": "#/components/schemas/TargetConfig"
},
"error": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"additionalProperties": true
}
}

@@ -415,2 +510,20 @@ },

"type": "string"
},
"_title": {
"type": "string"
},
"_org": {
"type": "string"
},
"_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"_created_at": {
"type": "string"
},
"_updated_at": {
"type": "string"
}

@@ -470,2 +583,6 @@ },

"properties": {
"id": {
"type": "string",
"description": "Identifier for target configuration. Useful for later usages when trying to identify which target config to map to."
},
"name": {

@@ -475,2 +592,6 @@ "type": "string",

},
"allow_failure": {
"type": "boolean",
"description": "Pass it as true, when you don't want failures to interrupt the mapping process."
},
"target_schema": {

@@ -529,3 +650,4 @@ "type": "string",

"required": [
"target_schema"
"target_schema",
"mapping_attributes"
]

@@ -656,2 +778,5 @@ },

"$ref": "#/components/schemas/OperationNode"
},
"origin": {
"$ref": "#/components/schemas/AttributeOrigin"
}

@@ -674,2 +799,10 @@ },

},
"AttributeOrigin": {
"type": "string",
"description": "Origin of an attribute.",
"enum": [
"system_recommendation",
"user_manually"
]
},
"OperationNode": {

@@ -843,2 +976,22 @@ "description": "Mapping operation nodes are either primitive values or operation node objects",

]
},
"MappingHistoryResponse": {
"type": "object",
"properties": {
"configId": {
"type": "string",
"example": "source#entity_id"
},
"timestamp": {
"type": "string",
"format": "datetime"
},
"version": {
"type": "string",
"example": "v1"
},
"attributes": {
"type": "object"
}
}
}

@@ -845,0 +998,0 @@ }

{
"name": "@epilot/entity-mapping-client",
"version": "0.0.1-alpha.0",
"version": "0.0.1-alpha.1",
"description": "JavaScript client library for the ePilot Entity Mapping API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc