@workos/oagen-emitters 0.6.4 → 0.6.6
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 +16 -0
- package/dist/index.mjs +1 -1
- package/dist/{plugin-CZoeqixh.mjs → plugin-BgVrq-hM.mjs} +23 -17
- package/dist/plugin-BgVrq-hM.mjs.map +1 -0
- package/dist/plugin.mjs +1 -1
- package/package.json +1 -1
- package/src/dotnet/index.ts +13 -7
- package/src/dotnet/models.ts +3 -1
- package/src/go/fixtures.ts +6 -7
- package/src/go/tests.ts +7 -2
- package/src/kotlin/models.ts +5 -3
- package/src/python/client.ts +7 -5
- package/src/python/models.ts +2 -2
- package/dist/plugin-CZoeqixh.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.6](https://github.com/workos/oagen-emitters/compare/v0.6.5...v0.6.6) (2026-04-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **dotnet:** prevent infinite recursion in discriminator converter WriteJson ([#59](https://github.com/workos/oagen-emitters/issues/59)) ([b2a2b7e](https://github.com/workos/oagen-emitters/commit/b2a2b7e1d18348423debb40ca6c331b4b7a34dc2))
|
|
9
|
+
* **go:** resolve test fixture paths through dedup rewrite map ([#58](https://github.com/workos/oagen-emitters/issues/58)) ([815750a](https://github.com/workos/oagen-emitters/commit/815750a9eef8d8c3883ab505848e585732a02a05))
|
|
10
|
+
* **python:** emit non-spec imports as plain imports instead of ignore block ([#60](https://github.com/workos/oagen-emitters/issues/60)) ([bf86e0c](https://github.com/workos/oagen-emitters/commit/bf86e0cfbb3ce7b48454be68d0f9fcfe5f6265c4))
|
|
11
|
+
|
|
12
|
+
## [0.6.5](https://github.com/workos/oagen-emitters/compare/v0.6.4...v0.6.5) (2026-04-28)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **python,kotlin,dotnet:** skip literal defaults for optional fields; fix dotnet JsonConverter nullability ([#56](https://github.com/workos/oagen-emitters/issues/56)) ([78d4c4c](https://github.com/workos/oagen-emitters/commit/78d4c4c303d67f7399d799dc37ad06d8e8997faa))
|
|
18
|
+
|
|
3
19
|
## [0.6.4](https://github.com/workos/oagen-emitters/compare/v0.6.3...v0.6.4) (2026-04-28)
|
|
4
20
|
|
|
5
21
|
|
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-BgVrq-hM.mjs";
|
|
2
2
|
export { dotnetEmitter, dotnetExtractor, elixirExtractor, goEmitter, goExtractor, kotlinEmitter, kotlinExtractor, nodeEmitter, nodeExtractor, phpEmitter, phpExtractor, pythonEmitter, pythonExtractor, rubyEmitter, rubyExtractor, rustExtractor, workosEmittersPlugin };
|
|
@@ -7322,7 +7322,7 @@ function generateModels$5(models, ctx) {
|
|
|
7322
7322
|
const wireKey = field.name;
|
|
7323
7323
|
const isRequired = !isOptionalField(model.name, field, ctx);
|
|
7324
7324
|
let accessor;
|
|
7325
|
-
if (field.type.kind === "literal") accessor = `data.get("${wireKey}", ${pythonLiteralDefault(field.type.value)})`;
|
|
7325
|
+
if (field.type.kind === "literal" && isRequired) accessor = `data.get("${wireKey}", ${pythonLiteralDefault(field.type.value)})`;
|
|
7326
7326
|
else accessor = isRequired ? `data["${wireKey}"]` : `data.get("${wireKey}")`;
|
|
7327
7327
|
const deserRequired = isRequired && field.type.kind !== "nullable";
|
|
7328
7328
|
const walrusVar = `_v_${pyFieldName}`;
|
|
@@ -8863,13 +8863,10 @@ function generateWorkOSClient(spec, ctx) {
|
|
|
8863
8863
|
lines.push(")");
|
|
8864
8864
|
} else lines.push(importLine);
|
|
8865
8865
|
}
|
|
8866
|
-
lines.push("");
|
|
8867
|
-
lines.push("# @oagen-ignore-start — non-spec service imports (hand-maintained)");
|
|
8868
8866
|
for (const s of NON_SPEC_SERVICES) {
|
|
8869
8867
|
const w = PYTHON_NON_SPEC_WIRING[s.id];
|
|
8870
8868
|
if (w) lines.push(w.importLine);
|
|
8871
8869
|
}
|
|
8872
|
-
lines.push("# @oagen-ignore-end");
|
|
8873
8870
|
lines.push("");
|
|
8874
8871
|
lines.push("");
|
|
8875
8872
|
lines.push("class WorkOSClient(_SyncBase):");
|
|
@@ -13803,7 +13800,10 @@ const ID_PREFIXES$1 = {
|
|
|
13803
13800
|
* Generate JSON fixture files for test data.
|
|
13804
13801
|
*/
|
|
13805
13802
|
function generateFixtures$1(spec) {
|
|
13806
|
-
if (spec.models.length === 0) return
|
|
13803
|
+
if (spec.models.length === 0) return {
|
|
13804
|
+
files: [],
|
|
13805
|
+
pathRewrites: /* @__PURE__ */ new Map()
|
|
13806
|
+
};
|
|
13807
13807
|
const modelMap = new Map(spec.models.map((m) => [m.name, m]));
|
|
13808
13808
|
const enumMap = new Map(spec.enums.map((e) => [e.name, e]));
|
|
13809
13809
|
const files = [];
|
|
@@ -13847,7 +13847,10 @@ function generateFixtures$1(spec) {
|
|
|
13847
13847
|
const canonical = sorted[0];
|
|
13848
13848
|
for (let i = 1; i < sorted.length; i++) pathRewrites.set(sorted[i], canonical);
|
|
13849
13849
|
}
|
|
13850
|
-
return
|
|
13850
|
+
return {
|
|
13851
|
+
files: files.filter((f) => !pathRewrites.has(f.path)),
|
|
13852
|
+
pathRewrites
|
|
13853
|
+
};
|
|
13851
13854
|
}
|
|
13852
13855
|
function unwrapListModel$1(model, modelMap) {
|
|
13853
13856
|
const dataField = model.fields.find((f) => f.name === "data");
|
|
@@ -13972,7 +13975,7 @@ function generateTests$3(spec, ctx) {
|
|
|
13972
13975
|
content: helperLines.join("\n"),
|
|
13973
13976
|
overwriteExisting: true
|
|
13974
13977
|
});
|
|
13975
|
-
const fixtures = generateFixtures$1(spec);
|
|
13978
|
+
const { files: fixtures, pathRewrites: fixtureRewrites } = generateFixtures$1(spec);
|
|
13976
13979
|
for (const fixture of fixtures) files.push({
|
|
13977
13980
|
path: fixture.path,
|
|
13978
13981
|
content: fixture.content,
|
|
@@ -13992,12 +13995,12 @@ function generateTests$3(spec, ctx) {
|
|
|
13992
13995
|
const testFile = generateServiceTest$1({
|
|
13993
13996
|
name: mountName,
|
|
13994
13997
|
operations
|
|
13995
|
-
}, spec, ctx, accessPaths);
|
|
13998
|
+
}, spec, ctx, accessPaths, fixtureRewrites);
|
|
13996
13999
|
if (testFile) files.push(testFile);
|
|
13997
14000
|
}
|
|
13998
14001
|
return files;
|
|
13999
14002
|
}
|
|
14000
|
-
function generateServiceTest$1(service, spec, ctx, _accessPaths) {
|
|
14003
|
+
function generateServiceTest$1(service, spec, ctx, _accessPaths, fixtureRewrites) {
|
|
14001
14004
|
if (service.operations.length === 0) return null;
|
|
14002
14005
|
const resolvedName = resolveResourceClassName$1(service, ctx);
|
|
14003
14006
|
const accessorName = resolvedName;
|
|
@@ -14075,6 +14078,7 @@ function generateServiceTest$1(service, spec, ctx, _accessPaths) {
|
|
|
14075
14078
|
}
|
|
14076
14079
|
}
|
|
14077
14080
|
fixturePath = `testdata/list_${fileName$1(resolved.name)}.json`;
|
|
14081
|
+
if (fixtureRewrites.has(fixturePath)) fixturePath = fixtureRewrites.get(fixturePath);
|
|
14078
14082
|
}
|
|
14079
14083
|
}
|
|
14080
14084
|
const expectedPath = buildExpectedPath$1(op);
|
|
@@ -14999,7 +15003,7 @@ function generateModels$2(models, ctx, discCtx) {
|
|
|
14999
15003
|
let csType;
|
|
15000
15004
|
let initializer = "";
|
|
15001
15005
|
let setterModifier = "";
|
|
15002
|
-
if (constInit !== null) {
|
|
15006
|
+
if (constInit !== null && !isOptional) {
|
|
15003
15007
|
csType = baseType;
|
|
15004
15008
|
initializer = ` = ${constInit};`;
|
|
15005
15009
|
setterModifier = "internal ";
|
|
@@ -16893,7 +16897,7 @@ const dotnetEmitter = {
|
|
|
16893
16897
|
lines.push(" {");
|
|
16894
16898
|
lines.push(" public override bool CanConvert(Type objectType) => objectType == typeof(object);");
|
|
16895
16899
|
lines.push("");
|
|
16896
|
-
lines.push(" public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer)");
|
|
16900
|
+
lines.push(" public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object? existingValue, Newtonsoft.Json.JsonSerializer serializer)");
|
|
16897
16901
|
lines.push(" {");
|
|
16898
16902
|
lines.push(" var jObject = JObject.Load(reader);");
|
|
16899
16903
|
lines.push(` var discriminatorValue = jObject["${disc.property}"]?.ToString();`);
|
|
@@ -16907,7 +16911,7 @@ const dotnetEmitter = {
|
|
|
16907
16911
|
lines.push(" }");
|
|
16908
16912
|
lines.push(" }");
|
|
16909
16913
|
lines.push("");
|
|
16910
|
-
lines.push(" public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer)");
|
|
16914
|
+
lines.push(" public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object? value, Newtonsoft.Json.JsonSerializer serializer)");
|
|
16911
16915
|
lines.push(" {");
|
|
16912
16916
|
lines.push(" serializer.Serialize(writer, value);");
|
|
16913
16917
|
lines.push(" }");
|
|
@@ -16937,7 +16941,7 @@ const dotnetEmitter = {
|
|
|
16937
16941
|
lines.push(" {");
|
|
16938
16942
|
lines.push(` public override bool CanConvert(Type objectType) => typeof(${baseClass}).IsAssignableFrom(objectType);`);
|
|
16939
16943
|
lines.push("");
|
|
16940
|
-
lines.push(" public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer)");
|
|
16944
|
+
lines.push(" public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object? existingValue, Newtonsoft.Json.JsonSerializer serializer)");
|
|
16941
16945
|
lines.push(" {");
|
|
16942
16946
|
lines.push(" var jObject = JObject.Load(reader);");
|
|
16943
16947
|
lines.push(` var discriminatorValue = jObject["${disc.property}"]?.ToString();`);
|
|
@@ -16956,9 +16960,11 @@ const dotnetEmitter = {
|
|
|
16956
16960
|
lines.push(" return target;");
|
|
16957
16961
|
lines.push(" }");
|
|
16958
16962
|
lines.push("");
|
|
16959
|
-
lines.push(" public override
|
|
16963
|
+
lines.push(" public override bool CanWrite => false;");
|
|
16964
|
+
lines.push("");
|
|
16965
|
+
lines.push(" public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object? value, Newtonsoft.Json.JsonSerializer serializer)");
|
|
16960
16966
|
lines.push(" {");
|
|
16961
|
-
lines.push("
|
|
16967
|
+
lines.push(" throw new NotImplementedException(\"Serialization is handled by the default serializer.\");");
|
|
16962
16968
|
lines.push(" }");
|
|
16963
16969
|
lines.push(" }");
|
|
16964
16970
|
lines.push("}");
|
|
@@ -17651,7 +17657,7 @@ function renderFields(fields, overrideFields = /* @__PURE__ */ new Set()) {
|
|
|
17651
17657
|
let kotlinType;
|
|
17652
17658
|
let defaultExpr = null;
|
|
17653
17659
|
const literalDefault = literalDefaultExpr(field.type);
|
|
17654
|
-
if (literalDefault !== null) {
|
|
17660
|
+
if (literalDefault !== null && field.required) {
|
|
17655
17661
|
kotlinType = baseType;
|
|
17656
17662
|
defaultExpr = literalDefault;
|
|
17657
17663
|
} else if (!field.required) {
|
|
@@ -21589,4 +21595,4 @@ const workosEmittersPlugin = {
|
|
|
21589
21595
|
//#endregion
|
|
21590
21596
|
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 };
|
|
21591
21597
|
|
|
21592
|
-
//# sourceMappingURL=plugin-
|
|
21598
|
+
//# sourceMappingURL=plugin-BgVrq-hM.mjs.map
|