@acrool/rtk-query-codegen-openapi 1.4.0-alpha.1 → 1.4.0-alpha.2

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/lib/bin/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var W=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ee=Object.prototype.hasOwnProperty;var H=(n,e)=>()=>(n&&(e=n(n=0)),e);var De=(n,e)=>{for(var t in e)W(n,t,{get:e[t],enumerable:!0})},Fe=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ne(e))!Ee.call(n,o)&&o!==t&&W(n,o,{get:()=>e[o],enumerable:!(r=we(e,o))||r.enumerable});return n};var Ie=n=>Fe(W({},"__esModule",{value:!0}),n);import{fileURLToPath as je}from"node:url";var qe,g,u=H(()=>{"use strict";qe=()=>je(import.meta.url),g=qe()});var ge={};De(ge,{argumentMatches:()=>Je,defaultIsDataResponse:()=>Ze,getOperationName:()=>G,getOverrides:()=>_,getTags:()=>Ye,operationMatches:()=>fe});import{getOperationName as He}from"oazapfts/generate";function Ze(n,e){if(e&&n==="default")return!0;let t=Number(n);return!Number.isNaN(t)&&t>=200&&t<300}function G({verb:n,path:e}){return He(n,e,void 0)}function Ye({verb:n,pathItem:e}){return n?e[n]?.tags||[]:[]}function le(n){let e=Array.isArray(n)?n:[n];return function(r){return n?e.some(o=>typeof o=="string"?o===r:o?.test(r)):!0}}function fe(n){let e=typeof n=="function"?n:le(n);return function(r){if(!n)return!0;let o=G(r);return e(o,r)}}function Je(n){let e=typeof n=="function"?n:le(n);return function(r){if(!n||r.in==="path")return!0;let o=r.name;return e(o,r)}}function _(n,e){return e?.find(t=>fe(t.pattern)(n))}var B=H(()=>{"use strict";u()});u();import U from"commander";import{createRequire as yt}from"node:module";u();import Ge from"commander";import{createRequire as Me}from"node:module";import{resolve as Z}from"node:path";import{existsSync as Q,rmSync as Ke,readdirSync as ke,statSync as Ve,mkdirSync as Ue}from"node:fs";import Y from"node:path";var $=Me(g);function We(n){let e=new Map;if(!Q(n))return e;function t(r){try{let o=ke(r);for(let i of o){let s=Y.join(r,i);if(Ve(s).isDirectory())t(s);else if(i==="enhanceEndpoints.ts"){let c=$("node:fs").readFileSync(s);e.set(s,c)}}}catch{}}return t(n),e}function Qe(n){for(let[e,t]of n)try{let r=Y.dirname(e);Q(r)||Ue(r,{recursive:!0}),$("node:fs").writeFileSync(e,t)}catch(r){console.warn(`Failed to restore ${e}:`,r)}}function J(n){let e=["/","/usr","/etc","/var","/home","/Users",".",".."],t=Z(n);if(e.some(r=>t===Z(r))&&(console.error(`Dangerous path detected: ${t}. Refusing to delete.`),process.exit(1)),Q(n)){console.log(`Cleaning output directory: ${n}`);let r=We(n);Ke(n,{recursive:!0,force:!0}),r.size>0&&(Qe(r),console.log(`Protected ${r.size} enhanceEndpoints.ts file(s) from deletion`)),console.log(`Directory cleaned: ${n}`)}}function X(){try{if($.resolve("esbuild")&&$.resolve("esbuild-runner"))return $("esbuild-runner/register"),!0}catch{}try{if($.resolve("typescript")&&$.resolve("ts-node"))return $("ts-node").register({transpileOnly:!0,compilerOptions:{target:"es6",module:"commonjs"}}),!0}catch{}return!1}function ee(n){(!n||!/\.([mc]?(jsx?|tsx?)|jsonc?)?$/.test(n))&&(console.error("Please provide a valid configuration file."),Ge.help())}function te(n,e){/\.[mc]?tsx?$/.test(n)&&!e&&(console.error("Encountered a TypeScript config file, but neither esbuild-runner nor ts-node are installed."),process.exit(1))}import{dirname as dt,resolve as ht}from"node:path";u();u();import E from"node:path";import Ae from"typescript";u();u();function F(n){return n.replace(n[0],n[0].toUpperCase())}u();import L from"node:fs";import Le from"node:path";u();function ne(n){try{new URL(n)}catch{return!1}return!0}async function re(n,e){if(!ne(n))throw new Error(`remoteFile must be a valid URL: ${n}`);try{let t=Le.dirname(e);L.existsSync(t)||await L.promises.mkdir(t,{recursive:!0});let r=await fetch(n);if(!r.ok)throw new Error(`Failed to download schema from ${n}: ${r.statusText}`);let o=await r.text();return await L.promises.writeFile(e,o,"utf-8"),console.log(`Schema downloaded from ${n} to ${e}`),e}catch(t){throw console.error(`Error downloading schema from ${n}:`,t),t}}u();u();var oe=["get","put","post","delete","options","head","patch","trace"];function ie(n){return Object.entries(n.paths).flatMap(([e,t])=>t?Object.entries(t).filter(r=>oe.includes(r[0])).map(([r,o])=>({path:e,verb:r,pathItem:t,operation:o})):[])}u();import _e from"@apidevtools/swagger-parser";import Be from"swagger2openapi";async function se(n,e){let t=await _e.bundle(n,{resolve:{http:e}});return"openapi"in t&&t.openapi.startsWith("3")?t:(await Be.convertObj(t,{})).openapi}u();function ae(n,e,t,r){return r?r(n,e):t?.type?t.type==="query":n==="get"}var I=class{docCache={};async getDocument(e,t){if(this.docCache[e])return this.docCache[e];let r=await se(e,t);return this.docCache[e]=r,r}async downloadSchema(e,t){return re(e,t)}getPaths(e){return Object.keys(e.paths||{})}clearCache(){this.docCache={}}};u();import pe from"lodash.camelcase";var j=class{groupPaths(e,t){let{groupKeyMatch:r,outputDir:o}=t,i=e.reduce((a,c)=>{let m=r(c),l=m?pe(m):"_common";return a[l]||(a[l]=[]),a[l].push(c),a},{}),s={};for(let[a,c]of Object.entries(i))s[a]={groupKey:a,paths:c,outputPath:`${o}/${a}/query.service.ts`};return s}createGroupFilter(e,t){return(r,o)=>{let i=o.path,s=pe(t.groupKeyMatch(i)||"");return s!==e&&(s||"_common")!==e?!1:t.filterEndpoint?t.filterEndpoint(r,i,e):!0}}};u();import me from"node:fs";import P from"node:path";u();import ze from"node:path";import ce from"node:fs";async function ue(n){let e=ze.dirname(n);ce.existsSync(e)||await ce.promises.mkdir(e,{recursive:!0})}var q=class{async writeFile(e,t){try{let r=P.resolve(process.cwd(),e);return P.basename(r)==="enhanceEndpoints.ts"&&me.existsSync(r)?{path:r,success:!0}:(await ue(r),me.writeFileSync(r,t),{path:r,success:!0})}catch(r){return{path:e,success:!1,error:r}}}async writeFiles(e){let t=[];for(let[r,o]of Object.entries(e)){let i=await this.writeFile(r,o);t.push(i)}return t}async writeGroupFiles(e,t){let r={};return t.types&&(r[P.join(e,"types.ts")]=t.types),t.queryService&&(r[P.join(e,"query.generated.ts")]=t.queryService),t.enhanceEndpoints&&(r[P.join(e,"enhanceEndpoints.ts")]=t.enhanceEndpoints),t.index&&(r[P.join(e,"index.ts")]=t.index),this.writeFiles(r)}async writeSharedFiles(e,t){let r={};return t.commonTypes&&(r[P.join(e,"common-types.ts")]=t.commonTypes),t.doNotModify&&(r[P.join(e,"DO_NOT_MODIFY.md")]=t.doNotModify),t.utils&&(r[P.join(e,"utils.ts")]=t.utils),this.writeFiles(r)}async writeSchemaFile(e,t){let r={};return r[P.join(e,"schema.ts")]=t,this.writeFiles(r)}};u();import Xe from"oazapfts/generate";var M=class{constructor(e,t){this.v3Doc=e;this.apiGen=new Xe(e,{unionUndefined:t.unionUndefined,mergeReadWriteOnly:t.mergeReadWriteOnly})}apiGen;initialize(){this.apiGen.spec.components?.schemas&&(Object.keys(this.apiGen.spec.components.schemas).forEach(e=>{let t=this.apiGen.spec.components.schemas[e];t&&typeof t=="object"&&"title"in t&&delete t.title}),this.apiGen.preprocessComponents(this.apiGen.spec.components.schemas),Object.keys(this.apiGen.spec.components.schemas).forEach(e=>{try{this.apiGen.getRefAlias({$ref:`#/components/schemas/${e}`})}catch{}}))}getOperationDefinitions(e){let{operationMatches:t}=(B(),Ie(ge));return ie(this.v3Doc).filter(t(e))}getApiGenerator(){return this.apiGen}getDocument(){return this.v3Doc}getSchemaTypeNames(){return new Set}};u();function ye(){return`/* eslint-disable */
2
+ var z=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var X=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ie=(n,e)=>{for(var t in e)z(n,t,{get:e[t],enumerable:!0})},qe=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Fe(e))!je.call(n,o)&&o!==t&&z(n,o,{get:()=>e[o],enumerable:!(r=De(e,o))||r.enumerable});return n};var Ge=n=>qe(z({},"__esModule",{value:!0}),n);import{fileURLToPath as Me}from"node:url";var ke,y,c=X(()=>{"use strict";ke=()=>Me(import.meta.url),y=ke()});var be={};Ie(be,{argumentMatches:()=>tt,defaultIsDataResponse:()=>Xe,getOperationName:()=>K,getOverrides:()=>H,getTags:()=>et,operationMatches:()=>he});import{getOperationName as Je}from"oazapfts/generate";function Xe(n,e){if(e&&n==="default")return!0;let t=Number(n);return!Number.isNaN(t)&&t>=200&&t<300}function K({verb:n,path:e}){return Je(n,e,void 0)}function et({verb:n,pathItem:e}){return n?e[n]?.tags||[]:[]}function de(n){let e=Array.isArray(n)?n:[n];return function(r){return n?e.some(o=>typeof o=="string"?o===r:o?.test(r)):!0}}function he(n){let e=typeof n=="function"?n:de(n);return function(r){if(!n)return!0;let o=K(r);return e(o,r)}}function tt(n){let e=typeof n=="function"?n:de(n);return function(r){if(!n||r.in==="path")return!0;let o=r.name;return e(o,r)}}function H(n,e){return e?.find(t=>he(t.pattern)(n))}var Z=X(()=>{"use strict";c()});c();import L from"commander";import{createRequire as bt}from"node:module";c();import Ke from"commander";import{createRequire as Ue}from"node:module";import{resolve as ee}from"node:path";import{existsSync as _,rmSync as Ve,readdirSync as Qe,statSync as We,mkdirSync as Le}from"node:fs";import te from"node:path";var E=Ue(y);function ze(n){let e=new Map;if(!_(n))return e;function t(r){try{let o=Qe(r);for(let i of o){let s=te.join(r,i);if(We(s).isDirectory())t(s);else if(i==="enhanceEndpoints.ts"){let p=E("node:fs").readFileSync(s);e.set(s,p)}}}catch{}}return t(n),e}function _e(n){for(let[e,t]of n)try{let r=te.dirname(e);_(r)||Le(r,{recursive:!0}),E("node:fs").writeFileSync(e,t)}catch(r){console.warn(`Failed to restore ${e}:`,r)}}function ne(n){let e=["/","/usr","/etc","/var","/home","/Users",".",".."],t=ee(n);if(e.some(r=>t===ee(r))&&(console.error(`Dangerous path detected: ${t}. Refusing to delete.`),process.exit(1)),_(n)){console.log(`Cleaning output directory: ${n}`);let r=ze(n);Ve(n,{recursive:!0,force:!0}),r.size>0&&(_e(r),console.log(`Protected ${r.size} enhanceEndpoints.ts file(s) from deletion`)),console.log(`Directory cleaned: ${n}`)}}function re(){try{if(E.resolve("esbuild")&&E.resolve("esbuild-runner"))return E("esbuild-runner/register"),!0}catch{}try{if(E.resolve("typescript")&&E.resolve("ts-node"))return E("ts-node").register({transpileOnly:!0,compilerOptions:{target:"es6",module:"commonjs"}}),!0}catch{}return!1}function oe(n){(!n||!/\.([mc]?(jsx?|tsx?)|jsonc?)?$/.test(n))&&(console.error("Please provide a valid configuration file."),Ke.help())}function ie(n,e){/\.[mc]?tsx?$/.test(n)&&!e&&(console.error("Encountered a TypeScript config file, but neither esbuild-runner nor ts-node are installed."),process.exit(1))}import{dirname as Ot,resolve as Tt}from"node:path";c();c();import j from"node:path";import we from"typescript";c();c();function q(n){return n.replace(n[0],n[0].toUpperCase())}c();import B from"node:fs";import Be from"node:path";c();function se(n){try{new URL(n)}catch{return!1}return!0}async function ae(n,e){if(!se(n))throw new Error(`remoteFile must be a valid URL: ${n}`);try{let t=Be.dirname(e);B.existsSync(t)||await B.promises.mkdir(t,{recursive:!0});let r=await fetch(n);if(!r.ok)throw new Error(`Failed to download schema from ${n}: ${r.statusText}`);let o=await r.text();return await B.promises.writeFile(e,o,"utf-8"),console.log(`Schema downloaded from ${n} to ${e}`),e}catch(t){throw console.error(`Error downloading schema from ${n}:`,t),t}}c();c();var pe=["get","put","post","delete","options","head","patch","trace"];function ce(n){return Object.entries(n.paths).flatMap(([e,t])=>t?Object.entries(t).filter(r=>pe.includes(r[0])).map(([r,o])=>({path:e,verb:r,pathItem:t,operation:o})):[])}c();import He from"@apidevtools/swagger-parser";import Ze from"swagger2openapi";async function ue(n,e){let t=await He.bundle(n,{resolve:{http:e}});return"openapi"in t&&t.openapi.startsWith("3")?t:(await Ze.convertObj(t,{})).openapi}c();function le(n,e,t,r){return r?r(n,e):t?.type?t.type==="query":n==="get"}var G=class{docCache={};async getDocument(e,t){if(this.docCache[e])return this.docCache[e];let r=await ue(e,t);return this.docCache[e]=r,r}async downloadSchema(e,t){return ae(e,t)}getPaths(e){return Object.keys(e.paths||{})}clearCache(){this.docCache={}}};c();import me from"lodash.camelcase";var M=class{groupPaths(e,t){let{groupKeyMatch:r,outputDir:o}=t,i=e.reduce((a,p)=>{let l=r(p),m=l?me(l):"_common";return a[m]||(a[m]=[]),a[m].push(p),a},{}),s={};for(let[a,p]of Object.entries(i))s[a]={groupKey:a,paths:p,outputPath:`${o}/${a}/query.service.ts`};return s}createGroupFilter(e,t){return(r,o)=>{let i=o.path,s=me(t.groupKeyMatch(i)||"");return s!==e&&(s||"_common")!==e?!1:t.filterEndpoint?t.filterEndpoint(r,i,e):!0}}};c();import ye from"node:fs";import $ from"node:path";c();import Ye from"node:path";import fe from"node:fs";async function ge(n){let e=Ye.dirname(n);fe.existsSync(e)||await fe.promises.mkdir(e,{recursive:!0})}var k=class{async writeFile(e,t){try{let r=$.resolve(process.cwd(),e);return $.basename(r)==="enhanceEndpoints.ts"&&ye.existsSync(r)?{path:r,success:!0}:(await ge(r),ye.writeFileSync(r,t),{path:r,success:!0})}catch(r){return{path:e,success:!1,error:r}}}async writeFiles(e){let t=[];for(let[r,o]of Object.entries(e)){let i=await this.writeFile(r,o);t.push(i)}return t}async writeGroupFiles(e,t){let r={};return t.types&&(r[$.join(e,"types.ts")]=t.types),t.queryService&&(r[$.join(e,"query.generated.ts")]=t.queryService),t.enhanceEndpoints&&(r[$.join(e,"enhanceEndpoints.ts")]=t.enhanceEndpoints),t.index&&(r[$.join(e,"index.ts")]=t.index),this.writeFiles(r)}async writeSharedFiles(e,t){let r={};return t.commonTypes&&(r[$.join(e,"common-types.ts")]=t.commonTypes),t.doNotModify&&(r[$.join(e,"DO_NOT_MODIFY.md")]=t.doNotModify),t.utils&&(r[$.join(e,"utils.ts")]=t.utils),this.writeFiles(r)}async writeSchemaFile(e,t){let r={};return r[$.join(e,"schema.ts")]=t,this.writeFiles(r)}};c();import nt from"oazapfts/generate";var U=class{constructor(e,t){this.v3Doc=e;this.apiGen=new nt(e,{unionUndefined:t.unionUndefined,mergeReadWriteOnly:t.mergeReadWriteOnly})}apiGen;initialize(){this.apiGen.spec.components?.schemas&&(Object.keys(this.apiGen.spec.components.schemas).forEach(e=>{let t=this.apiGen.spec.components.schemas[e];t&&typeof t=="object"&&"title"in t&&delete t.title}),this.apiGen.preprocessComponents(this.apiGen.spec.components.schemas),Object.keys(this.apiGen.spec.components.schemas).forEach(e=>{try{this.apiGen.getRefAlias({$ref:`#/components/schemas/${e}`})}catch{}}))}getOperationDefinitions(e){let{operationMatches:t}=(Z(),Ge(be));return ce(this.v3Doc).filter(t(e))}getApiGenerator(){return this.apiGen}getDocument(){return this.v3Doc}getSchemaTypeNames(){return new Set}};c();function Oe(){return`/* eslint-disable */
3
3
  // [Warning] Generated automatically - do not edit manually
4
4
 
5
5
  export interface RequestOptions {
@@ -14,21 +14,70 @@ export interface IRequestConfig {
14
14
  timeout?: number;
15
15
  }
16
16
 
17
- export type IRestFulEndpointsQueryReturn<TVariables> = TVariables extends void ?
18
- void | {fetchOptions?: IRequestConfig;}:
17
+ export type IRestFulEndpointsQueryReturn<TVariables> = TVariables extends void ?
18
+ void | {fetchOptions?: IRequestConfig;}:
19
19
  {
20
20
  variables: TVariables;
21
21
  fetchOptions?: IRequestConfig;
22
22
  };
23
- `}u();import v from"typescript";function et(n){return n.charAt(0).toUpperCase()+n.slice(1)}function tt(n,e,t){return v.transform(n,[r=>o=>v.visitNode(o,function i(s){return v.isIdentifier(s)&&s.text===e?v.factory.createIdentifier(t):v.visitEachChild(s,i,r)})]).transformed[0]}function nt(n){if(!v.isUnionTypeNode(n.type))return null;let e=[];for(let t of n.type.types)if(v.isLiteralTypeNode(t)&&v.isStringLiteral(t.literal))e.push(t.literal.text);else return null;return e.length>0?e:null}function rt(n,e){let t=e.map(r=>` ${r.charAt(0).toUpperCase()+r.slice(1)} = "${r}"`);return`export enum ${n} {
23
+
24
+ export type UseSimpleQuery<TRes, TArg = void> = (
25
+ arg: TArg,
26
+ options?: {
27
+ skip?: boolean;
28
+ pollingInterval?: number;
29
+ refetchOnMountOrArgChange?: boolean | number;
30
+ refetchOnFocus?: boolean;
31
+ refetchOnReconnect?: boolean;
32
+ }
33
+ ) => {
34
+ data: TRes | undefined;
35
+ currentData: TRes | undefined;
36
+ isLoading: boolean;
37
+ isFetching: boolean;
38
+ isSuccess: boolean;
39
+ isError: boolean;
40
+ isUninitialized: boolean;
41
+ error: unknown;
42
+ refetch: () => void;
43
+ };
44
+
45
+ export type UseSimpleMutation<TRes, TArg = void> = () => [
46
+ (arg: TArg) => {unwrap: () => Promise<TRes>} & PromiseLike<{data: TRes} | {error: unknown}>,
47
+ {
48
+ data: TRes | undefined;
49
+ isLoading: boolean;
50
+ isSuccess: boolean;
51
+ isError: boolean;
52
+ isUninitialized: boolean;
53
+ error: unknown;
54
+ reset: () => void;
55
+ }
56
+ ];
57
+
58
+ export type UseSimpleLazyQuery<TRes, TArg = void> = () => [
59
+ (arg: TArg, preferCacheValue?: boolean) => void,
60
+ {
61
+ data: TRes | undefined;
62
+ currentData: TRes | undefined;
63
+ isLoading: boolean;
64
+ isFetching: boolean;
65
+ isSuccess: boolean;
66
+ isError: boolean;
67
+ isUninitialized: boolean;
68
+ error: unknown;
69
+ },
70
+ {lastArg: TArg | undefined}
71
+ ];
72
+ `}c();import v from"typescript";function rt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function ot(n,e,t){return v.transform(n,[r=>o=>v.visitNode(o,function i(s){return v.isIdentifier(s)&&s.text===e?v.factory.createIdentifier(t):v.visitEachChild(s,i,r)})]).transformed[0]}function it(n){if(!v.isUnionTypeNode(n.type))return null;let e=[];for(let t of n.type.types)if(v.isLiteralTypeNode(t)&&v.isStringLiteral(t.literal))e.push(t.literal.text);else return null;return e.length>0?e:null}function st(n,e){let t=e.map(r=>` ${r.charAt(0).toUpperCase()+r.slice(1)} = "${r}"`);return`export enum ${n} {
24
73
  ${t.join(`,
25
74
  `)}
26
- }`}function de(n,e){let t=v.createPrinter({newLine:v.NewLineKind.LineFeed}),r=v.createSourceFile("component-schema.ts","",v.ScriptTarget.Latest,!1,v.ScriptKind.TS),o=[],i={};return Object.entries(n).forEach(([s,a])=>{let c=et(s);if(i[s]=c,e&&!e.has(s))return;if(v.isTypeAliasDeclaration(a)){let p=nt(a);if(p){o.push(rt(c,p));return}}let m=tt(a,s,c),l=t.printNode(v.EmitHint.Unspecified,m,r);o.push(l)}),`/* eslint-disable */
75
+ }`}function Te(n,e){let t=v.createPrinter({newLine:v.NewLineKind.LineFeed}),r=v.createSourceFile("component-schema.ts","",v.ScriptTarget.Latest,!1,v.ScriptKind.TS),o=[],i={};return Object.entries(n).forEach(([s,a])=>{let p=rt(s);if(i[s]=p,e&&!e.has(s))return;if(v.isTypeAliasDeclaration(a)){let f=it(a);if(f){o.push(st(p,f));return}}let l=ot(a,s,p),m=t.printNode(v.EmitHint.Unspecified,l,r);o.push(m)}),`/* eslint-disable */
27
76
  // [Warning] Generated automatically - do not edit manually
28
77
 
29
78
  ${o.join(`
30
79
  `)}
31
- `}u();function he(){return`# \u8ACB\u52FF\u4FEE\u6539\u6B64\u8CC7\u6599\u593E
80
+ `}c();function Se(){return`# \u8ACB\u52FF\u4FEE\u6539\u6B64\u8CC7\u6599\u593E
32
81
 
33
82
  \u26A0\uFE0F **\u91CD\u8981\u63D0\u9192\uFF1A\u8ACB\u52FF\u4FEE\u6539\u6B64\u8CC7\u6599\u593E\u4E2D\u7684\u4EFB\u4F55\u6A94\u6848**
34
83
 
@@ -47,51 +96,54 @@ ${o.join(`
47
96
  \u9019\u4E9B\u6A94\u6848\u662F\u7531 @acrool/rtk-query-codegen-openapi \u7522\u751F\u5668\u6240\u5EFA\u7ACB\u3002
48
97
 
49
98
  \u5982\u6709\u7591\u554F\uFF0C\u8ACB\u53C3\u8003\u5C08\u6848\u6587\u4EF6\u6216\u806F\u7E6B\u958B\u767C\u5718\u968A\u3002
50
- `}u();import Se from"typescript";u();B();import{supportDeepObjects as ot}from"oazapfts/generate";var N=class{constructor(e){this.options=e}extractEndpointInfos(e){return e.map(t=>this.extractSingleEndpointInfo(t))}extractSingleEndpointInfo(e){let{verb:t,path:r,operation:o}=e,{operationNameSuffix:i="",argSuffix:s="Req",responseSuffix:a="Res",queryMatch:c,endpointOverrides:m}=this.options,l=G({verb:t,path:r}),p=i?F(l+i):l,f=F(l+i+s),h=F(l+i+a),y=ae(t,r,_(e,m),c),b=`${l.replace(/([A-Z])/g,"_$1").toUpperCase()}`,x=o.summary||`${t.toUpperCase()} ${r}`,{queryParams:S,pathParams:T,isVoidArg:R,hasRequestBody:w}=this.extractParameters(e),D=this.extractContentType(o),Re=Array.isArray(o.tags)?o.tags:[];return{operationName:p,argTypeName:f,responseTypeName:h,isQuery:y,verb:t.toUpperCase(),path:r,queryKeyName:b,queryParams:S,pathParams:T,isVoidArg:R,summary:x,contentType:D,hasRequestBody:w,tags:Re}}extractParameters(e){let{operation:t,pathItem:r}=e,o=this.resolveArray(t.parameters),i=this.resolveArray(r.parameters).filter(p=>!o.some(f=>f.name===p.name&&f.in===p.in)),s=ot([...i,...o]).filter(p=>p.in!=="header"),a=s.filter(p=>p.in==="query"),c=s.filter(p=>p.in==="path"),m=!!t.requestBody,l=a.length===0&&c.length===0&&!t.requestBody;return{queryParams:a,pathParams:c,isVoidArg:l,hasRequestBody:m}}resolveArray(e){return e?Array.isArray(e)?e:[e]:[]}extractContentType(e){if(!e.requestBody)return"application/json";let t=e.requestBody.content;if(!t||typeof t!="object")return"application/json";let r=Object.keys(t);return r.length===0?"application/json":r[0]}};u();import O from"typescript";var z=n=>n.charAt(0).toUpperCase()+n.slice(1);function it(n,e,t){return O.transform(n,[r=>o=>O.visitNode(o,function i(s){return O.isIdentifier(s)&&s.text===e?O.factory.createIdentifier(t):O.visitEachChild(s,i,r)})]).transformed[0]}function st(n,e,t,r){let o=new Set;for(let i of e)t.has(i)||o.add(z(i));return O.transform(n,[i=>s=>O.visitNode(s,function a(c){if(O.isTypeReferenceNode(c)&&O.isIdentifier(c.typeName)){let m=c.typeName.text;if(o.has(m)&&m!==r){let l=O.factory.createQualifiedName(O.factory.createIdentifier("Schema"),O.factory.createIdentifier(m));return O.factory.createTypeReferenceNode(l,c.typeArguments)}}return O.visitEachChild(c,a,i)})]).transformed[0]}function at(n){if(!O.isUnionTypeNode(n.type))return null;let e=[];for(let t of n.type.types)if(O.isLiteralTypeNode(t)&&O.isStringLiteral(t.literal))e.push(t.literal.text);else return null;return e.length>0?e:null}function pt(n,e){let t=e.map(r=>` ${r.charAt(0).toUpperCase()+r.slice(1)} = "${r}"`);return`export enum ${n} {
99
+ `}c();import Pe from"typescript";c();Z();import{supportDeepObjects as at}from"oazapfts/generate";var F=class{constructor(e){this.options=e}extractEndpointInfos(e){return e.map(t=>this.extractSingleEndpointInfo(t))}extractSingleEndpointInfo(e){let{verb:t,path:r,operation:o}=e,{operationNameSuffix:i="",argSuffix:s="Req",responseSuffix:a="Res",queryMatch:p,endpointOverrides:l}=this.options,m=K({verb:t,path:r}),f=i?q(m+i):m,g=q(m+i+s),O=q(m+i+a),b=le(t,r,H(e,l),p),T=`${m.replace(/([A-Z])/g,"_$1").toUpperCase()}`,C=o.summary||`${t.toUpperCase()} ${r}`,{queryParams:u,pathParams:A,isVoidArg:P,hasRequestBody:S}=this.extractParameters(e),x=this.extractContentType(o),N=Array.isArray(o.tags)?o.tags:[];return{operationName:f,argTypeName:g,responseTypeName:O,isQuery:b,verb:t.toUpperCase(),path:r,queryKeyName:T,queryParams:u,pathParams:A,isVoidArg:P,summary:C,contentType:x,hasRequestBody:S,tags:N}}extractParameters(e){let{operation:t,pathItem:r}=e,o=this.resolveArray(t.parameters),i=this.resolveArray(r.parameters).filter(f=>!o.some(g=>g.name===f.name&&g.in===f.in)),s=at([...i,...o]).filter(f=>f.in!=="header"),a=s.filter(f=>f.in==="query"),p=s.filter(f=>f.in==="path"),l=!!t.requestBody,m=a.length===0&&p.length===0&&!t.requestBody;return{queryParams:a,pathParams:p,isVoidArg:m,hasRequestBody:l}}resolveArray(e){return e?Array.isArray(e)?e:[e]:[]}extractContentType(e){if(!e.requestBody)return"application/json";let t=e.requestBody.content;if(!t||typeof t!="object")return"application/json";let r=Object.keys(t);return r.length===0?"application/json":r[0]}};c();import h from"typescript";var Y=n=>n.charAt(0).toUpperCase()+n.slice(1);function pt(n,e,t){return h.transform(n,[r=>o=>h.visitNode(o,function i(s){return h.isIdentifier(s)&&s.text===e?h.factory.createIdentifier(t):h.visitEachChild(s,i,r)})]).transformed[0]}function ct(n,e,t,r){let o=new Set;for(let i of e)t.has(i)||o.add(Y(i));return h.transform(n,[i=>s=>h.visitNode(s,function a(p){if(h.isTypeReferenceNode(p)&&h.isIdentifier(p.typeName)){let l=p.typeName.text;if(o.has(l)&&l!==r){let m=h.factory.createQualifiedName(h.factory.createIdentifier("Schema"),h.factory.createIdentifier(l));return h.factory.createTypeReferenceNode(m,p.typeArguments)}}return h.visitEachChild(p,a,i)})]).transformed[0]}function ut(n){if(!h.isUnionTypeNode(n.type))return null;let e=[];for(let t of n.type.types)if(h.isLiteralTypeNode(t)&&h.isStringLiteral(t.literal))e.push(t.literal.text);else return null;return e.length>0?e:null}function lt(n,e){let t=e.map(r=>` ${r.charAt(0).toUpperCase()+r.slice(1)} = "${r}"`);return`export enum ${n} {
51
100
  ${t.join(`,
52
101
  `)}
53
- }`}function K(n,e,t,r,o){let i=o?.localSchemaNames??new Set,s=o?.localSchemaInterfaces??{},a={};t&&Object.keys(t).forEach(f=>{if(a[f]=f,f.endsWith("Vo")){let h=f.slice(0,-2)+"VO";a[h]=f}if(f.endsWith("Dto")){let h=f.slice(0,-3)+"DTO";a[h]=f}});let c=t&&Object.keys(t).some(f=>!i.has(f)),m=`/* eslint-disable */
102
+ }`}function V(n,e,t,r,o){let i=o?.localSchemaNames??new Set,s=o?.localSchemaInterfaces??{},a={};t&&Object.keys(t).forEach(g=>{if(a[g]=g,g.endsWith("Vo")){let O=g.slice(0,-2)+"VO";a[O]=g}if(g.endsWith("Dto")){let O=g.slice(0,-3)+"DTO";a[O]=g}});let p=t&&Object.keys(t).some(g=>!i.has(g)),l=`/* eslint-disable */
54
103
  // [Warning] Generated automatically - do not edit manually
55
104
 
56
- `;c&&(m+=`import * as Schema from "../schema";
57
- `),m+=`
58
- `;let l=[];if(Object.keys(s).length>0){let f=O.createPrinter({newLine:O.NewLineKind.LineFeed}),h=O.createSourceFile("types.ts","",O.ScriptTarget.Latest,!1,O.ScriptKind.TS),y=[],b=new Set(t?Object.keys(t):[]);for(let[x,S]of Object.entries(s)){let T=z(x);if(O.isTypeAliasDeclaration(S)){let D=at(S);if(D){y.push(pt(T,D));continue}}let R=it(S,x,T);R=st(R,b,i,T);let w=f.printNode(O.EmitHint.Unspecified,R,h);y.push(w)}y.length>0&&l.push(y.join(`
59
- `))}let p=[];return n.forEach(f=>{let h=f.argTypeName,y=f.responseTypeName;if(h){let b=ct(f,r,a,i);b.trim()===""?p.push(`export type ${h} = void;`,""):p.push(`export type ${h} = {`,b,"};","")}if(y){let b=ut(f,r,a,i);b.content.trim()===""?p.push(`export type ${y} = void;`,""):b.isDirectType?p.push(`export type ${y} = ${b.content};`,""):p.push(`export type ${y} = {`,b.content,"};","")}}),p.length>0&&l.push(p.join(`
60
- `)),l.length===0&&l.push("// \u6B64\u6A94\u6848\u7528\u65BC\u5B9A\u7FA9 API \u76F8\u95DC\u7684\u985E\u578B","// \u985E\u578B\u5B9A\u7FA9\u6703\u6839\u64DA OpenAPI Schema \u81EA\u52D5\u751F\u6210",""),m+l.join(`
105
+ `;p&&(l+=`import * as Schema from "../schema";
106
+ `),l+=`
107
+ `;let m=[];if(Object.keys(s).length>0){let g=h.createPrinter({newLine:h.NewLineKind.LineFeed}),O=h.createSourceFile("types.ts","",h.ScriptTarget.Latest,!1,h.ScriptKind.TS),b=[],T=new Set(t?Object.keys(t):[]);for(let[C,u]of Object.entries(s)){let A=Y(C);if(h.isTypeAliasDeclaration(u)){let x=ut(u);if(x){b.push(lt(A,x));continue}}let P=pt(u,C,A);P=ct(P,T,i,A);let S=g.printNode(h.EmitHint.Unspecified,P,O);b.push(S)}b.length>0&&m.push(b.join(`
108
+ `))}let f=[];return n.forEach(g=>{let O=g.argTypeName,b=g.responseTypeName;if(O){let T=mt(g,r,a,i);T.trim()===""?f.push(`export type ${O} = void;`,""):f.push(`export type ${O} = {`,T,"};","")}if(b){let T=ft(g,r,a,i);T.content.trim()===""?f.push(`export type ${b} = void;`,""):T.isDirectType?f.push(`export type ${b} = ${T.content};`,""):f.push(`export type ${b} = {`,T.content,"};","")}}),f.length>0&&m.push(f.join(`
109
+ `)),m.length===0&&m.push("// \u6B64\u6A94\u6848\u7528\u65BC\u5B9A\u7FA9 API \u76F8\u95DC\u7684\u985E\u578B","// \u985E\u578B\u5B9A\u7FA9\u6703\u6839\u64DA OpenAPI Schema \u81EA\u52D5\u751F\u6210",""),l+m.join(`
61
110
 
62
- `)}function ct(n,e,t={},r=new Set){let o=[];n.queryParams&&n.queryParams.length>0&&n.queryParams.forEach(s=>{let a=s.required?"":"?",c=Oe(s,t,r);o.push(` ${s.name}${a}: ${c};`)}),n.pathParams&&n.pathParams.length>0&&n.pathParams.forEach(s=>{let a=s.required?"":"?",c=Oe(s,t,r);o.push(` ${s.name}${a}: ${c};`)});let i=e?.find(s=>s.operation?.operationId===n.operationName||s.operation?.operationId===n.operationName.toLowerCase()||s.verb===n.verb.toLowerCase()&&s.path===n.path);if(i?.operation?.requestBody){let a=i.operation.requestBody.content,c=a["application/json"]||a["*/*"],m=a["multipart/form-data"]||a["application/x-www-form-urlencoded"];if(c?.schema){let l=A(c.schema,t,1,r);o.push(` body: ${l};`)}else if(m?.schema){let l=A(m.schema,t,1,r);o.push(` body: ${l};`)}else{let l=Object.values(a)[0];if(l?.schema){let p=A(l.schema,t,1,r);o.push(` body: ${p};`)}else o.push(" body?: any; // Request body from OpenAPI")}}return o.length===0?"":o.join(`
63
- `)}function ut(n,e,t={},r=new Set){let o=e?.find(i=>i.operation?.operationId===n.operationName||i.operation?.operationId===n.operationName.toLowerCase()||i.verb===n.verb.toLowerCase()&&i.path===n.path);if(o?.operation?.responses){let i=o.operation.responses[200]||o.operation.responses[201];if(i?.content){let s=i.content["application/json"]||i.content["*/*"]||Object.values(i.content)[0];if(s?.schema){let a=s.schema;if(a.$ref||a.type!=="object"||!a.properties){let m=A(a,t,0,r);if(m&&m!=="any")return{content:m,isDirectType:!0}}let c=mt(a,t,r);if(c.length>0)return{content:c.join(`
64
- `),isDirectType:!1}}}}return{content:"",isDirectType:!1}}function mt(n,e={},t=new Set){let r=[];if(n.type==="object"&&n.properties){let o=n.required||[];Object.entries(n.properties).forEach(([i,s])=>{let c=o.includes(i)?"":"?",m=A(s,e,1,t),p=/[^a-zA-Z0-9_$]/.test(i)?`"${i}"`:i;s.description&&r.push(` /** ${s.description} */`),r.push(` ${p}${c}: ${m};`)})}return r}function A(n,e={},t=0,r=new Set){if(!n)return"any";if(n.$ref){let i=n.$ref;if(i.startsWith("#/components/schemas/")){let s=i.replace("#/components/schemas/",""),a=e[s]||s,c=z(a),m=r.has(s)?c:`Schema.${c}`;return n.nullable?`${m} | null`:m}}let o;switch(n.type){case"string":n.enum?o=n.enum.map(a=>`"${a}"`).join(" | "):n.format==="binary"?o="Blob":o="string";break;case"number":case"integer":o="number";break;case"boolean":o="boolean";break;case"array":let i=n.items?A(n.items,e,t,r):"any";o=i.includes("|")?`(${i})[]`:`${i}[]`;break;case"object":if(n.properties){let a=Object.entries(n.properties);if(a.length===0)n.additionalProperties?o=`Record<string, ${n.additionalProperties===!0?"any":A(n.additionalProperties,e,t,r)}>`:o="{}";else{let c=" ".repeat(t+1),m=" ".repeat(t),l=[];a.forEach(([p,f])=>{let y=(n.required||[]).includes(p)?"":"?",b=A(f,e,t+1,r),S=/[^a-zA-Z0-9_$]/.test(p)?`"${p}"`:p;f.description&&l.push(`${c}/** ${f.description} */`),l.push(`${c}${S}${y}: ${b};`)}),o=`{
65
- ${l.join(`
111
+ `)}function mt(n,e,t={},r=new Set){let o=[];n.queryParams&&n.queryParams.length>0&&n.queryParams.forEach(s=>{let a=s.required?"":"?",p=ve(s,t,r);o.push(` ${s.name}${a}: ${p};`)}),n.pathParams&&n.pathParams.length>0&&n.pathParams.forEach(s=>{let a=s.required?"":"?",p=ve(s,t,r);o.push(` ${s.name}${a}: ${p};`)});let i=e?.find(s=>s.operation?.operationId===n.operationName||s.operation?.operationId===n.operationName.toLowerCase()||s.verb===n.verb.toLowerCase()&&s.path===n.path);if(i?.operation?.requestBody){let a=i.operation.requestBody.content,p=a["application/json"]||a["*/*"],l=a["multipart/form-data"]||a["application/x-www-form-urlencoded"];if(p?.schema){let m=R(p.schema,t,1,r);o.push(` body: ${m};`)}else if(l?.schema){let m=R(l.schema,t,1,r);o.push(` body: ${m};`)}else{let m=Object.values(a)[0];if(m?.schema){let f=R(m.schema,t,1,r);o.push(` body: ${f};`)}else o.push(" body?: any; // Request body from OpenAPI")}}return o.length===0?"":o.join(`
112
+ `)}function ft(n,e,t={},r=new Set){let o=e?.find(i=>i.operation?.operationId===n.operationName||i.operation?.operationId===n.operationName.toLowerCase()||i.verb===n.verb.toLowerCase()&&i.path===n.path);if(o?.operation?.responses){let i=o.operation.responses[200]||o.operation.responses[201];if(i?.content){let s=i.content["application/json"]||i.content["*/*"]||Object.values(i.content)[0];if(s?.schema){let a=s.schema;if(a.$ref||a.type!=="object"||!a.properties){let l=R(a,t,0,r);if(l&&l!=="any")return{content:l,isDirectType:!0}}let p=gt(a,t,r);if(p.length>0)return{content:p.join(`
113
+ `),isDirectType:!1}}}}return{content:"",isDirectType:!1}}function gt(n,e={},t=new Set){let r=[];if(n.type==="object"&&n.properties){let o=n.required||[];Object.entries(n.properties).forEach(([i,s])=>{let p=o.includes(i)?"":"?",l=R(s,e,1,t),f=/[^a-zA-Z0-9_$]/.test(i)?`"${i}"`:i;s.description&&r.push(` /** ${s.description} */`),r.push(` ${f}${p}: ${l};`)})}return r}function R(n,e={},t=0,r=new Set){if(!n)return"any";if(n.$ref){let i=n.$ref;if(i.startsWith("#/components/schemas/")){let s=i.replace("#/components/schemas/",""),a=e[s]||s,p=Y(a),l=r.has(s)?p:`Schema.${p}`;return n.nullable?`${l} | null`:l}}let o;switch(n.type){case"string":n.enum?o=n.enum.map(a=>`"${a}"`).join(" | "):n.format==="binary"?o="Blob":o="string";break;case"number":case"integer":o="number";break;case"boolean":o="boolean";break;case"array":let i=n.items?R(n.items,e,t,r):"any";o=i.includes("|")?`(${i})[]`:`${i}[]`;break;case"object":if(n.properties){let a=Object.entries(n.properties);if(a.length===0)n.additionalProperties?o=`Record<string, ${n.additionalProperties===!0?"any":R(n.additionalProperties,e,t,r)}>`:o="{}";else{let p=" ".repeat(t+1),l=" ".repeat(t),m=[];a.forEach(([f,g])=>{let b=(n.required||[]).includes(f)?"":"?",T=R(g,e,t+1,r),u=/[^a-zA-Z0-9_$]/.test(f)?`"${f}"`:f;g.description&&m.push(`${p}/** ${g.description} */`),m.push(`${p}${u}${b}: ${T};`)}),o=`{
114
+ ${m.join(`
66
115
  `)}
67
- ${m}}`}}else n.additionalProperties?o=`Record<string, ${n.additionalProperties===!0?"any":A(n.additionalProperties,e,t,r)}>`:o="any";break;default:o="any";break}return n.nullable?`${o} | null`:o}function Oe(n,e={},t=new Set){return n.schema?A(n.schema,e,0,t):"any"}u();function be(n,e){let{groupKey:t}=e,r=e.httpClient?.importReturnTypeName||"IRestFulEndpointsQueryReturn",o=n.map(p=>{let f=p.isQuery?"query":"mutation",h=p.isVoidArg?"void":`${r}<${p.argTypeName}>`,y=p.path;p.pathParams&&p.pathParams.length>0?(p.pathParams.forEach(S=>{y=y.replace(`{${S.name}}`,`\${queryArg.variables.${S.name}}`)}),y="`"+y+"`"):y=`"${y}"`;let b="";p.queryParams&&p.queryParams.length>0&&(b=`
116
+ ${l}}`}}else n.additionalProperties?o=`Record<string, ${n.additionalProperties===!0?"any":R(n.additionalProperties,e,t,r)}>`:o="any";break;default:o="any";break}return n.nullable?`${o} | null`:o}function ve(n,e={},t=new Set){return n.schema?R(n.schema,e,0,t):"any"}c();function xe(n,e){let{groupKey:t}=e,r=e.httpClient?.importReturnTypeName||"IRestFulEndpointsQueryReturn",o=n.map(u=>{let A=u.isQuery?"query":"mutation",P=u.isVoidArg?"void":`${r}<${u.argTypeName}>`,S=u.path;u.pathParams&&u.pathParams.length>0?(u.pathParams.forEach(D=>{S=S.replace(`{${D.name}}`,`\${queryArg.variables.${D.name}}`)}),S="`"+S+"`"):S=`"${S}"`;let x="";u.queryParams&&u.queryParams.length>0&&(x=`
68
117
  params: {
69
- ${p.queryParams.map(T=>` ${T.name}: queryArg.variables.${T.name},`).join(`
118
+ ${u.queryParams.map(I=>` ${I.name}: queryArg.variables.${I.name},`).join(`
70
119
  `)}
71
- },`);let x="";if(p.tags&&p.tags.length>0){let S=p.tags.map(T=>`ECacheTagTypes.${T.split(/\s+/).map(w=>w.charAt(0).toUpperCase()+w.slice(1)).join("")}`).join(", ");p.isQuery?x=`
72
- providesTags: [${S}],`:x=`
73
- invalidatesTags: (result, error) => error ? [] : [${S}],`}return` /** ${p.summary||p.operationName} */
74
- ${p.operationName}: build.${f}<
75
- ${p.responseTypeName},
76
- ${h}
77
- >({${x}
120
+ },`);let N="";if(u.tags&&u.tags.length>0){let D=u.tags.map(I=>`ECacheTagTypes.${I.split(/\s+/).map(J=>J.charAt(0).toUpperCase()+J.slice(1)).join("")}`).join(", ");u.isQuery?N=`
121
+ providesTags: [${D}],`:N=`
122
+ invalidatesTags: (result, error) => error ? [] : [${D}],`}return` /** ${u.summary||u.operationName} */
123
+ ${u.operationName}: build.${A}<
124
+ ${u.responseTypeName},
125
+ ${P}
126
+ >({${N}
78
127
  query: (queryArg) => ({
79
- url: ${y},
80
- method: "${p.verb.toUpperCase()}",
81
- contentType: "${p.contentType}",${b}${p.hasRequestBody?`
82
- body: queryArg.variables.body,`:""}${p.isVoidArg?"":`
128
+ url: ${S},
129
+ method: "${u.verb.toUpperCase()}",
130
+ contentType: "${u.contentType}",${x}${u.hasRequestBody?`
131
+ body: queryArg.variables.body,`:""}${u.isVoidArg?"":`
83
132
  fetchOptions: queryArg?.fetchOptions,`}
84
133
  }),
85
134
  }),`}).join(`
86
- `),i=[...new Set([...n.map(p=>p.argTypeName),...n.map(p=>p.responseTypeName)])].filter(p=>p!=="VoidApiArg"),s=i.length>0?`import type { ${i.join(", ")} } from "./types";`:"",a=e.apiConfiguration?`import {${e.apiConfiguration.importName} as api} from "${e.apiConfiguration.file.replace(/\.ts$/,"")}";
135
+ `),i=[...new Set([...n.map(u=>u.argTypeName),...n.map(u=>u.responseTypeName)])].filter(u=>u!=="VoidApiArg"),s=i.length>0?`import type { ${i.join(", ")} } from "./types";`:"",a=e.apiConfiguration?`import {${e.apiConfiguration.importName} as api} from "${e.apiConfiguration.file.replace(/\.ts$/,"")}";
87
136
  `:`import {baseApi as api} from "../../../library/redux/baseApi";
88
- `,c=e.httpClient?`import {${e.httpClient.importReturnTypeName}} from "${e.httpClient.file}";
137
+ `,p=e.httpClient?`import {${e.httpClient.importReturnTypeName}} from "${e.httpClient.file}";
89
138
  `:`import {IRestFulEndpointsQueryReturn} from "@acrool/react-fetcher";
90
- `,l=n.some(p=>p.tags&&p.tags.length>0)?`import {ECacheTagTypes} from "../tagTypes";
91
- `:"";return`/* eslint-disable */
139
+ `,m=n.some(u=>u.tags&&u.tags.length>0)?`import {ECacheTagTypes} from "../tagTypes";
140
+ `:"",f=n.some(u=>u.isQuery),g=f&&!!e.useLazyQueries,O=n.some(u=>!u.isQuery),b=[];f&&b.push("UseSimpleQuery"),O&&b.push("UseSimpleMutation"),g&&b.push("UseSimpleLazyQuery");let T=b.length>0?`import type { ${b.join(", ")} } from "../common-types";
141
+ `:"",C=n.map(u=>{let A=u.operationName.charAt(0).toUpperCase()+u.operationName.slice(1),P=u.isVoidArg?"void":`${r}<${u.argTypeName}>`,S=[];if(u.isQuery){let x=`use${A}Query`;if(S.push(`export const ${x} = injectedRtkApi.${x} as UseSimpleQuery<${u.responseTypeName}, ${P}>;`),e.useLazyQueries){let N=`useLazy${A}Query`;S.push(`export const ${N} = injectedRtkApi.${N} as UseSimpleLazyQuery<${u.responseTypeName}, ${P}>;`)}}else{let x=`use${A}Mutation`;S.push(`export const ${x} = injectedRtkApi.${x} as UseSimpleMutation<${u.responseTypeName}, ${P}>;`)}return S.join(`
142
+ `)}).join(`
143
+ `);return`/* eslint-disable */
92
144
  // [Warning] Generated automatically - do not edit manually
93
145
 
94
- ${a}${c}${l}
146
+ ${a}${p}${m}${T}
95
147
  ${s}
96
148
 
97
149
 
@@ -101,14 +153,10 @@ ${o}
101
153
  }),
102
154
  });
103
155
 
104
- export const {
105
- ${n.map(p=>{let f=p.operationName.charAt(0).toUpperCase()+p.operationName.slice(1);if(p.isQuery){let h=`use${f}Query`;if(e.useLazyQueries){let y=`useLazy${f}Query`;return` ${h},
106
- ${y},`}else return` ${h},`}else return` ${`use${f}Mutation`},`}).join(`
107
- `)}
108
- } = injectedRtkApi;
156
+ ${C}
109
157
 
110
158
  export default injectedRtkApi;
111
- `}u();function ve(n,e){return`/* eslint-disable */
159
+ `}c();function Ae(n,e){return`/* eslint-disable */
112
160
  // [Warning] Generated automatically - do not edit manually
113
161
 
114
162
  import api from "./query.generated";
@@ -125,13 +173,13 @@ ${n.map(o=>o.isQuery?` ${o.operationName}: {
125
173
  });
126
174
 
127
175
  export default enhancedApi;
128
- `}var k=class{constructor(e,t){this.parserService=e;this.options=t;this.infoExtractor=new N(t)}infoExtractor;async generate(){let e=this.parserService.getOperationDefinitions(this.options.filterEndpoints),t=this.infoExtractor.extractEndpointInfos(e);return this.generateRtkQueryCode(t)}generateRtkQueryCode(e){let t=this.generateTypes(e),r=be(e,this.options),o=ve(e,this.options),i=this.generateIndex(),s=e.map(c=>c.operationName),a=new Set;return e.forEach(c=>{c.tags&&Array.isArray(c.tags)&&c.tags.forEach(m=>a.add(m))}),{operationNames:s,tags:Array.from(a),files:{types:t,queryService:r,index:i,enhanceEndpoints:o}}}generateTypes(e){let t={...this.options,apiConfiguration:this.options.apiConfiguration||{file:"@/store/webapi",importName:"WebApiConfiguration"}},o=this.parserService.getApiGenerator().aliases.reduce((s,a)=>{if(Se.isInterfaceDeclaration(a)||Se.isTypeAliasDeclaration(a)){let c=a.name.text;return{...s,[c]:a}}return s},{}),i=this.parserService.getOperationDefinitions(this.options.filterEndpoints);return K(e,t,o,i)}generateIndex(){let e=this.options.groupKey||"";return`/* eslint-disable */
176
+ `}var Q=class{constructor(e,t){this.parserService=e;this.options=t;this.infoExtractor=new F(t)}infoExtractor;async generate(){let e=this.parserService.getOperationDefinitions(this.options.filterEndpoints),t=this.infoExtractor.extractEndpointInfos(e);return this.generateRtkQueryCode(t)}generateRtkQueryCode(e){let t=this.generateTypes(e),r=xe(e,this.options),o=Ae(e,this.options),i=this.generateIndex(),s=e.map(p=>p.operationName),a=new Set;return e.forEach(p=>{p.tags&&Array.isArray(p.tags)&&p.tags.forEach(l=>a.add(l))}),{operationNames:s,tags:Array.from(a),files:{types:t,queryService:r,index:i,enhanceEndpoints:o}}}generateTypes(e){let t={...this.options,apiConfiguration:this.options.apiConfiguration||{file:"@/store/webapi",importName:"WebApiConfiguration"}},o=this.parserService.getApiGenerator().aliases.reduce((s,a)=>{if(Pe.isInterfaceDeclaration(a)||Pe.isTypeAliasDeclaration(a)){let p=a.name.text;return{...s,[p]:a}}return s},{}),i=this.parserService.getOperationDefinitions(this.options.filterEndpoints);return V(e,t,o,i)}generateIndex(){let e=this.options.groupKey||"";return`/* eslint-disable */
129
177
  // [Warning] Generated automatically - do not edit manually
130
178
 
131
179
  export { default as ${e?`${e.charAt(0).toLowerCase()+e.slice(1)}Api`:"api"} } from "./enhanceEndpoints";
132
180
  export * from "./query.generated";
133
181
  export * from "./types";
134
- `}};u();function xe(){return`/* eslint-disable */
182
+ `}};c();function Ce(){return`/* eslint-disable */
135
183
  // [Warning] Generated automatically - do not edit manually
136
184
 
137
185
  /**
@@ -144,7 +192,7 @@ export function withoutUndefined(obj?: Record<string, any>) {
144
192
  );
145
193
  }
146
194
 
147
- `}u();function lt(n){return n.split(/\s+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function Te(n){return n.length===0?`/* eslint-disable */
195
+ `}c();function yt(n){return n.split(/\s+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function $e(n){return n.length===0?`/* eslint-disable */
148
196
  // [Warning] Generated automatically - do not edit manually
149
197
 
150
198
  export enum ECacheTagTypes {
@@ -153,14 +201,14 @@ export enum ECacheTagTypes {
153
201
  // [Warning] Generated automatically - do not edit manually
154
202
 
155
203
  export enum ECacheTagTypes {
156
- ${n.sort().map(t=>` ${lt(t)} = '${t}',`).join(`
204
+ ${n.sort().map(t=>` ${yt(t)} = '${t}',`).join(`
157
205
  `)}
158
206
  }
159
- `}u();function C(n,e){if(!(!n||typeof n!="object")){if(n.$ref&&typeof n.$ref=="string"){let t=n.$ref.match(/^#\/components\/schemas\/(.+)$/);t&&e.add(t[1])}if(n.properties)for(let t of Object.values(n.properties))C(t,e);n.items&&C(n.items,e),n.additionalProperties&&typeof n.additionalProperties=="object"&&C(n.additionalProperties,e);for(let t of["allOf","oneOf","anyOf"])if(Array.isArray(n[t]))for(let r of n[t])C(r,e)}}function ft(n){let e=new Set;for(let t of n){let r=t.operation;if(r.parameters)for(let o of r.parameters){let i=o;i.schema&&C(i.schema,e)}if(r.requestBody){let o=r.requestBody;if(o.content)for(let i of Object.values(o.content))i.schema&&C(i.schema,e)}if(r.responses)for(let o of Object.values(r.responses)){let i=o;if(i.content)for(let s of Object.values(i.content))s.schema&&C(s.schema,e)}}return e}function gt(n,e){let t=new Set,r=[...n];for(;r.length>0;){let o=r.pop();if(t.has(o))continue;t.add(o);let i=e[o];if(!i)continue;let s=new Set;C(i,s);for(let a of s)t.has(a)||r.push(a)}return t}function Pe(n,e,t){let r=new Map;for(let[m,l]of n){let p=ft(l),f=gt(p,e);r.set(m,f)}let o=new Map;for(let[m,l]of r)for(let p of l)o.has(p)||o.set(p,new Set),o.get(p).add(m);let i=new Set,s=new Map,a=new Set;for(let m of t){let l=o.get(m);if(!l||l.size===0)a.add(m);else if(l.size===1){let p=[...l][0];s.has(p)||s.set(p,new Set),s.get(p).add(m)}else i.add(m)}let c=!0;for(;c;){c=!1;for(let[m,l]of s)for(let p of[...l]){let f=e[p];if(!f)continue;let h=new Set;C(f,h);for(let y of h)for(let[b,x]of s)b!==m&&x.has(y)&&(i.add(y),i.add(p),x.delete(y),l.delete(p),c=!0)}}return{sharedSchemas:i,groupLocalSchemas:s,unusedSchemas:a}}var V=class{_options;openApiService=new I;groupService=new j;fileWriterService=new q;openApiDoc=null;parserService=null;schemaInterfaces={};actualSchemaFile="";generatedContent={groups:[],commonTypes:"",componentSchema:"",doNotModify:"",utils:"",tagTypes:""};allTags=new Set;groupOperationDefs=new Map;groupGenerationOptions=new Map;constructor(e){this._options=e}async generateAll(){return await this.prepare(),await this.generateApi(),this.splitSchemaByUsage(),this.generateCommonTypesContent(),this.generateSchemaContent(),this.generateUtilsContent(),this.generateDoNotModifyContent(),this.generateTagTypesContent(),await this.release()}async prepare(){this.actualSchemaFile=this._options.schemaFile,this._options.remoteFile&&(this.actualSchemaFile=await this.openApiService.downloadSchema(this._options.remoteFile,this._options.schemaFile)),this.openApiDoc=await this.openApiService.getDocument(this.actualSchemaFile,this._options.httpResolverOptions),this.parserService=new M(this.openApiDoc,this._options),this.parserService.initialize();let e=this.parserService.getApiGenerator();this.schemaInterfaces=e.aliases.reduce((t,r)=>{if(Ae.isInterfaceDeclaration(r)||Ae.isTypeAliasDeclaration(r)){let o=r.name.text;return{...t,[o]:r}}return t},{})}async generateApi(){if(!this.openApiDoc||!this.parserService)throw new Error("\u8ACB\u5148\u8ABF\u7528 prepare() \u65B9\u6CD5");let e=this.openApiService.getPaths(this.openApiDoc),t=this.groupService.groupPaths(e,this._options.outputFiles);for(let r of Object.values(t))try{let o=await this.generateApiGroupContent(this._options,r);o.operationNames.length>0&&(this.generatedContent.groups.push({groupKey:r.groupKey,outputPath:r.outputPath,content:o}),o.tags&&Array.isArray(o.tags)&&o.tags.forEach(i=>this.allTags.add(i)))}catch(o){throw new Error(`\u7FA4\u7D44 ${r.groupKey} \u751F\u6210\u5931\u6557: ${o}`)}}splitSchemaByUsage(){if(!this.openApiDoc||this.groupOperationDefs.size===0)return;let e=this.openApiDoc.components?.schemas??{},t=Object.keys(this.schemaInterfaces),r=Pe(this.groupOperationDefs,e,t);this.sharedSchemaNames=r.sharedSchemas;for(let o of this.generatedContent.groups){let i=r.groupLocalSchemas.get(o.groupKey);if(!i||i.size===0)continue;let s=this.groupGenerationOptions.get(o.groupKey);if(!s||!this.parserService)continue;let a={};for(let h of i)this.schemaInterfaces[h]&&(a[h]=this.schemaInterfaces[h]);let c=new N(s),m=this.groupOperationDefs.get(o.groupKey)??[],l=c.extractEndpointInfos(m),p={...s,apiConfiguration:s.apiConfiguration||{file:"@/store/webapi",importName:"WebApiConfiguration"}},f=K(l,p,this.schemaInterfaces,m,{localSchemaInterfaces:a,localSchemaNames:i});o.content.files.types=f}}sharedSchemaNames=null;async generateCommonTypesContent(){this.generatedContent.commonTypes=ye()}async generateSchemaContent(){this.generatedContent.componentSchema=de(this.schemaInterfaces,this.sharedSchemaNames??void 0)}async generateDoNotModifyContent(){this.generatedContent.doNotModify=he()}async generateUtilsContent(){this.generatedContent.utils=xe()}async generateTagTypesContent(){let e=Array.from(this.allTags);this.generatedContent.tagTypes=Te(e)}async release(){let e=[],t=[],r=[];try{for(let a of this.generatedContent.groups)try{if(a.content?.files){let c=E.dirname(a.outputPath),m=await this.fileWriterService.writeGroupFiles(c,{types:a.content.files.types,queryService:a.content.files.queryService,enhanceEndpoints:a.content.files.enhanceEndpoints,index:a.content.files.index});e.push(...m),r.push(a.groupKey)}}catch(c){t.push(new Error(`\u5BEB\u5165\u7FA4\u7D44 ${a.groupKey} \u5931\u6557: ${c}`))}let o=this.generatedContent.groups[0]?E.dirname(E.dirname(this.generatedContent.groups[0].outputPath)):"./generated";if(this.generatedContent.commonTypes||this.generatedContent.doNotModify||this.generatedContent.utils){let a=await this.fileWriterService.writeSharedFiles(o,{commonTypes:this.generatedContent.commonTypes||void 0,doNotModify:this.generatedContent.doNotModify||void 0,utils:this.generatedContent.utils||void 0});e.push(...a)}if(this.generatedContent.tagTypes){let a=await this.fileWriterService.writeFile(E.join(o,"tagTypes.ts"),this.generatedContent.tagTypes);e.push(a)}if(this.generatedContent.componentSchema){let a=await this.fileWriterService.writeSchemaFile(o,this.generatedContent.componentSchema);e.push(...a)}let i=this.generateMainIndex(r),s=await this.fileWriterService.writeFile(E.join(o,"index.ts"),i);e.push(s)}catch(o){t.push(o)}return{success:t.length===0,writtenFiles:e,errors:t,generatedGroups:r}}async generateApiGroupContent(e,t){let{outputFiles:r,...o}=e,i={...o,schemaFile:this.actualSchemaFile,outputFile:t.outputPath,sharedTypesFile:`${r.outputDir}/common-types.ts`,filterEndpoints:this.groupService.createGroupFilter(t.groupKey,r),queryMatch:r.queryMatch,groupKey:t.groupKey};if(!this.openApiDoc||!this.parserService)throw new Error("OpenAPI \u6587\u6A94\u672A\u521D\u59CB\u5316\uFF0C\u8ACB\u5148\u8ABF\u7528 prepare()");let s=this.parserService.getOperationDefinitions(i.filterEndpoints);return this.groupOperationDefs.set(t.groupKey,s),this.groupGenerationOptions.set(t.groupKey,i),await new k(this.parserService,i).generate()}generateMainIndex(e){return`/* eslint-disable */
207
+ `}c();function w(n,e){if(!(!n||typeof n!="object")){if(n.$ref&&typeof n.$ref=="string"){let t=n.$ref.match(/^#\/components\/schemas\/(.+)$/);t&&e.add(t[1])}if(n.properties)for(let t of Object.values(n.properties))w(t,e);n.items&&w(n.items,e),n.additionalProperties&&typeof n.additionalProperties=="object"&&w(n.additionalProperties,e);for(let t of["allOf","oneOf","anyOf"])if(Array.isArray(n[t]))for(let r of n[t])w(r,e)}}function dt(n){let e=new Set;for(let t of n){let r=t.operation;if(r.parameters)for(let o of r.parameters){let i=o;i.schema&&w(i.schema,e)}if(r.requestBody){let o=r.requestBody;if(o.content)for(let i of Object.values(o.content))i.schema&&w(i.schema,e)}if(r.responses)for(let o of Object.values(r.responses)){let i=o;if(i.content)for(let s of Object.values(i.content))s.schema&&w(s.schema,e)}}return e}function ht(n,e){let t=new Set,r=[...n];for(;r.length>0;){let o=r.pop();if(t.has(o))continue;t.add(o);let i=e[o];if(!i)continue;let s=new Set;w(i,s);for(let a of s)t.has(a)||r.push(a)}return t}function Re(n,e,t){let r=new Map;for(let[l,m]of n){let f=dt(m),g=ht(f,e);r.set(l,g)}let o=new Map;for(let[l,m]of r)for(let f of m)o.has(f)||o.set(f,new Set),o.get(f).add(l);let i=new Set,s=new Map,a=new Set;for(let l of t){let m=o.get(l);if(!m||m.size===0)a.add(l);else if(m.size===1){let f=[...m][0];s.has(f)||s.set(f,new Set),s.get(f).add(l)}else i.add(l)}let p=!0;for(;p;){p=!1;for(let[l,m]of s)for(let f of[...m]){let g=e[f];if(!g)continue;let O=new Set;w(g,O);for(let b of O)for(let[T,C]of s)T!==l&&C.has(b)&&(i.add(b),i.add(f),C.delete(b),m.delete(f),p=!0)}}return{sharedSchemas:i,groupLocalSchemas:s,unusedSchemas:a}}var W=class{_options;openApiService=new G;groupService=new M;fileWriterService=new k;openApiDoc=null;parserService=null;schemaInterfaces={};actualSchemaFile="";generatedContent={groups:[],commonTypes:"",componentSchema:"",doNotModify:"",utils:"",tagTypes:""};allTags=new Set;groupOperationDefs=new Map;groupGenerationOptions=new Map;constructor(e){this._options=e}async generateAll(){return await this.prepare(),await this.generateApi(),this.splitSchemaByUsage(),this.generateCommonTypesContent(),this.generateSchemaContent(),this.generateUtilsContent(),this.generateDoNotModifyContent(),this.generateTagTypesContent(),await this.release()}async prepare(){this.actualSchemaFile=this._options.schemaFile,this._options.remoteFile&&(this.actualSchemaFile=await this.openApiService.downloadSchema(this._options.remoteFile,this._options.schemaFile)),this.openApiDoc=await this.openApiService.getDocument(this.actualSchemaFile,this._options.httpResolverOptions),this.parserService=new U(this.openApiDoc,this._options),this.parserService.initialize();let e=this.parserService.getApiGenerator();this.schemaInterfaces=e.aliases.reduce((t,r)=>{if(we.isInterfaceDeclaration(r)||we.isTypeAliasDeclaration(r)){let o=r.name.text;return{...t,[o]:r}}return t},{})}async generateApi(){if(!this.openApiDoc||!this.parserService)throw new Error("\u8ACB\u5148\u8ABF\u7528 prepare() \u65B9\u6CD5");let e=this.openApiService.getPaths(this.openApiDoc),t=this.groupService.groupPaths(e,this._options.outputFiles);for(let r of Object.values(t))try{let o=await this.generateApiGroupContent(this._options,r);o.operationNames.length>0&&(this.generatedContent.groups.push({groupKey:r.groupKey,outputPath:r.outputPath,content:o}),o.tags&&Array.isArray(o.tags)&&o.tags.forEach(i=>this.allTags.add(i)))}catch(o){throw new Error(`\u7FA4\u7D44 ${r.groupKey} \u751F\u6210\u5931\u6557: ${o}`)}}splitSchemaByUsage(){if(!this.openApiDoc||this.groupOperationDefs.size===0)return;let e=this.openApiDoc.components?.schemas??{},t=Object.keys(this.schemaInterfaces),r=Re(this.groupOperationDefs,e,t);this.sharedSchemaNames=r.sharedSchemas;for(let o of this.generatedContent.groups){let i=r.groupLocalSchemas.get(o.groupKey);if(!i||i.size===0)continue;let s=this.groupGenerationOptions.get(o.groupKey);if(!s||!this.parserService)continue;let a={};for(let O of i)this.schemaInterfaces[O]&&(a[O]=this.schemaInterfaces[O]);let p=new F(s),l=this.groupOperationDefs.get(o.groupKey)??[],m=p.extractEndpointInfos(l),f={...s,apiConfiguration:s.apiConfiguration||{file:"@/store/webapi",importName:"WebApiConfiguration"}},g=V(m,f,this.schemaInterfaces,l,{localSchemaInterfaces:a,localSchemaNames:i});o.content.files.types=g}}sharedSchemaNames=null;async generateCommonTypesContent(){this.generatedContent.commonTypes=Oe()}async generateSchemaContent(){this.generatedContent.componentSchema=Te(this.schemaInterfaces,this.sharedSchemaNames??void 0)}async generateDoNotModifyContent(){this.generatedContent.doNotModify=Se()}async generateUtilsContent(){this.generatedContent.utils=Ce()}async generateTagTypesContent(){let e=Array.from(this.allTags);this.generatedContent.tagTypes=$e(e)}async release(){let e=[],t=[],r=[];try{for(let a of this.generatedContent.groups)try{if(a.content?.files){let p=j.dirname(a.outputPath),l=await this.fileWriterService.writeGroupFiles(p,{types:a.content.files.types,queryService:a.content.files.queryService,enhanceEndpoints:a.content.files.enhanceEndpoints,index:a.content.files.index});e.push(...l),r.push(a.groupKey)}}catch(p){t.push(new Error(`\u5BEB\u5165\u7FA4\u7D44 ${a.groupKey} \u5931\u6557: ${p}`))}let o=this.generatedContent.groups[0]?j.dirname(j.dirname(this.generatedContent.groups[0].outputPath)):"./generated";if(this.generatedContent.commonTypes||this.generatedContent.doNotModify||this.generatedContent.utils){let a=await this.fileWriterService.writeSharedFiles(o,{commonTypes:this.generatedContent.commonTypes||void 0,doNotModify:this.generatedContent.doNotModify||void 0,utils:this.generatedContent.utils||void 0});e.push(...a)}if(this.generatedContent.tagTypes){let a=await this.fileWriterService.writeFile(j.join(o,"tagTypes.ts"),this.generatedContent.tagTypes);e.push(a)}if(this.generatedContent.componentSchema){let a=await this.fileWriterService.writeSchemaFile(o,this.generatedContent.componentSchema);e.push(...a)}let i=this.generateMainIndex(r),s=await this.fileWriterService.writeFile(j.join(o,"index.ts"),i);e.push(s)}catch(o){t.push(o)}return{success:t.length===0,writtenFiles:e,errors:t,generatedGroups:r}}async generateApiGroupContent(e,t){let{outputFiles:r,...o}=e,i={...o,schemaFile:this.actualSchemaFile,outputFile:t.outputPath,sharedTypesFile:`${r.outputDir}/common-types.ts`,filterEndpoints:this.groupService.createGroupFilter(t.groupKey,r),queryMatch:r.queryMatch,groupKey:t.groupKey};if(!this.openApiDoc||!this.parserService)throw new Error("OpenAPI \u6587\u6A94\u672A\u521D\u59CB\u5316\uFF0C\u8ACB\u5148\u8ABF\u7528 prepare()");let s=this.parserService.getOperationDefinitions(i.filterEndpoints);return this.groupOperationDefs.set(t.groupKey,s),this.groupGenerationOptions.set(t.groupKey,i),await new Q(this.parserService,i).generate()}generateMainIndex(e){return`/* eslint-disable */
160
208
  // [Warning] Generated automatically - do not edit manually
161
209
 
162
210
  export * from "./schema";
163
211
  ${e.map(r=>`export * from "./${r}";`).join(`
164
212
  `)}
165
- `}};async function Ce(n){let t=await new V(n).generateAll();if(!t.success&&t.errors.length>0)throw t.errors[0]}var $e=yt(g);async function Ot(n){let e=ht(process.cwd(),n);process.chdir(dt(e));let t=$e(e),r=t.default??t;"outputFiles"in r||(console.error('Configuration must include "outputFiles" property. Single file output is no longer supported.'),process.exit(1)),r.outputFiles&&r.outputFiles.outputDir&&J(r.outputFiles.outputDir);try{console.log("Generating multiple outputs..."),await Ce(r),console.log("Done")}catch(o){console.error("Generation failed:",o),process.exit(1)}}async function bt(){let n=$e("../../package.json"),e=X();U.version(n.version).usage("<path/to/config.js>").parse(process.argv);let t=U.args[0];if(U.args.length===0){U.help();return}ee(t),te(t,e),await Ot(t)}bt().catch(n=>{console.error("CLI execution failed:",n),process.exit(1)});export{Ot as runGeneration};
213
+ `}};async function Ne(n){let t=await new W(n).generateAll();if(!t.success&&t.errors.length>0)throw t.errors[0]}var Ee=bt(y);async function St(n){let e=Tt(process.cwd(),n);process.chdir(Ot(e));let t=Ee(e),r=t.default??t;"outputFiles"in r||(console.error('Configuration must include "outputFiles" property. Single file output is no longer supported.'),process.exit(1)),r.outputFiles&&r.outputFiles.outputDir&&ne(r.outputFiles.outputDir);try{console.log("Generating multiple outputs..."),await Ne(r),console.log("Done")}catch(o){console.error("Generation failed:",o),process.exit(1)}}async function vt(){let n=Ee("../../package.json"),e=re();L.version(n.version).usage("<path/to/config.js>").parse(process.argv);let t=L.args[0];if(L.args.length===0){L.help();return}oe(t),ie(t,e),await St(t)}vt().catch(n=>{console.error("CLI execution failed:",n),process.exit(1)});export{St as runGeneration};
166
214
  //# sourceMappingURL=cli.mjs.map