@workos/oagen-emitters 0.15.1 → 0.15.2

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/dist/plugin.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as workosEmittersPlugin } from "./plugin-C2Hp2Vs2.mjs";
1
+ import { t as workosEmittersPlugin } from "./plugin-Xkr83G9A.mjs";
2
2
  export { workosEmittersPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workos/oagen-emitters",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "WorkOS' oagen emitters",
5
5
  "license": "MIT",
6
6
  "author": "WorkOS",
@@ -1673,10 +1673,13 @@ function renderOptionsObjectMethod(
1673
1673
  (itemRawName ? resolveInterfaceName(itemRawName, ctx) : responseModel);
1674
1674
  if (!itemType) return false;
1675
1675
  const wireType = wireInterfaceName(itemType);
1676
- const returnType =
1677
- preferredBaselineReturnType(ctx, baselineMethod?.returnType) ?? `Promise<AutoPaginatable<${itemType}>>`;
1678
1676
  const extraParams = op.queryParams.filter((p) => !PAGINATION_PARAM_NAMES.has(p.name));
1679
1677
  const needsWireSerializer = extraParams.some((p) => fieldName(p.name) !== wireFieldName(p.name));
1678
+ const paginationType = needsWireSerializer ? 'PaginationOptions' : optionParam.type;
1679
+ const returnType = needsWireSerializer
1680
+ ? `Promise<AutoPaginatable<${itemType}, ${paginationType}>>`
1681
+ : (preferredBaselineReturnType(ctx, baselineMethod?.returnType) ??
1682
+ `Promise<AutoPaginatable<${itemType}, ${paginationType}>>`);
1680
1683
  const listOptionsExpr = needsWireSerializer
1681
1684
  ? `options ? serialize${optionParam.type}(options) : undefined`
1682
1685
  : 'paginationOptions';
@@ -1887,7 +1890,8 @@ function renderPaginatedMethod(
1887
1890
  const wireType = wireInterfaceName(itemType);
1888
1891
  const serializeCall = serializerArg ? `options ? serialize${optionsType}(options) : undefined` : 'options';
1889
1892
 
1890
- lines.push(` async ${method}(${allParams}): Promise<AutoPaginatable<${itemType}, ${optionsType}>> {`);
1893
+ const paginationType = needsWireSerializer ? 'PaginationOptions' : optionsType;
1894
+ lines.push(` async ${method}(${allParams}): Promise<AutoPaginatable<${itemType}, ${paginationType}>> {`);
1891
1895
  lines.push(` return new AutoPaginatable(`);
1892
1896
  lines.push(` await fetchAndDeserialize<${wireType}, ${itemType}>(`);
1893
1897
  lines.push(` this.workos,`);