@wix/motion-edm-autogen-transformations-core 1.48.0 → 1.50.0

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.
Files changed (32) hide show
  1. package/dist/cjs/__tests__/corvid-entity.spec.js.map +1 -1
  2. package/dist/cjs/__tests__/getArgumentCardinality.spec.js.map +1 -1
  3. package/dist/cjs/__tests__/helpers.spec.js.map +1 -1
  4. package/dist/cjs/__tests__/reduceTransformation.spec.js.map +1 -1
  5. package/dist/cjs/__tests__/transformations/custom-functions.spec.js.map +1 -1
  6. package/dist/cjs/__tests__/transformations/preset/create-transformation.spec.js.map +1 -1
  7. package/dist/cjs/__tests__/transformations/preset/delete-transformation.spec.js.map +1 -1
  8. package/dist/cjs/__tests__/transformations/preset/get-transformation.spec.js.map +1 -1
  9. package/dist/cjs/__tests__/transformations/preset/list-transformation.spec.js.map +1 -1
  10. package/dist/cjs/__tests__/transformations/preset/query-transformation.spec.js.map +1 -1
  11. package/dist/cjs/__tests__/transformations/preset/update-transformation.spec.js.map +1 -1
  12. package/dist/cjs/__tests__/validations/validateRequestTransformation.spec.js.map +1 -1
  13. package/dist/cjs/__tests__/validations/validateResponseTransformation.spec.js.map +1 -1
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/cjs/lib/corvid-entity/index.js.map +1 -1
  16. package/dist/cjs/lib/getArgumentCardinality.js.map +1 -1
  17. package/dist/cjs/lib/helpers.js.map +1 -1
  18. package/dist/cjs/lib/transformations/common.js.map +1 -1
  19. package/dist/cjs/lib/transformations/constants.js.map +1 -1
  20. package/dist/cjs/lib/transformations/custom-functions.js.map +1 -1
  21. package/dist/cjs/lib/transformations/preset/create.js.map +1 -1
  22. package/dist/cjs/lib/transformations/preset/delete.js.map +1 -1
  23. package/dist/cjs/lib/transformations/preset/get.js.map +1 -1
  24. package/dist/cjs/lib/transformations/preset/list.js.map +1 -1
  25. package/dist/cjs/lib/transformations/preset/query.js.map +1 -1
  26. package/dist/cjs/lib/transformations/preset/update.js.map +1 -1
  27. package/dist/cjs/lib/transformations/reduceTransformation.js.map +1 -1
  28. package/dist/cjs/lib/transformations/validations/common.js.map +1 -1
  29. package/dist/cjs/lib/transformations/validations/validateRequestTransformation.js.map +1 -1
  30. package/dist/cjs/lib/transformations/validations/validateResponseTransformation.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_","_corvidEntity","toCorvidName","fromCorvidName","corvidEntities","describe","test","each","name","expected","expect","toStrictEqual","aString","nonReservedName","reservedCorvidName","aRandomItemFrom","isReservedCorvidFieldName","toBeTruthy","toBeFalsy","commonReservedName","isReservedCommonFieldName"],"sources":["../../../src/__tests__/corvid-entity.spec.ts"],"sourcesContent":["import { aRandomItemFrom, aString } from '@wix/motion-runtime-test-context';\n\nimport { corvidEntities } from '..';\nimport {\n isReservedCommonFieldName,\n isReservedCorvidFieldName,\n} from '../lib/corvid-entity';\n\nconst { toCorvidName, fromCorvidName } = corvidEntities;\n\ndescribe('corvid entities transformers', () => {\n describe('toCorvidName', () => {\n test.each`\n name | expected\n ${'id'} | ${'_id'}\n ${'createdDate'} | ${'_createdDate'}\n ${'updatedDate'} | ${'_updatedDate'}\n `('adjusts $name to $expected', ({ name, expected }) => {\n expect(toCorvidName(name)).toStrictEqual(expected);\n });\n\n test('returns the given name when it should not be changed', () => {\n const name = aString();\n\n expect(toCorvidName(name)).toStrictEqual(name);\n });\n });\n\n describe('fromCorvidName', () => {\n test.each`\n name | expected\n ${'_id'} | ${'id'}\n ${'_createdDate'} | ${'createdDate'}\n ${'_updatedDate'} | ${'updatedDate'}\n `('adjusts $name to $expected', ({ name, expected }) => {\n expect(fromCorvidName(name)).toStrictEqual(expected);\n });\n\n test('returns the given name when it should not be changed', () => {\n const name = aString();\n\n expect(fromCorvidName(name)).toStrictEqual(name);\n });\n });\n\n describe('internal methods', () => {\n const nonReservedName = aString();\n\n describe('isReservedCorvidFieldName', () => {\n test('returns true if the provided name is a reserved Corvid field-name', () => {\n const reservedCorvidName = aRandomItemFrom([\n '_id',\n '_createdDate',\n '_updatedDate',\n ]);\n\n expect(isReservedCorvidFieldName(reservedCorvidName)).toBeTruthy();\n });\n\n test('returns false if the provided name is not a reserved common field-name', () => {\n expect(isReservedCorvidFieldName(nonReservedName)).toBeFalsy();\n });\n });\n\n describe('isReservedCommonFieldName', () => {\n test('returns true if the provided name is a reserved common field-name', () => {\n const commonReservedName = aRandomItemFrom([\n 'id',\n 'createdDate',\n 'updatedDate',\n ]);\n\n expect(isReservedCommonFieldName(commonReservedName)).toBeTruthy();\n });\n\n test('returns false if the provided name is not a reserved common field-name', () => {\n expect(isReservedCommonFieldName(nonReservedName)).toBeFalsy();\n });\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAKA,MAAM;EAAEG,YAAY;EAAEC;AAAe,CAAC,GAAGC,gBAAc;AAEvDC,QAAQ,CAAC,8BAA8B,EAAE,MAAM;EAC7CA,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC7BC,IAAI,CAACC,IAAK;AACd;AACA,QAAQ,IAAK,eAAc,KAAM;AACjC,QAAQ,aAAc,MAAK,cAAe;AAC1C,QAAQ,aAAc,MAAK,cAAe;AAC1C,KAAK,CAAC,4BAA4B,EAAE,CAAC;MAAEC,IAAI;MAAEC;IAAS,CAAC,KAAK;MACtDC,MAAM,CAACR,YAAY,CAACM,IAAI,CAAC,CAAC,CAACG,aAAa,CAACF,QAAQ,CAAC;IACpD,CAAC,CAAC;IAEFH,IAAI,CAAC,sDAAsD,EAAE,MAAM;MACjE,MAAME,IAAI,GAAG,IAAAI,iCAAO,EAAC,CAAC;MAEtBF,MAAM,CAACR,YAAY,CAACM,IAAI,CAAC,CAAC,CAACG,aAAa,CAACH,IAAI,CAAC;I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AAJ,yCAAe,EAAC,CACzC,IAAI,EACJ,aAAa,EACb,aAAa,CACd,CAAC;QAEFL,MAAM,CAAC,IAAAU,uCAAyB,EAACD,kBAAkB,CAAC,CAAC,CAACF,UAAU,CAAC,CAAC;MACpE,CAAC,CAAC;MAEFX,IAAI,CAAC,wEAAwE,EAAE,MAAM;QACnFI,MAAM,CAAC,IAAAU,uCAAyB,EAACP,eAAe,CAAC,CAAC,CAACK,SAAS,CAAC,CAAC;MAChE,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_","_corvidEntity","toCorvidName","fromCorvidName","corvidEntities","describe","test","each","name","expected","expect","toStrictEqual","aString","nonReservedName","reservedCorvidName","aRandomItemFrom","isReservedCorvidFieldName","toBeTruthy","toBeFalsy","commonReservedName","isReservedCommonFieldName"],"sources":["../../../src/__tests__/corvid-entity.spec.ts"],"sourcesContent":["import { aRandomItemFrom, aString } from '@wix/motion-runtime-test-context';\n\nimport { corvidEntities } from '..';\nimport {\n isReservedCommonFieldName,\n isReservedCorvidFieldName,\n} from '../lib/corvid-entity';\n\nconst { toCorvidName, fromCorvidName } = corvidEntities;\n\ndescribe('corvid entities transformers', () => {\n describe('toCorvidName', () => {\n test.each`\n name | expected\n ${'id'} | ${'_id'}\n ${'createdDate'} | ${'_createdDate'}\n ${'updatedDate'} | ${'_updatedDate'}\n `('adjusts $name to $expected', ({ name, expected }) => {\n expect(toCorvidName(name)).toStrictEqual(expected);\n });\n\n test('returns the given name when it should not be changed', () => {\n const name = aString();\n\n expect(toCorvidName(name)).toStrictEqual(name);\n });\n });\n\n describe('fromCorvidName', () => {\n test.each`\n name | expected\n ${'_id'} | ${'id'}\n ${'_createdDate'} | ${'createdDate'}\n ${'_updatedDate'} | ${'updatedDate'}\n `('adjusts $name to $expected', ({ name, expected }) => {\n expect(fromCorvidName(name)).toStrictEqual(expected);\n });\n\n test('returns the given name when it should not be changed', () => {\n const name = aString();\n\n expect(fromCorvidName(name)).toStrictEqual(name);\n });\n });\n\n describe('internal methods', () => {\n const nonReservedName = aString();\n\n describe('isReservedCorvidFieldName', () => {\n test('returns true if the provided name is a reserved Corvid field-name', () => {\n const reservedCorvidName = aRandomItemFrom([\n '_id',\n '_createdDate',\n '_updatedDate',\n ]);\n\n expect(isReservedCorvidFieldName(reservedCorvidName)).toBeTruthy();\n });\n\n test('returns false if the provided name is not a reserved common field-name', () => {\n expect(isReservedCorvidFieldName(nonReservedName)).toBeFalsy();\n });\n });\n\n describe('isReservedCommonFieldName', () => {\n test('returns true if the provided name is a reserved common field-name', () => {\n const commonReservedName = aRandomItemFrom([\n 'id',\n 'createdDate',\n 'updatedDate',\n ]);\n\n expect(isReservedCommonFieldName(commonReservedName)).toBeTruthy();\n });\n\n test('returns false if the provided name is not a reserved common field-name', () => {\n expect(isReservedCommonFieldName(nonReservedName)).toBeFalsy();\n });\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAKA,MAAM;EAAEG,YAAY;EAAEC;AAAe,CAAC,GAAGC,gBAAc;AAEvDC,QAAQ,CAAC,8BAA8B,EAAE,MAAM;EAC7CA,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC7BC,IAAI,CAACC,IAAI;AACb;AACA,QAAQ,IAAI,eAAe,KAAK;AAChC,QAAQ,aAAa,MAAM,cAAc;AACzC,QAAQ,aAAa,MAAM,cAAc;AACzC,KAAK,CAAC,4BAA4B,EAAE,CAAC;MAAEC,IAAI;MAAEC;IAAS,CAAC,KAAK;MACtDC,MAAM,CAACR,YAAY,CAACM,IAAI,CAAC,CAAC,CAACG,aAAa,CAACF,QAAQ,CAAC;IACpD,CAAC,CAAC;IAEFH,IAAI,CAAC,sDAAsD,EAAE,MAAM;MACjE,MAAME,IAAI,GAAG,IAAAI,iCAAO,EAA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2B,EAAE,MAAM;MAC1CC,IAAI,CAAC,mEAAmE,EAAE,MAAM;QAC9E,MAAMa,kBAAkB,GAAG,IAAAJ,yCAAe,EAAC,CACzC,IAAI,EACJ,aAAa,EACb,aAAa,CACd,CAAC;QAEFL,MAAM,CAAC,IAAAU,uCAAyB,EAACD,kBAAkB,CAAC,CAAC,CAACF,UAAU,CAAC,CAAC;MACpE,CAAC,CAAC;MAEFX,IAAI,CAAC,wEAAwE,EAAE,MAAM;QACnFI,MAAM,CAAC,IAAAU,uCAAyB,EAACP,eAAe,CAAC,CAAC,CAACK,SAAS,CAAC,CAAC;MAChE,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_","describe","simpleTransformation","aNumber","min","max","aString","expect","getArgumentCardinality","toStrictEqual","nonArgumentMapping","anObject","argumentMapping","argumentMappingArray","test","complexMappingTransformation","specialTransformation"],"sources":["../../../src/__tests__/getArgumentCardinality.spec.ts"],"sourcesContent":["import { anObject, aNumber, aString } from '@wix/motion-runtime-test-context';\n\nimport { getArgumentCardinality } from '..';\n\ndescribe('getArgumentCardinality', () => {\n describe('simple transformation', () => {\n const simpleTransformation = `$[${aNumber({\n min: 0,\n max: 9,\n })}].${aString()}`;\n\n expect(getArgumentCardinality(simpleTransformation)).toStrictEqual(1);\n });\n\n describe('complex transformations', () => {\n const nonArgumentMapping = anObject();\n\n const argumentMapping = {\n [aString()]: '$[0].abc',\n [aString()]: '$[1].id',\n [aString()]: '$[2].a',\n [aString()]: '$[3].a.b.c',\n ...nonArgumentMapping,\n };\n\n const argumentMappingArray = ['$[0].a', '$[1].b', 'a.b.c'];\n\n test('counts the number of arguments referenced in a given transformation object', () => {\n const complexMappingTransformation = {\n ...nonArgumentMapping,\n ...argumentMapping,\n };\n\n expect(\n getArgumentCardinality(complexMappingTransformation),\n ).toStrictEqual(4);\n });\n\n test('counts the number of arguments referenced in a transformation object with arrays', () => {\n const complexMappingTransformation = {\n ...nonArgumentMapping,\n [aString()]: argumentMappingArray,\n };\n\n expect(\n getArgumentCardinality(complexMappingTransformation),\n ).toStrictEqual(2);\n });\n\n test('counts only unique occurrences', () => {\n const complexMappingTransformation = {\n ...nonArgumentMapping,\n ...argumentMapping,\n [aString()]: argumentMappingArray,\n };\n\n expect(\n getArgumentCardinality(complexMappingTransformation),\n ).toStrictEqual(4);\n });\n\n test('does not fail on special transformation cases', () => {\n const specialTransformation = {\n [aString()]: { '@constant': true },\n [aString()]: { '@constant': null },\n [aString()]: '$[0].a.b.c.',\n };\n\n expect(getArgumentCardinality(specialTransformation)).toStrictEqual(1);\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AAEAE,QAAQ,CAAC,wBAAwB,EAAE,MAAM;EACvCA,QAAQ,CAAC,uBAAuB,EAAE,MAAM;IACtC,MAAMC,oBAAoB,GAAI,KAAI,IAAAC,iCAAO,EAAC;MACxCC,GAAG,EAAE,CAAC;MACNC,GAAG,EAAE;IACP,CAAC,CAAE,KAAI,IAAAC,iCAAO,EAAC,CAAE,EAAC;IAElBC,MAAM,CAAC,IAAAC,wBAAsB,EAACN,oBAAoB,CAAC,CAAC,CAACO,aAAa,CAAC,CAAC,CAAC;EACvE,CAAC,CAAC;EAEFR,QAAQ,CAAC,yBAAyB,EAAE,MAAM;IACxC,MAAMS,kBAAkB,GAAG,IAAAC,kCAAQ,EAAC,CAAC;IAErC,MAAMC,eAAe,GAAG;MACtB,CAAC,IAAAN,iCAAO,EAAC,CAAC,GAAG,UAAU;MACvB,CAAC,IAAAA,iCAAO,EAAC,CAAC,GAAG,SAAS;MACtB,CAAC,IAAAA,iCAAO,EAAC,CAAC,GAAG,QAAQ;MACrB,CAAC,IAAAA,iCAAO,EAAC,CAAC,GAAG,YAAY;MACzB,GAAGI;IACL,CAAC;IAED,MAAMG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AAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_","describe","simpleTransformation","aNumber","min","max","aString","expect","getArgumentCardinality","toStrictEqual","nonArgumentMapping","anObject","argumentMapping","argumentMappingArray","test","complexMappingTransformation","specialTransformation"],"sources":["../../../src/__tests__/getArgumentCardinality.spec.ts"],"sourcesContent":["import { anObject, aNumber, aString } from '@wix/motion-runtime-test-context';\n\nimport { getArgumentCardinality } from '..';\n\ndescribe('getArgumentCardinality', () => {\n describe('simple transformation', () => {\n const simpleTransformation = `$[${aNumber({\n min: 0,\n max: 9,\n })}].${aString()}`;\n\n expect(getArgumentCardinality(simpleTransformation)).toStrictEqual(1);\n });\n\n describe('complex transformations', () => {\n const nonArgumentMapping = anObject();\n\n const argumentMapping = {\n [aString()]: '$[0].abc',\n [aString()]: '$[1].id',\n [aString()]: '$[2].a',\n [aString()]: '$[3].a.b.c',\n ...nonArgumentMapping,\n };\n\n const argumentMappingArray = ['$[0].a', '$[1].b', 'a.b.c'];\n\n test('counts the number of arguments referenced in a given transformation object', () => {\n const complexMappingTransformation = {\n ...nonArgumentMapping,\n ...argumentMapping,\n };\n\n expect(\n getArgumentCardinality(complexMappingTransformation),\n ).toStrictEqual(4);\n });\n\n test('counts the number of arguments referenced in a transformation object with arrays', () => {\n const complexMappingTransformation = {\n ...nonArgumentMapping,\n [aString()]: argumentMappingArray,\n };\n\n expect(\n getArgumentCardinality(complexMappingTransformation),\n ).toStrictEqual(2);\n });\n\n test('counts only unique occurrences', () => {\n const complexMappingTransformation = {\n ...nonArgumentMapping,\n ...argumentMapping,\n [aString()]: argumentMappingArray,\n };\n\n expect(\n getArgumentCardinality(complexMappingTransformation),\n ).toStrictEqual(4);\n });\n\n test('does not fail on special transformation cases', () => {\n const specialTransformation = {\n [aString()]: { '@constant': true },\n [aString()]: { '@constant': null },\n [aString()]: '$[0].a.b.c.',\n };\n\n expect(getArgumentCardinality(specialTransformation)).toStrictEqual(1);\n });\n });\n});\n"],"mappings":";;AAAA,I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ACO,4BAA4B,CACrD,CAAC,CAACN,aAAa,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC;IAEFK,IAAI,CAAC,gCAAgC,EAAE,MAAM;MAC3C,MAAMC,4BAA4B,GAAG;QACnC,GAAGL,kBAAkB;QACrB,GAAGE,eAAe;QAClB,CAAC,IAAAN,iCAAO,EAAC,CAAC,GAAGO;MACf,CAAC;MAEDN,MAAM,CACJ,IAAAC,wBAAsB,EAACO,4BAA4B,CACrD,CAAC,CAACN,aAAa,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC;IAEFK,IAAI,CAAC,+CAA+C,EAAE,MAAM;MAC1D,MAAME,qBAAqB,GAAG;QAC5B,CAAC,IAAAV,iCAAO,EAAC,CAAC,GAAG;UAAE,WAAW,EAAE;QAAK,CAAC;QAClC,CAAC,IAAAA,iCAAO,EAAC,CAAC,GAAG;UAAE,WAAW,EAAE;QAAK,CAAC;QAClC,CAAC,IAAAA,iCAAO,EAAC,CAAC,GAAG;MACf,CAAC;MAEDC,MAAM,CAAC,IAAAC,wBAAsB,EAACQ,qBAAqB,CAAC,CAAC,CAACP,aAAa,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionEdmAutogenTestContext","require","_motionRuntimeTestContext","_lodash","_helpers","describe","index","aNumber","min","max","nestedPath","times","aString","join","simpleTransformation","simpleTransformationWithNestedPath","test","each","aSimpleMappingTransformation","simpleMapping","aComplexMappingTransformation","complexMapping","transformation","expectedValue","expect","isSimpleTransformation","toStrictEqual","extractIndexAndPath","getArgumentIndex","toBeNull","aRandomJsonPath","expression","expectedResult","isJsonPathExpression","nonJsonPathString","jsonPath","aRandomResponseTransformationJsonPath","slice","stripJsonPathRootPrefix","isInvalidJsonValue","toBeTruthy","toBeFalsy"],"sources":["../../../src/__tests__/helpers.spec.ts"],"sourcesContent":["import {\n aComplexMappingTransformation,\n aRandomJsonPath,\n aRandomResponseTransformationJsonPath,\n aSimpleMappingTransformation,\n} from '@wix/motion-edm-autogen-test-context';\nimport { aNumber, aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport {\n extractIndexAndPath,\n getArgumentIndex,\n isInvalidJsonValue,\n isJsonPathExpression,\n isSimpleTransformation,\n stripJsonPathRootPrefix,\n} from '../lib/helpers';\n\ndescribe('helper functions', () => {\n const index = aNumber({ min: 0, max: 1 });\n // @ts-expect-error\n const nestedPath = times(3, aString()).join('.');\n const simpleTransformation = `$[${index}]`;\n const simpleTransformationWithNestedPath = `$[${index}].${nestedPath}`;\n\n describe('isSimpleTransformation', () => {\n test.each`\n transformation | expectedValue | transformationType\n ${aSimpleMappingTransformation().simpleMapping} | ${true} | ${'simple'}\n ${aComplexMappingTransformation().complexMapping} | ${false} | ${'complex'}\n `(\n 'returns $expectedValue for $transformationType transformation',\n ({ transformation, expectedValue }) => {\n expect(isSimpleTransformation(transformation)).toStrictEqual(\n expectedValue,\n );\n },\n );\n });\n\n describe('extractIndexAndPath', () => {\n test('extracts the index and nested-path of the argument from a simple tranformation', () => {\n expect(\n extractIndexAndPath(simpleTransformationWithNestedPath),\n ).toStrictEqual({ index, nestedPath });\n });\n\n test('sets the nestedPath to null when one could not be found', () => {\n expect(extractIndexAndPath(simpleTransformation)).toStrictEqual({\n index,\n nestedPath: null,\n });\n });\n });\n\n describe('getArgumentIndex', () => {\n test('extracts the index of an argument within a jsonpath', () => {\n expect(getArgumentIndex(simpleTransformation)).toStrictEqual(index);\n });\n\n test('return null when no index was found', () => {\n expect(getArgumentIndex(aString())).toBeNull();\n });\n });\n\n describe('isJsonPathExpression', () => {\n test.each`\n description | expression | expectedResult\n ${'starts with $'} | ${aRandomJsonPath()} | ${true}\n ${'does not start with $'} | ${aString()} | ${false}\n `(\n 'return $expectedResult when the expression $description',\n ({ expression, expectedResult }) => {\n expect(isJsonPathExpression(expression)).toStrictEqual(expectedResult);\n },\n );\n });\n\n describe('stripJsonPathRootPrefix', () => {\n const nonJsonPathString = aString();\n const jsonPath = aRandomResponseTransformationJsonPath();\n\n test.each`\n description | expression | expectedResult\n ${'is $'} | ${'$'} | ${'$'}\n ${'does not start with $'} | ${nonJsonPathString} | ${nonJsonPathString}\n ${'starts with $.'} | ${jsonPath} | ${jsonPath.slice(2)}\n `(\n 'return $expectedResult when the expression $description',\n ({ expression, expectedResult }) => {\n expect(stripJsonPathRootPrefix(expression)).toStrictEqual(\n expectedResult,\n );\n },\n );\n });\n\n describe('isInvalidJsonValue', () => {\n test('returns true for an invalid json-value', () => {\n expect(isInvalidJsonValue('x-y-z')).toBeTruthy();\n });\n\n test('returns false for a valid json-value', () => {\n expect(isInvalidJsonValue('\"string\"')).toBeFalsy();\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AAMA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AASAI,QAAQ,CAAC,kBAAkB,EAAE,MAAM;EACjC,MAAMC,KAAK,GAAG,IAAAC,iCAAO,EAAC;IAAEC,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE;EAAE,CAAC,CAAC;EACzC;EACA,MAAMC,UAAU,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAE,IAAAC,iCAAO,EAAC,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAChD,MAAMC,oBAAoB,GAAI,KAAIR,KAAM,GAAE;EAC1C,MAAMS,kCAAkC,GAAI,KAAIT,KAAM,KAAII,UAAW,EAAC;EAEtEL,QAAQ,CAAC,wBAAwB,EAAE,MAAM;IACvCW,IAAI,CAACC,IAAK;AACd;AACA,QAAQ,IAAAC,yDAA4B,EAAC,CAAC,CAACC,aAAc,QAAO,IAAK,YAAW,QAAS;AACrF,QAAQ,IAAAC,0DAA6B,EAAC,CAAC,CAACC,cAAe,MAAK,KAAM,WAAU,SAAU;AAC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EACzD,CAAC;MAAEmB,UAAU;MAAEC;IAAe,CAAC,KAAK;MAClCR,MAAM,CAAC,IAAAS,6BAAoB,EAACF,UAAU,CAAC,CAAC,CAACL,aAAa,CAACM,cAAc,CAAC;IACxE,CACF,CAAC;EACH,CAAC,CAAC;EAEF3B,QAAQ,CAAC,yBAAyB,EAAE,MAAM;IACxC,MAAM6B,iBAAiB,GAAG,IAAAtB,iCAAO,EAAC,CAAC;IACnC,MAAMuB,QAAQ,GAAG,IAAAC,kEAAqC,EAAC,CAAC;IAExDpB,IAAI,CAACC,IAAK;AACd;AACA,QAAQ,MAAO,uBAAsB,GAAI,oBAAmB,GAAI;AAChE,QAAQ,uBAAwB,MAAKiB,iBAAkB,MAAKA,iBAAkB;AAC9E,QAAQ,gBAAiB,aAAYC,QAAS,eAAcA,QAAQ,CAACE,KAAK,CAAC,CAAC,CAAE;AAC9E,KAAK,CACC,yDAAyD,EACzD,CAAC;MAAEN,UAAU;MAAEC;IAAe,CAAC,KAAK;MAClCR,MAAM,CAAC,IAAAc,gCAAuB,EAACP,UAAU,CAAC,CAAC,CAACL,aAAa,CACvDM,cACF,CAAC;IACH,CACF,CAAC;EACH,CAAC,CAAC;EAEF3B,QAAQ,CAAC,oBAAoB,EAAE,MAAM;IACnCW,IAAI,CAAC,wCAAwC,EAAE,MAAM;MACnDQ,MAAM,CAAC,IAAAe,2BAAkB,EAAC,OAAO,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IAClD,CAAC,CAAC;IAEFxB,IAAI,CAAC,sCAAsC,EAAE,MAAM;MACjDQ,MAAM,CAAC,IAAAe,2BAAkB,EAAC,UAAU,CAAC,CAAC,CAACE,SAAS,CAAC,CAAC;IACpD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionEdmAutogenTestContext","require","_motionRuntimeTestContext","_lodash","_helpers","describe","index","aNumber","min","max","nestedPath","times","aString","join","simpleTransformation","simpleTransformationWithNestedPath","test","each","aSimpleMappingTransformation","simpleMapping","aComplexMappingTransformation","complexMapping","transformation","expectedValue","expect","isSimpleTransformation","toStrictEqual","extractIndexAndPath","getArgumentIndex","toBeNull","aRandomJsonPath","expression","expectedResult","isJsonPathExpression","nonJsonPathString","jsonPath","aRandomResponseTransformationJsonPath","slice","stripJsonPathRootPrefix","isInvalidJsonValue","toBeTruthy","toBeFalsy"],"sources":["../../../src/__tests__/helpers.spec.ts"],"sourcesContent":["import {\n aComplexMappingTransformation,\n aRandomJsonPath,\n aRandomResponseTransformationJsonPath,\n aSimpleMappingTransformation,\n} from '@wix/motion-edm-autogen-test-context';\nimport { aNumber, aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport {\n extractIndexAndPath,\n getArgumentIndex,\n isInvalidJsonValue,\n isJsonPathExpression,\n isSimpleTransformation,\n stripJsonPathRootPrefix,\n} from '../lib/helpers';\n\ndescribe('helper functions', () => {\n const index = aNumber({ min: 0, max: 1 });\n // @ts-expect-error\n const nestedPath = times(3, aString()).join('.');\n const simpleTransformation = `$[${index}]`;\n const simpleTransformationWithNestedPath = `$[${index}].${nestedPath}`;\n\n describe('isSimpleTransformation', () => {\n test.each`\n transformation | expectedValue | transformationType\n ${aSimpleMappingTransformation().simpleMapping} | ${true} | ${'simple'}\n ${aComplexMappingTransformation().complexMapping} | ${false} | ${'complex'}\n `(\n 'returns $expectedValue for $transformationType transformation',\n ({ transformation, expectedValue }) => {\n expect(isSimpleTransformation(transformation)).toStrictEqual(\n expectedValue,\n );\n },\n );\n });\n\n describe('extractIndexAndPath', () => {\n test('extracts the index and nested-path of the argument from a simple tranformation', () => {\n expect(\n extractIndexAndPath(simpleTransformationWithNestedPath),\n ).toStrictEqual({ index, nestedPath });\n });\n\n test('sets the nestedPath to null when one could not be found', () => {\n expect(extractIndexAndPath(simpleTransformation)).toStrictEqual({\n index,\n nestedPath: null,\n });\n });\n });\n\n describe('getArgumentIndex', () => {\n test('extracts the index of an argument within a jsonpath', () => {\n expect(getArgumentIndex(simpleTransformation)).toStrictEqual(index);\n });\n\n test('return null when no index was found', () => {\n expect(getArgumentIndex(aString())).toBeNull();\n });\n });\n\n describe('isJsonPathExpression', () => {\n test.each`\n description | expression | expectedResult\n ${'starts with $'} | ${aRandomJsonPath()} | ${true}\n ${'does not start with $'} | ${aString()} | ${false}\n `(\n 'return $expectedResult when the expression $description',\n ({ expression, expectedResult }) => {\n expect(isJsonPathExpression(expression)).toStrictEqual(expectedResult);\n },\n );\n });\n\n describe('stripJsonPathRootPrefix', () => {\n const nonJsonPathString = aString();\n const jsonPath = aRandomResponseTransformationJsonPath();\n\n test.each`\n description | expression | expectedResult\n ${'is $'} | ${'$'} | ${'$'}\n ${'does not start with $'} | ${nonJsonPathString} | ${nonJsonPathString}\n ${'starts with $.'} | ${jsonPath} | ${jsonPath.slice(2)}\n `(\n 'return $expectedResult when the expression $description',\n ({ expression, expectedResult }) => {\n expect(stripJsonPathRootPrefix(expression)).toStrictEqual(\n expectedResult,\n );\n },\n );\n });\n\n describe('isInvalidJsonValue', () => {\n test('returns true for an invalid json-value', () => {\n expect(isInvalidJsonValue('x-y-z')).toBeTruthy();\n });\n\n test('returns false for a valid json-value', () => {\n expect(isInvalidJsonValue('\"string\"')).toBeFalsy();\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AAMA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AASAI,QAAQ,CAAC,kBAAkB,EAAE,MAAM;EACjC,MAAMC,KAAK,GAAG,IAAAC,iCAAO,EAAC;IAAEC,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE;EAAE,CAAC,CAAC;EACzC;EACA,MAAMC,UAAU,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAE,IAAAC,iCAAO,EAAC,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAChD,MAAMC,oBAAoB,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AC,CAAC;IAEFxB,IAAI,CAAC,sCAAsC,EAAE,MAAM;MACjDQ,MAAM,CAAC,IAAAe,2BAAkB,EAAC,UAAU,CAAC,CAAC,CAACE,SAAS,CAAC,CAAC;IACpD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_reduceTransformation","describe","visitorCallbackResult","aString","test","visitorCallback","jest","fn","mockReturnValueOnce","transformation","result","reduceTransformation","visitors","TopLevelSimpleTransformationExpression","expect","toHaveBeenCalledTimes","toHaveBeenCalledWith","toStrictEqual","TopLevelCustomFunctionExpression","transformationWithInvalidCustomFunctionExpression","TopLevelUnsupportedTransformationExpression","accumulator","anObject","a","b","c","d","e","NestedSimpleTransformationExpression","topLevelSpreadOperatorCallback","nestedSpreadOperatorCallback","times","argumentExpression","sibling","siblingKeys","Object","keys","path","beforeEach","forEach","mock","mockClear","nestedOmitCallback","omitExpression","TopLevelSpreadExpression","NestedOmit","NestedSpreadExpression","not","toHaveBeenCalled","set","simpleTransformationCallback","anotherArgumentExpression","topLevelArgumentExpression","customFunctionExpressionCallback","customFunctionExpression","CustomFunctionExpression","invalidCustomFunctionExpression","nestedConstantExpressionCallback","undesiredVisitor","someConst","NestedConstantValue","value","countAccumulator","count","unsupportedTransformationValue","NestedUnsupportedTransformationExpression","TopLevelMapArrayItems","withItemTransformation","itemTransformation","MapArrayItems","nestedSimpleTransformationVisitor","yyy","zzz","fieldsToOmit","sourcePathExpression","TopLevelOmit","each","visitorType","errorMessage","error","Error","mockImplementationOnce","toThrow"],"sources":["../../../src/__tests__/reduceTransformation.spec.ts"],"sourcesContent":["import { anObject, aString } from '@wix/motion-runtime-test-context';\nimport { set, times } from 'lodash';\n\nimport { reduceTransformation } from '../lib/transformations/reduceTransformation';\n\ndescribe('reduceTransformation', () => {\n describe('simple transformations', () => {\n const visitorCallbackResult = aString();\n\n test('traverses a simple transformation', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformation = '$.a.b.c';\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelSimpleTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith('$.a.b.c');\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n\n describe('custom-functions', () => {\n test('traverses a valid custom-function expression', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformation = '#someCustomFunction($.a.b.c,someOtherArg)';\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelCustomFunctionExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n 'someCustomFunction',\n ['$.a.b.c', 'someOtherArg'],\n transformation,\n );\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n\n test('does not fail for invalid custom-function expression', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformationWithInvalidCustomFunctionExpression = '#($.a.b.c)';\n\n const result = reduceTransformation(\n transformationWithInvalidCustomFunctionExpression,\n {\n visitors: {\n TopLevelCustomFunctionExpression: visitorCallback,\n },\n },\n );\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n null,\n null,\n transformationWithInvalidCustomFunctionExpression,\n );\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n });\n\n // TODO: replace with returning the invalid value, for constant-transformation\n test('invokes the TopLevelUnsupportedTransformationExpression otherwise', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n\n const transformation = aString();\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelUnsupportedTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(transformation);\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n });\n\n describe('complex transformation', () => {\n const accumulator = anObject();\n\n test('traverses all string nodes that are transformation expressions', () => {\n const visitorCallback = jest.fn();\n\n const transformation = {\n a: {\n b: { c: '$[0].ddd.eee.ffff' },\n d: 2,\n e: ['$.ggg', 3, 4, 5],\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSimpleTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(2);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b.c',\n '$[0].ddd.eee.ffff',\n );\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.e[0]',\n '$.ggg',\n );\n });\n\n describe('spread operator', () => {\n const [topLevelSpreadOperatorCallback, nestedSpreadOperatorCallback] =\n times(2, () => jest.fn());\n const argumentExpression = '$[1].d.e.f';\n const sibling = anObject();\n const siblingKeys = Object.keys(sibling);\n const path = `${siblingKeys[0]}.b.c`;\n\n beforeEach(() => {\n [topLevelSpreadOperatorCallback, nestedSpreadOperatorCallback].forEach(\n (mock) => mock.mockClear(),\n );\n });\n\n test('invokes the spread operator visitor prior to its children', () => {\n const nestedOmitCallback = jest.fn();\n const omitExpression = {\n '@source': argumentExpression,\n '@omit': times(2, () => aString()),\n };\n const transformation = { '*': omitExpression, ...sibling };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedOmit: nestedOmitCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n omitExpression,\n siblingKeys,\n );\n\n // expect(nestedOmitCallback).toHaveBeenCalled();\n });\n\n test('traverses top-level spread-operator transformation nodes', () => {\n const transformation = { '*': argumentExpression, ...sibling };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n argumentExpression,\n siblingKeys,\n );\n expect(nestedSpreadOperatorCallback).not.toHaveBeenCalled();\n });\n\n test('traverses nested spread-operator transformation nodes', () => {\n const transformation = set({}, path, {\n '*': argumentExpression,\n ...sibling,\n });\n const simpleTransformationCallback = jest.fn();\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).not.toHaveBeenCalled();\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n argumentExpression,\n siblingKeys,\n );\n });\n\n test('traverses items within an array of a spread-operator transformation nodes', () => {\n const simpleTransformationCallback = jest.fn();\n const transformation = set({}, path, {\n '*': ['$[0].x.y.z', '$[1].d.e.f'],\n ...sibling,\n });\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(2);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$[0].x.y.z',\n siblingKeys,\n );\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$[1].d.e.f',\n siblingKeys,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n\n test('sets the path to be the parent of the spread operator', () => {\n const anotherArgumentExpression = '$[0].x.y.z';\n const topLevelArgumentExpression = '$[1]';\n const transformation = set(\n { '*': topLevelArgumentExpression, ...sibling },\n path,\n {\n '*': [anotherArgumentExpression, argumentExpression],\n },\n );\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n },\n });\n\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(2);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n argumentExpression,\n [],\n );\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n anotherArgumentExpression,\n [],\n );\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n topLevelArgumentExpression,\n siblingKeys,\n );\n });\n });\n\n describe('custom functions', () => {\n test('traverses custom-function nodes', () => {\n const customFunctionExpressionCallback = jest.fn();\n const simpleTransformationCallback = jest.fn();\n const customFunctionExpression =\n '#someCustomFunction($[0].someCustomFunction)';\n const transformation = {\n a: {\n b: customFunctionExpression,\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n CustomFunctionExpression: customFunctionExpressionCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(customFunctionExpressionCallback).toHaveBeenCalledTimes(1);\n expect(customFunctionExpressionCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b',\n 'someCustomFunction',\n ['$[0].someCustomFunction'],\n customFunctionExpression,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n\n test('does not fail on invalid custom-function nodes', () => {\n const customFunctionExpressionCallback = jest.fn();\n const simpleTransformationCallback = jest.fn();\n const invalidCustomFunctionExpression = '#($[0].someCustomFunction)';\n\n const transformation = {\n a: {\n b: invalidCustomFunctionExpression,\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n CustomFunctionExpression: customFunctionExpressionCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(customFunctionExpressionCallback).toHaveBeenCalledTimes(1);\n expect(customFunctionExpressionCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b',\n null,\n null,\n invalidCustomFunctionExpression,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n });\n\n describe('constant annotation', () => {\n test('traverses a nested constant annotation expression', () => {\n const nestedConstantExpressionCallback = jest.fn();\n const undesiredVisitor = jest.fn();\n const transformation = {\n a: { b: { c: { '@constant': { someConst: '$.value123' } } } },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedConstantValue: nestedConstantExpressionCallback,\n NestedSimpleTransformationExpression: undesiredVisitor,\n },\n });\n\n expect(nestedConstantExpressionCallback).toHaveBeenCalledTimes(1);\n expect(nestedConstantExpressionCallback).toHaveBeenCalledWith({\n accumulator,\n path: 'a.b.c',\n value: { someConst: '$.value123' },\n });\n expect(undesiredVisitor).not.toHaveBeenCalled();\n });\n });\n\n test('returns the accumulator with changes made to it', () => {\n const countAccumulator = { count: 0 };\n\n const transformation = {\n a: {\n b: 1,\n '*': '$[0].a.b.c',\n },\n };\n\n const result = reduceTransformation(transformation, {\n accumulator: countAccumulator,\n visitors: {\n NestedSpreadExpression: () => {\n countAccumulator.count += 1;\n },\n },\n });\n\n expect(result).toStrictEqual({ count: 1 });\n });\n\n // TODO: replace with returning the invalid value, for constant-transformation\n test('invokes the NestedUnsupportedTransformationExpression otherwise', () => {\n const visitorCallback = jest.fn();\n const unsupportedTransformationValue = aString();\n const transformation = {\n a: { b: { c: unsupportedTransformationValue } },\n };\n\n reduceTransformation(transformation, {\n visitors: {\n NestedUnsupportedTransformationExpression: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b.c',\n unsupportedTransformationValue,\n );\n });\n });\n\n describe('mapping array items', () => {\n const visitorCallback = jest.fn();\n\n beforeEach(() => {\n visitorCallback.mockClear();\n });\n\n describe('top-level transformation', () => {\n test('invokes the TopLevelMapArrayItems visitor', () => {\n const transformation = {\n '@path': '$.d.e.f',\n '@itemTransformation': '$.g.h.i',\n };\n\n reduceTransformation(transformation, {\n visitors: {\n TopLevelMapArrayItems: visitorCallback,\n },\n accumulator: {},\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith('$.d.e.f', '$.g.h.i');\n });\n });\n\n describe('nested transformation', () => {\n const accumulator = {};\n const path = 'a.b.c';\n\n const withItemTransformation = (itemTransformation) =>\n set({}, path, {\n '@path': '$.d.e.f',\n '@itemTransformation': itemTransformation,\n });\n\n describe('simple item-transformation', () => {\n test('invokes the MapArrayItems visitor', () => {\n reduceTransformation(withItemTransformation('$.g.h.i'), {\n visitors: {\n MapArrayItems: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$.d.e.f',\n '$.g.h.i',\n );\n });\n });\n\n describe('complex item-transformation', () => {\n test('invokes the MapArrayItems visitor', () => {\n const nestedSimpleTransformationVisitor = jest.fn();\n\n reduceTransformation(\n withItemTransformation({ yyy: '$.g.h.i', zzz: '$.j.k.l' }),\n {\n visitors: {\n MapArrayItems: visitorCallback,\n NestedSimpleTransformationExpression:\n nestedSimpleTransformationVisitor,\n },\n accumulator,\n },\n );\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$.d.e.f',\n {\n yyy: '$.g.h.i',\n zzz: '$.j.k.l',\n },\n );\n expect(nestedSimpleTransformationVisitor).not.toHaveBeenCalled();\n });\n });\n });\n });\n\n describe('omit notation', () => {\n const fieldsToOmit = times(2, () => aString());\n const visitorCallback = jest.fn();\n const sourcePathExpression = '$.d.e.f';\n const path = 'a.b.c';\n const accumulator = {};\n\n beforeEach(() => {\n visitorCallback.mockClear();\n });\n\n describe('top-level transformation', () => {\n test('invokes the TopLevelOmit visitor', () => {\n const transformation = {\n '@source': sourcePathExpression,\n '@omit': fieldsToOmit,\n };\n\n reduceTransformation(transformation, {\n visitors: {\n TopLevelOmit: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n sourcePathExpression,\n fieldsToOmit,\n );\n });\n });\n\n describe('nested transformation', () => {\n test('invokes the NestedOmit visitor', () => {\n const transformation = set({}, path, {\n '@source': sourcePathExpression,\n '@omit': fieldsToOmit,\n });\n\n reduceTransformation(transformation, {\n visitors: {\n NestedOmit: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n sourcePathExpression,\n fieldsToOmit,\n );\n });\n });\n });\n\n describe('error handling', () => {\n describe.each`\n transformation | visitorType\n ${'$.a.b.c'} | ${'TopLevelSimpleTransformationExpression'}\n ${'#someCustomFunc($.a.b.c)'} | ${'TopLevelCustomFunctionExpression'}\n ${{ a: { b: { c: 'unsupported transformation' } } }} | ${'NestedUnsupportedTransformationExpression'}\n ${{ a: { b: { c: '$.d.e.f' } } }} | ${'NestedSimpleTransformationExpression'}\n ${{ '*': '$.d.e.f' }} | ${'TopLevelSpreadExpression'}\n ${{ a: { '*': '$.d.e.f' } }} | ${'NestedSpreadExpression'}\n ${{ a: { b: '#someCustomFunction($.d.e.f)' } }} | ${'CustomFunctionExpression'}\n `('$visitor visitor', ({ transformation, visitorType }) => {\n test(`rethrows the error thrown by the ${visitorType} visitor`, () => {\n const errorMessage = aString();\n const error = new Error(errorMessage);\n const visitorCallback = jest.fn().mockImplementationOnce(() => {\n throw error;\n });\n\n expect(() =>\n reduceTransformation(transformation, {\n visitors: {\n [visitorType]: visitorCallback,\n },\n }),\n ).toThrow(error);\n });\n\n test(`does not fail when the ${visitorType} visitor is missing`, () => {\n expect(() =>\n reduceTransformation(transformation, {\n visitors: {\n [visitorType]: null,\n },\n }),\n ).not.toThrow();\n });\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,qBAAA,GAAAF,OAAA;AAEAG,QAAQ,CAAC,sBAAsB,EAAE,MAAM;EACrCA,QAAQ,CAAC,wBAAwB,EAAE,MAAM;IACvC,MAAMC,qBAAqB,GAAG,IAAAC,iCAAO,EAAC,CAAC;IAEvCC,IAAI,CAAC,mCAAmC,EAAE,MAAM;MAC9C,MAAMC,eAAe,GAAGC,IAAI,CACzBC,EAAE,CAAC,CAAC,CACJC,mBAAmB,CAACN,qBAAqB,CAAC;MAC7C,MAAMO,cAAc,GAAG,SAAS;MAEhC,MAAMC,MAAM,GAAG,IAAAC,0CAAoB,EAACF,cAAc,EAAE;QAClDG,QAAQ,EAAE;UACRC,sCAAsC,EAAER;QAC1C;MACF,CAAC,CAAC;MAEFS,MAAM,CAACT,eAAe,CAAC,CAACU,qBAAqB,CAAC,CAAC,CAAC;MAChDD,MAAM,CAACT,eAAe,CAAC,CAACW,oBAAoB,CAAC,SAAS,CAAC;MACvDF,MAAM,CAACJ,MAAM,CAAC,CAACO,aAAa,CAACf,qBAAqB,CAAC;IACrD,CAAC,CAAC;IAEFD,QAAQ,CAAC,kBAAkB,EAAE,MAAM;MACjCG,IAAI,CAAC,8CAA8C,EAAE,MAAM;QACzD,MAAMC,eAAe,GAAGC,IAAI,CACzBC,EAAE,CAAC,CAAC,CACJC,mBAAmB,CAACN,qBAAqB,CAAC;QAC7C,MAAMO,cAAc,GAAG,2CAA2C;QAElE,MAAMC,MAAM,GAAG,IAAAC,0CAAoB,EAACF,cAAc,EAAE;UAClDG,QAAQ,EAAE;YACRM,gCAAgC,EAAEb;UACp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AC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_reduceTransformation","describe","visitorCallbackResult","aString","test","visitorCallback","jest","fn","mockReturnValueOnce","transformation","result","reduceTransformation","visitors","TopLevelSimpleTransformationExpression","expect","toHaveBeenCalledTimes","toHaveBeenCalledWith","toStrictEqual","TopLevelCustomFunctionExpression","transformationWithInvalidCustomFunctionExpression","TopLevelUnsupportedTransformationExpression","accumulator","anObject","a","b","c","d","e","NestedSimpleTransformationExpression","topLevelSpreadOperatorCallback","nestedSpreadOperatorCallback","times","argumentExpression","sibling","siblingKeys","Object","keys","path","beforeEach","forEach","mock","mockClear","nestedOmitCallback","omitExpression","TopLevelSpreadExpression","NestedOmit","NestedSpreadExpression","not","toHaveBeenCalled","set","simpleTransformationCallback","anotherArgumentExpression","topLevelArgumentExpression","customFunctionExpressionCallback","customFunctionExpression","CustomFunctionExpression","invalidCustomFunctionExpression","nestedConstantExpressionCallback","undesiredVisitor","someConst","NestedConstantValue","value","countAccumulator","count","unsupportedTransformationValue","NestedUnsupportedTransformationExpression","TopLevelMapArrayItems","withItemTransformation","itemTransformation","MapArrayItems","nestedSimpleTransformationVisitor","yyy","zzz","fieldsToOmit","sourcePathExpression","TopLevelOmit","each","visitorType","errorMessage","error","Error","mockImplementationOnce","toThrow"],"sources":["../../../src/__tests__/reduceTransformation.spec.ts"],"sourcesContent":["import { anObject, aString } from '@wix/motion-runtime-test-context';\nimport { set, times } from 'lodash';\n\nimport { reduceTransformation } from '../lib/transformations/reduceTransformation';\n\ndescribe('reduceTransformation', () => {\n describe('simple transformations', () => {\n const visitorCallbackResult = aString();\n\n test('traverses a simple transformation', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformation = '$.a.b.c';\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelSimpleTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith('$.a.b.c');\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n\n describe('custom-functions', () => {\n test('traverses a valid custom-function expression', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformation = '#someCustomFunction($.a.b.c,someOtherArg)';\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelCustomFunctionExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n 'someCustomFunction',\n ['$.a.b.c', 'someOtherArg'],\n transformation,\n );\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n\n test('does not fail for invalid custom-function expression', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n const transformationWithInvalidCustomFunctionExpression = '#($.a.b.c)';\n\n const result = reduceTransformation(\n transformationWithInvalidCustomFunctionExpression,\n {\n visitors: {\n TopLevelCustomFunctionExpression: visitorCallback,\n },\n },\n );\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n null,\n null,\n transformationWithInvalidCustomFunctionExpression,\n );\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n });\n\n // TODO: replace with returning the invalid value, for constant-transformation\n test('invokes the TopLevelUnsupportedTransformationExpression otherwise', () => {\n const visitorCallback = jest\n .fn()\n .mockReturnValueOnce(visitorCallbackResult);\n\n const transformation = aString();\n\n const result = reduceTransformation(transformation, {\n visitors: {\n TopLevelUnsupportedTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(transformation);\n expect(result).toStrictEqual(visitorCallbackResult);\n });\n });\n\n describe('complex transformation', () => {\n const accumulator = anObject();\n\n test('traverses all string nodes that are transformation expressions', () => {\n const visitorCallback = jest.fn();\n\n const transformation = {\n a: {\n b: { c: '$[0].ddd.eee.ffff' },\n d: 2,\n e: ['$.ggg', 3, 4, 5],\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSimpleTransformationExpression: visitorCallback,\n },\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(2);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b.c',\n '$[0].ddd.eee.ffff',\n );\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.e[0]',\n '$.ggg',\n );\n });\n\n describe('spread operator', () => {\n const [topLevelSpreadOperatorCallback, nestedSpreadOperatorCallback] =\n times(2, () => jest.fn());\n const argumentExpression = '$[1].d.e.f';\n const sibling = anObject();\n const siblingKeys = Object.keys(sibling);\n const path = `${siblingKeys[0]}.b.c`;\n\n beforeEach(() => {\n [topLevelSpreadOperatorCallback, nestedSpreadOperatorCallback].forEach(\n (mock) => mock.mockClear(),\n );\n });\n\n test('invokes the spread operator visitor prior to its children', () => {\n const nestedOmitCallback = jest.fn();\n const omitExpression = {\n '@source': argumentExpression,\n '@omit': times(2, () => aString()),\n };\n const transformation = { '*': omitExpression, ...sibling };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedOmit: nestedOmitCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n omitExpression,\n siblingKeys,\n );\n\n // expect(nestedOmitCallback).toHaveBeenCalled();\n });\n\n test('traverses top-level spread-operator transformation nodes', () => {\n const transformation = { '*': argumentExpression, ...sibling };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n argumentExpression,\n siblingKeys,\n );\n expect(nestedSpreadOperatorCallback).not.toHaveBeenCalled();\n });\n\n test('traverses nested spread-operator transformation nodes', () => {\n const transformation = set({}, path, {\n '*': argumentExpression,\n ...sibling,\n });\n const simpleTransformationCallback = jest.fn();\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(topLevelSpreadOperatorCallback).not.toHaveBeenCalled();\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n argumentExpression,\n siblingKeys,\n );\n });\n\n test('traverses items within an array of a spread-operator transformation nodes', () => {\n const simpleTransformationCallback = jest.fn();\n const transformation = set({}, path, {\n '*': ['$[0].x.y.z', '$[1].d.e.f'],\n ...sibling,\n });\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(2);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$[0].x.y.z',\n siblingKeys,\n );\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$[1].d.e.f',\n siblingKeys,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n\n test('sets the path to be the parent of the spread operator', () => {\n const anotherArgumentExpression = '$[0].x.y.z';\n const topLevelArgumentExpression = '$[1]';\n const transformation = set(\n { '*': topLevelArgumentExpression, ...sibling },\n path,\n {\n '*': [anotherArgumentExpression, argumentExpression],\n },\n );\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedSpreadExpression: nestedSpreadOperatorCallback,\n TopLevelSpreadExpression: topLevelSpreadOperatorCallback,\n },\n });\n\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledTimes(2);\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n argumentExpression,\n [],\n );\n expect(nestedSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n anotherArgumentExpression,\n [],\n );\n\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledTimes(1);\n expect(topLevelSpreadOperatorCallback).toHaveBeenCalledWith(\n accumulator,\n topLevelArgumentExpression,\n siblingKeys,\n );\n });\n });\n\n describe('custom functions', () => {\n test('traverses custom-function nodes', () => {\n const customFunctionExpressionCallback = jest.fn();\n const simpleTransformationCallback = jest.fn();\n const customFunctionExpression =\n '#someCustomFunction($[0].someCustomFunction)';\n const transformation = {\n a: {\n b: customFunctionExpression,\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n CustomFunctionExpression: customFunctionExpressionCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(customFunctionExpressionCallback).toHaveBeenCalledTimes(1);\n expect(customFunctionExpressionCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b',\n 'someCustomFunction',\n ['$[0].someCustomFunction'],\n customFunctionExpression,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n\n test('does not fail on invalid custom-function nodes', () => {\n const customFunctionExpressionCallback = jest.fn();\n const simpleTransformationCallback = jest.fn();\n const invalidCustomFunctionExpression = '#($[0].someCustomFunction)';\n\n const transformation = {\n a: {\n b: invalidCustomFunctionExpression,\n },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n CustomFunctionExpression: customFunctionExpressionCallback,\n NestedSimpleTransformationExpression: simpleTransformationCallback,\n },\n });\n\n expect(customFunctionExpressionCallback).toHaveBeenCalledTimes(1);\n expect(customFunctionExpressionCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b',\n null,\n null,\n invalidCustomFunctionExpression,\n );\n\n expect(simpleTransformationCallback).not.toHaveBeenCalled();\n });\n });\n\n describe('constant annotation', () => {\n test('traverses a nested constant annotation expression', () => {\n const nestedConstantExpressionCallback = jest.fn();\n const undesiredVisitor = jest.fn();\n const transformation = {\n a: { b: { c: { '@constant': { someConst: '$.value123' } } } },\n };\n\n reduceTransformation(transformation, {\n accumulator,\n visitors: {\n NestedConstantValue: nestedConstantExpressionCallback,\n NestedSimpleTransformationExpression: undesiredVisitor,\n },\n });\n\n expect(nestedConstantExpressionCallback).toHaveBeenCalledTimes(1);\n expect(nestedConstantExpressionCallback).toHaveBeenCalledWith({\n accumulator,\n path: 'a.b.c',\n value: { someConst: '$.value123' },\n });\n expect(undesiredVisitor).not.toHaveBeenCalled();\n });\n });\n\n test('returns the accumulator with changes made to it', () => {\n const countAccumulator = { count: 0 };\n\n const transformation = {\n a: {\n b: 1,\n '*': '$[0].a.b.c',\n },\n };\n\n const result = reduceTransformation(transformation, {\n accumulator: countAccumulator,\n visitors: {\n NestedSpreadExpression: () => {\n countAccumulator.count += 1;\n },\n },\n });\n\n expect(result).toStrictEqual({ count: 1 });\n });\n\n // TODO: replace with returning the invalid value, for constant-transformation\n test('invokes the NestedUnsupportedTransformationExpression otherwise', () => {\n const visitorCallback = jest.fn();\n const unsupportedTransformationValue = aString();\n const transformation = {\n a: { b: { c: unsupportedTransformationValue } },\n };\n\n reduceTransformation(transformation, {\n visitors: {\n NestedUnsupportedTransformationExpression: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n 'a.b.c',\n unsupportedTransformationValue,\n );\n });\n });\n\n describe('mapping array items', () => {\n const visitorCallback = jest.fn();\n\n beforeEach(() => {\n visitorCallback.mockClear();\n });\n\n describe('top-level transformation', () => {\n test('invokes the TopLevelMapArrayItems visitor', () => {\n const transformation = {\n '@path': '$.d.e.f',\n '@itemTransformation': '$.g.h.i',\n };\n\n reduceTransformation(transformation, {\n visitors: {\n TopLevelMapArrayItems: visitorCallback,\n },\n accumulator: {},\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith('$.d.e.f', '$.g.h.i');\n });\n });\n\n describe('nested transformation', () => {\n const accumulator = {};\n const path = 'a.b.c';\n\n const withItemTransformation = (itemTransformation) =>\n set({}, path, {\n '@path': '$.d.e.f',\n '@itemTransformation': itemTransformation,\n });\n\n describe('simple item-transformation', () => {\n test('invokes the MapArrayItems visitor', () => {\n reduceTransformation(withItemTransformation('$.g.h.i'), {\n visitors: {\n MapArrayItems: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$.d.e.f',\n '$.g.h.i',\n );\n });\n });\n\n describe('complex item-transformation', () => {\n test('invokes the MapArrayItems visitor', () => {\n const nestedSimpleTransformationVisitor = jest.fn();\n\n reduceTransformation(\n withItemTransformation({ yyy: '$.g.h.i', zzz: '$.j.k.l' }),\n {\n visitors: {\n MapArrayItems: visitorCallback,\n NestedSimpleTransformationExpression:\n nestedSimpleTransformationVisitor,\n },\n accumulator,\n },\n );\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n '$.d.e.f',\n {\n yyy: '$.g.h.i',\n zzz: '$.j.k.l',\n },\n );\n expect(nestedSimpleTransformationVisitor).not.toHaveBeenCalled();\n });\n });\n });\n });\n\n describe('omit notation', () => {\n const fieldsToOmit = times(2, () => aString());\n const visitorCallback = jest.fn();\n const sourcePathExpression = '$.d.e.f';\n const path = 'a.b.c';\n const accumulator = {};\n\n beforeEach(() => {\n visitorCallback.mockClear();\n });\n\n describe('top-level transformation', () => {\n test('invokes the TopLevelOmit visitor', () => {\n const transformation = {\n '@source': sourcePathExpression,\n '@omit': fieldsToOmit,\n };\n\n reduceTransformation(transformation, {\n visitors: {\n TopLevelOmit: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n sourcePathExpression,\n fieldsToOmit,\n );\n });\n });\n\n describe('nested transformation', () => {\n test('invokes the NestedOmit visitor', () => {\n const transformation = set({}, path, {\n '@source': sourcePathExpression,\n '@omit': fieldsToOmit,\n });\n\n reduceTransformation(transformation, {\n visitors: {\n NestedOmit: visitorCallback,\n },\n accumulator,\n });\n\n expect(visitorCallback).toHaveBeenCalledTimes(1);\n expect(visitorCallback).toHaveBeenCalledWith(\n accumulator,\n path,\n sourcePathExpression,\n fieldsToOmit,\n );\n });\n });\n });\n\n describe('error handling', () => {\n describe.each`\n transformation | visitorType\n ${'$.a.b.c'} | ${'TopLevelSimpleTransformationExpression'}\n ${'#someCustomFunc($.a.b.c)'} | ${'TopLevelCustomFunctionExpression'}\n ${{ a: { b: { c: 'unsupported transformation' } } }} | ${'NestedUnsupportedTransformationExpression'}\n ${{ a: { b: { c: '$.d.e.f' } } }} | ${'NestedSimpleTransformationExpression'}\n ${{ '*': '$.d.e.f' }} | ${'TopLevelSpreadExpression'}\n ${{ a: { '*': '$.d.e.f' } }} | ${'NestedSpreadExpression'}\n ${{ a: { b: '#someCustomFunction($.d.e.f)' } }} | ${'CustomFunctionExpression'}\n `('$visitor visitor', ({ transformation, visitorType }) => {\n test(`rethrows the error thrown by the ${visitorType} visitor`, () => {\n const errorMessage = aString();\n const error = new Error(errorMessage);\n const visitorCallback = jest.fn().mockImplementationOnce(() => {\n throw error;\n });\n\n expect(() =>\n reduceTransformation(transformation, {\n visitors: {\n [visitorType]: visitorCallback,\n },\n }),\n ).toThrow(error);\n });\n\n test(`does not fail when the ${visitorType} visitor is missing`, () => {\n expect(() =>\n reduceTransformation(transformation, {\n visitors: {\n [visitorType]: null,\n },\n }),\n ).not.toThrow();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C,EAAE;QAAU;MAAE;IAAE,CAAC,yBAAyB,sCAAsC;AACrG,QAAQ;MAAE,GAAG,EAAE;IAAU,CAAC,qCAAqC,0BAA0B;AACzF,QAAQ;MAAEF,CAAC,EAAE;QAAE,GAAG,EAAE;MAAU;IAAE,CAAC,8BAA8B,wBAAwB;AACvF,QAAQ;MAAEA,CAAC,EAAE;QAAEC,CAAC,EAAE;MAA+B;IAAE,CAAC,WAAW,0BAA0B;AACzF,KAAK,CAAC,kBAAkB,EAAE,CAAC;MAAEf,cAAc;MAAEoE;IAAY,CAAC,KAAK;MACzDzE,IAAI,CAAC,oCAAoCyE,WAAW,UAAU,EAAE,MAAM;QACpE,MAAMC,YAAY,GAAG,IAAA3E,iCAAO,EAAC,CAAC;QAC9B,MAAM4E,KAAK,GAAG,IAAIC,KAAK,CAACF,YAAY,CAAC;QACrC,MAAMzE,eAAe,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC,CAAC0E,sBAAsB,CAAC,MAAM;UAC7D,MAAMF,KAAK;QACb,CAAC,CAAC;QAEFjE,MAAM,CAAC,MACL,IAAAH,0CAAoB,EAACF,cAAc,EAAE;UACnCG,QAAQ,EAAE;YACR,CAACiE,WAAW,GAAGxE;UACjB;QACF,CAAC,CACH,CAAC,CAAC6E,OAAO,CAACH,KAAK,CAAC;MAClB,CAAC,CAAC;MAEF3E,IAAI,CAAC,0BAA0ByE,WAAW,qBAAqB,EAAE,MAAM;QACrE/D,MAAM,CAAC,MACL,IAAAH,0CAAoB,EAACF,cAAc,EAAE;UACnCG,QAAQ,EAAE;YACR,CAACiE,WAAW,GAAG;UACjB;QACF,CAAC,CACH,CAAC,CAAC9B,GAAG,CAACmC,OAAO,CAAC,CAAC;MACjB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","_customFunctions","describe","test","each","argumentExpressions","expectedArgumentExpressions","functionName","aString","functionExpression","expect","parseCustomFunctionCall","toStrictEqual","expression","expectedResult","isFunctionCallExpression","value","transformationParentPath","joinWithDots","args","join","argumentValues","customFunctions","set","result","runCustomFunctionCallExpression","times","toThrow","Error","t","RegExp"],"sources":["../../../../src/__tests__/transformations/custom-functions.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { set, times } from 'lodash';\n\nimport { isFunctionCallExpression, parseCustomFunctionCall } from '../..';\nimport { runCustomFunctionCallExpression } from '../../lib/transformations/custom-functions';\n\ndescribe('parseCustomFunctionCall', () => {\n /* eslint-disable max-len */\n test.each`\n argumentCount | argumentExpressions | expectedArgumentExpressions\n ${'a single argument'} | ${'$[0].some.path'} | ${['$[0].some.path']}\n ${'multiple arguments'} | ${'$[0].some.path,someString'} | ${['$[0].some.path', 'someString']}\n ${'multiple arguments with whitespaces'} | ${'$[0].some.path, someString , $[1]'} | ${['$[0].some.path', 'someString', '$[1]']}\n ${'no arguments'} | ${''} | ${[]}\n `(\n /* eslint-enable max-len */\n 'parses a custom-function call applied with $argumentCount',\n ({ argumentExpressions, expectedArgumentExpressions }) => {\n const functionName = aString();\n const functionExpression = `#${functionName}(${argumentExpressions})`;\n\n expect(parseCustomFunctionCall(functionExpression)).toStrictEqual({\n functionName,\n argumentExpressions: expectedArgumentExpressions,\n });\n },\n );\n});\n\ndescribe('isFunctionCallExpression', () => {\n test.each`\n description | expression | expectedResult\n ${'a #-prefixed with a valid function name'} | ${'#someInvalidName$#@#>'} | ${true}\n ${'a non-# prefixed with a valid function name'} | ${'someFunctions($[1])'} | ${false}\n ${'a non-string value'} | ${[1, 2, 3]} | ${false}\n `(\n 'returns $expectedResult when $description function call expression is provided',\n ({ expression, expectedResult }) => {\n expect(isFunctionCallExpression(expression)).toStrictEqual(\n expectedResult,\n );\n },\n );\n});\n\ndescribe('runCustomFunctionCallExpression', () => {\n const value = aString();\n const transformationParentPath = aString();\n const joinWithDots = (...args) => args.join('|');\n\n describe.each`\n argumentCount | argumentValues | expectedResult\n ${'single'} | ${[value]} | ${value}\n ${'multi'} | ${[value, value]} | ${`${value}|${value}`}\n ${'no'} | ${[]} | ${''}\n `(\n '$argumentCount-argument expression',\n ({ argumentValues, expectedResult }) => {\n describe.each`\n functionName | description\n ${'someFunction'} | ${'an unscoped'}\n ${'someScope.someFunction'} | ${'a scoped'}\n `('$description custom function', ({ functionName }) => {\n const customFunctions = set({}, functionName, joinWithDots);\n\n test('runs it and returns its result', () => {\n const result = runCustomFunctionCallExpression({\n functionName,\n customFunctions,\n argumentValues,\n transformationParentPath,\n });\n\n expect(result).toStrictEqual(expectedResult);\n });\n });\n },\n );\n\n describe('error handling', () => {\n const argumentValues = times(2, () => aString());\n\n test('throws when the function is not recognized', () => {\n const customFunctions = {};\n\n expect(() =>\n runCustomFunctionCallExpression({\n functionName: 'someNonexistentFunction',\n customFunctions,\n argumentValues,\n transformationParentPath,\n }),\n ).toThrow(`unrecognized custom function \"someNonexistentFunction\"`);\n });\n\n test('throws an error when the function call throws an error', () => {\n const functionName = aString();\n\n const customFunctions = {\n [functionName]: () => {\n throw new Error('Something went wrong in the custom function');\n },\n };\n\n const t = () =>\n runCustomFunctionCallExpression({\n functionName,\n customFunctions,\n argumentValues,\n transformationParentPath,\n });\n\n expect(t).toThrow(Error);\n expect(t).toThrow(\n new RegExp(\n `Transforming ${transformationParentPath} failed, #${functionName} threw: \"Something went wrong in the custom function\" for arguments: .+`,\n ),\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEAI,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACxC;EACAC,IAAI,CAACC,IAAK;AACZ;AACA,MAAM,mBAAoB,wBAAuB,gBAAiB,2BAA0B,CAAC,gBAAgB,CAAE;AAC/G,MAAM,oBAAqB,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ACrE,CAAC,CAAC;IAEFxB,IAAI,CAAC,wDAAwD,EAAE,MAAM;MACnE,MAAMI,YAAY,GAAG,IAAAC,iCAAO,EAAC,CAAC;MAE9B,MAAMc,eAAe,GAAG;QACtB,CAACf,YAAY,GAAG,MAAM;UACpB,MAAM,IAAIqB,KAAK,CAAC,6CAA6C,CAAC;QAChE;MACF,CAAC;MAED,MAAMC,CAAC,GAAGA,CAAA,KACR,IAAAJ,gDAA+B,EAAC;QAC9BlB,YAAY;QACZe,eAAe;QACfD,cAAc;QACdJ;MACF,CAAC,CAAC;MAEJP,MAAM,CAACmB,CAAC,CAAC,CAACF,OAAO,CAACC,KAAK,CAAC;MACxBlB,MAAM,CAACmB,CAAC,CAAC,CAACF,OAAO,CACf,IAAIG,MAAM,CACP,gBAAeb,wBAAyB,aAAYV,YAAa,yEACpE,CACF,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","_customFunctions","describe","test","each","argumentExpressions","expectedArgumentExpressions","functionName","aString","functionExpression","expect","parseCustomFunctionCall","toStrictEqual","expression","expectedResult","isFunctionCallExpression","value","transformationParentPath","joinWithDots","args","join","argumentValues","customFunctions","set","result","runCustomFunctionCallExpression","times","toThrow","Error","t","RegExp"],"sources":["../../../../src/__tests__/transformations/custom-functions.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { set, times } from 'lodash';\n\nimport { isFunctionCallExpression, parseCustomFunctionCall } from '../..';\nimport { runCustomFunctionCallExpression } from '../../lib/transformations/custom-functions';\n\ndescribe('parseCustomFunctionCall', () => {\n /* eslint-disable max-len */\n test.each`\n argumentCount | argumentExpressions | expectedArgumentExpressions\n ${'a single argument'} | ${'$[0].some.path'} | ${['$[0].some.path']}\n ${'multiple arguments'} | ${'$[0].some.path,someString'} | ${['$[0].some.path', 'someString']}\n ${'multiple arguments with whitespaces'} | ${'$[0].some.path, someString , $[1]'} | ${['$[0].some.path', 'someString', '$[1]']}\n ${'no arguments'} | ${''} | ${[]}\n `(\n /* eslint-enable max-len */\n 'parses a custom-function call applied with $argumentCount',\n ({ argumentExpressions, expectedArgumentExpressions }) => {\n const functionName = aString();\n const functionExpression = `#${functionName}(${argumentExpressions})`;\n\n expect(parseCustomFunctionCall(functionExpression)).toStrictEqual({\n functionName,\n argumentExpressions: expectedArgumentExpressions,\n });\n },\n );\n});\n\ndescribe('isFunctionCallExpression', () => {\n test.each`\n description | expression | expectedResult\n ${'a #-prefixed with a valid function name'} | ${'#someInvalidName$#@#>'} | ${true}\n ${'a non-# prefixed with a valid function name'} | ${'someFunctions($[1])'} | ${false}\n ${'a non-string value'} | ${[1, 2, 3]} | ${false}\n `(\n 'returns $expectedResult when $description function call expression is provided',\n ({ expression, expectedResult }) => {\n expect(isFunctionCallExpression(expression)).toStrictEqual(\n expectedResult,\n );\n },\n );\n});\n\ndescribe('runCustomFunctionCallExpression', () => {\n const value = aString();\n const transformationParentPath = aString();\n const joinWithDots = (...args) => args.join('|');\n\n describe.each`\n argumentCount | argumentValues | expectedResult\n ${'single'} | ${[value]} | ${value}\n ${'multi'} | ${[value, value]} | ${`${value}|${value}`}\n ${'no'} | ${[]} | ${''}\n `(\n '$argumentCount-argument expression',\n ({ argumentValues, expectedResult }) => {\n describe.each`\n functionName | description\n ${'someFunction'} | ${'an unscoped'}\n ${'someScope.someFunction'} | ${'a scoped'}\n `('$description custom function', ({ functionName }) => {\n const customFunctions = set({}, functionName, joinWithDots);\n\n test('runs it and returns its result', () => {\n const result = runCustomFunctionCallExpression({\n functionName,\n customFunctions,\n argumentValues,\n transformationParentPath,\n });\n\n expect(result).toStrictEqual(expectedResult);\n });\n });\n },\n );\n\n describe('error handling', () => {\n const argumentValues = times(2, () => aString());\n\n test('throws when the function is not recognized', () => {\n const customFunctions = {};\n\n expect(() =>\n runCustomFunctionCallExpression({\n functionName: 'someNonexistentFunction',\n customFunctions,\n argumentValues,\n transformationParentPath,\n }),\n ).toThrow(`unrecognized custom function \"someNonexistentFunction\"`);\n });\n\n test('throws an error when the function call throws an error', () => {\n const functionName = aString();\n\n const customFunctions = {\n [functionName]: () => {\n throw new Error('Something went wrong in the custom function');\n },\n };\n\n const t = () =>\n runCustomFunctionCallExpression({\n functionName,\n customFunctions,\n argumentValues,\n transformationParentPath,\n });\n\n expect(t).toThrow(Error);\n expect(t).toThrow(\n new RegExp(\n `Transforming ${transformationParentPath} failed, #${functionName} threw: \"Something went wrong in the custom function\" for arguments: .+`,\n ),\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEAI,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACxC;EACAC,IAAI,CAACC,IAAI;AACX;AACA,MAAM,mBAAmB,wBAAwB,gBAAgB,2BAA2B,CAAC,gBAAgB,CAAC;AAC9G,MAAM,oBAAoB,uBAAuB,2BAA2B,gBAAgB,CAAC,gBAAgB,EAAE,YAAY,CAAC;AAC5H,MAAM,qCAAqC,MAAM,qCAAqC,MAAM,CAAC,gBAAgB,EAAE,YAAY,EAAE,MAAM,CAAC;AACpI,MAAM,cAAc,6BAA6B,EAAE,yCAAyC,EAAE;AAC9F,GAAG,EACC;EACA,2DAA2D,EAC3D,CAAC;IAAEC,mBAAmB;IAAEC;EAA4B,CAAC,KAAK;IACxD,MAAMC,YAAY,GAAG,IAAAC,iCAAO,EAAC,CAAC;IAC9B,MAAMC,kBAAkB,GAAG,IAAIF,YAAY,IAAIF,mBAAmB,GAAG;IAErEK,MAAM,CAAC,IAAAC,yBAAuB,EAACF,kBAAkB,CAAC,CAAC,CAACG,aAAa,CAAC;MAChEL,YAAY;MACZF,mBAAmB,EAAEC;IACvB,CAAC,CAAC;EACJ,CACF,CAAC;AACH,CAAC,CAAC;AAEFJ,QAAQ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,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","create","buildRequestTransformation","buildResponseTransformation","preset","describe","test","requestMessageEntityPath","aString","tranformationObject","expect","toStrictEqual","entityPathSegments","times","join","responseMessageResultPath","tranformationString"],"sources":["../../../../../src/__tests__/transformations/preset/create-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../..';\n\nconst {\n create: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('create-method transformations', () => {\n describe('buildRequestTransformation', () => {\n test('creates a transformation that maps the first argument into requestMessageEntityPath', () => {\n const requestMessageEntityPath = aString();\n\n const tranformationObject = buildRequestTransformation({\n requestMessageEntityPath,\n });\n\n expect(tranformationObject).toStrictEqual({\n [requestMessageEntityPath]: '$[0]',\n });\n });\n\n test('supports nested paths', () => {\n // @ts-expect-error\n const entityPathSegments = times(2, aString);\n const requestMessageEntityPath = entityPathSegments.join('.');\n\n const tranformationObject = buildRequestTransformation({\n requestMessageEntityPath,\n });\n\n expect(tranformationObject).toStrictEqual({\n [entityPathSegments[0]]: { [entityPathSegments[1]]: '$[0]' },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const tranformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(tranformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EACJG,MAAM,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACpE,CAAC,GAAGC,QAAM;AAEVC,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3CC,IAAI,CAAC,qFAAqF,EAAE,MAAM;MAChG,MAAMC,wBAAwB,GAAG,IAAAC,iCAAO,EAAC,CAAC;MAE1C,MAAMC,mBAAmB,GAAGP,0BAA0B,CAAC;QACrDK;MACF,CAAC,CAAC;MAEFG,MAAM,CAACD,mBAAmB,CAAC,CAACE,aAAa,CAAC;QACxC,CAACJ,wBAAwB,GAAG;MAC9B,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFD,IAAI,CAAC,uBAAuB,EAAE,MAAM;MAClC;MACA,MAAMM,kBAAkB,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAEL,iCAAO,CAAC;MAC5C,MAAMD,wBAAwB,GAAGK,kBAAkB,CAACE,IAAI,CAAC,GAAG,CAAC;MAE7D,MAAML,mBAAmB,GAAGP,0BAA0B,CAAC;QACrDK;MACF,CAAC,CAAC;MAEFG,MAAM,CAACD,mBAAmB,CAAC,CAACE,aAAa,CAAC;QACxC,CAACC,kBAAkB,CAAC,CAAC,CAAC,GAAG;UAAE,CAACA,kBAAkB,CAAC,CAAC,CAAC,GAAG;QAAO;MAC7D,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFP,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CC,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMS,yBAAyB,GAAG,IAAAP,iCAAO,EAAC,CAAC;MAE3C,MAAMQ,mBAAmB,GAAGb,2BAA2B,CAAC;QACtDY;MACF,CAAC,CAAC;MAEFL,MAAM,CAACM,mBAAmB,CAAC,CAACL,aAAa,CACtC,KAAII,yBAA0B,EACjC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","create","buildRequestTransformation","buildResponseTransformation","preset","describe","test","requestMessageEntityPath","aString","tranformationObject","expect","toStrictEqual","entityPathSegments","times","join","responseMessageResultPath","tranformationString"],"sources":["../../../../../src/__tests__/transformations/preset/create-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../..';\n\nconst {\n create: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('create-method transformations', () => {\n describe('buildRequestTransformation', () => {\n test('creates a transformation that maps the first argument into requestMessageEntityPath', () => {\n const requestMessageEntityPath = aString();\n\n const tranformationObject = buildRequestTransformation({\n requestMessageEntityPath,\n });\n\n expect(tranformationObject).toStrictEqual({\n [requestMessageEntityPath]: '$[0]',\n });\n });\n\n test('supports nested paths', () => {\n // @ts-expect-error\n const entityPathSegments = times(2, aString);\n const requestMessageEntityPath = entityPathSegments.join('.');\n\n const tranformationObject = buildRequestTransformation({\n requestMessageEntityPath,\n });\n\n expect(tranformationObject).toStrictEqual({\n [entityPathSegments[0]]: { [entityPathSegments[1]]: '$[0]' },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const tranformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(tranformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EACJG,MAAM,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACpE,CAAC,GAAGC,QAAM;AAEVC,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3CC,IAAI,CAAC,qFAAqF,EAAE,MAAM;MAChG,MAAMC,wBAAwB,GAAG,IAAAC,iCAAO,EAAC,CAAC;MAE1C,MAAMC,mBAAmB,GAAGP,0BAA0B,CAAC;QACrDK;MACF,CAAC,CAAC;MAEFG,MAAM,CAACD,mBAAmB,CAAC,CAACE,aAAa,CAAC;QACxC,CAACJ,wBAAwB,GAAG;MAC9B,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFD,IAAI,CAAC,uBAAuB,EAAE,MAAM;MAClC;MACA,MAAMM,kBAAkB,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAEL,iCAAO,CAAC;MAC5C,MAAMD,wBAAwB,GAAGK,kBAAkB,CAACE,IAAI,CAAC,GAAG,CAAC;MAE7D,MAAML,mBAAmB,GAAGP,0BAA0B,CAAC;QACrDK;MACF,CAAC,CAAC;MAEFG,MAAM,CAACD,mBAAmB,CAAC,CAACE,aAAa,CAAC;QACxC,CAACC,kBAAkB,CAAC,CAAC,CAAC,GAAG;UAAE,CAACA,kBAAkB,CAAC,CAAC,CAAC,GAAG;QAAO;MAC7D,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFP,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CC,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMS,yBAAyB,GAAG,IAAAP,iCAAO,EAAC,CAAC;MAE3C,MAAMQ,mBAAmB,GAAGb,2BAA2B,CAAC;QACtDY;MACF,CAAC,CAAC;MAEFL,MAAM,CAACM,mBAAmB,CAAC,CAACL,aAAa,CACvC,KAAKI,yBAAyB,EAChC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","RESPONSE_OBJECT_UNCHANGED","transformations","delete","buildRequestTransformation","buildResponseTransformation","preset","describe","requestMessageIdentifierPath","aString","test","transformationObject","expect","toStrictEqual","requestMessageOptionsPath","sharedPath","identifierPathSegment","idPathSegments","times","optionsPathSegments","join","trasformationString"],"sources":["../../../../../src/__tests__/transformations/preset/delete-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset, transformations } from '../../..';\n\nconst { RESPONSE_OBJECT_UNCHANGED } = transformations;\nconst {\n delete: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('delete-method transformations', () => {\n describe('buildRequestTransformation', () => {\n const requestMessageIdentifierPath = aString();\n\n test('creates a transformation that maps the first argument into requestMessageIdentifierPath', () => {\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageIdentifierPath]: '$[0]',\n });\n });\n\n test(`creates a transformation that maps the 2nd argument into requestMessageOptionsPath when provided`, () => {\n const requestMessageOptionsPath = aString();\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath,\n requestMessageOptionsPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageIdentifierPath]: '$[0]',\n [requestMessageOptionsPath]: '$[1]',\n });\n });\n\n test('supports shared paths for requestMessageIdentifierPath and requestMessageOptionsPath', () => {\n const sharedPath = aString();\n const identifierPathSegment = aString();\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath: `${sharedPath}.${identifierPathSegment}`,\n requestMessageOptionsPath: sharedPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [sharedPath]: { [identifierPathSegment]: '$[0]', '*': '$[1]' },\n });\n });\n\n test('supports nested paths', () => {\n // @ts-expect-error\n const idPathSegments = times(2, aString);\n // @ts-expect-error\n const optionsPathSegments = times(2, aString);\n\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath: idPathSegments.join('.'),\n requestMessageOptionsPath: optionsPathSegments.join('.'),\n });\n\n expect(transformationObject).toStrictEqual({\n [idPathSegments[0]]: { [idPathSegments[1]]: '$[0]' },\n [optionsPathSegments[0]]: { [optionsPathSegments[1]]: '$[1]' },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('returns the identity transformation', () => {\n const trasformationString = buildResponseTransformation();\n\n expect(trasformationString).toStrictEqual(RESPONSE_OBJECT_UNCHANGED);\n });\n });\n});\n"],"mappings":";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oB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACE,UAAU,GAAG;UAAE,CAACC,qBAAqB,GAAG,MAAM;UAAE,GAAG,EAAE;QAAO;MAC/D,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFN,IAAI,CAAC,uBAAuB,EAAE,MAAM;MAClC;MACA,MAAMO,cAAc,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAET,iCAAO,CAAC;MACxC;MACA,MAAMU,mBAAmB,GAAG,IAAAD,aAAK,EAAC,CAAC,EAAET,iCAAO,CAAC;MAE7C,MAAME,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI,4BAA4B,EAAES,cAAc,CAACG,IAAI,CAAC,GAAG,CAAC;QACtDN,yBAAyB,EAAEK,mBAAmB,CAACC,IAAI,CAAC,GAAG;MACzD,CAAC,CAAC;MAEFR,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACI,cAAc,CAAC,CAAC,CAAC,GAAG;UAAE,CAACA,cAAc,CAAC,CAAC,CAAC,GAAG;QAAO,CAAC;QACpD,CAACE,mBAAmB,CAAC,CAAC,CAAC,GAAG;UAAE,CAACA,mBAAmB,CAAC,CAAC,CAAC,GAAG;QAAO;MAC/D,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFZ,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CG,IAAI,CAAC,qCAAqC,EAAE,MAAM;MAChD,MAAMW,mBAAmB,GAAGhB,2BAA2B,CAAC,CAAC;MAEzDO,MAAM,CAACS,mBAAmB,CAAC,CAACR,aAAa,CAACZ,yBAAyB,CAAC;IACtE,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","RESPONSE_OBJECT_UNCHANGED","transformations","delete","buildRequestTransformation","buildResponseTransformation","preset","describe","requestMessageIdentifierPath","aString","test","transformationObject","expect","toStrictEqual","requestMessageOptionsPath","sharedPath","identifierPathSegment","idPathSegments","times","optionsPathSegments","join","trasformationString"],"sources":["../../../../../src/__tests__/transformations/preset/delete-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset, transformations } from '../../..';\n\nconst { RESPONSE_OBJECT_UNCHANGED } = transformations;\nconst {\n delete: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('delete-method transformations', () => {\n describe('buildRequestTransformation', () => {\n const requestMessageIdentifierPath = aString();\n\n test('creates a transformation that maps the first argument into requestMessageIdentifierPath', () => {\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageIdentifierPath]: '$[0]',\n });\n });\n\n test(`creates a transformation that maps the 2nd argument into requestMessageOptionsPath when provided`, () => {\n const requestMessageOptionsPath = aString();\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath,\n requestMessageOptionsPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageIdentifierPath]: '$[0]',\n [requestMessageOptionsPath]: '$[1]',\n });\n });\n\n test('supports shared paths for requestMessageIdentifierPath and requestMessageOptionsPath', () => {\n const sharedPath = aString();\n const identifierPathSegment = aString();\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath: `${sharedPath}.${identifierPathSegment}`,\n requestMessageOptionsPath: sharedPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [sharedPath]: { [identifierPathSegment]: '$[0]', '*': '$[1]' },\n });\n });\n\n test('supports nested paths', () => {\n // @ts-expect-error\n const idPathSegments = times(2, aString);\n // @ts-expect-error\n const optionsPathSegments = times(2, aString);\n\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath: idPathSegments.join('.'),\n requestMessageOptionsPath: optionsPathSegments.join('.'),\n });\n\n expect(transformationObject).toStrictEqual({\n [idPathSegments[0]]: { [idPathSegments[1]]: '$[0]' },\n [optionsPathSegments[0]]: { [optionsPathSegments[1]]: '$[1]' },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('returns the identity transformation', () => {\n const trasformationString = buildResponseTransformation();\n\n expect(trasformationString).toStrictEqual(RESPONSE_OBJECT_UNCHANGED);\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EAAEG;AAA0B,CAAC,GAAGC,iBAAe;AACrD,MAAM;EACJC,MAAM,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACpE,CAAC,GAAGC,QAAM;AAEVC,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3C,MAAMC,4BAA4B,GAAG,IAAAC,iCAAO,EAAC,CAAC;IAE9CC,IAAI,CAAC,yFAAyF,EAAE,MAAM;MACpG,MAAMC,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI;MACF,CAAC,CAAC;MAEFI,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACL,4BAA4B,GAAG;MAClC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFE,IAAI,CAAC,kGAAkG,EAAE,MAAM;MAC7G,MAAMI,yBAAyB,GAAG,IAAAL,iCAAO,EAAC,CAAC;MAC3C,MAAME,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI,4BAA4B;QAC5BM;MACF,CAAC,CAAC;MAEFF,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACL,4BAA4B,GAAG,MAAM;QACtC,CAACM,yBAAyB,GAAG;MAC/B,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFJ,IAAI,CAAC,sFAAsF,EAAE,MAAM;MACjG,MAAMK,UAAU,GAAG,IAAAN,iCAAO,EAAC,CAAC;MAC5B,MAAMO,qBAAqB,GAAG,IAAAP,iCAAO,EAAC,CAA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","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","get","buildRequestTransformation","buildResponseTransformation","preset","describe","requestMessageIdentifierPath","aString","test","transformationObject","expect","toStrictEqual","idPathSegments","times","join","responseMessageResultPath","transformationString"],"sources":["../../../../../src/__tests__/transformations/preset/get-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../..';\n\nconst {\n get: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('get-method transformations', () => {\n describe('buildRequestTransformation', () => {\n const requestMessageIdentifierPath = aString();\n\n test('creates a transformation that maps the first argument into requestMessageIdentifierPath', () => {\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageIdentifierPath]: '$[0]',\n });\n });\n\n test('supports a nested path', () => {\n // @ts-expect-errora\n const idPathSegments = times(2, aString);\n\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath: idPathSegments.join('.'),\n });\n\n expect(transformationObject).toStrictEqual({\n [idPathSegments[0]]: { [idPathSegments[1]]: '$[0]' },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const transformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(transformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EACJG,GAAG,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACjE,CAAC,GAAGC,QAAM;AAEVC,QAAQ,CAAC,4BAA4B,EAAE,MAAM;EAC3CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3C,MAAMC,4BAA4B,GAAG,IAAAC,iCAAO,EAAC,CAAC;IAE9CC,IAAI,CAAC,yFAAyF,EAAE,MAAM;MACpG,MAAMC,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI;MACF,CAAC,CAAC;MAEFI,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACL,4BAA4B,GAAG;MAClC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFE,IAAI,CAAC,wBAAwB,EAAE,MAAM;MACnC;MACA,MAAMI,cAAc,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAEN,iCAAO,CAAC;MAExC,MAAME,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI,4BAA4B,EAAEM,cAAc,CAACE,IAAI,CAAC,GAAG;MACvD,CAAC,CAAC;MAEFJ,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACC,cAAc,CAAC,CAAC,CAAC,GAAG;UAAE,CAACA,cAAc,CAAC,CAAC,CAAC,GAAG;QAAO;MACrD,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFP,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CG,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMO,yBAAyB,GAAG,IAAAR,iCAAO,EAAC,CAAC;MAE3C,MAAMS,oBAAoB,GAAGb,2BAA2B,CAAC;QACvDY;MACF,CAAC,CAAC;MAEFL,MAAM,CAACM,oBAAoB,CAAC,CAACL,aAAa,CACvC,KAAII,yBAA0B,EACjC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","get","buildRequestTransformation","buildResponseTransformation","preset","describe","requestMessageIdentifierPath","aString","test","transformationObject","expect","toStrictEqual","idPathSegments","times","join","responseMessageResultPath","transformationString"],"sources":["../../../../../src/__tests__/transformations/preset/get-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../..';\n\nconst {\n get: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('get-method transformations', () => {\n describe('buildRequestTransformation', () => {\n const requestMessageIdentifierPath = aString();\n\n test('creates a transformation that maps the first argument into requestMessageIdentifierPath', () => {\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageIdentifierPath]: '$[0]',\n });\n });\n\n test('supports a nested path', () => {\n // @ts-expect-errora\n const idPathSegments = times(2, aString);\n\n const transformationObject = buildRequestTransformation({\n requestMessageIdentifierPath: idPathSegments.join('.'),\n });\n\n expect(transformationObject).toStrictEqual({\n [idPathSegments[0]]: { [idPathSegments[1]]: '$[0]' },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const transformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(transformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EACJG,GAAG,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACjE,CAAC,GAAGC,QAAM;AAEVC,QAAQ,CAAC,4BAA4B,EAAE,MAAM;EAC3CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3C,MAAMC,4BAA4B,GAAG,IAAAC,iCAAO,EAAC,CAAC;IAE9CC,IAAI,CAAC,yFAAyF,EAAE,MAAM;MACpG,MAAMC,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI;MACF,CAAC,CAAC;MAEFI,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACL,4BAA4B,GAAG;MAClC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFE,IAAI,CAAC,wBAAwB,EAAE,MAAM;MACnC;MACA,MAAMI,cAAc,GAAG,IAAAC,aAAK,EAAC,CAAC,EAAEN,iCAAO,CAAC;MAExC,MAAME,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDI,4BAA4B,EAAEM,cAAc,CAACE,IAAI,CAAC,GAAG;MACvD,CAAC,CAAC;MAEFJ,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACC,cAAc,CAAC,CAAC,CAAC,GAAG;UAAE,CAACA,cAAc,CAAC,CAAC,CAAC,GAAG;QAAO;MACrD,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFP,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CG,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMO,yBAAyB,GAAG,IAAAR,iCAAO,EAAC,CAAC;MAE3C,MAAMS,oBAAoB,GAAGb,2BAA2B,CAAC;QACvDY;MACF,CAAC,CAAC;MAEFL,MAAM,CAACM,oBAAoB,CAAC,CAACL,aAAa,CACxC,KAAKI,yBAAyB,EAChC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_","list","buildRequestTransformation","buildResponseTransformation","preset","describe","test","transformationString","expect","toStrictEqual","responseMessageResultPath","aString"],"sources":["../../../../../src/__tests__/transformations/preset/list-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\n\nimport { preset } from '../../..';\n\nconst {\n list: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('list-method transformations', () => {\n describe('buildRequestTransformation', () => {\n // eslint-disable-next-line max-len\n test('returns the passthrough request transformation', () => {\n const transformationString = buildRequestTransformation();\n\n expect(transformationString).toStrictEqual('$[0]');\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const transformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(transformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AAEA,MAAM;EACJE,IAAI,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AAClE,CAAC,GAAGC,QAAM;AAEVC,QAAQ,CAAC,6BAA6B,EAAE,MAAM;EAC5CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3C;IACAC,IAAI,CAAC,gDAAgD,EAAE,MAAM;MAC3D,MAAMC,oBAAoB,GAAGL,0BAA0B,CAAC,CAAC;MAEzDM,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC,MAAM,CAAC;IACpD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFJ,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CC,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMI,yBAAyB,GAAG,IAAAC,iCAAO,EAAC,CAAC;MAE3C,MAAMJ,oBAAoB,GAAGJ,2BAA2B,CAAC;QACvDO;MACF,CAAC,CAAC;MAEFF,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CACvC,KAAIC,yBAA0B,EACjC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_","list","buildRequestTransformation","buildResponseTransformation","preset","describe","test","transformationString","expect","toStrictEqual","responseMessageResultPath","aString"],"sources":["../../../../../src/__tests__/transformations/preset/list-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\n\nimport { preset } from '../../..';\n\nconst {\n list: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('list-method transformations', () => {\n describe('buildRequestTransformation', () => {\n // eslint-disable-next-line max-len\n test('returns the passthrough request transformation', () => {\n const transformationString = buildRequestTransformation();\n\n expect(transformationString).toStrictEqual('$[0]');\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const transformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(transformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AAEA,MAAM;EACJE,IAAI,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AAClE,CAAC,GAAGC,QAAM;AAEVC,QAAQ,CAAC,6BAA6B,EAAE,MAAM;EAC5CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3C;IACAC,IAAI,CAAC,gDAAgD,EAAE,MAAM;MAC3D,MAAMC,oBAAoB,GAAGL,0BAA0B,CAAC,CAAC;MAEzDM,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC,MAAM,CAAC;IACpD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFJ,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CC,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMI,yBAAyB,GAAG,IAAAC,iCAAO,EAAC,CAAC;MAE3C,MAAMJ,oBAAoB,GAAGJ,2BAA2B,CAAC;QACvDO;MACF,CAAC,CAAC;MAEFF,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CACxC,KAAKC,yBAAyB,EAChC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","query","buildRequestTransformation","buildResponseTransformation","preset","describe","test","requestQueryObjectPropertyName","aString","transformationString","expect","toStrictEqual","responseMessageResultPath","responseMessagePagingMetadataPath","times","transformationObject","items","pagingMetadata","itemTransformation"],"sources":["../../../../../src/__tests__/transformations/preset/query-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../..';\n\nconst {\n query: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('query-method transformations', () => {\n describe('buildRequestTransformation', () => {\n // eslint-disable-next-line max-len\n test('sets the query object as a property named via requestQueryObjectPropertyName, and spreads the 2nd argument', () => {\n const requestQueryObjectPropertyName = aString();\n const transformationString = buildRequestTransformation({\n requestQueryObjectPropertyName,\n });\n\n expect(transformationString).toStrictEqual({\n [requestQueryObjectPropertyName]: '$[0]',\n '*': '$[1]',\n });\n });\n\n // eslint-disable-next-line max-len\n test(\"sets the given query tree under the 'query' property as a default, with the second argument spread into the payload\", () => {\n const transformationString = buildRequestTransformation();\n\n expect(transformationString).toStrictEqual({\n query: '$[0]',\n '*': '$[1]',\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n const [responseMessageResultPath, responseMessagePagingMetadataPath] =\n times(2, () => aString());\n\n test('unwraps the value of the provided property-path', () => {\n const transformationObject = buildResponseTransformation({\n responseMessageResultPath,\n responseMessagePagingMetadataPath,\n });\n\n expect(transformationObject).toStrictEqual({\n items: `$.${responseMessageResultPath}`,\n pagingMetadata: `$.${responseMessagePagingMetadataPath}`,\n });\n });\n\n test('adds an item-transformation when provided', () => {\n const itemTransformation = `$.some.path.${aString()}`;\n const transformationObject = buildResponseTransformation({\n responseMessageResultPath,\n responseMessagePagingMetadataPath,\n itemTransformation,\n });\n\n expect(transformationObject).toStrictEqual({\n items: {\n '@path': `$.${responseMessageResultPath}`,\n '@itemTransformation': itemTransformation,\n },\n pagingMetadata: `$.${responseMessagePagingMetadataPath}`,\n });\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,M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GAAI,eAAc,IAAAV,iCAAO,EAAC,CAAE,EAAC;MACrD,MAAMO,oBAAoB,GAAGZ,2BAA2B,CAAC;QACvDS,yBAAyB;QACzBC,iCAAiC;QACjCK;MACF,CAAC,CAAC;MAEFR,MAAM,CAACK,oBAAoB,CAAC,CAACJ,aAAa,CAAC;QACzCK,KAAK,EAAE;UACL,OAAO,EAAG,KAAIJ,yBAA0B,EAAC;UACzC,qBAAqB,EAAEM;QACzB,CAAC;QACDD,cAAc,EAAG,KAAIJ,iCAAkC;MACzD,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","query","buildRequestTransformation","buildResponseTransformation","preset","describe","test","requestQueryObjectPropertyName","aString","transformationString","expect","toStrictEqual","responseMessageResultPath","responseMessagePagingMetadataPath","times","transformationObject","items","pagingMetadata","itemTransformation"],"sources":["../../../../../src/__tests__/transformations/preset/query-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../..';\n\nconst {\n query: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('query-method transformations', () => {\n describe('buildRequestTransformation', () => {\n // eslint-disable-next-line max-len\n test('sets the query object as a property named via requestQueryObjectPropertyName, and spreads the 2nd argument', () => {\n const requestQueryObjectPropertyName = aString();\n const transformationString = buildRequestTransformation({\n requestQueryObjectPropertyName,\n });\n\n expect(transformationString).toStrictEqual({\n [requestQueryObjectPropertyName]: '$[0]',\n '*': '$[1]',\n });\n });\n\n // eslint-disable-next-line max-len\n test(\"sets the given query tree under the 'query' property as a default, with the second argument spread into the payload\", () => {\n const transformationString = buildRequestTransformation();\n\n expect(transformationString).toStrictEqual({\n query: '$[0]',\n '*': '$[1]',\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n const [responseMessageResultPath, responseMessagePagingMetadataPath] =\n times(2, () => aString());\n\n test('unwraps the value of the provided property-path', () => {\n const transformationObject = buildResponseTransformation({\n responseMessageResultPath,\n responseMessagePagingMetadataPath,\n });\n\n expect(transformationObject).toStrictEqual({\n items: `$.${responseMessageResultPath}`,\n pagingMetadata: `$.${responseMessagePagingMetadataPath}`,\n });\n });\n\n test('adds an item-transformation when provided', () => {\n const itemTransformation = `$.some.path.${aString()}`;\n const transformationObject = buildResponseTransformation({\n responseMessageResultPath,\n responseMessagePagingMetadataPath,\n itemTransformation,\n });\n\n expect(transformationObject).toStrictEqual({\n items: {\n '@path': `$.${responseMessageResultPath}`,\n '@itemTransformation': itemTransformation,\n },\n pagingMetadata: `$.${responseMessagePagingMetadataPath}`,\n });\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EACJG,KAAK,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACnE,CAAC,GAAGC,QAAM;AAEVC,QAAQ,CAAC,8BAA8B,EAAE,MAAM;EAC7CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3C;IACAC,IAAI,CAAC,4GAA4G,EAAE,MAAM;MACvH,MAAMC,8BAA8B,GAAG,IAAAC,iCAAO,EAAC,CAAC;MAChD,MAAMC,oBAAoB,GAAGP,0BAA0B,CAAC;QACtDK;MACF,CAAC,CAAC;MAEFG,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzC,CAACJ,8BAA8B,GAAG,MAAM;QACxC,GAAG,EAAE;MACP,CAAC,CAAC;IACJ,CAAC,CAAC;;IAEF;IACAD,IAAI,CAAC,qHAAqH,EAAE,MAAM;MAChI,MAAMG,oBAAoB,GAAGP,0BAA0B,CAAC,CAAC;MAEzDQ,MAAM,CAACD,oBAAoB,CAAC,CAACE,aAAa,CAAC;QACzCV,KAAK,EAAE,MAAM;QACb,GAAG,EAAE;MACP,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFI,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5C,MAAM,CAACO,yBAAyB,EAAEC,iCAAiC,CAAC,GAClE,IAAAC,aAAK,EAAC,CAAC,EAAE,MAAM,IAAAN,iCAAO,EAAC,CAAC,CAAC;IAE3BF,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMS,oBAAoB,GAAGZ,2BAA2B,CAAC;QACvDS,yBAAyB;QACzBC;MACF,CAAC,CAAC;MAEFH,MAAM,CAACK,oBAAoB,CAAC,CAACJ,aAAa,CAAC;QACzCK,KAAK,EAAE,KAAKJ,yBAAyB,EAAE;QACvCK,cAAc,EAAE,KAAKJ,iCAAiC;MACxD,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFP,IAAI,CAAC,2CAA2C,EAAE,MAAM;MACtD,MAAMY,kBAAkB,GAAG,eAAe,IAAAV,iCAAO,EAAC,CAAC,EAAE;MACrD,MAAMO,oBAAoB,GAAGZ,2BAA2B,CAAC;QACvDS,yBAAyB;QACzBC,iCAAiC;QACjCK;MACF,CAAC,CAAC;MAEFR,MAAM,CAACK,oBAAoB,CAAC,CAACJ,aAAa,CAAC;QACzCK,KAAK,EAAE;UACL,OAAO,EAAE,KAAKJ,yBAAyB,EAAE;UACzC,qBAAqB,EAAEM;QACzB,CAAC;QACDD,cAAc,EAAE,KAAKJ,iCAAiC;MACxD,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","update","buildRequestTransformation","buildResponseTransformation","preset","describe","requestMessageOptionsPath","aString","requestMessageEntityPath","requestMessageEntityIdentifierField","test","transformedObject","expect","toStrictEqual","requestMessageEntityPathSegments","times","optionsPathSegments","transformationObject","join","sharedPath","responseMessageResultPath","transformationString"],"sources":["../../../../../src/__tests__/transformations/preset/update-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../..';\n\nconst {\n update: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('update-method transformations', () => {\n describe('buildRequestTransformation', () => {\n const requestMessageOptionsPath = aString();\n const requestMessageEntityPath = aString();\n const requestMessageEntityIdentifierField = aString();\n\n test('creates a transformation mapping args into requestMessageIdentifierPath and requestMessageEntityPath', () => {\n const transformedObject = buildRequestTransformation({\n requestMessageEntityIdentifierField,\n requestMessageEntityPath,\n });\n\n expect(transformedObject).toStrictEqual({\n [requestMessageEntityPath]: {\n [requestMessageEntityIdentifierField]: '$[0]',\n '*': '$[1]',\n },\n });\n });\n\n test(`creates a transformation that maps the 3rd argument into requestMessageOptionsPath when provided`, () => {\n const transformedObject = buildRequestTransformation({\n requestMessageEntityIdentifierField,\n requestMessageEntityPath,\n requestMessageOptionsPath,\n });\n\n expect(transformedObject).toStrictEqual({\n [requestMessageEntityPath]: {\n [requestMessageEntityIdentifierField]: '$[0]',\n '*': '$[1]',\n },\n [requestMessageOptionsPath]: '$[2]',\n });\n });\n\n test('supports nested paths for requestMessageEntityPath and requestMessageOptionsPath', () => {\n // @ts-expect-error\n const requestMessageEntityPathSegments = times(2, aString);\n // @ts-expect-error\n const optionsPathSegments = times(2, aString);\n\n const transformationObject = buildRequestTransformation({\n requestMessageEntityIdentifierField,\n requestMessageEntityPath: requestMessageEntityPathSegments.join('.'),\n requestMessageOptionsPath: optionsPathSegments.join('.'),\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageEntityPathSegments[0]]: {\n [requestMessageEntityPathSegments[1]]: {\n [requestMessageEntityIdentifierField]: '$[0]',\n '*': '$[1]',\n },\n },\n [optionsPathSegments[0]]: { [optionsPathSegments[1]]: '$[2]' },\n });\n });\n\n test('supports shared paths for requestMessageEntityPath and requestMessageOptionsPath', () => {\n const sharedPath = aString();\n\n const transformationObject = buildRequestTransformation({\n requestMessageEntityIdentifierField,\n requestMessageEntityPath: sharedPath,\n requestMessageOptionsPath: sharedPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [sharedPath]: {\n [requestMessageEntityIdentifierField]: '$[0]',\n '*': ['$[1]', '$[2]'],\n },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const transformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(transformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EACJG,MAAM,EAAE;IAAEC,0BAA0B;IAAEC;EAA4B;AACpE,CAAC,GAAGC,QAAM;AAEVC,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9CA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3C,MAAMC,yBAAyB,GAAG,IAAAC,iCAAO,EAAC,CAAC;IAC3C,MAAMC,wBAAwB,GAAG,IAAAD,iCAAO,EAAC,CAAC;IAC1C,MAAME,mCAAmC,GAAG,IAAAF,iCAAO,EAAC,CAAC;IAErDG,IAAI,CAAC,sGAAsG,EAAE,MAAM;MACjH,MAAMC,iBAAiB,GAAGT,0BAA0B,CAAC;QACnDO,mCAAmC;QACnCD;MACF,CAAC,CAAC;MAEFI,MAAM,CAACD,iBAAiB,CAAC,CAACE,aAAa,CAAC;QACtC,CAACL,wBAAwB,GAAG;UAC1B,CAACC,mCAAmC,GAAG,MAAM;UAC7C,GAAG,EAAE;QACP;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFC,IAAI,CAAE,kGAAiG,EAAE,MAAM;MAC7G,MAAMC,iBAAiB,GAAGT,0BAA0B,CAAC;QACnDO,mCAAmC;QACnCD,wBAAwB;QACxBF;MACF,CAAC,CAAC;MAEFM,MAAM,C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AACV,mCAAmC,GAAG,MAAM;UAC7C,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM;QACtB;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFJ,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAC5CK,IAAI,CAAC,iDAAiD,EAAE,MAAM;MAC5D,MAAMU,yBAAyB,GAAG,IAAAb,iCAAO,EAAC,CAAC;MAE3C,MAAMc,oBAAoB,GAAGlB,2BAA2B,CAAC;QACvDiB;MACF,CAAC,CAAC;MAEFR,MAAM,CAACS,oBAAoB,CAAC,CAACR,aAAa,CACvC,KAAIO,yBAA0B,EACjC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","update","buildRequestTransformation","buildResponseTransformation","preset","describe","requestMessageOptionsPath","aString","requestMessageEntityPath","requestMessageEntityIdentifierField","test","transformedObject","expect","toStrictEqual","requestMessageEntityPathSegments","times","optionsPathSegments","transformationObject","join","sharedPath","responseMessageResultPath","transformationString"],"sources":["../../../../../src/__tests__/transformations/preset/update-transformation.spec.ts"],"sourcesContent":["import { aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { preset } from '../../..';\n\nconst {\n update: { buildRequestTransformation, buildResponseTransformation },\n} = preset;\n\ndescribe('update-method transformations', () => {\n describe('buildRequestTransformation', () => {\n const requestMessageOptionsPath = aString();\n const requestMessageEntityPath = aString();\n const requestMessageEntityIdentifierField = aString();\n\n test('creates a transformation mapping args into requestMessageIdentifierPath and requestMessageEntityPath', () => {\n const transformedObject = buildRequestTransformation({\n requestMessageEntityIdentifierField,\n requestMessageEntityPath,\n });\n\n expect(transformedObject).toStrictEqual({\n [requestMessageEntityPath]: {\n [requestMessageEntityIdentifierField]: '$[0]',\n '*': '$[1]',\n },\n });\n });\n\n test(`creates a transformation that maps the 3rd argument into requestMessageOptionsPath when provided`, () => {\n const transformedObject = buildRequestTransformation({\n requestMessageEntityIdentifierField,\n requestMessageEntityPath,\n requestMessageOptionsPath,\n });\n\n expect(transformedObject).toStrictEqual({\n [requestMessageEntityPath]: {\n [requestMessageEntityIdentifierField]: '$[0]',\n '*': '$[1]',\n },\n [requestMessageOptionsPath]: '$[2]',\n });\n });\n\n test('supports nested paths for requestMessageEntityPath and requestMessageOptionsPath', () => {\n // @ts-expect-error\n const requestMessageEntityPathSegments = times(2, aString);\n // @ts-expect-error\n const optionsPathSegments = times(2, aString);\n\n const transformationObject = buildRequestTransformation({\n requestMessageEntityIdentifierField,\n requestMessageEntityPath: requestMessageEntityPathSegments.join('.'),\n requestMessageOptionsPath: optionsPathSegments.join('.'),\n });\n\n expect(transformationObject).toStrictEqual({\n [requestMessageEntityPathSegments[0]]: {\n [requestMessageEntityPathSegments[1]]: {\n [requestMessageEntityIdentifierField]: '$[0]',\n '*': '$[1]',\n },\n },\n [optionsPathSegments[0]]: { [optionsPathSegments[1]]: '$[2]' },\n });\n });\n\n test('supports shared paths for requestMessageEntityPath and requestMessageOptionsPath', () => {\n const sharedPath = aString();\n\n const transformationObject = buildRequestTransformation({\n requestMessageEntityIdentifierField,\n requestMessageEntityPath: sharedPath,\n requestMessageOptionsPath: sharedPath,\n });\n\n expect(transformationObject).toStrictEqual({\n [sharedPath]: {\n [requestMessageEntityIdentifierField]: '$[0]',\n '*': ['$[1]', '$[2]'],\n },\n });\n });\n });\n\n describe('buildResponseTransformation', () => {\n test('unwraps the value of the provided property-path', () => {\n const responseMessageResultPath = aString();\n\n const transformationString = buildResponseTransformation({\n responseMessageResultPath,\n });\n\n expect(transformationString).toStrictEqual(\n `$.${responseMessageResultPath}`,\n );\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EACJG,MAAM,EAAE;IAAEC,0BAA0B;IAAEC;EAA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names":["_motionRuntimeTestContext","require","_lodash","_","validateRequestTransformation","validation","describe","validResults","isValid","validationErrors","test","validTransformation","expect","toStrictEqual","a","validationErrorWith","parentPath","invalidValue","description","arrayContaining","objectContaining","each","transformationKey","expectedValidationMessage","transformation","d","e","f","parentKey","aString","invalidSourceValue","invalidSourceTransformation","times","invalidTransformation","expectedParentPath","transformationWithOmitValue","value","nonArray","nonStringArray","aNumber","arrayWithInvalidPaths","invalidCustomFunctionCallExpression","b","c","invalidCustomFunctionExpression","transformationValue","specialField"],"sources":["../../../../src/__tests__/validations/validateRequestTransformation.spec.ts"],"sourcesContent":["import { aNumber, aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { validation } from '../..';\n\nconst { validateRequestTransformation } = validation;\n\ndescribe('validateRequestTransformation', () => {\n describe('valid transformations', () => {\n const validResults = { isValid: true, validationErrors: [] };\n\n test('returns valid transformation response for a valid simple transformation', () => {\n const validTransformation = '$[0].a.b.c';\n\n expect(validateRequestTransformation(validTransformation)).toStrictEqual(\n validResults,\n );\n });\n\n test('returns valid transformation response for a valid complex transformation', () => {\n const validTransformation = { a: '$[0].a.b.c' };\n\n expect(validateRequestTransformation(validTransformation)).toStrictEqual(\n validResults,\n );\n });\n });\n\n describe('invalid transformations', () => {\n const validationErrorWith = ({\n parentPath,\n invalidValue,\n description,\n }) => ({\n isValid: false,\n validationErrors: expect.arrayContaining([\n expect.objectContaining({\n parentPath,\n invalidValue,\n description,\n }),\n ]),\n });\n\n describe('invalid complex-transformation keys', () => {\n test.each`\n description | transformationKey | expectedValidationMessage\n ${'refers to an argument index'} | ${'$[0]'} | ${\"must start with '$.'\"}\n ${'refers to a custom function'} | ${'#someFunction'} | ${'cannot be a custom function call'}\n `(\n 'returns a validation error when a transformation value segment $description',\n ({ transformationKey, expectedValidationMessage }) => {\n const transformation = {\n d: { e: { f: { [transformationKey]: '$[0].a.b.c' } } },\n '*': '$[1]',\n };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'd.e.f',\n invalidValue: transformationKey,\n description: expectedValidationMessage,\n }),\n );\n },\n );\n });\n\n describe('invalid transformations values', () => {\n describe('omit transformation', () => {\n const parentKey = aString();\n\n describe('invalid source', () => {\n const invalidSourceValue = '$[x].a.b.c';\n const invalidSourceTransformation = {\n '@source': invalidSourceValue,\n '@omit': times(2, () => aString()),\n };\n\n test.each`\n description | invalidTransformation | expectedParentPath\n ${'top level'} | ${invalidSourceTransformation} | ${'@source'}\n ${'nested'} | ${{ [parentKey]: invalidSourceTransformation }} | ${`${parentKey}.@source`}\n `(\n 'returns a validation error when the @source value is invalid',\n ({ invalidTransformation, expectedParentPath }) => {\n expect(\n validateRequestTransformation(invalidTransformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: expectedParentPath,\n invalidValue: invalidSourceValue,\n description: 'must start with $[N] where N is an index',\n }),\n );\n },\n );\n });\n\n describe('invalid @omit', () => {\n const transformationWithOmitValue = (value) => ({\n '@source': '$[0].a.b.c',\n '@omit': value,\n });\n\n const nonArray = aString();\n const nonStringArray = times(2, () => aNumber());\n const arrayWithInvalidPaths = ['a.b.c', aString()];\n\n describe.each`\n description | invalidTransformation | expectedParentPath\n ${'top level'} | ${transformationWithOmitValue(nonArray)} | ${'@omit'}\n ${'nested'} | ${{ [parentKey]: transformationWithOmitValue(nonArray) }} | ${`${parentKey}.@omit`}\n `(\n '@omit is not an array',\n ({ invalidTransformation, expectedParentPath }) => {\n test('returns a validation error', () => {\n expect(\n validateRequestTransformation(invalidTransformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: expectedParentPath,\n invalidValue: nonArray,\n description: 'must be an array of strings',\n }),\n );\n });\n },\n );\n\n describe.each`\n description | invalidTransformation | expectedParentPath\n ${'top level'} | ${transformationWithOmitValue(nonStringArray)} | ${'@omit'}\n ${'nested'} | ${{ [parentKey]: transformationWithOmitValue(nonStringArray) }} | ${`${parentKey}.@omit`}\n `(\n '@omit is an array of non-strings',\n ({ invalidTransformation, expectedParentPath }) => {\n test('return a validation error', () => {\n expect(\n validateRequestTransformation(invalidTransformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: expectedParentPath,\n invalidValue: nonStringArray,\n description: 'must be an array of strings',\n }),\n );\n });\n },\n );\n\n /* eslint-disable max-len */\n describe.each`\n description | invalidTransformation | expectedParentPath\n ${'top level'} | ${transformationWithOmitValue(arrayWithInvalidPaths)} | ${'@omit'}\n ${'nested'} | ${{ [parentKey]: transformationWithOmitValue(arrayWithInvalidPaths) }} | ${`${parentKey}.@omit`}\n `(\n '@omit is an array with invalid string paths',\n ({ description, invalidTransformation, expectedParentPath }) => {\n /* eslint-enable max-len */\n test(`returns a validation error for invalid ${description} transformation`, () => {\n expect(\n validateRequestTransformation(invalidTransformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: expectedParentPath,\n invalidValue: arrayWithInvalidPaths,\n description: 'must contain non-nested paths only',\n }),\n );\n });\n },\n );\n });\n });\n\n describe('custom function expressions', () => {\n test('returns a validation error when an invalid custom function-name is used', () => {\n const invalidCustomFunctionCallExpression = '#1a';\n const transformation = {\n a: { b: { c: invalidCustomFunctionCallExpression } },\n };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: invalidCustomFunctionCallExpression,\n description: 'contains an invalid custom function expression',\n }),\n );\n });\n\n test('returns a validation error when a custom function argument is invalid for request transformation', () => {\n const invalidCustomFunctionExpression = '#someFunction($.id)';\n const transformation = {\n a: { b: { c: invalidCustomFunctionExpression } },\n };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: '$.id',\n description: 'must start with $[N] where N is an index',\n }),\n );\n });\n\n describe('#constant function', () => {\n test('returns a validation error when passed value is not a valid json value', () => {\n const invalidCustomFunctionExpression = '#constant(not-json)';\n const transformation = {\n a: { b: { c: invalidCustomFunctionExpression } },\n };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: 'not-json',\n description: 'must be a valid json value',\n }),\n );\n });\n\n test('allows passing non json-path arguments to the #constant function', () => {\n const transformation = { a: { b: { c: '#constant(\"abc\")' } } };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n {\n isValid: true,\n validationErrors: [],\n },\n );\n });\n });\n });\n\n /* eslint-disable max-len */\n describe.each`\n description | transformationValue | expectedValidationMessage\n ${'does not start with $[N] where N is a numeric index'} | ${'$[x].a.b.c'} | ${'must start with $[N] where N is an index'}\n ${'is not a valid json-path'} | ${'@'} | ${'must start with $[N] where N is an index'}\n ${'has several arguments referred to in the transformation'} | ${'$[0].$[1]'} | ${'must have a single argument-index as the first path segment'}\n ${'refers to * in the path'} | ${'$[0].a.b.*'} | ${'cannot refer to the * operator'}\n `(\n /* eslint-enable max-len */\n 'returns a validation error when a transformation value segment $description',\n ({ transformationValue, expectedValidationMessage }) => {\n test('simple transformation', () => {\n expect(\n validateRequestTransformation(transformationValue),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: null,\n invalidValue: transformationValue,\n description: expectedValidationMessage,\n }),\n );\n });\n\n test('complex transformation', () => {\n const transformation = { a: { b: { c: transformationValue } } };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: transformationValue,\n description: expectedValidationMessage,\n }),\n );\n });\n },\n );\n\n describe('special fields', () => {\n describe.each(['id', 'createdDate', 'updatedDate'])(\n '%s',\n (specialField) => {\n const transformationValue = `$[0].a.b.${specialField}`;\n // eslint-disable-next-line max-len\n const expectedValidationMessage = `cannot refer to ${specialField} field, consider using _${specialField} instead`;\n\n test('simple transformation', () => {\n expect(\n validateRequestTransformation(transformationValue),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: null,\n invalidValue: transformationValue,\n description: expectedValidationMessage,\n }),\n );\n });\n\n test('complex transformation', () => {\n const transformation = { a: { b: { c: transformationValue } } };\n\n expect(\n validateRequestTransformation(transformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: transformationValue,\n description: expectedValidationMessage,\n }),\n );\n });\n },\n );\n });\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EAAEG;AAA8B,CAAC,GAAGC,YAAU;AAEpDC,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9CA,QAAQ,CAAC,uBAAuB,EAAE,MAAM;IACtC,MAAMC,YAAY,GAAG;MAAEC,OAAO,EAAE,IAAI;MAAEC,gBAAgB,EAAE;IAAG,CAAC;IAE5DC,IAAI,CAAC,yEAAyE,EAAE,MAAM;MACpF,MAAMC,mBAAmB,GAAG,YAAY;MAExCC,MAAM,CAACR,6BAA6B,CAACO,mBAAmB,CAAC,CAAC,CAACE,aAAa,CACtEN,YACF,CAAC;IACH,CAAC,CAAC;IAEFG,IAAI,CAAC,0EAA0E,EAAE,MAAM;MACrF,MAAMC,mBAAmB,GAAG;QAAEG,CAAC,EAAE;MAAa,CAAC;MAE/CF,MAAM,CAACR,6BAA6B,CAACO,mBAAmB,CAAC,CAAC,CAACE,aAAa,CACtEN,YACF,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFD,QAAQ,CAAC,yBAAyB,EAAE,MAAM;IACxC,MAAMS,mBAAmB,GAAGA,CAAC;MAC3BC,UAAU;MACVC,YAAY;MACZC;IACF,CAAC,MAAM;MACLV,OAAO,EAAE,KAAK;MACdC,gBAAgB,EAAEG,MAAM,CAACO,eAAe,CAAC,CACvCP,MAAM,CAACQ,gBAAgB,CAAC;QACtBJ,UAAU;QACVC,YAAY;QACZC;MACF,CAAC,CAAC,CACH;IACH,CAAC,CAAC;IAEFZ,QAAQ,CAAC,qCAAqC,EAAE,MAAM;MACpDI,IAAI,CAACW,IAA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CAAC,IAAI,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CACjD,IAAI,EACHyB,YAAY,IAAK;UAChB,MAAMD,mBAAmB,GAAI,YAAWC,YAAa,EAAC;UACtD;UACA,MAAMvB,yBAAyB,GAAI,mBAAkBuB,YAAa,2BAA0BA,YAAa,UAAS;UAElHpC,IAAI,CAAC,uBAAuB,EAAE,MAAM;YAClCE,MAAM,CACJR,6BAA6B,CAACyC,mBAAmB,CACnD,CAAC,CAAChC,aAAa,CACbE,mBAAmB,CAAC;cAClBC,UAAU,EAAE,IAAI;cAChBC,YAAY,EAAE4B,mBAAmB;cACjC3B,WAAW,EAAEK;YACf,CAAC,CACH,CAAC;UACH,CAAC,CAAC;UAEFb,IAAI,CAAC,wBAAwB,EAAE,MAAM;YACnC,MAAMc,cAAc,GAAG;cAAEV,CAAC,EAAE;gBAAE4B,CAAC,EAAE;kBAAEC,CAAC,EAAEE;gBAAoB;cAAE;YAAE,CAAC;YAE/DjC,MAAM,CACJR,6BAA6B,CAACoB,cAAc,CAC9C,CAAC,CAACX,aAAa,CACbE,mBAAmB,CAAC;cAClBC,UAAU,EAAE,OAAO;cACnBC,YAAY,EAAE4B,mBAAmB;cACjC3B,WAAW,EAAEK;YACf,CAAC,CACH,CAAC;UACH,CAAC,CAAC;QACJ,CACF,CAAC;MACH,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_motionRuntimeTestContext","require","_lodash","_","validateRequestTransformation","validation","describe","validResults","isValid","validationErrors","test","validTransformation","expect","toStrictEqual","a","validationErrorWith","parentPath","invalidValue","description","arrayContaining","objectContaining","each","transformationKey","expectedValidationMessage","transformation","d","e","f","parentKey","aString","invalidSourceValue","invalidSourceTransformation","times","invalidTransformation","expectedParentPath","transformationWithOmitValue","value","nonArray","nonStringArray","aNumber","arrayWithInvalidPaths","invalidCustomFunctionCallExpression","b","c","invalidCustomFunctionExpression","transformationValue","specialField"],"sources":["../../../../src/__tests__/validations/validateRequestTransformation.spec.ts"],"sourcesContent":["import { aNumber, aString } from '@wix/motion-runtime-test-context';\nimport { times } from 'lodash';\n\nimport { validation } from '../..';\n\nconst { validateRequestTransformation } = validation;\n\ndescribe('validateRequestTransformation', () => {\n describe('valid transformations', () => {\n const validResults = { isValid: true, validationErrors: [] };\n\n test('returns valid transformation response for a valid simple transformation', () => {\n const validTransformation = '$[0].a.b.c';\n\n expect(validateRequestTransformation(validTransformation)).toStrictEqual(\n validResults,\n );\n });\n\n test('returns valid transformation response for a valid complex transformation', () => {\n const validTransformation = { a: '$[0].a.b.c' };\n\n expect(validateRequestTransformation(validTransformation)).toStrictEqual(\n validResults,\n );\n });\n });\n\n describe('invalid transformations', () => {\n const validationErrorWith = ({\n parentPath,\n invalidValue,\n description,\n }) => ({\n isValid: false,\n validationErrors: expect.arrayContaining([\n expect.objectContaining({\n parentPath,\n invalidValue,\n description,\n }),\n ]),\n });\n\n describe('invalid complex-transformation keys', () => {\n test.each`\n description | transformationKey | expectedValidationMessage\n ${'refers to an argument index'} | ${'$[0]'} | ${\"must start with '$.'\"}\n ${'refers to a custom function'} | ${'#someFunction'} | ${'cannot be a custom function call'}\n `(\n 'returns a validation error when a transformation value segment $description',\n ({ transformationKey, expectedValidationMessage }) => {\n const transformation = {\n d: { e: { f: { [transformationKey]: '$[0].a.b.c' } } },\n '*': '$[1]',\n };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'd.e.f',\n invalidValue: transformationKey,\n description: expectedValidationMessage,\n }),\n );\n },\n );\n });\n\n describe('invalid transformations values', () => {\n describe('omit transformation', () => {\n const parentKey = aString();\n\n describe('invalid source', () => {\n const invalidSourceValue = '$[x].a.b.c';\n const invalidSourceTransformation = {\n '@source': invalidSourceValue,\n '@omit': times(2, () => aString()),\n };\n\n test.each`\n description | invalidTransformation | expectedParentPath\n ${'top level'} | ${invalidSourceTransformation} | ${'@source'}\n ${'nested'} | ${{ [parentKey]: invalidSourceTransformation }} | ${`${parentKey}.@source`}\n `(\n 'returns a validation error when the @source value is invalid',\n ({ invalidTransformation, expectedParentPath }) => {\n expect(\n validateRequestTransformation(invalidTransformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: expectedParentPath,\n invalidValue: invalidSourceValue,\n description: 'must start with $[N] where N is an index',\n }),\n );\n },\n );\n });\n\n describe('invalid @omit', () => {\n const transformationWithOmitValue = (value) => ({\n '@source': '$[0].a.b.c',\n '@omit': value,\n });\n\n const nonArray = aString();\n const nonStringArray = times(2, () => aNumber());\n const arrayWithInvalidPaths = ['a.b.c', aString()];\n\n describe.each`\n description | invalidTransformation | expectedParentPath\n ${'top level'} | ${transformationWithOmitValue(nonArray)} | ${'@omit'}\n ${'nested'} | ${{ [parentKey]: transformationWithOmitValue(nonArray) }} | ${`${parentKey}.@omit`}\n `(\n '@omit is not an array',\n ({ invalidTransformation, expectedParentPath }) => {\n test('returns a validation error', () => {\n expect(\n validateRequestTransformation(invalidTransformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: expectedParentPath,\n invalidValue: nonArray,\n description: 'must be an array of strings',\n }),\n );\n });\n },\n );\n\n describe.each`\n description | invalidTransformation | expectedParentPath\n ${'top level'} | ${transformationWithOmitValue(nonStringArray)} | ${'@omit'}\n ${'nested'} | ${{ [parentKey]: transformationWithOmitValue(nonStringArray) }} | ${`${parentKey}.@omit`}\n `(\n '@omit is an array of non-strings',\n ({ invalidTransformation, expectedParentPath }) => {\n test('return a validation error', () => {\n expect(\n validateRequestTransformation(invalidTransformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: expectedParentPath,\n invalidValue: nonStringArray,\n description: 'must be an array of strings',\n }),\n );\n });\n },\n );\n\n /* eslint-disable max-len */\n describe.each`\n description | invalidTransformation | expectedParentPath\n ${'top level'} | ${transformationWithOmitValue(arrayWithInvalidPaths)} | ${'@omit'}\n ${'nested'} | ${{ [parentKey]: transformationWithOmitValue(arrayWithInvalidPaths) }} | ${`${parentKey}.@omit`}\n `(\n '@omit is an array with invalid string paths',\n ({ description, invalidTransformation, expectedParentPath }) => {\n /* eslint-enable max-len */\n test(`returns a validation error for invalid ${description} transformation`, () => {\n expect(\n validateRequestTransformation(invalidTransformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: expectedParentPath,\n invalidValue: arrayWithInvalidPaths,\n description: 'must contain non-nested paths only',\n }),\n );\n });\n },\n );\n });\n });\n\n describe('custom function expressions', () => {\n test('returns a validation error when an invalid custom function-name is used', () => {\n const invalidCustomFunctionCallExpression = '#1a';\n const transformation = {\n a: { b: { c: invalidCustomFunctionCallExpression } },\n };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: invalidCustomFunctionCallExpression,\n description: 'contains an invalid custom function expression',\n }),\n );\n });\n\n test('returns a validation error when a custom function argument is invalid for request transformation', () => {\n const invalidCustomFunctionExpression = '#someFunction($.id)';\n const transformation = {\n a: { b: { c: invalidCustomFunctionExpression } },\n };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: '$.id',\n description: 'must start with $[N] where N is an index',\n }),\n );\n });\n\n describe('#constant function', () => {\n test('returns a validation error when passed value is not a valid json value', () => {\n const invalidCustomFunctionExpression = '#constant(not-json)';\n const transformation = {\n a: { b: { c: invalidCustomFunctionExpression } },\n };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: 'not-json',\n description: 'must be a valid json value',\n }),\n );\n });\n\n test('allows passing non json-path arguments to the #constant function', () => {\n const transformation = { a: { b: { c: '#constant(\"abc\")' } } };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n {\n isValid: true,\n validationErrors: [],\n },\n );\n });\n });\n });\n\n /* eslint-disable max-len */\n describe.each`\n description | transformationValue | expectedValidationMessage\n ${'does not start with $[N] where N is a numeric index'} | ${'$[x].a.b.c'} | ${'must start with $[N] where N is an index'}\n ${'is not a valid json-path'} | ${'@'} | ${'must start with $[N] where N is an index'}\n ${'has several arguments referred to in the transformation'} | ${'$[0].$[1]'} | ${'must have a single argument-index as the first path segment'}\n ${'refers to * in the path'} | ${'$[0].a.b.*'} | ${'cannot refer to the * operator'}\n `(\n /* eslint-enable max-len */\n 'returns a validation error when a transformation value segment $description',\n ({ transformationValue, expectedValidationMessage }) => {\n test('simple transformation', () => {\n expect(\n validateRequestTransformation(transformationValue),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: null,\n invalidValue: transformationValue,\n description: expectedValidationMessage,\n }),\n );\n });\n\n test('complex transformation', () => {\n const transformation = { a: { b: { c: transformationValue } } };\n\n expect(validateRequestTransformation(transformation)).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: transformationValue,\n description: expectedValidationMessage,\n }),\n );\n });\n },\n );\n\n describe('special fields', () => {\n describe.each(['id', 'createdDate', 'updatedDate'])(\n '%s',\n (specialField) => {\n const transformationValue = `$[0].a.b.${specialField}`;\n // eslint-disable-next-line max-len\n const expectedValidationMessage = `cannot refer to ${specialField} field, consider using _${specialField} instead`;\n\n test('simple transformation', () => {\n expect(\n validateRequestTransformation(transformationValue),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: null,\n invalidValue: transformationValue,\n description: expectedValidationMessage,\n }),\n );\n });\n\n test('complex transformation', () => {\n const transformation = { a: { b: { c: transformationValue } } };\n\n expect(\n validateRequestTransformation(transformation),\n ).toStrictEqual(\n validationErrorWith({\n parentPath: 'a.b.c',\n invalidValue: transformationValue,\n description: expectedValidationMessage,\n }),\n );\n });\n },\n );\n });\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAEA,MAAM;EAAEG;AAA8B,CAAC,GAAGC,YAAU;AAEpDC,QAAQ,CAAC,+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