@workos/openapi-spec 0.44.0 → 0.45.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/dist/open-api-spec.yaml +14 -0
- package/dist/policy.mjs +75 -1
- package/dist/types.d.ts +12 -0
- package/package.json +7 -9
package/dist/open-api-spec.yaml
CHANGED
|
@@ -13838,6 +13838,20 @@ paths:
|
|
|
13838
13838
|
required:
|
|
13839
13839
|
- code
|
|
13840
13840
|
- message
|
|
13841
|
+
- type: object
|
|
13842
|
+
properties:
|
|
13843
|
+
code:
|
|
13844
|
+
type: string
|
|
13845
|
+
description: The error code identifying the type of error.
|
|
13846
|
+
example: organization_blocked_from_sending_invites
|
|
13847
|
+
const: organization_blocked_from_sending_invites
|
|
13848
|
+
message:
|
|
13849
|
+
type: string
|
|
13850
|
+
description: A human-readable description of the error.
|
|
13851
|
+
example: Request could not be processed.
|
|
13852
|
+
required:
|
|
13853
|
+
- code
|
|
13854
|
+
- message
|
|
13841
13855
|
'404':
|
|
13842
13856
|
description: Not Found
|
|
13843
13857
|
content:
|
package/dist/policy.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { toCamelCase } from "@workos/oagen";
|
|
2
1
|
//#region src/policy/operation-hints.ts
|
|
3
2
|
/**
|
|
4
3
|
* Per-operation overrides for the operation resolver. Keyed by `"METHOD /path"`.
|
|
@@ -368,6 +367,81 @@ const modelHints = {
|
|
|
368
367
|
UserApiKeyOwner: "UserManagementUsers"
|
|
369
368
|
};
|
|
370
369
|
//#endregion
|
|
370
|
+
//#region src/policy/naming.ts
|
|
371
|
+
/**
|
|
372
|
+
* Naming utilities inlined from `@workos/oagen` (`src/utils/naming.ts`), same
|
|
373
|
+
* as the types in `./types.ts`: the published `dist/policy.mjs` must have zero
|
|
374
|
+
* runtime imports from `@workos/oagen`, because a runtime dependency on oagen
|
|
375
|
+
* drags its native tree-sitter toolchain into every consumer's install (see
|
|
376
|
+
* workos/cli#202). Keep in sync with the upstream definitions.
|
|
377
|
+
*/
|
|
378
|
+
/**
|
|
379
|
+
* Known compound tokens that the regex-based splitter over-splits.
|
|
380
|
+
* Each entry is [lowercase-word-sequence, canonical-form].
|
|
381
|
+
* Sorted longest-first so greedy matching works correctly.
|
|
382
|
+
*/
|
|
383
|
+
const COMPOUND_WORDS = [[[
|
|
384
|
+
"m",
|
|
385
|
+
"2",
|
|
386
|
+
"m"
|
|
387
|
+
], "M2M"], [["o", "auth"], "OAuth"]];
|
|
388
|
+
/**
|
|
389
|
+
* Recombine adjacent words that form a known compound token.
|
|
390
|
+
*/
|
|
391
|
+
function recombineCompounds(words) {
|
|
392
|
+
const result = [];
|
|
393
|
+
let i = 0;
|
|
394
|
+
while (i < words.length) {
|
|
395
|
+
let matched = false;
|
|
396
|
+
for (const [pattern, canonical] of COMPOUND_WORDS) if (i + pattern.length <= words.length) {
|
|
397
|
+
if (pattern.every((p, j) => words[i + j].toLowerCase() === p)) {
|
|
398
|
+
result.push(canonical);
|
|
399
|
+
i += pattern.length;
|
|
400
|
+
matched = true;
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
if (!matched) {
|
|
405
|
+
result.push(words[i]);
|
|
406
|
+
i++;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return result;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Split a string into words, handling:
|
|
413
|
+
* - camelCase / PascalCase boundaries
|
|
414
|
+
* - snake_case / kebab-case separators
|
|
415
|
+
* - Consecutive capitals (e.g., "HTTPClient" → ["HTTP", "Client"])
|
|
416
|
+
* - Numbers as word boundaries (e.g., "OAuth2Token" → ["OAuth", "2", "Token"])
|
|
417
|
+
* - Known compounds are recombined (e.g., "M2M" stays as one word)
|
|
418
|
+
*/
|
|
419
|
+
function splitWords(s) {
|
|
420
|
+
if (!s) return [];
|
|
421
|
+
return recombineCompounds(s.replace(/[^a-zA-Z0-9_\-\s.]/g, "_").replace(/([a-z])([A-Z])/g, "$1\0$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1\0$2").replace(/([a-zA-Z])(\d)/g, "$1\0$2").replace(/(\d)([a-zA-Z])/g, "$1\0$2").split(/[\0_\-\s.]+/).filter((w) => w.length > 0));
|
|
422
|
+
}
|
|
423
|
+
const ACRONYM_SET = /* @__PURE__ */ new Set([
|
|
424
|
+
"SSO",
|
|
425
|
+
"FGA",
|
|
426
|
+
"SAML",
|
|
427
|
+
"SCIM",
|
|
428
|
+
"JWT",
|
|
429
|
+
"HMAC",
|
|
430
|
+
"M2M"
|
|
431
|
+
]);
|
|
432
|
+
function toCamelCase(s, acronyms) {
|
|
433
|
+
const merged = acronyms ? /* @__PURE__ */ new Set([...ACRONYM_SET, ...acronyms]) : ACRONYM_SET;
|
|
434
|
+
const words = splitWords(s);
|
|
435
|
+
if (words.length === 0) return "";
|
|
436
|
+
return words.map((w, i) => {
|
|
437
|
+
if (i === 0) return w.toLowerCase();
|
|
438
|
+
const upper = w.toUpperCase();
|
|
439
|
+
if (merged.has(upper)) return upper;
|
|
440
|
+
if (upper === "OAUTH") return "OAuth";
|
|
441
|
+
return w.charAt(0).toUpperCase() + w.slice(1).toLowerCase();
|
|
442
|
+
}).join("");
|
|
443
|
+
}
|
|
444
|
+
//#endregion
|
|
371
445
|
//#region src/policy/transforms.ts
|
|
372
446
|
/**
|
|
373
447
|
* NestJS-style operationId transform. Strips "Controller" and extracts the
|
package/dist/types.d.ts
CHANGED
|
@@ -29090,6 +29090,18 @@ export interface operations {
|
|
|
29090
29090
|
* @example Request could not be processed.
|
|
29091
29091
|
*/
|
|
29092
29092
|
message: string;
|
|
29093
|
+
} | {
|
|
29094
|
+
/**
|
|
29095
|
+
* @description The error code identifying the type of error.
|
|
29096
|
+
* @example organization_blocked_from_sending_invites
|
|
29097
|
+
* @constant
|
|
29098
|
+
*/
|
|
29099
|
+
code: "organization_blocked_from_sending_invites";
|
|
29100
|
+
/**
|
|
29101
|
+
* @description A human-readable description of the error.
|
|
29102
|
+
* @example Request could not be processed.
|
|
29103
|
+
*/
|
|
29104
|
+
message: string;
|
|
29093
29105
|
};
|
|
29094
29106
|
};
|
|
29095
29107
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workos/openapi-spec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "WorkOS OpenAPI specification, TypeScript types, and SDK resolution policy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,9 +29,6 @@
|
|
|
29
29
|
"./operation-overrides/node": "./dist/operationOverrides.node.json",
|
|
30
30
|
"./package.json": "./package.json"
|
|
31
31
|
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@workos/oagen": "^0.26.1"
|
|
34
|
-
},
|
|
35
32
|
"scripts": {
|
|
36
33
|
"generate:services": "node scripts/generate-services.mjs",
|
|
37
34
|
"build:policy": "npm run generate:services && tsdown",
|
|
@@ -61,13 +58,14 @@
|
|
|
61
58
|
"devDependencies": {
|
|
62
59
|
"@types/js-yaml": "^4.0.9",
|
|
63
60
|
"@types/node": "^26.1.1",
|
|
64
|
-
"@workos/oagen
|
|
61
|
+
"@workos/oagen": "^0.27.0",
|
|
62
|
+
"@workos/oagen-emitters": "^0.21.0",
|
|
65
63
|
"diff2html": "^3.4.56",
|
|
66
64
|
"husky": "^9.1.7",
|
|
67
65
|
"js-yaml": "^4.1.1",
|
|
68
|
-
"openapi-to-postmanv2": "^6.
|
|
69
|
-
"tsdown": "^0.22.
|
|
70
|
-
"tsx": "^4.23.
|
|
71
|
-
"typescript": "^
|
|
66
|
+
"openapi-to-postmanv2": "^6.3.1",
|
|
67
|
+
"tsdown": "^0.22.13",
|
|
68
|
+
"tsx": "^4.23.1",
|
|
69
|
+
"typescript": "^7.0.2"
|
|
72
70
|
}
|
|
73
71
|
}
|