@workos/oagen-emitters 0.0.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/.github/workflows/ci.yml +20 -0
- package/.github/workflows/lint-pr-title.yml +16 -0
- package/.github/workflows/lint.yml +21 -0
- package/.github/workflows/release-please.yml +28 -0
- package/.github/workflows/release.yml +32 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/.husky/pre-push +1 -0
- package/.node-version +1 -0
- package/.oxfmtrc.json +10 -0
- package/.oxlintrc.json +29 -0
- package/.vscode/settings.json +11 -0
- package/LICENSE.txt +21 -0
- package/README.md +123 -0
- package/commitlint.config.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2158 -0
- package/docs/endpoint-coverage.md +275 -0
- package/docs/sdk-architecture/node.md +355 -0
- package/oagen.config.ts +51 -0
- package/package.json +83 -0
- package/renovate.json +26 -0
- package/smoke/sdk-dotnet.ts +903 -0
- package/smoke/sdk-elixir.ts +771 -0
- package/smoke/sdk-go.ts +948 -0
- package/smoke/sdk-kotlin.ts +799 -0
- package/smoke/sdk-node.ts +516 -0
- package/smoke/sdk-php.ts +699 -0
- package/smoke/sdk-python.ts +738 -0
- package/smoke/sdk-ruby.ts +723 -0
- package/smoke/sdk-rust.ts +774 -0
- package/src/compat/extractors/dotnet.ts +8 -0
- package/src/compat/extractors/elixir.ts +8 -0
- package/src/compat/extractors/go.ts +8 -0
- package/src/compat/extractors/kotlin.ts +8 -0
- package/src/compat/extractors/node.ts +8 -0
- package/src/compat/extractors/php.ts +8 -0
- package/src/compat/extractors/python.ts +8 -0
- package/src/compat/extractors/ruby.ts +8 -0
- package/src/compat/extractors/rust.ts +8 -0
- package/src/index.ts +1 -0
- package/src/node/client.ts +356 -0
- package/src/node/common.ts +203 -0
- package/src/node/config.ts +70 -0
- package/src/node/enums.ts +87 -0
- package/src/node/errors.ts +205 -0
- package/src/node/fixtures.ts +139 -0
- package/src/node/index.ts +57 -0
- package/src/node/manifest.ts +23 -0
- package/src/node/models.ts +323 -0
- package/src/node/naming.ts +96 -0
- package/src/node/resources.ts +380 -0
- package/src/node/serializers.ts +286 -0
- package/src/node/tests.ts +336 -0
- package/src/node/type-map.ts +56 -0
- package/src/node/utils.ts +164 -0
- package/test/compat/extractors/node.test.ts +145 -0
- package/test/fixtures/sample-sdk-node/package.json +7 -0
- package/test/fixtures/sample-sdk-node/src/client.ts +24 -0
- package/test/fixtures/sample-sdk-node/src/index.ts +4 -0
- package/test/fixtures/sample-sdk-node/src/models.ts +28 -0
- package/test/fixtures/sample-sdk-node/tsconfig.json +13 -0
- package/test/node/client.test.ts +165 -0
- package/test/node/enums.test.ts +128 -0
- package/test/node/errors.test.ts +65 -0
- package/test/node/models.test.ts +301 -0
- package/test/node/naming.test.ts +212 -0
- package/test/node/resources.test.ts +260 -0
- package/test/node/serializers.test.ts +206 -0
- package/test/node/type-map.test.ts +127 -0
- package/tsconfig.json +20 -0
- package/tsup.config.ts +8 -0
- package/vitest.config.ts +4 -0
package/oagen.config.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { OagenConfig } from '@workos/oagen';
|
|
2
|
+
import { toCamelCase } from '@workos/oagen';
|
|
3
|
+
import { nodeEmitter } from './src/node/index.js';
|
|
4
|
+
import { nodeExtractor } from './src/compat/extractors/node.js';
|
|
5
|
+
import { rubyExtractor } from './src/compat/extractors/ruby.js';
|
|
6
|
+
import { pythonExtractor } from './src/compat/extractors/python.js';
|
|
7
|
+
import { phpExtractor } from './src/compat/extractors/php.js';
|
|
8
|
+
import { goExtractor } from './src/compat/extractors/go.js';
|
|
9
|
+
import { rustExtractor } from './src/compat/extractors/rust.js';
|
|
10
|
+
import { kotlinExtractor } from './src/compat/extractors/kotlin.js';
|
|
11
|
+
import { dotnetExtractor } from './src/compat/extractors/dotnet.js';
|
|
12
|
+
import { elixirExtractor } from './src/compat/extractors/elixir.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* NestJS-style operationId transform. Strips "Controller" and extracts the
|
|
16
|
+
* action after the first underscore: `FooController_bar` → `bar`.
|
|
17
|
+
*/
|
|
18
|
+
function nestjsOperationIdTransform(id: string): string {
|
|
19
|
+
const stripped = id.replace(/Controller/g, '');
|
|
20
|
+
const idx = stripped.indexOf('_');
|
|
21
|
+
return idx !== -1 ? toCamelCase(stripped.slice(idx + 1)) : toCamelCase(stripped);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const config: OagenConfig = {
|
|
25
|
+
emitters: [nodeEmitter],
|
|
26
|
+
extractors: [
|
|
27
|
+
nodeExtractor,
|
|
28
|
+
rubyExtractor,
|
|
29
|
+
pythonExtractor,
|
|
30
|
+
phpExtractor,
|
|
31
|
+
goExtractor,
|
|
32
|
+
rustExtractor,
|
|
33
|
+
kotlinExtractor,
|
|
34
|
+
dotnetExtractor,
|
|
35
|
+
elixirExtractor,
|
|
36
|
+
],
|
|
37
|
+
smokeRunners: {
|
|
38
|
+
node: './smoke/sdk-node.ts',
|
|
39
|
+
ruby: './smoke/sdk-ruby.ts',
|
|
40
|
+
python: './smoke/sdk-python.ts',
|
|
41
|
+
php: './smoke/sdk-php.ts',
|
|
42
|
+
go: './smoke/sdk-go.ts',
|
|
43
|
+
rust: './smoke/sdk-rust.ts',
|
|
44
|
+
elixir: './smoke/sdk-elixir.ts',
|
|
45
|
+
kotlin: './smoke/sdk-kotlin.ts',
|
|
46
|
+
dotnet: './smoke/sdk-dotnet.ts',
|
|
47
|
+
},
|
|
48
|
+
docUrl: 'https://workos.com/docs',
|
|
49
|
+
operationIdTransform: nestjsOperationIdTransform,
|
|
50
|
+
};
|
|
51
|
+
export default config;
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@workos/oagen-emitters",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "WorkOS' oagen emitters",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "WorkOS",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup",
|
|
18
|
+
"lint": "oxlint",
|
|
19
|
+
"lint:fix": "oxlint --fix",
|
|
20
|
+
"format": "oxfmt --check .",
|
|
21
|
+
"format:fix": "oxfmt --write .",
|
|
22
|
+
"format:md": "prettier --write '**/*.md'",
|
|
23
|
+
"lint:all": "oxlint --fix && oxfmt --write . && prettier --write '**/*.md'",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"prepare": "husky",
|
|
28
|
+
"sdk:generate:dotnet": "oagen generate --lang dotnet --output ./sdk-dotnet --namespace workos --api-surface ./sdk-dotnet-surface.json",
|
|
29
|
+
"sdk:diff:dotnet": "oagen diff --old ./sdk-dotnet/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml --lang dotnet --output ./sdk-dotnet --api-surface ./sdk-dotnet-surface.json",
|
|
30
|
+
"sdk:verify:dotnet": "oagen verify --lang dotnet --output ./sdk-dotnet --api-surface ./sdk-dotnet-surface.json",
|
|
31
|
+
"sdk:extract:dotnet": "oagen extract --lang dotnet --sdk-path ../backend/workos-dotnet --output ./sdk-dotnet-surface.json",
|
|
32
|
+
"sdk:generate:elixir": "oagen generate --lang elixir --output ./sdk-elixir --namespace workos --api-surface ./sdk-elixir-surface.json",
|
|
33
|
+
"sdk:diff:elixir": "oagen diff --old ./sdk-elixir/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml --lang elixir --output ./sdk-elixir --api-surface ./sdk-elixir-surface.json",
|
|
34
|
+
"sdk:verify:elixir": "oagen verify --lang elixir --output ./sdk-elixir --api-surface ./sdk-elixir-surface.json",
|
|
35
|
+
"sdk:extract:elixir": "oagen extract --lang elixir --sdk-path ../backend/workos-elixir --output ./sdk-elixir-surface.json",
|
|
36
|
+
"sdk:generate:go": "oagen generate --lang go --output ./sdk-go --namespace workos --api-surface ./sdk-go-surface.json",
|
|
37
|
+
"sdk:diff:go": "oagen diff --old ./sdk-go/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml --lang go --output ./sdk-go --api-surface ./sdk-go-surface.json",
|
|
38
|
+
"sdk:verify:go": "oagen verify --lang go --output ./sdk-go --api-surface ./sdk-go-surface.json",
|
|
39
|
+
"sdk:extract:go": "oagen extract --lang go --sdk-path ../backend/workos-go --output ./sdk-go-surface.json",
|
|
40
|
+
"sdk:generate:kotlin": "oagen generate --lang kotlin --output ./sdk-kotlin --namespace workos --api-surface ./sdk-kotlin-surface.json",
|
|
41
|
+
"sdk:diff:kotlin": "oagen diff --old ./sdk-kotlin/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml --lang kotlin --output ./sdk-kotlin --api-surface ./sdk-kotlin-surface.json",
|
|
42
|
+
"sdk:verify:kotlin": "oagen verify --lang kotlin --output ./sdk-kotlin --api-surface ./sdk-kotlin-surface.json",
|
|
43
|
+
"sdk:extract:kotlin": "oagen extract --lang kotlin --sdk-path ../backend/workos-kotlin --output ./sdk-kotlin-surface.json",
|
|
44
|
+
"sdk:generate:node": "oagen generate --lang node --output ./sdk-node --namespace workos --api-surface ./sdk-node-surface.json",
|
|
45
|
+
"sdk:diff:node": "oagen diff --old ./sdk-node/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml --lang node --output ./sdk-node --api-surface ./sdk-node-surface.json",
|
|
46
|
+
"sdk:verify:node": "oagen verify --lang node --output ./sdk-node --api-surface ./sdk-node-surface.json",
|
|
47
|
+
"sdk:extract:node": "oagen extract --lang node --sdk-path ../backend/workos-node --output ./sdk-node-surface.json",
|
|
48
|
+
"sdk:generate:php": "oagen generate --lang php --output ./sdk-php --namespace workos --api-surface ./sdk-php-surface.json",
|
|
49
|
+
"sdk:diff:php": "oagen diff --old ./sdk-php/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml --lang php --output ./sdk-php --api-surface ./sdk-php-surface.json",
|
|
50
|
+
"sdk:verify:php": "oagen verify --lang php --output ./sdk-php --api-surface ./sdk-php-surface.json",
|
|
51
|
+
"sdk:extract:php": "oagen extract --lang php --sdk-path ../backend/workos-php --output ./sdk-php-surface.json",
|
|
52
|
+
"sdk:generate:python": "oagen generate --lang python --output ./sdk-python --namespace workos --api-surface ./sdk-python-surface.json",
|
|
53
|
+
"sdk:diff:python": "oagen diff --old ./sdk-python/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml --lang python --output ./sdk-python --api-surface ./sdk-python-surface.json",
|
|
54
|
+
"sdk:verify:python": "oagen verify --lang python --output ./sdk-python --api-surface ./sdk-python-surface.json",
|
|
55
|
+
"sdk:extract:python": "oagen extract --lang python --sdk-path ../backend/workos-python --output ./sdk-python-surface.json",
|
|
56
|
+
"sdk:generate:ruby": "oagen generate --lang ruby --output ./sdk-ruby --namespace workos --api-surface ./sdk-ruby-surface.json",
|
|
57
|
+
"sdk:diff:ruby": "oagen diff --old ./sdk-ruby/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml --lang ruby --output ./sdk-ruby --api-surface ./sdk-ruby-surface.json",
|
|
58
|
+
"sdk:verify:ruby": "oagen verify --lang ruby --output ./sdk-ruby --api-surface ./sdk-ruby-surface.json",
|
|
59
|
+
"sdk:extract:ruby": "oagen extract --lang ruby --sdk-path ../backend/workos-ruby --output ./sdk-ruby-surface.json",
|
|
60
|
+
"sdk:generate:rust": "oagen generate --lang rust --output ./sdk-rust --namespace workos --api-surface ./sdk-rust-surface.json",
|
|
61
|
+
"sdk:diff:rust": "oagen diff --old ./sdk-rust/spec-snapshot.yaml --new ../openapi-spec/spec/open-api-spec.yaml --lang rust --output ./sdk-rust --api-surface ./sdk-rust-surface.json",
|
|
62
|
+
"sdk:verify:rust": "oagen verify --lang rust --output ./sdk-rust --api-surface ./sdk-rust-surface.json",
|
|
63
|
+
"sdk:extract:rust": "oagen extract --lang rust --sdk-path ../backend/workos-rust --output ./sdk-rust-surface.json"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@workos/oagen": "^0.0.1"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@commitlint/cli": "^20.5.0",
|
|
70
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
71
|
+
"@types/node": "^25.3.3",
|
|
72
|
+
"husky": "^9.1.7",
|
|
73
|
+
"oxfmt": "^0.36.0",
|
|
74
|
+
"oxlint": "^1.51.0",
|
|
75
|
+
"prettier": "^3.8.1",
|
|
76
|
+
"tsup": "^8.4.0",
|
|
77
|
+
"tsx": "^4.19.0",
|
|
78
|
+
"vitest": "^3.0.0"
|
|
79
|
+
},
|
|
80
|
+
"engines": {
|
|
81
|
+
"node": ">=24.10.0"
|
|
82
|
+
}
|
|
83
|
+
}
|
package/renovate.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["config:recommended"],
|
|
3
|
+
"dependencyDashboard": false,
|
|
4
|
+
"schedule": ["on the 15th day of the month before 12pm"],
|
|
5
|
+
"timezone": "UTC",
|
|
6
|
+
"rebaseWhen": "conflicted",
|
|
7
|
+
"packageRules": [
|
|
8
|
+
{
|
|
9
|
+
"matchManagers": ["github-actions"],
|
|
10
|
+
"extractVersion": "^v(?<version>\\d+\\.\\d+\\.\\d+)$"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"matchUpdateTypes": ["minor", "patch"],
|
|
14
|
+
"automerge": true,
|
|
15
|
+
"groupName": "minor and patch updates"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"matchUpdateTypes": ["major"],
|
|
19
|
+
"automerge": false
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"matchUpdateTypes": ["digest"],
|
|
23
|
+
"automerge": false
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|