@skmtc/core 0.0.808 → 0.0.810
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/context/types.d.ts +0 -8
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/model/toModelBase.d.ts +24 -2
- package/esm/dsl/model/toModelBase.d.ts.map +1 -1
- package/esm/dsl/model/types.d.ts +2 -2
- package/esm/dsl/operation/toOperationBase.d.ts +26 -3
- package/esm/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/types.d.ts +2 -2
- package/esm/oas/array/array-types.d.ts +238 -25
- package/esm/oas/array/array-types.d.ts.map +1 -1
- package/esm/oas/array/array-types.js +97 -5
- package/esm/oas/boolean/boolean-types.d.ts +81 -9
- package/esm/oas/boolean/boolean-types.d.ts.map +1 -1
- package/esm/oas/boolean/boolean-types.js +32 -2
- package/esm/oas/contact/contact-types.d.ts +176 -0
- package/esm/oas/contact/contact-types.d.ts.map +1 -1
- package/esm/oas/contact/contact-types.js +102 -0
- package/esm/oas/header/Header.d.ts +8 -185
- package/esm/oas/header/Header.d.ts.map +1 -1
- package/esm/oas/header/Header.js +57 -220
- package/esm/oas/mediaType/toMediaTypeItemV3.d.ts +288 -0
- package/esm/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/esm/oas/mediaType/toMediaTypeItemV3.js +272 -0
- package/esm/oas/operation/operation-types.d.ts +251 -0
- package/esm/oas/operation/operation-types.d.ts.map +1 -1
- package/esm/oas/operation/operation-types.js +98 -0
- package/esm/oas/string/string-types.d.ts +192 -18
- package/esm/oas/string/string-types.d.ts.map +1 -1
- package/esm/oas/string/string-types.js +76 -4
- package/esm/types/ModuleExport.d.ts +130 -0
- package/esm/types/ModuleExport.d.ts.map +1 -1
- package/esm/types/ModuleExport.js +36 -0
- package/esm/typescript/List.d.ts +2 -2
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +4 -4
- package/esm/typescript/toPathTemplate.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/context/types.d.ts +0 -8
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/model/toModelBase.d.ts +24 -2
- package/script/dsl/model/toModelBase.d.ts.map +1 -1
- package/script/dsl/model/types.d.ts +2 -2
- package/script/dsl/operation/toOperationBase.d.ts +26 -3
- package/script/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/script/dsl/operation/types.d.ts +2 -2
- package/script/oas/array/array-types.d.ts +238 -25
- package/script/oas/array/array-types.d.ts.map +1 -1
- package/script/oas/array/array-types.js +97 -5
- package/script/oas/boolean/boolean-types.d.ts +81 -9
- package/script/oas/boolean/boolean-types.d.ts.map +1 -1
- package/script/oas/boolean/boolean-types.js +32 -2
- package/script/oas/contact/contact-types.d.ts +176 -0
- package/script/oas/contact/contact-types.d.ts.map +1 -1
- package/script/oas/contact/contact-types.js +102 -0
- package/script/oas/header/Header.d.ts +8 -185
- package/script/oas/header/Header.d.ts.map +1 -1
- package/script/oas/header/Header.js +57 -220
- package/script/oas/mediaType/toMediaTypeItemV3.d.ts +288 -0
- package/script/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/script/oas/mediaType/toMediaTypeItemV3.js +272 -0
- package/script/oas/operation/operation-types.d.ts +251 -0
- package/script/oas/operation/operation-types.d.ts.map +1 -1
- package/script/oas/operation/operation-types.js +98 -0
- package/script/oas/string/string-types.d.ts +192 -18
- package/script/oas/string/string-types.d.ts.map +1 -1
- package/script/oas/string/string-types.js +76 -4
- package/script/types/ModuleExport.d.ts +130 -0
- package/script/types/ModuleExport.d.ts.map +1 -1
- package/script/types/ModuleExport.js +36 -0
- package/script/typescript/List.d.ts +2 -2
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +4 -4
- package/script/typescript/toPathTemplate.d.ts.map +1 -1
|
@@ -2,54 +2,228 @@ import * as v from 'valibot';
|
|
|
2
2
|
/**
|
|
3
3
|
* Union type for OpenAPI string format specifiers.
|
|
4
4
|
*
|
|
5
|
-
* Represents the standard string formats defined in OpenAPI v3,
|
|
6
|
-
* providing semantic meaning for string validation and processing.
|
|
7
|
-
*
|
|
5
|
+
* Represents the standard string formats defined in the OpenAPI v3 specification,
|
|
6
|
+
* providing semantic meaning for string validation and processing. These formats
|
|
7
|
+
* are used by generators to produce appropriate validation rules, UI components,
|
|
8
|
+
* and type annotations in target languages.
|
|
9
|
+
*
|
|
10
|
+
* ## Format Categories
|
|
11
|
+
*
|
|
12
|
+
* **Date/Time Formats:**
|
|
13
|
+
* - `date-time`: Full RFC3339 date-time (e.g., "2018-03-20T09:12:28Z")
|
|
14
|
+
* - `time`: RFC3339 time only (e.g., "09:12:28")
|
|
15
|
+
* - `date`: RFC3339 full-date (e.g., "2018-03-20")
|
|
16
|
+
* - `duration`: RFC3339 duration (e.g., "P3Y6M4DT12H30M5S")
|
|
17
|
+
*
|
|
18
|
+
* **Network Formats:**
|
|
19
|
+
* - `email`: RFC5322 email address
|
|
20
|
+
* - `hostname`: RFC1123 hostname
|
|
21
|
+
* - `ipv4`: IPv4 address
|
|
22
|
+
* - `ipv6`: IPv6 address
|
|
23
|
+
* - `uri`: RFC3986 URI
|
|
24
|
+
* - `uuid`: RFC4122 UUID
|
|
25
|
+
*
|
|
26
|
+
* **Encoding/Pattern Formats:**
|
|
27
|
+
* - `regex`: Regular expression pattern
|
|
28
|
+
* - `password`: Password field hint for UI components
|
|
29
|
+
* - `byte`: Base64 encoded data
|
|
30
|
+
* - `binary`: Binary data
|
|
31
|
+
*
|
|
32
|
+
* @example Using string formats in schema definitions
|
|
33
|
+
* ```typescript
|
|
34
|
+
* import type { StringFormat } from '@skmtc/core/oas/string';
|
|
35
|
+
*
|
|
36
|
+
* const emailFormat: StringFormat = 'email';
|
|
37
|
+
* const timestampFormat: StringFormat = 'date-time';
|
|
38
|
+
* ```
|
|
8
39
|
*/
|
|
9
40
|
export type StringFormat = 'date-time' | 'time' | 'date' | 'duration' | 'email' | 'hostname' | 'ipv4' | 'ipv6' | 'uuid' | 'uri' | 'regex' | 'password' | 'byte' | 'binary';
|
|
10
41
|
/**
|
|
11
42
|
* Valibot enum schema for valid OpenAPI string format values.
|
|
12
43
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
44
|
+
* This schema validates that string format values conform to the OpenAPI v3
|
|
45
|
+
* specification's standard format identifiers. It includes date/time formats,
|
|
46
|
+
* network address formats, and encoding formats that provide semantic meaning
|
|
47
|
+
* for string validation and UI generation.
|
|
48
|
+
*
|
|
49
|
+
* @example Validating string formats
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { stringFormat } from '@skmtc/core/oas/string';
|
|
52
|
+
* import * as v from 'valibot';
|
|
53
|
+
*
|
|
54
|
+
* const validFormat = v.parse(stringFormat, 'email'); // 'email'
|
|
55
|
+
* const invalidFormat = v.parse(stringFormat, 'invalid'); // Throws ValiError
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example Using in schema validation
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const schema = {
|
|
61
|
+
* type: 'string',
|
|
62
|
+
* format: 'email',
|
|
63
|
+
* description: 'User email address'
|
|
64
|
+
* };
|
|
65
|
+
*
|
|
66
|
+
* // Validate the format field
|
|
67
|
+
* if (schema.format) {
|
|
68
|
+
* const validatedFormat = v.parse(stringFormat, schema.format);
|
|
69
|
+
* console.log(`Valid format: ${validatedFormat}`);
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
15
72
|
*/
|
|
16
73
|
export declare const stringFormat: v.GenericSchema<StringFormat>;
|
|
17
74
|
/**
|
|
18
75
|
* Valibot schema for validating OpenAPI string data objects.
|
|
19
76
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
77
|
+
* This comprehensive schema validates OpenAPI string schemas according to the
|
|
78
|
+
* OpenAPI v3 specification, including all standard properties like length
|
|
79
|
+
* constraints, pattern validation, format specifiers, enumeration values,
|
|
80
|
+
* and metadata fields. Used throughout the SKMTC pipeline for runtime
|
|
81
|
+
* validation of string schema definitions.
|
|
82
|
+
*
|
|
83
|
+
* @example Validating a basic string schema
|
|
84
|
+
* ```typescript
|
|
85
|
+
* import { oasStringData } from '@skmtc/core/oas/string';
|
|
86
|
+
* import * as v from 'valibot';
|
|
87
|
+
*
|
|
88
|
+
* const schema = {
|
|
89
|
+
* type: 'string',
|
|
90
|
+
* description: 'User name',
|
|
91
|
+
* minLength: 1,
|
|
92
|
+
* maxLength: 100,
|
|
93
|
+
* pattern: '^[a-zA-Z\\s]+$'
|
|
94
|
+
* };
|
|
95
|
+
*
|
|
96
|
+
* const validated = v.parse(oasStringData, schema);
|
|
97
|
+
* console.log(validated.minLength); // 1
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* @example Validating formatted strings
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const emailSchema = {
|
|
103
|
+
* type: 'string',
|
|
104
|
+
* format: 'email',
|
|
105
|
+
* title: 'Email Address',
|
|
106
|
+
* example: 'user@example.com'
|
|
107
|
+
* };
|
|
108
|
+
*
|
|
109
|
+
* const result = v.parse(oasStringData, emailSchema);
|
|
110
|
+
* console.log(result.format); // 'email'
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @example Validating enumerated strings
|
|
114
|
+
* ```typescript
|
|
115
|
+
* const statusSchema = {
|
|
116
|
+
* type: 'string',
|
|
117
|
+
* enum: ['pending', 'approved', 'rejected'],
|
|
118
|
+
* default: 'pending',
|
|
119
|
+
* description: 'Application status'
|
|
120
|
+
* };
|
|
121
|
+
*
|
|
122
|
+
* const validated = v.parse(oasStringData, statusSchema);
|
|
123
|
+
* console.log(validated.enum); // ['pending', 'approved', 'rejected']
|
|
124
|
+
* ```
|
|
22
125
|
*/
|
|
23
126
|
export declare const oasStringData: v.GenericSchema<OasStringData>;
|
|
24
127
|
/**
|
|
25
128
|
* Data type for OpenAPI string schema objects.
|
|
26
129
|
*
|
|
27
|
-
* Represents string schemas
|
|
28
|
-
*
|
|
29
|
-
*
|
|
130
|
+
* Represents the complete structure of OpenAPI string schemas as processed by the
|
|
131
|
+
* SKMTC pipeline. This type includes all standard OpenAPI string schema properties
|
|
132
|
+
* including validation constraints (length, pattern), format specifiers, enumeration
|
|
133
|
+
* values, and metadata fields. It's used throughout the string processing pipeline
|
|
134
|
+
* for type-safe handling of string schema definitions.
|
|
135
|
+
*
|
|
136
|
+
* ## Usage in SKMTC Pipeline
|
|
137
|
+
*
|
|
138
|
+
* This type is used by:
|
|
139
|
+
* - Schema parsers to validate incoming string schema data
|
|
140
|
+
* - String processors to transform OpenAPI schemas into OAS objects
|
|
141
|
+
* - Code generators to access string constraints and generate validation code
|
|
142
|
+
* - UI generators to create appropriate form controls based on formats and constraints
|
|
143
|
+
*
|
|
144
|
+
* @example Basic string schema
|
|
145
|
+
* ```typescript
|
|
146
|
+
* import type { OasStringData } from '@skmtc/core/oas/string';
|
|
147
|
+
*
|
|
148
|
+
* const nameSchema: OasStringData = {
|
|
149
|
+
* type: 'string',
|
|
150
|
+
* title: 'Full Name',
|
|
151
|
+
* description: 'User full name',
|
|
152
|
+
* minLength: 1,
|
|
153
|
+
* maxLength: 200,
|
|
154
|
+
* example: 'John Doe'
|
|
155
|
+
* };
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* @example Email string with format
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const emailSchema: OasStringData = {
|
|
161
|
+
* type: 'string',
|
|
162
|
+
* format: 'email',
|
|
163
|
+
* title: 'Email Address',
|
|
164
|
+
* description: 'User email for notifications',
|
|
165
|
+
* example: 'john.doe@example.com'
|
|
166
|
+
* };
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @example Enumerated string values
|
|
170
|
+
* ```typescript
|
|
171
|
+
* const roleSchema: OasStringData = {
|
|
172
|
+
* type: 'string',
|
|
173
|
+
* title: 'User Role',
|
|
174
|
+
* description: 'User access level',
|
|
175
|
+
* enum: ['admin', 'moderator', 'user', 'guest'],
|
|
176
|
+
* default: 'user'
|
|
177
|
+
* };
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* @example Pattern-constrained string
|
|
181
|
+
* ```typescript
|
|
182
|
+
* const phoneSchema: OasStringData = {
|
|
183
|
+
* type: 'string',
|
|
184
|
+
* title: 'Phone Number',
|
|
185
|
+
* description: 'US phone number',
|
|
186
|
+
* pattern: '^\\+?1?[2-9]\\d{9}$',
|
|
187
|
+
* example: '+1234567890',
|
|
188
|
+
* minLength: 10,
|
|
189
|
+
* maxLength: 15
|
|
190
|
+
* };
|
|
191
|
+
* ```
|
|
192
|
+
*
|
|
193
|
+
* @example Nullable string with constraints
|
|
194
|
+
* ```typescript
|
|
195
|
+
* const commentSchema: OasStringData = {
|
|
196
|
+
* type: 'string',
|
|
197
|
+
* title: 'Comment',
|
|
198
|
+
* description: 'Optional user comment',
|
|
199
|
+
* maxLength: 500,
|
|
200
|
+
* nullable: true,
|
|
201
|
+
* default: null
|
|
202
|
+
* };
|
|
203
|
+
* ```
|
|
30
204
|
*/
|
|
31
205
|
export type OasStringData = {
|
|
32
|
-
/** Human-readable title for the string */
|
|
206
|
+
/** Human-readable title for the string schema */
|
|
33
207
|
title?: string;
|
|
34
|
-
/** Detailed description
|
|
208
|
+
/** Detailed description explaining the string's purpose and usage */
|
|
35
209
|
description?: string;
|
|
36
|
-
/** Default value
|
|
210
|
+
/** Default value used when no explicit value is provided */
|
|
37
211
|
default?: string;
|
|
38
212
|
/** Type identifier (always 'string') */
|
|
39
213
|
type: 'string';
|
|
40
|
-
/** Maximum allowed length */
|
|
214
|
+
/** Maximum allowed length in characters */
|
|
41
215
|
maxLength?: number;
|
|
42
|
-
/** Minimum required length */
|
|
216
|
+
/** Minimum required length in characters */
|
|
43
217
|
minLength?: number;
|
|
44
218
|
/** Regular expression pattern for validation */
|
|
45
219
|
pattern?: string;
|
|
46
220
|
/** Array of valid enumeration values */
|
|
47
221
|
enum?: string[];
|
|
48
|
-
/** Format specifier (date-time,
|
|
222
|
+
/** Format specifier (email, date-time, uuid, etc.) */
|
|
49
223
|
format?: string;
|
|
50
|
-
/** Whether null values are allowed */
|
|
224
|
+
/** Whether null values are allowed in addition to string values */
|
|
51
225
|
nullable?: boolean;
|
|
52
|
-
/** Example value for documentation */
|
|
226
|
+
/** Example value for documentation and testing */
|
|
53
227
|
example?: string;
|
|
54
228
|
};
|
|
55
229
|
//# sourceMappingURL=string-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-types.d.ts","sourceRoot":"","sources":["../../../src/oas/string/string-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B
|
|
1
|
+
{"version":3,"file":"string-types.d.ts","sourceRoot":"","sources":["../../../src/oas/string/string-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,UAAU,GACV,MAAM,GACN,MAAM,GACN,MAAM,GACN,KAAK,GACL,OAAO,GACP,UAAU,GACV,MAAM,GACN,QAAQ,CAAA;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,aAAa,CAAC,YAAY,CAerD,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa,CAYvD,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wCAAwC;IACxC,IAAI,EAAE,QAAQ,CAAA;IACd,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA"}
|
|
@@ -2,8 +2,34 @@ import * as v from 'valibot';
|
|
|
2
2
|
/**
|
|
3
3
|
* Valibot enum schema for valid OpenAPI string format values.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* This schema validates that string format values conform to the OpenAPI v3
|
|
6
|
+
* specification's standard format identifiers. It includes date/time formats,
|
|
7
|
+
* network address formats, and encoding formats that provide semantic meaning
|
|
8
|
+
* for string validation and UI generation.
|
|
9
|
+
*
|
|
10
|
+
* @example Validating string formats
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { stringFormat } from '@skmtc/core/oas/string';
|
|
13
|
+
* import * as v from 'valibot';
|
|
14
|
+
*
|
|
15
|
+
* const validFormat = v.parse(stringFormat, 'email'); // 'email'
|
|
16
|
+
* const invalidFormat = v.parse(stringFormat, 'invalid'); // Throws ValiError
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example Using in schema validation
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const schema = {
|
|
22
|
+
* type: 'string',
|
|
23
|
+
* format: 'email',
|
|
24
|
+
* description: 'User email address'
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* // Validate the format field
|
|
28
|
+
* if (schema.format) {
|
|
29
|
+
* const validatedFormat = v.parse(stringFormat, schema.format);
|
|
30
|
+
* console.log(`Valid format: ${validatedFormat}`);
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
7
33
|
*/
|
|
8
34
|
export const stringFormat = v.enum({
|
|
9
35
|
'date-time': 'date-time',
|
|
@@ -24,8 +50,54 @@ export const stringFormat = v.enum({
|
|
|
24
50
|
/**
|
|
25
51
|
* Valibot schema for validating OpenAPI string data objects.
|
|
26
52
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
53
|
+
* This comprehensive schema validates OpenAPI string schemas according to the
|
|
54
|
+
* OpenAPI v3 specification, including all standard properties like length
|
|
55
|
+
* constraints, pattern validation, format specifiers, enumeration values,
|
|
56
|
+
* and metadata fields. Used throughout the SKMTC pipeline for runtime
|
|
57
|
+
* validation of string schema definitions.
|
|
58
|
+
*
|
|
59
|
+
* @example Validating a basic string schema
|
|
60
|
+
* ```typescript
|
|
61
|
+
* import { oasStringData } from '@skmtc/core/oas/string';
|
|
62
|
+
* import * as v from 'valibot';
|
|
63
|
+
*
|
|
64
|
+
* const schema = {
|
|
65
|
+
* type: 'string',
|
|
66
|
+
* description: 'User name',
|
|
67
|
+
* minLength: 1,
|
|
68
|
+
* maxLength: 100,
|
|
69
|
+
* pattern: '^[a-zA-Z\\s]+$'
|
|
70
|
+
* };
|
|
71
|
+
*
|
|
72
|
+
* const validated = v.parse(oasStringData, schema);
|
|
73
|
+
* console.log(validated.minLength); // 1
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example Validating formatted strings
|
|
77
|
+
* ```typescript
|
|
78
|
+
* const emailSchema = {
|
|
79
|
+
* type: 'string',
|
|
80
|
+
* format: 'email',
|
|
81
|
+
* title: 'Email Address',
|
|
82
|
+
* example: 'user@example.com'
|
|
83
|
+
* };
|
|
84
|
+
*
|
|
85
|
+
* const result = v.parse(oasStringData, emailSchema);
|
|
86
|
+
* console.log(result.format); // 'email'
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @example Validating enumerated strings
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const statusSchema = {
|
|
92
|
+
* type: 'string',
|
|
93
|
+
* enum: ['pending', 'approved', 'rejected'],
|
|
94
|
+
* default: 'pending',
|
|
95
|
+
* description: 'Application status'
|
|
96
|
+
* };
|
|
97
|
+
*
|
|
98
|
+
* const validated = v.parse(oasStringData, statusSchema);
|
|
99
|
+
* console.log(validated.enum); // ['pending', 'approved', 'rejected']
|
|
100
|
+
* ```
|
|
29
101
|
*/
|
|
30
102
|
export const oasStringData = v.object({
|
|
31
103
|
type: v.literal('string'),
|
|
@@ -1,8 +1,138 @@
|
|
|
1
1
|
import "../_dnt.polyfills.js";
|
|
2
2
|
import * as v from 'valibot';
|
|
3
|
+
/**
|
|
4
|
+
* Valibot schema for validating module export configuration objects.
|
|
5
|
+
*
|
|
6
|
+
* This schema validates module export structures used throughout the SKMTC
|
|
7
|
+
* code generation pipeline. Module exports define how generated code modules
|
|
8
|
+
* are exposed and imported, specifying both the export name and the file path
|
|
9
|
+
* where the export can be found.
|
|
10
|
+
*
|
|
11
|
+
* @example Validating a basic module export
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { moduleExport } from '@skmtc/core/types';
|
|
14
|
+
* import * as v from 'valibot';
|
|
15
|
+
*
|
|
16
|
+
* const config = {
|
|
17
|
+
* exportName: 'UserApi',
|
|
18
|
+
* exportPath: './generated/UserApi.ts'
|
|
19
|
+
* };
|
|
20
|
+
*
|
|
21
|
+
* const validated = v.parse(moduleExport, config);
|
|
22
|
+
* console.log(validated.exportName); // 'UserApi'
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example Validating multiple exports
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const exports = [
|
|
28
|
+
* { exportName: 'createUser', exportPath: './api/users.ts' },
|
|
29
|
+
* { exportName: 'updateUser', exportPath: './api/users.ts' },
|
|
30
|
+
* { exportName: 'UserModel', exportPath: './models/User.ts' }
|
|
31
|
+
* ];
|
|
32
|
+
*
|
|
33
|
+
* exports.forEach(exp => {
|
|
34
|
+
* const validated = v.parse(moduleExport, exp);
|
|
35
|
+
* console.log(`Export: ${validated.exportName} from ${validated.exportPath}`);
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
3
39
|
export declare const moduleExport: v.GenericSchema<ModuleExport>;
|
|
40
|
+
/**
|
|
41
|
+
* Configuration object for module exports in the SKMTC pipeline.
|
|
42
|
+
*
|
|
43
|
+
* This type defines the structure for describing how generated code modules
|
|
44
|
+
* should be exported and made available for import. It's used throughout
|
|
45
|
+
* the SKMTC system for organizing generated code, managing dependencies,
|
|
46
|
+
* and creating proper import/export relationships between generated files.
|
|
47
|
+
*
|
|
48
|
+
* ## Usage in SKMTC Pipeline
|
|
49
|
+
*
|
|
50
|
+
* This type is used by:
|
|
51
|
+
* - Code generators to define export configurations
|
|
52
|
+
* - File processors to organize generated modules
|
|
53
|
+
* - Import managers to resolve module dependencies
|
|
54
|
+
* - Build systems to understand code structure
|
|
55
|
+
*
|
|
56
|
+
* @example Basic module export definition
|
|
57
|
+
* ```typescript
|
|
58
|
+
* import type { ModuleExport } from '@skmtc/core/types';
|
|
59
|
+
*
|
|
60
|
+
* const apiExport: ModuleExport = {
|
|
61
|
+
* exportName: 'UserApiClient',
|
|
62
|
+
* exportPath: './generated/api/UserApiClient.ts'
|
|
63
|
+
* };
|
|
64
|
+
*
|
|
65
|
+
* console.log(`Import ${apiExport.exportName} from '${apiExport.exportPath}'`);
|
|
66
|
+
* // Import UserApiClient from './generated/api/UserApiClient.ts'
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example Function export configuration
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const functionExport: ModuleExport = {
|
|
72
|
+
* exportName: 'validateUserData',
|
|
73
|
+
* exportPath: './generated/validators/userValidation.ts'
|
|
74
|
+
* };
|
|
75
|
+
*
|
|
76
|
+
* // Used to generate: export { validateUserData } from './generated/validators/userValidation.ts'
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @example Type export configuration
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const typeExport: ModuleExport = {
|
|
82
|
+
* exportName: 'UserType',
|
|
83
|
+
* exportPath: './generated/types/User.ts'
|
|
84
|
+
* };
|
|
85
|
+
*
|
|
86
|
+
* // Used to generate: export type { UserType } from './generated/types/User.ts'
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @example Multiple exports from same file
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const userModuleExports: ModuleExport[] = [
|
|
92
|
+
* {
|
|
93
|
+
* exportName: 'User',
|
|
94
|
+
* exportPath: './generated/models/User.ts'
|
|
95
|
+
* },
|
|
96
|
+
* {
|
|
97
|
+
* exportName: 'UserValidator',
|
|
98
|
+
* exportPath: './generated/models/User.ts'
|
|
99
|
+
* },
|
|
100
|
+
* {
|
|
101
|
+
* exportName: 'createUser',
|
|
102
|
+
* exportPath: './generated/models/User.ts'
|
|
103
|
+
* }
|
|
104
|
+
* ];
|
|
105
|
+
*
|
|
106
|
+
* // All exports reference the same file but different symbols
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @example Integration with build systems
|
|
110
|
+
* ```typescript
|
|
111
|
+
* class ModuleRegistry {
|
|
112
|
+
* private exports: ModuleExport[] = [];
|
|
113
|
+
*
|
|
114
|
+
* addExport(moduleExport: ModuleExport) {
|
|
115
|
+
* this.exports.push(moduleExport);
|
|
116
|
+
* }
|
|
117
|
+
*
|
|
118
|
+
* generateIndexFile(): string {
|
|
119
|
+
* return this.exports
|
|
120
|
+
* .map(exp => `export { ${exp.exportName} } from '${exp.exportPath}';`)
|
|
121
|
+
* .join('\n');
|
|
122
|
+
* }
|
|
123
|
+
* }
|
|
124
|
+
*
|
|
125
|
+
* const registry = new ModuleRegistry();
|
|
126
|
+
* registry.addExport({
|
|
127
|
+
* exportName: 'ApiClient',
|
|
128
|
+
* exportPath: './api/client.ts'
|
|
129
|
+
* });
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
4
132
|
export type ModuleExport = {
|
|
133
|
+
/** The name of the symbol being exported (function, class, type, etc.) */
|
|
5
134
|
exportName: string;
|
|
135
|
+
/** The file path where the export can be found */
|
|
6
136
|
exportPath: string;
|
|
7
137
|
};
|
|
8
138
|
//# sourceMappingURL=ModuleExport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleExport.d.ts","sourceRoot":"","sources":["../../src/types/ModuleExport.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,aAAa,CAAC,YAAY,CAGrD,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA"}
|
|
1
|
+
{"version":3,"file":"ModuleExport.d.ts","sourceRoot":"","sources":["../../src/types/ModuleExport.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,aAAa,CAAC,YAAY,CAGrD,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,0EAA0E;IAC1E,UAAU,EAAE,MAAM,CAAA;IAClB,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA"}
|
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
import "../_dnt.polyfills.js";
|
|
2
2
|
import * as v from 'valibot';
|
|
3
|
+
/**
|
|
4
|
+
* Valibot schema for validating module export configuration objects.
|
|
5
|
+
*
|
|
6
|
+
* This schema validates module export structures used throughout the SKMTC
|
|
7
|
+
* code generation pipeline. Module exports define how generated code modules
|
|
8
|
+
* are exposed and imported, specifying both the export name and the file path
|
|
9
|
+
* where the export can be found.
|
|
10
|
+
*
|
|
11
|
+
* @example Validating a basic module export
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { moduleExport } from '@skmtc/core/types';
|
|
14
|
+
* import * as v from 'valibot';
|
|
15
|
+
*
|
|
16
|
+
* const config = {
|
|
17
|
+
* exportName: 'UserApi',
|
|
18
|
+
* exportPath: './generated/UserApi.ts'
|
|
19
|
+
* };
|
|
20
|
+
*
|
|
21
|
+
* const validated = v.parse(moduleExport, config);
|
|
22
|
+
* console.log(validated.exportName); // 'UserApi'
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example Validating multiple exports
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const exports = [
|
|
28
|
+
* { exportName: 'createUser', exportPath: './api/users.ts' },
|
|
29
|
+
* { exportName: 'updateUser', exportPath: './api/users.ts' },
|
|
30
|
+
* { exportName: 'UserModel', exportPath: './models/User.ts' }
|
|
31
|
+
* ];
|
|
32
|
+
*
|
|
33
|
+
* exports.forEach(exp => {
|
|
34
|
+
* const validated = v.parse(moduleExport, exp);
|
|
35
|
+
* console.log(`Export: ${validated.exportName} from ${validated.exportPath}`);
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
3
39
|
export const moduleExport = v.object({
|
|
4
40
|
exportName: v.string(),
|
|
5
41
|
exportPath: v.string()
|
package/esm/typescript/List.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export type ListKeyValue<Key extends Stringable, Value extends Stringable> = Lis
|
|
|
27
27
|
/**
|
|
28
28
|
* Type representing the different bookend styles for lists.
|
|
29
29
|
*/
|
|
30
|
-
export type BookendsType = '[]' | '{}' | '()' | '
|
|
30
|
+
export type BookendsType = '[]' | '{}' | '()' | 'none';
|
|
31
31
|
type ConstructorOptions<Separator extends string = ', ', Bookends extends BookendsType = 'none'> = {
|
|
32
32
|
separator?: Separator;
|
|
33
33
|
bookends?: Bookends;
|
|
@@ -62,7 +62,7 @@ type ToConditionalReturn<Value extends Stringable, Condition extends boolean> =
|
|
|
62
62
|
*
|
|
63
63
|
* @template Values - Array of stringable values
|
|
64
64
|
* @template Separator - String used to separate items
|
|
65
|
-
* @template Bookends - Style of bookends ('[]', '{}', '()', '
|
|
65
|
+
* @template Bookends - Style of bookends ('[]', '{}', '()', 'none')
|
|
66
66
|
*
|
|
67
67
|
* @example Basic usage
|
|
68
68
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/typescript/List.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGtD,4EAA4E;AAC5E,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEpE,2DAA2D;AAC3D,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;AAErE,8EAA8E;AAC9E,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEnE,gFAAgF;AAChF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEpE,kDAAkD;AAClD,MAAM,MAAM,eA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AM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,UAAU,IAAI,CACnE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,KAAK,EAAE,MAAM,KACV,CAAC,GAAG,SAAS,CAAA;AAElB;;;;;;;GAOG;AACH,qBAAa,SAAS,CAAC,CAAC,SAAS,UAAU;IACzC,sCAAsC;IACtC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;IAEnB;;;;OAIG;gBACS,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;IAI/B;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAItE;;;;;OAKG;IACH,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IAIpE;;;;;OAKG;IACH,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;CAGrE"}
|
package/esm/typescript/List.js
CHANGED
|
@@ -22,7 +22,7 @@ import { match } from 'ts-pattern';
|
|
|
22
22
|
*
|
|
23
23
|
* @template Values - Array of stringable values
|
|
24
24
|
* @template Separator - String used to separate items
|
|
25
|
-
* @template Bookends - Style of bookends ('[]', '{}', '()', '
|
|
25
|
+
* @template Bookends - Style of bookends ('[]', '{}', '()', 'none')
|
|
26
26
|
*
|
|
27
27
|
* @example Basic usage
|
|
28
28
|
* ```typescript
|
|
@@ -149,13 +149,13 @@ export class List {
|
|
|
149
149
|
return '';
|
|
150
150
|
}
|
|
151
151
|
const joined = this.values.map(value => value.toString()).join(this.separator);
|
|
152
|
-
return match(this.bookends)
|
|
152
|
+
return (match(this.bookends)
|
|
153
153
|
.with('[]', () => `[${joined}]`)
|
|
154
154
|
.with('{}', () => `{${joined}}`)
|
|
155
155
|
.with('()', () => `(${joined})`)
|
|
156
|
-
.with('<>', () => `<${joined}>`)
|
|
156
|
+
// .with('<>', () => `<${joined}>`)
|
|
157
157
|
.with('none', () => joined)
|
|
158
|
-
.exhaustive();
|
|
158
|
+
.exhaustive());
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toPathTemplate.d.ts","sourceRoot":"","sources":["../../src/typescript/toPathTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"toPathTemplate.d.ts","sourceRoot":"","sources":["../../src/typescript/toPathTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,MAEhE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { GeneratorKey } from '../types/GeneratorKeys.js';
|
|
2
1
|
import type { ManifestEntry } from '../types/Manifest.js';
|
|
3
2
|
import type { Mapping, Preview } from '../types/Preview.js';
|
|
4
3
|
import type { ResultsItem } from '../types/Results.js';
|
|
@@ -14,13 +13,6 @@ export type GetFileOptions = {
|
|
|
14
13
|
/** Whether to throw an error if the file is not found */
|
|
15
14
|
throwIfNotFound?: boolean;
|
|
16
15
|
};
|
|
17
|
-
/**
|
|
18
|
-
* Arguments for adding a generator key to the context.
|
|
19
|
-
*/
|
|
20
|
-
export type AddGeneratorKeyArgs = {
|
|
21
|
-
/** The generator key to add */
|
|
22
|
-
generatorKey: GeneratorKey;
|
|
23
|
-
};
|
|
24
16
|
/**
|
|
25
17
|
* Result of rendering files in the context.
|
|
26
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEtE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAA;AAEvD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CACrC,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CA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