@workos/oagen 0.29.4 → 0.30.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.
@@ -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-CihWp6dQ.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-BhXruu32.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";
@@ -177,6 +177,43 @@ function resolveResponseModelName(op) {
177
177
  if (ref.kind === "nullable" && ref.inner.kind === "model") return ref.inner.name;
178
178
  return null;
179
179
  }
180
+ /**
181
+ * Find every pair of distinct paths that resolve to the same SDK method name.
182
+ *
183
+ * Emitters already refuse to generate on a collision, but they only run inside
184
+ * the per-language build matrix — so a spec addition that collides fails every
185
+ * matrix job minutes in, with no cheap way to catch it first. Surfacing the same
186
+ * check from `oagen resolve` turns that into a seconds-long precheck.
187
+ *
188
+ * Returns every collision rather than throwing on the first, so a spec that
189
+ * introduces several is fixed in one pass instead of one CI round-trip each.
190
+ *
191
+ * Callers that generate a subset of services must filter to the operations they
192
+ * will actually emit before calling this: a collision between two out-of-scope
193
+ * paths is not that run's problem.
194
+ */
195
+ function findResolvedMethodCollisions(resolved) {
196
+ const seen = /* @__PURE__ */ new Map();
197
+ const collisions = [];
198
+ for (const r of resolved) {
199
+ const key = `${r.mountOn}.${r.methodName}`;
200
+ const current = {
201
+ httpMethod: r.operation.httpMethod.toUpperCase(),
202
+ path: r.operation.path
203
+ };
204
+ const existing = seen.get(key);
205
+ if (existing && (existing.path !== current.path || existing.httpMethod !== current.httpMethod)) {
206
+ collisions.push({
207
+ key,
208
+ first: existing,
209
+ second: current
210
+ });
211
+ continue;
212
+ }
213
+ if (!existing) seen.set(key, current);
214
+ }
215
+ return collisions;
216
+ }
180
217
  //#endregion
181
218
  //#region src/engine/merge-adapters/url-fingerprint.ts
182
219
  /**
@@ -4415,6 +4452,6 @@ function summarize(changes) {
4415
4452
  };
4416
4453
  }
4417
4454
  //#endregion
4418
- export { resolveMountTarget 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, resolveOperations as v };
4455
+ 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 };
4419
4456
 
4420
- //# sourceMappingURL=diff-B6TjXIwb.mjs.map
4457
+ //# sourceMappingURL=diff-DMFiDAI6.mjs.map