@powerlines/plugin-hey-api 0.1.295 → 0.1.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/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the <b>🔌 Powerlines</b> monorepo. Powerlines is the "
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.1.288-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.1.295-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -58,21 +58,19 @@ A Powerlines plugin to generate project code with [OpenAPI](https://heyapi.dev/)
58
58
 
59
59
  ## Table of Contents
60
60
 
61
- - [Powerlines - Hey API Plugin](#powerlines---hey-api-plugin)
62
- - [Table of Contents](#table-of-contents)
63
- - [Installing](#installing)
64
- - [Reduced Package Size](#reduced-package-size)
65
- - [Development](#development)
66
- - [Building](#building)
67
- - [Running unit tests](#running-unit-tests)
68
- - [Linting](#linting)
69
- - [Storm Workspaces](#storm-workspaces)
70
- - [Roadmap](#roadmap)
71
- - [Support](#support)
72
- - [License](#license)
73
- - [Changelog](#changelog)
74
- - [Contributing](#contributing)
75
- - [Contributors](#contributors)
61
+ - [Installing](#installing)
62
+ - [Reduced Package Size](#reduced-package-size)
63
+ - [Development](#development)
64
+ - [Building](#building)
65
+ - [Running unit tests](#running-unit-tests)
66
+ - [Linting](#linting)
67
+ - [Storm Workspaces](#storm-workspaces)
68
+ - [Roadmap](#roadmap)
69
+ - [Support](#support)
70
+ - [License](#license)
71
+ - [Changelog](#changelog)
72
+ - [Contributing](#contributing)
73
+ - [Contributors](#contributors)
76
74
 
77
75
  <!-- END doctoc -->
78
76
 
@@ -1,4 +1,4 @@
1
- //#region rolldown:runtime
1
+ //#region \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -0,0 +1,3 @@
1
+ import "node:module";
2
+
3
+ export { };
@@ -1,5 +1,6 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
3
4
 
4
5
  //#region src/helpers/create-operation-id.ts
5
6
  /**
@@ -9,7 +10,7 @@ let __stryke_string_format_camel_case = require("@stryke/string-format/camel-cas
9
10
  * @returns The generated operation ID
10
11
  */
11
12
  function createOperationId(summary) {
12
- return (0, __stryke_string_format_camel_case.camelCase)(summary.replace(/\b(?:a|from|to|the|given|of|an)\b/gi, "").replace("Get list", "list"));
13
+ return (0, _stryke_string_format_camel_case.camelCase)(summary.replace(/\b(?:a|from|to|the|given|of|an)\b/gi, "").replace("Get list", "list"));
13
14
  }
14
15
 
15
16
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"create-operation-id.d.cts","names":[],"sources":["../../src/helpers/create-operation-id.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA"}
1
+ {"version":3,"file":"create-operation-id.d.cts","names":[],"sources":["../../src/helpers/create-operation-id.ts"],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA,CAAkB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-operation-id.d.mts","names":[],"sources":["../../src/helpers/create-operation-id.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA"}
1
+ {"version":3,"file":"create-operation-id.d.mts","names":[],"sources":["../../src/helpers/create-operation-id.ts"],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA,CAAkB,OAAA"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  const require_helpers_create_operation_id = require('./create-operation-id.cjs');
2
3
 
3
4
  exports.createOperationId = require_helpers_create_operation_id.createOperationId;
package/dist/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
3
  const require_helpers_create_operation_id = require('./helpers/create-operation-id.cjs');
4
4
  require('./helpers/index.cjs');
5
- let __hey_api_openapi_ts = require("@hey-api/openapi-ts");
6
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
7
- let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
8
- let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
5
+ let _hey_api_openapi_ts = require("@hey-api/openapi-ts");
6
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
7
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
8
+ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
9
9
  let defu = require("defu");
10
- defu = require_rolldown_runtime.__toESM(defu);
10
+ defu = require_runtime.__toESM(defu);
11
11
  let powerlines_plugin_utils = require("powerlines/plugin-utils");
12
12
 
13
13
  //#region src/index.ts
@@ -41,8 +41,8 @@ const plugin = (options = {}) => {
41
41
  }
42
42
  ],
43
43
  ...(0, defu.default)(options, {
44
- schema: (0, __stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root, "schema.yaml"),
45
- output: { path: (0, __stryke_path_join_paths.joinPaths)("{builtinPath}", "api") },
44
+ schema: (0, _stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root, "schema.yaml"),
45
+ output: { path: (0, _stryke_path_join_paths.joinPaths)("{builtinPath}", "api") },
46
46
  logs: this.envPaths.log
47
47
  })
48
48
  } };
@@ -51,11 +51,11 @@ const plugin = (options = {}) => {
51
51
  this.config.heyApi.output ??= {};
52
52
  this.config.heyApi.output.path = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.heyApi.output.path);
53
53
  if (!this.config.heyApi.schema) throw new Error("The `schema` option is required by the Hey API plugin.");
54
- if ((0, __stryke_type_checks_is_set_string.isSetString)(this.config.heyApi.schema)) {
54
+ if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.heyApi.schema)) {
55
55
  const result = await this.fetch(this.config.heyApi.schema);
56
56
  this.config.heyApi.schema = await result.json();
57
57
  }
58
- if ((0, __stryke_type_checks_is_set_object.isSetObject)(this.config.heyApi.schema) && this.config.heyApi.schema.paths) {
58
+ if ((0, _stryke_type_checks_is_set_object.isSetObject)(this.config.heyApi.schema) && this.config.heyApi.schema.paths) {
59
59
  const schema = this.config.heyApi.schema;
60
60
  for (const pathItem of Object.values(schema.paths)) {
61
61
  if (!pathItem || "$ref" in pathItem) continue;
@@ -70,23 +70,22 @@ const plugin = (options = {}) => {
70
70
  "trace"
71
71
  ]) {
72
72
  const operation = pathItem[method];
73
- if (!(0, __stryke_type_checks_is_set_string.isSetString)(operation?.summary)) continue;
73
+ if (!(0, _stryke_type_checks_is_set_string.isSetString)(operation?.summary)) continue;
74
74
  operation.operationId = require_helpers_create_operation_id.createOperationId(operation.summary);
75
75
  }
76
76
  }
77
77
  }
78
78
  },
79
79
  async prepare() {
80
- await (0, __hey_api_openapi_ts.createClient)({
80
+ await (0, _hey_api_openapi_ts.createClient)({
81
81
  ...this.config.heyApi,
82
82
  input: this.config.heyApi.schema
83
83
  });
84
84
  }
85
85
  };
86
86
  };
87
- var src_default = plugin;
88
87
 
89
88
  //#endregion
90
89
  exports.createOperationId = require_helpers_create_operation_id.createOperationId;
91
- exports.default = src_default;
90
+ exports.default = plugin;
92
91
  exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { createOperationId } from "./helpers/create-operation-id.cjs";
2
2
  import { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig } from "./types/plugin.cjs";
3
- import "./types/index.cjs";
4
3
  import { Plugin } from "powerlines";
5
4
 
6
5
  //#region src/index.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;IAmCwB,MAAA,CAAA,EAIX,mBAJW;EAAA;;;;AAgBxB;;;;;;AAIS,cAJI,MAIJ,EAAA,CAAA,iBAHU,mBAGV,GAHgC,mBAGhC,CAAA,CAAA,OAAA,CAAA,EADE,mBACF,EAAA,GAAN,MAAM,CAAC,QAAD,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YAsCY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;;;;;;;;AAYb;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { createOperationId } from "./helpers/create-operation-id.mjs";
2
2
  import { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig } from "./types/plugin.mjs";
3
- import "./types/index.mjs";
4
3
  import { Plugin } from "powerlines";
5
4
 
6
5
  //#region src/index.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;IAmCwB,MAAA,CAAA,EAIX,mBAJW;EAAA;;;;AAgBxB;;;;;;AAIS,cAJI,MAIJ,EAAA,CAAA,iBAHU,mBAGV,GAHgC,mBAGhC,CAAA,CAAA,OAAA,CAAA,EADE,mBACF,EAAA,GAAN,MAAM,CAAC,QAAD,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YAsCY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;;;;;;;;AAYb;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -81,8 +81,7 @@ const plugin = (options = {}) => {
81
81
  }
82
82
  };
83
83
  };
84
- var src_default = plugin;
85
84
 
86
85
  //#endregion
87
- export { createOperationId, src_default as default, plugin };
86
+ export { createOperationId, plugin as default, plugin };
88
87
  //# sourceMappingURL=index.mjs.map
@@ -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 type { UserConfig } from \"@hey-api/openapi-ts\";\nimport { createClient, OpenApi } from \"@hey-api/openapi-ts\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { createOperationId } from \"./helpers/create-operation-id\";\nimport {\n HeyAPIPluginContext,\n HeyAPIPluginOptions,\n HeyAPIPluginOutputOptions,\n HeyAPIPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n heyApi?: HeyAPIPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate Hey API for code generation.\n *\n * @see https://heyapi.dev/\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends HeyAPIPluginContext = HeyAPIPluginContext\n>(\n options: HeyAPIPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"hey-api\",\n config() {\n return {\n heyApi: {\n plugins: [\n {\n name: \"@hey-api/typescript\",\n exportFromIndex: false\n },\n {\n name: \"@hey-api/sdk\",\n instance: \"PrismaClient\",\n exportFromIndex: false,\n auth: false\n },\n {\n name: \"@hey-api/client-fetch\",\n throwOnError: true\n }\n ],\n ...defu(options, {\n schema: joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.root,\n \"schema.yaml\"\n ),\n output: {\n path: joinPaths(\"{builtinPath}\", \"api\")\n },\n logs: this.envPaths.log\n })\n }\n } as Partial<HeyAPIPluginUserConfig>;\n },\n async configResolved() {\n this.config.heyApi.output ??= {} as HeyAPIPluginOutputOptions;\n this.config.heyApi.output.path = replacePathTokens(\n this,\n this.config.heyApi.output.path\n );\n\n if (!this.config.heyApi.schema) {\n throw new Error(\n \"The `schema` option is required by the Hey API plugin.\"\n );\n }\n\n if (isSetString(this.config.heyApi.schema)) {\n const result = await this.fetch(this.config.heyApi.schema);\n this.config.heyApi.schema =\n (await result.json()) as HeyAPIPluginOptions[\"schema\"];\n }\n\n if (\n isSetObject(this.config.heyApi.schema) &&\n (this.config.heyApi.schema as OpenApi.V3_0_X).paths\n ) {\n const schema = this.config.heyApi.schema as OpenApi.V3_0_X;\n for (const pathItem of Object.values(schema.paths)) {\n if (!pathItem || \"$ref\" in pathItem) {\n continue;\n }\n\n for (const method of [\n \"get\",\n \"put\",\n \"post\",\n \"delete\",\n \"options\",\n \"head\",\n \"patch\",\n \"trace\"\n ] as const) {\n const operation = pathItem[method];\n if (!isSetString(operation?.summary)) {\n continue;\n }\n\n operation.operationId = createOperationId(operation.summary);\n }\n }\n }\n },\n async prepare() {\n await createClient({\n ...this.config.heyApi,\n input: this.config.heyApi.schema!\n } as UserConfig);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmDA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,QAAQ;IACN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/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 type { UserConfig } from \"@hey-api/openapi-ts\";\nimport { createClient, OpenApi } from \"@hey-api/openapi-ts\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { createOperationId } from \"./helpers/create-operation-id\";\nimport {\n HeyAPIPluginContext,\n HeyAPIPluginOptions,\n HeyAPIPluginOutputOptions,\n HeyAPIPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n heyApi?: HeyAPIPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate Hey API for code generation.\n *\n * @see https://heyapi.dev/\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends HeyAPIPluginContext = HeyAPIPluginContext\n>(\n options: HeyAPIPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"hey-api\",\n config() {\n return {\n heyApi: {\n plugins: [\n {\n name: \"@hey-api/typescript\",\n exportFromIndex: false\n },\n {\n name: \"@hey-api/sdk\",\n instance: \"PrismaClient\",\n exportFromIndex: false,\n auth: false\n },\n {\n name: \"@hey-api/client-fetch\",\n throwOnError: true\n }\n ],\n ...defu(options, {\n schema: joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.root,\n \"schema.yaml\"\n ),\n output: {\n path: joinPaths(\"{builtinPath}\", \"api\")\n },\n logs: this.envPaths.log\n })\n }\n } as Partial<HeyAPIPluginUserConfig>;\n },\n async configResolved() {\n this.config.heyApi.output ??= {} as HeyAPIPluginOutputOptions;\n this.config.heyApi.output.path = replacePathTokens(\n this,\n this.config.heyApi.output.path\n );\n\n if (!this.config.heyApi.schema) {\n throw new Error(\n \"The `schema` option is required by the Hey API plugin.\"\n );\n }\n\n if (isSetString(this.config.heyApi.schema)) {\n const result = await this.fetch(this.config.heyApi.schema);\n this.config.heyApi.schema =\n (await result.json()) as HeyAPIPluginOptions[\"schema\"];\n }\n\n if (\n isSetObject(this.config.heyApi.schema) &&\n (this.config.heyApi.schema as OpenApi.V3_0_X).paths\n ) {\n const schema = this.config.heyApi.schema as OpenApi.V3_0_X;\n for (const pathItem of Object.values(schema.paths)) {\n if (!pathItem || \"$ref\" in pathItem) {\n continue;\n }\n\n for (const method of [\n \"get\",\n \"put\",\n \"post\",\n \"delete\",\n \"options\",\n \"head\",\n \"patch\",\n \"trace\"\n ] as const) {\n const operation = pathItem[method];\n if (!isSetString(operation?.summary)) {\n continue;\n }\n\n operation.operationId = createOperationId(operation.summary);\n }\n }\n }\n },\n async prepare() {\n await createClient({\n ...this.config.heyApi,\n input: this.config.heyApi.schema!\n } as UserConfig);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmDA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,QAAQ;IACN,SAAS;KACP;MACE,MAAM;MACN,iBAAiB;MAClB;KACD;MACE,MAAM;MACN,UAAU;MACV,iBAAiB;MACjB,MAAM;MACP;KACD;MACE,MAAM;MACN,cAAc;MACf;KACF;IACD,GAAG,KAAK,SAAS;KACf,QAAQ,UACN,KAAK,gBAAgB,eACrB,KAAK,OAAO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A,QAAA,CAAA,GAAA;EAAL;;;;AAKV;;;;EAGI,MAAA,CAAA,EArBO,YAqBP,CAAA,OAAA,CAAA;EAAa;;;WAhBN;;KAGC,sBAAA,GAAyB;WAC1B;;KAGC,0BAAA,GAA6B;UAC/B,KAAK;YACH,gCAAgC,OAAA,CAAQ;;;KAIxC,4CACc,6BACtB,8BACA,cAAc"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAsBY,yBAAA,GAA4B,YAAA;EAA5B;;;;;AAYZ;;;EAHE,IAAA;AAAA;AAAA,KAGU,mBAAA,GAAsB,IAAA,CAChC,YAAA;EAgBS;;;;;;;;EALT,MAAA,GAAS,YAAA;EAKyB;;AAGpC;EAHE,MAAA,GAAS,yBAAA;AAAA;AAAA,KAGC,sBAAA,GAAyB,UAAA;EACnC,MAAA,GAAS,mBAAA;AAAA;AAAA,KAGC,0BAAA,GAA6B,cAAA;EACvC,MAAA,EAAQ,IAAA,CAAK,mBAAA;IACX,MAAA,EAAQ,mBAAA,aAAgC,OAAA,CAAQ,MAAA;EAAA;AAAA;AAAA,KAIxC,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAsBY,yBAAA,GAA4B;EAA5B;AAYZ;;;;;;AAoBA;EAIY,IAAA,CAAA,EAAA,MAAA;CAA6B;AAC1B,KAzBH,mBAAA,GAAsB,IAyBnB,CAxBb,UAwBa,EAAA,OAAA,GAAA,QAAA,GAAA,QAAA,CAAA,GAAA;EAAL;;;;AAKV;;;;EAGI,MAAA,CAAA,EArBO,UAqBP,CAAA,OAAA,CAAA;EAAa;;;WAhBN;;KAGC,sBAAA,GAAyB;WAC1B;;KAGC,0BAAA,GAA6B;UAC/B,KAAK;YACH,gCAAgC,OAAA,CAAQ;;;KAIxC,4CACc,6BACtB,8BACA,cAAc"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAsBY,yBAAA,GAA4B,UAAA;EAA5B;;;;;AAYZ;;;EAHE,IAAA;AAAA;AAAA,KAGU,mBAAA,GAAsB,IAAA,CAChC,UAAA;EAgBS;;;;;;;;EALT,MAAA,GAAS,UAAA;EAKyB;;AAGpC;EAHE,MAAA,GAAS,yBAAA;AAAA;AAAA,KAGC,sBAAA,GAAyB,YAAA;EACnC,MAAA,GAAS,mBAAA;AAAA;AAAA,KAGC,0BAAA,GAA6B,cAAA;EACvC,MAAA,EAAQ,IAAA,CAAK,mBAAA;IACX,MAAA,EAAQ,mBAAA,aAAgC,OAAA,CAAQ,MAAA;EAAA;AAAA;AAAA,KAIxC,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-hey-api",
3
- "version": "0.1.295",
3
+ "version": "0.1.297",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code using Hey API.",
6
6
  "repository": {
@@ -55,7 +55,6 @@
55
55
  "default": "./dist/index.mjs"
56
56
  }
57
57
  },
58
- "./*": "./*",
59
58
  "./helpers": {
60
59
  "require": {
61
60
  "types": "./dist/helpers/index.d.cts",
@@ -84,6 +83,7 @@
84
83
  "default": "./dist/helpers/create-operation-id.mjs"
85
84
  }
86
85
  },
86
+ "./package.json": "./package.json",
87
87
  "./types": {
88
88
  "require": {
89
89
  "types": "./dist/types/index.d.cts",
@@ -124,13 +124,13 @@
124
124
  "@stryke/types": "^0.10.52",
125
125
  "defu": "^6.1.4",
126
126
  "jiti": "^2.6.1",
127
- "powerlines": "^0.41.6"
127
+ "powerlines": "^0.41.8"
128
128
  },
129
129
  "devDependencies": {
130
- "@powerlines/plugin-plugin": "^0.12.292",
130
+ "@powerlines/plugin-plugin": "^0.12.294",
131
131
  "@types/node": "^25.4.0"
132
132
  },
133
133
  "publishConfig": { "access": "public" },
134
134
  "types": "./dist/index.d.cts",
135
- "gitHead": "86bbe64da57a38d472b37261ca9d113171841a6c"
135
+ "gitHead": "40d1f94407720be23c3801f9145fdad1fe27dfb2"
136
136
  }