@powerlines/plugin-hey-api 0.1.206 → 0.1.208

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 (51) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/helpers/create-operation-id.cjs +15 -2
  3. package/dist/helpers/create-operation-id.d.cts +11 -2
  4. package/dist/helpers/create-operation-id.d.cts.map +1 -0
  5. package/dist/helpers/create-operation-id.d.mts +11 -2
  6. package/dist/helpers/create-operation-id.d.mts.map +1 -0
  7. package/dist/helpers/create-operation-id.mjs +15 -2
  8. package/dist/helpers/create-operation-id.mjs.map +1 -0
  9. package/dist/helpers/index.cjs +2 -3
  10. package/dist/helpers/index.d.cts +1 -2
  11. package/dist/helpers/index.d.mts +1 -2
  12. package/dist/helpers/index.mjs +1 -2
  13. package/dist/index.cjs +6 -35
  14. package/dist/index.d.cts +3 -4
  15. package/dist/index.d.cts.map +1 -1
  16. package/dist/index.d.mts +3 -4
  17. package/dist/index.d.mts.map +1 -1
  18. package/dist/index.mjs +2 -4
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/types/index.cjs +0 -2
  21. package/dist/types/index.d.cts +1 -2
  22. package/dist/types/index.d.mts +1 -2
  23. package/dist/types/index.mjs +0 -3
  24. package/dist/types/plugin.cjs +0 -1
  25. package/dist/types/plugin.d.cts +49 -2
  26. package/dist/types/plugin.d.cts.map +1 -0
  27. package/dist/types/plugin.d.mts +49 -2
  28. package/dist/types/plugin.d.mts.map +1 -0
  29. package/dist/types/plugin.mjs +0 -2
  30. package/package.json +8 -8
  31. package/dist/create-operation-id-CdT_cWku.mjs +0 -16
  32. package/dist/create-operation-id-CdT_cWku.mjs.map +0 -1
  33. package/dist/create-operation-id-Cw-sRmUe.cjs +0 -21
  34. package/dist/create-operation-id-DDMlsM4b.d.cts +0 -11
  35. package/dist/create-operation-id-DDMlsM4b.d.cts.map +0 -1
  36. package/dist/create-operation-id-_82tqUNg.d.mts +0 -11
  37. package/dist/create-operation-id-_82tqUNg.d.mts.map +0 -1
  38. package/dist/helpers-B15z10jN.mjs +0 -1
  39. package/dist/helpers-LF26RHol.cjs +0 -0
  40. package/dist/index-9iG2qHLe.d.mts +0 -1
  41. package/dist/index-D-CYNcT9.d.mts +0 -1
  42. package/dist/index-D4ELpJXS.d.cts +0 -1
  43. package/dist/index-DLoAMD9J.d.cts +0 -1
  44. package/dist/plugin-CtyxP8Qk.d.mts +0 -49
  45. package/dist/plugin-CtyxP8Qk.d.mts.map +0 -1
  46. package/dist/plugin-DbwOBxik.d.cts +0 -49
  47. package/dist/plugin-DbwOBxik.d.cts.map +0 -1
  48. package/dist/plugin-ifZVa20V.mjs +0 -1
  49. package/dist/plugin-pBKbb5K9.cjs +0 -0
  50. package/dist/types-U3zd8PTP.mjs +0 -1
  51. package/dist/types-o3zWarRp.cjs +0 -0
@@ -0,0 +1,29 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -1,3 +1,16 @@
1
- const require_create_operation_id = require('../create-operation-id-Cw-sRmUe.cjs');
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
2
3
 
3
- exports.createOperationId = require_create_operation_id.createOperationId;
4
+ //#region src/helpers/create-operation-id.ts
5
+ /**
6
+ * Create an Operation Id from a summary string
7
+ *
8
+ * @param summary - The summary string from the specification
9
+ * @returns The generated operation ID
10
+ */
11
+ 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
+ }
14
+
15
+ //#endregion
16
+ exports.createOperationId = createOperationId;
@@ -1,2 +1,11 @@
1
- import { t as createOperationId } from "../create-operation-id-DDMlsM4b.cjs";
2
- export { createOperationId };
1
+ //#region src/helpers/create-operation-id.d.ts
2
+ /**
3
+ * Create an Operation Id from a summary string
4
+ *
5
+ * @param summary - The summary string from the specification
6
+ * @returns The generated operation ID
7
+ */
8
+ declare function createOperationId(summary: string): string;
9
+ //#endregion
10
+ export { createOperationId };
11
+ //# sourceMappingURL=create-operation-id.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-operation-id.d.cts","names":[],"sources":["../../src/helpers/create-operation-id.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA"}
@@ -1,2 +1,11 @@
1
- import { t as createOperationId } from "../create-operation-id-_82tqUNg.mjs";
2
- export { createOperationId };
1
+ //#region src/helpers/create-operation-id.d.ts
2
+ /**
3
+ * Create an Operation Id from a summary string
4
+ *
5
+ * @param summary - The summary string from the specification
6
+ * @returns The generated operation ID
7
+ */
8
+ declare function createOperationId(summary: string): string;
9
+ //#endregion
10
+ export { createOperationId };
11
+ //# sourceMappingURL=create-operation-id.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-operation-id.d.mts","names":[],"sources":["../../src/helpers/create-operation-id.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA"}
@@ -1,3 +1,16 @@
1
- import { t as createOperationId } from "../create-operation-id-CdT_cWku.mjs";
1
+ import { camelCase } from "@stryke/string-format/camel-case";
2
2
 
3
- export { createOperationId };
3
+ //#region src/helpers/create-operation-id.ts
4
+ /**
5
+ * Create an Operation Id from a summary string
6
+ *
7
+ * @param summary - The summary string from the specification
8
+ * @returns The generated operation ID
9
+ */
10
+ function createOperationId(summary) {
11
+ return camelCase(summary.replace(/\b(?:a|from|to|the|given|of|an)\b/gi, "").replace("Get list", "list"));
12
+ }
13
+
14
+ //#endregion
15
+ export { createOperationId };
16
+ //# sourceMappingURL=create-operation-id.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-operation-id.mjs","names":[],"sources":["../../src/helpers/create-operation-id.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 { camelCase } from \"@stryke/string-format/camel-case\";\n\n/**\n * Create an Operation Id from a summary string\n *\n * @param summary - The summary string from the specification\n * @returns The generated operation ID\n */\nexport function createOperationId(summary: string) {\n return camelCase(\n summary\n .replace(/\\b(?:a|from|to|the|given|of|an)\\b/gi, \"\")\n .replace(\"Get list\", \"list\")\n );\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgB,kBAAkB,SAAiB;AACjD,QAAO,UACL,QACG,QAAQ,uCAAuC,GAAG,CAClD,QAAQ,YAAY,OAAO,CAC/B"}
@@ -1,4 +1,3 @@
1
- const require_create_operation_id = require('../create-operation-id-Cw-sRmUe.cjs');
2
- require('../helpers-LF26RHol.cjs');
1
+ const require_helpers_create_operation_id = require('./create-operation-id.cjs');
3
2
 
4
- exports.createOperationId = require_create_operation_id.createOperationId;
3
+ exports.createOperationId = require_helpers_create_operation_id.createOperationId;
@@ -1,3 +1,2 @@
1
- import { t as createOperationId } from "../create-operation-id-DDMlsM4b.cjs";
2
- import "../index-DLoAMD9J.cjs";
1
+ import { createOperationId } from "./create-operation-id.cjs";
3
2
  export { createOperationId };
@@ -1,3 +1,2 @@
1
- import { t as createOperationId } from "../create-operation-id-_82tqUNg.mjs";
2
- import "../index-D-CYNcT9.mjs";
1
+ import { createOperationId } from "./create-operation-id.mjs";
3
2
  export { createOperationId };
@@ -1,4 +1,3 @@
1
- import { t as createOperationId } from "../create-operation-id-CdT_cWku.mjs";
2
- import "../helpers-B15z10jN.mjs";
1
+ import { createOperationId } from "./create-operation-id.mjs";
3
2
 
4
3
  export { createOperationId };
package/dist/index.cjs CHANGED
@@ -1,41 +1,13 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- //#region rolldown:runtime
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
- key = keys[i];
13
- if (!__hasOwnProp.call(to, key) && key !== except) {
14
- __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- }
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
-
28
- //#endregion
29
- const require_create_operation_id = require('./create-operation-id-Cw-sRmUe.cjs');
30
- require('./helpers-LF26RHol.cjs');
31
- require('./plugin-pBKbb5K9.cjs');
32
- require('./types-o3zWarRp.cjs');
2
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
+ const require_helpers_create_operation_id = require('./helpers/create-operation-id.cjs');
4
+ require('./helpers/index.cjs');
33
5
  let __hey_api_openapi_ts = require("@hey-api/openapi-ts");
34
6
  let __stryke_path_join_paths = require("@stryke/path/join-paths");
35
7
  let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
36
8
  let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
37
9
  let defu = require("defu");
38
- defu = __toESM(defu);
10
+ defu = require_rolldown_runtime.__toESM(defu);
39
11
  let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
40
12
 
41
13
  //#region src/index.ts
@@ -99,7 +71,7 @@ const plugin = (options = {}) => {
99
71
  ]) {
100
72
  const operation = pathItem[method];
101
73
  if (!(0, __stryke_type_checks_is_set_string.isSetString)(operation?.summary)) continue;
102
- operation.operationId = require_create_operation_id.createOperationId(operation.summary);
74
+ operation.operationId = require_helpers_create_operation_id.createOperationId(operation.summary);
103
75
  }
104
76
  }
105
77
  }
@@ -115,7 +87,6 @@ const plugin = (options = {}) => {
115
87
  var src_default = plugin;
116
88
 
117
89
  //#endregion
118
- exports.__toESM = __toESM;
119
- exports.createOperationId = require_create_operation_id.createOperationId;
90
+ exports.createOperationId = require_helpers_create_operation_id.createOperationId;
120
91
  exports.default = src_default;
121
92
  exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,6 @@
1
- import { t as createOperationId } from "./create-operation-id-DDMlsM4b.cjs";
2
- import "./index-DLoAMD9J.cjs";
3
- import { a as HeyAPIPluginUserConfig, c as __ΩHeyAPIPluginOutputOptions, i as HeyAPIPluginResolvedConfig, l as __ΩHeyAPIPluginResolvedConfig, n as HeyAPIPluginOptions, o as __ΩHeyAPIPluginContext, r as HeyAPIPluginOutputOptions, s as __ΩHeyAPIPluginOptions, t as HeyAPIPluginContext, u as __ΩHeyAPIPluginUserConfig } from "./plugin-DbwOBxik.cjs";
4
- import "./index-D4ELpJXS.cjs";
1
+ import { createOperationId } from "./helpers/create-operation-id.cjs";
2
+ import { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig } from "./types/plugin.cjs";
3
+ import "./types/index.cjs";
5
4
  import { Plugin } from "powerlines/types/plugin";
6
5
 
7
6
  //#region src/index.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AA6CA;;;;;AAIG,cAJU,MAIV,EAAA,CAAA,iBAHgB,mBAGhB,GAHsC,mBAGtC,CAAA,CAAA,OAAA,CAAA,EADQ,mBACR,EAAA,GAAA,MAAA,CAAO,QAAP,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AA6CA;;;;;;AAIS,cAJI,MAIJ,EAAA,CAAA,iBAHU,mBAGV,GAHgC,mBAGhC,CAAA,CAAA,OAAA,CAAA,EADE,mBACF,EAAA,GAAN,MAAM,CAAC,QAAD,CAAA"}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
- import { t as createOperationId } from "./create-operation-id-_82tqUNg.mjs";
2
- import "./index-D-CYNcT9.mjs";
3
- import { a as HeyAPIPluginUserConfig, c as __ΩHeyAPIPluginOutputOptions, i as HeyAPIPluginResolvedConfig, l as __ΩHeyAPIPluginResolvedConfig, n as HeyAPIPluginOptions, o as __ΩHeyAPIPluginContext, r as HeyAPIPluginOutputOptions, s as __ΩHeyAPIPluginOptions, t as HeyAPIPluginContext, u as __ΩHeyAPIPluginUserConfig } from "./plugin-CtyxP8Qk.mjs";
4
- import "./index-9iG2qHLe.mjs";
1
+ import { createOperationId } from "./helpers/create-operation-id.mjs";
2
+ import { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig } from "./types/plugin.mjs";
3
+ import "./types/index.mjs";
5
4
  import { Plugin } from "powerlines/types/plugin";
6
5
 
7
6
  //#region src/index.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AA6CA;;;;;AAIG,cAJU,MAIV,EAAA,CAAA,iBAHgB,mBAGhB,GAHsC,mBAGtC,CAAA,CAAA,OAAA,CAAA,EADQ,mBACR,EAAA,GAAA,MAAA,CAAO,QAAP,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AA6CA;;;;;;AAIS,cAJI,MAIJ,EAAA,CAAA,iBAHU,mBAGV,GAHgC,mBAGhC,CAAA,CAAA,OAAA,CAAA,EADE,mBACF,EAAA,GAAN,MAAM,CAAC,QAAD,CAAA"}
package/dist/index.mjs CHANGED
@@ -1,7 +1,5 @@
1
- import { t as createOperationId } from "./create-operation-id-CdT_cWku.mjs";
2
- import "./helpers-B15z10jN.mjs";
3
- import "./plugin-ifZVa20V.mjs";
4
- import "./types-U3zd8PTP.mjs";
1
+ import { createOperationId } from "./helpers/create-operation-id.mjs";
2
+ import "./helpers/index.mjs";
5
3
  import { createClient } from "@hey-api/openapi-ts";
6
4
  import { joinPaths } from "@stryke/path/join-paths";
7
5
  import { isSetObject } from "@stryke/type-checks/is-set-object";
@@ -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 { replacePathTokens } from \"powerlines/plugin-utils/paths\";\nimport { Plugin } from \"powerlines/types/plugin\";\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\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.projectRoot,\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 = (await result.json()) as OpenApi.V3_0_X;\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":";;;;;;;;;;;;;;;;;;;;AA6CA,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,aACZ,cACD;KACD,QAAQ,EACN,MAAM,UAAU,iBAAiB,MAAM,EACxC;KACD,MAAM,KAAK,SAAS;KACrB,CAAC;IACH,EACF;;EAEH,MAAM,iBAAiB;AACrB,QAAK,OAAO,OAAO,WAAW,EAAE;AAChC,QAAK,OAAO,OAAO,OAAO,OAAO,kBAC/B,MACA,KAAK,OAAO,OAAO,OAAO,KAC3B;AAED,OAAI,CAAC,KAAK,OAAO,OAAO,OACtB,OAAM,IAAI,MACR,yDACD;AAGH,OAAI,YAAY,KAAK,OAAO,OAAO,OAAO,EAAE;IAC1C,MAAM,SAAS,MAAM,KAAK,MAAM,KAAK,OAAO,OAAO,OAAO;AAC1D,SAAK,OAAO,OAAO,SAAU,MAAM,OAAO,MAAM;;AAGlD,OACE,YAAY,KAAK,OAAO,OAAO,OAAO,IACrC,KAAK,OAAO,OAAO,OAA0B,OAC9C;IACA,MAAM,SAAS,KAAK,OAAO,OAAO;AAClC,SAAK,MAAM,YAAY,OAAO,OAAO,OAAO,MAAM,EAAE;AAClD,SAAI,CAAC,YAAY,UAAU,SACzB;AAGF,UAAK,MAAM,UAAU;MACnB;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACD,EAAW;MACV,MAAM,YAAY,SAAS;AAC3B,UAAI,CAAC,YAAY,WAAW,QAAQ,CAClC;AAGF,gBAAU,cAAc,kBAAkB,UAAU,QAAQ;;;;;EAKpE,MAAM,UAAU;AACd,SAAM,aAAa;IACjB,GAAG,KAAK,OAAO;IACf,OAAO,KAAK,OAAO,OAAO;IAC3B,CAAe;;EAEnB;;AAGH,kBAAe"}
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 { replacePathTokens } from \"powerlines/plugin-utils/paths\";\nimport { Plugin } from \"powerlines/types/plugin\";\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\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.projectRoot,\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 = (await result.json()) as OpenApi.V3_0_X;\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":";;;;;;;;;;;;;;;;;;AA6CA,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,aACZ,cACD;KACD,QAAQ,EACN,MAAM,UAAU,iBAAiB,MAAM,EACxC;KACD,MAAM,KAAK,SAAS;KACrB,CAAC;IACH,EACF;;EAEH,MAAM,iBAAiB;AACrB,QAAK,OAAO,OAAO,WAAW,EAAE;AAChC,QAAK,OAAO,OAAO,OAAO,OAAO,kBAC/B,MACA,KAAK,OAAO,OAAO,OAAO,KAC3B;AAED,OAAI,CAAC,KAAK,OAAO,OAAO,OACtB,OAAM,IAAI,MACR,yDACD;AAGH,OAAI,YAAY,KAAK,OAAO,OAAO,OAAO,EAAE;IAC1C,MAAM,SAAS,MAAM,KAAK,MAAM,KAAK,OAAO,OAAO,OAAO;AAC1D,SAAK,OAAO,OAAO,SAAU,MAAM,OAAO,MAAM;;AAGlD,OACE,YAAY,KAAK,OAAO,OAAO,OAAO,IACrC,KAAK,OAAO,OAAO,OAA0B,OAC9C;IACA,MAAM,SAAS,KAAK,OAAO,OAAO;AAClC,SAAK,MAAM,YAAY,OAAO,OAAO,OAAO,MAAM,EAAE;AAClD,SAAI,CAAC,YAAY,UAAU,SACzB;AAGF,UAAK,MAAM,UAAU;MACnB;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACD,EAAW;MACV,MAAM,YAAY,SAAS;AAC3B,UAAI,CAAC,YAAY,WAAW,QAAQ,CAClC;AAGF,gBAAU,cAAc,kBAAkB,UAAU,QAAQ;;;;;EAKpE,MAAM,UAAU;AACd,SAAM,aAAa;IACjB,GAAG,KAAK,OAAO;IACf,OAAO,KAAK,OAAO,OAAO;IAC3B,CAAe;;EAEnB;;AAGH,kBAAe"}
@@ -1,2 +0,0 @@
1
- require('../plugin-pBKbb5K9.cjs');
2
- require('../types-o3zWarRp.cjs');
@@ -1,3 +1,2 @@
1
- import { a as HeyAPIPluginUserConfig, c as __ΩHeyAPIPluginOutputOptions, i as HeyAPIPluginResolvedConfig, l as __ΩHeyAPIPluginResolvedConfig, n as HeyAPIPluginOptions, o as __ΩHeyAPIPluginContext, r as HeyAPIPluginOutputOptions, s as __ΩHeyAPIPluginOptions, t as HeyAPIPluginContext, u as __ΩHeyAPIPluginUserConfig } from "../plugin-DbwOBxik.cjs";
2
- import "../index-D4ELpJXS.cjs";
1
+ import { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig } from "./plugin.cjs";
3
2
  export { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig };
@@ -1,3 +1,2 @@
1
- import { a as HeyAPIPluginUserConfig, c as __ΩHeyAPIPluginOutputOptions, i as HeyAPIPluginResolvedConfig, l as __ΩHeyAPIPluginResolvedConfig, n as HeyAPIPluginOptions, o as __ΩHeyAPIPluginContext, r as HeyAPIPluginOutputOptions, s as __ΩHeyAPIPluginOptions, t as HeyAPIPluginContext, u as __ΩHeyAPIPluginUserConfig } from "../plugin-CtyxP8Qk.mjs";
2
- import "../index-9iG2qHLe.mjs";
1
+ import { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig } from "./plugin.mjs";
3
2
  export { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig };
@@ -1,4 +1 @@
1
- import "../plugin-ifZVa20V.mjs";
2
- import "../types-U3zd8PTP.mjs";
3
-
4
1
  export { };
@@ -1 +0,0 @@
1
- require('../plugin-pBKbb5K9.cjs');
@@ -1,2 +1,49 @@
1
- import { a as HeyAPIPluginUserConfig, c as __ΩHeyAPIPluginOutputOptions, i as HeyAPIPluginResolvedConfig, l as __ΩHeyAPIPluginResolvedConfig, n as HeyAPIPluginOptions, o as __ΩHeyAPIPluginContext, r as HeyAPIPluginOutputOptions, s as __ΩHeyAPIPluginOptions, t as HeyAPIPluginContext, u as __ΩHeyAPIPluginUserConfig } from "../plugin-DbwOBxik.cjs";
2
- export { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig };
1
+ import { OpenApi, UserConfig } from "@hey-api/openapi-ts";
2
+ import { UserConfig as UserConfig$1 } from "powerlines/types/config";
3
+ import { PluginContext } from "powerlines/types/context";
4
+ import { ResolvedConfig } from "powerlines/types/resolved";
5
+
6
+ //#region src/types/plugin.d.ts
7
+ type HeyAPIPluginOutputOptions = UserConfig["output"] & {
8
+ /**
9
+ * The path to the output file generated by the plugin.
10
+ *
11
+ * @remarks
12
+ * If using the default value, the file can be imported from "powerlines:api". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
13
+ *
14
+ * @defaultValue "\{builtinPath\}/api"
15
+ */
16
+ path?: string;
17
+ };
18
+ type HeyAPIPluginOptions = Omit<UserConfig, "input" | "output"> & {
19
+ /**
20
+ * The path to the Hey API schema file.
21
+ *
22
+ * @remarks
23
+ * This can be a string path, URL, HeyAPI3 object, Buffer, or Readable stream.
24
+ *
25
+ * @defaultValue "\{projectRoot\}/schema.yaml"
26
+ */
27
+ schema?: UserConfig["input"];
28
+ /**
29
+ * The output details of the Hey API generation
30
+ */
31
+ output?: HeyAPIPluginOutputOptions;
32
+ };
33
+ type HeyAPIPluginUserConfig = UserConfig$1 & {
34
+ heyApi?: HeyAPIPluginOptions;
35
+ };
36
+ type HeyAPIPluginResolvedConfig = ResolvedConfig & {
37
+ heyApi: Omit<HeyAPIPluginOptions, "schema"> & {
38
+ schema: HeyAPIPluginOptions["schema"] | OpenApi.V3_0_X;
39
+ };
40
+ };
41
+ type HeyAPIPluginContext<TResolvedConfig extends HeyAPIPluginResolvedConfig = HeyAPIPluginResolvedConfig> = PluginContext<TResolvedConfig>;
42
+ declare type __ΩHeyAPIPluginOutputOptions = any[];
43
+ declare type __ΩHeyAPIPluginOptions = any[];
44
+ declare type __ΩHeyAPIPluginUserConfig = any[];
45
+ declare type __ΩHeyAPIPluginResolvedConfig = any[];
46
+ declare type __ΩHeyAPIPluginContext = any[];
47
+ //#endregion
48
+ export { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig };
49
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAwBY,yBAAA,GAA4B;EAA5B;AAYZ;;;;;;AAiBA;EAIY,IAAA,CAAA,EAAA,MAAA;CAA6B;AAC1B,KAtBH,mBAAA,GAAsB,IAsBnB,CAtBwB,UAsBxB,EAAA,OAAA,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,2 +1,49 @@
1
- import { a as HeyAPIPluginUserConfig, c as __ΩHeyAPIPluginOutputOptions, i as HeyAPIPluginResolvedConfig, l as __ΩHeyAPIPluginResolvedConfig, n as HeyAPIPluginOptions, o as __ΩHeyAPIPluginContext, r as HeyAPIPluginOutputOptions, s as __ΩHeyAPIPluginOptions, t as HeyAPIPluginContext, u as __ΩHeyAPIPluginUserConfig } from "../plugin-CtyxP8Qk.mjs";
2
- export { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig };
1
+ import { OpenApi, UserConfig } from "@hey-api/openapi-ts";
2
+ import { UserConfig as UserConfig$1 } from "powerlines/types/config";
3
+ import { PluginContext } from "powerlines/types/context";
4
+ import { ResolvedConfig } from "powerlines/types/resolved";
5
+
6
+ //#region src/types/plugin.d.ts
7
+ type HeyAPIPluginOutputOptions = UserConfig["output"] & {
8
+ /**
9
+ * The path to the output file generated by the plugin.
10
+ *
11
+ * @remarks
12
+ * If using the default value, the file can be imported from "powerlines:api". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
13
+ *
14
+ * @defaultValue "\{builtinPath\}/api"
15
+ */
16
+ path?: string;
17
+ };
18
+ type HeyAPIPluginOptions = Omit<UserConfig, "input" | "output"> & {
19
+ /**
20
+ * The path to the Hey API schema file.
21
+ *
22
+ * @remarks
23
+ * This can be a string path, URL, HeyAPI3 object, Buffer, or Readable stream.
24
+ *
25
+ * @defaultValue "\{projectRoot\}/schema.yaml"
26
+ */
27
+ schema?: UserConfig["input"];
28
+ /**
29
+ * The output details of the Hey API generation
30
+ */
31
+ output?: HeyAPIPluginOutputOptions;
32
+ };
33
+ type HeyAPIPluginUserConfig = UserConfig$1 & {
34
+ heyApi?: HeyAPIPluginOptions;
35
+ };
36
+ type HeyAPIPluginResolvedConfig = ResolvedConfig & {
37
+ heyApi: Omit<HeyAPIPluginOptions, "schema"> & {
38
+ schema: HeyAPIPluginOptions["schema"] | OpenApi.V3_0_X;
39
+ };
40
+ };
41
+ type HeyAPIPluginContext<TResolvedConfig extends HeyAPIPluginResolvedConfig = HeyAPIPluginResolvedConfig> = PluginContext<TResolvedConfig>;
42
+ declare type __ΩHeyAPIPluginOutputOptions = any[];
43
+ declare type __ΩHeyAPIPluginOptions = any[];
44
+ declare type __ΩHeyAPIPluginUserConfig = any[];
45
+ declare type __ΩHeyAPIPluginResolvedConfig = any[];
46
+ declare type __ΩHeyAPIPluginContext = any[];
47
+ //#endregion
48
+ export { HeyAPIPluginContext, HeyAPIPluginOptions, HeyAPIPluginOutputOptions, HeyAPIPluginResolvedConfig, HeyAPIPluginUserConfig, __ΩHeyAPIPluginContext, __ΩHeyAPIPluginOptions, __ΩHeyAPIPluginOutputOptions, __ΩHeyAPIPluginResolvedConfig, __ΩHeyAPIPluginUserConfig };
49
+ //# sourceMappingURL=plugin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAwBY,yBAAA,GAA4B;EAA5B;AAYZ;;;;;;AAiBA;EAIY,IAAA,CAAA,EAAA,MAAA;CAA6B;AAC1B,KAtBH,mBAAA,GAAsB,IAsBnB,CAtBwB,UAsBxB,EAAA,OAAA,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,3 +1 @@
1
- import "../plugin-ifZVa20V.mjs";
2
-
3
1
  export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-hey-api",
3
- "version": "0.1.206",
3
+ "version": "0.1.208",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code using Hey API.",
6
6
  "repository": {
@@ -118,19 +118,19 @@
118
118
  "keywords": ["hey-api", "powerlines", "storm-software", "powerlines-plugin"],
119
119
  "dependencies": {
120
120
  "@hey-api/openapi-ts": "^0.88.2",
121
- "@stryke/path": "^0.26.3",
122
- "@stryke/string-format": "^0.13.6",
123
- "@stryke/type-checks": "^0.5.22",
124
- "@stryke/types": "^0.10.36",
121
+ "@stryke/path": "^0.26.4",
122
+ "@stryke/string-format": "^0.13.7",
123
+ "@stryke/type-checks": "^0.5.23",
124
+ "@stryke/types": "^0.10.37",
125
125
  "defu": "^6.1.4",
126
126
  "jiti": "^2.6.1",
127
- "powerlines": "^0.38.19"
127
+ "powerlines": "^0.38.21"
128
128
  },
129
129
  "devDependencies": {
130
- "@powerlines/plugin-plugin": "^0.12.203",
130
+ "@powerlines/plugin-plugin": "^0.12.205",
131
131
  "@types/node": "^24.10.9"
132
132
  },
133
133
  "publishConfig": { "access": "public" },
134
134
  "types": "./dist/index.d.cts",
135
- "gitHead": "ed4d8044dcb6e1de7843b3908424bb0a7e636620"
135
+ "gitHead": "6000a15bf3fbc1b7eaaf967088c68eef9949786a"
136
136
  }
@@ -1,16 +0,0 @@
1
- import { camelCase } from "@stryke/string-format/camel-case";
2
-
3
- //#region src/helpers/create-operation-id.ts
4
- /**
5
- * Create an Operation Id from a summary string
6
- *
7
- * @param summary - The summary string from the specification
8
- * @returns The generated operation ID
9
- */
10
- function createOperationId(summary) {
11
- return camelCase(summary.replace(/\b(?:a|from|to|the|given|of|an)\b/gi, "").replace("Get list", "list"));
12
- }
13
-
14
- //#endregion
15
- export { createOperationId as t };
16
- //# sourceMappingURL=create-operation-id-CdT_cWku.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-operation-id-CdT_cWku.mjs","names":[],"sources":["../src/helpers/create-operation-id.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 { camelCase } from \"@stryke/string-format/camel-case\";\n\n/**\n * Create an Operation Id from a summary string\n *\n * @param summary - The summary string from the specification\n * @returns The generated operation ID\n */\nexport function createOperationId(summary: string) {\n return camelCase(\n summary\n .replace(/\\b(?:a|from|to|the|given|of|an)\\b/gi, \"\")\n .replace(\"Get list\", \"list\")\n );\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgB,kBAAkB,SAAiB;AACjD,QAAO,UACL,QACG,QAAQ,uCAAuC,GAAG,CAClD,QAAQ,YAAY,OAAO,CAC/B"}
@@ -1,21 +0,0 @@
1
- const require_index = require('./index.cjs');
2
- let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
3
-
4
- //#region src/helpers/create-operation-id.ts
5
- /**
6
- * Create an Operation Id from a summary string
7
- *
8
- * @param summary - The summary string from the specification
9
- * @returns The generated operation ID
10
- */
11
- 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
- }
14
-
15
- //#endregion
16
- Object.defineProperty(exports, 'createOperationId', {
17
- enumerable: true,
18
- get: function () {
19
- return createOperationId;
20
- }
21
- });
@@ -1,11 +0,0 @@
1
- //#region src/helpers/create-operation-id.d.ts
2
- /**
3
- * Create an Operation Id from a summary string
4
- *
5
- * @param summary - The summary string from the specification
6
- * @returns The generated operation ID
7
- */
8
- declare function createOperationId(summary: string): string;
9
- //#endregion
10
- export { createOperationId as t };
11
- //# sourceMappingURL=create-operation-id-DDMlsM4b.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-operation-id-DDMlsM4b.d.cts","names":[],"sources":["../src/helpers/create-operation-id.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA"}
@@ -1,11 +0,0 @@
1
- //#region src/helpers/create-operation-id.d.ts
2
- /**
3
- * Create an Operation Id from a summary string
4
- *
5
- * @param summary - The summary string from the specification
6
- * @returns The generated operation ID
7
- */
8
- declare function createOperationId(summary: string): string;
9
- //#endregion
10
- export { createOperationId as t };
11
- //# sourceMappingURL=create-operation-id-_82tqUNg.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-operation-id-_82tqUNg.d.mts","names":[],"sources":["../src/helpers/create-operation-id.ts"],"sourcesContent":[],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA"}
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1,49 +0,0 @@
1
- import { OpenApi, UserConfig } from "@hey-api/openapi-ts";
2
- import { UserConfig as UserConfig$1 } from "powerlines/types/config";
3
- import { PluginContext } from "powerlines/types/context";
4
- import { ResolvedConfig } from "powerlines/types/resolved";
5
-
6
- //#region src/types/plugin.d.ts
7
- type HeyAPIPluginOutputOptions = UserConfig["output"] & {
8
- /**
9
- * The path to the output file generated by the plugin.
10
- *
11
- * @remarks
12
- * If using the default value, the file can be imported from "powerlines:api". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
13
- *
14
- * @defaultValue "\{builtinPath\}/api"
15
- */
16
- path?: string;
17
- };
18
- type HeyAPIPluginOptions = Omit<UserConfig, "input" | "output"> & {
19
- /**
20
- * The path to the Hey API schema file.
21
- *
22
- * @remarks
23
- * This can be a string path, URL, HeyAPI3 object, Buffer, or Readable stream.
24
- *
25
- * @defaultValue "\{projectRoot\}/schema.yaml"
26
- */
27
- schema?: UserConfig["input"];
28
- /**
29
- * The output details of the Hey API generation
30
- */
31
- output?: HeyAPIPluginOutputOptions;
32
- };
33
- type HeyAPIPluginUserConfig = UserConfig$1 & {
34
- heyApi?: HeyAPIPluginOptions;
35
- };
36
- type HeyAPIPluginResolvedConfig = ResolvedConfig & {
37
- heyApi: Omit<HeyAPIPluginOptions, "schema"> & {
38
- schema: HeyAPIPluginOptions["schema"] | OpenApi.V3_0_X;
39
- };
40
- };
41
- type HeyAPIPluginContext<TResolvedConfig extends HeyAPIPluginResolvedConfig = HeyAPIPluginResolvedConfig> = PluginContext<TResolvedConfig>;
42
- declare type __ΩHeyAPIPluginOutputOptions = any[];
43
- declare type __ΩHeyAPIPluginOptions = any[];
44
- declare type __ΩHeyAPIPluginUserConfig = any[];
45
- declare type __ΩHeyAPIPluginResolvedConfig = any[];
46
- declare type __ΩHeyAPIPluginContext = any[];
47
- //#endregion
48
- export { HeyAPIPluginUserConfig as a, __ΩHeyAPIPluginOutputOptions as c, HeyAPIPluginResolvedConfig as i, __ΩHeyAPIPluginResolvedConfig as l, HeyAPIPluginOptions as n, __ΩHeyAPIPluginContext as o, HeyAPIPluginOutputOptions as r, __ΩHeyAPIPluginOptions as s, HeyAPIPluginContext as t, __ΩHeyAPIPluginUserConfig as u };
49
- //# sourceMappingURL=plugin-CtyxP8Qk.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-CtyxP8Qk.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAwBY,yBAAA,GAA4B;EAA5B;AAYZ;;;;;;AAiBA;EAIY,IAAA,CAAA,EAAA,MAAA;CAA6B;AAC1B,KAtBH,mBAAA,GAAsB,IAsBnB,CAtBwB,UAsBxB,EAAA,OAAA,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,49 +0,0 @@
1
- import { OpenApi, UserConfig } from "@hey-api/openapi-ts";
2
- import { UserConfig as UserConfig$1 } from "powerlines/types/config";
3
- import { PluginContext } from "powerlines/types/context";
4
- import { ResolvedConfig } from "powerlines/types/resolved";
5
-
6
- //#region src/types/plugin.d.ts
7
- type HeyAPIPluginOutputOptions = UserConfig["output"] & {
8
- /**
9
- * The path to the output file generated by the plugin.
10
- *
11
- * @remarks
12
- * If using the default value, the file can be imported from "powerlines:api". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
13
- *
14
- * @defaultValue "\{builtinPath\}/api"
15
- */
16
- path?: string;
17
- };
18
- type HeyAPIPluginOptions = Omit<UserConfig, "input" | "output"> & {
19
- /**
20
- * The path to the Hey API schema file.
21
- *
22
- * @remarks
23
- * This can be a string path, URL, HeyAPI3 object, Buffer, or Readable stream.
24
- *
25
- * @defaultValue "\{projectRoot\}/schema.yaml"
26
- */
27
- schema?: UserConfig["input"];
28
- /**
29
- * The output details of the Hey API generation
30
- */
31
- output?: HeyAPIPluginOutputOptions;
32
- };
33
- type HeyAPIPluginUserConfig = UserConfig$1 & {
34
- heyApi?: HeyAPIPluginOptions;
35
- };
36
- type HeyAPIPluginResolvedConfig = ResolvedConfig & {
37
- heyApi: Omit<HeyAPIPluginOptions, "schema"> & {
38
- schema: HeyAPIPluginOptions["schema"] | OpenApi.V3_0_X;
39
- };
40
- };
41
- type HeyAPIPluginContext<TResolvedConfig extends HeyAPIPluginResolvedConfig = HeyAPIPluginResolvedConfig> = PluginContext<TResolvedConfig>;
42
- declare type __ΩHeyAPIPluginOutputOptions = any[];
43
- declare type __ΩHeyAPIPluginOptions = any[];
44
- declare type __ΩHeyAPIPluginUserConfig = any[];
45
- declare type __ΩHeyAPIPluginResolvedConfig = any[];
46
- declare type __ΩHeyAPIPluginContext = any[];
47
- //#endregion
48
- export { HeyAPIPluginUserConfig as a, __ΩHeyAPIPluginOutputOptions as c, HeyAPIPluginResolvedConfig as i, __ΩHeyAPIPluginResolvedConfig as l, HeyAPIPluginOptions as n, __ΩHeyAPIPluginContext as o, HeyAPIPluginOutputOptions as r, __ΩHeyAPIPluginOptions as s, HeyAPIPluginContext as t, __ΩHeyAPIPluginUserConfig as u };
49
- //# sourceMappingURL=plugin-DbwOBxik.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-DbwOBxik.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAwBY,yBAAA,GAA4B;EAA5B;AAYZ;;;;;;AAiBA;EAIY,IAAA,CAAA,EAAA,MAAA;CAA6B;AAC1B,KAtBH,mBAAA,GAAsB,IAsBnB,CAtBwB,UAsBxB,EAAA,OAAA,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 +0,0 @@
1
- export { };
File without changes
@@ -1 +0,0 @@
1
- export { };
File without changes