@workos/oagen-emitters 0.6.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.
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +7 -0
- package/dist/index.mjs +1 -1
- package/dist/{plugin-Dws9b6T7.mjs → plugin-CZc7Teko.mjs} +20 -5
- package/dist/plugin-CZc7Teko.mjs.map +1 -0
- package/dist/plugin.mjs +1 -1
- package/package.json +1 -1
- package/src/go/index.ts +15 -1
- package/src/php/resources.ts +9 -4
- package/dist/plugin-Dws9b6T7.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
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
|
+
|
|
3
10
|
## [0.6.0](https://github.com/workos/oagen-emitters/compare/v0.5.0...v0.6.0) (2026-04-24)
|
|
4
11
|
|
|
5
12
|
|
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-
|
|
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 };
|
|
@@ -10993,12 +10993,14 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
|
|
|
10993
10993
|
if (p.default != null) desc += ` Defaults to ${JSON.stringify(p.default)}.`;
|
|
10994
10994
|
docParts.push(`@param ${docType} $${phpName}${desc}`);
|
|
10995
10995
|
}
|
|
10996
|
+
const groupedParamNames = collectGroupedParamNames(op);
|
|
10996
10997
|
if (plan.hasBody && op.requestBody?.kind === "model") {
|
|
10997
10998
|
const bodyModel = modelMap.get(op.requestBody.name);
|
|
10998
10999
|
if (bodyModel) {
|
|
10999
11000
|
const bodyParamMap = buildBodyParamMap(op, bodyModel);
|
|
11000
11001
|
for (const field of bodyModel.fields) {
|
|
11001
11002
|
if (hiddenParams.has(field.name)) continue;
|
|
11003
|
+
if (groupedParamNames.has(field.name)) continue;
|
|
11002
11004
|
const docType = mapTypeRefForPHPDoc(field.type);
|
|
11003
11005
|
const phpName = bodyParamMap.get(field.name) ?? fieldName$3(field.name);
|
|
11004
11006
|
if (seenDocParams.has(phpName)) continue;
|
|
@@ -11010,7 +11012,6 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
|
|
|
11010
11012
|
}
|
|
11011
11013
|
}
|
|
11012
11014
|
}
|
|
11013
|
-
const groupedParamNames = collectGroupedParamNames(op);
|
|
11014
11015
|
for (const group of op.parameterGroups ?? []) {
|
|
11015
11016
|
const phpName = fieldName$3(group.name);
|
|
11016
11017
|
if (seenDocParams.has(phpName)) continue;
|
|
@@ -11108,7 +11109,8 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
|
|
|
11108
11109
|
if (plan.hasBody) {
|
|
11109
11110
|
const bodyModel = op.requestBody?.kind === "model" ? modelMap.get(op.requestBody.name) : null;
|
|
11110
11111
|
const bodyParamMap = buildBodyParamMap(op, bodyModel ?? null);
|
|
11111
|
-
const
|
|
11112
|
+
const deleteGroupedParams = collectGroupedParamNames(op);
|
|
11113
|
+
const visibleFields = bodyModel?.fields.filter((f) => !hiddenParams.has(f.name) && !deleteGroupedParams.has(f.name)) ?? [];
|
|
11112
11114
|
const hasOptionalFields = visibleFields.some((f) => !f.required);
|
|
11113
11115
|
if (hasOptionalFields) lines.push(" $body = array_filter([");
|
|
11114
11116
|
else lines.push(" $body = [");
|
|
@@ -11140,7 +11142,8 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
|
|
|
11140
11142
|
} else if (plan.hasBody) {
|
|
11141
11143
|
const bodyModel = op.requestBody?.kind === "model" ? modelMap.get(op.requestBody.name) : null;
|
|
11142
11144
|
const bodyParamMap = buildBodyParamMap(op, bodyModel ?? null);
|
|
11143
|
-
const
|
|
11145
|
+
const bodyGroupedParams = collectGroupedParamNames(op);
|
|
11146
|
+
const visibleFields = bodyModel?.fields.filter((f) => !hiddenParams.has(f.name) && !bodyGroupedParams.has(f.name)) ?? [];
|
|
11144
11147
|
const hasOptionalFields = visibleFields.some((f) => !f.required);
|
|
11145
11148
|
if (hasOptionalFields) lines.push(" $body = array_filter([");
|
|
11146
11149
|
else lines.push(" $body = [");
|
|
@@ -11216,6 +11219,7 @@ function buildMethodParams(op, plan, modelMap, ctx, hiddenParams) {
|
|
|
11216
11219
|
const bodyModel = modelMap.get(op.requestBody.name);
|
|
11217
11220
|
if (bodyModel) for (const field of bodyModel.fields) {
|
|
11218
11221
|
if (hidden.has(field.name)) continue;
|
|
11222
|
+
if (groupedParams.has(field.name)) continue;
|
|
11219
11223
|
const phpType = mapTypeRef$4(field.type, { qualified: true });
|
|
11220
11224
|
let phpName = fieldName$3(field.name);
|
|
11221
11225
|
if (usedNames.has(phpName)) {
|
|
@@ -14482,7 +14486,18 @@ function ensureTrailingNewlines$3(files) {
|
|
|
14482
14486
|
const goEmitter = {
|
|
14483
14487
|
language: "go",
|
|
14484
14488
|
generateModels(models, ctx) {
|
|
14485
|
-
|
|
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));
|
|
14486
14501
|
},
|
|
14487
14502
|
generateEnums(enums, ctx) {
|
|
14488
14503
|
const syntheticEnums = getSyntheticEnums();
|
|
@@ -21438,4 +21453,4 @@ const workosEmittersPlugin = {
|
|
|
21438
21453
|
//#endregion
|
|
21439
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 };
|
|
21440
21455
|
|
|
21441
|
-
//# sourceMappingURL=plugin-
|
|
21456
|
+
//# sourceMappingURL=plugin-CZc7Teko.mjs.map
|