@lsby/net-core 0.6.0 → 0.6.2
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/bin/gen-api-type/bin.cjs +18 -28
- package/dist/bin/gen-api-type/index.cjs +18 -28
- package/dist/bin/gen-api-type/test.cjs +1 -0
- package/dist/bin/gen-api-type/test.d.cts +2 -0
- package/dist/cjs/bin/gen-api-type/bin.cjs +18 -28
- package/dist/cjs/bin/gen-api-type/index.cjs +18 -28
- package/dist/cjs/bin/gen-api-type/test.cjs +1 -0
- package/dist/cjs/bin/gen-api-type/test.d.cts +2 -0
- package/dist/esm/bin/gen-api-type/bin.js +1 -1
- package/dist/esm/bin/gen-api-type/index.js +1 -1
- package/dist/esm/bin/gen-api-type/test.d.ts +2 -0
- package/dist/esm/bin/gen-api-type/test.js +0 -0
- package/dist/esm/{chunk-D6H6RJRI.js → chunk-M4SW7UWH.js} +18 -28
- package/dist/esm/index.js +6 -6
- package/package.json +1 -1
|
@@ -96,26 +96,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
96
96
|
type jsonErrorOutput = \u83B7\u5F97\u63A5\u53E3\u9519\u8BEF\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
97
97
|
type jsonSuccessOutput = \u83B7\u5F97\u63A5\u53E3\u6B63\u786E\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
98
98
|
type wsData = \u53D6\u7B2C\u4E00\u4E2AWS\u63D2\u4EF6\u7ED3\u679C<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u63D2\u4EF6\u7C7B\u578B<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u7C7B\u578B<typeof \u5BFC\u5165>>>
|
|
99
|
-
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends
|
|
100
|
-
?
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends never
|
|
100
|
+
? never
|
|
101
|
+
: jsonPath extends infer _
|
|
102
|
+
? jsonMethod extends infer _
|
|
103
|
+
? jsonInput extends infer _
|
|
104
|
+
? jsonErrorOutput extends infer _
|
|
105
|
+
? jsonSuccessOutput extends infer _
|
|
106
|
+
? wsData extends infer _
|
|
107
|
+
? {
|
|
108
|
+
path: jsonPath
|
|
109
|
+
method: jsonMethod
|
|
110
|
+
input: jsonInput
|
|
111
|
+
errorOutput: jsonErrorOutput
|
|
112
|
+
successOutput: jsonSuccessOutput
|
|
113
|
+
webSocketData?: wsData
|
|
114
|
+
}
|
|
115
|
+
: never
|
|
113
116
|
: never
|
|
114
117
|
: never
|
|
115
118
|
: never
|
|
116
119
|
: never
|
|
117
120
|
: never
|
|
118
|
-
: never
|
|
119
121
|
|
|
120
122
|
type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
|
|
121
123
|
type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
|
|
@@ -138,7 +140,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
138
140
|
});
|
|
139
141
|
let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
|
|
140
142
|
let JSON\u7ED3\u679C = [];
|
|
141
|
-
let WS\u7ED3\u679C = [];
|
|
142
143
|
let \u5BFC\u51FA\u7C7B\u578B = [];
|
|
143
144
|
for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
|
|
144
145
|
import_typescript.default.forEachChild(\u6E90\u6587\u4EF6, (node) => {
|
|
@@ -151,15 +152,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
151
152
|
import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
152
153
|
)
|
|
153
154
|
);
|
|
154
|
-
} else if (import_typescript.default.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
|
|
155
|
-
let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
|
|
156
|
-
WS\u7ED3\u679C.push(
|
|
157
|
-
\u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
|
|
158
|
-
type,
|
|
159
|
-
void 0,
|
|
160
|
-
import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
161
|
-
)
|
|
162
|
-
);
|
|
163
155
|
}
|
|
164
156
|
});
|
|
165
157
|
let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
|
|
@@ -194,14 +186,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
194
186
|
}
|
|
195
187
|
let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
196
188
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
|
|
197
|
-
let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
198
|
-
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
|
|
199
189
|
let \u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B = Array.from(new Set(\u5BFC\u51FA\u7C7B\u578B.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
200
190
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
|
|
201
191
|
let \u6700\u7EC8\u4EE3\u7801 = [
|
|
192
|
+
// ..
|
|
202
193
|
...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
|
|
203
194
|
`export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
|
|
204
|
-
`export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
|
|
205
195
|
\u9644\u52A0\u4EE3\u7801
|
|
206
196
|
];
|
|
207
197
|
await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
|
|
@@ -101,26 +101,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
101
101
|
type jsonErrorOutput = \u83B7\u5F97\u63A5\u53E3\u9519\u8BEF\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
102
102
|
type jsonSuccessOutput = \u83B7\u5F97\u63A5\u53E3\u6B63\u786E\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
103
103
|
type wsData = \u53D6\u7B2C\u4E00\u4E2AWS\u63D2\u4EF6\u7ED3\u679C<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u63D2\u4EF6\u7C7B\u578B<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u7C7B\u578B<typeof \u5BFC\u5165>>>
|
|
104
|
-
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends
|
|
105
|
-
?
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
104
|
+
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends never
|
|
105
|
+
? never
|
|
106
|
+
: jsonPath extends infer _
|
|
107
|
+
? jsonMethod extends infer _
|
|
108
|
+
? jsonInput extends infer _
|
|
109
|
+
? jsonErrorOutput extends infer _
|
|
110
|
+
? jsonSuccessOutput extends infer _
|
|
111
|
+
? wsData extends infer _
|
|
112
|
+
? {
|
|
113
|
+
path: jsonPath
|
|
114
|
+
method: jsonMethod
|
|
115
|
+
input: jsonInput
|
|
116
|
+
errorOutput: jsonErrorOutput
|
|
117
|
+
successOutput: jsonSuccessOutput
|
|
118
|
+
webSocketData?: wsData
|
|
119
|
+
}
|
|
120
|
+
: never
|
|
118
121
|
: never
|
|
119
122
|
: never
|
|
120
123
|
: never
|
|
121
124
|
: never
|
|
122
125
|
: never
|
|
123
|
-
: never
|
|
124
126
|
|
|
125
127
|
type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
|
|
126
128
|
type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
|
|
@@ -143,7 +145,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
143
145
|
});
|
|
144
146
|
let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
|
|
145
147
|
let JSON\u7ED3\u679C = [];
|
|
146
|
-
let WS\u7ED3\u679C = [];
|
|
147
148
|
let \u5BFC\u51FA\u7C7B\u578B = [];
|
|
148
149
|
for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
|
|
149
150
|
import_typescript.default.forEachChild(\u6E90\u6587\u4EF6, (node) => {
|
|
@@ -156,15 +157,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
156
157
|
import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
157
158
|
)
|
|
158
159
|
);
|
|
159
|
-
} else if (import_typescript.default.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
|
|
160
|
-
let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
|
|
161
|
-
WS\u7ED3\u679C.push(
|
|
162
|
-
\u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
|
|
163
|
-
type,
|
|
164
|
-
void 0,
|
|
165
|
-
import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
166
|
-
)
|
|
167
|
-
);
|
|
168
160
|
}
|
|
169
161
|
});
|
|
170
162
|
let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
|
|
@@ -199,14 +191,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
199
191
|
}
|
|
200
192
|
let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
201
193
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
|
|
202
|
-
let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
203
|
-
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
|
|
204
194
|
let \u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B = Array.from(new Set(\u5BFC\u51FA\u7C7B\u578B.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
205
195
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
|
|
206
196
|
let \u6700\u7EC8\u4EE3\u7801 = [
|
|
197
|
+
// ..
|
|
207
198
|
...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
|
|
208
199
|
`export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
|
|
209
|
-
`export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
|
|
210
200
|
\u9644\u52A0\u4EE3\u7801
|
|
211
201
|
];
|
|
212
202
|
await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -96,26 +96,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
96
96
|
type jsonErrorOutput = \u83B7\u5F97\u63A5\u53E3\u9519\u8BEF\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
97
97
|
type jsonSuccessOutput = \u83B7\u5F97\u63A5\u53E3\u6B63\u786E\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
98
98
|
type wsData = \u53D6\u7B2C\u4E00\u4E2AWS\u63D2\u4EF6\u7ED3\u679C<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u63D2\u4EF6\u7C7B\u578B<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u7C7B\u578B<typeof \u5BFC\u5165>>>
|
|
99
|
-
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends
|
|
100
|
-
?
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends never
|
|
100
|
+
? never
|
|
101
|
+
: jsonPath extends infer _
|
|
102
|
+
? jsonMethod extends infer _
|
|
103
|
+
? jsonInput extends infer _
|
|
104
|
+
? jsonErrorOutput extends infer _
|
|
105
|
+
? jsonSuccessOutput extends infer _
|
|
106
|
+
? wsData extends infer _
|
|
107
|
+
? {
|
|
108
|
+
path: jsonPath
|
|
109
|
+
method: jsonMethod
|
|
110
|
+
input: jsonInput
|
|
111
|
+
errorOutput: jsonErrorOutput
|
|
112
|
+
successOutput: jsonSuccessOutput
|
|
113
|
+
webSocketData?: wsData
|
|
114
|
+
}
|
|
115
|
+
: never
|
|
113
116
|
: never
|
|
114
117
|
: never
|
|
115
118
|
: never
|
|
116
119
|
: never
|
|
117
120
|
: never
|
|
118
|
-
: never
|
|
119
121
|
|
|
120
122
|
type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
|
|
121
123
|
type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
|
|
@@ -138,7 +140,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
138
140
|
});
|
|
139
141
|
let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
|
|
140
142
|
let JSON\u7ED3\u679C = [];
|
|
141
|
-
let WS\u7ED3\u679C = [];
|
|
142
143
|
let \u5BFC\u51FA\u7C7B\u578B = [];
|
|
143
144
|
for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
|
|
144
145
|
import_typescript.default.forEachChild(\u6E90\u6587\u4EF6, (node) => {
|
|
@@ -151,15 +152,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
151
152
|
import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
152
153
|
)
|
|
153
154
|
);
|
|
154
|
-
} else if (import_typescript.default.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
|
|
155
|
-
let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
|
|
156
|
-
WS\u7ED3\u679C.push(
|
|
157
|
-
\u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
|
|
158
|
-
type,
|
|
159
|
-
void 0,
|
|
160
|
-
import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
161
|
-
)
|
|
162
|
-
);
|
|
163
155
|
}
|
|
164
156
|
});
|
|
165
157
|
let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
|
|
@@ -194,14 +186,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
194
186
|
}
|
|
195
187
|
let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
196
188
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
|
|
197
|
-
let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
198
|
-
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
|
|
199
189
|
let \u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B = Array.from(new Set(\u5BFC\u51FA\u7C7B\u578B.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
200
190
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
|
|
201
191
|
let \u6700\u7EC8\u4EE3\u7801 = [
|
|
192
|
+
// ..
|
|
202
193
|
...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
|
|
203
194
|
`export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
|
|
204
|
-
`export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
|
|
205
195
|
\u9644\u52A0\u4EE3\u7801
|
|
206
196
|
];
|
|
207
197
|
await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
|
|
@@ -101,26 +101,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
101
101
|
type jsonErrorOutput = \u83B7\u5F97\u63A5\u53E3\u9519\u8BEF\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
102
102
|
type jsonSuccessOutput = \u83B7\u5F97\u63A5\u53E3\u6B63\u786E\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
103
103
|
type wsData = \u53D6\u7B2C\u4E00\u4E2AWS\u63D2\u4EF6\u7ED3\u679C<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u63D2\u4EF6\u7C7B\u578B<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u7C7B\u578B<typeof \u5BFC\u5165>>>
|
|
104
|
-
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends
|
|
105
|
-
?
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
104
|
+
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends never
|
|
105
|
+
? never
|
|
106
|
+
: jsonPath extends infer _
|
|
107
|
+
? jsonMethod extends infer _
|
|
108
|
+
? jsonInput extends infer _
|
|
109
|
+
? jsonErrorOutput extends infer _
|
|
110
|
+
? jsonSuccessOutput extends infer _
|
|
111
|
+
? wsData extends infer _
|
|
112
|
+
? {
|
|
113
|
+
path: jsonPath
|
|
114
|
+
method: jsonMethod
|
|
115
|
+
input: jsonInput
|
|
116
|
+
errorOutput: jsonErrorOutput
|
|
117
|
+
successOutput: jsonSuccessOutput
|
|
118
|
+
webSocketData?: wsData
|
|
119
|
+
}
|
|
120
|
+
: never
|
|
118
121
|
: never
|
|
119
122
|
: never
|
|
120
123
|
: never
|
|
121
124
|
: never
|
|
122
125
|
: never
|
|
123
|
-
: never
|
|
124
126
|
|
|
125
127
|
type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
|
|
126
128
|
type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
|
|
@@ -143,7 +145,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
143
145
|
});
|
|
144
146
|
let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
|
|
145
147
|
let JSON\u7ED3\u679C = [];
|
|
146
|
-
let WS\u7ED3\u679C = [];
|
|
147
148
|
let \u5BFC\u51FA\u7C7B\u578B = [];
|
|
148
149
|
for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
|
|
149
150
|
import_typescript.default.forEachChild(\u6E90\u6587\u4EF6, (node) => {
|
|
@@ -156,15 +157,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
156
157
|
import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
157
158
|
)
|
|
158
159
|
);
|
|
159
|
-
} else if (import_typescript.default.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
|
|
160
|
-
let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
|
|
161
|
-
WS\u7ED3\u679C.push(
|
|
162
|
-
\u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
|
|
163
|
-
type,
|
|
164
|
-
void 0,
|
|
165
|
-
import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
166
|
-
)
|
|
167
|
-
);
|
|
168
160
|
}
|
|
169
161
|
});
|
|
170
162
|
let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
|
|
@@ -199,14 +191,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
199
191
|
}
|
|
200
192
|
let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
201
193
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
|
|
202
|
-
let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
203
|
-
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
|
|
204
194
|
let \u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B = Array.from(new Set(\u5BFC\u51FA\u7C7B\u578B.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
205
195
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
|
|
206
196
|
let \u6700\u7EC8\u4EE3\u7801 = [
|
|
197
|
+
// ..
|
|
207
198
|
...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
|
|
208
199
|
`export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
|
|
209
|
-
`export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
|
|
210
200
|
\u9644\u52A0\u4EE3\u7801
|
|
211
201
|
];
|
|
212
202
|
await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -66,26 +66,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
66
66
|
type jsonErrorOutput = \u83B7\u5F97\u63A5\u53E3\u9519\u8BEF\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
67
67
|
type jsonSuccessOutput = \u83B7\u5F97\u63A5\u53E3\u6B63\u786E\u5F62\u5F0F<typeof \u5BFC\u5165>
|
|
68
68
|
type wsData = \u53D6\u7B2C\u4E00\u4E2AWS\u63D2\u4EF6\u7ED3\u679C<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u63D2\u4EF6\u7C7B\u578B<\u83B7\u5F97\u63A5\u53E3\u903B\u8F91\u7C7B\u578B<typeof \u5BFC\u5165>>>
|
|
69
|
-
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends
|
|
70
|
-
?
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
69
|
+
type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends never
|
|
70
|
+
? never
|
|
71
|
+
: jsonPath extends infer _
|
|
72
|
+
? jsonMethod extends infer _
|
|
73
|
+
? jsonInput extends infer _
|
|
74
|
+
? jsonErrorOutput extends infer _
|
|
75
|
+
? jsonSuccessOutput extends infer _
|
|
76
|
+
? wsData extends infer _
|
|
77
|
+
? {
|
|
78
|
+
path: jsonPath
|
|
79
|
+
method: jsonMethod
|
|
80
|
+
input: jsonInput
|
|
81
|
+
errorOutput: jsonErrorOutput
|
|
82
|
+
successOutput: jsonSuccessOutput
|
|
83
|
+
webSocketData?: wsData
|
|
84
|
+
}
|
|
85
|
+
: never
|
|
83
86
|
: never
|
|
84
87
|
: never
|
|
85
88
|
: never
|
|
86
89
|
: never
|
|
87
90
|
: never
|
|
88
|
-
: never
|
|
89
91
|
|
|
90
92
|
type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
|
|
91
93
|
type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
|
|
@@ -108,7 +110,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
108
110
|
});
|
|
109
111
|
let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
|
|
110
112
|
let JSON\u7ED3\u679C = [];
|
|
111
|
-
let WS\u7ED3\u679C = [];
|
|
112
113
|
let \u5BFC\u51FA\u7C7B\u578B = [];
|
|
113
114
|
for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
|
|
114
115
|
ts.forEachChild(\u6E90\u6587\u4EF6, (node) => {
|
|
@@ -121,15 +122,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
121
122
|
ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.NoTypeReduction | ts.TypeFormatFlags.AllowUniqueESSymbolType | ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
122
123
|
)
|
|
123
124
|
);
|
|
124
|
-
} else if (ts.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
|
|
125
|
-
let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
|
|
126
|
-
WS\u7ED3\u679C.push(
|
|
127
|
-
\u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
|
|
128
|
-
type,
|
|
129
|
-
void 0,
|
|
130
|
-
ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.NoTypeReduction | ts.TypeFormatFlags.AllowUniqueESSymbolType | ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
|
|
131
|
-
)
|
|
132
|
-
);
|
|
133
125
|
}
|
|
134
126
|
});
|
|
135
127
|
let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
|
|
@@ -164,14 +156,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
|
|
|
164
156
|
}
|
|
165
157
|
let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
166
158
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
|
|
167
|
-
let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
168
|
-
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
|
|
169
159
|
let \u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B = Array.from(new Set(\u5BFC\u51FA\u7C7B\u578B.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
|
|
170
160
|
await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
|
|
171
161
|
let \u6700\u7EC8\u4EE3\u7801 = [
|
|
162
|
+
// ..
|
|
172
163
|
...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
|
|
173
164
|
`export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
|
|
174
|
-
`export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
|
|
175
165
|
\u9644\u52A0\u4EE3\u7801
|
|
176
166
|
];
|
|
177
167
|
await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
JSON解析插件
|
|
3
|
+
} from "./chunk-P6HJULSY.js";
|
|
1
4
|
import {
|
|
2
5
|
表单解析插件
|
|
3
6
|
} from "./chunk-L36NOE2J.js";
|
|
@@ -10,18 +13,15 @@ import {
|
|
|
10
13
|
import {
|
|
11
14
|
自定义数据插件
|
|
12
15
|
} from "./chunk-KCQRJ4JL.js";
|
|
13
|
-
import {
|
|
14
|
-
JSON解析插件
|
|
15
|
-
} from "./chunk-P6HJULSY.js";
|
|
16
16
|
import {
|
|
17
17
|
插件
|
|
18
18
|
} from "./chunk-43GZE5YL.js";
|
|
19
|
-
import {
|
|
20
|
-
EXPORT_TYPE
|
|
21
|
-
} from "./chunk-ZF7EC2OM.js";
|
|
22
19
|
import {
|
|
23
20
|
服务器
|
|
24
21
|
} from "./chunk-JBHOWUYP.js";
|
|
22
|
+
import {
|
|
23
|
+
EXPORT_TYPE
|
|
24
|
+
} from "./chunk-ZF7EC2OM.js";
|
|
25
25
|
import {
|
|
26
26
|
截断字符串,
|
|
27
27
|
递归截断字符串
|