@workos/oagen-emitters 0.5.0 → 0.6.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,3 +1,3 @@
1
1
  {
2
- ".": "0.5.0"
2
+ ".": "0.6.1"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.1](https://github.com/workos/oagen-emitters/compare/v0.6.0...v0.6.1) (2026-04-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **php:** exclude grouped body params from signature, PHPDoc, and body array ([#46](https://github.com/workos/oagen-emitters/issues/46)) ([7772c8a](https://github.com/workos/oagen-emitters/commit/7772c8a9c167155009fb81f48af67680287db93e))
9
+
10
+ ## [0.6.0](https://github.com/workos/oagen-emitters/compare/v0.5.0...v0.6.0) (2026-04-24)
11
+
12
+
13
+ ### Features
14
+
15
+ * extract plugin bundle and move manifest ownership to framework ([#44](https://github.com/workos/oagen-emitters/issues/44)) ([6a8c3a9](https://github.com/workos/oagen-emitters/commit/6a8c3a9897bf9952e83b7143037a97b0c5ecc508))
16
+
3
17
  ## [0.5.0](https://github.com/workos/oagen-emitters/compare/v0.4.0...v0.5.0) (2026-04-24)
4
18
 
5
19
 
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as nodeEmitter, a as rustExtractor, c as pythonExtractor, d as rubyEmitter, f as kotlinEmitter, g as pythonEmitter, h as phpEmitter, i as kotlinExtractor, l as rubyExtractor, m as goEmitter, n as elixirExtractor, o as goExtractor, p as dotnetEmitter, r as dotnetExtractor, s as phpExtractor, t as workosEmittersPlugin, u as nodeExtractor } from "./plugin-BSop9f9z.mjs";
1
+ import { _ as nodeEmitter, a as rustExtractor, c as pythonExtractor, d as rubyEmitter, f as kotlinEmitter, g as pythonEmitter, h as phpEmitter, i as kotlinExtractor, l as rubyExtractor, m as goEmitter, n as elixirExtractor, o as goExtractor, p as dotnetEmitter, r as dotnetExtractor, s as phpExtractor, t as workosEmittersPlugin, u as nodeExtractor } from "./plugin-CZc7Teko.mjs";
2
2
  export { dotnetEmitter, dotnetExtractor, elixirExtractor, goEmitter, goExtractor, kotlinEmitter, kotlinExtractor, nodeEmitter, nodeExtractor, phpEmitter, phpExtractor, pythonEmitter, pythonExtractor, rubyEmitter, rubyExtractor, rustExtractor, workosEmittersPlugin };
@@ -6603,7 +6603,7 @@ function generateSerializerTests(spec, ctx) {
6603
6603
  }
6604
6604
  //#endregion
6605
6605
  //#region src/node/manifest.ts
6606
- function generateManifest$6(spec, ctx) {
6606
+ function buildOperationsMap$6(spec, ctx) {
6607
6607
  const manifest = {};
6608
6608
  for (const service of spec.services) {
6609
6609
  const propName = servicePropertyName$4(resolveResourceClassName$3(service, ctx));
@@ -6615,12 +6615,7 @@ function generateManifest$6(spec, ctx) {
6615
6615
  };
6616
6616
  }
6617
6617
  }
6618
- return [{
6619
- path: "smoke-manifest.json",
6620
- content: JSON.stringify(manifest, null, 2),
6621
- integrateTarget: false,
6622
- overwriteExisting: true
6623
- }];
6618
+ return manifest;
6624
6619
  }
6625
6620
  //#endregion
6626
6621
  //#region src/node/index.ts
@@ -6652,8 +6647,8 @@ const nodeEmitter = {
6652
6647
  generateTests(spec, ctx) {
6653
6648
  return ensureTrailingNewlines$6(generateTests$6(spec, ctx));
6654
6649
  },
6655
- generateManifest(spec, ctx) {
6656
- return ensureTrailingNewlines$6(generateManifest$6(spec, ctx));
6650
+ buildOperationsMap(spec, ctx) {
6651
+ return buildOperationsMap$6(spec, ctx);
6657
6652
  },
6658
6653
  fileHeader() {
6659
6654
  return "// This file is auto-generated by oagen. Do not edit.";
@@ -10254,9 +10249,9 @@ function generateModelRoundTripTests(spec, ctx) {
10254
10249
  //#endregion
10255
10250
  //#region src/python/manifest.ts
10256
10251
  /**
10257
- * Generate smoke test manifest mapping HTTP operations to SDK methods.
10252
+ * Build operation-to-SDK-method mapping for the manifest.
10258
10253
  */
10259
- function generateManifest$5(spec, ctx) {
10254
+ function buildOperationsMap$5(spec, ctx) {
10260
10255
  const manifest = {};
10261
10256
  const accessPaths = buildServiceAccessPaths$3(spec.services, ctx);
10262
10257
  for (const service of spec.services) {
@@ -10274,12 +10269,7 @@ function generateManifest$5(spec, ctx) {
10274
10269
  };
10275
10270
  }
10276
10271
  }
10277
- return [{
10278
- path: "smoke-manifest.json",
10279
- content: JSON.stringify(manifest, null, 2),
10280
- integrateTarget: false,
10281
- overwriteExisting: true
10282
- }];
10272
+ return manifest;
10283
10273
  }
10284
10274
  //#endregion
10285
10275
  //#region src/python/index.ts
@@ -10337,8 +10327,8 @@ const pythonEmitter = {
10337
10327
  spec: testSpec
10338
10328
  }));
10339
10329
  },
10340
- generateManifest(spec, ctx) {
10341
- return ensureTrailingNewlines$5(generateManifest$5(spec, ctx));
10330
+ buildOperationsMap(spec, ctx) {
10331
+ return buildOperationsMap$5(spec, ctx);
10342
10332
  },
10343
10333
  fileHeader() {
10344
10334
  return "# This file is auto-generated by oagen. Do not edit.";
@@ -11003,12 +10993,14 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
11003
10993
  if (p.default != null) desc += ` Defaults to ${JSON.stringify(p.default)}.`;
11004
10994
  docParts.push(`@param ${docType} $${phpName}${desc}`);
11005
10995
  }
10996
+ const groupedParamNames = collectGroupedParamNames(op);
11006
10997
  if (plan.hasBody && op.requestBody?.kind === "model") {
11007
10998
  const bodyModel = modelMap.get(op.requestBody.name);
11008
10999
  if (bodyModel) {
11009
11000
  const bodyParamMap = buildBodyParamMap(op, bodyModel);
11010
11001
  for (const field of bodyModel.fields) {
11011
11002
  if (hiddenParams.has(field.name)) continue;
11003
+ if (groupedParamNames.has(field.name)) continue;
11012
11004
  const docType = mapTypeRefForPHPDoc(field.type);
11013
11005
  const phpName = bodyParamMap.get(field.name) ?? fieldName$3(field.name);
11014
11006
  if (seenDocParams.has(phpName)) continue;
@@ -11020,7 +11012,6 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
11020
11012
  }
11021
11013
  }
11022
11014
  }
11023
- const groupedParamNames = collectGroupedParamNames(op);
11024
11015
  for (const group of op.parameterGroups ?? []) {
11025
11016
  const phpName = fieldName$3(group.name);
11026
11017
  if (seenDocParams.has(phpName)) continue;
@@ -11118,7 +11109,8 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
11118
11109
  if (plan.hasBody) {
11119
11110
  const bodyModel = op.requestBody?.kind === "model" ? modelMap.get(op.requestBody.name) : null;
11120
11111
  const bodyParamMap = buildBodyParamMap(op, bodyModel ?? null);
11121
- const visibleFields = bodyModel?.fields.filter((f) => !hiddenParams.has(f.name)) ?? [];
11112
+ const deleteGroupedParams = collectGroupedParamNames(op);
11113
+ const visibleFields = bodyModel?.fields.filter((f) => !hiddenParams.has(f.name) && !deleteGroupedParams.has(f.name)) ?? [];
11122
11114
  const hasOptionalFields = visibleFields.some((f) => !f.required);
11123
11115
  if (hasOptionalFields) lines.push(" $body = array_filter([");
11124
11116
  else lines.push(" $body = [");
@@ -11150,7 +11142,8 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
11150
11142
  } else if (plan.hasBody) {
11151
11143
  const bodyModel = op.requestBody?.kind === "model" ? modelMap.get(op.requestBody.name) : null;
11152
11144
  const bodyParamMap = buildBodyParamMap(op, bodyModel ?? null);
11153
- const visibleFields = bodyModel?.fields.filter((f) => !hiddenParams.has(f.name)) ?? [];
11145
+ const bodyGroupedParams = collectGroupedParamNames(op);
11146
+ const visibleFields = bodyModel?.fields.filter((f) => !hiddenParams.has(f.name) && !bodyGroupedParams.has(f.name)) ?? [];
11154
11147
  const hasOptionalFields = visibleFields.some((f) => !f.required);
11155
11148
  if (hasOptionalFields) lines.push(" $body = array_filter([");
11156
11149
  else lines.push(" $body = [");
@@ -11226,6 +11219,7 @@ function buildMethodParams(op, plan, modelMap, ctx, hiddenParams) {
11226
11219
  const bodyModel = modelMap.get(op.requestBody.name);
11227
11220
  if (bodyModel) for (const field of bodyModel.fields) {
11228
11221
  if (hidden.has(field.name)) continue;
11222
+ if (groupedParams.has(field.name)) continue;
11229
11223
  const phpType = mapTypeRef$4(field.type, { qualified: true });
11230
11224
  let phpName = fieldName$3(field.name);
11231
11225
  if (usedNames.has(phpName)) {
@@ -12020,9 +12014,9 @@ function emitBodyAssertions(lines, op, ctx, hidden) {
12020
12014
  //#endregion
12021
12015
  //#region src/php/manifest.ts
12022
12016
  /**
12023
- * Generate smoke test manifest mapping HTTP operations to SDK methods.
12017
+ * Build operation-to-SDK-method mapping for the manifest.
12024
12018
  */
12025
- function generateManifest$4(spec, ctx) {
12019
+ function buildOperationsMap$4(spec, ctx) {
12026
12020
  const manifest = {};
12027
12021
  const accessPaths = buildServiceAccessPaths$2(spec.services, ctx);
12028
12022
  for (const service of spec.services) {
@@ -12040,11 +12034,7 @@ function generateManifest$4(spec, ctx) {
12040
12034
  };
12041
12035
  }
12042
12036
  }
12043
- return [{
12044
- path: "smoke-manifest.json",
12045
- content: JSON.stringify(manifest, null, 2),
12046
- integrateTarget: false
12047
- }];
12037
+ return manifest;
12048
12038
  }
12049
12039
  //#endregion
12050
12040
  //#region src/php/index.ts
@@ -12085,9 +12075,9 @@ const phpEmitter = {
12085
12075
  ensureNamingInitialized(ctx);
12086
12076
  return ensureTrailingNewlines$4(generateTests$4(spec, ctx));
12087
12077
  },
12088
- generateManifest(spec, ctx) {
12078
+ buildOperationsMap(spec, ctx) {
12089
12079
  ensureNamingInitialized(ctx);
12090
- return ensureTrailingNewlines$4(generateManifest$4(spec, ctx));
12080
+ return buildOperationsMap$4(spec, ctx);
12091
12081
  },
12092
12082
  fileHeader() {
12093
12083
  return "<?php\n\ndeclare(strict_types=1);\n\n// This file is auto-generated by oagen. Do not edit.";
@@ -14464,9 +14454,9 @@ function generateModelFixtureValues(model) {
14464
14454
  //#endregion
14465
14455
  //#region src/go/manifest.ts
14466
14456
  /**
14467
- * Generate smoke test manifest mapping HTTP operations to SDK methods.
14457
+ * Build operation-to-SDK-method mapping for the manifest.
14468
14458
  */
14469
- function generateManifest$3(spec, ctx) {
14459
+ function buildOperationsMap$3(spec, ctx) {
14470
14460
  const manifest = {};
14471
14461
  const accessPaths = buildServiceAccessPaths$1(spec.services, ctx);
14472
14462
  for (const service of spec.services) {
@@ -14484,11 +14474,7 @@ function generateManifest$3(spec, ctx) {
14484
14474
  };
14485
14475
  }
14486
14476
  }
14487
- return [{
14488
- path: "smoke-manifest.json",
14489
- content: JSON.stringify(manifest, null, 2),
14490
- integrateTarget: false
14491
- }];
14477
+ return manifest;
14492
14478
  }
14493
14479
  //#endregion
14494
14480
  //#region src/go/index.ts
@@ -14500,7 +14486,18 @@ function ensureTrailingNewlines$3(files) {
14500
14486
  const goEmitter = {
14501
14487
  language: "go",
14502
14488
  generateModels(models, ctx) {
14503
- return ensureTrailingNewlines$3(generateModels$3(enrichModelsFromSpec(models), ctx));
14489
+ const enriched = enrichModelsFromSpec(models);
14490
+ const originalByName = new Map(models.map((m) => [m.name, m]));
14491
+ return ensureTrailingNewlines$3(generateModels$3(enriched.map((m) => {
14492
+ if (m.discriminator && m.fields.length === 0) {
14493
+ const original = originalByName.get(m.name);
14494
+ if (original && original.fields.length > 0) return {
14495
+ ...m,
14496
+ fields: original.fields
14497
+ };
14498
+ }
14499
+ return m;
14500
+ }), ctx));
14504
14501
  },
14505
14502
  generateEnums(enums, ctx) {
14506
14503
  const syntheticEnums = getSyntheticEnums();
@@ -14521,8 +14518,8 @@ const goEmitter = {
14521
14518
  generateTests(spec, ctx) {
14522
14519
  return ensureTrailingNewlines$3(generateTests$3(spec, ctx));
14523
14520
  },
14524
- generateManifest(spec, ctx) {
14525
- return ensureTrailingNewlines$3(generateManifest$3(spec, ctx));
14521
+ buildOperationsMap(spec, ctx) {
14522
+ return buildOperationsMap$3(spec, ctx);
14526
14523
  },
14527
14524
  fileHeader() {
14528
14525
  return "// Code generated by oagen. DO NOT EDIT.";
@@ -16740,9 +16737,9 @@ function csStringLiteral(s) {
16740
16737
  //#endregion
16741
16738
  //#region src/dotnet/manifest.ts
16742
16739
  /**
16743
- * Generate smoke test manifest mapping HTTP operations to SDK methods.
16740
+ * Build operation-to-SDK-method mapping for the manifest.
16744
16741
  */
16745
- function generateManifest$2(spec, ctx) {
16742
+ function buildOperationsMap$2(spec, ctx) {
16746
16743
  const manifest = {};
16747
16744
  const accessPaths = buildServiceAccessPaths(spec.services, ctx);
16748
16745
  for (const service of spec.services) {
@@ -16760,11 +16757,7 @@ function generateManifest$2(spec, ctx) {
16760
16757
  };
16761
16758
  }
16762
16759
  }
16763
- return [{
16764
- path: "smoke-manifest.json",
16765
- content: JSON.stringify(manifest, null, 2),
16766
- integrateTarget: false
16767
- }];
16760
+ return manifest;
16768
16761
  }
16769
16762
  //#endregion
16770
16763
  //#region src/dotnet/index.ts
@@ -16906,8 +16899,8 @@ const dotnetEmitter = {
16906
16899
  primeModelAliases(enrichModelsFromSpec(c.spec.models));
16907
16900
  return prefixTestPaths(ensureTrailingNewlines$2(generateTests$2(spec, c)));
16908
16901
  },
16909
- generateManifest(spec, ctx) {
16910
- return ensureTrailingNewlines$2(generateManifest$2(spec, fixNamespace(ctx)));
16902
+ buildOperationsMap(spec, ctx) {
16903
+ return buildOperationsMap$2(spec, fixNamespace(ctx));
16911
16904
  },
16912
16905
  fileHeader() {
16913
16906
  return "// This file is auto-generated by oagen. Do not edit.";
@@ -19319,14 +19312,15 @@ function findService(ctx, op) {
19319
19312
  //#endregion
19320
19313
  //#region src/kotlin/manifest.ts
19321
19314
  /**
19322
- * Generate the smoke-test manifest mapping `"HTTP_METHOD /path"` to
19323
- * `{ sdkMethod, service }`. The `service` is the camelCase accessor property
19324
- * on the main `WorkOS` client (e.g., `organizations`).
19315
+ * Build the operation-to-SDK-method mapping for the manifest.
19316
+ *
19317
+ * The `service` is the camelCase accessor property on the main `WorkOS`
19318
+ * client (e.g., `organizations`).
19325
19319
  *
19326
19320
  * For polymorphic/split operations (e.g., authenticate -> 8 methods), the
19327
- * manifest emits one entry per wrapper method so each variant is addressable.
19321
+ * manifest emits an array of methods so each variant is addressable.
19328
19322
  */
19329
- function generateManifest$1(spec, ctx) {
19323
+ function buildOperationsMap$1(spec, ctx) {
19330
19324
  const manifest = {};
19331
19325
  const resolvedLookup = buildResolvedLookup(ctx);
19332
19326
  for (const service of spec.services) {
@@ -19348,11 +19342,7 @@ function generateManifest$1(spec, ctx) {
19348
19342
  };
19349
19343
  }
19350
19344
  }
19351
- return [{
19352
- path: "smoke-manifest.json",
19353
- content: JSON.stringify(manifest, null, 2),
19354
- integrateTarget: false
19355
- }];
19345
+ return manifest;
19356
19346
  }
19357
19347
  //#endregion
19358
19348
  //#region src/kotlin/index.ts
@@ -19393,8 +19383,8 @@ const kotlinEmitter = {
19393
19383
  spec: enrichedSpec
19394
19384
  }));
19395
19385
  },
19396
- generateManifest(spec, ctx) {
19397
- return ensureTrailingNewlines$1(generateManifest$1(spec, ctx));
19386
+ buildOperationsMap(spec, ctx) {
19387
+ return buildOperationsMap$1(spec, ctx);
19398
19388
  },
19399
19389
  fileHeader() {
19400
19390
  return "// This file is auto-generated by oagen. Do not edit.";
@@ -21121,13 +21111,13 @@ function stubUrlRegex(escaped) {
21121
21111
  //#endregion
21122
21112
  //#region src/ruby/manifest.ts
21123
21113
  /**
21124
- * Generate smoke test manifest mapping HTTP operations to SDK methods.
21114
+ * Build operation-to-SDK-method mapping for the manifest.
21125
21115
  *
21126
21116
  * Uses each resolved operation's actual mountOn (not the service default) so
21127
21117
  * operations remounted via operationHints land on the correct service prop.
21128
21118
  * Split operations emit one entry per wrapper (keyed by wrapper name + variant).
21129
21119
  */
21130
- function generateManifest(spec, ctx) {
21120
+ function buildOperationsMap(spec, ctx) {
21131
21121
  const manifest = {};
21132
21122
  for (const r of ctx.resolvedOperations ?? []) {
21133
21123
  const op = r.operation;
@@ -21142,12 +21132,7 @@ function generateManifest(spec, ctx) {
21142
21132
  service: propName
21143
21133
  };
21144
21134
  }
21145
- return [{
21146
- path: "smoke-manifest.json",
21147
- content: JSON.stringify(manifest, null, 2),
21148
- integrateTarget: false,
21149
- overwriteExisting: true
21150
- }];
21135
+ return manifest;
21151
21136
  }
21152
21137
  //#endregion
21153
21138
  //#region src/ruby/rbi.ts
@@ -21410,8 +21395,8 @@ const rubyEmitter = {
21410
21395
  generateTests(spec, ctx) {
21411
21396
  return ensureTrailingNewlines(generateTests(spec, ctx));
21412
21397
  },
21413
- generateManifest(spec, ctx) {
21414
- return ensureTrailingNewlines(generateManifest(spec, ctx));
21398
+ buildOperationsMap(spec, ctx) {
21399
+ return buildOperationsMap(spec, ctx);
21415
21400
  },
21416
21401
  fileHeader() {
21417
21402
  return `# frozen_string_literal: true\n\n# This file is auto-generated by oagen. Do not edit.`;
@@ -21468,4 +21453,4 @@ const workosEmittersPlugin = {
21468
21453
  //#endregion
21469
21454
  export { nodeEmitter as _, rustExtractor as a, pythonExtractor as c, rubyEmitter as d, kotlinEmitter as f, pythonEmitter as g, phpEmitter as h, kotlinExtractor as i, rubyExtractor as l, goEmitter as m, elixirExtractor as n, goExtractor as o, dotnetEmitter as p, dotnetExtractor as r, phpExtractor as s, workosEmittersPlugin as t, nodeExtractor as u };
21470
21455
 
21471
- //# sourceMappingURL=plugin-BSop9f9z.mjs.map
21456
+ //# sourceMappingURL=plugin-CZc7Teko.mjs.map