@workos/openapi-spec 0.5.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 +29 -0
- package/dist/open-api-spec.yaml +442 -162
- package/dist/policy.mjs +21 -0
- package/dist/types.d.ts +401 -127
- package/package.json +6 -6
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"];
|