@skmtc/core 0.0.804 → 0.0.806
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/esm/helpers/strings.d.ts +44 -0
- package/esm/helpers/strings.d.ts.map +1 -1
- package/esm/helpers/strings.js +44 -0
- package/esm/oas/contact/Contact.d.ts +42 -0
- package/esm/oas/contact/Contact.d.ts.map +1 -1
- package/esm/oas/contact/Contact.js +36 -0
- package/esm/oas/info/Info.d.ts +36 -0
- package/esm/oas/info/Info.d.ts.map +1 -1
- package/esm/oas/info/Info.js +37 -0
- package/esm/oas/mediaType/MediaType.d.ts +17 -0
- package/esm/oas/mediaType/MediaType.d.ts.map +1 -1
- package/esm/oas/mediaType/MediaType.js +17 -0
- package/esm/run/toV3JsonDocument.d.ts +54 -0
- package/esm/run/toV3JsonDocument.d.ts.map +1 -1
- package/esm/run/toV3JsonDocument.js +54 -0
- package/esm/types/Brand.d.ts +41 -0
- package/esm/types/Brand.d.ts.map +1 -1
- package/esm/types/Brand.js +41 -0
- package/esm/types/Enrichments.d.ts +58 -0
- package/esm/types/Enrichments.d.ts.map +1 -1
- package/esm/types/Enrichments.js +58 -0
- package/esm/types/Settings.d.ts +50 -0
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +50 -0
- package/package.json +1 -1
- package/script/helpers/strings.d.ts +44 -0
- package/script/helpers/strings.d.ts.map +1 -1
- package/script/helpers/strings.js +44 -0
- package/script/oas/contact/Contact.d.ts +42 -0
- package/script/oas/contact/Contact.d.ts.map +1 -1
- package/script/oas/contact/Contact.js +36 -0
- package/script/oas/info/Info.d.ts +36 -0
- package/script/oas/info/Info.d.ts.map +1 -1
- package/script/oas/info/Info.js +37 -0
- package/script/oas/mediaType/MediaType.d.ts +17 -0
- package/script/oas/mediaType/MediaType.d.ts.map +1 -1
- package/script/oas/mediaType/MediaType.js +17 -0
- package/script/run/toV3JsonDocument.d.ts +54 -0
- package/script/run/toV3JsonDocument.d.ts.map +1 -1
- package/script/run/toV3JsonDocument.js +54 -0
- package/script/types/Brand.d.ts +41 -0
- package/script/types/Brand.d.ts.map +1 -1
- package/script/types/Brand.js +41 -0
- package/script/types/Enrichments.d.ts +58 -0
- package/script/types/Enrichments.d.ts.map +1 -1
- package/script/types/Enrichments.js +58 -0
- package/script/types/Settings.d.ts +50 -0
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +50 -0
|
@@ -96,13 +96,30 @@ export type MediaTypeFields = {
|
|
|
96
96
|
* ```
|
|
97
97
|
*/
|
|
98
98
|
export declare class OasMediaType {
|
|
99
|
+
/** Type identifier for this OAS media type */
|
|
99
100
|
oasType: 'mediaType';
|
|
101
|
+
/** The media type identifier (e.g., 'application/json', 'text/xml') */
|
|
100
102
|
mediaType: string;
|
|
103
|
+
/** The schema defining the structure and validation rules for the content */
|
|
101
104
|
schema: OasSchema | OasRef<'schema'> | undefined;
|
|
105
|
+
/** Example values demonstrating the media type content */
|
|
102
106
|
examples: Record<string, OasExample | OasRef<'example'>> | undefined;
|
|
107
|
+
/** Custom extension fields (x-* properties) defined for this media type */
|
|
103
108
|
extensionFields: Record<string, unknown> | undefined;
|
|
109
|
+
/** Encoding information for multipart and form data serialization */
|
|
104
110
|
encoding?: Record<string, unknown> | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Creates a new OasMediaType instance.
|
|
113
|
+
*
|
|
114
|
+
* @param fields - Media type configuration including content schema, examples, and encoding
|
|
115
|
+
*/
|
|
105
116
|
constructor(fields: MediaTypeFields);
|
|
117
|
+
/**
|
|
118
|
+
* Converts this OAS media type to an OpenAPI v3 JSON schema representation.
|
|
119
|
+
*
|
|
120
|
+
* @param options - Conversion options including reference handling and formatting preferences
|
|
121
|
+
* @returns OpenAPI v3 media type object with schema and examples
|
|
122
|
+
*/
|
|
106
123
|
toJsonSchema(options: ToJsonSchemaOptions): OpenAPIV3.MediaTypeObject;
|
|
107
124
|
}
|
|
108
125
|
//# sourceMappingURL=Medi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IACvE,SAAS,EAAE,MAAM,CAAA;IACjB,6EAA6E;IAC7E,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;IAChD,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAA;IACpE,2EAA2E;IAC3E,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;IACpD,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;IAC9C;;;;OAIG;gBACS,MAAM,EAAE,eAAe;IAQnC;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC,eAAe;CAMtE"}
|
|
@@ -79,37 +79,48 @@ exports.OasMediaType = void 0;
|
|
|
79
79
|
* ```
|
|
80
80
|
*/
|
|
81
81
|
class OasMediaType {
|
|
82
|
+
/**
|
|
83
|
+
* Creates a new OasMediaType instance.
|
|
84
|
+
*
|
|
85
|
+
* @param fields - Media type configuration including content schema, examples, and encoding
|
|
86
|
+
*/
|
|
82
87
|
constructor(fields) {
|
|
88
|
+
/** Type identifier for this OAS media type */
|
|
83
89
|
Object.defineProperty(this, "oasType", {
|
|
84
90
|
enumerable: true,
|
|
85
91
|
configurable: true,
|
|
86
92
|
writable: true,
|
|
87
93
|
value: 'mediaType'
|
|
88
94
|
});
|
|
95
|
+
/** The media type identifier (e.g., 'application/json', 'text/xml') */
|
|
89
96
|
Object.defineProperty(this, "mediaType", {
|
|
90
97
|
enumerable: true,
|
|
91
98
|
configurable: true,
|
|
92
99
|
writable: true,
|
|
93
100
|
value: void 0
|
|
94
101
|
});
|
|
102
|
+
/** The schema defining the structure and validation rules for the content */
|
|
95
103
|
Object.defineProperty(this, "schema", {
|
|
96
104
|
enumerable: true,
|
|
97
105
|
configurable: true,
|
|
98
106
|
writable: true,
|
|
99
107
|
value: void 0
|
|
100
108
|
});
|
|
109
|
+
/** Example values demonstrating the media type content */
|
|
101
110
|
Object.defineProperty(this, "examples", {
|
|
102
111
|
enumerable: true,
|
|
103
112
|
configurable: true,
|
|
104
113
|
writable: true,
|
|
105
114
|
value: void 0
|
|
106
115
|
});
|
|
116
|
+
/** Custom extension fields (x-* properties) defined for this media type */
|
|
107
117
|
Object.defineProperty(this, "extensionFields", {
|
|
108
118
|
enumerable: true,
|
|
109
119
|
configurable: true,
|
|
110
120
|
writable: true,
|
|
111
121
|
value: void 0
|
|
112
122
|
});
|
|
123
|
+
/** Encoding information for multipart and form data serialization */
|
|
113
124
|
Object.defineProperty(this, "encoding", {
|
|
114
125
|
enumerable: true,
|
|
115
126
|
configurable: true,
|
|
@@ -122,6 +133,12 @@ class OasMediaType {
|
|
|
122
133
|
this.encoding = fields.encoding;
|
|
123
134
|
this.extensionFields = fields.extensionFields;
|
|
124
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Converts this OAS media type to an OpenAPI v3 JSON schema representation.
|
|
138
|
+
*
|
|
139
|
+
* @param options - Conversion options including reference handling and formatting preferences
|
|
140
|
+
* @returns OpenAPI v3 media type object with schema and examples
|
|
141
|
+
*/
|
|
125
142
|
toJsonSchema(options) {
|
|
126
143
|
return {
|
|
127
144
|
schema: this.schema?.toJsonSchema(options),
|
|
@@ -1,3 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview OpenAPI Document Conversion Utilities
|
|
3
|
+
*
|
|
4
|
+
* This module provides robust utilities for converting OpenAPI documents between
|
|
5
|
+
* different versions (v2/Swagger, v3.0, v3.1) and formats (JSON, YAML). It handles
|
|
6
|
+
* the complexities of version migration, format detection, and schema validation
|
|
7
|
+
* to ensure seamless OpenAPI document processing within the SKMTC pipeline.
|
|
8
|
+
*
|
|
9
|
+
* ## Key Features
|
|
10
|
+
*
|
|
11
|
+
* - **Multi-Version Support**: Convert between Swagger v2, OpenAPI v3.0, and v3.1
|
|
12
|
+
* - **Format Detection**: Automatic detection of JSON vs YAML input formats
|
|
13
|
+
* - **Version Migration**: Safe migration with schema validation and error handling
|
|
14
|
+
* - **Type Safety**: Full TypeScript support with proper type guards
|
|
15
|
+
* - **Error Recovery**: Comprehensive error handling for malformed documents
|
|
16
|
+
*
|
|
17
|
+
* @example Converting Swagger v2 to OpenAPI v3
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { toV3JsonDocument } from '@skmtc/core/toV3JsonDocument';
|
|
20
|
+
*
|
|
21
|
+
* const swaggerV2 = {
|
|
22
|
+
* swagger: '2.0',
|
|
23
|
+
* info: { title: 'My API', version: '1.0.0' },
|
|
24
|
+
* paths: { '/users': { get: { responses: { '200': { description: 'Success' } } } } }
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* const openApiV3 = await toV3JsonDocument(swaggerV2);
|
|
28
|
+
* console.log(openApiV3.openapi); // '3.0.0'
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example Converting from YAML string
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const yamlContent = `
|
|
34
|
+
* openapi: 3.1.0
|
|
35
|
+
* info:
|
|
36
|
+
* title: My API
|
|
37
|
+
* version: 1.0.0
|
|
38
|
+
* paths: {}
|
|
39
|
+
* `;
|
|
40
|
+
*
|
|
41
|
+
* const openApiV3 = await toV3JsonDocument(yamlContent);
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example Handling conversion errors
|
|
45
|
+
* ```typescript
|
|
46
|
+
* try {
|
|
47
|
+
* const result = await toV3JsonDocument(malformedDocument);
|
|
48
|
+
* } catch (error) {
|
|
49
|
+
* console.error('Conversion failed:', error.message);
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @module toV3JsonDocument
|
|
54
|
+
*/
|
|
1
55
|
import "../_dnt.polyfills.js";
|
|
2
56
|
import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from 'openapi-types';
|
|
3
57
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toV3JsonDocument.d.ts","sourceRoot":"","sources":["../../src/run/toV3JsonDocument.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"toV3JsonDocument.d.ts","sourceRoot":"","sources":["../../src/run/toV3JsonDocument.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAUtE;;;;;GAKG;AACH,KAAK,cAAc,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAA;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,cAM/C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,YAAY,GAAU,QAAQ,cAAc,KAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CA0BrF,CAAA"}
|
|
@@ -4,6 +4,60 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.toV3Document = exports.stringToSchema = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview OpenAPI Document Conversion Utilities
|
|
9
|
+
*
|
|
10
|
+
* This module provides robust utilities for converting OpenAPI documents between
|
|
11
|
+
* different versions (v2/Swagger, v3.0, v3.1) and formats (JSON, YAML). It handles
|
|
12
|
+
* the complexities of version migration, format detection, and schema validation
|
|
13
|
+
* to ensure seamless OpenAPI document processing within the SKMTC pipeline.
|
|
14
|
+
*
|
|
15
|
+
* ## Key Features
|
|
16
|
+
*
|
|
17
|
+
* - **Multi-Version Support**: Convert between Swagger v2, OpenAPI v3.0, and v3.1
|
|
18
|
+
* - **Format Detection**: Automatic detection of JSON vs YAML input formats
|
|
19
|
+
* - **Version Migration**: Safe migration with schema validation and error handling
|
|
20
|
+
* - **Type Safety**: Full TypeScript support with proper type guards
|
|
21
|
+
* - **Error Recovery**: Comprehensive error handling for malformed documents
|
|
22
|
+
*
|
|
23
|
+
* @example Converting Swagger v2 to OpenAPI v3
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { toV3JsonDocument } from '@skmtc/core/toV3JsonDocument';
|
|
26
|
+
*
|
|
27
|
+
* const swaggerV2 = {
|
|
28
|
+
* swagger: '2.0',
|
|
29
|
+
* info: { title: 'My API', version: '1.0.0' },
|
|
30
|
+
* paths: { '/users': { get: { responses: { '200': { description: 'Success' } } } } }
|
|
31
|
+
* };
|
|
32
|
+
*
|
|
33
|
+
* const openApiV3 = await toV3JsonDocument(swaggerV2);
|
|
34
|
+
* console.log(openApiV3.openapi); // '3.0.0'
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example Converting from YAML string
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const yamlContent = `
|
|
40
|
+
* openapi: 3.1.0
|
|
41
|
+
* info:
|
|
42
|
+
* title: My API
|
|
43
|
+
* version: 1.0.0
|
|
44
|
+
* paths: {}
|
|
45
|
+
* `;
|
|
46
|
+
*
|
|
47
|
+
* const openApiV3 = await toV3JsonDocument(yamlContent);
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @example Handling conversion errors
|
|
51
|
+
* ```typescript
|
|
52
|
+
* try {
|
|
53
|
+
* const result = await toV3JsonDocument(malformedDocument);
|
|
54
|
+
* } catch (error) {
|
|
55
|
+
* console.error('Conversion failed:', error.message);
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @module toV3JsonDocument
|
|
60
|
+
*/
|
|
7
61
|
require("../_dnt.polyfills.js");
|
|
8
62
|
const parse_js_1 = require("../deps/jsr.io/@std/yaml/1.0.9/parse.js");
|
|
9
63
|
const openapi_down_convert_1 = require("@apiture/openapi-down-convert");
|
package/script/types/Brand.d.ts
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Brand Type System for SKMTC Core
|
|
3
|
+
*
|
|
4
|
+
* This module provides TypeScript branded types for creating type-safe identifiers
|
|
5
|
+
* and values that are structurally identical but nominally distinct. Branded types
|
|
6
|
+
* help prevent mixing up similar primitive types and provide better type safety
|
|
7
|
+
* across the SKMTC codebase.
|
|
8
|
+
*
|
|
9
|
+
* ## Key Features
|
|
10
|
+
*
|
|
11
|
+
* - **Type Safety**: Prevents accidental mixing of similar primitive types
|
|
12
|
+
* - **Nominal Typing**: Creates distinct types from the same underlying type
|
|
13
|
+
* - **Zero Runtime Cost**: Pure TypeScript compile-time construct
|
|
14
|
+
* - **Developer Experience**: Better IntelliSense and error messages
|
|
15
|
+
*
|
|
16
|
+
* @example Creating branded types
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import type { Brand } from '@skmtc/core/Brand';
|
|
19
|
+
*
|
|
20
|
+
* type UserId = Brand<string, 'UserId'>;
|
|
21
|
+
* type ProductId = Brand<string, 'ProductId'>;
|
|
22
|
+
*
|
|
23
|
+
* const userId: UserId = 'user-123' as UserId;
|
|
24
|
+
* const productId: ProductId = 'prod-456' as ProductId;
|
|
25
|
+
*
|
|
26
|
+
* // TypeScript will prevent this error:
|
|
27
|
+
* // const wrong: UserId = productId; // Type error!
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example Using with numbers
|
|
31
|
+
* ```typescript
|
|
32
|
+
* type Score = Brand<number, 'Score'>;
|
|
33
|
+
* type Percentage = Brand<number, 'Percentage'>;
|
|
34
|
+
*
|
|
35
|
+
* function calculateGrade(score: Score, total: Score): Percentage {
|
|
36
|
+
* return ((score / total) * 100) as Percentage;
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @module Brand
|
|
41
|
+
*/
|
|
1
42
|
/**
|
|
2
43
|
* Unique symbol used for branding types.
|
|
3
44
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Brand.d.ts","sourceRoot":"","sources":["../../src/types/Brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,MAAM,CAAA;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,GAAG;IAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"Brand.d.ts","sourceRoot":"","sources":["../../src/types/Brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;;;;;;;;GAQG;AACH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,MAAM,CAAA;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,GAAG;IAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
package/script/types/Brand.js
CHANGED
|
@@ -1,4 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Brand Type System for SKMTC Core
|
|
4
|
+
*
|
|
5
|
+
* This module provides TypeScript branded types for creating type-safe identifiers
|
|
6
|
+
* and values that are structurally identical but nominally distinct. Branded types
|
|
7
|
+
* help prevent mixing up similar primitive types and provide better type safety
|
|
8
|
+
* across the SKMTC codebase.
|
|
9
|
+
*
|
|
10
|
+
* ## Key Features
|
|
11
|
+
*
|
|
12
|
+
* - **Type Safety**: Prevents accidental mixing of similar primitive types
|
|
13
|
+
* - **Nominal Typing**: Creates distinct types from the same underlying type
|
|
14
|
+
* - **Zero Runtime Cost**: Pure TypeScript compile-time construct
|
|
15
|
+
* - **Developer Experience**: Better IntelliSense and error messages
|
|
16
|
+
*
|
|
17
|
+
* @example Creating branded types
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import type { Brand } from '@skmtc/core/Brand';
|
|
20
|
+
*
|
|
21
|
+
* type UserId = Brand<string, 'UserId'>;
|
|
22
|
+
* type ProductId = Brand<string, 'ProductId'>;
|
|
23
|
+
*
|
|
24
|
+
* const userId: UserId = 'user-123' as UserId;
|
|
25
|
+
* const productId: ProductId = 'prod-456' as ProductId;
|
|
26
|
+
*
|
|
27
|
+
* // TypeScript will prevent this error:
|
|
28
|
+
* // const wrong: UserId = productId; // Type error!
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example Using with numbers
|
|
32
|
+
* ```typescript
|
|
33
|
+
* type Score = Brand<number, 'Score'>;
|
|
34
|
+
* type Percentage = Brand<number, 'Percentage'>;
|
|
35
|
+
*
|
|
36
|
+
* function calculateGrade(score: Score, total: Score): Percentage {
|
|
37
|
+
* return ((score / total) * 100) as Percentage;
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @module Brand
|
|
42
|
+
*/
|
|
2
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
44
|
/**
|
|
4
45
|
* Unique symbol used for branding types.
|
|
@@ -1,3 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Enrichment System for SKMTC Core
|
|
3
|
+
*
|
|
4
|
+
* This module provides comprehensive enrichment types and schemas for enhancing
|
|
5
|
+
* OpenAPI operations with UI generation metadata. Enrichments allow generators
|
|
6
|
+
* to create forms, tables, inputs, and other UI components with rich metadata
|
|
7
|
+
* about how data should be presented and interacted with.
|
|
8
|
+
*
|
|
9
|
+
* The enrichment system supports a hierarchical structure:
|
|
10
|
+
* Generator → Path → Method → Operation → Component Type (form/table/input)
|
|
11
|
+
*
|
|
12
|
+
* ## Key Features
|
|
13
|
+
*
|
|
14
|
+
* - **Form Enrichments**: Field definitions with inputs, labels, and validation
|
|
15
|
+
* - **Table Enrichments**: Column definitions with formatters and headers
|
|
16
|
+
* - **Input Enrichments**: Standalone input components with formatting
|
|
17
|
+
* - **Hierarchical Organization**: Nested structure for easy lookup and management
|
|
18
|
+
* - **Type Safety**: Comprehensive Valibot validation for all enrichment data
|
|
19
|
+
*
|
|
20
|
+
* @example Basic form enrichment
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import type { FormItem } from '@skmtc/core/Enrichments';
|
|
23
|
+
*
|
|
24
|
+
* const userForm: FormItem = {
|
|
25
|
+
* title: 'User Registration',
|
|
26
|
+
* description: 'Create a new user account',
|
|
27
|
+
* fields: [
|
|
28
|
+
* {
|
|
29
|
+
* id: 'name',
|
|
30
|
+
* accessorPath: ['name'],
|
|
31
|
+
* input: { moduleName: 'TextInput', exportName: 'default' },
|
|
32
|
+
* label: 'Full Name',
|
|
33
|
+
* placeholder: 'Enter your full name'
|
|
34
|
+
* }
|
|
35
|
+
* ],
|
|
36
|
+
* submitLabel: 'Create Account'
|
|
37
|
+
* };
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example Table enrichment with formatters
|
|
41
|
+
* ```typescript
|
|
42
|
+
* import type { TableItem } from '@skmtc/core/Enrichments';
|
|
43
|
+
*
|
|
44
|
+
* const userTable: TableItem = {
|
|
45
|
+
* title: 'User Directory',
|
|
46
|
+
* columns: [
|
|
47
|
+
* {
|
|
48
|
+
* id: 'email',
|
|
49
|
+
* accessorPath: ['email'],
|
|
50
|
+
* formatter: { moduleName: 'EmailFormatter', exportName: 'default' },
|
|
51
|
+
* label: 'Email Address'
|
|
52
|
+
* }
|
|
53
|
+
* ]
|
|
54
|
+
* };
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @module Enrichments
|
|
58
|
+
*/
|
|
1
59
|
import "../_dnt.polyfills.js";
|
|
2
60
|
import { type ModuleExport } from './ModuleExport.js';
|
|
3
61
|
import * as v from 'valibot';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Enrichments.d.ts","sourceRoot":"","sources":["../../src/types/Enrichments.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Enrichments.d.ts","sourceRoot":"","sources":["../../src/types/Enrichments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa,CAMvD,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAK7C,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,CAAC,EAAE,MA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AC,iBAAiB,CAA8C,CAAA;AAE/G;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;AAEpE;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,aAAa,CAAC,eAAe,CAA2C,CAAA;AAExG;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,aAAa,CAAC,oBAAoB,CAAyC,CAAA;AAEhH;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA"}
|
|
@@ -34,6 +34,64 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.generatorEnrichments = exports.pathEnrichments = exports.methodEnrichments = exports.operationEnrichments = exports.inputItem = exports.tableItem = exports.tableColumnItem = exports.formItem = exports.formFieldItem = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* @fileoverview Enrichment System for SKMTC Core
|
|
39
|
+
*
|
|
40
|
+
* This module provides comprehensive enrichment types and schemas for enhancing
|
|
41
|
+
* OpenAPI operations with UI generation metadata. Enrichments allow generators
|
|
42
|
+
* to create forms, tables, inputs, and other UI components with rich metadata
|
|
43
|
+
* about how data should be presented and interacted with.
|
|
44
|
+
*
|
|
45
|
+
* The enrichment system supports a hierarchical structure:
|
|
46
|
+
* Generator → Path → Method → Operation → Component Type (form/table/input)
|
|
47
|
+
*
|
|
48
|
+
* ## Key Features
|
|
49
|
+
*
|
|
50
|
+
* - **Form Enrichments**: Field definitions with inputs, labels, and validation
|
|
51
|
+
* - **Table Enrichments**: Column definitions with formatters and headers
|
|
52
|
+
* - **Input Enrichments**: Standalone input components with formatting
|
|
53
|
+
* - **Hierarchical Organization**: Nested structure for easy lookup and management
|
|
54
|
+
* - **Type Safety**: Comprehensive Valibot validation for all enrichment data
|
|
55
|
+
*
|
|
56
|
+
* @example Basic form enrichment
|
|
57
|
+
* ```typescript
|
|
58
|
+
* import type { FormItem } from '@skmtc/core/Enrichments';
|
|
59
|
+
*
|
|
60
|
+
* const userForm: FormItem = {
|
|
61
|
+
* title: 'User Registration',
|
|
62
|
+
* description: 'Create a new user account',
|
|
63
|
+
* fields: [
|
|
64
|
+
* {
|
|
65
|
+
* id: 'name',
|
|
66
|
+
* accessorPath: ['name'],
|
|
67
|
+
* input: { moduleName: 'TextInput', exportName: 'default' },
|
|
68
|
+
* label: 'Full Name',
|
|
69
|
+
* placeholder: 'Enter your full name'
|
|
70
|
+
* }
|
|
71
|
+
* ],
|
|
72
|
+
* submitLabel: 'Create Account'
|
|
73
|
+
* };
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example Table enrichment with formatters
|
|
77
|
+
* ```typescript
|
|
78
|
+
* import type { TableItem } from '@skmtc/core/Enrichments';
|
|
79
|
+
*
|
|
80
|
+
* const userTable: TableItem = {
|
|
81
|
+
* title: 'User Directory',
|
|
82
|
+
* columns: [
|
|
83
|
+
* {
|
|
84
|
+
* id: 'email',
|
|
85
|
+
* accessorPath: ['email'],
|
|
86
|
+
* formatter: { moduleName: 'EmailFormatter', exportName: 'default' },
|
|
87
|
+
* label: 'Email Address'
|
|
88
|
+
* }
|
|
89
|
+
* ]
|
|
90
|
+
* };
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @module Enrichments
|
|
94
|
+
*/
|
|
37
95
|
require("../_dnt.polyfills.js");
|
|
38
96
|
const ModuleExport_js_1 = require("./ModuleExport.js");
|
|
39
97
|
const v = __importStar(require("valibot"));
|
|
@@ -1,3 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview SKMTC Core Settings and Configuration
|
|
3
|
+
*
|
|
4
|
+
* This module provides comprehensive configuration types and schemas for the SKMTC
|
|
5
|
+
* code generation pipeline. It defines settings for generators, modules, packages,
|
|
6
|
+
* and runtime behavior that control how OpenAPI documents are processed and what
|
|
7
|
+
* artifacts are generated.
|
|
8
|
+
*
|
|
9
|
+
* ## Key Features
|
|
10
|
+
*
|
|
11
|
+
* - **Generator Configuration**: Settings for individual code generators
|
|
12
|
+
* - **Module Management**: Package and module resolution configuration
|
|
13
|
+
* - **Runtime Settings**: Control generation behavior and output preferences
|
|
14
|
+
* - **Enrichment Integration**: Support for UI enrichment metadata
|
|
15
|
+
* - **Type Safety**: Comprehensive Valibot validation for all configuration
|
|
16
|
+
*
|
|
17
|
+
* @example Basic generator settings
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import type { Settings } from '@skmtc/core/Settings';
|
|
20
|
+
*
|
|
21
|
+
* const settings: Settings = {
|
|
22
|
+
* generators: {
|
|
23
|
+
* 'my-generator': {
|
|
24
|
+
* enabled: true,
|
|
25
|
+
* config: {
|
|
26
|
+
* outputPath: './generated',
|
|
27
|
+
* typescript: true
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* },
|
|
31
|
+
* enrichments: {},
|
|
32
|
+
* filters: {
|
|
33
|
+
* includePaths: ['/api/v1/*'],
|
|
34
|
+
* excludeMethods: ['OPTIONS']
|
|
35
|
+
* }
|
|
36
|
+
* };
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example Module package configuration
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import type { ModulePackage } from '@skmtc/core/Settings';
|
|
42
|
+
*
|
|
43
|
+
* const moduleConfig: ModulePackage = {
|
|
44
|
+
* rootPath: './src/generated',
|
|
45
|
+
* moduleName: '@my-org/api-client'
|
|
46
|
+
* };
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @module Settings
|
|
50
|
+
*/
|
|
1
51
|
import "../_dnt.polyfills.js";
|
|
2
52
|
import { type GeneratorEnrichments } from './Enrichments.js';
|
|
3
53
|
import * as v from 'valibot';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../src/types/Settings.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../src/types/Settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAClF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,aAAa,CAAA;AAEjD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa,CAGvD,CAAA;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAA;IAChB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,aAAa,CAAC,SAAS,CAAyC,CAAA;AAE1F;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,aAAa,CAAC,cAAc,CAAmC,CAAA;AAE9F;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,aAAa,CAAC,UAAU,CAA6C,CAAA;AAIhG;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,aAAa,CAAC,cAAc,CAKzD,CAAA;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAEhD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GAAG,cAAc,GAAG,UAAU,GAAG,MAAM,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAA;IAC1B,kDAAkD;IAClD,WAAW,CAAC,EAAE,oBAAoB,CAAA;IAClC,sDAAsD;IACtD,IAAI,CAAC,EAAE,IAAI,EAAE,CAAA;CACd,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0DAA0D;IAC1D,QAAQ,EAAE,cAAc,CAAA;CACzB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,aAAa,CAAC,iBAAiB,CAG/D,CAAA"}
|
package/script/types/Settings.js
CHANGED
|
@@ -34,6 +34,56 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.skmtcClientConfig = exports.clientSettings = exports.skipModels = exports.skipOperations = exports.skipPaths = exports.modulePackage = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* @fileoverview SKMTC Core Settings and Configuration
|
|
39
|
+
*
|
|
40
|
+
* This module provides comprehensive configuration types and schemas for the SKMTC
|
|
41
|
+
* code generation pipeline. It defines settings for generators, modules, packages,
|
|
42
|
+
* and runtime behavior that control how OpenAPI documents are processed and what
|
|
43
|
+
* artifacts are generated.
|
|
44
|
+
*
|
|
45
|
+
* ## Key Features
|
|
46
|
+
*
|
|
47
|
+
* - **Generator Configuration**: Settings for individual code generators
|
|
48
|
+
* - **Module Management**: Package and module resolution configuration
|
|
49
|
+
* - **Runtime Settings**: Control generation behavior and output preferences
|
|
50
|
+
* - **Enrichment Integration**: Support for UI enrichment metadata
|
|
51
|
+
* - **Type Safety**: Comprehensive Valibot validation for all configuration
|
|
52
|
+
*
|
|
53
|
+
* @example Basic generator settings
|
|
54
|
+
* ```typescript
|
|
55
|
+
* import type { Settings } from '@skmtc/core/Settings';
|
|
56
|
+
*
|
|
57
|
+
* const settings: Settings = {
|
|
58
|
+
* generators: {
|
|
59
|
+
* 'my-generator': {
|
|
60
|
+
* enabled: true,
|
|
61
|
+
* config: {
|
|
62
|
+
* outputPath: './generated',
|
|
63
|
+
* typescript: true
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* },
|
|
67
|
+
* enrichments: {},
|
|
68
|
+
* filters: {
|
|
69
|
+
* includePaths: ['/api/v1/*'],
|
|
70
|
+
* excludeMethods: ['OPTIONS']
|
|
71
|
+
* }
|
|
72
|
+
* };
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @example Module package configuration
|
|
76
|
+
* ```typescript
|
|
77
|
+
* import type { ModulePackage } from '@skmtc/core/Settings';
|
|
78
|
+
*
|
|
79
|
+
* const moduleConfig: ModulePackage = {
|
|
80
|
+
* rootPath: './src/generated',
|
|
81
|
+
* moduleName: '@my-org/api-client'
|
|
82
|
+
* };
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @module Settings
|
|
86
|
+
*/
|
|
37
87
|
require("../_dnt.polyfills.js");
|
|
38
88
|
const Enrichments_js_1 = require("./Enrichments.js");
|
|
39
89
|
const v = __importStar(require("valibot"));
|