@strapi/openapi 0.0.0-experimental.6188a65af997a4a8b190bbf104a9ba27ebf583c8 → 0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +76 -0
  2. package/dist/assemblers/document/factory.js +4 -4
  3. package/dist/assemblers/document/factory.js.map +1 -1
  4. package/dist/assemblers/document/factory.mjs.map +1 -1
  5. package/dist/assemblers/document/info.js.map +1 -1
  6. package/dist/assemblers/document/info.mjs.map +1 -1
  7. package/dist/assemblers/document/metadata.js.map +1 -1
  8. package/dist/assemblers/document/metadata.mjs.map +1 -1
  9. package/dist/assemblers/document/path/factory.js +4 -4
  10. package/dist/assemblers/document/path/factory.js.map +1 -1
  11. package/dist/assemblers/document/path/factory.mjs.map +1 -1
  12. package/dist/assemblers/document/path/path-item/factory.js +4 -4
  13. package/dist/assemblers/document/path/path-item/factory.js.map +1 -1
  14. package/dist/assemblers/document/path/path-item/factory.mjs.map +1 -1
  15. package/dist/assemblers/document/path/path-item/operation/body.js.map +1 -1
  16. package/dist/assemblers/document/path/path-item/operation/body.mjs.map +1 -1
  17. package/dist/assemblers/document/path/path-item/operation/factory.js.map +1 -1
  18. package/dist/assemblers/document/path/path-item/operation/factory.mjs.map +1 -1
  19. package/dist/assemblers/document/path/path-item/operation/operation-id.js.map +1 -1
  20. package/dist/assemblers/document/path/path-item/operation/operation-id.mjs.map +1 -1
  21. package/dist/assemblers/document/path/path-item/operation/operation.js.map +1 -1
  22. package/dist/assemblers/document/path/path-item/operation/operation.mjs.map +1 -1
  23. package/dist/assemblers/document/path/path-item/operation/parameters.js.map +1 -1
  24. package/dist/assemblers/document/path/path-item/operation/parameters.mjs.map +1 -1
  25. package/dist/assemblers/document/path/path-item/operation/responses.js.map +1 -1
  26. package/dist/assemblers/document/path/path-item/operation/responses.mjs.map +1 -1
  27. package/dist/assemblers/document/path/path-item/operation/tags.js.map +1 -1
  28. package/dist/assemblers/document/path/path-item/operation/tags.mjs.map +1 -1
  29. package/dist/assemblers/document/path/path-item/path-item.js.map +1 -1
  30. package/dist/assemblers/document/path/path-item/path-item.mjs.map +1 -1
  31. package/dist/assemblers/document/path/path.js.map +1 -1
  32. package/dist/assemblers/document/path/path.mjs.map +1 -1
  33. package/dist/context/factories/abstract.js.map +1 -1
  34. package/dist/context/factories/abstract.mjs.map +1 -1
  35. package/dist/context/factories/document.js.map +1 -1
  36. package/dist/context/factories/document.mjs.map +1 -1
  37. package/dist/context/factories/operation.js.map +1 -1
  38. package/dist/context/factories/operation.mjs.map +1 -1
  39. package/dist/context/factories/path-item.js.map +1 -1
  40. package/dist/context/factories/path-item.mjs.map +1 -1
  41. package/dist/context/factories/path.js.map +1 -1
  42. package/dist/context/factories/path.mjs.map +1 -1
  43. package/dist/exports.d.ts.map +1 -1
  44. package/dist/exports.js +4 -4
  45. package/dist/exports.js.map +1 -1
  46. package/dist/exports.mjs.map +1 -1
  47. package/dist/generator/generator.js.map +1 -1
  48. package/dist/generator/generator.mjs.map +1 -1
  49. package/dist/post-processor/component-writer.js +3 -2
  50. package/dist/post-processor/component-writer.js.map +1 -1
  51. package/dist/post-processor/component-writer.mjs.map +1 -1
  52. package/dist/post-processor/factory.js.map +1 -1
  53. package/dist/post-processor/factory.mjs.map +1 -1
  54. package/dist/pre-processor/factory.js.map +1 -1
  55. package/dist/pre-processor/factory.mjs.map +1 -1
  56. package/dist/registries/factory.js.map +1 -1
  57. package/dist/registries/factory.mjs.map +1 -1
  58. package/dist/routes/collector.js.map +1 -1
  59. package/dist/routes/collector.mjs.map +1 -1
  60. package/dist/routes/matcher.js.map +1 -1
  61. package/dist/routes/matcher.mjs.map +1 -1
  62. package/dist/routes/providers/abstract.js.map +1 -1
  63. package/dist/routes/providers/abstract.mjs.map +1 -1
  64. package/dist/routes/providers/admin.js.map +1 -1
  65. package/dist/routes/providers/admin.mjs.map +1 -1
  66. package/dist/routes/providers/api.js.map +1 -1
  67. package/dist/routes/providers/api.mjs.map +1 -1
  68. package/dist/routes/providers/plugin.d.ts.map +1 -1
  69. package/dist/routes/providers/plugin.js +11 -1
  70. package/dist/routes/providers/plugin.js.map +1 -1
  71. package/dist/routes/providers/plugin.mjs +11 -1
  72. package/dist/routes/providers/plugin.mjs.map +1 -1
  73. package/dist/routes/rules/is-of-type.d.ts.map +1 -1
  74. package/dist/routes/rules/is-of-type.js.map +1 -1
  75. package/dist/routes/rules/is-of-type.mjs.map +1 -1
  76. package/dist/utils/debug.d.ts.map +1 -1
  77. package/dist/utils/debug.js +5 -1
  78. package/dist/utils/debug.js.map +1 -1
  79. package/dist/utils/debug.mjs.map +1 -1
  80. package/dist/utils/timer/factory.js.map +1 -1
  81. package/dist/utils/timer/factory.mjs.map +1 -1
  82. package/dist/utils/timer/timer.js.map +1 -1
  83. package/dist/utils/timer/timer.mjs.map +1 -1
  84. package/dist/utils/zod.d.ts.map +1 -1
  85. package/dist/utils/zod.js +3 -2
  86. package/dist/utils/zod.js.map +1 -1
  87. package/dist/utils/zod.mjs.map +1 -1
  88. package/package.json +5 -4
@@ -1 +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;;;;"}
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,MAAAA,CAAOC,QAAQ,CAAC,GAAyB;AAChD,QAAA,KAAK,MAAMC,KAAAA,IAAS,IAAI,CAACC,MAAM,CAAE;YAC/B,MAAMD,KAAAA;AACR,QAAA;AACF,IAAA;AAzBA;;MAGA,WAAA,CAAmBE,MAAmB,CAAE;QACtC,IAAI,CAACC,OAAO,GAAGD,MAAAA;AACjB,IAAA;AAqBF;;;;"}
@@ -1 +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;;;;"}
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,sBAAAA,CAAe,uBAAA,CAAA;AAEtB,MAAMC,mBAAAA,SAA4BC,+BAAAA,CAAAA;AACvC,IAAA,IAAWC,MAAAA,GAAuB;AAChC,QAAA,MAAM,EAAEC,KAAK,EAAE,GAAG,IAAI,CAACC,OAAO;AAE9B,QAAA,MAAMF,MAAAA,GAASG,MAAAA,CAAOC,MAAM,CAACH,KAAAA,CAAMD,MAAM,CAAA,CAAEK,OAAO,CAAC,CAACC,MAAAA,GAAWA,MAAAA,CAAON,MAAM,CAAA;QAE5EJ,KAAAA,CAAM,iCAAA,EAAmCI,OAAOO,MAAM,CAAA;QAEtD,OAAOP,MAAAA;AACT,IAAA;AACF;;;;"}
@@ -1 +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;;;;"}
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,cAAAA,CAAe,uBAAA,CAAA;AAEtB,MAAMC,mBAAAA,SAA4BC,sBAAAA,CAAAA;AACvC,IAAA,IAAWC,MAAAA,GAAuB;AAChC,QAAA,MAAM,EAAEC,KAAK,EAAE,GAAG,IAAI,CAACC,OAAO;AAE9B,QAAA,MAAMF,MAAAA,GAASG,MAAAA,CAAOC,MAAM,CAACH,KAAAA,CAAMD,MAAM,CAAA,CAAEK,OAAO,CAAC,CAACC,MAAAA,GAAWA,MAAAA,CAAON,MAAM,CAAA;QAE5EJ,KAAAA,CAAM,iCAAA,EAAmCI,OAAOO,MAAM,CAAA;QAEtD,OAAOP,MAAAA;AACT,IAAA;AACF;;;;"}
@@ -1 +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;;;;"}
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,sBAAAA,CAAe,qBAAA,CAAA;AAE7B;;;;;;;IAQO,MAAMC,iBAAAA,SAA0BC,+BAAAA,CAAAA;AACrC;;;;;;;AAOC,MACD,IAAWC,MAAAA,GAAuB;AAChC,QAAA,MAAM,EAAEC,IAAI,EAAE,GAAG,IAAI,CAACC,OAAO;AAE7B,QAAA,MAAMF,MAAAA,GAASG,MAAAA,CAAOC,MAAM,CAACH,KAC3B;SACCI,OAAO,CAAC,CAACC,GAAAA,GAAQH,MAAAA,CAAOC,MAAM,CAACE,GAAAA,CAAIN,MAAM,CAAA,CAC1C;AACCK,SAAAA,OAAO,CAAC,CAACE,MAAAA,GAAWA,MAAAA,CAAOP,MAAM,CAAA;QAEpCJ,KAAAA,CAAM,gCAAA,EAAkCI,OAAOQ,MAAM,CAAA;QAErD,OAAOR,MAAAA;AACT,IAAA;AACF;;;;"}
@@ -1 +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;;;;"}
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,cAAAA,CAAe,qBAAA,CAAA;AAE7B;;;;;;;IAQO,MAAMC,iBAAAA,SAA0BC,sBAAAA,CAAAA;AACrC;;;;;;;AAOC,MACD,IAAWC,MAAAA,GAAuB;AAChC,QAAA,MAAM,EAAEC,IAAI,EAAE,GAAG,IAAI,CAACC,OAAO;AAE7B,QAAA,MAAMF,MAAAA,GAASG,MAAAA,CAAOC,MAAM,CAACH,KAC3B;SACCI,OAAO,CAAC,CAACC,GAAAA,GAAQH,MAAAA,CAAOC,MAAM,CAACE,GAAAA,CAAIN,MAAM,CAAA,CAC1C;AACCK,SAAAA,OAAO,CAAC,CAACE,MAAAA,GAAWA,MAAAA,CAAOP,MAAM,CAAA;QAEpCJ,KAAAA,CAAM,gCAAA,EAAkCI,OAAOQ,MAAM,CAAA;QAErD,OAAOR,MAAAA;AACT,IAAA;AACF;;;;"}
@@ -1 +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"}
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,CAkChC;CACF"}
@@ -26,7 +26,17 @@ const debug = debug$1.createDebugger('routes:provider:plugins');
26
26
  const { plugins } = this._strapi;
27
27
  const routes = Object.values(plugins).flatMap((plugin)=>{
28
28
  const { routes } = plugin;
29
- return Array.isArray(routes) ? routes : Object.values(routes).flatMap((router)=>router.routes);
29
+ return Array.isArray(routes) ? routes : Object.values(routes).flatMap((router)=>{
30
+ return router.routes.map((route)=>{
31
+ const hasOwnPrefix = route.config != null && Object.prototype.hasOwnProperty.call(route.config, 'prefix');
32
+ const effectivePrefix = hasOwnPrefix ? route.config?.prefix ?? '' : router.prefix ?? '';
33
+ const fullPath = (`${effectivePrefix}${route.path}` || '/').replace(/\/+/g, '/').replace(/\/$/, '') || '/';
34
+ return {
35
+ ...route,
36
+ path: fullPath
37
+ };
38
+ });
39
+ });
30
40
  });
31
41
  debug('found %o routes in Strapi plugins', routes.length);
32
42
  return routes;
@@ -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,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;;;;"}
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 ? routes\n : Object.values(routes).flatMap((router: Core.Router) => {\n return router.routes.map((route: Core.Route) => {\n const hasOwnPrefix =\n route.config != null &&\n Object.prototype.hasOwnProperty.call(route.config, 'prefix');\n\n const effectivePrefix = hasOwnPrefix\n ? (route.config?.prefix ?? '')\n : (router.prefix ?? '');\n\n const fullPath =\n (`${effectivePrefix}${route.path}` || '/')\n .replace(/\\/+/g, '/')\n .replace(/\\/$/, '') || '/';\n\n return {\n ...route,\n path: fullPath,\n };\n });\n });\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","map","route","hasOwnPrefix","config","prototype","hasOwnProperty","call","effectivePrefix","prefix","fullPath","path","replace","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;YAEnB,OAAOC,KAAAA,CAAMC,OAAO,CAACR,MAAAA,CAAAA,GACjBA,MAAAA,GACAG,MAAAA,CAAOC,MAAM,CAACJ,MAAAA,CAAAA,CAAQK,OAAO,CAAC,CAACI,MAAAA,GAAAA;AAC7B,gBAAA,OAAOA,MAAAA,CAAOT,MAAM,CAACU,GAAG,CAAC,CAACC,KAAAA,GAAAA;AACxB,oBAAA,MAAMC,YAAAA,GACJD,KAAAA,CAAME,MAAM,IAAI,QAChBV,MAAAA,CAAOW,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,KAAAA,CAAME,MAAM,EAAE,QAAA,CAAA;oBAErD,MAAMI,eAAAA,GAAkBL,eACnBD,KAAAA,CAAME,MAAM,EAAEK,MAAAA,IAAU,EAAA,GACxBT,MAAAA,CAAOS,MAAM,IAAI,EAAA;AAEtB,oBAAA,MAAMC,WACJ,CAAC,GAAGF,eAAAA,CAAAA,EAAkBN,KAAAA,CAAMS,IAAI,CAAA,CAAE,IAAI,GAAE,EACrCC,OAAO,CAAC,MAAA,EAAQ,KAChBA,OAAO,CAAC,OAAO,EAAA,CAAA,IAAO,GAAA;oBAE3B,OAAO;AACL,wBAAA,GAAGV,KAAK;wBACRS,IAAAA,EAAMD;AACR,qBAAA;AACF,gBAAA,CAAA,CAAA;AACF,YAAA,CAAA,CAAA;AACN,QAAA,CAAA,CAAA;QAEAvB,KAAAA,CAAM,mCAAA,EAAqCI,OAAOsB,MAAM,CAAA;QAExD,OAAOtB,MAAAA;AACT,IAAA;AACF;;;;"}
@@ -24,7 +24,17 @@ const debug = createDebugger('routes:provider:plugins');
24
24
  const { plugins } = this._strapi;
25
25
  const routes = Object.values(plugins).flatMap((plugin)=>{
26
26
  const { routes } = plugin;
27
- return Array.isArray(routes) ? routes : Object.values(routes).flatMap((router)=>router.routes);
27
+ return Array.isArray(routes) ? routes : Object.values(routes).flatMap((router)=>{
28
+ return router.routes.map((route)=>{
29
+ const hasOwnPrefix = route.config != null && Object.prototype.hasOwnProperty.call(route.config, 'prefix');
30
+ const effectivePrefix = hasOwnPrefix ? route.config?.prefix ?? '' : router.prefix ?? '';
31
+ const fullPath = (`${effectivePrefix}${route.path}` || '/').replace(/\/+/g, '/').replace(/\/$/, '') || '/';
32
+ return {
33
+ ...route,
34
+ path: fullPath
35
+ };
36
+ });
37
+ });
28
38
  });
29
39
  debug('found %o routes in Strapi plugins', routes.length);
30
40
  return routes;
@@ -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,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;;;;"}
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 ? routes\n : Object.values(routes).flatMap((router: Core.Router) => {\n return router.routes.map((route: Core.Route) => {\n const hasOwnPrefix =\n route.config != null &&\n Object.prototype.hasOwnProperty.call(route.config, 'prefix');\n\n const effectivePrefix = hasOwnPrefix\n ? (route.config?.prefix ?? '')\n : (router.prefix ?? '');\n\n const fullPath =\n (`${effectivePrefix}${route.path}` || '/')\n .replace(/\\/+/g, '/')\n .replace(/\\/$/, '') || '/';\n\n return {\n ...route,\n path: fullPath,\n };\n });\n });\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","map","route","hasOwnPrefix","config","prototype","hasOwnProperty","call","effectivePrefix","prefix","fullPath","path","replace","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;YAEnB,OAAOC,KAAAA,CAAMC,OAAO,CAACR,MAAAA,CAAAA,GACjBA,MAAAA,GACAG,MAAAA,CAAOC,MAAM,CAACJ,MAAAA,CAAAA,CAAQK,OAAO,CAAC,CAACI,MAAAA,GAAAA;AAC7B,gBAAA,OAAOA,MAAAA,CAAOT,MAAM,CAACU,GAAG,CAAC,CAACC,KAAAA,GAAAA;AACxB,oBAAA,MAAMC,YAAAA,GACJD,KAAAA,CAAME,MAAM,IAAI,QAChBV,MAAAA,CAAOW,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,KAAAA,CAAME,MAAM,EAAE,QAAA,CAAA;oBAErD,MAAMI,eAAAA,GAAkBL,eACnBD,KAAAA,CAAME,MAAM,EAAEK,MAAAA,IAAU,EAAA,GACxBT,MAAAA,CAAOS,MAAM,IAAI,EAAA;AAEtB,oBAAA,MAAMC,WACJ,CAAC,GAAGF,eAAAA,CAAAA,EAAkBN,KAAAA,CAAMS,IAAI,CAAA,CAAE,IAAI,GAAE,EACrCC,OAAO,CAAC,MAAA,EAAQ,KAChBA,OAAO,CAAC,OAAO,EAAA,CAAA,IAAO,GAAA;oBAE3B,OAAO;AACL,wBAAA,GAAGV,KAAK;wBACRS,IAAAA,EAAMD;AACR,qBAAA;AACF,gBAAA,CAAA,CAAA;AACF,YAAA,CAAA,CAAA;AACN,QAAA,CAAA,CAAA;QAEAvB,KAAAA,CAAM,mCAAA,EAAqCI,OAAOsB,MAAM,CAAA;QAExD,OAAOtB,MAAAA;AACT,IAAA;AACF;;;;"}
@@ -1 +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"}
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,GAAI,MAAM,MAAM,KAAG,WAEvC,CAAC"}
@@ -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,KAAUA,GAAAA,KAAAA,CAAMC,IAAI,CAACF,IAAI,KAAKA,IAAAA;AACxC;;;;"}
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,KAAUA,GAAAA,KAAAA,CAAMC,IAAI,CAACF,IAAI,KAAKA,IAAAA;AACxC;;;;"}
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;;;;"}
@@ -1 +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"}
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,GACzB,UAAS,MAAM,GAAG,IAAW,EAC7B,YAAW,MAAwB,yBAGpC,CAAC"}
@@ -3,8 +3,12 @@
3
3
  var createDebug = require('debug');
4
4
  var constants = require('../constants.js');
5
5
 
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
+
8
+ var createDebug__default = /*#__PURE__*/_interopDefault(createDebug);
9
+
6
10
  const createDebugger = (section = null, namespace = constants.DEBUG_NAMESPACE)=>{
7
- return section !== null ? createDebug(`${namespace}:${section}`) : createDebug(namespace);
11
+ return section !== null ? createDebug__default.default(`${namespace}:${section}`) : createDebug__default.default(namespace);
8
12
  };
9
13
 
10
14
  exports.createDebugger = createDebugger;
@@ -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,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;;;;"}
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,4BAAAA,CAAY,CAAA,EAAGF,UAAU,CAAC,EAAED,OAAAA,CAAAA,CAAS,CAAA,GAAIG,4BAAAA,CAAYF,SAAAA,CAAAA;AACjF;;;;"}
@@ -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,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;;;;"}
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,MAAS,GAAA;AACP,QAAA,OAAO,IAAIC,WAAAA,EAAAA;AACb;AACF;;;;"}
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,MAAS,GAAA;AACP,QAAA,OAAO,IAAIC,KAAAA,EAAAA;AACb;AACF;;;;"}
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","constructor"],"mappings":";;AAAO,MAAMA,KAAAA,CAAAA;IAaXC,KAAgB,GAAA;AACd,QAAA,IAAI,IAAI,CAACC,UAAU,KAAK,IAAM,EAAA;AAC5B,YAAA,MAAM,IAAIC,KACR,CAAA,sFAAA,CAAA;AAEJ;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;IAEAM,IAAO,GAAA;AACL,QAAA,IAAI,IAAI,CAACN,UAAU,KAAK,IAAM,EAAA;AAC5B,YAAA,MAAM,IAAIC,KAAM,CAAA,4EAAA,CAAA;AAClB;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,SAAW,EAAA,IAAI,CAACP,UAAU;YAAEQ,OAAS,EAAA,IAAI,CAACJ,QAAQ;YAAEK,WAAa,EAAA,IAAI,CAACJ;AAAa,SAAA;AAC9F;IAEAK,KAAc,GAAA;QACZ,IAAI,CAACV,UAAU,GAAG,IAAA;QAClB,IAAI,CAACI,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;AACtB;IApCAM,WAAc,EAAA;QACZ,IAAI,CAACX,UAAU,GAAG,IAAA;QAClB,IAAI,CAACI,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;AACtB;AAiCF;;;;"}
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","constructor"],"mappings":"AAAO,MAAMA,KAAAA,CAAAA;IAaXC,KAAgB,GAAA;AACd,QAAA,IAAI,IAAI,CAACC,UAAU,KAAK,IAAM,EAAA;AAC5B,YAAA,MAAM,IAAIC,KACR,CAAA,sFAAA,CAAA;AAEJ;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;IAEAM,IAAO,GAAA;AACL,QAAA,IAAI,IAAI,CAACN,UAAU,KAAK,IAAM,EAAA;AAC5B,YAAA,MAAM,IAAIC,KAAM,CAAA,4EAAA,CAAA;AAClB;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,SAAW,EAAA,IAAI,CAACP,UAAU;YAAEQ,OAAS,EAAA,IAAI,CAACJ,QAAQ;YAAEK,WAAa,EAAA,IAAI,CAACJ;AAAa,SAAA;AAC9F;IAEAK,KAAc,GAAA;QACZ,IAAI,CAACV,UAAU,GAAG,IAAA;QAClB,IAAI,CAACI,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;AACtB;IApCAM,WAAc,EAAA;QACZ,IAAI,CAACX,UAAU,GAAG,IAAA;QAClB,IAAI,CAACI,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;AACtB;AAiCF;;;;"}
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;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../src/utils/zod.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,eAAO,MAAM,YAAY,cACZ,EAAE,OAAO,KACnB,YAAY,YAAY,GAAG,YAAY,eAsBzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,OAAQ,MAAM,WAAiC,CAAC"}
1
+ {"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../src/utils/zod.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,eAAO,MAAM,YAAY,GACvB,WAAW,CAAC,CAAC,OAAO,KACnB,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC,eAsBzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,IAAI,MAAM,WAAiC,CAAC"}
package/dist/utils/zod.js CHANGED
@@ -3,7 +3,8 @@
3
3
  var node_crypto = require('node:crypto');
4
4
  var z = require('zod/v4');
5
5
 
6
- function _interopNamespaceDefault(e) {
6
+ function _interopNamespace(e) {
7
+ if (e && e.__esModule) return e;
7
8
  var n = Object.create(null);
8
9
  if (e) {
9
10
  Object.keys(e).forEach(function (k) {
@@ -20,7 +21,7 @@ function _interopNamespaceDefault(e) {
20
21
  return Object.freeze(n);
21
22
  }
22
23
 
23
- var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
24
+ var z__namespace = /*#__PURE__*/_interopNamespace(z);
24
25
 
25
26
  /**
26
27
  * Converts a Zod schema to an OpenAPI Schema Object.
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BaA,MAAAA,YAAAA,GAAe,CAC1BC,SAAAA,GAAAA;IAEA,IAAI;AACF,QAAA,MAAMC,EAAKC,GAAAA,sBAAAA,EAAAA;QACX,MAAMC,QAAAA,GAAWC,aAAED,QAAQ,EAAA;;QAG3BA,QAASE,CAAAA,GAAG,CAACL,SAAW,EAAA;AAAEC,YAAAA;AAAG,SAAA,CAAA;;;QAI7B,KAAK,MAAM,CAACK,GAAKC,EAAAA,KAAAA,CAAM,IAAIH,YAAEI,CAAAA,cAAc,CAACC,MAAM,CAAE;YAClDN,QAASE,CAAAA,GAAG,CAACE,KAAO,EAAA;gBAAEN,EAAIK,EAAAA;AAAI,aAAA,CAAA;AAChC;;AAGA,QAAA,MAAM,EAAEI,OAAO,EAAE,GAAGN,YAAEO,CAAAA,YAAY,CAACR,QAAU,EAAA;YAAES,GAAKC,EAAAA;AAAiB,SAAA,CAAA;;QAGrE,OAAOH,OAAO,CAACT,EAAG,CAAA;AACpB,KAAA,CAAE,OAAOa,CAAG,EAAA;AACV,QAAA,MAAM,IAAIC,KAAM,CAAA,0DAAA,CAAA;AAClB;AACF;AAEA;;;;;IAMaF,MAAAA,gBAAAA,GAAmB,CAACZ,EAAAA,GAAe,CAAC,qBAAqB,EAAEA,EAAG,CAAA;;;;;"}
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;;;;;"}
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BaA,MAAAA,YAAAA,GAAe,CAC1BC,SAAAA,GAAAA;IAEA,IAAI;AACF,QAAA,MAAMC,EAAKC,GAAAA,UAAAA,EAAAA;QACX,MAAMC,QAAAA,GAAWC,EAAED,QAAQ,EAAA;;QAG3BA,QAASE,CAAAA,GAAG,CAACL,SAAW,EAAA;AAAEC,YAAAA;AAAG,SAAA,CAAA;;;QAI7B,KAAK,MAAM,CAACK,GAAKC,EAAAA,KAAAA,CAAM,IAAIH,CAAEI,CAAAA,cAAc,CAACC,MAAM,CAAE;YAClDN,QAASE,CAAAA,GAAG,CAACE,KAAO,EAAA;gBAAEN,EAAIK,EAAAA;AAAI,aAAA,CAAA;AAChC;;AAGA,QAAA,MAAM,EAAEI,OAAO,EAAE,GAAGN,CAAEO,CAAAA,YAAY,CAACR,QAAU,EAAA;YAAES,GAAKC,EAAAA;AAAiB,SAAA,CAAA;;QAGrE,OAAOH,OAAO,CAACT,EAAG,CAAA;AACpB,KAAA,CAAE,OAAOa,CAAG,EAAA;AACV,QAAA,MAAM,IAAIC,KAAM,CAAA,0DAAA,CAAA;AAClB;AACF;AAEA;;;;;IAMaF,MAAAA,gBAAAA,GAAmB,CAACZ,EAAAA,GAAe,CAAC,qBAAqB,EAAEA,EAAG,CAAA;;;;"}
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": "0.0.0-experimental.6188a65af997a4a8b190bbf104a9ba27ebf583c8",
3
+ "version": "0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282",
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": {
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git://github.com/strapi/strapi.git"
11
+ "url": "https://github.com/strapi/strapi.git",
12
+ "directory": "packages/core/openapi"
12
13
  },
13
14
  "license": "SEE LICENSE IN LICENSE",
14
15
  "author": {
@@ -52,7 +53,7 @@
52
53
  "test:unit:watch": "run -T jest --watch"
53
54
  },
54
55
  "engines": {
55
- "node": ">=18.0.0 <=22.x.x",
56
+ "node": ">=20.19.0 <=26.x.x",
56
57
  "npm": ">=6.0.0"
57
58
  },
58
59
  "dependencies": {
@@ -61,7 +62,7 @@
61
62
  "zod": "3.25.67"
62
63
  },
63
64
  "devDependencies": {
64
- "@strapi/types": "0.0.0-experimental.6188a65af997a4a8b190bbf104a9ba27ebf583c8",
65
+ "@strapi/types": "0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282",
65
66
  "@types/debug": "^4"
66
67
  }
67
68
  }