@lsby/net-core 0.3.2 → 0.3.3

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.
@@ -70,15 +70,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
70
70
  const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
71
71
  const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
72
72
  await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
73
- for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
74
- if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
75
- const expression = node.expression;
76
- if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
77
- break;
78
- }
79
- throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
80
- }
81
- }
82
73
  \u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
83
74
  \u4EE3\u7801\u533A.push(`${importName}.default`);
84
75
  }
@@ -75,15 +75,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
75
75
  const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
76
76
  const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
77
77
  await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
78
- for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
79
- if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
80
- const expression = node.expression;
81
- if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
82
- break;
83
- }
84
- throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
85
- }
86
- }
87
78
  \u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
88
79
  \u4EE3\u7801\u533A.push(`${importName}.default`);
89
80
  }
@@ -70,15 +70,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
70
70
  const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
71
71
  const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
72
72
  await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
73
- for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
74
- if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
75
- const expression = node.expression;
76
- if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
77
- break;
78
- }
79
- throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
80
- }
81
- }
82
73
  \u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
83
74
  \u4EE3\u7801\u533A.push(`${importName}.default`);
84
75
  }
@@ -75,15 +75,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
75
75
  const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
76
76
  const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
77
77
  await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
78
- for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
79
- if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
80
- const expression = node.expression;
81
- if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
82
- break;
83
- }
84
- throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
85
- }
86
- }
87
78
  \u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
88
79
  \u4EE3\u7801\u533A.push(`${importName}.default`);
89
80
  }
@@ -36,6 +36,7 @@ __export(src_exports, {
36
36
  \u5305\u88C5\u7684\u6B63\u786EJSON\u7ED3\u679C: () => \u5305\u88C5\u7684\u6B63\u786EJSON\u7ED3\u679C,
37
37
  \u5305\u88C5\u7684\u9519\u8BEFJSON\u7ED3\u679C: () => \u5305\u88C5\u7684\u9519\u8BEFJSON\u7ED3\u679C,
38
38
  \u63A5\u53E3: () => \u63A5\u53E3,
39
+ \u63A5\u53E3\u62BD\u8C61\u7C7B: () => \u63A5\u53E3\u62BD\u8C61\u7C7B,
39
40
  \u63A5\u53E3\u7C7B\u578B: () => \u63A5\u53E3\u7C7B\u578B,
40
41
  \u63D2\u4EF6: () => \u63D2\u4EF6,
41
42
  \u670D\u52A1\u5668: () => \u670D\u52A1\u5668,
@@ -175,6 +176,16 @@ var \u63A5\u53E3 = class {
175
176
  }
176
177
  };
177
178
 
179
+ // src/interface/interface-abstract.ts
180
+ var \u63A5\u53E3\u62BD\u8C61\u7C7B = class extends \u63A5\u53E3 {
181
+ constructor() {
182
+ super(null, null);
183
+ }
184
+ \u83B7\u5F97\u5B9E\u73B0() {
185
+ return this.\u8C03\u7528;
186
+ }
187
+ };
188
+
178
189
  // src/interface/plug.ts
179
190
  var \u63D2\u4EF6 = class {
180
191
  constructor(\u7C7B\u578B, \u5B9E\u73B0) {
@@ -350,6 +361,7 @@ var \u6D4B\u8BD5 = class {
350
361
  \u5305\u88C5\u7684\u6B63\u786EJSON\u7ED3\u679C,
351
362
  \u5305\u88C5\u7684\u9519\u8BEFJSON\u7ED3\u679C,
352
363
  \u63A5\u53E3,
364
+ \u63A5\u53E3\u62BD\u8C61\u7C7B,
353
365
  \u63A5\u53E3\u7C7B\u578B,
354
366
  \u63D2\u4EF6,
355
367
  \u670D\u52A1\u5668,
@@ -1,6 +1,7 @@
1
1
  export { 包装的接口类型, 包装的正确JSON结果, 包装的错误JSON结果 } from './extend/wrap-json.cjs';
2
2
  export { 任意接口, 接口 } from './interface/interface.cjs';
3
3
  export { 任意接口类型, 接口类型, 获得接口插件们 } from './interface/interface-type.cjs';
4
+ export { 接口抽象类, 计算实现参数, 计算实现结果 } from './interface/interface-abstract.cjs';
4
5
  export { 任意插件, 包装插件项, 取插件内部类型, 合并插件结果, 插件, 插件项类型 } from './interface/plug.cjs';
5
6
  export { 中文路径支持插件 } from './plugin/chinese-path.cjs';
6
7
  export { 自定义数据插件 } from './plugin/custom-data.cjs';
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/interface/interface-abstract.ts
21
+ var interface_abstract_exports = {};
22
+ __export(interface_abstract_exports, {
23
+ \u63A5\u53E3\u62BD\u8C61\u7C7B: () => \u63A5\u53E3\u62BD\u8C61\u7C7B
24
+ });
25
+ module.exports = __toCommonJS(interface_abstract_exports);
26
+
27
+ // src/interface/interface.ts
28
+ var \u63A5\u53E3 = class {
29
+ constructor(\u63A5\u53E3\u7C7B\u578B, \u5B9E\u73B0) {
30
+ this.\u63A5\u53E3\u7C7B\u578B = \u63A5\u53E3\u7C7B\u578B;
31
+ this.\u5B9E\u73B0 = \u5B9E\u73B0;
32
+ }
33
+ \u83B7\u5F97\u7C7B\u578B() {
34
+ return this.\u63A5\u53E3\u7C7B\u578B;
35
+ }
36
+ \u83B7\u5F97\u5B9E\u73B0() {
37
+ return this.\u5B9E\u73B0;
38
+ }
39
+ };
40
+
41
+ // src/interface/interface-abstract.ts
42
+ var \u63A5\u53E3\u62BD\u8C61\u7C7B = class extends \u63A5\u53E3 {
43
+ constructor() {
44
+ super(null, null);
45
+ }
46
+ \u83B7\u5F97\u5B9E\u73B0() {
47
+ return this.\u8C03\u7528;
48
+ }
49
+ };
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ \u63A5\u53E3\u62BD\u8C61\u7C7B
53
+ });
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ import { 正确结果 as ____, 错误结果 as ____$1 } from '../result/result.cjs';
3
+ import { 接口 as __ } from './interface.cjs';
4
+ import { 接口类型 as ____$2 } from './interface-type.cjs';
5
+ import { 合并插件结果 as ______ } from './plug.cjs';
6
+ import 'express';
7
+ import '@lsby/ts-fp-data';
8
+
9
+ type F1<A> = A extends ____$2<infer A1, infer _A2, infer _A3, infer _A4, infer _A5> ? A1 : never;
10
+ type F2<A> = A extends ____$2<infer _A1, infer A2, infer _A3, infer _A4, infer _A5> ? A2 : never;
11
+ type F3<A> = A extends ____$2<infer _A1, infer _A2, infer A3, infer _A4, infer _A5> ? A3 : never;
12
+ type F4<A> = A extends ____$2<infer _A1, infer _A2, infer _A3, infer A4, infer _A5> ? A4 : never;
13
+ type F5<A> = A extends ____$2<infer _A1, infer _A2, infer _A3, infer _A4, infer A5> ? A5 : never;
14
+ type 计算实现参数<接口类型定义> = ______<F3<接口类型定义>>;
15
+ type 计算实现结果<接口类型定义> = Promise<____<z.infer<F4<接口类型定义>>> | ____$1<z.infer<F5<接口类型定义>>>>;
16
+ declare abstract class 接口抽象类<接口类型描述 extends ____$2<any, any, any, any, any>> extends __<F1<接口类型描述>, F2<接口类型描述>, F3<接口类型描述>, F4<接口类型描述>, F5<接口类型描述>> {
17
+ constructor();
18
+ abstract 获得类型(): 接口类型描述;
19
+ 获得实现(): (ctx: object) => Promise<____<z.infer<F4<接口类型描述>>> | ____$1<z.infer<F5<接口类型描述>>>>;
20
+ abstract 调用(ctx: ______<F3<接口类型描述>>): Promise<____<z.infer<F4<接口类型描述>>> | ____$1<z.infer<F5<接口类型描述>>>>;
21
+ }
22
+
23
+ export { 接口抽象类, type 计算实现参数, type 计算实现结果 };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../../chunk-G3SHYW4Z.js";
4
+ } from "../../chunk-YYOST4AX.js";
5
5
 
6
6
  // src/bin/gen-list/bin.ts
7
7
  import path from "node:path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  main
3
- } from "../../chunk-G3SHYW4Z.js";
3
+ } from "../../chunk-YYOST4AX.js";
4
4
  export {
5
5
  main
6
6
  };
@@ -0,0 +1,17 @@
1
+ import {
2
+ 接口
3
+ } from "./chunk-KRIDSMPV.js";
4
+
5
+ // src/interface/interface-abstract.ts
6
+ var \u63A5\u53E3\u62BD\u8C61\u7C7B = class extends \u63A5\u53E3 {
7
+ constructor() {
8
+ super(null, null);
9
+ }
10
+ \u83B7\u5F97\u5B9E\u73B0() {
11
+ return this.\u8C03\u7528;
12
+ }
13
+ };
14
+
15
+ export {
16
+ 接口抽象类
17
+ };
@@ -41,15 +41,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
41
41
  const outputFolderRelativeToProjectRoot = path.relative(path.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
42
42
  const importPath = path.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
43
43
  await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
44
- for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
45
- if (ts.isExportAssignment(node) && node.isExportEquals === void 0) {
46
- const expression = node.expression;
47
- if (ts.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
48
- break;
49
- }
50
- throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
51
- }
52
- }
53
44
  \u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
54
45
  \u4EE3\u7801\u533A.push(`${importName}.default`);
55
46
  }
@@ -2,10 +2,10 @@ import {
2
2
  包装的接口类型,
3
3
  包装的正确JSON结果,
4
4
  包装的错误JSON结果
5
- } from "../chunk-ISEUOCLS.js";
6
- import "../chunk-SF5Z34AP.js";
5
+ } from "../chunk-AIZ3Q6UU.js";
7
6
  import "../chunk-IPDMEQ3O.js";
8
7
  import "../chunk-AHCV3LQ7.js";
8
+ import "../chunk-SF5Z34AP.js";
9
9
  export {
10
10
  \u5305\u88C5\u7684\u63A5\u53E3\u7C7B\u578B,
11
11
  \u5305\u88C5\u7684\u6B63\u786EJSON\u7ED3\u679C,
@@ -1,6 +1,7 @@
1
1
  export { 包装的接口类型, 包装的正确JSON结果, 包装的错误JSON结果 } from './extend/wrap-json.js';
2
2
  export { 任意接口, 接口 } from './interface/interface.js';
3
3
  export { 任意接口类型, 接口类型, 获得接口插件们 } from './interface/interface-type.js';
4
+ export { 接口抽象类, 计算实现参数, 计算实现结果 } from './interface/interface-abstract.js';
4
5
  export { 任意插件, 包装插件项, 取插件内部类型, 合并插件结果, 插件, 插件项类型 } from './interface/plug.js';
5
6
  export { 中文路径支持插件 } from './plugin/chinese-path.js';
6
7
  export { 自定义数据插件 } from './plugin/custom-data.js';
package/dist/esm/index.js CHANGED
@@ -17,13 +17,7 @@ import {
17
17
  包装的接口类型,
18
18
  包装的正确JSON结果,
19
19
  包装的错误JSON结果
20
- } from "./chunk-ISEUOCLS.js";
21
- import {
22
- 接口类型
23
- } from "./chunk-SF5Z34AP.js";
24
- import {
25
- 接口
26
- } from "./chunk-KRIDSMPV.js";
20
+ } from "./chunk-AIZ3Q6UU.js";
27
21
  import {
28
22
  正确JSON结果,
29
23
  正确结果,
@@ -33,6 +27,15 @@ import {
33
27
  错误结果
34
28
  } from "./chunk-IPDMEQ3O.js";
35
29
  import "./chunk-AHCV3LQ7.js";
30
+ import {
31
+ 接口抽象类
32
+ } from "./chunk-JNJOQH5L.js";
33
+ import {
34
+ 接口类型
35
+ } from "./chunk-SF5Z34AP.js";
36
+ import {
37
+ 接口
38
+ } from "./chunk-KRIDSMPV.js";
36
39
  import {
37
40
  中文路径支持插件
38
41
  } from "./chunk-XG4VZZOX.js";
@@ -46,6 +49,7 @@ export {
46
49
  \u5305\u88C5\u7684\u6B63\u786EJSON\u7ED3\u679C,
47
50
  \u5305\u88C5\u7684\u9519\u8BEFJSON\u7ED3\u679C,
48
51
  \u63A5\u53E3,
52
+ \u63A5\u53E3\u62BD\u8C61\u7C7B,
49
53
  \u63A5\u53E3\u7C7B\u578B,
50
54
  \u63D2\u4EF6,
51
55
  \u670D\u52A1\u5668,
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ import { 正确结果 as ____, 错误结果 as ____$1 } from '../result/result.js';
3
+ import { 接口 as __ } from './interface.js';
4
+ import { 接口类型 as ____$2 } from './interface-type.js';
5
+ import { 合并插件结果 as ______ } from './plug.js';
6
+ import 'express';
7
+ import '@lsby/ts-fp-data';
8
+
9
+ type F1<A> = A extends ____$2<infer A1, infer _A2, infer _A3, infer _A4, infer _A5> ? A1 : never;
10
+ type F2<A> = A extends ____$2<infer _A1, infer A2, infer _A3, infer _A4, infer _A5> ? A2 : never;
11
+ type F3<A> = A extends ____$2<infer _A1, infer _A2, infer A3, infer _A4, infer _A5> ? A3 : never;
12
+ type F4<A> = A extends ____$2<infer _A1, infer _A2, infer _A3, infer A4, infer _A5> ? A4 : never;
13
+ type F5<A> = A extends ____$2<infer _A1, infer _A2, infer _A3, infer _A4, infer A5> ? A5 : never;
14
+ type 计算实现参数<接口类型定义> = ______<F3<接口类型定义>>;
15
+ type 计算实现结果<接口类型定义> = Promise<____<z.infer<F4<接口类型定义>>> | ____$1<z.infer<F5<接口类型定义>>>>;
16
+ declare abstract class 接口抽象类<接口类型描述 extends ____$2<any, any, any, any, any>> extends __<F1<接口类型描述>, F2<接口类型描述>, F3<接口类型描述>, F4<接口类型描述>, F5<接口类型描述>> {
17
+ constructor();
18
+ abstract 获得类型(): 接口类型描述;
19
+ 获得实现(): (ctx: object) => Promise<____<z.infer<F4<接口类型描述>>> | ____$1<z.infer<F5<接口类型描述>>>>;
20
+ abstract 调用(ctx: ______<F3<接口类型描述>>): Promise<____<z.infer<F4<接口类型描述>>> | ____$1<z.infer<F5<接口类型描述>>>>;
21
+ }
22
+
23
+ export { 接口抽象类, type 计算实现参数, type 计算实现结果 };
@@ -0,0 +1,7 @@
1
+ import {
2
+ 接口抽象类
3
+ } from "../chunk-JNJOQH5L.js";
4
+ import "../chunk-KRIDSMPV.js";
5
+ export {
6
+ \u63A5\u53E3\u62BD\u8C61\u7C7B
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsby/net-core",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "require": "./dist/cjs/index.cjs",
@@ -1,10 +1,10 @@
1
- import {
2
- 接口类型
3
- } from "./chunk-SF5Z34AP.js";
4
1
  import {
5
2
  正确JSON结果,
6
3
  错误JSON结果
7
4
  } from "./chunk-IPDMEQ3O.js";
5
+ import {
6
+ 接口类型
7
+ } from "./chunk-SF5Z34AP.js";
8
8
 
9
9
  // src/extend/wrap-json.ts
10
10
  import { z } from "zod";