@spartaficial/openapi-to-k6 0.0.0-stage → 1.0.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.
- package/LICENSE +125 -0
- package/README.md +338 -2
- package/dist/cli.cjs +7 -0
- package/dist/cli.d.cts +6 -0
- package/dist/cli.d.mts +6 -0
- package/dist/cli.mjs +7 -0
- package/dist/config-loader-Bzjhl1Vk.mjs +6 -0
- package/dist/config-loader-CB7t7edy.cjs +6 -0
- package/dist/index.cjs +6 -0
- package/dist/index.d.cts +257 -0
- package/dist/index.d.mts +258 -0
- package/dist/index.mjs +6 -0
- package/dist/runtime.cjs +6 -0
- package/dist/runtime.d.cts +131 -0
- package/dist/runtime.d.mts +131 -0
- package/dist/runtime.mjs +6 -0
- package/package.json +100 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
Spartaficial Commercial License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Spartaficial - Cerios. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software is licensed, not sold. By installing, copying, or otherwise using
|
|
6
|
+
it, you agree to the terms below. If you do not agree, do not install or use it.
|
|
7
|
+
|
|
8
|
+
1. DEFINITIONS
|
|
9
|
+
|
|
10
|
+
"Software" means the @spartaficial npm packages covered by this file,
|
|
11
|
+
including their source, build output, and documentation.
|
|
12
|
+
|
|
13
|
+
"Licensor" means Cerios, trading as Spartaficial.
|
|
14
|
+
|
|
15
|
+
"You" means the individual or legal entity exercising rights under this
|
|
16
|
+
License.
|
|
17
|
+
|
|
18
|
+
"License Key" means the signed credential issued by Licensor that names You
|
|
19
|
+
and an expiry date, and that may additionally name a single project.
|
|
20
|
+
|
|
21
|
+
"Licensed Projects" means every software project owned or controlled by
|
|
22
|
+
You, or, where the License Key names a project, only the project whose
|
|
23
|
+
package.json `name` field matches that name.
|
|
24
|
+
|
|
25
|
+
2. GRANT
|
|
26
|
+
|
|
27
|
+
Subject to your compliance with this License and to a valid, unexpired
|
|
28
|
+
License Key, Licensor grants you a non-exclusive, non-transferable,
|
|
29
|
+
non-sublicensable, revocable license to:
|
|
30
|
+
|
|
31
|
+
(a) install and execute the Software to generate source code for the
|
|
32
|
+
Licensed Projects;
|
|
33
|
+
|
|
34
|
+
(b) use, modify, and distribute the code the Software generates, without
|
|
35
|
+
restriction and without royalty, as part of your own products; and
|
|
36
|
+
|
|
37
|
+
(c) make a reasonable number of copies of the Software for backup and
|
|
38
|
+
internal deployment in support of (a).
|
|
39
|
+
|
|
40
|
+
Code generated by the Software is yours. This License places no restriction
|
|
41
|
+
on it, and it carries no obligation to Licensor.
|
|
42
|
+
|
|
43
|
+
3. SCOPE
|
|
44
|
+
|
|
45
|
+
A License Key covers every @spartaficial product. Unless it names a project,
|
|
46
|
+
it covers every project owned or controlled by You. A License Key that names
|
|
47
|
+
a project covers that project only; any other project requires a separate
|
|
48
|
+
License Key or one that does not name a project.
|
|
49
|
+
|
|
50
|
+
4. RESTRICTIONS
|
|
51
|
+
|
|
52
|
+
You may not:
|
|
53
|
+
|
|
54
|
+
(a) use the Software without a valid, unexpired License Key, except as
|
|
55
|
+
permitted in Section 5;
|
|
56
|
+
|
|
57
|
+
(b) circumvent, disable, remove, or interfere with any license verification,
|
|
58
|
+
expiry check, or notice in the Software, or assist another party in
|
|
59
|
+
doing so;
|
|
60
|
+
|
|
61
|
+
(c) use a License Key outside its Licensed Projects, or share it with
|
|
62
|
+
anyone other than Your employees and contractors working on the
|
|
63
|
+
Licensed Projects, or sublicense, resell, rent, or otherwise transfer
|
|
64
|
+
a License Key;
|
|
65
|
+
|
|
66
|
+
(d) redistribute, publish, or make the Software itself available to any
|
|
67
|
+
third party, whether modified or unmodified, including by republishing
|
|
68
|
+
it to a package registry;
|
|
69
|
+
|
|
70
|
+
(e) reverse engineer, decompile, or disassemble the Software, except to the
|
|
71
|
+
extent that applicable law expressly permits despite this limitation; or
|
|
72
|
+
|
|
73
|
+
(f) remove or alter any copyright, trademark, or proprietary notice.
|
|
74
|
+
|
|
75
|
+
5. PERMITTED USE WITHOUT A KEY
|
|
76
|
+
|
|
77
|
+
You may install the Software and run its `--help`, `--version`, and `init`
|
|
78
|
+
commands without a License Key, in order to evaluate and configure it.
|
|
79
|
+
|
|
80
|
+
Code generated while a License Key was valid remains yours under Section
|
|
81
|
+
2(b). Expiry of a License Key does not affect it, and does not restrict your
|
|
82
|
+
ability to build, test, ship, or operate software containing it.
|
|
83
|
+
|
|
84
|
+
6. OWNERSHIP
|
|
85
|
+
|
|
86
|
+
The Software is protected by copyright and other intellectual property law.
|
|
87
|
+
Licensor retains all right, title, and interest in the Software. No rights
|
|
88
|
+
are granted except those expressly stated here.
|
|
89
|
+
|
|
90
|
+
7. TERM AND TERMINATION
|
|
91
|
+
|
|
92
|
+
This License runs for the validity period of your License Key. It terminates
|
|
93
|
+
automatically, without notice, if you breach any term.
|
|
94
|
+
|
|
95
|
+
On termination you must stop using the Software and destroy your copies.
|
|
96
|
+
Section 2(b) and Sections 6, 8, 9, and 10 survive termination.
|
|
97
|
+
|
|
98
|
+
8. NO WARRANTY
|
|
99
|
+
|
|
100
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
101
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
102
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
103
|
+
|
|
104
|
+
9. LIMITATION OF LIABILITY
|
|
105
|
+
|
|
106
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL LICENSOR BE LIABLE
|
|
107
|
+
FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
108
|
+
CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH
|
|
109
|
+
THE SOFTWARE OR ITS USE. LICENSOR'S TOTAL AGGREGATE LIABILITY SHALL NOT
|
|
110
|
+
EXCEED THE FEES YOU PAID FOR THE LICENSE KEY IN THE TWELVE MONTHS PRECEDING
|
|
111
|
+
THE CLAIM.
|
|
112
|
+
|
|
113
|
+
10. GOVERNING LAW
|
|
114
|
+
|
|
115
|
+
This License is governed by the laws of the Netherlands, excluding its
|
|
116
|
+
conflict of law rules. The courts of the Netherlands have exclusive
|
|
117
|
+
jurisdiction over any dispute arising from it.
|
|
118
|
+
|
|
119
|
+
11. THIRD PARTY COMPONENTS
|
|
120
|
+
|
|
121
|
+
The Software depends on third party open source components, each licensed
|
|
122
|
+
under its own terms. Those terms govern those components, not this License.
|
|
123
|
+
|
|
124
|
+
To obtain or renew a License Key, contact Cerios - Spartaficial at
|
|
125
|
+
spartaficial@cerios.com.
|
package/README.md
CHANGED
|
@@ -1,3 +1,339 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @spartaficial/openapi-to-k6
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Generate type-safe K6 HTTP clients from OpenAPI specifications with TypeScript types.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🚀 **Type-safe K6 clients** - Full TypeScript support with generated interfaces
|
|
8
|
+
- 🔄 **Request parameter merging** - Common parameters merged with request-specific parameters
|
|
9
|
+
- 📝 **JSDoc generation** - Automatic documentation from OpenAPI descriptions
|
|
10
|
+
- 🎯 **Operation filtering** - Filter by tags, methods, paths, operationIds
|
|
11
|
+
- 🔧 **Flexible configuration** - CLI options or config file
|
|
12
|
+
- 📦 **Uses openapi-to-typescript** - Leverages existing TypeScript type generation
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @spartaficial/openapi-to-k6
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
> Commercial software. Generation requires a license key — see [Licensing](#licensing).
|
|
21
|
+
> Running your generated k6 scripts does not.
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
### CLI Usage
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Initialize a config file
|
|
29
|
+
npx openapi-to-k6 init
|
|
30
|
+
|
|
31
|
+
# Generate with config file
|
|
32
|
+
npx openapi-to-k6
|
|
33
|
+
|
|
34
|
+
# Generate with CLI options
|
|
35
|
+
npx openapi-to-k6 --input openapi.yaml --output k6/api-client.ts
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Programmatic Usage
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { OpenApiK6Generator } from "@spartaficial/openapi-to-k6";
|
|
42
|
+
|
|
43
|
+
const generator = new OpenApiK6Generator({
|
|
44
|
+
input: "./openapi.yaml",
|
|
45
|
+
outputClient: "./k6/api-client.ts",
|
|
46
|
+
outputTypes: "./k6/api-types.ts",
|
|
47
|
+
useOperationId: true,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
generator.generate();
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
Create an `openapi-to-k6.config.ts` file:
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { defineConfig } from "@spartaficial/openapi-to-k6";
|
|
59
|
+
|
|
60
|
+
export default defineConfig({
|
|
61
|
+
defaults: {
|
|
62
|
+
includeDescriptions: true,
|
|
63
|
+
showStats: true,
|
|
64
|
+
preferredContentTypes: ["application/json"],
|
|
65
|
+
},
|
|
66
|
+
specs: [
|
|
67
|
+
{
|
|
68
|
+
input: "openapi.yaml",
|
|
69
|
+
outputClient: "k6/api-client.ts",
|
|
70
|
+
outputTypes: "k6/api-types.ts",
|
|
71
|
+
useOperationId: true,
|
|
72
|
+
basePath: "/api/v1",
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Generated Output
|
|
79
|
+
|
|
80
|
+
Generation produces three files, each with a distinct job:
|
|
81
|
+
|
|
82
|
+
| File | Role |
|
|
83
|
+
| ------------ | ------------------------------------------------------------------------------------------------ |
|
|
84
|
+
| `types.ts` | TypeScript types for schemas, path/query params, and headers |
|
|
85
|
+
| `client.ts` | Thin passthrough over `k6/http` - returns raw K6 `Response`, no parsing |
|
|
86
|
+
| `service.ts` | Wraps the client: checks status codes via `check()`, parses bodies, returns `K6ServiceResult<T>` |
|
|
87
|
+
|
|
88
|
+
### The `/runtime` subpath
|
|
89
|
+
|
|
90
|
+
Generated code imports a small set of shared helpers from a second entry point of
|
|
91
|
+
this same package:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import {
|
|
95
|
+
buildQueryString,
|
|
96
|
+
cleanBaseUrl,
|
|
97
|
+
mergeRequestParameters,
|
|
98
|
+
type QueryParams,
|
|
99
|
+
} from "@spartaficial/openapi-to-k6/runtime";
|
|
100
|
+
import { type K6ServiceResult, serializeBody, formatResponseBody } from "@spartaficial/openapi-to-k6/runtime";
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
There is nothing extra to install - `@spartaficial/openapi-to-k6` already provides
|
|
104
|
+
it. This module is deliberately free of Node.js built-ins and Node globals so it is
|
|
105
|
+
safe to load inside k6, which runs on sobek rather than Node. That property is
|
|
106
|
+
enforced by a test against the built output, not just by convention.
|
|
107
|
+
|
|
108
|
+
> **Generated scripts must be bundled before `k6 run`.** k6 does not resolve
|
|
109
|
+
> `package.json` `"exports"`, so the `@spartaficial/openapi-to-k6/runtime` specifier
|
|
110
|
+
> will not resolve if you hand the generated TypeScript straight to k6. Run it
|
|
111
|
+
> through a bundler (esbuild, webpack, or rollup) first - the same step you already
|
|
112
|
+
> need for TypeScript support.
|
|
113
|
+
|
|
114
|
+
### Generated client
|
|
115
|
+
|
|
116
|
+
The client is a pure passthrough layer: no response parsing, no generated types.
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import {
|
|
120
|
+
buildQueryString,
|
|
121
|
+
cleanBaseUrl,
|
|
122
|
+
mergeRequestParameters,
|
|
123
|
+
type QueryParams,
|
|
124
|
+
} from "@spartaficial/openapi-to-k6/runtime";
|
|
125
|
+
import http from "k6/http";
|
|
126
|
+
import type { Params, Response, RequestBody } from "k6/http";
|
|
127
|
+
|
|
128
|
+
export class Client {
|
|
129
|
+
private readonly baseUrl: string;
|
|
130
|
+
private readonly commonRequestParameters: Params;
|
|
131
|
+
|
|
132
|
+
constructor(baseUrl: string, commonRequestParameters: Params = {}) {
|
|
133
|
+
this.baseUrl = cleanBaseUrl(baseUrl);
|
|
134
|
+
this.commonRequestParameters = commonRequestParameters;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @summary List all users
|
|
139
|
+
* @method GET /users
|
|
140
|
+
*/
|
|
141
|
+
listUsers(options?: { params?: QueryParams; requestParameters?: Params }): Response {
|
|
142
|
+
const url = this.baseUrl + `/users` + buildQueryString(options?.params);
|
|
143
|
+
const mergedParams = mergeRequestParameters(options?.requestParameters || {}, this.commonRequestParameters);
|
|
144
|
+
|
|
145
|
+
return http.get(url, mergedParams);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Generated service
|
|
151
|
+
|
|
152
|
+
The service adds status-code checking and body parsing, returning `K6ServiceResult<T>`
|
|
153
|
+
(`{ response, data, ok }`).
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
import { type K6ServiceResult, serializeBody, formatResponseBody } from "@spartaficial/openapi-to-k6/runtime";
|
|
157
|
+
import { check } from "k6";
|
|
158
|
+
import type { Params } from "k6/http";
|
|
159
|
+
|
|
160
|
+
import { Client } from "./client";
|
|
161
|
+
import type { ListUsersHeaders, ListUsersParams, User } from "./types";
|
|
162
|
+
|
|
163
|
+
export class Service {
|
|
164
|
+
private readonly _client: Client;
|
|
165
|
+
|
|
166
|
+
constructor(client: Client) {
|
|
167
|
+
this._client = client;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
listUsers(headers?: ListUsersHeaders, params?: ListUsersParams, requestParameters?: Params): K6ServiceResult<User[]> {
|
|
171
|
+
const response = this._client.listUsers({ params, requestParameters });
|
|
172
|
+
|
|
173
|
+
const ok = check(response, {
|
|
174
|
+
"listUsers status is 200": r => {
|
|
175
|
+
if (r.status !== 200) {
|
|
176
|
+
console.log(`listUsers failed with status: ${r.status}, body: ${formatResponseBody(r.body)}`);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return r.status === 200;
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
return { response, data: response.json() as User[], ok };
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Using the Generated Client in K6
|
|
189
|
+
|
|
190
|
+
Use the service when you want typed, status-checked results; drop to the client when
|
|
191
|
+
you want the raw `Response`.
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
import { sleep } from "k6";
|
|
195
|
+
|
|
196
|
+
import { Client } from "./client";
|
|
197
|
+
import { Service } from "./service";
|
|
198
|
+
|
|
199
|
+
const client = new Client("https://api.example.com", {
|
|
200
|
+
headers: {
|
|
201
|
+
Authorization: "Bearer token123",
|
|
202
|
+
"Content-Type": "application/json",
|
|
203
|
+
},
|
|
204
|
+
tags: { name: "api-test" },
|
|
205
|
+
timeout: "30s",
|
|
206
|
+
});
|
|
207
|
+
const service = new Service(client);
|
|
208
|
+
|
|
209
|
+
export default function () {
|
|
210
|
+
// Service: status is checked for you, `data` is typed, `ok` reports the check
|
|
211
|
+
const { data: users, ok } = service.listUsers();
|
|
212
|
+
if (ok) {
|
|
213
|
+
console.log(`got ${users.length} users`);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Query params and per-request K6 options
|
|
217
|
+
service.listUsers(undefined, { page: 1, limit: 10 }, { timeout: "5s" });
|
|
218
|
+
|
|
219
|
+
// Client: raw Response, nothing parsed or checked
|
|
220
|
+
const raw = client.listUsers({ params: { page: 1 } });
|
|
221
|
+
console.log(raw.status);
|
|
222
|
+
|
|
223
|
+
sleep(1);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export const options = {
|
|
227
|
+
vus: 10,
|
|
228
|
+
duration: "30s",
|
|
229
|
+
};
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Options
|
|
233
|
+
|
|
234
|
+
### Generator Options
|
|
235
|
+
|
|
236
|
+
| Option | Type | Default | Description |
|
|
237
|
+
| ----------------------- | ------------------------ | ---------------------- | ------------------------------------------------------------------------------------------- |
|
|
238
|
+
| `input` | `string` | required | Path to OpenAPI specification file |
|
|
239
|
+
| `outputClient` | `string` | required | Output path for generated K6 client |
|
|
240
|
+
| `outputTypes` | `string` | - | Separate file for TypeScript types |
|
|
241
|
+
| `useOperationId` | `boolean` | `false` | Use operationId for client/service method names and operation-derived TypeScript type names |
|
|
242
|
+
| `basePath` | `string` | - | Base path to prepend to all endpoints |
|
|
243
|
+
| `stripPathPrefix` | `string` | - | Strip prefix from paths (glob support) |
|
|
244
|
+
| `ignoreHeaders` | `string[]` | - | Header patterns to ignore |
|
|
245
|
+
| `includeDescriptions` | `boolean` | `true` | Include JSDoc descriptions |
|
|
246
|
+
| `showStats` | `boolean` | `true` | Show generation statistics |
|
|
247
|
+
| `refMappings` | `Record<string, string>` | - | Redirect remote `$ref` URLs to local files by prefix |
|
|
248
|
+
| `preferredContentTypes` | `string[]` | `["application/json"]` | Preferred content types |
|
|
249
|
+
|
|
250
|
+
### Operation Filters
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
{
|
|
254
|
+
operationFilters: {
|
|
255
|
+
includeTags: ['users', 'auth'], // Only these tags
|
|
256
|
+
excludeTags: ['admin'], // Exclude these tags
|
|
257
|
+
includeMethods: ['get', 'post'], // Only these HTTP methods
|
|
258
|
+
excludeMethods: ['delete'], // Exclude these methods
|
|
259
|
+
includePaths: ['/api/**'], // Only matching paths (glob)
|
|
260
|
+
excludePaths: ['/internal/**'], // Exclude matching paths
|
|
261
|
+
includeOperationIds: ['getUser'], // Only these operationIds
|
|
262
|
+
excludeOperationIds: ['deleteAll'], // Exclude these operationIds
|
|
263
|
+
excludeDeprecated: true, // Exclude deprecated operations
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Related Packages
|
|
269
|
+
|
|
270
|
+
- [@spartaficial/openapi-core](../openapi-core) - Shared utilities
|
|
271
|
+
- [@spartaficial/openapi-to-typescript](../openapi-to-typescript) - TypeScript type generation
|
|
272
|
+
- [@spartaficial/openapi-to-zod](../openapi-to-zod) - Zod schema generation
|
|
273
|
+
- [@spartaficial/openapi-to-zod-playwright](../openapi-to-zod-playwright) - Playwright client generation
|
|
274
|
+
|
|
275
|
+
## Requirements
|
|
276
|
+
|
|
277
|
+
- Node.js 22 (22.18 or later) or Node.js 24 and later
|
|
278
|
+
- `@types/k6` >= 0.52.0
|
|
279
|
+
|
|
280
|
+
## Specs split across files
|
|
281
|
+
|
|
282
|
+
A `$ref` may point into another document, including an absolute URL from a shared schema
|
|
283
|
+
registry. Referenced documents are read when the spec is loaded and inlined into your spec, so
|
|
284
|
+
the generated output is self-contained. Remote URLs are never fetched - map them to local files
|
|
285
|
+
with the `refMappings` option.
|
|
286
|
+
|
|
287
|
+
See [Specs split across files](../../README.md#specs-split-across-files) for how paths resolve,
|
|
288
|
+
how `refMappings` matching works, and what happens on a name clash.
|
|
289
|
+
|
|
290
|
+
## Licensing
|
|
291
|
+
|
|
292
|
+
This package is commercial software. **Generation requires a license key.**
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
SPARTAFICIAL_LICENSE_KEY=<your key>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
One key covers every `@spartaficial` package in every project you own. It names your
|
|
299
|
+
organisation and an expiry date; set the same value wherever the generators run. A key can
|
|
300
|
+
optionally be restricted to a single project by its `package.json` name.
|
|
301
|
+
|
|
302
|
+
`--help`, `--version` and `init` run without a key.
|
|
303
|
+
|
|
304
|
+
**Your build and your test runs are never gated.** Compiling code that was already
|
|
305
|
+
generated, and importing `@spartaficial/openapi-to-k6/runtime` from a generated client,
|
|
306
|
+
work forever with no key set — that import happens inside _your_ build, frequently in CI
|
|
307
|
+
where no key is present. If a license lapses, re-running codegen fails while your k6
|
|
308
|
+
scripts keep compiling and running. Generated files contain no license logic.
|
|
309
|
+
|
|
310
|
+
### Which project the key is checked against
|
|
311
|
+
|
|
312
|
+
This only matters for a key restricted to one project. A customer-wide key never reads
|
|
313
|
+
`package.json`, and runs from any directory.
|
|
314
|
+
|
|
315
|
+
With a config file, the project is resolved from the directory holding that config, so
|
|
316
|
+
running the CLI from a monorepo root still binds to the right workspace.
|
|
317
|
+
|
|
318
|
+
Direct mode (`--input`/`--output`) has no config file, so the project is resolved from
|
|
319
|
+
the **current directory**. Run it from the directory whose `package.json` your license
|
|
320
|
+
names, or a valid key will report `PACKAGE_NAME_MISMATCH`.
|
|
321
|
+
|
|
322
|
+
See the [licensing documentation](https://spartaficial.dev/docs/openapi-codegen/licensing)
|
|
323
|
+
for the error-code table and CI setup.
|
|
324
|
+
|
|
325
|
+
To buy or renew a key, contact Cerios - Spartaficial at spartaficial@cerios.com.
|
|
326
|
+
|
|
327
|
+
## License
|
|
328
|
+
|
|
329
|
+
Spartaficial Commercial License — see [LICENSE](./LICENSE).
|
|
330
|
+
|
|
331
|
+
Code generated by this tool is yours, with no restriction and no royalty.
|
|
332
|
+
|
|
333
|
+
Copyright © 2026 Spartaficial - Cerios
|
|
334
|
+
|
|
335
|
+
## Contributing
|
|
336
|
+
|
|
337
|
+
This is proprietary software and we do not accept external pull requests.
|
|
338
|
+
Bug reports and feature requests are welcome on the
|
|
339
|
+
[GitHub issues](https://github.com/Spartaficial/openapi-codegen-support/issues) page.
|
package/dist/cli.cjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) 2026 Spartaficial - Cerios. All rights reserved.
|
|
4
|
+
* Proprietary software, licensed not sold. Unauthorized use, redistribution or
|
|
5
|
+
* circumvention of licensing is prohibited. See LICENSE for details.
|
|
6
|
+
*/
|
|
7
|
+
const _0x3ab398=_0x30f0,e=require('./config-loader-CB7t7edy.cjs');let t=require('@spartaficial/openapi-core'),n=require('commander');function _0x30f0(_0x48786b,_0x28f12b){_0x48786b=_0x48786b-0xed;const _0x30f071=_0x28f1();let _0x1b428a=_0x30f071[_0x48786b];if(_0x30f0['PzPvfy']===undefined){var _0x499bf2=function(_0x166228){const _0x57a487='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x144511='',_0x34577d='';for(let _0x3734ea=0x0,_0x7c0b73,_0x1b55c1,_0x2682cc=0x0;_0x1b55c1=_0x166228['charAt'](_0x2682cc++);~_0x1b55c1&&(_0x7c0b73=_0x3734ea%0x4?_0x7c0b73*0x40+_0x1b55c1:_0x1b55c1,_0x3734ea++%0x4)?_0x144511+=String['fromCharCode'](0xff&_0x7c0b73>>(-0x2*_0x3734ea&0x6)):0x0){_0x1b55c1=_0x57a487['indexOf'](_0x1b55c1);}for(let _0x42e59a=0x0,_0xd1fae2=_0x144511['length'];_0x42e59a<_0xd1fae2;_0x42e59a++){_0x34577d+='%'+('00'+_0x144511['charCodeAt'](_0x42e59a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x34577d);};_0x30f0['JNJkgx']=_0x499bf2,_0x30f0['JoRoZj']={},_0x30f0['PzPvfy']=!![];}const _0x476fde=_0x30f071[0x0];_0x30f0['WoWFeb']!==_0x476fde&&(_0x30f0['JoRoZj']={},_0x30f0['WoWFeb']=_0x476fde);const _0x3a5acb=_0x30f0['JoRoZj'][_0x48786b];return _0x3a5acb===undefined?(_0x1b428a=_0x30f0['JNJkgx'](_0x1b428a),_0x30f0['JoRoZj'][_0x48786b]=_0x1b428a):_0x1b428a=_0x3a5acb,_0x1b428a;}const r=[{'type':'text','name':_0x3ab398(0x10b),'message':_0x3ab398(0x117),'initial':_0x3ab398(0x101),'validate':_0x144511=>_0x144511[_0x3ab398(0x102)]>0x0||'Output\x20path\x20is\x20required'},{'type':_0x3ab398(0x116),'name':_0x3ab398(0xf6),'message':_0x3ab398(0x114),'initial':'k6/api-types.ts','validate':_0x34577d=>_0x34577d[_0x3ab398(0x102)]>0x0||_0x3ab398(0x10c)},{'type':'confirm','name':'useOperationId','message':'Use\x20operationId\x20for\x20method\x20names?','initial':!0x1},{'type':_0x3ab398(0x118),'name':'format','message':'Configuration\x20file\x20format:','choices':[{'title':'TypeScript\x20(.ts)','value':'ts'},{'title':'JSON\x20(.json)','value':'json'}],'initial':0x0}],i={'includeDescriptions':!0x0,'showStats':!0x0,'preferredContentTypes':[_0x3ab398(0xf5)]};function a(_0x3734ea,_0x7c0b73){const _0x4e74ad=_0x30f0;let _0x1b55c1=(0x0,t[_0x4e74ad(0x104)])(_0x7c0b73,_0x4e74ad(0x10b)),_0x2682cc=(0x0,t['getStringField'])(_0x7c0b73,'outputTypes'),_0x42e59a=(0x0,t['getStringField'])(_0x7c0b73,_0x4e74ad(0x115)),_0xd1fae2=(0x0,t['getBooleanField'])(_0x7c0b73,_0x4e74ad(0x103))===!0x0;if(!_0x1b55c1||!_0x2682cc||_0x42e59a!=='ts'&&_0x42e59a!==_0x4e74ad(0x10e))return;if(_0x42e59a==='ts')return{'format':_0x42e59a,'content':_0x4e74ad(0x109)['concat'](i[_0x4e74ad(0x100)],',\x0a\x20\x20\x20\x20showStats:\x20')[_0x4e74ad(0xfd)](i['showStats'],',\x0a\x20\x20\x20\x20preferredContentTypes:\x20')['concat'](JSON['stringify'](i[_0x4e74ad(0x10f)]),',\x0a\x20\x20},\x0a\x20\x20specs:\x20[\x0a\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20input:\x20\x22')['concat'](_0x3734ea,_0x4e74ad(0x11b))[_0x4e74ad(0xfd)](_0x1b55c1,'\x22,\x0a\x20\x20\x20\x20\x20\x20outputTypes:\x20\x22')['concat'](_0x2682cc,'\x22,')[_0x4e74ad(0xfd)](_0xd1fae2?'\x0a\x20\x20\x20\x20\x20\x20useOperationId:\x20true,':'','\x0a\x20\x20\x20\x20},\x0a\x20\x20],\x0a});\x0a')};let _0x32ffa3={'input':_0x3734ea,'outputClient':_0x1b55c1,'outputTypes':_0x2682cc};return _0xd1fae2&&(_0x32ffa3[_0x4e74ad(0x103)]=!0x0),{'format':_0x42e59a,'content':''[_0x4e74ad(0xfd)](JSON[_0x4e74ad(0x105)]({'defaults':i,'specs':[_0x32ffa3]},null,0x2),'\x0a')};}const o=new n['Command']();function _0x28f1(){const _0x5d7c18=['ywz0zxi','Aw5PDa','B3b0Aw9U','zgvZy3jPChrPB24','CMvHzfbHy2THz2vwzxjZAw9U','ywn0Aw9U','ls1UBY1KzxnJCMLWDgLVBNm','t3v0Chv0igzPBguGCgf0AcbMB3iGsZyGy2XPzw50','yxbWBgLJyxrPB24VANnVBG','B3v0Chv0vhLWzxm','BMfTzq','DMvYC2LVBG','qhnWyxj0ywzPy2LHBc9VCgvUyxbPlxrVlwS2','ls1IyxnLlxbHDgGGphbHDgG+','B3bLBMfWAs10BY1RnG','sw5PDgLHBgL6zsbHig5LDYbVCgvUyxbPlxrVlwS2ignVBMzPz3vYyxrPB24GzMLSzq','y29Uy2f0','ls1UBY1ZDgf0CW','lxmSic0TB3v0Chv0lxnLCNzPy2uGphbHDgG+','Aw5JBhvKzurLC2nYAxb0Aw9UCW','AZyVyxbPlwnSAwvUDc50CW','BgvUz3rO','DxnLt3bLCMf0Aw9Uswq','z2v0u3rYAw5NrMLLBgq','C3rYAw5NAwz5','vxnLig9WzxjHDgLVBKLKigzVCIbTzxrOB2qGBMfTzxm','rgLYzwn0ig1VzguGCMvXDwLYzxmGls1PBNb1DcWGls1VDxrWDxqSigfUzcaTlw91Dhb1Dc10ExbLCY4','Bg9N','Aw1WB3j0ihSGzgvMAw5Lq29UzMLNih0GzNjVBsaIqhnWyxj0ywzPy2LHBc9VCgvUyxbPlxrVlwS2iJSkcMv4Cg9YDcbKzwzHDwX0igrLzMLUzunVBMzPzYH7cIaGzgvMyxvSDhm6ihSkicaGigLUy2X1zgvezxnJCMLWDgLVBNm6ia','ls11C2uTB3bLCMf0Aw9UlwLK','B3v0Chv0q2XPzw50','vhLWzxmGB3v0Chv0ihbHDgGGAxmGCMvXDwLYzwq','B3v0Chv0','ANnVBG','ChjLzMvYCMvKq29UDgvUDfr5CgvZ','yMfZzvbHDgG','zgvZy3jPChrPB25Z','B3v0Chv0u2vYDMLJzq','CNvUq29UzMLNtw9Kzq','t3v0Chv0igzPBguGCgf0AcbMB3iGvhLWzvnJCMLWDcb0ExbLCZO','zM9YBwf0','Dgv4Da','t3v0Chv0igzPBguGCgf0AcbMB3iGsZyGy2XPzw50oG','C2vSzwn0','ugf0Acb0BYbJB25MAwCGzMLSzsaOB3bLBMfWAs10BY1RnI5JB25MAwCUE3rZlgPZB259kq','Aw5WDxq','iIWkicaGicaGB3v0Chv0q2XPzw50oIaI','z2vUzxjHDgu','q2XPt3b0Aw9UC0vYCM9Y','B3bLBMfWAs55yw1S','yxjNDG'];_0x28f1=function(){return _0x5d7c18;};return _0x28f1();}o[_0x3ab398(0xf7)]('openapi-to-k6')['description']('Generate\x20type-safe\x20K6\x20HTTP\x20clients\x20from\x20OpenAPI\x20specifications')[_0x3ab398(0xf8)]((0x0,t[_0x3ab398(0xf1)])(__dirname))['option']('-c,\x20--config\x20<path>',_0x3ab398(0x119))[_0x3ab398(0xef)]('-i,\x20--input\x20<path>','Input\x20OpenAPI\x20specification\x20file')[_0x3ab398(0xef)]('-o,\x20--output\x20<path>',_0x3ab398(0xf4))[_0x3ab398(0xef)]('-t,\x20--output-types\x20<path>','Output\x20file\x20path\x20for\x20TypeScript\x20types\x20(required\x20in\x20direct\x20mode)')[_0x3ab398(0xef)](_0x3ab398(0xff),'Output\x20file\x20path\x20for\x20the\x20K6\x20service\x20wrapper\x20(optional)')[_0x3ab398(0xef)](_0x3ab398(0x10a),_0x3ab398(0x106))[_0x3ab398(0xef)](_0x3ab398(0xfa),'Base\x20path\x20to\x20prepend\x20to\x20all\x20endpoints')['option'](_0x3ab398(0xf3),'Exclude\x20JSDoc\x20descriptions')[_0x3ab398(0xef)](_0x3ab398(0xfe),'Hide\x20generation\x20statistics')['addHelpText'](_0x3ab398(0xed),'\x0aExamples:\x0a\x20\x20#\x20Create\x20a\x20new\x20config\x20file\x0a\x20\x20$\x20openapi-to-k6\x20init\x0a\x0a\x20\x20#\x20Generate\x20with\x20auto-discovered\x20config\x0a\x20\x20$\x20openapi-to-k6\x0a\x0a\x20\x20#\x20Generate\x20without\x20a\x20config\x20file\x20(all\x20three\x20paths\x20are\x20required)\x0a\x20\x20$\x20openapi-to-k6\x20--input\x20openapi.yaml\x20--output\x20k6/client.ts\x20--output-types\x20k6/types.ts\x0a\x0a\x20\x20#\x20Also\x20generate\x20the\x20service\x20wrapper\x0a\x20\x20$\x20openapi-to-k6\x20--input\x20openapi.yaml\x20--output\x20k6/client.ts\x20--output-types\x20k6/types.ts\x20--output-service\x20k6/service.ts\x0a\x0a\x20\x20#\x20Generate\x20with\x20custom\x20config\x20path\x0a\x20\x20$\x20openapi-to-k6\x20--config\x20custom.config.ts\x0a')[_0x3ab398(0xf2)](async _0x32f49f=>{const _0x549f1a=_0x30f0;try{if(_0x32f49f['input']||_0x32f49f[_0x549f1a(0x10d)]||_0x32f49f[_0x549f1a(0xf6)]){if(!_0x32f49f['input']||!_0x32f49f[_0x549f1a(0x10d)]||!_0x32f49f[_0x549f1a(0xf6)])throw new t[(_0x549f1a(0x11d))](_0x549f1a(0x107));s({'input':_0x32f49f['input'],'outputClient':_0x32f49f['output'],'outputTypes':_0x32f49f['outputTypes'],'useOperationId':_0x32f49f['useOperationId'],'basePath':_0x32f49f[_0x549f1a(0x110)],'descriptions':_0x32f49f[_0x549f1a(0x111)],'stats':_0x32f49f['stats'],'outputService':_0x32f49f['outputService']});}else await(0x0,t[_0x549f1a(0x113)])({'configPath':_0x32f49f['config'],'loadConfig':e['n'],'getResolvedConfigPath':e['t'],'productName':_0x549f1a(0xf9),'mergeConfigWithDefaults':e['r'],'createGenerator':_0x34874e=>new e['i'](_0x34874e),'banner':{'start':'\x0a'['concat']((0x0,t['getRandomCeriosMessage'])(),'\x0a'),'done':'\x0a✅\x20Generation\x20complete!\x0a'}});}catch(_0x439bab){(0x0,t['handleCliError'])(_0x439bab,{'showStackTrace':!!process.env.DEBUG});}}),o['command'](_0x3ab398(0xee))[_0x3ab398(0xf0)](_0x3ab398(0xfc))['action'](async()=>{try{await c();}catch(_0x555a40){(0x0,t['handleCliError'])(_0x555a40);}}),o['parseAsync'](process[_0x3ab398(0x11f)]);function s(_0x1bbfa5){const _0x3622ac=_0x30f0;console['log']((0x0,t['prepareGeneration'])(_0x3622ac(0xf9)));let _0x5bc5cc=new e['i']({'input':_0x1bbfa5[_0x3622ac(0x11a)],'outputClient':_0x1bbfa5[_0x3622ac(0x10b)],'outputTypes':_0x1bbfa5[_0x3622ac(0xf6)],'useOperationId':_0x1bbfa5[_0x3622ac(0x103)],'basePath':_0x1bbfa5['basePath'],'includeDescriptions':_0x1bbfa5['descriptions']!==!0x1,'showStats':_0x1bbfa5['stats']!==!0x1,'outputService':_0x1bbfa5[_0x3622ac(0x112)]});console['log']('\x0a'[_0x3622ac(0xfd)]((0x0,t['getRandomCeriosMessage'])(),'\x0a')),_0x5bc5cc[_0x3622ac(0x11c)](),console[_0x3622ac(0x108)]('\x0a✅\x20Generation\x20complete!\x0a');}async function c(){const _0x442ed2=_0x30f0;await(0x0,t['runInitCommand'])({'packageName':_0x442ed2(0xfb),'manualEntryInitial':_0x442ed2(0x11e),'createdMark':'✅','questions':r,'buildConfig':a,'nextSteps':['\x20\x201.\x20Review\x20and\x20customize\x20the\x20config\x20file','\x20\x202.\x20Run\x20\x27npx\x20openapi-to-k6\x27\x20to\x20generate\x20the\x20K6\x20client']});}
|
package/dist/cli.d.cts
ADDED
package/dist/cli.d.mts
ADDED
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) 2026 Spartaficial - Cerios. All rights reserved.
|
|
4
|
+
* Proprietary software, licensed not sold. Unauthorized use, redistribution or
|
|
5
|
+
* circumvention of licensing is prohibited. See LICENSE for details.
|
|
6
|
+
*/
|
|
7
|
+
function _0x1348(){const _0x15f624=['qMfZzsbWyxrOihrVihbYzxbLBMqGDg8GywXSigvUzhbVAw50CW','B3v0Chv0q2XPzw50','t3v0Chv0igzPBguGCgf0AcbMB3iGsZyGy2XPzw50','y29UzMLYBq','B3v0Chv0u2vYDMLJzq','B3b0Aw9U','t3v0Chv0igzPBguGCgf0AcbMB3iGvhLWzvnJCMLWDcb0ExbLCZO','Aw5PDa','ChjLzMvYCMvKq29UDgvUDfr5CgvZ','lwKSic0TAw5WDxqGphbHDgG+','C2vSzwn0','BMfTzq','ls11C2uTB3bLCMf0Aw9UlwLK','B3bLBMfWAs55yw1S','vhLWzvnJCMLWDcaOlNrZkq','BgvUz3rO','ugf0Acb0BYbJB25MAwCGzMLSzsaOB3bLBMfWAs10BY1RnI5JB25MAwCUE3rZlgPZB259kq','t3v0Chv0igzPBguGCgf0AcbMB3iGsZyGy2XPzw50oG','Aw5WDxq','t3v0Chv0ihbHDgGGAxmGCMvXDwLYzwq','Dgv4Da','C2HVD1n0yxrZ','lwmSic0Ty29UzMLNidXWyxrOpG','rgLYzwn0ig1VzguGCMvXDwLYzxmGls1PBNb1DcWGls1VDxrWDxqSigfUzcaTlw91Dhb1Dc10ExbLCY4','sgLKzsbNzw5LCMf0Aw9Uihn0yxrPC3rPy3m','lxmSic0TB3v0Chv0lxnLCNzPy2uGphbHDgG+','B3bLBMfWAs10BY1RnG','B3v0Chv0','C3rYAw5NAwz5','q29UzMLNDxjHDgLVBIbMAwXLigzVCM1HDdO','sw5PDgLHBgL6zsbHig5LDYbVCgvUyxbPlxrVlwS2ignVBMzPz3vYyxrPB24GzMLSzq','y29UzMLN','DMvYC2LVBG','C3rHDhm','laOGicaGC2HVD1n0yxrZoIa','cIaGicaGihvZzu9WzxjHDgLVBKLKoIb0CNvLla','t3v0Chv0igzPBguGCgf0AcbMB3iGDgHLieS2ihnLCNzPy2uGD3jHChbLCIaOB3b0Aw9UywWP','z2vUzxjHDgu','B3v0Chv0vhLWzxm','t3v0Chv0igzPBguGCgf0AcbMB3iGvhLWzvnJCMLWDcb0ExbLCYaOCMvXDwLYzwqGAw4GzgLYzwn0ig1VzguP','laOGicaGChjLzMvYCMvKq29UDgvUDfr5CgvZoIa','Bg9N','ls1UBY1ZDgf0CW','qhnWyxj0ywzPy2LHBc9VCgvUyxbPlxrVlwS2','Aw1WB3j0ihSGzgvMAw5Lq29UzMLNih0GzNjVBsaIqhnWyxj0ywzPy2LHBc9VCgvUyxbPlxrVlwS2iJSkcMv4Cg9YDcbKzwzHDwX0igrLzMLUzunVBMzPzYH7cIaGzgvMyxvSDhm6ihSkicaGigLUy2X1zgvezxnJCMLWDgLVBNm6ia','Aw5JBhvKzurLC2nYAxb0Aw9UCW','DxnLt3bLCMf0Aw9Uswq','yxjNDG','y29Uy2f0','laOGih0ScIaGC3bLy3m6ifSkicaGihSkicaGicaGAw5WDxq6ici','ywrKsgvSCfrLEhq','zM9YBwf0','cUkCHsbhzw5LCMf0Aw9UignVBxbSzxrLiqO','zgvZy3jPChrPB25Z'];_0x1348=function(){return _0x15f624;};return _0x1348();}import{a as _0x19d044,i as _0x23dffd,l as _0x4429bb,n as _0x560fe1,o as _0x285c6b,r as _0x23b07a,t as _0x328cdf,u as _0x51e5d6}from'./config-loader-Bzjhl1Vk.mjs';function _0x456a(_0x1e850f,_0x134874){_0x1e850f=_0x1e850f-0x1c1;const _0x456a30=_0x1348();let _0x724b8b=_0x456a30[_0x1e850f];if(_0x456a['MKaaXZ']===undefined){var _0xc09e5b=function(_0x1b48a7){const _0x172f32='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x19d044='',_0x23dffd='';for(let _0x4429bb=0x0,_0x560fe1,_0x285c6b,_0x23b07a=0x0;_0x285c6b=_0x1b48a7['charAt'](_0x23b07a++);~_0x285c6b&&(_0x560fe1=_0x4429bb%0x4?_0x560fe1*0x40+_0x285c6b:_0x285c6b,_0x4429bb++%0x4)?_0x19d044+=String['fromCharCode'](0xff&_0x560fe1>>(-0x2*_0x4429bb&0x6)):0x0){_0x285c6b=_0x172f32['indexOf'](_0x285c6b);}for(let _0x328cdf=0x0,_0x51e5d6=_0x19d044['length'];_0x328cdf<_0x51e5d6;_0x328cdf++){_0x23dffd+='%'+('00'+_0x19d044['charCodeAt'](_0x328cdf)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x23dffd);};_0x456a['HAaGVM']=_0xc09e5b,_0x456a['ypyJiK']={},_0x456a['MKaaXZ']=!![];}const _0xe1093a=_0x456a30[0x0];_0x456a['WuqbXu']!==_0xe1093a&&(_0x456a['ypyJiK']={},_0x456a['WuqbXu']=_0xe1093a);const _0x4f5753=_0x456a['ypyJiK'][_0x1e850f];return _0x4f5753===undefined?(_0x724b8b=_0x456a['HAaGVM'](_0x724b8b),_0x456a['ypyJiK'][_0x1e850f]=_0x724b8b):_0x724b8b=_0x4f5753,_0x724b8b;}import{CliOptionsError as _0x26ad3a,getBooleanField as _0xe6623c,getRandomCeriosMessage as _0x5652d8,getStringField as _0x4015ec,handleCliError as _0x2aecd0,prepareGeneration as _0x4b4152,readPackageVersion as _0x536d58,runConfigMode as _0x4b8f91,runInitCommand as _0x410fd0}from'@spartaficial/openapi-core';import _0x135f9d from'node:path';import{fileURLToPath as _0x1e0c05}from'node:url';import{Command as _0x246b04}from'commander';var b,x,S,C=_0x51e5d6(()=>{b=()=>_0x1e0c05(import.meta.url),x=()=>_0x135f9d['dirname'](b()),S=x();});function w(_0x28817f,_0x4e125b){const _0x37ad44=_0x456a;let _0x47bda6=_0x4015ec(_0x4e125b,'outputClient'),_0x5661ce=_0x4015ec(_0x4e125b,'outputTypes'),_0x1ba129=_0x4015ec(_0x4e125b,_0x37ad44(0x1f4)),_0x2b2c0b=_0xe6623c(_0x4e125b,'useOperationId')===!0x0;if(!_0x47bda6||!_0x5661ce||_0x1ba129!=='ts'&&_0x1ba129!=='json')return;if(_0x1ba129==='ts')return{'format':_0x1ba129,'content':_0x37ad44(0x1ed)['concat'](E[_0x37ad44(0x1ee)],_0x37ad44(0x1e3))[_0x37ad44(0x1f1)](E[_0x37ad44(0x1d6)],_0x37ad44(0x1e9))['concat'](JSON[_0x37ad44(0x1dd)](E[_0x37ad44(0x1c9)]),_0x37ad44(0x1f2))['concat'](_0x28817f,'\x22,\x0a\x20\x20\x20\x20\x20\x20outputClient:\x20\x22')['concat'](_0x47bda6,'\x22,\x0a\x20\x20\x20\x20\x20\x20outputTypes:\x20\x22')[_0x37ad44(0x1f1)](_0x5661ce,'\x22,')['concat'](_0x2b2c0b?_0x37ad44(0x1e4):'','\x0a\x20\x20\x20\x20},\x0a\x20\x20],\x0a});\x0a')};let _0x3ca41f={'input':_0x28817f,'outputClient':_0x47bda6,'outputTypes':_0x5661ce};return _0x2b2c0b&&(_0x3ca41f[_0x37ad44(0x1ef)]=!0x0),{'format':_0x1ba129,'content':''[_0x37ad44(0x1f1)](JSON[_0x37ad44(0x1dd)]({'defaults':E,'specs':[_0x3ca41f]},null,0x2),'\x0a')};}var T,E,D=_0x51e5d6(()=>{const _0x28981e=_0x456a;T=[{'type':_0x28981e(0x1d5),'name':'outputClient','message':_0x28981e(0x1d2),'initial':'k6/api-client.ts','validate':_0x98ae15=>_0x98ae15[_0x28981e(0x1d0)]>0x0||_0x28981e(0x1d4)},{'type':_0x28981e(0x1d5),'name':'outputTypes','message':_0x28981e(0x1c7),'initial':'k6/api-types.ts','validate':_0x48101f=>_0x48101f['length']>0x0||'Types\x20output\x20path\x20is\x20required'},{'type':_0x28981e(0x1c4),'name':'useOperationId','message':'Use\x20operationId\x20for\x20method\x20names?','initial':!0x1},{'type':_0x28981e(0x1cb),'name':_0x28981e(0x1f4),'message':_0x28981e(0x1de),'choices':[{'title':_0x28981e(0x1cf),'value':'ts'},{'title':'JSON\x20(.json)','value':'json'}],'initial':0x0}],E={'includeDescriptions':!0x0,'showStats':!0x0,'preferredContentTypes':['application/json']};}),O=_0x4429bb(()=>{const _0x40013b=_0x456a;C(),D(),_0x285c6b(),_0x560fe1();let _0x55d87d=new _0x246b04();_0x55d87d[_0x40013b(0x1cc)](_0x40013b(0x1db))['description']('Generate\x20type-safe\x20K6\x20HTTP\x20clients\x20from\x20OpenAPI\x20specifications')[_0x40013b(0x1e1)](_0x536d58(S))['option'](_0x40013b(0x1d7),_0x40013b(0x1d1))['option'](_0x40013b(0x1ca),'Input\x20OpenAPI\x20specification\x20file')['option']('-o,\x20--output\x20<path>',_0x40013b(0x1c3))[_0x40013b(0x1c6)]('-t,\x20--output-types\x20<path>',_0x40013b(0x1e8))['option'](_0x40013b(0x1da),_0x40013b(0x1e5))['option'](_0x40013b(0x1cd),'Use\x20operationId\x20for\x20method\x20names')['option']('--base-path\x20<path>',_0x40013b(0x1c1))[_0x40013b(0x1c6)]('--no-descriptions','Exclude\x20JSDoc\x20descriptions')['option'](_0x40013b(0x1eb),_0x40013b(0x1d9))[_0x40013b(0x1f3)]('after','\x0aExamples:\x0a\x20\x20#\x20Create\x20a\x20new\x20config\x20file\x0a\x20\x20$\x20openapi-to-k6\x20init\x0a\x0a\x20\x20#\x20Generate\x20with\x20auto-discovered\x20config\x0a\x20\x20$\x20openapi-to-k6\x0a\x0a\x20\x20#\x20Generate\x20without\x20a\x20config\x20file\x20(all\x20three\x20paths\x20are\x20required)\x0a\x20\x20$\x20openapi-to-k6\x20--input\x20openapi.yaml\x20--output\x20k6/client.ts\x20--output-types\x20k6/types.ts\x0a\x0a\x20\x20#\x20Also\x20generate\x20the\x20service\x20wrapper\x0a\x20\x20$\x20openapi-to-k6\x20--input\x20openapi.yaml\x20--output\x20k6/client.ts\x20--output-types\x20k6/types.ts\x20--output-service\x20k6/service.ts\x0a\x0a\x20\x20#\x20Generate\x20with\x20custom\x20config\x20path\x0a\x20\x20$\x20openapi-to-k6\x20--config\x20custom.config.ts\x0a')['action'](async _0x249584=>{const _0x12b8ce=_0x456a;try{if(_0x249584['input']||_0x249584[_0x12b8ce(0x1dc)]||_0x249584[_0x12b8ce(0x1e7)]){if(!_0x249584['input']||!_0x249584[_0x12b8ce(0x1dc)]||!_0x249584['outputTypes'])throw new _0x26ad3a(_0x12b8ce(0x1d8));_0x162ebb({'input':_0x249584['input'],'outputClient':_0x249584[_0x12b8ce(0x1dc)],'outputTypes':_0x249584[_0x12b8ce(0x1e7)],'useOperationId':_0x249584['useOperationId'],'basePath':_0x249584['basePath'],'descriptions':_0x249584['descriptions'],'stats':_0x249584[_0x12b8ce(0x1e2)],'outputService':_0x249584['outputService']});}else await _0x4b8f91({'configPath':_0x249584[_0x12b8ce(0x1e0)],'loadConfig':_0x23b07a,'getResolvedConfigPath':_0x328cdf,'productName':'@spartaficial/openapi-to-k6','mergeConfigWithDefaults':_0x23dffd,'createGenerator':_0x20504d=>new _0x19d044(_0x20504d),'banner':{'start':'\x0a'['concat'](_0x5652d8(),'\x0a'),'done':_0x12b8ce(0x1f5)}});}catch(_0x183440){_0x2aecd0(_0x183440,{'showStackTrace':!!process.env.DEBUG});}}),_0x55d87d['command'](_0x40013b(0x1c8))['description'](_0x40013b(0x1df))['action'](async()=>{try{await _0x232eda();}catch(_0x529961){_0x2aecd0(_0x529961);}}),_0x55d87d['parseAsync'](process[_0x40013b(0x1f0)]);function _0x162ebb(_0x50848d){const _0x315045=_0x456a;console[_0x315045(0x1ea)](_0x4b4152(_0x315045(0x1ec)));let _0x4184de=new _0x19d044({'input':_0x50848d[_0x315045(0x1d3)],'outputClient':_0x50848d[_0x315045(0x1c2)],'outputTypes':_0x50848d['outputTypes'],'useOperationId':_0x50848d['useOperationId'],'basePath':_0x50848d['basePath'],'includeDescriptions':_0x50848d[_0x315045(0x1f6)]!==!0x1,'showStats':_0x50848d[_0x315045(0x1e2)]!==!0x1,'outputService':_0x50848d[_0x315045(0x1c5)]});console['log']('\x0a'[_0x315045(0x1f1)](_0x5652d8(),'\x0a')),_0x4184de[_0x315045(0x1e6)](),console[_0x315045(0x1ea)](_0x315045(0x1f5));}async function _0x232eda(){const _0x32f049=_0x456a;await _0x410fd0({'packageName':_0x32f049(0x1db),'manualEntryInitial':_0x32f049(0x1ce),'createdMark':'✅','questions':T,'buildConfig':w,'nextSteps':['\x20\x201.\x20Review\x20and\x20customize\x20the\x20config\x20file','\x20\x202.\x20Run\x20\x27npx\x20openapi-to-k6\x27\x20to\x20generate\x20the\x20K6\x20client']});}});export default O();export{};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Spartaficial - Cerios. All rights reserved.
|
|
3
|
+
* Proprietary software, licensed not sold. Unauthorized use, redistribution or
|
|
4
|
+
* circumvention of licensing is prohibited. See LICENSE for details.
|
|
5
|
+
*/
|
|
6
|
+
const _0x4e3abd=_0x5d81;import{ExecutionModeSchema as _0x11dddf,FileOperationError as _0x1cdbc1,GeneratorError as _0x5b157f,LRUCache as _0x4d94f5,OperationFiltersSchema as _0x554bb5,WarningCollector as _0x18a6d6,applyFormatting as _0x2e3f5a,constructFullPath as _0x2b66c9,createConfigLoader as _0x204b28,createFilterStatistics as _0x3ed109,createNameRegistry as _0x17583a,deriveClassName as _0x35c639,ensureDirectoryExists as _0x4059ac,escapeJSDoc as _0x289ef8,extractEndpoints as _0x90582a,formatNameCollision as _0x53c3a5,formatPropertyName as _0x53f99b,generateCustomFileHeader as _0x2f7a4b,generateFileHeader as _0x356514,generateOperationJSDoc as _0x692df1,getEndpointStats as _0x5b5014,getResponseParseMethod as _0x4ea7f3,isNonDefaultPathSerialization as _0x592dc9,isNonDefaultSerialization as _0x46b889,loadOpenAPISpecCached as _0xccca2,mergeAllSpecsWithDefaults as _0x520ceb,normalizeBasePath as _0x32a519,omitUndefined as _0x3be095,resolveParameterSerialization as _0xa8593,resolvePathParameterSerialization as _0x582ae6,sanitizeParamName as _0x8aeb82,stripPrefix as _0x2efe75,toPascalCase as _0x41d50c,toRelativeImportPath as _0x47e28d,validateFilters as _0x1627a2,validateIgnorePatterns as _0x4626b1}from'@spartaficial/openapi-core';import{TypeScriptDefaultsSchema as _0x295648,TypeScriptGenerator as _0x25d0a5,TypeScriptGeneratorOptionsSchema as _0x8d4f58}from'@spartaficial/openapi-to-typescript';import{existsSync as _0x231e51,writeFileSync as _0x450b0d}from'node:fs';import{normalize as _0x1ad500}from'node:path';import{z as _0x5f5d85}from'zod';var I=(_0x2451bc,_0x5a675e,_0x3d69fc)=>()=>{if(_0x3d69fc)throw _0x3d69fc[0x0];try{return _0x2451bc&&(_0x5a675e=_0x2451bc(_0x2451bc=0x0)),_0x5a675e;}catch(_0x176f94){throw _0x3d69fc=[_0x176f94],_0x176f94;}},se=(_0x4764e7,_0x5bf551)=>()=>(_0x5bf551||(_0x4764e7((_0x5bf551={'exports':{}})[_0x4e3abd(0x1a9)],_0x5bf551,_0x5bf551['exports']),_0x4764e7=null),_0x5bf551[_0x4e3abd(0x1a9)]),L,R=I(()=>{L=class extends _0x5b157f{constructor(_0x63843d,_0x406a6e){super(_0x63843d,'K6_CLIENT_GENERATION_ERROR',{'cause':_0x406a6e?.['message']}),this['name']='K6ClientGenerationError';}};});function ce(_0x40b437,_0x5addbd){const _0x1702c8=_0x5d81;return _0x5addbd[_0x1702c8(0x1de)]===0x0?'':'export\x20type\x20'[_0x1702c8(0x1c7)](''[_0x1702c8(0x1c7)](_0x41d50c(_0x40b437),_0x1702c8(0x1be)),'\x20=\x20{\x0a')[_0x1702c8(0x1c7)](_0x5addbd[_0x1702c8(0x1af)](_0x57ae40=>''[_0x1702c8(0x1c7)](_0x57ae40[_0x1702c8(0x1b0)]?'\x20\x20/**\x20'[_0x1702c8(0x1c7)](_0x289ef8(_0x57ae40['description']),'\x20*/\x0a'):'','\x20\x20')[_0x1702c8(0x1c7)](_0x53f99b(_0x57ae40['name']))['concat'](_0x57ae40[_0x1702c8(0x1e0)]?'':'?',':\x20')[_0x1702c8(0x1c7)](_0x57ae40[_0x1702c8(0x19d)],';'))[_0x1702c8(0x1b9)]('\x0a'),_0x1702c8(0x1e2));}function z(_0xc35cee,_0x68f9a7,_0x20f013){const _0x282d8d=_0x5d81;return _0x68f9a7['length']===0x0?'':_0x282d8d(0x1cf)['concat'](''['concat'](_0x41d50c(_0xc35cee))[_0x282d8d(0x1c7)](_0x20f013),'\x20=\x20{\x0a')[_0x282d8d(0x1c7)](_0x68f9a7['map'](_0x23fe6c=>''[_0x282d8d(0x1c7)](_0x23fe6c['description']?_0x282d8d(0x200)[_0x282d8d(0x1c7)](_0x289ef8(_0x23fe6c['description']),'\x20*/\x0a'):'','\x20\x20')[_0x282d8d(0x1c7)](_0x53f99b(_0x23fe6c['name']))[_0x282d8d(0x1c7)](_0x23fe6c['required']?'':'?',':\x20')[_0x282d8d(0x1c7)](_0x23fe6c[_0x282d8d(0x19d)],';'))['join']('\x0a'),'\x0a};');}function le(_0x505cf9,_0x16f2ba){const _0x544004=_0x5d81;return z(_0x505cf9,_0x16f2ba,_0x544004(0x207));}function B(_0x535f04,_0x2fd595){return z(_0x535f04,_0x2fd595,'Cookies');}function V(_0x392229,_0x3b5390,_0xcda6b9){const _0x37958d=_0x5d81;let {path:_0x41803e,method:_0x637fc4,methodName:_0x5a1fc0,pathParams:_0x3bfe6d,queryParams:_0x3db884,requestBody:_0x41cfca}=_0x392229,_0x54168d=_0x3db884[_0x37958d(0x1de)]>0x0,_0x3a1e11=!!_0x41cfca,_0x293738=[];for(let _0x3378da of _0x3bfe6d){let _0x3d19cc=_0x8aeb82(_0x3378da);_0x293738[_0x37958d(0x1fd)](''['concat'](_0x3d19cc,_0x37958d(0x1ba)));}let _0x5d0dac=[];_0x54168d&&_0x5d0dac['push']('params?:\x20QueryParams'),_0x5d0dac['push']('requestParameters?:\x20Params'),_0x3a1e11&&_0x5d0dac[_0x37958d(0x1fd)](_0x37958d(0x212)),_0x5d0dac[_0x37958d(0x1de)]>0x0&&_0x293738[_0x37958d(0x1fd)]('options?:\x20{\x0a\x20\x20\x20\x20'[_0x37958d(0x1c7)](_0x5d0dac['join'](_0x37958d(0x20d)),_0x37958d(0x1ff)));let _0x181e5c=_0x2b66c9(_0x3b5390,_0x41803e),_0x55e559=_0x181e5c,_0x13573a=new Map(_0x392229[_0x37958d(0x1c6)][_0x37958d(0x1af)](_0x3fae4c=>[_0x3fae4c['name'],_0x3fae4c]));for(let _0x167714 of _0x3bfe6d){let _0x4d772e=_0x8aeb82(_0x167714),_0x3d6320=_0x13573a['get'](_0x167714),_0x3c876c=_0x582ae6(_0x3d6320?.['style'],_0x3d6320?.[_0x37958d(0x210)]),_0x328299=_0x592dc9(_0x3c876c)?_0x37958d(0x1e9)[_0x37958d(0x1c7)](JSON[_0x37958d(0x1ca)](_0x167714),',\x20')['concat'](_0x4d772e,',\x20{\x20style:\x20')[_0x37958d(0x1c7)](JSON[_0x37958d(0x1ca)](_0x3c876c['style']),_0x37958d(0x1a0))[_0x37958d(0x1c7)](_0x3c876c['explode'],_0x37958d(0x213)):'${encodeURIComponent(String('['concat'](_0x4d772e,'))}');_0x55e559=_0x55e559['replace']('{'['concat'](_0x167714,'}'),_0x328299);}let _0x8b9905=_0x692df1({'summary':_0x392229[_0x37958d(0x1e7)],'description':_0x392229[_0x37958d(0x1b0)],'deprecated':_0x392229[_0x37958d(0x1ea)],'method':_0x392229['method'],'path':_0x181e5c,'includeDescriptions':_0xcda6b9}),_0x46f6cf=_0x637fc4[_0x37958d(0x1b6)](),_0x146892=_0x3db884[_0x37958d(0x1af)](_0x447a6c=>[_0x447a6c['name'],_0xa8593(_0x447a6c[_0x37958d(0x1db)],_0x447a6c[_0x37958d(0x210)],_0x447a6c[_0x37958d(0x19e)])])['filter'](([,_0x4f04a1])=>_0x46b889(_0x4f04a1)),_0x158a81=_0x146892[_0x37958d(0x1de)]>0x0?_0x37958d(0x19c)['concat'](_0x146892['map'](([_0x5135b4,_0x175872])=>''[_0x37958d(0x1c7)](JSON[_0x37958d(0x1ca)](_0x5135b4),_0x37958d(0x1d0))['concat'](JSON['stringify'](_0x175872['style']),',\x20explode:\x20')['concat'](_0x175872[_0x37958d(0x210)])[_0x37958d(0x1c7)](_0x175872['allowReserved']?_0x37958d(0x1c4):'','\x20}'))[_0x37958d(0x1b9)](',\x20'),'\x20}'):'',_0x42bdcc=_0x54168d?_0x37958d(0x1f5)['concat'](_0x55e559,_0x37958d(0x1a1))[_0x37958d(0x1c7)](_0x158a81,');'):_0x37958d(0x1f5)[_0x37958d(0x1c7)](_0x55e559,'`;'),_0x374548=_0x3a1e11?'options?.body':'null',_0x17a4bd=_0x41cfca?.['contentType']?.[_0x37958d(0x1f9)]()['startsWith']('multipart/form-data'),_0x145842=_0x41cfca&&!_0x17a4bd?_0x37958d(0x20e)[_0x37958d(0x1c7)](_0x41cfca['contentType'],_0x37958d(0x1f0)):'';return'\x20\x20'['concat'](_0x8b9905,'\x0a\x20\x20')['concat'](_0x5a1fc0,'(')['concat'](_0x293738['join'](',\x20'),_0x37958d(0x1f8))['concat'](_0x42bdcc,_0x37958d(0x21a))['concat'](_0x46f6cf,'\x22,\x20url,\x20')[_0x37958d(0x1c7)](_0x374548,_0x37958d(0x1a4))['concat'](_0x145842,'...mergedParams?.headers,\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20});\x0a\x20\x20}');}function H(_0x396865,_0x50a596){const _0x33e8aa=_0x5d81;let _0x3bd499=_0x90582a(_0x396865,{'useOperationId':_0x50a596[_0x33e8aa(0x1d9)],'operationFilters':_0x50a596['operationFilters'],'ignoreHeaders':_0x50a596[_0x33e8aa(0x211)],'stripPathPrefix':_0x50a596['stripPathPrefix'],'preferredContentTypes':_0x50a596[_0x33e8aa(0x1f4)]});if(_0x3bd499[_0x33e8aa(0x1de)]===0x0)return'';let _0x4c492b=[];for(let _0x3c5566 of _0x3bd499){let _0x18c898=ce(_0x3c5566['methodName'],_0x3c5566[_0x33e8aa(0x1a3)]);_0x18c898&&_0x4c492b[_0x33e8aa(0x1fd)](_0x18c898);let _0x516ded=le(_0x3c5566['methodName'],_0x3c5566[_0x33e8aa(0x194)]);_0x516ded&&_0x4c492b[_0x33e8aa(0x1fd)](_0x516ded);let _0x57a4e7=B(_0x3c5566['methodName'],_0x3c5566['cookieParams']);_0x57a4e7&&_0x4c492b['push'](_0x57a4e7);}return _0x4c492b[_0x33e8aa(0x1de)]===0x0?'':''['concat'](_0x4c492b['join']('\x0a\x0a'),'\x0a');}function U(_0x33f690,_0xf7ded0,_0x51c822){const _0x43af0c=_0x5d81;let _0x36626a=_0x3ed109(),_0x19e238=_0x90582a(_0x33f690,{'useOperationId':_0xf7ded0[_0x43af0c(0x1d9)],'operationFilters':_0xf7ded0[_0x43af0c(0x197)],'ignoreHeaders':_0xf7ded0[_0x43af0c(0x211)],'stripPathPrefix':_0xf7ded0['stripPathPrefix'],'preferredContentTypes':_0xf7ded0['preferredContentTypes'],'stats':_0x36626a});if(_0x19e238[_0x43af0c(0x1de)]===0x0)return _0x1627a2(_0x36626a,_0xf7ded0['operationFilters'],_0x51c822),'';let _0x54f8b3=_0x35c639(_0xf7ded0['outputClient']),_0x2a0590=_0x32a519(_0xf7ded0['basePath']),_0x5e26cb=_0xf7ded0[_0x43af0c(0x1fe)]??!0x0,_0xffdee7=_0x17583a();for(let _0x2abccf of _0x19e238){let _0x5c66e6=_0xffdee7['register'](_0x2abccf['methodName'],''[_0x43af0c(0x1c7)](_0x2abccf[_0x43af0c(0x19f)]['toUpperCase'](),'\x20')[_0x43af0c(0x1c7)](_0x2abccf['path']));_0x5c66e6!==void 0x0&&_0x51c822?.(_0x53c3a5(_0x2abccf['methodName'],''['concat'](_0x2abccf[_0x43af0c(0x19f)][_0x43af0c(0x1b6)](),'\x20')[_0x43af0c(0x1c7)](_0x2abccf[_0x43af0c(0x1fb)]),_0x5c66e6));}let _0x491417=_0x19e238[_0x43af0c(0x20c)](_0x34488b=>_0x34488b['queryParams'][_0x43af0c(0x1de)]>0x0),_0x47bc80=_0x19e238['some'](_0x6ebee=>!!_0x6ebee['requestBody']),_0x539c6b=_0x19e238[_0x43af0c(0x1af)](_0x247dd8=>V(_0x247dd8,_0x2a0590,_0x5e26cb))['join']('\x0a\x0a'),_0x41520e=[],_0xe64a=[_0x43af0c(0x1be),'Response'];_0x47bc80&&_0xe64a[_0x43af0c(0x1fd)](_0x43af0c(0x1e8));let _0x20ec8e=[_0x43af0c(0x21c),_0x43af0c(0x20a)];_0x491417&&_0x20ec8e[_0x43af0c(0x1d4)]('buildQueryString'),_0x19e238['some'](_0x546c2b=>_0x546c2b['pathParameters'][_0x43af0c(0x20c)](_0x246fc9=>_0x592dc9(_0x582ae6(_0x246fc9[_0x43af0c(0x1db)],_0x246fc9[_0x43af0c(0x210)]))))&&_0x20ec8e[_0x43af0c(0x1fd)]('serializePathParam');let _0x2ecf58=_0x43af0c(0x1ab)[_0x43af0c(0x1c7)](_0xe64a['join'](',\x20'),'\x20}\x20from\x20\x22k6/http\x22;');return _0x2ecf58+=_0x491417?'\x0aimport\x20{\x20'['concat'](_0x20ec8e['join'](',\x20'),',\x20type\x20QueryParams\x20}\x20from\x20\x22@spartaficial/openapi-to-k6/runtime\x22;'):'\x0aimport\x20{\x20'[_0x43af0c(0x1c7)](_0x20ec8e[_0x43af0c(0x1b9)](',\x20'),'\x20}\x20from\x20\x22@spartaficial/openapi-to-k6/runtime\x22;'),_0x41520e[_0x43af0c(0x1fd)](_0x2ecf58),_0x41520e[_0x43af0c(0x1fd)]('\x0a/**\x0a\x20*\x20K6\x20HTTP\x20client\x20for\x20API\x20testing\x0a\x20*\x20Generated\x20from\x20OpenAPI\x20specification\x0a\x20*\x0a\x20*\x20This\x20is\x20a\x20thin\x20passthrough\x20layer\x20-\x20no\x20response\x20parsing\x20or\x20validation.\x0a\x20*\x20Returns\x20raw\x20K6\x20Response\x20objects.\x20Use\x20the\x20Service\x20class\x20for\x20typed\x20responses.\x0a\x20*/\x0aexport\x20class\x20'['concat'](_0x54f8b3,'\x20{\x0a\x20\x20private\x20readonly\x20baseUrl:\x20string;\x0a\x20\x20private\x20readonly\x20commonRequestParameters:\x20Params;\x0a\x0a\x20\x20/**\x0a\x20\x20\x20*\x20Creates\x20a\x20new\x20API\x20client\x20instance\x0a\x20\x20\x20*\x20@param\x20baseUrl\x20-\x20Base\x20URL\x20for\x20all\x20API\x20requests\x20(trailing\x20slash\x20will\x20be\x20removed)\x0a\x20\x20\x20*\x20@param\x20commonRequestParameters\x20-\x20Common\x20K6\x20request\x20parameters\x20applied\x20to\x20all\x20requests\x0a\x20\x20\x20*/\x0a\x20\x20constructor(baseUrl:\x20string,\x20commonRequestParameters:\x20Params\x20=\x20{})\x20{\x0a\x20\x20\x20\x20this.baseUrl\x20=\x20cleanBaseUrl(baseUrl);\x0a\x20\x20\x20\x20this.commonRequestParameters\x20=\x20commonRequestParameters;\x0a\x20\x20}\x0a\x0a')[_0x43af0c(0x1c7)](_0x539c6b,'\x0a}')),_0x41520e['join']('\x0a');}function ue(_0x4c4d87,_0x399c29){const _0x3196c9=_0x5d81;return _0x5b5014(_0x4c4d87,{'useOperationId':_0x399c29[_0x3196c9(0x1d9)],'operationFilters':_0x399c29[_0x3196c9(0x197)],'ignoreHeaders':_0x399c29[_0x3196c9(0x211)],'stripPathPrefix':_0x399c29[_0x3196c9(0x1d7)],'preferredContentTypes':_0x399c29[_0x3196c9(0x1f4)]});}function _0x423b(){const _0x120f97=['D2fYBMLUz0nVBgXLy3rVCG','z2vUzxjHDgu','AgvHzgvYugfYyw1Z','Bg9N','CMvXDwvZDfbHCMfTzxrLCNm/oIbqyxjHBxm','B3bLCMf0Aw9UrMLSDgvYCW','Bwv0Ag9KtMfTzq','C3rYAxbty2HLBwfqCMvMAxG','sZztzxj2AwnLuMvZDwX0ihDPDgGGC3rHDhvZignOzwnRigfUzcbWyxjZzwqGzgf0yq','BMv2zxi','lcb7ia','DhLWzq','ywXSB3DszxnLCNzLza','Bwv0Ag9K','lcbLEhbSB2rLoIa','ycaRigj1AwXKuxvLCNLtDhjPBMCOB3b0Aw9UCZ8UCgfYyw1Z','C2HVD1n0yxrZ','CxvLCNLqyxjHBxm','lcb7cIaGicaGic4UlM1LCMDLzfbHCMfTCYWkicaGicaGAgvHzgvYCZOGEWOGicaGicaGia','q2XPzw50','icaGic8Vie1LCMDLignVB2TPzxmGAw50BYbYzxf1zxn0ihbHCMfTzxrLCNmkicaGigLMicGHCMvXDwvZDfbHCMfTzxrLCNmPihSkicaGicaGCMvXDwvZDfbHCMfTzxrLCNmGpsb7FtSkicaGih0kicaGihjLCxvLC3rqyxjHBwv0zxjZlMnVB2TPzxmGpsb7ic4UlNjLCxvLC3rqyxjHBwv0zxjZlMnVB2TPzxmSic4UlMnVB2TPzxmGFtSkcG','B3v0Chv0q2XPzw50','DgL0Bgu','zxHWB3j0CW','B3b0Aw9UywW','Aw1WB3j0igH0DhaGzNjVBsaIAZyVAhr0Cci7cMLTCg9YDcb0ExbLihSG','sw5WDxqGzMLSzsbUB3qGzM91BMq6ia','C3bLyW','Aw5MBW','BwfW','zgvZy3jPChrPB24','Aw1WB3j0ihr5CguGEYa','ihSkicbWCML2yxrLihjLywrVBMX5if9JBgLLBNq6ia','B3v0Chv0vhLWzxm','DgHPCY5Fy2XPzw50lG','C3bLy0nHy2HL','Dg9vChbLCKnHC2u','ih0GzNjVBsaIqhnWyxj0ywzPy2LHBc9VCgvUyxbPlxrVlwS2l3j1BNrPBwuIoWPPBxbVCNqGEYa','CgfYyw1Z','AM9PBG','oIbZDhjPBMC','z2vUzxjHDgvtzxj2AwnLu3rYAw5N','B3b0Aw9UCW','C2XPy2u','ugfYyw1Z','yM9VBgvHBG','C3rYAw5N','Aw5WDxq','z2vUzxjHDgvty2HLBwfuExbLC1n0CMLUzW','C3vMzML4','lcbHBgXVD1jLC2vYDMvKoIb0CNvL','qhnWyxj0ywzPy2LHBc9VCgvUyxbPlxrVlwS2','Cgf0AfbHCMfTzxrLCNm','y29Uy2f0','C2vYDMLJzq','y29UC3qGzgf0ysa9ihvUzgvMAw5LzcbHCYb2B2LKoW','C3rYAw5NAwz5','AgvHzgvYCW','y29UC3qGzgf0ysa9ihjLC3bVBNnLlMjVzhKGyxmG','icaGifnLCNzPy2uGBwv0Ag9KCZOG','q29VA2LLCW','zxHWB3j0ihr5CguG','oIb7ihn0EwXLoIa','DhLWzu5HBwu','zxzLCNK','iJOGkhiPid0+ihSkicaGicaGicbPzIaOCI5ZDgf0DxmGit09ia','Dw5ZAgLMDa','ihDHCW','Bg9HzenVBMzPzW','C3rYAxbqyxrOuhjLzML4','CgfYC2vtCgvJ','DxnLt3bLCMf0Aw9Uswq','DMvYC2LVBG','C3r5Bgu','DhjPBq','uMvJB3jKpa','BgvUz3rO','t3v0Chv0ihr5CgvZihbHDgGGAxmGCMvXDwLYzwq','CMvXDwLYzwq','icdINjmGr2vUzxjHDgvKieS2ihnLCNzPy2u6ia','cN07','rwfJAcbZCgvJig11C3qGC3bLy2LMEsbHBIbVDxrWDxqGzMLSzsbWyxrOigzVCIbNzw5LCMf0zwqGvhLWzvnJCMLWDcb0ExbLCY4','cI8QkGOGkIblnIbbueKGC2vYDMLJzsb3AxrOihn0yxr1CYbJB2rLihzHBgLKyxrPB24kicOGr2vUzxjHDgvKigzYB20Gt3bLBKfqssbZCgvJAwzPy2f0Aw9UcIaQcIaQifDYyxbZihrOzsbJBgLLBNqGBwv0Ag9KCYb3AxrOoGOGkIaTifn0yxr1CYbJB2rLignOzwnRAw5NihvZAw5NieS2j3mGy2HLy2SOksbMDw5JDgLVBGOGkIaTifjLC3bVBNnLigjVzhKGCgfYC2LUzWOGkIaTieS2u2vYDMLJzvjLC3vSDcbYzxr1CM4GDhLWzsb3AxrOig9RigzSywCkicOVcMv4Cg9YDcbJBgfZCYa','DM9Pza','CMvMtwfWCgLUz3m','C3vTBwfYEq','uMvXDwvZDejVzhK','jhTZzxjPywXPEMvqyxrOugfYyw0O','zgvWCMvJyxrLza','C3rYAwn0t2jQzwn0','B3v0Chv0u2vYDMLJzq','C3vJy2vZC1jLC3bVBNnLq29UDgvUDfr5Cgu','z2v0uMvZB2X2zwrdB25MAwDqyxrO','rMfPBgvKihrVigDLBMvYyxrLieS2ignSAwvUDdOG','iIWkicaGicaGica','DxrMltG','C3vJy2vZC1jLC3bVBNnLvhLWzq','zMLSzuHLywrLCG','ChjLzMvYCMvKq29UDgvUDfr5CgvZ','y29UC3qGDxjSid0GDgHPCY5IyxnLvxjSicSGya','zxH0zw5K','ywrK','ktOGuMvZCg9UC2uGEWOGicaG','Dg9mB3DLCKnHC2u','sZztzxj2AwnLuMvZDwX0lcbMB3jTyxrszxnWB25ZzujVzhK','Cgf0Aa','ksb7cIaGicb0AgLZlL9JBgLLBNqGpsbJBgLLBNq7cIaGFqOk','ChvZAa','Aw5JBhvKzurLC2nYAxb0Aw9UCW','oWOGih0','icaVkIOG','zw5KC1DPDgG','zMX1C2G','ANnVBG','Aw1WB3j0ugf0AezYB21tzxj2AwnL','zgvMyxvSDe51BgXHyMXL','yxjYyxK','sgvHzgvYCW','zNjVBq','B21PDa','BwvYz2vszxf1zxn0ugfYyw1LDgvYCW','icaGic8Vie1LCMDLigHLywrLCNmGAw50BYbYzxf1zxn0ihbHCMfTzxrLCNmkicaGigLMicGHCMvXDwvZDfbHCMfTzxrLCNmPihSkicaGicaGCMvXDwvZDfbHCMfTzxrLCNmGpsb7FtSkicaGih0kicaGihjLCxvLC3rqyxjHBwv0zxjZlMHLywrLCNmGpsb7ic4UlNjLCxvLC3rqyxjHBwv0zxjZlMHLywrLCNmSic4UlMHLywrLCNmGFtSkcG','C29Tzq','oWOGicaG','iKnVBNrLBNqTvhLWzsi6ici','Dw5PB24','zxHWBg9Kzq','AwDUB3jLsgvHzgvYCW','yM9KEt86ifjLCxvLC3rcB2r5ihWGBNvSBa','ih0PFq','qwXSihjLCxvPCMvKigzPzwXKCYbHCMuGChjLC2vUDcaOC3bLy3mGyxjYyxKGD2L0AcbPBNb1Dc9VDxrWDxrdBgLLBNqVB3v0Chv0vhLWzxmP','ksb7cIaGicaGicaGicbJB25ZB2XLlMXVzYHG','icdINjmGr2vUzxjHDgvKieS2ignSAwvUDdOG','icaGignVBNn0ihjLC3bVBNnLid0G','CMvXDwvZDfbHCMfTzxrLCNm','ChjLzML4','cIaGicbJB25ZDcbTzxjNzwrqyxjHBxmGpsbTzxjNzvjLCxvLC3rqyxjHBwv0zxjZkaOGicaGicbVChrPB25ZpY5Yzxf1zxn0ugfYyw1LDgvYCYb8Fcb7FsWkicaGicaGDgHPCY5JB21TB25szxf1zxn0ugfYyw1LDgvYCWOGicaGktSkcIaGicbYzxr1CM4GAhr0Cc5Yzxf1zxn0kci','rwfJAcbZCgvJig11C3qGC3bLy2LMEsb0AguGCgf0Acb0BYb5B3vYie9Wzw5bueKGC3bLy2LMAwnHDgLVBIbMAwXLlG','y2XLyw5cyxnLvxjS','y29UC3qGzgf0ysa9ihjLC3bVBNnLlMPZB24OksbHCYa','Dw5RBM93BG'];_0x423b=function(){return _0x120f97;};return _0x423b();}var de=I(()=>{});function W(_0x459921,_0x59044b){const _0x4e0930=_0x5d81;if(!_0x459921)return _0x459921;if(_0x459921[_0x4e0930(0x201)]('[]'))return''[_0x4e0930(0x1c7)](W(_0x459921[_0x4e0930(0x1bd)](0x0,-0x2),_0x59044b),'[]');let _0x46cdf9=_0x2efe75(_0x459921,_0x59044b['stripSchemaPrefix']);return _0x2e3f5a(_0x46cdf9,_0x59044b['prefix'],_0x59044b[_0x4e0930(0x1c3)]);}function G(_0xe21285){const _0x40ba4b=_0x5d81;return[_0x40ba4b(0x1c0),'number',_0x40ba4b(0x1bf),'unknown','any','void','null','undefined',_0x40ba4b(0x19b),'object']['includes'](_0xe21285)?!0x0:_0xe21285['endsWith']('[]')?G(_0xe21285['slice'](0x0,-0x2)):!!(_0xe21285['startsWith'](_0x40ba4b(0x1dd))||_0xe21285['includes']('\x22'));}function fe(_0x782945,_0x1c94f2,_0x5e0f1c){const _0x56db72=_0x5d81;let {methodName:_0x223f0a,pathParams:_0x585731,queryParams:_0x3ea069,headerParams:_0x24435b,cookieParams:_0x173e0c,requestBody:_0x23aae5}=_0x782945,_0x36a1a=[];for(let _0x5a812e of _0x585731){let _0x160bd8=_0x8aeb82(_0x5a812e);_0x36a1a[_0x56db72(0x1fd)](''['concat'](_0x160bd8,_0x56db72(0x1ba)));}if(_0x24435b['length']>0x0){let _0x29e53e=''['concat'](_0x41d50c(_0x223f0a),'Headers'),_0x3855bd=_0x24435b[_0x56db72(0x1d2)](_0x419474=>_0x419474['required']);_0x36a1a['push'](_0x56db72(0x1cb)[_0x56db72(0x1c7)](_0x3855bd?'':'?',':\x20')[_0x56db72(0x1c7)](_0x29e53e));}if(_0x173e0c['length']>0x0){let _0x5b4b7c=''['concat'](_0x41d50c(_0x223f0a),_0x56db72(0x1ce)),_0x3b9d2e=_0x173e0c['every'](_0x2b303e=>_0x2b303e['required']);_0x36a1a['push']('cookies'['concat'](_0x3b9d2e?'':'?',':\x20')['concat'](_0x5b4b7c));}if(_0x3ea069[_0x56db72(0x1de)]>0x0){let _0x1e3d48=''['concat'](_0x41d50c(_0x223f0a),'Params'),_0x3eb059=_0x3ea069['every'](_0x58186a=>_0x58186a[_0x56db72(0x1e0)]);_0x36a1a[_0x56db72(0x1fd)](_0x56db72(0x1b8)['concat'](_0x3eb059?'':'?',':\x20')[_0x56db72(0x1c7)](_0x1e3d48));}if(_0x23aae5){let _0x3453af=G(_0x23aae5[_0x56db72(0x1d1)])?_0x23aae5[_0x56db72(0x1d1)]:W(_0x23aae5[_0x56db72(0x1d1)],_0x5e0f1c);_0x36a1a[_0x56db72(0x1fd)]('body'['concat'](_0x23aae5['required']?'':'?',':\x20')[_0x56db72(0x1c7)](_0x3453af));}_0x36a1a['push'](_0x56db72(0x196));let _0x1e06ae='unknown';_0x782945[_0x56db72(0x1f2)]&&(_0x1e06ae=G(_0x782945[_0x56db72(0x1f2)])?_0x782945[_0x56db72(0x1f2)]:W(_0x782945['successResponseType'],_0x5e0f1c));let _0x3da217='K6ServiceResult<'['concat'](_0x1e06ae,'>'),_0x41b248=_0x782945['successStatusCode']||0xc8,_0x2997e4=_0x692df1({'summary':_0x782945[_0x56db72(0x1e7)],'description':_0x782945[_0x56db72(0x1b0)],'deprecated':_0x782945[_0x56db72(0x1ea)],'method':_0x782945[_0x56db72(0x19f)],'path':_0x782945['path'],'includeDescriptions':_0x1c94f2,'returns':_0x56db72(0x19a)}),_0x283e66=_0x585731['map'](_0xef7960=>_0x8aeb82(_0xef7960))['join'](',\x20'),_0x4f8feb=[];_0x3ea069['length']>0x0&&_0x4f8feb[_0x56db72(0x1fd)]('params'),_0x4f8feb['push'](_0x56db72(0x218)),_0x23aae5&&_0x4f8feb['push']('body:\x20serializeBody(body,\x20'[_0x56db72(0x1c7)](JSON[_0x56db72(0x1ca)](_0x23aae5['contentType']),')'));let _0x142da4='{\x20'['concat'](_0x4f8feb[_0x56db72(0x1b9)](',\x20'),'\x20}'),_0x469a10=_0x283e66?_0x56db72(0x1b4)['concat'](_0x223f0a,'(')['concat'](_0x283e66,',\x20')['concat'](_0x142da4,')'):_0x56db72(0x1b4)[_0x56db72(0x1c7)](_0x223f0a,'(')['concat'](_0x142da4,')'),_0x1c48ca;if(_0x1e06ae===_0x56db72(0x1e5))_0x1c48ca=_0x56db72(0x1c9);else{let {method:_0x473c34}=_0x4ea7f3(_0x782945[_0x56db72(0x1ed)]);_0x1c48ca=_0x473c34===_0x56db72(0x203)?_0x56db72(0x21d)['concat'](_0x1e06ae,';'):_0x56db72(0x1cc)[_0x56db72(0x1c7)](_0x1e06ae,';');}let _0x58a5f5='';_0x24435b['length']>0x0&&(_0x58a5f5=_0x56db72(0x20b));let _0x4f15a0='';return _0x173e0c[_0x56db72(0x1de)]>0x0&&(_0x4f15a0=_0x56db72(0x1a6)),'\x20\x20'[_0x56db72(0x1c7)](_0x2997e4,'\x0a\x20\x20')['concat'](_0x223f0a,'(')[_0x56db72(0x1c7)](_0x36a1a['join'](',\x20'),'):\x20')[_0x56db72(0x1c7)](_0x3da217,'\x20{\x0a')[_0x56db72(0x1c7)](_0x58a5f5)['concat'](_0x4f15a0,_0x56db72(0x217))[_0x56db72(0x1c7)](_0x469a10,';\x0a\x0a\x20\x20\x20\x20//\x20Validate\x20status\x20code\x0a\x20\x20\x20\x20const\x20ok\x20=\x20check(response,\x20{\x0a\x20\x20\x20\x20\x20\x20\x22')['concat'](_0x223f0a,'\x20status\x20is\x20')[_0x56db72(0x1c7)](_0x41b248,_0x56db72(0x1d3))['concat'](_0x41b248,_0x56db72(0x215))['concat'](_0x223f0a,'\x20failed\x20with\x20status:\x20${r.status},\x20body:\x20${formatResponseBody(r.body)}`);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20r.status\x20===\x20')[_0x56db72(0x1c7)](_0x41b248,';\x0a\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20});\x0a\x0a\x20\x20\x20\x20')['concat'](_0x1c48ca,'\x0a\x20\x20\x20\x20return\x20{\x20response,\x20data,\x20ok\x20};\x0a\x20\x20}');}function pe(_0x9890c3,_0x307d46){const _0x225fb5=_0x5d81;let _0x2f85c6=new Set();for(let _0x301f03 of _0x9890c3){if(_0x301f03[_0x225fb5(0x1f2)]&&_0x301f03[_0x225fb5(0x1f2)]!==_0x225fb5(0x21e)&&_0x301f03[_0x225fb5(0x1f2)]!=='void'&&!G(_0x301f03['successResponseType'])){let _0x1cc147=W(_0x301f03['successResponseType'],_0x307d46),_0x328124=_0x1cc147[_0x225fb5(0x201)]('[]')?_0x1cc147['slice'](0x0,-0x2):_0x1cc147;G(_0x328124)||_0x2f85c6[_0x225fb5(0x1f7)](_0x328124);}if(_0x301f03['requestBody']?.[_0x225fb5(0x1d1)]&&_0x301f03['requestBody'][_0x225fb5(0x1d1)]!==_0x225fb5(0x21e)&&!G(_0x301f03['requestBody']['typeName'])){let _0x341fb3=W(_0x301f03['requestBody'][_0x225fb5(0x1d1)],_0x307d46);_0x2f85c6[_0x225fb5(0x1f7)](_0x341fb3);}}return Array[_0x225fb5(0x208)](_0x2f85c6);}function me(_0x374e4a){const _0x39997f=_0x5d81;let _0x2670c9=[];for(let _0x16b6a2 of _0x374e4a)_0x16b6a2[_0x39997f(0x1a3)]['length']>0x0&&_0x2670c9['push'](''[_0x39997f(0x1c7)](_0x41d50c(_0x16b6a2['methodName']),'Params')),_0x16b6a2['headerParams']['length']>0x0&&_0x2670c9[_0x39997f(0x1fd)](''[_0x39997f(0x1c7)](_0x41d50c(_0x16b6a2['methodName']),'Headers')),_0x16b6a2['cookieParams'][_0x39997f(0x1de)]>0x0&&_0x2670c9[_0x39997f(0x1fd)](''[_0x39997f(0x1c7)](_0x41d50c(_0x16b6a2[_0x39997f(0x198)]),_0x39997f(0x1ce)));return _0x2670c9;}function he(_0x75a902,_0x5a31b3,_0x8ca5f9,_0x5f0017){const _0x1cc63e=_0x5d81;let _0x2d52fd=_0x90582a(_0x75a902,{'useOperationId':_0x5a31b3[_0x1cc63e(0x1d9)],'operationFilters':_0x5a31b3[_0x1cc63e(0x197)],'ignoreHeaders':_0x5a31b3[_0x1cc63e(0x211)],'stripPathPrefix':_0x5a31b3['stripPathPrefix'],'preferredContentTypes':_0x5a31b3[_0x1cc63e(0x1f4)],'trackStatusCode':!0x0});if(_0x2d52fd['length']===0x0)return'';let _0x535a6a=_0x35c639(_0x5a31b3['outputClient'],_0x1cc63e(0x1a5)),_0x5e969e=_0x35c639(_0x5a31b3['outputService']||_0x1cc63e(0x1c8),'Service'),_0x4c889e=_0x5a31b3[_0x1cc63e(0x1fe)]??!0x0,_0xc96ef9={'stripSchemaPrefix':_0x5a31b3[_0x1cc63e(0x199)],'prefix':_0x5a31b3['prefix'],'suffix':_0x5a31b3['suffix']},_0x4f0420=me(_0x2d52fd),_0xde8a50=pe(_0x2d52fd,_0xc96ef9),_0x14ff15=_0x2d52fd[_0x1cc63e(0x1af)](_0x3fc130=>fe(_0x3fc130,_0x4c889e,_0xc96ef9))['join']('\x0a\x0a'),_0x20d01d=[],_0x449d47=_0x2d52fd[_0x1cc63e(0x20c)](_0x4354e5=>!!_0x4354e5['requestBody'])?'K6ServiceResult,\x20serializeBody,\x20formatResponseBody':_0x1cc63e(0x1fa);_0x20d01d['push']('import\x20{\x20check\x20}\x20from\x20\x22k6\x22;\x0aimport\x20type\x20{\x20Params\x20}\x20from\x20\x22k6/http\x22;\x0aimport\x20{\x20type\x20'['concat'](_0x449d47,_0x1cc63e(0x1b7))[_0x1cc63e(0x1c7)](_0x535a6a,'\x20}\x20from\x20\x22')[_0x1cc63e(0x1c7)](_0x8ca5f9,'\x22;'));let _0x59f62e=[..._0x4f0420,..._0xde8a50];return _0x59f62e[_0x1cc63e(0x1de)]>0x0&&_0x20d01d['push'](_0x1cc63e(0x1b1)[_0x1cc63e(0x1c7)](_0x59f62e['join'](',\x20'),'\x20}\x20from\x20\x22')['concat'](_0x5f0017,'\x22;')),_0x20d01d[_0x1cc63e(0x1fd)](_0x1cc63e(0x1e4)[_0x1cc63e(0x1c7)](_0x5e969e,_0x1cc63e(0x1b2))[_0x1cc63e(0x1c7)](_0x535a6a,';\x0a\x0a\x20\x20/**\x0a\x20\x20\x20*\x20Creates\x20a\x20new\x20API\x20service\x20instance\x0a\x20\x20\x20*\x20@param\x20client\x20-\x20The\x20K6\x20client\x20instance\x20to\x20wrap\x0a\x20\x20\x20*/\x0a\x20\x20constructor(client:\x20')[_0x1cc63e(0x1c7)](_0x535a6a,_0x1cc63e(0x1fc))['concat'](_0x14ff15,'\x0a}')),_0x20d01d['join']('\x0a');}function ge(_0x5aadd7,_0x1a0b7a){const _0x276358=_0x5d81;return _0x5b5014(_0x5aadd7,{'useOperationId':_0x1a0b7a['useOperationId'],'operationFilters':_0x1a0b7a['operationFilters'],'ignoreHeaders':_0x1a0b7a[_0x276358(0x211)],'stripPathPrefix':_0x1a0b7a[_0x276358(0x1d7)],'preferredContentTypes':_0x1a0b7a['preferredContentTypes']});}var _e=I(()=>{}),K,ve=I(()=>{const _0x1d8a45=_0x5d81;R(),de(),_e(),K=class _0x10303c{[_0x1d8a45(0x1bc)];['spec']=null;static [_0x1d8a45(0x1b5)]=new _0x4d94f5(0x32);['warningCollector'];constructor(_0x18254f){const _0x4e5516=_0x5d81;if(!_0x18254f[_0x4e5516(0x1c1)])throw new _0x1cdbc1('Input\x20path\x20is\x20required','');if(!_0x231e51(_0x18254f['input']))throw new _0x1cdbc1(_0x4e5516(0x1ac)[_0x4e5516(0x1c7)](_0x18254f['input']),_0x18254f[_0x4e5516(0x1c1)]);if(!_0x18254f[_0x4e5516(0x1b3)])throw new L(_0x4e5516(0x1df));if(!_0x18254f['outputClient'])throw new L('Output\x20client\x20path\x20is\x20required');let _0x53cdde=_0x18254f['showWarnings']!==!0x1;this[_0x4e5516(0x192)]=new _0x18a6d6({'packageName':'@spartaficial/openapi-to-k6','enabled':_0x53cdde}),this[_0x4e5516(0x1bc)]={'includeDescriptions':_0x18254f[_0x4e5516(0x1fe)]??!0x0,'showStats':_0x18254f['showStats']??!0x0,'showWarnings':_0x53cdde,..._0x3be095(_0x18254f)};}[_0x1d8a45(0x1d8)](){const _0x1952d2=_0x5d81;return this['spec']||=_0xccca2(this[_0x1952d2(0x1bc)][_0x1952d2(0x1c1)],_0x10303c['specCache'],{'warn':_0x33c51e=>{this['warningCollector']['add'](_0x33c51e);},'refMappings':this['options'][_0x1952d2(0x1e6)]}),this[_0x1952d2(0x1ad)];}['generateString'](){const _0x14f7c0=_0x5d81;let _0x5bd9a7=this['parseSpec'](),_0x132451=_0x2f7a4b(this['options']['fileHeader']),_0x217049=_0x356514({'packageName':'@spartaficial/openapi-to-k6','apiTitle':_0x5bd9a7['info']?.['title'],'apiVersion':_0x5bd9a7[_0x14f7c0(0x1ae)]?.[_0x14f7c0(0x1da)]});_0x4626b1(this['options'][_0x14f7c0(0x211)],_0x5bd9a7,_0xfb009c=>{this['warningCollector']['add'](_0xfb009c);});let _0x29a586=U(_0x5bd9a7,this[_0x14f7c0(0x1bc)],_0x315622=>{const _0x4937b5=_0x5d81;this['warningCollector'][_0x4937b5(0x1f7)](_0x315622);});return this['warningCollector'][_0x14f7c0(0x202)](),_0x132451+_0x217049+_0x29a586;}['generateParamTypesString'](){return H(this['parseSpec'](),this['options']);}['generateSchemaTypesString'](){const _0x7189c1=_0x5d81;let _0x404242={'input':this['options']['input'],'outputTypes':this[_0x7189c1(0x1bc)][_0x7189c1(0x1b3)],'includeDescriptions':this['options'][_0x7189c1(0x1fe)],'prefix':this[_0x7189c1(0x1bc)][_0x7189c1(0x219)],'suffix':this['options']['suffix'],'stripSchemaPrefix':this['options']['stripSchemaPrefix'],'stripPathPrefix':this[_0x7189c1(0x1bc)][_0x7189c1(0x1d7)],'useOperationId':this[_0x7189c1(0x1bc)][_0x7189c1(0x1d9)]??!0x1,'defaultNullable':this[_0x7189c1(0x1bc)][_0x7189c1(0x205)],'enumFormat':this['options']['enumFormat']??_0x7189c1(0x20f),'ignoreHeaders':this['options']['ignoreHeaders'],'operationFilters':this[_0x7189c1(0x1bc)]['operationFilters'],'refMappings':this['options'][_0x7189c1(0x1e6)],'showStats':this['options'][_0x7189c1(0x1a2)],'includeHeader':!0x1,'showWarnings':!0x1};return new _0x25d0a5(_0x404242)['generateString']();}[_0x1d8a45(0x1bb)](_0x2128d7,_0x24f874){const _0x10e8c0=_0x5d81;let _0x275f61=this[_0x10e8c0(0x1d8)](),_0x4cd002=_0x2f7a4b(this['options'][_0x10e8c0(0x1f3)]),_0x34b83c=_0x356514({'packageName':_0x10e8c0(0x1c5),'apiTitle':_0x275f61['info']?.[_0x10e8c0(0x1a8)],'apiVersion':_0x275f61['info']?.[_0x10e8c0(0x1da)]}),_0x582a64=he(_0x275f61,this[_0x10e8c0(0x1bc)],_0x2128d7,_0x24f874);return _0x4cd002+_0x34b83c+_0x582a64;}[_0x1d8a45(0x204)](_0x130ea5){const _0x1ee52b=_0x5d81;return this[_0x1ee52b(0x1bc)]['outputService']?_0x47e28d(this[_0x1ee52b(0x1bc)][_0x1ee52b(0x1ec)],_0x130ea5):'';}[_0x1d8a45(0x193)](){const _0x240a4e=_0x5d81;try{let _0x514493=this[_0x240a4e(0x1d8)](),_0x56910c=_0x1ad500(this[_0x240a4e(0x1bc)][_0x240a4e(0x1a7)]),_0x212806=_0x2f7a4b(this[_0x240a4e(0x1bc)][_0x240a4e(0x1f3)])+_0x356514({'packageName':_0x240a4e(0x1c5),'apiTitle':_0x514493[_0x240a4e(0x1ae)]?.['title'],'apiVersion':_0x514493[_0x240a4e(0x1ae)]?.[_0x240a4e(0x1da)]});if(this['options'][_0x240a4e(0x1b3)]){let _0x9e3e5=_0x1ad500(this[_0x240a4e(0x1bc)]['outputTypes']),_0x2ce068=this['generateParamTypesString'](),_0x6a8698=this[_0x240a4e(0x1c2)]()+(_0x2ce068?'\x0a'[_0x240a4e(0x1c7)](_0x2ce068):'');_0x6a8698[_0x240a4e(0x1dc)]()&&(_0x4059ac(_0x9e3e5),_0x450b0d(_0x9e3e5,_0x212806+_0x6a8698,_0x240a4e(0x1f1)),console['log']('\x20\x20✓\x20Generated\x20types:\x20'[_0x240a4e(0x1c7)](_0x9e3e5)));}let _0x262910=U(_0x514493,this['options'],_0x1cdd61=>{const _0x88ebae=_0x5d81;this[_0x88ebae(0x192)][_0x88ebae(0x1f7)](_0x1cdd61);});if(!_0x262910){this[_0x240a4e(0x192)][_0x240a4e(0x1f7)]('No\x20operations\x20to\x20generate\x20a\x20client\x20from,\x20so\x20'['concat'](_0x56910c)+(this[_0x240a4e(0x1bc)][_0x240a4e(0x1ec)]?'\x20and\x20'['concat'](_0x1ad500(this[_0x240a4e(0x1bc)][_0x240a4e(0x1ec)]),'\x20were'):_0x240a4e(0x1d5))+'\x20not\x20written.\x20Check\x20that\x20the\x20specification\x20declares\x20paths\x20and\x20that\x20any\x20operationFilters\x20still\x20match.'),this[_0x240a4e(0x192)]['flush']();return;}if(_0x4059ac(_0x56910c),_0x450b0d(_0x56910c,_0x212806+_0x262910,_0x240a4e(0x1f1)),console[_0x240a4e(0x195)](_0x240a4e(0x216)[_0x240a4e(0x1c7)](_0x56910c)),this['options'][_0x240a4e(0x1a2)]){let _0x161022=ue(_0x514493,this['options']);console['log']('\x20\x20\x20\x20Paths:\x20'['concat'](_0x161022['totalPaths'],',\x20Operations:\x20')[_0x240a4e(0x1c7)](_0x161022['includedOperations'],'/')['concat'](_0x161022['totalOperations']));}if(this[_0x240a4e(0x1bc)]['outputService']){let _0x3874a8=_0x1ad500(this[_0x240a4e(0x1bc)][_0x240a4e(0x1ec)]),_0x57c4da=this[_0x240a4e(0x204)](this['options'][_0x240a4e(0x1a7)]),_0x474a03=this['importPathFromService'](this['options']['outputTypes']),_0x487621=this[_0x240a4e(0x1bb)](_0x57c4da,_0x474a03);if(_0x487621&&(_0x4059ac(_0x3874a8),_0x450b0d(_0x3874a8,_0x487621,'utf-8'),console[_0x240a4e(0x195)](_0x240a4e(0x1e1)[_0x240a4e(0x1c7)](_0x3874a8)),this['options']['showStats'])){let _0x30e1bd=ge(_0x514493,this['options']);console['log'](_0x240a4e(0x1cd)[_0x240a4e(0x1c7)](_0x30e1bd['includedOperations']));}}this['warningCollector'][_0x240a4e(0x202)]();}catch(_0x311183){throw new L(_0x240a4e(0x1ef)[_0x240a4e(0x1c7)](_0x311183 instanceof Error?_0x311183['message']:String(_0x311183)),_0x311183 instanceof Error?_0x311183:void 0x0);}}};});function ye(_0xf6cdb){return _0x520ceb(_0xf6cdb);}var q,J,Y,X,Z,Q,$,be=I(()=>{const _0x1db3b0=_0x5d81;q=_0x5f5d85['strictObject']({'outputClient':_0x5f5d85['string'](),'outputService':_0x5f5d85[_0x1db3b0(0x1c0)]()[_0x1db3b0(0x1aa)](),'operationFilters':_0x554bb5['optional'](),'useOperationId':_0x5f5d85[_0x1db3b0(0x1bf)]()[_0x1db3b0(0x1aa)](),'basePath':_0x5f5d85['string']()[_0x1db3b0(0x1aa)](),'ignoreHeaders':_0x5f5d85['array'](_0x5f5d85[_0x1db3b0(0x1c0)]())[_0x1db3b0(0x1aa)](),'preferredContentTypes':_0x5f5d85[_0x1db3b0(0x206)](_0x5f5d85[_0x1db3b0(0x1c0)]())[_0x1db3b0(0x1aa)]()}),J=_0x8d4f58[_0x1db3b0(0x209)]({'operationFilters':!0x0,'schemaType':!0x0})[_0x1db3b0(0x1f6)]({...q['shape']}),Y=_0x295648[_0x1db3b0(0x209)]({'operationFilters':!0x0,'schemaType':!0x0})['extend']({...q['omit']({'outputClient':!0x0,'outputService':!0x0})['shape']}),X=_0x5f5d85[_0x1db3b0(0x1eb)]({'defaults':Y['optional'](),'specs':_0x5f5d85['array'](J)['min'](0x1,{'message':'Configuration\x20must\x20include\x20at\x20least\x20one\x20specification.\x20Each\x20specification\x20should\x20have\x20\x27input\x27,\x20\x27outputClient\x27,\x20and\x20\x27outputTypes\x27\x20paths.'}),'executionMode':_0x11dddf[_0x1db3b0(0x1aa)]()}),Z=_0x204b28({'packageName':'openapi-to-k6','errorMessages':{'missingFieldMessages':{'input':_0x1db3b0(0x21b),'outputClient':'Each\x20spec\x20must\x20specify\x20an\x20output\x20file\x20path\x20for\x20the\x20generated\x20K6\x20API\x20client.','outputTypes':_0x1db3b0(0x1e3)},'unrecognizedKeyMessages':{'output':'Did\x20you\x20mean\x20\x27outputClient\x27\x20or\x20\x27outputTypes\x27?\x20The\x20\x27output\x27\x20field\x20was\x20renamed.'},'requiredFieldsHelp':_0x1db3b0(0x214)}},X),Q=Z[_0x1db3b0(0x1d6)],$=Z[_0x1db3b0(0x1ee)];});function _0x5d81(_0x46fb4e,_0x423b0c){_0x46fb4e=_0x46fb4e-0x192;const _0x5d813d=_0x423b();let _0x101a3f=_0x5d813d[_0x46fb4e];if(_0x5d81['XDWoQz']===undefined){var _0x477a48=function(_0x37382f){const _0x18b97f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x11dddf='',_0x1cdbc1='';for(let _0x5b157f=0x0,_0x4d94f5,_0x554bb5,_0x18a6d6=0x0;_0x554bb5=_0x37382f['charAt'](_0x18a6d6++);~_0x554bb5&&(_0x4d94f5=_0x5b157f%0x4?_0x4d94f5*0x40+_0x554bb5:_0x554bb5,_0x5b157f++%0x4)?_0x11dddf+=String['fromCharCode'](0xff&_0x4d94f5>>(-0x2*_0x5b157f&0x6)):0x0){_0x554bb5=_0x18b97f['indexOf'](_0x554bb5);}for(let _0x2e3f5a=0x0,_0x2b66c9=_0x11dddf['length'];_0x2e3f5a<_0x2b66c9;_0x2e3f5a++){_0x1cdbc1+='%'+('00'+_0x11dddf['charCodeAt'](_0x2e3f5a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1cdbc1);};_0x5d81['kMtNDn']=_0x477a48,_0x5d81['MrFjdC']={},_0x5d81['XDWoQz']=!![];}const _0x1329bd=_0x5d813d[0x0];_0x5d81['PsoOSY']!==_0x1329bd&&(_0x5d81['MrFjdC']={},_0x5d81['PsoOSY']=_0x1329bd);const _0x5c7856=_0x5d81['MrFjdC'][_0x46fb4e];return _0x5c7856===undefined?(_0x101a3f=_0x5d81['kMtNDn'](_0x101a3f),_0x5d81['MrFjdC'][_0x46fb4e]=_0x101a3f):_0x101a3f=_0x5c7856,_0x101a3f;}export{K as a,R as c,ye as i,se as l,be as n,ve as o,Q as r,L as s,$ as t,I as u};
|