@workos/openapi-spec 0.12.0 → 0.13.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.
Files changed (2) hide show
  1. package/dist/policy.mjs +15 -0
  2. package/package.json +1 -1
package/dist/policy.mjs CHANGED
@@ -414,6 +414,21 @@ function transformSpec(spec) {
414
414
  }
415
415
  }
416
416
  }
417
+ if (schemas["OrganizationDomainStandAlone"] && !schemas["OrganizationDomain"]) {
418
+ schemas["OrganizationDomain"] = schemas["OrganizationDomainStandAlone"];
419
+ delete schemas["OrganizationDomainStandAlone"];
420
+ const oldRef = "#/components/schemas/OrganizationDomainStandAlone";
421
+ const newRef = "#/components/schemas/OrganizationDomain";
422
+ for (const pathItem of Object.values(paths)) for (const op of Object.values(pathItem)) {
423
+ const responses = op.responses;
424
+ for (const response of Object.values(responses ?? {})) {
425
+ const schema = response.content?.["application/json"]?.schema;
426
+ if (schema?.$ref === oldRef) schema.$ref = newRef;
427
+ }
428
+ }
429
+ const createJson = paths["/organization_domains"]?.post?.responses?.["201"]?.content?.["application/json"];
430
+ if (createJson && !createJson.schema?.$ref) createJson.schema = { $ref: newRef };
431
+ }
417
432
  if (schemas["ListMetadata"]) {
418
433
  const groupRoleList = schemas["GroupRoleAssignmentList"];
419
434
  const listMetadata = groupRoleList?.properties?.list_metadata;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workos/openapi-spec",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "description": "WorkOS OpenAPI specification, TypeScript types, and SDK resolution policy",
6
6
  "license": "MIT",