@skmtc/core 0.0.781 → 0.0.783
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/app/validate.d.ts +1 -1
- package/esm/app/validate.d.ts.map +1 -1
- package/esm/context/CoreContext.d.ts +177 -8
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +178 -0
- package/esm/context/ParseContext.d.ts +1 -1
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/StackTrail.d.ts +2 -2
- package/esm/context/StackTrail.d.ts.map +1 -1
- package/esm/context/types.d.ts +2 -2
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/ContentBase.d.ts +115 -0
- package/esm/dsl/ContentBase.d.ts.map +1 -1
- package/esm/dsl/ContentBase.js +110 -0
- package/esm/dsl/File.d.ts.map +1 -1
- package/esm/dsl/JsonFile.d.ts.map +1 -1
- package/esm/dsl/model/toModelBase.d.ts +2 -23
- package/esm/dsl/model/toModelBase.d.ts.map +1 -1
- package/esm/dsl/model/toModelEntry.d.ts +5 -5
- package/esm/dsl/model/toModelEntry.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationBase.d.ts +2 -25
- package/esm/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationEntry.d.ts +5 -5
- package/esm/dsl/operation/toOperationEntry.d.ts.map +1 -1
- package/esm/helpers/formatNumber.d.ts.map +1 -1
- package/esm/helpers/generationStats.d.ts.map +1 -1
- package/esm/helpers/strings.d.ts +63 -0
- package/esm/helpers/strings.d.ts.map +1 -1
- package/esm/helpers/strings.js +59 -0
- package/esm/helpers/toResolvedArtifactPath.d.ts.map +1 -1
- package/esm/mod.d.ts +66 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +66 -0
- package/esm/oas/document/Document.d.ts +1 -9
- package/esm/oas/document/Document.d.ts.map +1 -1
- package/esm/oas/operation/Operation.d.ts +2 -12
- package/esm/oas/operation/Operation.d.ts.map +1 -1
- package/esm/oas/ref/Ref.d.ts +1 -3
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/server/Server.d.ts.map +1 -1
- package/esm/oas/serverVariable/ServerVariable.d.ts.map +1 -1
- package/esm/run/toArtifacts.d.ts +114 -0
- package/esm/run/toArtifacts.d.ts.map +1 -1
- package/esm/run/toArtifacts.js +86 -0
- package/esm/types/DenoJson.d.ts +2 -11
- package/esm/types/DenoJson.d.ts.map +1 -1
- package/esm/types/Enrichments.d.ts +9 -207
- package/esm/types/Enrichments.d.ts.map +1 -1
- package/esm/types/Manifest.d.ts +3 -59
- package/esm/types/Manifest.d.ts.map +1 -1
- package/esm/types/Method.d.ts +11 -2
- package/esm/types/Method.d.ts.map +1 -1
- package/esm/types/Method.js +4 -3
- package/esm/types/ModuleExport.d.ts +1 -4
- package/esm/types/ModuleExport.d.ts.map +1 -1
- package/esm/types/PrettierConfig.d.ts +1 -24
- package/esm/types/PrettierConfig.d.ts.map +1 -1
- package/esm/types/Preview.d.ts +17 -52
- package/esm/types/Preview.d.ts.map +1 -1
- package/esm/types/Preview.js +3 -2
- package/esm/types/Results.d.ts +1 -1
- package/esm/types/Results.d.ts.map +1 -1
- package/esm/types/Settings.d.ts +135 -102
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +3 -0
- package/esm/typescript/List.d.ts +112 -1
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +106 -0
- package/package.json +1 -1
- package/script/app/validate.d.ts +1 -1
- package/script/app/validate.d.ts.map +1 -1
- package/script/context/CoreContext.d.ts +177 -8
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +178 -0
- package/script/context/ParseContext.d.ts +1 -1
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/StackTrail.d.ts +2 -2
- package/script/context/StackTrail.d.ts.map +1 -1
- package/script/context/types.d.ts +2 -2
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/ContentBase.d.ts +115 -0
- package/script/dsl/ContentBase.d.ts.map +1 -1
- package/script/dsl/ContentBase.js +110 -0
- package/script/dsl/File.d.ts.map +1 -1
- package/script/dsl/JsonFile.d.ts.map +1 -1
- package/script/dsl/model/toModelBase.d.ts +2 -23
- package/script/dsl/model/toModelBase.d.ts.map +1 -1
- package/script/dsl/model/toModelEntry.d.ts +5 -5
- package/script/dsl/model/toModelEntry.d.ts.map +1 -1
- package/script/dsl/operation/toOperationBase.d.ts +2 -25
- package/script/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/script/dsl/operation/toOperationEntry.d.ts +5 -5
- package/script/dsl/operation/toOperationEntry.d.ts.map +1 -1
- package/script/helpers/formatNumber.d.ts.map +1 -1
- package/script/helpers/generationStats.d.ts.map +1 -1
- package/script/helpers/strings.d.ts +63 -0
- package/script/helpers/strings.d.ts.map +1 -1
- package/script/helpers/strings.js +59 -0
- package/script/helpers/toResolvedArtifactPath.d.ts.map +1 -1
- package/script/mod.d.ts +66 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +66 -0
- package/script/oas/document/Document.d.ts +1 -9
- package/script/oas/document/Document.d.ts.map +1 -1
- package/script/oas/operation/Operation.d.ts +2 -12
- package/script/oas/operation/Operation.d.ts.map +1 -1
- package/script/oas/ref/Ref.d.ts +1 -3
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/server/Server.d.ts.map +1 -1
- package/script/oas/serverVariable/ServerVariable.d.ts.map +1 -1
- package/script/run/toArtifacts.d.ts +114 -0
- package/script/run/toArtifacts.d.ts.map +1 -1
- package/script/run/toArtifacts.js +86 -0
- package/script/types/DenoJson.d.ts +2 -11
- package/script/types/DenoJson.d.ts.map +1 -1
- package/script/types/Enrichments.d.ts +9 -207
- package/script/types/Enrichments.d.ts.map +1 -1
- package/script/types/Manifest.d.ts +3 -59
- package/script/types/Manifest.d.ts.map +1 -1
- package/script/types/Method.d.ts +11 -2
- package/script/types/Method.d.ts.map +1 -1
- package/script/types/Method.js +4 -3
- package/script/types/ModuleExport.d.ts +1 -4
- package/script/types/ModuleExport.d.ts.map +1 -1
- package/script/types/PrettierConfig.d.ts +1 -24
- package/script/types/PrettierConfig.d.ts.map +1 -1
- package/script/types/Preview.d.ts +17 -52
- package/script/types/Preview.d.ts.map +1 -1
- package/script/types/Preview.js +3 -2
- package/script/types/Results.d.ts +1 -1
- package/script/types/Results.d.ts.map +1 -1
- package/script/types/Settings.d.ts +135 -102
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +3 -0
- package/script/typescript/List.d.ts +112 -1
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +106 -0
package/esm/dsl/ContentBase.js
CHANGED
|
@@ -1,17 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for all content generators in the SKMTC DSL system.
|
|
3
|
+
*
|
|
4
|
+
* `ContentBase` provides the foundation for creating custom generators that transform
|
|
5
|
+
* OpenAPI Schema (OAS) objects into code artifacts. It handles registration with the
|
|
6
|
+
* generation context, skipping logic, and provides access to the pipeline's utilities.
|
|
7
|
+
*
|
|
8
|
+
* ## Generator Lifecycle
|
|
9
|
+
*
|
|
10
|
+
* 1. **Construction**: Initialize with context and optional generator key
|
|
11
|
+
* 2. **Registration**: Call {@link register} to add artifacts to the pipeline
|
|
12
|
+
* 3. **Generation**: Implement custom logic using context utilities
|
|
13
|
+
* 4. **Rendering**: Artifacts are automatically rendered by the pipeline
|
|
14
|
+
*
|
|
15
|
+
* @example Basic generator
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { ContentBase } from '@skmtc/core';
|
|
18
|
+
*
|
|
19
|
+
* class MyModelGenerator extends ContentBase {
|
|
20
|
+
* generate() {
|
|
21
|
+
* // Skip if not needed
|
|
22
|
+
* if (this.shouldSkip()) return;
|
|
23
|
+
*
|
|
24
|
+
* // Access OAS objects through context
|
|
25
|
+
* const schemas = this.context.oasDocument.components.schemas;
|
|
26
|
+
*
|
|
27
|
+
* for (const [name, schema] of Object.entries(schemas)) {
|
|
28
|
+
* if (schema.isRef()) continue;
|
|
29
|
+
*
|
|
30
|
+
* const file = new File({
|
|
31
|
+
* context: this.context,
|
|
32
|
+
* path: `./models/${name}.ts`,
|
|
33
|
+
* content: this.generateModelContent(schema)
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* // Register the file for rendering
|
|
37
|
+
* this.register({ file });
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* private generateModelContent(schema: OasObject): string {
|
|
42
|
+
* // Custom model generation logic
|
|
43
|
+
* return `export interface ${schema.name} { ... }`;
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example Generator with skipping logic
|
|
49
|
+
* ```typescript
|
|
50
|
+
* class ConditionalGenerator extends ContentBase {
|
|
51
|
+
* generate() {
|
|
52
|
+
* // Check if generation should be skipped
|
|
53
|
+
* if (this.shouldSkipBasedOnSettings()) {
|
|
54
|
+
* this.skip('Disabled in settings');
|
|
55
|
+
* return;
|
|
56
|
+
* }
|
|
57
|
+
*
|
|
58
|
+
* // Continue with generation...
|
|
59
|
+
* const file = this.createOutputFile();
|
|
60
|
+
* this.register({ file });
|
|
61
|
+
* }
|
|
62
|
+
*
|
|
63
|
+
* private shouldSkipBasedOnSettings(): boolean {
|
|
64
|
+
* return this.context.settings?.skip?.models?.includes('MyModel') ?? false;
|
|
65
|
+
* }
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
1
69
|
export class ContentBase {
|
|
70
|
+
/**
|
|
71
|
+
* Creates a new ContentBase instance.
|
|
72
|
+
*
|
|
73
|
+
* @param args - Construction arguments
|
|
74
|
+
* @param args.context - The generation context
|
|
75
|
+
* @param args.generatorKey - Optional generator key
|
|
76
|
+
*/
|
|
2
77
|
constructor({ context, generatorKey }) {
|
|
78
|
+
/** The generation context providing access to OAS objects and utilities */
|
|
3
79
|
Object.defineProperty(this, "context", {
|
|
4
80
|
enumerable: true,
|
|
5
81
|
configurable: true,
|
|
6
82
|
writable: true,
|
|
7
83
|
value: void 0
|
|
8
84
|
});
|
|
85
|
+
/** Whether this generator has been skipped */
|
|
9
86
|
Object.defineProperty(this, "skipped", {
|
|
10
87
|
enumerable: true,
|
|
11
88
|
configurable: true,
|
|
12
89
|
writable: true,
|
|
13
90
|
value: false
|
|
14
91
|
});
|
|
92
|
+
/** Optional generator key for identification and tracking */
|
|
15
93
|
Object.defineProperty(this, "generatorKey", {
|
|
16
94
|
enumerable: true,
|
|
17
95
|
configurable: true,
|
|
@@ -21,6 +99,38 @@ export class ContentBase {
|
|
|
21
99
|
this.context = context;
|
|
22
100
|
this.generatorKey = generatorKey;
|
|
23
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Registers generated artifacts with the rendering pipeline.
|
|
104
|
+
*
|
|
105
|
+
* This method is called by generator implementations to add files,
|
|
106
|
+
* JSON artifacts, or other content to the generation output.
|
|
107
|
+
*
|
|
108
|
+
* @param args - The artifacts to register
|
|
109
|
+
* @param args.file - Optional file to register
|
|
110
|
+
* @param args.jsonFile - Optional JSON file to register
|
|
111
|
+
*
|
|
112
|
+
* @example Registering a file
|
|
113
|
+
* ```typescript
|
|
114
|
+
* const file = new File({
|
|
115
|
+
* context: this.context,
|
|
116
|
+
* path: './output.ts',
|
|
117
|
+
* content: 'export const value = 42;'
|
|
118
|
+
* });
|
|
119
|
+
*
|
|
120
|
+
* this.register({ file });
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @example Registering JSON data
|
|
124
|
+
* ```typescript
|
|
125
|
+
* const jsonFile = new JsonFile({
|
|
126
|
+
* context: this.context,
|
|
127
|
+
* path: './config.json',
|
|
128
|
+
* data: { version: '1.0.0', features: ['api'] }
|
|
129
|
+
* });
|
|
130
|
+
*
|
|
131
|
+
* this.register({ jsonFile });
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
24
134
|
register(args) {
|
|
25
135
|
this.context.register(args);
|
|
26
136
|
}
|
package/esm/dsl/File.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/dsl/File.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzE,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;CACrC,CAAA;AAED,qBAAa,IAAI;IACf,QAAQ,EAAE,IAAI,CAAO;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACnD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACpC,QAAQ,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;gBAEzB,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ;IAQxC,QAAQ;
|
|
1
|
+
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/dsl/File.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzE,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;CACrC,CAAA;AAED,qBAAa,IAAI;IACf,QAAQ,EAAE,IAAI,CAAO;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACnD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACpC,QAAQ,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;gBAEzB,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ;IAQxC,QAAQ,IAAI,MAAM;CAkCnB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,2CAIjC,uBAAuB,WAqBzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonFile.d.ts","sourceRoot":"","sources":["../../src/dsl/JsonFile.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC,CAAA;AAED,qBAAa,QAAQ;IACnB,QAAQ,EAAE,MAAM,CAAS;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;gBAEpB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,YAAY;IAK3C,QAAQ;
|
|
1
|
+
{"version":3,"file":"JsonFile.d.ts","sourceRoot":"","sources":["../../src/dsl/JsonFile.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC,CAAA;AAED,qBAAa,QAAQ;IACnB,QAAQ,EAAE,MAAM,CAAS;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;gBAEpB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,YAAY;IAK3C,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
2
2
|
import type { RefName } from '../../types/RefName.js';
|
|
3
3
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
+
import { ModelBase } from './ModelBase.js';
|
|
4
5
|
import type { Identifier } from '../Identifier.js';
|
|
5
6
|
import * as v from 'valibot';
|
|
6
7
|
export type ModelInsertableArgs<EnrichmentType = undefined> = {
|
|
@@ -8,33 +9,11 @@ export type ModelInsertableArgs<EnrichmentType = undefined> = {
|
|
|
8
9
|
settings: ContentSettings<EnrichmentType>;
|
|
9
10
|
refName: RefName;
|
|
10
11
|
};
|
|
11
|
-
type ToEnrichmentsArgs = {
|
|
12
|
-
refName: RefName;
|
|
13
|
-
context: GenerateContext;
|
|
14
|
-
};
|
|
15
12
|
export type BaseModelConfig<EnrichmentType = undefined> = {
|
|
16
13
|
id: string;
|
|
17
14
|
toIdentifier: (refName: RefName) => Identifier;
|
|
18
15
|
toExportPath: (refName: RefName) => string;
|
|
19
16
|
toEnrichmentSchema?: () => v.BaseSchema<EnrichmentType, EnrichmentType, v.BaseIssue<unknown>>;
|
|
20
17
|
};
|
|
21
|
-
export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModelConfig<EnrichmentType>) =>
|
|
22
|
-
new (args: ModelInsertableArgs<EnrichmentType>): {
|
|
23
|
-
settings: ContentSettings<EnrichmentType>;
|
|
24
|
-
refName: RefName;
|
|
25
|
-
generatorKey: import("../../mod.js").GeneratorKey;
|
|
26
|
-
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_1>, refName: RefName, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
27
|
-
insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, Schema extends import("../../mod.js").OasSchema | import("../../mod.js").OasRef<"schema"> | import("../../mod.js").OasVoid, EnrichmentType_2 = undefined>(insertable: import("./types.js").ModelInsertable<V, EnrichmentType_2>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../../mod.js").InsertNormalisedModelReturn<V, Schema>;
|
|
28
|
-
register(args: import("../../mod.js").BaseRegisterArgs): void;
|
|
29
|
-
context: GenerateContext;
|
|
30
|
-
skipped: boolean;
|
|
31
|
-
};
|
|
32
|
-
id: string;
|
|
33
|
-
type: "model";
|
|
34
|
-
toIdentifier: (refName: RefName) => Identifier;
|
|
35
|
-
toExportPath: (refName: RefName) => string;
|
|
36
|
-
toEnrichments: ({ refName, context }: ToEnrichmentsArgs) => EnrichmentType;
|
|
37
|
-
isSupported: () => boolean;
|
|
38
|
-
};
|
|
39
|
-
export {};
|
|
18
|
+
export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModelConfig<EnrichmentType>) => new (args: ModelInsertableArgs<EnrichmentType>) => ModelBase<EnrichmentType>;
|
|
40
19
|
//# sourceMappingURL=toModelBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toModelBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"toModelBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,MAAM,MAAM,mBAAmB,CAAC,cAAc,GAAG,SAAS,IAAI;IAC5D,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAOD,MAAM,MAAM,eAAe,CAAC,cAAc,GAAG,SAAS,IAAI;IACxD,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,UAAU,CAAA;IAC9C,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC9F,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,cAAc,GAAG,SAAS,EACpD,QAAQ,eAAe,CAAC,cAAc,CAAC,KACtC,KAAK,IAAI,EAAE,mBAAmB,CAAC,cAAc,CAAC,KAAK,SAAS,CAAC,cAAc,CA0B7E,CAAA"}
|
|
@@ -13,12 +13,12 @@ type ToModelEntryArgs<EnrichmentType = undefined, Acc = void> = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare const toModelEntry: <EnrichmentType = undefined, Acc = void>({ id, transform, toPreviewModule, toMappingModule, toEnrichmentSchema, toEnrichmentRequest }: ToModelEntryArgs<EnrichmentType, Acc>) => {
|
|
15
15
|
id: string;
|
|
16
|
-
type:
|
|
16
|
+
type: "model";
|
|
17
17
|
transform: ({ context, refName, acc }: TransformModelArgs<Acc>) => Acc;
|
|
18
|
-
toPreviewModule
|
|
19
|
-
toMappingModule
|
|
20
|
-
toEnrichmentSchema
|
|
21
|
-
toEnrichmentRequest
|
|
18
|
+
toPreviewModule?: ({ context, refName }: ToModelPreviewModuleArgs) => PreviewModule;
|
|
19
|
+
toMappingModule?: ({ context, refName }: ToModelMappingArgs) => MappingModule;
|
|
20
|
+
toEnrichmentSchema?: () => v.GenericSchema<EnrichmentType>;
|
|
21
|
+
toEnrichmentRequest?: <RequestedEnrichment extends EnrichmentType>(refName: RefName) => EnrichmentRequest<RequestedEnrichment> | undefined;
|
|
22
22
|
};
|
|
23
23
|
export {};
|
|
24
24
|
//# sourceMappingURL=toModelEntry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toModelEntry.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAClG,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE1E,KAAK,gBAAgB,CAAC,cAAc,GAAG,SAAS,EAAE,GAAG,GAAG,IAAI,IAAI;IAC9D,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE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js';
|
|
2
|
+
import { OperationBase } from './OperationBase.js';
|
|
3
3
|
import type { Identifier } from '../Identifier.js';
|
|
4
4
|
import type { OperationInsertableArgs } from './types.js';
|
|
5
5
|
import * as v from 'valibot';
|
|
@@ -9,28 +9,5 @@ export type BaseOperationConfig<EnrichmentType = undefined> = {
|
|
|
9
9
|
toExportPath: (operation: OasOperation) => string;
|
|
10
10
|
toEnrichmentSchema?: () => v.BaseSchema<EnrichmentType, EnrichmentType, v.BaseIssue<unknown>>;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
operation: OasOperation;
|
|
14
|
-
context: GenerateContext;
|
|
15
|
-
};
|
|
16
|
-
export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseOperationConfig<EnrichmentType>) => {
|
|
17
|
-
new (args: OperationInsertableArgs<EnrichmentType>): {
|
|
18
|
-
settings: import("../ContentSettings.js").ContentSettings<EnrichmentType>;
|
|
19
|
-
operation: OasOperation;
|
|
20
|
-
generatorKey: import("../../mod.js").GeneratorKey;
|
|
21
|
-
insertOperation<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").OperationInsertable<V, EnrichmentType_1>, operation: OasOperation, options?: Pick<import("../../mod.js").InsertOperationOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
22
|
-
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_2>, refName: import("../../mod.js").RefName, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_2>;
|
|
23
|
-
insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, Schema extends import("../../mod.js").OasSchema | import("../../mod.js").OasRef<"schema"> | import("../../mod.js").OasVoid, EnrichmentType_3 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_3>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../../mod.js").InsertNormalisedModelReturn<V, Schema>;
|
|
24
|
-
defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value, noExport }: Omit<import("../../mod.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
25
|
-
register(args: import("../../mod.js").BaseRegisterArgs): void;
|
|
26
|
-
context: GenerateContext;
|
|
27
|
-
skipped: boolean;
|
|
28
|
-
};
|
|
29
|
-
id: string;
|
|
30
|
-
type: "operation";
|
|
31
|
-
toIdentifier: (operation: OasOperation) => Identifier;
|
|
32
|
-
toExportPath: (operation: OasOperation) => string;
|
|
33
|
-
toEnrichments: ({ operation, context }: ToEnrichmentsArgs) => EnrichmentType;
|
|
34
|
-
};
|
|
35
|
-
export {};
|
|
12
|
+
export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseOperationConfig<EnrichmentType>) => new (args: OperationInsertableArgs<EnrichmentType>) => OperationBase<EnrichmentType>;
|
|
36
13
|
//# sourceMappingURL=toOperationBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,MAAM,MAAM,mBAAmB,CAAC,cAAc,GAAG,SAAS,IAAI;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,UAAU,CAAA;IACrD,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,MAAM,CAAA;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC9F,CAAA;AAOD,eAAO,MAAM,eAAe,GAAI,cAAc,GAAG,SAAS,EACxD,QAAQ,mBAAmB,CAAC,cAAc,CAAC,KAC1C,KAAK,IAAI,EAAE,uBAAuB,CAAC,cAAc,CAAC,KAAK,aAAa,CAAC,cAAc,CA6BrF,CAAA"}
|
|
@@ -15,12 +15,12 @@ export type ToOperationConfigArgs<EnrichmentType = undefined, Acc = void> = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const toOperationEntry: <EnrichmentType = undefined, Acc = void>({ id, transform, toEnrichmentSchema, isSupported, toPreviewModule, toMappingModule, toEnrichmentRequest }: ToOperationConfigArgs<EnrichmentType, Acc>) => {
|
|
17
17
|
id: string;
|
|
18
|
-
type:
|
|
18
|
+
type: "operation";
|
|
19
19
|
transform: ({ context, operation, acc }: TransformOperationArgs<Acc>) => Acc;
|
|
20
|
-
toEnrichmentSchema
|
|
20
|
+
toEnrichmentSchema?: () => v.GenericSchema<EnrichmentType>;
|
|
21
21
|
isSupported: ({ context, operation }: IsSupportedArgs) => boolean;
|
|
22
|
-
toPreviewModule
|
|
23
|
-
toMappingModule
|
|
24
|
-
toEnrichmentRequest
|
|
22
|
+
toPreviewModule?: ({ context, operation }: ToOperationPreviewModuleArgs) => PreviewModule;
|
|
23
|
+
toMappingModule?: ({ context, operation }: ToOperationMappingArgs) => MappingModule;
|
|
24
|
+
toEnrichmentRequest?: <RequestedEnrichment extends EnrichmentType>(operation: OasOperation) => EnrichmentRequest<RequestedEnrichment> | undefined;
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=toOperationEntry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationEntry.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EACV,eAAe,EACf,4BAA4B,EAC5B,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAG1E,MAAM,MAAM,qBAAqB,CAAC,cAAc,GAAG,SAAS,EAAE,GAAG,GAAG,IAAI,IAAI;IAC1E,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,sBAAsB,CAAC,GAAG,CAAC,KAAK,GAAG,CAAA;IAC5E,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;IAC1D,WAAW,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,8BAA8B,CAAC,cAAc,CAAC,KAAK,OAAO,CAAA;IACjG,eAAe,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,4BAA4B,KAAK,aAAa,CAAA;IACzF,eAAe,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,sBAAsB,KAAK,aAAa,CAAA;IACnF,mBAAmB,CAAC,EAAE,CAAC,mBAAmB,SAAS,cAAc,EAC/D,SAAS,EAAE,YAAY,KACp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sourceRoot":"","sources":["../../src/helpers/formatNumber.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,EAAE,UAAS,IAAI,CAAC,eAAyB,KAAG,MAKrF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generationStats.d.ts","sourceRoot":"","sources":["../../src/helpers/generationStats.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAIlE,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC,CAAA;AACD,eAAO,MAAM,iBAAiB,GAAI,yBAAyB,mBAAmB
|
|
1
|
+
{"version":3,"file":"generationStats.d.ts","sourceRoot":"","sources":["../../src/helpers/generationStats.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAIlE,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC,CAAA;AACD,eAAO,MAAM,iBAAiB,GAAI,yBAAyB,mBAAmB,KAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAcrK,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,WAAW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAG,MAOpE,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,UAAU,eAAe,KAAG,MAO3D,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,UAAU,eAAe,KAAG,MAIvD,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,SAAS,eAAe,CAAC,SAAS,CAAC,KAAG,MAAM,EAAE,EAQ9E,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,MAAM,EAAE,WAAW,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,GAAG,UAAU,CAAA;IACzD,MAAM,EAAE,MAAM,EAAE,EAAE,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,0BAA0B,eAAe,KAAG,IA0BvE,CAAA"}
|
package/esm/helpers/strings.d.ts
CHANGED
|
@@ -1,9 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capitalizes the first character of a string.
|
|
3
|
+
*
|
|
4
|
+
* @param str - The string to capitalize
|
|
5
|
+
* @returns The string with the first character uppercased
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* capitalize('hello world'); // 'Hello world'
|
|
10
|
+
* capitalize('API'); // 'API'
|
|
11
|
+
* capitalize(''); // ''
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
1
14
|
import "../_dnt.polyfills.js";
|
|
2
15
|
export declare const capitalize: (str: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Decapitalizes (lowercases) the first character of a string.
|
|
18
|
+
*
|
|
19
|
+
* @param str - The string to decapitalize
|
|
20
|
+
* @returns The string with the first character lowercased
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* decapitalize('Hello World'); // 'hello World'
|
|
25
|
+
* decapitalize('API'); // 'aPI'
|
|
26
|
+
* decapitalize(''); // ''
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
3
29
|
export declare const decapitalize: (str: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Options for controlling camelCase conversion behavior.
|
|
32
|
+
*/
|
|
4
33
|
type CamelCaseOptions = {
|
|
34
|
+
/** Whether to capitalize the first character (PascalCase) */
|
|
5
35
|
upperFirst?: boolean;
|
|
6
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Converts a string to camelCase, removing non-alphanumeric characters.
|
|
39
|
+
*
|
|
40
|
+
* This function handles various input formats including kebab-case, snake_case,
|
|
41
|
+
* space-separated words, and mixed formats. It intelligently capitalizes words
|
|
42
|
+
* after the first unless `upperFirst` is specified.
|
|
43
|
+
*
|
|
44
|
+
* @param str - The string to convert to camelCase
|
|
45
|
+
* @param options - Options to control the conversion
|
|
46
|
+
* @param options.upperFirst - Whether to capitalize the first character (default: false)
|
|
47
|
+
* @returns The camelCase version of the input string
|
|
48
|
+
*
|
|
49
|
+
* @example Basic usage
|
|
50
|
+
* ```typescript
|
|
51
|
+
* camelCase('hello world'); // 'helloWorld'
|
|
52
|
+
* camelCase('user-name'); // 'userName'
|
|
53
|
+
* camelCase('api_key'); // 'apiKey'
|
|
54
|
+
* camelCase('HTTP-Response'); // 'httpResponse'
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example PascalCase (upperFirst)
|
|
58
|
+
* ```typescript
|
|
59
|
+
* camelCase('user profile', { upperFirst: true }); // 'UserProfile'
|
|
60
|
+
* camelCase('api-client', { upperFirst: true }); // 'ApiClient'
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Complex inputs
|
|
64
|
+
* ```typescript
|
|
65
|
+
* camelCase('get-user-by-id'); // 'getUserById'
|
|
66
|
+
* camelCase('XML_HTTP_Request'); // 'xmlHttpRequest'
|
|
67
|
+
* camelCase('2fa-enabled'); // '2faEnabled'
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
7
70
|
export declare const camelCase: (str: string, { upperFirst }?: CamelCaseOptions) => string;
|
|
8
71
|
export {};
|
|
9
72
|
//# sourceMappingURL=strings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/helpers/strings.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/helpers/strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,sBAAsB,CAAC;AAE9B,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,MAExC,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAE1C,CAAA;AAED;;GAEG;AACH,KAAK,gBAAgB,GAAG;IACtB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,iBAAgB,gBAAqB,KAAG,MAgB9E,CAAA"}
|
package/esm/helpers/strings.js
CHANGED
|
@@ -1,10 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capitalizes the first character of a string.
|
|
3
|
+
*
|
|
4
|
+
* @param str - The string to capitalize
|
|
5
|
+
* @returns The string with the first character uppercased
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* capitalize('hello world'); // 'Hello world'
|
|
10
|
+
* capitalize('API'); // 'API'
|
|
11
|
+
* capitalize(''); // ''
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
1
14
|
import "../_dnt.polyfills.js";
|
|
2
15
|
export const capitalize = (str) => {
|
|
3
16
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
4
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Decapitalizes (lowercases) the first character of a string.
|
|
20
|
+
*
|
|
21
|
+
* @param str - The string to decapitalize
|
|
22
|
+
* @returns The string with the first character lowercased
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* decapitalize('Hello World'); // 'hello World'
|
|
27
|
+
* decapitalize('API'); // 'aPI'
|
|
28
|
+
* decapitalize(''); // ''
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
5
31
|
export const decapitalize = (str) => {
|
|
6
32
|
return str.charAt(0).toLocaleLowerCase() + str.slice(1);
|
|
7
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Converts a string to camelCase, removing non-alphanumeric characters.
|
|
36
|
+
*
|
|
37
|
+
* This function handles various input formats including kebab-case, snake_case,
|
|
38
|
+
* space-separated words, and mixed formats. It intelligently capitalizes words
|
|
39
|
+
* after the first unless `upperFirst` is specified.
|
|
40
|
+
*
|
|
41
|
+
* @param str - The string to convert to camelCase
|
|
42
|
+
* @param options - Options to control the conversion
|
|
43
|
+
* @param options.upperFirst - Whether to capitalize the first character (default: false)
|
|
44
|
+
* @returns The camelCase version of the input string
|
|
45
|
+
*
|
|
46
|
+
* @example Basic usage
|
|
47
|
+
* ```typescript
|
|
48
|
+
* camelCase('hello world'); // 'helloWorld'
|
|
49
|
+
* camelCase('user-name'); // 'userName'
|
|
50
|
+
* camelCase('api_key'); // 'apiKey'
|
|
51
|
+
* camelCase('HTTP-Response'); // 'httpResponse'
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example PascalCase (upperFirst)
|
|
55
|
+
* ```typescript
|
|
56
|
+
* camelCase('user profile', { upperFirst: true }); // 'UserProfile'
|
|
57
|
+
* camelCase('api-client', { upperFirst: true }); // 'ApiClient'
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @example Complex inputs
|
|
61
|
+
* ```typescript
|
|
62
|
+
* camelCase('get-user-by-id'); // 'getUserById'
|
|
63
|
+
* camelCase('XML_HTTP_Request'); // 'xmlHttpRequest'
|
|
64
|
+
* camelCase('2fa-enabled'); // '2faEnabled'
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
8
67
|
export const camelCase = (str, { upperFirst } = {}) => {
|
|
9
68
|
let doCapitalize = Boolean(upperFirst);
|
|
10
69
|
const camelCased = str.replace(/[^a-zA-Z0-9]+([a-zA-Z0-9]+)/g, (_, matched) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toResolvedArtifactPath.d.ts","sourceRoot":"","sources":["../../src/helpers/toResolvedArtifactPath.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,+BAGpC,0BAA0B,
|
|
1
|
+
{"version":3,"file":"toResolvedArtifactPath.d.ts","sourceRoot":"","sources":["../../src/helpers/toResolvedArtifactPath.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,+BAGpC,0BAA0B,KAAG,MAE/B,CAAA"}
|
package/esm/mod.d.ts
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module SKMTC Core
|
|
3
|
+
*
|
|
4
|
+
* SKMTC (Schema Kit Mapping & Type Conversion) is a powerful TypeScript/Deno library
|
|
5
|
+
* for processing OpenAPI v3 documents and generating code artifacts. It provides a
|
|
6
|
+
* comprehensive three-phase pipeline for parsing, generating, and rendering OpenAPI
|
|
7
|
+
* schemas into various output formats.
|
|
8
|
+
*
|
|
9
|
+
* ## Quick Start
|
|
10
|
+
*
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { toArtifacts } from '@skmtc/core';
|
|
13
|
+
*
|
|
14
|
+
* const result = await toArtifacts({
|
|
15
|
+
* traceId: 'my-trace',
|
|
16
|
+
* spanId: 'my-span',
|
|
17
|
+
* documentObject: openApiDoc,
|
|
18
|
+
* settings: clientSettings,
|
|
19
|
+
* toGeneratorConfigMap: () => generatorMap,
|
|
20
|
+
* startAt: Date.now(),
|
|
21
|
+
* silent: false
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* console.log(result.artifacts); // Generated code files
|
|
25
|
+
* console.log(result.manifest); // Generation metadata
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* ## Architecture
|
|
29
|
+
*
|
|
30
|
+
* The library follows a three-phase pipeline:
|
|
31
|
+
* - **Parse Phase**: Converts OpenAPI v3 JSON into internal OAS objects
|
|
32
|
+
* - **Generate Phase**: Transforms OAS objects into generator artifacts
|
|
33
|
+
* - **Render Phase**: Renders artifacts to formatted files
|
|
34
|
+
*
|
|
35
|
+
* ## Key Components
|
|
36
|
+
*
|
|
37
|
+
* - {@link CoreContext} - Main orchestration class for the pipeline
|
|
38
|
+
* - {@link toArtifacts} - Primary transformation function
|
|
39
|
+
* - {@link ContentBase} - Base class for creating generators
|
|
40
|
+
* - {@link ModelBase} and {@link OperationBase} - DSL building blocks
|
|
41
|
+
* - {@link List} - Powerful string manipulation and code generation utility
|
|
42
|
+
*
|
|
43
|
+
* ## Type System
|
|
44
|
+
*
|
|
45
|
+
* The library provides comprehensive TypeScript types for OpenAPI schemas,
|
|
46
|
+
* generator configurations, and output artifacts. All major types are
|
|
47
|
+
* validated using Valibot schemas for runtime safety.
|
|
48
|
+
*
|
|
49
|
+
* @example Basic Usage
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { CoreContext } from '@skmtc/core';
|
|
52
|
+
*
|
|
53
|
+
* const context = new CoreContext({
|
|
54
|
+
* spanId: 'my-span',
|
|
55
|
+
* silent: false
|
|
56
|
+
* });
|
|
57
|
+
*
|
|
58
|
+
* const result = await context.toArtifacts({
|
|
59
|
+
* documentObject: myOpenApiDoc,
|
|
60
|
+
* settings: mySettings,
|
|
61
|
+
* toGeneratorConfigMap: () => myGenerators,
|
|
62
|
+
* prettier: prettierConfig,
|
|
63
|
+
* silent: false
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
1
67
|
import "./_dnt.polyfills.js";
|
|
2
68
|
export * from './app/validate.js';
|
|
3
69
|
export * from './context/CoreContext.js';
|
package/esm/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,OAAO,qBAAqB,CAAC;AAG7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA;AAClD,cAAc,oCAAoC,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A;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mCAAmC,CAAA;AACjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uCAAuC,CAAA;AACrD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA"}
|
package/esm/mod.js
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module SKMTC Core
|
|
3
|
+
*
|
|
4
|
+
* SKMTC (Schema Kit Mapping & Type Conversion) is a powerful TypeScript/Deno library
|
|
5
|
+
* for processing OpenAPI v3 documents and generating code artifacts. It provides a
|
|
6
|
+
* comprehensive three-phase pipeline for parsing, generating, and rendering OpenAPI
|
|
7
|
+
* schemas into various output formats.
|
|
8
|
+
*
|
|
9
|
+
* ## Quick Start
|
|
10
|
+
*
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { toArtifacts } from '@skmtc/core';
|
|
13
|
+
*
|
|
14
|
+
* const result = await toArtifacts({
|
|
15
|
+
* traceId: 'my-trace',
|
|
16
|
+
* spanId: 'my-span',
|
|
17
|
+
* documentObject: openApiDoc,
|
|
18
|
+
* settings: clientSettings,
|
|
19
|
+
* toGeneratorConfigMap: () => generatorMap,
|
|
20
|
+
* startAt: Date.now(),
|
|
21
|
+
* silent: false
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* console.log(result.artifacts); // Generated code files
|
|
25
|
+
* console.log(result.manifest); // Generation metadata
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* ## Architecture
|
|
29
|
+
*
|
|
30
|
+
* The library follows a three-phase pipeline:
|
|
31
|
+
* - **Parse Phase**: Converts OpenAPI v3 JSON into internal OAS objects
|
|
32
|
+
* - **Generate Phase**: Transforms OAS objects into generator artifacts
|
|
33
|
+
* - **Render Phase**: Renders artifacts to formatted files
|
|
34
|
+
*
|
|
35
|
+
* ## Key Components
|
|
36
|
+
*
|
|
37
|
+
* - {@link CoreContext} - Main orchestration class for the pipeline
|
|
38
|
+
* - {@link toArtifacts} - Primary transformation function
|
|
39
|
+
* - {@link ContentBase} - Base class for creating generators
|
|
40
|
+
* - {@link ModelBase} and {@link OperationBase} - DSL building blocks
|
|
41
|
+
* - {@link List} - Powerful string manipulation and code generation utility
|
|
42
|
+
*
|
|
43
|
+
* ## Type System
|
|
44
|
+
*
|
|
45
|
+
* The library provides comprehensive TypeScript types for OpenAPI schemas,
|
|
46
|
+
* generator configurations, and output artifacts. All major types are
|
|
47
|
+
* validated using Valibot schemas for runtime safety.
|
|
48
|
+
*
|
|
49
|
+
* @example Basic Usage
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { CoreContext } from '@skmtc/core';
|
|
52
|
+
*
|
|
53
|
+
* const context = new CoreContext({
|
|
54
|
+
* spanId: 'my-span',
|
|
55
|
+
* silent: false
|
|
56
|
+
* });
|
|
57
|
+
*
|
|
58
|
+
* const result = await context.toArtifacts({
|
|
59
|
+
* documentObject: myOpenApiDoc,
|
|
60
|
+
* settings: mySettings,
|
|
61
|
+
* toGeneratorConfigMap: () => myGenerators,
|
|
62
|
+
* prettier: prettierConfig,
|
|
63
|
+
* silent: false
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
1
67
|
import "./_dnt.polyfills.js";
|
|
2
68
|
export * from './app/validate.js';
|
|
3
69
|
export * from './context/CoreContext.js';
|
|
@@ -41,14 +41,6 @@ export declare class OasDocument {
|
|
|
41
41
|
get security(): OasSecurityRequirement[] | undefined;
|
|
42
42
|
/** Specification Extension fields */
|
|
43
43
|
get extensionFields(): Record<string, unknown> | undefined;
|
|
44
|
-
toJSON():
|
|
45
|
-
openapi: string;
|
|
46
|
-
info: OasInfo;
|
|
47
|
-
servers: OasServer[] | undefined;
|
|
48
|
-
operations: OasOperation[];
|
|
49
|
-
components: OasComponents | undefined;
|
|
50
|
-
tags: OasTag[] | undefined;
|
|
51
|
-
security: OasSecurityRequirement[] | undefined;
|
|
52
|
-
};
|
|
44
|
+
toJSON(): object;
|
|
53
45
|
}
|
|
54
46
|
//# sourceMappingURL=Document.d.ts.map
|