@workos/oagen-emitters 0.3.0 → 0.5.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/.github/workflows/ci.yml +1 -1
- package/.github/workflows/lint.yml +1 -1
- package/.github/workflows/release-please.yml +2 -2
- package/.github/workflows/release.yml +1 -1
- package/.husky/pre-push +11 -0
- package/.node-version +1 -1
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +15 -0
- package/README.md +35 -224
- package/dist/index.d.mts +12 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -12737
- package/dist/plugin-BSop9f9z.mjs +21471 -0
- package/dist/plugin-BSop9f9z.mjs.map +1 -0
- package/dist/plugin.d.mts +7 -0
- package/dist/plugin.d.mts.map +1 -0
- package/dist/plugin.mjs +2 -0
- package/docs/sdk-architecture/dotnet.md +336 -0
- package/oagen.config.ts +5 -343
- package/package.json +10 -34
- package/smoke/sdk-dotnet.ts +45 -12
- package/src/dotnet/client.ts +89 -0
- package/src/dotnet/enums.ts +323 -0
- package/src/dotnet/fixtures.ts +236 -0
- package/src/dotnet/index.ts +248 -0
- package/src/dotnet/manifest.ts +36 -0
- package/src/dotnet/models.ts +320 -0
- package/src/dotnet/naming.ts +368 -0
- package/src/dotnet/resources.ts +943 -0
- package/src/dotnet/tests.ts +713 -0
- package/src/dotnet/type-map.ts +228 -0
- package/src/dotnet/wrappers.ts +197 -0
- package/src/go/client.ts +35 -3
- package/src/go/enums.ts +4 -0
- package/src/go/index.ts +15 -7
- package/src/go/models.ts +6 -1
- package/src/go/naming.ts +5 -17
- package/src/go/resources.ts +534 -73
- package/src/go/tests.ts +39 -3
- package/src/go/type-map.ts +8 -3
- package/src/go/wrappers.ts +79 -21
- package/src/index.ts +15 -0
- package/src/kotlin/client.ts +58 -0
- package/src/kotlin/enums.ts +189 -0
- package/src/kotlin/index.ts +92 -0
- package/src/kotlin/manifest.ts +55 -0
- package/src/kotlin/models.ts +486 -0
- package/src/kotlin/naming.ts +229 -0
- package/src/kotlin/overrides.ts +25 -0
- package/src/kotlin/resources.ts +998 -0
- package/src/kotlin/tests.ts +1133 -0
- package/src/kotlin/type-map.ts +123 -0
- package/src/kotlin/wrappers.ts +168 -0
- package/src/node/client.ts +84 -7
- package/src/node/field-plan.ts +12 -14
- package/src/node/fixtures.ts +39 -3
- package/src/node/index.ts +1 -0
- package/src/node/models.ts +281 -37
- package/src/node/resources.ts +319 -95
- package/src/node/tests.ts +108 -29
- package/src/node/type-map.ts +1 -31
- package/src/node/utils.ts +96 -6
- package/src/node/wrappers.ts +31 -1
- package/src/php/client.ts +11 -3
- package/src/php/models.ts +0 -33
- package/src/php/naming.ts +2 -21
- package/src/php/resources.ts +275 -19
- package/src/php/tests.ts +118 -18
- package/src/php/type-map.ts +16 -2
- package/src/php/wrappers.ts +7 -2
- package/src/plugin.ts +50 -0
- package/src/python/client.ts +50 -32
- package/src/python/enums.ts +35 -10
- package/src/python/index.ts +35 -27
- package/src/python/models.ts +139 -2
- package/src/python/naming.ts +2 -22
- package/src/python/resources.ts +234 -17
- package/src/python/tests.ts +260 -16
- package/src/python/type-map.ts +16 -2
- package/src/ruby/client.ts +238 -0
- package/src/ruby/enums.ts +149 -0
- package/src/ruby/index.ts +93 -0
- package/src/ruby/manifest.ts +35 -0
- package/src/ruby/models.ts +360 -0
- package/src/ruby/naming.ts +187 -0
- package/src/ruby/rbi.ts +313 -0
- package/src/ruby/resources.ts +799 -0
- package/src/ruby/tests.ts +459 -0
- package/src/ruby/type-map.ts +97 -0
- package/src/ruby/wrappers.ts +161 -0
- package/src/shared/model-utils.ts +357 -16
- package/src/shared/naming-utils.ts +83 -0
- package/src/shared/non-spec-services.ts +13 -0
- package/src/shared/resolved-ops.ts +75 -1
- package/src/shared/wrapper-utils.ts +12 -1
- package/test/dotnet/client.test.ts +121 -0
- package/test/dotnet/enums.test.ts +193 -0
- package/test/dotnet/errors.test.ts +9 -0
- package/test/dotnet/manifest.test.ts +82 -0
- package/test/dotnet/models.test.ts +258 -0
- package/test/dotnet/resources.test.ts +387 -0
- package/test/dotnet/tests.test.ts +202 -0
- package/test/entrypoint.test.ts +89 -0
- package/test/go/client.test.ts +6 -6
- package/test/go/resources.test.ts +156 -7
- package/test/kotlin/models.test.ts +135 -0
- package/test/kotlin/resources.test.ts +210 -0
- package/test/kotlin/tests.test.ts +176 -0
- package/test/node/client.test.ts +74 -0
- package/test/node/models.test.ts +134 -1
- package/test/node/resources.test.ts +343 -34
- package/test/node/utils.test.ts +140 -0
- package/test/php/client.test.ts +2 -1
- package/test/php/models.test.ts +5 -4
- package/test/php/resources.test.ts +103 -0
- package/test/php/tests.test.ts +67 -0
- package/test/plugin.test.ts +50 -0
- package/test/python/client.test.ts +56 -0
- package/test/python/models.test.ts +99 -0
- package/test/python/resources.test.ts +294 -0
- package/test/python/tests.test.ts +91 -0
- package/test/ruby/client.test.ts +81 -0
- package/test/ruby/resources.test.ts +386 -0
- package/test/shared/resolved-ops.test.ts +122 -0
- package/tsdown.config.ts +1 -1
- package/dist/index.mjs.map +0 -1
- package/scripts/generate-php.js +0 -13
- package/scripts/git-push-with-published-oagen.sh +0 -21
package/.github/workflows/ci.yml
CHANGED
|
@@ -9,7 +9,7 @@ jobs:
|
|
|
9
9
|
test:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
|
|
13
13
|
|
|
14
14
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
15
15
|
with:
|
|
@@ -9,7 +9,7 @@ jobs:
|
|
|
9
9
|
lint:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
|
|
13
13
|
|
|
14
14
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
15
15
|
with:
|
|
@@ -20,12 +20,12 @@ jobs:
|
|
|
20
20
|
steps:
|
|
21
21
|
- name: Generate token
|
|
22
22
|
id: generate-token
|
|
23
|
-
uses: actions/create-github-app-token@
|
|
23
|
+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # 3.1.1
|
|
24
24
|
with:
|
|
25
25
|
app-id: ${{ vars.SDK_BOT_APP_ID }}
|
|
26
26
|
private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}
|
|
27
27
|
|
|
28
|
-
- uses: googleapis/release-please-action@
|
|
28
|
+
- uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # 4.4.1
|
|
29
29
|
id: release
|
|
30
30
|
with:
|
|
31
31
|
token: ${{ steps.generate-token.outputs.token }}
|
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
steps:
|
|
15
15
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
16
16
|
|
|
17
|
-
- uses: actions/setup-node@
|
|
17
|
+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # 6.3.0
|
|
18
18
|
with:
|
|
19
19
|
node-version-file: .node-version
|
|
20
20
|
registry-url: 'https://registry.npmjs.org'
|
package/.husky/pre-push
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
# Block pushes if package.json has local file: references
|
|
2
|
+
if grep -q '"file:\.\.' package.json 2>/dev/null; then
|
|
3
|
+
echo ""
|
|
4
|
+
echo "ERROR: package.json contains local file: references."
|
|
5
|
+
echo "Run 'npm run dev:unlink' before pushing, or commit with published versions."
|
|
6
|
+
echo ""
|
|
7
|
+
grep '"file:\.\.' package.json
|
|
8
|
+
echo ""
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
|
|
1
12
|
npm run typecheck
|
|
2
13
|
npm test
|
package/.node-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
24.
|
|
1
|
+
24.14.1
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0](https://github.com/workos/oagen-emitters/compare/v0.4.0...v0.5.0) (2026-04-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* multi-language emitter improvements, parameter groups, and JSDoc fixes ([#40](https://github.com/workos/oagen-emitters/issues/40)) ([6d32479](https://github.com/workos/oagen-emitters/commit/6d3247911cbf39c66539a0cda441893fe8ef4748))
|
|
9
|
+
* **python:** add implicit discriminator detection with unknown fallback variant ([#42](https://github.com/workos/oagen-emitters/issues/42)) ([b7fec64](https://github.com/workos/oagen-emitters/commit/b7fec644b906a446bb6d8f98d04f8641131c4d2e))
|
|
10
|
+
|
|
11
|
+
## [0.4.0](https://github.com/workos/oagen-emitters/compare/v0.3.0...v0.4.0) (2026-04-14)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* add dotnet and kotlin emitters with shared generator fixes ([#35](https://github.com/workos/oagen-emitters/issues/35)) ([d84896f](https://github.com/workos/oagen-emitters/commit/d84896f8277f24e7a7800640fca8317e3d5479de))
|
|
17
|
+
|
|
3
18
|
## [0.3.0](https://github.com/workos/oagen-emitters/compare/v0.2.1...v0.3.0) (2026-04-09)
|
|
4
19
|
|
|
5
20
|
|
package/README.md
CHANGED
|
@@ -1,252 +1,63 @@
|
|
|
1
1
|
# oagen-emitters
|
|
2
2
|
|
|
3
|
-
Language emitters for [oagen](../oagen)
|
|
3
|
+
Language emitters, extractors, and smoke runners for [oagen](../oagen). This package is a **plugin library** -- it provides SDK generation capabilities but does not own the consumer config. The canonical generation config lives in the spec-consuming project (e.g. https://github.com/workos/openapi-spec/oagen.config.ts`).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Plugin export
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
| --------------- | ------------- | --------------- | ------------------- |
|
|
9
|
-
| Node/TypeScript | `nodeEmitter` | `nodeExtractor` | `smoke/sdk-node.ts` |
|
|
7
|
+
The primary export for consumers is the `workosEmittersPlugin` bundle:
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
```ts
|
|
10
|
+
import { workosEmittersPlugin } from "@workos/oagen-emitters";
|
|
11
|
+
|
|
12
|
+
const config: OagenConfig = {
|
|
13
|
+
...workosEmittersPlugin,
|
|
14
|
+
// consumer-owned spec policy goes here
|
|
15
|
+
docUrl: "https://workos.com/docs",
|
|
16
|
+
operationHints,
|
|
17
|
+
mountRules,
|
|
18
|
+
};
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The plugin bundle registers all emitters, extractors, and smoke runners provided by this package.
|
|
22
|
+
|
|
23
|
+
## Development
|
|
12
24
|
|
|
13
25
|
```bash
|
|
14
26
|
npm install
|
|
15
27
|
npm test # run emitter unit tests
|
|
16
28
|
npm run typecheck # verify types
|
|
29
|
+
npm run build # build dist/ output
|
|
17
30
|
```
|
|
18
31
|
|
|
19
32
|
### Using a local `oagen` checkout
|
|
20
33
|
|
|
21
|
-
This repo depends on a published `@workos/oagen` by default.
|
|
22
|
-
|
|
23
|
-
If you are actively changing the sibling checkout at `../oagen`, you can switch this repo to a local linked copy:
|
|
24
|
-
|
|
25
34
|
```bash
|
|
26
|
-
npm run oagen:use:local
|
|
35
|
+
npm run oagen:use:local # build and link ../oagen
|
|
36
|
+
npm run oagen:build:local # rebuild ../oagen after changes
|
|
37
|
+
npm run oagen:use:published # switch back to published package
|
|
38
|
+
npm run git:push -- <args> # push with published oagen, then restore local link
|
|
27
39
|
```
|
|
28
40
|
|
|
29
|
-
|
|
41
|
+
## Emitter development
|
|
30
42
|
|
|
31
|
-
|
|
32
|
-
2. links it into this repo with `npm link`
|
|
43
|
+
Each emitter lives in `src/<lang>/` and implements the `Emitter` interface from `@workos/oagen`. Extractors live in `src/compat/extractors/<lang>.ts`. Smoke runners live in `smoke/sdk-<lang>.ts`.
|
|
33
44
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm run oagen:build:local
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
To go back to the published package from npm:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
npm run oagen:use:published
|
|
44
|
-
```
|
|
45
|
+
When building or changing an emitter:
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Example:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npm run git:push -- origin HEAD
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
That command:
|
|
59
|
-
|
|
60
|
-
1. switches to the published `@workos/oagen`
|
|
61
|
-
2. runs `git push ...`
|
|
62
|
-
3. restores the local `../oagen` link on exit, even if the push fails
|
|
63
|
-
|
|
64
|
-
## Workflows
|
|
65
|
-
|
|
66
|
-
### Setting up a new language
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
# 1. Extract the live SDK's public API surface
|
|
70
|
-
npm run sdk:extract:node
|
|
71
|
-
|
|
72
|
-
# 2. Generate and integrate
|
|
73
|
-
npm run sdk:generate:node
|
|
74
|
-
|
|
75
|
-
# 3. Verify
|
|
76
|
-
npm run sdk:verify:node
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Ongoing spec updates
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
# 1. Incremental generation from spec changes
|
|
83
|
-
npm run sdk:diff:node
|
|
84
|
-
|
|
85
|
-
# 2. Verify
|
|
86
|
-
npm run sdk:verify:node
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### After manually editing the live SDK
|
|
90
|
-
|
|
91
|
-
If you rename methods, add exports, or change the live SDK's public API by hand:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
# 1. Re-extract the baseline so the overlay stays in sync
|
|
95
|
-
npm run sdk:extract:node
|
|
96
|
-
|
|
97
|
-
# 2. Regenerate (the overlay will use the updated baseline)
|
|
98
|
-
npm run sdk:generate:node
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Commands
|
|
102
|
-
|
|
103
|
-
All SDK commands are in `package.json` under `scripts`. Replace `node` with the target language for other SDKs.
|
|
104
|
-
|
|
105
|
-
### `npm run sdk:extract:node`
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
oagen extract --lang node --sdk-path ../backend/workos-node --output ./sdk-node-surface.json
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Extracts the live SDK's public API surface (classes, interfaces, type aliases, enums, exports) into `sdk-node-surface.json`. This is **per-language** — each language has its own extractor that understands the language's public surface conventions (TypeScript exports, Ruby public methods, Python `__all__`, etc.).
|
|
112
|
-
|
|
113
|
-
**When to run:** Before the first generation, and whenever the live SDK's public API changes (hand-written additions, renamed methods, new exports).
|
|
114
|
-
|
|
115
|
-
### `npm run sdk:generate:node`
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
oagen generate --lang node --output ./sdk --namespace workos \
|
|
119
|
-
--spec ../openapi-spec/spec/open-api-spec.yaml \
|
|
120
|
-
--api-surface ./sdk-node-surface.json \
|
|
121
|
-
--target ../backend/workos-node
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Full generation from the OpenAPI spec. Produces a standalone SDK at `./sdk/` and integrates new interface, serializer, enum, and fixture files into the live SDK at `--target`.
|
|
125
|
-
|
|
126
|
-
**What gets integrated:** New type definitions (interfaces, serializers, enums, fixtures) that don't already exist in the live SDK. Existing files are never modified.
|
|
127
|
-
|
|
128
|
-
**What stays standalone:** Resource classes, tests, client, barrel exports, error classes, and common utilities remain in `./sdk/` only. The developer wires up resource classes and client accessors manually.
|
|
129
|
-
|
|
130
|
-
**When to run:** First-time setup, or when you want a full regeneration (e.g., after a major spec overhaul).
|
|
131
|
-
|
|
132
|
-
### `npm run sdk:diff:node`
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
oagen diff --old ./sdk/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml \
|
|
136
|
-
--lang node --output ./sdk \
|
|
137
|
-
--target ../backend/workos-node \
|
|
138
|
-
--api-surface ./sdk-node-surface.json
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Incremental generation — compares the previous spec snapshot against the current spec and only regenerates files affected by the changes.
|
|
142
|
-
|
|
143
|
-
**Requires** a prior `sdk:generate:node` run which creates `./sdk/spec-snapshot.yaml`.
|
|
144
|
-
|
|
145
|
-
**When to run:** After the OpenAPI spec is updated (new endpoints, changed models, etc.).
|
|
146
|
-
|
|
147
|
-
### `npm run sdk:verify:node`
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
oagen verify --lang node --output ./sdk \
|
|
151
|
-
--spec ../openapi-spec/spec/open-api-spec.yaml \
|
|
152
|
-
--api-surface ./sdk-node-surface.json
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
Runs compat verification (checks that generated types preserve the live SDK's public API surface) and smoke tests (checks wire-level HTTP behavior).
|
|
156
|
-
|
|
157
|
-
**When to run:** After any generation to verify correctness, or in CI.
|
|
158
|
-
|
|
159
|
-
## SDK Behavior
|
|
160
|
-
|
|
161
|
-
Emitters read runtime policy (retry, errors, telemetry, pagination, etc.) from `ctx.spec.sdk` rather than hardcoding values. The `ApiSpec.sdk` field is always populated with defaults from `defaultSdkBehavior()`.
|
|
162
|
-
|
|
163
|
-
```ts
|
|
164
|
-
function generateHttpClient(ctx: EmitterContext) {
|
|
165
|
-
const sdk = ctx.spec.sdk;
|
|
166
|
-
const retryCodes = sdk.retry.retryableStatusCodes; // [429, 500, 502, 503, 504]
|
|
167
|
-
const timeout = sdk.timeout.defaultTimeoutSeconds; // 60
|
|
168
|
-
}
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Per-language overrides go in the SDK's `oagen.config.ts`:
|
|
172
|
-
|
|
173
|
-
```ts
|
|
174
|
-
// Example: Python SDK overrides
|
|
175
|
-
export default {
|
|
176
|
-
sdkBehavior: {
|
|
177
|
-
retry: { backoff: { initialDelay: 0.5, maxDelay: 8.0 } },
|
|
178
|
-
timeout: {
|
|
179
|
-
defaultTimeoutSeconds: 30,
|
|
180
|
-
timeoutEnvVar: "WORKOS_REQUEST_TIMEOUT",
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
};
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
See `@workos/oagen`'s `src/ir/sdk-behavior.ts` for all interfaces and default values.
|
|
187
|
-
|
|
188
|
-
## Operation Hints
|
|
189
|
-
|
|
190
|
-
`oagen.config.ts` defines `operationHints` and `mountRules` that control how operations are named and organized across all SDKs.
|
|
191
|
-
|
|
192
|
-
### Adding a hint for a new operation
|
|
193
|
-
|
|
194
|
-
When the spec adds a new endpoint and the algorithm-derived name is wrong, add an entry to `operationHints`:
|
|
195
|
-
|
|
196
|
-
```ts
|
|
197
|
-
const operationHints: Record<string, OperationHint> = {
|
|
198
|
-
// Override derived name
|
|
199
|
-
"GET /sso/authorize": { name: "get_authorization_url" },
|
|
200
|
-
|
|
201
|
-
// Remount to a different service
|
|
202
|
-
"GET /organizations/{id}/audit_logs_retention": { mountOn: "AuditLogs" },
|
|
203
|
-
};
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### Adding a union split
|
|
207
|
-
|
|
208
|
-
For endpoints that accept a discriminated union body (multiple request shapes), use `split`:
|
|
209
|
-
|
|
210
|
-
```ts
|
|
211
|
-
'POST /user_management/authenticate': {
|
|
212
|
-
split: [
|
|
213
|
-
{
|
|
214
|
-
name: 'authenticate_with_password',
|
|
215
|
-
targetVariant: 'PasswordSessionAuthenticateRequest',
|
|
216
|
-
defaults: { grant_type: 'password' },
|
|
217
|
-
inferFromClient: ['client_id', 'client_secret'],
|
|
218
|
-
exposedParams: ['email', 'password', 'invitation_token'],
|
|
219
|
-
},
|
|
220
|
-
// ... more variants
|
|
221
|
-
],
|
|
222
|
-
},
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### Mount rules
|
|
226
|
-
|
|
227
|
-
Instead of adding `mountOn` to every operation individually, use `mountRules` for service-level remounting:
|
|
228
|
-
|
|
229
|
-
```ts
|
|
230
|
-
const mountRules: Record<string, string> = {
|
|
231
|
-
Connections: "SSO", // All Connections ops → SSO namespace
|
|
232
|
-
DirectoryGroups: "DirectorySync",
|
|
233
|
-
UserManagementUsers: "UserManagement",
|
|
234
|
-
};
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
### Reviewing operations
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
npx oagen resolve --spec ../openapi-spec/spec/open-api-spec.yaml --format table
|
|
241
|
-
```
|
|
47
|
+
1. Implement or update the emitter code in `src/<lang>/`
|
|
48
|
+
2. Implement or update the extractor in `src/compat/extractors/` if needed
|
|
49
|
+
3. Implement or update the smoke runner in `smoke/` if needed
|
|
50
|
+
4. Export the emitter through `src/plugin.ts` and `src/index.ts`
|
|
51
|
+
5. Run `npm test` and `npm run typecheck`
|
|
52
|
+
6. Switch to the consumer project (e.g. `openapi-spec`) and run the real end-to-end flow
|
|
242
53
|
|
|
243
|
-
|
|
54
|
+
### Adding a new language
|
|
244
55
|
|
|
245
56
|
Use the oagen skills:
|
|
246
57
|
|
|
247
58
|
```bash
|
|
248
|
-
claude --plugin-dir
|
|
59
|
+
claude --plugin-dir node_modules/@workos/oagen
|
|
249
60
|
/oagen:generate-sdk <language>
|
|
250
61
|
```
|
|
251
62
|
|
|
252
|
-
This orchestrates: emitter scaffolding
|
|
63
|
+
This orchestrates: emitter scaffolding, extractor, compat verification, smoke tests, and integration.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { workosEmittersPlugin } from "./plugin.mjs";
|
|
1
2
|
import { Emitter } from "@workos/oagen";
|
|
3
|
+
import { dotnetExtractor, elixirExtractor, goExtractor, kotlinExtractor, nodeExtractor, phpExtractor, pythonExtractor, rubyExtractor, rustExtractor } from "@workos/oagen/compat";
|
|
2
4
|
|
|
3
5
|
//#region src/node/index.d.ts
|
|
4
6
|
declare const nodeEmitter: Emitter;
|
|
@@ -12,5 +14,14 @@ declare const phpEmitter: Emitter;
|
|
|
12
14
|
//#region src/go/index.d.ts
|
|
13
15
|
declare const goEmitter: Emitter;
|
|
14
16
|
//#endregion
|
|
15
|
-
|
|
17
|
+
//#region src/dotnet/index.d.ts
|
|
18
|
+
declare const dotnetEmitter: Emitter;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/kotlin/index.d.ts
|
|
21
|
+
declare const kotlinEmitter: Emitter;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/ruby/index.d.ts
|
|
24
|
+
declare const rubyEmitter: Emitter;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { dotnetEmitter, dotnetExtractor, elixirExtractor, goEmitter, goExtractor, kotlinEmitter, kotlinExtractor, nodeEmitter, nodeExtractor, phpEmitter, phpExtractor, pythonEmitter, pythonExtractor, rubyEmitter, rubyExtractor, rustExtractor, workosEmittersPlugin };
|
|
16
27
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/node/index.ts","../src/python/index.ts","../src/php/index.ts","../src/go/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/node/index.ts","../src/python/index.ts","../src/php/index.ts","../src/go/index.ts","../src/dotnet/index.ts","../src/kotlin/index.ts","../src/ruby/index.ts"],"mappings":";;;;;cAgCa,WAAA,EAAa,OAAA;;;cCOb,aAAA,EAAe,OAAA;;;cCHf,UAAA,EAAY,OAAA;;;cCPZ,SAAA,EAAW,OAAA;;;cCqCX,aAAA,EAAe,OAAA;;;cCnCf,aAAA,EAAe,OAAA;;;cCHf,WAAA,EAAa,OAAA"}
|