@keq-request/cli 5.0.0-alpha.27 → 5.0.0-alpha.28

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cli.cjs +132 -86
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +132 -86
  5. package/dist/cli.js.map +1 -1
  6. package/dist/compiler/compiler.d.ts.map +1 -1
  7. package/dist/compiler/tasks/setup/index.d.ts.map +1 -1
  8. package/dist/compiler/tasks/setup/utils/index.d.ts +0 -1
  9. package/dist/compiler/tasks/setup/utils/index.d.ts.map +1 -1
  10. package/dist/compiler/tasks/setup/utils/parse-runtime-config.d.ts +3 -0
  11. package/dist/compiler/tasks/setup/utils/parse-runtime-config.d.ts.map +1 -0
  12. package/dist/compiler/types/compiler-context.d.ts +1 -1
  13. package/dist/compiler/types/compiler-context.d.ts.map +1 -1
  14. package/dist/compiler/types/compiler-hooks.d.ts +2 -1
  15. package/dist/compiler/types/compiler-hooks.d.ts.map +1 -1
  16. package/dist/define-config.d.ts +3 -0
  17. package/dist/define-config.d.ts.map +1 -0
  18. package/dist/index.cjs +137 -93
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +136 -91
  23. package/dist/index.js.map +1 -1
  24. package/dist/models/module-definition.d.ts +3 -2
  25. package/dist/models/module-definition.d.ts.map +1 -1
  26. package/dist/plugins/download-http-file/download-http-file.plugin.d.ts +2 -2
  27. package/dist/plugins/download-http-file/download-http-file.plugin.d.ts.map +1 -1
  28. package/dist/plugins/download-local-file/download-local-file.plugin.d.ts.map +1 -1
  29. package/dist/plugins/shaking/shaking.plugin.d.ts.map +1 -1
  30. package/dist/plugins.cjs +25 -12
  31. package/dist/plugins.cjs.map +1 -1
  32. package/dist/plugins.js +25 -12
  33. package/dist/plugins.js.map +1 -1
  34. package/dist/types/address.d.ts +8 -0
  35. package/dist/types/address.d.ts.map +1 -0
  36. package/dist/types/index.d.ts +2 -1
  37. package/dist/types/index.d.ts.map +1 -1
  38. package/dist/types/runtime-config.d.ts +16 -7
  39. package/dist/types/runtime-config.d.ts.map +1 -1
  40. package/dist/utils/is-valid-url.d.ts +16 -0
  41. package/dist/utils/is-valid-url.d.ts.map +1 -0
  42. package/package.json +3 -3
  43. package/dist/compiler/tasks/setup/utils/validate-modules.d.ts +0 -2
  44. package/dist/compiler/tasks/setup/utils/validate-modules.d.ts.map +0 -1
  45. package/dist/define-keq-config.d.ts +0 -3
  46. package/dist/define-keq-config.d.ts.map +0 -1
@@ -0,0 +1,8 @@
1
+ import { Static } from '@sinclair/typebox';
2
+ export declare const Address: import("@sinclair/typebox").TObject<{
3
+ url: import("@sinclair/typebox").TString;
4
+ headers: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>>;
5
+ encoding: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"utf8">, import("@sinclair/typebox").TLiteral<"ascii">]>>;
6
+ }>;
7
+ export type Address = Static<typeof Address>;
8
+ //# sourceMappingURL=address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/types/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAA;AAGhD,eAAO,MAAM,OAAO;;;;EASlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,OAAO,CAAC,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export * from './build-cli-options.js';
2
2
  export * from './plugin.js';
3
3
  export * from './generator.js';
4
- export * from './runtime-config.js';
5
4
  export * from './to-code-options.js';
5
+ export * from './address.js';
6
+ export * from './runtime-config.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA"}
@@ -1,7 +1,7 @@
1
- import { Static } from '@sinclair/typebox';
1
+ import { StaticDecode, StaticEncode } from '@sinclair/typebox';
2
2
  import { FileNamingStyle } from '../constants/file-naming-style.js';
3
3
  import { Plugin } from './plugin.js';
4
- export declare const RuntimeConfig: import("@sinclair/typebox").TObject<{
4
+ export declare const RawConfig: import("@sinclair/typebox").TObject<{
5
5
  mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"micro-function">, import("@sinclair/typebox").TLiteral<"nestjs-module">, import("@sinclair/typebox").TLiteral<"none">]>>;
6
6
  /**
7
7
  * Whether to generate ES Module code
@@ -18,15 +18,24 @@ export declare const RuntimeConfig: import("@sinclair/typebox").TObject<{
18
18
  * File naming style for generated files
19
19
  */
20
20
  fileNamingStyle: import("@sinclair/typebox").TEnum<typeof FileNamingStyle>;
21
- modules: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
21
+ modules: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
22
+ url: import("@sinclair/typebox").TString;
23
+ headers: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>>;
24
+ encoding: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"utf8">, import("@sinclair/typebox").TLiteral<"ascii">]>>;
25
+ }>]>>, Record<string, {
26
+ headers?: {
27
+ [x: string]: string;
28
+ } | undefined;
29
+ encoding?: "utf8" | "ascii" | undefined;
30
+ url: string;
31
+ }>>;
22
32
  debug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
23
33
  /**
24
34
  * Whether to tolerate wrong openapi/swagger structure
25
35
  */
26
36
  tolerant: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
27
- plugins: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>>;
37
+ plugins: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<Plugin>>>;
28
38
  }>;
29
- export interface RuntimeConfig extends Omit<Static<typeof RuntimeConfig>, 'operationId' | 'plugins'> {
30
- plugins?: Plugin[];
31
- }
39
+ export type RawConfig = StaticEncode<typeof RawConfig>;
40
+ export type RuntimeConfig = StaticDecode<typeof RawConfig>;
32
41
  //# sourceMappingURL=runtime-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-config.d.ts","sourceRoot":"","sources":["../../src/types/runtime-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,eAAO,MAAM,aAAa;;IASxB;;;;;OAKG;;IAGH;;OAEG;;IAGH;;OAEG;;;;IAOH;;OAEG;;;EAIH,CAAA;AAGF,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClG,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB"}
1
+ {"version":3,"file":"runtime-config.d.ts","sourceRoot":"","sources":["../../src/types/runtime-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAQ,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AA6CpC,eAAO,MAAM,SAAS;;IASpB;;;;;OAKG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;IAOH;;OAEG;;;EAIH,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAA;AACtD,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 验证是否为有效的 URL
3
+ *
4
+ * @param url - 待验证的 URL 字符串
5
+ * @returns 如果是有效的 URL 返回 true,否则返回 false
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * isValidURL('http://example.com') // true
10
+ * isValidURL('https://example.com:8080/path?query=1#fragment') // true
11
+ * isValidURL('file:///path/to/file.json') // true
12
+ * isValidURL('not a url') // false
13
+ * ```
14
+ */
15
+ export declare function isValidURL(url: string): boolean;
16
+ //# sourceMappingURL=is-valid-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-valid-url.d.ts","sourceRoot":"","sources":["../../src/utils/is-valid-url.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C"}
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "keq": "dist/cli.cjs"
8
8
  },
9
9
  "description": "Transform Swagger/OpenAPI to the function that send request by keq",
10
- "version": "5.0.0-alpha.27",
10
+ "version": "5.0.0-alpha.28",
11
11
  "engines": {
12
12
  "node": ">=20.0.0"
13
13
  },
@@ -50,7 +50,7 @@
50
50
  "@types/node": "^20.19.25",
51
51
  "@types/ramda": "^0.31.1",
52
52
  "@types/swagger2openapi": "^7.0.4",
53
- "keq": "5.0.0-alpha.27"
53
+ "keq": "5.0.0-alpha.28"
54
54
  },
55
55
  "dependencies": {
56
56
  "@inquirer/prompts": "^7.10.1",
@@ -82,7 +82,7 @@
82
82
  "word-wrap": "^1.2.5"
83
83
  },
84
84
  "peerDependencies": {
85
- "keq": "5.0.0-alpha.27"
85
+ "keq": "5.0.0-alpha.28"
86
86
  },
87
87
  "optionalDependencies": {
88
88
  "eslint": "^9.39.1"
@@ -1,2 +0,0 @@
1
- export declare function validateModules(modules: Record<string, string>): void;
2
- //# sourceMappingURL=validate-modules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate-modules.d.ts","sourceRoot":"","sources":["../../../../../src/compiler/tasks/setup/utils/validate-modules.ts"],"names":[],"mappings":"AAIA,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CA+BrE"}
@@ -1,3 +0,0 @@
1
- import { RuntimeConfig } from './types/runtime-config.js';
2
- export declare function defineKeqConfig(config: RuntimeConfig): RuntimeConfig;
3
- //# sourceMappingURL=define-keq-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-keq-config.d.ts","sourceRoot":"","sources":["../src/define-keq-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAGzD,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAEpE"}