@strapi/openapi 5.37.0 → 5.38.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/assemblers/document/factory.js +4 -4
- package/dist/assemblers/document/factory.js.map +1 -1
- package/dist/assemblers/document/factory.mjs.map +1 -1
- package/dist/assemblers/document/info.js.map +1 -1
- package/dist/assemblers/document/info.mjs.map +1 -1
- package/dist/assemblers/document/metadata.js.map +1 -1
- package/dist/assemblers/document/metadata.mjs.map +1 -1
- package/dist/assemblers/document/path/factory.js +4 -4
- package/dist/assemblers/document/path/factory.js.map +1 -1
- package/dist/assemblers/document/path/factory.mjs.map +1 -1
- package/dist/assemblers/document/path/path-item/factory.js +4 -4
- package/dist/assemblers/document/path/path-item/factory.js.map +1 -1
- package/dist/assemblers/document/path/path-item/factory.mjs.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/body.js.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/body.mjs.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/factory.js.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/factory.mjs.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/operation-id.js.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/operation-id.mjs.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/operation.js.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/operation.mjs.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/parameters.js.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/parameters.mjs.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/responses.js.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/responses.mjs.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/tags.js.map +1 -1
- package/dist/assemblers/document/path/path-item/operation/tags.mjs.map +1 -1
- package/dist/assemblers/document/path/path-item/path-item.js.map +1 -1
- package/dist/assemblers/document/path/path-item/path-item.mjs.map +1 -1
- package/dist/assemblers/document/path/path.js.map +1 -1
- package/dist/assemblers/document/path/path.mjs.map +1 -1
- package/dist/context/factories/abstract.js.map +1 -1
- package/dist/context/factories/abstract.mjs.map +1 -1
- package/dist/context/factories/document.js.map +1 -1
- package/dist/context/factories/document.mjs.map +1 -1
- package/dist/context/factories/operation.js.map +1 -1
- package/dist/context/factories/operation.mjs.map +1 -1
- package/dist/context/factories/path-item.js.map +1 -1
- package/dist/context/factories/path-item.mjs.map +1 -1
- package/dist/context/factories/path.js.map +1 -1
- package/dist/context/factories/path.mjs.map +1 -1
- package/dist/exports.js +4 -4
- package/dist/exports.js.map +1 -1
- package/dist/exports.mjs.map +1 -1
- package/dist/generator/generator.js.map +1 -1
- package/dist/generator/generator.mjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/post-processor/component-writer.js.map +1 -1
- package/dist/post-processor/component-writer.mjs.map +1 -1
- package/dist/post-processor/factory.js.map +1 -1
- package/dist/post-processor/factory.mjs.map +1 -1
- package/dist/pre-processor/factory.js.map +1 -1
- package/dist/pre-processor/factory.mjs.map +1 -1
- package/dist/registries/factory.js.map +1 -1
- package/dist/registries/factory.mjs.map +1 -1
- package/dist/routes/collector.js.map +1 -1
- package/dist/routes/collector.mjs.map +1 -1
- package/dist/routes/matcher.js.map +1 -1
- package/dist/routes/matcher.mjs.map +1 -1
- package/dist/routes/providers/abstract.js.map +1 -1
- package/dist/routes/providers/abstract.mjs.map +1 -1
- package/dist/routes/providers/admin.js.map +1 -1
- package/dist/routes/providers/admin.mjs.map +1 -1
- package/dist/routes/providers/api.js.map +1 -1
- package/dist/routes/providers/api.mjs.map +1 -1
- package/dist/routes/providers/plugin.js.map +1 -1
- package/dist/routes/providers/plugin.mjs.map +1 -1
- package/dist/routes/rules/is-of-type.js.map +1 -1
- package/dist/routes/rules/is-of-type.mjs.map +1 -1
- package/dist/utils/debug.js.map +1 -1
- package/dist/utils/debug.mjs.map +1 -1
- package/dist/utils/timer/factory.js.map +1 -1
- package/dist/utils/timer/factory.mjs.map +1 -1
- package/dist/utils/timer/timer.js.map +1 -1
- package/dist/utils/timer/timer.mjs.map +1 -1
- package/dist/utils/zod.js.map +1 -1
- package/dist/utils/zod.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["../../../src/routes/providers/plugin.ts"],"sourcesContent":["import { type Core } from '@strapi/types';\nimport { createDebugger } from '../../utils';\n\nimport { AbstractRoutesProvider } from './abstract';\n\nconst debug = createDebugger('routes:provider:plugins');\n\n/**\n * Class providing routes from Strapi plugins.\n *\n * This class extracts and consolidates routes registered by Strapi plugins,\n * accommodating different ways plugins may define their routes.\n *\n * @extends {@link AbstractRoutesProvider}\n */\nexport class PluginRoutesProvider extends AbstractRoutesProvider {\n /**\n * Retrieves all routes registered in the Strapi plugins.\n *\n * It handles two cases:\n * - The plugin's routes are directly provided as a {@link Core.Route}[].\n * - The plugin's routes are defined as a record of routers which contain their own list of routes.\n *\n * @returns An array of {@link Core.Route} objects.\n */\n public get routes(): Core.Route[] {\n const { plugins } = this._strapi;\n\n const routes = Object.values(plugins).flatMap((plugin) => {\n const { routes } = plugin;\n\n return Array.isArray(routes)\n ? // If it is a simple Route[], return as is\n routes\n : // Else, extract and flatten every route from each router\n Object.values(routes).flatMap((router) => router.routes);\n });\n\n debug('found %o routes in Strapi plugins', routes.length);\n\n return routes;\n }\n}\n"],"names":["debug","createDebugger","PluginRoutesProvider","AbstractRoutesProvider","routes","plugins","_strapi","Object","values","flatMap","plugin","Array","isArray","router","length"],"mappings":";;;;;;;AAKA,MAAMA,QAAQC,
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["../../../src/routes/providers/plugin.ts"],"sourcesContent":["import { type Core } from '@strapi/types';\nimport { createDebugger } from '../../utils';\n\nimport { AbstractRoutesProvider } from './abstract';\n\nconst debug = createDebugger('routes:provider:plugins');\n\n/**\n * Class providing routes from Strapi plugins.\n *\n * This class extracts and consolidates routes registered by Strapi plugins,\n * accommodating different ways plugins may define their routes.\n *\n * @extends {@link AbstractRoutesProvider}\n */\nexport class PluginRoutesProvider extends AbstractRoutesProvider {\n /**\n * Retrieves all routes registered in the Strapi plugins.\n *\n * It handles two cases:\n * - The plugin's routes are directly provided as a {@link Core.Route}[].\n * - The plugin's routes are defined as a record of routers which contain their own list of routes.\n *\n * @returns An array of {@link Core.Route} objects.\n */\n public get routes(): Core.Route[] {\n const { plugins } = this._strapi;\n\n const routes = Object.values(plugins).flatMap((plugin) => {\n const { routes } = plugin;\n\n return Array.isArray(routes)\n ? // If it is a simple Route[], return as is\n routes\n : // Else, extract and flatten every route from each router\n Object.values(routes).flatMap((router) => router.routes);\n });\n\n debug('found %o routes in Strapi plugins', routes.length);\n\n return routes;\n }\n}\n"],"names":["debug","createDebugger","PluginRoutesProvider","AbstractRoutesProvider","routes","plugins","_strapi","Object","values","flatMap","plugin","Array","isArray","router","length"],"mappings":";;;;;;;AAKA,MAAMA,QAAQC,sBAAAA,CAAe,yBAAA,CAAA;AAE7B;;;;;;;IAQO,MAAMC,oBAAAA,SAA6BC,+BAAAA,CAAAA;AACxC;;;;;;;;AAQC,MACD,IAAWC,MAAAA,GAAuB;AAChC,QAAA,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI,CAACC,OAAO;AAEhC,QAAA,MAAMF,SAASG,MAAAA,CAAOC,MAAM,CAACH,OAAAA,CAAAA,CAASI,OAAO,CAAC,CAACC,MAAAA,GAAAA;YAC7C,MAAM,EAAEN,MAAM,EAAE,GAAGM,MAAAA;AAEnB,YAAA,OAAOC,KAAAA,CAAMC,OAAO,CAACR,MAAAA,CAAAA,GAEjBA,SAEAG,MAAAA,CAAOC,MAAM,CAACJ,MAAAA,CAAAA,CAAQK,OAAO,CAAC,CAACI,MAAAA,GAAWA,OAAOT,MAAM,CAAA;AAC7D,QAAA,CAAA,CAAA;QAEAJ,KAAAA,CAAM,mCAAA,EAAqCI,OAAOU,MAAM,CAAA;QAExD,OAAOV,MAAAA;AACT,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../src/routes/providers/plugin.ts"],"sourcesContent":["import { type Core } from '@strapi/types';\nimport { createDebugger } from '../../utils';\n\nimport { AbstractRoutesProvider } from './abstract';\n\nconst debug = createDebugger('routes:provider:plugins');\n\n/**\n * Class providing routes from Strapi plugins.\n *\n * This class extracts and consolidates routes registered by Strapi plugins,\n * accommodating different ways plugins may define their routes.\n *\n * @extends {@link AbstractRoutesProvider}\n */\nexport class PluginRoutesProvider extends AbstractRoutesProvider {\n /**\n * Retrieves all routes registered in the Strapi plugins.\n *\n * It handles two cases:\n * - The plugin's routes are directly provided as a {@link Core.Route}[].\n * - The plugin's routes are defined as a record of routers which contain their own list of routes.\n *\n * @returns An array of {@link Core.Route} objects.\n */\n public get routes(): Core.Route[] {\n const { plugins } = this._strapi;\n\n const routes = Object.values(plugins).flatMap((plugin) => {\n const { routes } = plugin;\n\n return Array.isArray(routes)\n ? // If it is a simple Route[], return as is\n routes\n : // Else, extract and flatten every route from each router\n Object.values(routes).flatMap((router) => router.routes);\n });\n\n debug('found %o routes in Strapi plugins', routes.length);\n\n return routes;\n }\n}\n"],"names":["debug","createDebugger","PluginRoutesProvider","AbstractRoutesProvider","routes","plugins","_strapi","Object","values","flatMap","plugin","Array","isArray","router","length"],"mappings":";;;;;AAKA,MAAMA,QAAQC,
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":["../../../src/routes/providers/plugin.ts"],"sourcesContent":["import { type Core } from '@strapi/types';\nimport { createDebugger } from '../../utils';\n\nimport { AbstractRoutesProvider } from './abstract';\n\nconst debug = createDebugger('routes:provider:plugins');\n\n/**\n * Class providing routes from Strapi plugins.\n *\n * This class extracts and consolidates routes registered by Strapi plugins,\n * accommodating different ways plugins may define their routes.\n *\n * @extends {@link AbstractRoutesProvider}\n */\nexport class PluginRoutesProvider extends AbstractRoutesProvider {\n /**\n * Retrieves all routes registered in the Strapi plugins.\n *\n * It handles two cases:\n * - The plugin's routes are directly provided as a {@link Core.Route}[].\n * - The plugin's routes are defined as a record of routers which contain their own list of routes.\n *\n * @returns An array of {@link Core.Route} objects.\n */\n public get routes(): Core.Route[] {\n const { plugins } = this._strapi;\n\n const routes = Object.values(plugins).flatMap((plugin) => {\n const { routes } = plugin;\n\n return Array.isArray(routes)\n ? // If it is a simple Route[], return as is\n routes\n : // Else, extract and flatten every route from each router\n Object.values(routes).flatMap((router) => router.routes);\n });\n\n debug('found %o routes in Strapi plugins', routes.length);\n\n return routes;\n }\n}\n"],"names":["debug","createDebugger","PluginRoutesProvider","AbstractRoutesProvider","routes","plugins","_strapi","Object","values","flatMap","plugin","Array","isArray","router","length"],"mappings":";;;;;AAKA,MAAMA,QAAQC,cAAAA,CAAe,yBAAA,CAAA;AAE7B;;;;;;;IAQO,MAAMC,oBAAAA,SAA6BC,sBAAAA,CAAAA;AACxC;;;;;;;;AAQC,MACD,IAAWC,MAAAA,GAAuB;AAChC,QAAA,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI,CAACC,OAAO;AAEhC,QAAA,MAAMF,SAASG,MAAAA,CAAOC,MAAM,CAACH,OAAAA,CAAAA,CAASI,OAAO,CAAC,CAACC,MAAAA,GAAAA;YAC7C,MAAM,EAAEN,MAAM,EAAE,GAAGM,MAAAA;AAEnB,YAAA,OAAOC,KAAAA,CAAMC,OAAO,CAACR,MAAAA,CAAAA,GAEjBA,SAEAG,MAAAA,CAAOC,MAAM,CAACJ,MAAAA,CAAAA,CAAQK,OAAO,CAAC,CAACI,MAAAA,GAAWA,OAAOT,MAAM,CAAA;AAC7D,QAAA,CAAA,CAAA;QAEAJ,KAAAA,CAAM,mCAAA,EAAqCI,OAAOU,MAAM,CAAA;QAExD,OAAOV,MAAAA;AACT,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-of-type.js","sources":["../../../src/routes/rules/is-of-type.ts"],"sourcesContent":["import type { MatcherRule } from '../types';\n\nexport const isOfType = (type: string): MatcherRule => {\n return (route) => route.info.type === type;\n};\n"],"names":["isOfType","type","route","info"],"mappings":";;AAEO,MAAMA,WAAW,CAACC,IAAAA,GAAAA;AACvB,IAAA,OAAO,CAACC,
|
|
1
|
+
{"version":3,"file":"is-of-type.js","sources":["../../../src/routes/rules/is-of-type.ts"],"sourcesContent":["import type { MatcherRule } from '../types';\n\nexport const isOfType = (type: string): MatcherRule => {\n return (route) => route.info.type === type;\n};\n"],"names":["isOfType","type","route","info"],"mappings":";;AAEO,MAAMA,WAAW,CAACC,IAAAA,GAAAA;AACvB,IAAA,OAAO,CAACC,KAAAA,GAAUA,KAAAA,CAAMC,IAAI,CAACF,IAAI,KAAKA,IAAAA;AACxC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-of-type.mjs","sources":["../../../src/routes/rules/is-of-type.ts"],"sourcesContent":["import type { MatcherRule } from '../types';\n\nexport const isOfType = (type: string): MatcherRule => {\n return (route) => route.info.type === type;\n};\n"],"names":["isOfType","type","route","info"],"mappings":"AAEO,MAAMA,WAAW,CAACC,IAAAA,GAAAA;AACvB,IAAA,OAAO,CAACC,
|
|
1
|
+
{"version":3,"file":"is-of-type.mjs","sources":["../../../src/routes/rules/is-of-type.ts"],"sourcesContent":["import type { MatcherRule } from '../types';\n\nexport const isOfType = (type: string): MatcherRule => {\n return (route) => route.info.type === type;\n};\n"],"names":["isOfType","type","route","info"],"mappings":"AAEO,MAAMA,WAAW,CAACC,IAAAA,GAAAA;AACvB,IAAA,OAAO,CAACC,KAAAA,GAAUA,KAAAA,CAAMC,IAAI,CAACF,IAAI,KAAKA,IAAAA;AACxC;;;;"}
|
package/dist/utils/debug.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.js","sources":["../../src/utils/debug.ts"],"sourcesContent":["import createDebug from 'debug';\n\nimport { DEBUG_NAMESPACE } from '../constants';\n\nexport const createDebugger = (\n section: string | null = null,\n namespace: string = DEBUG_NAMESPACE\n) => {\n return section !== null ? createDebug(`${namespace}:${section}`) : createDebug(namespace);\n};\n"],"names":["createDebugger","section","namespace","DEBUG_NAMESPACE","createDebug"],"mappings":";;;;;MAIaA,
|
|
1
|
+
{"version":3,"file":"debug.js","sources":["../../src/utils/debug.ts"],"sourcesContent":["import createDebug from 'debug';\n\nimport { DEBUG_NAMESPACE } from '../constants';\n\nexport const createDebugger = (\n section: string | null = null,\n namespace: string = DEBUG_NAMESPACE\n) => {\n return section !== null ? createDebug(`${namespace}:${section}`) : createDebug(namespace);\n};\n"],"names":["createDebugger","section","namespace","DEBUG_NAMESPACE","createDebug"],"mappings":";;;;;MAIaA,cAAAA,GAAiB,CAC5BC,UAAyB,IAAI,EAC7BC,YAAoBC,yBAAe,GAAA;IAEnC,OAAOF,OAAAA,KAAY,OAAOG,WAAAA,CAAY,CAAA,EAAGF,UAAU,CAAC,EAAED,OAAAA,CAAAA,CAAS,CAAA,GAAIG,WAAAA,CAAYF,SAAAA,CAAAA;AACjF;;;;"}
|
package/dist/utils/debug.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.mjs","sources":["../../src/utils/debug.ts"],"sourcesContent":["import createDebug from 'debug';\n\nimport { DEBUG_NAMESPACE } from '../constants';\n\nexport const createDebugger = (\n section: string | null = null,\n namespace: string = DEBUG_NAMESPACE\n) => {\n return section !== null ? createDebug(`${namespace}:${section}`) : createDebug(namespace);\n};\n"],"names":["createDebugger","section","namespace","DEBUG_NAMESPACE","createDebug"],"mappings":";;;MAIaA,
|
|
1
|
+
{"version":3,"file":"debug.mjs","sources":["../../src/utils/debug.ts"],"sourcesContent":["import createDebug from 'debug';\n\nimport { DEBUG_NAMESPACE } from '../constants';\n\nexport const createDebugger = (\n section: string | null = null,\n namespace: string = DEBUG_NAMESPACE\n) => {\n return section !== null ? createDebug(`${namespace}:${section}`) : createDebug(namespace);\n};\n"],"names":["createDebugger","section","namespace","DEBUG_NAMESPACE","createDebug"],"mappings":";;;MAIaA,cAAAA,GAAiB,CAC5BC,UAAyB,IAAI,EAC7BC,YAAoBC,eAAe,GAAA;IAEnC,OAAOF,OAAAA,KAAY,OAAOG,WAAAA,CAAY,CAAA,EAAGF,UAAU,CAAC,EAAED,OAAAA,CAAAA,CAAS,CAAA,GAAIG,WAAAA,CAAYF,SAAAA,CAAAA;AACjF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sources":["../../../src/utils/timer/factory.ts"],"sourcesContent":["import { Timer } from './timer';\n\nexport class TimerFactory {\n create() {\n return new Timer();\n }\n}\n"],"names":["TimerFactory","create","Timer"],"mappings":";;;;AAEO,MAAMA,YAAAA,CAAAA;IACXC,
|
|
1
|
+
{"version":3,"file":"factory.js","sources":["../../../src/utils/timer/factory.ts"],"sourcesContent":["import { Timer } from './timer';\n\nexport class TimerFactory {\n create() {\n return new Timer();\n }\n}\n"],"names":["TimerFactory","create","Timer"],"mappings":";;;;AAEO,MAAMA,YAAAA,CAAAA;IACXC,MAAAA,GAAS;AACP,QAAA,OAAO,IAAIC,WAAAA,EAAAA;AACb,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.mjs","sources":["../../../src/utils/timer/factory.ts"],"sourcesContent":["import { Timer } from './timer';\n\nexport class TimerFactory {\n create() {\n return new Timer();\n }\n}\n"],"names":["TimerFactory","create","Timer"],"mappings":";;AAEO,MAAMA,YAAAA,CAAAA;IACXC,
|
|
1
|
+
{"version":3,"file":"factory.mjs","sources":["../../../src/utils/timer/factory.ts"],"sourcesContent":["import { Timer } from './timer';\n\nexport class TimerFactory {\n create() {\n return new Timer();\n }\n}\n"],"names":["TimerFactory","create","Timer"],"mappings":";;AAEO,MAAMA,YAAAA,CAAAA;IACXC,MAAAA,GAAS;AACP,QAAA,OAAO,IAAIC,KAAAA,EAAAA;AACb,IAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.js","sources":["../../../src/utils/timer/timer.ts"],"sourcesContent":["export class Timer {\n private _startTime: number | null;\n\n private _endTime: number | null;\n\n private _elapsedTime: number | null;\n\n constructor() {\n this._startTime = null;\n this._endTime = null;\n this._elapsedTime = null;\n }\n\n start(): number {\n if (this._startTime !== null) {\n throw new Error(\n 'Timer is already started. Use `reset()` to reset the timer before starting it again.'\n );\n }\n\n this._startTime = Date.now();\n\n this._endTime = null;\n this._elapsedTime = null;\n\n return this._startTime;\n }\n\n stop() {\n if (this._startTime === null) {\n throw new Error('Timer is not started. Use `start()` to start the timer before stopping it.');\n }\n\n this._endTime = Date.now();\n this._elapsedTime = this._endTime - this._startTime;\n\n return { startTime: this._startTime, endTime: this._endTime, elapsedTime: this._elapsedTime };\n }\n\n reset(): void {\n this._startTime = null;\n this._endTime = null;\n this._elapsedTime = null;\n }\n}\n"],"names":["Timer","start","_startTime","Error","Date","now","_endTime","_elapsedTime","stop","startTime","endTime","elapsedTime","reset"],"mappings":";;AAAO,MAAMA,KAAAA,CAAAA;IAaXC,
|
|
1
|
+
{"version":3,"file":"timer.js","sources":["../../../src/utils/timer/timer.ts"],"sourcesContent":["export class Timer {\n private _startTime: number | null;\n\n private _endTime: number | null;\n\n private _elapsedTime: number | null;\n\n constructor() {\n this._startTime = null;\n this._endTime = null;\n this._elapsedTime = null;\n }\n\n start(): number {\n if (this._startTime !== null) {\n throw new Error(\n 'Timer is already started. Use `reset()` to reset the timer before starting it again.'\n );\n }\n\n this._startTime = Date.now();\n\n this._endTime = null;\n this._elapsedTime = null;\n\n return this._startTime;\n }\n\n stop() {\n if (this._startTime === null) {\n throw new Error('Timer is not started. Use `start()` to start the timer before stopping it.');\n }\n\n this._endTime = Date.now();\n this._elapsedTime = this._endTime - this._startTime;\n\n return { startTime: this._startTime, endTime: this._endTime, elapsedTime: this._elapsedTime };\n }\n\n reset(): void {\n this._startTime = null;\n this._endTime = null;\n this._elapsedTime = null;\n }\n}\n"],"names":["Timer","start","_startTime","Error","Date","now","_endTime","_elapsedTime","stop","startTime","endTime","elapsedTime","reset"],"mappings":";;AAAO,MAAMA,KAAAA,CAAAA;IAaXC,KAAAA,GAAgB;AACd,QAAA,IAAI,IAAI,CAACC,UAAU,KAAK,IAAA,EAAM;AAC5B,YAAA,MAAM,IAAIC,KAAAA,CACR,sFAAA,CAAA;AAEJ,QAAA;AAEA,QAAA,IAAI,CAACD,UAAU,GAAGE,IAAAA,CAAKC,GAAG,EAAA;QAE1B,IAAI,CAACC,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;QAEpB,OAAO,IAAI,CAACL,UAAU;AACxB,IAAA;IAEAM,IAAAA,GAAO;AACL,QAAA,IAAI,IAAI,CAACN,UAAU,KAAK,IAAA,EAAM;AAC5B,YAAA,MAAM,IAAIC,KAAAA,CAAM,4EAAA,CAAA;AAClB,QAAA;AAEA,QAAA,IAAI,CAACG,QAAQ,GAAGF,IAAAA,CAAKC,GAAG,EAAA;QACxB,IAAI,CAACE,YAAY,GAAG,IAAI,CAACD,QAAQ,GAAG,IAAI,CAACJ,UAAU;QAEnD,OAAO;YAAEO,SAAAA,EAAW,IAAI,CAACP,UAAU;YAAEQ,OAAAA,EAAS,IAAI,CAACJ,QAAQ;YAAEK,WAAAA,EAAa,IAAI,CAACJ;AAAa,SAAA;AAC9F,IAAA;IAEAK,KAAAA,GAAc;QACZ,IAAI,CAACV,UAAU,GAAG,IAAA;QAClB,IAAI,CAACI,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;AACtB,IAAA;IApCA,WAAA,EAAc;QACZ,IAAI,CAACL,UAAU,GAAG,IAAA;QAClB,IAAI,CAACI,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;AACtB,IAAA;AAiCF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.mjs","sources":["../../../src/utils/timer/timer.ts"],"sourcesContent":["export class Timer {\n private _startTime: number | null;\n\n private _endTime: number | null;\n\n private _elapsedTime: number | null;\n\n constructor() {\n this._startTime = null;\n this._endTime = null;\n this._elapsedTime = null;\n }\n\n start(): number {\n if (this._startTime !== null) {\n throw new Error(\n 'Timer is already started. Use `reset()` to reset the timer before starting it again.'\n );\n }\n\n this._startTime = Date.now();\n\n this._endTime = null;\n this._elapsedTime = null;\n\n return this._startTime;\n }\n\n stop() {\n if (this._startTime === null) {\n throw new Error('Timer is not started. Use `start()` to start the timer before stopping it.');\n }\n\n this._endTime = Date.now();\n this._elapsedTime = this._endTime - this._startTime;\n\n return { startTime: this._startTime, endTime: this._endTime, elapsedTime: this._elapsedTime };\n }\n\n reset(): void {\n this._startTime = null;\n this._endTime = null;\n this._elapsedTime = null;\n }\n}\n"],"names":["Timer","start","_startTime","Error","Date","now","_endTime","_elapsedTime","stop","startTime","endTime","elapsedTime","reset"],"mappings":"AAAO,MAAMA,KAAAA,CAAAA;IAaXC,
|
|
1
|
+
{"version":3,"file":"timer.mjs","sources":["../../../src/utils/timer/timer.ts"],"sourcesContent":["export class Timer {\n private _startTime: number | null;\n\n private _endTime: number | null;\n\n private _elapsedTime: number | null;\n\n constructor() {\n this._startTime = null;\n this._endTime = null;\n this._elapsedTime = null;\n }\n\n start(): number {\n if (this._startTime !== null) {\n throw new Error(\n 'Timer is already started. Use `reset()` to reset the timer before starting it again.'\n );\n }\n\n this._startTime = Date.now();\n\n this._endTime = null;\n this._elapsedTime = null;\n\n return this._startTime;\n }\n\n stop() {\n if (this._startTime === null) {\n throw new Error('Timer is not started. Use `start()` to start the timer before stopping it.');\n }\n\n this._endTime = Date.now();\n this._elapsedTime = this._endTime - this._startTime;\n\n return { startTime: this._startTime, endTime: this._endTime, elapsedTime: this._elapsedTime };\n }\n\n reset(): void {\n this._startTime = null;\n this._endTime = null;\n this._elapsedTime = null;\n }\n}\n"],"names":["Timer","start","_startTime","Error","Date","now","_endTime","_elapsedTime","stop","startTime","endTime","elapsedTime","reset"],"mappings":"AAAO,MAAMA,KAAAA,CAAAA;IAaXC,KAAAA,GAAgB;AACd,QAAA,IAAI,IAAI,CAACC,UAAU,KAAK,IAAA,EAAM;AAC5B,YAAA,MAAM,IAAIC,KAAAA,CACR,sFAAA,CAAA;AAEJ,QAAA;AAEA,QAAA,IAAI,CAACD,UAAU,GAAGE,IAAAA,CAAKC,GAAG,EAAA;QAE1B,IAAI,CAACC,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;QAEpB,OAAO,IAAI,CAACL,UAAU;AACxB,IAAA;IAEAM,IAAAA,GAAO;AACL,QAAA,IAAI,IAAI,CAACN,UAAU,KAAK,IAAA,EAAM;AAC5B,YAAA,MAAM,IAAIC,KAAAA,CAAM,4EAAA,CAAA;AAClB,QAAA;AAEA,QAAA,IAAI,CAACG,QAAQ,GAAGF,IAAAA,CAAKC,GAAG,EAAA;QACxB,IAAI,CAACE,YAAY,GAAG,IAAI,CAACD,QAAQ,GAAG,IAAI,CAACJ,UAAU;QAEnD,OAAO;YAAEO,SAAAA,EAAW,IAAI,CAACP,UAAU;YAAEQ,OAAAA,EAAS,IAAI,CAACJ,QAAQ;YAAEK,WAAAA,EAAa,IAAI,CAACJ;AAAa,SAAA;AAC9F,IAAA;IAEAK,KAAAA,GAAc;QACZ,IAAI,CAACV,UAAU,GAAG,IAAA;QAClB,IAAI,CAACI,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;AACtB,IAAA;IApCA,WAAA,EAAc;QACZ,IAAI,CAACL,UAAU,GAAG,IAAA;QAClB,IAAI,CAACI,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;AACtB,IAAA;AAiCF;;;;"}
|
package/dist/utils/zod.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod.js","sources":["../../src/utils/zod.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport * as z from 'zod/v4';\n\nimport type { OpenAPIV3_1 } from 'openapi-types';\n\n/**\n * Converts a Zod schema to an OpenAPI Schema Object.\n *\n * @description\n * Takes a Zod schema and converts it into an OpenAPI Schema Object (v3.1).\n * It uses a local registry to handle the conversion process and generates the appropriate\n * OpenAPI components.\n *\n * @param zodSchema - The Zod schema to convert to OpenAPI format. Can be any valid Zod schema.\n *\n * @returns An OpenAPI Schema Object representing the input Zod schema structure.\n * If the conversion cannot be completed, returns undefined.\n *\n * @example\n * ```typescript\n * import * as z from 'zod/v4';\n *\n * // Create a Zod schema\n * const userSchema = z.object({\n * id: z.number(),\n * name: z.string(),\n * email: z.string().email()\n * });\n *\n * // Convert to OpenAPI schema\n * const openAPISchema = zodToOpenAPI(userSchema);\n * ```\n */\n\nexport const zodToOpenAPI = (\n zodSchema: z.ZodType\n): OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject => {\n try {\n const id = randomUUID();\n const registry = z.registry<{ id: string }>();\n\n // Add the schema to the local registry with a custom, unique ID\n registry.add(zodSchema, { id });\n\n // Copy the global registry definitions into the local registry to make sure references are resolved\n // This prevent \"__shared\" definitions from being created\n for (const [key, value] of z.globalRegistry._idmap) {\n registry.add(value, { id: key });\n }\n\n // Generate the schemas and only return the one we want, transform the URI path to be OpenAPI compliant\n const { schemas } = z.toJSONSchema(registry, { uri: toComponentsPath });\n\n // TODO: make sure it's compliant\n return schemas[id] as OpenAPIV3_1.SchemaObject;\n } catch (e) {\n throw new Error(\"Couldn't transform the zod schema into an OpenAPI schema\");\n }\n};\n\n/**\n * Generates a path string for referencing a component schema by its identifier.\n *\n * @param id - The identifier of the component schema.\n * @returns The constructed path string for the specified component schema.\n */\nexport const toComponentsPath = (id: string) => `#/components/schemas/${id}`;\n"],"names":["zodToOpenAPI","zodSchema","id","randomUUID","registry","z","add","key","value","globalRegistry","_idmap","schemas","toJSONSchema","uri","toComponentsPath","e","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"zod.js","sources":["../../src/utils/zod.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport * as z from 'zod/v4';\n\nimport type { OpenAPIV3_1 } from 'openapi-types';\n\n/**\n * Converts a Zod schema to an OpenAPI Schema Object.\n *\n * @description\n * Takes a Zod schema and converts it into an OpenAPI Schema Object (v3.1).\n * It uses a local registry to handle the conversion process and generates the appropriate\n * OpenAPI components.\n *\n * @param zodSchema - The Zod schema to convert to OpenAPI format. Can be any valid Zod schema.\n *\n * @returns An OpenAPI Schema Object representing the input Zod schema structure.\n * If the conversion cannot be completed, returns undefined.\n *\n * @example\n * ```typescript\n * import * as z from 'zod/v4';\n *\n * // Create a Zod schema\n * const userSchema = z.object({\n * id: z.number(),\n * name: z.string(),\n * email: z.string().email()\n * });\n *\n * // Convert to OpenAPI schema\n * const openAPISchema = zodToOpenAPI(userSchema);\n * ```\n */\n\nexport const zodToOpenAPI = (\n zodSchema: z.ZodType\n): OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject => {\n try {\n const id = randomUUID();\n const registry = z.registry<{ id: string }>();\n\n // Add the schema to the local registry with a custom, unique ID\n registry.add(zodSchema, { id });\n\n // Copy the global registry definitions into the local registry to make sure references are resolved\n // This prevent \"__shared\" definitions from being created\n for (const [key, value] of z.globalRegistry._idmap) {\n registry.add(value, { id: key });\n }\n\n // Generate the schemas and only return the one we want, transform the URI path to be OpenAPI compliant\n const { schemas } = z.toJSONSchema(registry, { uri: toComponentsPath });\n\n // TODO: make sure it's compliant\n return schemas[id] as OpenAPIV3_1.SchemaObject;\n } catch (e) {\n throw new Error(\"Couldn't transform the zod schema into an OpenAPI schema\");\n }\n};\n\n/**\n * Generates a path string for referencing a component schema by its identifier.\n *\n * @param id - The identifier of the component schema.\n * @returns The constructed path string for the specified component schema.\n */\nexport const toComponentsPath = (id: string) => `#/components/schemas/${id}`;\n"],"names":["zodToOpenAPI","zodSchema","id","randomUUID","registry","z","add","key","value","globalRegistry","_idmap","schemas","toJSONSchema","uri","toComponentsPath","e","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BO,MAAMA,YAAAA,GAAe,CAC1BC,SAAAA,GAAAA;IAEA,IAAI;AACF,QAAA,MAAMC,EAAAA,GAAKC,sBAAAA,EAAAA;QACX,MAAMC,QAAAA,GAAWC,aAAED,QAAQ,EAAA;;QAG3BA,QAAAA,CAASE,GAAG,CAACL,SAAAA,EAAW;AAAEC,YAAAA;AAAG,SAAA,CAAA;;;QAI7B,KAAK,MAAM,CAACK,GAAAA,EAAKC,KAAAA,CAAM,IAAIH,YAAAA,CAAEI,cAAc,CAACC,MAAM,CAAE;YAClDN,QAAAA,CAASE,GAAG,CAACE,KAAAA,EAAO;gBAAEN,EAAAA,EAAIK;AAAI,aAAA,CAAA;AAChC,QAAA;;AAGA,QAAA,MAAM,EAAEI,OAAO,EAAE,GAAGN,YAAAA,CAAEO,YAAY,CAACR,QAAAA,EAAU;YAAES,GAAAA,EAAKC;AAAiB,SAAA,CAAA;;QAGrE,OAAOH,OAAO,CAACT,EAAAA,CAAG;AACpB,IAAA,CAAA,CAAE,OAAOa,CAAAA,EAAG;AACV,QAAA,MAAM,IAAIC,KAAAA,CAAM,0DAAA,CAAA;AAClB,IAAA;AACF;AAEA;;;;;UAMaF,gBAAAA,GAAmB,CAACZ,KAAe,CAAC,qBAAqB,EAAEA,EAAAA,CAAAA;;;;;"}
|
package/dist/utils/zod.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod.mjs","sources":["../../src/utils/zod.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport * as z from 'zod/v4';\n\nimport type { OpenAPIV3_1 } from 'openapi-types';\n\n/**\n * Converts a Zod schema to an OpenAPI Schema Object.\n *\n * @description\n * Takes a Zod schema and converts it into an OpenAPI Schema Object (v3.1).\n * It uses a local registry to handle the conversion process and generates the appropriate\n * OpenAPI components.\n *\n * @param zodSchema - The Zod schema to convert to OpenAPI format. Can be any valid Zod schema.\n *\n * @returns An OpenAPI Schema Object representing the input Zod schema structure.\n * If the conversion cannot be completed, returns undefined.\n *\n * @example\n * ```typescript\n * import * as z from 'zod/v4';\n *\n * // Create a Zod schema\n * const userSchema = z.object({\n * id: z.number(),\n * name: z.string(),\n * email: z.string().email()\n * });\n *\n * // Convert to OpenAPI schema\n * const openAPISchema = zodToOpenAPI(userSchema);\n * ```\n */\n\nexport const zodToOpenAPI = (\n zodSchema: z.ZodType\n): OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject => {\n try {\n const id = randomUUID();\n const registry = z.registry<{ id: string }>();\n\n // Add the schema to the local registry with a custom, unique ID\n registry.add(zodSchema, { id });\n\n // Copy the global registry definitions into the local registry to make sure references are resolved\n // This prevent \"__shared\" definitions from being created\n for (const [key, value] of z.globalRegistry._idmap) {\n registry.add(value, { id: key });\n }\n\n // Generate the schemas and only return the one we want, transform the URI path to be OpenAPI compliant\n const { schemas } = z.toJSONSchema(registry, { uri: toComponentsPath });\n\n // TODO: make sure it's compliant\n return schemas[id] as OpenAPIV3_1.SchemaObject;\n } catch (e) {\n throw new Error(\"Couldn't transform the zod schema into an OpenAPI schema\");\n }\n};\n\n/**\n * Generates a path string for referencing a component schema by its identifier.\n *\n * @param id - The identifier of the component schema.\n * @returns The constructed path string for the specified component schema.\n */\nexport const toComponentsPath = (id: string) => `#/components/schemas/${id}`;\n"],"names":["zodToOpenAPI","zodSchema","id","randomUUID","registry","z","add","key","value","globalRegistry","_idmap","schemas","toJSONSchema","uri","toComponentsPath","e","Error"],"mappings":";;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"zod.mjs","sources":["../../src/utils/zod.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport * as z from 'zod/v4';\n\nimport type { OpenAPIV3_1 } from 'openapi-types';\n\n/**\n * Converts a Zod schema to an OpenAPI Schema Object.\n *\n * @description\n * Takes a Zod schema and converts it into an OpenAPI Schema Object (v3.1).\n * It uses a local registry to handle the conversion process and generates the appropriate\n * OpenAPI components.\n *\n * @param zodSchema - The Zod schema to convert to OpenAPI format. Can be any valid Zod schema.\n *\n * @returns An OpenAPI Schema Object representing the input Zod schema structure.\n * If the conversion cannot be completed, returns undefined.\n *\n * @example\n * ```typescript\n * import * as z from 'zod/v4';\n *\n * // Create a Zod schema\n * const userSchema = z.object({\n * id: z.number(),\n * name: z.string(),\n * email: z.string().email()\n * });\n *\n * // Convert to OpenAPI schema\n * const openAPISchema = zodToOpenAPI(userSchema);\n * ```\n */\n\nexport const zodToOpenAPI = (\n zodSchema: z.ZodType\n): OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject => {\n try {\n const id = randomUUID();\n const registry = z.registry<{ id: string }>();\n\n // Add the schema to the local registry with a custom, unique ID\n registry.add(zodSchema, { id });\n\n // Copy the global registry definitions into the local registry to make sure references are resolved\n // This prevent \"__shared\" definitions from being created\n for (const [key, value] of z.globalRegistry._idmap) {\n registry.add(value, { id: key });\n }\n\n // Generate the schemas and only return the one we want, transform the URI path to be OpenAPI compliant\n const { schemas } = z.toJSONSchema(registry, { uri: toComponentsPath });\n\n // TODO: make sure it's compliant\n return schemas[id] as OpenAPIV3_1.SchemaObject;\n } catch (e) {\n throw new Error(\"Couldn't transform the zod schema into an OpenAPI schema\");\n }\n};\n\n/**\n * Generates a path string for referencing a component schema by its identifier.\n *\n * @param id - The identifier of the component schema.\n * @returns The constructed path string for the specified component schema.\n */\nexport const toComponentsPath = (id: string) => `#/components/schemas/${id}`;\n"],"names":["zodToOpenAPI","zodSchema","id","randomUUID","registry","z","add","key","value","globalRegistry","_idmap","schemas","toJSONSchema","uri","toComponentsPath","e","Error"],"mappings":";;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BO,MAAMA,YAAAA,GAAe,CAC1BC,SAAAA,GAAAA;IAEA,IAAI;AACF,QAAA,MAAMC,EAAAA,GAAKC,UAAAA,EAAAA;QACX,MAAMC,QAAAA,GAAWC,EAAED,QAAQ,EAAA;;QAG3BA,QAAAA,CAASE,GAAG,CAACL,SAAAA,EAAW;AAAEC,YAAAA;AAAG,SAAA,CAAA;;;QAI7B,KAAK,MAAM,CAACK,GAAAA,EAAKC,KAAAA,CAAM,IAAIH,CAAAA,CAAEI,cAAc,CAACC,MAAM,CAAE;YAClDN,QAAAA,CAASE,GAAG,CAACE,KAAAA,EAAO;gBAAEN,EAAAA,EAAIK;AAAI,aAAA,CAAA;AAChC,QAAA;;AAGA,QAAA,MAAM,EAAEI,OAAO,EAAE,GAAGN,CAAAA,CAAEO,YAAY,CAACR,QAAAA,EAAU;YAAES,GAAAA,EAAKC;AAAiB,SAAA,CAAA;;QAGrE,OAAOH,OAAO,CAACT,EAAAA,CAAG;AACpB,IAAA,CAAA,CAAE,OAAOa,CAAAA,EAAG;AACV,QAAA,MAAM,IAAIC,KAAAA,CAAM,0DAAA,CAAA;AAClB,IAAA;AACF;AAEA;;;;;UAMaF,gBAAAA,GAAmB,CAACZ,KAAe,CAAC,qBAAqB,EAAEA,EAAAA,CAAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/openapi",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.38.0",
|
|
4
4
|
"description": "A tool set to help generate and validate API documentation for Strapi projects",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"zod": "3.25.67"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@strapi/types": "5.
|
|
64
|
+
"@strapi/types": "5.38.0",
|
|
65
65
|
"@types/debug": "^4"
|
|
66
66
|
}
|
|
67
67
|
}
|