@weconjs/core 1.2.13 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generators/PostmanGenerator.d.ts +137 -0
- package/dist/generators/PostmanGenerator.d.ts.map +1 -0
- package/dist/generators/PostmanGenerator.js +318 -0
- package/dist/generators/PostmanGenerator.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/routing/PostmanGroup.d.ts +56 -0
- package/dist/routing/PostmanGroup.d.ts.map +1 -0
- package/dist/routing/PostmanGroup.js +66 -0
- package/dist/routing/PostmanGroup.js.map +1 -0
- package/dist/routing/PostmanRoute.d.ts +145 -0
- package/dist/routing/PostmanRoute.d.ts.map +1 -0
- package/dist/routing/PostmanRoute.js +138 -0
- package/dist/routing/PostmanRoute.js.map +1 -0
- package/dist/routing/Route.d.ts +2 -0
- package/dist/routing/Route.d.ts.map +1 -1
- package/dist/routing/Route.js +2 -0
- package/dist/routing/Route.js.map +1 -1
- package/dist/routing/Routes.d.ts +2 -0
- package/dist/routing/Routes.d.ts.map +1 -1
- package/dist/routing/Routes.js +3 -0
- package/dist/routing/Routes.js.map +1 -1
- package/dist/routing/Wecon.d.ts +33 -0
- package/dist/routing/Wecon.d.ts.map +1 -1
- package/dist/routing/Wecon.js +52 -0
- package/dist/routing/Wecon.js.map +1 -1
- package/dist/routing/index.d.ts +5 -1
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +2 -0
- package/dist/routing/index.js.map +1 -1
- package/dist/types/postman.types.d.ts +241 -0
- package/dist/types/postman.types.d.ts.map +1 -0
- package/dist/types/postman.types.js +6 -0
- package/dist/types/postman.types.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostmanGenerator - Intelligent Postman Collection & Environment Generator
|
|
3
|
+
*
|
|
4
|
+
* This utility class generates:
|
|
5
|
+
* 1. Postman Collection v2.1.0 JSON files
|
|
6
|
+
* 2. Postman Environment JSON files with auto-extracted variables
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Automatic variable extraction from route paths (e.g., :userId -> {{userId}})
|
|
10
|
+
* - Collection of custom variables from PostmanRoute and PostmanGroup configs
|
|
11
|
+
* - Hierarchical folder structure matching Routes organization
|
|
12
|
+
* - Smart defaults for missing configurations
|
|
13
|
+
*/
|
|
14
|
+
import Routes from "../routing/Routes.js";
|
|
15
|
+
import type { PostmanInfo, PostmanVariableList, PostmanAuth, PostmanEventList, PostmanProtocolProfileBehavior } from "../types/postman.types.js";
|
|
16
|
+
import type { PostmanItem } from "../routing/PostmanRoute.js";
|
|
17
|
+
import type { PostmanItemGroup } from "../routing/PostmanGroup.js";
|
|
18
|
+
/**
|
|
19
|
+
* Configuration for PostmanGenerator
|
|
20
|
+
*/
|
|
21
|
+
export interface PostmanGeneratorConfig {
|
|
22
|
+
/** Name of the Postman collection */
|
|
23
|
+
name: string;
|
|
24
|
+
/** Description of the API */
|
|
25
|
+
description?: string;
|
|
26
|
+
/** Base URL for all requests (will be added as {{baseUrl}} variable) */
|
|
27
|
+
baseUrl?: string;
|
|
28
|
+
/** API version */
|
|
29
|
+
version?: string;
|
|
30
|
+
/** Output file paths */
|
|
31
|
+
output?: {
|
|
32
|
+
/** Path to save the collection JSON file */
|
|
33
|
+
collection?: string;
|
|
34
|
+
/** Path to save the environment JSON file */
|
|
35
|
+
environment?: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Postman Collection v2.1.0 structure
|
|
40
|
+
*/
|
|
41
|
+
interface PostmanCollection {
|
|
42
|
+
info: PostmanInfo;
|
|
43
|
+
item: (PostmanItemGroup | PostmanItem)[];
|
|
44
|
+
auth?: PostmanAuth | null;
|
|
45
|
+
event?: PostmanEventList;
|
|
46
|
+
variable?: PostmanVariableList;
|
|
47
|
+
protocolProfileBehavior?: PostmanProtocolProfileBehavior;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Postman Environment structure
|
|
51
|
+
*/
|
|
52
|
+
interface PostmanEnvironment {
|
|
53
|
+
id?: string;
|
|
54
|
+
name: string;
|
|
55
|
+
values: Array<{
|
|
56
|
+
key: string;
|
|
57
|
+
value: string;
|
|
58
|
+
type?: "default" | "secret";
|
|
59
|
+
enabled?: boolean;
|
|
60
|
+
description?: string;
|
|
61
|
+
}>;
|
|
62
|
+
_postman_variable_scope?: string;
|
|
63
|
+
_postman_exported_at?: string;
|
|
64
|
+
_postman_exported_using?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* PostmanGenerator class
|
|
68
|
+
*/
|
|
69
|
+
declare class PostmanGenerator {
|
|
70
|
+
private config;
|
|
71
|
+
private routes;
|
|
72
|
+
private collectedVariables;
|
|
73
|
+
private pathVariables;
|
|
74
|
+
constructor(config: PostmanGeneratorConfig, routes: Routes);
|
|
75
|
+
/**
|
|
76
|
+
* Generate both collection and environment files
|
|
77
|
+
*/
|
|
78
|
+
generate(): Promise<{
|
|
79
|
+
collection: PostmanCollection;
|
|
80
|
+
environment: PostmanEnvironment;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Extract variables from all routes and their configurations
|
|
84
|
+
*/
|
|
85
|
+
private extractVariables;
|
|
86
|
+
/**
|
|
87
|
+
* Recursively extract variables from Routes instances
|
|
88
|
+
*/
|
|
89
|
+
private extractVariablesFromRoutes;
|
|
90
|
+
/**
|
|
91
|
+
* Recursively scan an object for string values containing {{variable}}
|
|
92
|
+
*/
|
|
93
|
+
private recursivelyScanForVariables;
|
|
94
|
+
/**
|
|
95
|
+
* Extract path parameters from Express-style path
|
|
96
|
+
* Example: /users/:userId/posts/:postId -> ['userId', 'postId']
|
|
97
|
+
*/
|
|
98
|
+
private extractPathParams;
|
|
99
|
+
/**
|
|
100
|
+
* Extract variable references from strings (e.g., {{authToken}})
|
|
101
|
+
*/
|
|
102
|
+
private extractVariablesFromString;
|
|
103
|
+
/**
|
|
104
|
+
* Generate the Postman Collection
|
|
105
|
+
*/
|
|
106
|
+
private generateCollection;
|
|
107
|
+
/**
|
|
108
|
+
* Convert Routes/Route instances to Postman items/folders
|
|
109
|
+
*/
|
|
110
|
+
private convertRoutesToItems;
|
|
111
|
+
/**
|
|
112
|
+
* Convert a single Route to a PostmanItem
|
|
113
|
+
*/
|
|
114
|
+
private convertRouteToItem;
|
|
115
|
+
/**
|
|
116
|
+
* Convert Express-style path to Postman-style path
|
|
117
|
+
* Example: /users/:userId -> /users/{{userId}}
|
|
118
|
+
*/
|
|
119
|
+
private convertPathToPostman;
|
|
120
|
+
/**
|
|
121
|
+
* Generate the Postman Environment
|
|
122
|
+
*/
|
|
123
|
+
private generateEnvironment;
|
|
124
|
+
/**
|
|
125
|
+
* Write JSON to file with pretty formatting
|
|
126
|
+
*/
|
|
127
|
+
private writeJsonFile;
|
|
128
|
+
/**
|
|
129
|
+
* Static helper to generate from Wecon configuration
|
|
130
|
+
*/
|
|
131
|
+
static generateFromWecon(config: PostmanGeneratorConfig, routes: Routes): Promise<{
|
|
132
|
+
collection: PostmanCollection;
|
|
133
|
+
environment: PostmanEnvironment;
|
|
134
|
+
}>;
|
|
135
|
+
}
|
|
136
|
+
export default PostmanGenerator;
|
|
137
|
+
//# sourceMappingURL=PostmanGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostmanGenerator.d.ts","sourceRoot":"","sources":["../../src/generators/PostmanGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,KAAK,EACV,WAAW,EAEX,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,8BAA8B,EAC/B,MAAM,2BAA2B,CAAC;AAC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,EAAE,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,cAAM,gBAAgB;IACpB,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,kBAAkB,CAA2C;IACrE,OAAO,CAAC,aAAa,CAA0B;gBAEnC,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM;IAK1D;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC;QAC/B,UAAU,EAAE,iBAAiB,CAAC;QAC9B,WAAW,EAAE,kBAAkB,CAAC;KACjC,CAAC;IAsBF;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAexB;;OAEG;IACH,OAAO,CAAC,0BAA0B;IA8BlC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA+CnC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAMlC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAuB1B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA8C5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgC1B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAuC3B;;OAEG;IACH,OAAO,CAAC,aAAa;IAerB;;OAEG;WACiB,iBAAiB,CACnC,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;QACT,UAAU,EAAE,iBAAiB,CAAC;QAC9B,WAAW,EAAE,kBAAkB,CAAC;KACjC,CAAC;CAIH;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostmanGenerator - Intelligent Postman Collection & Environment Generator
|
|
3
|
+
*
|
|
4
|
+
* This utility class generates:
|
|
5
|
+
* 1. Postman Collection v2.1.0 JSON files
|
|
6
|
+
* 2. Postman Environment JSON files with auto-extracted variables
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Automatic variable extraction from route paths (e.g., :userId -> {{userId}})
|
|
10
|
+
* - Collection of custom variables from PostmanRoute and PostmanGroup configs
|
|
11
|
+
* - Hierarchical folder structure matching Routes organization
|
|
12
|
+
* - Smart defaults for missing configurations
|
|
13
|
+
*/
|
|
14
|
+
import { writeFileSync } from "fs";
|
|
15
|
+
import { dirname } from "path";
|
|
16
|
+
import { mkdirSync } from "fs";
|
|
17
|
+
import Route from "../routing/Route.js";
|
|
18
|
+
import Routes from "../routing/Routes.js";
|
|
19
|
+
// so we can easily change schema version in the future
|
|
20
|
+
const SCHEMA_URL = "https://schema.getpostman.com/json/collection/v2.1.0/collection.json";
|
|
21
|
+
/**
|
|
22
|
+
* PostmanGenerator class
|
|
23
|
+
*/
|
|
24
|
+
class PostmanGenerator {
|
|
25
|
+
config;
|
|
26
|
+
routes;
|
|
27
|
+
collectedVariables = new Map();
|
|
28
|
+
pathVariables = new Set();
|
|
29
|
+
constructor(config, routes) {
|
|
30
|
+
this.config = config;
|
|
31
|
+
this.routes = routes;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Generate both collection and environment files
|
|
35
|
+
*/
|
|
36
|
+
async generate() {
|
|
37
|
+
// Extract all variables from routes
|
|
38
|
+
this.extractVariables();
|
|
39
|
+
// Generate collection
|
|
40
|
+
const collection = this.generateCollection();
|
|
41
|
+
// Generate environment
|
|
42
|
+
const environment = this.generateEnvironment();
|
|
43
|
+
// Write files if output paths specified
|
|
44
|
+
if (this.config.output?.collection) {
|
|
45
|
+
this.writeJsonFile(this.config.output.collection, collection);
|
|
46
|
+
}
|
|
47
|
+
if (this.config.output?.environment) {
|
|
48
|
+
this.writeJsonFile(this.config.output.environment, environment);
|
|
49
|
+
}
|
|
50
|
+
return { collection, environment };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Extract variables from all routes and their configurations
|
|
54
|
+
*/
|
|
55
|
+
extractVariables() {
|
|
56
|
+
// Add baseUrl as a variable
|
|
57
|
+
if (this.config.baseUrl) {
|
|
58
|
+
this.collectedVariables.set("baseUrl", {
|
|
59
|
+
key: "baseUrl",
|
|
60
|
+
value: this.config.baseUrl,
|
|
61
|
+
type: "string",
|
|
62
|
+
description: "Base URL for all API requests",
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Recursively extract variables from routes
|
|
66
|
+
this.extractVariablesFromRoutes(this.routes);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Recursively extract variables from Routes instances
|
|
70
|
+
*/
|
|
71
|
+
extractVariablesFromRoutes(routes, parentPath = "") {
|
|
72
|
+
if (routes instanceof Route) {
|
|
73
|
+
// Extract path parameters (e.g., :userId)
|
|
74
|
+
const pathParams = this.extractPathParams(routes.path);
|
|
75
|
+
pathParams.forEach((param) => this.pathVariables.add(param));
|
|
76
|
+
// Extract variables from PostmanRoute config
|
|
77
|
+
if (routes.postman) {
|
|
78
|
+
// Deep scan the entire PostmanRoute configuration object
|
|
79
|
+
this.recursivelyScanForVariables(routes.postman);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else if (routes instanceof Routes) {
|
|
83
|
+
const currentPath = parentPath + routes.prefix;
|
|
84
|
+
// Extract variables from PostmanGroup config
|
|
85
|
+
if (routes.postman) {
|
|
86
|
+
// Deep scan the entire PostmanGroup configuration object
|
|
87
|
+
this.recursivelyScanForVariables(routes.postman);
|
|
88
|
+
}
|
|
89
|
+
// Recursively process child routes
|
|
90
|
+
routes.routes.forEach((childRoute) => {
|
|
91
|
+
this.extractVariablesFromRoutes(childRoute, currentPath);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Recursively scan an object for string values containing {{variable}}
|
|
97
|
+
*/
|
|
98
|
+
recursivelyScanForVariables(obj) {
|
|
99
|
+
if (!obj)
|
|
100
|
+
return;
|
|
101
|
+
if (typeof obj === "string") {
|
|
102
|
+
const variables = this.extractVariablesFromString(obj);
|
|
103
|
+
variables.forEach((varName) => {
|
|
104
|
+
if (!this.collectedVariables.has(varName)) {
|
|
105
|
+
this.collectedVariables.set(varName, {
|
|
106
|
+
key: varName,
|
|
107
|
+
value: "",
|
|
108
|
+
type: "string",
|
|
109
|
+
description: "Extracted from configuration",
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (Array.isArray(obj)) {
|
|
116
|
+
obj.forEach((item) => this.recursivelyScanForVariables(item));
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (typeof obj === "object") {
|
|
120
|
+
// Special handling for PostmanVariable objects to preserve their metadata
|
|
121
|
+
// Check if it looks like a PostmanVariable (has key/id and value)
|
|
122
|
+
const potentialVar = obj;
|
|
123
|
+
if ((potentialVar.key || potentialVar.id) &&
|
|
124
|
+
potentialVar.value !== undefined) {
|
|
125
|
+
const key = potentialVar.key || potentialVar.id;
|
|
126
|
+
if (key && !this.collectedVariables.has(key)) {
|
|
127
|
+
this.collectedVariables.set(key, potentialVar);
|
|
128
|
+
}
|
|
129
|
+
// Continue scanning value just in case it has nested vars (unlikely but possible)
|
|
130
|
+
this.recursivelyScanForVariables(potentialVar.value);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
// Standard object traversal
|
|
134
|
+
Object.values(obj).forEach((value) => this.recursivelyScanForVariables(value));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Extract path parameters from Express-style path
|
|
139
|
+
* Example: /users/:userId/posts/:postId -> ['userId', 'postId']
|
|
140
|
+
*/
|
|
141
|
+
extractPathParams(path) {
|
|
142
|
+
const matches = path.match(/:([a-zA-Z_][a-zA-Z0-9_]*)/g);
|
|
143
|
+
if (!matches)
|
|
144
|
+
return [];
|
|
145
|
+
return matches.map((match) => match.slice(1)); // Remove the ':' prefix
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Extract variable references from strings (e.g., {{authToken}})
|
|
149
|
+
*/
|
|
150
|
+
extractVariablesFromString(str) {
|
|
151
|
+
const matches = str.match(/\{\{([a-zA-Z_][a-zA-Z0-9_]*)\}\}/g);
|
|
152
|
+
if (!matches)
|
|
153
|
+
return [];
|
|
154
|
+
return matches.map((match) => match.slice(2, -2)); // Remove {{ and }}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Generate the Postman Collection
|
|
158
|
+
*/
|
|
159
|
+
generateCollection() {
|
|
160
|
+
const collection = {
|
|
161
|
+
info: {
|
|
162
|
+
name: this.config.name,
|
|
163
|
+
description: this.config.description || "",
|
|
164
|
+
version: this.config.version || "1.0.0",
|
|
165
|
+
schema: SCHEMA_URL,
|
|
166
|
+
},
|
|
167
|
+
item: [],
|
|
168
|
+
};
|
|
169
|
+
// Convert Routes to Postman items
|
|
170
|
+
collection.item = this.convertRoutesToItems(this.routes);
|
|
171
|
+
// Add collection-level variables
|
|
172
|
+
const collectionVars = Array.from(this.collectedVariables.values());
|
|
173
|
+
if (collectionVars.length > 0) {
|
|
174
|
+
collection.variable = collectionVars;
|
|
175
|
+
}
|
|
176
|
+
return collection;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Convert Routes/Route instances to Postman items/folders
|
|
180
|
+
*/
|
|
181
|
+
convertRoutesToItems(routes, parentPrefix = "") {
|
|
182
|
+
const items = [];
|
|
183
|
+
if (routes instanceof Route) {
|
|
184
|
+
routes.path = `${parentPrefix}${routes.path}`;
|
|
185
|
+
// Convert single Route to PostmanItem
|
|
186
|
+
const item = this.convertRouteToItem(routes);
|
|
187
|
+
items.push(item);
|
|
188
|
+
}
|
|
189
|
+
else if (routes instanceof Routes) {
|
|
190
|
+
// Check if this Routes instance should be a folder
|
|
191
|
+
const shouldBeFolder = routes.postman?.folderName || routes.prefix;
|
|
192
|
+
// Process child routes first
|
|
193
|
+
const childItems = [];
|
|
194
|
+
routes.routes.forEach((childRoute) => {
|
|
195
|
+
const children = this.convertRoutesToItems(childRoute, parentPrefix + routes.prefix);
|
|
196
|
+
childItems.push(...children);
|
|
197
|
+
});
|
|
198
|
+
if (shouldBeFolder) {
|
|
199
|
+
// Use PostmanGroup to generate the folder
|
|
200
|
+
if (routes.postman) {
|
|
201
|
+
const folder = routes.postman.toPostmanItemGroup(childItems);
|
|
202
|
+
items.push(folder);
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
// Fallback if no PostmanGroup config but has prefix (shouldn't happen with default init)
|
|
206
|
+
items.push({
|
|
207
|
+
name: routes.prefix || "Routes",
|
|
208
|
+
item: childItems,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
// No folder, just flatten the children
|
|
214
|
+
items.push(...childItems);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return items;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Convert a single Route to a PostmanItem
|
|
221
|
+
*/
|
|
222
|
+
convertRouteToItem(route) {
|
|
223
|
+
const baseUrl = this.config.baseUrl || "{{baseUrl}}";
|
|
224
|
+
// Use PostmanRoute's toPostmanItem if configured
|
|
225
|
+
if (route.postman) {
|
|
226
|
+
return route.postman.toPostmanItem(route, baseUrl);
|
|
227
|
+
}
|
|
228
|
+
// Otherwise, generate a basic item (Fallback)
|
|
229
|
+
const postmanPath = this.convertPathToPostman(route.path);
|
|
230
|
+
const item = {
|
|
231
|
+
name: route.name || `[${route.method}] ${route.path}`,
|
|
232
|
+
request: {
|
|
233
|
+
method: route.method.toUpperCase(),
|
|
234
|
+
header: [],
|
|
235
|
+
url: {
|
|
236
|
+
raw: `${baseUrl}${postmanPath}`,
|
|
237
|
+
host: baseUrl.includes("://") ? [baseUrl] : [baseUrl],
|
|
238
|
+
path: postmanPath.split("/").filter((segment) => segment !== ""),
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
// Add description if available
|
|
243
|
+
if (route.description) {
|
|
244
|
+
item.description = route.description;
|
|
245
|
+
}
|
|
246
|
+
return item;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Convert Express-style path to Postman-style path
|
|
250
|
+
* Example: /users/:userId -> /users/{{userId}}
|
|
251
|
+
*/
|
|
252
|
+
convertPathToPostman(path) {
|
|
253
|
+
return path.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g, "{{$1}}");
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Generate the Postman Environment
|
|
257
|
+
*/
|
|
258
|
+
generateEnvironment() {
|
|
259
|
+
const environment = {
|
|
260
|
+
name: `${this.config.name} - Environment`,
|
|
261
|
+
values: [],
|
|
262
|
+
_postman_variable_scope: "environment",
|
|
263
|
+
_postman_exported_at: new Date().toISOString(),
|
|
264
|
+
_postman_exported_using: "Wecon PostmanGenerator",
|
|
265
|
+
};
|
|
266
|
+
// Add collected variables
|
|
267
|
+
this.collectedVariables.forEach((variable) => {
|
|
268
|
+
environment.values.push({
|
|
269
|
+
key: variable.key || variable.id || "",
|
|
270
|
+
value: String(variable.value || ""),
|
|
271
|
+
type: "default",
|
|
272
|
+
enabled: !variable.disabled,
|
|
273
|
+
description: typeof variable.description === "string"
|
|
274
|
+
? variable.description
|
|
275
|
+
: variable.description?.content,
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
// Add path variables (from :param) with empty values
|
|
279
|
+
this.pathVariables.forEach((paramName) => {
|
|
280
|
+
if (!this.collectedVariables.has(paramName)) {
|
|
281
|
+
environment.values.push({
|
|
282
|
+
key: paramName,
|
|
283
|
+
value: "",
|
|
284
|
+
type: "default",
|
|
285
|
+
enabled: true,
|
|
286
|
+
description: `Path parameter extracted from route`,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
return environment;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Write JSON to file with pretty formatting
|
|
294
|
+
*/
|
|
295
|
+
writeJsonFile(filePath, data) {
|
|
296
|
+
try {
|
|
297
|
+
// Ensure directory exists
|
|
298
|
+
const dir = dirname(filePath);
|
|
299
|
+
mkdirSync(dir, { recursive: true });
|
|
300
|
+
// Write file
|
|
301
|
+
writeFileSync(filePath, JSON.stringify(data, null, 2), "utf-8");
|
|
302
|
+
console.log(`✓ Generated Postman file: ${filePath}`);
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
console.error(`✗ Failed to write Postman file: ${filePath}`, error);
|
|
306
|
+
throw error;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Static helper to generate from Wecon configuration
|
|
311
|
+
*/
|
|
312
|
+
static async generateFromWecon(config, routes) {
|
|
313
|
+
const generator = new PostmanGenerator(config, routes);
|
|
314
|
+
return generator.generate();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
export default PostmanGenerator;
|
|
318
|
+
//# sourceMappingURL=PostmanGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostmanGenerator.js","sourceRoot":"","sources":["../../src/generators/PostmanGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAY1C,uDAAuD;AACvD,MAAM,UAAU,GACd,sEAAsE,CAAC;AAqDzE;;GAEG;AACH,MAAM,gBAAgB;IACZ,MAAM,CAAyB;IAC/B,MAAM,CAAS;IACf,kBAAkB,GAAiC,IAAI,GAAG,EAAE,CAAC;IAC7D,aAAa,GAAgB,IAAI,GAAG,EAAE,CAAC;IAE/C,YAAY,MAA8B,EAAE,MAAc;QACxD,I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AAO,WAAW,CAAC;IACrB,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,QAAgB,EAAE,IAAa;QACnD,IAAI,CAAC;YACH,0BAA0B;YAC1B,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;YAC9B,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAEpC,aAAa;YACb,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,6BAA6B,QAAQ,EAAE,CAAC,CAAC;QACvD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;YACpE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,iBAAiB,CACnC,MAA8B,EAC9B,MAAc;QAKd,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACvD,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;CACF;AAED,eAAe,gBAAgB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,8 +13,11 @@ export { createWinstonLogger, createConsoleLogger, } from "./logger/index.js";
|
|
|
13
13
|
export type { LoggerOptions, WinstonBasedLogger } from "./logger/index.js";
|
|
14
14
|
export { createWecon } from "./server/index.js";
|
|
15
15
|
export type { CreateWeconOptions, WeconApp, ApiError, ApiResponse, RespondOptions, } from "./server/index.js";
|
|
16
|
-
export { Wecon, Route, Routes, RoutesParam, RaiMatcher, ErrorCatcher, } from "./routing/index.js";
|
|
17
|
-
export type { WeconDevConfig, RaiRoutesList } from "./routing/index.js";
|
|
16
|
+
export { Wecon, Route, Routes, RoutesParam, PostmanRoute, PostmanGroup, RaiMatcher, ErrorCatcher, } from "./routing/index.js";
|
|
17
|
+
export type { WeconDevConfig, WeconPostmanConfig, PostmanItem, PostmanItemGroup, RaiRoutesList, } from "./routing/index.js";
|
|
18
|
+
export { default as PostmanGenerator } from "./generators/PostmanGenerator.js";
|
|
19
|
+
export type { PostmanGeneratorConfig } from "./generators/PostmanGenerator.js";
|
|
20
|
+
export type { PostmanDescription, PostmanVersion, PostmanInfo, PostmanAuthAttribute, PostmanAuthType, PostmanAuth, PostmanVariableType, PostmanVariable, PostmanVariableList, PostmanScript, PostmanEvent, PostmanEventList, PostmanProtocolProfileBehavior, PostmanGroupConfig, PostmanRouteConfig, PostmanCollectionConfig, } from "./types/postman.types.js";
|
|
18
21
|
export { ConfigError, RequestError } from "./errors/index.js";
|
|
19
22
|
export { initializeI18n, initI18n, i18nNamespaceMiddleware, getI18n, i18next, I18nLoader, translate, getCurrentLanguage, changeLanguage, } from "./i18n/index.js";
|
|
20
23
|
export type { I18nResources } from "./i18n/index.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGtE,OAAO,EACL,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,EACL,mBAAmB,EACnB,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G3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAG5B,YAAY,EAEV,WAAW,EACX,YAAY,EACZ,GAAG,EACH,WAAW,EACX,aAAa,EACb,cAAc,EACd,iBAAiB,EAGjB,WAAW,EACX,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,EACd,UAAU,EAGV,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EAGX,aAAa,EACb,gBAAgB,EAGhB,YAAY,EACZ,WAAW,EACX,aAAa,EAGb,aAAa,EACb,UAAU,EAGV,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,9 @@ export { createWinstonLogger, createConsoleLogger, } from "./logger/index.js";
|
|
|
17
17
|
// Server
|
|
18
18
|
export { createWecon } from "./server/index.js";
|
|
19
19
|
// Routing
|
|
20
|
-
export { Wecon, Route, Routes, RoutesParam, RaiMatcher, ErrorCatcher, } from "./routing/index.js";
|
|
20
|
+
export { Wecon, Route, Routes, RoutesParam, PostmanRoute, PostmanGroup, RaiMatcher, ErrorCatcher, } from "./routing/index.js";
|
|
21
|
+
// Postman Generator
|
|
22
|
+
export { default as PostmanGenerator } from "./generators/PostmanGenerator.js";
|
|
21
23
|
// Errors
|
|
22
24
|
export { ConfigError, RequestError } from "./errors/index.js";
|
|
23
25
|
// i18n
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtE,gBAAgB;AAChB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,kDAAkD;AAClD,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAG3B,UAAU;AACV,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D,SAAS;AACT,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,SAAS;AACT,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,UAAU;AACV,OAAO,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,WAAW,EACX,UAAU,EACV,YAAY,GACb,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtE,gBAAgB;AAChB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,kDAAkD;AAClD,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAG3B,UAAU;AACV,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D,SAAS;AACT,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,SAAS;AACT,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,UAAU;AACV,OAAO,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,GACb,MAAM,oBAAoB,CAAC;AAS5B,oBAAoB;AACpB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAuB/E,SAAS;AACT,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO;AACP,OAAO,EACL,cAAc,EACd,QAAQ,EACR,uBAAuB,EACvB,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAGzB,WAAW;AACX,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAQ7B,YAAY;AACZ,OAAO,EACL,kBAAkB,EAClB,sBAAsB,IAAI,iCAAiC,EAC3D,wBAAwB,IAAI,mCAAmC,EAC/D,gBAAgB,EAChB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAU3B,WAAW;AACX,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3D,yDAAyD;AACzD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PostmanDescription, PostmanAuth, PostmanVariableList, PostmanEventList, PostmanProtocolProfileBehavior, PostmanGroupConfig } from "../types/postman.types.js";
|
|
2
|
+
import type { PostmanItem } from "./PostmanRoute.js";
|
|
3
|
+
/**
|
|
4
|
+
* Postman Item Group (Folder) structure
|
|
5
|
+
*/
|
|
6
|
+
export interface PostmanItemGroup {
|
|
7
|
+
name: string;
|
|
8
|
+
description?: PostmanDescription;
|
|
9
|
+
item: (PostmanItem | PostmanItemGroup)[];
|
|
10
|
+
auth?: PostmanAuth | null;
|
|
11
|
+
event?: PostmanEventList;
|
|
12
|
+
variable?: PostmanVariableList;
|
|
13
|
+
protocolProfileBehavior?: PostmanProtocolProfileBehavior;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* PostmanGroup
|
|
17
|
+
*
|
|
18
|
+
* Configures how a group of Routes (a folder) is represented in the generated Postman collection.
|
|
19
|
+
* This class handles the creation of Postman Folders (Item Groups).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* new Routes({
|
|
24
|
+
* prefix: '/users',
|
|
25
|
+
* postman: new PostmanGroup({
|
|
26
|
+
* folderName: 'User Management',
|
|
27
|
+
* description: 'Endpoints for managing users',
|
|
28
|
+
* auth: { type: 'bearer', ... }
|
|
29
|
+
* })
|
|
30
|
+
* })
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare class PostmanGroup {
|
|
34
|
+
/** Folder name - the display name for this folder in Postman */
|
|
35
|
+
folderName: string;
|
|
36
|
+
/** Description of the folder/route group */
|
|
37
|
+
description?: PostmanDescription;
|
|
38
|
+
/** Authentication configuration (inherited by child items unless overridden) */
|
|
39
|
+
auth?: PostmanAuth | null;
|
|
40
|
+
/** Variables scoped to this folder */
|
|
41
|
+
variable?: PostmanVariableList;
|
|
42
|
+
/** Pre-request and test scripts for this folder */
|
|
43
|
+
event?: PostmanEventList;
|
|
44
|
+
/** Protocol profile behavior configuration */
|
|
45
|
+
protocolProfileBehavior?: PostmanProtocolProfileBehavior;
|
|
46
|
+
constructor(config: PostmanGroupConfig);
|
|
47
|
+
/**
|
|
48
|
+
* Converts this configuration and a list of child items into a Postman Folder.
|
|
49
|
+
*
|
|
50
|
+
* @param items - The list of child requests (Items) or sub-folders (ItemGroups)
|
|
51
|
+
* @returns A formatted Postman ItemGroup object
|
|
52
|
+
*/
|
|
53
|
+
toPostmanItemGroup(items: (PostmanItem | PostmanItemGroup)[]): PostmanItemGroup;
|
|
54
|
+
}
|
|
55
|
+
export default PostmanGroup;
|
|
56
|
+
//# sourceMappingURL=PostmanG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1
|
+
/**
|
|
2
|
+
* PostmanGroup
|
|
3
|
+
*
|
|
4
|
+
* Configures how a group of Routes (a folder) is represented in the generated Postman collection.
|
|
5
|
+
* This class handles the creation of Postman Folders (Item Groups).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* new Routes({
|
|
10
|
+
* prefix: '/users',
|
|
11
|
+
* postman: new PostmanGroup({
|
|
12
|
+
* folderName: 'User Management',
|
|
13
|
+
* description: 'Endpoints for managing users',
|
|
14
|
+
* auth: { type: 'bearer', ... }
|
|
15
|
+
* })
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
class PostmanGroup {
|
|
20
|
+
/** Folder name - the display name for this folder in Postman */
|
|
21
|
+
folderName;
|
|
22
|
+
/** Description of the folder/route group */
|
|
23
|
+
description;
|
|
24
|
+
/** Authentication configuration (inherited by child items unless overridden) */
|
|
25
|
+
auth;
|
|
26
|
+
/** Variables scoped to this folder */
|
|
27
|
+
variable;
|
|
28
|
+
/** Pre-request and test scripts for this folder */
|
|
29
|
+
event;
|
|
30
|
+
/** Protocol profile behavior configuration */
|
|
31
|
+
protocolProfileBehavior;
|
|
32
|
+
constructor(config) {
|
|
33
|
+
this.folderName = config.folderName;
|
|
34
|
+
this.description = config.description;
|
|
35
|
+
this.auth = config.auth;
|
|
36
|
+
this.variable = config.variable;
|
|
37
|
+
this.event = config.event;
|
|
38
|
+
this.protocolProfileBehavior = config.protocolProfileBehavior;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Converts this configuration and a list of child items into a Postman Folder.
|
|
42
|
+
*
|
|
43
|
+
* @param items - The list of child requests (Items) or sub-folders (ItemGroups)
|
|
44
|
+
* @returns A formatted Postman ItemGroup object
|
|
45
|
+
*/
|
|
46
|
+
toPostmanItemGroup(items) {
|
|
47
|
+
const folder = {
|
|
48
|
+
name: this.folderName,
|
|
49
|
+
item: items,
|
|
50
|
+
};
|
|
51
|
+
if (this.description)
|
|
52
|
+
folder.description = this.description;
|
|
53
|
+
if (this.auth !== undefined)
|
|
54
|
+
folder.auth = this.auth;
|
|
55
|
+
if (this.variable)
|
|
56
|
+
folder.variable = this.variable;
|
|
57
|
+
if (this.event)
|
|
58
|
+
folder.event = this.event;
|
|
59
|
+
if (this.protocolProfileBehavior) {
|
|
60
|
+
folder.protocolProfileBehavior = this.protocolProfileBehavior;
|
|
61
|
+
}
|
|
62
|
+
return folder;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export default PostmanGroup;
|
|
66
|
+
//# sourceMappingURL=PostmanGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostmanGroup.js","sourceRoot":"","sources":["../../src/routing/PostmanGroup.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,YAAY;IAChB,gEAAgE;IAChE,UAAU,CAAS;IAEnB,4CAA4C;IAC5C,WAAW,CAAsB;IAEjC,gFAAgF;IAChF,IAAI,CAAsB;IAE1B,sCAAsC;IACtC,QAAQ,CAAuB;IAE/B,mDAAmD;IACnD,KAAK,CAAoB;IAEzB,8CAA8C;IAC9C,uBAAuB,CAAkC;IAEzD,YAAY,MAA0B;QACpC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,uBAAuB,GAAG,MAAM,CAAC,uBAAuB,CAAC;IAChE,CAAC;IAED;;;;;OAKG;IACI,kBAAkB,CACvB,KAAyC;QAEzC,MAAM,MAAM,GAAqB;YAC/B,IAAI,EAAE,IAAI,CAAC,U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