@strapi/core 5.18.1 → 5.20.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 (93) hide show
  1. package/dist/core-api/routes/index.d.ts +4 -22
  2. package/dist/core-api/routes/index.d.ts.map +1 -1
  3. package/dist/core-api/routes/index.js +150 -8
  4. package/dist/core-api/routes/index.js.map +1 -1
  5. package/dist/core-api/routes/index.mjs +131 -8
  6. package/dist/core-api/routes/index.mjs.map +1 -1
  7. package/dist/core-api/routes/validation/attributes.d.ts +244 -0
  8. package/dist/core-api/routes/validation/attributes.d.ts.map +1 -0
  9. package/dist/core-api/routes/validation/attributes.js +560 -0
  10. package/dist/core-api/routes/validation/attributes.js.map +1 -0
  11. package/dist/core-api/routes/validation/attributes.mjs +521 -0
  12. package/dist/core-api/routes/validation/attributes.mjs.map +1 -0
  13. package/dist/core-api/routes/validation/common.d.ts +105 -0
  14. package/dist/core-api/routes/validation/common.d.ts.map +1 -0
  15. package/dist/core-api/routes/validation/common.js +116 -0
  16. package/dist/core-api/routes/validation/common.js.map +1 -0
  17. package/dist/core-api/routes/validation/common.mjs +95 -0
  18. package/dist/core-api/routes/validation/common.mjs.map +1 -0
  19. package/dist/core-api/routes/validation/component.d.ts +34 -0
  20. package/dist/core-api/routes/validation/component.d.ts.map +1 -0
  21. package/dist/core-api/routes/validation/component.js +45 -0
  22. package/dist/core-api/routes/validation/component.js.map +1 -0
  23. package/dist/core-api/routes/validation/component.mjs +43 -0
  24. package/dist/core-api/routes/validation/component.mjs.map +1 -0
  25. package/dist/core-api/routes/validation/constants.d.ts +8 -0
  26. package/dist/core-api/routes/validation/constants.d.ts.map +1 -0
  27. package/dist/core-api/routes/validation/constants.js +18 -0
  28. package/dist/core-api/routes/validation/constants.js.map +1 -0
  29. package/dist/core-api/routes/validation/constants.mjs +16 -0
  30. package/dist/core-api/routes/validation/constants.mjs.map +1 -0
  31. package/dist/core-api/routes/validation/content-type.d.ts +128 -0
  32. package/dist/core-api/routes/validation/content-type.d.ts.map +1 -0
  33. package/dist/core-api/routes/validation/content-type.js +201 -0
  34. package/dist/core-api/routes/validation/content-type.js.map +1 -0
  35. package/dist/core-api/routes/validation/content-type.mjs +180 -0
  36. package/dist/core-api/routes/validation/content-type.mjs.map +1 -0
  37. package/dist/core-api/routes/validation/index.d.ts +5 -0
  38. package/dist/core-api/routes/validation/index.d.ts.map +1 -0
  39. package/dist/core-api/routes/validation/mappers.d.ts +105 -0
  40. package/dist/core-api/routes/validation/mappers.d.ts.map +1 -0
  41. package/dist/core-api/routes/validation/mappers.js +238 -0
  42. package/dist/core-api/routes/validation/mappers.js.map +1 -0
  43. package/dist/core-api/routes/validation/mappers.mjs +214 -0
  44. package/dist/core-api/routes/validation/mappers.mjs.map +1 -0
  45. package/dist/core-api/routes/validation/utils.d.ts +47 -0
  46. package/dist/core-api/routes/validation/utils.d.ts.map +1 -0
  47. package/dist/core-api/routes/validation/utils.js +112 -0
  48. package/dist/core-api/routes/validation/utils.js.map +1 -0
  49. package/dist/core-api/routes/validation/utils.mjs +90 -0
  50. package/dist/core-api/routes/validation/utils.mjs.map +1 -0
  51. package/dist/domain/module/index.d.ts.map +1 -1
  52. package/dist/domain/module/index.js +3 -0
  53. package/dist/domain/module/index.js.map +1 -1
  54. package/dist/domain/module/index.mjs +3 -0
  55. package/dist/domain/module/index.mjs.map +1 -1
  56. package/dist/factories.d.ts +3 -1
  57. package/dist/factories.d.ts.map +1 -1
  58. package/dist/factories.js +10 -2
  59. package/dist/factories.js.map +1 -1
  60. package/dist/factories.mjs +10 -3
  61. package/dist/factories.mjs.map +1 -1
  62. package/dist/middlewares/cors.d.ts +9 -1
  63. package/dist/middlewares/cors.d.ts.map +1 -1
  64. package/dist/middlewares/cors.js +39 -17
  65. package/dist/middlewares/cors.js.map +1 -1
  66. package/dist/middlewares/cors.mjs +39 -18
  67. package/dist/middlewares/cors.mjs.map +1 -1
  68. package/dist/package.json.js +13 -12
  69. package/dist/package.json.js.map +1 -1
  70. package/dist/package.json.mjs +13 -12
  71. package/dist/package.json.mjs.map +1 -1
  72. package/dist/services/metrics/index.d.ts +1 -1
  73. package/dist/services/metrics/index.d.ts.map +1 -1
  74. package/dist/services/metrics/index.js +9 -8
  75. package/dist/services/metrics/index.js.map +1 -1
  76. package/dist/services/metrics/index.mjs +9 -8
  77. package/dist/services/metrics/index.mjs.map +1 -1
  78. package/dist/services/metrics/sender.d.ts.map +1 -1
  79. package/dist/services/metrics/sender.js +2 -2
  80. package/dist/services/metrics/sender.js.map +1 -1
  81. package/dist/services/metrics/sender.mjs +2 -2
  82. package/dist/services/metrics/sender.mjs.map +1 -1
  83. package/dist/services/server/register-routes.js +22 -2
  84. package/dist/services/server/register-routes.js.map +1 -1
  85. package/dist/services/server/register-routes.mjs +22 -2
  86. package/dist/services/server/register-routes.mjs.map +1 -1
  87. package/dist/services/server/routing.d.ts +10 -0
  88. package/dist/services/server/routing.d.ts.map +1 -1
  89. package/dist/services/server/routing.js +7 -1
  90. package/dist/services/server/routing.js.map +1 -1
  91. package/dist/services/server/routing.mjs +7 -1
  92. package/dist/services/server/routing.mjs.map +1 -1
  93. package/package.json +13 -12
@@ -0,0 +1,105 @@
1
+ import type { Core, UID } from '@strapi/types';
2
+ import { AbstractRouteValidator } from '@strapi/utils';
3
+ import * as z from 'zod/v4';
4
+ /**
5
+ * AbstractCoreRouteValidator provides the foundation for validating and managing core routes within a Strapi context for a specific model.
6
+ *
7
+ * This abstract class extends the base AbstractRouteValidator from utils to add schema-aware validation
8
+ * logic for scalar and populatable fields defined in a model schema.
9
+ *
10
+ * It uses runtime information about Strapi models to derive and expose schema validations.
11
+ *
12
+ * @template {UID.Schema} T Representing the schema identifier to be validated.
13
+ */
14
+ export declare abstract class AbstractCoreRouteValidator<T extends UID.Schema> extends AbstractRouteValidator {
15
+ /**
16
+ * The `_strapi` variable serves as a reference to the core Strapi instance.
17
+ * It is used for interacting with the loaded model.
18
+ */
19
+ protected readonly _strapi: Core.Strapi;
20
+ /**
21
+ * A unique identifier used to represent a model within Strapi.
22
+ *
23
+ * The type of the identifier is generic to allow flexibility and ensure type safety
24
+ * when working with either content-types or components.
25
+ */
26
+ protected readonly _uid: T;
27
+ /**
28
+ * Protected constructor for initializing the class with the provided Strapi instance and unique identifier (UID).
29
+ *
30
+ * @param strapi The Strapi instance to be used.
31
+ * @param uid The unique identifier for the instance.
32
+ */
33
+ constructor(strapi: Core.Strapi, uid: T);
34
+ /**
35
+ * Retrieves an enum schema constructed from the keys of the scalar fields.
36
+ *
37
+ * @return A Zod enum containing the keys from the scalar fields.
38
+ */
39
+ get scalarFieldsEnum(): z.ZodEnum<{
40
+ [x: string]: string;
41
+ }>;
42
+ /**
43
+ * Retrieves an enum schema constructed from the keys of fields that can be populated (relations, components, files, etc.)
44
+ *
45
+ * @return A ZodEnum object containing the list of populatable field keys.
46
+ */
47
+ get populatableFieldsEnum(): z.ZodEnum<{
48
+ [x: string]: string;
49
+ }>;
50
+ /**
51
+ * Retrieves an array representation of the scalar fields.
52
+ *
53
+ * @return An array containing the scalar fields as defined by {@link scalarFieldsEnum}.
54
+ */
55
+ get scalarFieldsArray(): z.ZodArray<z.ZodEnum<{
56
+ [x: string]: string;
57
+ }>>;
58
+ /**
59
+ * Retrieves an array of populatable fields.
60
+ *
61
+ * @return A Zod array schema representing the available populatable fields as defined by {@link populatableFieldsEnum}.
62
+ */
63
+ get populatableFieldsArray(): z.ZodArray<z.ZodEnum<{
64
+ [x: string]: string;
65
+ }>>;
66
+ /**
67
+ * Retrieves the schema associated with the current model.
68
+ *
69
+ * The schema represents the structural definition of the model,
70
+ * as retrieved from the Strapi model associated with the given UID.
71
+ *
72
+ * @return The schema of the model retrieved from Strapi.
73
+ */
74
+ protected get _schema(): T extends UID.ContentType ? import("@strapi/types/dist/schema").ContentType<T> : T extends `${string}.${string}` ? import("@strapi/types/dist/schema").Component<T> : never;
75
+ /**
76
+ * Retrieves scalar fields from the object's schema attributes.
77
+ *
78
+ * Filters the schema attributes to include only those that are scalar and not private.
79
+ *
80
+ * @return An object composed of scalar fields from the schema attributes.
81
+ */
82
+ protected get _scalarFields(): {
83
+ [k: string]: import("@strapi/types/dist/schema/attribute").AnyAttribute;
84
+ };
85
+ /**
86
+ * Retrieves the populatable fields from the schema attributes.
87
+ *
88
+ * Filters the schema attributes to include only those that are populatable and not private.
89
+ *
90
+ * @return An object containing the populatable fields derived from the schema attributes.
91
+ */
92
+ protected get _populatableFields(): {
93
+ [k: string]: import("@strapi/types/dist/schema/attribute").AnyAttribute;
94
+ };
95
+ /**
96
+ * Creates a Zod schema as a record with scalar fields as keys and the specified type as values.
97
+ *
98
+ * @param type - The Zod type to use for the record's values.
99
+ * @return A Zod record schema with scalar fields as keys and the specified type as values.
100
+ */
101
+ fieldRecord(type: z.ZodTypeAny): z.ZodRecord<z.ZodEnum<{
102
+ [x: string]: string;
103
+ }>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
104
+ }
105
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/core-api/routes/validation/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAgB,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B;;;;;;;;;GASG;AACH,8BAAsB,0BAA0B,CAC9C,CAAC,SAAS,GAAG,CAAC,MAAM,CACpB,SAAQ,sBAAsB;IAC9B;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;IAExC;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAE3B;;;;;OAKG;gBACgB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;IAM9C;;;;OAIG;IACH,IAAW,gBAAgB;;OAE1B;IAED;;;;OAIG;IACH,IAAW,qBAAqB;;OAE/B;IAED;;;;OAIG;IACH,IAAW,iBAAiB;;QAE3B;IAED;;;;OAIG;IACH,IAAW,sBAAsB;;QAEhC;IAED;;;;;;;OAOG;IACH,SAAS,KAAK,OAAO,gLAEpB;IAED;;;;;;OAMG;IACH,SAAS,KAAK,aAAa;;MAQ1B;IAED;;;;;;OAMG;IACH,SAAS,KAAK,kBAAkB;;MAQ/B;IAED;;;;;OAKG;IACI,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU;;;CAGtC"}
@@ -0,0 +1,116 @@
1
+ 'use strict';
2
+
3
+ var strapiUtils = require('@strapi/utils');
4
+ var z = require('zod/v4');
5
+
6
+ function _interopNamespaceDefault(e) {
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
24
+
25
+ /**
26
+ * AbstractCoreRouteValidator provides the foundation for validating and managing core routes within a Strapi context for a specific model.
27
+ *
28
+ * This abstract class extends the base AbstractRouteValidator from utils to add schema-aware validation
29
+ * logic for scalar and populatable fields defined in a model schema.
30
+ *
31
+ * It uses runtime information about Strapi models to derive and expose schema validations.
32
+ *
33
+ * @template {UID.Schema} T Representing the schema identifier to be validated.
34
+ */ class AbstractCoreRouteValidator extends strapiUtils.AbstractRouteValidator {
35
+ /**
36
+ * Retrieves an enum schema constructed from the keys of the scalar fields.
37
+ *
38
+ * @return A Zod enum containing the keys from the scalar fields.
39
+ */ get scalarFieldsEnum() {
40
+ return z__namespace.enum(Object.keys(this._scalarFields));
41
+ }
42
+ /**
43
+ * Retrieves an enum schema constructed from the keys of fields that can be populated (relations, components, files, etc.)
44
+ *
45
+ * @return A ZodEnum object containing the list of populatable field keys.
46
+ */ get populatableFieldsEnum() {
47
+ return z__namespace.enum(Object.keys(this._populatableFields));
48
+ }
49
+ /**
50
+ * Retrieves an array representation of the scalar fields.
51
+ *
52
+ * @return An array containing the scalar fields as defined by {@link scalarFieldsEnum}.
53
+ */ get scalarFieldsArray() {
54
+ return z__namespace.array(this.scalarFieldsEnum);
55
+ }
56
+ /**
57
+ * Retrieves an array of populatable fields.
58
+ *
59
+ * @return A Zod array schema representing the available populatable fields as defined by {@link populatableFieldsEnum}.
60
+ */ get populatableFieldsArray() {
61
+ return z__namespace.array(this.populatableFieldsEnum);
62
+ }
63
+ /**
64
+ * Retrieves the schema associated with the current model.
65
+ *
66
+ * The schema represents the structural definition of the model,
67
+ * as retrieved from the Strapi model associated with the given UID.
68
+ *
69
+ * @return The schema of the model retrieved from Strapi.
70
+ */ get _schema() {
71
+ return this._strapi.getModel(this._uid);
72
+ }
73
+ /**
74
+ * Retrieves scalar fields from the object's schema attributes.
75
+ *
76
+ * Filters the schema attributes to include only those that are scalar and not private.
77
+ *
78
+ * @return An object composed of scalar fields from the schema attributes.
79
+ */ get _scalarFields() {
80
+ const attributes = Object.entries(this._schema.attributes);
81
+ const scalarEntries = attributes.filter(([, attribute])=>strapiUtils.contentTypes.isScalarAttribute(attribute)).filter(([attributeName])=>!strapiUtils.contentTypes.isPrivateAttribute(this._schema, attributeName));
82
+ return Object.fromEntries(scalarEntries);
83
+ }
84
+ /**
85
+ * Retrieves the populatable fields from the schema attributes.
86
+ *
87
+ * Filters the schema attributes to include only those that are populatable and not private.
88
+ *
89
+ * @return An object containing the populatable fields derived from the schema attributes.
90
+ */ get _populatableFields() {
91
+ const attributes = Object.entries(this._schema.attributes);
92
+ const populatableEntries = attributes.filter(([, attribute])=>!strapiUtils.contentTypes.isScalarAttribute(attribute)).filter(([attributeName])=>!strapiUtils.contentTypes.isPrivateAttribute(this._schema, attributeName));
93
+ return Object.fromEntries(populatableEntries);
94
+ }
95
+ /**
96
+ * Creates a Zod schema as a record with scalar fields as keys and the specified type as values.
97
+ *
98
+ * @param type - The Zod type to use for the record's values.
99
+ * @return A Zod record schema with scalar fields as keys and the specified type as values.
100
+ */ fieldRecord(type) {
101
+ return z__namespace.record(this.scalarFieldsEnum, type);
102
+ }
103
+ /**
104
+ * Protected constructor for initializing the class with the provided Strapi instance and unique identifier (UID).
105
+ *
106
+ * @param strapi The Strapi instance to be used.
107
+ * @param uid The unique identifier for the instance.
108
+ */ constructor(strapi, uid){
109
+ super();
110
+ this._strapi = strapi;
111
+ this._uid = uid;
112
+ }
113
+ }
114
+
115
+ exports.AbstractCoreRouteValidator = AbstractCoreRouteValidator;
116
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sources":["../../../../src/core-api/routes/validation/common.ts"],"sourcesContent":["import type { Core, UID } from '@strapi/types';\n\nimport { contentTypes, AbstractRouteValidator } from '@strapi/utils';\nimport * as z from 'zod/v4';\n\n/**\n * AbstractCoreRouteValidator provides the foundation for validating and managing core routes within a Strapi context for a specific model.\n *\n * This abstract class extends the base AbstractRouteValidator from utils to add schema-aware validation\n * logic for scalar and populatable fields defined in a model schema.\n *\n * It uses runtime information about Strapi models to derive and expose schema validations.\n *\n * @template {UID.Schema} T Representing the schema identifier to be validated.\n */\nexport abstract class AbstractCoreRouteValidator<\n T extends UID.Schema,\n> extends AbstractRouteValidator {\n /**\n * The `_strapi` variable serves as a reference to the core Strapi instance.\n * It is used for interacting with the loaded model.\n */\n protected readonly _strapi: Core.Strapi;\n\n /**\n * A unique identifier used to represent a model within Strapi.\n *\n * The type of the identifier is generic to allow flexibility and ensure type safety\n * when working with either content-types or components.\n */\n protected readonly _uid: T;\n\n /**\n * Protected constructor for initializing the class with the provided Strapi instance and unique identifier (UID).\n *\n * @param strapi The Strapi instance to be used.\n * @param uid The unique identifier for the instance.\n */\n public constructor(strapi: Core.Strapi, uid: T) {\n super();\n this._strapi = strapi;\n this._uid = uid;\n }\n\n /**\n * Retrieves an enum schema constructed from the keys of the scalar fields.\n *\n * @return A Zod enum containing the keys from the scalar fields.\n */\n public get scalarFieldsEnum() {\n return z.enum(Object.keys(this._scalarFields) as [string]);\n }\n\n /**\n * Retrieves an enum schema constructed from the keys of fields that can be populated (relations, components, files, etc.)\n *\n * @return A ZodEnum object containing the list of populatable field keys.\n */\n public get populatableFieldsEnum() {\n return z.enum(Object.keys(this._populatableFields) as [string]);\n }\n\n /**\n * Retrieves an array representation of the scalar fields.\n *\n * @return An array containing the scalar fields as defined by {@link scalarFieldsEnum}.\n */\n public get scalarFieldsArray() {\n return z.array(this.scalarFieldsEnum);\n }\n\n /**\n * Retrieves an array of populatable fields.\n *\n * @return A Zod array schema representing the available populatable fields as defined by {@link populatableFieldsEnum}.\n */\n public get populatableFieldsArray() {\n return z.array(this.populatableFieldsEnum);\n }\n\n /**\n * Retrieves the schema associated with the current model.\n *\n * The schema represents the structural definition of the model,\n * as retrieved from the Strapi model associated with the given UID.\n *\n * @return The schema of the model retrieved from Strapi.\n */\n protected get _schema() {\n return this._strapi.getModel(this._uid);\n }\n\n /**\n * Retrieves scalar fields from the object's schema attributes.\n *\n * Filters the schema attributes to include only those that are scalar and not private.\n *\n * @return An object composed of scalar fields from the schema attributes.\n */\n protected get _scalarFields() {\n const attributes = Object.entries(this._schema.attributes);\n\n const scalarEntries = attributes\n .filter(([, attribute]) => contentTypes.isScalarAttribute(attribute))\n .filter(([attributeName]) => !contentTypes.isPrivateAttribute(this._schema, attributeName));\n\n return Object.fromEntries(scalarEntries);\n }\n\n /**\n * Retrieves the populatable fields from the schema attributes.\n *\n * Filters the schema attributes to include only those that are populatable and not private.\n *\n * @return An object containing the populatable fields derived from the schema attributes.\n */\n protected get _populatableFields() {\n const attributes = Object.entries(this._schema.attributes);\n\n const populatableEntries = attributes\n .filter(([, attribute]) => !contentTypes.isScalarAttribute(attribute))\n .filter(([attributeName]) => !contentTypes.isPrivateAttribute(this._schema, attributeName));\n\n return Object.fromEntries(populatableEntries);\n }\n\n /**\n * Creates a Zod schema as a record with scalar fields as keys and the specified type as values.\n *\n * @param type - The Zod type to use for the record's values.\n * @return A Zod record schema with scalar fields as keys and the specified type as values.\n */\n public fieldRecord(type: z.ZodTypeAny) {\n return z.record(this.scalarFieldsEnum, type);\n }\n}\n"],"names":["AbstractCoreRouteValidator","AbstractRouteValidator","scalarFieldsEnum","z","enum","Object","keys","_scalarFields","populatableFieldsEnum","_populatableFields","scalarFieldsArray","array","populatableFieldsArray","_schema","_strapi","getModel","_uid","attributes","entries","scalarEntries","filter","attribute","contentTypes","isScalarAttribute","attributeName","isPrivateAttribute","fromEntries","populatableEntries","fieldRecord","type","record","strapi","uid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;;;;IAUO,MAAeA,0BAEZC,SAAAA,kCAAAA,CAAAA;AA2BR;;;;AAIC,MACD,IAAWC,gBAAmB,GAAA;QAC5B,OAAOC,YAAAA,CAAEC,IAAI,CAACC,MAAAA,CAAOC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAA,CAAA;AAC9C;AAEA;;;;AAIC,MACD,IAAWC,qBAAwB,GAAA;QACjC,OAAOL,YAAAA,CAAEC,IAAI,CAACC,MAAAA,CAAOC,IAAI,CAAC,IAAI,CAACG,kBAAkB,CAAA,CAAA;AACnD;AAEA;;;;AAIC,MACD,IAAWC,iBAAoB,GAAA;AAC7B,QAAA,OAAOP,YAAEQ,CAAAA,KAAK,CAAC,IAAI,CAACT,gBAAgB,CAAA;AACtC;AAEA;;;;AAIC,MACD,IAAWU,sBAAyB,GAAA;AAClC,QAAA,OAAOT,YAAEQ,CAAAA,KAAK,CAAC,IAAI,CAACH,qBAAqB,CAAA;AAC3C;AAEA;;;;;;;AAOC,MACD,IAAcK,OAAU,GAAA;QACtB,OAAO,IAAI,CAACC,OAAO,CAACC,QAAQ,CAAC,IAAI,CAACC,IAAI,CAAA;AACxC;AAEA;;;;;;AAMC,MACD,IAAcT,aAAgB,GAAA;QAC5B,MAAMU,UAAAA,GAAaZ,OAAOa,OAAO,CAAC,IAAI,CAACL,OAAO,CAACI,UAAU,CAAA;QAEzD,MAAME,aAAAA,GAAgBF,UACnBG,CAAAA,MAAM,CAAC,CAAC,GAAGC,SAAU,CAAA,GAAKC,wBAAaC,CAAAA,iBAAiB,CAACF,SAAAA,CAAAA,CAAAA,CACzDD,MAAM,CAAC,CAAC,CAACI,aAAAA,CAAc,GAAK,CAACF,wBAAaG,CAAAA,kBAAkB,CAAC,IAAI,CAACZ,OAAO,EAAEW,aAAAA,CAAAA,CAAAA;QAE9E,OAAOnB,MAAAA,CAAOqB,WAAW,CAACP,aAAAA,CAAAA;AAC5B;AAEA;;;;;;AAMC,MACD,IAAcV,kBAAqB,GAAA;QACjC,MAAMQ,UAAAA,GAAaZ,OAAOa,OAAO,CAAC,IAAI,CAACL,OAAO,CAACI,UAAU,CAAA;QAEzD,MAAMU,kBAAAA,GAAqBV,UACxBG,CAAAA,MAAM,CAAC,CAAC,GAAGC,SAAAA,CAAU,GAAK,CAACC,wBAAaC,CAAAA,iBAAiB,CAACF,SAAAA,CAAAA,CAAAA,CAC1DD,MAAM,CAAC,CAAC,CAACI,aAAAA,CAAc,GAAK,CAACF,wBAAaG,CAAAA,kBAAkB,CAAC,IAAI,CAACZ,OAAO,EAAEW,aAAAA,CAAAA,CAAAA;QAE9E,OAAOnB,MAAAA,CAAOqB,WAAW,CAACC,kBAAAA,CAAAA;AAC5B;AAEA;;;;;MAMOC,WAAYC,CAAAA,IAAkB,EAAE;AACrC,QAAA,OAAO1B,aAAE2B,MAAM,CAAC,IAAI,CAAC5B,gBAAgB,EAAE2B,IAAAA,CAAAA;AACzC;AAtGA;;;;;AAKC,MACD,WAAmBE,CAAAA,MAAmB,EAAEC,GAAM,CAAE;QAC9C,KAAK,EAAA;QACL,IAAI,CAAClB,OAAO,GAAGiB,MAAAA;QACf,IAAI,CAACf,IAAI,GAAGgB,GAAAA;AACd;AA6FF;;;;"}
@@ -0,0 +1,95 @@
1
+ import { AbstractRouteValidator, contentTypes } from '@strapi/utils';
2
+ import * as z from 'zod/v4';
3
+
4
+ /**
5
+ * AbstractCoreRouteValidator provides the foundation for validating and managing core routes within a Strapi context for a specific model.
6
+ *
7
+ * This abstract class extends the base AbstractRouteValidator from utils to add schema-aware validation
8
+ * logic for scalar and populatable fields defined in a model schema.
9
+ *
10
+ * It uses runtime information about Strapi models to derive and expose schema validations.
11
+ *
12
+ * @template {UID.Schema} T Representing the schema identifier to be validated.
13
+ */ class AbstractCoreRouteValidator extends AbstractRouteValidator {
14
+ /**
15
+ * Retrieves an enum schema constructed from the keys of the scalar fields.
16
+ *
17
+ * @return A Zod enum containing the keys from the scalar fields.
18
+ */ get scalarFieldsEnum() {
19
+ return z.enum(Object.keys(this._scalarFields));
20
+ }
21
+ /**
22
+ * Retrieves an enum schema constructed from the keys of fields that can be populated (relations, components, files, etc.)
23
+ *
24
+ * @return A ZodEnum object containing the list of populatable field keys.
25
+ */ get populatableFieldsEnum() {
26
+ return z.enum(Object.keys(this._populatableFields));
27
+ }
28
+ /**
29
+ * Retrieves an array representation of the scalar fields.
30
+ *
31
+ * @return An array containing the scalar fields as defined by {@link scalarFieldsEnum}.
32
+ */ get scalarFieldsArray() {
33
+ return z.array(this.scalarFieldsEnum);
34
+ }
35
+ /**
36
+ * Retrieves an array of populatable fields.
37
+ *
38
+ * @return A Zod array schema representing the available populatable fields as defined by {@link populatableFieldsEnum}.
39
+ */ get populatableFieldsArray() {
40
+ return z.array(this.populatableFieldsEnum);
41
+ }
42
+ /**
43
+ * Retrieves the schema associated with the current model.
44
+ *
45
+ * The schema represents the structural definition of the model,
46
+ * as retrieved from the Strapi model associated with the given UID.
47
+ *
48
+ * @return The schema of the model retrieved from Strapi.
49
+ */ get _schema() {
50
+ return this._strapi.getModel(this._uid);
51
+ }
52
+ /**
53
+ * Retrieves scalar fields from the object's schema attributes.
54
+ *
55
+ * Filters the schema attributes to include only those that are scalar and not private.
56
+ *
57
+ * @return An object composed of scalar fields from the schema attributes.
58
+ */ get _scalarFields() {
59
+ const attributes = Object.entries(this._schema.attributes);
60
+ const scalarEntries = attributes.filter(([, attribute])=>contentTypes.isScalarAttribute(attribute)).filter(([attributeName])=>!contentTypes.isPrivateAttribute(this._schema, attributeName));
61
+ return Object.fromEntries(scalarEntries);
62
+ }
63
+ /**
64
+ * Retrieves the populatable fields from the schema attributes.
65
+ *
66
+ * Filters the schema attributes to include only those that are populatable and not private.
67
+ *
68
+ * @return An object containing the populatable fields derived from the schema attributes.
69
+ */ get _populatableFields() {
70
+ const attributes = Object.entries(this._schema.attributes);
71
+ const populatableEntries = attributes.filter(([, attribute])=>!contentTypes.isScalarAttribute(attribute)).filter(([attributeName])=>!contentTypes.isPrivateAttribute(this._schema, attributeName));
72
+ return Object.fromEntries(populatableEntries);
73
+ }
74
+ /**
75
+ * Creates a Zod schema as a record with scalar fields as keys and the specified type as values.
76
+ *
77
+ * @param type - The Zod type to use for the record's values.
78
+ * @return A Zod record schema with scalar fields as keys and the specified type as values.
79
+ */ fieldRecord(type) {
80
+ return z.record(this.scalarFieldsEnum, type);
81
+ }
82
+ /**
83
+ * Protected constructor for initializing the class with the provided Strapi instance and unique identifier (UID).
84
+ *
85
+ * @param strapi The Strapi instance to be used.
86
+ * @param uid The unique identifier for the instance.
87
+ */ constructor(strapi, uid){
88
+ super();
89
+ this._strapi = strapi;
90
+ this._uid = uid;
91
+ }
92
+ }
93
+
94
+ export { AbstractCoreRouteValidator };
95
+ //# sourceMappingURL=common.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.mjs","sources":["../../../../src/core-api/routes/validation/common.ts"],"sourcesContent":["import type { Core, UID } from '@strapi/types';\n\nimport { contentTypes, AbstractRouteValidator } from '@strapi/utils';\nimport * as z from 'zod/v4';\n\n/**\n * AbstractCoreRouteValidator provides the foundation for validating and managing core routes within a Strapi context for a specific model.\n *\n * This abstract class extends the base AbstractRouteValidator from utils to add schema-aware validation\n * logic for scalar and populatable fields defined in a model schema.\n *\n * It uses runtime information about Strapi models to derive and expose schema validations.\n *\n * @template {UID.Schema} T Representing the schema identifier to be validated.\n */\nexport abstract class AbstractCoreRouteValidator<\n T extends UID.Schema,\n> extends AbstractRouteValidator {\n /**\n * The `_strapi` variable serves as a reference to the core Strapi instance.\n * It is used for interacting with the loaded model.\n */\n protected readonly _strapi: Core.Strapi;\n\n /**\n * A unique identifier used to represent a model within Strapi.\n *\n * The type of the identifier is generic to allow flexibility and ensure type safety\n * when working with either content-types or components.\n */\n protected readonly _uid: T;\n\n /**\n * Protected constructor for initializing the class with the provided Strapi instance and unique identifier (UID).\n *\n * @param strapi The Strapi instance to be used.\n * @param uid The unique identifier for the instance.\n */\n public constructor(strapi: Core.Strapi, uid: T) {\n super();\n this._strapi = strapi;\n this._uid = uid;\n }\n\n /**\n * Retrieves an enum schema constructed from the keys of the scalar fields.\n *\n * @return A Zod enum containing the keys from the scalar fields.\n */\n public get scalarFieldsEnum() {\n return z.enum(Object.keys(this._scalarFields) as [string]);\n }\n\n /**\n * Retrieves an enum schema constructed from the keys of fields that can be populated (relations, components, files, etc.)\n *\n * @return A ZodEnum object containing the list of populatable field keys.\n */\n public get populatableFieldsEnum() {\n return z.enum(Object.keys(this._populatableFields) as [string]);\n }\n\n /**\n * Retrieves an array representation of the scalar fields.\n *\n * @return An array containing the scalar fields as defined by {@link scalarFieldsEnum}.\n */\n public get scalarFieldsArray() {\n return z.array(this.scalarFieldsEnum);\n }\n\n /**\n * Retrieves an array of populatable fields.\n *\n * @return A Zod array schema representing the available populatable fields as defined by {@link populatableFieldsEnum}.\n */\n public get populatableFieldsArray() {\n return z.array(this.populatableFieldsEnum);\n }\n\n /**\n * Retrieves the schema associated with the current model.\n *\n * The schema represents the structural definition of the model,\n * as retrieved from the Strapi model associated with the given UID.\n *\n * @return The schema of the model retrieved from Strapi.\n */\n protected get _schema() {\n return this._strapi.getModel(this._uid);\n }\n\n /**\n * Retrieves scalar fields from the object's schema attributes.\n *\n * Filters the schema attributes to include only those that are scalar and not private.\n *\n * @return An object composed of scalar fields from the schema attributes.\n */\n protected get _scalarFields() {\n const attributes = Object.entries(this._schema.attributes);\n\n const scalarEntries = attributes\n .filter(([, attribute]) => contentTypes.isScalarAttribute(attribute))\n .filter(([attributeName]) => !contentTypes.isPrivateAttribute(this._schema, attributeName));\n\n return Object.fromEntries(scalarEntries);\n }\n\n /**\n * Retrieves the populatable fields from the schema attributes.\n *\n * Filters the schema attributes to include only those that are populatable and not private.\n *\n * @return An object containing the populatable fields derived from the schema attributes.\n */\n protected get _populatableFields() {\n const attributes = Object.entries(this._schema.attributes);\n\n const populatableEntries = attributes\n .filter(([, attribute]) => !contentTypes.isScalarAttribute(attribute))\n .filter(([attributeName]) => !contentTypes.isPrivateAttribute(this._schema, attributeName));\n\n return Object.fromEntries(populatableEntries);\n }\n\n /**\n * Creates a Zod schema as a record with scalar fields as keys and the specified type as values.\n *\n * @param type - The Zod type to use for the record's values.\n * @return A Zod record schema with scalar fields as keys and the specified type as values.\n */\n public fieldRecord(type: z.ZodTypeAny) {\n return z.record(this.scalarFieldsEnum, type);\n }\n}\n"],"names":["AbstractCoreRouteValidator","AbstractRouteValidator","scalarFieldsEnum","z","enum","Object","keys","_scalarFields","populatableFieldsEnum","_populatableFields","scalarFieldsArray","array","populatableFieldsArray","_schema","_strapi","getModel","_uid","attributes","entries","scalarEntries","filter","attribute","contentTypes","isScalarAttribute","attributeName","isPrivateAttribute","fromEntries","populatableEntries","fieldRecord","type","record","strapi","uid"],"mappings":";;;AAKA;;;;;;;;;IAUO,MAAeA,0BAEZC,SAAAA,sBAAAA,CAAAA;AA2BR;;;;AAIC,MACD,IAAWC,gBAAmB,GAAA;QAC5B,OAAOC,CAAAA,CAAEC,IAAI,CAACC,MAAAA,CAAOC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAA,CAAA;AAC9C;AAEA;;;;AAIC,MACD,IAAWC,qBAAwB,GAAA;QACjC,OAAOL,CAAAA,CAAEC,IAAI,CAACC,MAAAA,CAAOC,IAAI,CAAC,IAAI,CAACG,kBAAkB,CAAA,CAAA;AACnD;AAEA;;;;AAIC,MACD,IAAWC,iBAAoB,GAAA;AAC7B,QAAA,OAAOP,CAAEQ,CAAAA,KAAK,CAAC,IAAI,CAACT,gBAAgB,CAAA;AACtC;AAEA;;;;AAIC,MACD,IAAWU,sBAAyB,GAAA;AAClC,QAAA,OAAOT,CAAEQ,CAAAA,KAAK,CAAC,IAAI,CAACH,qBAAqB,CAAA;AAC3C;AAEA;;;;;;;AAOC,MACD,IAAcK,OAAU,GAAA;QACtB,OAAO,IAAI,CAACC,OAAO,CAACC,QAAQ,CAAC,IAAI,CAACC,IAAI,CAAA;AACxC;AAEA;;;;;;AAMC,MACD,IAAcT,aAAgB,GAAA;QAC5B,MAAMU,UAAAA,GAAaZ,OAAOa,OAAO,CAAC,IAAI,CAACL,OAAO,CAACI,UAAU,CAAA;QAEzD,MAAME,aAAAA,GAAgBF,UACnBG,CAAAA,MAAM,CAAC,CAAC,GAAGC,SAAU,CAAA,GAAKC,YAAaC,CAAAA,iBAAiB,CAACF,SAAAA,CAAAA,CAAAA,CACzDD,MAAM,CAAC,CAAC,CAACI,aAAAA,CAAc,GAAK,CAACF,YAAaG,CAAAA,kBAAkB,CAAC,IAAI,CAACZ,OAAO,EAAEW,aAAAA,CAAAA,CAAAA;QAE9E,OAAOnB,MAAAA,CAAOqB,WAAW,CAACP,aAAAA,CAAAA;AAC5B;AAEA;;;;;;AAMC,MACD,IAAcV,kBAAqB,GAAA;QACjC,MAAMQ,UAAAA,GAAaZ,OAAOa,OAAO,CAAC,IAAI,CAACL,OAAO,CAACI,UAAU,CAAA;QAEzD,MAAMU,kBAAAA,GAAqBV,UACxBG,CAAAA,MAAM,CAAC,CAAC,GAAGC,SAAAA,CAAU,GAAK,CAACC,YAAaC,CAAAA,iBAAiB,CAACF,SAAAA,CAAAA,CAAAA,CAC1DD,MAAM,CAAC,CAAC,CAACI,aAAAA,CAAc,GAAK,CAACF,YAAaG,CAAAA,kBAAkB,CAAC,IAAI,CAACZ,OAAO,EAAEW,aAAAA,CAAAA,CAAAA;QAE9E,OAAOnB,MAAAA,CAAOqB,WAAW,CAACC,kBAAAA,CAAAA;AAC5B;AAEA;;;;;MAMOC,WAAYC,CAAAA,IAAkB,EAAE;AACrC,QAAA,OAAO1B,EAAE2B,MAAM,CAAC,IAAI,CAAC5B,gBAAgB,EAAE2B,IAAAA,CAAAA;AACzC;AAtGA;;;;;AAKC,MACD,WAAmBE,CAAAA,MAAmB,EAAEC,GAAM,CAAE;QAC9C,KAAK,EAAA;QACL,IAAI,CAAClB,OAAO,GAAGiB,MAAAA;QACf,IAAI,CAACf,IAAI,GAAGgB,GAAAA;AACd;AA6FF;;;;"}
@@ -0,0 +1,34 @@
1
+ import type { UID } from '@strapi/types';
2
+ import { AbstractCoreRouteValidator } from './common';
3
+ /**
4
+ * A component validator for core content-type routes.
5
+ *
6
+ * Provides validation schemas and utilities for handling component-specific validation in content-type routes.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const strapi = // ... strapi instance
11
+ * const uid = 'api::article.article'
12
+ * const validator = new CoreComponentRouteValidator(strapi, uid);
13
+ *
14
+ * // Get validation schema for a component entry
15
+ * const componentSchema = validator.component;
16
+ * ```
17
+ */
18
+ export declare class CoreComponentRouteValidator extends AbstractCoreRouteValidator<UID.Component> {
19
+ /**
20
+ * Generates a comprehensive validation schema for a single component entry.
21
+ *
22
+ * Combines scalar fields and populatable fields into a single schema.
23
+ *
24
+ * @returns A schema for validating complete entries
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const validator = new CoreComponentRouteValidator(strapi, uid);
29
+ * const entrySchema = validator.entry;
30
+ * ```
31
+ */
32
+ get entry(): import("zod/v4").ZodObject<{}, import("zod/v4/core").$strip>;
33
+ }
34
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/core-api/routes/validation/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAEtD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,2BAA4B,SAAQ,0BAA0B,CAAC,GAAG,CAAC,SAAS,CAAC;IACxF;;;;;;;;;;;;OAYG;IACH,IAAI,KAAK,iEAMR;CACF"}
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ var mappers = require('./mappers.js');
4
+ var common = require('./common.js');
5
+
6
+ // eslint-disable-next-line import/no-cycle
7
+ /**
8
+ * A component validator for core content-type routes.
9
+ *
10
+ * Provides validation schemas and utilities for handling component-specific validation in content-type routes.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const strapi = // ... strapi instance
15
+ * const uid = 'api::article.article'
16
+ * const validator = new CoreComponentRouteValidator(strapi, uid);
17
+ *
18
+ * // Get validation schema for a component entry
19
+ * const componentSchema = validator.component;
20
+ * ```
21
+ */ class CoreComponentRouteValidator extends common.AbstractCoreRouteValidator {
22
+ /**
23
+ * Generates a comprehensive validation schema for a single component entry.
24
+ *
25
+ * Combines scalar fields and populatable fields into a single schema.
26
+ *
27
+ * @returns A schema for validating complete entries
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const validator = new CoreComponentRouteValidator(strapi, uid);
32
+ * const entrySchema = validator.entry;
33
+ * ```
34
+ */ get entry() {
35
+ const { _scalarFields, _populatableFields } = this;
36
+ const entries = Object.entries({
37
+ ..._scalarFields,
38
+ ..._populatableFields
39
+ });
40
+ return mappers.createAttributesSchema(entries);
41
+ }
42
+ }
43
+
44
+ exports.CoreComponentRouteValidator = CoreComponentRouteValidator;
45
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../../src/core-api/routes/validation/component.ts"],"sourcesContent":["import type { UID } from '@strapi/types';\n\n// eslint-disable-next-line import/no-cycle\nimport { createAttributesSchema } from './mappers';\nimport { AbstractCoreRouteValidator } from './common';\n\n/**\n * A component validator for core content-type routes.\n *\n * Provides validation schemas and utilities for handling component-specific validation in content-type routes.\n *\n * @example\n * ```ts\n * const strapi = // ... strapi instance\n * const uid = 'api::article.article'\n * const validator = new CoreComponentRouteValidator(strapi, uid);\n *\n * // Get validation schema for a component entry\n * const componentSchema = validator.component;\n * ```\n */\nexport class CoreComponentRouteValidator extends AbstractCoreRouteValidator<UID.Component> {\n /**\n * Generates a comprehensive validation schema for a single component entry.\n *\n * Combines scalar fields and populatable fields into a single schema.\n *\n * @returns A schema for validating complete entries\n *\n * @example\n * ```ts\n * const validator = new CoreComponentRouteValidator(strapi, uid);\n * const entrySchema = validator.entry;\n * ```\n */\n get entry() {\n const { _scalarFields, _populatableFields } = this;\n\n const entries = Object.entries({ ..._scalarFields, ..._populatableFields });\n\n return createAttributesSchema(entries);\n }\n}\n"],"names":["CoreComponentRouteValidator","AbstractCoreRouteValidator","entry","_scalarFields","_populatableFields","entries","Object","createAttributesSchema"],"mappings":";;;;;AAEA;AAIA;;;;;;;;;;;;;;IAeO,MAAMA,2BAAoCC,SAAAA,iCAAAA,CAAAA;AAC/C;;;;;;;;;;;;AAYC,MACD,IAAIC,KAAQ,GAAA;AACV,QAAA,MAAM,EAAEC,aAAa,EAAEC,kBAAkB,EAAE,GAAG,IAAI;QAElD,MAAMC,OAAAA,GAAUC,MAAOD,CAAAA,OAAO,CAAC;AAAE,YAAA,GAAGF,aAAa;AAAE,YAAA,GAAGC;AAAmB,SAAA,CAAA;AAEzE,QAAA,OAAOG,8BAAuBF,CAAAA,OAAAA,CAAAA;AAChC;AACF;;;;"}
@@ -0,0 +1,43 @@
1
+ import { createAttributesSchema } from './mappers.mjs';
2
+ import { AbstractCoreRouteValidator } from './common.mjs';
3
+
4
+ // eslint-disable-next-line import/no-cycle
5
+ /**
6
+ * A component validator for core content-type routes.
7
+ *
8
+ * Provides validation schemas and utilities for handling component-specific validation in content-type routes.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const strapi = // ... strapi instance
13
+ * const uid = 'api::article.article'
14
+ * const validator = new CoreComponentRouteValidator(strapi, uid);
15
+ *
16
+ * // Get validation schema for a component entry
17
+ * const componentSchema = validator.component;
18
+ * ```
19
+ */ class CoreComponentRouteValidator extends AbstractCoreRouteValidator {
20
+ /**
21
+ * Generates a comprehensive validation schema for a single component entry.
22
+ *
23
+ * Combines scalar fields and populatable fields into a single schema.
24
+ *
25
+ * @returns A schema for validating complete entries
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const validator = new CoreComponentRouteValidator(strapi, uid);
30
+ * const entrySchema = validator.entry;
31
+ * ```
32
+ */ get entry() {
33
+ const { _scalarFields, _populatableFields } = this;
34
+ const entries = Object.entries({
35
+ ..._scalarFields,
36
+ ..._populatableFields
37
+ });
38
+ return createAttributesSchema(entries);
39
+ }
40
+ }
41
+
42
+ export { CoreComponentRouteValidator };
43
+ //# sourceMappingURL=component.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.mjs","sources":["../../../../src/core-api/routes/validation/component.ts"],"sourcesContent":["import type { UID } from '@strapi/types';\n\n// eslint-disable-next-line import/no-cycle\nimport { createAttributesSchema } from './mappers';\nimport { AbstractCoreRouteValidator } from './common';\n\n/**\n * A component validator for core content-type routes.\n *\n * Provides validation schemas and utilities for handling component-specific validation in content-type routes.\n *\n * @example\n * ```ts\n * const strapi = // ... strapi instance\n * const uid = 'api::article.article'\n * const validator = new CoreComponentRouteValidator(strapi, uid);\n *\n * // Get validation schema for a component entry\n * const componentSchema = validator.component;\n * ```\n */\nexport class CoreComponentRouteValidator extends AbstractCoreRouteValidator<UID.Component> {\n /**\n * Generates a comprehensive validation schema for a single component entry.\n *\n * Combines scalar fields and populatable fields into a single schema.\n *\n * @returns A schema for validating complete entries\n *\n * @example\n * ```ts\n * const validator = new CoreComponentRouteValidator(strapi, uid);\n * const entrySchema = validator.entry;\n * ```\n */\n get entry() {\n const { _scalarFields, _populatableFields } = this;\n\n const entries = Object.entries({ ..._scalarFields, ..._populatableFields });\n\n return createAttributesSchema(entries);\n }\n}\n"],"names":["CoreComponentRouteValidator","AbstractCoreRouteValidator","entry","_scalarFields","_populatableFields","entries","Object","createAttributesSchema"],"mappings":";;;AAEA;AAIA;;;;;;;;;;;;;;IAeO,MAAMA,2BAAoCC,SAAAA,0BAAAA,CAAAA;AAC/C;;;;;;;;;;;;AAYC,MACD,IAAIC,KAAQ,GAAA;AACV,QAAA,MAAM,EAAEC,aAAa,EAAEC,kBAAkB,EAAE,GAAG,IAAI;QAElD,MAAMC,OAAAA,GAAUC,MAAOD,CAAAA,OAAO,CAAC;AAAE,YAAA,GAAGF,aAAa;AAAE,YAAA,GAAGC;AAAmB,SAAA,CAAA;AAEzE,QAAA,OAAOG,sBAAuBF,CAAAA,OAAAA,CAAAA;AAChC;AACF;;;;"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Defines the constant literal values for boolean representations.
3
+ *
4
+ * These values can be used to convert string representations of booleans (for example, 'true', 'false', '1', '0')
5
+ * into actual boolean types.
6
+ */
7
+ export declare const BOOLEAN_LITERAL_VALUES: readonly ["t", "1", "true", "f", "0", "false"];
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/core-api/routes/validation/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,sBAAsB,gDAAiD,CAAC"}
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Defines the constant literal values for boolean representations.
5
+ *
6
+ * These values can be used to convert string representations of booleans (for example, 'true', 'false', '1', '0')
7
+ * into actual boolean types.
8
+ */ const BOOLEAN_LITERAL_VALUES = [
9
+ 't',
10
+ '1',
11
+ 'true',
12
+ 'f',
13
+ '0',
14
+ 'false'
15
+ ];
16
+
17
+ exports.BOOLEAN_LITERAL_VALUES = BOOLEAN_LITERAL_VALUES;
18
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/core-api/routes/validation/constants.ts"],"sourcesContent":["/**\n * Defines the constant literal values for boolean representations.\n *\n * These values can be used to convert string representations of booleans (for example, 'true', 'false', '1', '0')\n * into actual boolean types.\n */\n\nexport const BOOLEAN_LITERAL_VALUES = ['t', '1', 'true', 'f', '0', 'false'] as const;\n"],"names":["BOOLEAN_LITERAL_VALUES"],"mappings":";;AAAA;;;;;UAOaA,sBAAyB,GAAA;AAAC,IAAA,GAAA;AAAK,IAAA,GAAA;AAAK,IAAA,MAAA;AAAQ,IAAA,GAAA;AAAK,IAAA,GAAA;AAAK,IAAA;;;;;"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Defines the constant literal values for boolean representations.
3
+ *
4
+ * These values can be used to convert string representations of booleans (for example, 'true', 'false', '1', '0')
5
+ * into actual boolean types.
6
+ */ const BOOLEAN_LITERAL_VALUES = [
7
+ 't',
8
+ '1',
9
+ 'true',
10
+ 'f',
11
+ '0',
12
+ 'false'
13
+ ];
14
+
15
+ export { BOOLEAN_LITERAL_VALUES };
16
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","sources":["../../../../src/core-api/routes/validation/constants.ts"],"sourcesContent":["/**\n * Defines the constant literal values for boolean representations.\n *\n * These values can be used to convert string representations of booleans (for example, 'true', 'false', '1', '0')\n * into actual boolean types.\n */\n\nexport const BOOLEAN_LITERAL_VALUES = ['t', '1', 'true', 'f', '0', 'false'] as const;\n"],"names":["BOOLEAN_LITERAL_VALUES"],"mappings":"AAAA;;;;;UAOaA,sBAAyB,GAAA;AAAC,IAAA,GAAA;AAAK,IAAA,GAAA;AAAK,IAAA,MAAA;AAAQ,IAAA,GAAA;AAAK,IAAA,GAAA;AAAK,IAAA;;;;;"}