@wix/metro-runtime
Advanced tools
Comparing version 1.1536.0 to 1.1537.0
@@ -19,2 +19,3 @@ "use strict"; | ||
exports.resolveQueryFieldsTransformationPaths = _queryTransformation.resolveQueryFieldsTransformationPaths; | ||
var _renameAllNestedKeys = require("./rename-all-nested-keys"); | ||
const converters = (0, _utils.typeToConverterSet)([..._converters.protobufConverters, ..._converters2.veloConverters]); | ||
@@ -40,13 +41,25 @@ function extractDomainEventPayload(parsedDomainEvent) { | ||
return { | ||
toAmbassadorRequest(userInputArgs) { | ||
return (0, _lodash.omitBy)(serialize((0, _motionEdmAutogenTransformations.fromCorvidEntity)((0, _motionEdmAutogenTransformations.transformToRequestMessage)(userInputArgs, customTransformation, _motionEdmAutogenP13n.builtinCustomFunctions)), _domain.ConverterType.TO_JSON), _lodash.isUndefined); | ||
toAmbassadorRequest(userInputArgs, ignorePathsForKeyRenames = []) { | ||
return (0, _lodash.omitBy)(serialize((0, _renameAllNestedKeys.renameAllNestedKeys)((0, _motionEdmAutogenTransformations.transformToRequestMessage)(userInputArgs, customTransformation, _motionEdmAutogenP13n.builtinCustomFunctions), { | ||
_id: 'id', | ||
_createdDate: 'createdDate', | ||
_updatedDate: 'updatedDate' | ||
}, ignorePathsForKeyRenames), _domain.ConverterType.TO_JSON), _lodash.isUndefined); | ||
}, | ||
fromJSON(json) { | ||
fromJSON(json, ignorePathsForKeyRenames = []) { | ||
const deserialized = serialize(json, _domain.ConverterType.FROM_JSON); | ||
const fqdnTransformed = (0, _transformationHandler.transformFqdn)(deserialized, fqdnTransformation); | ||
return (0, _motionEdmAutogenTransformations.toCorvidEntity)((0, _motionEdmAutogenTransformations.transformResponseMessage)(fqdnTransformed, customTransformation, _motionEdmAutogenP13n.builtinCustomFunctions)); | ||
return (0, _renameAllNestedKeys.renameAllNestedKeys)((0, _motionEdmAutogenTransformations.transformResponseMessage)(fqdnTransformed, customTransformation, _motionEdmAutogenP13n.builtinCustomFunctions), { | ||
id: '_id', | ||
createdDate: '_createdDate', | ||
updatedDate: '_updatedDate' | ||
}, ignorePathsForKeyRenames); | ||
}, | ||
toJSON(veloPayload) { | ||
toJSON(veloPayload, ignorePathsForKeyRenames = []) { | ||
const deserialized = serialize(veloPayload, _domain.ConverterType.TO_JSON); | ||
return (0, _motionEdmAutogenTransformations.fromCorvidEntity)((0, _motionEdmAutogenTransformations.transformToRequestMessage)(deserialized, customTransformation, _motionEdmAutogenP13n.builtinCustomFunctions)); | ||
return (0, _renameAllNestedKeys.renameAllNestedKeys)((0, _motionEdmAutogenTransformations.transformToRequestMessage)(deserialized, customTransformation, _motionEdmAutogenP13n.builtinCustomFunctions), { | ||
_id: 'id', | ||
_createdDate: 'createdDate', | ||
_updatedDate: 'updatedDate' | ||
}, ignorePathsForKeyRenames); | ||
} | ||
@@ -53,0 +66,0 @@ }; |
@@ -11,3 +11,3 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
import { builtinCustomFunctions } from '@wix/motion-edm-autogen-p13n'; | ||
import { fromCorvidEntity, toCorvidEntity, transformResponseMessage, transformToRequestMessage, } from '@wix/motion-edm-autogen-transformations'; | ||
import { transformResponseMessage, transformToRequestMessage, } from '@wix/motion-edm-autogen-transformations'; | ||
import { ConverterType } from './serializer/domain'; | ||
@@ -21,2 +21,3 @@ import { protobufConverters } from './serializer/protobuf-converters/converters'; | ||
import { resolveQueryFieldsTransformationPaths } from './query-transformation'; | ||
import { renameAllNestedKeys } from './rename-all-nested-keys'; | ||
var converters = typeToConverterSet(__spreadArray(__spreadArray([], protobufConverters, true), veloConverters, true)); | ||
@@ -38,13 +39,28 @@ export { RootPath, resolveQueryFieldsTransformationPaths, transformError }; | ||
return { | ||
toAmbassadorRequest: function (userInputArgs) { | ||
return omitBy(serialize(fromCorvidEntity(transformToRequestMessage(userInputArgs, customTransformation, builtinCustomFunctions)), ConverterType.TO_JSON), isUndefined); | ||
toAmbassadorRequest: function (userInputArgs, ignorePathsForKeyRenames) { | ||
if (ignorePathsForKeyRenames === void 0) { ignorePathsForKeyRenames = []; } | ||
return omitBy(serialize(renameAllNestedKeys(transformToRequestMessage(userInputArgs, customTransformation, builtinCustomFunctions), { | ||
_id: 'id', | ||
_createdDate: 'createdDate', | ||
_updatedDate: 'updatedDate', | ||
}, ignorePathsForKeyRenames), ConverterType.TO_JSON), isUndefined); | ||
}, | ||
fromJSON: function (json) { | ||
fromJSON: function (json, ignorePathsForKeyRenames) { | ||
if (ignorePathsForKeyRenames === void 0) { ignorePathsForKeyRenames = []; } | ||
var deserialized = serialize(json, ConverterType.FROM_JSON); | ||
var fqdnTransformed = transformFqdn(deserialized, fqdnTransformation); | ||
return toCorvidEntity(transformResponseMessage(fqdnTransformed, customTransformation, builtinCustomFunctions)); | ||
return renameAllNestedKeys(transformResponseMessage(fqdnTransformed, customTransformation, builtinCustomFunctions), { | ||
id: '_id', | ||
createdDate: '_createdDate', | ||
updatedDate: '_updatedDate', | ||
}, ignorePathsForKeyRenames); | ||
}, | ||
toJSON: function (veloPayload) { | ||
toJSON: function (veloPayload, ignorePathsForKeyRenames) { | ||
if (ignorePathsForKeyRenames === void 0) { ignorePathsForKeyRenames = []; } | ||
var deserialized = serialize(veloPayload, ConverterType.TO_JSON); | ||
return fromCorvidEntity(transformToRequestMessage(deserialized, customTransformation, builtinCustomFunctions)); | ||
return renameAllNestedKeys(transformToRequestMessage(deserialized, customTransformation, builtinCustomFunctions), { | ||
_id: 'id', | ||
_createdDate: 'createdDate', | ||
_updatedDate: 'updatedDate', | ||
}, ignorePathsForKeyRenames); | ||
}, | ||
@@ -51,0 +67,0 @@ }; |
{ | ||
"metro-runtime.js": "https://static.parastorage.com/services/metro-runtime/67d0febf65343f857beabb84d32cb8d243d6a344e8093d4542ec189b/metro-runtime.umd.js" | ||
"metro-runtime.js": "https://static.parastorage.com/services/metro-runtime/793fefd27dac7bb945d76db3fa7f67ed8a8d458a50424af118bdb8b3/metro-runtime.umd.js" | ||
} |
{ | ||
"metro-runtime.js": "https://static.parastorage.com/services/metro-runtime/67d0febf65343f857beabb84d32cb8d243d6a344e8093d4542ec189b/metro-runtime.umd.min.js" | ||
"metro-runtime.js": "https://static.parastorage.com/services/metro-runtime/793fefd27dac7bb945d76db3fa7f67ed8a8d458a50424af118bdb8b3/metro-runtime.umd.min.js" | ||
} |
@@ -27,5 +27,5 @@ import { Payload } from './serializer/domain'; | ||
export declare function serializer({ rootSchema, depSchemas, fqdnTransformation, customTransformation, }: SerializerParams): { | ||
toAmbassadorRequest(userInputArgs: any[]): Payload; | ||
fromJSON(json: Payload): Payload; | ||
toJSON(veloPayload: Payload): Payload; | ||
toAmbassadorRequest(userInputArgs: any[], ignorePathsForKeyRenames?: string[]): Payload; | ||
fromJSON(json: Payload, ignorePathsForKeyRenames?: string[]): Payload; | ||
toJSON(veloPayload: Payload, ignorePathsForKeyRenames?: string[]): Payload; | ||
}; |
{ | ||
"name": "@wix/metro-runtime", | ||
"version": "1.1536.0", | ||
"version": "1.1537.0", | ||
"license": "UNLICENSED", | ||
@@ -116,3 +116,3 @@ "author": { | ||
}, | ||
"falconPackageHash": "a6b526c4169e4ba5dda9cf7a21578a4b38c63bad79d970d3ee17d4a3" | ||
"falconPackageHash": "76cb5ce9095032fec4ae61f07090d5704992bb66eb3ec4fe3406a82e" | ||
} |
import { builtinCustomFunctions } from '@wix/motion-edm-autogen-p13n'; | ||
import { | ||
fromCorvidEntity, | ||
toCorvidEntity, | ||
transformResponseMessage, | ||
@@ -21,2 +19,3 @@ transformToRequestMessage, | ||
import { resolveQueryFieldsTransformationPaths } from './query-transformation'; | ||
import { renameAllNestedKeys } from './rename-all-nested-keys'; | ||
@@ -71,6 +70,9 @@ const converters = typeToConverterSet([ | ||
return { | ||
toAmbassadorRequest(userInputArgs: any[]): Payload { | ||
toAmbassadorRequest( | ||
userInputArgs: any[], | ||
ignorePathsForKeyRenames: string[] = [], | ||
): Payload { | ||
return omitBy( | ||
serialize( | ||
fromCorvidEntity( | ||
renameAllNestedKeys( | ||
transformToRequestMessage( | ||
@@ -81,2 +83,8 @@ userInputArgs, | ||
), | ||
{ | ||
_id: 'id', | ||
_createdDate: 'createdDate', | ||
_updatedDate: 'updatedDate', | ||
}, | ||
ignorePathsForKeyRenames, | ||
), | ||
@@ -89,3 +97,3 @@ ConverterType.TO_JSON, | ||
fromJSON(json: Payload): Payload { | ||
fromJSON(json: Payload, ignorePathsForKeyRenames: string[] = []): Payload { | ||
const deserialized = serialize(json, ConverterType.FROM_JSON); | ||
@@ -95,3 +103,3 @@ | ||
return toCorvidEntity( | ||
return renameAllNestedKeys( | ||
transformResponseMessage( | ||
@@ -102,9 +110,18 @@ fqdnTransformed, | ||
), | ||
{ | ||
id: '_id', | ||
createdDate: '_createdDate', | ||
updatedDate: '_updatedDate', | ||
}, | ||
ignorePathsForKeyRenames, | ||
); | ||
}, | ||
toJSON(veloPayload: Payload): Payload { | ||
toJSON( | ||
veloPayload: Payload, | ||
ignorePathsForKeyRenames: string[] = [], | ||
): Payload { | ||
const deserialized = serialize(veloPayload, ConverterType.TO_JSON); | ||
return fromCorvidEntity( | ||
return renameAllNestedKeys( | ||
transformToRequestMessage( | ||
@@ -115,2 +132,8 @@ deserialized, | ||
), | ||
{ | ||
_id: 'id', | ||
_createdDate: 'createdDate', | ||
_updatedDate: 'updatedDate', | ||
}, | ||
ignorePathsForKeyRenames, | ||
); | ||
@@ -117,0 +140,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4370294
258
39007