moonflower 1.4.8 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/openapi/analyzerModule/analyzerModule.cjs +1 -1
  2. package/dist/openapi/analyzerModule/analyzerModule.cjs.map +1 -1
  3. package/dist/openapi/analyzerModule/analyzerModule.d.ts +18 -3
  4. package/dist/openapi/analyzerModule/analyzerModule.d.ts.map +1 -1
  5. package/dist/openapi/analyzerModule/analyzerModule.mjs +168 -112
  6. package/dist/openapi/analyzerModule/analyzerModule.mjs.map +1 -1
  7. package/dist/openapi/analyzerModule/analyzerWorker.cjs +2 -0
  8. package/dist/openapi/analyzerModule/analyzerWorker.cjs.map +1 -0
  9. package/dist/openapi/analyzerModule/analyzerWorker.d.ts +2 -0
  10. package/dist/openapi/analyzerModule/analyzerWorker.d.ts.map +1 -0
  11. package/dist/openapi/analyzerModule/analyzerWorker.mjs +44 -0
  12. package/dist/openapi/analyzerModule/analyzerWorker.mjs.map +1 -0
  13. package/dist/openapi/analyzerModule/nodeParsers.cjs +1 -1
  14. package/dist/openapi/analyzerModule/nodeParsers.cjs.map +1 -1
  15. package/dist/openapi/analyzerModule/nodeParsers.d.ts.map +1 -1
  16. package/dist/openapi/analyzerModule/nodeParsers.mjs +199 -264
  17. package/dist/openapi/analyzerModule/nodeParsers.mjs.map +1 -1
  18. package/dist/openapi/analyzerModule/parseEndpoint.cjs +1 -1
  19. package/dist/openapi/analyzerModule/parseEndpoint.cjs.map +1 -1
  20. package/dist/openapi/analyzerModule/parseEndpoint.d.ts +8 -1
  21. package/dist/openapi/analyzerModule/parseEndpoint.d.ts.map +1 -1
  22. package/dist/openapi/analyzerModule/parseEndpoint.mjs +121 -106
  23. package/dist/openapi/analyzerModule/parseEndpoint.mjs.map +1 -1
  24. package/dist/openapi/analyzerModule/test/TestCase.d.ts +1 -0
  25. package/dist/openapi/analyzerModule/test/TestCase.d.ts.map +1 -1
  26. package/dist/openapi/analyzerModule/test/workerGlobalSetup.d.ts +3 -0
  27. package/dist/openapi/analyzerModule/test/workerGlobalSetup.d.ts.map +1 -0
  28. package/dist/openapi/analyzerModule/workerPaths.d.ts +2 -0
  29. package/dist/openapi/analyzerModule/workerPaths.d.ts.map +1 -0
  30. package/dist/openapi/analyzerModule/workerPool.cjs +2 -0
  31. package/dist/openapi/analyzerModule/workerPool.cjs.map +1 -0
  32. package/dist/openapi/analyzerModule/workerPool.d.ts +33 -0
  33. package/dist/openapi/analyzerModule/workerPool.d.ts.map +1 -0
  34. package/dist/openapi/analyzerModule/workerPool.mjs +46 -0
  35. package/dist/openapi/analyzerModule/workerPool.mjs.map +1 -0
  36. package/package.json +1 -1
  37. package/src/openapi/analyzerModule/analyzerModule.ts +198 -25
  38. package/src/openapi/analyzerModule/analyzerWorker.ts +73 -0
  39. package/src/openapi/analyzerModule/nodeParsers.ts +4 -104
  40. package/src/openapi/analyzerModule/parseEndpoint.ts +31 -9
  41. package/src/openapi/analyzerModule/test/TestCase.ts +1 -0
  42. package/src/openapi/analyzerModule/test/openApiAnalyzer.spec.ts +2 -2
  43. package/src/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.data.ts +6 -0
  44. package/src/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.ts +9 -1
  45. package/src/openapi/analyzerModule/test/workerGlobalSetup.ts +25 -0
  46. package/src/openapi/analyzerModule/workerPaths.ts +4 -0
  47. package/src/openapi/analyzerModule/workerPool.ts +92 -0
  48. package/src/test/app.spec.ts +10 -1
  49. package/vite.config.ts +5 -0
@@ -1,11 +1,11 @@
1
- import { SyntaxKind as a } from "ts-morph";
1
+ import { SyntaxKind as o } from "ts-morph";
2
2
  import { Logger as l } from "../../utils/logger.mjs";
3
- import { resolveEndpointPath as y, findNodeImplementation as d, getValuesOfObjectLiteral as m, getShapeOfValidatorLiteral as f, getValidatorPropertyStringValue as h, getValidatorPropertyOptionality as E, getValidatorPropertyShape as P, getProperTypeShape as L } from "./nodeParsers.mjs";
4
- const j = (t, n) => {
5
- const r = t.getFirstDescendantByKind(a.PropertyAccessExpression).getText().split(".")[1].toUpperCase(), e = r === "DEL" ? "DELETE" : r, u = y(t) ?? "", i = {
6
- method: e,
7
- path: u,
8
- sourceFilePath: n,
3
+ import { resolveEndpointPath as L, findNodeImplementation as g, getValuesOfObjectLiteral as B, getShapeOfValidatorLiteral as m, getValidatorPropertyStringValue as y, getValidatorPropertyOptionality as R, getValidatorPropertyShape as x, getProperTypeShape as w } from "./nodeParsers.mjs";
4
+ const O = (e, i) => {
5
+ const r = e.getFirstDescendantByKind(o.PropertyAccessExpression).getText().split(".")[1].toUpperCase(), t = r === "DEL" ? "DELETE" : r, a = L(e) ?? "", s = {
6
+ method: t,
7
+ path: a,
8
+ sourceFilePath: i,
9
9
  requestPathParams: [],
10
10
  requestQuery: [],
11
11
  requestHeaders: [],
@@ -16,48 +16,63 @@ const j = (t, n) => {
16
16
  summary: void 0,
17
17
  description: void 0,
18
18
  tags: void 0
19
- }, o = x(t);
19
+ }, u = [], d = (n, p) => {
20
+ const E = performance.now(), P = p();
21
+ return u.push({ section: n, timing: performance.now() - E }), P;
22
+ }, c = v(e);
20
23
  try {
21
- B(o.useApiEndpoint).forEach((g) => {
22
- i[g.identifier] = g.value;
24
+ d("useApiEndpoint", () => K(c.useApiEndpoint)).forEach((p) => {
25
+ s[p.identifier] = p.value;
23
26
  });
24
- } catch (s) {
25
- l.error("Error", s);
27
+ } catch (n) {
28
+ l.error("Error", n);
26
29
  }
27
30
  try {
28
- i.requestPathParams = v(o.usePathParams, u);
29
- } catch (s) {
30
- l.error("Error", s);
31
+ s.requestPathParams = d(
32
+ "usePathParams",
33
+ () => q(c.usePathParams, a)
34
+ );
35
+ } catch (n) {
36
+ l.error("Error", n);
31
37
  }
32
38
  try {
33
- i.requestQuery = c(o.useQueryParams, "useQueryParams");
34
- } catch (s) {
35
- l.error("Error", s);
39
+ s.requestQuery = d(
40
+ "useQueryParams",
41
+ () => h(c.useQueryParams, "useQueryParams")
42
+ );
43
+ } catch (n) {
44
+ l.error("Error", n);
36
45
  }
37
46
  try {
38
- i.requestHeaders = c(o.useHeaderParams, "useHeaderParams");
39
- } catch (s) {
40
- l.error("Error", s);
47
+ s.requestHeaders = d(
48
+ "useHeaderParams",
49
+ () => h(c.useHeaderParams, "useHeaderParams")
50
+ );
51
+ } catch (n) {
52
+ l.error("Error", n);
41
53
  }
42
54
  try {
43
- const s = K(o.useRequestRawBody);
44
- s && (i.rawBody = s);
45
- } catch (s) {
46
- l.error("Error", s);
55
+ const n = d("useRequestRawBody", () => C(c.useRequestRawBody));
56
+ n && (s.rawBody = n);
57
+ } catch (n) {
58
+ l.error("Error", n);
47
59
  }
48
60
  try {
49
- i.objectBody = c(o.useRequestBody, "useRequestBody");
50
- } catch (s) {
51
- l.error("Error", s);
61
+ s.objectBody = d(
62
+ "useRequestBody",
63
+ () => h(c.useRequestBody, "useRequestBody")
64
+ );
65
+ } catch (n) {
66
+ l.error("Error", n);
52
67
  }
53
68
  try {
54
- i.responses = R(t);
55
- } catch (s) {
56
- l.error("Error", s);
69
+ s.responses = d("response", () => b(e));
70
+ } catch (n) {
71
+ l.error("Error", n);
57
72
  }
58
- return i;
59
- }, x = (t) => {
60
- const n = {
73
+ return { endpoint: s, sectionTimings: u };
74
+ }, v = (e) => {
75
+ const i = {
61
76
  useApiEndpoint: null,
62
77
  usePathParams: null,
63
78
  useQueryParams: null,
@@ -65,117 +80,117 @@ const j = (t, n) => {
65
80
  useRequestBody: null,
66
81
  useRequestRawBody: null
67
82
  };
68
- for (const r of t.getDescendantsOfKind(a.CallExpression)) {
69
- const e = r.getFirstChildByKind(a.Identifier)?.getText();
70
- e && e in n && n[e] === null && (n[e] = r);
83
+ for (const r of e.getDescendantsOfKind(o.CallExpression)) {
84
+ const t = r.getFirstChildByKind(o.Identifier)?.getText();
85
+ t && t in i && i[t] === null && (i[t] = r);
71
86
  }
72
- return n;
73
- }, B = (t) => {
74
- if (!t)
87
+ return i;
88
+ }, K = (e) => {
89
+ if (!e)
75
90
  return [];
76
- const n = t.getFirstChildByKind(a.SyntaxList), r = d(n.getLastChild());
77
- if (!r.isKind(a.ObjectLiteralExpression))
91
+ const i = e.getFirstChildByKind(o.SyntaxList), r = g(i.getLastChild());
92
+ if (!r.isKind(o.ObjectLiteralExpression))
78
93
  throw new Error("Non-literal type used in useApiEndpoint");
79
- const e = r.asKind(a.ObjectLiteralExpression);
80
- return m(e).filter((i) => i.value !== null);
81
- }, v = (t, n) => {
82
- if (!t)
94
+ const t = r.asKind(o.ObjectLiteralExpression);
95
+ return B(t).filter((s) => s.value !== null);
96
+ }, q = (e, i) => {
97
+ if (!e)
83
98
  return [];
84
- const r = t.getFirstChildByKind(a.SyntaxList), e = d(r.getLastChild());
85
- if (!e.isKind(a.ObjectLiteralExpression))
99
+ const r = e.getFirstChildByKind(o.SyntaxList), t = g(r.getLastChild());
100
+ if (!t.isKind(o.ObjectLiteralExpression))
86
101
  throw new Error("Non-literal type used in usePathParams");
87
- const u = n.split("/").filter((o) => o.startsWith(":")).map((o) => ({
88
- name: o.substring(1).replace(/\?/, ""),
89
- optional: o.includes("?")
90
- })), i = e.asKind(a.ObjectLiteralExpression);
91
- return f(i).filter((o) => o.shape !== null).map((o) => ({
92
- identifier: o.identifier,
93
- signature: o.shape,
94
- optional: u.some((s) => s.name === o.identifier && s.optional),
95
- description: o.description,
96
- errorMessage: o.errorMessage
102
+ const a = i.split("/").filter((u) => u.startsWith(":")).map((u) => ({
103
+ name: u.substring(1).replace(/\?/, ""),
104
+ optional: u.includes("?")
105
+ })), s = t.asKind(o.ObjectLiteralExpression);
106
+ return m(s).filter((u) => u.shape !== null).map((u) => ({
107
+ identifier: u.identifier,
108
+ signature: u.shape,
109
+ optional: a.some((d) => d.name === u.identifier && d.optional),
110
+ description: u.description,
111
+ errorMessage: u.errorMessage
97
112
  }));
98
- }, K = (t) => {
99
- if (!t)
113
+ }, C = (e) => {
114
+ if (!e)
100
115
  return null;
101
- const n = t.getFirstChildByKind(a.SyntaxList), r = d(
102
- n.getLastChild((e) => !e.isKind(a.CommaToken))
116
+ const i = e.getFirstChildByKind(o.SyntaxList), r = g(
117
+ i.getLastChild((t) => !t.isKind(o.CommaToken))
103
118
  );
104
119
  return {
105
- signature: P(r),
106
- optional: E(r),
107
- description: h(r, "description"),
108
- errorMessage: h(r, "errorMessage")
120
+ signature: x(r),
121
+ optional: R(r),
122
+ description: y(r, "description"),
123
+ errorMessage: y(r, "errorMessage")
109
124
  };
110
- }, c = (t, n) => {
111
- if (!t)
125
+ }, h = (e, i) => {
126
+ if (!e)
112
127
  return [];
113
- const r = t.getFirstChildByKind(a.SyntaxList), e = d(r.getLastChild());
114
- if (!e.isKind(a.ObjectLiteralExpression))
115
- throw new Error(`Non-literal type used in ${n}`);
116
- const u = e.asKind(a.ObjectLiteralExpression);
117
- return f(u).filter((i) => i.shape !== null).map((i) => ({
118
- identifier: i.identifier,
119
- signature: i.shape,
120
- optional: i.optional,
121
- description: i.description,
122
- errorMessage: i.errorMessage
128
+ const r = e.getFirstChildByKind(o.SyntaxList), t = g(r.getLastChild());
129
+ if (!t.isKind(o.ObjectLiteralExpression))
130
+ throw new Error(`Non-literal type used in ${i}`);
131
+ const a = t.asKind(o.ObjectLiteralExpression);
132
+ return m(a).filter((s) => s.shape !== null).map((s) => ({
133
+ identifier: s.identifier,
134
+ signature: s.shape,
135
+ optional: s.optional,
136
+ description: s.description,
137
+ errorMessage: s.errorMessage
123
138
  }));
124
- }, R = (t) => {
125
- const r = t.getFirstChildByKind(a.CallExpression).getFirstChildByKind(a.SyntaxList).getFirstChildByKind(a.ArrowFunction).getReturnType(), e = r.getText().startsWith("Promise") ? r.getTypeArguments()[0] : r, u = L(e, t);
126
- return p(u);
127
- }, p = (t) => {
128
- if (typeof t == "string")
139
+ }, b = (e) => {
140
+ const r = e.getFirstChildByKind(o.CallExpression).getFirstChildByKind(o.SyntaxList).getFirstChildByKind(o.ArrowFunction).getReturnType(), t = r.getText().startsWith("Promise") ? r.getTypeArguments()[0] : r, a = w(t, e);
141
+ return f(a);
142
+ }, f = (e) => {
143
+ if (typeof e == "string")
129
144
  return [
130
145
  {
131
- status: t === "void" || t === "null" ? 204 : 200,
146
+ status: e === "void" || e === "null" ? 204 : 200,
132
147
  contentType: "text/plain",
133
- signature: t,
148
+ signature: e,
134
149
  description: "",
135
150
  errorMessage: ""
136
151
  }
137
152
  ];
138
- if (t[0].role === "union_entry" || t[0].role === "literal_string")
139
- return p(t[0].shape);
140
- if (t[0].role === "property" && t[0].identifier === "_isUseReturnValue") {
141
- const n = (() => {
142
- const e = t.find(
143
- (u) => u.role === "property" && u.identifier === "status"
153
+ if (e[0].role === "union_entry" || e[0].role === "literal_string")
154
+ return f(e[0].shape);
155
+ if (e[0].role === "property" && e[0].identifier === "_isUseReturnValue") {
156
+ const i = (() => {
157
+ const t = e.find(
158
+ (a) => a.role === "property" && a.identifier === "status"
144
159
  )?.shape;
145
- if (!e || typeof e == "string" || typeof e[0].shape != "string")
160
+ if (!t || typeof t == "string" || typeof t[0].shape != "string")
146
161
  throw new Error("Invalid useReturnValue hook");
147
- return parseInt(e[0].shape);
162
+ return parseInt(t[0].shape);
148
163
  })(), r = (() => {
149
- const e = t.find(
150
- (u) => u.role === "property" && u.identifier === "contentType"
164
+ const t = e.find(
165
+ (a) => a.role === "property" && a.identifier === "contentType"
151
166
  )?.shape;
152
- if (!e || typeof e == "string" || typeof e[0].shape != "string")
167
+ if (!t || typeof t == "string" || typeof t[0].shape != "string")
153
168
  throw new Error("Invalid useReturnValue hook");
154
- return e[0].shape;
169
+ return t[0].shape;
155
170
  })();
156
171
  return [
157
172
  {
158
- status: n,
173
+ status: i,
159
174
  contentType: r,
160
- signature: t,
175
+ signature: e,
161
176
  description: "",
162
177
  errorMessage: ""
163
178
  }
164
179
  ];
165
180
  }
166
- return t[0].role === "union" ? typeof t[0].shape == "string" ? [
181
+ return e[0].role === "union" ? typeof e[0].shape == "string" ? [
167
182
  {
168
- status: t[0].shape === "void" || t[0].shape === "null" ? 204 : 200,
183
+ status: e[0].shape === "void" || e[0].shape === "null" ? 204 : 200,
169
184
  contentType: "application/json",
170
- signature: t[0].shape,
185
+ signature: e[0].shape,
171
186
  description: "",
172
187
  errorMessage: ""
173
188
  }
174
- ] : t[0].shape.flatMap((n) => p([n])) : t[0].role === "buffer" ? [
189
+ ] : e[0].shape.flatMap((i) => f([i])) : e[0].role === "buffer" ? [
175
190
  {
176
191
  status: 200,
177
192
  contentType: "application/octet-stream",
178
- signature: t,
193
+ signature: e,
179
194
  description: "",
180
195
  errorMessage: ""
181
196
  }
@@ -183,13 +198,13 @@ const j = (t, n) => {
183
198
  {
184
199
  status: 200,
185
200
  contentType: "application/json",
186
- signature: t,
201
+ signature: e,
187
202
  description: "",
188
203
  errorMessage: ""
189
204
  }
190
205
  ];
191
206
  };
192
207
  export {
193
- j as parseEndpoint
208
+ O as parseEndpoint
194
209
  };
195
210
  //# sourceMappingURL=parseEndpoint.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parseEndpoint.mjs","sources":["../../../src/openapi/analyzerModule/parseEndpoint.ts"],"sourcesContent":["import { Node, SyntaxKind, ts } from 'ts-morph'\n\nimport { ApiEndpointDocs } from '../../hooks/useApiEndpoint'\nimport { Logger } from '../../utils/logger'\nimport { EndpointData } from '../types'\nimport {\n\tfindNodeImplementation,\n\tgetProperTypeShape,\n\tgetShapeOfValidatorLiteral,\n\tgetValidatorPropertyOptionality,\n\tgetValidatorPropertyShape,\n\tgetValidatorPropertyStringValue,\n\tgetValuesOfObjectLiteral,\n\tresolveEndpointPath,\n} from './nodeParsers'\n\nexport const parseEndpoint = (node: Node<ts.Node>, sourceFilePath: string) => {\n\tconst parsedEndpointMethod = node\n\t\t.getFirstDescendantByKind(SyntaxKind.PropertyAccessExpression)!\n\t\t.getText()\n\t\t.split('.')[1]\n\t\t.toUpperCase()\n\n\tconst endpointMethod = parsedEndpointMethod === 'DEL' ? 'DELETE' : parsedEndpointMethod\n\n\tconst endpointPath = resolveEndpointPath(node) ?? ''\n\n\tconst endpointData: EndpointData = {\n\t\tmethod: endpointMethod as 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n\t\tpath: endpointPath,\n\t\tsourceFilePath,\n\t\trequestPathParams: [],\n\t\trequestQuery: [],\n\t\trequestHeaders: [],\n\t\trawBody: undefined,\n\t\tobjectBody: [],\n\t\tresponses: [],\n\t\tname: undefined,\n\t\tsummary: undefined,\n\t\tdescription: undefined,\n\t\ttags: undefined,\n\t}\n\n\tconst warningData: {\n\t\tsegment: string\n\t\terror: Error\n\t}[] = []\n\n\tconst hookNodes = getHookNodes(node)\n\n\t// API documentation\n\ttry {\n\t\tconst entries = parseApiDocumentation(hookNodes.useApiEndpoint)\n\t\tentries.forEach((param) => {\n\t\t\tendpointData[param.identifier] = param.value as string & string[]\n\t\t})\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'api',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Request params\n\ttry {\n\t\tendpointData.requestPathParams = parseRequestParams(hookNodes.usePathParams, endpointPath)\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'path',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Request query\n\ttry {\n\t\tendpointData.requestQuery = parseRequestObjectInput(hookNodes.useQueryParams, 'useQueryParams')\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'query',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Request headers\n\ttry {\n\t\tendpointData.requestHeaders = parseRequestObjectInput(hookNodes.useHeaderParams, 'useHeaderParams')\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'headers',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Raw request body\n\ttry {\n\t\tconst parsedBody = parseRequestRawBody(hookNodes.useRequestRawBody)\n\t\tif (parsedBody) {\n\t\t\tendpointData.rawBody = parsedBody\n\t\t}\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'rawBody',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Object request body\n\ttry {\n\t\tendpointData.objectBody = parseRequestObjectInput(hookNodes.useRequestBody, 'useRequestBody')\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'objectBody',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Request response\n\ttry {\n\t\tendpointData.responses = parseRequestResponse(node)\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'response',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\treturn endpointData\n}\n\ntype HookName =\n\t| 'useApiEndpoint'\n\t| 'usePathParams'\n\t| 'useQueryParams'\n\t| 'useHeaderParams'\n\t| 'useRequestBody'\n\t| 'useRequestRawBody'\n\nconst getHookNodes = (endpointNode: Node<ts.Node>): Record<HookName, Node<ts.CallExpression> | null> => {\n\tconst result: Record<HookName, Node<ts.CallExpression> | null> = {\n\t\tuseApiEndpoint: null,\n\t\tusePathParams: null,\n\t\tuseQueryParams: null,\n\t\tuseHeaderParams: null,\n\t\tuseRequestBody: null,\n\t\tuseRequestRawBody: null,\n\t}\n\tfor (const node of endpointNode.getDescendantsOfKind(SyntaxKind.CallExpression)) {\n\t\tconst name = node.getFirstChildByKind(SyntaxKind.Identifier)?.getText() as HookName | undefined\n\t\tif (name && name in result && result[name] === null) {\n\t\t\tresult[name] = node\n\t\t}\n\t}\n\treturn result\n}\n\nconst parseApiDocumentation = (hookNode: Node<ts.CallExpression> | null) => {\n\tif (!hookNode) {\n\t\treturn []\n\t}\n\tconst paramNode = hookNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tconst valueNode = findNodeImplementation(paramNode.getLastChild()!)\n\n\tif (!valueNode.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\tthrow new Error('Non-literal type used in useApiEndpoint')\n\t}\n\n\tconst objectLiteral = valueNode.asKind(SyntaxKind.ObjectLiteralExpression)!\n\n\tconst values = getValuesOfObjectLiteral(objectLiteral).filter((param) => param.value !== null)\n\treturn values as {\n\t\tidentifier: keyof ApiEndpointDocs\n\t\tvalue: (typeof values)[number]['value']\n\t}[]\n}\n\nconst parseRequestParams = (\n\thookNode: Node<ts.CallExpression> | null,\n\tendpointPath: string,\n): EndpointData['requestPathParams'] => {\n\tif (!hookNode) {\n\t\treturn []\n\t}\n\n\tconst paramNode = hookNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tconst valueNode = findNodeImplementation(paramNode.getLastChild()!)\n\n\tif (!valueNode.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\tthrow new Error('Non-literal type used in usePathParams')\n\t}\n\n\tconst declaredParams = endpointPath\n\t\t.split('/')\n\t\t.filter((segment) => segment.startsWith(':'))\n\t\t.map((segment) => ({\n\t\t\tname: segment.substring(1).replace(/\\?/, ''),\n\t\t\toptional: segment.includes('?'),\n\t\t}))\n\n\tconst objectLiteral = valueNode.asKind(SyntaxKind.ObjectLiteralExpression)!\n\treturn getShapeOfValidatorLiteral(objectLiteral)\n\t\t.filter((param) => param.shape !== null)\n\t\t.map((param) => ({\n\t\t\tidentifier: param.identifier,\n\t\t\tsignature: param.shape as string,\n\t\t\toptional: declaredParams.some((declared) => declared.name === param.identifier && declared.optional),\n\t\t\tdescription: param.description,\n\t\t\terrorMessage: param.errorMessage,\n\t\t}))\n}\n\nconst parseRequestRawBody = (\n\thookNode: Node<ts.CallExpression> | null,\n): NonNullable<EndpointData['rawBody']> | null => {\n\tif (!hookNode) {\n\t\treturn null\n\t}\n\tconst paramNode = hookNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tconst valueNode = findNodeImplementation(\n\t\tparamNode.getLastChild((node) => !node.isKind(SyntaxKind.CommaToken))!,\n\t)\n\n\treturn {\n\t\tsignature: getValidatorPropertyShape(valueNode),\n\t\toptional: getValidatorPropertyOptionality(valueNode),\n\t\tdescription: getValidatorPropertyStringValue(valueNode, 'description'),\n\t\terrorMessage: getValidatorPropertyStringValue(valueNode, 'errorMessage'),\n\t}\n}\n\nconst parseRequestObjectInput = (\n\thookNode: Node<ts.CallExpression> | null,\n\tnodeName: 'useQueryParams' | 'useHeaderParams' | 'useRequestBody',\n): EndpointData['requestQuery'] | EndpointData['objectBody'] => {\n\tif (!hookNode) {\n\t\treturn []\n\t}\n\tconst paramNode = hookNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tconst valueNode = findNodeImplementation(paramNode.getLastChild()!)\n\n\tif (!valueNode.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\tthrow new Error(`Non-literal type used in ${nodeName}`)\n\t}\n\n\tconst objectLiteral = valueNode.asKind(SyntaxKind.ObjectLiteralExpression)!\n\treturn getShapeOfValidatorLiteral(objectLiteral)\n\t\t.filter((param) => param.shape !== null)\n\t\t.map((param) => ({\n\t\t\tidentifier: param.identifier,\n\t\t\tsignature: param.shape as string,\n\t\t\toptional: param.optional,\n\t\t\tdescription: param.description,\n\t\t\terrorMessage: param.errorMessage,\n\t\t}))\n}\n\nconst parseRequestResponse = (node: Node<ts.Node>): EndpointData['responses'] => {\n\tconst implementationNode = node\n\t\t.getFirstChildByKind(SyntaxKind.CallExpression)!\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t.getFirstChildByKind(SyntaxKind.ArrowFunction)!\n\tconst returnType = implementationNode.getReturnType()\n\n\tconst actualType = (() => {\n\t\tif (returnType.getText().startsWith('Promise')) {\n\t\t\treturn returnType.getTypeArguments()[0]\n\t\t}\n\t\treturn returnType\n\t})()\n\n\tconst responseType = getProperTypeShape(actualType, node)\n\n\treturn parseResponseTypes(responseType)\n}\n\nconst parseResponseTypes = (\n\tresponseType: ReturnType<typeof getProperTypeShape>,\n): EndpointData['responses'] => {\n\t// TODO: Add support for response descriptions and errors\n\tif (typeof responseType === 'string') {\n\t\treturn [\n\t\t\t{\n\t\t\t\tstatus: responseType === 'void' || responseType === 'null' ? 204 : 200,\n\t\t\t\tcontentType: 'text/plain',\n\t\t\t\tsignature: responseType,\n\t\t\t\tdescription: '',\n\t\t\t\terrorMessage: '',\n\t\t\t},\n\t\t]\n\t}\n\n\tif (responseType[0].role === 'union_entry' || responseType[0].role === 'literal_string') {\n\t\treturn parseResponseTypes(responseType[0].shape)\n\t}\n\n\t// Response type is a useReturnValue hook\n\tif (responseType[0].role === 'property' && responseType[0].identifier === '_isUseReturnValue') {\n\t\tconst status = (() => {\n\t\t\tconst property = responseType.find(\n\t\t\t\t(response) => response.role === 'property' && response.identifier === 'status',\n\t\t\t)?.shape\n\t\t\tif (!property || typeof property === 'string' || typeof property[0].shape !== 'string') {\n\t\t\t\tthrow new Error('Invalid useReturnValue hook')\n\t\t\t}\n\t\t\treturn parseInt(property[0].shape)\n\t\t})()\n\t\tconst contentType = (() => {\n\t\t\tconst property = responseType.find(\n\t\t\t\t(response) => response.role === 'property' && response.identifier === 'contentType',\n\t\t\t)?.shape\n\t\t\tif (!property || typeof property === 'string' || typeof property[0].shape !== 'string') {\n\t\t\t\tthrow new Error('Invalid useReturnValue hook')\n\t\t\t}\n\t\t\treturn property[0].shape\n\t\t})()\n\t\treturn [\n\t\t\t{\n\t\t\t\tstatus,\n\t\t\t\tcontentType,\n\t\t\t\tsignature: responseType,\n\t\t\t\tdescription: '',\n\t\t\t\terrorMessage: '',\n\t\t\t},\n\t\t]\n\t}\n\n\tif (responseType[0].role === 'union') {\n\t\tif (typeof responseType[0].shape === 'string') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tstatus: responseType[0].shape === 'void' || responseType[0].shape === 'null' ? 204 : 200,\n\t\t\t\t\tcontentType: 'application/json',\n\t\t\t\t\tsignature: responseType[0].shape,\n\t\t\t\t\tdescription: '',\n\t\t\t\t\terrorMessage: '',\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\treturn responseType[0].shape.flatMap((unionEntry) => {\n\t\t\treturn parseResponseTypes([unionEntry])\n\t\t})\n\t}\n\n\tif (responseType[0].role === 'buffer') {\n\t\treturn [\n\t\t\t{\n\t\t\t\tstatus: 200,\n\t\t\t\tcontentType: 'application/octet-stream',\n\t\t\t\tsignature: responseType,\n\t\t\t\tdescription: '',\n\t\t\t\terrorMessage: '',\n\t\t\t},\n\t\t]\n\t}\n\n\treturn [\n\t\t{\n\t\t\tstatus: 200,\n\t\t\tcontentType: 'application/json',\n\t\t\tsignature: responseType,\n\t\t\tdescription: '',\n\t\t\terrorMessage: '',\n\t\t},\n\t]\n}\n"],"names":["parseEndpoint","node","sourceFilePath","parsedEndpointMethod","SyntaxKind","endpointMethod","endpointPath","resolveEndpointPath","endpointData","hookNodes","getHookNodes","parseApiDocumentation","param","err","Logger","parseRequestParams","parseRequestObjectInput","parsedBody","parseRequestRawBody","parseRequestResponse","endpointNode","result","name","hookNode","paramNode","valueNode","findNodeImplementation","objectLiteral","getValuesOfObjectLiteral","declaredParams","segment","getShapeOfValidatorLiteral","declared","getValidatorPropertyShape","getValidatorPropertyOptionality","getValidatorPropertyStringValue","nodeName","returnType","actualType","responseType","getProperTypeShape","parseResponseTypes","status","property","response","contentType","unionEntry"],"mappings":";;;AAgBa,MAAAA,IAAgB,CAACC,GAAqBC,MAA2B;AAC7E,QAAMC,IAAuBF,EAC3B,yBAAyBG,EAAW,wBAAwB,EAC5D,QAAQ,EACR,MAAM,GAAG,EAAE,CAAC,EACZ,YAAY,GAERC,IAAiBF,MAAyB,QAAQ,WAAWA,GAE7DG,IAAeC,EAAoBN,CAAI,KAAK,IAE5CO,IAA6B;AAAA,IAClC,QAAQH;AAAA,IACR,MAAMC;AAAA,IACN,gBAAAJ;AAAA,IACA,mBAAmB,CAAC;AAAA,IACpB,cAAc,CAAC;AAAA,IACf,gBAAgB,CAAC;AAAA,IAC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AAA,MAAA,GACpE;AACC,UAAA,CAACD,KAAY,OAAOA,KAAa,YAAY,OAAOA,EAAS,CAAC,EAAE,SAAU;AACvE,cAAA,IAAI,MAAM,6BAA6B;AAEvC,aAAAA,EAAS,CAAC,EAAE;AAAA,IAAA,GACjB;AACI,WAAA;AAAA,MACN;AAAA,QACC,QAAAD;AAAA,QACA,aAAAG;AAAA,QACA,WAAWN;AAAA,QACX,aAAa;AAAA,QACb,cAAc;AAAA,MAAA;AAAA,IAEhB;AAAA,EAAA;AAGD,SAAIA,EAAa,CAAC,EAAE,SAAS,UACxB,OAAOA,EAAa,CAAC,EAAE,SAAU,WAC7B;AAAA,IACN;AAAA,MACC,QAAQA,EAAa,CAAC,EAAE,UAAU,UAAUA,EAAa,CAAC,EAAE,UAAU,SAAS,MAAM;AAAA,MACrF,aAAa;AAAA,MACb,WAAWA,EAAa,CAAC,EAAE;AAAA,MAC3B,aAAa;AAAA,MACb,cAAc;AAAA,IAAA;AAAA,EAEhB,IAGMA,EAAa,CAAC,EAAE,MAAM,QAAQ,CAACO,MAC9BL,EAAmB,CAACK,CAAU,CAAC,CACtC,IAGEP,EAAa,CAAC,EAAE,SAAS,WACrB;AAAA,IACN;AAAA,MACC,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,WAAWA;AAAA,MACX,aAAa;AAAA,MACb,cAAc;AAAA,IAAA;AAAA,EAEhB,IAGM;AAAA,IACN;AAAA,MACC,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,WAAWA;AAAA,MACX,aAAa;AAAA,MACb,cAAc;AAAA,IAAA;AAAA,EAEhB;AACD;"}
1
+ {"version":3,"file":"parseEndpoint.mjs","sources":["../../../src/openapi/analyzerModule/parseEndpoint.ts"],"sourcesContent":["import { Node, SyntaxKind, ts } from 'ts-morph'\n\nimport { ApiEndpointDocs } from '../../hooks/useApiEndpoint'\nimport { Logger } from '../../utils/logger'\nimport { EndpointData } from '../types'\nimport {\n\tfindNodeImplementation,\n\tgetProperTypeShape,\n\tgetShapeOfValidatorLiteral,\n\tgetValidatorPropertyOptionality,\n\tgetValidatorPropertyShape,\n\tgetValidatorPropertyStringValue,\n\tgetValuesOfObjectLiteral,\n\tresolveEndpointPath,\n} from './nodeParsers'\n\nexport type SectionTiming = { section: string; timing: number }\n\nexport const parseEndpoint = (\n\tnode: Node<ts.Node>,\n\tsourceFilePath: string,\n): { endpoint: EndpointData; sectionTimings: SectionTiming[] } => {\n\tconst parsedEndpointMethod = node\n\t\t.getFirstDescendantByKind(SyntaxKind.PropertyAccessExpression)!\n\t\t.getText()\n\t\t.split('.')[1]\n\t\t.toUpperCase()\n\n\tconst endpointMethod = parsedEndpointMethod === 'DEL' ? 'DELETE' : parsedEndpointMethod\n\n\tconst endpointPath = resolveEndpointPath(node) ?? ''\n\n\tconst endpointData: EndpointData = {\n\t\tmethod: endpointMethod as 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',\n\t\tpath: endpointPath,\n\t\tsourceFilePath,\n\t\trequestPathParams: [],\n\t\trequestQuery: [],\n\t\trequestHeaders: [],\n\t\trawBody: undefined,\n\t\tobjectBody: [],\n\t\tresponses: [],\n\t\tname: undefined,\n\t\tsummary: undefined,\n\t\tdescription: undefined,\n\t\ttags: undefined,\n\t}\n\n\tconst warningData: {\n\t\tsegment: string\n\t\terror: Error\n\t}[] = []\n\n\tconst sectionTimings: SectionTiming[] = []\n\n\tconst time = <T>(section: string, fn: () => T): T => {\n\t\tconst t1 = performance.now()\n\t\tconst result = fn()\n\t\tsectionTimings.push({ section, timing: performance.now() - t1 })\n\t\treturn result\n\t}\n\n\tconst hookNodes = getHookNodes(node)\n\n\t// API documentation\n\ttry {\n\t\tconst entries = time('useApiEndpoint', () => parseApiDocumentation(hookNodes.useApiEndpoint))\n\t\tentries.forEach((param) => {\n\t\t\tendpointData[param.identifier] = param.value as string & string[]\n\t\t})\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'api',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Request params\n\ttry {\n\t\tendpointData.requestPathParams = time('usePathParams', () =>\n\t\t\tparseRequestParams(hookNodes.usePathParams, endpointPath),\n\t\t)\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'path',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Request query\n\ttry {\n\t\tendpointData.requestQuery = time('useQueryParams', () =>\n\t\t\tparseRequestObjectInput(hookNodes.useQueryParams, 'useQueryParams'),\n\t\t)\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'query',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Request headers\n\ttry {\n\t\tendpointData.requestHeaders = time('useHeaderParams', () =>\n\t\t\tparseRequestObjectInput(hookNodes.useHeaderParams, 'useHeaderParams'),\n\t\t)\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'headers',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Raw request body\n\ttry {\n\t\tconst parsedBody = time('useRequestRawBody', () => parseRequestRawBody(hookNodes.useRequestRawBody))\n\t\tif (parsedBody) {\n\t\t\tendpointData.rawBody = parsedBody\n\t\t}\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'rawBody',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Object request body\n\ttry {\n\t\tendpointData.objectBody = time('useRequestBody', () =>\n\t\t\tparseRequestObjectInput(hookNodes.useRequestBody, 'useRequestBody'),\n\t\t)\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'objectBody',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\t// Request response\n\ttry {\n\t\tendpointData.responses = time('response', () => parseRequestResponse(node))\n\t} catch (err) {\n\t\twarningData.push({\n\t\t\tsegment: 'response',\n\t\t\terror: err as Error,\n\t\t})\n\t\tLogger.error('Error', err)\n\t}\n\n\treturn { endpoint: endpointData, sectionTimings }\n}\n\ntype HookName =\n\t| 'useApiEndpoint'\n\t| 'usePathParams'\n\t| 'useQueryParams'\n\t| 'useHeaderParams'\n\t| 'useRequestBody'\n\t| 'useRequestRawBody'\n\nconst getHookNodes = (endpointNode: Node<ts.Node>): Record<HookName, Node<ts.CallExpression> | null> => {\n\tconst result: Record<HookName, Node<ts.CallExpression> | null> = {\n\t\tuseApiEndpoint: null,\n\t\tusePathParams: null,\n\t\tuseQueryParams: null,\n\t\tuseHeaderParams: null,\n\t\tuseRequestBody: null,\n\t\tuseRequestRawBody: null,\n\t}\n\tfor (const node of endpointNode.getDescendantsOfKind(SyntaxKind.CallExpression)) {\n\t\tconst name = node.getFirstChildByKind(SyntaxKind.Identifier)?.getText() as HookName | undefined\n\t\tif (name && name in result && result[name] === null) {\n\t\t\tresult[name] = node\n\t\t}\n\t}\n\treturn result\n}\n\nconst parseApiDocumentation = (hookNode: Node<ts.CallExpression> | null) => {\n\tif (!hookNode) {\n\t\treturn []\n\t}\n\tconst paramNode = hookNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tconst valueNode = findNodeImplementation(paramNode.getLastChild()!)\n\n\tif (!valueNode.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\tthrow new Error('Non-literal type used in useApiEndpoint')\n\t}\n\n\tconst objectLiteral = valueNode.asKind(SyntaxKind.ObjectLiteralExpression)!\n\n\tconst values = getValuesOfObjectLiteral(objectLiteral).filter((param) => param.value !== null)\n\treturn values as {\n\t\tidentifier: keyof ApiEndpointDocs\n\t\tvalue: (typeof values)[number]['value']\n\t}[]\n}\n\nconst parseRequestParams = (\n\thookNode: Node<ts.CallExpression> | null,\n\tendpointPath: string,\n): EndpointData['requestPathParams'] => {\n\tif (!hookNode) {\n\t\treturn []\n\t}\n\n\tconst paramNode = hookNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tconst valueNode = findNodeImplementation(paramNode.getLastChild()!)\n\n\tif (!valueNode.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\tthrow new Error('Non-literal type used in usePathParams')\n\t}\n\n\tconst declaredParams = endpointPath\n\t\t.split('/')\n\t\t.filter((segment) => segment.startsWith(':'))\n\t\t.map((segment) => ({\n\t\t\tname: segment.substring(1).replace(/\\?/, ''),\n\t\t\toptional: segment.includes('?'),\n\t\t}))\n\n\tconst objectLiteral = valueNode.asKind(SyntaxKind.ObjectLiteralExpression)!\n\treturn getShapeOfValidatorLiteral(objectLiteral)\n\t\t.filter((param) => param.shape !== null)\n\t\t.map((param) => ({\n\t\t\tidentifier: param.identifier,\n\t\t\tsignature: param.shape as string,\n\t\t\toptional: declaredParams.some((declared) => declared.name === param.identifier && declared.optional),\n\t\t\tdescription: param.description,\n\t\t\terrorMessage: param.errorMessage,\n\t\t}))\n}\n\nconst parseRequestRawBody = (\n\thookNode: Node<ts.CallExpression> | null,\n): NonNullable<EndpointData['rawBody']> | null => {\n\tif (!hookNode) {\n\t\treturn null\n\t}\n\tconst paramNode = hookNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tconst valueNode = findNodeImplementation(\n\t\tparamNode.getLastChild((node) => !node.isKind(SyntaxKind.CommaToken))!,\n\t)\n\n\treturn {\n\t\tsignature: getValidatorPropertyShape(valueNode),\n\t\toptional: getValidatorPropertyOptionality(valueNode),\n\t\tdescription: getValidatorPropertyStringValue(valueNode, 'description'),\n\t\terrorMessage: getValidatorPropertyStringValue(valueNode, 'errorMessage'),\n\t}\n}\n\nconst parseRequestObjectInput = (\n\thookNode: Node<ts.CallExpression> | null,\n\tnodeName: 'useQueryParams' | 'useHeaderParams' | 'useRequestBody',\n): EndpointData['requestQuery'] | EndpointData['objectBody'] => {\n\tif (!hookNode) {\n\t\treturn []\n\t}\n\tconst paramNode = hookNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tconst valueNode = findNodeImplementation(paramNode.getLastChild()!)\n\n\tif (!valueNode.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\tthrow new Error(`Non-literal type used in ${nodeName}`)\n\t}\n\n\tconst objectLiteral = valueNode.asKind(SyntaxKind.ObjectLiteralExpression)!\n\treturn getShapeOfValidatorLiteral(objectLiteral)\n\t\t.filter((param) => param.shape !== null)\n\t\t.map((param) => ({\n\t\t\tidentifier: param.identifier,\n\t\t\tsignature: param.shape as string,\n\t\t\toptional: param.optional,\n\t\t\tdescription: param.description,\n\t\t\terrorMessage: param.errorMessage,\n\t\t}))\n}\n\nconst parseRequestResponse = (node: Node<ts.Node>): EndpointData['responses'] => {\n\tconst implementationNode = node\n\t\t.getFirstChildByKind(SyntaxKind.CallExpression)!\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t.getFirstChildByKind(SyntaxKind.ArrowFunction)!\n\tconst returnType = implementationNode.getReturnType()\n\n\tconst actualType = (() => {\n\t\tif (returnType.getText().startsWith('Promise')) {\n\t\t\treturn returnType.getTypeArguments()[0]\n\t\t}\n\t\treturn returnType\n\t})()\n\n\tconst responseType = getProperTypeShape(actualType, node)\n\n\treturn parseResponseTypes(responseType)\n}\n\nconst parseResponseTypes = (\n\tresponseType: ReturnType<typeof getProperTypeShape>,\n): EndpointData['responses'] => {\n\t// TODO: Add support for response descriptions and errors\n\tif (typeof responseType === 'string') {\n\t\treturn [\n\t\t\t{\n\t\t\t\tstatus: responseType === 'void' || responseType === 'null' ? 204 : 200,\n\t\t\t\tcontentType: 'text/plain',\n\t\t\t\tsignature: responseType,\n\t\t\t\tdescription: '',\n\t\t\t\terrorMessage: '',\n\t\t\t},\n\t\t]\n\t}\n\n\tif (responseType[0].role === 'union_entry' || responseType[0].role === 'literal_string') {\n\t\treturn parseResponseTypes(responseType[0].shape)\n\t}\n\n\t// Response type is a useReturnValue hook\n\tif (responseType[0].role === 'property' && responseType[0].identifier === '_isUseReturnValue') {\n\t\tconst status = (() => {\n\t\t\tconst property = responseType.find(\n\t\t\t\t(response) => response.role === 'property' && response.identifier === 'status',\n\t\t\t)?.shape\n\t\t\tif (!property || typeof property === 'string' || typeof property[0].shape !== 'string') {\n\t\t\t\tthrow new Error('Invalid useReturnValue hook')\n\t\t\t}\n\t\t\treturn parseInt(property[0].shape)\n\t\t})()\n\t\tconst contentType = (() => {\n\t\t\tconst property = responseType.find(\n\t\t\t\t(response) => response.role === 'property' && response.identifier === 'contentType',\n\t\t\t)?.shape\n\t\t\tif (!property || typeof property === 'string' || typeof property[0].shape !== 'string') {\n\t\t\t\tthrow new Error('Invalid useReturnValue hook')\n\t\t\t}\n\t\t\treturn property[0].shape\n\t\t})()\n\t\treturn [\n\t\t\t{\n\t\t\t\tstatus,\n\t\t\t\tcontentType,\n\t\t\t\tsignature: responseType,\n\t\t\t\tdescription: '',\n\t\t\t\terrorMessage: '',\n\t\t\t},\n\t\t]\n\t}\n\n\tif (responseType[0].role === 'union') {\n\t\tif (typeof responseType[0].shape === 'string') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tstatus: responseType[0].shape === 'void' || responseType[0].shape === 'null' ? 204 : 200,\n\t\t\t\t\tcontentType: 'application/json',\n\t\t\t\t\tsignature: responseType[0].shape,\n\t\t\t\t\tdescription: '',\n\t\t\t\t\terrorMessage: '',\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\treturn responseType[0].shape.flatMap((unionEntry) => {\n\t\t\treturn parseResponseTypes([unionEntry])\n\t\t})\n\t}\n\n\tif (responseType[0].role === 'buffer') {\n\t\treturn [\n\t\t\t{\n\t\t\t\tstatus: 200,\n\t\t\t\tcontentType: 'application/octet-stream',\n\t\t\t\tsignature: responseType,\n\t\t\t\tdescription: '',\n\t\t\t\terrorMessage: '',\n\t\t\t},\n\t\t]\n\t}\n\n\treturn [\n\t\t{\n\t\t\tstatus: 200,\n\t\t\tcontentType: 'application/json',\n\t\t\tsignature: responseType,\n\t\t\tdescription: '',\n\t\t\terrorMessage: '',\n\t\t},\n\t]\n}\n"],"names":["parseEndpoint","node","sourceFilePath","parsedEndpointMethod","SyntaxKind","endpointMethod","endpointPath","resolveEndpointPath","endpointData","sectionTimings","time","section","fn","t1","result","hookNodes","getHookNodes","parseApiDocumentation","param","err","Logger","parseRequestParams","parseRequestObjectInput","parsedBody","parseRequestRawBody","parseRequestResponse","endpointNode","name","hookNode","paramNode","valueNode","findNodeImplementation","objectLiteral","getValuesOfObjectLiteral","declaredParams","segment","getShapeOfValidatorLiteral","declared","getValidatorPropertyShape","getValidatorPropertyOptionality","getValidatorPropertyStringValue","nodeName","returnType","actualType","responseType","getProperTypeShape","parseResponseTypes","status","property","response","contentType","unionEntry"],"mappings":";;;AAkBa,MAAAA,IAAgB,CAC5BC,GACAC,MACiE;AACjE,QAAMC,IAAuBF,EAC3B,yBAAyBG,EAAW,wBAAwB,EAC5D,QAAQ,EACR,MAAM,GAAG,EAAE,CAAC,EACZ,YAAY,GAERC,IAAiBF,MAAyB,QAAQ,WAAWA,GAE7DG,IAAeC,EAAoBN,CAAI,KAAK,IAE5CO,IAA6B;AAAA,IAClC,QAAQH;AAAA,IACR,MAAMC;AAAA,IACN,gBAAAJ;AAAA,IACA,mBAAmB,CAAC;AAAA,IACpB,cAAc,CAAC;AAAA,IACf,gBAAgB,CAAC;AAAA,IACjB,SAAS;AAAA,IACT,YAAY,CAAC;AAAA,IACb,WAAW,CAAC;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACP,GAOMO,IAAkC,CAAC,GAEnCC,IAAO,CAAIC,GAAiBC,MAAmB;AAC9C,UAAAC,IAAK,YAAY,IAAI,GACrBC,IAASF,EAAG;AACH,WAAAH,EAAA,KAAK,EAAE,SAAAE,GAAS,QAAQ,YAAY,IAAI,IAAIE,GAAI,GACxDC;AAAA,EACR,GAEMC,IAAYC,EAAaf,CAAI;AAG/B,MAAA;AAEK,IADQS,EAAK,kBAAkB,MAAMO,EAAsBF,EAAU,cAAc,CAAC,EACpF,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K,MAAaA,EAAS,SAAS,cAAcA,EAAS,eAAe;AAAA,MAAA,GACpE;AACC,UAAA,CAACD,KAAY,OAAOA,KAAa,YAAY,OAAOA,EAAS,CAAC,EAAE,SAAU;AACvE,cAAA,IAAI,MAAM,6BAA6B;AAEvC,aAAAA,EAAS,CAAC,EAAE;AAAA,IAAA,GACjB;AACI,WAAA;AAAA,MACN;AAAA,QACC,QAAAD;AAAA,QACA,aAAAG;AAAA,QACA,WAAWN;AAAA,QACX,aAAa;AAAA,QACb,cAAc;AAAA,MAAA;AAAA,IAEhB;AAAA,EAAA;AAGD,SAAIA,EAAa,CAAC,EAAE,SAAS,UACxB,OAAOA,EAAa,CAAC,EAAE,SAAU,WAC7B;AAAA,IACN;AAAA,MACC,QAAQA,EAAa,CAAC,EAAE,UAAU,UAAUA,EAAa,CAAC,EAAE,UAAU,SAAS,MAAM;AAAA,MACrF,aAAa;AAAA,MACb,WAAWA,EAAa,CAAC,EAAE;AAAA,MAC3B,aAAa;AAAA,MACb,cAAc;AAAA,IAAA;AAAA,EAEhB,IAGMA,EAAa,CAAC,EAAE,MAAM,QAAQ,CAACO,MAC9BL,EAAmB,CAACK,CAAU,CAAC,CACtC,IAGEP,EAAa,CAAC,EAAE,SAAS,WACrB;AAAA,IACN;AAAA,MACC,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,WAAWA;AAAA,MACX,aAAa;AAAA,MACb,cAAc;AAAA,IAAA;AAAA,EAEhB,IAGM;AAAA,IACN;AAAA,MACC,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,WAAWA;AAAA,MACX,aAAa;AAAA,MACb,cAAc;AAAA,IAAA;AAAA,EAEhB;AACD;"}
@@ -11,6 +11,7 @@ export declare const TestCase: {
11
11
  readonly parsesZodQueryNumberArray: "parses-zod-query-number-array";
12
12
  readonly parsesZodQueryObjectArray: "parses-zod-query-object-array";
13
13
  readonly parsesZodQueryOptionalArray: "parses-zod-query-optional-array";
14
+ readonly parsesZodPipe: "parses-zod-pipe";
14
15
  readonly parsesReturnRecordStringUnknown: "parses-return-record-string-unknown";
15
16
  readonly parsesReturnObjectWithRecordProperty: "parses-return-object-with-record-property";
16
17
  readonly parsesBufferReturnedFromFunction: "parses-buffer-returned-from-function";
@@ -1 +1 @@
1
- {"version":3,"file":"TestCase.d.ts","sourceRoot":"","sources":["../../../../src/openapi/analyzerModule/test/TestCase.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BX,CAAA"}
1
+ {"version":3,"file":"TestCase.d.ts","sourceRoot":"","sources":["../../../../src/openapi/analyzerModule/test/TestCase.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BX,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare function setup(): void;
2
+ export declare function teardown(): void;
3
+ //# sourceMappingURL=workerGlobalSetup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workerGlobalSetup.d.ts","sourceRoot":"","sources":["../../../../src/openapi/analyzerModule/test/workerGlobalSetup.ts"],"names":[],"mappings":"AASA,wBAAgB,KAAK,SASpB;AAED,wBAAgB,QAAQ,SAIvB"}
@@ -0,0 +1,2 @@
1
+ export declare const TEST_WORKER_PATH: string;
2
+ //# sourceMappingURL=workerPaths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workerPaths.d.ts","sourceRoot":"","sources":["../../../src/openapi/analyzerModule/workerPaths.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,QAA+D,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("os"),h=require("worker_threads");class l{constructor(e){this.queue=[],this.pending=new Map;const t=Math.max(1,Math.min(o.cpus().length-1,8));this.workers=Array.from({length:t},()=>{const s=new h.Worker(e);return s.on("message",r=>{const i=this.pending.get(r.taskId);i&&(this.pending.delete(r.taskId),i(r)),this.idle.push(s),this.flush()}),s.on("error",r=>{for(const[i,n]of this.pending){n({taskId:i,error:String(r)}),this.pending.delete(i);break}this.idle.push(s),this.flush()}),s}),this.idle=[...this.workers]}run(e){return new Promise(t=>{if(this.idle.length>0){const s=this.idle.pop();this.pending.set(e.taskId,t),s.postMessage(e)}else this.queue.push({task:e,resolve:t})})}runAll(e){return Promise.all(e.map(t=>this.run(t)))}terminate(){this.workers.forEach(e=>e.terminate())}flush(){for(;this.queue.length>0&&this.idle.length>0;){const{task:e,resolve:t}=this.queue.shift(),s=this.idle.pop();this.pending.set(e.taskId,t),s.postMessage(e)}}}exports.WorkerPool=l;
2
+ //# sourceMappingURL=workerPool.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workerPool.cjs","sources":["../../../src/openapi/analyzerModule/workerPool.ts"],"sourcesContent":["import os from 'os'\nimport { Worker } from 'worker_threads'\n\nimport { EndpointData } from '../types'\nimport { SectionTiming } from './parseEndpoint'\n\nexport type WorkerTask = {\n\ttaskId: string\n\ttsconfigPath: string\n\tsourceFilePath: string\n\trouterName: string\n\tendpointIndex: number\n}\n\nexport type WorkerResultSuccess = {\n\ttaskId: string\n\tendpoint: EndpointData\n\tsectionTimings: SectionTiming[]\n\ttiming: number\n}\n\nexport type WorkerResultError = {\n\ttaskId: string\n\terror: string\n}\n\nexport type WorkerResult = WorkerResultSuccess | WorkerResultError\n\nexport class WorkerPool {\n\tprivate workers: Worker[]\n\tprivate idle: Worker[]\n\tprivate queue: Array<{ task: WorkerTask; resolve: (r: WorkerResult) => void }> = []\n\tprivate pending = new Map<string, (r: WorkerResult) => void>()\n\n\tconstructor(workerUrl: URL) {\n\t\tconst size = Math.max(1, Math.min(os.cpus().length - 1, 8))\n\t\tthis.workers = Array.from({ length: size }, () => {\n\t\t\tconst worker = new Worker(workerUrl)\n\t\t\tworker.on('message', (result: WorkerResult) => {\n\t\t\t\tconst resolve = this.pending.get(result.taskId)\n\t\t\t\tif (resolve) {\n\t\t\t\t\tthis.pending.delete(result.taskId)\n\t\t\t\t\tresolve(result)\n\t\t\t\t}\n\t\t\t\tthis.idle.push(worker)\n\t\t\t\tthis.flush()\n\t\t\t})\n\t\t\tworker.on('error', (err) => {\n\t\t\t\t// Find any pending task for this worker and reject it\n\t\t\t\t// (worker crashed — shouldn't happen, but handle gracefully)\n\t\t\t\tfor (const [taskId, resolve] of this.pending) {\n\t\t\t\t\tresolve({ taskId, error: String(err) })\n\t\t\t\t\tthis.pending.delete(taskId)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tthis.idle.push(worker)\n\t\t\t\tthis.flush()\n\t\t\t})\n\t\t\treturn worker\n\t\t})\n\t\tthis.idle = [...this.workers]\n\t}\n\n\trun(task: WorkerTask): Promise<WorkerResult> {\n\t\treturn new Promise((resolve) => {\n\t\t\tif (this.idle.length > 0) {\n\t\t\t\tconst worker = this.idle.pop()!\n\t\t\t\tthis.pending.set(task.taskId, resolve)\n\t\t\t\tworker.postMessage(task)\n\t\t\t} else {\n\t\t\t\tthis.queue.push({ task, resolve })\n\t\t\t}\n\t\t})\n\t}\n\n\trunAll(tasks: WorkerTask[]): Promise<WorkerResult[]> {\n\t\treturn Promise.all(tasks.map((t) => this.run(t)))\n\t}\n\n\tterminate() {\n\t\tthis.workers.forEach((w) => w.terminate())\n\t}\n\n\tprivate flush() {\n\t\twhile (this.queue.length > 0 && this.idle.length > 0) {\n\t\t\tconst { task, resolve } = this.queue.shift()!\n\t\t\tconst worker = this.idle.pop()!\n\t\t\tthis.pending.set(task.taskId, resolve)\n\t\t\tworker.postMessage(task)\n\t\t}\n\t}\n}\n"],"names":["WorkerPool","workerUrl","size","os","worker","Worker","result","resolve","err","taskId","task","tasks","w"],"mappings":"kIA4BO,MAAMA,CAAW,CAMvB,YAAYC,EAAgB,CAH5B,KAAQ,MAAyE,CAAC,EAC1E,KAAA,YAAc,IAGrB,MAAMC,EAAO,KAAK,IAAI,EAAG,KAAK,IAAIC,EAAG,KAAA,EA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AA,EAAY,KAAK,MAAM,MAAM,EACrCH,EAAS,KAAK,KAAK,IAAI,EAC7B,KAAK,QAAQ,IAAIM,EAAK,OAAQH,CAAO,EACrCH,EAAO,YAAYM,CAAI,CAAA,CACxB,CAEF"}
@@ -0,0 +1,33 @@
1
+ import { EndpointData } from '../types';
2
+ import { SectionTiming } from './parseEndpoint';
3
+
4
+ export type WorkerTask = {
5
+ taskId: string;
6
+ tsconfigPath: string;
7
+ sourceFilePath: string;
8
+ routerName: string;
9
+ endpointIndex: number;
10
+ };
11
+ export type WorkerResultSuccess = {
12
+ taskId: string;
13
+ endpoint: EndpointData;
14
+ sectionTimings: SectionTiming[];
15
+ timing: number;
16
+ };
17
+ export type WorkerResultError = {
18
+ taskId: string;
19
+ error: string;
20
+ };
21
+ export type WorkerResult = WorkerResultSuccess | WorkerResultError;
22
+ export declare class WorkerPool {
23
+ private workers;
24
+ private idle;
25
+ private queue;
26
+ private pending;
27
+ constructor(workerUrl: URL);
28
+ run(task: WorkerTask): Promise<WorkerResult>;
29
+ runAll(tasks: WorkerTask[]): Promise<WorkerResult[]>;
30
+ terminate(): void;
31
+ private flush;
32
+ }
33
+ //# sourceMappingURL=workerPool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workerPool.d.ts","sourceRoot":"","sources":["../../../src/openapi/analyzerModule/workerPool.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,YAAY,CAAA;IACtB,cAAc,EAAE,aAAa,EAAE,CAAA;IAC/B,MAAM,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,iBAAiB,CAAA;AAElE,qBAAa,UAAU;IACtB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,KAAK,CAAsE;IACnF,OAAO,CAAC,OAAO,CAA+C;gBAElD,SAAS,EAAE,GAAG;IA6B1B,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;IAY5C,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAIpD,SAAS;IAIT,OAAO,CAAC,KAAK;CAQb"}
@@ -0,0 +1,46 @@
1
+ import o from "os";
2
+ import { Worker as h } from "worker_threads";
3
+ class u {
4
+ constructor(e) {
5
+ this.queue = [], this.pending = /* @__PURE__ */ new Map();
6
+ const t = Math.max(1, Math.min(o.cpus().length - 1, 8));
7
+ this.workers = Array.from({ length: t }, () => {
8
+ const s = new h(e);
9
+ return s.on("message", (i) => {
10
+ const r = this.pending.get(i.taskId);
11
+ r && (this.pending.delete(i.taskId), r(i)), this.idle.push(s), this.flush();
12
+ }), s.on("error", (i) => {
13
+ for (const [r, n] of this.pending) {
14
+ n({ taskId: r, error: String(i) }), this.pending.delete(r);
15
+ break;
16
+ }
17
+ this.idle.push(s), this.flush();
18
+ }), s;
19
+ }), this.idle = [...this.workers];
20
+ }
21
+ run(e) {
22
+ return new Promise((t) => {
23
+ if (this.idle.length > 0) {
24
+ const s = this.idle.pop();
25
+ this.pending.set(e.taskId, t), s.postMessage(e);
26
+ } else
27
+ this.queue.push({ task: e, resolve: t });
28
+ });
29
+ }
30
+ runAll(e) {
31
+ return Promise.all(e.map((t) => this.run(t)));
32
+ }
33
+ terminate() {
34
+ this.workers.forEach((e) => e.terminate());
35
+ }
36
+ flush() {
37
+ for (; this.queue.length > 0 && this.idle.length > 0; ) {
38
+ const { task: e, resolve: t } = this.queue.shift(), s = this.idle.pop();
39
+ this.pending.set(e.taskId, t), s.postMessage(e);
40
+ }
41
+ }
42
+ }
43
+ export {
44
+ u as WorkerPool
45
+ };
46
+ //# sourceMappingURL=workerPool.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workerPool.mjs","sources":["../../../src/openapi/analyzerModule/workerPool.ts"],"sourcesContent":["import os from 'os'\nimport { Worker } from 'worker_threads'\n\nimport { EndpointData } from '../types'\nimport { SectionTiming } from './parseEndpoint'\n\nexport type WorkerTask = {\n\ttaskId: string\n\ttsconfigPath: string\n\tsourceFilePath: string\n\trouterName: string\n\tendpointIndex: number\n}\n\nexport type WorkerResultSuccess = {\n\ttaskId: string\n\tendpoint: EndpointData\n\tsectionTimings: SectionTiming[]\n\ttiming: number\n}\n\nexport type WorkerResultError = {\n\ttaskId: string\n\terror: string\n}\n\nexport type WorkerResult = WorkerResultSuccess | WorkerResultError\n\nexport class WorkerPool {\n\tprivate workers: Worker[]\n\tprivate idle: Worker[]\n\tprivate queue: Array<{ task: WorkerTask; resolve: (r: WorkerResult) => void }> = []\n\tprivate pending = new Map<string, (r: WorkerResult) => void>()\n\n\tconstructor(workerUrl: URL) {\n\t\tconst size = Math.max(1, Math.min(os.cpus().length - 1, 8))\n\t\tthis.workers = Array.from({ length: size }, () => {\n\t\t\tconst worker = new Worker(workerUrl)\n\t\t\tworker.on('message', (result: WorkerResult) => {\n\t\t\t\tconst resolve = this.pending.get(result.taskId)\n\t\t\t\tif (resolve) {\n\t\t\t\t\tthis.pending.delete(result.taskId)\n\t\t\t\t\tresolve(result)\n\t\t\t\t}\n\t\t\t\tthis.idle.push(worker)\n\t\t\t\tthis.flush()\n\t\t\t})\n\t\t\tworker.on('error', (err) => {\n\t\t\t\t// Find any pending task for this worker and reject it\n\t\t\t\t// (worker crashed — shouldn't happen, but handle gracefully)\n\t\t\t\tfor (const [taskId, resolve] of this.pending) {\n\t\t\t\t\tresolve({ taskId, error: String(err) })\n\t\t\t\t\tthis.pending.delete(taskId)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tthis.idle.push(worker)\n\t\t\t\tthis.flush()\n\t\t\t})\n\t\t\treturn worker\n\t\t})\n\t\tthis.idle = [...this.workers]\n\t}\n\n\trun(task: WorkerTask): Promise<WorkerResult> {\n\t\treturn new Promise((resolve) => {\n\t\t\tif (this.idle.length > 0) {\n\t\t\t\tconst worker = this.idle.pop()!\n\t\t\t\tthis.pending.set(task.taskId, resolve)\n\t\t\t\tworker.postMessage(task)\n\t\t\t} else {\n\t\t\t\tthis.queue.push({ task, resolve })\n\t\t\t}\n\t\t})\n\t}\n\n\trunAll(tasks: WorkerTask[]): Promise<WorkerResult[]> {\n\t\treturn Promise.all(tasks.map((t) => this.run(t)))\n\t}\n\n\tterminate() {\n\t\tthis.workers.forEach((w) => w.terminate())\n\t}\n\n\tprivate flush() {\n\t\twhile (this.queue.length > 0 && this.idle.length > 0) {\n\t\t\tconst { task, resolve } = this.queue.shift()!\n\t\t\tconst worker = this.idle.pop()!\n\t\t\tthis.pending.set(task.taskId, resolve)\n\t\t\tworker.postMessage(task)\n\t\t}\n\t}\n}\n"],"names":["WorkerPool","workerUrl","size","os","worker","Worker","result","resolve","err","taskId","task","tasks","w"],"mappings":";;AA4BO,MAAMA,EAAW;AAAA,EAMvB,YAAYC,GAAgB;AAH5B,SAAQ,QAAyE,CAAC,GAC1E,KAAA,8BAAc,IAAuC;AAG5D,UAAMC,IAAO,KAAK,IAAI,GAAG,KAAK,IAAIC,EAAG,KAAA,EAAO,SAAS,GAAG,CAAC,CAAC;AAC1D,SAAK,UAAU,MAAM,KAAK,EAAE,QAAQD,EAAA,GAAQ,MAAM;AAC3C,YAAAE,IAAS,IAAIC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