@skmtc/core 0.0.785 → 0.0.787

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 (93) hide show
  1. package/esm/dsl/ContentSettings.d.ts +164 -0
  2. package/esm/dsl/ContentSettings.d.ts.map +1 -1
  3. package/esm/dsl/ContentSettings.js +151 -0
  4. package/esm/dsl/Definition.d.ts +199 -0
  5. package/esm/dsl/Definition.d.ts.map +1 -1
  6. package/esm/dsl/Definition.js +189 -0
  7. package/esm/dsl/EntityType.d.ts +83 -0
  8. package/esm/dsl/EntityType.d.ts.map +1 -1
  9. package/esm/dsl/EntityType.js +83 -0
  10. package/esm/dsl/Identifier.d.ts +152 -0
  11. package/esm/dsl/Identifier.d.ts.map +1 -1
  12. package/esm/dsl/Identifier.js +152 -0
  13. package/esm/dsl/Import.d.ts +221 -0
  14. package/esm/dsl/Import.d.ts.map +1 -1
  15. package/esm/dsl/Import.js +202 -0
  16. package/esm/dsl/operation/OperationBase.d.ts +181 -1
  17. package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
  18. package/esm/dsl/operation/OperationBase.js +181 -1
  19. package/esm/oas/array/Array.d.ts +109 -1
  20. package/esm/oas/array/Array.d.ts.map +1 -1
  21. package/esm/oas/array/Array.js +93 -1
  22. package/esm/oas/document/Document.d.ts +155 -1
  23. package/esm/oas/document/Document.d.ts.map +1 -1
  24. package/esm/oas/document/Document.js +141 -2
  25. package/esm/oas/integer/Integer.d.ts +98 -0
  26. package/esm/oas/integer/Integer.d.ts.map +1 -1
  27. package/esm/oas/integer/Integer.js +80 -0
  28. package/esm/oas/object/Object.d.ts +255 -10
  29. package/esm/oas/object/Object.d.ts.map +1 -1
  30. package/esm/oas/object/Object.js +229 -10
  31. package/esm/oas/string/String.d.ts +103 -1
  32. package/esm/oas/string/String.d.ts.map +1 -1
  33. package/esm/oas/string/String.js +87 -1
  34. package/esm/types/Brand.d.ts +74 -0
  35. package/esm/types/Brand.d.ts.map +1 -1
  36. package/esm/types/Brand.js +9 -0
  37. package/esm/types/GeneratorKeys.d.ts +336 -0
  38. package/esm/types/GeneratorKeys.d.ts.map +1 -1
  39. package/esm/types/GeneratorKeys.js +243 -0
  40. package/esm/types/GeneratorType.d.ts +119 -0
  41. package/esm/types/GeneratorType.d.ts.map +1 -1
  42. package/esm/types/Method.d.ts +109 -0
  43. package/esm/types/Method.d.ts.map +1 -1
  44. package/esm/types/Method.js +84 -0
  45. package/esm/types/RefName.d.ts +61 -0
  46. package/esm/types/RefName.d.ts.map +1 -1
  47. package/package.json +1 -1
  48. package/script/dsl/ContentSettings.d.ts +164 -0
  49. package/script/dsl/ContentSettings.d.ts.map +1 -1
  50. package/script/dsl/ContentSettings.js +151 -0
  51. package/script/dsl/Definition.d.ts +199 -0
  52. package/script/dsl/Definition.d.ts.map +1 -1
  53. package/script/dsl/Definition.js +189 -0
  54. package/script/dsl/EntityType.d.ts +83 -0
  55. package/script/dsl/EntityType.d.ts.map +1 -1
  56. package/script/dsl/EntityType.js +83 -0
  57. package/script/dsl/Identifier.d.ts +152 -0
  58. package/script/dsl/Identifier.d.ts.map +1 -1
  59. package/script/dsl/Identifier.js +152 -0
  60. package/script/dsl/Import.d.ts +221 -0
  61. package/script/dsl/Import.d.ts.map +1 -1
  62. package/script/dsl/Import.js +202 -0
  63. package/script/dsl/operation/OperationBase.d.ts +181 -1
  64. package/script/dsl/operation/OperationBase.d.ts.map +1 -1
  65. package/script/dsl/operation/OperationBase.js +181 -1
  66. package/script/oas/array/Array.d.ts +109 -1
  67. package/script/oas/array/Array.d.ts.map +1 -1
  68. package/script/oas/array/Array.js +93 -1
  69. package/script/oas/document/Document.d.ts +155 -1
  70. package/script/oas/document/Document.d.ts.map +1 -1
  71. package/script/oas/document/Document.js +141 -2
  72. package/script/oas/integer/Integer.d.ts +98 -0
  73. package/script/oas/integer/Integer.d.ts.map +1 -1
  74. package/script/oas/integer/Integer.js +80 -0
  75. package/script/oas/object/Object.d.ts +255 -10
  76. package/script/oas/object/Object.d.ts.map +1 -1
  77. package/script/oas/object/Object.js +229 -10
  78. package/script/oas/string/String.d.ts +103 -1
  79. package/script/oas/string/String.d.ts.map +1 -1
  80. package/script/oas/string/String.js +87 -1
  81. package/script/types/Brand.d.ts +74 -0
  82. package/script/types/Brand.d.ts.map +1 -1
  83. package/script/types/Brand.js +9 -0
  84. package/script/types/GeneratorKeys.d.ts +336 -0
  85. package/script/types/GeneratorKeys.d.ts.map +1 -1
  86. package/script/types/GeneratorKeys.js +243 -0
  87. package/script/types/GeneratorType.d.ts +119 -0
  88. package/script/types/GeneratorType.d.ts.map +1 -1
  89. package/script/types/Method.d.ts +109 -0
  90. package/script/types/Method.d.ts.map +1 -1
  91. package/script/types/Method.js +84 -0
  92. package/script/types/RefName.d.ts +61 -0
  93. package/script/types/RefName.d.ts.map +1 -1
@@ -15,8 +15,85 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.OasDocument = void 0;
16
16
  require("../../_dnt.polyfills.js");
17
17
  const ts_pattern_1 = require("ts-pattern");
18
- /** Top level document object describing the API */
18
+ /**
19
+ * Represents a complete OpenAPI v3 document in the SKMTC OAS processing system.
20
+ *
21
+ * The `OasDocument` class is the root object in the OAS hierarchy, containing all
22
+ * the information needed to describe a complete REST API. It provides normalized
23
+ * access to document properties with built-in validation and error handling.
24
+ *
25
+ * ## Key Features
26
+ *
27
+ * - **Normalized Structure**: Operations are flattened from nested paths for easier processing
28
+ * - **Lazy Initialization**: Fields are set after construction during parsing
29
+ * - **Type Safety**: All properties are typed and validated on access
30
+ * - **Extensibility**: Supports OpenAPI extension fields (x-* properties)
31
+ * - **JSON Serialization**: Can be converted back to standard OpenAPI JSON format
32
+ *
33
+ * @example Basic document access
34
+ * ```typescript
35
+ * import { OasDocument } from '@skmtc/core';
36
+ *
37
+ * // Document is typically created during parsing
38
+ * const document = new OasDocument();
39
+ * document.fields = {
40
+ * openapi: '3.0.0',
41
+ * info: { title: 'My API', version: '1.0.0' },
42
+ * operations: [
43
+ * // ... parsed operations
44
+ * ],
45
+ * components: {
46
+ * schemas: {
47
+ * User: { type: 'object', properties: { id: { type: 'string' } } }
48
+ * }
49
+ * }
50
+ * };
51
+ *
52
+ * console.log(document.info.title); // 'My API'
53
+ * console.log(document.operations.length); // Number of operations
54
+ * ```
55
+ *
56
+ * @example Iterating over operations
57
+ * ```typescript
58
+ * // Process all operations in the document
59
+ * for (const operation of document.operations) {
60
+ * console.log(`${operation.method.toUpperCase()} ${operation.path}`);
61
+ *
62
+ * if (operation.operationId) {
63
+ * console.log(`Operation ID: ${operation.operationId}`);
64
+ * }
65
+ * }
66
+ * ```
67
+ *
68
+ * @example Working with components
69
+ * ```typescript
70
+ * if (document.components?.schemas) {
71
+ * const userSchema = document.components.schemas.get('User');
72
+ * if (userSchema) {
73
+ * console.log('User schema found:', userSchema);
74
+ * }
75
+ * }
76
+ * ```
77
+ */
19
78
  class OasDocument {
79
+ /**
80
+ * Creates a new OasDocument instance.
81
+ *
82
+ * The document is typically created with undefined fields and populated
83
+ * later during the parsing process. This allows for lazy initialization
84
+ * and proper error handling during document processing.
85
+ *
86
+ * @param fields - Optional document fields (usually set later during parsing)
87
+ *
88
+ * @example
89
+ * ```typescript
90
+ * // Usually created without fields during parsing
91
+ * const document = new OasDocument();
92
+ *
93
+ * // Fields are set later by the parser
94
+ * document.fields = parsedDocumentFields;
95
+ * ```
96
+ */
20
97
  constructor(fields) {
21
98
  /** Static identifier property for OasDocument */
22
99
  Object.defineProperty(this, "oasType", {
@@ -25,10 +102,31 @@ class OasDocument {
25
102
  writable: true,
26
103
  value: 'openapi'
27
104
  });
28
- /** @internal */
105
+ /** @internal Private fields storage */
29
106
  _OasDocument_fields.set(this, void 0);
30
107
  __classPrivateFieldSet(this, _OasDocument_fields, fields, "f");
31
108
  }
109
+ /**
110
+ * Removes an item from the document based on a stack trail path.
111
+ *
112
+ * This method is used internally during document processing to remove
113
+ * specific operations or schema components. The stack trail indicates
114
+ * the path to the item within the document structure.
115
+ *
116
+ * @param stackTrail - Path to the item to remove
117
+ * @returns The removed item, or undefined if not found
118
+ *
119
+ * @internal This method is primarily used by the processing pipeline
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * // Remove an operation at /users POST
124
+ * const removed = document.removeItem(new StackTrail(['paths', '/users', 'post']));
125
+ *
126
+ * // Remove a schema component
127
+ * const removedSchema = document.removeItem(new StackTrail(['components', 'schemas', 'User']));
128
+ * ```
129
+ */
32
130
  removeItem(stackTrail) {
33
131
  const [first, second, third] = stackTrail.stackTrail;
34
132
  return (0, ts_pattern_1.match)(first)
@@ -50,6 +148,26 @@ class OasDocument {
50
148
  throw new Error(`Unexpected stack trail: ${stackTrail}`);
51
149
  });
52
150
  }
151
+ /**
152
+ * Sets the document fields after parsing.
153
+ *
154
+ * This setter is called by the parsing pipeline to populate the document
155
+ * with parsed OpenAPI data. It enables lazy initialization and proper
156
+ * error handling during document processing.
157
+ *
158
+ * @param fields - The parsed document fields
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * const document = new OasDocument();
163
+ * document.fields = {
164
+ * openapi: '3.0.0',
165
+ * info: { title: 'API', version: '1.0' },
166
+ * operations: [],
167
+ * // ... other fields
168
+ * };
169
+ * ```
170
+ */
53
171
  set fields(fields) {
54
172
  __classPrivateFieldSet(this, _OasDocument_fields, fields, "f");
55
173
  }
@@ -108,6 +226,27 @@ class OasDocument {
108
226
  }
109
227
  return __classPrivateFieldGet(this, _OasDocument_fields, "f").extensionFields;
110
228
  }
229
+ /**
230
+ * Converts the document back to a JSON-serializable OpenAPI object.
231
+ *
232
+ * This method serializes the document to a standard OpenAPI v3 format,
233
+ * which can be used for output, validation, or further processing. The
234
+ * resulting object follows the OpenAPI specification structure.
235
+ *
236
+ * @returns A JSON-serializable object representing the OpenAPI document
237
+ *
238
+ * @example
239
+ * ```typescript
240
+ * // Convert document back to standard OpenAPI format
241
+ * const openApiJson = document.toJSON();
242
+ *
243
+ * // Can be stringified for output
244
+ * const yamlString = JSON.stringify(openApiJson, null, 2);
245
+ *
246
+ * // Or used with OpenAPI tools
247
+ * await validateOpenApiDocument(openApiJson);
248
+ * ```
249
+ */
111
250
  toJSON() {
112
251
  return {
113
252
  openapi: this.openapi,
@@ -2,21 +2,119 @@ import "../../_dnt.polyfills.js";
2
2
  import type { OasRef } from '../ref/Ref.js';
3
3
  import type { OpenAPIV3 } from 'openapi-types';
4
4
  import type { ToJsonSchemaOptions } from '../schema/Schema.js';
5
+ /**
6
+ * Constructor fields for {@link OasInteger}.
7
+ *
8
+ * @template Nullable - Whether the integer value can be null
9
+ */
5
10
  export type IntegerFields<Nullable extends boolean | undefined> = {
11
+ /** A short summary of the integer schema */
6
12
  title?: string;
13
+ /** A description of the integer schema */
7
14
  description?: string;
15
+ /** Whether the integer value can be null */
8
16
  nullable?: Nullable;
17
+ /** Integer format specification (int32 or int64) */
9
18
  format?: 'int32' | 'int64';
19
+ /** Default value for the integer */
10
20
  default?: Nullable extends true ? number | null | undefined : number | undefined;
21
+ /** Array of allowed enum values */
11
22
  enums?: Nullable extends true ? (number | null)[] | undefined : number[] | undefined;
23
+ /** Custom extension fields (x-* properties) */
12
24
  extensionFields?: Record<string, unknown>;
25
+ /** Example value for the integer */
13
26
  example?: Nullable extends true ? number | null | undefined : number | undefined;
27
+ /** Number must be a multiple of this value */
14
28
  multipleOf?: number;
29
+ /** Maximum value (inclusive) */
15
30
  maximum?: number;
31
+ /** Whether maximum is exclusive */
16
32
  exclusiveMaximum?: boolean;
33
+ /** Minimum value (inclusive) */
17
34
  minimum?: number;
35
+ /** Whether minimum is exclusive */
18
36
  exclusiveMinimum?: boolean;
19
37
  };
38
+ /**
39
+ * Represents an integer schema in the OpenAPI Specification.
40
+ *
41
+ * `OasInteger` handles integer type definitions with comprehensive validation
42
+ * constraints including range limits, multiple-of validation, format specifications,
43
+ * and enum restrictions. It supports both 32-bit and 64-bit integer formats
44
+ * and provides nullable type support.
45
+ *
46
+ * This class is used throughout the OAS processing pipeline to represent
47
+ * integer fields in API schemas, including IDs, counts, timestamps, and
48
+ * other numeric values that must be whole numbers.
49
+ *
50
+ * ## Key Features
51
+ *
52
+ * - **Format Support**: int32 and int64 format specifications
53
+ * - **Range Validation**: Minimum and maximum value constraints
54
+ * - **Multiple Validation**: Ensure values are multiples of specified numbers
55
+ * - **Enum Values**: Restricted sets of allowed integer values
56
+ * - **Nullable Support**: Type-safe nullable integer handling
57
+ * - **JSON Schema**: Conversion to standard JSON Schema format
58
+ *
59
+ * @template Nullable - Whether the integer value can be null
60
+ *
61
+ * @example Basic integer schema
62
+ * ```typescript
63
+ * import { OasInteger } from '@skmtc/core';
64
+ *
65
+ * const ageInteger = new OasInteger({
66
+ * title: 'Age',
67
+ * description: 'Person age in years',
68
+ * minimum: 0,
69
+ * maximum: 150,
70
+ * example: 25
71
+ * });
72
+ * ```
73
+ *
74
+ * @example ID with int64 format
75
+ * ```typescript
76
+ * const userIdInteger = new OasInteger({
77
+ * title: 'User ID',
78
+ * description: 'Unique user identifier',
79
+ * format: 'int64',
80
+ * minimum: 1,
81
+ * example: 1234567890123
82
+ * });
83
+ * ```
84
+ *
85
+ * @example Count with multiple-of validation
86
+ * ```typescript
87
+ * const batchSizeInteger = new OasInteger({
88
+ * title: 'Batch Size',
89
+ * description: 'Number of items to process',
90
+ * minimum: 10,
91
+ * maximum: 1000,
92
+ * multipleOf: 10, // Must be multiple of 10
93
+ * default: 50
94
+ * });
95
+ * ```
96
+ *
97
+ * @example Status code enum
98
+ * ```typescript
99
+ * const statusCodeInteger = new OasInteger({
100
+ * title: 'HTTP Status Code',
101
+ * description: 'Valid HTTP response status codes',
102
+ * enums: [200, 201, 400, 401, 404, 500],
103
+ * example: 200
104
+ * });
105
+ * ```
106
+ *
107
+ * @example Nullable integer
108
+ * ```typescript
109
+ * const optionalCountInteger = new OasInteger<true>({
110
+ * title: 'Optional Count',
111
+ * description: 'Count value that can be null',
112
+ * nullable: true,
113
+ * minimum: 0,
114
+ * default: null
115
+ * });
116
+ * ```
117
+ */
20
118
  export declare class OasInteger<Nullable extends boolean | undefined = boolean | undefined> {
21
119
  /**
22
120
  * Object is part the 'schema' set which is used
@@ -1 +1 @@
1
- {"version":3,"file":"Integer.d.ts","sourceRoot":"","sources":["../../../src/oas/integer/Integer.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,OAAO,GAAG,SAAS,IAAI;IAChE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IAC1B,OAAO,CAAC,EAAE,QAAQ,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;IAChF,KAAK,CAAC,EAAE,QAAQ,SAAS,IAAI,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;IACpF,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC,OAAO,CAAC,EAAE,QAAQ,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;IAChF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,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IAC3B;;OAEG;IACH,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;IACrC;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B;;OAEG;IACH,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;IACrC;;OAEG;IACH,OAAO,EAAE,QAAQ,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;gBACnE,MAAM,GAAE,aAAa,CAAC,QAAQ,CAAM;IAgBhD,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC;IAIjC,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC;IAI/B,WAAW,IAAI,UAAU,CAAC,QAAQ,CAAC;IAKnC,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC,oBAAoB;CAiB5E"}
@@ -2,6 +2,86 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OasInteger = void 0;
4
4
  require("../../_dnt.polyfills.js");
5
+ /**
6
+ * Represents an integer schema in the OpenAPI Specification.
7
+ *
8
+ * `OasInteger` handles integer type definitions with comprehensive validation
9
+ * constraints including range limits, multiple-of validation, format specifications,
10
+ * and enum restrictions. It supports both 32-bit and 64-bit integer formats
11
+ * and provides nullable type support.
12
+ *
13
+ * This class is used throughout the OAS processing pipeline to represent
14
+ * integer fields in API schemas, including IDs, counts, timestamps, and
15
+ * other numeric values that must be whole numbers.
16
+ *
17
+ * ## Key Features
18
+ *
19
+ * - **Format Support**: int32 and int64 format specifications
20
+ * - **Range Validation**: Minimum and maximum value constraints
21
+ * - **Multiple Validation**: Ensure values are multiples of specified numbers
22
+ * - **Enum Values**: Restricted sets of allowed integer values
23
+ * - **Nullable Support**: Type-safe nullable integer handling
24
+ * - **JSON Schema**: Conversion to standard JSON Schema format
25
+ *
26
+ * @template Nullable - Whether the integer value can be null
27
+ *
28
+ * @example Basic integer schema
29
+ * ```typescript
30
+ * import { OasInteger } from '@skmtc/core';
31
+ *
32
+ * const ageInteger = new OasInteger({
33
+ * title: 'Age',
34
+ * description: 'Person age in years',
35
+ * minimum: 0,
36
+ * maximum: 150,
37
+ * example: 25
38
+ * });
39
+ * ```
40
+ *
41
+ * @example ID with int64 format
42
+ * ```typescript
43
+ * const userIdInteger = new OasInteger({
44
+ * title: 'User ID',
45
+ * description: 'Unique user identifier',
46
+ * format: 'int64',
47
+ * minimum: 1,
48
+ * example: 1234567890123
49
+ * });
50
+ * ```
51
+ *
52
+ * @example Count with multiple-of validation
53
+ * ```typescript
54
+ * const batchSizeInteger = new OasInteger({
55
+ * title: 'Batch Size',
56
+ * description: 'Number of items to process',
57
+ * minimum: 10,
58
+ * maximum: 1000,
59
+ * multipleOf: 10, // Must be multiple of 10
60
+ * default: 50
61
+ * });
62
+ * ```
63
+ *
64
+ * @example Status code enum
65
+ * ```typescript
66
+ * const statusCodeInteger = new OasInteger({
67
+ * title: 'HTTP Status Code',
68
+ * description: 'Valid HTTP response status codes',
69
+ * enums: [200, 201, 400, 401, 404, 500],
70
+ * example: 200
71
+ * });
72
+ * ```
73
+ *
74
+ * @example Nullable integer
75
+ * ```typescript
76
+ * const optionalCountInteger = new OasInteger<true>({
77
+ * title: 'Optional Count',
78
+ * description: 'Count value that can be null',
79
+ * nullable: true,
80
+ * minimum: 0,
81
+ * default: null
82
+ * });
83
+ * ```
84
+ */
5
85
  class OasInteger {
6
86
  constructor(fields = {}) {
7
87
  /**