swagger-to-playwright-api-clients 1.0.4
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/LICENSE +21 -0
- package/README.md +190 -0
- package/dist/api.d.ts +27 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +127 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +255 -0
- package/dist/cli.js.map +1 -0
- package/dist/clients/BaseAPIClient.d.ts +88 -0
- package/dist/clients/BaseAPIClient.d.ts.map +1 -0
- package/dist/clients/BaseAPIClient.js +199 -0
- package/dist/clients/BaseAPIClient.js.map +1 -0
- package/dist/config/types.d.ts +72 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +19 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/copyBaseClient.d.ts +8 -0
- package/dist/utils/copyBaseClient.d.ts.map +1 -0
- package/dist/utils/copyBaseClient.js +354 -0
- package/dist/utils/copyBaseClient.js.map +1 -0
- package/dist/utils/logger.d.ts +6 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +57 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/swagger/ClientGenerator.d.ts +49 -0
- package/dist/utils/swagger/ClientGenerator.d.ts.map +1 -0
- package/dist/utils/swagger/ClientGenerator.js +192 -0
- package/dist/utils/swagger/ClientGenerator.js.map +1 -0
- package/dist/utils/swagger/FileWriter.d.ts +66 -0
- package/dist/utils/swagger/FileWriter.d.ts.map +1 -0
- package/dist/utils/swagger/FileWriter.js +185 -0
- package/dist/utils/swagger/FileWriter.js.map +1 -0
- package/dist/utils/swagger/SwaggerGenerator.d.ts +42 -0
- package/dist/utils/swagger/SwaggerGenerator.d.ts.map +1 -0
- package/dist/utils/swagger/SwaggerGenerator.js +211 -0
- package/dist/utils/swagger/SwaggerGenerator.js.map +1 -0
- package/dist/utils/swagger/SwaggerParser.d.ts +69 -0
- package/dist/utils/swagger/SwaggerParser.d.ts.map +1 -0
- package/dist/utils/swagger/SwaggerParser.js +358 -0
- package/dist/utils/swagger/SwaggerParser.js.map +1 -0
- package/dist/utils/swagger/TypeGenerator.d.ts +49 -0
- package/dist/utils/swagger/TypeGenerator.d.ts.map +1 -0
- package/dist/utils/swagger/TypeGenerator.js +166 -0
- package/dist/utils/swagger/TypeGenerator.js.map +1 -0
- package/dist/utils/swagger/index.d.ts +12 -0
- package/dist/utils/swagger/index.d.ts.map +1 -0
- package/dist/utils/swagger/index.js +38 -0
- package/dist/utils/swagger/index.js.map +1 -0
- package/dist/utils/swagger/run-generator.d.ts +23 -0
- package/dist/utils/swagger/run-generator.d.ts.map +1 -0
- package/dist/utils/swagger/run-generator.js +195 -0
- package/dist/utils/swagger/run-generator.js.map +1 -0
- package/dist/utils/swagger/types.d.ts +142 -0
- package/dist/utils/swagger/types.d.ts.map +1 -0
- package/dist/utils/swagger/types.js +7 -0
- package/dist/utils/swagger/types.js.map +1 -0
- package/dist/utils/swagger/utils/naming.d.ts +48 -0
- package/dist/utils/swagger/utils/naming.d.ts.map +1 -0
- package/dist/utils/swagger/utils/naming.js +109 -0
- package/dist/utils/swagger/utils/naming.js.map +1 -0
- package/dist/utils/swagger/utils/pathUtils.d.ts +40 -0
- package/dist/utils/swagger/utils/pathUtils.d.ts.map +1 -0
- package/dist/utils/swagger/utils/pathUtils.js +118 -0
- package/dist/utils/swagger/utils/pathUtils.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Utility to copy BaseAPIClient to user's project
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.copyBaseClient = copyBaseClient;
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const logger_1 = __importDefault(require("./logger"));
|
|
46
|
+
/**
|
|
47
|
+
* BaseAPIClient template content - standalone version without winston dependency
|
|
48
|
+
*/
|
|
49
|
+
const BASE_API_CLIENT_CONTENT = `/**
|
|
50
|
+
* BaseAPIClient - Base class for making API requests using Playwright's APIRequestContext
|
|
51
|
+
* Generated by swagger-to-playwright-api-clients
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
import { request, APIRequestContext } from '@playwright/test';
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Options for individual API requests
|
|
58
|
+
*/
|
|
59
|
+
export interface RequestOptions {
|
|
60
|
+
headers?: Record<string, string>;
|
|
61
|
+
params?: Record<string, string | number | boolean | undefined>;
|
|
62
|
+
timeout?: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Standard API response result
|
|
67
|
+
*/
|
|
68
|
+
export interface APIResponseResult<T = unknown> {
|
|
69
|
+
body: T;
|
|
70
|
+
status: number;
|
|
71
|
+
headers: Record<string, string>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Logger interface - implement this to customize logging
|
|
76
|
+
*/
|
|
77
|
+
export interface APIClientLogger {
|
|
78
|
+
info(message: string): void;
|
|
79
|
+
debug(message: string): void;
|
|
80
|
+
error(message: string): void;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Default console logger
|
|
85
|
+
*/
|
|
86
|
+
const defaultLogger: APIClientLogger = {
|
|
87
|
+
info: (msg) => console.log(\`[INFO] \${msg}\`),
|
|
88
|
+
debug: (msg) => console.debug(\`[DEBUG] \${msg}\`),
|
|
89
|
+
error: (msg) => console.error(\`[ERROR] \${msg}\`),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* BaseAPIClient - Provides HTTP methods using Playwright's request API
|
|
94
|
+
*/
|
|
95
|
+
export class BaseAPIClient {
|
|
96
|
+
private baseURL: string;
|
|
97
|
+
private defaultHeaders: Record<string, string>;
|
|
98
|
+
private context: APIRequestContext | null = null;
|
|
99
|
+
private logger: APIClientLogger;
|
|
100
|
+
|
|
101
|
+
constructor(
|
|
102
|
+
baseURL: string,
|
|
103
|
+
defaultHeaders: Record<string, string> = {},
|
|
104
|
+
logger: APIClientLogger = defaultLogger
|
|
105
|
+
) {
|
|
106
|
+
this.baseURL = baseURL;
|
|
107
|
+
this.defaultHeaders = defaultHeaders;
|
|
108
|
+
this.logger = logger;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Initialize the API request context
|
|
113
|
+
*/
|
|
114
|
+
async init(): Promise<void> {
|
|
115
|
+
this.context = await request.newContext({
|
|
116
|
+
baseURL: this.baseURL,
|
|
117
|
+
extraHTTPHeaders: this.defaultHeaders,
|
|
118
|
+
});
|
|
119
|
+
this.logger.info(\`BaseAPIClient initialized with baseURL: \${this.baseURL}\`);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Dispose the API request context
|
|
124
|
+
*/
|
|
125
|
+
async dispose(): Promise<void> {
|
|
126
|
+
if (this.context) {
|
|
127
|
+
await this.context.dispose();
|
|
128
|
+
this.context = null;
|
|
129
|
+
this.logger.info('BaseAPIClient disposed');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get the request context, initializing if needed
|
|
135
|
+
*/
|
|
136
|
+
private async getContext(): Promise<APIRequestContext> {
|
|
137
|
+
if (!this.context) {
|
|
138
|
+
await this.init();
|
|
139
|
+
}
|
|
140
|
+
return this.context!;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Build URL with query parameters
|
|
145
|
+
*/
|
|
146
|
+
private buildUrl(
|
|
147
|
+
endpoint: string,
|
|
148
|
+
params?: Record<string, string | number | boolean | undefined>
|
|
149
|
+
): string {
|
|
150
|
+
if (!params) return endpoint;
|
|
151
|
+
|
|
152
|
+
const searchParams = new URLSearchParams();
|
|
153
|
+
for (const [key, value] of Object.entries(params)) {
|
|
154
|
+
if (value !== undefined) {
|
|
155
|
+
searchParams.append(key, String(value));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const queryString = searchParams.toString();
|
|
160
|
+
if (!queryString) return endpoint;
|
|
161
|
+
|
|
162
|
+
return \`\${endpoint}\${endpoint.includes('?') ? '&' : '?'}\${queryString}\`;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Log request details
|
|
167
|
+
*/
|
|
168
|
+
private logRequest(
|
|
169
|
+
method: string,
|
|
170
|
+
url: string,
|
|
171
|
+
headers?: Record<string, string>,
|
|
172
|
+
body?: unknown
|
|
173
|
+
): void {
|
|
174
|
+
this.logger.info(\`>>> \${method} \${this.baseURL}\${url}\`);
|
|
175
|
+
const allHeaders = { ...this.defaultHeaders, ...headers };
|
|
176
|
+
this.logger.debug(\`Headers: \${JSON.stringify(allHeaders, null, 2)}\`);
|
|
177
|
+
if (body !== undefined) {
|
|
178
|
+
this.logger.info(\`Body: \${JSON.stringify(body, null, 2)}\`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Log response details
|
|
184
|
+
*/
|
|
185
|
+
private logResponse<T>(method: string, url: string, status: number, body: T): void {
|
|
186
|
+
this.logger.info(\`<<< \${method} \${this.baseURL}\${url} - Status: \${status}\`);
|
|
187
|
+
this.logger.info(\`Response: \${JSON.stringify(body, null, 2)}\`);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Parse response into standard result format
|
|
192
|
+
*/
|
|
193
|
+
private async parseResponse<T>(
|
|
194
|
+
response: Awaited<ReturnType<APIRequestContext['get']>>
|
|
195
|
+
): Promise<APIResponseResult<T>> {
|
|
196
|
+
let body: T;
|
|
197
|
+
const contentType = response.headers()['content-type'] || '';
|
|
198
|
+
|
|
199
|
+
if (contentType.includes('application/json')) {
|
|
200
|
+
try {
|
|
201
|
+
body = await response.json();
|
|
202
|
+
} catch {
|
|
203
|
+
body = (await response.text()) as unknown as T;
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
body = (await response.text()) as unknown as T;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return {
|
|
210
|
+
body,
|
|
211
|
+
status: response.status(),
|
|
212
|
+
headers: response.headers(),
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* GET request
|
|
218
|
+
*/
|
|
219
|
+
async get<T = unknown>(
|
|
220
|
+
endpoint: string,
|
|
221
|
+
options?: RequestOptions
|
|
222
|
+
): Promise<APIResponseResult<T>> {
|
|
223
|
+
const ctx = await this.getContext();
|
|
224
|
+
const url = this.buildUrl(endpoint, options?.params);
|
|
225
|
+
|
|
226
|
+
this.logRequest('GET', url, options?.headers);
|
|
227
|
+
|
|
228
|
+
const response = await ctx.get(url, {
|
|
229
|
+
headers: options?.headers,
|
|
230
|
+
timeout: options?.timeout,
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
const result = await this.parseResponse<T>(response);
|
|
234
|
+
this.logResponse('GET', url, result.status, result.body);
|
|
235
|
+
|
|
236
|
+
return result;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* POST request
|
|
241
|
+
*/
|
|
242
|
+
async post<T = unknown>(
|
|
243
|
+
endpoint: string,
|
|
244
|
+
data?: unknown,
|
|
245
|
+
options?: RequestOptions
|
|
246
|
+
): Promise<APIResponseResult<T>> {
|
|
247
|
+
const ctx = await this.getContext();
|
|
248
|
+
const url = this.buildUrl(endpoint, options?.params);
|
|
249
|
+
|
|
250
|
+
this.logRequest('POST', url, options?.headers, data);
|
|
251
|
+
|
|
252
|
+
const response = await ctx.post(url, {
|
|
253
|
+
data,
|
|
254
|
+
headers: options?.headers,
|
|
255
|
+
timeout: options?.timeout,
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
const result = await this.parseResponse<T>(response);
|
|
259
|
+
this.logResponse('POST', url, result.status, result.body);
|
|
260
|
+
|
|
261
|
+
return result;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* PUT request
|
|
266
|
+
*/
|
|
267
|
+
async put<T = unknown>(
|
|
268
|
+
endpoint: string,
|
|
269
|
+
data?: unknown,
|
|
270
|
+
options?: RequestOptions
|
|
271
|
+
): Promise<APIResponseResult<T>> {
|
|
272
|
+
const ctx = await this.getContext();
|
|
273
|
+
const url = this.buildUrl(endpoint, options?.params);
|
|
274
|
+
|
|
275
|
+
this.logRequest('PUT', url, options?.headers, data);
|
|
276
|
+
|
|
277
|
+
const response = await ctx.put(url, {
|
|
278
|
+
data,
|
|
279
|
+
headers: options?.headers,
|
|
280
|
+
timeout: options?.timeout,
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
const result = await this.parseResponse<T>(response);
|
|
284
|
+
this.logResponse('PUT', url, result.status, result.body);
|
|
285
|
+
|
|
286
|
+
return result;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* PATCH request
|
|
291
|
+
*/
|
|
292
|
+
async patch<T = unknown>(
|
|
293
|
+
endpoint: string,
|
|
294
|
+
data?: unknown,
|
|
295
|
+
options?: RequestOptions
|
|
296
|
+
): Promise<APIResponseResult<T>> {
|
|
297
|
+
const ctx = await this.getContext();
|
|
298
|
+
const url = this.buildUrl(endpoint, options?.params);
|
|
299
|
+
|
|
300
|
+
this.logRequest('PATCH', url, options?.headers, data);
|
|
301
|
+
|
|
302
|
+
const response = await ctx.patch(url, {
|
|
303
|
+
data,
|
|
304
|
+
headers: options?.headers,
|
|
305
|
+
timeout: options?.timeout,
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
const result = await this.parseResponse<T>(response);
|
|
309
|
+
this.logResponse('PATCH', url, result.status, result.body);
|
|
310
|
+
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* DELETE request
|
|
316
|
+
*/
|
|
317
|
+
async delete<T = unknown>(
|
|
318
|
+
endpoint: string,
|
|
319
|
+
data?: unknown,
|
|
320
|
+
options?: RequestOptions
|
|
321
|
+
): Promise<APIResponseResult<T>> {
|
|
322
|
+
const ctx = await this.getContext();
|
|
323
|
+
const url = this.buildUrl(endpoint, options?.params);
|
|
324
|
+
|
|
325
|
+
this.logRequest('DELETE', url, options?.headers, data);
|
|
326
|
+
|
|
327
|
+
const response = await ctx.delete(url, {
|
|
328
|
+
data,
|
|
329
|
+
headers: options?.headers,
|
|
330
|
+
timeout: options?.timeout,
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
const result = await this.parseResponse<T>(response);
|
|
334
|
+
this.logResponse('DELETE', url, result.status, result.body);
|
|
335
|
+
|
|
336
|
+
return result;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export default BaseAPIClient;
|
|
341
|
+
`;
|
|
342
|
+
/**
|
|
343
|
+
* Copy BaseAPIClient to the specified output directory
|
|
344
|
+
*/
|
|
345
|
+
async function copyBaseClient(outputDir) {
|
|
346
|
+
const targetPath = path.join(outputDir, 'BaseAPIClient.ts');
|
|
347
|
+
// Ensure directory exists
|
|
348
|
+
await fs.promises.mkdir(outputDir, { recursive: true });
|
|
349
|
+
// Write the file
|
|
350
|
+
await fs.promises.writeFile(targetPath, BASE_API_CLIENT_CONTENT, 'utf-8');
|
|
351
|
+
logger_1.default.info(`BaseAPIClient copied to: ${targetPath}`);
|
|
352
|
+
return targetPath;
|
|
353
|
+
}
|
|
354
|
+
//# sourceMappingURL=copyBaseClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyBaseClient.js","sourceRoot":"","sources":["../../src/utils/copyBaseClient.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkTH,wCAYC;AA5TD,uCAAyB;AACzB,2CAA6B;AAC7B,sDAA8B;AAE9B;;GAEG;AACH,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoS/B,CAAC;AAEF;;GAEG;AACI,KAAK,UAAU,cAAc,CAAC,SAAiB;IACrD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IAE5D,0BAA0B;IAC1B,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAExD,iBAAiB;IACjB,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAE1E,gBAAM,CAAC,IAAI,CAAC,4BAA4B,UAAU,EAAE,CAAC,CAAC;IAEtD,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import winston from 'winston';
|
|
2
|
+
declare const logger: winston.Logger;
|
|
3
|
+
export declare const logRequest: (method: string, url: string, statusCode: number, duration: number) => void;
|
|
4
|
+
export declare const logError: (error: Error, context?: string) => void;
|
|
5
|
+
export default logger;
|
|
6
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AA4B9B,QAAA,MAAM,MAAM,gBAsBV,CAAC;AAGH,eAAO,MAAM,UAAU,GACtB,QAAQ,MAAM,EACd,KAAK,MAAM,EACX,YAAY,MAAM,EAClB,UAAU,MAAM,KACd,IAEF,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,EAAE,gBAAY,KAAG,IAGrD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.logError = exports.logRequest = void 0;
|
|
7
|
+
const winston_1 = __importDefault(require("winston"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
// Define log directory
|
|
10
|
+
const logDir = path_1.default.join(process.cwd(), 'logs');
|
|
11
|
+
// Custom log format
|
|
12
|
+
const logFormat = winston_1.default.format.combine(winston_1.default.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), winston_1.default.format.errors({ stack: true }), winston_1.default.format.printf(({ level, message, timestamp, stack }) => {
|
|
13
|
+
if (stack) {
|
|
14
|
+
return `${timestamp} [${level.toUpperCase()}]: ${message}\n${stack}`;
|
|
15
|
+
}
|
|
16
|
+
return `${timestamp} [${level.toUpperCase()}]: ${message}`;
|
|
17
|
+
}));
|
|
18
|
+
// Console format with colors
|
|
19
|
+
const consoleFormat = winston_1.default.format.combine(winston_1.default.format.colorize({ all: true }), winston_1.default.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), winston_1.default.format.printf(({ level, message, timestamp }) => {
|
|
20
|
+
return `${timestamp} [${level}]: ${message}`;
|
|
21
|
+
}));
|
|
22
|
+
// Create logger instance
|
|
23
|
+
const logger = winston_1.default.createLogger({
|
|
24
|
+
level: process.env.LOG_LEVEL || 'info',
|
|
25
|
+
format: logFormat,
|
|
26
|
+
transports: [
|
|
27
|
+
// Console transport
|
|
28
|
+
new winston_1.default.transports.Console({
|
|
29
|
+
format: consoleFormat,
|
|
30
|
+
}),
|
|
31
|
+
// Combined log file
|
|
32
|
+
new winston_1.default.transports.File({
|
|
33
|
+
filename: path_1.default.join(logDir, 'combined.log'),
|
|
34
|
+
maxsize: 5242880, // 5MB
|
|
35
|
+
maxFiles: 5,
|
|
36
|
+
}),
|
|
37
|
+
// Error log file
|
|
38
|
+
new winston_1.default.transports.File({
|
|
39
|
+
filename: path_1.default.join(logDir, 'error.log'),
|
|
40
|
+
level: 'error',
|
|
41
|
+
maxsize: 5242880, // 5MB
|
|
42
|
+
maxFiles: 5,
|
|
43
|
+
}),
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
// Utility methods
|
|
47
|
+
const logRequest = (method, url, statusCode, duration) => {
|
|
48
|
+
logger.info(`${method} ${url} - ${statusCode} (${duration}ms)`);
|
|
49
|
+
};
|
|
50
|
+
exports.logRequest = logRequest;
|
|
51
|
+
const logError = (error, context = '') => {
|
|
52
|
+
const errorMessage = context ? `${context}: ${error.message}` : error.message;
|
|
53
|
+
logger.error(errorMessage, { stack: error.stack });
|
|
54
|
+
};
|
|
55
|
+
exports.logError = logError;
|
|
56
|
+
exports.default = logger;
|
|
57
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAC9B,gDAAwB;AAExB,uBAAuB;AACvB,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;AAEhD,oBAAoB;AACpB,MAAM,SAAS,GAAG,iBAAO,CAAC,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ACF,oBAAoB;QACpB,IAAI,iBAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YAC3B,QAAQ,EAAE,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC;YAC3C,OAAO,EAAE,OAAO,EAAE,MAAM;YACxB,QAAQ,EAAE,CAAC;SACX,CAAC;QACF,iBAAiB;QACjB,IAAI,iBAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YAC3B,QAAQ,EAAE,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC;YACxC,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,OAAO,EAAE,MAAM;YACxB,QAAQ,EAAE,CAAC;SACX,CAAC;KACF;CACD,CAAC,CAAC;AAEH,kBAAkB;AACX,MAAM,UAAU,GAAG,CACzB,MAAc,EACd,GAAW,EACX,UAAkB,EAClB,QAAgB,EACT,EAAE;IACT,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,GAAG,MAAM,UAAU,KAAK,QAAQ,KAAK,CAAC,CAAC;AACjE,CAAC,CAAC;AAPW,QAAA,UAAU,cAOrB;AAEK,MAAM,QAAQ,GAAG,CAAC,KAAY,EAAE,OAAO,GAAG,EAAE,EAAQ,EAAE;IAC5D,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;IAC9E,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC;AAHW,QAAA,QAAQ,YAGnB;AAEF,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClientGenerator - Generates API client functions from parsed endpoints
|
|
3
|
+
* Uses BaseAPIClient for all HTTP requests
|
|
4
|
+
*/
|
|
5
|
+
import { ParsedEndpoint } from './types';
|
|
6
|
+
import { TypeGenerator } from './TypeGenerator';
|
|
7
|
+
export interface GeneratedFunction {
|
|
8
|
+
name: string;
|
|
9
|
+
code: string;
|
|
10
|
+
endpoint: ParsedEndpoint;
|
|
11
|
+
}
|
|
12
|
+
export declare class ClientGenerator {
|
|
13
|
+
private typeGenerator;
|
|
14
|
+
private baseClientPath;
|
|
15
|
+
constructor(typeGenerator: TypeGenerator, baseClientPath?: string);
|
|
16
|
+
/**
|
|
17
|
+
* Generate client function for an endpoint
|
|
18
|
+
*/
|
|
19
|
+
generateClientFunction(endpoint: ParsedEndpoint): GeneratedFunction;
|
|
20
|
+
/**
|
|
21
|
+
* Generate all client functions for a group of endpoints
|
|
22
|
+
*/
|
|
23
|
+
generateClientFunctions(endpoints: ParsedEndpoint[]): GeneratedFunction[];
|
|
24
|
+
/**
|
|
25
|
+
* Build the function code
|
|
26
|
+
*/
|
|
27
|
+
private buildFunctionCode;
|
|
28
|
+
/**
|
|
29
|
+
* Build function parameters
|
|
30
|
+
*/
|
|
31
|
+
private buildFunctionParams;
|
|
32
|
+
/**
|
|
33
|
+
* Build query params type
|
|
34
|
+
*/
|
|
35
|
+
private buildQueryParamsType;
|
|
36
|
+
/**
|
|
37
|
+
* Build function body
|
|
38
|
+
*/
|
|
39
|
+
private buildFunctionBody;
|
|
40
|
+
/**
|
|
41
|
+
* Build JSDoc comment
|
|
42
|
+
*/
|
|
43
|
+
private buildJsDoc;
|
|
44
|
+
/**
|
|
45
|
+
* Generate a complete client class for a group of endpoints
|
|
46
|
+
*/
|
|
47
|
+
generateClientClass(className: string, endpoints: ParsedEndpoint[], typeImports: string[]): string;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=ClientGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientGenerator.d.ts","sourceRoot":"","sources":["../../../src/utils/swagger/ClientGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAShD,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,CAAC;CACzB;AAED,qBAAa,eAAe;IAC3B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,cAAc,CAAS;gBAEnB,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC,EAAE,MAAM;IAKjE;;OAEG;IACH,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,iBAAiB;IAcnE;;OAEG;IACH,uBAAuB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,iBAAiB,EAAE;IAIzE;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAyBzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAqC3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAsCzB;;OAEG;IACH,OAAO,CAAC,UAAU;IAiClB;;OAEG;IACH,mBAAmB,CAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,cAAc,EAAE,EAC3B,WAAW,EAAE,MAAM,EAAE,GACnB,MAAM;CAwBT"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ClientGenerator - Generates API client functions from parsed endpoints
|
|
4
|
+
* Uses BaseAPIClient for all HTTP requests
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ClientGenerator = void 0;
|
|
8
|
+
const naming_1 = require("./utils/naming");
|
|
9
|
+
const pathUtils_1 = require("./utils/pathUtils");
|
|
10
|
+
class ClientGenerator {
|
|
11
|
+
typeGenerator;
|
|
12
|
+
baseClientPath;
|
|
13
|
+
constructor(typeGenerator, baseClientPath) {
|
|
14
|
+
this.typeGenerator = typeGenerator;
|
|
15
|
+
this.baseClientPath = baseClientPath || '../../clients/BaseAPIClient';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Generate client function for an endpoint
|
|
19
|
+
*/
|
|
20
|
+
generateClientFunction(endpoint) {
|
|
21
|
+
const resourceName = (0, naming_1.extractResourceName)(endpoint.path);
|
|
22
|
+
const pathParams = (0, naming_1.extractPathParams)(endpoint.path);
|
|
23
|
+
const functionName = (0, naming_1.generateFunctionName)(endpoint.method, resourceName, pathParams);
|
|
24
|
+
const code = this.buildFunctionCode(endpoint, functionName);
|
|
25
|
+
return {
|
|
26
|
+
name: functionName,
|
|
27
|
+
code,
|
|
28
|
+
endpoint,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate all client functions for a group of endpoints
|
|
33
|
+
*/
|
|
34
|
+
generateClientFunctions(endpoints) {
|
|
35
|
+
return endpoints.map((endpoint) => this.generateClientFunction(endpoint));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build the function code
|
|
39
|
+
*/
|
|
40
|
+
buildFunctionCode(endpoint, functionName) {
|
|
41
|
+
const pathParams = (0, naming_1.extractPathParams)(endpoint.path);
|
|
42
|
+
const pathTemplate = (0, pathUtils_1.generatePathTemplate)(endpoint.path);
|
|
43
|
+
const method = endpoint.method.toLowerCase();
|
|
44
|
+
// Build function parameters
|
|
45
|
+
const params = this.buildFunctionParams(endpoint, pathParams);
|
|
46
|
+
// Build function body
|
|
47
|
+
const body = this.buildFunctionBody(endpoint, method, pathTemplate);
|
|
48
|
+
// Get type annotations
|
|
49
|
+
const requestTypeName = this.typeGenerator.getRequestTypeName(endpoint);
|
|
50
|
+
const responseTypeName = this.typeGenerator.getResponseTypeName(endpoint) || 'unknown';
|
|
51
|
+
// Build JSDoc comment
|
|
52
|
+
const jsDoc = this.buildJsDoc(endpoint);
|
|
53
|
+
// Build the complete function
|
|
54
|
+
return `${jsDoc}
|
|
55
|
+
${functionName} = async (${params}): Promise<APIResponseResult<${responseTypeName}>> => {
|
|
56
|
+
${body}
|
|
57
|
+
}`;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Build function parameters
|
|
61
|
+
*/
|
|
62
|
+
buildFunctionParams(endpoint, pathParams) {
|
|
63
|
+
const params = [];
|
|
64
|
+
// Add path parameters
|
|
65
|
+
for (const param of pathParams) {
|
|
66
|
+
const paramDef = endpoint.pathParams.find((p) => p.name === param);
|
|
67
|
+
const type = paramDef?.type || 'string';
|
|
68
|
+
params.push(`${(0, naming_1.toCamelCase)(param)}: ${type}`);
|
|
69
|
+
}
|
|
70
|
+
// Determine if we need a data/payload parameter
|
|
71
|
+
const hasRequestBody = !!endpoint.requestBody;
|
|
72
|
+
const hasQueryParams = endpoint.queryParams.length > 0;
|
|
73
|
+
const method = endpoint.method.toLowerCase();
|
|
74
|
+
if (hasRequestBody && ['post', 'put', 'patch', 'delete'].includes(method)) {
|
|
75
|
+
const requestTypeName = this.typeGenerator.getRequestTypeName(endpoint);
|
|
76
|
+
if (requestTypeName) {
|
|
77
|
+
params.push(`data: ${requestTypeName}`);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
params.push('data: unknown');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Add query params as options if they exist
|
|
84
|
+
if (hasQueryParams) {
|
|
85
|
+
const queryType = this.buildQueryParamsType(endpoint);
|
|
86
|
+
const optional = endpoint.queryParams.every((p) => !p.required);
|
|
87
|
+
params.push(`params${optional ? '?' : ''}: ${queryType}`);
|
|
88
|
+
}
|
|
89
|
+
// Add optional request options
|
|
90
|
+
params.push('options?: RequestOptions');
|
|
91
|
+
return params.join(', ');
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Build query params type
|
|
95
|
+
*/
|
|
96
|
+
buildQueryParamsType(endpoint) {
|
|
97
|
+
const props = endpoint.queryParams.map((param) => {
|
|
98
|
+
const optional = param.required ? '' : '?';
|
|
99
|
+
return `${param.name}${optional}: ${param.type}`;
|
|
100
|
+
});
|
|
101
|
+
return `{ ${props.join('; ')} }`;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Build function body
|
|
105
|
+
*/
|
|
106
|
+
buildFunctionBody(endpoint, method, pathTemplate) {
|
|
107
|
+
const hasQueryParams = endpoint.queryParams.length > 0;
|
|
108
|
+
const hasRequestBody = !!endpoint.requestBody;
|
|
109
|
+
const lines = [];
|
|
110
|
+
// Build request options
|
|
111
|
+
if (hasQueryParams) {
|
|
112
|
+
lines.push('const reqOptions = { ...options, params };');
|
|
113
|
+
}
|
|
114
|
+
// Build the request call
|
|
115
|
+
const optionsArg = hasQueryParams ? 'reqOptions' : 'options';
|
|
116
|
+
if (['post', 'put', 'patch'].includes(method)) {
|
|
117
|
+
if (hasRequestBody) {
|
|
118
|
+
lines.push(`return this.client.${method}(${pathTemplate}, data, ${optionsArg});`);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
lines.push(`return this.client.${method}(${pathTemplate}, {}, ${optionsArg});`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else if (method === 'delete') {
|
|
125
|
+
if (hasRequestBody) {
|
|
126
|
+
lines.push(`return this.client.delete(${pathTemplate}, data, ${optionsArg});`);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
lines.push(`return this.client.delete(${pathTemplate}, undefined, ${optionsArg});`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
// GET
|
|
134
|
+
lines.push(`return this.client.${method}(${pathTemplate}, ${optionsArg});`);
|
|
135
|
+
}
|
|
136
|
+
return lines.join('\n ');
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Build JSDoc comment
|
|
140
|
+
*/
|
|
141
|
+
buildJsDoc(endpoint) {
|
|
142
|
+
const lines = ['/**'];
|
|
143
|
+
if (endpoint.summary) {
|
|
144
|
+
lines.push(` * ${endpoint.summary}`);
|
|
145
|
+
}
|
|
146
|
+
if (endpoint.description) {
|
|
147
|
+
lines.push(` * ${endpoint.description}`);
|
|
148
|
+
}
|
|
149
|
+
if (endpoint.deprecated) {
|
|
150
|
+
lines.push(' * @deprecated');
|
|
151
|
+
}
|
|
152
|
+
// Add param docs
|
|
153
|
+
for (const param of endpoint.pathParams) {
|
|
154
|
+
lines.push(` * @param ${param.name} - ${param.description || 'Path parameter'}`);
|
|
155
|
+
}
|
|
156
|
+
if (endpoint.requestBody) {
|
|
157
|
+
lines.push(' * @param data - Request body');
|
|
158
|
+
}
|
|
159
|
+
if (endpoint.queryParams.length > 0) {
|
|
160
|
+
lines.push(' * @param params - Query parameters');
|
|
161
|
+
}
|
|
162
|
+
lines.push(' */');
|
|
163
|
+
return lines.join('\n');
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Generate a complete client class for a group of endpoints
|
|
167
|
+
*/
|
|
168
|
+
generateClientClass(className, endpoints, typeImports) {
|
|
169
|
+
const functions = this.generateClientFunctions(endpoints);
|
|
170
|
+
const functionCode = functions.map((f) => ` ${f.code}`).join('\n\n');
|
|
171
|
+
return `import { BaseAPIClient, RequestOptions, APIResponseResult } from '${this.baseClientPath}';
|
|
172
|
+
${typeImports.length > 0 ? `import { ${typeImports.join(', ')} } from './types';` : ''}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* ${className} - Auto-generated API client
|
|
176
|
+
*/
|
|
177
|
+
export class ${className} {
|
|
178
|
+
private client: BaseAPIClient;
|
|
179
|
+
|
|
180
|
+
constructor(client: BaseAPIClient) {
|
|
181
|
+
this.client = client;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
${functionCode}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export default ${className};
|
|
188
|
+
`;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
exports.ClientGenerator = ClientGenerator;
|
|
192
|
+
//# sourceMappingURL=ClientGenerator.js.map
|
|
@@ -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