genoc 0.3.0 → 0.4.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.
Files changed (71) hide show
  1. package/README.md +31 -187
  2. package/dist/analyzer/analyze.d.ts +18 -0
  3. package/dist/analyzer/analyze.js +493 -0
  4. package/dist/analyzer/discriminator-registry.d.ts +108 -0
  5. package/dist/analyzer/discriminator-registry.js +209 -0
  6. package/dist/analyzer/path-analyzer.d.ts +43 -6
  7. package/dist/analyzer/path-analyzer.js +57 -84
  8. package/dist/analyzer/schema-mapper.d.ts +68 -6
  9. package/dist/analyzer/schema-mapper.js +299 -40
  10. package/dist/analyzer/types.d.ts +126 -0
  11. package/dist/cli/app.d.ts +4 -2
  12. package/dist/cli/app.js +23 -4
  13. package/dist/cli/config-loader.d.ts +20 -0
  14. package/dist/cli/config-loader.js +186 -0
  15. package/dist/cli/config-schema.d.ts +105 -0
  16. package/dist/cli/config-schema.js +183 -0
  17. package/dist/cli/impl.d.ts +9 -1
  18. package/dist/cli/impl.js +189 -36
  19. package/dist/generator/client-generator.d.ts +13 -14
  20. package/dist/generator/client-generator.js +45 -77
  21. package/dist/generator/contracts-generator.d.ts +11 -9
  22. package/dist/generator/contracts-generator.js +45 -491
  23. package/dist/generator/method-generator.d.ts +1 -1
  24. package/dist/generator/method-generator.js +10 -150
  25. package/dist/parser/ref-resolver.d.ts +1 -1
  26. package/dist/parser/ref-resolver.js +1 -2
  27. package/dist/parser/version/index.d.ts +4 -16
  28. package/dist/parser/version/index.js +3 -14
  29. package/dist/parser/version/v3.0/validator.d.ts +1 -1
  30. package/dist/parser/version/v3.1/validator.d.ts +17 -0
  31. package/dist/parser/version/v3.1/validator.js +126 -0
  32. package/dist/parser/version/validate.d.ts +9 -0
  33. package/dist/parser/version/validate.js +12 -0
  34. package/dist/parser/version/version-detector.d.ts +21 -0
  35. package/dist/parser/version/version-detector.js +19 -0
  36. package/dist/pipeline.d.ts +15 -0
  37. package/dist/pipeline.js +25 -0
  38. package/dist/types/client.d.ts +0 -12
  39. package/dist/utils/generator-helpers.d.ts +1 -24
  40. package/dist/utils/generator-helpers.js +11 -78
  41. package/dist/utils/operation-naming.d.ts +84 -0
  42. package/dist/utils/operation-naming.js +178 -0
  43. package/dist/utils/proxy.d.ts +2 -0
  44. package/dist/utils/proxy.js +16 -0
  45. package/dist/utils/string.d.ts +7 -0
  46. package/dist/utils/string.js +9 -0
  47. package/package.json +19 -15
  48. package/dist/index.d.ts +0 -9
  49. package/dist/index.js +0 -11
  50. package/dist/parser/validators.d.ts +0 -7
  51. package/dist/parser/validators.js +0 -79
  52. package/dist/parser/version/normalized-spec.d.ts +0 -199
  53. package/dist/parser/version/registry.d.ts +0 -28
  54. package/dist/parser/version/registry.js +0 -44
  55. package/dist/parser/version/v3.0/index.d.ts +0 -3
  56. package/dist/parser/version/v3.0/index.js +0 -3
  57. package/dist/parser/version/v3.0/normalizer.d.ts +0 -15
  58. package/dist/parser/version/v3.0/normalizer.js +0 -389
  59. package/dist/parser/version/v3.0/strategy.d.ts +0 -27
  60. package/dist/parser/version/v3.0/strategy.js +0 -96
  61. package/dist/parser/version/v3.1/index.d.ts +0 -1
  62. package/dist/parser/version/v3.1/index.js +0 -1
  63. package/dist/parser/version/v3.1/strategy.d.ts +0 -42
  64. package/dist/parser/version/v3.1/strategy.js +0 -513
  65. package/dist/parser/version/v3.2/index.d.ts +0 -4
  66. package/dist/parser/version/v3.2/index.js +0 -4
  67. package/dist/parser/version/v3.2/strategy.d.ts +0 -39
  68. package/dist/parser/version/v3.2/strategy.js +0 -57
  69. package/dist/parser/version/version-strategy.d.ts +0 -31
  70. package/dist/parser/version/version-strategy.js +0 -1
  71. /package/dist/{parser/version/normalized-spec.js → analyzer/types.js} +0 -0
@@ -1,4 +0,0 @@
1
- /**
2
- * Export for OpenAPI 3.2 version strategy
3
- */
4
- export { V3_2_VersionStrategy } from './strategy.js';
@@ -1,39 +0,0 @@
1
- import type { ValidationResult } from '../../validators.js';
2
- import type { NormalizedSpec } from '../normalized-spec.js';
3
- import type { VersionStrategy } from '../version-strategy.js';
4
- /**
5
- * Stub strategy for OpenAPI 3.2.x specifications
6
- *
7
- * This strategy matches OpenAPI 3.2.x specifications but throws
8
- * "not yet supported" errors until full implementation is available.
9
- */
10
- export declare class V3_2_VersionStrategy implements VersionStrategy {
11
- /**
12
- * Get the supported OpenAPI version
13
- */
14
- version(): string;
15
- /**
16
- * Check if this strategy matches the given OpenAPI specification
17
- */
18
- matches(spec: unknown): boolean;
19
- /**
20
- * Normalize a raw OpenAPI specification to a consistent format
21
- * Throws "not yet supported" error
22
- */
23
- normalizeSpec(_rawSpec: unknown): NormalizedSpec;
24
- /**
25
- * Validate the normalized specification
26
- * Throws "not yet supported" error
27
- */
28
- validateSpec(_spec: NormalizedSpec): ValidationResult;
29
- /**
30
- * Resolve a reference within the document context
31
- * Throws "not yet supported" error
32
- */
33
- resolveRef(_ref: string, _doc: unknown, _context?: unknown): unknown;
34
- /**
35
- * Get supported features for this version
36
- * Returns empty array since version is not yet supported
37
- */
38
- getSupportedFeatures(): string[];
39
- }
@@ -1,57 +0,0 @@
1
- /**
2
- * Stub strategy for OpenAPI 3.2.x specifications
3
- *
4
- * This strategy matches OpenAPI 3.2.x specifications but throws
5
- * "not yet supported" errors until full implementation is available.
6
- */
7
- export class V3_2_VersionStrategy {
8
- /**
9
- * Get the supported OpenAPI version
10
- */
11
- version() {
12
- return '3.2';
13
- }
14
- /**
15
- * Check if this strategy matches the given OpenAPI specification
16
- */
17
- matches(spec) {
18
- if (!spec || typeof spec !== 'object' || Array.isArray(spec)) {
19
- return false;
20
- }
21
- const specObj = spec;
22
- const openapiVersion = specObj.openapi;
23
- if (typeof openapiVersion === 'string') {
24
- // Match 3.2.x versions (e.g., "3.2.0", "3.2.1", etc.)
25
- return openapiVersion.startsWith('3.2');
26
- }
27
- return false;
28
- }
29
- /**
30
- * Normalize a raw OpenAPI specification to a consistent format
31
- * Throws "not yet supported" error
32
- */
33
- normalizeSpec(_rawSpec) {
34
- throw new Error('OpenAPI 3.2 is not yet supported. Supported versions: 3.0, 3.1');
35
- }
36
- /**
37
- * Validate the normalized specification
38
- * Throws "not yet supported" error
39
- */
40
- validateSpec(_spec) {
41
- throw new Error('OpenAPI 3.2 is not yet supported. Supported versions: 3.0, 3.1');
42
- }
43
- /**
44
- * Resolve a reference within the document context
45
- * Throws "not yet supported" error
46
- */
47
- resolveRef(_ref, _doc, _context) {
48
- throw new Error('OpenAPI 3.2 is not yet supported. Supported versions: 3.0, 3.1');
49
- }
50
- /**
51
- * Get supported features for this version
52
- * Returns empty array since version is not yet supported
53
- */
54
- getSupportedFeatures() {
55
- return [];
56
- }
57
- }
@@ -1,31 +0,0 @@
1
- import type { ValidationResult } from '../validators.js';
2
- import type { NormalizedSpec } from './normalized-spec.js';
3
- /**
4
- * Version strategy interface for multi-version OpenAPI support
5
- */
6
- export interface VersionStrategy {
7
- /**
8
- * Get the supported OpenAPI version
9
- */
10
- version(): string;
11
- /**
12
- * Check if this strategy matches the given OpenAPI specification
13
- */
14
- matches(spec: unknown): boolean;
15
- /**
16
- * Normalize a raw OpenAPI specification to a consistent format
17
- */
18
- normalizeSpec(rawSpec: unknown): NormalizedSpec;
19
- /**
20
- * Validate the normalized specification
21
- */
22
- validateSpec(spec: NormalizedSpec): ValidationResult;
23
- /**
24
- * Resolve a reference within the document context
25
- */
26
- resolveRef(ref: string, doc: unknown, context?: unknown): unknown;
27
- /**
28
- * Get supported features for this version
29
- */
30
- getSupportedFeatures(): string[];
31
- }
@@ -1 +0,0 @@
1
- export {};