@workos/oagen-emitters 0.7.0 → 0.7.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/dist/plugin.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as workosEmittersPlugin } from "./plugin-Bp46oZIh.mjs";
1
+ import { t as workosEmittersPlugin } from "./plugin-h8Onp2Ma.mjs";
2
2
  export { workosEmittersPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workos/oagen-emitters",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "WorkOS' oagen emitters",
5
5
  "license": "MIT",
6
6
  "author": "WorkOS",
@@ -270,8 +270,13 @@ function generateServiceInits(spec: ApiSpec, ctx: EmitterContext): GeneratedFile
270
270
  const ops = mountGroups.get(mountTarget)?.operations ?? service.operations;
271
271
  const groupClassNames = collectParameterGroupClassNames(ops);
272
272
 
273
+ // Use `X as X` re-export form (PEP 484) so pyright recognizes these as
274
+ // public re-exports. Otherwise consumers importing
275
+ // `from workos.user_management import RoleSingle` get a private-import
276
+ // warning under strict mode. Models barrel uses the same convention.
273
277
  const resourceImports = [resolvedName, `Async${resolvedName}`, ...groupClassNames];
274
- lines.push(`from ._resource import ${resourceImports.join(', ')}`);
278
+ const aliasedImports = resourceImports.map((n) => `${n} as ${n}`);
279
+ lines.push(`from ._resource import ${aliasedImports.join(', ')}`);
275
280
  lines.push('from .models import *');
276
281
 
277
282
  files.push({
@@ -103,7 +103,9 @@ describe('generateClient', () => {
103
103
 
104
104
  const serviceInit = files.find((f) => f.path === 'src/workos/organizations/__init__.py');
105
105
  expect(serviceInit).toBeDefined();
106
- expect(serviceInit!.content).toContain('from ._resource import Organizations, AsyncOrganizations');
106
+ expect(serviceInit!.content).toContain(
107
+ 'from ._resource import Organizations as Organizations, AsyncOrganizations as AsyncOrganizations',
108
+ );
107
109
  });
108
110
 
109
111
  it('generates flat directory structure for services (no nested namespaces)', () => {
@@ -193,7 +195,7 @@ describe('generateClient', () => {
193
195
  expect(serviceInit!.content).toContain('RoleSingle');
194
196
  expect(serviceInit!.content).toContain('RoleMultiple');
195
197
  expect(serviceInit!.content).toContain(
196
- 'from ._resource import UserManagement, AsyncUserManagement, RoleSingle, RoleMultiple',
198
+ 'from ._resource import UserManagement as UserManagement, AsyncUserManagement as AsyncUserManagement, RoleSingle as RoleSingle, RoleMultiple as RoleMultiple',
197
199
  );
198
200
  });
199
201