@powerlines/plugin-openapi 0.2.295 → 0.2.297
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 +4 -4
- package/dist/index.d.cts +6 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts +2 -4
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +2 -4
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ let defu = require("defu");
|
|
|
5
5
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
6
6
|
let openapi_typescript = require("openapi-typescript");
|
|
7
7
|
openapi_typescript = require_rolldown_runtime.__toESM(openapi_typescript);
|
|
8
|
-
let
|
|
8
|
+
let powerlines_plugin_utils = require("powerlines/plugin-utils");
|
|
9
9
|
|
|
10
10
|
//#region src/index.ts
|
|
11
11
|
/**
|
|
@@ -19,14 +19,14 @@ 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.workspaceConfig.workspaceRoot, this.config.
|
|
23
|
-
cwd: (0, __stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.
|
|
22
|
+
schema: (0, __stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root, "schema.yaml"),
|
|
23
|
+
cwd: (0, __stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root),
|
|
24
24
|
outputPath: (0, __stryke_path_join_paths.joinPaths)("{builtinPath}", "api"),
|
|
25
25
|
silent: this.config.logLevel === null
|
|
26
26
|
}) };
|
|
27
27
|
},
|
|
28
28
|
async configResolved() {
|
|
29
|
-
this.config.openapi.outputPath = (0,
|
|
29
|
+
this.config.openapi.outputPath = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.openapi.outputPath);
|
|
30
30
|
},
|
|
31
31
|
async prepare() {
|
|
32
32
|
const ast = await (0, openapi_typescript.default)(this.config.openapi.schema, this.config.openapi);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig } from "./types/plugin.cjs";
|
|
2
2
|
import "./types/index.cjs";
|
|
3
|
-
import { Plugin } from "powerlines
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
|
-
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface UserConfig {
|
|
8
|
+
openapi?: OpenAPIPluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* A Powerlines plugin to integrate OpenAPI for code generation.
|
|
9
13
|
*
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IA6BwB,OAAA,CAAA,EAIV,oBAJU;EAAA;;;;AAcxB;;;;AAIU,cAJG,MAIH,EAAA,CAAA,iBAHS,oBAGT,GAHgC,oBAGhC,CAAA,CAAA,OAAA,CAAA,EADC,oBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { OpenAPIPluginContext, OpenAPIPluginOptions, OpenAPIPluginResolvedConfig, OpenAPIPluginUserConfig, __ΩOpenAPIPluginContext, __ΩOpenAPIPluginOptions, __ΩOpenAPIPluginResolvedConfig, __ΩOpenAPIPluginUserConfig } from "./types/plugin.mjs";
|
|
2
2
|
import "./types/index.mjs";
|
|
3
|
-
import { Plugin } from "powerlines
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
|
-
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface UserConfig {
|
|
8
|
+
openapi?: OpenAPIPluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* A Powerlines plugin to integrate OpenAPI for code generation.
|
|
9
13
|
*
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IA6BwB,OAAA,CAAA,EAIV,oBAJU;EAAA;;;;AAcxB;;;;AAIU,cAJG,MAIH,EAAA,CAAA,iBAHS,oBAGT,GAHgC,oBAGhC,CAAA,CAAA,OAAA,CAAA,EADC,oBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
2
2
|
import defu from "defu";
|
|
3
3
|
import openapiTS, { astToString } from "openapi-typescript";
|
|
4
|
-
import { replacePathTokens } from "powerlines/plugin-utils
|
|
4
|
+
import { replacePathTokens } from "powerlines/plugin-utils";
|
|
5
5
|
|
|
6
6
|
//#region src/index.ts
|
|
7
7
|
/**
|
|
@@ -15,8 +15,8 @@ const plugin = (options = {}) => {
|
|
|
15
15
|
name: "openapi",
|
|
16
16
|
config() {
|
|
17
17
|
return { openapi: defu(options, {
|
|
18
|
-
schema: joinPaths(this.workspaceConfig.workspaceRoot, this.config.
|
|
19
|
-
cwd: joinPaths(this.workspaceConfig.workspaceRoot, this.config.
|
|
18
|
+
schema: joinPaths(this.workspaceConfig.workspaceRoot, this.config.root, "schema.yaml"),
|
|
19
|
+
cwd: joinPaths(this.workspaceConfig.workspaceRoot, 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 {
|
|
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 {\n OpenAPIPluginContext,\n OpenAPIPluginOptions,\n OpenAPIPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n export interface UserConfig {\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(\n this.workspaceConfig.workspaceRoot,\n this.config.root,\n \"schema.yaml\"\n ),\n cwd: joinPaths(this.workspaceConfig.workspaceRoot, this.config.root),\n outputPath: joinPaths(\"{builtinPath}\", \"api\"),\n silent: this.config.logLevel === null\n })\n } as Partial<OpenAPIPluginUserConfig>;\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":";;;;;;;;;;;;AA2CA,MAAa,UAGX,UAAgC,EAAE,KACb;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,SAAS,KAAK,SAAS;IACrB,QAAQ,UACN,KAAK,gBAAgB,eACrB,KAAK,OAAO,MACZ,cACD;IACD,KAAK,UAAU,KAAK,gBAAgB,eAAe,KAAK,OAAO,KAAK;IACpE,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;;AAGH,kBAAe"}
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
1
2
|
import { Buffer } from "node:buffer";
|
|
2
3
|
import { Stream } from "node:stream";
|
|
3
4
|
import { OpenAPI3, OpenAPITSOptions } from "openapi-typescript";
|
|
4
|
-
import { UserConfig } from "powerlines/types/config";
|
|
5
|
-
import { PluginContext } from "powerlines/types/context";
|
|
6
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
7
5
|
|
|
8
6
|
//#region src/types/plugin.d.ts
|
|
9
7
|
type OpenAPIPluginOptions = Omit<OpenAPITSOptions, "cwd"> & {
|
|
@@ -13,7 +11,7 @@ type OpenAPIPluginOptions = Omit<OpenAPITSOptions, "cwd"> & {
|
|
|
13
11
|
* @remarks
|
|
14
12
|
* This can be a string path, URL, OpenAPI3 object, Buffer, or Readable stream.
|
|
15
13
|
*
|
|
16
|
-
* @defaultValue "\{
|
|
14
|
+
* @defaultValue "\{root\}/schema.yaml"
|
|
17
15
|
*/
|
|
18
16
|
schema?: string | URL | OpenAPI3 | Buffer | Stream.Readable;
|
|
19
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAuBY,oBAAA,GAAuB,KAAK;;AAAxC;;;;;;;EAS6D,MAAA,CAAA,EAAA,MAAA,GAAzC,GAAyC,GAAnC,QAAmC,GAAxB,MAAwB,GAAf,MAAA,CAAO,QAAQ;EAajD;;;;;;;;EAGR,UAAA,CAAA,EAAA,MAAA;CAAI;AAGI,KANA,uBAAA,GAA0B,UAMC,GAAA;EAAG,OAAA,CAAA,EAL9B,IAK8B,CALzB,oBAKyB,EAAA,QAAA,CAAA,GAJtC,QAIsC,CAJ7B,IAI6B,CAJxB,oBAIwB,EAAA,QAAA,CAAA,CAAA,GAHtC,IAGsC,CAHjC,gBAGiC,EAAA,KAAA,CAAA;CAC1B;AAAL,KADC,2BAAA,GAA8B,cAC/B,GAAA;EACO,OAAA,EADP,IACO,CADF,oBACE,EAAA,QAAA,CAAA,GAAd,QAAc,CAAL,IAAK,CAAA,oBAAA,EAAA,QAAA,CAAA,CAAA,GACd,IADc,CACT,gBADS,EAAA,KAAA,CAAA;CAAL;AAAT,KAIQ,oBAJR,CAAA,wBAKsB,2BALtB,GAMA,2BANA,CAAA,GAOA,aAPA,CAOc,eAPd,CAAA;AACK,uCAAA,GAAA,EAAA;AAAL,0CAAA,GAAA,EAAA;AAAI,8CAAA,GAAA,EAAA;AAGI,uCAAoB,GAAA,EAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { OpenAPI3, OpenAPITSOptions } from "openapi-typescript";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
2
3
|
import { Buffer } from "node:buffer";
|
|
3
4
|
import { Stream } from "node:stream";
|
|
4
|
-
import { UserConfig } from "powerlines/types/config";
|
|
5
|
-
import { PluginContext } from "powerlines/types/context";
|
|
6
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
7
5
|
|
|
8
6
|
//#region src/types/plugin.d.ts
|
|
9
7
|
type OpenAPIPluginOptions = Omit<OpenAPITSOptions, "cwd"> & {
|
|
@@ -13,7 +11,7 @@ type OpenAPIPluginOptions = Omit<OpenAPITSOptions, "cwd"> & {
|
|
|
13
11
|
* @remarks
|
|
14
12
|
* This can be a string path, URL, OpenAPI3 object, Buffer, or Readable stream.
|
|
15
13
|
*
|
|
16
|
-
* @defaultValue "\{
|
|
14
|
+
* @defaultValue "\{root\}/schema.yaml"
|
|
17
15
|
*/
|
|
18
16
|
schema?: string | URL | OpenAPI3 | Buffer | Stream.Readable;
|
|
19
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAuBY,oBAAA,GAAuB,KAAK;;AAAxC;;;;;;;EAS6D,MAAA,CAAA,EAAA,MAAA,GAAzC,GAAyC,GAAnC,QAAmC,GAAxB,MAAwB,GAAf,MAAA,CAAO,QAAQ;EAajD;;;;;;;;EAGR,UAAA,CAAA,EAAA,MAAA;CAAI;AAGI,KANA,uBAAA,GAA0B,UAMC,GAAA;EAAG,OAAA,CAAA,EAL9B,IAK8B,CALzB,oBAKyB,EAAA,QAAA,CAAA,GAJtC,QAIsC,CAJ7B,IAI6B,CAJxB,oBAIwB,EAAA,QAAA,CAAA,CAAA,GAHtC,IAGsC,CAHjC,gBAGiC,EAAA,KAAA,CAAA;CAC1B;AAAL,KADC,2BAAA,GAA8B,cAC/B,GAAA;EACO,OAAA,EADP,IACO,CADF,oBACE,EAAA,QAAA,CAAA,GAAd,QAAc,CAAL,IAAK,CAAA,oBAAA,EAAA,QAAA,CAAA,CAAA,GACd,IADc,CACT,gBADS,EAAA,KAAA,CAAA;CAAL;AAAT,KAIQ,oBAJR,CAAA,wBAKsB,2BALtB,GAMA,2BANA,CAAA,GAOA,aAPA,CAOc,eAPd,CAAA;AACK,uCAAA,GAAA,EAAA;AAAL,0CAAA,GAAA,EAAA;AAAI,8CAAA,GAAA,EAAA;AAGI,uCAAoB,GAAA,EAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-openapi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.297",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to generate project code from OpenAPI specifications.",
|
|
6
6
|
"repository": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"default": "./dist/index.mjs"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
"
|
|
58
|
+
"./*": "./*",
|
|
59
59
|
"./types": {
|
|
60
60
|
"require": {
|
|
61
61
|
"types": "./dist/types/index.d.cts",
|
|
@@ -101,13 +101,13 @@
|
|
|
101
101
|
"defu": "^6.1.4",
|
|
102
102
|
"jiti": "^2.6.1",
|
|
103
103
|
"openapi-typescript": "^7.13.0",
|
|
104
|
-
"powerlines": "^0.
|
|
104
|
+
"powerlines": "^0.39.1"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
108
|
-
"@types/node": "^25.3.
|
|
107
|
+
"@powerlines/plugin-plugin": "^0.12.243",
|
|
108
|
+
"@types/node": "^25.3.3"
|
|
109
109
|
},
|
|
110
110
|
"publishConfig": { "access": "public" },
|
|
111
111
|
"types": "./dist/index.d.cts",
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "30a096fed42d3462dbc028b16145250c373f3d99"
|
|
113
113
|
}
|