@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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +7 -0
- package/dist/index.mjs +1 -1
- package/dist/{plugin-Bp46oZIh.mjs → plugin-h8Onp2Ma.mjs} +4 -4
- package/dist/plugin-h8Onp2Ma.mjs.map +1 -0
- package/dist/plugin.mjs +1 -1
- package/package.json +1 -1
- package/src/python/client.ts +6 -1
- package/test/python/client.test.ts +4 -2
- package/dist/plugin-Bp46oZIh.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-h8Onp2Ma.mjs";
|
|
2
2
|
export { workosEmittersPlugin };
|
package/package.json
CHANGED
package/src/python/client.ts
CHANGED
|
@@ -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
|
-
|
|
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(
|
|
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
|
|