@strapi/openapi 0.0.0-experimental.1e4c115f717b021ca11c139584d4519db28ba786
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/LICENSE +37 -0
- package/README.md +1 -0
- package/dist/assemblers/document/factory.d.ts +8 -0
- package/dist/assemblers/document/factory.d.ts.map +1 -0
- package/dist/assemblers/document/factory.js +38 -0
- package/dist/assemblers/document/factory.js.map +1 -0
- package/dist/assemblers/document/factory.mjs +36 -0
- package/dist/assemblers/document/factory.mjs.map +1 -0
- package/dist/assemblers/document/index.d.ts +5 -0
- package/dist/assemblers/document/index.d.ts.map +1 -0
- package/dist/assemblers/document/info.d.ts +8 -0
- package/dist/assemblers/document/info.d.ts.map +1 -0
- package/dist/assemblers/document/info.js +32 -0
- package/dist/assemblers/document/info.js.map +1 -0
- package/dist/assemblers/document/info.mjs +30 -0
- package/dist/assemblers/document/info.mjs.map +1 -0
- package/dist/assemblers/document/metadata.d.ts +6 -0
- package/dist/assemblers/document/metadata.d.ts.map +1 -0
- package/dist/assemblers/document/metadata.js +23 -0
- package/dist/assemblers/document/metadata.js.map +1 -0
- package/dist/assemblers/document/metadata.mjs +21 -0
- package/dist/assemblers/document/metadata.mjs.map +1 -0
- package/dist/assemblers/document/path/factory.d.ts +6 -0
- package/dist/assemblers/document/path/factory.d.ts.map +1 -0
- package/dist/assemblers/document/path/factory.js +27 -0
- package/dist/assemblers/document/path/factory.js.map +1 -0
- package/dist/assemblers/document/path/factory.mjs +25 -0
- package/dist/assemblers/document/path/factory.mjs.map +1 -0
- package/dist/assemblers/document/path/index.d.ts +4 -0
- package/dist/assemblers/document/path/index.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/factory.d.ts +6 -0
- package/dist/assemblers/document/path/path-item/factory.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/factory.js +26 -0
- package/dist/assemblers/document/path/path-item/factory.js.map +1 -0
- package/dist/assemblers/document/path/path-item/factory.mjs +24 -0
- package/dist/assemblers/document/path/path-item/factory.mjs.map +1 -0
- package/dist/assemblers/document/path/path-item/index.d.ts +4 -0
- package/dist/assemblers/document/path/path-item/index.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/body.d.ts +7 -0
- package/dist/assemblers/document/path/path-item/operation/body.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/body.js +27 -0
- package/dist/assemblers/document/path/path-item/operation/body.js.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/body.mjs +25 -0
- package/dist/assemblers/document/path/path-item/operation/body.mjs.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/factory.d.ts +10 -0
- package/dist/assemblers/document/path/path-item/operation/factory.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/factory.js +37 -0
- package/dist/assemblers/document/path/path-item/operation/factory.js.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/factory.mjs +35 -0
- package/dist/assemblers/document/path/path-item/operation/factory.mjs.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/index.d.ts +8 -0
- package/dist/assemblers/document/path/path-item/operation/index.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/operation-id.d.ts +10 -0
- package/dist/assemblers/document/path/path-item/operation/operation-id.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/operation-id.js +47 -0
- package/dist/assemblers/document/path/path-item/operation/operation-id.js.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/operation-id.mjs +45 -0
- package/dist/assemblers/document/path/path-item/operation/operation-id.mjs.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/operation.d.ts +13 -0
- package/dist/assemblers/document/path/path-item/operation/operation.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/operation.js +48 -0
- package/dist/assemblers/document/path/path-item/operation/operation.js.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/operation.mjs +46 -0
- package/dist/assemblers/document/path/path-item/operation/operation.mjs.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/parameters.d.ts +9 -0
- package/dist/assemblers/document/path/path-item/operation/parameters.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/parameters.js +67 -0
- package/dist/assemblers/document/path/path-item/operation/parameters.js.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/parameters.mjs +65 -0
- package/dist/assemblers/document/path/path-item/operation/parameters.mjs.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/responses.d.ts +8 -0
- package/dist/assemblers/document/path/path-item/operation/responses.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/responses.js +51 -0
- package/dist/assemblers/document/path/path-item/operation/responses.js.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/responses.mjs +49 -0
- package/dist/assemblers/document/path/path-item/operation/responses.mjs.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/tags.d.ts +7 -0
- package/dist/assemblers/document/path/path-item/operation/tags.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/tags.js +25 -0
- package/dist/assemblers/document/path/path-item/operation/tags.js.map +1 -0
- package/dist/assemblers/document/path/path-item/operation/tags.mjs +23 -0
- package/dist/assemblers/document/path/path-item/operation/tags.mjs.map +1 -0
- package/dist/assemblers/document/path/path-item/path-item.d.ts +13 -0
- package/dist/assemblers/document/path/path-item/path-item.d.ts.map +1 -0
- package/dist/assemblers/document/path/path-item/path-item.js +53 -0
- package/dist/assemblers/document/path/path-item/path-item.js.map +1 -0
- package/dist/assemblers/document/path/path-item/path-item.mjs +51 -0
- package/dist/assemblers/document/path/path-item/path-item.mjs.map +1 -0
- package/dist/assemblers/document/path/path.d.ts +10 -0
- package/dist/assemblers/document/path/path.d.ts.map +1 -0
- package/dist/assemblers/document/path/path.js +28 -0
- package/dist/assemblers/document/path/path.js.map +1 -0
- package/dist/assemblers/document/path/path.mjs +26 -0
- package/dist/assemblers/document/path/path.mjs.map +1 -0
- package/dist/assemblers/index.d.ts +3 -0
- package/dist/assemblers/index.d.ts.map +1 -0
- package/dist/assemblers/types.d.ts +18 -0
- package/dist/assemblers/types.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +5 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/context/factories/abstract.d.ts +11 -0
- package/dist/context/factories/abstract.d.ts.map +1 -0
- package/dist/context/factories/abstract.js +38 -0
- package/dist/context/factories/abstract.js.map +1 -0
- package/dist/context/factories/abstract.mjs +36 -0
- package/dist/context/factories/abstract.mjs.map +1 -0
- package/dist/context/factories/document.d.ts +11 -0
- package/dist/context/factories/document.d.ts.map +1 -0
- package/dist/context/factories/document.js +20 -0
- package/dist/context/factories/document.js.map +1 -0
- package/dist/context/factories/document.mjs +18 -0
- package/dist/context/factories/document.mjs.map +1 -0
- package/dist/context/factories/index.d.ts +6 -0
- package/dist/context/factories/index.d.ts.map +1 -0
- package/dist/context/factories/operation.d.ts +11 -0
- package/dist/context/factories/operation.d.ts.map +1 -0
- package/dist/context/factories/operation.js +20 -0
- package/dist/context/factories/operation.js.map +1 -0
- package/dist/context/factories/operation.mjs +18 -0
- package/dist/context/factories/operation.mjs.map +1 -0
- package/dist/context/factories/path-item.d.ts +10 -0
- package/dist/context/factories/path-item.d.ts.map +1 -0
- package/dist/context/factories/path-item.js +20 -0
- package/dist/context/factories/path-item.js.map +1 -0
- package/dist/context/factories/path-item.mjs +18 -0
- package/dist/context/factories/path-item.mjs.map +1 -0
- package/dist/context/factories/path.d.ts +10 -0
- package/dist/context/factories/path.d.ts.map +1 -0
- package/dist/context/factories/path.js +20 -0
- package/dist/context/factories/path.js.map +1 -0
- package/dist/context/factories/path.mjs +18 -0
- package/dist/context/factories/path.mjs.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/types.d.ts +28 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/exports.d.ts +9 -0
- package/dist/exports.d.ts.map +1 -0
- package/dist/exports.js +49 -0
- package/dist/exports.js.map +1 -0
- package/dist/exports.mjs +47 -0
- package/dist/exports.mjs.map +1 -0
- package/dist/generator/generator.d.ts +29 -0
- package/dist/generator/generator.d.ts.map +1 -0
- package/dist/generator/generator.js +85 -0
- package/dist/generator/generator.js.map +1 -0
- package/dist/generator/generator.mjs +83 -0
- package/dist/generator/generator.mjs.map +1 -0
- package/dist/generator/index.d.ts +3 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/types.d.ts +12 -0
- package/dist/generator/types.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/post-processor/component-writer.d.ts +6 -0
- package/dist/post-processor/component-writer.d.ts.map +1 -0
- package/dist/post-processor/component-writer.js +19 -0
- package/dist/post-processor/component-writer.js.map +1 -0
- package/dist/post-processor/component-writer.mjs +17 -0
- package/dist/post-processor/component-writer.mjs.map +1 -0
- package/dist/post-processor/factory.d.ts +5 -0
- package/dist/post-processor/factory.d.ts.map +1 -0
- package/dist/post-processor/factory.js +14 -0
- package/dist/post-processor/factory.js.map +1 -0
- package/dist/post-processor/factory.mjs +12 -0
- package/dist/post-processor/factory.mjs.map +1 -0
- package/dist/post-processor/index.d.ts +4 -0
- package/dist/post-processor/index.d.ts.map +1 -0
- package/dist/post-processor/types.d.ts +5 -0
- package/dist/post-processor/types.d.ts.map +1 -0
- package/dist/pre-processor/factory.d.ts +5 -0
- package/dist/pre-processor/factory.d.ts.map +1 -0
- package/dist/pre-processor/factory.js +10 -0
- package/dist/pre-processor/factory.js.map +1 -0
- package/dist/pre-processor/factory.mjs +8 -0
- package/dist/pre-processor/factory.mjs.map +1 -0
- package/dist/pre-processor/index.d.ts +3 -0
- package/dist/pre-processor/index.d.ts.map +1 -0
- package/dist/pre-processor/types.d.ts +5 -0
- package/dist/pre-processor/types.d.ts.map +1 -0
- package/dist/registries/factory.d.ts +4 -0
- package/dist/registries/factory.d.ts.map +1 -0
- package/dist/registries/factory.js +10 -0
- package/dist/registries/factory.js.map +1 -0
- package/dist/registries/factory.mjs +8 -0
- package/dist/registries/factory.mjs.map +1 -0
- package/dist/registries/index.d.ts +3 -0
- package/dist/registries/index.d.ts.map +1 -0
- package/dist/registries/types.d.ts +3 -0
- package/dist/registries/types.d.ts.map +1 -0
- package/dist/routes/collector.d.ts +29 -0
- package/dist/routes/collector.d.ts.map +1 -0
- package/dist/routes/collector.js +40 -0
- package/dist/routes/collector.js.map +1 -0
- package/dist/routes/collector.mjs +38 -0
- package/dist/routes/collector.mjs.map +1 -0
- package/dist/routes/index.d.ts +7 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/matcher.d.ts +25 -0
- package/dist/routes/matcher.d.ts.map +1 -0
- package/dist/routes/matcher.js +24 -0
- package/dist/routes/matcher.js.map +1 -0
- package/dist/routes/matcher.mjs +22 -0
- package/dist/routes/matcher.mjs.map +1 -0
- package/dist/routes/providers/abstract.d.ts +35 -0
- package/dist/routes/providers/abstract.d.ts.map +1 -0
- package/dist/routes/providers/abstract.js +29 -0
- package/dist/routes/providers/abstract.js.map +1 -0
- package/dist/routes/providers/abstract.mjs +27 -0
- package/dist/routes/providers/abstract.mjs.map +1 -0
- package/dist/routes/providers/admin.d.ts +6 -0
- package/dist/routes/providers/admin.d.ts.map +1 -0
- package/dist/routes/providers/admin.js +19 -0
- package/dist/routes/providers/admin.js.map +1 -0
- package/dist/routes/providers/admin.mjs +17 -0
- package/dist/routes/providers/admin.mjs.map +1 -0
- package/dist/routes/providers/api.d.ts +22 -0
- package/dist/routes/providers/api.d.ts.map +1 -0
- package/dist/routes/providers/api.js +35 -0
- package/dist/routes/providers/api.js.map +1 -0
- package/dist/routes/providers/api.mjs +33 -0
- package/dist/routes/providers/api.mjs.map +1 -0
- package/dist/routes/providers/index.d.ts +6 -0
- package/dist/routes/providers/index.d.ts.map +1 -0
- package/dist/routes/providers/plugin.d.ts +23 -0
- package/dist/routes/providers/plugin.d.ts.map +1 -0
- package/dist/routes/providers/plugin.js +37 -0
- package/dist/routes/providers/plugin.js.map +1 -0
- package/dist/routes/providers/plugin.mjs +35 -0
- package/dist/routes/providers/plugin.mjs.map +1 -0
- package/dist/routes/providers/types.d.ts +13 -0
- package/dist/routes/providers/types.d.ts.map +1 -0
- package/dist/routes/rules/index.d.ts +2 -0
- package/dist/routes/rules/index.d.ts.map +1 -0
- package/dist/routes/rules/is-of-type.d.ts +3 -0
- package/dist/routes/rules/is-of-type.d.ts.map +1 -0
- package/dist/routes/rules/is-of-type.js +8 -0
- package/dist/routes/rules/is-of-type.js.map +1 -0
- package/dist/routes/rules/is-of-type.mjs +6 -0
- package/dist/routes/rules/is-of-type.mjs.map +1 -0
- package/dist/routes/types.d.ts +6 -0
- package/dist/routes/types.d.ts.map +1 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/debug.d.ts +3 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/debug.js +11 -0
- package/dist/utils/debug.js.map +1 -0
- package/dist/utils/debug.mjs +9 -0
- package/dist/utils/debug.mjs.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/timer/factory.d.ts +5 -0
- package/dist/utils/timer/factory.d.ts.map +1 -0
- package/dist/utils/timer/factory.js +12 -0
- package/dist/utils/timer/factory.js.map +1 -0
- package/dist/utils/timer/factory.mjs +10 -0
- package/dist/utils/timer/factory.mjs.map +1 -0
- package/dist/utils/timer/index.d.ts +3 -0
- package/dist/utils/timer/index.d.ts.map +1 -0
- package/dist/utils/timer/timer.d.ts +14 -0
- package/dist/utils/timer/timer.d.ts.map +1 -0
- package/dist/utils/timer/timer.js +38 -0
- package/dist/utils/timer/timer.js.map +1 -0
- package/dist/utils/timer/timer.mjs +36 -0
- package/dist/utils/timer/timer.mjs.map +1 -0
- package/dist/utils/zod.d.ts +39 -0
- package/dist/utils/zod.d.ts.map +1 -0
- package/dist/utils/zod.js +86 -0
- package/dist/utils/zod.js.map +1 -0
- package/dist/utils/zod.mjs +64 -0
- package/dist/utils/zod.mjs.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Abstract class representing a provider for routes.
|
|
5
|
+
*
|
|
6
|
+
* This class provides a base implementation for classes that manage and provide
|
|
7
|
+
* routes from Strapi.
|
|
8
|
+
*
|
|
9
|
+
* @implements {@link RoutesProvider}
|
|
10
|
+
*/ class AbstractRoutesProvider {
|
|
11
|
+
/**
|
|
12
|
+
* Iterator to traverse the routes.
|
|
13
|
+
*
|
|
14
|
+
* This generator function allows iterating over the {@link Core.Route} objects
|
|
15
|
+
* managed by this provider and yielding them one at a time.
|
|
16
|
+
*/ *[Symbol.iterator]() {
|
|
17
|
+
for (const route of this.routes){
|
|
18
|
+
yield route;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @param strapi - The Strapi instance used to retrieve and manage routes.
|
|
23
|
+
*/ constructor(strapi){
|
|
24
|
+
this._strapi = strapi;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.AbstractRoutesProvider = AbstractRoutesProvider;
|
|
29
|
+
//# sourceMappingURL=abstract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract.js","sources":["../../../src/routes/providers/abstract.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport type { RoutesProvider } from './types';\n\n/**\n * Abstract class representing a provider for routes.\n *\n * This class provides a base implementation for classes that manage and provide\n * routes from Strapi.\n *\n * @implements {@link RoutesProvider}\n */\nexport abstract class AbstractRoutesProvider implements RoutesProvider {\n /**\n * Reference to the Strapi instance.\n */\n protected readonly _strapi: Core.Strapi;\n\n /**\n * @param strapi - The Strapi instance used to retrieve and manage routes.\n */\n public constructor(strapi: Core.Strapi) {\n this._strapi = strapi;\n }\n\n /**\n * Retrieves an array of routes.\n *\n * Classes extending this abstract class must provide their own implementation\n * for returning the list of routes they manage.\n */\n public abstract get routes(): Core.Route[];\n\n /**\n * Iterator to traverse the routes.\n *\n * This generator function allows iterating over the {@link Core.Route} objects\n * managed by this provider and yielding them one at a time.\n */\n public *[Symbol.iterator](): Iterator<Core.Route> {\n for (const route of this.routes) {\n yield route;\n }\n }\n}\n"],"names":["AbstractRoutesProvider","Symbol","iterator","route","routes","strapi","_strapi"],"mappings":";;AAIA;;;;;;;AAOC,IACM,MAAeA,sBAAAA,CAAAA;AAqBpB;;;;;AAKC,MACD,EAASC,MAAOC,CAAAA,QAAQ,CAAC,GAAyB;AAChD,QAAA,KAAK,MAAMC,KAAAA,IAAS,IAAI,CAACC,MAAM,CAAE;YAC/B,MAAMD,KAAAA;AACR;AACF;AAzBA;;MAGA,WAAA,CAAmBE,MAAmB,CAAE;QACtC,IAAI,CAACC,OAAO,GAAGD,MAAAA;AACjB;AAqBF;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract class representing a provider for routes.
|
|
3
|
+
*
|
|
4
|
+
* This class provides a base implementation for classes that manage and provide
|
|
5
|
+
* routes from Strapi.
|
|
6
|
+
*
|
|
7
|
+
* @implements {@link RoutesProvider}
|
|
8
|
+
*/ class AbstractRoutesProvider {
|
|
9
|
+
/**
|
|
10
|
+
* Iterator to traverse the routes.
|
|
11
|
+
*
|
|
12
|
+
* This generator function allows iterating over the {@link Core.Route} objects
|
|
13
|
+
* managed by this provider and yielding them one at a time.
|
|
14
|
+
*/ *[Symbol.iterator]() {
|
|
15
|
+
for (const route of this.routes){
|
|
16
|
+
yield route;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @param strapi - The Strapi instance used to retrieve and manage routes.
|
|
21
|
+
*/ constructor(strapi){
|
|
22
|
+
this._strapi = strapi;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { AbstractRoutesProvider };
|
|
27
|
+
//# sourceMappingURL=abstract.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract.mjs","sources":["../../../src/routes/providers/abstract.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport type { RoutesProvider } from './types';\n\n/**\n * Abstract class representing a provider for routes.\n *\n * This class provides a base implementation for classes that manage and provide\n * routes from Strapi.\n *\n * @implements {@link RoutesProvider}\n */\nexport abstract class AbstractRoutesProvider implements RoutesProvider {\n /**\n * Reference to the Strapi instance.\n */\n protected readonly _strapi: Core.Strapi;\n\n /**\n * @param strapi - The Strapi instance used to retrieve and manage routes.\n */\n public constructor(strapi: Core.Strapi) {\n this._strapi = strapi;\n }\n\n /**\n * Retrieves an array of routes.\n *\n * Classes extending this abstract class must provide their own implementation\n * for returning the list of routes they manage.\n */\n public abstract get routes(): Core.Route[];\n\n /**\n * Iterator to traverse the routes.\n *\n * This generator function allows iterating over the {@link Core.Route} objects\n * managed by this provider and yielding them one at a time.\n */\n public *[Symbol.iterator](): Iterator<Core.Route> {\n for (const route of this.routes) {\n yield route;\n }\n }\n}\n"],"names":["AbstractRoutesProvider","Symbol","iterator","route","routes","strapi","_strapi"],"mappings":"AAIA;;;;;;;AAOC,IACM,MAAeA,sBAAAA,CAAAA;AAqBpB;;;;;AAKC,MACD,EAASC,MAAOC,CAAAA,QAAQ,CAAC,GAAyB;AAChD,QAAA,KAAK,MAAMC,KAAAA,IAAS,IAAI,CAACC,MAAM,CAAE;YAC/B,MAAMD,KAAAA;AACR;AACF;AAzBA;;MAGA,WAAA,CAAmBE,MAAmB,CAAE;QACtC,IAAI,CAACC,OAAO,GAAGD,MAAAA;AACjB;AAqBF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../src/routes/providers/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIpD,qBAAa,mBAAoB,SAAQ,sBAAsB;IAC7D,IAAW,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,CAQhC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var debug$1 = require('../../utils/debug.js');
|
|
4
|
+
require('node:crypto');
|
|
5
|
+
require('zod');
|
|
6
|
+
var abstract = require('./abstract.js');
|
|
7
|
+
|
|
8
|
+
const debug = debug$1.createDebugger('routes:provider:admin');
|
|
9
|
+
class AdminRoutesProvider extends abstract.AbstractRoutesProvider {
|
|
10
|
+
get routes() {
|
|
11
|
+
const { admin } = this._strapi;
|
|
12
|
+
const routes = Object.values(admin.routes).flatMap((router)=>router.routes);
|
|
13
|
+
debug('found %o routes in Strapi admin', routes.length);
|
|
14
|
+
return routes;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.AdminRoutesProvider = AdminRoutesProvider;
|
|
19
|
+
//# sourceMappingURL=admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.js","sources":["../../../src/routes/providers/admin.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport { createDebugger } from '../../utils';\nimport { AbstractRoutesProvider } from './abstract';\n\nconst debug = createDebugger('routes:provider:admin');\n\nexport class AdminRoutesProvider extends AbstractRoutesProvider {\n public get routes(): Core.Route[] {\n const { admin } = this._strapi;\n\n const routes = Object.values(admin.routes).flatMap((router) => router.routes);\n\n debug('found %o routes in Strapi admin', routes.length);\n\n return routes;\n }\n}\n"],"names":["debug","createDebugger","AdminRoutesProvider","AbstractRoutesProvider","routes","admin","_strapi","Object","values","flatMap","router","length"],"mappings":";;;;;;;AAKA,MAAMA,QAAQC,sBAAe,CAAA,uBAAA,CAAA;AAEtB,MAAMC,mBAA4BC,SAAAA,+BAAAA,CAAAA;AACvC,IAAA,IAAWC,MAAuB,GAAA;AAChC,QAAA,MAAM,EAAEC,KAAK,EAAE,GAAG,IAAI,CAACC,OAAO;AAE9B,QAAA,MAAMF,MAASG,GAAAA,MAAAA,CAAOC,MAAM,CAACH,KAAMD,CAAAA,MAAM,CAAEK,CAAAA,OAAO,CAAC,CAACC,MAAWA,GAAAA,MAAAA,CAAON,MAAM,CAAA;QAE5EJ,KAAM,CAAA,iCAAA,EAAmCI,OAAOO,MAAM,CAAA;QAEtD,OAAOP,MAAAA;AACT;AACF;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createDebugger } from '../../utils/debug.mjs';
|
|
2
|
+
import 'node:crypto';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import { AbstractRoutesProvider } from './abstract.mjs';
|
|
5
|
+
|
|
6
|
+
const debug = createDebugger('routes:provider:admin');
|
|
7
|
+
class AdminRoutesProvider extends AbstractRoutesProvider {
|
|
8
|
+
get routes() {
|
|
9
|
+
const { admin } = this._strapi;
|
|
10
|
+
const routes = Object.values(admin.routes).flatMap((router)=>router.routes);
|
|
11
|
+
debug('found %o routes in Strapi admin', routes.length);
|
|
12
|
+
return routes;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { AdminRoutesProvider };
|
|
17
|
+
//# sourceMappingURL=admin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.mjs","sources":["../../../src/routes/providers/admin.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport { createDebugger } from '../../utils';\nimport { AbstractRoutesProvider } from './abstract';\n\nconst debug = createDebugger('routes:provider:admin');\n\nexport class AdminRoutesProvider extends AbstractRoutesProvider {\n public get routes(): Core.Route[] {\n const { admin } = this._strapi;\n\n const routes = Object.values(admin.routes).flatMap((router) => router.routes);\n\n debug('found %o routes in Strapi admin', routes.length);\n\n return routes;\n }\n}\n"],"names":["debug","createDebugger","AdminRoutesProvider","AbstractRoutesProvider","routes","admin","_strapi","Object","values","flatMap","router","length"],"mappings":";;;;;AAKA,MAAMA,QAAQC,cAAe,CAAA,uBAAA,CAAA;AAEtB,MAAMC,mBAA4BC,SAAAA,sBAAAA,CAAAA;AACvC,IAAA,IAAWC,MAAuB,GAAA;AAChC,QAAA,MAAM,EAAEC,KAAK,EAAE,GAAG,IAAI,CAACC,OAAO;AAE9B,QAAA,MAAMF,MAASG,GAAAA,MAAAA,CAAOC,MAAM,CAACH,KAAMD,CAAAA,MAAM,CAAEK,CAAAA,OAAO,CAAC,CAACC,MAAWA,GAAAA,MAAAA,CAAON,MAAM,CAAA;QAE5EJ,KAAM,CAAA,iCAAA,EAAmCI,OAAOO,MAAM,CAAA;QAEtD,OAAOP,MAAAA;AACT;AACF;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
import { AbstractRoutesProvider } from './abstract';
|
|
3
|
+
/**
|
|
4
|
+
* Class representing a provider for API routes.
|
|
5
|
+
*
|
|
6
|
+
* This class retrieves and provides access to routes registered in the Strapi
|
|
7
|
+
* APIs.
|
|
8
|
+
*
|
|
9
|
+
* @extends {@link AbstractRoutesProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class ApiRoutesProvider extends AbstractRoutesProvider {
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves all routes registered in the Strapi APIs.
|
|
14
|
+
*
|
|
15
|
+
* It extracts routes from the Strapi APIs by flattening their
|
|
16
|
+
* structure and consolidating them into a single array of {@link Core.Route}.
|
|
17
|
+
*
|
|
18
|
+
* @returns An array of {@link Core.Route} objects
|
|
19
|
+
*/
|
|
20
|
+
get routes(): Core.Route[];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/routes/providers/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIpD;;;;;;;GAOG;AACH,qBAAa,iBAAkB,SAAQ,sBAAsB;IAC3D;;;;;;;OAOG;IACH,IAAW,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,CAYhC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var debug$1 = require('../../utils/debug.js');
|
|
4
|
+
require('node:crypto');
|
|
5
|
+
require('zod');
|
|
6
|
+
var abstract = require('./abstract.js');
|
|
7
|
+
|
|
8
|
+
const debug = debug$1.createDebugger('routes:provider:api');
|
|
9
|
+
/**
|
|
10
|
+
* Class representing a provider for API routes.
|
|
11
|
+
*
|
|
12
|
+
* This class retrieves and provides access to routes registered in the Strapi
|
|
13
|
+
* APIs.
|
|
14
|
+
*
|
|
15
|
+
* @extends {@link AbstractRoutesProvider}
|
|
16
|
+
*/ class ApiRoutesProvider extends abstract.AbstractRoutesProvider {
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves all routes registered in the Strapi APIs.
|
|
19
|
+
*
|
|
20
|
+
* It extracts routes from the Strapi APIs by flattening their
|
|
21
|
+
* structure and consolidating them into a single array of {@link Core.Route}.
|
|
22
|
+
*
|
|
23
|
+
* @returns An array of {@link Core.Route} objects
|
|
24
|
+
*/ get routes() {
|
|
25
|
+
const { apis } = this._strapi;
|
|
26
|
+
const routes = Object.values(apis)// Extract and flatten each router from every API
|
|
27
|
+
.flatMap((api)=>Object.values(api.routes))// Extract and flatten the routes from each router
|
|
28
|
+
.flatMap((router)=>router.routes);
|
|
29
|
+
debug('found %o routes in Strapi APIs', routes.length);
|
|
30
|
+
return routes;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.ApiRoutesProvider = ApiRoutesProvider;
|
|
35
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sources":["../../../src/routes/providers/api.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { createDebugger } from '../../utils';\n\nimport { AbstractRoutesProvider } from './abstract';\n\nconst debug = createDebugger('routes:provider:api');\n\n/**\n * Class representing a provider for API routes.\n *\n * This class retrieves and provides access to routes registered in the Strapi\n * APIs.\n *\n * @extends {@link AbstractRoutesProvider}\n */\nexport class ApiRoutesProvider extends AbstractRoutesProvider {\n /**\n * Retrieves all routes registered in the Strapi APIs.\n *\n * It extracts routes from the Strapi APIs by flattening their\n * structure and consolidating them into a single array of {@link Core.Route}.\n *\n * @returns An array of {@link Core.Route} objects\n */\n public get routes(): Core.Route[] {\n const { apis } = this._strapi;\n\n const routes = Object.values(apis)\n // Extract and flatten each router from every API\n .flatMap((api) => Object.values(api.routes))\n // Extract and flatten the routes from each router\n .flatMap((router) => router.routes);\n\n debug('found %o routes in Strapi APIs', routes.length);\n\n return routes;\n }\n}\n"],"names":["debug","createDebugger","ApiRoutesProvider","AbstractRoutesProvider","routes","apis","_strapi","Object","values","flatMap","api","router","length"],"mappings":";;;;;;;AAKA,MAAMA,QAAQC,sBAAe,CAAA,qBAAA,CAAA;AAE7B;;;;;;;IAQO,MAAMC,iBAA0BC,SAAAA,+BAAAA,CAAAA;AACrC;;;;;;;AAOC,MACD,IAAWC,MAAuB,GAAA;AAChC,QAAA,MAAM,EAAEC,IAAI,EAAE,GAAG,IAAI,CAACC,OAAO;AAE7B,QAAA,MAAMF,MAASG,GAAAA,MAAAA,CAAOC,MAAM,CAACH,KAC3B;SACCI,OAAO,CAAC,CAACC,GAAQH,GAAAA,MAAAA,CAAOC,MAAM,CAACE,GAAAA,CAAIN,MAAM,CAAA,CAC1C;AACCK,SAAAA,OAAO,CAAC,CAACE,MAAWA,GAAAA,MAAAA,CAAOP,MAAM,CAAA;QAEpCJ,KAAM,CAAA,gCAAA,EAAkCI,OAAOQ,MAAM,CAAA;QAErD,OAAOR,MAAAA;AACT;AACF;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createDebugger } from '../../utils/debug.mjs';
|
|
2
|
+
import 'node:crypto';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import { AbstractRoutesProvider } from './abstract.mjs';
|
|
5
|
+
|
|
6
|
+
const debug = createDebugger('routes:provider:api');
|
|
7
|
+
/**
|
|
8
|
+
* Class representing a provider for API routes.
|
|
9
|
+
*
|
|
10
|
+
* This class retrieves and provides access to routes registered in the Strapi
|
|
11
|
+
* APIs.
|
|
12
|
+
*
|
|
13
|
+
* @extends {@link AbstractRoutesProvider}
|
|
14
|
+
*/ class ApiRoutesProvider extends AbstractRoutesProvider {
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves all routes registered in the Strapi APIs.
|
|
17
|
+
*
|
|
18
|
+
* It extracts routes from the Strapi APIs by flattening their
|
|
19
|
+
* structure and consolidating them into a single array of {@link Core.Route}.
|
|
20
|
+
*
|
|
21
|
+
* @returns An array of {@link Core.Route} objects
|
|
22
|
+
*/ get routes() {
|
|
23
|
+
const { apis } = this._strapi;
|
|
24
|
+
const routes = Object.values(apis)// Extract and flatten each router from every API
|
|
25
|
+
.flatMap((api)=>Object.values(api.routes))// Extract and flatten the routes from each router
|
|
26
|
+
.flatMap((router)=>router.routes);
|
|
27
|
+
debug('found %o routes in Strapi APIs', routes.length);
|
|
28
|
+
return routes;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { ApiRoutesProvider };
|
|
33
|
+
//# sourceMappingURL=api.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.mjs","sources":["../../../src/routes/providers/api.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { createDebugger } from '../../utils';\n\nimport { AbstractRoutesProvider } from './abstract';\n\nconst debug = createDebugger('routes:provider:api');\n\n/**\n * Class representing a provider for API routes.\n *\n * This class retrieves and provides access to routes registered in the Strapi\n * APIs.\n *\n * @extends {@link AbstractRoutesProvider}\n */\nexport class ApiRoutesProvider extends AbstractRoutesProvider {\n /**\n * Retrieves all routes registered in the Strapi APIs.\n *\n * It extracts routes from the Strapi APIs by flattening their\n * structure and consolidating them into a single array of {@link Core.Route}.\n *\n * @returns An array of {@link Core.Route} objects\n */\n public get routes(): Core.Route[] {\n const { apis } = this._strapi;\n\n const routes = Object.values(apis)\n // Extract and flatten each router from every API\n .flatMap((api) => Object.values(api.routes))\n // Extract and flatten the routes from each router\n .flatMap((router) => router.routes);\n\n debug('found %o routes in Strapi APIs', routes.length);\n\n return routes;\n }\n}\n"],"names":["debug","createDebugger","ApiRoutesProvider","AbstractRoutesProvider","routes","apis","_strapi","Object","values","flatMap","api","router","length"],"mappings":";;;;;AAKA,MAAMA,QAAQC,cAAe,CAAA,qBAAA,CAAA;AAE7B;;;;;;;IAQO,MAAMC,iBAA0BC,SAAAA,sBAAAA,CAAAA;AACrC;;;;;;;AAOC,MACD,IAAWC,MAAuB,GAAA;AAChC,QAAA,MAAM,EAAEC,IAAI,EAAE,GAAG,IAAI,CAACC,OAAO;AAE7B,QAAA,MAAMF,MAASG,GAAAA,MAAAA,CAAOC,MAAM,CAACH,KAC3B;SACCI,OAAO,CAAC,CAACC,GAAQH,GAAAA,MAAAA,CAAOC,MAAM,CAACE,GAAAA,CAAIN,MAAM,CAAA,CAC1C;AACCK,SAAAA,OAAO,CAAC,CAACE,MAAWA,GAAAA,MAAAA,CAAOP,MAAM,CAAA;QAEpCJ,KAAM,CAAA,gCAAA,EAAkCI,OAAOQ,MAAM,CAAA;QAErD,OAAOR,MAAAA;AACT;AACF;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AbstractRoutesProvider } from './abstract';
|
|
2
|
+
export { AdminRoutesProvider } from './admin';
|
|
3
|
+
export { ApiRoutesProvider } from './api';
|
|
4
|
+
export { PluginRoutesProvider } from './plugin';
|
|
5
|
+
export type { RoutesProvider } from './types';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Core } from '@strapi/types';
|
|
2
|
+
import { AbstractRoutesProvider } from './abstract';
|
|
3
|
+
/**
|
|
4
|
+
* Class providing routes from Strapi plugins.
|
|
5
|
+
*
|
|
6
|
+
* This class extracts and consolidates routes registered by Strapi plugins,
|
|
7
|
+
* accommodating different ways plugins may define their routes.
|
|
8
|
+
*
|
|
9
|
+
* @extends {@link AbstractRoutesProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class PluginRoutesProvider extends AbstractRoutesProvider {
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves all routes registered in the Strapi plugins.
|
|
14
|
+
*
|
|
15
|
+
* It handles two cases:
|
|
16
|
+
* - The plugin's routes are directly provided as a {@link Core.Route}[].
|
|
17
|
+
* - The plugin's routes are defined as a record of routers which contain their own list of routes.
|
|
18
|
+
*
|
|
19
|
+
* @returns An array of {@link Core.Route} objects.
|
|
20
|
+
*/
|
|
21
|
+
get routes(): Core.Route[];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/routes/providers/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIpD;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,sBAAsB;IAC9D;;;;;;;;OAQG;IACH,IAAW,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,CAgBhC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var debug$1 = require('../../utils/debug.js');
|
|
4
|
+
require('node:crypto');
|
|
5
|
+
require('zod');
|
|
6
|
+
var abstract = require('./abstract.js');
|
|
7
|
+
|
|
8
|
+
const debug = debug$1.createDebugger('routes:provider:plugins');
|
|
9
|
+
/**
|
|
10
|
+
* Class providing routes from Strapi plugins.
|
|
11
|
+
*
|
|
12
|
+
* This class extracts and consolidates routes registered by Strapi plugins,
|
|
13
|
+
* accommodating different ways plugins may define their routes.
|
|
14
|
+
*
|
|
15
|
+
* @extends {@link AbstractRoutesProvider}
|
|
16
|
+
*/ class PluginRoutesProvider extends abstract.AbstractRoutesProvider {
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves all routes registered in the Strapi plugins.
|
|
19
|
+
*
|
|
20
|
+
* It handles two cases:
|
|
21
|
+
* - The plugin's routes are directly provided as a {@link Core.Route}[].
|
|
22
|
+
* - The plugin's routes are defined as a record of routers which contain their own list of routes.
|
|
23
|
+
*
|
|
24
|
+
* @returns An array of {@link Core.Route} objects.
|
|
25
|
+
*/ get routes() {
|
|
26
|
+
const { plugins } = this._strapi;
|
|
27
|
+
const routes = Object.values(plugins).flatMap((plugin)=>{
|
|
28
|
+
const { routes } = plugin;
|
|
29
|
+
return Array.isArray(routes) ? routes : Object.values(routes).flatMap((router)=>router.routes);
|
|
30
|
+
});
|
|
31
|
+
debug('found %o routes in Strapi plugins', routes.length);
|
|
32
|
+
return routes;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.PluginRoutesProvider = PluginRoutesProvider;
|
|
37
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +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,sBAAe,CAAA,yBAAA,CAAA;AAE7B;;;;;;;IAQO,MAAMC,oBAA6BC,SAAAA,+BAAAA,CAAAA;AACxC;;;;;;;;AAQC,MACD,IAAWC,MAAuB,GAAA;AAChC,QAAA,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI,CAACC,OAAO;AAEhC,QAAA,MAAMF,SAASG,MAAOC,CAAAA,MAAM,CAACH,OAASI,CAAAA,CAAAA,OAAO,CAAC,CAACC,MAAAA,GAAAA;YAC7C,MAAM,EAAEN,MAAM,EAAE,GAAGM,MAAAA;AAEnB,YAAA,OAAOC,KAAMC,CAAAA,OAAO,CAACR,MAAAA,CAAAA,GAEjBA,SAEAG,MAAOC,CAAAA,MAAM,CAACJ,MAAAA,CAAAA,CAAQK,OAAO,CAAC,CAACI,MAAAA,GAAWA,OAAOT,MAAM,CAAA;AAC7D,SAAA,CAAA;QAEAJ,KAAM,CAAA,mCAAA,EAAqCI,OAAOU,MAAM,CAAA;QAExD,OAAOV,MAAAA;AACT;AACF;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createDebugger } from '../../utils/debug.mjs';
|
|
2
|
+
import 'node:crypto';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import { AbstractRoutesProvider } from './abstract.mjs';
|
|
5
|
+
|
|
6
|
+
const debug = createDebugger('routes:provider:plugins');
|
|
7
|
+
/**
|
|
8
|
+
* Class providing routes from Strapi plugins.
|
|
9
|
+
*
|
|
10
|
+
* This class extracts and consolidates routes registered by Strapi plugins,
|
|
11
|
+
* accommodating different ways plugins may define their routes.
|
|
12
|
+
*
|
|
13
|
+
* @extends {@link AbstractRoutesProvider}
|
|
14
|
+
*/ class PluginRoutesProvider extends AbstractRoutesProvider {
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves all routes registered in the Strapi plugins.
|
|
17
|
+
*
|
|
18
|
+
* It handles two cases:
|
|
19
|
+
* - The plugin's routes are directly provided as a {@link Core.Route}[].
|
|
20
|
+
* - The plugin's routes are defined as a record of routers which contain their own list of routes.
|
|
21
|
+
*
|
|
22
|
+
* @returns An array of {@link Core.Route} objects.
|
|
23
|
+
*/ get routes() {
|
|
24
|
+
const { plugins } = this._strapi;
|
|
25
|
+
const routes = Object.values(plugins).flatMap((plugin)=>{
|
|
26
|
+
const { routes } = plugin;
|
|
27
|
+
return Array.isArray(routes) ? routes : Object.values(routes).flatMap((router)=>router.routes);
|
|
28
|
+
});
|
|
29
|
+
debug('found %o routes in Strapi plugins', routes.length);
|
|
30
|
+
return routes;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { PluginRoutesProvider };
|
|
35
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +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,cAAe,CAAA,yBAAA,CAAA;AAE7B;;;;;;;IAQO,MAAMC,oBAA6BC,SAAAA,sBAAAA,CAAAA;AACxC;;;;;;;;AAQC,MACD,IAAWC,MAAuB,GAAA;AAChC,QAAA,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI,CAACC,OAAO;AAEhC,QAAA,MAAMF,SAASG,MAAOC,CAAAA,MAAM,CAACH,OAASI,CAAAA,CAAAA,OAAO,CAAC,CAACC,MAAAA,GAAAA;YAC7C,MAAM,EAAEN,MAAM,EAAE,GAAGM,MAAAA;AAEnB,YAAA,OAAOC,KAAMC,CAAAA,OAAO,CAACR,MAAAA,CAAAA,GAEjBA,SAEAG,MAAOC,CAAAA,MAAM,CAACJ,MAAAA,CAAAA,CAAQK,OAAO,CAAC,CAACI,MAAAA,GAAWA,OAAOT,MAAM,CAAA;AAC7D,SAAA,CAAA;QAEAJ,KAAM,CAAA,mCAAA,EAAqCI,OAAOU,MAAM,CAAA;QAExD,OAAOV,MAAAA;AACT;AACF;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
/**
|
|
3
|
+
* Interface representing a provider for routes.
|
|
4
|
+
*
|
|
5
|
+
* It extends {@link Iterable} to allow iteration over {@link Core.Route} objects.
|
|
6
|
+
*/
|
|
7
|
+
export interface RoutesProvider extends Iterable<Core.Route> {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves an array of routes.
|
|
10
|
+
*/
|
|
11
|
+
get routes(): Core.Route[];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/routes/providers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;GAIG;AACH,MAAM,WAAW,cAAe,SAAQ,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC1D;;OAEG;IACH,IAAI,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-of-type.d.ts","sourceRoot":"","sources":["../../../src/routes/rules/is-of-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,WAEvC,CAAC"}
|
|
@@ -0,0 +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,KAAUA,GAAAA,KAAAA,CAAMC,IAAI,CAACF,IAAI,KAAKA,IAAAA;AACxC;;;;"}
|
|
@@ -0,0 +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,KAAUA,GAAAA,KAAAA,CAAMC,IAAI,CAACF,IAAI,KAAKA,IAAAA;AACxC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/routes/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { Context } from './context';
|
|
3
|
+
export type DocumentContextData = Partial<OpenAPIV3.Document>;
|
|
4
|
+
export type DocumentContext = Context<DocumentContextData>;
|
|
5
|
+
export type OperationContextData = Partial<OpenAPIV3.OperationObject>;
|
|
6
|
+
export type OperationContext = Context<OperationContextData>;
|
|
7
|
+
export type PathContextData = Partial<OpenAPIV3.PathsObject>;
|
|
8
|
+
export type PathContext = Context<PathContextData>;
|
|
9
|
+
export type PathItemContextData = Partial<OpenAPIV3.PathItemObject>;
|
|
10
|
+
export type PathItemContext = Context<PathItemContextData>;
|
|
11
|
+
export interface GenerationOptions {
|
|
12
|
+
type: 'admin' | 'content-api';
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AAC9D,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;AACtE,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,GAAG,aAAa,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,OAAO,CAAC;AAIhC,eAAO,MAAM,cAAc,aAChB,MAAM,GAAG,IAAI,cACX,MAAM,yBAGlB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createDebug = require('debug');
|
|
4
|
+
var constants = require('../constants.js');
|
|
5
|
+
|
|
6
|
+
const createDebugger = (section = null, namespace = constants.DEBUG_NAMESPACE)=>{
|
|
7
|
+
return section !== null ? createDebug(`${namespace}:${section}`) : createDebug(namespace);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
exports.createDebugger = createDebugger;
|
|
11
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +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,cAAiB,GAAA,CAC5BC,UAAyB,IAAI,EAC7BC,YAAoBC,yBAAe,GAAA;IAEnC,OAAOF,OAAAA,KAAY,IAAOG,GAAAA,WAAAA,CAAY,CAAC,EAAEF,SAAU,CAAA,CAAC,EAAED,OAAAA,CAAQ,CAAC,CAAA,GAAIG,WAAYF,CAAAA,SAAAA,CAAAA;AACjF;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import createDebug from 'debug';
|
|
2
|
+
import { DEBUG_NAMESPACE } from '../constants.mjs';
|
|
3
|
+
|
|
4
|
+
const createDebugger = (section = null, namespace = DEBUG_NAMESPACE)=>{
|
|
5
|
+
return section !== null ? createDebug(`${namespace}:${section}`) : createDebug(namespace);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { createDebugger };
|
|
9
|
+
//# sourceMappingURL=debug.mjs.map
|
|
@@ -0,0 +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,cAAiB,GAAA,CAC5BC,UAAyB,IAAI,EAC7BC,YAAoBC,eAAe,GAAA;IAEnC,OAAOF,OAAAA,KAAY,IAAOG,GAAAA,WAAAA,CAAY,CAAC,EAAEF,SAAU,CAAA,CAAC,EAAED,OAAAA,CAAQ,CAAC,CAAA,GAAIG,WAAYF,CAAAA,SAAAA,CAAAA;AACjF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/utils/timer/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,YAAY;IACvB,MAAM;CAGP"}
|
|
@@ -0,0 +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,MAAS,GAAA;AACP,QAAA,OAAO,IAAIC,WAAAA,EAAAA;AACb;AACF;;;;"}
|
|
@@ -0,0 +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,MAAS,GAAA;AACP,QAAA,OAAO,IAAIC,KAAAA,EAAAA;AACb;AACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/timer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class Timer {
|
|
2
|
+
private _startTime;
|
|
3
|
+
private _endTime;
|
|
4
|
+
private _elapsedTime;
|
|
5
|
+
constructor();
|
|
6
|
+
start(): number;
|
|
7
|
+
stop(): {
|
|
8
|
+
startTime: number;
|
|
9
|
+
endTime: number;
|
|
10
|
+
elapsedTime: number;
|
|
11
|
+
};
|
|
12
|
+
reset(): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=timer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../../src/utils/timer/timer.ts"],"names":[],"mappings":"AAAA,qBAAa,KAAK;IAChB,OAAO,CAAC,UAAU,CAAgB;IAElC,OAAO,CAAC,QAAQ,CAAgB;IAEhC,OAAO,CAAC,YAAY,CAAgB;;IAQpC,KAAK,IAAI,MAAM;IAef,IAAI;;;;;IAWJ,KAAK,IAAI,IAAI;CAKd"}
|