@lsby/net-core 0.5.2 → 0.6.1

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.
@@ -95,37 +95,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
95
95
  type jsonInput = \u5408\u5E76JSON\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>>>
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
+ 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>>>
98
99
  type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends infer _
99
100
  ? jsonMethod extends infer _
100
101
  ? jsonInput extends infer _
101
102
  ? jsonErrorOutput extends infer _
102
103
  ? jsonSuccessOutput extends infer _
103
- ? {
104
- path: jsonPath
105
- method: jsonMethod
106
- input: jsonInput
107
- errorOutput: jsonErrorOutput
108
- successOutput: jsonSuccessOutput
109
- }
104
+ ? wsData extends infer _
105
+ ? {
106
+ path: jsonPath
107
+ method: jsonMethod
108
+ input: jsonInput
109
+ errorOutput: jsonErrorOutput
110
+ successOutput: jsonSuccessOutput
111
+ webSocketData: wsData
112
+ }
113
+ : never
110
114
  : never
111
115
  : never
112
116
  : never
113
117
  : never
114
118
  : never
115
119
 
116
- type wsPath = \u83B7\u5F97\u63A5\u53E3\u8DEF\u5F84\u7C7B\u578B<typeof \u5BFC\u5165>
117
- 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>>>
118
- type WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = wsPath extends infer _
119
- ? wsData extends infer _
120
- ? wsData extends Record<string, never>
121
- ? never
122
- : {
123
- path: wsPath
124
- data: wsData
125
- }
126
- : never
127
- : never
128
-
129
120
  type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
130
121
  type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
131
122
  `;
@@ -147,7 +138,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
147
138
  });
148
139
  let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
149
140
  let JSON\u7ED3\u679C = [];
150
- let WS\u7ED3\u679C = [];
151
141
  let \u5BFC\u51FA\u7C7B\u578B = [];
152
142
  for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
153
143
  import_typescript.default.forEachChild(\u6E90\u6587\u4EF6, (node) => {
@@ -160,15 +150,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
160
150
  import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
161
151
  )
162
152
  );
163
- } else if (import_typescript.default.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
164
- let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
165
- WS\u7ED3\u679C.push(
166
- \u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
167
- type,
168
- void 0,
169
- import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
170
- )
171
- );
172
153
  }
173
154
  });
174
155
  let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
@@ -203,14 +184,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
203
184
  }
204
185
  let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
205
186
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
206
- let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
207
- await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
208
187
  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")));
209
188
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
210
189
  let \u6700\u7EC8\u4EE3\u7801 = [
190
+ // ..
211
191
  ...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
212
192
  `export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
213
- `export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
214
193
  \u9644\u52A0\u4EE3\u7801
215
194
  ];
216
195
  await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
@@ -100,37 +100,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
100
100
  type jsonInput = \u5408\u5E76JSON\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>>>
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
+ 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>>>
103
104
  type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends infer _
104
105
  ? jsonMethod extends infer _
105
106
  ? jsonInput extends infer _
106
107
  ? jsonErrorOutput extends infer _
107
108
  ? jsonSuccessOutput extends infer _
108
- ? {
109
- path: jsonPath
110
- method: jsonMethod
111
- input: jsonInput
112
- errorOutput: jsonErrorOutput
113
- successOutput: jsonSuccessOutput
114
- }
109
+ ? wsData extends infer _
110
+ ? {
111
+ path: jsonPath
112
+ method: jsonMethod
113
+ input: jsonInput
114
+ errorOutput: jsonErrorOutput
115
+ successOutput: jsonSuccessOutput
116
+ webSocketData: wsData
117
+ }
118
+ : never
115
119
  : never
116
120
  : never
117
121
  : never
118
122
  : never
119
123
  : never
120
124
 
121
- type wsPath = \u83B7\u5F97\u63A5\u53E3\u8DEF\u5F84\u7C7B\u578B<typeof \u5BFC\u5165>
122
- 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>>>
123
- type WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = wsPath extends infer _
124
- ? wsData extends infer _
125
- ? wsData extends Record<string, never>
126
- ? never
127
- : {
128
- path: wsPath
129
- data: wsData
130
- }
131
- : never
132
- : never
133
-
134
125
  type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
135
126
  type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
136
127
  `;
@@ -152,7 +143,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
152
143
  });
153
144
  let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
154
145
  let JSON\u7ED3\u679C = [];
155
- let WS\u7ED3\u679C = [];
156
146
  let \u5BFC\u51FA\u7C7B\u578B = [];
157
147
  for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
158
148
  import_typescript.default.forEachChild(\u6E90\u6587\u4EF6, (node) => {
@@ -165,15 +155,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
165
155
  import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
166
156
  )
167
157
  );
168
- } else if (import_typescript.default.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
169
- let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
170
- WS\u7ED3\u679C.push(
171
- \u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
172
- type,
173
- void 0,
174
- import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
175
- )
176
- );
177
158
  }
178
159
  });
179
160
  let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
@@ -208,14 +189,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
208
189
  }
209
190
  let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
210
191
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
211
- let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
212
- await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
213
192
  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")));
214
193
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
215
194
  let \u6700\u7EC8\u4EE3\u7801 = [
195
+ // ..
216
196
  ...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
217
197
  `export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
218
- `export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
219
198
  \u9644\u52A0\u4EE3\u7801
220
199
  ];
221
200
  await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
@@ -95,37 +95,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
95
95
  type jsonInput = \u5408\u5E76JSON\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>>>
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
+ 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>>>
98
99
  type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends infer _
99
100
  ? jsonMethod extends infer _
100
101
  ? jsonInput extends infer _
101
102
  ? jsonErrorOutput extends infer _
102
103
  ? jsonSuccessOutput extends infer _
103
- ? {
104
- path: jsonPath
105
- method: jsonMethod
106
- input: jsonInput
107
- errorOutput: jsonErrorOutput
108
- successOutput: jsonSuccessOutput
109
- }
104
+ ? wsData extends infer _
105
+ ? {
106
+ path: jsonPath
107
+ method: jsonMethod
108
+ input: jsonInput
109
+ errorOutput: jsonErrorOutput
110
+ successOutput: jsonSuccessOutput
111
+ webSocketData: wsData
112
+ }
113
+ : never
110
114
  : never
111
115
  : never
112
116
  : never
113
117
  : never
114
118
  : never
115
119
 
116
- type wsPath = \u83B7\u5F97\u63A5\u53E3\u8DEF\u5F84\u7C7B\u578B<typeof \u5BFC\u5165>
117
- 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>>>
118
- type WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = wsPath extends infer _
119
- ? wsData extends infer _
120
- ? wsData extends Record<string, never>
121
- ? never
122
- : {
123
- path: wsPath
124
- data: wsData
125
- }
126
- : never
127
- : never
128
-
129
120
  type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
130
121
  type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
131
122
  `;
@@ -147,7 +138,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
147
138
  });
148
139
  let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
149
140
  let JSON\u7ED3\u679C = [];
150
- let WS\u7ED3\u679C = [];
151
141
  let \u5BFC\u51FA\u7C7B\u578B = [];
152
142
  for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
153
143
  import_typescript.default.forEachChild(\u6E90\u6587\u4EF6, (node) => {
@@ -160,15 +150,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
160
150
  import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
161
151
  )
162
152
  );
163
- } else if (import_typescript.default.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
164
- let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
165
- WS\u7ED3\u679C.push(
166
- \u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
167
- type,
168
- void 0,
169
- import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
170
- )
171
- );
172
153
  }
173
154
  });
174
155
  let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
@@ -203,14 +184,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
203
184
  }
204
185
  let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
205
186
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
206
- let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
207
- await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
208
187
  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")));
209
188
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
210
189
  let \u6700\u7EC8\u4EE3\u7801 = [
190
+ // ..
211
191
  ...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
212
192
  `export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
213
- `export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
214
193
  \u9644\u52A0\u4EE3\u7801
215
194
  ];
216
195
  await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
@@ -100,37 +100,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
100
100
  type jsonInput = \u5408\u5E76JSON\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>>>
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
+ 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>>>
103
104
  type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends infer _
104
105
  ? jsonMethod extends infer _
105
106
  ? jsonInput extends infer _
106
107
  ? jsonErrorOutput extends infer _
107
108
  ? jsonSuccessOutput extends infer _
108
- ? {
109
- path: jsonPath
110
- method: jsonMethod
111
- input: jsonInput
112
- errorOutput: jsonErrorOutput
113
- successOutput: jsonSuccessOutput
114
- }
109
+ ? wsData extends infer _
110
+ ? {
111
+ path: jsonPath
112
+ method: jsonMethod
113
+ input: jsonInput
114
+ errorOutput: jsonErrorOutput
115
+ successOutput: jsonSuccessOutput
116
+ webSocketData: wsData
117
+ }
118
+ : never
115
119
  : never
116
120
  : never
117
121
  : never
118
122
  : never
119
123
  : never
120
124
 
121
- type wsPath = \u83B7\u5F97\u63A5\u53E3\u8DEF\u5F84\u7C7B\u578B<typeof \u5BFC\u5165>
122
- 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>>>
123
- type WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = wsPath extends infer _
124
- ? wsData extends infer _
125
- ? wsData extends Record<string, never>
126
- ? never
127
- : {
128
- path: wsPath
129
- data: wsData
130
- }
131
- : never
132
- : never
133
-
134
125
  type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
135
126
  type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
136
127
  `;
@@ -152,7 +143,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
152
143
  });
153
144
  let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
154
145
  let JSON\u7ED3\u679C = [];
155
- let WS\u7ED3\u679C = [];
156
146
  let \u5BFC\u51FA\u7C7B\u578B = [];
157
147
  for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
158
148
  import_typescript.default.forEachChild(\u6E90\u6587\u4EF6, (node) => {
@@ -165,15 +155,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
165
155
  import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
166
156
  )
167
157
  );
168
- } else if (import_typescript.default.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
169
- let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
170
- WS\u7ED3\u679C.push(
171
- \u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
172
- type,
173
- void 0,
174
- import_typescript.default.TypeFormatFlags.NoTruncation | import_typescript.default.TypeFormatFlags.NoTypeReduction | import_typescript.default.TypeFormatFlags.AllowUniqueESSymbolType | import_typescript.default.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
175
- )
176
- );
177
158
  }
178
159
  });
179
160
  let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
@@ -208,14 +189,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
208
189
  }
209
190
  let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
210
191
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
211
- let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
212
- await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
213
192
  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")));
214
193
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
215
194
  let \u6700\u7EC8\u4EE3\u7801 = [
195
+ // ..
216
196
  ...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
217
197
  `export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
218
- `export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
219
198
  \u9644\u52A0\u4EE3\u7801
220
199
  ];
221
200
  await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../../chunk-YRXFPMG3.js";
4
+ } from "../../chunk-OZRCGUR6.js";
5
5
  import "../../chunk-JVDSGTFS.js";
6
6
 
7
7
  // src/bin/gen-api-type/bin.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  main
3
- } from "../../chunk-YRXFPMG3.js";
3
+ } from "../../chunk-OZRCGUR6.js";
4
4
  import "../../chunk-JVDSGTFS.js";
5
5
  export {
6
6
  main
@@ -65,37 +65,28 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
65
65
  type jsonInput = \u5408\u5E76JSON\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>>>
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
+ 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>>>
68
69
  type JSON\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = jsonPath extends infer _
69
70
  ? jsonMethod extends infer _
70
71
  ? jsonInput extends infer _
71
72
  ? jsonErrorOutput extends infer _
72
73
  ? jsonSuccessOutput extends infer _
73
- ? {
74
- path: jsonPath
75
- method: jsonMethod
76
- input: jsonInput
77
- errorOutput: jsonErrorOutput
78
- successOutput: jsonSuccessOutput
79
- }
74
+ ? wsData extends infer _
75
+ ? {
76
+ path: jsonPath
77
+ method: jsonMethod
78
+ input: jsonInput
79
+ errorOutput: jsonErrorOutput
80
+ successOutput: jsonSuccessOutput
81
+ webSocketData: wsData
82
+ }
83
+ : never
80
84
  : never
81
85
  : never
82
86
  : never
83
87
  : never
84
88
  : never
85
89
 
86
- type wsPath = \u83B7\u5F97\u63A5\u53E3\u8DEF\u5F84\u7C7B\u578B<typeof \u5BFC\u5165>
87
- 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>>>
88
- type WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C = wsPath extends infer _
89
- ? wsData extends infer _
90
- ? wsData extends Record<string, never>
91
- ? never
92
- : {
93
- path: wsPath
94
- data: wsData
95
- }
96
- : never
97
- : never
98
-
99
90
  type \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = GetNetCoreExportTypeName<\u5BFC\u5165>
100
91
  type \u5BFC\u51FA\u7C7B\u578B\u5B9A\u4E49 = GetNetCoreExportTypeDefine<\u5BFC\u5165>
101
92
  `;
@@ -117,7 +108,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
117
108
  });
118
109
  let \u7C7B\u578B\u68C0\u67E5\u5668 = \u65B0\u9879\u76EE.getTypeChecker();
119
110
  let JSON\u7ED3\u679C = [];
120
- let WS\u7ED3\u679C = [];
121
111
  let \u5BFC\u51FA\u7C7B\u578B = [];
122
112
  for (let \u6E90\u6587\u4EF6 of \u4F34\u968F\u7684\u865A\u62DF\u6587\u4EF6\u4EEC) {
123
113
  ts.forEachChild(\u6E90\u6587\u4EF6, (node) => {
@@ -130,15 +120,6 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
130
120
  ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.NoTypeReduction | ts.TypeFormatFlags.AllowUniqueESSymbolType | ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
131
121
  )
132
122
  );
133
- } else if (ts.isTypeAliasDeclaration(node) && node.name.text === "WS\u63A5\u53E3\u8BA1\u7B97\u7ED3\u679C") {
134
- let type = \u7C7B\u578B\u68C0\u67E5\u5668.getTypeAtLocation(node);
135
- WS\u7ED3\u679C.push(
136
- \u7C7B\u578B\u68C0\u67E5\u5668.typeToString(
137
- type,
138
- void 0,
139
- ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.NoTypeReduction | ts.TypeFormatFlags.AllowUniqueESSymbolType | ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope
140
- )
141
- );
142
123
  }
143
124
  });
144
125
  let \u5BFC\u51FA\u7C7B\u578B\u540D\u79F0 = void 0;
@@ -173,14 +154,12 @@ async function main(tsconfig\u8DEF\u5F84, \u76EE\u6807\u8DEF\u5F84, \u8F93\u51FA
173
154
  }
174
155
  let \u6700\u7EC8\u7ED3\u679C_JSON = Array.from(new Set(JSON\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
175
156
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_JSON.length} \u4E2Ajson\u63A5\u53E3\u7C7B\u578B`);
176
- let \u6700\u7EC8\u7ED3\u679C_WS = Array.from(new Set(WS\u7ED3\u679C.filter((a) => a !== "any" && a !== "never" && a !== "unknown")));
177
- await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_WS.length} \u4E2Aws\u63A5\u53E3\u7C7B\u578B`);
178
157
  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")));
179
158
  await log.debug(`\u6700\u7EC8\u7B5B\u9009\u51FA ${\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B.length} \u4E2A\u5BFC\u51FA\u7C7B\u578B`);
180
159
  let \u6700\u7EC8\u4EE3\u7801 = [
160
+ // ..
181
161
  ...\u6700\u7EC8\u7ED3\u679C_\u5BFC\u51FA\u7C7B\u578B,
182
162
  `export type InterfaceType = [${\u6700\u7EC8\u7ED3\u679C_JSON.join(",")}]`,
183
- `export type InterfaceWsType = [${\u6700\u7EC8\u7ED3\u679C_WS.join(",")}]`,
184
163
  \u9644\u52A0\u4EE3\u7801
185
164
  ];
186
165
  await log.debug("\u6700\u7EC8\u4EE3\u7801\u751F\u6210\u5B8C\u6210");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsby/net-core",
3
- "version": "0.5.2",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "require": "./dist/cjs/index.cjs",