@workos/oagen 0.24.2 → 0.24.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.
@@ -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
  }
@@ -4153,4 +4158,4 @@ function summarize(changes) {
4153
4158
  //#endregion
4154
4159
  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
4160
 
4156
- //# sourceMappingURL=diff-IXR1sWSP.mjs.map
4161
+ //# sourceMappingURL=diff-B5B0ie7S.mjs.map