@strapi/utils 4.14.2 → 4.14.4
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/index.d.ts +19 -143
- package/dist/index.js +7223 -104
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7206 -0
- package/dist/index.mjs.map +1 -0
- package/dist/parse-multipart.d.ts +1 -2
- package/dist/print-value.d.ts +1 -1
- package/dist/template-configuration.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +12 -12
- package/dist/async.js +0 -33
- package/dist/async.js.map +0 -1
- package/dist/code-generator.js +0 -11
- package/dist/code-generator.js.map +0 -1
- package/dist/config.js +0 -79
- package/dist/config.js.map +0 -1
- package/dist/content-types.js +0 -162
- package/dist/content-types.js.map +0 -1
- package/dist/convert-query-params.js +0 -477
- package/dist/convert-query-params.js.map +0 -1
- package/dist/env-helper.js +0 -84
- package/dist/env-helper.js.map +0 -1
- package/dist/errors.js +0 -101
- package/dist/errors.js.map +0 -1
- package/dist/file.js +0 -54
- package/dist/file.js.map +0 -1
- package/dist/format-yup-error.js +0 -17
- package/dist/format-yup-error.js.map +0 -1
- package/dist/hooks.js +0 -89
- package/dist/hooks.js.map +0 -1
- package/dist/import-default.js +0 -9
- package/dist/import-default.js.map +0 -1
- package/dist/object-formatting.js +0 -14
- package/dist/object-formatting.js.map +0 -1
- package/dist/operators.js +0 -72
- package/dist/operators.js.map +0 -1
- package/dist/pagination.js +0 -80
- package/dist/pagination.js.map +0 -1
- package/dist/parse-multipart.js +0 -36
- package/dist/parse-multipart.js.map +0 -1
- package/dist/parse-type.js +0 -108
- package/dist/parse-type.js.map +0 -1
- package/dist/policy.js +0 -109
- package/dist/policy.js.map +0 -1
- package/dist/print-value.js +0 -50
- package/dist/print-value.js.map +0 -1
- package/dist/provider-factory.js +0 -80
- package/dist/provider-factory.js.map +0 -1
- package/dist/relations.js +0 -23
- package/dist/relations.js.map +0 -1
- package/dist/sanitize/index.js +0 -156
- package/dist/sanitize/index.js.map +0 -1
- package/dist/sanitize/sanitizers.js +0 -147
- package/dist/sanitize/sanitizers.js.map +0 -1
- package/dist/sanitize/visitors/index.js +0 -21
- package/dist/sanitize/visitors/index.js.map +0 -1
- package/dist/sanitize/visitors/remove-disallowed-fields.js +0 -83
- package/dist/sanitize/visitors/remove-disallowed-fields.js.map +0 -1
- package/dist/sanitize/visitors/remove-dynamic-zones.js +0 -10
- package/dist/sanitize/visitors/remove-dynamic-zones.js.map +0 -1
- package/dist/sanitize/visitors/remove-morph-to-relations.js +0 -10
- package/dist/sanitize/visitors/remove-morph-to-relations.js.map +0 -1
- package/dist/sanitize/visitors/remove-password.js +0 -9
- package/dist/sanitize/visitors/remove-password.js.map +0 -1
- package/dist/sanitize/visitors/remove-private.js +0 -14
- package/dist/sanitize/visitors/remove-private.js.map +0 -1
- package/dist/sanitize/visitors/remove-restricted-fields.js +0 -25
- package/dist/sanitize/visitors/remove-restricted-fields.js.map +0 -1
- package/dist/sanitize/visitors/remove-restricted-relations.js +0 -88
- package/dist/sanitize/visitors/remove-restricted-relations.js.map +0 -1
- package/dist/set-creator-fields.js +0 -39
- package/dist/set-creator-fields.js.map +0 -1
- package/dist/string-formatting.js +0 -85
- package/dist/string-formatting.js.map +0 -1
- package/dist/template-configuration.js +0 -30
- package/dist/template-configuration.js.map +0 -1
- package/dist/template.js +0 -20
- package/dist/template.js.map +0 -1
- package/dist/traverse/factory.js +0 -127
- package/dist/traverse/factory.js.map +0 -1
- package/dist/traverse/index.js +0 -17
- package/dist/traverse/index.js.map +0 -1
- package/dist/traverse/query-fields.js +0 -35
- package/dist/traverse/query-fields.js.map +0 -1
- package/dist/traverse/query-filters.js +0 -75
- package/dist/traverse/query-filters.js.map +0 -1
- package/dist/traverse/query-populate.js +0 -171
- package/dist/traverse/query-populate.js.map +0 -1
- package/dist/traverse/query-sort.js +0 -117
- package/dist/traverse/query-sort.js.map +0 -1
- package/dist/traverse-entity.js +0 -134
- package/dist/traverse-entity.js.map +0 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/validate/index.js +0 -121
- package/dist/validate/index.js.map +0 -1
- package/dist/validate/utils.js +0 -9
- package/dist/validate/utils.js.map +0 -1
- package/dist/validate/validators.js +0 -115
- package/dist/validate/validators.js.map +0 -1
- package/dist/validate/visitors/index.js +0 -21
- package/dist/validate/visitors/index.js.map +0 -1
- package/dist/validate/visitors/throw-disallowed-fields.js +0 -84
- package/dist/validate/visitors/throw-disallowed-fields.js.map +0 -1
- package/dist/validate/visitors/throw-dynamic-zones.js +0 -11
- package/dist/validate/visitors/throw-dynamic-zones.js.map +0 -1
- package/dist/validate/visitors/throw-morph-to-relations.js +0 -11
- package/dist/validate/visitors/throw-morph-to-relations.js.map +0 -1
- package/dist/validate/visitors/throw-password.js +0 -10
- package/dist/validate/visitors/throw-password.js.map +0 -1
- package/dist/validate/visitors/throw-private.js +0 -15
- package/dist/validate/visitors/throw-private.js.map +0 -1
- package/dist/validate/visitors/throw-restricted-fields.js +0 -24
- package/dist/validate/visitors/throw-restricted-fields.js.map +0 -1
- package/dist/validate/visitors/throw-restricted-relations.js +0 -81
- package/dist/validate/visitors/throw-restricted-relations.js.map +0 -1
- package/dist/validators.js +0 -64
- package/dist/validators.js.map +0 -1
- package/dist/webhook.js +0 -27
- package/dist/webhook.js.map +0 -1
- package/dist/yup.js +0 -108
- package/dist/yup.js.map +0 -1
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const fp_1 = require("lodash/fp");
|
|
4
|
-
exports.default = (allowedFields = null) => ({ key, path: { attribute: path } }, { remove }) => {
|
|
5
|
-
// All fields are allowed
|
|
6
|
-
if (allowedFields === null) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
// Throw on invalid formats
|
|
10
|
-
if (!((0, fp_1.isArray)(allowedFields) && allowedFields.every(fp_1.isString))) {
|
|
11
|
-
throw new TypeError(`Expected array of strings for allowedFields but got "${typeof allowedFields}"`);
|
|
12
|
-
}
|
|
13
|
-
if ((0, fp_1.isNil)(path)) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const containedPaths = getContainedPaths(path);
|
|
17
|
-
/**
|
|
18
|
-
* Tells if the current path should be kept or not based
|
|
19
|
-
* on the success of the check functions for any of the allowed paths.
|
|
20
|
-
*
|
|
21
|
-
* The check functions are defined as follow:
|
|
22
|
-
*
|
|
23
|
-
* `containedPaths.includes(p)`
|
|
24
|
-
* @example
|
|
25
|
-
* ```js
|
|
26
|
-
* const path = 'foo.bar.field';
|
|
27
|
-
* const p = 'foo.bar';
|
|
28
|
-
* // it should match
|
|
29
|
-
*
|
|
30
|
-
* const path = 'foo.bar.field';
|
|
31
|
-
* const p = 'bar.foo';
|
|
32
|
-
* // it shouldn't match
|
|
33
|
-
*
|
|
34
|
-
* const path = 'foo.bar';
|
|
35
|
-
* const p = 'foo.bar.field';
|
|
36
|
-
* // it should match but isn't handled by this check
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* `p.startsWith(`${path}.`)`
|
|
40
|
-
* @example
|
|
41
|
-
* ```js
|
|
42
|
-
* const path = 'foo.bar';
|
|
43
|
-
* const p = 'foo.bar.field';
|
|
44
|
-
* // it should match
|
|
45
|
-
*
|
|
46
|
-
* const path = 'foo.bar.field';
|
|
47
|
-
* const p = 'bar.foo';
|
|
48
|
-
* // it shouldn't match
|
|
49
|
-
*
|
|
50
|
-
* const path = 'foo.bar.field';
|
|
51
|
-
* const p = 'foo.bar';
|
|
52
|
-
* // it should match but isn't handled by this check
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
const isPathAllowed = allowedFields.some((p) => containedPaths.includes(p) || p.startsWith(`${path}.`));
|
|
56
|
-
if (isPathAllowed) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
// Remove otherwise
|
|
60
|
-
remove(key);
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Retrieve the list of allowed paths based on the given path
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```js
|
|
67
|
-
* const containedPaths = getContainedPaths('foo');
|
|
68
|
-
* // ['foo']
|
|
69
|
-
*
|
|
70
|
-
* * const containedPaths = getContainedPaths('foo.bar');
|
|
71
|
-
* // ['foo', 'foo.bar']
|
|
72
|
-
*
|
|
73
|
-
* * const containedPaths = getContainedPaths('foo.bar.field');
|
|
74
|
-
* // ['foo', 'foo.bar', 'foo.bar.field']
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
const getContainedPaths = (path) => {
|
|
78
|
-
const parts = (0, fp_1.toPath)(path);
|
|
79
|
-
return parts.reduce((acc, value, index, list) => {
|
|
80
|
-
return [...acc, list.slice(0, index + 1).join('.')];
|
|
81
|
-
}, []);
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=remove-disallowed-fields.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-disallowed-fields.js","sourceRoot":"","sources":["../../../src/sanitize/visitors/remove-disallowed-fields.ts"],"names":[],"mappings":";;AAAA,kCAA6D;AAG7D,kBAAe,CAAC,gBAAiC,IAAI,EAAW,EAAE,CAChE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACjD,yBAAyB;IACzB,IAAI,aAAa,KAAK,IAAI,EAAE;QAC1B,OAAO;KACR;IAED,2BAA2B;IAC3B,IAAI,CAAC,CAAC,IAAA,YAAO,EAAC,aAAa,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,aAAQ,CAAC,CAAC,EAAE;QAC9D,MAAM,IAAI,SAAS,CACjB,wDAAwD,OAAO,aAAa,GAAG,CAChF,CAAC;KACH;IAED,IAAI,IAAA,UAAK,EAAC,IAAI,CAAC,EAAE;QACf,OAAO;KACR;IAED,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI,CACtC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,CAC9D,CAAC;IAEF,IAAI,aAAa,EAAE;QACjB,OAAO;KACR;IAED,mBAAmB;IACnB,MAAM,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AAEJ;;;;;;;;;;;;;;GAcG;AACH,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,MAAM,KAAK,GAAG,IAAA,WAAM,EAAC,IAAI,CAAC,CAAC;IAE3B,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAC9C,OAAO,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACtD,CAAC,EAAE,EAAc,CAAC,CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const content_types_1 = require("../../content-types");
|
|
4
|
-
const visitor = ({ key, attribute }, { remove }) => {
|
|
5
|
-
if ((0, content_types_1.isDynamicZoneAttribute)(attribute)) {
|
|
6
|
-
remove(key);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
exports.default = visitor;
|
|
10
|
-
//# sourceMappingURL=remove-dynamic-zones.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-dynamic-zones.js","sourceRoot":"","sources":["../../../src/sanitize/visitors/remove-dynamic-zones.ts"],"names":[],"mappings":";;AAAA,uDAA6D;AAG7D,MAAM,OAAO,GAAY,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC1D,IAAI,IAAA,sCAAsB,EAAC,SAAS,CAAC,EAAE;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC;KACb;AACH,CAAC,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const content_types_1 = require("../../content-types");
|
|
4
|
-
const visitor = ({ key, attribute }, { remove }) => {
|
|
5
|
-
if ((0, content_types_1.isMorphToRelationalAttribute)(attribute)) {
|
|
6
|
-
remove(key);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
exports.default = visitor;
|
|
10
|
-
//# sourceMappingURL=remove-morph-to-relations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-morph-to-relations.js","sourceRoot":"","sources":["../../../src/sanitize/visitors/remove-morph-to-relations.ts"],"names":[],"mappings":";;AAAA,uDAAmE;AAGnE,MAAM,OAAO,GAAY,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC1D,IAAI,IAAA,4CAA4B,EAAC,SAAS,CAAC,EAAE;QAC3C,MAAM,CAAC,GAAG,CAAC,CAAC;KACb;AACH,CAAC,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const visitor = ({ key, attribute }, { remove }) => {
|
|
4
|
-
if (attribute?.type === 'password') {
|
|
5
|
-
remove(key);
|
|
6
|
-
}
|
|
7
|
-
};
|
|
8
|
-
exports.default = visitor;
|
|
9
|
-
//# sourceMappingURL=remove-password.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-password.js","sourceRoot":"","sources":["../../../src/sanitize/visitors/remove-password.ts"],"names":[],"mappings":";;AAEA,MAAM,OAAO,GAAY,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC1D,IAAI,SAAS,EAAE,IAAI,KAAK,UAAU,EAAE;QAClC,MAAM,CAAC,GAAG,CAAC,CAAC;KACb;AACH,CAAC,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const content_types_1 = require("../../content-types");
|
|
4
|
-
const visitor = ({ schema, key, attribute }, { remove }) => {
|
|
5
|
-
if (!attribute) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
const isPrivate = attribute.private === true || (0, content_types_1.isPrivateAttribute)(schema, key);
|
|
9
|
-
if (isPrivate) {
|
|
10
|
-
remove(key);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
exports.default = visitor;
|
|
14
|
-
//# sourceMappingURL=remove-private.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-private.js","sourceRoot":"","sources":["../../../src/sanitize/visitors/remove-private.ts"],"names":[],"mappings":";;AAAA,uDAAyD;AAGzD,MAAM,OAAO,GAAY,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAClE,IAAI,CAAC,SAAS,EAAE;QACd,OAAO;KACR;IAED,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,KAAK,IAAI,IAAI,IAAA,kCAAkB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhF,IAAI,SAAS,EAAE;QACb,MAAM,CAAC,GAAG,CAAC,CAAC;KACb;AACH,CAAC,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const fp_1 = require("lodash/fp");
|
|
4
|
-
exports.default = (restrictedFields = null) => ({ key, path: { attribute: path } }, { remove }) => {
|
|
5
|
-
// Remove all fields
|
|
6
|
-
if (restrictedFields === null) {
|
|
7
|
-
remove(key);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
// Throw on invalid formats
|
|
11
|
-
if (!((0, fp_1.isArray)(restrictedFields) && restrictedFields.every(fp_1.isString))) {
|
|
12
|
-
throw new TypeError(`Expected array of strings for restrictedFields but got "${typeof restrictedFields}"`);
|
|
13
|
-
}
|
|
14
|
-
// Remove if an exact match was found
|
|
15
|
-
if (restrictedFields.includes(path)) {
|
|
16
|
-
remove(key);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
// Remove nested matches
|
|
20
|
-
const isRestrictedNested = restrictedFields.some((allowedPath) => path?.toString().startsWith(`${allowedPath}.`));
|
|
21
|
-
if (isRestrictedNested) {
|
|
22
|
-
remove(key);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=remove-restricted-fields.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-restricted-fields.js","sourceRoot":"","sources":["../../../src/sanitize/visitors/remove-restricted-fields.ts"],"names":[],"mappings":";;AAAA,kCAA8C;AAG9C,kBAAe,CAAC,mBAAoC,IAAI,EAAW,EAAE,CACnE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACjD,oBAAoB;IACpB,IAAI,gBAAgB,KAAK,IAAI,EAAE;QAC7B,MAAM,CAAC,GAAG,CAAC,CAAC;QACZ,OAAO;KACR;IAED,2BAA2B;IAC3B,IAAI,CAAC,CAAC,IAAA,YAAO,EAAC,gBAAgB,CAAC,IAAI,gBAAgB,CAAC,KAAK,CAAC,aAAQ,CAAC,CAAC,EAAE;QACpE,MAAM,IAAI,SAAS,CACjB,2DAA2D,OAAO,gBAAgB,GAAG,CACtF,CAAC;KACH;IAED,qCAAqC;IACrC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,IAAc,CAAC,EAAE;QAC7C,MAAM,CAAC,GAAG,CAAC,CAAC;QACZ,OAAO;KACR;IAED,wBAAwB;IACxB,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAC/D,IAAI,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,CAAC,CAC/C,CAAC;IACF,IAAI,kBAAkB,EAAE;QACtB,MAAM,CAAC,GAAG,CAAC,CAAC;KACb;AACH,CAAC,CAAC"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const contentTypeUtils = __importStar(require("../../content-types"));
|
|
27
|
-
const ACTIONS_TO_VERIFY = ['find'];
|
|
28
|
-
const { CREATED_BY_ATTRIBUTE, UPDATED_BY_ATTRIBUTE } = contentTypeUtils.constants;
|
|
29
|
-
exports.default = (auth) => async ({ data, key, attribute, schema }, { remove, set }) => {
|
|
30
|
-
if (!attribute) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const isRelation = attribute.type === 'relation';
|
|
34
|
-
if (!isRelation) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const handleMorphRelation = async () => {
|
|
38
|
-
const newMorphValue = [];
|
|
39
|
-
for (const element of data[key]) {
|
|
40
|
-
const scopes = ACTIONS_TO_VERIFY.map((action) => `${element.__type}.${action}`);
|
|
41
|
-
const isAllowed = await hasAccessToSomeScopes(scopes, auth);
|
|
42
|
-
if (isAllowed) {
|
|
43
|
-
newMorphValue.push(element);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// If the new value is empty, remove the relation completely
|
|
47
|
-
if (newMorphValue.length === 0) {
|
|
48
|
-
remove(key);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
set(key, newMorphValue);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const handleRegularRelation = async () => {
|
|
55
|
-
const scopes = ACTIONS_TO_VERIFY.map((action) => `${attribute.target}.${action}`);
|
|
56
|
-
const isAllowed = await hasAccessToSomeScopes(scopes, auth);
|
|
57
|
-
// If the authenticated user don't have access to any of the scopes, then remove the field
|
|
58
|
-
if (!isAllowed) {
|
|
59
|
-
remove(key);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const isCreatorRelation = [CREATED_BY_ATTRIBUTE, UPDATED_BY_ATTRIBUTE].includes(key);
|
|
63
|
-
// Polymorphic relations
|
|
64
|
-
if (contentTypeUtils.isMorphToRelationalAttribute(attribute)) {
|
|
65
|
-
await handleMorphRelation();
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
// Creator relations
|
|
69
|
-
if (isCreatorRelation && schema.options?.populateCreatorFields) {
|
|
70
|
-
// do nothing
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
// Regular relations
|
|
74
|
-
await handleRegularRelation();
|
|
75
|
-
};
|
|
76
|
-
const hasAccessToSomeScopes = async (scopes, auth) => {
|
|
77
|
-
for (const scope of scopes) {
|
|
78
|
-
try {
|
|
79
|
-
await strapi.auth.verify(auth, { scope });
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
catch {
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return false;
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=remove-restricted-relations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-restricted-relations.js","sourceRoot":"","sources":["../../../src/sanitize/visitors/remove-restricted-relations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAwD;AAGxD,MAAM,iBAAiB,GAAG,CAAC,MAAM,CAAC,CAAC;AACnC,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,GAAG,gBAAgB,CAAC,SAAS,CAAC;AAIlF,kBAAe,CAAC,IAAa,EAAW,EAAE,CACxC,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE;IAC1D,IAAI,CAAC,SAAS,EAAE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,CAAC,4BAA4B,CAAC,SAAS,CAAC,EAAE;QAC5D,MAAM,mBAAmB,EAAE,CAAC;QAC5B,OAAO;KACR;IAED,oBAAoB;IACpB,IAAI,iBAAiB,IAAI,MAAM,CAAC,OAAO,EAAE,qBAAqB,EAAE;QAC9D,aAAa;QACb,OAAO;KACR;IAED,oBAAoB;IACpB,MAAM,qBAAqB,EAAE,CAAC;AAChC,CAAC,CAAC;AAEJ,MAAM,qBAAqB,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAa,EAAE,EAAE;IACtE,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,IAAI;YACF,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC1C,OAAO,IAAI,CAAC;SACb;QAAC,MAAM;YACN,SAAS;SACV;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const fp_1 = require("lodash/fp");
|
|
27
|
-
const contentTypes = __importStar(require("./content-types"));
|
|
28
|
-
const { CREATED_BY_ATTRIBUTE, UPDATED_BY_ATTRIBUTE } = contentTypes.constants;
|
|
29
|
-
const setCreatorFields = ({ user, isEdition = false }) => (data) => {
|
|
30
|
-
if (isEdition) {
|
|
31
|
-
return (0, fp_1.assoc)(UPDATED_BY_ATTRIBUTE, user.id, data);
|
|
32
|
-
}
|
|
33
|
-
return (0, fp_1.assign)(data, {
|
|
34
|
-
[CREATED_BY_ATTRIBUTE]: user.id,
|
|
35
|
-
[UPDATED_BY_ATTRIBUTE]: user.id,
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
exports.default = setCreatorFields;
|
|
39
|
-
//# sourceMappingURL=set-creator-fields.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-creator-fields.js","sourceRoot":"","sources":["../src/set-creator-fields.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAA0C;AAC1C,8DAAgD;AAEhD,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,GAAG,YAAY,CAAC,SAAS,CAAC;AAW9E,MAAM,gBAAgB,GACpB,CAAuB,EAAE,IAAI,EAAE,SAAS,GAAG,KAAK,EAAW,EAAE,EAAE,CAC/D,CAAoC,IAAgB,EAAE,EAAE;IACtD,IAAI,SAAS,EAAE;QACb,OAAO,IAAA,UAAK,EAAC,oBAAoB,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;KACnD;IAED,OAAO,IAAA,WAAM,EAAC,IAAI,EAAE;QAClB,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC,EAAE;QAC/B,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC,EAAE;KAChC,CAAC,CAAC;AACL,CAAC,CAAC;AAEJ,kBAAe,gBAAgB,CAAC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.joinBy = exports.startsWithANumber = exports.toRegressedEnumValue = exports.toKebabCase = exports.isKebabCase = exports.isCamelCase = exports.stringEquals = exports.stringIncludes = exports.escapeQuery = exports.getCommonPath = exports.getCommonBeginning = exports.nameToCollectionName = exports.nameToSlug = void 0;
|
|
30
|
-
const lodash_1 = __importStar(require("lodash"));
|
|
31
|
-
const fp_1 = require("lodash/fp");
|
|
32
|
-
const slugify_1 = __importDefault(require("@sindresorhus/slugify"));
|
|
33
|
-
const nameToSlug = (name, options = { separator: '-' }) => (0, slugify_1.default)(name, options);
|
|
34
|
-
exports.nameToSlug = nameToSlug;
|
|
35
|
-
const nameToCollectionName = (name) => (0, slugify_1.default)(name, { separator: '_' });
|
|
36
|
-
exports.nameToCollectionName = nameToCollectionName;
|
|
37
|
-
const toRegressedEnumValue = (value) => (0, slugify_1.default)(value, {
|
|
38
|
-
decamelize: false,
|
|
39
|
-
lowercase: false,
|
|
40
|
-
separator: '_',
|
|
41
|
-
});
|
|
42
|
-
exports.toRegressedEnumValue = toRegressedEnumValue;
|
|
43
|
-
const getCommonBeginning = (...strings) => lodash_1.default.takeWhile(strings[0], (char, index) => strings.every((string) => string[index] === char)).join('');
|
|
44
|
-
exports.getCommonBeginning = getCommonBeginning;
|
|
45
|
-
const getCommonPath = (...paths) => {
|
|
46
|
-
const [segments, ...otherSegments] = paths.map((it) => lodash_1.default.split(it, '/'));
|
|
47
|
-
return lodash_1.default.join(lodash_1.default.takeWhile(segments, (str, index) => otherSegments.every((it) => it[index] === str)), '/');
|
|
48
|
-
};
|
|
49
|
-
exports.getCommonPath = getCommonPath;
|
|
50
|
-
const escapeQuery = (query, charsToEscape, escapeChar = '\\') => {
|
|
51
|
-
return query
|
|
52
|
-
.split('')
|
|
53
|
-
.reduce((escapedQuery, char) => charsToEscape.includes(char)
|
|
54
|
-
? `${escapedQuery}${escapeChar}${char}`
|
|
55
|
-
: `${escapedQuery}${char}`, '');
|
|
56
|
-
};
|
|
57
|
-
exports.escapeQuery = escapeQuery;
|
|
58
|
-
const stringIncludes = (arr, val) => arr.map(String).includes(String(val));
|
|
59
|
-
exports.stringIncludes = stringIncludes;
|
|
60
|
-
const stringEquals = (a, b) => String(a) === String(b);
|
|
61
|
-
exports.stringEquals = stringEquals;
|
|
62
|
-
const isCamelCase = (value) => /^[a-z][a-zA-Z0-9]+$/.test(value);
|
|
63
|
-
exports.isCamelCase = isCamelCase;
|
|
64
|
-
const isKebabCase = (value) => /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.test(value);
|
|
65
|
-
exports.isKebabCase = isKebabCase;
|
|
66
|
-
const startsWithANumber = (value) => /^[0-9]/.test(value);
|
|
67
|
-
exports.startsWithANumber = startsWithANumber;
|
|
68
|
-
const joinBy = (joint, ...args) => {
|
|
69
|
-
const trim = (0, fp_1.trimChars)(joint);
|
|
70
|
-
const trimEnd = (0, fp_1.trimCharsEnd)(joint);
|
|
71
|
-
const trimStart = (0, fp_1.trimCharsStart)(joint);
|
|
72
|
-
return args.reduce((url, path, index) => {
|
|
73
|
-
if (args.length === 1)
|
|
74
|
-
return path;
|
|
75
|
-
if (index === 0)
|
|
76
|
-
return trimEnd(path);
|
|
77
|
-
if (index === args.length - 1)
|
|
78
|
-
return url + joint + trimStart(path);
|
|
79
|
-
return url + joint + trim(path);
|
|
80
|
-
}, '');
|
|
81
|
-
};
|
|
82
|
-
exports.joinBy = joinBy;
|
|
83
|
-
const toKebabCase = (value) => (0, lodash_1.kebabCase)(value);
|
|
84
|
-
exports.toKebabCase = toKebabCase;
|
|
85
|
-
//# sourceMappingURL=string-formatting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string-formatting.js","sourceRoot":"","sources":["../src/string-formatting.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAsC;AACtC,kCAAoE;AACpE,oEAA4C;AAE5C,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,UAA2B,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE,CACjF,IA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AC,KAAK,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,IAAA,mBAAc,EAAC,KAAK,CAAC,CAAC;IAExC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACnC,IAAI,KAAK,KAAK,CAAC;YAAE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,KAAK,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,GAAG,GAAG,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QACpE,OAAO,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAiBA,wBAAM;AAfR,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,kBAAS,EAAC,KAAK,CAAC,CAAC;AAYtD,kCAAW"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const lodash_1 = require("lodash");
|
|
3
|
-
const regex = /\$\{[^()]*\}/g;
|
|
4
|
-
const excludeConfigPaths = ['info.scripts'];
|
|
5
|
-
const isObj = (value) => (0, lodash_1.isPlainObject)(value);
|
|
6
|
-
/**
|
|
7
|
-
* Allow dynamic config values through the native ES6 template string function.
|
|
8
|
-
*/
|
|
9
|
-
const templateConfiguration = (obj, configPath = '') => {
|
|
10
|
-
// Allow values which looks like such as an ES6 literal string without parenthesis inside (aka function call).
|
|
11
|
-
// Exclude config with conflicting syntax (e.g. npm scripts).
|
|
12
|
-
return Object.keys(obj).reduce((acc, key) => {
|
|
13
|
-
const value = obj[key];
|
|
14
|
-
if (isObj(value) && !(0, lodash_1.isString)(value)) {
|
|
15
|
-
acc[key] = templateConfiguration(value, `${configPath}.${key}`);
|
|
16
|
-
}
|
|
17
|
-
else if ((0, lodash_1.isString)(value) &&
|
|
18
|
-
!excludeConfigPaths.includes(configPath.substr(1)) &&
|
|
19
|
-
value.match(regex) !== null) {
|
|
20
|
-
// eslint-disable-next-line prefer-template, no-eval
|
|
21
|
-
acc[key] = eval('`' + value + '`');
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
acc[key] = value;
|
|
25
|
-
}
|
|
26
|
-
return acc;
|
|
27
|
-
}, {});
|
|
28
|
-
};
|
|
29
|
-
module.exports = templateConfiguration;
|
|
30
|
-
//# sourceMappingURL=template-configuration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-configuration.js","sourceRoot":"","sources":["../src/template-configuration.ts"],"names":[],"mappings":";AAAA,mCAAiD;AAEjD,MAAM,KAAK,GAAG,eAAe,CAAC;AAC9B,MAAM,kBAAkB,GAAG,CAAC,cAAc,CAAC,CAAC;AAE5C,MAAM,KAAK,GAAG,CAAC,KAAc,EAAoC,EAAE,CAAC,IAAA,sBAAa,EAAC,KAAK,CAAC,CAAC;AAEzF;;GAEG;AACH,MAAM,qBAAqB,GAAG,CAAC,GAA4B,EAAE,UAAU,GAAG,EAAE,EAAE,EAAE;IAC9E,8GAA8G;IAC9G,6DAA6D;IAC7D,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC1C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QAEvB,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAA,iBAAQ,EAAC,KAAK,CAAC,EAAE;YACpC,GAAG,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAC,KAAK,EAAE,GAAG,UAAU,IAAI,GAAG,EAAE,CAAC,CAAC;SACjE;aAAM,IACL,IAAA,iBAAQ,EAAC,KAAK,CAAC;YACf,CAAC,kBAAkB,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAClD,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,EAC3B;YACA,oDAAoD;YACpD,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC;SACpC;aAAM;YACL,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAClB;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAA6B,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,iBAAS,qBAAqB,CAAC"}
|
package/dist/template.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLooseInterpolationRegExp = exports.createStrictInterpolationRegExp = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Create a strict interpolation RegExp based on the given variables' name
|
|
6
|
-
*/
|
|
7
|
-
const createStrictInterpolationRegExp = (allowedVariableNames, flags) => {
|
|
8
|
-
const oneOfVariables = allowedVariableNames.join('|');
|
|
9
|
-
// 1. We need to match the delimiters: <%= ... %>
|
|
10
|
-
// 2. We accept any number of whitespaces characters before and/or after the variable name: \s* ... \s*
|
|
11
|
-
// 3. We only accept values from the variable list as interpolation variables' name: : (${oneOfVariables})
|
|
12
|
-
return new RegExp(`<%=\\s*(${oneOfVariables})\\s*%>`, flags);
|
|
13
|
-
};
|
|
14
|
-
exports.createStrictInterpolationRegExp = createStrictInterpolationRegExp;
|
|
15
|
-
/**
|
|
16
|
-
* Create a loose interpolation RegExp to match as many groups as possible
|
|
17
|
-
*/
|
|
18
|
-
const createLooseInterpolationRegExp = (flags) => new RegExp(/<%=([\s\S]+?)%>/, flags);
|
|
19
|
-
exports.createLooseInterpolationRegExp = createLooseInterpolationRegExp;
|
|
20
|
-
//# sourceMappingURL=template.js.map
|
package/dist/template.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAM,+BAA+B,GAAG,CAAC,oBAA8B,EAAE,KAAa,EAAE,EAAE;IACxF,MAAM,cAAc,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEtD,iDAAiD;IACjD,uGAAuG;IACvG,0GAA0G;IAC1G,OAAO,IAAI,MAAM,CAAC,WAAW,cAAc,SAAS,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC,CAAC;AAOO,0EAA+B;AALxC;;GAEG;AACH,MAAM,8BAA8B,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;AAErD,wEAA8B"}
|
package/dist/traverse/factory.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-loop-func */
|
|
4
|
-
const fp_1 = require("lodash/fp");
|
|
5
|
-
const DEFAULT_PATH = { raw: null, attribute: null };
|
|
6
|
-
exports.default = () => {
|
|
7
|
-
const state = {
|
|
8
|
-
parsers: [],
|
|
9
|
-
interceptors: [],
|
|
10
|
-
ignore: [],
|
|
11
|
-
handlers: {
|
|
12
|
-
attributes: [],
|
|
13
|
-
common: [],
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
const traverse = async (visitor, options, data) => {
|
|
17
|
-
const { path = DEFAULT_PATH, schema } = options ?? {};
|
|
18
|
-
// interceptors
|
|
19
|
-
for (const { predicate, handler } of state.interceptors) {
|
|
20
|
-
if (predicate(data)) {
|
|
21
|
-
return handler(visitor, options, data, { recurse: traverse });
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
// parsers
|
|
25
|
-
const parser = state.parsers.find((parser) => parser.predicate(data))?.parser;
|
|
26
|
-
const utils = parser?.(data);
|
|
27
|
-
// Return the data untouched if we don't know how to traverse it
|
|
28
|
-
if (!utils) {
|
|
29
|
-
return data;
|
|
30
|
-
}
|
|
31
|
-
// main loop
|
|
32
|
-
let out = utils.transform(data);
|
|
33
|
-
const keys = utils.keys(out);
|
|
34
|
-
for (const key of keys) {
|
|
35
|
-
const attribute = schema?.attributes?.[key] ??
|
|
36
|
-
// FIX: Needed to not break existing behavior on the API.
|
|
37
|
-
// It looks for the attribute in the DB metadata when the key is in snake_case
|
|
38
|
-
schema?.attributes?.[strapi.db.metadata.get(schema?.uid).columnToAttribute[key]];
|
|
39
|
-
const newPath = { ...path };
|
|
40
|
-
newPath.raw = (0, fp_1.isNil)(path.raw) ? key : `${path.raw}.${key}`;
|
|
41
|
-
if (!(0, fp_1.isNil)(attribute)) {
|
|
42
|
-
newPath.attribute = (0, fp_1.isNil)(path.attribute) ? key : `${path.attribute}.${key}`;
|
|
43
|
-
}
|
|
44
|
-
// visitors
|
|
45
|
-
const visitorOptions = {
|
|
46
|
-
key,
|
|
47
|
-
value: utils.get(key, out),
|
|
48
|
-
attribute,
|
|
49
|
-
schema,
|
|
50
|
-
path: newPath,
|
|
51
|
-
data: out,
|
|
52
|
-
};
|
|
53
|
-
const transformUtils = {
|
|
54
|
-
remove(key) {
|
|
55
|
-
out = utils.remove(key, out);
|
|
56
|
-
},
|
|
57
|
-
set(key, value) {
|
|
58
|
-
out = utils.set(key, value, out);
|
|
59
|
-
},
|
|
60
|
-
recurse: traverse,
|
|
61
|
-
};
|
|
62
|
-
await visitor(visitorOptions, (0, fp_1.pick)(['remove', 'set'], transformUtils));
|
|
63
|
-
const value = utils.get(key, out);
|
|
64
|
-
const createContext = () => ({
|
|
65
|
-
key,
|
|
66
|
-
value,
|
|
67
|
-
attribute,
|
|
68
|
-
schema,
|
|
69
|
-
path: newPath,
|
|
70
|
-
data: out,
|
|
71
|
-
visitor,
|
|
72
|
-
});
|
|
73
|
-
// ignore
|
|
74
|
-
const ignoreCtx = createContext();
|
|
75
|
-
const shouldIgnore = state.ignore.some((predicate) => predicate(ignoreCtx));
|
|
76
|
-
if (shouldIgnore) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
// handlers
|
|
80
|
-
const handlers = [...state.handlers.common, ...state.handlers.attributes];
|
|
81
|
-
for await (const handler of handlers) {
|
|
82
|
-
const ctx = createContext();
|
|
83
|
-
const pass = await handler.predicate(ctx);
|
|
84
|
-
if (pass) {
|
|
85
|
-
await handler.handler(ctx, (0, fp_1.pick)(['recurse', 'set'], transformUtils));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return out;
|
|
90
|
-
};
|
|
91
|
-
return {
|
|
92
|
-
traverse,
|
|
93
|
-
intercept(predicate, handler) {
|
|
94
|
-
state.interceptors.push({ predicate, handler });
|
|
95
|
-
return this;
|
|
96
|
-
},
|
|
97
|
-
parse(predicate, parser) {
|
|
98
|
-
state.parsers.push({ predicate, parser });
|
|
99
|
-
return this;
|
|
100
|
-
},
|
|
101
|
-
ignore(predicate) {
|
|
102
|
-
state.ignore.push(predicate);
|
|
103
|
-
return this;
|
|
104
|
-
},
|
|
105
|
-
on(predicate, handler) {
|
|
106
|
-
state.handlers.common.push({ predicate, handler });
|
|
107
|
-
return this;
|
|
108
|
-
},
|
|
109
|
-
onAttribute(predicate, handler) {
|
|
110
|
-
state.handlers.attributes.push({ predicate, handler });
|
|
111
|
-
return this;
|
|
112
|
-
},
|
|
113
|
-
onRelation(handler) {
|
|
114
|
-
return this.onAttribute(({ attribute }) => attribute?.type === 'relation', handler);
|
|
115
|
-
},
|
|
116
|
-
onMedia(handler) {
|
|
117
|
-
return this.onAttribute(({ attribute }) => attribute?.type === 'media', handler);
|
|
118
|
-
},
|
|
119
|
-
onComponent(handler) {
|
|
120
|
-
return this.onAttribute(({ attribute }) => attribute?.type === 'component', handler);
|
|
121
|
-
},
|
|
122
|
-
onDynamicZone(handler) {
|
|
123
|
-
return this.onAttribute(({ attribute }) => attribute?.type === 'dynamiczone', handler);
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
//# sourceMappingURL=factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/traverse/factory.ts"],"names":[],"mappings":";;AAAA,oDAAoD;AACpD,kCAAwC;AAoGxC,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAEpD,kBAAe,GAAG,EAAE;IAClB,MAAM,KAAK,GAAU;QACnB,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,UAAU,EAAE,EAAE;YACd,MAAM,EAAE,EAAE;SACX;KACF,CAAC;IAEF,MAAM,QAAQ,GAAa,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC1D,MAAM,EAAE,IAAI,GAAG,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAEtD,eAAe;QACf,KAAK,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,KAAK,CAAC,YAAY,EAAE;YACvD,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE;gBACnB,OAAO,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;aAC/D;SACF;QAED,UAAU;QACV,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC;QAC9E,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;QAE7B,gEAAgE;QAChE,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CA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AAW,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,IAAI,KAAK,WAAW,EAAE,OAAO,CAAC,CAAC;QACvF,CAAC;QAED,aAAa,CAAC,OAA0D;YACtE,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,IAAI,KAAK,aAAa,EAAE,OAAO,CAAC,CAAC;QACzF,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/traverse/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.traverseQueryFields = exports.traverseQueryPopulate = exports.traverseQuerySort = exports.traverseQueryFilters = exports.factory = void 0;
|
|
7
|
-
var factory_1 = require("./factory");
|
|
8
|
-
Object.defineProperty(exports, "factory", { enumerable: true, get: function () { return __importDefault(factory_1).default; } });
|
|
9
|
-
var query_filters_1 = require("./query-filters");
|
|
10
|
-
Object.defineProperty(exports, "traverseQueryFilters", { enumerable: true, get: function () { return __importDefault(query_filters_1).default; } });
|
|
11
|
-
var query_sort_1 = require("./query-sort");
|
|
12
|
-
Object.defineProperty(exports, "traverseQuerySort", { enumerable: true, get: function () { return __importDefault(query_sort_1).default; } });
|
|
13
|
-
var query_populate_1 = require("./query-populate");
|
|
14
|
-
Object.defineProperty(exports, "traverseQueryPopulate", { enumerable: true, get: function () { return __importDefault(query_populate_1).default; } });
|
|
15
|
-
var query_fields_1 = require("./query-fields");
|
|
16
|
-
Object.defineProperty(exports, "traverseQueryFields", { enumerable: true, get: function () { return __importDefault(query_fields_1).default; } });
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/traverse/index.ts"],"names":[],"mappings":";;;;;;AAAA,qCAA+C;AAAtC,mHAAA,OAAO,OAAW;AAC3B,iDAAkE;AAAzD,sIAAA,OAAO,OAAwB;AACxC,2CAA4D;AAAnD,gIAAA,OAAO,OAAqB;AACrC,mDAAoE;AAA3D,wIAAA,OAAO,OAAyB;AACzC,+CAAgE;AAAvD,oIAAA,OAAO,OAAuB"}
|