@workos/oagen 0.30.1 → 0.31.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/README.md +4 -12
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +3003 -664
- package/dist/cli/index.mjs.map +1 -1
- package/dist/compat/index.d.mts +85 -36
- package/dist/compat/index.d.mts.map +1 -1
- package/dist/compat/index.mjs +33 -23
- package/dist/compat/index.mjs.map +1 -1
- package/dist/{diff-DMFiDAI6.mjs → diff-CAsypxXV.mjs} +109 -89
- package/dist/{diff-DMFiDAI6.mjs.map → diff-CAsypxXV.mjs.map} +1 -1
- package/dist/differ-B0DSuKUZ.d.mts +72 -0
- package/dist/differ-B0DSuKUZ.d.mts.map +1 -0
- package/dist/index.d.mts +129 -61
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2992 -563
- package/dist/index.mjs.map +1 -1
- package/dist/{overlay-BhXruu32.mjs → overlay-Dj3WWlNP.mjs} +45 -38
- package/dist/overlay-Dj3WWlNP.mjs.map +1 -0
- package/dist/scripts/smoke/baseline.d.mts +1 -1
- package/dist/scripts/smoke/baseline.mjs +2848 -537
- package/dist/scripts/smoke/baseline.mjs.map +1 -1
- package/dist/scripts/smoke/sdk-test.d.mts +1 -1
- package/dist/scripts/smoke/sdk-test.mjs +4 -2
- package/dist/scripts/smoke/sdk-test.mjs.map +1 -1
- package/dist/smoke.d.mts +259 -36
- package/dist/smoke.d.mts.map +1 -1
- package/dist/smoke.mjs +2848 -537
- package/dist/smoke.mjs.map +1 -1
- package/dist/{tree-sitter-C6HB4OrC.mjs → tree-sitter-C7Hk-NDu.mjs} +36 -7
- package/dist/tree-sitter-C7Hk-NDu.mjs.map +1 -0
- package/dist/{types-yrBidOg3.d.mts → types-I7W7CNl1.d.mts} +227 -9
- package/dist/types-I7W7CNl1.d.mts.map +1 -0
- package/dist/verify/index.d.mts +7 -8
- package/dist/verify/index.d.mts.map +1 -1
- package/dist/verify/index.mjs +24 -14
- package/dist/verify/index.mjs.map +1 -1
- package/docs/architecture/emitter-contract.md +1 -0
- package/docs/architecture/ir-types.md +175 -17
- package/docs/cli.md +13 -13
- package/package.json +3 -3
- package/skills/check-emitter-parity/SKILL.md +15 -1
- package/dist/differ-DHldxZMr.d.mts +0 -123
- package/dist/differ-DHldxZMr.d.mts.map +0 -1
- package/dist/overlay-BhXruu32.mjs.map +0 -1
- package/dist/tree-sitter-C6HB4OrC.mjs.map +0 -1
- package/dist/types-yrBidOg3.d.mts.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as assertNever, M as walkTypeRef, f as toSnakeCase, i as normalizeJsExtension, j as validateModelHints, k as collectResponseHeaders, t as safeParse, x as RegistryError } from "./tree-sitter-C7Hk-NDu.mjs";
|
|
2
2
|
import * as fs from "node:fs/promises";
|
|
3
|
-
import * as path$1 from "node:path";
|
|
4
|
-
import path from "node:path";
|
|
3
|
+
import path, * as path$1 from "node:path";
|
|
5
4
|
import Parser from "tree-sitter";
|
|
6
5
|
import { execFile } from "node:child_process";
|
|
7
6
|
import { promisify } from "node:util";
|
|
@@ -15,7 +14,7 @@ function toSnake(s) {
|
|
|
15
14
|
* When a path ends with one of these, we use it as the verb instead of
|
|
16
15
|
* deriving a CRUD verb from the HTTP method.
|
|
17
16
|
*/
|
|
18
|
-
const ACTION_VERBS = new Set([
|
|
17
|
+
const ACTION_VERBS = /* @__PURE__ */ new Set([
|
|
19
18
|
"accept",
|
|
20
19
|
"activate",
|
|
21
20
|
"authorize",
|
|
@@ -302,7 +301,7 @@ const DOTNET_URL_FINGERPRINT_CONFIG = {
|
|
|
302
301
|
contentNodeTypes: ["string_content", "string_literal_content"],
|
|
303
302
|
interpolationNodeTypes: ["interpolation"]
|
|
304
303
|
};
|
|
305
|
-
const DECLARATION_TYPES = new Set([
|
|
304
|
+
const DECLARATION_TYPES = /* @__PURE__ */ new Set([
|
|
306
305
|
"class_declaration",
|
|
307
306
|
"struct_declaration",
|
|
308
307
|
"interface_declaration",
|
|
@@ -322,11 +321,12 @@ function collectPrecedingXmlDocComments(children, index, source) {
|
|
|
322
321
|
let firstIdx = -1;
|
|
323
322
|
for (let k = index - 1; k >= 0; k--) {
|
|
324
323
|
const prev = children[k];
|
|
325
|
-
if (prev.type === "comment")
|
|
326
|
-
if (
|
|
327
|
-
|
|
324
|
+
if (prev.type === "comment") {
|
|
325
|
+
if (source.slice(prev.startIndex, prev.endIndex).startsWith("///")) {
|
|
326
|
+
if (lastIdx === -1) lastIdx = k;
|
|
327
|
+
firstIdx = k;
|
|
328
|
+
} else break;
|
|
328
329
|
} else break;
|
|
329
|
-
else break;
|
|
330
330
|
}
|
|
331
331
|
if (firstIdx === -1) return null;
|
|
332
332
|
const first = children[firstIdx];
|
|
@@ -641,11 +641,12 @@ function collectPrecedingGoComments(children, index, source) {
|
|
|
641
641
|
let firstIdx = -1;
|
|
642
642
|
for (let k = index - 1; k >= 0; k--) {
|
|
643
643
|
const prev = children[k];
|
|
644
|
-
if (prev.type === "comment")
|
|
645
|
-
if (
|
|
646
|
-
|
|
644
|
+
if (prev.type === "comment") {
|
|
645
|
+
if (source.slice(prev.startIndex, prev.endIndex).startsWith("//")) {
|
|
646
|
+
if (lastIdx === -1) lastIdx = k;
|
|
647
|
+
firstIdx = k;
|
|
648
|
+
} else break;
|
|
647
649
|
} else break;
|
|
648
|
-
else break;
|
|
649
650
|
}
|
|
650
651
|
if (firstIdx === -1) return null;
|
|
651
652
|
const first = children[firstIdx];
|
|
@@ -1009,9 +1010,9 @@ function findPrecedingDocstring(children, index, source) {
|
|
|
1009
1010
|
}
|
|
1010
1011
|
return null;
|
|
1011
1012
|
}
|
|
1012
|
-
const CLASS_MEMBER_TYPES = new Set(["method_definition", "public_field_definition"]);
|
|
1013
|
-
const INTERFACE_MEMBER_TYPES = new Set(["property_signature", "method_signature"]);
|
|
1014
|
-
const ENUM_MEMBER_TYPES = new Set(["enum_assignment", "property_identifier"]);
|
|
1013
|
+
const CLASS_MEMBER_TYPES = /* @__PURE__ */ new Set(["method_definition", "public_field_definition"]);
|
|
1014
|
+
const INTERFACE_MEMBER_TYPES = /* @__PURE__ */ new Set(["property_signature", "method_signature"]);
|
|
1015
|
+
const ENUM_MEMBER_TYPES = /* @__PURE__ */ new Set(["enum_assignment", "property_identifier"]);
|
|
1015
1016
|
const NODE_URL_FINGERPRINT_CONFIG = {
|
|
1016
1017
|
stringNodeTypes: ["string", "template_string"],
|
|
1017
1018
|
contentNodeTypes: ["string_fragment"],
|
|
@@ -1423,11 +1424,12 @@ function collectPrecedingRubyComments(children, index, source) {
|
|
|
1423
1424
|
let firstIdx = -1;
|
|
1424
1425
|
for (let k = index - 1; k >= 0; k--) {
|
|
1425
1426
|
const prev = children[k];
|
|
1426
|
-
if ((prev.grammarType ?? prev.type) === "comment")
|
|
1427
|
-
if (
|
|
1428
|
-
|
|
1427
|
+
if ((prev.grammarType ?? prev.type) === "comment") {
|
|
1428
|
+
if (source.slice(prev.startIndex, prev.endIndex).startsWith("#")) {
|
|
1429
|
+
if (lastIdx === -1) lastIdx = k;
|
|
1430
|
+
firstIdx = k;
|
|
1431
|
+
} else break;
|
|
1429
1432
|
} else break;
|
|
1430
|
-
else break;
|
|
1431
1433
|
}
|
|
1432
1434
|
if (firstIdx === -1) return null;
|
|
1433
1435
|
const first = children[firstIdx];
|
|
@@ -1555,11 +1557,12 @@ function collectPrecedingRustDocComments(children, index, source) {
|
|
|
1555
1557
|
let firstIdx = -1;
|
|
1556
1558
|
for (let k = index - 1; k >= 0; k--) {
|
|
1557
1559
|
const prev = children[k];
|
|
1558
|
-
if (prev.type === "line_comment")
|
|
1559
|
-
if (
|
|
1560
|
-
|
|
1560
|
+
if (prev.type === "line_comment") {
|
|
1561
|
+
if (source.slice(prev.startIndex, prev.endIndex).startsWith("///")) {
|
|
1562
|
+
if (lastIdx === -1) lastIdx = k;
|
|
1563
|
+
firstIdx = k;
|
|
1564
|
+
} else break;
|
|
1561
1565
|
} else break;
|
|
1562
|
-
else break;
|
|
1563
1566
|
}
|
|
1564
1567
|
if (firstIdx === -1) return null;
|
|
1565
1568
|
const first = children[firstIdx];
|
|
@@ -1572,7 +1575,7 @@ function collectPrecedingRustDocComments(children, index, source) {
|
|
|
1572
1575
|
}
|
|
1573
1576
|
//#endregion
|
|
1574
1577
|
//#region src/engine/merge-adapters/index.ts
|
|
1575
|
-
const adapters = new Map([
|
|
1578
|
+
const adapters = /* @__PURE__ */ new Map([
|
|
1576
1579
|
["dotnet", dotnetMergeAdapter],
|
|
1577
1580
|
["elixir", elixirMergeAdapter],
|
|
1578
1581
|
["go", goMergeAdapter],
|
|
@@ -1881,7 +1884,8 @@ async function extractStatements(source, language) {
|
|
|
1881
1884
|
* it points one past the last line of the class body.
|
|
1882
1885
|
*/
|
|
1883
1886
|
async function extractClassEndLines(source, language) {
|
|
1884
|
-
const
|
|
1887
|
+
const parser = await getParser(language);
|
|
1888
|
+
const tree = safeParse(parser, source);
|
|
1885
1889
|
const map = /* @__PURE__ */ new Map();
|
|
1886
1890
|
function processClassNode(node) {
|
|
1887
1891
|
const nameNode = node.childForFieldName("name") ?? node.children.find((c) => c.type === "type_identifier" || c.type === "identifier");
|
|
@@ -2139,14 +2143,15 @@ async function mergeIntoExisting(existingContent, generatedContent, language, he
|
|
|
2139
2143
|
}
|
|
2140
2144
|
if (prunedTexts.length > 0 && adapter.importedNames) {
|
|
2141
2145
|
const prunedText = prunedTexts.join("\n");
|
|
2142
|
-
const
|
|
2146
|
+
const parser = await getParser(language);
|
|
2147
|
+
const codeOnly = maskNonCode(safeParse(parser, result), result, adapter.urlFingerprintConfig);
|
|
2143
2148
|
const orphaned = /* @__PURE__ */ new Set();
|
|
2144
2149
|
for (const imp of existingStatements.imports) {
|
|
2145
2150
|
const names = adapter.importedNames(imp);
|
|
2146
2151
|
if (names.length === 0) continue;
|
|
2147
2152
|
if (!names.some((n) => referencesIdentifier(prunedText, n))) continue;
|
|
2148
2153
|
const line = imp.text.trim();
|
|
2149
|
-
const withoutImport = removeLines(codeOnly, new Set([line]));
|
|
2154
|
+
const withoutImport = removeLines(codeOnly, /* @__PURE__ */ new Set([line]));
|
|
2150
2155
|
if (names.some((n) => referencesIdentifier(withoutImport, n))) continue;
|
|
2151
2156
|
orphaned.add(line);
|
|
2152
2157
|
}
|
|
@@ -2166,26 +2171,28 @@ async function mergeIntoExisting(existingContent, generatedContent, language, he
|
|
|
2166
2171
|
if (!existInfo) continue;
|
|
2167
2172
|
if (docIgnoredSymbols.has(symbolName)) continue;
|
|
2168
2173
|
const genDoc = genInfo.docstring && genInfo.docstring.text.trim() !== headerLine ? genInfo.docstring : null;
|
|
2169
|
-
if (genDoc)
|
|
2170
|
-
if (
|
|
2171
|
-
|
|
2172
|
-
|
|
2174
|
+
if (genDoc) {
|
|
2175
|
+
if (existInfo.docstring) {
|
|
2176
|
+
if (!existInfo.docstring.text.includes("@oagen-ignore") && existInfo.docstring.text !== genDoc.text) {
|
|
2177
|
+
const newText = preserveDeprecatedTags(existInfo.docstring.text, genDoc.text);
|
|
2178
|
+
const range = resolveDocRange(result, existInfo.docstring.text, existInfo.declStartIndex, existInfo.docstring.startIndex, existInfo.docstring.endIndex);
|
|
2179
|
+
edits.push({
|
|
2180
|
+
start: range.start,
|
|
2181
|
+
end: range.end,
|
|
2182
|
+
newText
|
|
2183
|
+
});
|
|
2184
|
+
docstringUpdates++;
|
|
2185
|
+
}
|
|
2186
|
+
} else {
|
|
2187
|
+
const lineStart = declarationLineStart(result, existInfo.declStartIndex);
|
|
2188
|
+
const indent = " ".repeat(existInfo.declColumn);
|
|
2173
2189
|
edits.push({
|
|
2174
|
-
start:
|
|
2175
|
-
end:
|
|
2176
|
-
newText
|
|
2190
|
+
start: lineStart,
|
|
2191
|
+
end: lineStart,
|
|
2192
|
+
newText: indent + genDoc.text + "\n"
|
|
2177
2193
|
});
|
|
2178
2194
|
docstringUpdates++;
|
|
2179
2195
|
}
|
|
2180
|
-
} else {
|
|
2181
|
-
const lineStart = declarationLineStart(result, existInfo.declStartIndex);
|
|
2182
|
-
const indent = " ".repeat(existInfo.declColumn);
|
|
2183
|
-
edits.push({
|
|
2184
|
-
start: lineStart,
|
|
2185
|
-
end: lineStart,
|
|
2186
|
-
newText: indent + genDoc.text + "\n"
|
|
2187
|
-
});
|
|
2188
|
-
docstringUpdates++;
|
|
2189
2196
|
}
|
|
2190
2197
|
const matchedExistMembers = /* @__PURE__ */ new Set();
|
|
2191
2198
|
for (const [memberName, genMember] of genInfo.members) {
|
|
@@ -2525,8 +2532,10 @@ async function overwriteWithPreservedRegions(existingContent, generatedContent,
|
|
|
2525
2532
|
if (outcome.edited) regionDeclarationEdits++;
|
|
2526
2533
|
if (!alreadyPlaced && !outcome.placed) remaining.push(entry);
|
|
2527
2534
|
}
|
|
2528
|
-
if (!alreadyPlaced)
|
|
2529
|
-
|
|
2535
|
+
if (!alreadyPlaced) {
|
|
2536
|
+
if (remaining.length === 0) blocksByClass.delete("");
|
|
2537
|
+
else blocksByClass.set("", remaining);
|
|
2538
|
+
}
|
|
2530
2539
|
}
|
|
2531
2540
|
}
|
|
2532
2541
|
let effectiveClassEndLines = classEndLines;
|
|
@@ -2545,19 +2554,21 @@ async function overwriteWithPreservedRegions(existingContent, generatedContent,
|
|
|
2545
2554
|
break;
|
|
2546
2555
|
}
|
|
2547
2556
|
}
|
|
2548
|
-
if (insertLine === void 0)
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2557
|
+
if (insertLine === void 0) {
|
|
2558
|
+
if (info) insertLine = info.bodyEndLine;
|
|
2559
|
+
else {
|
|
2560
|
+
const scopeEndLine = entry.containingScope ? findDescribeScopeEndLine(result, entry.containingScope) : void 0;
|
|
2561
|
+
const blockHasImportsFallback = entry.lines.some((l) => /^\s*(import|from)\s/.test(l));
|
|
2562
|
+
if (scopeEndLine !== void 0) insertLine = scopeEndLine;
|
|
2563
|
+
else if (blockHasImportsFallback || hasTopLevelDeclaration(entry.lines)) {
|
|
2564
|
+
let lastImportLine = 0;
|
|
2565
|
+
for (let li = 0; li < result.length; li++) {
|
|
2566
|
+
const trimmed = result[li].trimStart();
|
|
2567
|
+
if (/^(import|from)\s/.test(trimmed)) lastImportLine = li + 1;
|
|
2568
|
+
}
|
|
2569
|
+
insertLine = lastImportLine;
|
|
2570
|
+
} else insertLine = result.length;
|
|
2571
|
+
}
|
|
2561
2572
|
}
|
|
2562
2573
|
if (entry.lines.some((l) => /^\s*import\s/.test(l))) while (insertLine >= 2 && result[insertLine - 1]?.trim() === "" && /^\s*(import|using|from)\s/.test(result[insertLine - 2] ?? "")) insertLine--;
|
|
2563
2574
|
const prevLine = insertLine > 0 ? result[insertLine - 1]?.trimStart() ?? "" : "";
|
|
@@ -3272,7 +3283,7 @@ function aggregateSurfaceServices(spec, ctx) {
|
|
|
3272
3283
|
/**
|
|
3273
3284
|
* Collect model and enum names transitively referenced by service operations.
|
|
3274
3285
|
* Walks operation parameters, request bodies, responses, and pagination item
|
|
3275
|
-
* types, then chases model field references until the set stabilizes.
|
|
3286
|
+
* and envelope types, then chases model field references until the set stabilizes.
|
|
3276
3287
|
*/
|
|
3277
3288
|
function collectReferencedNames(services, models, opts = {}) {
|
|
3278
3289
|
const preserveAllDiscriminated = opts.preserveAllDiscriminated !== false;
|
|
@@ -3288,12 +3299,17 @@ function collectReferencedNames(services, models, opts = {}) {
|
|
|
3288
3299
|
for (const p of [
|
|
3289
3300
|
...op.pathParams,
|
|
3290
3301
|
...op.queryParams,
|
|
3302
|
+
...op.bodyOwnedQueryParams ?? [],
|
|
3291
3303
|
...op.headerParams,
|
|
3292
3304
|
...op.cookieParams ?? []
|
|
3293
3305
|
]) collectFromTypeRef(p.type);
|
|
3294
3306
|
if (op.requestBody) collectFromTypeRef(op.requestBody);
|
|
3295
3307
|
collectFromTypeRef(op.response);
|
|
3296
|
-
if (op.pagination)
|
|
3308
|
+
if (op.pagination) {
|
|
3309
|
+
collectFromTypeRef(op.pagination.itemType);
|
|
3310
|
+
for (const field of op.pagination.envelopeFields ?? []) collectFromTypeRef(field.type);
|
|
3311
|
+
}
|
|
3312
|
+
for (const header of collectResponseHeaders(op)) collectFromTypeRef(header.type);
|
|
3297
3313
|
for (const err of op.errors) if (err.type) collectFromTypeRef(err.type);
|
|
3298
3314
|
if (op.successResponses) for (const sr of op.successResponses) collectFromTypeRef(sr.type);
|
|
3299
3315
|
}
|
|
@@ -3455,7 +3471,7 @@ async function treeShakeFiles(files, language) {
|
|
|
3455
3471
|
}
|
|
3456
3472
|
deps.set(file.path, fileDeps);
|
|
3457
3473
|
}
|
|
3458
|
-
const codeExtensions = new Set([
|
|
3474
|
+
const codeExtensions = /* @__PURE__ */ new Set([
|
|
3459
3475
|
".ts",
|
|
3460
3476
|
".js",
|
|
3461
3477
|
".tsx",
|
|
@@ -3537,11 +3553,10 @@ async function resolveFileToDirectoryConflicts(files, targetDir) {
|
|
|
3537
3553
|
content: moduleContent,
|
|
3538
3554
|
overwriteExisting: true
|
|
3539
3555
|
});
|
|
3540
|
-
const compatImport = "from ._compat import * # noqa: F401,F403 # pyright: ignore[reportUnusedImport]";
|
|
3541
3556
|
const existingContent = file.content.endsWith("\n") ? file.content : file.content + "\n";
|
|
3542
3557
|
result[i] = {
|
|
3543
3558
|
...file,
|
|
3544
|
-
content: existingContent +
|
|
3559
|
+
content: existingContent + "from ._compat import * # noqa: F401,F403 # pyright: ignore[reportUnusedImport]\n"
|
|
3545
3560
|
};
|
|
3546
3561
|
removals.push(fullModulePath);
|
|
3547
3562
|
}
|
|
@@ -3592,7 +3607,7 @@ async function formatTargetFiles(emitter, targetDir, filePaths) {
|
|
|
3592
3607
|
try {
|
|
3593
3608
|
await execFileAsync(formatCmd.cmd, [...formatCmd.args, ...batch], {
|
|
3594
3609
|
cwd: targetDir,
|
|
3595
|
-
maxBuffer:
|
|
3610
|
+
maxBuffer: 10485760,
|
|
3596
3611
|
timeout: 12e4
|
|
3597
3612
|
});
|
|
3598
3613
|
} catch (err) {
|
|
@@ -3688,7 +3703,7 @@ function mergeScopedManifestRecords(prev, scopedFiles, scopedOperations) {
|
|
|
3688
3703
|
files: scopedFileList,
|
|
3689
3704
|
operations: scopedOperations
|
|
3690
3705
|
};
|
|
3691
|
-
const files = [
|
|
3706
|
+
const files = [.../* @__PURE__ */ new Set([...prev.files, ...scopedFileList])].sort();
|
|
3692
3707
|
const priorOps = prev.operations;
|
|
3693
3708
|
return {
|
|
3694
3709
|
files,
|
|
@@ -3913,7 +3928,10 @@ function registerEmitter(emitter) {
|
|
|
3913
3928
|
}
|
|
3914
3929
|
function getEmitter(language) {
|
|
3915
3930
|
const emitter = emitters.get(language);
|
|
3916
|
-
if (!emitter)
|
|
3931
|
+
if (!emitter) {
|
|
3932
|
+
const available = [...emitters.keys()].join(", ") || "(none)";
|
|
3933
|
+
throw new RegistryError(`Unknown language: ${language}. Available: ${available}`, `Register an emitter for "${language}" via registerEmitter() or check your oagen.config.ts plugin configuration.`);
|
|
3934
|
+
}
|
|
3917
3935
|
return emitter;
|
|
3918
3936
|
}
|
|
3919
3937
|
//#endregion
|
|
@@ -3941,10 +3959,13 @@ function buildDirectionIndex(...specs) {
|
|
|
3941
3959
|
for (const param of [
|
|
3942
3960
|
...op.pathParams,
|
|
3943
3961
|
...op.queryParams,
|
|
3962
|
+
...op.bodyOwnedQueryParams ?? [],
|
|
3944
3963
|
...op.headerParams,
|
|
3945
3964
|
...op.cookieParams ?? []
|
|
3946
3965
|
]) requestSeeds.push(param.type);
|
|
3947
3966
|
responseSeeds.push(op.response);
|
|
3967
|
+
for (const field of op.pagination?.envelopeFields ?? []) responseSeeds.push(field.type);
|
|
3968
|
+
for (const header of collectResponseHeaders(op)) responseSeeds.push(header.type);
|
|
3948
3969
|
for (const success of op.successResponses ?? []) responseSeeds.push(success.type);
|
|
3949
3970
|
for (const error of op.errors) if (error.type) responseSeeds.push(error.type);
|
|
3950
3971
|
}
|
|
@@ -3992,12 +4013,7 @@ function reachableModels(seeds, models) {
|
|
|
3992
4013
|
case "map":
|
|
3993
4014
|
queue.push(ref.valueType);
|
|
3994
4015
|
break;
|
|
3995
|
-
case "union":
|
|
3996
|
-
queue.push(...ref.variants);
|
|
3997
|
-
break;
|
|
3998
|
-
case "primitive":
|
|
3999
|
-
case "enum":
|
|
4000
|
-
case "literal": break;
|
|
4016
|
+
case "union": queue.push(...ref.variants);
|
|
4001
4017
|
}
|
|
4002
4018
|
}
|
|
4003
4019
|
return found;
|
|
@@ -4126,16 +4142,18 @@ function diffFields(oldModel, newModel, direction = "unknown") {
|
|
|
4126
4142
|
for (const [name, newField] of newByName) {
|
|
4127
4143
|
const oldField = oldByName.get(name);
|
|
4128
4144
|
if (!oldField) continue;
|
|
4129
|
-
if (!typeRefsEqual(oldField.type, newField.type))
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4145
|
+
if (!typeRefsEqual(oldField.type, newField.type)) {
|
|
4146
|
+
if (primitivesDifferOnlyByFormat(oldField.type, newField.type)) changes.push({
|
|
4147
|
+
...classifyFieldChange("field-format-changed", name),
|
|
4148
|
+
details: formatChangeDetails(oldField.type, newField.type)
|
|
4149
|
+
});
|
|
4150
|
+
else changes.push({
|
|
4151
|
+
kind: "field-type-changed",
|
|
4152
|
+
fieldName: name,
|
|
4153
|
+
classification: "breaking",
|
|
4154
|
+
details: `type changed`
|
|
4155
|
+
});
|
|
4156
|
+
}
|
|
4139
4157
|
if (oldField.required !== newField.required) changes.push(classifyFieldChange("field-required-changed", name, newField.required));
|
|
4140
4158
|
if (!!oldField.readOnly !== !!newField.readOnly || !!oldField.writeOnly !== !!newField.writeOnly) changes.push(classifyFieldChange("field-access-changed", name));
|
|
4141
4159
|
}
|
|
@@ -4280,11 +4298,13 @@ function diffParams(oldOp, newOp) {
|
|
|
4280
4298
|
for (const [name, newEntry] of newByName) {
|
|
4281
4299
|
const oldEntry = oldByName.get(name);
|
|
4282
4300
|
if (!oldEntry) continue;
|
|
4283
|
-
if (!typeRefsEqual(oldEntry.p.type, newEntry.p.type))
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4301
|
+
if (!typeRefsEqual(oldEntry.p.type, newEntry.p.type)) {
|
|
4302
|
+
if (primitivesDifferOnlyByFormat(oldEntry.p.type, newEntry.p.type)) {
|
|
4303
|
+
const change = classifyParamChange("param-format-changed", name);
|
|
4304
|
+
change.details = formatChangeDetails(oldEntry.p.type, newEntry.p.type);
|
|
4305
|
+
changes.push(change);
|
|
4306
|
+
} else changes.push(classifyParamChange("param-type-changed", name));
|
|
4307
|
+
}
|
|
4288
4308
|
if (oldEntry.p.required !== newEntry.p.required) changes.push(classifyParamChange("param-required-changed", name, newEntry.p.required));
|
|
4289
4309
|
const oldDefault = serializeDefault(oldEntry.p.default);
|
|
4290
4310
|
const newDefault = serializeDefault(newEntry.p.default);
|
|
@@ -4454,4 +4474,4 @@ function summarize(changes) {
|
|
|
4454
4474
|
//#endregion
|
|
4455
4475
|
export { findResolvedMethodCollisions as _, registerEmitter as a, integrateGeneratedFiles as c, applyFileHeaders as d, buildEmitterContext as f, deriveMethodName as g, generateFiles as h, getEmitter as i, mapFilesForTargetIntegration as l, generateAllFiles as m, buildDirectionIndex as n, generate as o, collectReferencedNames as p, directionOf as r, MANIFEST_FILENAME as s, diffSpecs as t, treeShakeFiles as u, resolveMountTarget as v, resolveOperations as y };
|
|
4456
4476
|
|
|
4457
|
-
//# sourceMappingURL=diff-
|
|
4477
|
+
//# sourceMappingURL=diff-CAsypxXV.mjs.map
|