@workos/oagen 0.24.2 → 0.24.4

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 BreakingChangeCategory, At as CompatSourceKind, Bt as CompatPolicyHints, Ct as OverlayLookup, Dt as CompatParameter, Et as ViolationSeverity, Ft as CompatVisibility, Ht as mergePolicy, It as LanguageId, Lt as ParameterSensitivity, Mt as CompatSymbol, Nt as CompatSymbolKind, Ot as CompatPassingStyle, Pt as CompatTypeRef, Q as AdditiveChangeCategory, Rt as apiSurfaceToSnapshot, St as MethodOverlay, Tt as ViolationCategory, Vt as getDefaultPolicy, _t as ApiSurface, at as CompatProvenance, bt as Extractor, ct as severityMeetsThreshold, dt as ApiEnum, et as CompatApproval, ft as ApiField, gt as ApiProperty, ht as ApiParam, it as CompatFailLevel, jt as CompatStability, kt as CompatSnapshot, lt as Addition, mt as ApiMethod, nt as CompatChangeSeverity, ot as SoftRiskChangeCategory, pt as ApiInterface, rt as CompatConfig, st as defaultSeverityForCategory, t as ApiSpec, tt as CompatChangeCategory, ut as ApiClass, vt as ApiTypeAlias, wt as Violation, xt as LanguageHints, yt as DiffResult, zt as ALL_LANGUAGE_IDS } from "../types-nM5Kp7UP.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-DMmw0tbA.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-owWZiSwD.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-HVvbbyUV.mjs";
3
3
 
4
4
  //#region src/compat/schema.d.ts
5
5
  /** Current schema version for compatibility snapshots. */
@@ -1,5 +1,5 @@
1
- import { t as safeParse$1, v as ExtractorError } from "../tree-sitter-DcUvm0KA.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-sQHQoN0I.mjs";
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-DcvsIx5P.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 { A as walkTypeRef, C as assertNever, f as toSnakeCase, i as normalizeJsExtension, t as safeParse, x as RegistryError } from "./tree-sitter-DcUvm0KA.mjs";
1
+ import { A as validateModelHints, C as assertNever, f as toSnakeCase, i as normalizeJsExtension, j as walkTypeRef, t as safeParse, x as RegistryError } from "./tree-sitter-C6HB4OrC.mjs";
2
2
  import * as fs from "node:fs/promises";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
@@ -3012,13 +3012,18 @@ function buildEmitterContext(spec, options) {
3012
3012
  let scopedModelNames;
3013
3013
  let scopedEnumNames;
3014
3014
  if (options.scopedServices && options.scopedServices.size > 0) {
3015
- const scope = options.scopedServices;
3016
- const present = options.presentServiceKeys ?? /* @__PURE__ */ new Set();
3017
- const postMountOf = (service) => resolvedOperations.find((r) => r.service.name === service.name)?.mountOn ?? service.name;
3018
- const reachable = collectReferencedNames(spec.services.filter((s) => {
3019
- const postMount = postMountOf(s);
3020
- return scope.has(postMount) || present.has(canonicalServiceKey(postMount));
3021
- }), spec.models, { preserveAllDiscriminated: false });
3015
+ const selected = options.scopedServices;
3016
+ const selectedOpsByService = /* @__PURE__ */ new Map();
3017
+ for (const r of resolvedOperations) {
3018
+ if (!selected.has(r.mountOn)) continue;
3019
+ const ops = selectedOpsByService.get(r.service.name) ?? [];
3020
+ ops.push(r.operation);
3021
+ selectedOpsByService.set(r.service.name, ops);
3022
+ }
3023
+ const reachable = collectReferencedNames(spec.services.filter((s) => selectedOpsByService.has(s.name)).map((s) => ({
3024
+ ...s,
3025
+ operations: selectedOpsByService.get(s.name)
3026
+ })), spec.models, { preserveAllDiscriminated: false });
3022
3027
  scopedModelNames = reachable.models;
3023
3028
  scopedEnumNames = reachable.enums;
3024
3029
  }
@@ -3595,6 +3600,7 @@ async function removeEmptyParents(startDir, stopDir) {
3595
3600
  //#endregion
3596
3601
  //#region src/engine/orchestrator.ts
3597
3602
  async function generate(spec, emitter, options) {
3603
+ if (options.modelHints) validateModelHints(spec.models, spec.services, options.modelHints);
3598
3604
  const scopedServices = options.services && options.services.length > 0 ? resolveScopedServices(spec, options.services, options.mountRules) : void 0;
3599
3605
  const scoped = scopedServices !== void 0;
3600
3606
  const noPrune = options.noPrune === true || scoped;
@@ -4153,4 +4159,4 @@ function summarize(changes) {
4153
4159
  //#endregion
4154
4160
  export { MANIFEST_FILENAME as a, treeShakeFiles as c, collectReferencedNames as d, generateAllFiles as f, resolveOperations as h, generate as i, applyFileHeaders as l, deriveMethodName as m, getEmitter as n, integrateGeneratedFiles as o, generateFiles as p, registerEmitter as r, mapFilesForTargetIntegration as s, diffSpecs as t, buildEmitterContext as u };
4155
4161
 
4156
- //# sourceMappingURL=diff-IXR1sWSP.mjs.map
4162
+ //# sourceMappingURL=diff-DPnw1wPB.mjs.map