@workos/openapi-spec 0.6.0 → 0.7.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/README.md CHANGED
@@ -74,6 +74,35 @@ npm run sdk:compat-summary -- --report .oagen/python/compat-report.json --report
74
74
  npm run sdk:compat-summary -- --report .oagen/python/compat-report.json --output summary.md
75
75
  ```
76
76
 
77
+ ### SDK changelog metadata
78
+
79
+ The SDK PR workflow writes `.changelog-pending/*.md` fragments from deterministic release entries generated by [`scripts/sdk-release-metadata.mjs`](scripts/sdk-release-metadata.mjs). Entries answer three questions: where the change occurred (`scope`), how severe it is (`feat!`, `feat`, or `fix`), and what changed. Known scopes also include `docs_url`, which the changelog renderer uses to link scope names to WorkOS API reference pages.
80
+
81
+ Each entry includes `scope_sources` and `scope_candidates` so the chosen scope can be audited. Model and enum scope resolution uses parsed IR references when no explicit symbol taxonomy matches; if the symbol taxonomy and IR references disagree, the script emits a warning with both values. Automated runs pass `--strict-scopes`, which fails the workflow if a user-facing entry resolves to the fallback `sdk` scope or lacks `docs_url` metadata.
82
+
83
+ In automation, `.github/workflows/generate-prs.yml` provides the structured `oagen diff`, parsed old/new IR, compat report, and changed SDK files. The script outputs JSON entries; the workflow creates the PR and adds the PR link/number when writing the changelog fragment.
84
+
85
+ For manual repair of existing fragments, pass the `openapi-spec` workflow commit that triggered the SDK PR. The script uses the spec state at that commit and diffs it against the previous spec-changing commit.
86
+
87
+ ```bash
88
+ # JSON entries, useful for inspection
89
+ node scripts/sdk-release-metadata.mjs \
90
+ --spec-commit dee95fc \
91
+ --sdk-repo ../backend/workos-dotnet
92
+
93
+ # Full markdown fragment for replacing an existing .changelog-pending file
94
+ node scripts/sdk-release-metadata.mjs \
95
+ --spec-commit dee95fc \
96
+ --sdk-repo ../backend/workos-dotnet \
97
+ --format changelog \
98
+ --pr-number 263 \
99
+ --pr-url https://github.com/workos/workos-dotnet/pull/263
100
+ ```
101
+
102
+ `--pr-number` and `--pr-url` only affect manual `--format changelog` output: they render the first fragment line with a PR link. Automated runs do not pass them because the workflow already gets the PR URL from `gh pr create`.
103
+
104
+ Run `node scripts/sdk-release-metadata.mjs --help` for all options.
105
+
77
106
  ### Local development
78
107
 
79
108
  Install dependencies:
package/dist/policy.mjs CHANGED
@@ -7,6 +7,7 @@ import { toCamelCase } from "@workos/oagen";
7
7
  const operationHints = {
8
8
  "POST /radar/lists/{type}/{action}": { name: "add_list_entry" },
9
9
  "DELETE /radar/lists/{type}/{action}": { name: "remove_list_entry" },
10
+ "POST /data-integrations/{provider}/token": { name: "get_access_token" },
10
11
  "GET /sso/authorize": {
11
12
  name: "get_authorization_url",
12
13
  defaults: { response_type: "code" },
@@ -379,6 +380,26 @@ function transformSpec(spec) {
379
380
  }
380
381
  delete schemas["UserlandUserOrganizationMembershipBaseWithUser"];
381
382
  delete schemas["UserlandUserOrganizationMembershipBaseWithUserList"];
383
+ const tokenResponse = schemas["DataIntegrationAccessTokenResponse"];
384
+ for (const variant of tokenResponse?.oneOf ?? []) {
385
+ const expiresAt = variant.properties?.access_token?.properties?.expires_at;
386
+ if (expiresAt && expiresAt.format === void 0) expiresAt.format = "date-time";
387
+ const errorEnum = variant.properties?.error?.enum;
388
+ if (Array.isArray(errorEnum) && errorEnum.length === 2 && errorEnum[0] === "needs_reauthorization" && errorEnum[1] === "not_installed") errorEnum.reverse();
389
+ }
390
+ const slugTokenPath = "/data-integrations/{slug}/token";
391
+ const providerTokenPath = "/data-integrations/{provider}/token";
392
+ const tokenPathItem = paths[slugTokenPath];
393
+ if (tokenPathItem && !paths[providerTokenPath]) {
394
+ for (const [key, member] of Object.entries(tokenPathItem)) {
395
+ const params = key === "parameters" ? member : member?.parameters;
396
+ for (const param of params ?? []) if (param.in === "path" && param.name === "slug") param.name = "provider";
397
+ }
398
+ paths[providerTokenPath] = tokenPathItem;
399
+ delete paths[slugTokenPath];
400
+ }
401
+ const orgIdProp = (paths[providerTokenPath]?.post?.requestBody?.content?.["application/json"]?.schema)?.properties?.organization_id;
402
+ if (orgIdProp && orgIdProp.type === "string") orgIdProp.type = ["string", "null"];
382
403
  if (schemas["JwtTemplate"] && !schemas["JwtTemplateResponse"]) {
383
404
  schemas["JwtTemplateResponse"] = schemas["JwtTemplate"];
384
405
  delete schemas["JwtTemplate"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workos/openapi-spec",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "description": "WorkOS OpenAPI specification, TypeScript types, and SDK resolution policy",
6
6
  "license": "MIT",
@@ -26,7 +26,7 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@workos/oagen": "^0.22.4"
29
+ "@workos/oagen": "^0.22.6"
30
30
  },
31
31
  "scripts": {
32
32
  "build:policy": "tsdown",
@@ -54,13 +54,13 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/js-yaml": "^4.0.9",
57
- "@types/node": "^25.9.1",
58
- "@workos/oagen-emitters": "^0.16.0",
57
+ "@types/node": "^25.9.3",
58
+ "@workos/oagen-emitters": "^0.18.1",
59
59
  "diff2html": "^3.4.56",
60
60
  "husky": "^9.1.7",
61
61
  "js-yaml": "^4.2.0",
62
- "openapi-to-postmanv2": "^6.0.1",
63
- "tsdown": "^0.22.1",
62
+ "openapi-to-postmanv2": "^6.1.0",
63
+ "tsdown": "^0.22.3",
64
64
  "tsx": "^4.22.4",
65
65
  "typescript": "^6.0.3"
66
66
  }