@strapi/core 5.22.0 → 5.23.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/core-api/routes/validation/utils.d.ts.map +1 -1
- package/dist/core-api/routes/validation/utils.js +22 -6
- package/dist/core-api/routes/validation/utils.js.map +1 -1
- package/dist/core-api/routes/validation/utils.mjs +22 -6
- package/dist/core-api/routes/validation/utils.mjs.map +1 -1
- package/dist/package.json.js +11 -11
- package/dist/package.json.mjs +11 -11
- package/package.json +11 -11
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/core-api/routes/validation/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/core-api/routes/validation/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,OAAQ,SAAS,GAAG,CAAC,MAAM,UAAU,EAAE,OAAO,SAyB/E,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,kBAAkB,OAAQ,SAAS,GAAG,CAAC,MAAM,YAAY,MAAM,EAAE,OAAO,kFA0DpF,CAAC"}
|
@@ -22,6 +22,7 @@ function _interopNamespaceDefault(e) {
|
|
22
22
|
|
23
23
|
var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
|
24
24
|
|
25
|
+
// Schema generation happens on-demand when schemas don't exist in the registry
|
25
26
|
/**
|
26
27
|
* Safely adds or updates a schema in Zod's global registry.
|
27
28
|
*
|
@@ -39,13 +40,13 @@ var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
|
|
39
40
|
try {
|
40
41
|
const { _idmap: idMap } = z__namespace.globalRegistry;
|
41
42
|
const transformedId = strapiUtils.transformUidToValidOpenApiName(id);
|
42
|
-
|
43
|
+
const isReplacing = idMap.has(transformedId);
|
44
|
+
if (isReplacing) {
|
43
45
|
// Remove existing schema to prevent conflicts
|
44
|
-
strapi.log.debug(`Removing existing schema ${transformedId} from registry`);
|
45
46
|
idMap.delete(transformedId);
|
46
47
|
}
|
47
48
|
// Register the new schema with the transformed ID
|
48
|
-
strapi.log.debug(
|
49
|
+
strapi.log.debug(`${isReplacing ? 'Replacing' : 'Registering'} schema ${transformedId} in global registry`);
|
49
50
|
z__namespace.globalRegistry.add(schema, {
|
50
51
|
id: transformedId
|
51
52
|
});
|
@@ -88,10 +89,20 @@ var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
|
|
88
89
|
// Return existing schema if already registered
|
89
90
|
const mapItem = idMap.get(transformedId);
|
90
91
|
if (mapItem) {
|
91
|
-
|
92
|
+
// Schema already exists, return it silently
|
92
93
|
return mapItem;
|
93
94
|
}
|
94
|
-
strapi.log.
|
95
|
+
strapi.log.debug(`Schema ${transformedId} not found in registry, generating new schema`);
|
96
|
+
// Determine if this is a built-in schema or user content
|
97
|
+
const isBuiltInSchema = id.startsWith('plugin::') || id.startsWith('admin');
|
98
|
+
if (isBuiltInSchema) {
|
99
|
+
// Built-in schemas keep at debug level to avoid clutter
|
100
|
+
strapi.log.debug(`Initializing validation schema for ${transformedId}`);
|
101
|
+
} else {
|
102
|
+
// User content
|
103
|
+
const schemaName = transformedId.replace('Document', '').replace('Entry', '').replace(/([A-Z])/g, ' $1').trim();
|
104
|
+
strapi.log.debug(`📝 Generating validation schema for "${schemaName}"`);
|
105
|
+
}
|
95
106
|
// Temporary any placeholder before replacing with the actual schema type
|
96
107
|
// Used to prevent infinite loops in cyclical data structures
|
97
108
|
safeGlobalRegistrySet(id, z__namespace.any());
|
@@ -99,7 +110,12 @@ var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
|
|
99
110
|
const schema = callback();
|
100
111
|
// Replace the placeholder with the real schema
|
101
112
|
safeGlobalRegistrySet(id, schema);
|
102
|
-
|
113
|
+
// Show completion for user content only
|
114
|
+
if (!isBuiltInSchema) {
|
115
|
+
const fieldCount = Object.keys(schema?._def?.shape || {}).length || 0;
|
116
|
+
const schemaName = transformedId.replace('Document', '').replace('Entry', '').replace(/([A-Z])/g, ' $1').trim();
|
117
|
+
strapi.log.debug(` ✅ "${schemaName}" schema created with ${fieldCount} fields`);
|
118
|
+
}
|
103
119
|
return schema;
|
104
120
|
} catch (error) {
|
105
121
|
strapi.log.error(`Schema creation failed: Failed to create schema ${id}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/core-api/routes/validation/utils.ts"],"sourcesContent":["import { transformUidToValidOpenApiName } from '@strapi/utils';\nimport type { Internal } from '@strapi/types';\nimport * as z from 'zod/v4';\n\n/**\n * Safely adds or updates a schema in Zod's global registry.\n *\n * If a schema with the given `id` already exists, it will be removed before adding the new one.\n *\n * This is useful for hot-reloading or preventing issues with cyclical dependencies.\n *\n * @param id - The unique identifier for the schema in the global registry.\n * @param schema - The Zod schema to register.\n * @example\n * ```typescript\n * safeGlobalRegistrySet(\"mySchema\", z.object({ name: z.string() }));\n * ```\n */\nexport const safeGlobalRegistrySet = (id: Internal.UID.Schema, schema: z.ZodType) => {\n try {\n const { _idmap: idMap } = z.globalRegistry;\n\n const transformedId = transformUidToValidOpenApiName(id);\n\n
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/core-api/routes/validation/utils.ts"],"sourcesContent":["import { transformUidToValidOpenApiName } from '@strapi/utils';\nimport type { Internal } from '@strapi/types';\nimport * as z from 'zod/v4';\n\n// Schema generation happens on-demand when schemas don't exist in the registry\n\n/**\n * Safely adds or updates a schema in Zod's global registry.\n *\n * If a schema with the given `id` already exists, it will be removed before adding the new one.\n *\n * This is useful for hot-reloading or preventing issues with cyclical dependencies.\n *\n * @param id - The unique identifier for the schema in the global registry.\n * @param schema - The Zod schema to register.\n * @example\n * ```typescript\n * safeGlobalRegistrySet(\"mySchema\", z.object({ name: z.string() }));\n * ```\n */\nexport const safeGlobalRegistrySet = (id: Internal.UID.Schema, schema: z.ZodType) => {\n try {\n const { _idmap: idMap } = z.globalRegistry;\n\n const transformedId = transformUidToValidOpenApiName(id);\n\n const isReplacing = idMap.has(transformedId);\n\n if (isReplacing) {\n // Remove existing schema to prevent conflicts\n idMap.delete(transformedId);\n }\n\n // Register the new schema with the transformed ID\n strapi.log.debug(\n `${isReplacing ? 'Replacing' : 'Registering'} schema ${transformedId} in global registry`\n );\n z.globalRegistry.add(schema, { id: transformedId });\n } catch (error) {\n strapi.log.error(\n `Schema registration failed: Failed to register schema ${id} in global registry`\n );\n\n throw error;\n }\n};\n\n/**\n * Safely creates and registers a Zod schema in the global registry, particularly useful for handling cyclical data structures.\n *\n * If a schema with the given `id` already exists in the global registry, it returns the existing schema.\n *\n * Otherwise, it registers a temporary `z.any()` schema, calls the provided `callback` to create the actual schema,\n * and then replaces the temporary schema with the actual one in the registry.\n *\n * This prevents infinite loops in cases of cyclical dependencies.\n *\n * @param id - The unique identifier for the schema in the global registry.\n * @param callback - A function that returns the Zod schema to be created and registered.\n * @returns The created or retrieved Zod schema.\n * @example\n * ```typescript\n * const CategorySchema = safeSchemaCreation(\"Category\", () =>\n * z.object({\n * name: z.string(),\n * products: z.array(safeSchemaCreation(\"Product\", () =>\n * z.object({\n * name: z.string(),\n * category: z.lazy(() => CategorySchema) // Cyclical reference\n * })\n * ))\n * })\n * );\n * ```\n */\nexport const safeSchemaCreation = (id: Internal.UID.Schema, callback: () => z.ZodType) => {\n try {\n const { _idmap: idMap } = z.globalRegistry;\n\n const transformedId = transformUidToValidOpenApiName(id);\n\n // Return existing schema if already registered\n const mapItem = idMap.get(transformedId);\n if (mapItem) {\n // Schema already exists, return it silently\n return mapItem;\n }\n\n strapi.log.debug(`Schema ${transformedId} not found in registry, generating new schema`);\n\n // Determine if this is a built-in schema or user content\n const isBuiltInSchema = id.startsWith('plugin::') || id.startsWith('admin');\n\n if (isBuiltInSchema) {\n // Built-in schemas keep at debug level to avoid clutter\n strapi.log.debug(`Initializing validation schema for ${transformedId}`);\n } else {\n // User content\n const schemaName = transformedId\n .replace('Document', '')\n .replace('Entry', '')\n .replace(/([A-Z])/g, ' $1')\n .trim();\n strapi.log.debug(`📝 Generating validation schema for \"${schemaName}\"`);\n }\n\n // Temporary any placeholder before replacing with the actual schema type\n // Used to prevent infinite loops in cyclical data structures\n safeGlobalRegistrySet(id, z.any());\n\n // Generate the actual schema using the callback\n const schema = callback();\n\n // Replace the placeholder with the real schema\n safeGlobalRegistrySet(id, schema);\n\n // Show completion for user content only\n if (!isBuiltInSchema) {\n const fieldCount = Object.keys((schema as any)?._def?.shape || {}).length || 0;\n const schemaName = transformedId\n .replace('Document', '')\n .replace('Entry', '')\n .replace(/([A-Z])/g, ' $1')\n .trim();\n strapi.log.debug(` ✅ \"${schemaName}\" schema created with ${fieldCount} fields`);\n }\n\n return schema;\n } catch (error) {\n strapi.log.error(`Schema creation failed: Failed to create schema ${id}`);\n\n throw error;\n }\n};\n"],"names":["safeGlobalRegistrySet","id","schema","_idmap","idMap","z","globalRegistry","transformedId","transformUidToValidOpenApiName","isReplacing","has","delete","strapi","log","debug","add","error","safeSchemaCreation","callback","mapItem","get","isBuiltInSchema","startsWith","schemaName","replace","trim","any","fieldCount","Object","keys","_def","shape","length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAEA;;;;;;;;;;;;;AAaC,IACM,MAAMA,qBAAwB,GAAA,CAACC,EAAyBC,EAAAA,MAAAA,GAAAA;IAC7D,IAAI;AACF,QAAA,MAAM,EAAEC,MAAQC,EAAAA,KAAK,EAAE,GAAGC,aAAEC,cAAc;AAE1C,QAAA,MAAMC,gBAAgBC,0CAA+BP,CAAAA,EAAAA,C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;;;"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { transformUidToValidOpenApiName } from '@strapi/utils';
|
2
2
|
import * as z from 'zod/v4';
|
3
3
|
|
4
|
+
// Schema generation happens on-demand when schemas don't exist in the registry
|
4
5
|
/**
|
5
6
|
* Safely adds or updates a schema in Zod's global registry.
|
6
7
|
*
|
@@ -18,13 +19,13 @@ import * as z from 'zod/v4';
|
|
18
19
|
try {
|
19
20
|
const { _idmap: idMap } = z.globalRegistry;
|
20
21
|
const transformedId = transformUidToValidOpenApiName(id);
|
21
|
-
|
22
|
+
const isReplacing = idMap.has(transformedId);
|
23
|
+
if (isReplacing) {
|
22
24
|
// Remove existing schema to prevent conflicts
|
23
|
-
strapi.log.debug(`Removing existing schema ${transformedId} from registry`);
|
24
25
|
idMap.delete(transformedId);
|
25
26
|
}
|
26
27
|
// Register the new schema with the transformed ID
|
27
|
-
strapi.log.debug(
|
28
|
+
strapi.log.debug(`${isReplacing ? 'Replacing' : 'Registering'} schema ${transformedId} in global registry`);
|
28
29
|
z.globalRegistry.add(schema, {
|
29
30
|
id: transformedId
|
30
31
|
});
|
@@ -67,10 +68,20 @@ import * as z from 'zod/v4';
|
|
67
68
|
// Return existing schema if already registered
|
68
69
|
const mapItem = idMap.get(transformedId);
|
69
70
|
if (mapItem) {
|
70
|
-
|
71
|
+
// Schema already exists, return it silently
|
71
72
|
return mapItem;
|
72
73
|
}
|
73
|
-
strapi.log.
|
74
|
+
strapi.log.debug(`Schema ${transformedId} not found in registry, generating new schema`);
|
75
|
+
// Determine if this is a built-in schema or user content
|
76
|
+
const isBuiltInSchema = id.startsWith('plugin::') || id.startsWith('admin');
|
77
|
+
if (isBuiltInSchema) {
|
78
|
+
// Built-in schemas keep at debug level to avoid clutter
|
79
|
+
strapi.log.debug(`Initializing validation schema for ${transformedId}`);
|
80
|
+
} else {
|
81
|
+
// User content
|
82
|
+
const schemaName = transformedId.replace('Document', '').replace('Entry', '').replace(/([A-Z])/g, ' $1').trim();
|
83
|
+
strapi.log.debug(`📝 Generating validation schema for "${schemaName}"`);
|
84
|
+
}
|
74
85
|
// Temporary any placeholder before replacing with the actual schema type
|
75
86
|
// Used to prevent infinite loops in cyclical data structures
|
76
87
|
safeGlobalRegistrySet(id, z.any());
|
@@ -78,7 +89,12 @@ import * as z from 'zod/v4';
|
|
78
89
|
const schema = callback();
|
79
90
|
// Replace the placeholder with the real schema
|
80
91
|
safeGlobalRegistrySet(id, schema);
|
81
|
-
|
92
|
+
// Show completion for user content only
|
93
|
+
if (!isBuiltInSchema) {
|
94
|
+
const fieldCount = Object.keys(schema?._def?.shape || {}).length || 0;
|
95
|
+
const schemaName = transformedId.replace('Document', '').replace('Entry', '').replace(/([A-Z])/g, ' $1').trim();
|
96
|
+
strapi.log.debug(` ✅ "${schemaName}" schema created with ${fieldCount} fields`);
|
97
|
+
}
|
82
98
|
return schema;
|
83
99
|
} catch (error) {
|
84
100
|
strapi.log.error(`Schema creation failed: Failed to create schema ${id}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../../../src/core-api/routes/validation/utils.ts"],"sourcesContent":["import { transformUidToValidOpenApiName } from '@strapi/utils';\nimport type { Internal } from '@strapi/types';\nimport * as z from 'zod/v4';\n\n/**\n * Safely adds or updates a schema in Zod's global registry.\n *\n * If a schema with the given `id` already exists, it will be removed before adding the new one.\n *\n * This is useful for hot-reloading or preventing issues with cyclical dependencies.\n *\n * @param id - The unique identifier for the schema in the global registry.\n * @param schema - The Zod schema to register.\n * @example\n * ```typescript\n * safeGlobalRegistrySet(\"mySchema\", z.object({ name: z.string() }));\n * ```\n */\nexport const safeGlobalRegistrySet = (id: Internal.UID.Schema, schema: z.ZodType) => {\n try {\n const { _idmap: idMap } = z.globalRegistry;\n\n const transformedId = transformUidToValidOpenApiName(id);\n\n
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../../src/core-api/routes/validation/utils.ts"],"sourcesContent":["import { transformUidToValidOpenApiName } from '@strapi/utils';\nimport type { Internal } from '@strapi/types';\nimport * as z from 'zod/v4';\n\n// Schema generation happens on-demand when schemas don't exist in the registry\n\n/**\n * Safely adds or updates a schema in Zod's global registry.\n *\n * If a schema with the given `id` already exists, it will be removed before adding the new one.\n *\n * This is useful for hot-reloading or preventing issues with cyclical dependencies.\n *\n * @param id - The unique identifier for the schema in the global registry.\n * @param schema - The Zod schema to register.\n * @example\n * ```typescript\n * safeGlobalRegistrySet(\"mySchema\", z.object({ name: z.string() }));\n * ```\n */\nexport const safeGlobalRegistrySet = (id: Internal.UID.Schema, schema: z.ZodType) => {\n try {\n const { _idmap: idMap } = z.globalRegistry;\n\n const transformedId = transformUidToValidOpenApiName(id);\n\n const isReplacing = idMap.has(transformedId);\n\n if (isReplacing) {\n // Remove existing schema to prevent conflicts\n idMap.delete(transformedId);\n }\n\n // Register the new schema with the transformed ID\n strapi.log.debug(\n `${isReplacing ? 'Replacing' : 'Registering'} schema ${transformedId} in global registry`\n );\n z.globalRegistry.add(schema, { id: transformedId });\n } catch (error) {\n strapi.log.error(\n `Schema registration failed: Failed to register schema ${id} in global registry`\n );\n\n throw error;\n }\n};\n\n/**\n * Safely creates and registers a Zod schema in the global registry, particularly useful for handling cyclical data structures.\n *\n * If a schema with the given `id` already exists in the global registry, it returns the existing schema.\n *\n * Otherwise, it registers a temporary `z.any()` schema, calls the provided `callback` to create the actual schema,\n * and then replaces the temporary schema with the actual one in the registry.\n *\n * This prevents infinite loops in cases of cyclical dependencies.\n *\n * @param id - The unique identifier for the schema in the global registry.\n * @param callback - A function that returns the Zod schema to be created and registered.\n * @returns The created or retrieved Zod schema.\n * @example\n * ```typescript\n * const CategorySchema = safeSchemaCreation(\"Category\", () =>\n * z.object({\n * name: z.string(),\n * products: z.array(safeSchemaCreation(\"Product\", () =>\n * z.object({\n * name: z.string(),\n * category: z.lazy(() => CategorySchema) // Cyclical reference\n * })\n * ))\n * })\n * );\n * ```\n */\nexport const safeSchemaCreation = (id: Internal.UID.Schema, callback: () => z.ZodType) => {\n try {\n const { _idmap: idMap } = z.globalRegistry;\n\n const transformedId = transformUidToValidOpenApiName(id);\n\n // Return existing schema if already registered\n const mapItem = idMap.get(transformedId);\n if (mapItem) {\n // Schema already exists, return it silently\n return mapItem;\n }\n\n strapi.log.debug(`Schema ${transformedId} not found in registry, generating new schema`);\n\n // Determine if this is a built-in schema or user content\n const isBuiltInSchema = id.startsWith('plugin::') || id.startsWith('admin');\n\n if (isBuiltInSchema) {\n // Built-in schemas keep at debug level to avoid clutter\n strapi.log.debug(`Initializing validation schema for ${transformedId}`);\n } else {\n // User content\n const schemaName = transformedId\n .replace('Document', '')\n .replace('Entry', '')\n .replace(/([A-Z])/g, ' $1')\n .trim();\n strapi.log.debug(`📝 Generating validation schema for \"${schemaName}\"`);\n }\n\n // Temporary any placeholder before replacing with the actual schema type\n // Used to prevent infinite loops in cyclical data structures\n safeGlobalRegistrySet(id, z.any());\n\n // Generate the actual schema using the callback\n const schema = callback();\n\n // Replace the placeholder with the real schema\n safeGlobalRegistrySet(id, schema);\n\n // Show completion for user content only\n if (!isBuiltInSchema) {\n const fieldCount = Object.keys((schema as any)?._def?.shape || {}).length || 0;\n const schemaName = transformedId\n .replace('Document', '')\n .replace('Entry', '')\n .replace(/([A-Z])/g, ' $1')\n .trim();\n strapi.log.debug(` ✅ \"${schemaName}\" schema created with ${fieldCount} fields`);\n }\n\n return schema;\n } catch (error) {\n strapi.log.error(`Schema creation failed: Failed to create schema ${id}`);\n\n throw error;\n }\n};\n"],"names":["safeGlobalRegistrySet","id","schema","_idmap","idMap","z","globalRegistry","transformedId","transformUidToValidOpenApiName","isReplacing","has","delete","strapi","log","debug","add","error","safeSchemaCreation","callback","mapItem","get","isBuiltInSchema","startsWith","schemaName","replace","trim","any","fieldCount","Object","keys","_def","shape","length"],"mappings":";;;AAIA;AAEA;;;;;;;;;;;;;AAaC,IACM,MAAMA,qBAAwB,GAAA,CAACC,EAAyBC,EAAAA,MAAAA,GAAAA;IAC7D,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Oc,KAAO,EAAA;QACdJ,MAAOC,CAAAA,GAAG,CAACG,KAAK,CAAC,CAAC,gDAAgD,EAAEf,GAAG,CAAC,CAAA;QAExE,MAAMe,KAAAA;AACR;AACF;;;;"}
|
package/dist/package.json.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
var name = "@strapi/core";
|
6
|
-
var version = "5.
|
6
|
+
var version = "5.23.0";
|
7
7
|
var description = "Core of Strapi";
|
8
8
|
var homepage = "https://strapi.io";
|
9
9
|
var bugs = {
|
@@ -59,14 +59,14 @@ var dependencies = {
|
|
59
59
|
"@koa/cors": "5.0.0",
|
60
60
|
"@koa/router": "12.0.2",
|
61
61
|
"@paralleldrive/cuid2": "2.2.2",
|
62
|
-
"@strapi/admin": "5.
|
63
|
-
"@strapi/database": "5.
|
64
|
-
"@strapi/generators": "5.
|
65
|
-
"@strapi/logger": "5.
|
66
|
-
"@strapi/permissions": "5.
|
67
|
-
"@strapi/types": "5.
|
68
|
-
"@strapi/typescript-utils": "5.
|
69
|
-
"@strapi/utils": "5.
|
62
|
+
"@strapi/admin": "5.23.0",
|
63
|
+
"@strapi/database": "5.23.0",
|
64
|
+
"@strapi/generators": "5.23.0",
|
65
|
+
"@strapi/logger": "5.23.0",
|
66
|
+
"@strapi/permissions": "5.23.0",
|
67
|
+
"@strapi/types": "5.23.0",
|
68
|
+
"@strapi/typescript-utils": "5.23.0",
|
69
|
+
"@strapi/utils": "5.23.0",
|
70
70
|
bcryptjs: "2.4.3",
|
71
71
|
boxen: "5.1.2",
|
72
72
|
chalk: "4.1.2",
|
@@ -132,9 +132,9 @@ var devDependencies = {
|
|
132
132
|
"@types/node": "18.19.24",
|
133
133
|
"@types/node-schedule": "2.1.7",
|
134
134
|
"@types/statuses": "2.0.1",
|
135
|
-
"eslint-config-custom": "5.
|
135
|
+
"eslint-config-custom": "5.23.0",
|
136
136
|
supertest: "6.3.3",
|
137
|
-
tsconfig: "5.
|
137
|
+
tsconfig: "5.23.0"
|
138
138
|
};
|
139
139
|
var engines = {
|
140
140
|
node: ">=18.0.0 <=22.x.x",
|
package/dist/package.json.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
var name = "@strapi/core";
|
2
|
-
var version = "5.
|
2
|
+
var version = "5.23.0";
|
3
3
|
var description = "Core of Strapi";
|
4
4
|
var homepage = "https://strapi.io";
|
5
5
|
var bugs = {
|
@@ -55,14 +55,14 @@ var dependencies = {
|
|
55
55
|
"@koa/cors": "5.0.0",
|
56
56
|
"@koa/router": "12.0.2",
|
57
57
|
"@paralleldrive/cuid2": "2.2.2",
|
58
|
-
"@strapi/admin": "5.
|
59
|
-
"@strapi/database": "5.
|
60
|
-
"@strapi/generators": "5.
|
61
|
-
"@strapi/logger": "5.
|
62
|
-
"@strapi/permissions": "5.
|
63
|
-
"@strapi/types": "5.
|
64
|
-
"@strapi/typescript-utils": "5.
|
65
|
-
"@strapi/utils": "5.
|
58
|
+
"@strapi/admin": "5.23.0",
|
59
|
+
"@strapi/database": "5.23.0",
|
60
|
+
"@strapi/generators": "5.23.0",
|
61
|
+
"@strapi/logger": "5.23.0",
|
62
|
+
"@strapi/permissions": "5.23.0",
|
63
|
+
"@strapi/types": "5.23.0",
|
64
|
+
"@strapi/typescript-utils": "5.23.0",
|
65
|
+
"@strapi/utils": "5.23.0",
|
66
66
|
bcryptjs: "2.4.3",
|
67
67
|
boxen: "5.1.2",
|
68
68
|
chalk: "4.1.2",
|
@@ -128,9 +128,9 @@ var devDependencies = {
|
|
128
128
|
"@types/node": "18.19.24",
|
129
129
|
"@types/node-schedule": "2.1.7",
|
130
130
|
"@types/statuses": "2.0.1",
|
131
|
-
"eslint-config-custom": "5.
|
131
|
+
"eslint-config-custom": "5.23.0",
|
132
132
|
supertest: "6.3.3",
|
133
|
-
tsconfig: "5.
|
133
|
+
tsconfig: "5.23.0"
|
134
134
|
};
|
135
135
|
var engines = {
|
136
136
|
node: ">=18.0.0 <=22.x.x",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@strapi/core",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.23.0",
|
4
4
|
"description": "Core of Strapi",
|
5
5
|
"homepage": "https://strapi.io",
|
6
6
|
"bugs": {
|
@@ -56,14 +56,14 @@
|
|
56
56
|
"@koa/cors": "5.0.0",
|
57
57
|
"@koa/router": "12.0.2",
|
58
58
|
"@paralleldrive/cuid2": "2.2.2",
|
59
|
-
"@strapi/admin": "5.
|
60
|
-
"@strapi/database": "5.
|
61
|
-
"@strapi/generators": "5.
|
62
|
-
"@strapi/logger": "5.
|
63
|
-
"@strapi/permissions": "5.
|
64
|
-
"@strapi/types": "5.
|
65
|
-
"@strapi/typescript-utils": "5.
|
66
|
-
"@strapi/utils": "5.
|
59
|
+
"@strapi/admin": "5.23.0",
|
60
|
+
"@strapi/database": "5.23.0",
|
61
|
+
"@strapi/generators": "5.23.0",
|
62
|
+
"@strapi/logger": "5.23.0",
|
63
|
+
"@strapi/permissions": "5.23.0",
|
64
|
+
"@strapi/types": "5.23.0",
|
65
|
+
"@strapi/typescript-utils": "5.23.0",
|
66
|
+
"@strapi/utils": "5.23.0",
|
67
67
|
"bcryptjs": "2.4.3",
|
68
68
|
"boxen": "5.1.2",
|
69
69
|
"chalk": "4.1.2",
|
@@ -129,9 +129,9 @@
|
|
129
129
|
"@types/node": "18.19.24",
|
130
130
|
"@types/node-schedule": "2.1.7",
|
131
131
|
"@types/statuses": "2.0.1",
|
132
|
-
"eslint-config-custom": "5.
|
132
|
+
"eslint-config-custom": "5.23.0",
|
133
133
|
"supertest": "6.3.3",
|
134
|
-
"tsconfig": "5.
|
134
|
+
"tsconfig": "5.23.0"
|
135
135
|
},
|
136
136
|
"engines": {
|
137
137
|
"node": ">=18.0.0 <=22.x.x",
|