@workos/oagen-emitters 0.6.0 → 0.6.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/index.mjs +1 -1
- package/dist/{plugin-Dws9b6T7.mjs → plugin-DgjQSh2G.mjs} +62 -32
- package/dist/plugin-DgjQSh2G.mjs.map +1 -0
- package/dist/plugin.mjs +1 -1
- package/package.json +1 -1
- package/src/dotnet/manifest.ts +11 -5
- package/src/go/index.ts +15 -1
- package/src/go/manifest.ts +11 -5
- package/src/node/manifest.ts +8 -1
- package/src/php/manifest.ts +11 -5
- package/src/php/resources.ts +9 -4
- package/src/python/manifest.ts +11 -5
- package/dist/plugin-Dws9b6T7.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.2](https://github.com/workos/oagen-emitters/compare/v0.6.1...v0.6.2) (2026-04-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* use per-operation mountOn in manifest service field ([#48](https://github.com/workos/oagen-emitters/issues/48)) ([f55bf72](https://github.com/workos/oagen-emitters/commit/f55bf72c9b3011785a060f079dd8fc0ed9984af4))
|
|
9
|
+
|
|
10
|
+
## [0.6.1](https://github.com/workos/oagen-emitters/compare/v0.6.0...v0.6.1) (2026-04-25)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **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))
|
|
16
|
+
|
|
3
17
|
## [0.6.0](https://github.com/workos/oagen-emitters/compare/v0.5.0...v0.6.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-
|
|
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-DgjQSh2G.mjs";
|
|
2
2
|
export { dotnetEmitter, dotnetExtractor, elixirExtractor, goEmitter, goExtractor, kotlinEmitter, kotlinExtractor, nodeEmitter, nodeExtractor, phpEmitter, phpExtractor, pythonEmitter, pythonExtractor, rubyEmitter, rubyExtractor, rustExtractor, workosEmittersPlugin };
|
|
@@ -6605,13 +6605,16 @@ function generateSerializerTests(spec, ctx) {
|
|
|
6605
6605
|
//#region src/node/manifest.ts
|
|
6606
6606
|
function buildOperationsMap$6(spec, ctx) {
|
|
6607
6607
|
const manifest = {};
|
|
6608
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
6608
6609
|
for (const service of spec.services) {
|
|
6609
|
-
const
|
|
6610
|
+
const serviceProp = servicePropertyName$4(resolveResourceClassName$3(service, ctx));
|
|
6610
6611
|
for (const op of service.operations) {
|
|
6611
6612
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
6613
|
+
const method = resolveMethodName$6(op, service, ctx);
|
|
6614
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
6612
6615
|
manifest[httpKey] = {
|
|
6613
|
-
sdkMethod:
|
|
6614
|
-
service:
|
|
6616
|
+
sdkMethod: method,
|
|
6617
|
+
service: resolved ? servicePropertyName$4(resolved.mountOn) : serviceProp
|
|
6615
6618
|
};
|
|
6616
6619
|
}
|
|
6617
6620
|
}
|
|
@@ -10254,18 +10257,21 @@ function generateModelRoundTripTests(spec, ctx) {
|
|
|
10254
10257
|
function buildOperationsMap$5(spec, ctx) {
|
|
10255
10258
|
const manifest = {};
|
|
10256
10259
|
const accessPaths = buildServiceAccessPaths$3(spec.services, ctx);
|
|
10260
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
10257
10261
|
for (const service of spec.services) {
|
|
10258
|
-
let
|
|
10259
|
-
if (!
|
|
10262
|
+
let serviceProp = accessPaths.get(service.name);
|
|
10263
|
+
if (!serviceProp) {
|
|
10260
10264
|
const mountTarget = getMountTarget(service, ctx);
|
|
10261
|
-
|
|
10265
|
+
serviceProp = accessPaths.get(mountTarget);
|
|
10262
10266
|
}
|
|
10263
|
-
if (!
|
|
10267
|
+
if (!serviceProp) throw new Error(`Missing public client access path for service ${service.name}`);
|
|
10264
10268
|
for (const op of service.operations) {
|
|
10265
10269
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
10270
|
+
const method = resolveMethodName$5(op, service, ctx);
|
|
10271
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
10266
10272
|
manifest[httpKey] = {
|
|
10267
|
-
sdkMethod:
|
|
10268
|
-
service:
|
|
10273
|
+
sdkMethod: method,
|
|
10274
|
+
service: (resolved && accessPaths.get(resolved.mountOn)) ?? serviceProp
|
|
10269
10275
|
};
|
|
10270
10276
|
}
|
|
10271
10277
|
}
|
|
@@ -10993,12 +10999,14 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
|
|
|
10993
10999
|
if (p.default != null) desc += ` Defaults to ${JSON.stringify(p.default)}.`;
|
|
10994
11000
|
docParts.push(`@param ${docType} $${phpName}${desc}`);
|
|
10995
11001
|
}
|
|
11002
|
+
const groupedParamNames = collectGroupedParamNames(op);
|
|
10996
11003
|
if (plan.hasBody && op.requestBody?.kind === "model") {
|
|
10997
11004
|
const bodyModel = modelMap.get(op.requestBody.name);
|
|
10998
11005
|
if (bodyModel) {
|
|
10999
11006
|
const bodyParamMap = buildBodyParamMap(op, bodyModel);
|
|
11000
11007
|
for (const field of bodyModel.fields) {
|
|
11001
11008
|
if (hiddenParams.has(field.name)) continue;
|
|
11009
|
+
if (groupedParamNames.has(field.name)) continue;
|
|
11002
11010
|
const docType = mapTypeRefForPHPDoc(field.type);
|
|
11003
11011
|
const phpName = bodyParamMap.get(field.name) ?? fieldName$3(field.name);
|
|
11004
11012
|
if (seenDocParams.has(phpName)) continue;
|
|
@@ -11010,7 +11018,6 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
|
|
|
11010
11018
|
}
|
|
11011
11019
|
}
|
|
11012
11020
|
}
|
|
11013
|
-
const groupedParamNames = collectGroupedParamNames(op);
|
|
11014
11021
|
for (const group of op.parameterGroups ?? []) {
|
|
11015
11022
|
const phpName = fieldName$3(group.name);
|
|
11016
11023
|
if (seenDocParams.has(phpName)) continue;
|
|
@@ -11108,7 +11115,8 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
|
|
|
11108
11115
|
if (plan.hasBody) {
|
|
11109
11116
|
const bodyModel = op.requestBody?.kind === "model" ? modelMap.get(op.requestBody.name) : null;
|
|
11110
11117
|
const bodyParamMap = buildBodyParamMap(op, bodyModel ?? null);
|
|
11111
|
-
const
|
|
11118
|
+
const deleteGroupedParams = collectGroupedParamNames(op);
|
|
11119
|
+
const visibleFields = bodyModel?.fields.filter((f) => !hiddenParams.has(f.name) && !deleteGroupedParams.has(f.name)) ?? [];
|
|
11112
11120
|
const hasOptionalFields = visibleFields.some((f) => !f.required);
|
|
11113
11121
|
if (hasOptionalFields) lines.push(" $body = array_filter([");
|
|
11114
11122
|
else lines.push(" $body = [");
|
|
@@ -11140,7 +11148,8 @@ function generateMethod$2(lines, op, service, ctx, modelMap, resolvedOp) {
|
|
|
11140
11148
|
} else if (plan.hasBody) {
|
|
11141
11149
|
const bodyModel = op.requestBody?.kind === "model" ? modelMap.get(op.requestBody.name) : null;
|
|
11142
11150
|
const bodyParamMap = buildBodyParamMap(op, bodyModel ?? null);
|
|
11143
|
-
const
|
|
11151
|
+
const bodyGroupedParams = collectGroupedParamNames(op);
|
|
11152
|
+
const visibleFields = bodyModel?.fields.filter((f) => !hiddenParams.has(f.name) && !bodyGroupedParams.has(f.name)) ?? [];
|
|
11144
11153
|
const hasOptionalFields = visibleFields.some((f) => !f.required);
|
|
11145
11154
|
if (hasOptionalFields) lines.push(" $body = array_filter([");
|
|
11146
11155
|
else lines.push(" $body = [");
|
|
@@ -11216,6 +11225,7 @@ function buildMethodParams(op, plan, modelMap, ctx, hiddenParams) {
|
|
|
11216
11225
|
const bodyModel = modelMap.get(op.requestBody.name);
|
|
11217
11226
|
if (bodyModel) for (const field of bodyModel.fields) {
|
|
11218
11227
|
if (hidden.has(field.name)) continue;
|
|
11228
|
+
if (groupedParams.has(field.name)) continue;
|
|
11219
11229
|
const phpType = mapTypeRef$4(field.type, { qualified: true });
|
|
11220
11230
|
let phpName = fieldName$3(field.name);
|
|
11221
11231
|
if (usedNames.has(phpName)) {
|
|
@@ -12015,18 +12025,21 @@ function emitBodyAssertions(lines, op, ctx, hidden) {
|
|
|
12015
12025
|
function buildOperationsMap$4(spec, ctx) {
|
|
12016
12026
|
const manifest = {};
|
|
12017
12027
|
const accessPaths = buildServiceAccessPaths$2(spec.services, ctx);
|
|
12028
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
12018
12029
|
for (const service of spec.services) {
|
|
12019
|
-
let
|
|
12020
|
-
if (!
|
|
12030
|
+
let serviceProp = accessPaths.get(service.name);
|
|
12031
|
+
if (!serviceProp) {
|
|
12021
12032
|
const mountTarget = getMountTarget(service, ctx);
|
|
12022
|
-
|
|
12033
|
+
serviceProp = accessPaths.get(mountTarget);
|
|
12023
12034
|
}
|
|
12024
|
-
if (!
|
|
12035
|
+
if (!serviceProp) throw new Error(`Missing public client access path for service ${service.name}`);
|
|
12025
12036
|
for (const op of service.operations) {
|
|
12026
12037
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
12038
|
+
const method = resolveMethodName$4(op, service, ctx);
|
|
12039
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
12027
12040
|
manifest[httpKey] = {
|
|
12028
|
-
sdkMethod:
|
|
12029
|
-
service:
|
|
12041
|
+
sdkMethod: method,
|
|
12042
|
+
service: (resolved && accessPaths.get(resolved.mountOn)) ?? serviceProp
|
|
12030
12043
|
};
|
|
12031
12044
|
}
|
|
12032
12045
|
}
|
|
@@ -14455,18 +14468,21 @@ function generateModelFixtureValues(model) {
|
|
|
14455
14468
|
function buildOperationsMap$3(spec, ctx) {
|
|
14456
14469
|
const manifest = {};
|
|
14457
14470
|
const accessPaths = buildServiceAccessPaths$1(spec.services, ctx);
|
|
14471
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
14458
14472
|
for (const service of spec.services) {
|
|
14459
|
-
let
|
|
14460
|
-
if (!
|
|
14473
|
+
let serviceProp = accessPaths.get(service.name);
|
|
14474
|
+
if (!serviceProp) {
|
|
14461
14475
|
const mountTarget = getMountTarget(service, ctx);
|
|
14462
|
-
|
|
14476
|
+
serviceProp = accessPaths.get(mountTarget);
|
|
14463
14477
|
}
|
|
14464
|
-
if (!
|
|
14478
|
+
if (!serviceProp) throw new Error(`Missing public client access path for service ${service.name}`);
|
|
14465
14479
|
for (const op of service.operations) {
|
|
14466
14480
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
14481
|
+
const method = resolveMethodName$3(op, service, ctx);
|
|
14482
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
14467
14483
|
manifest[httpKey] = {
|
|
14468
|
-
sdkMethod:
|
|
14469
|
-
service:
|
|
14484
|
+
sdkMethod: method,
|
|
14485
|
+
service: (resolved && accessPaths.get(resolved.mountOn)) ?? serviceProp
|
|
14470
14486
|
};
|
|
14471
14487
|
}
|
|
14472
14488
|
}
|
|
@@ -14482,7 +14498,18 @@ function ensureTrailingNewlines$3(files) {
|
|
|
14482
14498
|
const goEmitter = {
|
|
14483
14499
|
language: "go",
|
|
14484
14500
|
generateModels(models, ctx) {
|
|
14485
|
-
|
|
14501
|
+
const enriched = enrichModelsFromSpec(models);
|
|
14502
|
+
const originalByName = new Map(models.map((m) => [m.name, m]));
|
|
14503
|
+
return ensureTrailingNewlines$3(generateModels$3(enriched.map((m) => {
|
|
14504
|
+
if (m.discriminator && m.fields.length === 0) {
|
|
14505
|
+
const original = originalByName.get(m.name);
|
|
14506
|
+
if (original && original.fields.length > 0) return {
|
|
14507
|
+
...m,
|
|
14508
|
+
fields: original.fields
|
|
14509
|
+
};
|
|
14510
|
+
}
|
|
14511
|
+
return m;
|
|
14512
|
+
}), ctx));
|
|
14486
14513
|
},
|
|
14487
14514
|
generateEnums(enums, ctx) {
|
|
14488
14515
|
const syntheticEnums = getSyntheticEnums();
|
|
@@ -16727,18 +16754,21 @@ function csStringLiteral(s) {
|
|
|
16727
16754
|
function buildOperationsMap$2(spec, ctx) {
|
|
16728
16755
|
const manifest = {};
|
|
16729
16756
|
const accessPaths = buildServiceAccessPaths(spec.services, ctx);
|
|
16757
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
16730
16758
|
for (const service of spec.services) {
|
|
16731
|
-
let
|
|
16732
|
-
if (!
|
|
16759
|
+
let serviceProp = accessPaths.get(service.name);
|
|
16760
|
+
if (!serviceProp) {
|
|
16733
16761
|
const mountTarget = getMountTarget(service, ctx);
|
|
16734
|
-
|
|
16762
|
+
serviceProp = accessPaths.get(mountTarget);
|
|
16735
16763
|
}
|
|
16736
|
-
if (!
|
|
16764
|
+
if (!serviceProp) throw new Error(`Missing public client access path for service ${service.name}`);
|
|
16737
16765
|
for (const op of service.operations) {
|
|
16738
16766
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
16767
|
+
const method = resolveMethodName$2(op, service, ctx);
|
|
16768
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
16739
16769
|
manifest[httpKey] = {
|
|
16740
|
-
sdkMethod:
|
|
16741
|
-
service:
|
|
16770
|
+
sdkMethod: method,
|
|
16771
|
+
service: (resolved && accessPaths.get(resolved.mountOn)) ?? serviceProp
|
|
16742
16772
|
};
|
|
16743
16773
|
}
|
|
16744
16774
|
}
|
|
@@ -21438,4 +21468,4 @@ const workosEmittersPlugin = {
|
|
|
21438
21468
|
//#endregion
|
|
21439
21469
|
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
21470
|
|
|
21441
|
-
//# sourceMappingURL=plugin-
|
|
21471
|
+
//# sourceMappingURL=plugin-DgjQSh2G.mjs.map
|