@workos/oagen 0.29.1 → 0.29.3

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.
@@ -1,5 +1,5 @@
1
- import { $ as AdditiveChangeCategory, At as CompatSnapshot, Bt as ALL_LANGUAGE_IDS, Ct as MethodOverlay, Dt as ViolationSeverity, Et as ViolationCategory, Ft as CompatTypeRef, Ht as getDefaultPolicy, It as CompatVisibility, Lt as LanguageId, Mt as CompatStability, Nt as CompatSymbol, Ot as CompatParameter, Pt as CompatSymbolKind, Rt as ParameterSensitivity, St as LanguageHints, Tt as Violation, Ut as mergePolicy, Vt as CompatPolicyHints, _t as ApiProperty, at as CompatFailLevel, bt as DiffResult, ct as defaultSeverityForCategory, dt as ApiClass, et as BreakingChangeCategory, ft as ApiEnum, gt as ApiParam, ht as ApiMethod, it as CompatConfig, jt as CompatSourceKind, kt as CompatPassingStyle, lt as severityMeetsThreshold, mt as ApiInterface, nt as CompatChangeCategory, ot as CompatProvenance, pt as ApiField, rt as CompatChangeSeverity, st as SoftRiskChangeCategory, t as ApiSpec, tt as CompatApproval, ut as Addition, vt as ApiSurface, wt as OverlayLookup, xt as Extractor, yt as ApiTypeAlias, zt as apiSurfaceToSnapshot } from "../types-DqKSnLBP.mjs";
2
- import { a as specDerivedEnumValues, c as specDerivedMethodPaths, d as ClassifiedChange, f as classifyAddedSymbol, i as filterSurface, l as specDerivedNames, m as summarizeChanges, n as diffSnapshots, o as specDerivedFieldPaths, p as classifySymbolChanges, r as diffSurfaces, s as specDerivedHttpKeys, t as CompatDiffResult, u as ClassificationResult } from "../differ-Co0fRniL.mjs";
1
+ import { $ as AdditiveChangeCategory, At as CompatSnapshot, Bt as ALL_LANGUAGE_IDS, Ct as MethodOverlay, Dt as ViolationSeverity, Et as ViolationCategory, Ft as CompatTypeRef, Ht as getDefaultPolicy, It as CompatVisibility, Lt as LanguageId, Mt as CompatStability, Nt as CompatSymbol, Ot as CompatParameter, Pt as CompatSymbolKind, Rt as ParameterSensitivity, St as LanguageHints, Tt as Violation, Ut as mergePolicy, Vt as CompatPolicyHints, _t as ApiProperty, at as CompatFailLevel, bt as DiffResult, ct as defaultSeverityForCategory, dt as ApiClass, et as BreakingChangeCategory, ft as ApiEnum, gt as ApiParam, ht as ApiMethod, it as CompatConfig, jt as CompatSourceKind, kt as CompatPassingStyle, lt as severityMeetsThreshold, mt as ApiInterface, nt as CompatChangeCategory, ot as CompatProvenance, pt as ApiField, rt as CompatChangeSeverity, st as SoftRiskChangeCategory, t as ApiSpec, tt as CompatApproval, ut as Addition, vt as ApiSurface, wt as OverlayLookup, xt as Extractor, yt as ApiTypeAlias, zt as apiSurfaceToSnapshot } from "../types-yrBidOg3.mjs";
2
+ import { a as specDerivedEnumValues, c as specDerivedMethodPaths, d as ClassifiedChange, f as classifyAddedSymbol, i as filterSurface, l as specDerivedNames, m as summarizeChanges, n as diffSnapshots, o as specDerivedFieldPaths, p as classifySymbolChanges, r as diffSurfaces, s as specDerivedHttpKeys, t as CompatDiffResult, u as ClassificationResult } from "../differ-DHldxZMr.mjs";
3
3
 
4
4
  //#region src/compat/schema.d.ts
5
5
  /** Current schema version for compatibility snapshots. */
@@ -1,5 +1,5 @@
1
1
  import { t as safeParse$1, v as ExtractorError } from "../tree-sitter-C6HB4OrC.mjs";
2
- import { A as getDefaultPolicy, C as defaultSeverityForCategory, D as isCompatibleSchemaVersion, E as COMPAT_SCHEMA_VERSION, O as validateSnapshot, S as summarizeChanges, T as apiSurfaceToSnapshot, _ as nodeHints, a as registerExtractor, b as classifyAddedSymbol, c as filterSurface, d as specDerivedHttpKeys, f as specDerivedMethodPaths, g as namedTypeWordsOverlap, h as defaultIsNullableOnlyDifference, i as getExtractor, j as mergePolicy, k as ALL_LANGUAGE_IDS, l as specDerivedEnumValues, m as NAMED_TYPE_RE, n as isPatchableChange, o as diffSnapshots, p as specDerivedNames, r as patchOverlay, s as diffSurfaces, t as buildOverlayLookup, u as specDerivedFieldPaths, v as resolveHints, w as severityMeetsThreshold, x as classifySymbolChanges, y as typeExistsInSurface } from "../overlay-jsSkFJ2g.mjs";
2
+ import { A as getDefaultPolicy, C as defaultSeverityForCategory, D as isCompatibleSchemaVersion, E as COMPAT_SCHEMA_VERSION, O as validateSnapshot, S as summarizeChanges, T as apiSurfaceToSnapshot, _ as nodeHints, a as registerExtractor, b as classifyAddedSymbol, c as filterSurface, d as specDerivedHttpKeys, f as specDerivedMethodPaths, g as namedTypeWordsOverlap, h as defaultIsNullableOnlyDifference, i as getExtractor, j as mergePolicy, k as ALL_LANGUAGE_IDS, l as specDerivedEnumValues, m as NAMED_TYPE_RE, n as isPatchableChange, o as diffSnapshots, p as specDerivedNames, r as patchOverlay, s as diffSurfaces, t as buildOverlayLookup, u as specDerivedFieldPaths, v as resolveHints, w as severityMeetsThreshold, x as classifySymbolChanges, y as typeExistsInSurface } from "../overlay-CihWp6dQ.mjs";
3
3
  import path, { basename, dirname, join, relative, resolve } from "node:path";
4
4
  import Parser from "tree-sitter";
5
5
  import ts from "typescript";
@@ -1,4 +1,4 @@
1
- import { At as CompatSnapshot, Nt as CompatSymbol, St as LanguageHints, Vt as CompatPolicyHints, bt as DiffResult, nt as CompatChangeCategory, ot as CompatProvenance, rt as CompatChangeSeverity, t as ApiSpec, vt as ApiSurface } from "./types-DqKSnLBP.mjs";
1
+ import { At as CompatSnapshot, Lt as LanguageId, Nt as CompatSymbol, St as LanguageHints, Vt as CompatPolicyHints, bt as DiffResult, nt as CompatChangeCategory, ot as CompatProvenance, rt as CompatChangeSeverity, t as ApiSpec, vt as ApiSurface } from "./types-yrBidOg3.mjs";
2
2
 
3
3
  //#region src/compat/classify.d.ts
4
4
  /** A single classified compatibility change. */
@@ -40,7 +40,7 @@ interface ClassificationResult {
40
40
  * Classify changes between a baseline and candidate symbol.
41
41
  * Returns one or more classified changes for the diff.
42
42
  */
43
- declare function classifySymbolChanges(baseline: CompatSymbol, candidate: CompatSymbol | undefined, policy: CompatPolicyHints): ClassifiedChange[];
43
+ declare function classifySymbolChanges(baseline: CompatSymbol, candidate: CompatSymbol | undefined, policy: CompatPolicyHints, language?: LanguageId): ClassifiedChange[];
44
44
  /**
45
45
  * Classify a new symbol as additive.
46
46
  */
@@ -120,4 +120,4 @@ declare function diffSnapshots(baseline: CompatSnapshot, candidate: CompatSnapsh
120
120
  declare function diffSurfaces(baseline: ApiSurface, candidate: ApiSurface, hints: LanguageHints): DiffResult;
121
121
  //#endregion
122
122
  export { specDerivedEnumValues as a, specDerivedMethodPaths as c, ClassifiedChange as d, classifyAddedSymbol as f, filterSurface as i, specDerivedNames as l, summarizeChanges as m, diffSnapshots as n, specDerivedFieldPaths as o, classifySymbolChanges as p, diffSurfaces as r, specDerivedHttpKeys as s, CompatDiffResult as t, ClassificationResult as u };
123
- //# sourceMappingURL=differ-Co0fRniL.d.mts.map
123
+ //# sourceMappingURL=differ-DHldxZMr.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"differ-DHldxZMr.d.mts","names":[],"sources":["../src/compat/classify.ts","../src/compat/spec-filter.ts","../src/compat/differ.ts"],"mappings":";;;;UAaiB,gBAAA;EAcJ;EAZX,QAAA,EAAU,oBAAA;EAAV;EAEA,QAAA,EAAU,oBAAA;EAAV;EAEA,MAAA;EAAA;EAEA,kBAAA;EAEA;EAAA,UAAA,EAAY,gBAAA;EAEZ;EAAA,GAAA,EAAK,MAAA;EAEL;EAAA,GAAA,EAAK,MAAA;EAEL;EAAA,OAAA;EAOW;;AAIb;;;;EAJE,WAAA;AAAA;;UAIe,oBAAA;EACf,OAAA,EAAS,gBAAA;EACT,OAAA;IACE,QAAA;IACA,QAAA;IACA,QAAA;EAAA;AAAA;;;;;iBAmMY,qBAAA,CACd,QAAA,EAAU,YAAA,EACV,SAAA,EAAW,YAAA,cACX,MAAA,EAAQ,iBAAA,EACR,QAAA,GAAW,UAAA,GACV,gBAAA;;;;iBA6Xa,mBAAA,CAAoB,MAAA,EAAQ,YAAA,GAAe,gBAAA;;iBAc3C,gBAAA,CAAiB,OAAA,EAAS,gBAAA,KAAqB,oBAAA;;;;AAnnB/D;;;;iBCJgB,gBAAA,CAAiB,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,aAAA,GAAgB,GAAA;;;;;iBA0CvD,qBAAA,CAAsB,IAAA,EAAM,OAAA,GAAU,GAAA,SAAY,GAAA;;;;;;iBAalD,qBAAA,CAAsB,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,aAAA,GAAgB,GAAA;;;;;;iBAqB5D,sBAAA,CAAuB,IAAA,EAAM,OAAA,GAAU,GAAA;;;;;iBAcvC,mBAAA,CAAoB,IAAA,EAAM,OAAA,GAAU,GAAA;;;;;;;;;;;;AD6IpD;;;;iBCzFgB,aAAA,CACd,OAAA,EAAS,UAAA,EACT,YAAA,EAAc,GAAA,UACd,IAAA;EACE,UAAA,GAAa,GAAA;EACb,WAAA,GAAc,GAAA;EACd,UAAA,GAAa,GAAA,SAAY,GAAA;AAAA,IAE1B,UAAA;;;;UChIc,gBAAA;EACf,OAAA,EAAS,gBAAA;EACT,OAAA,EAAS,oBAAA;AAAA;;;;;iBAOK,aAAA,CACd,QAAA,EAAU,cAAA,EACV,SAAA,EAAW,cAAA,EACX,MAAA,GAAS,iBAAA,GACR,gBAAA;;;;;;AFJH;;;iBEsqBgB,YAAA,CAAa,QAAA,EAAU,UAAA,EAAY,SAAA,EAAW,UAAA,EAAY,KAAA,EAAO,aAAA,GAAgB,UAAA"}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as collectEnumRefs, B as ErrorPolicy, C as Service, D as UnionType, E as TypeRef, F as validateModelHints, G as RequestGuardPolicy, H as LogEvent, I as walkTypeRef, J as TelemetryPolicy, K as RetryPolicy, L as AiAgentEnvVar, M as collectModelRefs, N as collectRequestBodyModels, O as assertNever, P as mapTypeRef, Q as mergeSdkBehavior, R as BackoffStrategy, S as ServerEntry, T as TypeParam, U as LoggingPolicy, V as IdempotencyPolicy, W as PaginationPolicy, X as UserAgentPolicy, Y as TimeoutPolicy, Z as defaultSdkBehavior, _ as Parameter, a as EnumRef, b as PrimitiveType, c as Field, d as MapType, f as Model, g as PaginationMeta, h as Operation, i as Enum, it as CompatConfig, j as collectFieldDependencies, k as assignModelsToServices, l as HttpMethod, m as NullableType, n as ArrayType, o as EnumValue, p as ModelRef, q as SdkBehavior, r as AuthScheme, s as ErrorResponse, t as ApiSpec, u as LiteralType, v as ParameterGroup, vt as ApiSurface, w as SuccessResponse, wt as OverlayLookup, x as SecurityRequirement, xt as Extractor, y as ParameterGroupVariant, z as DeepPartial } from "./types-DqKSnLBP.mjs";
1
+ import { A as collectEnumRefs, B as ErrorPolicy, C as Service, D as UnionType, E as TypeRef, F as validateModelHints, G as RequestGuardPolicy, H as LogEvent, I as walkTypeRef, J as TelemetryPolicy, K as RetryPolicy, L as AiAgentEnvVar, M as collectModelRefs, N as collectRequestBodyModels, O as assertNever, P as mapTypeRef, Q as mergeSdkBehavior, R as BackoffStrategy, S as ServerEntry, T as TypeParam, U as LoggingPolicy, V as IdempotencyPolicy, W as PaginationPolicy, X as UserAgentPolicy, Y as TimeoutPolicy, Z as defaultSdkBehavior, _ as Parameter, a as EnumRef, b as PrimitiveType, c as Field, d as MapType, f as Model, g as PaginationMeta, h as Operation, i as Enum, it as CompatConfig, j as collectFieldDependencies, k as assignModelsToServices, l as HttpMethod, m as NullableType, n as ArrayType, o as EnumValue, p as ModelRef, q as SdkBehavior, r as AuthScheme, s as ErrorResponse, t as ApiSpec, u as LiteralType, v as ParameterGroup, vt as ApiSurface, w as SuccessResponse, wt as OverlayLookup, x as SecurityRequirement, xt as Extractor, y as ParameterGroupVariant, z as DeepPartial } from "./types-yrBidOg3.mjs";
2
2
 
3
3
  //#region src/ir/operation-hints.d.ts
4
4
  /** Per-operation override keyed by "METHOD /path" (e.g. "POST /auth/token"). */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/ir/operation-hints.ts","../src/errors.ts","../src/engine/types.ts","../src/differ/types.ts","../src/parser/parse.ts","../src/engine/orchestrator.ts","../src/engine/generate-files.ts","../src/engine/writer.ts","../src/engine/integrate.ts","../src/engine/registry.ts","../src/differ/diff.ts","../src/differ/direction.ts","../src/utils/naming.ts","../src/engine/operation-plan.ts","../src/utils/escape.ts","../src/cli/config-loader.ts","../src/snippets/example-builder.ts","../src/snippets/types.ts","../src/snippets/runner.ts","../src/snippets/shared.ts"],"mappings":";;;;UAeiB,aAAA;EAAA;EAEf,IAAA;;EAEA,OAAA;EAFA;EAIA,KAAA,GAAQ,SAAA;EAAR;EAEA,QAAA,GAAW,MAAA;EAAX;EAEA,eAAA;EAAA;;;;AAUF;;EAHE,UAAA;AAAA;AAAA,UAGe,SAAA;EAIf;EAFA,IAAA;EAIW;EAFX,aAAA;EAMA;EAJA,QAAA,GAAW,MAAA;EAUG;EARd,eAAA;EAee;EAbf,aAAA;;;;;;EAMA,cAAA;AAAA;AAAA,UAOe,iBAAA;EAEJ;EAAX,SAAA,EAAW,SAAA;EAEF;EAAT,OAAA,EAAS,OAAA;EAIT;EAFA,UAAA;EAIW;EAFX,OAAA;EAIU;EAFV,QAAA,GAAW,eAAA;EAMX;EAJA,QAAA,EAAU,MAAA;EAIA;EAFV,eAAA;EAK8B;EAH9B,UAAA;AAAA;AAAA,UAGe,eAAA;EAIf;EAFA,IAAA;EAIU;EAFV,aAAA;EAMA;EAJA,QAAA,EAAU,MAAA;EAQV;EANA,eAAA;EAMiB;EAJjB,aAAA;EAgF8B;EA9E9B,cAAA;EA8E+D;EA5E/D,iBAAA;AAAA;;;;;AAoKF;;;;;;;iBAxFgB,gBAAA,CAAiB,EAAA,EAAI,SAAA,EAAW,QAAA,EAAU,OAAA;;AAkH1D;;;;;;;;;;;;;;;;iBA1BgB,kBAAA,CAAmB,IAAA,UAAc,MAAA,EAAQ,MAAA;;;;;;;ACvPzD;;;iBDiRgB,iBAAA,CACd,IAAA,EAAM,OAAA,EACN,KAAA,GAAQ,M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gB,GAAA;AAAA;AAAA,iBAGF,kBAAA,CACd,QAAA,EAAU,iBAAA,EACV,GAAA,EAAK,cAAA,EACL,QAAA,EAAU,cAAA,GACT,aAAA;;;;;;;iBAqEa,kBAAA,CACd,OAAA,EAAS,eAAA,EACT,GAAA,EAAK,cAAA,EACL,QAAA,EAAU,cAAA,GACT,UAAA;AAAA,iBA4Ca,cAAA,CAAe,QAAA,EAAU,iBAAA,GAAoB,GAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/ir/operation-hints.ts","../src/errors.ts","../src/engine/types.ts","../src/differ/types.ts","../src/parser/parse.ts","../src/engine/orchestrator.ts","../src/engine/generate-files.ts","../src/engine/writer.ts","../src/engine/integrate.ts","../src/engine/registry.ts","../src/differ/diff.ts","../src/differ/direction.ts","../src/utils/naming.ts","../src/engine/operation-plan.ts","../src/utils/escape.ts","../src/cli/config-loader.ts","../src/snippets/example-builder.ts","../src/snippets/types.ts","../src/snippets/runner.ts","../src/snippets/shared.ts"],"mappings":";;;;UAeiB,aAAA;EAAA;EAEf,IAAA;;EAEA,OAAA;EAFA;EAIA,KAAA,GAAQ,SAAA;EAAR;EAEA,QAAA,GAAW,MAAA;EAAX;EAEA,eAAA;EAAA;;;;AAUF;;EAHE,UAAA;AAAA;AAAA,UAGe,SAAA;EAIf;EAFA,IAAA;EAIW;EAFX,aAAA;EAMA;EAJA,QAAA,GAAW,MAAA;EAUG;EARd,eAAA;EAee;EAbf,aAAA;;;;;;EAMA,cAAA;AAAA;AAAA,UAOe,iBAAA;EAEJ;EAAX,SAAA,EAAW,SAAA;EAEF;EAAT,OAAA,EAAS,OAAA;EAIT;EAFA,UAAA;EAIW;EAFX,OAAA;EAIU;EAFV,QAAA,GAAW,eAAA;EAMX;EAJA,QAAA,EAAU,MAAA;EAIA;EAFV,eAAA;EAK8B;EAH9B,UAAA;AAAA;AAAA,UAGe,eAAA;EAIf;EAFA,IAAA;EAIU;EAFV,aAAA;EAMA;EAJA,QAAA,EA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GAAiB,aAAA;;;AlBkBrF;;;;;;;iBkBgBgB,qBAAA,CAAsB,OAAA,EAAS,aAAA,IAAiB,SAAA,YAAyB,aAAA;;;;;;;;;;;;;UClCxE,UAAA;EnBeL;EmBbV,MAAA;EnBgBe;EmBdf,QAAA;;EAEA,KAAA;EnBcA;EmBZA,SAAA,EAAW,SAAA;EnBgBX;EmBdA,KAAA,EAAO,KAAA;AAAA;;;;;AnB+BT;;;;;;UmBlBiB,aAAA;EACf,IAAA,EAAM,UAAA;EnB6BU;EmB3BhB,cAAA,EAAgB,GAAA;AAAA;AAAA,iBAGF,kBAAA,CACd,QAAA,EAAU,iBAAA,EACV,GAAA,EAAK,cAAA,EACL,QAAA,EAAU,cAAA,GACT,aAAA;;;;;;;iBAqEa,kBAAA,CACd,OAAA,EAAS,eAAA,EACT,GAAA,EAAK,cAAA,EACL,QAAA,EAAU,cAAA,GACT,UAAA;AAAA,iBA4Ca,cAAA,CAAe,QAAA,EAAU,iBAAA,GAAoB,GAAA"}
package/dist/index.mjs CHANGED
@@ -1743,6 +1743,30 @@ function extractInlineModel(name, schema) {
1743
1743
  }
1744
1744
  //#endregion
1745
1745
  //#region src/parser/operations.ts
1746
+ /**
1747
+ * Resolve a raw parameter entry to a concrete Parameter Object, following
1748
+ * `$ref`s into `components/parameters` when present. Follows chains of refs
1749
+ * (a component that itself is a `$ref` to another component), with a cycle
1750
+ * guard for a spec that refs itself.
1751
+ *
1752
+ * Throws when a `$ref` can't be resolved so a malformed spec fails loudly at
1753
+ * parse time instead of silently losing the parameter (see `extractParams`,
1754
+ * which used to drop any entry with no `in` field — every `$ref` object has
1755
+ * none).
1756
+ */
1757
+ function resolveParameterRef(raw, componentParameters, operationContext) {
1758
+ const seenRefs = /* @__PURE__ */ new Set();
1759
+ let current = raw;
1760
+ while ("$ref" in current) {
1761
+ if (seenRefs.has(current.$ref)) throw new Error(`Circular parameter $ref chain starting at "${current.$ref}" in ${operationContext}.`);
1762
+ seenRefs.add(current.$ref);
1763
+ const refName = /^#\/components\/parameters\/(.+)$/.exec(current.$ref)?.[1].replace(/~1/g, "/").replace(/~0/g, "~");
1764
+ const resolved = refName ? componentParameters?.[refName] : void 0;
1765
+ if (!resolved) throw new Error(`Unresolved parameter $ref "${current.$ref}" in ${operationContext}: no matching entry under components/parameters.`);
1766
+ current = resolved;
1767
+ }
1768
+ return current;
1769
+ }
1746
1770
  const HTTP_METHODS = [
1747
1771
  "get",
1748
1772
  "post",
@@ -1753,7 +1777,7 @@ const HTTP_METHODS = [
1753
1777
  "options",
1754
1778
  "trace"
1755
1779
  ];
1756
- function extractOperations(paths, operationIdTransform, componentSchemas) {
1780
+ function extractOperations(paths, operationIdTransform, componentSchemas, componentParameters) {
1757
1781
  if (!paths) return {
1758
1782
  services: [],
1759
1783
  inlineModels: []
@@ -1766,7 +1790,7 @@ function extractOperations(paths, operationIdTransform, componentSchemas) {
1766
1790
  const op = pathItem[method];
1767
1791
  if (!op) continue;
1768
1792
  const serviceName = inferServiceName(path, op.tags?.[0]);
1769
- const { operation, inlineModels: opModels } = buildOperation(method, path, op, pathLevelParams, operationIdTransform, serviceName, componentSchemas);
1793
+ const { operation, inlineModels: opModels } = buildOperation(method, path, op, pathLevelParams, operationIdTransform, serviceName, componentSchemas, componentParameters);
1770
1794
  inlineModels.push(...opModels);
1771
1795
  const ops = serviceMap.get(serviceName) ?? [];
1772
1796
  ops.push(operation);
@@ -1964,19 +1988,11 @@ function extractParameterGroups(op, allIRParams, operationContext) {
1964
1988
  * the request body. Emitters use the group's presence to generate sum-type
1965
1989
  * interfaces and custom JSON marshalling instead of flat optional fields.
1966
1990
  */
1967
- function extractBodyParameterGroups(op, operationContext) {
1991
+ function extractBodyParameterGroups(op, operationContext, componentSchemas) {
1968
1992
  const raw = op["x-mutually-exclusive-body-groups"];
1969
1993
  if (!raw || typeof raw !== "object") return void 0;
1970
1994
  const bodySchema = op.requestBody?.content?.["application/json"]?.schema;
1971
- const variantFieldSchemas = /* @__PURE__ */ new Map();
1972
- if (bodySchema) {
1973
- for (const sub of bodySchema.allOf ?? []) for (const variant of sub.oneOf ?? []) if (variant.properties) {
1974
- for (const [name, fieldSchema] of Object.entries(variant.properties)) if (fieldSchema) variantFieldSchemas.set(name, fieldSchema);
1975
- }
1976
- for (const variant of bodySchema.oneOf ?? []) if (variant.properties) {
1977
- for (const [name, fieldSchema] of Object.entries(variant.properties)) if (fieldSchema) variantFieldSchemas.set(name, fieldSchema);
1978
- }
1979
- }
1995
+ const variantFieldSchemas = collectVariantFieldSchemas(bodySchema, componentSchemas);
1980
1996
  const groups = [];
1981
1997
  for (const [groupName, groupDef] of Object.entries(raw)) {
1982
1998
  if (!groupDef || typeof groupDef !== "object") continue;
@@ -1986,10 +2002,12 @@ function extractBodyParameterGroups(op, operationContext) {
1986
2002
  const variants = Object.entries(groupDef.variants).map(([variantName, paramNames]) => {
1987
2003
  if (!Array.isArray(paramNames) || paramNames.length === 0) throw new Error(`Malformed x-mutually-exclusive-body-groups.${groupName}.variants.${variantName} in ${operationContext}: expected a non-empty array of parameter names.`);
1988
2004
  const parameters = paramNames.map((pName) => {
1989
- const fieldSchema = variantFieldSchemas.get(pName);
2005
+ const entry = variantFieldSchemas.get(pName);
2006
+ const fieldSchema = entry?.schema;
2007
+ if (!fieldSchema) console.warn(`[oagen] Warning: x-mutually-exclusive-body-groups.${groupName}.variants.${variantName} references "${pName}" in ${operationContext}, but no oneOf branch of the request body declares that property. Falling back to type: string.`);
1990
2008
  return {
1991
2009
  name: pName,
1992
- type: fieldSchema ? schemaToTypeRef(fieldSchema, toPascalCase(pName)) : {
2010
+ type: fieldSchema ? schemaToTypeRef(fieldSchema, toPascalCase(pName), entry?.owner) : {
1993
2011
  kind: "primitive",
1994
2012
  type: "string"
1995
2013
  },
@@ -2013,8 +2031,14 @@ function extractBodyParameterGroups(op, operationContext) {
2013
2031
  }
2014
2032
  return groups.length > 0 ? groups : void 0;
2015
2033
  }
2016
- function buildOperation(method, path, op, pathLevelParams, operationIdTransform, serviceName, componentSchemas) {
2017
- const allParams = [...pathLevelParams, ...op.parameters ?? []];
2034
+ function buildOperation(method, path, op, pathLevelParams, operationIdTransform, serviceName, componentSchemas, componentParameters) {
2035
+ const opLabel = op.operationId ?? `${method.toUpperCase()} ${path}`;
2036
+ const paramsByIdentity = /* @__PURE__ */ new Map();
2037
+ for (const raw of [...pathLevelParams, ...op.parameters ?? []]) {
2038
+ const param = resolveParameterRef(raw, componentParameters, opLabel);
2039
+ paramsByIdentity.set(`${param.in}:${param.name}`, param);
2040
+ }
2041
+ const allParams = [...paramsByIdentity.values()];
2018
2042
  const hasIdempotencyHeader = allParams.some((p) => p.in === "header" && p.name.toLowerCase() === "idempotency-key");
2019
2043
  const opContext = serviceName;
2020
2044
  const pathParams = extractParams(allParams, "path", opContext, componentSchemas);
@@ -2038,15 +2062,13 @@ function buildOperation(method, path, op, pathLevelParams, operationIdTransform,
2038
2062
  };
2039
2063
  } else if (paginationFromParams) pagination = paginationFromParams;
2040
2064
  const security = extractOperationSecurity(op.security);
2041
- const allIRParams = [
2065
+ const queryParamGroups = extractParameterGroups(op, [
2042
2066
  ...pathParams,
2043
2067
  ...queryParams,
2044
2068
  ...headerParams,
2045
2069
  ...cookieParams
2046
- ];
2047
- const opLabel = op.operationId ?? `${method.toUpperCase()} ${path}`;
2048
- const queryParamGroups = extractParameterGroups(op, allIRParams, opLabel);
2049
- const bodyParamGroups = extractBodyParameterGroups(op, opLabel);
2070
+ ], opLabel);
2071
+ const bodyParamGroups = extractBodyParameterGroups(op, opLabel, componentSchemas);
2050
2072
  const parameterGroups = queryParamGroups || bodyParamGroups ? [...queryParamGroups ?? [], ...bodyParamGroups ?? []] : void 0;
2051
2073
  return {
2052
2074
  operation: {
@@ -2129,6 +2151,55 @@ function resolveParamSchemaRef(schema, componentSchemas) {
2129
2151
  if (!match) return void 0;
2130
2152
  return componentSchemas[match[1]];
2131
2153
  }
2154
+ /**
2155
+ * Collect the property schemas of every `oneOf` branch reachable from a request
2156
+ * body schema, keyed by property name. These are the candidate members of a
2157
+ * mutually-exclusive body group.
2158
+ *
2159
+ * The bundler runs with `dereference: false`, so the body schema is very often
2160
+ * a bare `{ $ref: '#/components/schemas/XDto' }` and the `allOf`/`oneOf`
2161
+ * composition that actually declares the variant properties lives on the
2162
+ * component. Walking without resolving refs finds nothing, and every group
2163
+ * member then falls back to `string` — an SDK that compiles but types
2164
+ * object-valued members (e.g. a connection's `saml_options`) as plain strings.
2165
+ *
2166
+ * Composition keywords nest and may themselves be refs, so resolve and recurse
2167
+ * at each level. `seen` guards against a schema that (directly or transitively)
2168
+ * refs itself.
2169
+ */
2170
+ function collectVariantFieldSchemas(schema, componentSchemas, owner = void 0, out = /* @__PURE__ */ new Map(), seen = /* @__PURE__ */ new Set()) {
2171
+ if (!schema) return out;
2172
+ const ref = schema.$ref;
2173
+ if (ref) {
2174
+ if (seen.has(ref)) return out;
2175
+ seen.add(ref);
2176
+ const match = /^#\/components\/schemas\/(.+)$/.exec(ref);
2177
+ return collectVariantFieldSchemas(match && componentSchemas ? componentSchemas[match[1]] : void 0, componentSchemas, match ? resolveSchemaName(match[1]) : owner, out, seen);
2178
+ }
2179
+ for (const variant of schema.oneOf ?? []) {
2180
+ const variantRef = variant.$ref;
2181
+ const refMatch = variantRef ? /^#\/components\/schemas\/(.+)$/.exec(variantRef) : null;
2182
+ const resolved = resolveSchemaRefObject(variant, componentSchemas) ?? variant;
2183
+ const variantOwner = refMatch ? resolveSchemaName(refMatch[1]) : owner;
2184
+ for (const [name, fieldSchema] of Object.entries(resolved.properties ?? {})) if (fieldSchema) out.set(name, {
2185
+ schema: fieldSchema,
2186
+ owner: variantOwner
2187
+ });
2188
+ collectVariantFieldSchemas(variant, componentSchemas, owner, out, seen);
2189
+ }
2190
+ for (const sub of schema.allOf ?? []) collectVariantFieldSchemas(sub, componentSchemas, owner, out, seen);
2191
+ for (const sub of schema.anyOf ?? []) collectVariantFieldSchemas(sub, componentSchemas, owner, out, seen);
2192
+ return out;
2193
+ }
2194
+ /** Resolve `{ $ref: '#/components/schemas/X' }` to its component, else undefined. */
2195
+ function resolveSchemaRefObject(schema, componentSchemas) {
2196
+ if (!schema || !componentSchemas) return void 0;
2197
+ const ref = schema.$ref;
2198
+ if (!ref) return void 0;
2199
+ const match = /^#\/components\/schemas\/(.+)$/.exec(ref);
2200
+ if (!match) return void 0;
2201
+ return componentSchemas[match[1]];
2202
+ }
2132
2203
  function extractRequestBody(body, op, inlineModels) {
2133
2204
  if (!body?.content) return {};
2134
2205
  let encoding = "json";
@@ -2541,6 +2612,262 @@ function collectInlineEnumsFromOperations(services, enums) {
2541
2612
  ]) collectInlineEnumFromRef(param.type, enums, enumNames);
2542
2613
  }
2543
2614
  //#endregion
2615
+ //#region src/parser/parameter-group-names.ts
2616
+ /**
2617
+ * Assign `ParameterGroup.wrapperName` across the whole spec.
2618
+ *
2619
+ * Emitters derive a group's generated wrapper type name from the group name
2620
+ * alone, so two operations sharing a group name (create and update both
2621
+ * declare `protocol_options`) collapse onto a single type. That is only sound
2622
+ * while the two declarations carry the same members. Where they differ, one
2623
+ * operation ends up typed with the other's member — e.g. a connection update
2624
+ * forced to pass `CreateConnectionSAMLOptions`, which accepts three fields the
2625
+ * PATCH endpoint rejects.
2626
+ *
2627
+ * This pass fingerprints every group's members structurally and qualifies the
2628
+ * wrapper name with the operation name only for groups that genuinely diverge.
2629
+ * Groups whose declarations agree keep the bare group name, so wrapper types
2630
+ * already published in the SDKs are never renamed.
2631
+ */
2632
+ function assignParameterGroupWrapperNames(spec) {
2633
+ const modelMap = new Map(spec.models.map((m) => [m.name, m]));
2634
+ const enumMap = new Map(spec.enums.map((e) => [e.name, e]));
2635
+ const fingerprints = /* @__PURE__ */ new Map();
2636
+ const occurrences = [];
2637
+ for (const service of spec.services) for (const op of service.operations) for (const group of op.parameterGroups ?? []) {
2638
+ const fp = fingerprintGroup(group, modelMap, enumMap);
2639
+ let seen = fingerprints.get(group.name);
2640
+ if (!seen) {
2641
+ seen = /* @__PURE__ */ new Set();
2642
+ fingerprints.set(group.name, seen);
2643
+ }
2644
+ seen.add(fp);
2645
+ occurrences.push({
2646
+ service,
2647
+ op,
2648
+ group,
2649
+ fingerprint: fp
2650
+ });
2651
+ }
2652
+ for (const { op, group } of occurrences) group.wrapperName = (fingerprints.get(group.name)?.size ?? 0) > 1 ? `${op.name}_${group.name}` : group.name;
2653
+ qualifyResidualCollisions(occurrences);
2654
+ reconcileSharedGroups(occurrences.map((o) => o.group));
2655
+ }
2656
+ /**
2657
+ * Break the collisions the operation-qualified name can still leave behind.
2658
+ *
2659
+ * `${op.name}_${group.name}` is not a unique key, for two separate reasons:
2660
+ *
2661
+ * - `disambiguateOperationNames` makes operation names unique only *within* a
2662
+ * service, so two services that each own an operation named `create`, both
2663
+ * declaring a `password` group with different members, both land on
2664
+ * `create_password`.
2665
+ * - Within one service it deliberately leaves same-name operations alone when
2666
+ * they share a path (see the `uniquePaths.size <= 1` guard — "same path,
2667
+ * different methods"), so `PUT` and `PATCH` on one path both stay `update`
2668
+ * and a service prefix alone still produces one name for both.
2669
+ *
2670
+ * Either way `reconcileSharedGroups` would then fuse two incompatible
2671
+ * declarations into a single type — the exact failure this pass exists to
2672
+ * prevent — and it does not drop the surplus member, so the wrapper would
2673
+ * expose a field one of the operations rejects.
2674
+ *
2675
+ * So escalate in rounds, adding a qualifier at a time and re-testing what still
2676
+ * collides. `(service, path, method)` identifies an operation uniquely, and a
2677
+ * same-name collision within a service implies a shared path, so service then
2678
+ * method is sufficient to separate every case.
2679
+ *
2680
+ * Each round only touches names that *still* group differing fingerprints, so a
2681
+ * name whose sharers agree is never renamed: sharing one wrapper is exactly what
2682
+ * should happen there, and renaming it would move a type the SDKs already
2683
+ * publish. On a spec where no qualified name collides — the WorkOS spec today —
2684
+ * the whole pass is a no-op.
2685
+ */
2686
+ function qualifyResidualCollisions(occurrences) {
2687
+ const qualifiers = [(o) => o.service.name, (o) => o.op.httpMethod];
2688
+ for (const qualify of qualifiers) for (const sharers of collidingCandidates(occurrences)) {
2689
+ const movable = sharers.filter((o) => o.group.wrapperName !== o.group.name);
2690
+ for (const o of movable) o.group.wrapperName = `${qualify(o)}_${o.group.wrapperName ?? o.group.name}`;
2691
+ }
2692
+ separateRemainingByStructure(occurrences);
2693
+ }
2694
+ /**
2695
+ * Terminal round: separate whatever the operation attributes could not.
2696
+ *
2697
+ * No combination of operation attributes is unique by construction. Two
2698
+ * operations in one service can share a name, a method *and* differ only by
2699
+ * path — `normalizeOperationIdForNaming` strips the `[N]` suffix, so a NestJS
2700
+ * controller method bound to several routes derives one name for all of them.
2701
+ * The WorkOS spec already contains such a pair (`Authorization`'s
2702
+ * `listRoleAssignments` on two paths); it declares no parameter groups today,
2703
+ * so nothing is wrong in the SDKs, but the shape is present rather than
2704
+ * hypothetical. Adding `path` as a fourth qualifier would only move the
2705
+ * boundary again.
2706
+ *
2707
+ * So stop enumerating attributes and separate by the thing that actually
2708
+ * matters: a name still fusing distinct structures gets one wrapper per
2709
+ * distinct fingerprint. That makes "same `wrapperName` implies same structure"
2710
+ * hold unconditionally, which is the invariant every emitter relies on.
2711
+ *
2712
+ * Suffixes are keyed on the fingerprint, not on a per-occurrence counter, so
2713
+ * declarations that agree keep sharing a wrapper.
2714
+ *
2715
+ * Ordering is by first appearance, not by sorted fingerprint: the structure
2716
+ * declared first keeps the unsuffixed name. Sorting by fingerprint would be
2717
+ * equally deterministic but less stable in the way that matters — adding a
2718
+ * member to one operation changes its fingerprint and could swap which of two
2719
+ * published wrappers holds the bare name. Under first-appearance order only
2720
+ * reordering the operations themselves can shift a name, which is both rarer
2721
+ * and visible in the spec diff.
2722
+ *
2723
+ * Either way this is a no-op wherever an earlier round already sufficed —
2724
+ * including the WorkOS spec, which never reaches this round at all.
2725
+ */
2726
+ function separateRemainingByStructure(occurrences) {
2727
+ const taken = new Set(occurrences.map((o) => o.group.wrapperName ?? o.group.name));
2728
+ for (const sharers of collidingCandidates(occurrences)) {
2729
+ const base = sharers[0].group.wrapperName ?? sharers[0].group.name;
2730
+ const nameFor = /* @__PURE__ */ new Map();
2731
+ let n = 2;
2732
+ for (const o of sharers) {
2733
+ if (nameFor.has(o.fingerprint)) continue;
2734
+ if (nameFor.size === 0) {
2735
+ nameFor.set(o.fingerprint, base);
2736
+ continue;
2737
+ }
2738
+ while (taken.has(`${base}_${n}`)) n++;
2739
+ const name = `${base}_${n}`;
2740
+ taken.add(name);
2741
+ nameFor.set(o.fingerprint, name);
2742
+ n++;
2743
+ }
2744
+ for (const o of sharers) o.group.wrapperName = nameFor.get(o.fingerprint);
2745
+ }
2746
+ }
2747
+ /**
2748
+ * Candidate wrapper names shared by declarations that do not agree — the only
2749
+ * ones an escalation round may rename.
2750
+ */
2751
+ function collidingCandidates(occurrences) {
2752
+ const byCandidate = /* @__PURE__ */ new Map();
2753
+ for (const o of occurrences) {
2754
+ const key = o.group.wrapperName ?? o.group.name;
2755
+ const list = byCandidate.get(key);
2756
+ if (list) list.push(o);
2757
+ else byCandidate.set(key, [o]);
2758
+ }
2759
+ return [...byCandidate.values()].filter((sharers) => sharers.length > 1 && new Set(sharers.map((o) => o.fingerprint)).size > 1);
2760
+ }
2761
+ /**
2762
+ * Make every group that shares a `wrapperName` describe literally the same
2763
+ * type.
2764
+ *
2765
+ * Deciding two declarations may share one wrapper is only half the job. The
2766
+ * fingerprint deliberately ignores nullability and member order, so sharers can
2767
+ * still disagree on both — and each emitter renders the wrapper from whichever
2768
+ * operation it happens to reach first while rendering call sites from their own
2769
+ * operation. Kotlin showed the consequence: `ParentResource.ById.id` emitted as
2770
+ * `String` from one operation, while the Java-friendly overload built from
2771
+ * another passed a `String?` into it, and the SDK stopped compiling.
2772
+ *
2773
+ * So normalize the two axes the fingerprint waived:
2774
+ * - a member the sharers disagree on settles as non-nullable. Widening to
2775
+ * nullable instead reads as the friendlier choice, but the nullable form
2776
+ * doesn't survive every emitter's group paths (Kotlin's query dispatch
2777
+ * builds a `Pair<String, String>` from the member, which a `String?` can't
2778
+ * satisfy), and non-nullable is what all sharers carried before group
2779
+ * member types were resolved at all — so it changes no published surface.
2780
+ * A member every sharer agrees is nullable stays nullable.
2781
+ *
2782
+ * The cost: an operation whose spec really does accept null for a member
2783
+ * (`PATCH` on a resource may clear `parent_resource_id`) can't express that
2784
+ * through the shared wrapper. It never could — the member used to be a flat
2785
+ * `string` everywhere — so nothing regresses, but the limitation is real and
2786
+ * removing it means letting that group's wrapper split per operation.
2787
+ * - member order follows the first sharer, so positional constructors and
2788
+ * their call sites agree.
2789
+ */
2790
+ function reconcileSharedGroups(groups) {
2791
+ const byWrapper = /* @__PURE__ */ new Map();
2792
+ for (const group of groups) {
2793
+ const key = group.wrapperName ?? group.name;
2794
+ const list = byWrapper.get(key);
2795
+ if (list) list.push(group);
2796
+ else byWrapper.set(key, [group]);
2797
+ }
2798
+ for (const sharers of byWrapper.values()) {
2799
+ if (sharers.length < 2) continue;
2800
+ for (const variant of sharers[0].variants) {
2801
+ const peers = sharers.slice(1).map((g) => g.variants.find((v) => v.name === variant.name)).filter((v) => v !== void 0);
2802
+ if (peers.length === 0) continue;
2803
+ for (const member of variant.parameters) {
2804
+ const all = [member, ...peers.map((p) => p.parameters.find((q) => q.name === member.name)).filter(isParameter)];
2805
+ if (all.every((p) => p.type.kind === "nullable")) continue;
2806
+ for (const p of all) if (p.type.kind === "nullable") p.type = p.type.inner;
2807
+ }
2808
+ const canonical = variant.parameters.map((p) => p.name);
2809
+ for (const peer of peers) peer.parameters.sort((a, b) => {
2810
+ const ia = canonical.indexOf(a.name);
2811
+ const ib = canonical.indexOf(b.name);
2812
+ if (ia === -1 && ib === -1) return 0;
2813
+ if (ia === -1) return 1;
2814
+ if (ib === -1) return -1;
2815
+ return ia - ib;
2816
+ });
2817
+ }
2818
+ }
2819
+ }
2820
+ function isParameter(p) {
2821
+ return p !== void 0;
2822
+ }
2823
+ /**
2824
+ * Structural fingerprint of a group: its variants, their members, and each
2825
+ * member's resolved shape. Two declarations with the same fingerprint can
2826
+ * safely share one generated wrapper type.
2827
+ */
2828
+ function fingerprintGroup(group, modelMap, enumMap) {
2829
+ return group.variants.map((v) => {
2830
+ const members = [...v.parameters].sort((a, b) => a.name.localeCompare(b.name)).map((p) => `${p.name}:${fingerprintType(p.type, modelMap, enumMap, /* @__PURE__ */ new Set())}`);
2831
+ const optional = [...v.optionalParameters ?? []].sort();
2832
+ return `${v.name}(${members.join(",")})[${optional.join(",")}]`;
2833
+ }).join("|");
2834
+ }
2835
+ /**
2836
+ * Fingerprint a type by shape rather than by name.
2837
+ *
2838
+ * Names cannot be compared directly because the parser synthesizes a separate
2839
+ * name per declaration site for inline schemas: `create_user` and `update_user`
2840
+ * each get their own `PasswordHashType` enum, spelled `CreateUserPasswordHashType`
2841
+ * and `UpdateUserPasswordHashType`, though their values are identical. Comparing
2842
+ * names would report divergence and rename a wrapper for no reason.
2843
+ *
2844
+ * Nullability is also stripped: an update declaring a member nullable while
2845
+ * create declares it plain is not a reason to split the wrapper type.
2846
+ */
2847
+ function fingerprintType(ref, modelMap, enumMap, visiting) {
2848
+ switch (ref.kind) {
2849
+ case "nullable": return fingerprintType(ref.inner, modelMap, enumMap, visiting);
2850
+ case "primitive": return `p:${ref.type}`;
2851
+ case "literal": return `l:${typeof ref.value}:${String(ref.value)}`;
2852
+ case "array": return `a<${fingerprintType(ref.items, modelMap, enumMap, visiting)}>`;
2853
+ case "map": return `m<${fingerprintType(ref.valueType, modelMap, enumMap, visiting)}>`;
2854
+ case "union": return `u<${ref.variants.map((v) => fingerprintType(v, modelMap, enumMap, visiting)).sort().join(",")}>`;
2855
+ case "enum": {
2856
+ const e = enumMap.get(ref.name);
2857
+ if (!e) return `e:${ref.name}`;
2858
+ return `e<${e.values.map((v) => `${typeof v.value}:${String(v.value)}`).sort().join(",")}>`;
2859
+ }
2860
+ case "model": {
2861
+ const m = modelMap.get(ref.name);
2862
+ if (!m) return `M:${ref.name}`;
2863
+ if (visiting.has(ref.name)) return `M:${ref.name}`;
2864
+ const next = new Set(visiting).add(ref.name);
2865
+ return `M<${[...m.fields].sort((a, b) => a.name.localeCompare(b.name)).map((f) => `${f.name}${f.required ? "!" : "?"}:${fingerprintType(f.type, modelMap, enumMap, next)}`).join(",")}>`;
2866
+ }
2867
+ default: return "unknown";
2868
+ }
2869
+ }
2870
+ //#endregion
2544
2871
  //#region src/parser/normalize-model-refs.ts
2545
2872
  function validateModelRefs(spec) {
2546
2873
  const knownNames = /* @__PURE__ */ new Set();
@@ -2570,7 +2897,7 @@ async function parseSpec(specPath, options) {
2570
2897
  const version = spec.openapi ?? "";
2571
2898
  if (!version.startsWith("3.")) throw new SpecParseError(`Unsupported OpenAPI version: ${version}. oagen requires OpenAPI 3.x`, `Update the spec to OpenAPI 3.0 or 3.1. If you are using Swagger 2.x, convert it first with \`npx swagger2openapi ${specPath}\`.`);
2572
2899
  const { models, enums } = extractSchemas(spec.components?.schemas, { schemaNameTransform: options?.schemaNameTransform });
2573
- const { services, inlineModels } = extractOperations(spec.paths, options?.operationIdTransform, spec.components?.schemas);
2900
+ const { services, inlineModels } = extractOperations(spec.paths, options?.operationIdTransform, spec.components?.schemas, spec.components?.parameters);
2574
2901
  const responseNormalizedModels = mergeInlineResponseModels(models, inlineModels);
2575
2902
  const fieldInlineModels = extractInlineModelsFromSchemas(spec.components?.schemas);
2576
2903
  clearSchemaNameTransform();
@@ -2595,6 +2922,7 @@ async function parseSpec(specPath, options) {
2595
2922
  auth,
2596
2923
  sdk: defaultSdkBehavior()
2597
2924
  };
2925
+ assignParameterGroupWrapperNames(result);
2598
2926
  validateModelRefs(result);
2599
2927
  return result;
2600
2928
  }