@skmtc/core 0.54.0 → 0.54.1

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.
@@ -0,0 +1,165 @@
1
+ import type { GenerateContextType } from './generateTypes.js';
2
+ import type { OasOperationEntry } from '../dsl/operation/oas/toOasOperationEntry.js';
3
+ import type { WebhookEntry } from '../dsl/webhook/toWebhookEntry.js';
4
+ import type { GqlOperationEntry } from '../dsl/operation/gql/toGqlOperationEntry.js';
5
+ import type { ModelEntry } from '../dsl/model/toModelEntry.js';
6
+ import type { OasOperation } from '../oas/operation/Operation.js';
7
+ import type { OasWebhook } from '../oas/webhook/Webhook.js';
8
+ import type { GqlOperation } from '../gql/operation/GqlOperation.js';
9
+ import { type RefParts } from '../helpers/refFns.js';
10
+ import type { RefName } from '../types/RefName.js';
11
+ import type { IncludeModelRefs, IncludePaths, SkipModelRefs, SkipPaths } from '../types/Settings.js';
12
+ import type { GqlOperationSource, ModelSource, OasOperationSource, PreviewModule, WebhookSource } from '../types/Preview.js';
13
+ /** A generator entry, the run's context and one variant: what a subject is asked with. */
14
+ type AskArgs<Entry> = {
15
+ entry: Entry;
16
+ context: GenerateContextType;
17
+ variant: string;
18
+ };
19
+ type ToSourceArgs = {
20
+ generatorId: string;
21
+ variant: string;
22
+ };
23
+ /**
24
+ * One subject of a run: an OpenAPI operation, a webhook, a GraphQL operation
25
+ * or a model. For the run, it holds how its kind differs from the others:
26
+ * where its results and its enrichments are, what a message calls it, which
27
+ * filter names it, and how an entry of its kind is called with it. The run
28
+ * asks every kind the same questions, in the same order.
29
+ *
30
+ * @template Entry - The generator entry of the subject's kind
31
+ * @template Filter - One generator's `settings.include` or `settings.skip`
32
+ * filter for the kind; `never` for a kind that has none
33
+ */
34
+ export type Subject<Entry, Filter> = {
35
+ /** Its frame or frames below the generator's in a trail, and so its place in `manifest.results`. */
36
+ readonly trail: string | string[];
37
+ /** Where its enrichments are below a generator's id. A variant's name follows. */
38
+ readonly enrichmentPath: string[];
39
+ /** What a message calls it. */
40
+ readonly label: string;
41
+ isSupported: (args: AskArgs<Entry>) => boolean;
42
+ /** Whether a filter of `settings.include` or `settings.skip` names this variant of it. */
43
+ matches(filter: Filter | undefined, variant: string): boolean;
44
+ transform: (args: AskArgs<Entry>) => void;
45
+ toPreviewModule: (args: AskArgs<Entry>) => PreviewModule | undefined;
46
+ toSource(args: ToSourceArgs): OasOperationSource | WebhookSource | GqlOperationSource | ModelSource;
47
+ };
48
+ /** An OpenAPI operation as a subject. Its results and enrichments are at `[path][method]`. */
49
+ export declare class OasOperationSubject implements Subject<OasOperationEntry, IncludePaths | SkipPaths> {
50
+ operation: OasOperation;
51
+ trail: string[];
52
+ enrichmentPath: string[];
53
+ label: string;
54
+ constructor(operation: OasOperation);
55
+ isSupported({ entry, context, variant }: AskArgs<OasOperationEntry>): boolean;
56
+ matches(filter: IncludePaths | SkipPaths | undefined, variant: string): boolean;
57
+ transform({ entry, context, variant }: AskArgs<OasOperationEntry>): void;
58
+ toPreviewModule({ entry, context, variant }: AskArgs<OasOperationEntry>): PreviewModule | undefined;
59
+ toSource({ generatorId, variant }: ToSourceArgs): OasOperationSource;
60
+ }
61
+ /**
62
+ * A 3.1 webhook as a subject. Its results are at `['webhook'][name][method]`
63
+ * and its enrichments at `[name][method]`. A filter has the shape of an
64
+ * operation's, with the webhook's name in the place of the path.
65
+ */
66
+ export declare class WebhookSubject implements Subject<WebhookEntry, IncludePaths | SkipPaths> {
67
+ webhook: OasWebhook;
68
+ trail: string[];
69
+ enrichmentPath: string[];
70
+ label: string;
71
+ constructor(webhook: OasWebhook);
72
+ isSupported({ entry, context, variant }: AskArgs<WebhookEntry>): boolean;
73
+ matches(filter: IncludePaths | SkipPaths | undefined, variant: string): boolean;
74
+ transform({ entry, context, variant }: AskArgs<WebhookEntry>): void;
75
+ toPreviewModule({ entry, context, variant }: AskArgs<WebhookEntry>): PreviewModule | undefined;
76
+ toSource({ generatorId, variant }: ToSourceArgs): WebhookSource;
77
+ }
78
+ /**
79
+ * A GraphQL operation as a subject. Its results and enrichments are at
80
+ * `[rootKind][fieldName]`. `settings.include` and `settings.skip` have no
81
+ * filter for a GraphQL operation, so no filter names it.
82
+ */
83
+ export declare class GqlOperationSubject implements Subject<GqlOperationEntry, never> {
84
+ operation: GqlOperation;
85
+ trail: string[];
86
+ enrichmentPath: string[];
87
+ label: string;
88
+ constructor(operation: GqlOperation);
89
+ isSupported({ entry, context, variant }: AskArgs<GqlOperationEntry>): boolean;
90
+ matches(): boolean;
91
+ transform({ entry, context, variant }: AskArgs<GqlOperationEntry>): void;
92
+ toPreviewModule({ entry, context, variant }: AskArgs<GqlOperationEntry>): PreviewModule | undefined;
93
+ toSource({ generatorId, variant }: ToSourceArgs): GqlOperationSource;
94
+ }
95
+ /** A model as a subject: a schema component of either protocol. Its results and enrichments are at `[refName]`. */
96
+ export declare class ModelSubject implements Subject<ModelEntry, IncludeModelRefs | SkipModelRefs> {
97
+ refName: RefName;
98
+ ref: RefParts;
99
+ trail: string;
100
+ enrichmentPath: string[];
101
+ label: string;
102
+ constructor(refName: RefName);
103
+ isSupported({ entry, context, variant }: AskArgs<ModelEntry>): boolean;
104
+ matches(filter: IncludeModelRefs | SkipModelRefs | undefined, variant: string): boolean;
105
+ transform({ entry, context, variant }: AskArgs<ModelEntry>): void;
106
+ toPreviewModule({ entry, context, variant }: AskArgs<ModelEntry>): PreviewModule | undefined;
107
+ toSource({ generatorId, variant }: ToSourceArgs): ModelSource;
108
+ }
109
+ type ToOasOperationSourceArgs = {
110
+ operation: OasOperation;
111
+ generatorId: string;
112
+ /** Operation variant the artifact was emitted for (see {@link Variant}) */
113
+ variant: string;
114
+ };
115
+ /**
116
+ * Creates an OasOperationSource from an operation, generator ID, and variant.
117
+ *
118
+ * Transforms operation and generator information into a source descriptor
119
+ * that can be used for tracking operation origins in the generation pipeline.
120
+ *
121
+ * @param args - Arguments containing operation, generator ID, and variant
122
+ * @returns OasOperationSource descriptor for the operation
123
+ */
124
+ export declare const toOasOperationSource: ({ operation, generatorId, variant }: ToOasOperationSourceArgs) => OasOperationSource;
125
+ type ToWebhookSourceArgs = {
126
+ webhook: OasWebhook;
127
+ generatorId: string;
128
+ /** Webhook variant the artifact was emitted for (see {@link Variant}) */
129
+ variant: string;
130
+ };
131
+ /**
132
+ * Creates a {@link WebhookSource} from a webhook, generator ID, and variant.
133
+ * Sibling of {@link toOasOperationSource} for the 3.1 webhook subject.
134
+ */
135
+ export declare const toWebhookSource: ({ webhook, generatorId, variant }: ToWebhookSourceArgs) => WebhookSource;
136
+ type ToGqlOperationSourceArgs = {
137
+ operation: GqlOperation;
138
+ generatorId: string;
139
+ /** Operation variant the artifact was emitted for (see {@link Variant}) */
140
+ variant: string;
141
+ };
142
+ /**
143
+ * Creates a GraphQL operation source descriptor.
144
+ *
145
+ * Sibling to {@link toOasOperationSource} for the GraphQL protocol — encodes
146
+ * `rootKind` and `fieldName` instead of `path` / `method`.
147
+ */
148
+ export declare const toGqlOperationSource: ({ operation, generatorId, variant }: ToGqlOperationSourceArgs) => GqlOperationSource;
149
+ type ToModelSourceArgs = {
150
+ refName: RefName;
151
+ generatorId: string;
152
+ /** Model variant the artifact was emitted for (see {@link Variant}) */
153
+ variant: string;
154
+ };
155
+ /**
156
+ * Creates a ModelSource from a reference name, generator ID, and variant.
157
+ *
158
+ * Transforms model reference and generator information into a source descriptor
159
+ * that can be used for tracking model origins in the generation pipeline.
160
+ *
161
+ * @param args - Arguments containing reference name, generator ID, and variant
162
+ * @returns ModelSource descriptor for the model
163
+ */
164
+ export declare const toModelSource: ({ refName, generatorId, variant }: ToModelSourceArgs) => ModelSource;
165
+ export {};
@@ -0,0 +1,328 @@
1
+ import { toSchemaComponentRef } from '../helpers/refFns.js';
2
+ /** An OpenAPI operation as a subject. Its results and enrichments are at `[path][method]`. */
3
+ export class OasOperationSubject {
4
+ constructor(operation) {
5
+ Object.defineProperty(this, "operation", {
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true,
9
+ value: void 0
10
+ });
11
+ Object.defineProperty(this, "trail", {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value: void 0
16
+ });
17
+ Object.defineProperty(this, "enrichmentPath", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: void 0
22
+ });
23
+ Object.defineProperty(this, "label", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: void 0
28
+ });
29
+ this.operation = operation;
30
+ this.trail = [operation.path, operation.method];
31
+ this.enrichmentPath = this.trail;
32
+ this.label = `${operation.method.toUpperCase()} ${operation.path}`;
33
+ }
34
+ isSupported({ entry, context, variant }) {
35
+ return (typeof entry.isSupported !== 'function' ||
36
+ entry.isSupported({ operation: this.operation, context, variant }));
37
+ }
38
+ matches(filter, variant) {
39
+ const { path, method } = this.operation;
40
+ return matchesPathFilter({ paths: filter, path, method, variant });
41
+ }
42
+ transform({ entry, context, variant }) {
43
+ entry.transform({ context, operation: this.operation, variant });
44
+ }
45
+ toPreviewModule({ entry, context, variant }) {
46
+ return entry.toPreviewModule?.({ context, operation: this.operation, variant });
47
+ }
48
+ toSource({ generatorId, variant }) {
49
+ return toOasOperationSource({ operation: this.operation, generatorId, variant });
50
+ }
51
+ }
52
+ /**
53
+ * A 3.1 webhook as a subject. Its results are at `['webhook'][name][method]`
54
+ * and its enrichments at `[name][method]`. A filter has the shape of an
55
+ * operation's, with the webhook's name in the place of the path.
56
+ */
57
+ export class WebhookSubject {
58
+ constructor(webhook) {
59
+ Object.defineProperty(this, "webhook", {
60
+ enumerable: true,
61
+ configurable: true,
62
+ writable: true,
63
+ value: void 0
64
+ });
65
+ Object.defineProperty(this, "trail", {
66
+ enumerable: true,
67
+ configurable: true,
68
+ writable: true,
69
+ value: void 0
70
+ });
71
+ Object.defineProperty(this, "enrichmentPath", {
72
+ enumerable: true,
73
+ configurable: true,
74
+ writable: true,
75
+ value: void 0
76
+ });
77
+ Object.defineProperty(this, "label", {
78
+ enumerable: true,
79
+ configurable: true,
80
+ writable: true,
81
+ value: void 0
82
+ });
83
+ this.webhook = webhook;
84
+ this.trail = ['webhook', webhook.name, webhook.method];
85
+ this.enrichmentPath = [webhook.name, webhook.method];
86
+ this.label = `webhook '${webhook.name}' (${webhook.method.toUpperCase()})`;
87
+ }
88
+ isSupported({ entry, context, variant }) {
89
+ return (typeof entry.isSupported !== 'function' ||
90
+ entry.isSupported({ webhook: this.webhook, context, variant }));
91
+ }
92
+ matches(filter, variant) {
93
+ const { name, method } = this.webhook;
94
+ return matchesPathFilter({ paths: filter, path: name, method, variant });
95
+ }
96
+ transform({ entry, context, variant }) {
97
+ entry.transform({ context, webhook: this.webhook, variant });
98
+ }
99
+ toPreviewModule({ entry, context, variant }) {
100
+ return entry.toPreviewModule?.({ context, webhook: this.webhook, variant });
101
+ }
102
+ toSource({ generatorId, variant }) {
103
+ return toWebhookSource({ webhook: this.webhook, generatorId, variant });
104
+ }
105
+ }
106
+ /**
107
+ * A GraphQL operation as a subject. Its results and enrichments are at
108
+ * `[rootKind][fieldName]`. `settings.include` and `settings.skip` have no
109
+ * filter for a GraphQL operation, so no filter names it.
110
+ */
111
+ export class GqlOperationSubject {
112
+ constructor(operation) {
113
+ Object.defineProperty(this, "operation", {
114
+ enumerable: true,
115
+ configurable: true,
116
+ writable: true,
117
+ value: void 0
118
+ });
119
+ Object.defineProperty(this, "trail", {
120
+ enumerable: true,
121
+ configurable: true,
122
+ writable: true,
123
+ value: void 0
124
+ });
125
+ Object.defineProperty(this, "enrichmentPath", {
126
+ enumerable: true,
127
+ configurable: true,
128
+ writable: true,
129
+ value: void 0
130
+ });
131
+ Object.defineProperty(this, "label", {
132
+ enumerable: true,
133
+ configurable: true,
134
+ writable: true,
135
+ value: void 0
136
+ });
137
+ this.operation = operation;
138
+ this.trail = [operation.rootKind, operation.fieldName];
139
+ this.enrichmentPath = this.trail;
140
+ this.label = `${operation.rootKind} ${operation.fieldName}`;
141
+ }
142
+ isSupported({ entry, context, variant }) {
143
+ return (typeof entry.isSupported !== 'function' ||
144
+ entry.isSupported({ operation: this.operation, context, variant }));
145
+ }
146
+ matches() {
147
+ return false;
148
+ }
149
+ transform({ entry, context, variant }) {
150
+ entry.transform({ context, operation: this.operation, variant });
151
+ }
152
+ toPreviewModule({ entry, context, variant }) {
153
+ return entry.toPreviewModule?.({ context, operation: this.operation, variant });
154
+ }
155
+ toSource({ generatorId, variant }) {
156
+ return toGqlOperationSource({ operation: this.operation, generatorId, variant });
157
+ }
158
+ }
159
+ /** A model as a subject: a schema component of either protocol. Its results and enrichments are at `[refName]`. */
160
+ export class ModelSubject {
161
+ constructor(refName) {
162
+ Object.defineProperty(this, "refName", {
163
+ enumerable: true,
164
+ configurable: true,
165
+ writable: true,
166
+ value: void 0
167
+ });
168
+ Object.defineProperty(this, "ref", {
169
+ enumerable: true,
170
+ configurable: true,
171
+ writable: true,
172
+ value: void 0
173
+ });
174
+ Object.defineProperty(this, "trail", {
175
+ enumerable: true,
176
+ configurable: true,
177
+ writable: true,
178
+ value: void 0
179
+ });
180
+ Object.defineProperty(this, "enrichmentPath", {
181
+ enumerable: true,
182
+ configurable: true,
183
+ writable: true,
184
+ value: void 0
185
+ });
186
+ Object.defineProperty(this, "label", {
187
+ enumerable: true,
188
+ configurable: true,
189
+ writable: true,
190
+ value: void 0
191
+ });
192
+ this.refName = refName;
193
+ this.ref = toSchemaComponentRef(refName);
194
+ this.trail = refName;
195
+ this.enrichmentPath = [refName];
196
+ this.label = refName;
197
+ }
198
+ isSupported({ entry, context, variant }) {
199
+ return (typeof entry.isSupported !== 'function' ||
200
+ entry.isSupported({ ref: this.ref, context, variant }));
201
+ }
202
+ matches(filter, variant) {
203
+ return matchesRefFilter({ refs: filter, refName: this.refName, variant });
204
+ }
205
+ transform({ entry, context, variant }) {
206
+ entry.transform({ context, ref: this.ref, variant });
207
+ }
208
+ toPreviewModule({ entry, context, variant }) {
209
+ return entry.toPreviewModule?.({ context, ref: this.ref, variant });
210
+ }
211
+ toSource({ generatorId, variant }) {
212
+ return toModelSource({ refName: this.refName, generatorId, variant });
213
+ }
214
+ }
215
+ /**
216
+ * Match a `(path, method, variant)` tuple against an operation-shaped
217
+ * skip or include entry. Shared by both arms because skip and include
218
+ * have the same matching rules; only the engine's interpretation of
219
+ * the result differs (skip = deny, include = allow).
220
+ *
221
+ * Returns `false` when:
222
+ * - `paths` is `undefined` (no filter applies)
223
+ * - the `path` isn't keyed in the entry
224
+ * - the `method` isn't present in the inner record
225
+ *
226
+ * Returns `true` when:
227
+ * - the method's variant array is empty (matches every variant)
228
+ * - the method's variant array contains `variant`
229
+ */
230
+ const matchesPathFilter = ({ paths, path, method, variant }) => {
231
+ if (!paths) {
232
+ return false;
233
+ }
234
+ const methodMap = paths[path];
235
+ if (!methodMap) {
236
+ return false;
237
+ }
238
+ const variants = methodMap[method];
239
+ if (variants === undefined) {
240
+ return false;
241
+ }
242
+ if (variants.length === 0) {
243
+ return true;
244
+ }
245
+ return variants.includes(variant);
246
+ };
247
+ /**
248
+ * Match a `(refName, variant)` tuple against a model-shaped skip or
249
+ * include entry. Sibling to {@link matchesPathFilter} — both arms
250
+ * share matching rules; only the engine's interpretation of the
251
+ * result differs (skip = deny, include = allow).
252
+ *
253
+ * Returns `false` when:
254
+ * - `refs` is `undefined` (no filter applies)
255
+ * - the `refName` isn't keyed in the entry
256
+ *
257
+ * Returns `true` when:
258
+ * - the refName's variant array is empty (matches every variant)
259
+ * - the refName's variant array contains `variant`
260
+ */
261
+ const matchesRefFilter = ({ refs, refName, variant }) => {
262
+ if (!refs) {
263
+ return false;
264
+ }
265
+ const variants = refs[refName];
266
+ if (variants === undefined) {
267
+ return false;
268
+ }
269
+ if (variants.length === 0) {
270
+ return true;
271
+ }
272
+ return variants.includes(variant);
273
+ };
274
+ /**
275
+ * Creates an OasOperationSource from an operation, generator ID, and variant.
276
+ *
277
+ * Transforms operation and generator information into a source descriptor
278
+ * that can be used for tracking operation origins in the generation pipeline.
279
+ *
280
+ * @param args - Arguments containing operation, generator ID, and variant
281
+ * @returns OasOperationSource descriptor for the operation
282
+ */
283
+ export const toOasOperationSource = ({ operation, generatorId, variant }) => ({
284
+ type: 'oasOperation',
285
+ generatorId,
286
+ operationPath: operation.path,
287
+ operationMethod: operation.method,
288
+ variant
289
+ });
290
+ /**
291
+ * Creates a {@link WebhookSource} from a webhook, generator ID, and variant.
292
+ * Sibling of {@link toOasOperationSource} for the 3.1 webhook subject.
293
+ */
294
+ export const toWebhookSource = ({ webhook, generatorId, variant }) => ({
295
+ type: 'webhook',
296
+ generatorId,
297
+ webhookName: webhook.name,
298
+ webhookMethod: webhook.method,
299
+ variant
300
+ });
301
+ /**
302
+ * Creates a GraphQL operation source descriptor.
303
+ *
304
+ * Sibling to {@link toOasOperationSource} for the GraphQL protocol — encodes
305
+ * `rootKind` and `fieldName` instead of `path` / `method`.
306
+ */
307
+ export const toGqlOperationSource = ({ operation, generatorId, variant }) => ({
308
+ type: 'gqlOperation',
309
+ generatorId,
310
+ rootKind: operation.rootKind,
311
+ fieldName: operation.fieldName,
312
+ variant
313
+ });
314
+ /**
315
+ * Creates a ModelSource from a reference name, generator ID, and variant.
316
+ *
317
+ * Transforms model reference and generator information into a source descriptor
318
+ * that can be used for tracking model origins in the generation pipeline.
319
+ *
320
+ * @param args - Arguments containing reference name, generator ID, and variant
321
+ * @returns ModelSource descriptor for the model
322
+ */
323
+ export const toModelSource = ({ refName, generatorId, variant }) => ({
324
+ type: 'model',
325
+ generatorId,
326
+ refName,
327
+ variant
328
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skmtc/core",
3
- "version": "0.54.0",
3
+ "version": "0.54.1",
4
4
  "description": "Skmtc is a declarative code generation framework",
5
5
  "keywords": [
6
6
  "openapi",
@@ -11,11 +11,10 @@ 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 { RefName } from '../types/RefName.js';
17
+ export { toGqlOperationSource, toModelSource, toOasOperationSource, toWebhookSource } from './Subject.js';
19
18
  import type * as log from '../deps/jsr.io/@std/log/0.224.14/mod.js';
20
19
  import type { Logger } from '../types/Logger.js';
21
20
  import type { ResultType } from '../types/Results.js';
@@ -26,8 +25,6 @@ import { Inserted } from '../dsl/Inserted.js';
26
25
  import type { CaptureChannel, CaptureSink } from '../anchors/CaptureSink.js';
27
26
  import type { FileBase } from '../dsl/FileBase.js';
28
27
  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
28
  import type { OasVoid } from '../oas/void/Void.js';
32
29
  import type { ModelProjection, NormalizedModelProjection } from '../dsl/model/types.js';
33
30
  import { type EnrichmentWarning } from '../enrichments/EnrichmentWarning.js';
@@ -366,60 +363,3 @@ export declare class GenerateContext implements GenerateContextType {
366
363
  */
367
364
  findDefinition({ name, exportPath, into }: FindDefinitionArgs): DefinitionBase | undefined;
368
365
  }
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 {};