@wix/motion-edm-autogen-transformations-core 1.26.0 → 1.27.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 (104) hide show
  1. package/dist/cjs/__tests__/corvid-entity.spec.js +4 -2
  2. package/dist/cjs/__tests__/corvid-entity.spec.js.map +1 -1
  3. package/dist/cjs/__tests__/reduceTransformation.spec.js +1 -3
  4. package/dist/cjs/__tests__/reduceTransformation.spec.js.map +1 -1
  5. package/dist/cjs/__tests__/transformations/preset/create-transformation.spec.js +6 -3
  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 +9 -4
  8. package/dist/cjs/__tests__/transformations/preset/delete-transformation.spec.js.map +1 -1
  9. package/dist/cjs/__tests__/transformations/preset/get-transformation.spec.js +6 -3
  10. package/dist/cjs/__tests__/transformations/preset/get-transformation.spec.js.map +1 -1
  11. package/dist/cjs/__tests__/transformations/preset/list-transformation.spec.js +6 -3
  12. package/dist/cjs/__tests__/transformations/preset/list-transformation.spec.js.map +1 -1
  13. package/dist/cjs/__tests__/transformations/preset/query-transformation.spec.js +7 -6
  14. package/dist/cjs/__tests__/transformations/preset/query-transformation.spec.js.map +1 -1
  15. package/dist/cjs/__tests__/transformations/preset/update-transformation.spec.js +6 -3
  16. package/dist/cjs/__tests__/transformations/preset/update-transformation.spec.js.map +1 -1
  17. package/dist/cjs/__tests__/validations/validateRequestTransformation.spec.js +3 -1
  18. package/dist/cjs/__tests__/validations/validateRequestTransformation.spec.js.map +1 -1
  19. package/dist/cjs/__tests__/validations/validateResponseTransformation.spec.js +3 -1
  20. package/dist/cjs/__tests__/validations/validateResponseTransformation.spec.js.map +1 -1
  21. package/dist/cjs/index.js +13 -16
  22. package/dist/cjs/index.js.map +1 -1
  23. package/dist/cjs/lib/corvid-entity/index.js +2 -4
  24. package/dist/cjs/lib/corvid-entity/index.js.map +1 -1
  25. package/dist/cjs/lib/helpers.js +10 -10
  26. package/dist/cjs/lib/helpers.js.map +1 -1
  27. package/dist/cjs/lib/transformations/common.js +1 -2
  28. package/dist/cjs/lib/transformations/common.js.map +1 -1
  29. package/dist/cjs/lib/transformations/constants.js +2 -4
  30. package/dist/cjs/lib/transformations/constants.js.map +1 -1
  31. package/dist/cjs/lib/transformations/preset/delete.js +3 -1
  32. package/dist/cjs/lib/transformations/preset/delete.js.map +1 -1
  33. package/dist/cjs/lib/transformations/preset/query.js +9 -7
  34. package/dist/cjs/lib/transformations/preset/query.js.map +1 -1
  35. package/dist/cjs/lib/transformations/reduceTransformation.js +46 -36
  36. package/dist/cjs/lib/transformations/reduceTransformation.js.map +1 -1
  37. package/dist/cjs/lib/transformations/validations/common.js +4 -2
  38. package/dist/cjs/lib/transformations/validations/common.js.map +1 -1
  39. package/dist/cjs/lib/transformations/validations/validateRequestTransformation.js +3 -5
  40. package/dist/cjs/lib/transformations/validations/validateRequestTransformation.js.map +1 -1
  41. package/dist/cjs/lib/transformations/validations/validateResponseTransformation.js +7 -6
  42. package/dist/cjs/lib/transformations/validations/validateResponseTransformation.js.map +1 -1
  43. package/dist/esm/__tests__/corvid-entity.spec.js +30 -24
  44. package/dist/esm/__tests__/corvid-entity.spec.js.map +1 -1
  45. package/dist/esm/__tests__/getArgumentCardinality.spec.js +20 -25
  46. package/dist/esm/__tests__/getArgumentCardinality.spec.js.map +1 -1
  47. package/dist/esm/__tests__/helpers.spec.js +37 -29
  48. package/dist/esm/__tests__/helpers.spec.js.map +1 -1
  49. package/dist/esm/__tests__/reduceTransformation.spec.js +147 -149
  50. package/dist/esm/__tests__/reduceTransformation.spec.js.map +1 -1
  51. package/dist/esm/__tests__/transformations/custom-functions.spec.js +62 -59
  52. package/dist/esm/__tests__/transformations/custom-functions.spec.js.map +1 -1
  53. package/dist/esm/__tests__/transformations/preset/create-transformation.spec.js +24 -26
  54. package/dist/esm/__tests__/transformations/preset/create-transformation.spec.js.map +1 -1
  55. package/dist/esm/__tests__/transformations/preset/delete-transformation.spec.js +39 -43
  56. package/dist/esm/__tests__/transformations/preset/delete-transformation.spec.js.map +1 -1
  57. package/dist/esm/__tests__/transformations/preset/get-transformation.spec.js +22 -24
  58. package/dist/esm/__tests__/transformations/preset/get-transformation.spec.js.map +1 -1
  59. package/dist/esm/__tests__/transformations/preset/list-transformation.spec.js +11 -11
  60. package/dist/esm/__tests__/transformations/preset/list-transformation.spec.js.map +1 -1
  61. package/dist/esm/__tests__/transformations/preset/query-transformation.spec.js +29 -30
  62. package/dist/esm/__tests__/transformations/preset/query-transformation.spec.js.map +1 -1
  63. package/dist/esm/__tests__/transformations/preset/update-transformation.spec.js +58 -62
  64. package/dist/esm/__tests__/transformations/preset/update-transformation.spec.js.map +1 -1
  65. package/dist/esm/__tests__/validations/validateRequestTransformation.spec.js +94 -82
  66. package/dist/esm/__tests__/validations/validateRequestTransformation.spec.js.map +1 -1
  67. package/dist/esm/__tests__/validations/validateResponseTransformation.spec.js +130 -107
  68. package/dist/esm/__tests__/validations/validateResponseTransformation.spec.js.map +1 -1
  69. package/dist/esm/index.js +22 -22
  70. package/dist/esm/index.js.map +1 -1
  71. package/dist/esm/lib/corvid-entity/index.js +6 -10
  72. package/dist/esm/lib/corvid-entity/index.js.map +1 -1
  73. package/dist/esm/lib/getArgumentCardinality.js +15 -21
  74. package/dist/esm/lib/getArgumentCardinality.js.map +1 -1
  75. package/dist/esm/lib/helpers.js +26 -40
  76. package/dist/esm/lib/helpers.js.map +1 -1
  77. package/dist/esm/lib/transformations/common.js +2 -5
  78. package/dist/esm/lib/transformations/common.js.map +1 -1
  79. package/dist/esm/lib/transformations/constants.js +2 -2
  80. package/dist/esm/lib/transformations/constants.js.map +1 -1
  81. package/dist/esm/lib/transformations/custom-functions.js +11 -14
  82. package/dist/esm/lib/transformations/custom-functions.js.map +1 -1
  83. package/dist/esm/lib/transformations/preset/create.js +1 -4
  84. package/dist/esm/lib/transformations/preset/create.js.map +1 -1
  85. package/dist/esm/lib/transformations/preset/delete.js +9 -13
  86. package/dist/esm/lib/transformations/preset/delete.js.map +1 -1
  87. package/dist/esm/lib/transformations/preset/get.js +1 -4
  88. package/dist/esm/lib/transformations/preset/get.js.map +1 -1
  89. package/dist/esm/lib/transformations/preset/list.js +1 -3
  90. package/dist/esm/lib/transformations/preset/list.js.map +1 -1
  91. package/dist/esm/lib/transformations/preset/query.js +17 -24
  92. package/dist/esm/lib/transformations/preset/query.js.map +1 -1
  93. package/dist/esm/lib/transformations/preset/update.js +3 -4
  94. package/dist/esm/lib/transformations/preset/update.js.map +1 -1
  95. package/dist/esm/lib/transformations/reduceTransformation.js +33 -44
  96. package/dist/esm/lib/transformations/reduceTransformation.js.map +1 -1
  97. package/dist/esm/lib/transformations/validations/common.js +17 -20
  98. package/dist/esm/lib/transformations/validations/common.js.map +1 -1
  99. package/dist/esm/lib/transformations/validations/validateRequestTransformation.js +35 -44
  100. package/dist/esm/lib/transformations/validations/validateRequestTransformation.js.map +1 -1
  101. package/dist/esm/lib/transformations/validations/validateResponseTransformation.js +57 -69
  102. package/dist/esm/lib/transformations/validations/validateResponseTransformation.js.map +1 -1
  103. package/dist/tsconfig.tsbuildinfo +1 -1
  104. package/package.json +6 -6
@@ -1,87 +1,90 @@
1
- import { __makeTemplateObject } from "tslib";
2
1
  import { aString } from '@wix/motion-runtime-test-context';
3
2
  import { set, times } from 'lodash';
4
3
  import { isFunctionCallExpression, parseCustomFunctionCall } from '../..';
5
4
  import { runCustomFunctionCallExpression } from '../../lib/transformations/custom-functions';
6
- describe('parseCustomFunctionCall', function () {
5
+ describe('parseCustomFunctionCall', () => {
7
6
  /* eslint-disable max-len */
8
- test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n argumentCount | argumentExpressions | expectedArgumentExpressions\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n argumentCount | argumentExpressions | expectedArgumentExpressions\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), 'a single argument', '$[0].some.path', ['$[0].some.path'], 'multiple arguments', '$[0].some.path,someString', ['$[0].some.path', 'someString'], 'multiple arguments with whitespaces', '$[0].some.path, someString , $[1]', ['$[0].some.path', 'someString', '$[1]'], 'no arguments', '', [])(
7
+ test.each `
8
+ argumentCount | argumentExpressions | expectedArgumentExpressions
9
+ ${'a single argument'} | ${'$[0].some.path'} | ${['$[0].some.path']}
10
+ ${'multiple arguments'} | ${'$[0].some.path,someString'} | ${['$[0].some.path', 'someString']}
11
+ ${'multiple arguments with whitespaces'} | ${'$[0].some.path, someString , $[1]'} | ${['$[0].some.path', 'someString', '$[1]']}
12
+ ${'no arguments'} | ${''} | ${[]}
13
+ `(
9
14
  /* eslint-enable max-len */
10
- 'parses a custom-function call applied with $argumentCount', function (_a) {
11
- var argumentExpressions = _a.argumentExpressions, expectedArgumentExpressions = _a.expectedArgumentExpressions;
12
- var functionName = aString();
13
- var functionExpression = "#".concat(functionName, "(").concat(argumentExpressions, ")");
15
+ 'parses a custom-function call applied with $argumentCount', ({ argumentExpressions, expectedArgumentExpressions }) => {
16
+ const functionName = aString();
17
+ const functionExpression = `#${functionName}(${argumentExpressions})`;
14
18
  expect(parseCustomFunctionCall(functionExpression)).toStrictEqual({
15
- functionName: functionName,
19
+ functionName,
16
20
  argumentExpressions: expectedArgumentExpressions,
17
21
  });
18
22
  });
19
23
  });
20
- describe('isFunctionCallExpression', function () {
21
- test.each(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n description | expression | expectedResult\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n description | expression | expectedResult\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), 'a #-prefixed with a valid function name', '#someInvalidName$#@#>', true, 'a non-# prefixed with a valid function name', 'someFunctions($[1])', false, 'a non-string value', [1, 2, 3], false)('returns $expectedResult when $description function call expression is provided', function (_a) {
22
- var expression = _a.expression, expectedResult = _a.expectedResult;
24
+ describe('isFunctionCallExpression', () => {
25
+ test.each `
26
+ description | expression | expectedResult
27
+ ${'a #-prefixed with a valid function name'} | ${'#someInvalidName$#@#>'} | ${true}
28
+ ${'a non-# prefixed with a valid function name'} | ${'someFunctions($[1])'} | ${false}
29
+ ${'a non-string value'} | ${[1, 2, 3]} | ${false}
30
+ `('returns $expectedResult when $description function call expression is provided', ({ expression, expectedResult }) => {
23
31
  expect(isFunctionCallExpression(expression)).toStrictEqual(expectedResult);
24
32
  });
25
33
  });
26
- describe('runCustomFunctionCallExpression', function () {
27
- var value = aString();
28
- var transformationParentPath = aString();
29
- var joinWithDots = function () {
30
- var args = [];
31
- for (var _i = 0; _i < arguments.length; _i++) {
32
- args[_i] = arguments[_i];
33
- }
34
- return args.join('|');
35
- };
36
- describe.each(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n argumentCount | argumentValues | expectedResult\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n argumentCount | argumentValues | expectedResult\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), 'single', [value], value, 'multi', [value, value], "".concat(value, "|").concat(value), 'no', [], '')('$argumentCount-argument expression', function (_a) {
37
- var argumentValues = _a.argumentValues, expectedResult = _a.expectedResult;
38
- describe.each(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n functionName | description\n ", " | ", "\n ", " | ", "\n "], ["\n functionName | description\n ", " | ", "\n ", " | ", "\n "])), 'someFunction', 'an unscoped', 'someScope.someFunction', 'a scoped')('$description custom function', function (_a) {
39
- var functionName = _a.functionName;
40
- var customFunctions = set({}, functionName, joinWithDots);
41
- test('runs it and returns its result', function () {
42
- var result = runCustomFunctionCallExpression({
43
- functionName: functionName,
44
- customFunctions: customFunctions,
45
- argumentValues: argumentValues,
46
- transformationParentPath: transformationParentPath,
34
+ describe('runCustomFunctionCallExpression', () => {
35
+ const value = aString();
36
+ const transformationParentPath = aString();
37
+ const joinWithDots = (...args) => args.join('|');
38
+ describe.each `
39
+ argumentCount | argumentValues | expectedResult
40
+ ${'single'} | ${[value]} | ${value}
41
+ ${'multi'} | ${[value, value]} | ${`${value}|${value}`}
42
+ ${'no'} | ${[]} | ${''}
43
+ `('$argumentCount-argument expression', ({ argumentValues, expectedResult }) => {
44
+ describe.each `
45
+ functionName | description
46
+ ${'someFunction'} | ${'an unscoped'}
47
+ ${'someScope.someFunction'} | ${'a scoped'}
48
+ `('$description custom function', ({ functionName }) => {
49
+ const customFunctions = set({}, functionName, joinWithDots);
50
+ test('runs it and returns its result', () => {
51
+ const result = runCustomFunctionCallExpression({
52
+ functionName,
53
+ customFunctions,
54
+ argumentValues,
55
+ transformationParentPath,
47
56
  });
48
57
  expect(result).toStrictEqual(expectedResult);
49
58
  });
50
59
  });
51
60
  });
52
- describe('error handling', function () {
53
- var argumentValues = times(2, function () { return aString(); });
54
- test('throws when the function is not recognized', function () {
55
- var customFunctions = {};
56
- expect(function () {
57
- return runCustomFunctionCallExpression({
58
- functionName: 'someNonexistentFunction',
59
- customFunctions: customFunctions,
60
- argumentValues: argumentValues,
61
- transformationParentPath: transformationParentPath,
62
- });
63
- }).toThrow("unrecognized custom function \"someNonexistentFunction\"");
61
+ describe('error handling', () => {
62
+ const argumentValues = times(2, () => aString());
63
+ test('throws when the function is not recognized', () => {
64
+ const customFunctions = {};
65
+ expect(() => runCustomFunctionCallExpression({
66
+ functionName: 'someNonexistentFunction',
67
+ customFunctions,
68
+ argumentValues,
69
+ transformationParentPath,
70
+ })).toThrow(`unrecognized custom function "someNonexistentFunction"`);
64
71
  });
65
- test('throws an error when the function call throws an error', function () {
66
- var _a;
67
- var functionName = aString();
68
- var customFunctions = (_a = {},
69
- _a[functionName] = function () {
72
+ test('throws an error when the function call throws an error', () => {
73
+ const functionName = aString();
74
+ const customFunctions = {
75
+ [functionName]: () => {
70
76
  throw new Error('Something went wrong in the custom function');
71
77
  },
72
- _a);
73
- var t = function () {
74
- return runCustomFunctionCallExpression({
75
- functionName: functionName,
76
- customFunctions: customFunctions,
77
- argumentValues: argumentValues,
78
- transformationParentPath: transformationParentPath,
79
- });
80
78
  };
79
+ const t = () => runCustomFunctionCallExpression({
80
+ functionName,
81
+ customFunctions,
82
+ argumentValues,
83
+ transformationParentPath,
84
+ });
81
85
  expect(t).toThrow(Error);
82
- expect(t).toThrow(new RegExp("Transforming ".concat(transformationParentPath, " failed, #").concat(functionName, " threw: \"Something went wrong in the custom function\" for arguments: .+")));
86
+ expect(t).toThrow(new RegExp(`Transforming ${transformationParentPath} failed, #${functionName} threw: "Something went wrong in the custom function" for arguments: .+`));
83
87
  });
84
88
  });
85
89
  });
86
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
87
90
  //# sourceMappingURL=custom-functions.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-functions.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/transformations/custom-functions.spec.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAE7F,QAAQ,CAAC,yBAAyB,EAAE;IAClC,4BAA4B;IAC5B,IAAI,CAAC,IAAI,4ZAAA,+HAEL,EAAmB,uBAAwB,EAAgB,0BAA2B,EAAkB,QACxG,EAAoB,sBAAuB,EAA2B,eAAgB,EAAgC,QACtH,EAAqC,KAAM,EAAqC,KAAM,EAAwC,QAC9H,EAAc,4BAA6B,EAAE,wCAAyC,EAAE,MAC3F,KAJG,mBAAmB,EAAwB,gBAAgB,EAA2B,CAAC,gBAAgB,CAAC,EACxG,oBAAoB,EAAuB,2BAA2B,EAAgB,CAAC,gBAAgB,EAAE,YAAY,C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CAAC;QAEjD,IAAI,CAAC,4CAA4C,EAAE;YACjD,IAAM,eAAe,GAAG,EAAE,CAAC;YAE3B,MAAM,CAAC;gBACL,OAAA,+BAA+B,CAAC;oBAC9B,YAAY,EAAE,yBAAyB;oBACvC,eAAe,iBAAA;oBACf,cAAc,gBAAA;oBACd,wBAAwB,0BAAA;iBACzB,CAAC;YALF,CAKE,CACH,CAAC,OAAO,CAAC,0DAAwD,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,wDAAwD,EAAE;;YAC7D,IAAM,YAAY,GAAG,OAAO,EAAE,CAAC;YAE/B,IAAM,eAAe;gBACnB,GAAC,YAAY,IAAG;oBACd,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;gBACjE,CAAC;mBACF,CAAC;YAEF,IAAM,CAAC,GAAG;gBACR,OAAA,+BAA+B,CAAC;oBAC9B,YAAY,cAAA;oBACZ,eAAe,iBAAA;oBACf,cAAc,gBAAA;oBACd,wBAAwB,0BAAA;iBACzB,CAAC;YALF,CAKE,CAAC;YAEL,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACzB,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CACf,IAAI,MAAM,CACR,uBAAgB,wBAAwB,uBAAa,YAAY,8EAAyE,CAC3I,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"custom-functions.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/transformations/custom-functions.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,+BAA+B,EAAE,MAAM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AAC,GAAG,EAAE,CACV,+BAA+B,CAAC;gBAC9B,YAAY,EAAE,yBAAyB;gBACvC,eAAe;gBACf,cAAc;gBACd,wBAAwB;aACzB,CAAC,CACH,CAAC,OAAO,CAAC,wDAAwD,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,wDAAwD,EAAE,GAAG,EAAE;YAClE,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC;YAE/B,MAAM,eAAe,GAAG;gBACtB,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE;oBACnB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;gBACjE,CAAC;aACF,CAAC;YAEF,MAAM,CAAC,GAAG,GAAG,EAAE,CACb,+BAA+B,CAAC;gBAC9B,YAAY;gBACZ,eAAe;gBACf,cAAc;gBACd,wBAAwB;aACzB,CAAC,CAAC;YAEL,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACzB,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CACf,IAAI,MAAM,CACR,gBAAgB,wBAAwB,aAAa,YAAY,yEAAyE,CAC3I,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,39 +1,37 @@
1
1
  import { aString } from '@wix/motion-runtime-test-context';
2
2
  import { times } from 'lodash';
3
3
  import { preset } from '../../..';
4
- var _a = preset.create, buildRequestTransformation = _a.buildRequestTransformation, buildResponseTransformation = _a.buildResponseTransformation;
5
- describe('create-method transformations', function () {
6
- describe('buildRequestTransformation', function () {
7
- test('creates a transformation that maps the first argument into requestMessageEntityPath', function () {
8
- var _a;
9
- var requestMessageEntityPath = aString();
10
- var tranformationObject = buildRequestTransformation({
11
- requestMessageEntityPath: requestMessageEntityPath,
4
+ const { create: { buildRequestTransformation, buildResponseTransformation }, } = preset;
5
+ describe('create-method transformations', () => {
6
+ describe('buildRequestTransformation', () => {
7
+ test('creates a transformation that maps the first argument into requestMessageEntityPath', () => {
8
+ const requestMessageEntityPath = aString();
9
+ const tranformationObject = buildRequestTransformation({
10
+ requestMessageEntityPath,
11
+ });
12
+ expect(tranformationObject).toStrictEqual({
13
+ [requestMessageEntityPath]: '$[0]',
12
14
  });
13
- expect(tranformationObject).toStrictEqual((_a = {},
14
- _a[requestMessageEntityPath] = '$[0]',
15
- _a));
16
15
  });
17
- test('supports nested paths', function () {
18
- var _a, _b;
16
+ test('supports nested paths', () => {
19
17
  // @ts-expect-error
20
- var entityPathSegments = times(2, aString);
21
- var requestMessageEntityPath = entityPathSegments.join('.');
22
- var tranformationObject = buildRequestTransformation({
23
- requestMessageEntityPath: requestMessageEntityPath,
18
+ const entityPathSegments = times(2, aString);
19
+ const requestMessageEntityPath = entityPathSegments.join('.');
20
+ const tranformationObject = buildRequestTransformation({
21
+ requestMessageEntityPath,
22
+ });
23
+ expect(tranformationObject).toStrictEqual({
24
+ [entityPathSegments[0]]: { [entityPathSegments[1]]: '$[0]' },
24
25
  });
25
- expect(tranformationObject).toStrictEqual((_a = {},
26
- _a[entityPathSegments[0]] = (_b = {}, _b[entityPathSegments[1]] = '$[0]', _b),
27
- _a));
28
26
  });
29
27
  });
30
- describe('buildResponseTransformation', function () {
31
- test('unwraps the value of the provided property-path', function () {
32
- var responseMessageResultPath = aString();
33
- var tranformationString = buildResponseTransformation({
34
- responseMessageResultPath: responseMessageResultPath,
28
+ describe('buildResponseTransformation', () => {
29
+ test('unwraps the value of the provided property-path', () => {
30
+ const responseMessageResultPath = aString();
31
+ const tranformationString = buildResponseTransformation({
32
+ responseMessageResultPath,
35
33
  });
36
- expect(tranformationString).toStrictEqual("$.".concat(responseMessageResultPath));
34
+ expect(tranformationString).toStrictEqual(`$.${responseMessageResultPath}`);
37
35
  });
38
36
  });
39
37
  });
@@ -1 +1 @@
1
- {"version":3,"file":"create-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/create-transformation.spec.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AyB,2BAAA;aAC1B,CAAC,CAAC;YAEH,MAAM,CAAC,mBAAmB,CAAC,CAAC,aAAa,CACvC,YAAK,yBAAyB,CAAE,CACjC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"create-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/create-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,EACJ,MAAM,EAAE,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,GACpE,GAAG,MAAM,CAAC;AAEX,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAC1C,IAAI,CAAC,qFAAqF,EAAE,GAAG,EAAE;YAC/F,MAAM,wBAAwB,GAAG,OAAO,EAAE,CAAC;YAE3C,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;gBACrD,wBAAwB;aACzB,CAAC,CAAC;YAEH,MAAM,CAAC,mBAAmB,CAAC,CAAC,aAAa,CAAC;gBACxC,CAAC,wBAAwB,CAAC,EAAE,MAAM;aACnC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,uBAAuB,EAAE,GAAG,EAAE;YACjC,mBAAmB;YACnB,MAAM,kBAAkB,GAAG,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAC7C,MAAM,wBAAwB,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAE9D,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;gBACrD,wBAAwB;aACzB,CAAC,CAAC;YAEH,MAAM,CAAC,mBAAmB,CAAC,CAAC,aAAa,CAAC;gBACxC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE;aAC7D,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QAC3C,IAAI,CAAC,iDAAiD,EAAE,GAAG,EAAE;YAC3D,MAAM,yBAAyB,GAAG,OAAO,EAAE,CAAC;YAE5C,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;gBACtD,yBAAyB;aAC1B,CAAC,CAAC;YAEH,MAAM,CAAC,mBAAmB,CAAC,CAAC,aAAa,CACvC,KAAK,yBAAyB,EAAE,CACjC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,63 +1,59 @@
1
1
  import { aString } from '@wix/motion-runtime-test-context';
2
2
  import { times } from 'lodash';
3
3
  import { preset, transformations } from '../../..';
4
- var RESPONSE_OBJECT_UNCHANGED = transformations.RESPONSE_OBJECT_UNCHANGED;
5
- var _a = preset.delete, buildRequestTransformation = _a.buildRequestTransformation, buildResponseTransformation = _a.buildResponseTransformation;
6
- describe('delete-method transformations', function () {
7
- describe('buildRequestTransformation', function () {
8
- var requestMessageIdentifierPath = aString();
9
- test('creates a transformation that maps the first argument into requestMessageIdentifierPath', function () {
10
- var _a;
11
- var transformationObject = buildRequestTransformation({
12
- requestMessageIdentifierPath: requestMessageIdentifierPath,
4
+ const { RESPONSE_OBJECT_UNCHANGED } = transformations;
5
+ const { delete: { buildRequestTransformation, buildResponseTransformation }, } = preset;
6
+ describe('delete-method transformations', () => {
7
+ describe('buildRequestTransformation', () => {
8
+ const requestMessageIdentifierPath = aString();
9
+ test('creates a transformation that maps the first argument into requestMessageIdentifierPath', () => {
10
+ const transformationObject = buildRequestTransformation({
11
+ requestMessageIdentifierPath,
12
+ });
13
+ expect(transformationObject).toStrictEqual({
14
+ [requestMessageIdentifierPath]: '$[0]',
13
15
  });
14
- expect(transformationObject).toStrictEqual((_a = {},
15
- _a[requestMessageIdentifierPath] = '$[0]',
16
- _a));
17
16
  });
18
- test("creates a transformation that maps the 2nd argument into requestMessageOptionsPath when provided", function () {
19
- var _a;
20
- var requestMessageOptionsPath = aString();
21
- var transformationObject = buildRequestTransformation({
22
- requestMessageIdentifierPath: requestMessageIdentifierPath,
23
- requestMessageOptionsPath: requestMessageOptionsPath,
17
+ test(`creates a transformation that maps the 2nd argument into requestMessageOptionsPath when provided`, () => {
18
+ const requestMessageOptionsPath = aString();
19
+ const transformationObject = buildRequestTransformation({
20
+ requestMessageIdentifierPath,
21
+ requestMessageOptionsPath,
22
+ });
23
+ expect(transformationObject).toStrictEqual({
24
+ [requestMessageIdentifierPath]: '$[0]',
25
+ [requestMessageOptionsPath]: '$[1]',
24
26
  });
25
- expect(transformationObject).toStrictEqual((_a = {},
26
- _a[requestMessageIdentifierPath] = '$[0]',
27
- _a[requestMessageOptionsPath] = '$[1]',
28
- _a));
29
27
  });
30
- test('supports shared paths for requestMessageIdentifierPath and requestMessageOptionsPath', function () {
31
- var _a, _b;
32
- var sharedPath = aString();
33
- var identifierPathSegment = aString();
34
- var transformationObject = buildRequestTransformation({
35
- requestMessageIdentifierPath: "".concat(sharedPath, ".").concat(identifierPathSegment),
28
+ test('supports shared paths for requestMessageIdentifierPath and requestMessageOptionsPath', () => {
29
+ const sharedPath = aString();
30
+ const identifierPathSegment = aString();
31
+ const transformationObject = buildRequestTransformation({
32
+ requestMessageIdentifierPath: `${sharedPath}.${identifierPathSegment}`,
36
33
  requestMessageOptionsPath: sharedPath,
37
34
  });
38
- expect(transformationObject).toStrictEqual((_a = {},
39
- _a[sharedPath] = (_b = {}, _b[identifierPathSegment] = '$[0]', _b['*'] = '$[1]', _b),
40
- _a));
35
+ expect(transformationObject).toStrictEqual({
36
+ [sharedPath]: { [identifierPathSegment]: '$[0]', '*': '$[1]' },
37
+ });
41
38
  });
42
- test('supports nested paths', function () {
43
- var _a, _b, _c;
39
+ test('supports nested paths', () => {
44
40
  // @ts-expect-error
45
- var idPathSegments = times(2, aString);
41
+ const idPathSegments = times(2, aString);
46
42
  // @ts-expect-error
47
- var optionsPathSegments = times(2, aString);
48
- var transformationObject = buildRequestTransformation({
43
+ const optionsPathSegments = times(2, aString);
44
+ const transformationObject = buildRequestTransformation({
49
45
  requestMessageIdentifierPath: idPathSegments.join('.'),
50
46
  requestMessageOptionsPath: optionsPathSegments.join('.'),
51
47
  });
52
- expect(transformationObject).toStrictEqual((_a = {},
53
- _a[idPathSegments[0]] = (_b = {}, _b[idPathSegments[1]] = '$[0]', _b),
54
- _a[optionsPathSegments[0]] = (_c = {}, _c[optionsPathSegments[1]] = '$[1]', _c),
55
- _a));
48
+ expect(transformationObject).toStrictEqual({
49
+ [idPathSegments[0]]: { [idPathSegments[1]]: '$[0]' },
50
+ [optionsPathSegments[0]]: { [optionsPathSegments[1]]: '$[1]' },
51
+ });
56
52
  });
57
53
  });
58
- describe('buildResponseTransformation', function () {
59
- test('returns the identity transformation', function () {
60
- var trasformationString = buildResponseTransformation();
54
+ describe('buildResponseTransformation', () => {
55
+ test('returns the identity transformation', () => {
56
+ const trasformationString = buildResponseTransformation();
61
57
  expect(trasformationString).toStrictEqual(RESPONSE_OBJECT_UNCHANGED);
62
58
  });
63
59
  });
@@ -1 +1 @@
1
- {"version":3,"file":"delete-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/delete-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,IAAA,yBAAyB,GAAK,eAAe,0BAApB,CAAqB;AAEpD,IAAA,KACE,MAAM,OAD2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G,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACzC,mBAAmB;YACnB,IAAM,mBAAmB,GAAG,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAE9C,IAAM,oBAAoB,GAAG,0BAA0B,CAAC;gBACtD,4BAA4B,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;gBACtD,yBAAyB,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC;aACzD,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa;gBACxC,GAAC,cAAc,CAAC,CAAC,CAAC,cAAK,GAAC,cAAc,CAAC,CAAC,CAAC,IAAG,MAAM,KAAE;gBACpD,GAAC,mBAAmB,CAAC,CAAC,CAAC,cAAK,GAAC,mBAAmB,CAAC,CAAC,CAAC,IAAG,MAAM,KAAE;oBAC9D,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE;QACtC,IAAI,CAAC,qCAAqC,EAAE;YAC1C,IAAM,mBAAmB,GAAG,2BAA2B,EAAE,CAAC;YAE1D,MAAM,CAAC,mBAAmB,CAAC,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"delete-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/delete-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,EAAE,yBAAyB,EAAE,GAAG,eAAe,CAAC;AACtD,MAAM,EACJ,MAAM,EAAE,EAAE,0BAA0B,EAAE,2BAA2B,EA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,CAAC;QAEH,IAAI,CAAC,uBAAuB,EAAE,GAAG,EAAE;YACjC,mBAAmB;YACnB,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACzC,mBAAmB;YACnB,MAAM,mBAAmB,GAAG,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAE9C,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;gBACtD,4BAA4B,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;gBACtD,yBAAyB,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC;aACzD,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CAAC;gBACzC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE;gBACpD,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE;aAC/D,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QAC3C,IAAI,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC/C,MAAM,mBAAmB,GAAG,2BAA2B,EAAE,CAAC;YAE1D,MAAM,CAAC,mBAAmB,CAAC,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,38 +1,36 @@
1
1
  import { aString } from '@wix/motion-runtime-test-context';
2
2
  import { times } from 'lodash';
3
3
  import { preset } from '../../..';
4
- var _a = preset.get, buildRequestTransformation = _a.buildRequestTransformation, buildResponseTransformation = _a.buildResponseTransformation;
5
- describe('get-method transformations', function () {
6
- describe('buildRequestTransformation', function () {
7
- var requestMessageIdentifierPath = aString();
8
- test('creates a transformation that maps the first argument into requestMessageIdentifierPath', function () {
9
- var _a;
10
- var transformationObject = buildRequestTransformation({
11
- requestMessageIdentifierPath: requestMessageIdentifierPath,
4
+ const { get: { buildRequestTransformation, buildResponseTransformation }, } = preset;
5
+ describe('get-method transformations', () => {
6
+ describe('buildRequestTransformation', () => {
7
+ const requestMessageIdentifierPath = aString();
8
+ test('creates a transformation that maps the first argument into requestMessageIdentifierPath', () => {
9
+ const transformationObject = buildRequestTransformation({
10
+ requestMessageIdentifierPath,
11
+ });
12
+ expect(transformationObject).toStrictEqual({
13
+ [requestMessageIdentifierPath]: '$[0]',
12
14
  });
13
- expect(transformationObject).toStrictEqual((_a = {},
14
- _a[requestMessageIdentifierPath] = '$[0]',
15
- _a));
16
15
  });
17
- test('supports a nested path', function () {
18
- var _a, _b;
16
+ test('supports a nested path', () => {
19
17
  // @ts-expect-errora
20
- var idPathSegments = times(2, aString);
21
- var transformationObject = buildRequestTransformation({
18
+ const idPathSegments = times(2, aString);
19
+ const transformationObject = buildRequestTransformation({
22
20
  requestMessageIdentifierPath: idPathSegments.join('.'),
23
21
  });
24
- expect(transformationObject).toStrictEqual((_a = {},
25
- _a[idPathSegments[0]] = (_b = {}, _b[idPathSegments[1]] = '$[0]', _b),
26
- _a));
22
+ expect(transformationObject).toStrictEqual({
23
+ [idPathSegments[0]]: { [idPathSegments[1]]: '$[0]' },
24
+ });
27
25
  });
28
26
  });
29
- describe('buildResponseTransformation', function () {
30
- test('unwraps the value of the provided property-path', function () {
31
- var responseMessageResultPath = aString();
32
- var transformationString = buildResponseTransformation({
33
- responseMessageResultPath: responseMessageResultPath,
27
+ describe('buildResponseTransformation', () => {
28
+ test('unwraps the value of the provided property-path', () => {
29
+ const responseMessageResultPath = aString();
30
+ const transformationString = buildResponseTransformation({
31
+ responseMessageResultPath,
34
32
  });
35
- expect(transformationString).toStrictEqual("$.".concat(responseMessageResultPath));
33
+ expect(transformationString).toStrictEqual(`$.${responseMessageResultPath}`);
36
34
  });
37
35
  });
38
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"get-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/get-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGhC,IAAA,KACE,MAAM,IADwD,EAAzD,0BAA0B,gCAAA,EAAE,2BAA2B,iCAAE,CACvD;AAEX,QAAQ,CAAC,4BAA4B,EAAE;IACrC,QAAQ,CAAC,4BAA4B,EAAE;QACrC,IAAM,4BAA4B,GAAG,OAAO,EAAE,CAAC;QAE/C,IAAI,CAAC,yFAAyF,EAAE;;YAC9F,IAAM,oBAAoB,GAAG,0BAA0B,CAAC;gBACtD,4BAA4B,8BAAA;aAC7B,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa;gBACxC,GAAC,4BAA4B,IAAG,MAAM;oBACtC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,wBAAwB,EAAE;;YAC7B,oBAAoB;YACpB,IAAM,cAAc,GAAG,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAEzC,IAAM,oBAAoB,GAAG,0BAA0B,CAAC;gBACtD,4BAA4B,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;aACvD,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa;gBACxC,GAAC,cAAc,CAAC,CAAC,CAAC,cAAK,GAAC,cAAc,CAAC,CAAC,CAAC,IAAG,MAAM,KAAE;oBACpD,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE;QACtC,IAAI,CAAC,iDAAiD,EAAE;YACtD,IAAM,yBAAyB,GAAG,OAAO,EAAE,CAAC;YAE5C,IAAM,oBAAoB,GAAG,2BAA2B,CAAC;gBACvD,yBAAyB,2BAAA;aAC1B,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CACxC,YAAK,yBAAyB,CAAE,CACjC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"get-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/get-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,EACJ,GAAG,EAAE,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,GACjE,GAAG,MAAM,CAAC;AAEX,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAC1C,MAAM,4BAA4B,GAAG,OAAO,EAAE,CAAC;QAE/C,IAAI,CAAC,yFAAyF,EAAE,GAAG,EAAE;YACnG,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;gBACtD,4BAA4B;aAC7B,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CAAC;gBACzC,CAAC,4BAA4B,CAAC,EAAE,MAAM;aACvC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE;YAClC,oBAAoB;YACpB,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAEzC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;gBACtD,4BAA4B,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;aACvD,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CAAC;gBACzC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE;aACrD,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QAC3C,IAAI,CAAC,iDAAiD,EAAE,GAAG,EAAE;YAC3D,MAAM,yBAAyB,GAAG,OAAO,EAAE,CAAC;YAE5C,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;gBACvD,yBAAyB;aAC1B,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CACxC,KAAK,yBAAyB,EAAE,CACjC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,21 +1,21 @@
1
1
  import { aString } from '@wix/motion-runtime-test-context';
2
2
  import { preset } from '../../..';
3
- var _a = preset.list, buildRequestTransformation = _a.buildRequestTransformation, buildResponseTransformation = _a.buildResponseTransformation;
4
- describe('list-method transformations', function () {
5
- describe('buildRequestTransformation', function () {
3
+ const { list: { buildRequestTransformation, buildResponseTransformation }, } = preset;
4
+ describe('list-method transformations', () => {
5
+ describe('buildRequestTransformation', () => {
6
6
  // eslint-disable-next-line max-len
7
- test('returns the passthrough request transformation', function () {
8
- var transformationString = buildRequestTransformation();
7
+ test('returns the passthrough request transformation', () => {
8
+ const transformationString = buildRequestTransformation();
9
9
  expect(transformationString).toStrictEqual('$[0]');
10
10
  });
11
11
  });
12
- describe('buildResponseTransformation', function () {
13
- test('unwraps the value of the provided property-path', function () {
14
- var responseMessageResultPath = aString();
15
- var transformationString = buildResponseTransformation({
16
- responseMessageResultPath: responseMessageResultPath,
12
+ describe('buildResponseTransformation', () => {
13
+ test('unwraps the value of the provided property-path', () => {
14
+ const responseMessageResultPath = aString();
15
+ const transformationString = buildResponseTransformation({
16
+ responseMessageResultPath,
17
17
  });
18
- expect(transformationString).toStrictEqual("$.".concat(responseMessageResultPath));
18
+ expect(transformationString).toStrictEqual(`$.${responseMessageResultPath}`);
19
19
  });
20
20
  });
21
21
  });
@@ -1 +1 @@
1
- {"version":3,"file":"list-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/list-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGhC,IAAA,KACE,MAAM,KADyD,EAAzD,0BAA0B,gCAAA,EAAE,2BAA2B,iCAAE,CACxD;AAEX,QAAQ,CAAC,6BAA6B,EAAE;IACtC,QAAQ,CAAC,4BAA4B,EAAE;QACrC,mCAAmC;QACnC,IAAI,CAAC,gDAAgD,EAAE;YACrD,IAAM,oBAAoB,GAAG,0BAA0B,EAAE,CAAC;YAE1D,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE;QACtC,IAAI,CAAC,iDAAiD,EAAE;YACtD,IAAM,yBAAyB,GAAG,OAAO,EAAE,CAAC;YAE5C,IAAM,oBAAoB,GAAG,2BAA2B,CAAC;gBACvD,yBAAyB,2BAAA;aAC1B,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CACxC,YAAK,yBAAyB,CAAE,CACjC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"list-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/list-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,EACJ,IAAI,EAAE,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,GAClE,GAAG,MAAM,CAAC;AAEX,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAC1C,mCAAmC;QACnC,IAAI,CAAC,gDAAgD,EAAE,GAAG,EAAE;YAC1D,MAAM,oBAAoB,GAAG,0BAA0B,EAAE,CAAC;YAE1D,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QAC3C,IAAI,CAAC,iDAAiD,EAAE,GAAG,EAAE;YAC3D,MAAM,yBAAyB,GAAG,OAAO,EAAE,CAAC;YAE5C,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;gBACvD,yBAAyB;aAC1B,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CACxC,KAAK,yBAAyB,EAAE,CACjC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,55 +1,54 @@
1
1
  import { aString } from '@wix/motion-runtime-test-context';
2
2
  import { times } from 'lodash';
3
3
  import { preset } from '../../..';
4
- var _a = preset.query, buildRequestTransformation = _a.buildRequestTransformation, buildResponseTransformation = _a.buildResponseTransformation;
5
- describe('query-method transformations', function () {
6
- describe('buildRequestTransformation', function () {
4
+ const { query: { buildRequestTransformation, buildResponseTransformation }, } = preset;
5
+ describe('query-method transformations', () => {
6
+ describe('buildRequestTransformation', () => {
7
7
  // eslint-disable-next-line max-len
8
- test('sets the query object as a property named via requestQueryObjectPropertyName, and spreads the 2nd argument', function () {
9
- var _a;
10
- var requestQueryObjectPropertyName = aString();
11
- var transformationString = buildRequestTransformation({
12
- requestQueryObjectPropertyName: requestQueryObjectPropertyName,
8
+ test('sets the query object as a property named via requestQueryObjectPropertyName, and spreads the 2nd argument', () => {
9
+ const requestQueryObjectPropertyName = aString();
10
+ const transformationString = buildRequestTransformation({
11
+ requestQueryObjectPropertyName,
12
+ });
13
+ expect(transformationString).toStrictEqual({
14
+ [requestQueryObjectPropertyName]: '$[0]',
15
+ '*': '$[1]',
13
16
  });
14
- expect(transformationString).toStrictEqual((_a = {},
15
- _a[requestQueryObjectPropertyName] = '$[0]',
16
- _a['*'] = '$[1]',
17
- _a));
18
17
  });
19
18
  // eslint-disable-next-line max-len
20
- test("sets the given query tree under the 'query' property as a default, with the second argument spread into the payload", function () {
21
- var transformationString = buildRequestTransformation();
19
+ test("sets the given query tree under the 'query' property as a default, with the second argument spread into the payload", () => {
20
+ const transformationString = buildRequestTransformation();
22
21
  expect(transformationString).toStrictEqual({
23
22
  query: '$[0]',
24
23
  '*': '$[1]',
25
24
  });
26
25
  });
27
26
  });
28
- describe('buildResponseTransformation', function () {
29
- var _a = times(2, function () { return aString(); }), responseMessageResultPath = _a[0], responseMessagePagingMetadataPath = _a[1];
30
- test('unwraps the value of the provided property-path', function () {
31
- var transformationObject = buildResponseTransformation({
32
- responseMessageResultPath: responseMessageResultPath,
33
- responseMessagePagingMetadataPath: responseMessagePagingMetadataPath,
27
+ describe('buildResponseTransformation', () => {
28
+ const [responseMessageResultPath, responseMessagePagingMetadataPath] = times(2, () => aString());
29
+ test('unwraps the value of the provided property-path', () => {
30
+ const transformationObject = buildResponseTransformation({
31
+ responseMessageResultPath,
32
+ responseMessagePagingMetadataPath,
34
33
  });
35
34
  expect(transformationObject).toStrictEqual({
36
- items: "$.".concat(responseMessageResultPath),
37
- pagingMetadata: "$.".concat(responseMessagePagingMetadataPath),
35
+ items: `$.${responseMessageResultPath}`,
36
+ pagingMetadata: `$.${responseMessagePagingMetadataPath}`,
38
37
  });
39
38
  });
40
- test('adds an item-transformation when provided', function () {
41
- var itemTransformation = "$.some.path.".concat(aString());
42
- var transformationObject = buildResponseTransformation({
43
- responseMessageResultPath: responseMessageResultPath,
44
- responseMessagePagingMetadataPath: responseMessagePagingMetadataPath,
45
- itemTransformation: itemTransformation,
39
+ test('adds an item-transformation when provided', () => {
40
+ const itemTransformation = `$.some.path.${aString()}`;
41
+ const transformationObject = buildResponseTransformation({
42
+ responseMessageResultPath,
43
+ responseMessagePagingMetadataPath,
44
+ itemTransformation,
46
45
  });
47
46
  expect(transformationObject).toStrictEqual({
48
47
  items: {
49
- '@path': "$.".concat(responseMessageResultPath),
48
+ '@path': `$.${responseMessageResultPath}`,
50
49
  '@itemTransformation': itemTransformation,
51
50
  },
52
- pagingMetadata: "$.".concat(responseMessagePagingMetadataPath),
51
+ pagingMetadata: `$.${responseMessagePagingMetadataPath}`,
53
52
  });
54
53
  });
55
54
  });
@@ -1 +1 @@
1
- {"version":3,"file":"query-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/query-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGhC,IAAA,KACE,MAAM,MAD0D,EAAzD,0BAA0B,gCAAA,EAAE,2BAA2B,iCAAE,CACzD;AAEX,QAAQ,CAAC,8BAA8B,EAAE;IACvC,QAAQ,CAAC,4BAA4B,EAAE;QACrC,mCAAmC;QACnC,IAAI,CAAC,4GAA4G,EAAE;;YACjH,IAAM,8BAA8B,GAAG,OAAO,EAAE,CAAC;YACjD,IAAM,oBAAoB,GAAG,0BAA0B,CAAC;gBACtD,8BAA8B,gCAAA;aAC/B,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa;gBACxC,GAA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CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"query-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/query-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,EACJ,KAAK,EAAE,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,GACnE,GAAG,MAAM,CAAC;AAEX,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAC1C,mCAAmC;QACnC,IAAI,CAAC,4GAA4G,EAAE,GAAG,EAAE;YACtH,MAAM,8BAA8B,GAAG,OAAO,EAAE,CAAC;YACjD,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;gBACtD,8BAA8B;aAC/B,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CAAC;gBACzC,CAAC,8BAA8B,CAAC,EAAE,MAAM;gBACxC,GAAG,EAAE,MAAM;aACZ,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,mCAAmC;QACnC,IAAI,CAAC,qHAAqH,EAAE,GAAG,EAAE;YAC/H,MAAM,oBAAoB,GAAG,0BAA0B,EAAE,CAAC;YAE1D,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CAAC;gBACzC,KAAK,EAAE,MAAM;gBACb,GAAG,EAAE,MAAM;aACZ,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,yBAAyB,EAAE,iCAAiC,CAAC,GAClE,KAAK,CAAC,CAAC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