Skip to content

Commit c702c88

Browse files
authored
Add organizationId to organization domain (#1259)
## Description Add `organizationId` to the response as indicated in work-os-playground-domain-verification-v4hbbh ## Documentation Does this require changes to the WorkOS Docs? E.g. the [API Reference](https://workos.com/docs/reference) or code snippets need updates. ``` [ ] Yes ``` If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.
1 parent d15fe7e commit c702c88

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

src/organization-domains/fixtures/get-organization-domain-pending.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"object": "organization_domain",
33
"id": "org_domain_01HD50K7EPWCMNPGMKXKKE14XT",
4+
"organization_id": "org_01JR8C1EHCRPV4B4XP4W2B9X1M",
45
"domain": "workos.com",
56
"state": "pending",
67
"verification_token": "F06PGMsZIO0shrveGWuGxgCj7",

src/organization-domains/fixtures/get-organization-domain-verified.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"object": "organization_domain",
33
"id": "org_domain_01HCZRAP3TPQ0X0DKJHR32TATG",
4+
"organization_id": "org_01JR8C1EHCRPV4B4XP4W2B9X1M",
45
"domain": "workos.com",
56
"state": "verified",
67
"verification_token": null,

src/organization-domains/interfaces/organization-domain.interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface OrganizationDomain {
1717
object: 'organization_domain';
1818
id: string;
1919
domain: string;
20+
organizationId: string;
2021
state: OrganizationDomainState;
2122
verificationToken?: string;
2223
verificationStrategy: OrganizationDomainVerificationStrategy;
@@ -26,6 +27,7 @@ export interface OrganizationDomainResponse {
2627
object: 'organization_domain';
2728
id: string;
2829
domain: string;
30+
organization_id: string;
2931
state: OrganizationDomainState;
3032
verification_token?: string;
3133
verification_strategy: OrganizationDomainVerificationStrategy;

src/organization-domains/organization-domains.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ describe('OrganizationDomains', () => {
2323
);
2424
expect(subject.id).toEqual('org_domain_01HCZRAP3TPQ0X0DKJHR32TATG');
2525
expect(subject.domain).toEqual('workos.com');
26+
expect(subject.organizationId).toEqual('org_01JR8C1EHCRPV4B4XP4W2B9X1M');
2627
expect(subject.state).toEqual(OrganizationDomainState.Verified);
2728
expect(subject.verificationToken).toBeNull();
2829
expect(subject.verificationStrategy).toEqual('manual');
@@ -40,6 +41,7 @@ describe('OrganizationDomains', () => {
4041
);
4142
expect(subject.id).toEqual('org_domain_01HD50K7EPWCMNPGMKXKKE14XT');
4243
expect(subject.domain).toEqual('workos.com');
44+
expect(subject.organizationId).toEqual('org_01JR8C1EHCRPV4B4XP4W2B9X1M');
4345
expect(subject.state).toEqual(OrganizationDomainState.Pending);
4446
expect(subject.verificationToken).toEqual('F06PGMsZIO0shrveGWuGxgCj7');
4547
expect(subject.verificationStrategy).toEqual('dns');
@@ -59,6 +61,7 @@ describe('OrganizationDomains', () => {
5961
);
6062
expect(subject.id).toEqual('org_domain_01HD50K7EPWCMNPGMKXKKE14XT');
6163
expect(subject.domain).toEqual('workos.com');
64+
expect(subject.organizationId).toEqual('org_01JR8C1EHCRPV4B4XP4W2B9X1M');
6265
expect(subject.state).toEqual(OrganizationDomainState.Pending);
6366
expect(subject.verificationToken).toEqual('F06PGMsZIO0shrveGWuGxgCj7');
6467
expect(subject.verificationStrategy).toEqual('dns');
@@ -82,6 +85,7 @@ describe('OrganizationDomains', () => {
8285

8386
expect(subject.id).toEqual('org_domain_01HD50K7EPWCMNPGMKXKKE14XT');
8487
expect(subject.domain).toEqual('workos.com');
88+
expect(subject.organizationId).toEqual('org_01JR8C1EHCRPV4B4XP4W2B9X1M');
8589
expect(subject.state).toEqual(OrganizationDomainState.Pending);
8690
expect(subject.verificationToken).toEqual('F06PGMsZIO0shrveGWuGxgCj7');
8791
expect(subject.verificationStrategy).toEqual('dns');

src/organization-domains/serializers/organization-domain.serializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const deserializeOrganizationDomain = (
66
object: organizationDomain.object,
77
id: organizationDomain.id,
88
domain: organizationDomain.domain,
9+
organizationId: organizationDomain.organization_id,
910
state: organizationDomain.state,
1011
verificationToken: organizationDomain.verification_token,
1112
verificationStrategy: organizationDomain.verification_strategy,

0 commit comments

Comments
 (0)