@skmtc/core 0.0.312 → 0.0.313
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/CoreContext.d.ts +6 -5
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +51 -51
- package/esm/context/GenerateContext.d.ts +5 -4
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +25 -23
- package/esm/context/ParseContext.d.ts +5 -4
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +22 -30
- package/esm/context/RenderContext.d.ts +5 -5
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +28 -35
- package/esm/context/StackTrail.js +1 -1
- package/esm/generate/generate.d.ts.map +1 -1
- package/esm/generate/generate.js +3 -2
- package/esm/helpers/tracer.d.ts +3 -3
- package/esm/helpers/tracer.d.ts.map +1 -1
- package/esm/helpers/tracer.js +3 -3
- package/esm/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/esm/oas/parameter/toParameterV3.js +0 -1
- package/esm/server/createServer.js +2 -2
- package/esm/types/GeneratorKeys.js +6 -6
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +6 -5
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +51 -51
- package/script/context/GenerateContext.d.ts +5 -4
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +25 -23
- package/script/context/ParseContext.d.ts +5 -4
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +22 -30
- package/script/context/RenderContext.d.ts +5 -5
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +28 -35
- package/script/context/StackTrail.js +1 -1
- package/script/generate/generate.d.ts.map +1 -1
- package/script/generate/generate.js +3 -2
- package/script/helpers/tracer.d.ts +3 -3
- package/script/helpers/tracer.d.ts.map +1 -1
- package/script/helpers/tracer.js +3 -3
- package/script/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/script/oas/parameter/toParameterV3.js +0 -1
- package/script/server/createServer.js +2 -2
- package/script/types/GeneratorKeys.js +6 -6
|
@@ -8,9 +8,9 @@ import * as log from '../deps/jsr.io/@std/log/0.224.6/mod.js';
|
|
|
8
8
|
import type { GeneratorKey } from '../types/GeneratorKeys.js';
|
|
9
9
|
type CoreContextArgs = {
|
|
10
10
|
spanId: string;
|
|
11
|
-
schema: string;
|
|
12
11
|
};
|
|
13
12
|
type TransformArgs = {
|
|
13
|
+
schema: string;
|
|
14
14
|
settings: ClientSettings | undefined;
|
|
15
15
|
generatorsMap: Record<string, OperationGenerator | ModelGenerator>;
|
|
16
16
|
prettier?: PrettierConfigType;
|
|
@@ -18,16 +18,17 @@ type TransformArgs = {
|
|
|
18
18
|
export declare class CoreContext {
|
|
19
19
|
#private;
|
|
20
20
|
logger: log.Logger;
|
|
21
|
-
constructor({
|
|
22
|
-
parse(): OasDocument;
|
|
23
|
-
|
|
21
|
+
constructor({ spanId }: CoreContextArgs);
|
|
22
|
+
parse(schema: string): OasDocument;
|
|
23
|
+
appendToStackTrail(token: string | string[]): void;
|
|
24
|
+
removeFromStackTrail(token: string | string[]): void;
|
|
25
|
+
transform({ schema, settings, generatorsMap, prettier }: TransformArgs): {
|
|
24
26
|
results: Record<string, SuccessWarningError>;
|
|
25
27
|
files: Record<string, import("../types/Manifest.js").ManifestEntry>;
|
|
26
28
|
pinnable: Partial<Record<GeneratorKey, string>>;
|
|
27
29
|
artifacts: Record<string, string>;
|
|
28
30
|
};
|
|
29
31
|
captureCurrentResult(result: SuccessWarningError): void;
|
|
30
|
-
get phaseType(): 'parse' | 'generate' | 'render';
|
|
31
32
|
}
|
|
32
33
|
export type JsonFormatterArgs = {
|
|
33
34
|
logRecord: log.LogRecord;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreContext.d.ts","sourceRoot":"","sources":["../../src/context/CoreContext.ts"],"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,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;CA8BxD;AAkBD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,GAAG,CAAC,SAAS,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,UAAU,EACX,EAAE,iBAAiB,GAAG,MAAM,CAQ5B"}
|
|
@@ -9,16 +9,16 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _CoreContext_instances, _CoreContext_phase, _CoreContext_results, _CoreContext_stackTrail, _CoreContext_setupLogger,
|
|
12
|
+
var _CoreContext_instances, _CoreContext_phase, _CoreContext_results, _CoreContext_stackTrail, _CoreContext_setupLogger, _CoreContext_setupParsePhase, _CoreContext_setupGeneratePhase, _CoreContext_setupRenderPhase;
|
|
13
13
|
import { GenerateContext } from './GenerateContext.js';
|
|
14
|
-
import { match } from 'ts-pattern';
|
|
15
14
|
import { RenderContext } from './RenderContext.js';
|
|
16
15
|
import { ParseContext } from './ParseContext.js';
|
|
17
16
|
import * as log from '../deps/jsr.io/@std/log/0.224.6/mod.js';
|
|
18
17
|
import { ResultsHandler } from './ResultsHandler.js';
|
|
19
18
|
import { StackTrail } from './StackTrail.js';
|
|
19
|
+
import { tracer } from '../helpers/tracer.js';
|
|
20
20
|
export class CoreContext {
|
|
21
|
-
constructor({
|
|
21
|
+
constructor({ spanId }) {
|
|
22
22
|
_CoreContext_instances.add(this);
|
|
23
23
|
Object.defineProperty(this, "logger", {
|
|
24
24
|
enumerable: true,
|
|
@@ -32,49 +32,55 @@ export class CoreContext {
|
|
|
32
32
|
__classPrivateFieldSet(this, _CoreContext_stackTrail, new StackTrail([spanId]), "f");
|
|
33
33
|
__classPrivateFieldSet(this, _CoreContext_results, {}, "f");
|
|
34
34
|
this.logger = __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupLogger).call(this, spanId);
|
|
35
|
-
__classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupParsePhase).call(this, schema), "f");
|
|
36
35
|
}
|
|
37
|
-
parse() {
|
|
38
|
-
|
|
39
|
-
throw new Error(`Expected 'parse' phase, got '${__classPrivateFieldGet(this, _CoreContext_phase, "f").type}'`);
|
|
40
|
-
}
|
|
36
|
+
parse(schema) {
|
|
37
|
+
__classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupParsePhase).call(this, schema), "f");
|
|
41
38
|
return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.parse();
|
|
42
39
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
appendToStackTrail(token) {
|
|
41
|
+
__classPrivateFieldGet(this, _CoreContext_stackTrail, "f").append(token);
|
|
42
|
+
}
|
|
43
|
+
removeFromStackTrail(token) {
|
|
44
|
+
__classPrivateFieldGet(this, _CoreContext_stackTrail, "f").remove(token);
|
|
45
|
+
}
|
|
46
|
+
transform({ schema, settings, generatorsMap, prettier }) {
|
|
47
47
|
const callback = (generatorKey) => {
|
|
48
|
-
if (__classPrivateFieldGet(this, _CoreContext_phase, "f")
|
|
48
|
+
if (__classPrivateFieldGet(this, _CoreContext_phase, "f")?.type === 'render') {
|
|
49
49
|
__classPrivateFieldGet(this, _CoreContext_phase, "f").context.addGeneratorKey({ generatorKey });
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
const schemaModel =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
const schemaModel = tracer(this, 'parse', () => {
|
|
53
|
+
__classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupParsePhase).call(this, schema), "f");
|
|
54
|
+
return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.parse();
|
|
55
|
+
});
|
|
56
|
+
const files = tracer(this, 'generate', () => {
|
|
57
|
+
__classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupGeneratePhase).call(this, {
|
|
58
|
+
schemaModel,
|
|
59
|
+
settings,
|
|
60
|
+
generatorsMap,
|
|
61
|
+
callback
|
|
62
|
+
}), "f");
|
|
63
|
+
return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.generate(generatorsMap);
|
|
64
|
+
});
|
|
60
65
|
this.logger.debug(`${files.size} files generated`);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
const renderOutput = tracer(this, 'render', () => {
|
|
67
|
+
__classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupRenderPhase).call(this, {
|
|
68
|
+
files,
|
|
69
|
+
pinnableGenerators: Object.values(generatorsMap)
|
|
70
|
+
.map(({ id, pinnable }) => (pinnable ? id : null))
|
|
71
|
+
.filter(generatorId => generatorId !== null),
|
|
72
|
+
prettier,
|
|
73
|
+
basePath: settings?.basePath
|
|
74
|
+
}), "f");
|
|
75
|
+
return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.render();
|
|
76
|
+
});
|
|
71
77
|
return {
|
|
72
78
|
...renderOutput,
|
|
73
79
|
results: __classPrivateFieldGet(this, _CoreContext_results, "f")
|
|
74
80
|
};
|
|
75
81
|
}
|
|
76
82
|
captureCurrentResult(result) {
|
|
77
|
-
const stackTrail = __classPrivateFieldGet(this,
|
|
83
|
+
const stackTrail = __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").toString();
|
|
78
84
|
if (incomingResultIsWorse({
|
|
79
85
|
current: __classPrivateFieldGet(this, _CoreContext_results, "f")[stackTrail],
|
|
80
86
|
incoming: result
|
|
@@ -82,9 +88,6 @@ export class CoreContext {
|
|
|
82
88
|
__classPrivateFieldGet(this, _CoreContext_results, "f")[stackTrail] = result;
|
|
83
89
|
}
|
|
84
90
|
}
|
|
85
|
-
get phaseType() {
|
|
86
|
-
return __classPrivateFieldGet(this, _CoreContext_phase, "f").type;
|
|
87
|
-
}
|
|
88
91
|
}
|
|
89
92
|
_CoreContext_phase = new WeakMap(), _CoreContext_results = new WeakMap(), _CoreContext_stackTrail = new WeakMap(), _CoreContext_instances = new WeakSet(), _CoreContext_setupLogger = function _CoreContext_setupLogger(spanId) {
|
|
90
93
|
log.setup({
|
|
@@ -92,7 +95,7 @@ _CoreContext_phase = new WeakMap(), _CoreContext_results = new WeakMap(), _CoreC
|
|
|
92
95
|
[`${spanId}-logs`]: new log.ConsoleHandler('DEBUG', {
|
|
93
96
|
formatter: logRecord => skmtcFormatter({
|
|
94
97
|
logRecord,
|
|
95
|
-
stackTrail: __classPrivateFieldGet(this,
|
|
98
|
+
stackTrail: __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").toString()
|
|
96
99
|
}),
|
|
97
100
|
useColors: false
|
|
98
101
|
}),
|
|
@@ -109,37 +112,34 @@ _CoreContext_phase = new WeakMap(), _CoreContext_results = new WeakMap(), _CoreC
|
|
|
109
112
|
}
|
|
110
113
|
});
|
|
111
114
|
return log.getLogger(spanId);
|
|
112
|
-
}, _CoreContext_getStackTrailString = function _CoreContext_getStackTrailString() {
|
|
113
|
-
const substack = match(__classPrivateFieldGet(this, _CoreContext_phase, "f"))
|
|
114
|
-
.with({ type: 'parse' }, ({ context }) => context.stackTrail)
|
|
115
|
-
.with({ type: 'generate' }, ({ context }) => context.stackTrail)
|
|
116
|
-
.with({ type: 'render' }, ({ context }) => context.stackTrail)
|
|
117
|
-
.exhaustive();
|
|
118
|
-
return StackTrail.join(__classPrivateFieldGet(this, _CoreContext_stackTrail, "f"), substack);
|
|
119
115
|
}, _CoreContext_setupParsePhase = function _CoreContext_setupParsePhase(schema) {
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
const parseContext = new ParseContext({
|
|
117
|
+
schema,
|
|
118
|
+
logger: this.logger,
|
|
119
|
+
appendToStackTrail: this.appendToStackTrail.bind(this),
|
|
120
|
+
removeFromStackTrail: this.appendToStackTrail.bind(this)
|
|
121
|
+
});
|
|
122
122
|
return { type: 'parse', context: parseContext };
|
|
123
123
|
}, _CoreContext_setupGeneratePhase = function _CoreContext_setupGeneratePhase({ schemaModel, settings, generatorsMap, callback }) {
|
|
124
|
-
__classPrivateFieldGet(this, _CoreContext_stackTrail, "f").remove('parse');
|
|
125
|
-
__classPrivateFieldGet(this, _CoreContext_stackTrail, "f").append('generate');
|
|
126
124
|
const generateContext = new GenerateContext({
|
|
127
125
|
schemaModel,
|
|
128
126
|
settings,
|
|
129
127
|
generatorsMap,
|
|
130
128
|
logger: this.logger,
|
|
131
129
|
callback,
|
|
132
|
-
captureCurrentResult: this.captureCurrentResult.bind(this)
|
|
130
|
+
captureCurrentResult: this.captureCurrentResult.bind(this),
|
|
131
|
+
appendToStackTrail: this.appendToStackTrail.bind(this),
|
|
132
|
+
removeFromStackTrail: this.removeFromStackTrail.bind(this)
|
|
133
133
|
});
|
|
134
134
|
return { type: 'generate', context: generateContext };
|
|
135
135
|
}, _CoreContext_setupRenderPhase = function _CoreContext_setupRenderPhase({ files, prettier, basePath, pinnableGenerators }) {
|
|
136
|
-
__classPrivateFieldGet(this, _CoreContext_stackTrail, "f").remove('generate');
|
|
137
|
-
__classPrivateFieldGet(this, _CoreContext_stackTrail, "f").append('render');
|
|
138
136
|
const renderContext = new RenderContext({
|
|
139
137
|
files,
|
|
140
138
|
prettier,
|
|
141
139
|
basePath,
|
|
142
|
-
pinnableGenerators
|
|
140
|
+
pinnableGenerators,
|
|
141
|
+
appendToStackTrail: this.appendToStackTrail.bind(this),
|
|
142
|
+
removeFromStackTrail: this.removeFromStackTrail.bind(this)
|
|
143
143
|
});
|
|
144
144
|
return { type: 'render', context: renderContext };
|
|
145
145
|
};
|
|
@@ -22,6 +22,8 @@ type ConstructorArgs = {
|
|
|
22
22
|
logger: log.Logger;
|
|
23
23
|
callback: (generatorKey: GeneratorKey) => void;
|
|
24
24
|
captureCurrentResult: (result: SuccessWarningError) => void;
|
|
25
|
+
appendToStackTrail: (token: string | string[]) => void;
|
|
26
|
+
removeFromStackTrail: (token: string | string[]) => void;
|
|
25
27
|
};
|
|
26
28
|
export type PickArgs = {
|
|
27
29
|
name: string;
|
|
@@ -68,11 +70,10 @@ export declare class GenerateContext {
|
|
|
68
70
|
logger: log.Logger;
|
|
69
71
|
callback: (generatorKey: GeneratorKey) => void;
|
|
70
72
|
captureCurrentResult: (result: SuccessWarningError) => void;
|
|
71
|
-
|
|
73
|
+
appendToStackTrail: (token: string | string[]) => void;
|
|
74
|
+
removeFromStackTrail: (token: string | string[]) => void;
|
|
75
|
+
constructor({ schemaModel, settings, logger, callback, captureCurrentResult, appendToStackTrail, removeFromStackTrail }: ConstructorArgs);
|
|
72
76
|
generate(generatorsMap: Record<string, OperationGenerator | ModelGenerator>): Map<string, FileContents>;
|
|
73
|
-
appendStackTrailChunk(chunk: string | string[]): void;
|
|
74
|
-
removeStackTrailChunk(chunk: string | string[]): void;
|
|
75
|
-
get stackTrail(): string;
|
|
76
77
|
getFile(filePath: string, { throwIfNotFound }?: GetFileOptions): FileContents;
|
|
77
78
|
register({ imports, definitions, destinationPath }: RegisterArgs): void;
|
|
78
79
|
insert<V extends GeneratedValue, T extends GenerationType>({ generation, destinationPath, ...rest }: InsertArgs<V, T>): InsertReturn<V, T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAEf,MAAM,2BAA2B,CAAA;AAGlC,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACf,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE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CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,oBAAoB;IAwBnE,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY;IAgB7C,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAWpE,oDAAoD;IACpD,cAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS;CAGvE"}
|
|
@@ -9,15 +9,14 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _GenerateContext_instances, _GenerateContext_files,
|
|
12
|
+
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_runOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_generateModel, _GenerateContext_generateOperation;
|
|
13
13
|
import { join, normalize } from '../deps/jsr.io/@std/path/1.0.0/mod.js';
|
|
14
14
|
import { Import } from '../dsl/Import.js';
|
|
15
15
|
import { OperationDriver } from '../dsl/OperationDriver.js';
|
|
16
16
|
import { ModelDriver } from '../dsl/ModelDriver.js';
|
|
17
|
-
import { StackTrail } from './StackTrail.js';
|
|
18
17
|
import * as Sentry from '@sentry/deno';
|
|
19
18
|
export class GenerateContext {
|
|
20
|
-
constructor({ schemaModel, settings, logger, callback, captureCurrentResult }) {
|
|
19
|
+
constructor({ schemaModel, settings, logger, callback, captureCurrentResult, appendToStackTrail, removeFromStackTrail }) {
|
|
21
20
|
_GenerateContext_instances.add(this);
|
|
22
21
|
_GenerateContext_files.set(this, void 0);
|
|
23
22
|
Object.defineProperty(this, "schemaModel", {
|
|
@@ -32,7 +31,6 @@ export class GenerateContext {
|
|
|
32
31
|
writable: true,
|
|
33
32
|
value: void 0
|
|
34
33
|
});
|
|
35
|
-
_GenerateContext_stackTrail.set(this, void 0);
|
|
36
34
|
Object.defineProperty(this, "logger", {
|
|
37
35
|
enumerable: true,
|
|
38
36
|
configurable: true,
|
|
@@ -51,45 +49,49 @@ export class GenerateContext {
|
|
|
51
49
|
writable: true,
|
|
52
50
|
value: void 0
|
|
53
51
|
});
|
|
52
|
+
Object.defineProperty(this, "appendToStackTrail", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
configurable: true,
|
|
55
|
+
writable: true,
|
|
56
|
+
value: void 0
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(this, "removeFromStackTrail", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
writable: true,
|
|
62
|
+
value: void 0
|
|
63
|
+
});
|
|
54
64
|
this.logger = logger;
|
|
55
|
-
__classPrivateFieldSet(this, _GenerateContext_stackTrail, new StackTrail(), "f");
|
|
56
65
|
__classPrivateFieldSet(this, _GenerateContext_files, new Map(), "f");
|
|
57
66
|
this.schemaModel = schemaModel;
|
|
58
67
|
this.settings = settings;
|
|
59
68
|
this.callback = callback;
|
|
60
69
|
this.captureCurrentResult = captureCurrentResult;
|
|
70
|
+
this.appendToStackTrail = appendToStackTrail;
|
|
71
|
+
this.removeFromStackTrail = removeFromStackTrail;
|
|
61
72
|
}
|
|
62
73
|
generate(generatorsMap) {
|
|
63
74
|
Sentry.startSpan({ name: 'Generate operations' }, () => Object.values(generatorsMap)
|
|
64
75
|
.filter(generator => generator.type === 'operation')
|
|
65
76
|
.forEach(generator => {
|
|
66
|
-
this.
|
|
77
|
+
this.appendToStackTrail(generator.id);
|
|
67
78
|
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runOperationGenerator).call(this, {
|
|
68
79
|
schemaModel: this.schemaModel,
|
|
69
80
|
generator
|
|
70
81
|
});
|
|
71
|
-
this.
|
|
82
|
+
this.removeFromStackTrail(generator.id);
|
|
72
83
|
}));
|
|
73
84
|
Sentry.startSpan({ name: 'Generate models' }, () => {
|
|
74
85
|
Object.values(generatorsMap)
|
|
75
86
|
.filter(generator => generator.type === 'model')
|
|
76
87
|
.forEach(generator => {
|
|
77
|
-
this.
|
|
88
|
+
this.appendToStackTrail(generator.id);
|
|
78
89
|
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runModelGenerator).call(this, { schemaModel: this.schemaModel, generator });
|
|
79
|
-
this.
|
|
90
|
+
this.removeFromStackTrail(generator.id);
|
|
80
91
|
});
|
|
81
92
|
});
|
|
82
93
|
return __classPrivateFieldGet(this, _GenerateContext_files, "f");
|
|
83
94
|
}
|
|
84
|
-
appendStackTrailChunk(chunk) {
|
|
85
|
-
__classPrivateFieldGet(this, _GenerateContext_stackTrail, "f").append(chunk);
|
|
86
|
-
}
|
|
87
|
-
removeStackTrailChunk(chunk) {
|
|
88
|
-
__classPrivateFieldGet(this, _GenerateContext_stackTrail, "f").remove(chunk);
|
|
89
|
-
}
|
|
90
|
-
get stackTrail() {
|
|
91
|
-
return __classPrivateFieldGet(this, _GenerateContext_stackTrail, "f").toString();
|
|
92
|
-
}
|
|
93
95
|
getFile(filePath, { throwIfNotFound = false } = {}) {
|
|
94
96
|
const normalisedPath = normalize(filePath);
|
|
95
97
|
const currentFile = __classPrivateFieldGet(this, _GenerateContext_files, "f").get(normalisedPath);
|
|
@@ -201,7 +203,7 @@ export class GenerateContext {
|
|
|
201
203
|
return this.getFile(exportPath).definitions.get(name);
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
|
-
_GenerateContext_files = new WeakMap(),
|
|
206
|
+
_GenerateContext_files = new WeakMap(), _GenerateContext_instances = new WeakSet(), _GenerateContext_runOperationGenerator = function _GenerateContext_runOperationGenerator({ schemaModel, generator }) {
|
|
205
207
|
const generatorInstance = new generator(this);
|
|
206
208
|
schemaModel.operations.forEach(operation => {
|
|
207
209
|
// TODO If we make OasOperation generic, for example by
|
|
@@ -213,21 +215,21 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_stackTrail = new WeakMa
|
|
|
213
215
|
// https://linear.app/skmtc/issue/SKM-32/generic-models-operations
|
|
214
216
|
const { path, method } = operation;
|
|
215
217
|
if (generator.isSupported(operation)) {
|
|
216
|
-
this.
|
|
218
|
+
this.appendToStackTrail([path, method]);
|
|
217
219
|
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_generateOperation).call(this, { operation, generatorInstance });
|
|
218
|
-
this.
|
|
220
|
+
this.removeFromStackTrail([path, method]);
|
|
219
221
|
}
|
|
220
222
|
});
|
|
221
223
|
}, _GenerateContext_runModelGenerator = function _GenerateContext_runModelGenerator({ schemaModel, generator }) {
|
|
222
224
|
const generatorInstance = new generator(this);
|
|
223
225
|
const refNames = Object.keys(schemaModel.components?.schemas ?? {});
|
|
224
226
|
refNames.forEach(rn => {
|
|
225
|
-
this.
|
|
227
|
+
this.appendToStackTrail(rn);
|
|
226
228
|
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_generateModel).call(this, {
|
|
227
229
|
refName: rn,
|
|
228
230
|
generatorInstance
|
|
229
231
|
});
|
|
230
|
-
this.
|
|
232
|
+
this.removeFromStackTrail(rn);
|
|
231
233
|
});
|
|
232
234
|
}, _GenerateContext_generateModel = function _GenerateContext_generateModel({ refName, generatorInstance }) {
|
|
233
235
|
try {
|
|
@@ -4,18 +4,19 @@ import type * as log from '../deps/jsr.io/@std/log/0.224.6/mod.js';
|
|
|
4
4
|
type ConstructorArgs = {
|
|
5
5
|
schema: string;
|
|
6
6
|
logger: log.Logger;
|
|
7
|
+
appendToStackTrail: (token: string | string[]) => void;
|
|
8
|
+
removeFromStackTrail: (token: string | string[]) => void;
|
|
7
9
|
};
|
|
8
10
|
export declare class ParseContext {
|
|
9
11
|
#private;
|
|
10
12
|
schema: string;
|
|
11
13
|
logger: log.Logger;
|
|
12
14
|
documentRoot: OasDocument;
|
|
13
|
-
|
|
15
|
+
appendToStackTrail: (token: string | string[]) => void;
|
|
16
|
+
removeFromStackTrail: (token: string | string[]) => void;
|
|
17
|
+
constructor({ schema, logger, appendToStackTrail, removeFromStackTrail }: ConstructorArgs);
|
|
14
18
|
parse(): OasDocument;
|
|
15
19
|
logSkippedFields(skipped: Record<string, unknown>): void;
|
|
16
|
-
get stackTrail(): string;
|
|
17
|
-
appendStackTrailChunk(chunk: string | string[]): void;
|
|
18
|
-
removeStackTrailChunk(chunk: string | string[]): void;
|
|
19
20
|
}
|
|
20
21
|
export declare const parseSchema: (schema: string) => OpenAPIV3.Document<{}>;
|
|
21
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParseContext.d.ts","sourceRoot":"","sources":["../../src/context/ParseContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"ParseContext.d.ts","sourceRoot":"","sources":["../../src/context/ParseContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAElE,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACtD,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;CACzD,CAAA;AAED,qBAAa,YAAY;;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,YAAY,EAAE,WAAW,CAAA;IACzB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACtD,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;gBAE5C,EACV,MAAM,EACN,MAAM,EACN,kBAAkB,EAClB,oBAAoB,EACrB,EAAE,eAAe;IAUlB,KAAK;IA4BL,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAWlD;AAED,eAAO,MAAM,WAAW,WAAY,MAAM,2BAMzC,CAAA"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
1
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
2
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
5
|
};
|
|
12
|
-
var _ParseContext_instances,
|
|
13
|
-
import { StackTrail } from './StackTrail.js';
|
|
6
|
+
var _ParseContext_instances, _ParseContext_parseSchema, _ParseContext_parseDocument;
|
|
14
7
|
import * as Sentry from '@sentry/deno';
|
|
15
8
|
import { parse as parseYaml } from '../deps/jsr.io/@std/yaml/0.215.0/mod.js';
|
|
16
9
|
import { toDocumentFieldsV3 } from '../oas/document/toDocumentFieldsV3.js';
|
|
17
10
|
import { OasDocument } from '../oas/document/Document.js';
|
|
18
11
|
export class ParseContext {
|
|
19
|
-
constructor({ schema, logger }) {
|
|
12
|
+
constructor({ schema, logger, appendToStackTrail, removeFromStackTrail }) {
|
|
20
13
|
_ParseContext_instances.add(this);
|
|
21
14
|
Object.defineProperty(this, "schema", {
|
|
22
15
|
enumerable: true,
|
|
@@ -24,7 +17,6 @@ export class ParseContext {
|
|
|
24
17
|
writable: true,
|
|
25
18
|
value: void 0
|
|
26
19
|
});
|
|
27
|
-
_ParseContext_stackTrail.set(this, void 0);
|
|
28
20
|
Object.defineProperty(this, "logger", {
|
|
29
21
|
enumerable: true,
|
|
30
22
|
configurable: true,
|
|
@@ -37,37 +29,37 @@ export class ParseContext {
|
|
|
37
29
|
writable: true,
|
|
38
30
|
value: void 0
|
|
39
31
|
});
|
|
32
|
+
Object.defineProperty(this, "appendToStackTrail", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: void 0
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(this, "removeFromStackTrail", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
value: void 0
|
|
43
|
+
});
|
|
40
44
|
this.schema = schema;
|
|
41
45
|
this.logger = logger;
|
|
42
|
-
__classPrivateFieldSet(this, _ParseContext_stackTrail, new StackTrail(), "f");
|
|
43
46
|
this.documentRoot = new OasDocument();
|
|
47
|
+
this.appendToStackTrail = appendToStackTrail;
|
|
48
|
+
this.removeFromStackTrail = removeFromStackTrail;
|
|
44
49
|
}
|
|
45
50
|
parse() {
|
|
46
51
|
const parsedDocument = __classPrivateFieldGet(this, _ParseContext_instances, "m", _ParseContext_parseSchema).call(this);
|
|
47
52
|
return __classPrivateFieldGet(this, _ParseContext_instances, "m", _ParseContext_parseDocument).call(this, parsedDocument);
|
|
48
53
|
}
|
|
49
54
|
logSkippedFields(skipped) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// }
|
|
56
|
-
// ).slice(0, 45)}`
|
|
57
|
-
// )
|
|
58
|
-
// })
|
|
59
|
-
}
|
|
60
|
-
get stackTrail() {
|
|
61
|
-
return __classPrivateFieldGet(this, _ParseContext_stackTrail, "f").toString();
|
|
62
|
-
}
|
|
63
|
-
appendStackTrailChunk(chunk) {
|
|
64
|
-
__classPrivateFieldGet(this, _ParseContext_stackTrail, "f").append(chunk);
|
|
65
|
-
}
|
|
66
|
-
removeStackTrailChunk(chunk) {
|
|
67
|
-
__classPrivateFieldGet(this, _ParseContext_stackTrail, "f").remove(chunk);
|
|
55
|
+
Object.entries(skipped).forEach(([key, value]) => {
|
|
56
|
+
this.logger.warn(`Property not yet implemented. Please request from support if needed - ${JSON.stringify({
|
|
57
|
+
[key]: value
|
|
58
|
+
}).slice(0, 45)}`);
|
|
59
|
+
});
|
|
68
60
|
}
|
|
69
61
|
}
|
|
70
|
-
|
|
62
|
+
_ParseContext_instances = new WeakSet(), _ParseContext_parseSchema = function _ParseContext_parseSchema() {
|
|
71
63
|
const parsedDocument = Sentry.startSpan({ name: 'Parse schema to document' }, () => parseSchema(this.schema));
|
|
72
64
|
return parsedDocument;
|
|
73
65
|
}, _ParseContext_parseDocument = function _ParseContext_parseDocument(parsedDocument) {
|
|
@@ -7,18 +7,18 @@ type ConstructorArgs = {
|
|
|
7
7
|
prettier?: PrettierConfigType;
|
|
8
8
|
basePath: string | undefined;
|
|
9
9
|
pinnableGenerators: string[];
|
|
10
|
+
appendToStackTrail: (token: string | string[]) => void;
|
|
11
|
+
removeFromStackTrail: (token: string | string[]) => void;
|
|
10
12
|
};
|
|
11
13
|
export declare class RenderContext {
|
|
12
|
-
#private;
|
|
13
14
|
files: Map<string, FileContents>;
|
|
14
15
|
private prettier?;
|
|
15
16
|
basePath: string | undefined;
|
|
16
17
|
currentDestinationPath: string | 'PRE_RENDER' | 'POST_RENDER';
|
|
17
18
|
pinnableGenerators: string[];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
get stackTrail(): string;
|
|
19
|
+
appendToStackTrail: (token: string | string[]) => void;
|
|
20
|
+
removeFromStackTrail: (token: string | string[]) => void;
|
|
21
|
+
constructor({ files, prettier, basePath, pinnableGenerators, appendToStackTrail, removeFromStackTrail }: ConstructorArgs);
|
|
22
22
|
render(): Omit<RenderResult, 'results'>;
|
|
23
23
|
private collate;
|
|
24
24
|
getFile(filePath: string): FileContents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderContext.d.ts","sourceRoot":"","sources":["../../src/context/RenderContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAGpE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAEZ,YAAY,EACb,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAMpD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAChC,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"RenderContext.d.ts","sourceRoot":"","sources":["../../src/context/RenderContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAGpE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAEZ,YAAY,EACb,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,C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