@ahoo-wang/fetcher-generator 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,126 +1,132 @@
1
- import { Scope as he, VariableDeclarationKind as O, Project as ye } from "ts-morph";
1
+ import { Scope as ye, VariableDeclarationKind as D, Project as xe } from "ts-morph";
2
2
  import { ContentTypeValues as I, combineURLs as E } from "@ahoo-wang/fetcher";
3
- import { ResourceAttributionPathSpec as z } from "@ahoo-wang/fetcher-wow";
4
- import { parse as H } from "yaml";
5
- import { readFile as xe } from "fs";
6
- import { join as Ae, relative as Ce } from "path";
7
- function P(o) {
8
- return o.$ref.split("/").pop();
9
- }
10
- function S(o, e) {
11
- const t = P(o);
3
+ import { ResourceAttributionPathSpec as L } from "@ahoo-wang/fetcher-wow";
4
+ import { parse as K } from "yaml";
5
+ import { readFile as Ae } from "fs";
6
+ import { join as Ce, relative as Pe } from "path";
7
+ function P(n) {
8
+ return n.$ref.split("/").pop();
9
+ }
10
+ function S(n, e) {
11
+ const t = P(n);
12
12
  return e.schemas?.[t];
13
13
  }
14
- function K(o, e) {
15
- const t = P(o);
14
+ function Y(n, e) {
15
+ const t = P(n);
16
16
  return e.requestBodies?.[t];
17
17
  }
18
- function Y(o, e) {
19
- const t = P(o);
18
+ function Z(n, e) {
19
+ const t = P(n);
20
20
  return e.parameters?.[t];
21
21
  }
22
- function $(o, e) {
22
+ function $(n, e) {
23
23
  return {
24
- key: P(o),
25
- schema: S(o, e)
24
+ key: P(n),
25
+ schema: S(n, e)
26
26
  };
27
27
  }
28
- const Pe = /[-_\s.]+/;
29
- function N(o) {
30
- return o.split(Pe);
28
+ const $e = /[-_'\s.]+/;
29
+ function O(n) {
30
+ return n.split($e);
31
31
  }
32
- function X(o) {
33
- return Array.isArray(o) ? o.flatMap((e) => L(N(e))) : L(N(o));
32
+ function X(n) {
33
+ return Array.isArray(n) ? n.flatMap((e) => B(O(e))) : B(O(n));
34
34
  }
35
- function L(o) {
36
- return o.flatMap((e) => {
35
+ function B(n) {
36
+ return n.flatMap((e) => {
37
37
  if (e.length === 0)
38
38
  return [];
39
39
  const t = [];
40
- let n = "";
40
+ let o = "";
41
41
  for (let r = 0; r < e.length; r++) {
42
42
  const i = e[r], s = /[A-Z]/.test(i), a = r > 0 && /[a-z]/.test(e[r - 1]);
43
- s && a && n ? (t.push(n), n = i) : n += i;
43
+ s && a && o ? (t.push(o), o = i) : o += i;
44
44
  }
45
- return n && t.push(n), t;
45
+ return o && t.push(o), t;
46
46
  });
47
47
  }
48
- function R(o) {
49
- return o === "" || o.length === 0 ? "" : X(o).filter((t) => t.length > 0).map((t) => {
50
- const n = t.charAt(0), r = t.slice(1);
51
- return (/[a-zA-Z]/.test(n) ? n.toUpperCase() : n) + r.toLowerCase();
48
+ function R(n) {
49
+ return n === "" || n.length === 0 ? "" : X(n).filter((t) => t.length > 0).map((t) => {
50
+ const o = t.charAt(0), r = t.slice(1);
51
+ return (/[a-zA-Z]/.test(o) ? o.toUpperCase() : o) + r.toLowerCase();
52
52
  }).join("");
53
53
  }
54
- function f(o) {
55
- const e = R(o);
54
+ function f(n) {
55
+ const e = R(n);
56
56
  return e.charAt(0).toLowerCase() + e.slice(1);
57
57
  }
58
- function Z(o) {
59
- return o === "" || Array.isArray(o) && o.length === 0 ? "" : X(o).filter((t) => t.length > 0).map((t) => t.toUpperCase()).join("_");
58
+ function ee(n) {
59
+ return n === "" || Array.isArray(n) && n.length === 0 ? "" : X(n).filter((t) => t.length > 0).map((t) => t.toUpperCase()).join("_");
60
60
  }
61
- function g(o) {
62
- return !!(o && typeof o == "object" && "$ref" in o);
61
+ function M(n) {
62
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(n) ? n : `'${n}'`;
63
63
  }
64
- function G(o, e) {
64
+ function Te(n) {
65
+ return /^\d+$/.test(n) ? `NUM_${n}` : M(ee(n));
66
+ }
67
+ function g(n) {
68
+ return !!(n && typeof n == "object" && "$ref" in n);
69
+ }
70
+ function G(n, e) {
65
71
  if (e && !g(e) && e.content)
66
- return e.content[o]?.schema;
72
+ return e.content[n]?.schema;
67
73
  }
68
- function ee(o) {
69
- return G(I.APPLICATION_JSON, o);
74
+ function te(n) {
75
+ return G(I.APPLICATION_JSON, n);
70
76
  }
71
- function $e(o) {
72
- return G(I.TEXT_EVENT_STREAM, o);
77
+ function ve(n) {
78
+ return G(I.TEXT_EVENT_STREAM, n);
73
79
  }
74
- function Te(o) {
75
- return G("*/*", o);
80
+ function Ie(n) {
81
+ return G("*/*", n);
76
82
  }
77
- const ve = [
83
+ const Ee = [
78
84
  "string",
79
85
  "number",
80
86
  "integer",
81
87
  "boolean",
82
88
  "null"
83
89
  ];
84
- function te(o) {
85
- return Array.isArray(o) ? !0 : ve.includes(o);
90
+ function ne(n) {
91
+ return Array.isArray(n) ? !0 : Ee.includes(n);
86
92
  }
87
- function B(o) {
88
- return Array.isArray(o.enum) && o.enum.length > 0;
93
+ function U(n) {
94
+ return Array.isArray(n.enum) && n.enum.length > 0;
89
95
  }
90
- function T(o) {
91
- return o.type === "object" && !!o.properties;
96
+ function T(n) {
97
+ return n.type === "object" && !!n.properties;
92
98
  }
93
- function M(o) {
94
- return o.type === "array" && !!o.items;
99
+ function b(n) {
100
+ return n.type === "array" && !!n.items;
95
101
  }
96
- function Ie(o) {
97
- return Array.isArray(o.anyOf) && o.anyOf.length > 0;
102
+ function Se(n) {
103
+ return Array.isArray(n.anyOf) && n.anyOf.length > 0;
98
104
  }
99
- function Ee(o) {
100
- return Array.isArray(o.oneOf) && o.oneOf.length > 0;
105
+ function Re(n) {
106
+ return Array.isArray(n.oneOf) && n.oneOf.length > 0;
101
107
  }
102
- function b(o) {
103
- return Array.isArray(o.allOf) && o.allOf.length > 0;
108
+ function q(n) {
109
+ return Array.isArray(n.allOf) && n.allOf.length > 0;
104
110
  }
105
- function J(o) {
106
- return Ie(o) || Ee(o) || b(o);
111
+ function J(n) {
112
+ return Se(n) || Re(n) || q(n);
107
113
  }
108
- function Se(o) {
109
- return o.includes("|") || o.includes("&") ? `(${o})[]` : `${o}[]`;
114
+ function we(n) {
115
+ return n.includes("|") || n.includes("&") ? `(${n})[]` : `${n}[]`;
110
116
  }
111
- function Re(o) {
112
- return o.type === "object" && !o.properties && o.additionalProperties !== void 0;
117
+ function Ne(n) {
118
+ return n.type === "object" && !n.properties && n.additionalProperties !== void 0;
113
119
  }
114
- function we(o) {
115
- return o.type !== "object" ? !1 : o.properties ? Object.keys(o.properties).length === 0 : !0;
120
+ function De(n) {
121
+ return n.type !== "object" ? !1 : n.properties ? Object.keys(n.properties).length === 0 : !0;
116
122
  }
117
- function De(o) {
118
- return o.readOnly === !0;
123
+ function Oe(n) {
124
+ return n.readOnly === !0;
119
125
  }
120
- function w(o) {
121
- if (Array.isArray(o))
122
- return o.map((e) => w(e)).join(" | ");
123
- switch (o) {
126
+ function w(n) {
127
+ if (Array.isArray(n))
128
+ return n.map((e) => w(e)).join(" | ");
129
+ switch (n) {
124
130
  case "string":
125
131
  return "string";
126
132
  case "number":
@@ -134,92 +140,92 @@ function w(o) {
134
140
  return "any";
135
141
  }
136
142
  }
137
- function Oe(o) {
138
- if (!T(o))
143
+ function Me(n) {
144
+ if (!T(n))
139
145
  return [];
140
- const e = o.required || [];
141
- return Object.keys(o.properties).filter((t) => !e.includes(t));
146
+ const e = n.required || [];
147
+ return Object.keys(n.properties).filter((t) => !e.includes(t));
142
148
  }
143
- function Ne(o, e) {
144
- return o.operation.operationId && e.operation.operationId ? o.operation.operationId.localeCompare(
149
+ function be(n, e) {
150
+ return n.operation.operationId && e.operation.operationId ? n.operation.operationId.localeCompare(
145
151
  e.operation.operationId
146
- ) : o.path && e.path ? o.path.localeCompare(e.path) : o.method && e.method ? o.method.localeCompare(e.method) : 0;
152
+ ) : n.path && e.path ? n.path.localeCompare(e.path) : n.method && e.method ? n.method.localeCompare(e.method) : 0;
147
153
  }
148
- function ne(o) {
154
+ function oe(n) {
149
155
  const e = [];
150
- for (const [t, n] of Object.entries(o))
151
- oe(n).forEach((r) => {
156
+ for (const [t, o] of Object.entries(n))
157
+ re(o).forEach((r) => {
152
158
  e.push({
153
159
  method: r.method,
154
160
  operation: r.operation,
155
161
  path: t
156
162
  });
157
163
  });
158
- return e.sort(Ne);
164
+ return e.sort(be);
159
165
  }
160
- function oe(o) {
166
+ function re(n) {
161
167
  return [
162
- { method: "get", operation: o.get },
163
- { method: "put", operation: o.put },
164
- { method: "post", operation: o.post },
165
- { method: "delete", operation: o.delete },
166
- { method: "options", operation: o.options },
167
- { method: "head", operation: o.head },
168
- { method: "patch", operation: o.patch },
169
- { method: "trace", operation: o.trace }
168
+ { method: "get", operation: n.get },
169
+ { method: "put", operation: n.put },
170
+ { method: "post", operation: n.post },
171
+ { method: "delete", operation: n.delete },
172
+ { method: "options", operation: n.options },
173
+ { method: "head", operation: n.head },
174
+ { method: "patch", operation: n.patch },
175
+ { method: "trace", operation: n.trace }
170
176
  ].filter(({ operation: e }) => e !== void 0);
171
177
  }
172
- function _(o) {
173
- return o.responses[200];
178
+ function W(n) {
179
+ return n.responses[200];
174
180
  }
175
- function U(o) {
176
- const e = _(o);
177
- return ee(e);
181
+ function Q(n) {
182
+ const e = W(n);
183
+ return te(e);
178
184
  }
179
- function Me(o, e) {
180
- return o.parameters ? o.parameters.map((t) => g(t) ? Y(t, e) : t).filter((t) => t.in === "path") : [];
185
+ function qe(n, e) {
186
+ return n.parameters ? n.parameters.map((t) => g(t) ? Z(t, e) : t).filter((t) => t.in === "path") : [];
181
187
  }
182
- const be = "string";
183
- function re(o) {
184
- return !o.schema || g(o.schema) || !o.schema.type || !te(o.schema.type) ? be : w(o.schema.type);
188
+ const Fe = "string";
189
+ function ie(n) {
190
+ return !n.schema || g(n.schema) || !n.schema.type || !ne(n.schema.type) ? Fe : w(n.schema.type);
185
191
  }
186
- function ie(o) {
187
- return o.startsWith("http://") || o.startsWith("https://") ? qe(o) : Fe(o);
192
+ function se(n) {
193
+ return n.startsWith("http://") || n.startsWith("https://") ? je(n) : _e(n);
188
194
  }
189
- async function qe(o) {
190
- return await (await fetch(o)).text();
195
+ async function je(n) {
196
+ return await (await fetch(n)).text();
191
197
  }
192
- function Fe(o) {
198
+ function _e(n) {
193
199
  return new Promise((e, t) => {
194
- xe(o, "utf-8", (n, r) => {
195
- n ? t(n) : e(r);
200
+ Ae(n, "utf-8", (o, r) => {
201
+ o ? t(o) : e(r);
196
202
  });
197
203
  });
198
204
  }
199
- async function je(o) {
200
- const e = await ie(o);
201
- switch (se(e)) {
205
+ async function Ge(n) {
206
+ const e = await se(n);
207
+ switch (ae(e)) {
202
208
  case "json":
203
209
  return JSON.parse(e);
204
210
  case "yaml":
205
- return H(e);
211
+ return K(e);
206
212
  default:
207
- throw new Error(`Unsupported file format: ${o}`);
213
+ throw new Error(`Unsupported file format: ${n}`);
208
214
  }
209
215
  }
210
- async function Ge(o) {
211
- const e = await ie(o);
212
- switch (se(e)) {
216
+ async function We(n) {
217
+ const e = await se(n);
218
+ switch (ae(e)) {
213
219
  case "json":
214
220
  return JSON.parse(e);
215
221
  case "yaml":
216
- return H(e);
222
+ return K(e);
217
223
  default:
218
- throw new Error(`Unsupported file format: ${o}`);
224
+ throw new Error(`Unsupported file format: ${n}`);
219
225
  }
220
226
  }
221
- function se(o) {
222
- const e = o.trimStart();
227
+ function ae(n) {
228
+ const e = n.trimStart();
223
229
  if (e.startsWith("{") || e.startsWith("["))
224
230
  return "json";
225
231
  if (e.startsWith("-") || e.startsWith("%YAML"))
@@ -232,136 +238,136 @@ function se(o) {
232
238
  }
233
239
  throw new Error("Unable to infer file format");
234
240
  }
235
- const ae = "types.ts", _e = "@";
236
- function We(o) {
237
- return E(o.path, ae);
241
+ const ce = "types.ts", ke = "@";
242
+ function ze(n) {
243
+ return E(n.path, ce);
238
244
  }
239
- function ce(o, e, t) {
240
- const n = E(e, t), r = o.getSourceFile(n);
241
- return r || o.createSourceFile(n, "", {
245
+ function ge(n, e, t) {
246
+ const o = E(e, t), r = n.getSourceFile(o);
247
+ return r || n.createSourceFile(o, "", {
242
248
  overwrite: !0
243
249
  });
244
250
  }
245
- function A(o, e, t) {
246
- let n = o.getImportDeclaration(
251
+ function A(n, e, t) {
252
+ let o = n.getImportDeclaration(
247
253
  (r) => r.getModuleSpecifierValue() === e
248
254
  );
249
- n || (n = o.addImportDeclaration({
255
+ o || (o = n.addImportDeclaration({
250
256
  moduleSpecifier: e
251
257
  })), t.forEach((r) => {
252
- n.getNamedImports().some(
258
+ o.getNamedImports().some(
253
259
  (s) => s.getName() === r
254
- ) || n.addNamedImport(r);
260
+ ) || o.addNamedImport(r);
255
261
  });
256
262
  }
257
- function d(o, e, t) {
258
- if (t.path.startsWith(_e)) {
259
- A(o, t.path, [t.name]);
263
+ function d(n, e, t) {
264
+ if (t.path.startsWith(ke)) {
265
+ A(n, t.path, [t.name]);
260
266
  return;
261
267
  }
262
- const n = o.getDirectoryPath(), r = Ae(e, t.path, ae);
263
- let i = Ce(n, r);
264
- i = i.replace(/\.ts$/, ""), i.startsWith(".") || (i = "./" + i), A(o, i, [t.name]);
268
+ const o = n.getDirectoryPath(), r = Ce(e, t.path, ce);
269
+ let i = Pe(o, r);
270
+ i = i.replace(/\.ts$/, ""), i.startsWith(".") || (i = "./" + i), A(n, i, [t.name]);
265
271
  }
266
- function ke(o, e, t, n) {
267
- o.path !== n.path && d(e, t, n);
272
+ function Le(n, e, t, o) {
273
+ n.path !== o.path && d(e, t, o);
268
274
  }
269
- function ge(o, e = `
275
+ function pe(n, e = `
270
276
  `) {
271
- if (!Array.isArray(o))
277
+ if (!Array.isArray(n))
272
278
  return;
273
- const t = o.filter(
274
- (n) => typeof n == "string" && n.length > 0
279
+ const t = n.filter(
280
+ (o) => typeof o == "string" && o.length > 0
275
281
  );
276
282
  return t.length > 0 ? t.join(e) : void 0;
277
283
  }
278
- function C(o, e) {
279
- const t = ge(e);
280
- t && o.addJsDoc(t);
284
+ function C(n, e) {
285
+ const t = pe(e);
286
+ t && n.addJsDoc(t);
281
287
  }
282
- function W(o, e) {
288
+ function k(n, e) {
283
289
  const t = [
284
- o.title,
285
- o.description
290
+ n.title,
291
+ n.description
286
292
  ];
287
- return e && t.push(`- key: ${e}`), o.format && t.push(`- format: ${o.format}`), Q(t, o, "default"), Q(t, o, "example"), Be(t, o), Je(t, o), Ue(t, o), t;
293
+ return e && t.push(`- key: ${e}`), n.format && t.push(`- format: ${n.format}`), V(t, n, "default"), V(t, n, "example"), Je(t, n), Qe(t, n), Ve(t, n), t;
288
294
  }
289
- function ze(o, e, t) {
290
- const n = W(e, t);
291
- C(o, n);
295
+ function Be(n, e, t) {
296
+ const o = k(e, t);
297
+ C(n, o);
292
298
  }
293
- function Le(o, e, t) {
294
- const n = W(e, t);
295
- pe(n, "schema", e), C(o, n);
299
+ function Ue(n, e, t) {
300
+ const o = k(e, t);
301
+ ue(o, "schema", e), C(n, o);
296
302
  }
297
- function Q(o, e, t) {
298
- const n = e[t];
299
- if (n) {
300
- if (typeof n != "object") {
301
- o.push(`- ${t}: \`${n}\``);
303
+ function V(n, e, t) {
304
+ const o = e[t];
305
+ if (o) {
306
+ if (typeof o != "object") {
307
+ n.push(`- ${t}: \`${o}\``);
302
308
  return;
303
309
  }
304
- pe(o, t, n);
310
+ ue(n, t, o);
305
311
  }
306
312
  }
307
- function pe(o, e, t) {
308
- o.push(`- ${e}: `), o.push("```json"), o.push(JSON.stringify(t, null, 2)), o.push("```");
313
+ function ue(n, e, t) {
314
+ n.push(`- ${e}: `), n.push("```json"), n.push(JSON.stringify(t, null, 2)), n.push("```");
309
315
  }
310
- function Be(o, e) {
316
+ function Je(n, e) {
311
317
  const t = ["- Numeric Constraints"];
312
318
  e.minimum !== void 0 && t.push(` - minimum: ${e.minimum}`), e.maximum !== void 0 && t.push(` - maximum: ${e.maximum}`), e.exclusiveMinimum !== void 0 && t.push(
313
319
  ` - exclusiveMinimum: ${e.exclusiveMinimum}`
314
320
  ), e.exclusiveMaximum !== void 0 && t.push(
315
321
  ` - exclusiveMaximum: ${e.exclusiveMaximum}`
316
- ), e.multipleOf !== void 0 && t.push(` - multipleOf: ${e.multipleOf}`), t.length !== 1 && o.push(...t);
322
+ ), e.multipleOf !== void 0 && t.push(` - multipleOf: ${e.multipleOf}`), t.length !== 1 && n.push(...t);
317
323
  }
318
- function Je(o, e) {
324
+ function Qe(n, e) {
319
325
  const t = ["- String Constraints"];
320
- e.minLength !== void 0 && t.push(` - minLength: ${e.minLength}`), e.maxLength !== void 0 && t.push(` - maxLength: ${e.maxLength}`), e.pattern !== void 0 && t.push(` - pattern: ${e.pattern}`), t.length !== 1 && o.push(...t);
326
+ e.minLength !== void 0 && t.push(` - minLength: ${e.minLength}`), e.maxLength !== void 0 && t.push(` - maxLength: ${e.maxLength}`), e.pattern !== void 0 && t.push(` - pattern: ${e.pattern}`), t.length !== 1 && n.push(...t);
321
327
  }
322
- function Ue(o, e) {
328
+ function Ve(n, e) {
323
329
  const t = ["- Array Constraints"];
324
- e.minItems !== void 0 && t.push(` - minItems: ${e.minItems}`), e.maxItems !== void 0 && t.push(` - maxItems: ${e.maxItems}`), e.uniqueItems !== void 0 && t.push(` - uniqueItems: ${e.uniqueItems}`), t.length !== 1 && o.push(...t);
330
+ e.minItems !== void 0 && t.push(` - minItems: ${e.minItems}`), e.maxItems !== void 0 && t.push(` - maxItems: ${e.maxItems}`), e.uniqueItems !== void 0 && t.push(` - uniqueItems: ${e.uniqueItems}`), t.length !== 1 && n.push(...t);
325
331
  }
326
- function Qe(o) {
327
- const e = o.split(".");
332
+ function He(n) {
333
+ const e = n.split(".");
328
334
  return e.length != 2 || e[0].length === 0 || e[1].length === 0 ? null : e;
329
335
  }
330
- function Ve(o) {
331
- const e = Qe(o.name);
336
+ function Ke(n) {
337
+ const e = He(n.name);
332
338
  return e ? {
333
- tag: o,
339
+ tag: n,
334
340
  contextAlias: e[0],
335
341
  aggregateName: e[1]
336
342
  } : null;
337
343
  }
338
- function He(o) {
339
- const e = o?.map((n) => Ve(n)).filter((n) => n !== null);
344
+ function Ye(n) {
345
+ const e = n?.map((o) => Ke(o)).filter((o) => o !== null);
340
346
  if (!e)
341
347
  return /* @__PURE__ */ new Map();
342
348
  const t = /* @__PURE__ */ new Map();
343
- return e.forEach((n) => {
344
- t.set(n.tag.name, {
345
- aggregate: n,
349
+ return e.forEach((o) => {
350
+ t.set(o.tag.name, {
351
+ aggregate: o,
346
352
  commands: /* @__PURE__ */ new Map(),
347
353
  events: /* @__PURE__ */ new Map()
348
354
  });
349
355
  }), t;
350
356
  }
351
- function Ke(o) {
352
- if (!o)
357
+ function Ze(n) {
358
+ if (!n)
353
359
  return null;
354
- const e = o.split(".");
360
+ const e = n.split(".");
355
361
  return e.length != 3 ? null : e[2];
356
362
  }
357
- const Ye = "#/components/responses/wow.CommandOk", Xe = "#/components/parameters/wow.id";
358
- class Ze {
363
+ const Xe = "#/components/responses/wow.CommandOk", et = "#/components/parameters/wow.id";
364
+ class tt {
359
365
  /**
360
366
  * Creates a new AggregateResolver instance.
361
367
  * @param openAPI - The OpenAPI specification to resolve aggregates from
362
368
  */
363
369
  constructor(e) {
364
- this.openAPI = e, this.aggregates = He(e.tags), this.build();
370
+ this.openAPI = e, this.aggregates = Ye(e.tags), this.build();
365
371
  }
366
372
  aggregates;
367
373
  /**
@@ -369,7 +375,7 @@ class Ze {
369
375
  * @private
370
376
  */
371
377
  build() {
372
- const e = ne(this.openAPI.paths);
378
+ const e = oe(this.openAPI.paths);
373
379
  for (const t of e)
374
380
  this.commands(t.path, t), this.state(t.operation), this.events(t.operation), this.fields(t.operation);
375
381
  }
@@ -382,9 +388,9 @@ class Ze {
382
388
  for (const t of this.aggregates.values()) {
383
389
  if (!t.state || !t.fields)
384
390
  continue;
385
- const n = t.aggregate.contextAlias;
386
- let r = e.get(n);
387
- r || (r = /* @__PURE__ */ new Set(), e.set(n, r)), r.add(t);
391
+ const o = t.aggregate.contextAlias;
392
+ let r = e.get(o);
393
+ r || (r = /* @__PURE__ */ new Set(), e.set(o, r)), r.add(t);
388
394
  }
389
395
  return e;
390
396
  }
@@ -394,43 +400,43 @@ class Ze {
394
400
  * @param methodOperation - The HTTP method and operation details
395
401
  */
396
402
  commands(e, t) {
397
- const n = t.operation;
398
- if (n.operationId === "wow.command.send")
403
+ const o = t.operation;
404
+ if (o.operationId === "wow.command.send")
399
405
  return;
400
- const r = Ke(n.operationId);
406
+ const r = Ze(o.operationId);
401
407
  if (!r)
402
408
  return;
403
- const i = _(n);
404
- if (!i || !g(i) || i.$ref !== Ye || !n.requestBody)
409
+ const i = W(o);
410
+ if (!i || !g(i) || i.$ref !== Xe || !o.requestBody)
405
411
  return;
406
- const s = n.parameters ?? [], a = s.filter((l) => g(l) && l.$ref === Xe).at(0), c = s.filter(
412
+ const s = o.parameters ?? [], a = s.filter((l) => g(l) && l.$ref === et).at(0), c = s.filter(
407
413
  (l) => !g(l) && l.in === "path"
408
414
  );
409
415
  if (a) {
410
- const l = Y(
416
+ const l = Z(
411
417
  a,
412
418
  this.openAPI.components
413
419
  );
414
420
  c.push(l);
415
421
  }
416
- const p = n.requestBody.content[I.APPLICATION_JSON].schema, x = $(
422
+ const p = o.requestBody.content[I.APPLICATION_JSON].schema, x = $(
417
423
  p,
418
424
  this.openAPI.components
419
425
  );
420
- x.schema.title = x.schema.title || n.summary, x.schema.description = x.schema.description || n.description;
421
- const fe = {
426
+ x.schema.title = x.schema.title || o.summary, x.schema.description = x.schema.description || o.description;
427
+ const he = {
422
428
  name: r,
423
429
  method: t.method,
424
430
  path: e,
425
431
  pathParameters: c,
426
- summary: n.summary,
427
- description: n.description,
432
+ summary: o.summary,
433
+ description: o.description,
428
434
  schema: x,
429
- operation: n
435
+ operation: o
430
436
  };
431
- n.tags?.forEach((l) => {
432
- const k = this.aggregates.get(l);
433
- k && k.commands.set(r, fe);
437
+ o.tags?.forEach((l) => {
438
+ const z = this.aggregates.get(l);
439
+ z && z.commands.set(r, he);
434
440
  });
435
441
  }
436
442
  /**
@@ -440,16 +446,16 @@ class Ze {
440
446
  state(e) {
441
447
  if (!e.operationId?.endsWith(".snapshot_state.single"))
442
448
  return;
443
- const t = U(e);
449
+ const t = Q(e);
444
450
  if (!g(t))
445
451
  return;
446
- const n = $(
452
+ const o = $(
447
453
  t,
448
454
  this.openAPI.components
449
455
  );
450
456
  e.tags?.forEach((r) => {
451
457
  const i = this.aggregates.get(r);
452
- i && (i.state = n);
458
+ i && (i.state = o);
453
459
  });
454
460
  }
455
461
  /**
@@ -459,14 +465,14 @@ class Ze {
459
465
  events(e) {
460
466
  if (!this.openAPI.components || !e.operationId?.endsWith(".event.list_query"))
461
467
  return;
462
- const t = U(e);
468
+ const t = Q(e);
463
469
  if (g(t))
464
470
  return;
465
- const n = t?.items;
466
- if (!g(n))
471
+ const o = t?.items;
472
+ if (!g(o))
467
473
  return;
468
474
  const i = S(
469
- n,
475
+ o,
470
476
  this.openAPI.components
471
477
  ).properties.body.items.anyOf.map((s) => {
472
478
  const a = s.title, c = s.properties.name.const, u = s.properties.body, p = $(
@@ -493,11 +499,11 @@ class Ze {
493
499
  fields(e) {
494
500
  if (!this.openAPI.components || !e.operationId?.endsWith(".snapshot.count"))
495
501
  return;
496
- const n = K(
502
+ const o = Y(
497
503
  e.requestBody,
498
504
  this.openAPI.components
499
505
  ).content[I.APPLICATION_JSON].schema, i = S(
500
- n,
506
+ o,
501
507
  this.openAPI.components
502
508
  ).properties?.field, s = $(i, this.openAPI.components);
503
509
  e.tags?.forEach((a) => {
@@ -506,7 +512,7 @@ class Ze {
506
512
  });
507
513
  }
508
514
  }
509
- const y = "@ahoo-wang/fetcher-wow", et = {
515
+ const y = "@ahoo-wang/fetcher-wow", nt = {
510
516
  "wow.command.CommandResult": "CommandResult",
511
517
  "wow.command.CommandResultArray": "CommandResultArray",
512
518
  "wow.MessageHeaderSqlType": "MessageHeaderSqlType",
@@ -536,44 +542,44 @@ const y = "@ahoo-wang/fetcher-wow", et = {
536
542
  "wow.openapi.BatchResult": "BatchResult",
537
543
  "wow.messaging.CompensationTarget": "CompensationTarget"
538
544
  };
539
- function m(o) {
540
- if (!o)
545
+ function m(n) {
546
+ if (!n)
541
547
  return { name: "", path: "/" };
542
- const e = et[o];
548
+ const e = nt[n];
543
549
  if (e)
544
550
  return { name: e, path: y };
545
- const t = o.split(".");
546
- let n = -1;
551
+ const t = n.split(".");
552
+ let o = -1;
547
553
  for (let c = 0; c < t.length; c++)
548
554
  if (t[c] && /^[A-Z]/.test(t[c])) {
549
- n = c;
555
+ o = c;
550
556
  break;
551
557
  }
552
- const r = t.slice(0, n), i = r.length > 0 ? `/${r.join("/")}` : "/", s = t.slice(n);
558
+ const r = t.slice(0, o), i = r.length > 0 ? `/${r.join("/")}` : "/", s = t.slice(o);
553
559
  return { name: R(s), path: i };
554
560
  }
555
- function v(o) {
556
- const e = P(o);
561
+ function v(n) {
562
+ const e = P(n);
557
563
  return m(e);
558
564
  }
559
- function D(o) {
560
- return `${Z(o)}_BOUNDED_CONTEXT_ALIAS`;
565
+ function N(n) {
566
+ return `${ee(n)}_BOUNDED_CONTEXT_ALIAS`;
561
567
  }
562
- class tt {
563
- constructor(e, t, n, r) {
564
- this.modelInfo = e, this.sourceFile = t, this.keySchema = n, this.outputDir = r;
568
+ class ot {
569
+ constructor(e, t, o, r) {
570
+ this.modelInfo = e, this.sourceFile = t, this.keySchema = o, this.outputDir = r;
565
571
  }
566
572
  generate() {
567
573
  const e = this.process();
568
- e && Le(e, this.keySchema.schema, this.keySchema.key);
574
+ e && Ue(e, this.keySchema.schema, this.keySchema.key);
569
575
  }
570
576
  process() {
571
577
  const { schema: e } = this.keySchema;
572
- return B(e) ? this.processEnum(e) : T(e) ? this.processInterface(e) : M(e) ? this.processArray(e) : b(e) ? this.processIntersection(e) : J(e) ? this.processComposition(e) : this.processTypeAlias(e);
578
+ return U(e) ? this.processEnum(e) : T(e) ? this.processInterface(e) : b(e) ? this.processArray(e) : q(e) ? this.processIntersection(e) : J(e) ? this.processComposition(e) : this.processTypeAlias(e);
573
579
  }
574
580
  resolveReference(e) {
575
581
  const t = v(e);
576
- return ke(
582
+ return Le(
577
583
  this.modelInfo,
578
584
  this.sourceFile,
579
585
  this.outputDir,
@@ -585,20 +591,20 @@ class tt {
585
591
  }
586
592
  resolvePropertyDefinitions(e) {
587
593
  const { properties: t } = e;
588
- return Object.entries(t).map(([n, r]) => {
589
- const i = this.resolveType(r);
594
+ return Object.entries(t).map(([o, r]) => {
595
+ const i = this.resolveType(r), s = M(o);
590
596
  if (!g(r)) {
591
- const s = W(r), a = ge(s, `
597
+ const a = k(r), c = pe(a, `
592
598
  * `);
593
- if (a)
599
+ if (c)
594
600
  return `
595
601
  /**
596
- * ${a}
602
+ * ${c}
597
603
  */
598
- ${n}: ${i}
604
+ ${s}: ${i}
599
605
  `;
600
606
  }
601
- return `${n}: ${i}`;
607
+ return `${s}: ${i}`;
602
608
  });
603
609
  }
604
610
  resolveObjectType(e) {
@@ -607,8 +613,8 @@ class tt {
607
613
  const r = this.resolvePropertyDefinitions(e);
608
614
  t.push(...r);
609
615
  }
610
- const n = this.resolveAdditionalProperties(e);
611
- return n && t.push(n), t.length === 0 ? "Record<string, any>" : `{
616
+ const o = this.resolveAdditionalProperties(e);
617
+ return o && t.push(o), t.length === 0 ? "Record<string, any>" : `{
612
618
  ${t.join(`;
613
619
  `)};
614
620
  }`;
@@ -619,19 +625,19 @@ class tt {
619
625
  resolveType(e) {
620
626
  if (g(e))
621
627
  return this.resolveReference(e).name;
622
- if (Re(e))
628
+ if (Ne(e))
623
629
  return `Record<string,${this.resolveMapValueType(e)}>`;
624
630
  if (e.const)
625
631
  return `'${e.const}'`;
626
- if (B(e))
627
- return e.enum.map((t) => `'${t}'`).join(" | ");
632
+ if (U(e))
633
+ return e.enum.map((t) => `\`${t}\``).join(" | ");
628
634
  if (J(e)) {
629
- const n = (e.oneOf || e.anyOf || e.allOf || []).map((i) => this.resolveType(i)), r = b(e) ? " & " : " | ";
630
- return `(${n.join(r)})`;
635
+ const o = (e.oneOf || e.anyOf || e.allOf || []).map((i) => this.resolveType(i)), r = q(e) ? " & " : " | ";
636
+ return `(${o.join(r)})`;
631
637
  }
632
- if (M(e)) {
638
+ if (b(e)) {
633
639
  const t = this.resolveType(e.items);
634
- return Se(t);
640
+ return we(t);
635
641
  }
636
642
  return e.type === "object" ? this.resolveObjectType(e) : e.type ? w(e.type) : "any";
637
643
  }
@@ -640,26 +646,26 @@ class tt {
640
646
  name: this.modelInfo.name,
641
647
  isExported: !0,
642
648
  members: e.enum.filter((t) => typeof t == "string" && t.length > 0).map((t) => ({
643
- name: Z(t),
644
- initializer: `'${t}'`
649
+ name: Te(t),
650
+ initializer: `\`${t}\``
645
651
  }))
646
652
  });
647
653
  }
648
- addPropertyToInterface(e, t, n) {
649
- const r = this.resolveType(n);
650
- let i = e.getProperty(t);
651
- i ? i.setType(r) : i = e.addProperty({
652
- name: t,
654
+ addPropertyToInterface(e, t, o) {
655
+ const r = this.resolveType(o), i = M(t);
656
+ let s = e.getProperty(i);
657
+ s ? s.setType(r) : s = e.addProperty({
658
+ name: i,
653
659
  type: r,
654
- isReadonly: De(n)
655
- }), ze(i, n);
660
+ isReadonly: Oe(o)
661
+ }), Be(s, o);
656
662
  }
657
663
  processInterface(e) {
658
664
  const t = this.sourceFile.addInterface({
659
665
  name: this.modelInfo.name,
660
666
  isExported: !0
661
- }), n = e.properties || {};
662
- return Object.entries(n).forEach(([r, i]) => {
667
+ }), o = e.properties || {};
668
+ return Object.entries(o).forEach(([r, i]) => {
663
669
  this.addPropertyToInterface(t, r, i);
664
670
  }), e.additionalProperties && t.addIndexSignature({
665
671
  keyName: "key",
@@ -689,13 +695,13 @@ class tt {
689
695
  name: this.modelInfo.name,
690
696
  isExported: !0
691
697
  });
692
- return e.allOf.forEach((n) => {
693
- if (g(n)) {
694
- const r = this.resolveType(n);
698
+ return e.allOf.forEach((o) => {
699
+ if (g(o)) {
700
+ const r = this.resolveType(o);
695
701
  t.addExtends(r);
696
702
  return;
697
703
  }
698
- T(n) && Object.entries(n.properties).forEach(
704
+ T(o) && Object.entries(o.properties).forEach(
699
705
  ([r, i]) => {
700
706
  this.addPropertyToInterface(
701
707
  t,
@@ -714,12 +720,12 @@ class tt {
714
720
  });
715
721
  }
716
722
  }
717
- class nt {
723
+ class rt {
718
724
  constructor(e) {
719
725
  this.context = e;
720
726
  }
721
727
  getOrCreateSourceFile(e) {
722
- const t = We(e);
728
+ const t = ze(e);
723
729
  return this.context.getOrCreateSourceFile(t);
724
730
  }
725
731
  /**
@@ -736,24 +742,24 @@ class nt {
736
742
  this.context.logger.info("No schemas found in OpenAPI specification");
737
743
  return;
738
744
  }
739
- const t = this.stateAggregatedTypeNames(), n = this.filterSchemas(e, t);
745
+ const t = this.stateAggregatedTypeNames(), o = this.filterSchemas(e, t);
740
746
  this.context.logger.progress(
741
- `Generating models for ${n.length} schemas`
742
- ), n.forEach((r, i) => {
747
+ `Generating models for ${o.length} schemas`
748
+ ), o.forEach((r, i) => {
743
749
  this.context.logger.progressWithCount(
744
750
  i + 1,
745
- n.length,
751
+ o.length,
746
752
  `Processing schema: ${r.key}`,
747
753
  2
748
754
  ), this.generateKeyedSchema(r);
749
755
  }), this.context.logger.success("Model generation completed");
750
756
  }
751
757
  filterSchemas(e, t) {
752
- return Object.entries(e).map(([n, r]) => ({
753
- key: n,
758
+ return Object.entries(e).map(([o, r]) => ({
759
+ key: o,
754
760
  schema: r
755
761
  })).filter(
756
- (n) => !this.isWowSchema(n.key, t)
762
+ (o) => !this.isWowSchema(o.key, t)
757
763
  );
758
764
  }
759
765
  isWowSchema(e, t) {
@@ -763,8 +769,8 @@ class nt {
763
769
  "AggregatedDomainEventStreamServerSentEventNonNullData"
764
770
  ) || e.endsWith("AggregatedListQuery") || e.endsWith("AggregatedPagedQuery") || e.endsWith("AggregatedSingleQuery"))
765
771
  return !0;
766
- const n = m(e);
767
- return t.has(n.name);
772
+ const o = m(e);
773
+ return t.has(o.name);
768
774
  }
769
775
  aggregatedSchemaSuffix = [
770
776
  "MaterializedSnapshot",
@@ -777,9 +783,9 @@ class nt {
777
783
  ];
778
784
  stateAggregatedTypeNames() {
779
785
  const e = /* @__PURE__ */ new Set();
780
- for (const [t, n] of this.context.contextAggregates) {
786
+ for (const [t, o] of this.context.contextAggregates) {
781
787
  this.generateBoundedContext(t);
782
- for (const r of n)
788
+ for (const r of o)
783
789
  this.aggregatedSchemaSuffix.forEach((i) => {
784
790
  const s = m(r.state.key), a = R(s.name) + i;
785
791
  e.add(a);
@@ -800,10 +806,10 @@ class nt {
800
806
  * 4. Type alias processing
801
807
  */
802
808
  generateKeyedSchema(e) {
803
- const t = m(e.key), n = this.getOrCreateSourceFile(t);
804
- new tt(
809
+ const t = m(e.key), o = this.getOrCreateSourceFile(t);
810
+ new ot(
805
811
  t,
806
- n,
812
+ o,
807
813
  e,
808
814
  this.context.outputDir
809
815
  ).generate();
@@ -811,11 +817,11 @@ class nt {
811
817
  generateBoundedContext(e) {
812
818
  const t = `${e}/boundedContext.ts`;
813
819
  this.context.logger.info(`Creating bounded context file: ${t}`);
814
- const n = this.context.getOrCreateSourceFile(t), r = D(e);
815
- n.addStatements(`export const ${r} = '${e}';`);
820
+ const o = this.context.getOrCreateSourceFile(t), r = N(e);
821
+ o.addStatements(`export const ${r} = '${e}';`);
816
822
  }
817
823
  }
818
- const ot = "@ahoo-wang/fetcher-decorator", rt = [
824
+ const it = "@ahoo-wang/fetcher-decorator", st = [
819
825
  "type ApiMetadata",
820
826
  "type ApiMetadataCapable",
821
827
  "type ParameterRequest",
@@ -829,24 +835,24 @@ const ot = "@ahoo-wang/fetcher-decorator", rt = [
829
835
  "attribute",
830
836
  "path",
831
837
  "autoGeneratedError"
832
- ], it = {
838
+ ], at = {
833
839
  type: "Promise<Response>",
834
840
  metadata: "{resultExtractor: ResultExtractors.Response }"
835
- }, V = {
841
+ }, H = {
836
842
  type: "Promise<string>",
837
843
  metadata: "{resultExtractor: ResultExtractors.Text }"
838
- }, q = `{
844
+ }, F = `{
839
845
  headers: { Accept: ContentTypeValues.TEXT_EVENT_STREAM },
840
846
  resultExtractor: JsonEventStreamResultExtractor,
841
847
  }`;
842
- function ue(o) {
843
- A(o, ot, rt);
848
+ function le(n) {
849
+ A(n, it, st);
844
850
  }
845
- function F(o, e, t = [], n = [], r) {
851
+ function j(n, e, t = [], o = [], r) {
846
852
  return e.addClass({
847
- name: o,
853
+ name: n,
848
854
  isExported: !0,
849
- typeParameters: n,
855
+ typeParameters: o,
850
856
  extends: r,
851
857
  decorators: [
852
858
  {
@@ -856,68 +862,68 @@ function F(o, e, t = [], n = [], r) {
856
862
  ]
857
863
  });
858
864
  }
859
- function le(o, e) {
860
- o.addImplements("ApiMetadataCapable"), o.addConstructor({
865
+ function me(n, e) {
866
+ n.addImplements("ApiMetadataCapable"), n.addConstructor({
861
867
  parameters: [
862
868
  {
863
869
  name: "apiMetadata",
864
870
  type: "ApiMetadata",
865
871
  hasQuestionToken: e === void 0,
866
- scope: he.Public,
872
+ scope: ye.Public,
867
873
  isReadonly: !0,
868
874
  initializer: e
869
875
  }
870
876
  ]
871
877
  });
872
878
  }
873
- const st = "@ahoo-wang/fetcher-eventstream";
874
- function me(o) {
875
- A(o, st, [
879
+ const ct = "@ahoo-wang/fetcher-eventstream";
880
+ function de(n) {
881
+ A(n, ct, [
876
882
  "JsonEventStreamResultExtractor",
877
883
  "type JsonServerSentEventStream"
878
884
  ]);
879
885
  }
880
- function at(o) {
886
+ function gt(n) {
881
887
  let e = 0, t = 0;
882
- return o.commands.forEach((n) => {
883
- n.path.startsWith(z.TENANT) && (e += 1), n.path.startsWith(z.OWNER) && (t += 1);
888
+ return n.commands.forEach((o) => {
889
+ o.path.startsWith(L.TENANT) && (e += 1), o.path.startsWith(L.OWNER) && (t += 1);
884
890
  }), e === 0 && t === 0 ? "ResourceAttributionPathSpec.NONE" : e > t ? "ResourceAttributionPathSpec.TENANT" : "ResourceAttributionPathSpec.OWNER";
885
891
  }
886
- function de(o, e, t, n) {
887
- const r = `${t.contextAlias}/${t.aggregateName}/${n}.ts`;
888
- return ce(o, e, r);
892
+ function fe(n, e, t, o) {
893
+ const r = `${t.contextAlias}/${t.aggregateName}/${o}.ts`;
894
+ return ge(n, e, r);
889
895
  }
890
- function h(o, e) {
891
- return `${R(o.aggregateName)}${e}`;
896
+ function h(n, e) {
897
+ return `${R(n.aggregateName)}${e}`;
892
898
  }
893
- function j(o) {
894
- return o === "delete" ? "del" : o;
899
+ function _(n) {
900
+ return n === "delete" ? "del" : n;
895
901
  }
896
- const ct = "x-fetcher-method";
897
- function gt(o, e) {
898
- const t = o[ct];
902
+ const pt = "x-fetcher-method";
903
+ function ut(n, e) {
904
+ const t = n[pt];
899
905
  if (t)
900
906
  return t;
901
- if (!o.operationId)
907
+ if (!n.operationId)
902
908
  return;
903
- const n = N(o.operationId);
904
- for (let r = n.length - 1; r >= 0; r--) {
905
- const i = f(n.slice(r));
909
+ const o = O(n.operationId);
910
+ for (let r = o.length - 1; r >= 0; r--) {
911
+ const i = f(o.slice(r));
906
912
  if (!e(i))
907
913
  return i;
908
914
  }
909
- return f(n);
915
+ return f(o);
910
916
  }
911
- class pt {
917
+ class lt {
912
918
  /**
913
919
  * Creates a new ApiClientGenerator instance.
914
920
  * @param context - The generation context containing OpenAPI spec and configuration
915
921
  */
916
922
  constructor(e) {
917
- this.context = e, this.apiMetadataCtorInitializer = this.context.currentContextAlias ? `{basePath:${D(this.context.currentContextAlias)}}` : void 0;
923
+ this.context = e, this.apiMetadataCtorInitializer = this.context.currentContextAlias ? `{basePath:${N(this.context.currentContextAlias)}}` : void 0;
918
924
  }
919
925
  defaultParameterRequestType = "ParameterRequest";
920
- defaultReturnType = it;
926
+ defaultReturnType = at;
921
927
  apiMetadataCtorInitializer;
922
928
  /**
923
929
  * Generates API client classes for all valid tags in the OpenAPI specification.
@@ -943,10 +949,10 @@ class pt {
943
949
  this.context.logger.info(
944
950
  `Generating ${t.size} API client classes`
945
951
  );
946
- let n = 0;
952
+ let o = 0;
947
953
  for (const [r, i] of t) {
948
- n++, this.context.logger.progressWithCount(
949
- n,
954
+ o++, this.context.logger.progressWithCount(
955
+ o,
950
956
  t.size,
951
957
  `Generating API client for tag: ${r}`
952
958
  );
@@ -969,22 +975,22 @@ class pt {
969
975
  * @param operations - Set of operations for this client
970
976
  */
971
977
  generateApiClient(e, t) {
972
- const n = m(e.name);
978
+ const o = m(e.name);
973
979
  this.context.logger.info(
974
- `Generating API client class: ${n.name}ApiClient with ${t.size} operations`
980
+ `Generating API client class: ${o.name}ApiClient with ${t.size} operations`
975
981
  );
976
- const r = this.createApiClientFile(n);
977
- ue(r), me(r);
978
- const i = F(
979
- n.name + "ApiClient",
982
+ const r = this.createApiClientFile(o);
983
+ le(r), de(r);
984
+ const i = j(
985
+ o.name + "ApiClient",
980
986
  r
981
987
  );
982
- C(i, [e.description]), le(i, this.apiMetadataCtorInitializer), this.context.logger.info(
983
- `Processing ${t.size} operations for ${n.name}ApiClient`
988
+ C(i, [e.description]), me(i, this.apiMetadataCtorInitializer), this.context.logger.info(
989
+ `Processing ${t.size} operations for ${o.name}ApiClient`
984
990
  ), t.forEach((s) => {
985
991
  this.processOperation(e, r, i, s);
986
992
  }), this.context.logger.success(
987
- `Completed API client: ${n.name}ApiClient`
993
+ `Completed API client: ${o.name}ApiClient`
988
994
  );
989
995
  }
990
996
  /**
@@ -994,12 +1000,12 @@ class pt {
994
1000
  * @returns A unique camelCase method name
995
1001
  */
996
1002
  getMethodName(e, t) {
997
- const n = gt(t, (r) => e.getMethod(r) !== void 0);
998
- if (!n)
1003
+ const o = ut(t, (r) => e.getMethod(r) !== void 0);
1004
+ if (!o)
999
1005
  throw new Error(
1000
1006
  `Unable to resolve method name for apiClientClass:${e.getName()}.`
1001
1007
  );
1002
- return n;
1008
+ return o;
1003
1009
  }
1004
1010
  /**
1005
1011
  * Resolves the request type for an operation based on its request body.
@@ -1012,22 +1018,22 @@ class pt {
1012
1018
  return this.context.logger.info(
1013
1019
  `No request body found for operation ${t.operationId}, using default: ${this.defaultParameterRequestType}`
1014
1020
  ), this.defaultParameterRequestType;
1015
- let n;
1021
+ let o;
1016
1022
  if (g(t.requestBody) ? (this.context.logger.info(
1017
1023
  `Extracting request body from reference for operation: ${t.operationId}`
1018
- ), n = K(
1024
+ ), o = Y(
1019
1025
  t.requestBody,
1020
1026
  this.context.openAPI.components
1021
- )) : n = t.requestBody, !n)
1027
+ )) : o = t.requestBody, !o)
1022
1028
  return this.context.logger.info(
1023
1029
  `Request body extraction failed for operation ${t.operationId}, using default: ${this.defaultParameterRequestType}`
1024
1030
  ), this.defaultParameterRequestType;
1025
- if (n.content["multipart/form-data"])
1031
+ if (o.content["multipart/form-data"])
1026
1032
  return this.context.logger.info(
1027
1033
  `Detected multipart/form-data content for operation ${t.operationId}, using ParameterRequest<FormData>`
1028
1034
  ), "ParameterRequest<FormData>";
1029
- if (n.content["application/json"]) {
1030
- const r = n.content["application/json"].schema;
1035
+ if (o.content["application/json"]) {
1036
+ const r = o.content["application/json"].schema;
1031
1037
  if (g(r)) {
1032
1038
  const i = v(r);
1033
1039
  this.context.logger.info(
@@ -1050,19 +1056,19 @@ class pt {
1050
1056
  * @param operation - The operation to resolve parameters for
1051
1057
  * @returns Array of parameter declarations
1052
1058
  */
1053
- resolveParameters(e, t, n) {
1054
- const r = Me(
1055
- n,
1059
+ resolveParameters(e, t, o) {
1060
+ const r = qe(
1061
+ o,
1056
1062
  this.context.openAPI.components
1057
1063
  ).filter((a) => !this.context.isIgnoreApiClientPathParameters(
1058
1064
  e.name,
1059
1065
  a.name
1060
1066
  ));
1061
1067
  this.context.logger.info(
1062
- `Found ${r.length} path parameters for operation ${n.operationId}`
1068
+ `Found ${r.length} path parameters for operation ${o.operationId}`
1063
1069
  );
1064
1070
  const i = r.map((a) => {
1065
- const c = re(a);
1071
+ const c = ie(a);
1066
1072
  return this.context.logger.info(
1067
1073
  `Adding path parameter: ${a.name} (type: ${c})`
1068
1074
  ), {
@@ -1076,7 +1082,7 @@ class pt {
1076
1082
  }
1077
1083
  ]
1078
1084
  };
1079
- }), s = this.resolveRequestType(t, n);
1085
+ }), s = this.resolveRequestType(t, o);
1080
1086
  return this.context.logger.info(`Adding httpRequest parameter: ${s}`), i.push({
1081
1087
  name: "httpRequest",
1082
1088
  hasQuestionToken: s === this.defaultParameterRequestType,
@@ -1108,7 +1114,7 @@ class pt {
1108
1114
  * @returns The resolved return type string
1109
1115
  */
1110
1116
  resolveSchemaReturnType(e, t) {
1111
- const n = "Promise<any>";
1117
+ const o = "Promise<any>";
1112
1118
  if (g(t)) {
1113
1119
  const r = v(t);
1114
1120
  this.context.logger.info(
@@ -1119,15 +1125,15 @@ class pt {
1119
1125
  }
1120
1126
  if (!t.type)
1121
1127
  return this.context.logger.info(
1122
- `Schema has no type, using default return type: ${n}`
1123
- ), n;
1124
- if (te(t.type)) {
1128
+ `Schema has no type, using default return type: ${o}`
1129
+ ), o;
1130
+ if (ne(t.type)) {
1125
1131
  const i = `Promise<${w(t.type)}>`;
1126
1132
  return this.context.logger.info(`Resolved primitive return type: ${i}`), i;
1127
1133
  }
1128
1134
  return this.context.logger.info(
1129
- `Using default return type: ${n}`
1130
- ), n;
1135
+ `Using default return type: ${o}`
1136
+ ), o;
1131
1137
  }
1132
1138
  /**
1133
1139
  * Resolves the return type for an operation based on its responses.
@@ -1136,29 +1142,29 @@ class pt {
1136
1142
  * @returns Object containing type and optional stream flag
1137
1143
  */
1138
1144
  resolveReturnType(e, t) {
1139
- const n = _(t);
1140
- if (!n)
1145
+ const o = W(t);
1146
+ if (!o)
1141
1147
  return this.context.logger.info(
1142
1148
  `No OK response found for operation ${t.operationId}, using default return type: ${this.defaultReturnType.type}`
1143
1149
  ), this.defaultReturnType;
1144
- const r = ee(n) || Te(n);
1150
+ const r = te(o) || Ie(o);
1145
1151
  if (r) {
1146
1152
  const s = this.resolveSchemaReturnType(e, r);
1147
1153
  return this.context.logger.info(
1148
1154
  `Resolved JSON/wildcard response return type for operation ${t.operationId}: ${s}`
1149
1155
  ), {
1150
1156
  type: s,
1151
- metadata: s === V.type ? V.metadata : void 0
1157
+ metadata: s === H.type ? H.metadata : void 0
1152
1158
  };
1153
1159
  }
1154
- const i = $e(n);
1160
+ const i = ve(o);
1155
1161
  if (i) {
1156
1162
  if (g(i)) {
1157
1163
  const a = S(
1158
1164
  i,
1159
1165
  this.context.openAPI.components
1160
1166
  );
1161
- if (M(a) && g(a.items)) {
1167
+ if (b(a) && g(a.items)) {
1162
1168
  const c = v(a.items);
1163
1169
  this.context.logger.info(
1164
1170
  `Adding import for event stream model: ${c.name} from ${c.path}`
@@ -1168,14 +1174,14 @@ class pt {
1168
1174
  `Resolved event stream return type for operation ${t.operationId}: ${p}`
1169
1175
  ), {
1170
1176
  type: p,
1171
- metadata: q
1177
+ metadata: F
1172
1178
  };
1173
1179
  }
1174
1180
  }
1175
1181
  const s = "Promise<JsonServerSentEventStream<any>>";
1176
1182
  return this.context.logger.info(
1177
1183
  `Resolved generic event stream return type for operation ${t.operationId}: ${s}`
1178
- ), { type: s, metadata: q };
1184
+ ), { type: s, metadata: F };
1179
1185
  }
1180
1186
  return this.context.logger.info(
1181
1187
  `Using default return type for operation ${t.operationId}: ${this.defaultReturnType.type}`
@@ -1188,27 +1194,27 @@ class pt {
1188
1194
  * @param apiClientClass - The client class to add the method to
1189
1195
  * @param operation - The operation to process
1190
1196
  */
1191
- processOperation(e, t, n, r) {
1197
+ processOperation(e, t, o, r) {
1192
1198
  this.context.logger.info(
1193
1199
  `Processing operation: ${r.operation.operationId} (${r.method} ${r.path})`
1194
1200
  );
1195
- const i = this.getMethodName(n, r.operation);
1201
+ const i = this.getMethodName(o, r.operation);
1196
1202
  this.context.logger.info(`Generated method name: ${i}`);
1197
1203
  const s = this.resolveParameters(
1198
1204
  e,
1199
1205
  t,
1200
1206
  r.operation
1201
1207
  ), a = this.resolveReturnType(t, r.operation), c = a.metadata ? {
1202
- name: j(r.method),
1208
+ name: _(r.method),
1203
1209
  arguments: [`'${r.path}'`, a.metadata]
1204
1210
  } : {
1205
- name: j(r.method),
1211
+ name: _(r.method),
1206
1212
  arguments: [`'${r.path}'`]
1207
1213
  };
1208
1214
  this.context.logger.info(
1209
1215
  `Creating method with ${s.length} parameters, return type: ${a.type}`
1210
1216
  );
1211
- const u = n.addMethod({
1217
+ const u = o.addMethod({
1212
1218
  name: i,
1213
1219
  decorators: [c],
1214
1220
  parameters: s,
@@ -1231,7 +1237,7 @@ class pt {
1231
1237
  */
1232
1238
  groupOperations(e) {
1233
1239
  this.context.logger.info("Grouping operations by API client tags");
1234
- const t = /* @__PURE__ */ new Map(), n = ne(
1240
+ const t = /* @__PURE__ */ new Map(), o = oe(
1235
1241
  this.context.openAPI.paths
1236
1242
  ).filter((i) => {
1237
1243
  if (!i.operation.operationId)
@@ -1240,7 +1246,7 @@ class pt {
1240
1246
  return !s || s.length == 0 ? !1 : s.every((a) => e.has(a));
1241
1247
  });
1242
1248
  let r = 0;
1243
- for (const i of n)
1249
+ for (const i of o)
1244
1250
  i.operation.tags.forEach((s) => {
1245
1251
  t.has(s) || t.set(s, /* @__PURE__ */ new Set()), t.get(s).add(i), r++;
1246
1252
  });
@@ -1262,7 +1268,7 @@ class pt {
1262
1268
  );
1263
1269
  const e = /* @__PURE__ */ new Map(), t = this.context.openAPI.tags?.length || 0;
1264
1270
  for (const r of Object.values(this.context.openAPI.paths))
1265
- oe(r).forEach((i) => {
1271
+ re(r).forEach((i) => {
1266
1272
  i.operation.tags?.forEach((s) => {
1267
1273
  !this.shouldIgnoreTag(s) && !e.has(s) && e.set(s, {
1268
1274
  name: s,
@@ -1270,24 +1276,24 @@ class pt {
1270
1276
  });
1271
1277
  });
1272
1278
  });
1273
- let n = 0;
1279
+ let o = 0;
1274
1280
  return this.context.openAPI.tags?.forEach((r) => {
1275
1281
  this.shouldIgnoreTag(r.name) ? this.context.logger.info(
1276
1282
  `Excluded tag: ${r.name} (wow/Actuator/aggregate)`
1277
- ) : (e.set(r.name, r), n++, this.context.logger.info(`Included API client tag: ${r.name}`));
1283
+ ) : (e.set(r.name, r), o++, this.context.logger.info(`Included API client tag: ${r.name}`));
1278
1284
  }), this.context.logger.info(
1279
- `Resolved ${n} API client tags from ${t} total tags`
1285
+ `Resolved ${o} API client tags from ${t} total tags`
1280
1286
  ), e;
1281
1287
  }
1282
1288
  isAggregateTag(e) {
1283
1289
  for (const t of this.context.contextAggregates.values())
1284
- for (const n of t)
1285
- if (n.aggregate.tag.name === e)
1290
+ for (const o of t)
1291
+ if (o.aggregate.tag.name === e)
1286
1292
  return !0;
1287
1293
  return !1;
1288
1294
  }
1289
1295
  }
1290
- class ut {
1296
+ class mt {
1291
1297
  /**
1292
1298
  * Creates a new CommandClientGenerator instance.
1293
1299
  * @param context - The generation context containing OpenAPI spec and project details
@@ -1303,13 +1309,13 @@ class ut {
1303
1309
  generate() {
1304
1310
  const e = Array.from(
1305
1311
  this.context.contextAggregates.values()
1306
- ).reduce((n, r) => n + r.size, 0);
1312
+ ).reduce((o, r) => o + r.size, 0);
1307
1313
  this.context.logger.info("--- Generating Command Clients ---"), this.context.logger.progress(
1308
1314
  `Generating command clients for ${e} aggregates`
1309
1315
  );
1310
1316
  let t = 0;
1311
- for (const [, n] of this.context.contextAggregates)
1312
- n.forEach((r) => {
1317
+ for (const [, o] of this.context.contextAggregates)
1318
+ o.forEach((r) => {
1313
1319
  t++, this.context.logger.progressWithCount(
1314
1320
  t,
1315
1321
  e,
@@ -1326,7 +1332,7 @@ class ut {
1326
1332
  this.context.logger.info(
1327
1333
  `Processing command client for aggregate: ${e.aggregate.aggregateName} in context: ${e.aggregate.contextAlias}`
1328
1334
  );
1329
- const t = de(
1335
+ const t = fe(
1330
1336
  this.context.project,
1331
1337
  this.context.outputDir,
1332
1338
  e.aggregate,
@@ -1335,20 +1341,20 @@ class ut {
1335
1341
  this.context.logger.info(
1336
1342
  `Processing command endpoint paths for ${e.commands.size} commands`
1337
1343
  );
1338
- const n = this.processCommandEndpointPaths(
1344
+ const o = this.processCommandEndpointPaths(
1339
1345
  t,
1340
1346
  e
1341
1347
  );
1342
1348
  this.processCommandTypes(t, e), this.context.logger.info(
1343
1349
  `Creating default command client options: ${this.defaultCommandClientOptionsName}`
1344
1350
  ), t.addVariableStatement({
1345
- declarationKind: O.Const,
1351
+ declarationKind: D.Const,
1346
1352
  declarations: [
1347
1353
  {
1348
1354
  name: this.defaultCommandClientOptionsName,
1349
1355
  type: "ApiMetadata",
1350
1356
  initializer: `{
1351
- basePath: ${D(e.aggregate.contextAlias)}
1357
+ basePath: ${N(e.aggregate.contextAlias)}
1352
1358
  }`
1353
1359
  }
1354
1360
  ],
@@ -1368,14 +1374,14 @@ class ut {
1368
1374
  isTypeOnly: !0
1369
1375
  }), this.context.logger.info(
1370
1376
  "Adding import from @ahoo-wang/fetcher-eventstream: JsonEventStreamResultExtractor"
1371
- ), me(t), this.context.logger.info(
1377
+ ), de(t), this.context.logger.info(
1372
1378
  "Adding import from @ahoo-wang/fetcher: ContentTypeValues"
1373
1379
  ), A(t, "@ahoo-wang/fetcher", ["ContentTypeValues"]), this.context.logger.info(
1374
1380
  "Adding imports from @ahoo-wang/fetcher-decorator: ApiMetadata types and decorators"
1375
- ), ue(t), this.context.logger.info("Generating standard command client class"), this.processCommandClient(
1381
+ ), le(t), this.context.logger.info("Generating standard command client class"), this.processCommandClient(
1376
1382
  t,
1377
1383
  e,
1378
- n
1384
+ o
1379
1385
  ), this.context.logger.info("Generating stream command client class"), this.processStreamCommandClient(t, e), this.context.logger.success(
1380
1386
  `Command client generation completed for aggregate: ${e.aggregate.aggregateName}`
1381
1387
  );
@@ -1384,14 +1390,14 @@ class ut {
1384
1390
  return h(e, this.commandEndpointPathsSuffix);
1385
1391
  }
1386
1392
  processCommandEndpointPaths(e, t) {
1387
- const n = this.resolveAggregateCommandEndpointPathsName(
1393
+ const o = this.resolveAggregateCommandEndpointPathsName(
1388
1394
  t.aggregate
1389
1395
  );
1390
1396
  this.context.logger.info(
1391
- `Creating command endpoint paths enum: ${n}`
1397
+ `Creating command endpoint paths enum: ${o}`
1392
1398
  );
1393
1399
  const r = e.addEnum({
1394
- name: n,
1400
+ name: o,
1395
1401
  isExported: !0
1396
1402
  });
1397
1403
  return t.commands.forEach((i) => {
@@ -1403,19 +1409,19 @@ class ut {
1403
1409
  });
1404
1410
  }), this.context.logger.success(
1405
1411
  `Command endpoint paths enum created with ${t.commands.size} entries`
1406
- ), n;
1412
+ ), o;
1407
1413
  }
1408
1414
  resolveCommandTypeName(e) {
1409
1415
  const t = m(e.schema.key);
1410
1416
  return [t, t.name + "Command"];
1411
1417
  }
1412
1418
  resolveCommandType(e, t) {
1413
- const [n, r] = this.resolveCommandTypeName(t);
1414
- if (n.path === y)
1419
+ const [o, r] = this.resolveCommandTypeName(t);
1420
+ if (o.path === y)
1415
1421
  return;
1416
- d(e, this.context.outputDir, n);
1417
- let i = `${n.name}`;
1418
- const s = Oe(t.schema.schema).map((a) => `'${a}'`).join(" | ");
1422
+ d(e, this.context.outputDir, o);
1423
+ let i = `${o.name}`;
1424
+ const s = Me(t.schema.schema).map((a) => `'${a}'`).join(" | ");
1419
1425
  s !== "" && (i = `PartialBy<${i},${s}>`), i = `CommandBody<${i}>`, e.addTypeAlias({
1420
1426
  name: r,
1421
1427
  type: `${i}`,
@@ -1423,46 +1429,46 @@ class ut {
1423
1429
  });
1424
1430
  }
1425
1431
  processCommandTypes(e, t) {
1426
- t.commands.forEach((n) => {
1427
- this.resolveCommandType(e, n);
1432
+ t.commands.forEach((o) => {
1433
+ this.resolveCommandType(e, o);
1428
1434
  });
1429
1435
  }
1430
1436
  getEndpointPath(e, t) {
1431
1437
  return `${e}.${t.name.toUpperCase()}`;
1432
1438
  }
1433
- processCommandClient(e, t, n) {
1439
+ processCommandClient(e, t, o) {
1434
1440
  const r = h(
1435
1441
  t.aggregate,
1436
1442
  "CommandClient"
1437
- ), i = F(
1443
+ ), i = j(
1438
1444
  r,
1439
1445
  e,
1440
1446
  [],
1441
1447
  ["R = CommandResult"]
1442
1448
  );
1443
- le(i, this.defaultCommandClientOptionsName), t.commands.forEach((s) => {
1449
+ me(i, this.defaultCommandClientOptionsName), t.commands.forEach((s) => {
1444
1450
  this.processCommandMethod(
1445
1451
  t,
1446
1452
  i,
1447
1453
  s,
1448
- n
1454
+ o
1449
1455
  );
1450
1456
  });
1451
1457
  }
1452
1458
  processStreamCommandClient(e, t) {
1453
- const n = h(
1459
+ const o = h(
1454
1460
  t.aggregate,
1455
1461
  "CommandClient"
1456
1462
  ), r = h(
1457
1463
  t.aggregate,
1458
1464
  "StreamCommandClient"
1459
1465
  );
1460
- F(
1466
+ j(
1461
1467
  r,
1462
1468
  e,
1463
- ["''", q],
1469
+ ["''", F],
1464
1470
  [],
1465
- `${n}<CommandResultEventStream>`
1471
+ `${o}<CommandResultEventStream>`
1466
1472
  ).addConstructor({
1467
1473
  parameters: [
1468
1474
  {
@@ -1475,15 +1481,15 @@ class ut {
1475
1481
  });
1476
1482
  }
1477
1483
  resolveParameters(e, t) {
1478
- const [n, r] = this.resolveCommandTypeName(t);
1484
+ const [o, r] = this.resolveCommandTypeName(t);
1479
1485
  this.context.logger.info(
1480
- `Adding import for command model: ${n.name} from path: ${n.path}`
1486
+ `Adding import for command model: ${o.name} from path: ${o.path}`
1481
1487
  );
1482
1488
  const i = t.pathParameters.filter((s) => !this.context.isIgnoreCommandClientPathParameters(
1483
1489
  e.name,
1484
1490
  s.name
1485
1491
  )).map((s) => {
1486
- const a = re(s);
1492
+ const a = ie(s);
1487
1493
  return this.context.logger.info(
1488
1494
  `Adding path parameter: ${s.name} (type: ${a})`
1489
1495
  ), {
@@ -1502,7 +1508,7 @@ class ut {
1502
1508
  `Adding command request parameter: commandRequest (type: CommandRequest<${r}>)`
1503
1509
  ), i.push({
1504
1510
  name: "commandRequest",
1505
- hasQuestionToken: we(t.schema.schema),
1511
+ hasQuestionToken: De(t.schema.schema),
1506
1512
  type: `CommandRequest<${r}>`,
1507
1513
  decorators: [
1508
1514
  {
@@ -1524,22 +1530,22 @@ class ut {
1524
1530
  ]
1525
1531
  }), i;
1526
1532
  }
1527
- processCommandMethod(e, t, n, r) {
1533
+ processCommandMethod(e, t, o, r) {
1528
1534
  this.context.logger.info(
1529
- `Generating command method: ${f(n.name)} for command: ${n.name}`
1535
+ `Generating command method: ${f(o.name)} for command: ${o.name}`
1530
1536
  ), this.context.logger.info(
1531
- `Command method details: HTTP ${n.method}, path: ${n.path}`
1537
+ `Command method details: HTTP ${o.method}, path: ${o.path}`
1532
1538
  );
1533
1539
  const i = this.resolveParameters(
1534
1540
  e.aggregate.tag,
1535
- n
1541
+ o
1536
1542
  ), s = t.addMethod({
1537
- name: f(n.name),
1543
+ name: f(o.name),
1538
1544
  decorators: [
1539
1545
  {
1540
- name: j(n.method),
1546
+ name: _(o.method),
1541
1547
  arguments: [
1542
- `${this.getEndpointPath(r, n)}`
1548
+ `${this.getEndpointPath(r, o)}`
1543
1549
  ]
1544
1550
  }
1545
1551
  ],
@@ -1548,18 +1554,18 @@ class ut {
1548
1554
  statements: `throw autoGeneratedError(${i.map((a) => a.name).join(",")});`
1549
1555
  });
1550
1556
  this.context.logger.info(
1551
- `Adding JSDoc documentation for method: ${f(n.name)}`
1557
+ `Adding JSDoc documentation for method: ${f(o.name)}`
1552
1558
  ), C(s, [
1553
- n.summary,
1554
- n.description,
1555
- `- operationId: \`${n.operation.operationId}\``,
1556
- `- path: \`${n.path}\``
1559
+ o.summary,
1560
+ o.description,
1561
+ `- operationId: \`${o.operation.operationId}\``,
1562
+ `- path: \`${o.path}\``
1557
1563
  ]), this.context.logger.success(
1558
- `Command method generated: ${f(n.name)}`
1564
+ `Command method generated: ${f(o.name)}`
1559
1565
  );
1560
1566
  }
1561
1567
  }
1562
- class lt {
1568
+ class dt {
1563
1569
  /**
1564
1570
  * Creates a new QueryClientGenerator instance.
1565
1571
  * @param context - The generation context containing OpenAPI spec and project details
@@ -1575,13 +1581,13 @@ class lt {
1575
1581
  generate() {
1576
1582
  const e = Array.from(
1577
1583
  this.context.contextAggregates.values()
1578
- ).reduce((n, r) => n + r.size, 0);
1584
+ ).reduce((o, r) => o + r.size, 0);
1579
1585
  this.context.logger.info("--- Generating Query Clients ---"), this.context.logger.progress(
1580
1586
  `Generating query clients for ${e} aggregates`
1581
1587
  );
1582
1588
  let t = 0;
1583
- for (const [, n] of this.context.contextAggregates)
1584
- n.forEach((r) => {
1589
+ for (const [, o] of this.context.contextAggregates)
1590
+ o.forEach((r) => {
1585
1591
  t++, this.context.logger.progressWithCount(
1586
1592
  t,
1587
1593
  e,
@@ -1597,7 +1603,7 @@ class lt {
1597
1603
  * @returns The source file for the client
1598
1604
  */
1599
1605
  createClientFilePath(e, t) {
1600
- return de(
1606
+ return fe(
1601
1607
  this.context.project,
1602
1608
  this.context.outputDir,
1603
1609
  e,
@@ -1625,19 +1631,19 @@ class lt {
1625
1631
  "ResourceAttributionPathSpec"
1626
1632
  ]
1627
1633
  });
1628
- const n = "DEFAULT_QUERY_CLIENT_OPTIONS";
1634
+ const o = "DEFAULT_QUERY_CLIENT_OPTIONS";
1629
1635
  this.context.logger.info(
1630
- `Creating default query client options: ${n}`
1636
+ `Creating default query client options: ${o}`
1631
1637
  ), t.addVariableStatement({
1632
- declarationKind: O.Const,
1638
+ declarationKind: D.Const,
1633
1639
  declarations: [
1634
1640
  {
1635
- name: n,
1641
+ name: o,
1636
1642
  type: "QueryClientOptions",
1637
1643
  initializer: `{
1638
- contextAlias: ${D(e.aggregate.contextAlias)},
1644
+ contextAlias: ${N(e.aggregate.contextAlias)},
1639
1645
  aggregateName: '${e.aggregate.aggregateName}',
1640
- resourceAttribution: ${at(e)},
1646
+ resourceAttribution: ${gt(e)},
1641
1647
  }`
1642
1648
  }
1643
1649
  ],
@@ -1654,11 +1660,11 @@ class lt {
1654
1660
  ), d(t, this.context.outputDir, a), this.context.logger.info(
1655
1661
  `Creating query client factory: ${i}`
1656
1662
  ), t.addVariableStatement({
1657
- declarationKind: O.Const,
1663
+ declarationKind: D.Const,
1658
1664
  declarations: [
1659
1665
  {
1660
1666
  name: i,
1661
- initializer: `new QueryClientFactory<${s.name}, ${a.name} | string, ${r}>(${n})`
1667
+ initializer: `new QueryClientFactory<${s.name}, ${a.name} | string, ${r}>(${o})`
1662
1668
  }
1663
1669
  ],
1664
1670
  isExported: !0
@@ -1667,7 +1673,7 @@ class lt {
1667
1673
  );
1668
1674
  }
1669
1675
  processAggregateDomainEventType(e, t) {
1670
- const n = [];
1676
+ const o = [];
1671
1677
  this.context.logger.info(
1672
1678
  `Processing ${e.events.size} domain events for aggregate: ${e.aggregate.aggregateName}`
1673
1679
  );
@@ -1679,12 +1685,12 @@ class lt {
1679
1685
  t,
1680
1686
  this.context.outputDir,
1681
1687
  a
1682
- ), n.push(a);
1688
+ ), o.push(a);
1683
1689
  }
1684
1690
  const r = h(
1685
1691
  e.aggregate,
1686
1692
  this.domainEventTypeSuffix
1687
- ), i = n.map((s) => s.name).join(" | ");
1693
+ ), i = o.map((s) => s.name).join(" | ");
1688
1694
  return this.context.logger.info(
1689
1695
  `Creating domain event types union: ${r} = ${i}`
1690
1696
  ), t.addTypeAlias({
@@ -1694,11 +1700,11 @@ class lt {
1694
1700
  }), r;
1695
1701
  }
1696
1702
  processAggregateDomainEventTypes(e, t) {
1697
- const n = h(
1703
+ const o = h(
1698
1704
  e.aggregate,
1699
1705
  this.domainEventTypeMapTitleSuffix
1700
1706
  ), r = t.addEnum({
1701
- name: n,
1707
+ name: o,
1702
1708
  isExported: !0
1703
1709
  });
1704
1710
  for (const i of e.events.values())
@@ -1708,13 +1714,13 @@ class lt {
1708
1714
  });
1709
1715
  }
1710
1716
  }
1711
- class mt {
1717
+ class ft {
1712
1718
  /**
1713
1719
  * Creates a new ClientGenerator instance.
1714
1720
  * @param context - The generation context containing OpenAPI spec and project details
1715
1721
  */
1716
1722
  constructor(e) {
1717
- this.context = e, this.queryClientGenerator = new lt(e), this.commandClientGenerator = new ut(e), this.apiClientGenerator = new pt(e);
1723
+ this.context = e, this.queryClientGenerator = new dt(e), this.commandClientGenerator = new mt(e), this.apiClientGenerator = new lt(e);
1718
1724
  }
1719
1725
  queryClientGenerator;
1720
1726
  commandClientGenerator;
@@ -1737,7 +1743,7 @@ class mt {
1737
1743
  this.queryClientGenerator.generate(), this.commandClientGenerator.generate(), this.apiClientGenerator.generate(), this.context.logger.success("Client generation completed");
1738
1744
  }
1739
1745
  }
1740
- class dt {
1746
+ class ht {
1741
1747
  /** The ts-morph project instance used for code generation */
1742
1748
  project;
1743
1749
  /** The OpenAPI specification object */
@@ -1755,7 +1761,7 @@ class dt {
1755
1761
  this.project = e.project, this.openAPI = e.openAPI, this.outputDir = e.outputDir, this.contextAggregates = e.contextAggregates, this.logger = e.logger, this.config = e.config ?? {}, this.currentContextAlias = this.openAPI.info["x-wow-context-alias"];
1756
1762
  }
1757
1763
  getOrCreateSourceFile(e) {
1758
- return ce(this.project, this.outputDir, e);
1764
+ return ge(this.project, this.outputDir, e);
1759
1765
  }
1760
1766
  isIgnoreApiClientPathParameters(e, t) {
1761
1767
  return (this.config.apiClients?.[e]?.ignorePathParameters ?? this.defaultIgnorePathParameters).includes(t);
@@ -1764,8 +1770,8 @@ class dt {
1764
1770
  return this.defaultIgnorePathParameters.includes(t);
1765
1771
  }
1766
1772
  }
1767
- const ft = "./fetcher-generator.config.json";
1768
- class $t {
1773
+ const yt = "./fetcher-generator.config.json";
1774
+ class vt {
1769
1775
  /**
1770
1776
  * Creates a new CodeGenerator instance with the specified options.
1771
1777
  *
@@ -1773,7 +1779,7 @@ class $t {
1773
1779
  * @throws Error if the project initialization fails due to invalid TypeScript configuration or missing files.
1774
1780
  */
1775
1781
  constructor(e) {
1776
- this.options = e, this.project = new ye(e), this.options.logger.info(
1782
+ this.options = e, this.project = new xe(e), this.options.logger.info(
1777
1783
  `Project instance created with tsConfigFilePath: ${this.options.tsConfigFilePath}`
1778
1784
  );
1779
1785
  }
@@ -1801,28 +1807,28 @@ class $t {
1801
1807
  this.options.logger.info(
1802
1808
  "Starting code generation from OpenAPI specification"
1803
1809
  ), this.options.logger.info(`Input path: ${this.options.inputPath}`), this.options.logger.info(`Output directory: ${this.options.outputDir}`), this.options.logger.info("Parsing OpenAPI specification");
1804
- const e = await je(this.options.inputPath);
1810
+ const e = await Ge(this.options.inputPath);
1805
1811
  this.options.logger.info("OpenAPI specification parsed successfully"), this.options.logger.info("Resolving bounded context aggregates");
1806
- const n = new Ze(e).resolve();
1812
+ const o = new tt(e).resolve();
1807
1813
  this.options.logger.info(
1808
- `Resolved ${n.size} bounded context aggregates`
1814
+ `Resolved ${o.size} bounded context aggregates`
1809
1815
  );
1810
- const r = this.options.configPath ?? ft;
1816
+ const r = this.options.configPath ?? yt;
1811
1817
  let i = {};
1812
1818
  try {
1813
- this.options.logger.info(`Parsing configuration file: ${r}`), i = await Ge(r);
1819
+ this.options.logger.info(`Parsing configuration file: ${r}`), i = await We(r);
1814
1820
  } catch (p) {
1815
1821
  this.options.logger.info(`Configuration file parsing failed: ${p}`);
1816
1822
  }
1817
- const s = new dt({
1823
+ const s = new ht({
1818
1824
  openAPI: e,
1819
1825
  project: this.project,
1820
1826
  outputDir: this.options.outputDir,
1821
- contextAggregates: n,
1827
+ contextAggregates: o,
1822
1828
  logger: this.options.logger,
1823
1829
  config: i
1824
1830
  });
1825
- this.options.logger.info("Generating models"), new nt(s).generate(), this.options.logger.info("Models generated successfully"), this.options.logger.info("Generating clients"), new mt(s).generate(), this.options.logger.info("Clients generated successfully");
1831
+ this.options.logger.info("Generating models"), new rt(s).generate(), this.options.logger.info("Models generated successfully"), this.options.logger.info("Generating clients"), new ft(s).generate(), this.options.logger.info("Clients generated successfully");
1826
1832
  const u = this.project.getDirectory(this.options.outputDir);
1827
1833
  if (!u) {
1828
1834
  this.options.logger.info("Output directory not found.");
@@ -1855,8 +1861,8 @@ class $t {
1855
1861
  processDirectory(e) {
1856
1862
  const t = e.getDirectories();
1857
1863
  this.options.logger.info(`Processing ${t.length} subdirectories`);
1858
- for (const n of t)
1859
- this.options.logger.info(`Processing subdirectory: ${n.getPath()}`), this.generateIndexForDirectory(n), this.processDirectory(n);
1864
+ for (const o of t)
1865
+ this.options.logger.info(`Processing subdirectory: ${o.getPath()}`), this.generateIndexForDirectory(o), this.processDirectory(o);
1860
1866
  }
1861
1867
  /**
1862
1868
  * Generates an index.ts file for a specific directory.
@@ -1868,12 +1874,12 @@ class $t {
1868
1874
  generateIndexForDirectory(e) {
1869
1875
  const t = e.getPath();
1870
1876
  this.options.logger.info(`Generating index for directory: ${t}`);
1871
- const n = e.getSourceFiles().filter(
1877
+ const o = e.getSourceFiles().filter(
1872
1878
  (a) => a.getBaseName().endsWith(".ts") && a.getBaseName() !== "index.ts"
1873
1879
  ), r = e.getDirectories();
1874
1880
  if (this.options.logger.info(
1875
- `Found ${n.length} TypeScript files and ${r.length} subdirectories in ${t}`
1876
- ), n.length === 0 && r.length === 0) {
1881
+ `Found ${o.length} TypeScript files and ${r.length} subdirectories in ${t}`
1882
+ ), o.length === 0 && r.length === 0) {
1877
1883
  this.options.logger.info(
1878
1884
  `No files or subdirectories to export in ${t}, skipping index generation`
1879
1885
  );
@@ -1881,7 +1887,7 @@ class $t {
1881
1887
  }
1882
1888
  const i = `${t}/index.ts`, s = this.project.getSourceFile(i) || this.project.createSourceFile(i, "", { overwrite: !0 });
1883
1889
  s.removeText();
1884
- for (const a of n) {
1890
+ for (const a of o) {
1885
1891
  const c = `./${a.getBaseNameWithoutExtension()}`;
1886
1892
  s.addExportDeclaration({
1887
1893
  moduleSpecifier: c,
@@ -1898,7 +1904,7 @@ class $t {
1898
1904
  });
1899
1905
  }
1900
1906
  this.options.logger.info(
1901
- `Index file generated for ${t} with ${n.length + r.length} exports`
1907
+ `Index file generated for ${t} with ${o.length + r.length} exports`
1902
1908
  );
1903
1909
  }
1904
1910
  /**
@@ -1911,15 +1917,15 @@ class $t {
1911
1917
  const t = e.getDescendantSourceFiles();
1912
1918
  this.options.logger.info(
1913
1919
  `Optimizing ${t.length} source files in ${e.getPath()}`
1914
- ), t.forEach((n, r) => {
1920
+ ), t.forEach((o, r) => {
1915
1921
  this.options.logger.info(
1916
- `Optimizing file [${n.getFilePath()}] - ${r + 1}/${t.length}`
1917
- ), n.formatText(), n.organizeImports(), n.fixMissingImports();
1922
+ `Optimizing file [${o.getFilePath()}] - ${r + 1}/${t.length}`
1923
+ ), o.formatText(), o.organizeImports(), o.fixMissingImports();
1918
1924
  }), this.options.logger.info("All source files optimized");
1919
1925
  }
1920
1926
  }
1921
1927
  export {
1922
- $t as CodeGenerator,
1923
- ft as DEFAULT_CONFIG_PATH
1928
+ vt as CodeGenerator,
1929
+ yt as DEFAULT_CONFIG_PATH
1924
1930
  };
1925
1931
  //# sourceMappingURL=index.js.map