@weconjs/core 1.2.13 → 1.2.15
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/devtools/controllers/modules.controller.d.ts.map +1 -1
- package/dist/devtools/controllers/modules.controller.js +2 -4
- package/dist/devtools/controllers/modules.controller.js.map +1 -1
- package/dist/devtools/types.d.ts +1 -2
- package/dist/devtools/types.d.ts.map +1 -1
- package/dist/generators/PostmanGenerator.d.ts +149 -0
- package/dist/generators/PostmanGenerator.d.ts.map +1 -0
- package/dist/generators/PostmanGenerator.js +345 -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/module.d.ts +3 -4
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +5 -32
- package/dist/module.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 +35 -0
- package/dist/routing/Wecon.d.ts.map +1 -1
- package/dist/routing/Wecon.js +53 -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 +4 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.controller.d.ts","sourceRoot":"","sources":["../../../src/devtools/controllers/modules.controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,aAAa,CAAC;AAEhF;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,IACxC,MAAM,OAAO,EAAE,KAAK,QAAQ,KAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"modules.controller.d.ts","sourceRoot":"","sources":["../../../src/devtools/controllers/modules.controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,aAAa,CAAC;AAEhF;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,IACxC,MAAM,OAAO,EAAE,KAAK,QAAQ,KAAG,IAAI,CAY5C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,eAAe,IACtC,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAAI,CA+C3C"}
|
|
@@ -14,8 +14,7 @@ export function listModules(dtCtx) {
|
|
|
14
14
|
description: mod.description,
|
|
15
15
|
hasConfig: !!mod.config?.schema,
|
|
16
16
|
hasRoutes: !!mod.routes,
|
|
17
|
-
|
|
18
|
-
exports: mod.exports ?? [],
|
|
17
|
+
priority: mod.priority ?? 0,
|
|
19
18
|
}));
|
|
20
19
|
res.json({ success: true, data: summaries });
|
|
21
20
|
};
|
|
@@ -60,8 +59,7 @@ export function getModule(dtCtx) {
|
|
|
60
59
|
description: mod.description,
|
|
61
60
|
hasConfig: !!mod.config?.schema,
|
|
62
61
|
hasRoutes: !!mod.routes,
|
|
63
|
-
|
|
64
|
-
exports: mod.exports ?? [],
|
|
62
|
+
priority: mod.priority ?? 0,
|
|
65
63
|
config: {
|
|
66
64
|
schema: schemaDescription,
|
|
67
65
|
current: currentConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.controller.js","sourceRoot":"","sources":["../../../src/devtools/controllers/modules.controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAsB;IAChD,OAAO,CAAC,IAAa,EAAE,GAAa,EAAQ,EAAE;QAC5C,MAAM,SAAS,GAAoB,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC7D,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM;YAC/B,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM;YACvB,
|
|
1
|
+
{"version":3,"file":"modules.controller.js","sourceRoot":"","sources":["../../../src/devtools/controllers/modules.controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAsB;IAChD,OAAO,CAAC,IAAa,EAAE,GAAa,EAAQ,EAAE;QAC5C,MAAM,SAAS,GAAoB,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC7D,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;Y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,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,YAAY,CAAC;IAClB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB"}
|
|
@@ -0,0 +1,149 @@
|
|
|
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 (stored as {{APP_PUBLIC_ADDRESS}} env variable) */
|
|
27
|
+
baseUrl?: string;
|
|
28
|
+
/** API prefix for all routes (stored as {{API_PREFIX}} env variable) */
|
|
29
|
+
apiPrefix?: string;
|
|
30
|
+
/** API version */
|
|
31
|
+
version?: string;
|
|
32
|
+
/** Output file paths */
|
|
33
|
+
output?: {
|
|
34
|
+
/** Path to save the collection JSON file */
|
|
35
|
+
collection?: string;
|
|
36
|
+
/** Path to save the environment JSON file */
|
|
37
|
+
environment?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Postman Collection v2.1.0 structure
|
|
42
|
+
*/
|
|
43
|
+
interface PostmanCollection {
|
|
44
|
+
info: PostmanInfo;
|
|
45
|
+
item: (PostmanItemGroup | PostmanItem)[];
|
|
46
|
+
auth?: PostmanAuth | null;
|
|
47
|
+
event?: PostmanEventList;
|
|
48
|
+
variable?: PostmanVariableList;
|
|
49
|
+
protocolProfileBehavior?: PostmanProtocolProfileBehavior;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Postman Environment structure
|
|
53
|
+
*/
|
|
54
|
+
interface PostmanEnvironment {
|
|
55
|
+
id?: string;
|
|
56
|
+
name: string;
|
|
57
|
+
values: Array<{
|
|
58
|
+
key: string;
|
|
59
|
+
value: string;
|
|
60
|
+
type?: "default" | "secret";
|
|
61
|
+
enabled?: boolean;
|
|
62
|
+
description?: string;
|
|
63
|
+
}>;
|
|
64
|
+
_postman_variable_scope?: string;
|
|
65
|
+
_postman_exported_at?: string;
|
|
66
|
+
_postman_exported_using?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* PostmanGenerator class
|
|
70
|
+
*/
|
|
71
|
+
declare class PostmanGenerator {
|
|
72
|
+
private config;
|
|
73
|
+
private routes;
|
|
74
|
+
private collectedVariables;
|
|
75
|
+
private pathVariables;
|
|
76
|
+
constructor(config: PostmanGeneratorConfig, routes: Routes);
|
|
77
|
+
/**
|
|
78
|
+
* Generate both collection and environment files
|
|
79
|
+
*/
|
|
80
|
+
generate(): Promise<{
|
|
81
|
+
collection: PostmanCollection;
|
|
82
|
+
environment: PostmanEnvironment;
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Extract variables from all routes and their configurations
|
|
86
|
+
*/
|
|
87
|
+
private extractVariables;
|
|
88
|
+
/**
|
|
89
|
+
* Recursively extract variables from Routes instances
|
|
90
|
+
*/
|
|
91
|
+
private extractVariablesFromRoutes;
|
|
92
|
+
/**
|
|
93
|
+
* Recursively scan an object for string values containing {{variable}}
|
|
94
|
+
*/
|
|
95
|
+
private recursivelyScanForVariables;
|
|
96
|
+
/**
|
|
97
|
+
* Extract path parameters from Express-style path
|
|
98
|
+
* Example: /users/:userId/posts/:postId -> ['userId', 'postId']
|
|
99
|
+
*/
|
|
100
|
+
private extractPathParams;
|
|
101
|
+
/**
|
|
102
|
+
* Extract variable references from strings (e.g., {{authToken}})
|
|
103
|
+
*/
|
|
104
|
+
private extractVariablesFromString;
|
|
105
|
+
/**
|
|
106
|
+
* Generate the Postman Collection
|
|
107
|
+
*/
|
|
108
|
+
private generateCollection;
|
|
109
|
+
/**
|
|
110
|
+
* Convert Routes/Route instances to Postman items/folders
|
|
111
|
+
*/
|
|
112
|
+
private convertRoutesToItems;
|
|
113
|
+
/**
|
|
114
|
+
* Build the Postman base URL using environment variables.
|
|
115
|
+
* Returns e.g. "{{APP_PUBLIC_ADDRESS}}{{API_PREFIX}}" or "{{APP_PUBLIC_ADDRESS}}"
|
|
116
|
+
*/
|
|
117
|
+
private getPostmanBaseUrl;
|
|
118
|
+
/**
|
|
119
|
+
* Strip the literal apiPrefix from the beginning of a route path
|
|
120
|
+
* so it can be replaced by the {{API_PREFIX}} variable.
|
|
121
|
+
*/
|
|
122
|
+
private stripApiPrefix;
|
|
123
|
+
/**
|
|
124
|
+
* Convert a single Route to a PostmanItem
|
|
125
|
+
*/
|
|
126
|
+
private convertRouteToItem;
|
|
127
|
+
/**
|
|
128
|
+
* Convert Express-style path to Postman-style path
|
|
129
|
+
* Example: /users/:userId -> /users/{{userId}}
|
|
130
|
+
*/
|
|
131
|
+
private convertPathToPostman;
|
|
132
|
+
/**
|
|
133
|
+
* Generate the Postman Environment
|
|
134
|
+
*/
|
|
135
|
+
private generateEnvironment;
|
|
136
|
+
/**
|
|
137
|
+
* Write JSON to file with pretty formatting
|
|
138
|
+
*/
|
|
139
|
+
private writeJsonFile;
|
|
140
|
+
/**
|
|
141
|
+
* Static helper to generate from Wecon configuration
|
|
142
|
+
*/
|
|
143
|
+
static generateFromWecon(config: PostmanGeneratorConfig, routes: Routes): Promise<{
|
|
144
|
+
collection: PostmanCollection;
|
|
145
|
+
environment: PostmanEnvironment;
|
|
146
|
+
}>;
|
|
147
|
+
}
|
|
148
|
+
export default PostmanGenerator;
|
|
149
|
+
//# 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;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAMnE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,MAAM,CAAC,EAAE;QACP,4CAA4C;QAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,6CAA6C;QAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AA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AAC,iBAAiB;IAMzB;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAMlC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAiB1B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA8C5B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAOtB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAqC1B;;;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,345 @@
|
|
|
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 APP_PUBLIC_ADDRESS as an environment variable
|
|
57
|
+
this.collectedVariables.set("APP_PUBLIC_ADDRESS", {
|
|
58
|
+
key: "APP_PUBLIC_ADDRESS",
|
|
59
|
+
value: this.config.baseUrl || "http://localhost:3000",
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "Public address of the application",
|
|
62
|
+
});
|
|
63
|
+
// Add API_PREFIX as an environment variable
|
|
64
|
+
if (this.config.apiPrefix) {
|
|
65
|
+
this.collectedVariables.set("API_PREFIX", {
|
|
66
|
+
key: "API_PREFIX",
|
|
67
|
+
value: this.config.apiPrefix,
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "API route prefix",
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
// Recursively extract variables from routes
|
|
73
|
+
this.extractVariablesFromRoutes(this.routes);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Recursively extract variables from Routes instances
|
|
77
|
+
*/
|
|
78
|
+
extractVariablesFromRoutes(routes, parentPath = "") {
|
|
79
|
+
if (routes instanceof Route) {
|
|
80
|
+
// Extract path parameters (e.g., :userId)
|
|
81
|
+
const pathParams = this.extractPathParams(routes.path);
|
|
82
|
+
pathParams.forEach((param) => this.pathVariables.add(param));
|
|
83
|
+
// Extract variables from PostmanRoute config
|
|
84
|
+
if (routes.postman) {
|
|
85
|
+
// Deep scan the entire PostmanRoute configuration object
|
|
86
|
+
this.recursivelyScanForVariables(routes.postman);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (routes instanceof Routes) {
|
|
90
|
+
const currentPath = parentPath + routes.prefix;
|
|
91
|
+
// Extract variables from PostmanGroup config
|
|
92
|
+
if (routes.postman) {
|
|
93
|
+
// Deep scan the entire PostmanGroup configuration object
|
|
94
|
+
this.recursivelyScanForVariables(routes.postman);
|
|
95
|
+
}
|
|
96
|
+
// Recursively process child routes
|
|
97
|
+
routes.routes.forEach((childRoute) => {
|
|
98
|
+
this.extractVariablesFromRoutes(childRoute, currentPath);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Recursively scan an object for string values containing {{variable}}
|
|
104
|
+
*/
|
|
105
|
+
recursivelyScanForVariables(obj) {
|
|
106
|
+
if (!obj)
|
|
107
|
+
return;
|
|
108
|
+
if (typeof obj === "string") {
|
|
109
|
+
const variables = this.extractVariablesFromString(obj);
|
|
110
|
+
variables.forEach((varName) => {
|
|
111
|
+
if (!this.collectedVariables.has(varName)) {
|
|
112
|
+
this.collectedVariables.set(varName, {
|
|
113
|
+
key: varName,
|
|
114
|
+
value: "",
|
|
115
|
+
type: "string",
|
|
116
|
+
description: "Extracted from configuration",
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (Array.isArray(obj)) {
|
|
123
|
+
obj.forEach((item) => this.recursivelyScanForVariables(item));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (typeof obj === "object") {
|
|
127
|
+
// Special handling for PostmanVariable objects to preserve their metadata
|
|
128
|
+
// Check if it looks like a PostmanVariable (has key/id and value)
|
|
129
|
+
const potentialVar = obj;
|
|
130
|
+
if ((potentialVar.key || potentialVar.id) &&
|
|
131
|
+
potentialVar.value !== undefined) {
|
|
132
|
+
const key = potentialVar.key || potentialVar.id;
|
|
133
|
+
if (key && !this.collectedVariables.has(key)) {
|
|
134
|
+
this.collectedVariables.set(key, potentialVar);
|
|
135
|
+
}
|
|
136
|
+
// Continue scanning value just in case it has nested vars (unlikely but possible)
|
|
137
|
+
this.recursivelyScanForVariables(potentialVar.value);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
// Standard object traversal
|
|
141
|
+
Object.values(obj).forEach((value) => this.recursivelyScanForVariables(value));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Extract path parameters from Express-style path
|
|
146
|
+
* Example: /users/:userId/posts/:postId -> ['userId', 'postId']
|
|
147
|
+
*/
|
|
148
|
+
extractPathParams(path) {
|
|
149
|
+
const matches = path.match(/:([a-zA-Z_][a-zA-Z0-9_]*)/g);
|
|
150
|
+
if (!matches)
|
|
151
|
+
return [];
|
|
152
|
+
return matches.map((match) => match.slice(1)); // Remove the ':' prefix
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Extract variable references from strings (e.g., {{authToken}})
|
|
156
|
+
*/
|
|
157
|
+
extractVariablesFromString(str) {
|
|
158
|
+
const matches = str.match(/\{\{([a-zA-Z_][a-zA-Z0-9_]*)\}\}/g);
|
|
159
|
+
if (!matches)
|
|
160
|
+
return [];
|
|
161
|
+
return matches.map((match) => match.slice(2, -2)); // Remove {{ and }}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Generate the Postman Collection
|
|
165
|
+
*/
|
|
166
|
+
generateCollection() {
|
|
167
|
+
const collection = {
|
|
168
|
+
info: {
|
|
169
|
+
name: this.config.name,
|
|
170
|
+
description: this.config.description || "",
|
|
171
|
+
version: this.config.version || "1.0.0",
|
|
172
|
+
schema: SCHEMA_URL,
|
|
173
|
+
},
|
|
174
|
+
item: [],
|
|
175
|
+
};
|
|
176
|
+
// Convert Routes to Postman items
|
|
177
|
+
collection.item = this.convertRoutesToItems(this.routes);
|
|
178
|
+
return collection;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Convert Routes/Route instances to Postman items/folders
|
|
182
|
+
*/
|
|
183
|
+
convertRoutesToItems(routes, parentPrefix = "") {
|
|
184
|
+
const items = [];
|
|
185
|
+
if (routes instanceof Route) {
|
|
186
|
+
routes.path = `${parentPrefix}${routes.path}`;
|
|
187
|
+
// Convert single Route to PostmanItem
|
|
188
|
+
const item = this.convertRouteToItem(routes);
|
|
189
|
+
items.push(item);
|
|
190
|
+
}
|
|
191
|
+
else if (routes instanceof Routes) {
|
|
192
|
+
// Check if this Routes instance should be a folder
|
|
193
|
+
const shouldBeFolder = routes.postman?.folderName || routes.prefix;
|
|
194
|
+
// Process child routes first
|
|
195
|
+
const childItems = [];
|
|
196
|
+
routes.routes.forEach((childRoute) => {
|
|
197
|
+
const children = this.convertRoutesToItems(childRoute, parentPrefix + routes.prefix);
|
|
198
|
+
childItems.push(...children);
|
|
199
|
+
});
|
|
200
|
+
if (shouldBeFolder) {
|
|
201
|
+
// Use PostmanGroup to generate the folder
|
|
202
|
+
if (routes.postman) {
|
|
203
|
+
const folder = routes.postman.toPostmanItemGroup(childItems);
|
|
204
|
+
items.push(folder);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
// Fallback if no PostmanGroup config but has prefix (shouldn't happen with default init)
|
|
208
|
+
items.push({
|
|
209
|
+
name: routes.prefix || "Routes",
|
|
210
|
+
item: childItems,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
// No folder, just flatten the children
|
|
216
|
+
items.push(...childItems);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return items;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Build the Postman base URL using environment variables.
|
|
223
|
+
* Returns e.g. "{{APP_PUBLIC_ADDRESS}}{{API_PREFIX}}" or "{{APP_PUBLIC_ADDRESS}}"
|
|
224
|
+
*/
|
|
225
|
+
getPostmanBaseUrl() {
|
|
226
|
+
let base = "{{APP_PUBLIC_ADDRESS}}";
|
|
227
|
+
if (this.config.apiPrefix) {
|
|
228
|
+
base += "{{API_PREFIX}}";
|
|
229
|
+
}
|
|
230
|
+
return base;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Strip the literal apiPrefix from the beginning of a route path
|
|
234
|
+
* so it can be replaced by the {{API_PREFIX}} variable.
|
|
235
|
+
*/
|
|
236
|
+
stripApiPrefix(path) {
|
|
237
|
+
if (this.config.apiPrefix && path.startsWith(this.config.apiPrefix)) {
|
|
238
|
+
return path.slice(this.config.apiPrefix.length);
|
|
239
|
+
}
|
|
240
|
+
return path;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Convert a single Route to a PostmanItem
|
|
244
|
+
*/
|
|
245
|
+
convertRouteToItem(route) {
|
|
246
|
+
const baseUrl = this.getPostmanBaseUrl();
|
|
247
|
+
// Strip the literal apiPrefix from the route path
|
|
248
|
+
const strippedPath = this.stripApiPrefix(route.path);
|
|
249
|
+
// Use PostmanRoute's toPostmanItem if configured
|
|
250
|
+
if (route.postman) {
|
|
251
|
+
// Pass route with stripped path
|
|
252
|
+
const routeForPostman = { ...route, path: strippedPath };
|
|
253
|
+
return route.postman.toPostmanItem(routeForPostman, baseUrl);
|
|
254
|
+
}
|
|
255
|
+
// Otherwise, generate a basic item (Fallback)
|
|
256
|
+
const postmanPath = this.convertPathToPostman(strippedPath);
|
|
257
|
+
const item = {
|
|
258
|
+
name: route.name || `[${route.method}] ${route.path}`,
|
|
259
|
+
request: {
|
|
260
|
+
method: route.method.toUpperCase(),
|
|
261
|
+
header: [],
|
|
262
|
+
url: {
|
|
263
|
+
raw: `${baseUrl}${postmanPath}`,
|
|
264
|
+
host: [baseUrl],
|
|
265
|
+
path: postmanPath.split("/").filter((segment) => segment !== ""),
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
// Add description if available
|
|
270
|
+
if (route.description) {
|
|
271
|
+
item.description = route.description;
|
|
272
|
+
}
|
|
273
|
+
return item;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Convert Express-style path to Postman-style path
|
|
277
|
+
* Example: /users/:userId -> /users/{{userId}}
|
|
278
|
+
*/
|
|
279
|
+
convertPathToPostman(path) {
|
|
280
|
+
return path.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g, "{{$1}}");
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Generate the Postman Environment
|
|
284
|
+
*/
|
|
285
|
+
generateEnvironment() {
|
|
286
|
+
const environment = {
|
|
287
|
+
name: `${this.config.name} - Environment`,
|
|
288
|
+
values: [],
|
|
289
|
+
_postman_variable_scope: "environment",
|
|
290
|
+
_postman_exported_at: new Date().toISOString(),
|
|
291
|
+
_postman_exported_using: "Wecon PostmanGenerator",
|
|
292
|
+
};
|
|
293
|
+
// Add collected variables
|
|
294
|
+
this.collectedVariables.forEach((variable) => {
|
|
295
|
+
environment.values.push({
|
|
296
|
+
key: variable.key || variable.id || "",
|
|
297
|
+
value: String(variable.value || ""),
|
|
298
|
+
type: "default",
|
|
299
|
+
enabled: !variable.disabled,
|
|
300
|
+
description: typeof variable.description === "string"
|
|
301
|
+
? variable.description
|
|
302
|
+
: variable.description?.content,
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
// Add path variables (from :param) with empty values
|
|
306
|
+
this.pathVariables.forEach((paramName) => {
|
|
307
|
+
if (!this.collectedVariables.has(paramName)) {
|
|
308
|
+
environment.values.push({
|
|
309
|
+
key: paramName,
|
|
310
|
+
value: "",
|
|
311
|
+
type: "default",
|
|
312
|
+
enabled: true,
|
|
313
|
+
description: `Path parameter extracted from route`,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
return environment;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Write JSON to file with pretty formatting
|
|
321
|
+
*/
|
|
322
|
+
writeJsonFile(filePath, data) {
|
|
323
|
+
try {
|
|
324
|
+
// Ensure directory exists
|
|
325
|
+
const dir = dirname(filePath);
|
|
326
|
+
mkdirSync(dir, { recursive: true });
|
|
327
|
+
// Write file
|
|
328
|
+
writeFileSync(filePath, JSON.stringify(data, null, 2), "utf-8");
|
|
329
|
+
console.log(`✓ Generated Postman file: ${filePath}`);
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
console.error(`✗ Failed to write Postman file: ${filePath}`, error);
|
|
333
|
+
throw error;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Static helper to generate from Wecon configuration
|
|
338
|
+
*/
|
|
339
|
+
static async generateFromWecon(config, routes) {
|
|
340
|
+
const generator = new PostmanGenerator(config, routes);
|
|
341
|
+
return generator.generate();
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
export default PostmanGenerator;
|
|
345
|
+
//# 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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,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,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EACV,kBAAkB,EAClB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,KAAK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Ac,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,E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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"}
|
package/dist/module.d.ts
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* name: 'auth',
|
|
15
15
|
* config: authConfig,
|
|
16
16
|
* routes: authRoutes,
|
|
17
|
-
*
|
|
18
|
-
* exports: ['AuthService', 'JwtService'],
|
|
17
|
+
* priority: 1,
|
|
19
18
|
* onInit: async (ctx) => {
|
|
20
19
|
* ctx.logger.info('Auth module initialized');
|
|
21
20
|
* },
|
|
@@ -59,10 +58,10 @@ export declare function discoverSocketMiddleware(modulePath: string): Promise<So
|
|
|
59
58
|
*/
|
|
60
59
|
export declare function loadModule(modulePath: string, baseDir: string): Promise<WeconModule>;
|
|
61
60
|
/**
|
|
62
|
-
* Resolve module
|
|
61
|
+
* Resolve module load order by priority (lower numbers load first)
|
|
63
62
|
*
|
|
64
63
|
* @param modules - Map of module name to module
|
|
65
|
-
* @returns Ordered array of modules
|
|
64
|
+
* @returns Ordered array of modules sorted by priority ascending
|
|
66
65
|
*/
|
|
67
66
|
export declare function resolveModuleDependencies(modules: Map<string, WeconModule>): WeconModule[];
|
|
68
67
|
/**
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA6BpB;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,gBAAgB,GAAG,WAAW,CAgCtE;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,EAAE,CAAC,CAmCrD;AAED;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA8B7B;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC,CA+CtB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAChC,WAAW,EAAE,CAIf;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GACnD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqBlC"}
|