@skmtc/core 0.54.0 → 0.55.0
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/FilePlan.d.ts +56 -0
- package/esm/context/FilePlan.js +188 -0
- package/esm/context/GenerateContext.d.ts +19 -61
- package/esm/context/GenerateContext.js +72 -390
- package/esm/context/Subject.d.ts +209 -0
- package/esm/context/Subject.js +396 -0
- package/esm/enrichments/EnrichmentAudit.d.ts +7 -0
- package/esm/enrichments/EnrichmentAudit.js +36 -4
- package/package.json +1 -1
- package/script/context/FilePlan.d.ts +56 -0
- package/script/context/FilePlan.js +192 -0
- package/script/context/GenerateContext.d.ts +19 -61
- package/script/context/GenerateContext.js +77 -395
- package/script/context/Subject.d.ts +209 -0
- package/script/context/Subject.js +407 -0
- package/script/enrichments/EnrichmentAudit.d.ts +7 -0
- package/script/enrichments/EnrichmentAudit.js +36 -4
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { GenerateContextType } from './generateTypes.js';
|
|
2
|
+
import { type PlannedSubject } from './Subject.js';
|
|
3
|
+
import type { DeclaredProjection } from '../dsl/DeclaredProjection.js';
|
|
4
|
+
import type { WorkspacePath } from '../helpers/normalizeWorkspacePath.js';
|
|
5
|
+
import type { Reach } from '../parse/Reach.js';
|
|
6
|
+
type FilePlanArgs = {
|
|
7
|
+
context: GenerateContextType;
|
|
8
|
+
/** Every subject of the run, of each kind. */
|
|
9
|
+
subjects: readonly PlannedSubject[];
|
|
10
|
+
/** The projection classes the entries of the run declared, each one time. */
|
|
11
|
+
projections: readonly DeclaredProjection[];
|
|
12
|
+
reach: Reach;
|
|
13
|
+
/** Makes an export path a projection gives into the path of a file of the run. */
|
|
14
|
+
toFilePath: (exportPath: string, generatorId: string) => WorkspacePath;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Which subjects of a run hold each file, known before the run from what the
|
|
18
|
+
* entries declared. A subject holds a file when it can write to it or read
|
|
19
|
+
* from it:
|
|
20
|
+
*
|
|
21
|
+
* - a declared projection of the subject's kind maps the subject to the file;
|
|
22
|
+
* - the file is one that a declared model projection maps a model to, and
|
|
23
|
+
* the subject names that model or a model that reaches it.
|
|
24
|
+
*
|
|
25
|
+
* When the last subject that holds a file has run, the file is complete.
|
|
26
|
+
* {@link finish} gives those files.
|
|
27
|
+
*
|
|
28
|
+
* The plan may hold a file for longer than the run needs it: a reach can
|
|
29
|
+
* have a model no generator gets to. It never knows a file that no declared
|
|
30
|
+
* projection maps a subject to, so such a file is never given by `finish`.
|
|
31
|
+
*
|
|
32
|
+
* Many subjects name one model, so the plan counts in two steps: the
|
|
33
|
+
* subjects left that name a model, and for a file, its own subjects left
|
|
34
|
+
* plus the named models left that reach it. A model's reach is then read
|
|
35
|
+
* one time, not one time for each subject that names the model.
|
|
36
|
+
*/
|
|
37
|
+
export declare class FilePlan {
|
|
38
|
+
#private;
|
|
39
|
+
/**
|
|
40
|
+
* How many times a projection could not say where a subject's file is: a
|
|
41
|
+
* static threw, or the subject's enrichments have variants and no `main`.
|
|
42
|
+
* The run reports such a fault where it happens. The plan leaves the file out.
|
|
43
|
+
*/
|
|
44
|
+
unanswered: number;
|
|
45
|
+
constructor({ context, subjects, projections, reach, toFilePath }: FilePlanArgs);
|
|
46
|
+
/** Whether the plan knows the file at `path`. */
|
|
47
|
+
has(path: WorkspacePath): boolean;
|
|
48
|
+
/** The files `subject` holds, while it is left to run. */
|
|
49
|
+
filesOf(subject: PlannedSubject): WorkspacePath[];
|
|
50
|
+
/**
|
|
51
|
+
* `subject` has run. Gives the files that no subject left to run holds:
|
|
52
|
+
* nothing writes to them or reads from them after this.
|
|
53
|
+
*/
|
|
54
|
+
finish(subject: PlannedSubject): WorkspacePath[];
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _FilePlan_instances, _FilePlan_context, _FilePlan_projections, _FilePlan_toFilePath, _FilePlan_paths, _FilePlan_indexes, _FilePlan_left, _FilePlan_held, _FilePlan_namedLeft, _FilePlan_filesBehind, _FilePlan_modelFiles, _FilePlan_toFilesBehind, _FilePlan_toModelFiles, _FilePlan_toFiles, _FilePlan_toVariants, _FilePlan_toIndex;
|
|
13
|
+
import { ModelSubject } from './Subject.js';
|
|
14
|
+
import { fromModelKey } from '../helpers/refFns.js';
|
|
15
|
+
import { toVariantList } from '../helpers/toVariantList.js';
|
|
16
|
+
/**
|
|
17
|
+
* Which subjects of a run hold each file, known before the run from what the
|
|
18
|
+
* entries declared. A subject holds a file when it can write to it or read
|
|
19
|
+
* from it:
|
|
20
|
+
*
|
|
21
|
+
* - a declared projection of the subject's kind maps the subject to the file;
|
|
22
|
+
* - the file is one that a declared model projection maps a model to, and
|
|
23
|
+
* the subject names that model or a model that reaches it.
|
|
24
|
+
*
|
|
25
|
+
* When the last subject that holds a file has run, the file is complete.
|
|
26
|
+
* {@link finish} gives those files.
|
|
27
|
+
*
|
|
28
|
+
* The plan may hold a file for longer than the run needs it: a reach can
|
|
29
|
+
* have a model no generator gets to. It never knows a file that no declared
|
|
30
|
+
* projection maps a subject to, so such a file is never given by `finish`.
|
|
31
|
+
*
|
|
32
|
+
* Many subjects name one model, so the plan counts in two steps: the
|
|
33
|
+
* subjects left that name a model, and for a file, its own subjects left
|
|
34
|
+
* plus the named models left that reach it. A model's reach is then read
|
|
35
|
+
* one time, not one time for each subject that names the model.
|
|
36
|
+
*/
|
|
37
|
+
export class FilePlan {
|
|
38
|
+
constructor({ context, subjects, projections, reach, toFilePath }) {
|
|
39
|
+
_FilePlan_instances.add(this);
|
|
40
|
+
_FilePlan_context.set(this, void 0);
|
|
41
|
+
/** The declared projections, by the kind of subject they take. */
|
|
42
|
+
_FilePlan_projections.set(this, void 0);
|
|
43
|
+
_FilePlan_toFilePath.set(this, void 0);
|
|
44
|
+
_FilePlan_paths.set(this, []);
|
|
45
|
+
_FilePlan_indexes.set(this, new Map()
|
|
46
|
+
/** By a file's index: the holds on it by subjects left to run, plus the named models left that reach it. */
|
|
47
|
+
);
|
|
48
|
+
/** By a file's index: the holds on it by subjects left to run, plus the named models left that reach it. */
|
|
49
|
+
_FilePlan_left.set(this, []);
|
|
50
|
+
_FilePlan_held.set(this, new Map()
|
|
51
|
+
/** By a model's key: how many subjects that name it are left to run. */
|
|
52
|
+
);
|
|
53
|
+
/** By a model's key: how many subjects that name it are left to run. */
|
|
54
|
+
_FilePlan_namedLeft.set(this, new Map()
|
|
55
|
+
/** By a named model's key: the indexes of the files of every model it reaches, its own included. */
|
|
56
|
+
);
|
|
57
|
+
/** By a named model's key: the indexes of the files of every model it reaches, its own included. */
|
|
58
|
+
_FilePlan_filesBehind.set(this, new Map()
|
|
59
|
+
/** By a model's key: the indexes of the files the declared model projections map it to. */
|
|
60
|
+
);
|
|
61
|
+
/** By a model's key: the indexes of the files the declared model projections map it to. */
|
|
62
|
+
_FilePlan_modelFiles.set(this, new Map()
|
|
63
|
+
/**
|
|
64
|
+
* How many times a projection could not say where a subject's file is: a
|
|
65
|
+
* static threw, or the subject's enrichments have variants and no `main`.
|
|
66
|
+
* The run reports such a fault where it happens. The plan leaves the file out.
|
|
67
|
+
*/
|
|
68
|
+
);
|
|
69
|
+
/**
|
|
70
|
+
* How many times a projection could not say where a subject's file is: a
|
|
71
|
+
* static threw, or the subject's enrichments have variants and no `main`.
|
|
72
|
+
* The run reports such a fault where it happens. The plan leaves the file out.
|
|
73
|
+
*/
|
|
74
|
+
Object.defineProperty(this, "unanswered", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
value: 0
|
|
79
|
+
});
|
|
80
|
+
__classPrivateFieldSet(this, _FilePlan_context, context, "f");
|
|
81
|
+
__classPrivateFieldSet(this, _FilePlan_projections, Map.groupBy(projections, projection => projection.type), "f");
|
|
82
|
+
__classPrivateFieldSet(this, _FilePlan_toFilePath, toFilePath, "f");
|
|
83
|
+
subjects.forEach(subject => {
|
|
84
|
+
// A model names itself, so its own files are among the files behind
|
|
85
|
+
// its key; asking for them here too would answer each projection twice.
|
|
86
|
+
const files = subject.type === 'model' ? [] : __classPrivateFieldGet(this, _FilePlan_instances, "m", _FilePlan_toFiles).call(this, subject);
|
|
87
|
+
const models = subject.toNamedModels(reach);
|
|
88
|
+
files.forEach(file => {
|
|
89
|
+
__classPrivateFieldGet(this, _FilePlan_left, "f")[file] += 1;
|
|
90
|
+
});
|
|
91
|
+
models.forEach(key => {
|
|
92
|
+
const namedLeft = __classPrivateFieldGet(this, _FilePlan_namedLeft, "f").get(key) ?? 0;
|
|
93
|
+
if (namedLeft === 0) {
|
|
94
|
+
__classPrivateFieldGet(this, _FilePlan_instances, "m", _FilePlan_toFilesBehind).call(this, key, reach).forEach(file => {
|
|
95
|
+
__classPrivateFieldGet(this, _FilePlan_left, "f")[file] += 1;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
__classPrivateFieldGet(this, _FilePlan_namedLeft, "f").set(key, namedLeft + 1);
|
|
99
|
+
});
|
|
100
|
+
__classPrivateFieldGet(this, _FilePlan_held, "f").set(subject, { files, models });
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/** Whether the plan knows the file at `path`. */
|
|
104
|
+
has(path) {
|
|
105
|
+
return __classPrivateFieldGet(this, _FilePlan_indexes, "f").has(path);
|
|
106
|
+
}
|
|
107
|
+
/** The files `subject` holds, while it is left to run. */
|
|
108
|
+
filesOf(subject) {
|
|
109
|
+
const held = __classPrivateFieldGet(this, _FilePlan_held, "f").get(subject);
|
|
110
|
+
if (held === undefined) {
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
const behind = held.models.flatMap(key => __classPrivateFieldGet(this, _FilePlan_filesBehind, "f").get(key) ?? []);
|
|
114
|
+
return [...new Set([...held.files, ...behind])].map(file => __classPrivateFieldGet(this, _FilePlan_paths, "f")[file]);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* `subject` has run. Gives the files that no subject left to run holds:
|
|
118
|
+
* nothing writes to them or reads from them after this.
|
|
119
|
+
*/
|
|
120
|
+
finish(subject) {
|
|
121
|
+
const held = __classPrivateFieldGet(this, _FilePlan_held, "f").get(subject);
|
|
122
|
+
if (held === undefined) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
__classPrivateFieldGet(this, _FilePlan_held, "f").delete(subject);
|
|
126
|
+
const released = held.models.flatMap(key => {
|
|
127
|
+
const namedLeft = (__classPrivateFieldGet(this, _FilePlan_namedLeft, "f").get(key) ?? 0) - 1;
|
|
128
|
+
__classPrivateFieldGet(this, _FilePlan_namedLeft, "f").set(key, namedLeft);
|
|
129
|
+
return namedLeft === 0 ? (__classPrivateFieldGet(this, _FilePlan_filesBehind, "f").get(key) ?? []) : [];
|
|
130
|
+
});
|
|
131
|
+
return [...held.files, ...released].flatMap(file => {
|
|
132
|
+
__classPrivateFieldGet(this, _FilePlan_left, "f")[file] -= 1;
|
|
133
|
+
return __classPrivateFieldGet(this, _FilePlan_left, "f")[file] === 0 ? [__classPrivateFieldGet(this, _FilePlan_paths, "f")[file]] : [];
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
_FilePlan_context = new WeakMap(), _FilePlan_projections = new WeakMap(), _FilePlan_toFilePath = new WeakMap(), _FilePlan_paths = new WeakMap(), _FilePlan_indexes = new WeakMap(), _FilePlan_left = new WeakMap(), _FilePlan_held = new WeakMap(), _FilePlan_namedLeft = new WeakMap(), _FilePlan_filesBehind = new WeakMap(), _FilePlan_modelFiles = new WeakMap(), _FilePlan_instances = new WeakSet(), _FilePlan_toFilesBehind = function _FilePlan_toFilesBehind(key, reach) {
|
|
138
|
+
const found = __classPrivateFieldGet(this, _FilePlan_filesBehind, "f").get(key);
|
|
139
|
+
if (found !== undefined) {
|
|
140
|
+
return found;
|
|
141
|
+
}
|
|
142
|
+
const reached = [...reach.ofModel(fromModelKey(key))];
|
|
143
|
+
const files = [...new Set(reached.flatMap(model => __classPrivateFieldGet(this, _FilePlan_instances, "m", _FilePlan_toModelFiles).call(this, model)))];
|
|
144
|
+
__classPrivateFieldGet(this, _FilePlan_filesBehind, "f").set(key, files);
|
|
145
|
+
return files;
|
|
146
|
+
}, _FilePlan_toModelFiles = function _FilePlan_toModelFiles(key) {
|
|
147
|
+
const found = __classPrivateFieldGet(this, _FilePlan_modelFiles, "f").get(key);
|
|
148
|
+
if (found !== undefined) {
|
|
149
|
+
return found;
|
|
150
|
+
}
|
|
151
|
+
const files = __classPrivateFieldGet(this, _FilePlan_instances, "m", _FilePlan_toFiles).call(this, new ModelSubject(fromModelKey(key)));
|
|
152
|
+
__classPrivateFieldGet(this, _FilePlan_modelFiles, "f").set(key, files);
|
|
153
|
+
return files;
|
|
154
|
+
}, _FilePlan_toFiles = function _FilePlan_toFiles(subject) {
|
|
155
|
+
const projections = __classPrivateFieldGet(this, _FilePlan_projections, "f").get(subject.type) ?? [];
|
|
156
|
+
return projections.flatMap(projection => __classPrivateFieldGet(this, _FilePlan_instances, "m", _FilePlan_toVariants).call(this, subject, projection).flatMap(variant => {
|
|
157
|
+
try {
|
|
158
|
+
const exportPath = subject.toExportPath({ projection, context: __classPrivateFieldGet(this, _FilePlan_context, "f"), variant });
|
|
159
|
+
return exportPath === undefined ? [] : [__classPrivateFieldGet(this, _FilePlan_instances, "m", _FilePlan_toIndex).call(this, __classPrivateFieldGet(this, _FilePlan_toFilePath, "f").call(this, exportPath, projection.id))];
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
this.unanswered += 1;
|
|
163
|
+
return [];
|
|
164
|
+
}
|
|
165
|
+
}));
|
|
166
|
+
}, _FilePlan_toVariants = function _FilePlan_toVariants(subject, projection) {
|
|
167
|
+
try {
|
|
168
|
+
return toVariantList({
|
|
169
|
+
opEnrichments: __classPrivateFieldGet(this, _FilePlan_context, "f").readEnrichment([projection.id, ...subject.enrichmentPath]),
|
|
170
|
+
generatorId: projection.id,
|
|
171
|
+
operationLabel: subject.label
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
this.unanswered += 1;
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
}, _FilePlan_toIndex = function _FilePlan_toIndex(path) {
|
|
179
|
+
const found = __classPrivateFieldGet(this, _FilePlan_indexes, "f").get(path);
|
|
180
|
+
if (found !== undefined) {
|
|
181
|
+
return found;
|
|
182
|
+
}
|
|
183
|
+
const index = __classPrivateFieldGet(this, _FilePlan_paths, "f").length;
|
|
184
|
+
__classPrivateFieldGet(this, _FilePlan_paths, "f").push(path);
|
|
185
|
+
__classPrivateFieldGet(this, _FilePlan_left, "f").push(0);
|
|
186
|
+
__classPrivateFieldGet(this, _FilePlan_indexes, "f").set(path, index);
|
|
187
|
+
return index;
|
|
188
|
+
};
|
|
@@ -11,11 +11,13 @@ import type { BuildModelSettingsArgs, GenerateContextType, GenerateResult, Inser
|
|
|
11
11
|
import type { ClientSettings } from '../types/Settings.js';
|
|
12
12
|
import { type Method } from '../types/Method.js';
|
|
13
13
|
import type { OasOperation } from '../oas/operation/Operation.js';
|
|
14
|
-
import type { OasWebhook } from '../oas/webhook/Webhook.js';
|
|
15
14
|
import { type ProjectionOptionsRest } from '../types/ProjectionOptions.js';
|
|
16
15
|
import type { GeneratedValue } from '../dsl/GeneratedValue.js';
|
|
17
16
|
import { ContentSettings } from '../dsl/ContentSettings.js';
|
|
18
|
-
import type
|
|
17
|
+
import { type PlannedSubject } from './Subject.js';
|
|
18
|
+
import { FilePlan } from './FilePlan.js';
|
|
19
|
+
import type { Reach } from '../parse/Reach.js';
|
|
20
|
+
export { toGqlOperationSource, toModelSource, toOasOperationSource, toWebhookSource } from './Subject.js';
|
|
19
21
|
import type * as log from '../deps/jsr.io/@std/log/0.224.14/mod.js';
|
|
20
22
|
import type { Logger } from '../types/Logger.js';
|
|
21
23
|
import type { ResultType } from '../types/Results.js';
|
|
@@ -26,8 +28,6 @@ import { Inserted } from '../dsl/Inserted.js';
|
|
|
26
28
|
import type { CaptureChannel, CaptureSink } from '../anchors/CaptureSink.js';
|
|
27
29
|
import type { FileBase } from '../dsl/FileBase.js';
|
|
28
30
|
import type { GeneratorsMapContainer } from '../types/GeneratorType.js';
|
|
29
|
-
import type { OasOperationSource, WebhookSource, GqlOperationSource, ModelSource } from '../types/Preview.js';
|
|
30
|
-
import type { GqlOperation } from '../gql/operation/GqlOperation.js';
|
|
31
31
|
import type { OasVoid } from '../oas/void/Void.js';
|
|
32
32
|
import type { ModelProjection, NormalizedModelProjection } from '../dsl/model/types.js';
|
|
33
33
|
import { type EnrichmentWarning } from '../enrichments/EnrichmentWarning.js';
|
|
@@ -57,6 +57,11 @@ type ConstructorArgs = {
|
|
|
57
57
|
*/
|
|
58
58
|
logsGeneratorLines?: boolean;
|
|
59
59
|
};
|
|
60
|
+
type ToFilePlanArgs = {
|
|
61
|
+
/** The subjects of the run, of each kind. */
|
|
62
|
+
subjects: readonly PlannedSubject[];
|
|
63
|
+
reach: Reach;
|
|
64
|
+
};
|
|
60
65
|
/**
|
|
61
66
|
* Arguments for applying package imports to a generated file.
|
|
62
67
|
*
|
|
@@ -200,6 +205,16 @@ export declare class GenerateContext implements GenerateContextType {
|
|
|
200
205
|
* @internal
|
|
201
206
|
*/
|
|
202
207
|
toArtifacts(stackTrail: StackTrail): GenerateResult;
|
|
208
|
+
/**
|
|
209
|
+
* @internal
|
|
210
|
+
* The file plan of a run of this context: which of `subjects` hold each
|
|
211
|
+
* file, from the projection classes that the entries of the run declared.
|
|
212
|
+
* An entry that declared none adds no file to the plan, and a generator
|
|
213
|
+
* that `settings.skip` names whole adds none either, and a GraphQL
|
|
214
|
+
* document's plan knows no file. Building the plan
|
|
215
|
+
* leaves the run as it is: its reads of enrichments are not recorded.
|
|
216
|
+
*/
|
|
217
|
+
toFilePlan({ subjects, reach }: ToFilePlanArgs): FilePlan;
|
|
203
218
|
/**
|
|
204
219
|
* Evaluate each generator's `isSupported` over the parsed document's subjects
|
|
205
220
|
* and report the subjects each generator supports — capability only, no
|
|
@@ -366,60 +381,3 @@ export declare class GenerateContext implements GenerateContextType {
|
|
|
366
381
|
*/
|
|
367
382
|
findDefinition({ name, exportPath, into }: FindDefinitionArgs): DefinitionBase | undefined;
|
|
368
383
|
}
|
|
369
|
-
type ToOasOperationSourceArgs = {
|
|
370
|
-
operation: OasOperation;
|
|
371
|
-
generatorId: string;
|
|
372
|
-
/** Operation variant the artifact was emitted for (see {@link Variant}) */
|
|
373
|
-
variant: string;
|
|
374
|
-
};
|
|
375
|
-
/**
|
|
376
|
-
* Creates an OasOperationSource from an operation, generator ID, and variant.
|
|
377
|
-
*
|
|
378
|
-
* Transforms operation and generator information into a source descriptor
|
|
379
|
-
* that can be used for tracking operation origins in the generation pipeline.
|
|
380
|
-
*
|
|
381
|
-
* @param args - Arguments containing operation, generator ID, and variant
|
|
382
|
-
* @returns OasOperationSource descriptor for the operation
|
|
383
|
-
*/
|
|
384
|
-
export declare const toOasOperationSource: ({ operation, generatorId, variant }: ToOasOperationSourceArgs) => OasOperationSource;
|
|
385
|
-
type ToWebhookSourceArgs = {
|
|
386
|
-
webhook: OasWebhook;
|
|
387
|
-
generatorId: string;
|
|
388
|
-
/** Webhook variant the artifact was emitted for (see {@link Variant}) */
|
|
389
|
-
variant: string;
|
|
390
|
-
};
|
|
391
|
-
/**
|
|
392
|
-
* Creates a {@link WebhookSource} from a webhook, generator ID, and variant.
|
|
393
|
-
* Sibling of {@link toOasOperationSource} for the 3.1 webhook subject.
|
|
394
|
-
*/
|
|
395
|
-
export declare const toWebhookSource: ({ webhook, generatorId, variant }: ToWebhookSourceArgs) => WebhookSource;
|
|
396
|
-
type ToGqlOperationSourceArgs = {
|
|
397
|
-
operation: GqlOperation;
|
|
398
|
-
generatorId: string;
|
|
399
|
-
/** Operation variant the artifact was emitted for (see {@link Variant}) */
|
|
400
|
-
variant: string;
|
|
401
|
-
};
|
|
402
|
-
/**
|
|
403
|
-
* Creates a GraphQL operation source descriptor.
|
|
404
|
-
*
|
|
405
|
-
* Sibling to {@link toOasOperationSource} for the GraphQL protocol — encodes
|
|
406
|
-
* `rootKind` and `fieldName` instead of `path` / `method`.
|
|
407
|
-
*/
|
|
408
|
-
export declare const toGqlOperationSource: ({ operation, generatorId, variant }: ToGqlOperationSourceArgs) => GqlOperationSource;
|
|
409
|
-
type ToModelSourceArgs = {
|
|
410
|
-
refName: RefName;
|
|
411
|
-
generatorId: string;
|
|
412
|
-
/** Model variant the artifact was emitted for (see {@link Variant}) */
|
|
413
|
-
variant: string;
|
|
414
|
-
};
|
|
415
|
-
/**
|
|
416
|
-
* Creates a ModelSource from a reference name, generator ID, and variant.
|
|
417
|
-
*
|
|
418
|
-
* Transforms model reference and generator information into a source descriptor
|
|
419
|
-
* that can be used for tracking model origins in the generation pipeline.
|
|
420
|
-
*
|
|
421
|
-
* @param args - Arguments containing reference name, generator ID, and variant
|
|
422
|
-
* @returns ModelSource descriptor for the model
|
|
423
|
-
*/
|
|
424
|
-
export declare const toModelSource: ({ refName, generatorId, variant }: ToModelSourceArgs) => ModelSource;
|
|
425
|
-
export {};
|