@workos/oagen-emitters 0.6.8 → 0.7.0
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/README.md +1 -0
- package/dist/index.mjs +1 -1
- package/dist/{plugin-Cmg_LFtm.mjs → plugin-Bp46oZIh.mjs} +9 -9
- package/dist/plugin-Bp46oZIh.mjs.map +1 -0
- package/dist/plugin.mjs +1 -1
- package/package.json +2 -2
- package/src/node/tests.ts +1 -1
- package/src/node/utils.ts +1 -1
- package/src/python/models.ts +1 -1
- package/src/python/resources.ts +1 -1
- package/src/python/tests.ts +2 -2
- package/src/ruby/client.ts +1 -1
- package/src/ruby/models.ts +1 -1
- package/dist/plugin-Cmg_LFtm.mjs.map +0 -1
package/dist/plugin.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as workosEmittersPlugin } from "./plugin-
|
|
1
|
+
import { t as workosEmittersPlugin } from "./plugin-Bp46oZIh.mjs";
|
|
2
2
|
export { workosEmittersPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workos/oagen-emitters",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "WorkOS' oagen emitters",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "WorkOS",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"node": ">=24.10.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@workos/oagen": "^0.
|
|
57
|
+
"@workos/oagen": "^0.12.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/src/node/tests.ts
CHANGED
|
@@ -854,7 +854,7 @@ function modelNeedsRoundTripTest(model: Model): boolean {
|
|
|
854
854
|
*/
|
|
855
855
|
function generateSerializerTests(spec: ApiSpec, ctx: EmitterContext): GeneratedFile[] {
|
|
856
856
|
const files: GeneratedFile[] = [];
|
|
857
|
-
const modelToService = assignModelsToServices(spec.models, spec.services);
|
|
857
|
+
const modelToService = assignModelsToServices(spec.models, spec.services, ctx.modelHints);
|
|
858
858
|
const serviceNameMap = new Map<string, string>();
|
|
859
859
|
for (const service of spec.services) {
|
|
860
860
|
serviceNameMap.set(service.name, resolveResourceClassName(service, ctx));
|
package/src/node/utils.ts
CHANGED
|
@@ -223,7 +223,7 @@ export function createServiceDirResolver(
|
|
|
223
223
|
serviceNameMap: Map<string, string>;
|
|
224
224
|
resolveDir: (irService: string | undefined) => string;
|
|
225
225
|
} {
|
|
226
|
-
const modelToService = assignModelsToServices(models, services);
|
|
226
|
+
const modelToService = assignModelsToServices(models, services, ctx.modelHints);
|
|
227
227
|
const serviceNameMap = buildServiceNameMap(services, ctx);
|
|
228
228
|
const resolveDir = (irService: string | undefined) =>
|
|
229
229
|
irService ? resolveServiceDir(serviceNameMap.get(irService) ?? irService) : 'common';
|
package/src/python/models.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { assignEnumsToServices, collectGeneratedEnumSymbolsByDir } from './enums
|
|
|
11
11
|
export function generateModels(models: Model[], ctx: EmitterContext): GeneratedFile[] {
|
|
12
12
|
if (models.length === 0) return [];
|
|
13
13
|
|
|
14
|
-
const modelToService = assignModelsToServices(models, ctx.spec.services);
|
|
14
|
+
const modelToService = assignModelsToServices(models, ctx.spec.services, ctx.modelHints);
|
|
15
15
|
const enumToService = assignEnumsToServices(ctx.spec.enums, ctx.spec.services);
|
|
16
16
|
const mountDirMap = buildMountDirMap(ctx);
|
|
17
17
|
const resolveDir = (irService: string | undefined) =>
|
package/src/python/resources.ts
CHANGED
|
@@ -1116,7 +1116,7 @@ export function generateResources(services: Service[], ctx: EmitterContext): Gen
|
|
|
1116
1116
|
const actualModelImports = [...modelImports];
|
|
1117
1117
|
|
|
1118
1118
|
// Split imports into same-service and cross-service (using mount-based dirs)
|
|
1119
|
-
const modelToServiceMap = assignModelsToServices(ctx.spec.models, ctx.spec.services);
|
|
1119
|
+
const modelToServiceMap = assignModelsToServices(ctx.spec.models, ctx.spec.services, ctx.modelHints);
|
|
1120
1120
|
// Discriminator variant type aliases (e.g. EventSchemaVariant) live in the same
|
|
1121
1121
|
// service as their dispatcher model, so ensure they resolve to the same directory.
|
|
1122
1122
|
for (const model of ctx.spec.models) {
|
package/src/python/tests.ts
CHANGED
|
@@ -227,7 +227,7 @@ function generateServiceTest(
|
|
|
227
227
|
});
|
|
228
228
|
|
|
229
229
|
// Group imports by their actual service directory (models may live in different services)
|
|
230
|
-
const modelToServiceMap = assignModelsToServices(spec.models, spec.services);
|
|
230
|
+
const modelToServiceMap = assignModelsToServices(spec.models, spec.services, ctx.modelHints);
|
|
231
231
|
const mountDirMap = buildMountDirMap(ctx);
|
|
232
232
|
const resolveModelDir = (modelName: string) => {
|
|
233
233
|
const svc = modelToServiceMap.get(modelName);
|
|
@@ -1402,7 +1402,7 @@ function generateModelRoundTripTests(spec: ApiSpec, ctx: EmitterContext): Genera
|
|
|
1402
1402
|
);
|
|
1403
1403
|
if (models.length === 0) return null;
|
|
1404
1404
|
|
|
1405
|
-
const modelToService = assignModelsToServices(spec.models, spec.services);
|
|
1405
|
+
const modelToService = assignModelsToServices(spec.models, spec.services, ctx.modelHints);
|
|
1406
1406
|
const roundTripDirMap = buildMountDirMap(ctx);
|
|
1407
1407
|
const resolveDir = (irService: string | undefined) =>
|
|
1408
1408
|
irService ? (roundTripDirMap.get(irService) ?? 'common') : 'common';
|
package/src/ruby/client.ts
CHANGED
|
@@ -182,7 +182,7 @@ function generateMainEntryFile(spec: ApiSpec, ctx: EmitterContext): GeneratedFil
|
|
|
182
182
|
* keep the generated namespace flat while the filesystem is grouped.
|
|
183
183
|
*/
|
|
184
184
|
function collectModelSubdirs(spec: ApiSpec, ctx: EmitterContext): string[] {
|
|
185
|
-
const modelToService = assignModelsToServices(spec.models as Model[], spec.services);
|
|
185
|
+
const modelToService = assignModelsToServices(spec.models as Model[], spec.services, ctx.modelHints);
|
|
186
186
|
const mountDirMap = buildMountDirMap(ctx);
|
|
187
187
|
const subdirs = new Set<string>();
|
|
188
188
|
for (const model of spec.models as Model[]) {
|
package/src/ruby/models.ts
CHANGED
|
@@ -67,7 +67,7 @@ export function generateModels(models: Model[], ctx: EmitterContext): GeneratedF
|
|
|
67
67
|
// Model → mount target directory. Each model is assigned to the first service
|
|
68
68
|
// that references it (transitively). Orphans land in `shared/`. Zeitwerk is
|
|
69
69
|
// told to collapse each subfolder (in client.ts) so the namespace stays flat.
|
|
70
|
-
const modelToService = assignModelsToServices(models, ctx.spec.services);
|
|
70
|
+
const modelToService = assignModelsToServices(models, ctx.spec.services, ctx.modelHints);
|
|
71
71
|
const mountDirMap = buildMountDirMap(ctx);
|
|
72
72
|
const dirFor = (modelName: string): string => {
|
|
73
73
|
const service = modelToService.get(modelName);
|