@wix/motion-edm-autogen-transformations-core 1.3.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.
- package/dist/cjs/__tests__/corvid-entity.spec.js +68 -0
- package/dist/cjs/__tests__/corvid-entity.spec.js.map +1 -0
- package/dist/cjs/__tests__/getArgumentCardinality.spec.js +58 -0
- package/dist/cjs/__tests__/getArgumentCardinality.spec.js.map +1 -0
- package/dist/cjs/__tests__/helpers.spec.js +90 -0
- package/dist/cjs/__tests__/helpers.spec.js.map +1 -0
- package/dist/cjs/__tests__/reduceTransformation.spec.js +478 -0
- package/dist/cjs/__tests__/reduceTransformation.spec.js.map +1 -0
- package/dist/cjs/__tests__/transformations/custom-functions.spec.js +111 -0
- package/dist/cjs/__tests__/transformations/custom-functions.spec.js.map +1 -0
- package/dist/cjs/__tests__/transformations/preset/create-transformation.spec.js +47 -0
- package/dist/cjs/__tests__/transformations/preset/create-transformation.spec.js.map +1 -0
- package/dist/cjs/__tests__/transformations/preset/delete-transformation.spec.js +75 -0
- package/dist/cjs/__tests__/transformations/preset/delete-transformation.spec.js.map +1 -0
- package/dist/cjs/__tests__/transformations/preset/get-transformation.spec.js +46 -0
- package/dist/cjs/__tests__/transformations/preset/get-transformation.spec.js.map +1 -0
- package/dist/cjs/__tests__/transformations/preset/list-transformation.spec.js +28 -0
- package/dist/cjs/__tests__/transformations/preset/list-transformation.spec.js.map +1 -0
- package/dist/cjs/__tests__/transformations/preset/query-transformation.spec.js +66 -0
- package/dist/cjs/__tests__/transformations/preset/query-transformation.spec.js.map +1 -0
- package/dist/cjs/__tests__/transformations/preset/update-transformation.spec.js +90 -0
- package/dist/cjs/__tests__/transformations/preset/update-transformation.spec.js.map +1 -0
- package/dist/cjs/__tests__/validations/validateRequestTransformation.spec.js +291 -0
- package/dist/cjs/__tests__/validations/validateRequestTransformation.spec.js.map +1 -0
- package/dist/cjs/__tests__/validations/validateResponseTransformation.spec.js +370 -0
- package/dist/cjs/__tests__/validations/validateResponseTransformation.spec.js.map +1 -0
- package/dist/cjs/index.js +102 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/corvid-entity/index.js +32 -0
- package/dist/cjs/lib/corvid-entity/index.js.map +1 -0
- package/dist/cjs/lib/getArgumentCardinality.js +34 -0
- package/dist/cjs/lib/getArgumentCardinality.js.map +1 -0
- package/dist/cjs/lib/helpers.js +111 -0
- package/dist/cjs/lib/helpers.js.map +1 -0
- package/dist/cjs/lib/transformations/common.js +24 -0
- package/dist/cjs/lib/transformations/common.js.map +1 -0
- package/dist/cjs/lib/transformations/constants.js +23 -0
- package/dist/cjs/lib/transformations/constants.js.map +1 -0
- package/dist/cjs/lib/transformations/custom-functions.js +46 -0
- package/dist/cjs/lib/transformations/custom-functions.js.map +1 -0
- package/dist/cjs/lib/transformations/preset/create.js +17 -0
- package/dist/cjs/lib/transformations/preset/create.js.map +1 -0
- package/dist/cjs/lib/transformations/preset/delete.js +42 -0
- package/dist/cjs/lib/transformations/preset/delete.js.map +1 -0
- package/dist/cjs/lib/transformations/preset/get.js +17 -0
- package/dist/cjs/lib/transformations/preset/get.js.map +1 -0
- package/dist/cjs/lib/transformations/preset/list.js +13 -0
- package/dist/cjs/lib/transformations/preset/list.js.map +1 -0
- package/dist/cjs/lib/transformations/preset/query.js +40 -0
- package/dist/cjs/lib/transformations/preset/query.js.map +1 -0
- package/dist/cjs/lib/transformations/preset/update.js +37 -0
- package/dist/cjs/lib/transformations/preset/update.js.map +1 -0
- package/dist/cjs/lib/transformations/reduceTransformation.js +180 -0
- package/dist/cjs/lib/transformations/reduceTransformation.js.map +1 -0
- package/dist/cjs/lib/transformations/validations/common.js +50 -0
- package/dist/cjs/lib/transformations/validations/common.js.map +1 -0
- package/dist/cjs/lib/transformations/validations/validateRequestTransformation.js +118 -0
- package/dist/cjs/lib/transformations/validations/validateRequestTransformation.js.map +1 -0
- package/dist/cjs/lib/transformations/validations/validateResponseTransformation.js +161 -0
- package/dist/cjs/lib/transformations/validations/validateResponseTransformation.js.map +1 -0
- package/dist/esm/__tests__/corvid-entity.spec.js +58 -0
- package/dist/esm/__tests__/corvid-entity.spec.js.map +1 -0
- package/dist/esm/__tests__/getArgumentCardinality.spec.js +42 -0
- package/dist/esm/__tests__/getArgumentCardinality.spec.js.map +1 -0
- package/dist/esm/__tests__/helpers.spec.js +61 -0
- package/dist/esm/__tests__/helpers.spec.js.map +1 -0
- package/dist/esm/__tests__/reduceTransformation.spec.js +416 -0
- package/dist/esm/__tests__/reduceTransformation.spec.js.map +1 -0
- package/dist/esm/__tests__/transformations/custom-functions.spec.js +87 -0
- package/dist/esm/__tests__/transformations/custom-functions.spec.js.map +1 -0
- package/dist/esm/__tests__/transformations/preset/create-transformation.spec.js +40 -0
- package/dist/esm/__tests__/transformations/preset/create-transformation.spec.js.map +1 -0
- package/dist/esm/__tests__/transformations/preset/delete-transformation.spec.js +65 -0
- package/dist/esm/__tests__/transformations/preset/delete-transformation.spec.js.map +1 -0
- package/dist/esm/__tests__/transformations/preset/get-transformation.spec.js +39 -0
- package/dist/esm/__tests__/transformations/preset/get-transformation.spec.js.map +1 -0
- package/dist/esm/__tests__/transformations/preset/list-transformation.spec.js +22 -0
- package/dist/esm/__tests__/transformations/preset/list-transformation.spec.js.map +1 -0
- package/dist/esm/__tests__/transformations/preset/query-transformation.spec.js +57 -0
- package/dist/esm/__tests__/transformations/preset/query-transformation.spec.js.map +1 -0
- package/dist/esm/__tests__/transformations/preset/update-transformation.spec.js +85 -0
- package/dist/esm/__tests__/transformations/preset/update-transformation.spec.js.map +1 -0
- package/dist/esm/__tests__/validations/validateRequestTransformation.spec.js +200 -0
- package/dist/esm/__tests__/validations/validateRequestTransformation.spec.js.map +1 -0
- package/dist/esm/__tests__/validations/validateResponseTransformation.spec.js +246 -0
- package/dist/esm/__tests__/validations/validateResponseTransformation.spec.js.map +1 -0
- package/dist/esm/index.js +47 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/corvid-entity/index.js +17 -0
- package/dist/esm/lib/corvid-entity/index.js.map +1 -0
- package/dist/esm/lib/getArgumentCardinality.js +30 -0
- package/dist/esm/lib/getArgumentCardinality.js.map +1 -0
- package/dist/esm/lib/helpers.js +56 -0
- package/dist/esm/lib/helpers.js.map +1 -0
- package/dist/esm/lib/transformations/common.js +17 -0
- package/dist/esm/lib/transformations/common.js.map +1 -0
- package/dist/esm/lib/transformations/constants.js +18 -0
- package/dist/esm/lib/transformations/constants.js.map +1 -0
- package/dist/esm/lib/transformations/custom-functions.js +34 -0
- package/dist/esm/lib/transformations/custom-functions.js.map +1 -0
- package/dist/esm/lib/transformations/preset/create.js +8 -0
- package/dist/esm/lib/transformations/preset/create.js.map +1 -0
- package/dist/esm/lib/transformations/preset/delete.js +25 -0
- package/dist/esm/lib/transformations/preset/delete.js.map +1 -0
- package/dist/esm/lib/transformations/preset/get.js +8 -0
- package/dist/esm/lib/transformations/preset/get.js.map +1 -0
- package/dist/esm/lib/transformations/preset/list.js +6 -0
- package/dist/esm/lib/transformations/preset/list.js.map +1 -0
- package/dist/esm/lib/transformations/preset/query.js +28 -0
- package/dist/esm/lib/transformations/preset/query.js.map +1 -0
- package/dist/esm/lib/transformations/preset/update.js +18 -0
- package/dist/esm/lib/transformations/preset/update.js.map +1 -0
- package/dist/esm/lib/transformations/reduceTransformation.js +122 -0
- package/dist/esm/lib/transformations/reduceTransformation.js.map +1 -0
- package/dist/esm/lib/transformations/validations/common.js +35 -0
- package/dist/esm/lib/transformations/validations/common.js.map +1 -0
- package/dist/esm/lib/transformations/validations/validateRequestTransformation.js +107 -0
- package/dist/esm/lib/transformations/validations/validateRequestTransformation.js.map +1 -0
- package/dist/esm/lib/transformations/validations/validateResponseTransformation.js +142 -0
- package/dist/esm/lib/transformations/validations/validateResponseTransformation.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/__tests__/corvid-entity.spec.d.ts +2 -0
- package/dist/types/__tests__/corvid-entity.spec.d.ts.map +1 -0
- package/dist/types/__tests__/getArgumentCardinality.spec.d.ts +2 -0
- package/dist/types/__tests__/getArgumentCardinality.spec.d.ts.map +1 -0
- package/dist/types/__tests__/helpers.spec.d.ts +2 -0
- package/dist/types/__tests__/helpers.spec.d.ts.map +1 -0
- package/dist/types/__tests__/reduceTransformation.spec.d.ts +2 -0
- package/dist/types/__tests__/reduceTransformation.spec.d.ts.map +1 -0
- package/dist/types/__tests__/transformations/custom-functions.spec.d.ts +2 -0
- package/dist/types/__tests__/transformations/custom-functions.spec.d.ts.map +1 -0
- package/dist/types/__tests__/transformations/preset/create-transformation.spec.d.ts +2 -0
- package/dist/types/__tests__/transformations/preset/create-transformation.spec.d.ts.map +1 -0
- package/dist/types/__tests__/transformations/preset/delete-transformation.spec.d.ts +2 -0
- package/dist/types/__tests__/transformations/preset/delete-transformation.spec.d.ts.map +1 -0
- package/dist/types/__tests__/transformations/preset/get-transformation.spec.d.ts +2 -0
- package/dist/types/__tests__/transformations/preset/get-transformation.spec.d.ts.map +1 -0
- package/dist/types/__tests__/transformations/preset/list-transformation.spec.d.ts +2 -0
- package/dist/types/__tests__/transformations/preset/list-transformation.spec.d.ts.map +1 -0
- package/dist/types/__tests__/transformations/preset/query-transformation.spec.d.ts +2 -0
- package/dist/types/__tests__/transformations/preset/query-transformation.spec.d.ts.map +1 -0
- package/dist/types/__tests__/transformations/preset/update-transformation.spec.d.ts +2 -0
- package/dist/types/__tests__/transformations/preset/update-transformation.spec.d.ts.map +1 -0
- package/dist/types/__tests__/validations/validateRequestTransformation.spec.d.ts +2 -0
- package/dist/types/__tests__/validations/validateRequestTransformation.spec.d.ts.map +1 -0
- package/dist/types/__tests__/validations/validateResponseTransformation.spec.d.ts +2 -0
- package/dist/types/__tests__/validations/validateResponseTransformation.spec.d.ts.map +1 -0
- package/dist/types/index.d.ts +55 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/corvid-entity/index.d.ts +13 -0
- package/dist/types/lib/corvid-entity/index.d.ts.map +1 -0
- package/dist/types/lib/getArgumentCardinality.d.ts +3 -0
- package/dist/types/lib/getArgumentCardinality.d.ts.map +1 -0
- package/dist/types/lib/helpers.d.ts +28 -0
- package/dist/types/lib/helpers.d.ts.map +1 -0
- package/dist/types/lib/transformations/common.d.ts +15 -0
- package/dist/types/lib/transformations/common.d.ts.map +1 -0
- package/dist/types/lib/transformations/constants.d.ts +18 -0
- package/dist/types/lib/transformations/constants.d.ts.map +1 -0
- package/dist/types/lib/transformations/custom-functions.d.ts +13 -0
- package/dist/types/lib/transformations/custom-functions.d.ts.map +1 -0
- package/dist/types/lib/transformations/preset/create.d.ts +6 -0
- package/dist/types/lib/transformations/preset/create.d.ts.map +1 -0
- package/dist/types/lib/transformations/preset/delete.d.ts +7 -0
- package/dist/types/lib/transformations/preset/delete.d.ts.map +1 -0
- package/dist/types/lib/transformations/preset/get.d.ts +6 -0
- package/dist/types/lib/transformations/preset/get.d.ts.map +1 -0
- package/dist/types/lib/transformations/preset/list.d.ts +4 -0
- package/dist/types/lib/transformations/preset/list.d.ts.map +1 -0
- package/dist/types/lib/transformations/preset/query.d.ts +20 -0
- package/dist/types/lib/transformations/preset/query.d.ts.map +1 -0
- package/dist/types/lib/transformations/preset/update.d.ts +8 -0
- package/dist/types/lib/transformations/preset/update.d.ts.map +1 -0
- package/dist/types/lib/transformations/reduceTransformation.d.ts +6 -0
- package/dist/types/lib/transformations/reduceTransformation.d.ts.map +1 -0
- package/dist/types/lib/transformations/validations/common.d.ts +13 -0
- package/dist/types/lib/transformations/validations/common.d.ts.map +1 -0
- package/dist/types/lib/transformations/validations/validateRequestTransformation.d.ts +6 -0
- package/dist/types/lib/transformations/validations/validateRequestTransformation.d.ts.map +1 -0
- package/dist/types/lib/transformations/validations/validateResponseTransformation.d.ts +6 -0
- package/dist/types/lib/transformations/validations/validateResponseTransformation.d.ts.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { aString } from '@wix/motion-runtime-test-context';
|
|
2
|
+
import { times } from 'lodash';
|
|
3
|
+
import { transformations, preset } 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,
|
|
13
|
+
});
|
|
14
|
+
expect(transformationObject).toStrictEqual((_a = {},
|
|
15
|
+
_a[requestMessageIdentifierPath] = '$[0]',
|
|
16
|
+
_a));
|
|
17
|
+
});
|
|
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,
|
|
24
|
+
});
|
|
25
|
+
expect(transformationObject).toStrictEqual((_a = {},
|
|
26
|
+
_a[requestMessageIdentifierPath] = '$[0]',
|
|
27
|
+
_a[requestMessageOptionsPath] = '$[1]',
|
|
28
|
+
_a));
|
|
29
|
+
});
|
|
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),
|
|
36
|
+
requestMessageOptionsPath: sharedPath,
|
|
37
|
+
});
|
|
38
|
+
expect(transformationObject).toStrictEqual((_a = {},
|
|
39
|
+
_a[sharedPath] = (_b = {}, _b[identifierPathSegment] = '$[0]', _b['*'] = '$[1]', _b),
|
|
40
|
+
_a));
|
|
41
|
+
});
|
|
42
|
+
test('supports nested paths', function () {
|
|
43
|
+
var _a, _b, _c;
|
|
44
|
+
// @ts-expect-error
|
|
45
|
+
var idPathSegments = times(2, aString);
|
|
46
|
+
// @ts-expect-error
|
|
47
|
+
var optionsPathSegments = times(2, aString);
|
|
48
|
+
var transformationObject = buildRequestTransformation({
|
|
49
|
+
requestMessageIdentifierPath: idPathSegments.join('.'),
|
|
50
|
+
requestMessageOptionsPath: optionsPathSegments.join('.'),
|
|
51
|
+
});
|
|
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));
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('buildResponseTransformation', function () {
|
|
59
|
+
test('returns the identity transformation', function () {
|
|
60
|
+
var trasformationString = buildResponseTransformation();
|
|
61
|
+
expect(trasformationString).toStrictEqual(RESPONSE_OBJECT_UNCHANGED);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=delete-transformation.spec.js.map
|
|
@@ -0,0 +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;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;A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AAC;QAEH,IAAI,CAAC,uBAAuB,EAAE;;YAC5B,mBAAmB;YACnB,IAAM,cAAc,GAAG,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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { aString } from '@wix/motion-runtime-test-context';
|
|
2
|
+
import { times } from 'lodash';
|
|
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,
|
|
12
|
+
});
|
|
13
|
+
expect(transformationObject).toStrictEqual((_a = {},
|
|
14
|
+
_a[requestMessageIdentifierPath] = '$[0]',
|
|
15
|
+
_a));
|
|
16
|
+
});
|
|
17
|
+
test('supports a nested path', function () {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
// @ts-expect-errora
|
|
20
|
+
var idPathSegments = times(2, aString);
|
|
21
|
+
var transformationObject = buildRequestTransformation({
|
|
22
|
+
requestMessageIdentifierPath: idPathSegments.join('.'),
|
|
23
|
+
});
|
|
24
|
+
expect(transformationObject).toStrictEqual((_a = {},
|
|
25
|
+
_a[idPathSegments[0]] = (_b = {}, _b[idPathSegments[1]] = '$[0]', _b),
|
|
26
|
+
_a));
|
|
27
|
+
});
|
|
28
|
+
});
|
|
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,
|
|
34
|
+
});
|
|
35
|
+
expect(transformationString).toStrictEqual("$.".concat(responseMessageResultPath));
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=get-transformation.spec.js.map
|
|
@@ -0,0 +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;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGhC,IAAA,KACE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from '@wix/motion-runtime-test-context';
|
|
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 () {
|
|
6
|
+
// eslint-disable-next-line max-len
|
|
7
|
+
test('returns the passthrough request transformation', function () {
|
|
8
|
+
var transformationString = buildRequestTransformation();
|
|
9
|
+
expect(transformationString).toStrictEqual('$[0]');
|
|
10
|
+
});
|
|
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,
|
|
17
|
+
});
|
|
18
|
+
expect(transformationString).toStrictEqual("$.".concat(responseMessageResultPath));
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=list-transformation.spec.js.map
|
|
@@ -0,0 +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;AAC3D,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"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { aString } from '@wix/motion-runtime-test-context';
|
|
2
|
+
import { times } from 'lodash';
|
|
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 () {
|
|
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,
|
|
13
|
+
});
|
|
14
|
+
expect(transformationString).toStrictEqual((_a = {},
|
|
15
|
+
_a[requestQueryObjectPropertyName] = '$[0]',
|
|
16
|
+
_a['*'] = '$[1]',
|
|
17
|
+
_a));
|
|
18
|
+
});
|
|
19
|
+
// 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();
|
|
22
|
+
expect(transformationString).toStrictEqual({
|
|
23
|
+
query: '$[0]',
|
|
24
|
+
'*': '$[1]',
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
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,
|
|
34
|
+
});
|
|
35
|
+
expect(transformationObject).toStrictEqual({
|
|
36
|
+
items: "$.".concat(responseMessageResultPath),
|
|
37
|
+
pagingMetadata: "$.".concat(responseMessagePagingMetadataPath),
|
|
38
|
+
});
|
|
39
|
+
});
|
|
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,
|
|
46
|
+
});
|
|
47
|
+
expect(transformationObject).toStrictEqual({
|
|
48
|
+
items: {
|
|
49
|
+
'@path': "$.".concat(responseMessageResultPath),
|
|
50
|
+
'@itemTransformation': itemTransformation,
|
|
51
|
+
},
|
|
52
|
+
pagingMetadata: "$.".concat(responseMessagePagingMetadataPath),
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=query-transformation.spec.js.map
|
|
@@ -0,0 +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;AAC/B,OAAO,EAAE,MAAM,E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CAAC,2CAA2C,EAAE;YAChD,IAAM,kBAAkB,GAAG,sBAAe,OAAO,EAAE,CAAE,CAAC;YACtD,IAAM,oBAAoB,GAAG,2BAA2B,CAAC;gBACvD,yBAAyB,2BAAA;gBACzB,iCAAiC,mCAAA;gBACjC,kBAAkB,oBAAA;aACnB,CAAC,CAAC;YAEH,MAAM,CAAC,oBAAoB,CAAC,CAAC,aAAa,CAAC;gBACzC,KAAK,EAAE;oBACL,OAAO,EAAE,YAAK,yBAAyB,CAAE;oBACzC,qBAAqB,EAAE,kBAAkB;iBAC1C;gBACD,cAAc,EAAE,YAAK,iCAAiC,CAAE;aACzD,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { aString } from '@wix/motion-runtime-test-context';
|
|
2
|
+
import { times } from 'lodash';
|
|
3
|
+
import { preset } from '../../..';
|
|
4
|
+
var _a = preset.update, buildRequestTransformation = _a.buildRequestTransformation, buildResponseTransformation = _a.buildResponseTransformation;
|
|
5
|
+
describe('update-method transformations', function () {
|
|
6
|
+
describe('buildRequestTransformation', function () {
|
|
7
|
+
var requestMessageOptionsPath = aString();
|
|
8
|
+
var requestMessageEntityPath = aString();
|
|
9
|
+
var requestMessageEntityIdentifierField = aString();
|
|
10
|
+
test('creates a transformation mapping args into requestMessageIdentifierPath and requestMessageEntityPath', function () {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
var transformedObject = buildRequestTransformation({
|
|
13
|
+
requestMessageEntityIdentifierField: requestMessageEntityIdentifierField,
|
|
14
|
+
requestMessageEntityPath: requestMessageEntityPath,
|
|
15
|
+
});
|
|
16
|
+
expect(transformedObject).toStrictEqual((_a = {},
|
|
17
|
+
_a[requestMessageEntityPath] = (_b = {},
|
|
18
|
+
_b[requestMessageEntityIdentifierField] = '$[0]',
|
|
19
|
+
_b['*'] = '$[1]',
|
|
20
|
+
_b),
|
|
21
|
+
_a));
|
|
22
|
+
});
|
|
23
|
+
test("creates a transformation that maps the 3rd argument into requestMessageOptionsPath when provided", function () {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
var transformedObject = buildRequestTransformation({
|
|
26
|
+
requestMessageEntityIdentifierField: requestMessageEntityIdentifierField,
|
|
27
|
+
requestMessageEntityPath: requestMessageEntityPath,
|
|
28
|
+
requestMessageOptionsPath: requestMessageOptionsPath,
|
|
29
|
+
});
|
|
30
|
+
expect(transformedObject).toStrictEqual((_a = {},
|
|
31
|
+
_a[requestMessageEntityPath] = (_b = {},
|
|
32
|
+
_b[requestMessageEntityIdentifierField] = '$[0]',
|
|
33
|
+
_b['*'] = '$[1]',
|
|
34
|
+
_b),
|
|
35
|
+
_a[requestMessageOptionsPath] = '$[2]',
|
|
36
|
+
_a));
|
|
37
|
+
});
|
|
38
|
+
test('supports nested paths for requestMessageEntityPath and requestMessageOptionsPath', function () {
|
|
39
|
+
var _a, _b, _c, _d;
|
|
40
|
+
// @ts-expect-error
|
|
41
|
+
var requestMessageEntityPathSegments = times(2, aString);
|
|
42
|
+
// @ts-expect-error
|
|
43
|
+
var optionsPathSegments = times(2, aString);
|
|
44
|
+
var transformationObject = buildRequestTransformation({
|
|
45
|
+
requestMessageEntityIdentifierField: requestMessageEntityIdentifierField,
|
|
46
|
+
requestMessageEntityPath: requestMessageEntityPathSegments.join('.'),
|
|
47
|
+
requestMessageOptionsPath: optionsPathSegments.join('.'),
|
|
48
|
+
});
|
|
49
|
+
expect(transformationObject).toStrictEqual((_a = {},
|
|
50
|
+
_a[requestMessageEntityPathSegments[0]] = (_b = {},
|
|
51
|
+
_b[requestMessageEntityPathSegments[1]] = (_c = {},
|
|
52
|
+
_c[requestMessageEntityIdentifierField] = '$[0]',
|
|
53
|
+
_c['*'] = '$[1]',
|
|
54
|
+
_c),
|
|
55
|
+
_b),
|
|
56
|
+
_a[optionsPathSegments[0]] = (_d = {}, _d[optionsPathSegments[1]] = '$[2]', _d),
|
|
57
|
+
_a));
|
|
58
|
+
});
|
|
59
|
+
test('supports shared paths for requestMessageEntityPath and requestMessageOptionsPath', function () {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
var sharedPath = aString();
|
|
62
|
+
var transformationObject = buildRequestTransformation({
|
|
63
|
+
requestMessageEntityIdentifierField: requestMessageEntityIdentifierField,
|
|
64
|
+
requestMessageEntityPath: sharedPath,
|
|
65
|
+
requestMessageOptionsPath: sharedPath,
|
|
66
|
+
});
|
|
67
|
+
expect(transformationObject).toStrictEqual((_a = {},
|
|
68
|
+
_a[sharedPath] = (_b = {},
|
|
69
|
+
_b[requestMessageEntityIdentifierField] = '$[0]',
|
|
70
|
+
_b['*'] = ['$[1]', '$[2]'],
|
|
71
|
+
_b),
|
|
72
|
+
_a));
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
describe('buildResponseTransformation', function () {
|
|
76
|
+
test('unwraps the value of the provided property-path', function () {
|
|
77
|
+
var responseMessageResultPath = aString();
|
|
78
|
+
var transformationString = buildResponseTransformation({
|
|
79
|
+
responseMessageResultPath: responseMessageResultPath,
|
|
80
|
+
});
|
|
81
|
+
expect(transformationString).toStrictEqual("$.".concat(responseMessageResultPath));
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=update-transformation.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-transformation.spec.js","sourceRoot":"","sources":["../../../../../src/__tests__/transformations/preset/update-transformation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGhC,IAAA,KACE,MAAM,OAD2D,EAAzD,0BAA0B,gCAAA,EAAE,2BAA2B,iCAAE,CAC1D;AAEX,QAAQ,CAAC,+BAA+B,EAAE;IACxC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
+
import { times } from 'lodash';
|
|
4
|
+
import { validation } from '../..';
|
|
5
|
+
var validateRequestTransformation = validation.validateRequestTransformation;
|
|
6
|
+
describe('validateRequestTransformation', function () {
|
|
7
|
+
describe('valid transformations', function () {
|
|
8
|
+
var validResults = { isValid: true, validationErrors: [] };
|
|
9
|
+
test('returns valid transformation response for a valid simple transformation', function () {
|
|
10
|
+
var validTransformation = '$[0].a.b.c';
|
|
11
|
+
expect(validateRequestTransformation(validTransformation)).toStrictEqual(validResults);
|
|
12
|
+
});
|
|
13
|
+
test('returns valid transformation response for a valid complex transformation', function () {
|
|
14
|
+
var validTransformation = { a: '$[0].a.b.c' };
|
|
15
|
+
expect(validateRequestTransformation(validTransformation)).toStrictEqual(validResults);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
describe('invalid transformations', function () {
|
|
19
|
+
var validationErrorWith = function (_a) {
|
|
20
|
+
var parentPath = _a.parentPath, invalidValue = _a.invalidValue, description = _a.description;
|
|
21
|
+
return ({
|
|
22
|
+
isValid: false,
|
|
23
|
+
validationErrors: expect.arrayContaining([
|
|
24
|
+
expect.objectContaining({
|
|
25
|
+
parentPath: parentPath,
|
|
26
|
+
invalidValue: invalidValue,
|
|
27
|
+
description: description,
|
|
28
|
+
}),
|
|
29
|
+
]),
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
describe('invalid complex-transformation keys', function () {
|
|
33
|
+
test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n description | transformationKey | expectedValidationMessage\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n description | transformationKey | expectedValidationMessage\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), 'refers to an argument index', '$[0]', "must start with '$.'", 'refers to a custom function', '#someFunction', 'cannot be a custom function call')('returns a validation error when a transformation value segment $description', function (_a) {
|
|
34
|
+
var _b;
|
|
35
|
+
var transformationKey = _a.transformationKey, expectedValidationMessage = _a.expectedValidationMessage;
|
|
36
|
+
var transformation = {
|
|
37
|
+
d: { e: { f: (_b = {}, _b[transformationKey] = '$[0].a.b.c', _b) } },
|
|
38
|
+
'*': '$[1]',
|
|
39
|
+
};
|
|
40
|
+
expect(validateRequestTransformation(transformation)).toStrictEqual(validationErrorWith({
|
|
41
|
+
parentPath: 'd.e.f',
|
|
42
|
+
invalidValue: transformationKey,
|
|
43
|
+
description: expectedValidationMessage,
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe('invalid transformations values', function () {
|
|
48
|
+
describe('omit transformation', function () {
|
|
49
|
+
var parentKey = aString();
|
|
50
|
+
describe('invalid source', function () {
|
|
51
|
+
var _a;
|
|
52
|
+
var invalidSourceValue = '$[x].a.b.c';
|
|
53
|
+
var invalidSourceTransformation = {
|
|
54
|
+
'@source': invalidSourceValue,
|
|
55
|
+
'@omit': times(2, function () { return aString(); }),
|
|
56
|
+
};
|
|
57
|
+
test.each(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n description | invalidTransformation | expectedParentPath\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n description | invalidTransformation | expectedParentPath\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), 'top level', invalidSourceTransformation, '@source', 'nested', (_a = {}, _a[parentKey] = invalidSourceTransformation, _a), "".concat(parentKey, ".@source"))('returns a validation error when the @source value is invalid', function (_a) {
|
|
58
|
+
var invalidTransformation = _a.invalidTransformation, expectedParentPath = _a.expectedParentPath;
|
|
59
|
+
expect(validateRequestTransformation(invalidTransformation)).toStrictEqual(validationErrorWith({
|
|
60
|
+
parentPath: expectedParentPath,
|
|
61
|
+
invalidValue: invalidSourceValue,
|
|
62
|
+
description: 'must start with $[N] where N is an index',
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
describe('invalid @omit', function () {
|
|
67
|
+
var _a, _b, _c;
|
|
68
|
+
var transformationWithOmitValue = function (value) { return ({
|
|
69
|
+
'@source': '$[0].a.b.c',
|
|
70
|
+
'@omit': value,
|
|
71
|
+
}); };
|
|
72
|
+
var nonArray = aString();
|
|
73
|
+
var nonStringArray = times(2, function () { return aNumber(); });
|
|
74
|
+
var arrayWithInvalidPaths = ['a.b.c', aString()];
|
|
75
|
+
describe.each(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n description | invalidTransformation | expectedParentPath\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n description | invalidTransformation | expectedParentPath\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), 'top level', transformationWithOmitValue(nonArray), '@omit', 'nested', (_a = {}, _a[parentKey] = transformationWithOmitValue(nonArray), _a), "".concat(parentKey, ".@omit"))('@omit is not an array', function (_a) {
|
|
76
|
+
var invalidTransformation = _a.invalidTransformation, expectedParentPath = _a.expectedParentPath;
|
|
77
|
+
test('returns a validation error', function () {
|
|
78
|
+
expect(validateRequestTransformation(invalidTransformation)).toStrictEqual(validationErrorWith({
|
|
79
|
+
parentPath: expectedParentPath,
|
|
80
|
+
invalidValue: nonArray,
|
|
81
|
+
description: 'must be an array of strings',
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe.each(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n description | invalidTransformation | expectedParentPath\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n description | invalidTransformation | expectedParentPath\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), 'top level', transformationWithOmitValue(nonStringArray), '@omit', 'nested', (_b = {}, _b[parentKey] = transformationWithOmitValue(nonStringArray), _b), "".concat(parentKey, ".@omit"))('@omit is an array of non-strings', function (_a) {
|
|
86
|
+
var invalidTransformation = _a.invalidTransformation, expectedParentPath = _a.expectedParentPath;
|
|
87
|
+
test('return a validation error', function () {
|
|
88
|
+
expect(validateRequestTransformation(invalidTransformation)).toStrictEqual(validationErrorWith({
|
|
89
|
+
parentPath: expectedParentPath,
|
|
90
|
+
invalidValue: nonStringArray,
|
|
91
|
+
description: 'must be an array of strings',
|
|
92
|
+
}));
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
/* eslint-disable max-len */
|
|
96
|
+
describe.each(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n description | invalidTransformation | expectedParentPath\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n description | invalidTransformation | expectedParentPath\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), 'top level', transformationWithOmitValue(arrayWithInvalidPaths), '@omit', 'nested', (_c = {}, _c[parentKey] = transformationWithOmitValue(arrayWithInvalidPaths), _c), "".concat(parentKey, ".@omit"))('@omit is an array with invalid string paths', function (_a) {
|
|
97
|
+
var description = _a.description, invalidTransformation = _a.invalidTransformation, expectedParentPath = _a.expectedParentPath;
|
|
98
|
+
/* eslint-enable max-len */
|
|
99
|
+
test("returns a validation error for invalid ".concat(description, " transformation"), function () {
|
|
100
|
+
expect(validateRequestTransformation(invalidTransformation)).toStrictEqual(validationErrorWith({
|
|
101
|
+
parentPath: expectedParentPath,
|
|
102
|
+
invalidValue: arrayWithInvalidPaths,
|
|
103
|
+
description: 'must contain non-nested paths only',
|
|
104
|
+
}));
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
describe('custom function expressions', function () {
|
|
110
|
+
test('returns a validation error when an invalid custom function-name is used', function () {
|
|
111
|
+
var invalidCustomFunctionCallExpression = '#1a';
|
|
112
|
+
var transformation = {
|
|
113
|
+
a: { b: { c: invalidCustomFunctionCallExpression } },
|
|
114
|
+
};
|
|
115
|
+
expect(validateRequestTransformation(transformation)).toStrictEqual(validationErrorWith({
|
|
116
|
+
parentPath: 'a.b.c',
|
|
117
|
+
invalidValue: invalidCustomFunctionCallExpression,
|
|
118
|
+
description: 'contains an invalid custom function expression',
|
|
119
|
+
}));
|
|
120
|
+
});
|
|
121
|
+
test('returns a validation error when a custom function argument is invalid for request transformation', function () {
|
|
122
|
+
var invalidCustomFunctionExpression = '#someFunction($.id)';
|
|
123
|
+
var transformation = {
|
|
124
|
+
a: { b: { c: invalidCustomFunctionExpression } },
|
|
125
|
+
};
|
|
126
|
+
expect(validateRequestTransformation(transformation)).toStrictEqual(validationErrorWith({
|
|
127
|
+
parentPath: 'a.b.c',
|
|
128
|
+
invalidValue: '$.id',
|
|
129
|
+
description: 'must start with $[N] where N is an index',
|
|
130
|
+
}));
|
|
131
|
+
});
|
|
132
|
+
describe('#constant function', function () {
|
|
133
|
+
test('returns a validation error when passed value is not a valid json value', function () {
|
|
134
|
+
var invalidCustomFunctionExpression = '#constant(not-json)';
|
|
135
|
+
var transformation = {
|
|
136
|
+
a: { b: { c: invalidCustomFunctionExpression } },
|
|
137
|
+
};
|
|
138
|
+
expect(validateRequestTransformation(transformation)).toStrictEqual(validationErrorWith({
|
|
139
|
+
parentPath: 'a.b.c',
|
|
140
|
+
invalidValue: 'not-json',
|
|
141
|
+
description: 'must be a valid json value',
|
|
142
|
+
}));
|
|
143
|
+
});
|
|
144
|
+
test('allows passing non json-path arguments to the #constant function', function () {
|
|
145
|
+
var transformation = { a: { b: { c: '#constant("abc")' } } };
|
|
146
|
+
expect(validateRequestTransformation(transformation)).toStrictEqual({
|
|
147
|
+
isValid: true,
|
|
148
|
+
validationErrors: [],
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
/* eslint-disable max-len */
|
|
154
|
+
describe.each(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n description | transformationValue | expectedValidationMessage\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n description | transformationValue | expectedValidationMessage\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\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', 'is not a valid json-path', '@', 'must start with $[N] where N is an index', 'has several arguments referred to in the transformation', '$[0].$[1]', 'must have a single argument-index as the first path segment', 'refers to * in the path', '$[0].a.b.*', 'cannot refer to the * operator')(
|
|
155
|
+
/* eslint-enable max-len */
|
|
156
|
+
'returns a validation error when a transformation value segment $description', function (_a) {
|
|
157
|
+
var transformationValue = _a.transformationValue, expectedValidationMessage = _a.expectedValidationMessage;
|
|
158
|
+
test('simple transformation', function () {
|
|
159
|
+
expect(validateRequestTransformation(transformationValue)).toStrictEqual(validationErrorWith({
|
|
160
|
+
parentPath: null,
|
|
161
|
+
invalidValue: transformationValue,
|
|
162
|
+
description: expectedValidationMessage,
|
|
163
|
+
}));
|
|
164
|
+
});
|
|
165
|
+
test('complex transformation', function () {
|
|
166
|
+
var transformation = { a: { b: { c: transformationValue } } };
|
|
167
|
+
expect(validateRequestTransformation(transformation)).toStrictEqual(validationErrorWith({
|
|
168
|
+
parentPath: 'a.b.c',
|
|
169
|
+
invalidValue: transformationValue,
|
|
170
|
+
description: expectedValidationMessage,
|
|
171
|
+
}));
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
describe('special fields', function () {
|
|
175
|
+
describe.each(['id', 'createdDate', 'updatedDate'])('%s', function (specialField) {
|
|
176
|
+
var transformationValue = "$[0].a.b.".concat(specialField);
|
|
177
|
+
// eslint-disable-next-line max-len
|
|
178
|
+
var expectedValidationMessage = "cannot refer to ".concat(specialField, " field, consider using _").concat(specialField, " instead");
|
|
179
|
+
test('simple transformation', function () {
|
|
180
|
+
expect(validateRequestTransformation(transformationValue)).toStrictEqual(validationErrorWith({
|
|
181
|
+
parentPath: null,
|
|
182
|
+
invalidValue: transformationValue,
|
|
183
|
+
description: expectedValidationMessage,
|
|
184
|
+
}));
|
|
185
|
+
});
|
|
186
|
+
test('complex transformation', function () {
|
|
187
|
+
var transformation = { a: { b: { c: transformationValue } } };
|
|
188
|
+
expect(validateRequestTransformation(transformation)).toStrictEqual(validationErrorWith({
|
|
189
|
+
parentPath: 'a.b.c',
|
|
190
|
+
invalidValue: transformationValue,
|
|
191
|
+
description: expectedValidationMessage,
|
|
192
|
+
}));
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
200
|
+
//# sourceMappingURL=validateRequestTransformation.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateRequestTransformation.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/validations/validateRequestTransformation.spec.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE3B,IAAA,6BAA6B,GAAK,UAAU,8BAAf,CAAgB;AAErD,QAAQ,CAAC,+BAA+B,EAAE;IACxC,QAAQ,CAAC,uBAAuB,EAAE;QAChC,IAAM,YAAY,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC;QAE7D,IAAI,CAAC,yEAAyE,EAAE;YAC9E,IAAM,mBAAmB,GAAG,YAAY,CAAC;YAEzC,MAAM,CAAC,6BAA6B,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,CACtE,YAAY,CACb,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,0EAA0E,EAAE;YAC/E,IAAM,mBAAmB,GAAG,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC;YAEhD,MAAM,CAAC,6BAA6B,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,CACtE,YAAY,CACb,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,yBAAyB,EAAE;QAClC,IAAM,mBAAmB,GAAG,UAAC,EAI5B;gBAHC,UAAU,gBAAA,EACV,Y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