@powerlines/plugin-openapi 0.2.405 → 0.2.407
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/plugin.d.cts +5 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +5 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -19,8 +19,8 @@ const plugin = (options = {}) => {
|
|
|
19
19
|
name: "openapi",
|
|
20
20
|
config() {
|
|
21
21
|
return { openapi: (0, defu.default)(options, {
|
|
22
|
-
schema: (0, _stryke_path_join_paths.joinPaths)(this.
|
|
23
|
-
cwd: (0, _stryke_path_join_paths.joinPaths)(this.
|
|
22
|
+
schema: (0, _stryke_path_join_paths.joinPaths)(this.config.cwd, this.config.root, "schema.yaml"),
|
|
23
|
+
cwd: (0, _stryke_path_join_paths.joinPaths)(this.config.cwd, this.config.root),
|
|
24
24
|
outputPath: (0, _stryke_path_join_paths.joinPaths)("{builtinPath}", "api"),
|
|
25
25
|
silent: this.config.logLevel === null
|
|
26
26
|
}) };
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig } from "./types/plugin.cjs";
|
|
1
|
+
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig } from "./types/plugin.cjs";
|
|
2
2
|
import { Plugin } from "powerlines";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
@@ -15,5 +15,5 @@ declare module "powerlines" {
|
|
|
15
15
|
*/
|
|
16
16
|
declare const plugin: <TContext extends OpenAPIPluginContext = OpenAPIPluginContext>(options?: OpenAPIPluginOptions) => Plugin<TContext>;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, plugin as default, plugin };
|
|
18
|
+
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig, plugin as default, plugin };
|
|
19
19
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA4BY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;;;;cAUD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig } from "./types/plugin.mjs";
|
|
1
|
+
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig } from "./types/plugin.mjs";
|
|
2
2
|
import { Plugin } from "powerlines";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
@@ -15,5 +15,5 @@ declare module "powerlines" {
|
|
|
15
15
|
*/
|
|
16
16
|
declare const plugin: <TContext extends OpenAPIPluginContext = OpenAPIPluginContext>(options?: OpenAPIPluginOptions) => Plugin<TContext>;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, plugin as default, plugin };
|
|
18
|
+
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig, plugin as default, plugin };
|
|
19
19
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA4BY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;;;;cAUD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -15,8 +15,8 @@ const plugin = (options = {}) => {
|
|
|
15
15
|
name: "openapi",
|
|
16
16
|
config() {
|
|
17
17
|
return { openapi: defu(options, {
|
|
18
|
-
schema: joinPaths(this.
|
|
19
|
-
cwd: joinPaths(this.
|
|
18
|
+
schema: joinPaths(this.config.cwd, this.config.root, "schema.yaml"),
|
|
19
|
+
cwd: joinPaths(this.config.cwd, this.config.root),
|
|
20
20
|
outputPath: joinPaths("{builtinPath}", "api"),
|
|
21
21
|
silent: this.config.logLevel === null
|
|
22
22
|
}) };
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport openapiTS, { astToString } from \"openapi-typescript\";\nimport { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport openapiTS, { astToString } from \"openapi-typescript\";\nimport { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { OpenAPIPluginContext, OpenAPIPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n openapi?: OpenAPIPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate OpenAPI for code generation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends OpenAPIPluginContext = OpenAPIPluginContext\n>(\n options: OpenAPIPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"openapi\",\n config() {\n return {\n openapi: defu(options, {\n schema: joinPaths(this.config.cwd, this.config.root, \"schema.yaml\"),\n cwd: joinPaths(this.config.cwd, this.config.root),\n outputPath: joinPaths(\"{builtinPath}\", \"api\"),\n silent: this.config.logLevel === null\n })\n };\n },\n async configResolved() {\n this.config.openapi.outputPath = replacePathTokens(\n this,\n this.config.openapi.outputPath\n );\n },\n async prepare() {\n const ast = await openapiTS(\n this.config.openapi.schema,\n this.config.openapi\n );\n\n if (this.config.openapi.outputPath) {\n await this.fs.write(\n this.config.openapi.outputPath,\n astToString(ast, {\n fileName: this.config.openapi.outputPath\n })\n );\n } else {\n await this.emitBuiltin(astToString(ast), \"openapi\");\n }\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AAuCA,MAAa,UAGX,UAAgC,EAAE,KACb;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,SAAS,KAAK,SAAS;IACrB,QAAQ,UAAU,KAAK,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc;IACnE,KAAK,UAAU,KAAK,OAAO,KAAK,KAAK,OAAO,KAAK;IACjD,YAAY,UAAU,iBAAiB,MAAM;IAC7C,QAAQ,KAAK,OAAO,aAAa;IAClC,CAAC,EACH;;EAEH,MAAM,iBAAiB;AACrB,QAAK,OAAO,QAAQ,aAAa,kBAC/B,MACA,KAAK,OAAO,QAAQ,WACrB;;EAEH,MAAM,UAAU;GACd,MAAM,MAAM,MAAM,UAChB,KAAK,OAAO,QAAQ,QACpB,KAAK,OAAO,QACb;AAED,OAAI,KAAK,OAAO,QAAQ,WACtB,OAAM,KAAK,GAAG,MACZ,KAAK,OAAO,QAAQ,YACpB,YAAY,KAAK,EACf,UAAU,KAAK,OAAO,QAAQ,YAC/B,CAAC,CACH;OAED,OAAM,KAAK,YAAY,YAAY,IAAI,EAAE,UAAU;;EAGxD"}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig } from "./plugin.cjs";
|
|
2
|
-
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig };
|
|
1
|
+
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig } from "./plugin.cjs";
|
|
2
|
+
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig } from "./plugin.mjs";
|
|
2
|
-
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig };
|
|
1
|
+
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig } from "./plugin.mjs";
|
|
2
|
+
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig };
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -31,6 +31,10 @@ type OpenAPIPluginResolvedConfig = ResolvedConfig & {
|
|
|
31
31
|
openapi: Omit<OpenAPIPluginOptions, "schema"> & Required<Pick<OpenAPIPluginOptions, "schema">> & Pick<OpenAPITSOptions, "cwd">;
|
|
32
32
|
};
|
|
33
33
|
type OpenAPIPluginContext<TResolvedConfig extends OpenAPIPluginResolvedConfig = OpenAPIPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
34
|
+
declare type __ΩOpenAPIPluginOptions = any[];
|
|
35
|
+
declare type __ΩOpenAPIPluginUserConfig = any[];
|
|
36
|
+
declare type __ΩOpenAPIPluginResolvedConfig = any[];
|
|
37
|
+
declare type __ΩOpenAPIPluginContext = any[];
|
|
34
38
|
//#endregion
|
|
35
|
-
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig };
|
|
39
|
+
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig };
|
|
36
40
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;KAuBY,oBAAA,GAAuB,IAAA,CAAK,gBAAA;;AAAxC;;;;;;;EASE,MAAA,YAAkB,GAAA,GAAM,QAAA,GAAW,MAAA,GAAS,MAAA,CAAO,QAAA;EAAP;;;;;;;;EAU5C,UAAA;AAAA;AAAA,KAGU,uBAAA,GAA0B,UAAA;EACpC,OAAA,GAAU,IAAA,CAAK,oBAAA,cACb,QAAA,CAAS,IAAA,CAAK,oBAAA,eACd,IAAA,CAAK,gBAAA;AAAA;AAAA,KAGG,2BAAA,GAA8B,cAAA;EACxC,OAAA,EAAS,IAAA,CAAK,oBAAA,cACZ,QAAA,CAAS,IAAA,CAAK,oBAAA,eACd,IAAA,CAAK,gBAAA;AAAA;AAAA,KAGG,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA"}
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;KAuBY,oBAAA,GAAuB,IAAA,CAAK,gBAAA;;AAAxC;;;;;;;EASE,MAAA,YAAkB,GAAA,GAAM,QAAA,GAAW,MAAA,GAAS,MAAA,CAAO,QAAA;EAAP;;;;;;;;EAU5C,UAAA;AAAA;AAAA,KAGU,uBAAA,GAA0B,UAAA;EACpC,OAAA,GAAU,IAAA,CAAK,oBAAA,cACb,QAAA,CAAS,IAAA,CAAK,oBAAA,eACd,IAAA,CAAK,gBAAA;AAAA;AAAA,KAGG,2BAAA,GAA8B,cAAA;EACxC,OAAA,EAAS,IAAA,CAAK,oBAAA,cACZ,QAAA,CAAS,IAAA,CAAK,oBAAA,eACd,IAAA,CAAK,gBAAA;AAAA;AAAA,KAGG,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -31,6 +31,10 @@ type OpenAPIPluginResolvedConfig = ResolvedConfig & {
|
|
|
31
31
|
openapi: Omit<OpenAPIPluginOptions, "schema"> & Required<Pick<OpenAPIPluginOptions, "schema">> & Pick<OpenAPITSOptions, "cwd">;
|
|
32
32
|
};
|
|
33
33
|
type OpenAPIPluginContext<TResolvedConfig extends OpenAPIPluginResolvedConfig = OpenAPIPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
34
|
+
declare type __ΩOpenAPIPluginOptions = any[];
|
|
35
|
+
declare type __ΩOpenAPIPluginUserConfig = any[];
|
|
36
|
+
declare type __ΩOpenAPIPluginResolvedConfig = any[];
|
|
37
|
+
declare type __ΩOpenAPIPluginContext = any[];
|
|
34
38
|
//#endregion
|
|
35
|
-
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig };
|
|
39
|
+
export { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig };
|
|
36
40
|
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;KAuBY,oBAAA,GAAuB,IAAA,CAAK,gBAAA;;AAAxC;;;;;;;EASE,MAAA,YAAkB,GAAA,GAAM,QAAA,GAAW,MAAA,GAAS,MAAA,CAAO,QAAA;EAAP;;;;;;;;EAU5C,UAAA;AAAA;AAAA,KAGU,uBAAA,GAA0B,UAAA;EACpC,OAAA,GAAU,IAAA,CAAK,oBAAA,cACb,QAAA,CAAS,IAAA,CAAK,oBAAA,eACd,IAAA,CAAK,gBAAA;AAAA;AAAA,KAGG,2BAAA,GAA8B,cAAA;EACxC,OAAA,EAAS,IAAA,CAAK,oBAAA,cACZ,QAAA,CAAS,IAAA,CAAK,oBAAA,eACd,IAAA,CAAK,gBAAA;AAAA;AAAA,KAGG,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA"}
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;KAuBY,oBAAA,GAAuB,IAAA,CAAK,gBAAA;;AAAxC;;;;;;;EASE,MAAA,YAAkB,GAAA,GAAM,QAAA,GAAW,MAAA,GAAS,MAAA,CAAO,QAAA;EAAP;;;;;;;;EAU5C,UAAA;AAAA;AAAA,KAGU,uBAAA,GAA0B,UAAA;EACpC,OAAA,GAAU,IAAA,CAAK,oBAAA,cACb,QAAA,CAAS,IAAA,CAAK,oBAAA,eACd,IAAA,CAAK,gBAAA;AAAA;AAAA,KAGG,2BAAA,GAA8B,cAAA;EACxC,OAAA,EAAS,IAAA,CAAK,oBAAA,cACZ,QAAA,CAAS,IAAA,CAAK,oBAAA,eACd,IAAA,CAAK,gBAAA;AAAA;AAAA,KAGG,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-openapi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.407",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to generate project code from OpenAPI specifications.",
|
|
6
6
|
"repository": {
|
|
@@ -101,13 +101,13 @@
|
|
|
101
101
|
"defu": "^6.1.7",
|
|
102
102
|
"jiti": "^2.6.1",
|
|
103
103
|
"openapi-typescript": "^7.13.0",
|
|
104
|
-
"powerlines": "^0.
|
|
104
|
+
"powerlines": "^0.43.1"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
107
|
+
"@powerlines/plugin-plugin": "^0.12.353",
|
|
108
108
|
"@types/node": "^25.6.0"
|
|
109
109
|
},
|
|
110
110
|
"publishConfig": { "access": "public" },
|
|
111
111
|
"types": "./dist/index.d.cts",
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "0b0428286336ad582b5c70e69dfd97ba6b586b59"
|
|
113
113
|
}
|