Skip to content

Commit 674d148

Browse files
authored
Add dsync intent for admin portal (#334)
* Add dsync intent for admin portal * Fix yarn error * Fix case for dsync intent * Fix case in test
1 parent 9809fd2 commit 674d148

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.9.3",
2+
"version": "0.9.4",
33
"name": "@workos-inc/node",
44
"author": "WorkOS",
55
"description": "A Node wrapper for the WorkOS API",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export enum GeneratePortalLinkIntent {
22
SSO = 'sso',
3+
DSync = 'dsync',
34
}

src/portal/portal.spec.ts

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,36 @@ describe('Portal', () => {
5454

5555
describe('generateLink', () => {
5656
describe('with a valid organization', () => {
57-
it('returns an Admin Portal link', async () => {
58-
mock.onPost().reply(201, generateLink);
57+
describe('with the sso intent', () => {
58+
it('returns an Admin Portal link', async () => {
59+
mock.onPost().reply(201, generateLink);
5960

60-
const subject = await workos.portal.generateLink({
61-
intent: GeneratePortalLinkIntent.SSO,
62-
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
63-
returnUrl: 'https://www.example.com',
61+
const subject = await workos.portal.generateLink({
62+
intent: GeneratePortalLinkIntent.SSO,
63+
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
64+
returnUrl: 'https://www.example.com',
65+
});
66+
67+
expect(subject.link).toEqual(
68+
'https://id.workos.com/portal/launch?secret=secret',
69+
);
6470
});
71+
});
6572

66-
expect(subject.link).toEqual(
67-
'https://id.workos.com/portal/launch?secret=secret',
68-
);
73+
describe('with the dsync intent', () => {
74+
it('returns an Admin Portal link', async () => {
75+
mock.onPost().reply(201, generateLink);
76+
77+
const subject = await workos.portal.generateLink({
78+
intent: GeneratePortalLinkIntent.DSync,
79+
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
80+
returnUrl: 'https://www.example.com',
81+
});
82+
83+
expect(subject.link).toEqual(
84+
'https://id.workos.com/portal/launch?secret=secret',
85+
);
86+
});
6987
});
7088
});
7189

src/sso/__snapshots__/sso.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Object {
1919
"Accept": "application/json, text/plain, */*",
2020
"Authorization": "Bearer sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU",
2121
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
22-
"User-Agent": "workos-node/0.9.3",
22+
"User-Agent": "workos-node/0.9.4",
2323
}
2424
`;
2525

@@ -47,7 +47,7 @@ Object {
4747
"Accept": "application/json, text/plain, */*",
4848
"Authorization": "Bearer sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU",
4949
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
50-
"User-Agent": "workos-node/0.9.3",
50+
"User-Agent": "workos-node/0.9.4",
5151
}
5252
`;
5353

0 commit comments

Comments
 (0)