@workos/oagen-emitters 0.6.1 → 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 +7 -0
- package/dist/index.mjs +1 -1
- package/dist/{plugin-CZc7Teko.mjs → plugin-DgjQSh2G.mjs} +43 -28
- 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/manifest.ts +11 -5
- package/src/node/manifest.ts +8 -1
- package/src/php/manifest.ts +11 -5
- package/src/python/manifest.ts +11 -5
- package/dist/plugin-CZc7Teko.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-DgjQSh2G.mjs";
|
|
2
2
|
export { workosEmittersPlugin };
|
package/package.json
CHANGED
package/src/dotnet/manifest.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ApiSpec, EmitterContext, OperationsMap } from '@workos/oagen';
|
|
2
2
|
import { resolveMethodName } from './naming.js';
|
|
3
3
|
import { buildServiceAccessPaths } from './client.js';
|
|
4
|
-
import { getMountTarget } from '../shared/resolved-ops.js';
|
|
4
|
+
import { buildResolvedLookup, lookupResolved, getMountTarget } from '../shared/resolved-ops.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Build operation-to-SDK-method mapping for the manifest.
|
|
@@ -9,19 +9,25 @@ import { getMountTarget } from '../shared/resolved-ops.js';
|
|
|
9
9
|
export function buildOperationsMap(spec: ApiSpec, ctx: EmitterContext): OperationsMap {
|
|
10
10
|
const manifest: OperationsMap = {};
|
|
11
11
|
const accessPaths = buildServiceAccessPaths(spec.services, ctx);
|
|
12
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
12
13
|
|
|
13
14
|
for (const service of spec.services) {
|
|
14
|
-
let
|
|
15
|
-
if (!
|
|
15
|
+
let serviceProp = accessPaths.get(service.name);
|
|
16
|
+
if (!serviceProp) {
|
|
16
17
|
const mountTarget = getMountTarget(service, ctx);
|
|
17
|
-
|
|
18
|
+
serviceProp = accessPaths.get(mountTarget);
|
|
18
19
|
}
|
|
19
|
-
if (!
|
|
20
|
+
if (!serviceProp) {
|
|
20
21
|
throw new Error(`Missing public client access path for service ${service.name}`);
|
|
21
22
|
}
|
|
22
23
|
for (const op of service.operations) {
|
|
23
24
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
24
25
|
const method = resolveMethodName(op, service, ctx);
|
|
26
|
+
|
|
27
|
+
// Use per-operation mountOn when it differs from the service default
|
|
28
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
29
|
+
const propName = (resolved && accessPaths.get(resolved.mountOn)) ?? serviceProp;
|
|
30
|
+
|
|
25
31
|
manifest[httpKey] = { sdkMethod: method, service: propName };
|
|
26
32
|
}
|
|
27
33
|
}
|
package/src/go/manifest.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ApiSpec, EmitterContext, OperationsMap } from '@workos/oagen';
|
|
2
2
|
import { resolveMethodName } from './naming.js';
|
|
3
3
|
import { buildServiceAccessPaths } from './client.js';
|
|
4
|
-
import { getMountTarget } from '../shared/resolved-ops.js';
|
|
4
|
+
import { buildResolvedLookup, lookupResolved, getMountTarget } from '../shared/resolved-ops.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Build operation-to-SDK-method mapping for the manifest.
|
|
@@ -9,19 +9,25 @@ import { getMountTarget } from '../shared/resolved-ops.js';
|
|
|
9
9
|
export function buildOperationsMap(spec: ApiSpec, ctx: EmitterContext): OperationsMap {
|
|
10
10
|
const manifest: OperationsMap = {};
|
|
11
11
|
const accessPaths = buildServiceAccessPaths(spec.services, ctx);
|
|
12
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
12
13
|
|
|
13
14
|
for (const service of spec.services) {
|
|
14
|
-
let
|
|
15
|
-
if (!
|
|
15
|
+
let serviceProp = accessPaths.get(service.name);
|
|
16
|
+
if (!serviceProp) {
|
|
16
17
|
const mountTarget = getMountTarget(service, ctx);
|
|
17
|
-
|
|
18
|
+
serviceProp = accessPaths.get(mountTarget);
|
|
18
19
|
}
|
|
19
|
-
if (!
|
|
20
|
+
if (!serviceProp) {
|
|
20
21
|
throw new Error(`Missing public client access path for service ${service.name}`);
|
|
21
22
|
}
|
|
22
23
|
for (const op of service.operations) {
|
|
23
24
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
24
25
|
const method = resolveMethodName(op, service, ctx);
|
|
26
|
+
|
|
27
|
+
// Use per-operation mountOn when it differs from the service default
|
|
28
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
29
|
+
const propName = (resolved && accessPaths.get(resolved.mountOn)) ?? serviceProp;
|
|
30
|
+
|
|
25
31
|
manifest[httpKey] = { sdkMethod: method, service: propName };
|
|
26
32
|
}
|
|
27
33
|
}
|
package/src/node/manifest.ts
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import type { ApiSpec, EmitterContext, OperationsMap } from '@workos/oagen';
|
|
2
2
|
import { resolveMethodName, servicePropertyName } from './naming.js';
|
|
3
3
|
import { resolveResourceClassName } from './resources.js';
|
|
4
|
+
import { buildResolvedLookup, lookupResolved } from '../shared/resolved-ops.js';
|
|
4
5
|
|
|
5
6
|
export function buildOperationsMap(spec: ApiSpec, ctx: EmitterContext): OperationsMap {
|
|
6
7
|
const manifest: OperationsMap = {};
|
|
8
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
7
9
|
|
|
8
10
|
for (const service of spec.services) {
|
|
9
|
-
const
|
|
11
|
+
const serviceProp = servicePropertyName(resolveResourceClassName(service, ctx));
|
|
10
12
|
for (const op of service.operations) {
|
|
11
13
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
12
14
|
const method = resolveMethodName(op, service, ctx);
|
|
15
|
+
|
|
16
|
+
// Use per-operation mountOn when it differs from the service default
|
|
17
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
18
|
+
const propName = resolved ? servicePropertyName(resolved.mountOn) : serviceProp;
|
|
19
|
+
|
|
13
20
|
manifest[httpKey] = { sdkMethod: method, service: propName };
|
|
14
21
|
}
|
|
15
22
|
}
|
package/src/php/manifest.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ApiSpec, EmitterContext, OperationsMap } from '@workos/oagen';
|
|
2
2
|
import { resolveMethodName } from './naming.js';
|
|
3
3
|
import { buildServiceAccessPaths } from './client.js';
|
|
4
|
-
import { getMountTarget } from '../shared/resolved-ops.js';
|
|
4
|
+
import { buildResolvedLookup, lookupResolved, getMountTarget } from '../shared/resolved-ops.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Build operation-to-SDK-method mapping for the manifest.
|
|
@@ -9,19 +9,25 @@ import { getMountTarget } from '../shared/resolved-ops.js';
|
|
|
9
9
|
export function buildOperationsMap(spec: ApiSpec, ctx: EmitterContext): OperationsMap {
|
|
10
10
|
const manifest: OperationsMap = {};
|
|
11
11
|
const accessPaths = buildServiceAccessPaths(spec.services, ctx);
|
|
12
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
12
13
|
|
|
13
14
|
for (const service of spec.services) {
|
|
14
|
-
let
|
|
15
|
-
if (!
|
|
15
|
+
let serviceProp = accessPaths.get(service.name);
|
|
16
|
+
if (!serviceProp) {
|
|
16
17
|
const mountTarget = getMountTarget(service, ctx);
|
|
17
|
-
|
|
18
|
+
serviceProp = accessPaths.get(mountTarget);
|
|
18
19
|
}
|
|
19
|
-
if (!
|
|
20
|
+
if (!serviceProp) {
|
|
20
21
|
throw new Error(`Missing public client access path for service ${service.name}`);
|
|
21
22
|
}
|
|
22
23
|
for (const op of service.operations) {
|
|
23
24
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
24
25
|
const method = resolveMethodName(op, service, ctx);
|
|
26
|
+
|
|
27
|
+
// Use per-operation mountOn when it differs from the service default
|
|
28
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
29
|
+
const propName = (resolved && accessPaths.get(resolved.mountOn)) ?? serviceProp;
|
|
30
|
+
|
|
25
31
|
manifest[httpKey] = { sdkMethod: method, service: propName };
|
|
26
32
|
}
|
|
27
33
|
}
|
package/src/python/manifest.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ApiSpec, EmitterContext, OperationsMap } from '@workos/oagen';
|
|
2
2
|
import { resolveMethodName } from './naming.js';
|
|
3
3
|
import { buildServiceAccessPaths } from './client.js';
|
|
4
|
-
import { getMountTarget } from '../shared/resolved-ops.js';
|
|
4
|
+
import { buildResolvedLookup, lookupResolved, getMountTarget } from '../shared/resolved-ops.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Build operation-to-SDK-method mapping for the manifest.
|
|
@@ -9,20 +9,26 @@ import { getMountTarget } from '../shared/resolved-ops.js';
|
|
|
9
9
|
export function buildOperationsMap(spec: ApiSpec, ctx: EmitterContext): OperationsMap {
|
|
10
10
|
const manifest: OperationsMap = {};
|
|
11
11
|
const accessPaths = buildServiceAccessPaths(spec.services, ctx);
|
|
12
|
+
const resolvedLookup = buildResolvedLookup(ctx);
|
|
12
13
|
|
|
13
14
|
for (const service of spec.services) {
|
|
14
15
|
// For mounted services, look up the mount target's access path
|
|
15
|
-
let
|
|
16
|
-
if (!
|
|
16
|
+
let serviceProp = accessPaths.get(service.name);
|
|
17
|
+
if (!serviceProp) {
|
|
17
18
|
const mountTarget = getMountTarget(service, ctx);
|
|
18
|
-
|
|
19
|
+
serviceProp = accessPaths.get(mountTarget);
|
|
19
20
|
}
|
|
20
|
-
if (!
|
|
21
|
+
if (!serviceProp) {
|
|
21
22
|
throw new Error(`Missing public client access path for service ${service.name}`);
|
|
22
23
|
}
|
|
23
24
|
for (const op of service.operations) {
|
|
24
25
|
const httpKey = `${op.httpMethod.toUpperCase()} ${op.path}`;
|
|
25
26
|
const method = resolveMethodName(op, service, ctx);
|
|
27
|
+
|
|
28
|
+
// Use per-operation mountOn when it differs from the service default
|
|
29
|
+
const resolved = lookupResolved(op, resolvedLookup);
|
|
30
|
+
const propName = (resolved && accessPaths.get(resolved.mountOn)) ?? serviceProp;
|
|
31
|
+
|
|
26
32
|
manifest[httpKey] = { sdkMethod: method, service: propName };
|
|
27
33
|
}
|
|
28
34
|
}
|