@workos-inc/node 2.20.0 → 3.0.0-alpha.2
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/lib/audit-logs/audit-logs.js +5 -4
- package/lib/audit-logs/audit-logs.spec.js +87 -87
- package/lib/audit-logs/interfaces/audit-log-export-options.interface.d.ts +13 -3
- package/lib/audit-logs/interfaces/audit-log-export.interface.d.ts +8 -0
- package/lib/audit-logs/interfaces/create-audit-log-event-options.interface.d.ts +13 -1
- package/lib/audit-logs/serializers/audit-log-export-options.serializer.d.ts +2 -0
- package/lib/audit-logs/serializers/audit-log-export-options.serializer.js +14 -0
- package/lib/audit-logs/serializers/audit-log-export.serializer.d.ts +2 -0
- package/lib/audit-logs/serializers/audit-log-export.serializer.js +12 -0
- package/lib/audit-logs/serializers/create-audit-log-event-options.serializer.d.ts +2 -0
- package/lib/audit-logs/serializers/create-audit-log-event-options.serializer.js +16 -0
- package/lib/audit-logs/serializers/index.d.ts +3 -0
- package/lib/audit-logs/serializers/index.js +19 -0
- package/lib/audit-trail/audit-trail.spec.js +2 -1
- package/lib/common/interfaces/index.d.ts +2 -0
- package/lib/common/interfaces/index.js +2 -0
- package/lib/common/interfaces/list.interface.d.ts +8 -0
- package/lib/common/interfaces/workos-response-error.interface.d.ts +8 -0
- package/lib/common/serializers/index.d.ts +1 -0
- package/lib/common/serializers/index.js +17 -0
- package/lib/common/serializers/list.serializer.d.ts +2 -0
- package/lib/common/serializers/list.serializer.js +9 -0
- package/lib/common/utils/workos-mock-response.d.ts +7 -0
- package/lib/common/utils/workos-mock-response.js +11 -0
- package/lib/directory-sync/directory-sync.d.ts +7 -12
- package/lib/directory-sync/directory-sync.js +8 -6
- package/lib/directory-sync/directory-sync.spec.js +95 -20
- package/lib/directory-sync/interfaces/directory-group.interface.d.ts +20 -0
- package/lib/directory-sync/interfaces/directory-user.interface.d.ts +48 -0
- package/lib/directory-sync/interfaces/directory.interface.d.ts +12 -0
- package/lib/directory-sync/interfaces/index.d.ts +6 -6
- package/lib/directory-sync/interfaces/index.js +20 -0
- package/lib/directory-sync/interfaces/list-directories-options.interface.d.ts +1 -1
- package/lib/directory-sync/interfaces/{list-users-options.interface.d.ts → list-directory-users-options.interface.d.ts} +1 -1
- package/lib/directory-sync/interfaces/list-directory-users-options.interface.js +2 -0
- package/lib/directory-sync/serializers/directory-group.serializer.d.ts +2 -0
- package/lib/directory-sync/serializers/directory-group.serializer.js +14 -0
- package/lib/directory-sync/serializers/directory-user.serializer.d.ts +3 -0
- package/lib/directory-sync/serializers/directory-user.serializer.js +23 -0
- package/lib/directory-sync/serializers/directory.serializer.d.ts +2 -0
- package/lib/directory-sync/serializers/directory.serializer.js +16 -0
- package/lib/directory-sync/serializers/index.d.ts +3 -0
- package/lib/directory-sync/serializers/index.js +19 -0
- package/lib/directory-sync/utils/get-primary-email.d.ts +2 -2
- package/lib/directory-sync/utils/get-primary-email.spec.js +10 -8
- package/lib/events/events.d.ts +3 -3
- package/lib/events/events.js +3 -1
- package/lib/events/events.spec.js +19 -3
- package/lib/events/interfaces/event.interface.d.ts +4 -1
- package/lib/events/interfaces/list-events-options.interface.d.ts +2 -2
- package/lib/events/serializers/event.serializer.d.ts +2 -0
- package/lib/events/serializers/event.serializer.js +10 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/mfa/interfaces/challenge.interface.d.ts +9 -0
- package/lib/mfa/interfaces/factor.interface.d.ts +13 -4
- package/lib/mfa/interfaces/index.d.ts +9 -0
- package/lib/mfa/interfaces/index.js +25 -0
- package/lib/mfa/interfaces/sms.interface.d.ts +3 -0
- package/lib/mfa/interfaces/totp.interface.d.ts +7 -0
- package/lib/mfa/interfaces/verify-challenge-response.d.ts +5 -1
- package/lib/mfa/mfa.d.ts +2 -8
- package/lib/mfa/mfa.js +5 -4
- package/lib/mfa/mfa.spec.js +134 -115
- package/lib/mfa/serializers/challenge.serializer.d.ts +2 -0
- package/lib/mfa/serializers/challenge.serializer.js +13 -0
- package/lib/mfa/serializers/factor.serializer.d.ts +2 -0
- package/lib/mfa/serializers/factor.serializer.js +7 -0
- package/lib/mfa/serializers/index.d.ts +3 -0
- package/lib/mfa/serializers/index.js +19 -0
- package/lib/mfa/serializers/sms.serializer.d.ts +2 -0
- package/lib/mfa/serializers/sms.serializer.js +7 -0
- package/lib/mfa/serializers/totp.serializer.d.ts +2 -0
- package/lib/mfa/serializers/totp.serializer.js +11 -0
- package/lib/mfa/serializers/verify-response.serializer.d.ts +2 -0
- package/lib/mfa/serializers/verify-response.serializer.js +9 -0
- package/lib/organizations/interfaces/create-organization-options.interface.d.ts +5 -0
- package/lib/organizations/interfaces/organization.interface.d.ts +9 -0
- package/lib/organizations/interfaces/update-organization-options.interface.d.ts +5 -0
- package/lib/organizations/organizations.d.ts +2 -2
- package/lib/organizations/organizations.js +8 -6
- package/lib/organizations/organizations.spec.js +4 -3
- package/lib/organizations/serializers/create-organization-options.serializer.d.ts +2 -0
- package/lib/organizations/serializers/create-organization-options.serializer.js +9 -0
- package/lib/organizations/serializers/index.d.ts +3 -0
- package/lib/organizations/serializers/index.js +19 -0
- package/lib/organizations/serializers/organization.serializer.d.ts +2 -0
- package/lib/organizations/serializers/organization.serializer.js +13 -0
- package/lib/organizations/serializers/update-organization-options.serializer.d.ts +2 -0
- package/lib/organizations/serializers/update-organization-options.serializer.js +9 -0
- package/lib/passwordless/interfaces/create-passwordless-session-options.interface.d.ts +8 -0
- package/lib/passwordless/interfaces/index.d.ts +3 -3
- package/lib/passwordless/interfaces/index.js +17 -0
- package/lib/passwordless/interfaces/passwordless-session.interface.d.ts +7 -0
- package/lib/passwordless/passwordless.d.ts +1 -3
- package/lib/passwordless/passwordless.js +2 -1
- package/lib/passwordless/serializers/index.d.ts +0 -0
- package/lib/passwordless/serializers/index.js +1 -0
- package/lib/passwordless/serializers/passwordless-session.serializer.d.ts +2 -0
- package/lib/passwordless/serializers/passwordless-session.serializer.js +11 -0
- package/lib/portal/interfaces/generate-portal-link-intent.interface.js +1 -1
- package/lib/sso/interfaces/connection-type.enum.d.ts +1 -0
- package/lib/sso/interfaces/connection-type.enum.js +2 -1
- package/lib/sso/interfaces/connection.interface.d.ts +20 -1
- package/lib/sso/interfaces/index.d.ts +2 -0
- package/lib/sso/interfaces/index.js +2 -0
- package/lib/sso/interfaces/list-connections-options.interface.d.ts +5 -0
- package/lib/sso/interfaces/profile-and-token.interface.d.ts +6 -2
- package/lib/sso/interfaces/profile.interface.d.ts +14 -0
- package/lib/sso/serializers/connection.serializer.d.ts +2 -0
- package/lib/sso/serializers/connection.serializer.js +17 -0
- package/lib/sso/serializers/index.d.ts +3 -0
- package/lib/sso/serializers/index.js +19 -0
- package/lib/sso/serializers/profile-and-token.serializer.d.ts +2 -0
- package/lib/sso/serializers/profile-and-token.serializer.js +9 -0
- package/lib/sso/serializers/profile.serializer.d.ts +2 -0
- package/lib/sso/serializers/profile.serializer.js +16 -0
- package/lib/sso/sso.d.ts +3 -9
- package/lib/sso/sso.js +18 -9
- package/lib/sso/sso.spec.js +27 -9
- package/lib/users/exceptions/index.d.ts +4 -0
- package/lib/users/exceptions/index.js +10 -0
- package/lib/users/fixtures/list-users.json +21 -0
- package/lib/users/fixtures/session.json +6 -0
- package/lib/users/fixtures/user.json +12 -0
- package/lib/users/interfaces/add-user-to-organization-options.interface.d.ts +7 -0
- package/lib/users/interfaces/add-user-to-organization-options.interface.js +2 -0
- package/lib/users/interfaces/authenticate-user-with-password-options.interface.d.ts +21 -0
- package/lib/users/interfaces/authenticate-user-with-password-options.interface.js +2 -0
- package/lib/users/interfaces/authenticate-user-with-token-options.interface.d.ts +15 -0
- package/lib/users/interfaces/authenticate-user-with-token-options.interface.js +2 -0
- package/lib/users/interfaces/authentication-response.interface.d.ts +10 -0
- package/lib/users/interfaces/authentication-response.interface.js +2 -0
- package/lib/users/interfaces/complete-password-reset-options.interface.d.ts +8 -0
- package/lib/users/interfaces/complete-password-reset-options.interface.js +2 -0
- package/lib/users/interfaces/create-email-verification-challenge-options.interface.d.ts +16 -0
- package/lib/users/interfaces/create-email-verification-challenge-options.interface.js +2 -0
- package/lib/users/interfaces/create-password-reset-challenge-options.interface.d.ts +17 -0
- package/lib/users/interfaces/create-password-reset-challenge-options.interface.js +2 -0
- package/lib/users/interfaces/create-user-options.interface.d.ts +14 -0
- package/lib/users/interfaces/create-user-options.interface.js +2 -0
- package/lib/users/interfaces/index.d.ts +15 -0
- package/lib/users/interfaces/index.js +31 -0
- package/lib/users/interfaces/list-users-options.interface.d.ts +6 -0
- package/lib/users/interfaces/list-users-options.interface.js +2 -0
- package/lib/users/interfaces/remove-user-from-organization-options.interface.d.ts +4 -0
- package/lib/users/interfaces/remove-user-from-organization-options.interface.js +2 -0
- package/lib/users/interfaces/revoke-session-options.interface.d.ts +15 -0
- package/lib/users/interfaces/revoke-session-options.interface.js +2 -0
- package/lib/users/interfaces/session.interface.d.ts +12 -0
- package/lib/users/interfaces/session.interface.js +2 -0
- package/lib/users/interfaces/update-user-options.interface.d.ts +9 -0
- package/lib/users/interfaces/update-user-options.interface.js +2 -0
- package/lib/users/interfaces/update-user-password-options.interface.d.ts +7 -0
- package/lib/users/interfaces/update-user-password-options.interface.js +2 -0
- package/lib/users/interfaces/user.interface.d.ts +59 -0
- package/lib/users/interfaces/user.interface.js +2 -0
- package/lib/users/interfaces/verify-session.interface.d.ts +18 -0
- package/lib/users/interfaces/verify-session.interface.js +2 -0
- package/lib/users/serializers/authenticate-user-with-password-options.serializer.d.ts +2 -0
- package/lib/users/serializers/authenticate-user-with-password-options.serializer.js +14 -0
- package/lib/users/serializers/authenticate-user-with-token-options.serializer.d.ts +2 -0
- package/lib/users/serializers/authenticate-user-with-token-options.serializer.js +11 -0
- package/lib/users/serializers/authentication-response.serializer.d.ts +2 -0
- package/lib/users/serializers/authentication-response.serializer.js +12 -0
- package/lib/users/serializers/complete-password-reset-options.serializer.d.ts +2 -0
- package/lib/users/serializers/complete-password-reset-options.serializer.js +8 -0
- package/lib/users/serializers/create-email-verification-challenge.serializer.d.ts +2 -0
- package/lib/users/serializers/create-email-verification-challenge.serializer.js +9 -0
- package/lib/users/serializers/create-password-reset-challenge.serializer.d.ts +3 -0
- package/lib/users/serializers/create-password-reset-challenge.serializer.js +14 -0
- package/lib/users/serializers/create-user-options.serializer.d.ts +2 -0
- package/lib/users/serializers/create-user-options.serializer.js +11 -0
- package/lib/users/serializers/index.d.ts +13 -0
- package/lib/users/serializers/index.js +29 -0
- package/lib/users/serializers/revoke-session-options.serializer.d.ts +2 -0
- package/lib/users/serializers/revoke-session-options.serializer.js +14 -0
- package/lib/users/serializers/session.serializer.d.ts +2 -0
- package/lib/users/serializers/session.serializer.js +10 -0
- package/lib/users/serializers/update-user-options.serializer.d.ts +2 -0
- package/lib/users/serializers/update-user-options.serializer.js +8 -0
- package/lib/users/serializers/update-user-password-options.serializer.d.ts +2 -0
- package/lib/users/serializers/update-user-password-options.serializer.js +7 -0
- package/lib/users/serializers/user.serializer.d.ts +2 -0
- package/lib/users/serializers/user.serializer.js +31 -0
- package/lib/users/serializers/verify-session.serializer.d.ts +3 -0
- package/lib/users/serializers/verify-session.serializer.js +15 -0
- package/lib/users/users.d.ts +23 -0
- package/lib/users/users.js +124 -0
- package/lib/users/users.spec.d.ts +1 -0
- package/lib/users/users.spec.js +318 -0
- package/lib/webhooks/fixtures/webhook.json +1 -1
- package/lib/webhooks/interfaces/webhook-directory-user.interface.d.ts +2 -2
- package/lib/webhooks/interfaces/webhook.interface.d.ts +1 -0
- package/lib/workos.d.ts +6 -4
- package/lib/workos.js +3 -1
- package/package.json +13 -14
- package/lib/directory-sync/interfaces/group.interface.d.ts +0 -10
- package/lib/directory-sync/interfaces/user.interface.d.ts +0 -23
- /package/lib/{directory-sync/interfaces/group.interface.js → common/interfaces/workos-response-error.interface.js} +0 -0
- /package/lib/directory-sync/interfaces/{list-users-options.interface.js → directory-group.interface.js} +0 -0
- /package/lib/directory-sync/interfaces/{user.interface.js → directory-user.interface.js} +0 -0
|
@@ -10,6 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DirectorySync = void 0;
|
|
13
|
+
const serializers_1 = require("../common/serializers");
|
|
14
|
+
const serializers_2 = require("./serializers");
|
|
13
15
|
class DirectorySync {
|
|
14
16
|
constructor(workos) {
|
|
15
17
|
this.workos = workos;
|
|
@@ -19,13 +21,13 @@ class DirectorySync {
|
|
|
19
21
|
const { data } = yield this.workos.get('/directories', {
|
|
20
22
|
query: options,
|
|
21
23
|
});
|
|
22
|
-
return data;
|
|
24
|
+
return (0, serializers_1.deserializeList)(data, serializers_2.deserializeDirectory);
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
getDirectory(id) {
|
|
26
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
29
|
const { data } = yield this.workos.get(`/directories/${id}`);
|
|
28
|
-
return data;
|
|
30
|
+
return (0, serializers_2.deserializeDirectory)(data);
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
33
|
deleteDirectory(id) {
|
|
@@ -38,7 +40,7 @@ class DirectorySync {
|
|
|
38
40
|
const { data } = yield this.workos.get(`/directory_groups`, {
|
|
39
41
|
query: options,
|
|
40
42
|
});
|
|
41
|
-
return data;
|
|
43
|
+
return (0, serializers_1.deserializeList)(data, serializers_2.deserializeDirectoryGroup);
|
|
42
44
|
});
|
|
43
45
|
}
|
|
44
46
|
listUsers(options) {
|
|
@@ -46,19 +48,19 @@ class DirectorySync {
|
|
|
46
48
|
const { data } = yield this.workos.get(`/directory_users`, {
|
|
47
49
|
query: options,
|
|
48
50
|
});
|
|
49
|
-
return data;
|
|
51
|
+
return (0, serializers_1.deserializeList)(data, serializers_2.deserializeDirectoryUserWithGroups);
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
54
|
getUser(user) {
|
|
53
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
56
|
const { data } = yield this.workos.get(`/directory_users/${user}`);
|
|
55
|
-
return data;
|
|
57
|
+
return (0, serializers_2.deserializeDirectoryUserWithGroups)(data);
|
|
56
58
|
});
|
|
57
59
|
}
|
|
58
60
|
getGroup(group) {
|
|
59
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
62
|
const { data } = yield this.workos.get(`/directory_groups/${group}`);
|
|
61
|
-
return data;
|
|
63
|
+
return (0, serializers_2.deserializeDirectoryGroup)(data);
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
66
|
}
|
|
@@ -19,6 +19,18 @@ const mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
|
19
19
|
describe('DirectorySync', () => {
|
|
20
20
|
afterEach(() => mock.resetHistory());
|
|
21
21
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
22
|
+
const directory = {
|
|
23
|
+
id: 'directory_123',
|
|
24
|
+
createdAt: '2020-05-06 04:21:48.649164',
|
|
25
|
+
domain: 'foo-corp.com',
|
|
26
|
+
externalKey: '9asBRBVHz2ASEkgg',
|
|
27
|
+
name: 'Foo',
|
|
28
|
+
object: 'directory',
|
|
29
|
+
organizationId: 'org_01EXSR7M9QTKCC5D531SMCWMYG',
|
|
30
|
+
state: 'linked',
|
|
31
|
+
type: 'okta scim v1.1',
|
|
32
|
+
updatedAt: '2021-12-13 12:15:45.531847',
|
|
33
|
+
};
|
|
22
34
|
const directoryResponse = {
|
|
23
35
|
id: 'directory_123',
|
|
24
36
|
created_at: '2020-05-06 04:21:48.649164',
|
|
@@ -29,7 +41,19 @@ describe('DirectorySync', () => {
|
|
|
29
41
|
organization_id: 'org_01EXSR7M9QTKCC5D531SMCWMYG',
|
|
30
42
|
state: 'linked',
|
|
31
43
|
type: 'okta scim v1.1',
|
|
32
|
-
updated_at: '2021-
|
|
44
|
+
updated_at: '2021-12-13 12:15:45.531847',
|
|
45
|
+
};
|
|
46
|
+
const group = {
|
|
47
|
+
id: 'dir_grp_123',
|
|
48
|
+
idpId: '123',
|
|
49
|
+
directoryId: 'dir_123',
|
|
50
|
+
organizationId: 'org_123',
|
|
51
|
+
name: 'Foo Group',
|
|
52
|
+
createdAt: '2021-10-27 15:21:50.640958',
|
|
53
|
+
updatedAt: '2021-12-13 12:15:45.531847',
|
|
54
|
+
rawAttributes: {
|
|
55
|
+
foo: 'bar',
|
|
56
|
+
},
|
|
33
57
|
};
|
|
34
58
|
const groupResponse = {
|
|
35
59
|
id: 'dir_grp_123',
|
|
@@ -37,12 +61,37 @@ describe('DirectorySync', () => {
|
|
|
37
61
|
directory_id: 'dir_123',
|
|
38
62
|
organization_id: 'org_123',
|
|
39
63
|
name: 'Foo Group',
|
|
40
|
-
created_at:
|
|
41
|
-
updated_at: '2021-
|
|
64
|
+
created_at: '2021-10-27 15:21:50.640958',
|
|
65
|
+
updated_at: '2021-12-13 12:15:45.531847',
|
|
42
66
|
raw_attributes: {
|
|
43
67
|
foo: 'bar',
|
|
44
68
|
},
|
|
45
69
|
};
|
|
70
|
+
const userWithGroup = {
|
|
71
|
+
id: 'user_123',
|
|
72
|
+
customAttributes: {
|
|
73
|
+
custom: true,
|
|
74
|
+
},
|
|
75
|
+
directoryId: 'dir_123',
|
|
76
|
+
organizationId: 'org_123',
|
|
77
|
+
emails: [
|
|
78
|
+
{
|
|
79
|
+
primary: true,
|
|
80
|
+
type: 'type',
|
|
81
|
+
value: 'jonsnow@workos.com',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
firstName: 'Jon',
|
|
85
|
+
groups: [group],
|
|
86
|
+
idpId: 'idp_foo',
|
|
87
|
+
lastName: 'Snow',
|
|
88
|
+
jobTitle: 'Knight of the Watch',
|
|
89
|
+
rawAttributes: {},
|
|
90
|
+
state: 'active',
|
|
91
|
+
username: 'jonsnow',
|
|
92
|
+
createdAt: '2021-10-27 15:21:50.640959',
|
|
93
|
+
updatedAt: '2021-12-13 12:15:45.531847',
|
|
94
|
+
};
|
|
46
95
|
const userWithGroupResponse = {
|
|
47
96
|
id: 'user_123',
|
|
48
97
|
custom_attributes: {
|
|
@@ -65,6 +114,8 @@ describe('DirectorySync', () => {
|
|
|
65
114
|
raw_attributes: {},
|
|
66
115
|
state: 'active',
|
|
67
116
|
username: 'jonsnow',
|
|
117
|
+
created_at: '2021-10-27 15:21:50.640959',
|
|
118
|
+
updated_at: '2021-12-13 12:15:45.531847',
|
|
68
119
|
};
|
|
69
120
|
describe('listDirectories', () => {
|
|
70
121
|
describe('with options', () => {
|
|
@@ -79,10 +130,14 @@ describe('DirectorySync', () => {
|
|
|
79
130
|
domain: 'google.com',
|
|
80
131
|
})
|
|
81
132
|
.replyOnce(200, directoryListResponse);
|
|
82
|
-
const
|
|
133
|
+
const subject = yield workos.directorySync.listDirectories({
|
|
83
134
|
domain: 'google.com',
|
|
84
135
|
});
|
|
85
|
-
expect(
|
|
136
|
+
expect(subject).toEqual({
|
|
137
|
+
object: 'list',
|
|
138
|
+
data: [directory],
|
|
139
|
+
listMetadata: {},
|
|
140
|
+
});
|
|
86
141
|
}));
|
|
87
142
|
});
|
|
88
143
|
});
|
|
@@ -91,8 +146,8 @@ describe('DirectorySync', () => {
|
|
|
91
146
|
mock
|
|
92
147
|
.onGet('/directories/directory_123')
|
|
93
148
|
.replyOnce(200, directoryResponse);
|
|
94
|
-
const
|
|
95
|
-
expect(
|
|
149
|
+
const subject = yield workos.directorySync.getDirectory('directory_123');
|
|
150
|
+
expect(subject).toEqual(directory);
|
|
96
151
|
}));
|
|
97
152
|
});
|
|
98
153
|
describe('deleteDirectory', () => {
|
|
@@ -105,8 +160,8 @@ describe('DirectorySync', () => {
|
|
|
105
160
|
describe('getGroup', () => {
|
|
106
161
|
it(`requests a Directory Group`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
107
162
|
mock.onGet('/directory_groups/dir_grp_123').replyOnce(200, groupResponse);
|
|
108
|
-
const
|
|
109
|
-
expect(
|
|
163
|
+
const subject = yield workos.directorySync.getGroup('dir_grp_123');
|
|
164
|
+
expect(subject).toEqual(group);
|
|
110
165
|
}));
|
|
111
166
|
});
|
|
112
167
|
describe('listGroups', () => {
|
|
@@ -122,10 +177,14 @@ describe('DirectorySync', () => {
|
|
|
122
177
|
directory: 'directory_123',
|
|
123
178
|
})
|
|
124
179
|
.replyOnce(200, groupListResponse);
|
|
125
|
-
const
|
|
180
|
+
const subject = yield workos.directorySync.listGroups({
|
|
126
181
|
directory: 'directory_123',
|
|
127
182
|
});
|
|
128
|
-
expect(
|
|
183
|
+
expect(subject).toEqual({
|
|
184
|
+
object: 'list',
|
|
185
|
+
data: [group],
|
|
186
|
+
listMetadata: {},
|
|
187
|
+
});
|
|
129
188
|
}));
|
|
130
189
|
});
|
|
131
190
|
describe('with a User', () => {
|
|
@@ -135,10 +194,14 @@ describe('DirectorySync', () => {
|
|
|
135
194
|
user: 'directory_usr_123',
|
|
136
195
|
})
|
|
137
196
|
.replyOnce(200, groupListResponse);
|
|
138
|
-
const
|
|
197
|
+
const subject = yield workos.directorySync.listGroups({
|
|
139
198
|
user: 'directory_usr_123',
|
|
140
199
|
});
|
|
141
|
-
expect(
|
|
200
|
+
expect(subject).toEqual({
|
|
201
|
+
object: 'list',
|
|
202
|
+
data: [group],
|
|
203
|
+
listMetadata: {},
|
|
204
|
+
});
|
|
142
205
|
}));
|
|
143
206
|
});
|
|
144
207
|
});
|
|
@@ -155,10 +218,14 @@ describe('DirectorySync', () => {
|
|
|
155
218
|
directory: 'directory_123',
|
|
156
219
|
})
|
|
157
220
|
.replyOnce(200, userWithGroupListResponse);
|
|
158
|
-
const
|
|
221
|
+
const subject = yield workos.directorySync.listUsers({
|
|
159
222
|
directory: 'directory_123',
|
|
160
223
|
});
|
|
161
|
-
expect(
|
|
224
|
+
expect(subject).toEqual({
|
|
225
|
+
object: 'list',
|
|
226
|
+
data: [userWithGroup],
|
|
227
|
+
listMetadata: {},
|
|
228
|
+
});
|
|
162
229
|
}));
|
|
163
230
|
describe('with custom attributes', () => {
|
|
164
231
|
it('returns the custom attributes, using the provided type', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -179,6 +246,8 @@ describe('DirectorySync', () => {
|
|
|
179
246
|
last_name: 'Stoltenberg',
|
|
180
247
|
job_title: 'Software Engineer',
|
|
181
248
|
state: 'active',
|
|
249
|
+
created_at: '2021-10-27 15:21:50.640959',
|
|
250
|
+
updated_at: '2021-12-13 12:15:45.531847',
|
|
182
251
|
raw_attributes: {},
|
|
183
252
|
custom_attributes: {
|
|
184
253
|
managerId: '99f1817b-149c-4438-b80f-a272c3406109',
|
|
@@ -204,6 +273,8 @@ describe('DirectorySync', () => {
|
|
|
204
273
|
last_name: 'Leffler',
|
|
205
274
|
job_title: 'Software Engineer',
|
|
206
275
|
state: 'active',
|
|
276
|
+
created_at: '2021-10-27 15:21:50.640959',
|
|
277
|
+
updated_at: '2021-12-13 12:15:45.531847',
|
|
207
278
|
raw_attributes: {},
|
|
208
279
|
custom_attributes: {
|
|
209
280
|
managerId: '263c7472-4d3f-4ab4-8162-e768af103065',
|
|
@@ -223,7 +294,7 @@ describe('DirectorySync', () => {
|
|
|
223
294
|
const users = yield workos.directorySync.listUsers({
|
|
224
295
|
directory: 'directory_123',
|
|
225
296
|
});
|
|
226
|
-
const managerIds = users.data.map((user) => user.
|
|
297
|
+
const managerIds = users.data.map((user) => user.customAttributes.managerId);
|
|
227
298
|
expect(managerIds).toEqual([
|
|
228
299
|
'99f1817b-149c-4438-b80f-a272c3406109',
|
|
229
300
|
'263c7472-4d3f-4ab4-8162-e768af103065',
|
|
@@ -238,10 +309,14 @@ describe('DirectorySync', () => {
|
|
|
238
309
|
group: 'directory_grp_123',
|
|
239
310
|
})
|
|
240
311
|
.replyOnce(200, userWithGroupListResponse);
|
|
241
|
-
const
|
|
312
|
+
const subject = yield workos.directorySync.listUsers({
|
|
242
313
|
group: 'directory_grp_123',
|
|
243
314
|
});
|
|
244
|
-
expect(
|
|
315
|
+
expect(subject).toEqual({
|
|
316
|
+
object: 'list',
|
|
317
|
+
data: [userWithGroup],
|
|
318
|
+
listMetadata: {},
|
|
319
|
+
});
|
|
245
320
|
}));
|
|
246
321
|
});
|
|
247
322
|
});
|
|
@@ -250,8 +325,8 @@ describe('DirectorySync', () => {
|
|
|
250
325
|
mock
|
|
251
326
|
.onGet('/directory_users/dir_usr_123')
|
|
252
327
|
.replyOnce(200, userWithGroupResponse);
|
|
253
|
-
const
|
|
254
|
-
expect(
|
|
328
|
+
const subject = yield workos.directorySync.getUser('dir_usr_123');
|
|
329
|
+
expect(subject).toEqual(userWithGroup);
|
|
255
330
|
}));
|
|
256
331
|
});
|
|
257
332
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DirectoryGroup {
|
|
2
|
+
id: string;
|
|
3
|
+
idpId: string;
|
|
4
|
+
directoryId: string;
|
|
5
|
+
organizationId: string | null;
|
|
6
|
+
name: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
rawAttributes: any;
|
|
10
|
+
}
|
|
11
|
+
export interface DirectoryGroupResponse {
|
|
12
|
+
id: string;
|
|
13
|
+
idp_id: string;
|
|
14
|
+
directory_id: string;
|
|
15
|
+
organization_id: string | null;
|
|
16
|
+
name: string;
|
|
17
|
+
created_at: string;
|
|
18
|
+
updated_at: string;
|
|
19
|
+
raw_attributes: any;
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DirectoryGroup, DirectoryGroupResponse } from './directory-group.interface';
|
|
2
|
+
export type DefaultCustomAttributes = Record<string, unknown>;
|
|
3
|
+
export interface DirectoryUser<TCustomAttributes extends object = DefaultCustomAttributes, TRawAttributes = any> {
|
|
4
|
+
id: string;
|
|
5
|
+
directoryId: string;
|
|
6
|
+
organizationId: string | null;
|
|
7
|
+
rawAttributes: TRawAttributes;
|
|
8
|
+
customAttributes: TCustomAttributes;
|
|
9
|
+
idpId: string;
|
|
10
|
+
firstName: string;
|
|
11
|
+
emails: {
|
|
12
|
+
type: string;
|
|
13
|
+
value: string;
|
|
14
|
+
primary: boolean;
|
|
15
|
+
}[];
|
|
16
|
+
username: string;
|
|
17
|
+
lastName: string;
|
|
18
|
+
jobTitle: string | null;
|
|
19
|
+
state: 'active' | 'inactive' | 'suspended';
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DirectoryUserResponse<TCustomAttributes extends object = DefaultCustomAttributes, TRawAttributes = any> {
|
|
24
|
+
id: string;
|
|
25
|
+
directory_id: string;
|
|
26
|
+
organization_id: string | null;
|
|
27
|
+
raw_attributes: TRawAttributes;
|
|
28
|
+
custom_attributes: TCustomAttributes;
|
|
29
|
+
idp_id: string;
|
|
30
|
+
first_name: string;
|
|
31
|
+
emails: {
|
|
32
|
+
type: string;
|
|
33
|
+
value: string;
|
|
34
|
+
primary: boolean;
|
|
35
|
+
}[];
|
|
36
|
+
username: string;
|
|
37
|
+
last_name: string;
|
|
38
|
+
job_title: string | null;
|
|
39
|
+
state: 'active' | 'inactive' | 'suspended';
|
|
40
|
+
created_at: string;
|
|
41
|
+
updated_at: string;
|
|
42
|
+
}
|
|
43
|
+
export interface DirectoryUserWithGroups<TCustomAttributes extends object = DefaultCustomAttributes> extends DirectoryUser<TCustomAttributes> {
|
|
44
|
+
groups: DirectoryGroup[];
|
|
45
|
+
}
|
|
46
|
+
export interface DirectoryUserWithGroupsResponse<TCustomAttributes extends object = DefaultCustomAttributes> extends DirectoryUserResponse<TCustomAttributes> {
|
|
47
|
+
groups: DirectoryGroupResponse[];
|
|
48
|
+
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export interface Directory {
|
|
2
|
+
object: 'directory';
|
|
3
|
+
id: string;
|
|
4
|
+
domain: string;
|
|
5
|
+
externalKey: string;
|
|
6
|
+
name: string;
|
|
7
|
+
organizationId?: string;
|
|
8
|
+
state: 'unlinked' | 'linked' | 'invalid_credentials';
|
|
9
|
+
type: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface DirectoryResponse {
|
|
2
14
|
object: 'directory';
|
|
3
15
|
id: string;
|
|
4
16
|
domain: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export * from './directory.interface';
|
|
2
|
+
export * from './directory-group.interface';
|
|
3
|
+
export * from './list-directories-options.interface';
|
|
4
|
+
export * from './list-groups-options.interface';
|
|
5
|
+
export * from './list-directory-users-options.interface';
|
|
6
|
+
export * from './directory-user.interface';
|
|
@@ -1,2 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./directory.interface"), exports);
|
|
18
|
+
__exportStar(require("./directory-group.interface"), exports);
|
|
19
|
+
__exportStar(require("./list-directories-options.interface"), exports);
|
|
20
|
+
__exportStar(require("./list-groups-options.interface"), exports);
|
|
21
|
+
__exportStar(require("./list-directory-users-options.interface"), exports);
|
|
22
|
+
__exportStar(require("./directory-user.interface"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PaginationOptions } from '../../common/interfaces/pagination-options.interface';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ListDirectoryUsersOptions extends PaginationOptions {
|
|
3
3
|
directory?: string;
|
|
4
4
|
group?: string;
|
|
5
5
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeDirectoryGroup = void 0;
|
|
4
|
+
const deserializeDirectoryGroup = (directoryGroup) => ({
|
|
5
|
+
id: directoryGroup.id,
|
|
6
|
+
idpId: directoryGroup.idp_id,
|
|
7
|
+
directoryId: directoryGroup.directory_id,
|
|
8
|
+
organizationId: directoryGroup.organization_id,
|
|
9
|
+
name: directoryGroup.name,
|
|
10
|
+
createdAt: directoryGroup.created_at,
|
|
11
|
+
updatedAt: directoryGroup.updated_at,
|
|
12
|
+
rawAttributes: directoryGroup.raw_attributes,
|
|
13
|
+
});
|
|
14
|
+
exports.deserializeDirectoryGroup = deserializeDirectoryGroup;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefaultCustomAttributes, DirectoryUser, DirectoryUserResponse, DirectoryUserWithGroups, DirectoryUserWithGroupsResponse } from '../interfaces';
|
|
2
|
+
export declare const deserializeDirectoryUser: <TCustomAttributes extends object = DefaultCustomAttributes>(directoryUser: DirectoryUserResponse<TCustomAttributes, any> | DirectoryUserWithGroupsResponse<TCustomAttributes>) => DirectoryUser<TCustomAttributes, any>;
|
|
3
|
+
export declare const deserializeDirectoryUserWithGroups: <TCustomAttributes extends object = DefaultCustomAttributes>(directoryUserWithGroups: DirectoryUserWithGroupsResponse<TCustomAttributes>) => DirectoryUserWithGroups<TCustomAttributes>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeDirectoryUserWithGroups = exports.deserializeDirectoryUser = void 0;
|
|
4
|
+
const directory_group_serializer_1 = require("./directory-group.serializer");
|
|
5
|
+
const deserializeDirectoryUser = (directoryUser) => ({
|
|
6
|
+
id: directoryUser.id,
|
|
7
|
+
directoryId: directoryUser.directory_id,
|
|
8
|
+
organizationId: directoryUser.organization_id,
|
|
9
|
+
rawAttributes: directoryUser.raw_attributes,
|
|
10
|
+
customAttributes: directoryUser.custom_attributes,
|
|
11
|
+
idpId: directoryUser.idp_id,
|
|
12
|
+
firstName: directoryUser.first_name,
|
|
13
|
+
emails: directoryUser.emails,
|
|
14
|
+
username: directoryUser.username,
|
|
15
|
+
lastName: directoryUser.last_name,
|
|
16
|
+
jobTitle: directoryUser.job_title,
|
|
17
|
+
state: directoryUser.state,
|
|
18
|
+
createdAt: directoryUser.created_at,
|
|
19
|
+
updatedAt: directoryUser.updated_at,
|
|
20
|
+
});
|
|
21
|
+
exports.deserializeDirectoryUser = deserializeDirectoryUser;
|
|
22
|
+
const deserializeDirectoryUserWithGroups = (directoryUserWithGroups) => (Object.assign(Object.assign({}, (0, exports.deserializeDirectoryUser)(directoryUserWithGroups)), { groups: directoryUserWithGroups.groups.map(directory_group_serializer_1.deserializeDirectoryGroup) }));
|
|
23
|
+
exports.deserializeDirectoryUserWithGroups = deserializeDirectoryUserWithGroups;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeDirectory = void 0;
|
|
4
|
+
const deserializeDirectory = (directory) => ({
|
|
5
|
+
object: directory.object,
|
|
6
|
+
id: directory.id,
|
|
7
|
+
domain: directory.domain,
|
|
8
|
+
externalKey: directory.external_key,
|
|
9
|
+
name: directory.name,
|
|
10
|
+
organizationId: directory.organization_id,
|
|
11
|
+
state: directory.state,
|
|
12
|
+
type: directory.type,
|
|
13
|
+
createdAt: directory.created_at,
|
|
14
|
+
updatedAt: directory.updated_at,
|
|
15
|
+
});
|
|
16
|
+
exports.deserializeDirectory = deserializeDirectory;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./directory-group.serializer"), exports);
|
|
18
|
+
__exportStar(require("./directory-user.serializer"), exports);
|
|
19
|
+
__exportStar(require("./directory.serializer"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getPrimaryEmail(user:
|
|
1
|
+
import { DirectoryUser } from '../interfaces/directory-user.interface';
|
|
2
|
+
export declare function getPrimaryEmail(user: DirectoryUser): string | undefined;
|
|
@@ -4,11 +4,11 @@ const get_primary_email_1 = require("./get-primary-email");
|
|
|
4
4
|
describe('getPrimaryEmail', () => {
|
|
5
5
|
const user = {
|
|
6
6
|
id: 'user_123',
|
|
7
|
-
|
|
7
|
+
customAttributes: {
|
|
8
8
|
custom: true,
|
|
9
9
|
},
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
directoryId: 'dir_123',
|
|
11
|
+
organizationId: 'org_123',
|
|
12
12
|
emails: [
|
|
13
13
|
{
|
|
14
14
|
primary: true,
|
|
@@ -16,13 +16,15 @@ describe('getPrimaryEmail', () => {
|
|
|
16
16
|
value: 'jonsnow@workos.com',
|
|
17
17
|
},
|
|
18
18
|
],
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
firstName: 'Jon',
|
|
20
|
+
idpId: 'idp_foo',
|
|
21
|
+
lastName: 'Snow',
|
|
22
|
+
rawAttributes: {},
|
|
23
23
|
state: 'active',
|
|
24
24
|
username: 'jonsnow',
|
|
25
|
-
|
|
25
|
+
jobTitle: 'Knight of the Watch',
|
|
26
|
+
createdAt: '2021-10-27 15:21:50.640958',
|
|
27
|
+
updatedAt: '2021-12-13 12:15:45.531847',
|
|
26
28
|
};
|
|
27
29
|
it(`returns primary email value`, () => {
|
|
28
30
|
const primaryEmail = (0, get_primary_email_1.getPrimaryEmail)(user);
|
package/lib/events/events.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WorkOS } from '../workos';
|
|
2
|
-
import { Event } from './interfaces
|
|
3
|
-
import { List } from '../common/interfaces/list.interface';
|
|
2
|
+
import { Event } from './interfaces';
|
|
4
3
|
import { ListEventOptions } from './interfaces';
|
|
4
|
+
import { DeserializedList } from '../common/interfaces';
|
|
5
5
|
export declare class Events {
|
|
6
6
|
private readonly workos;
|
|
7
7
|
constructor(workos: WorkOS);
|
|
8
|
-
listEvents(options: ListEventOptions): Promise<
|
|
8
|
+
listEvents(options: ListEventOptions): Promise<DeserializedList<Event>>;
|
|
9
9
|
}
|
package/lib/events/events.js
CHANGED
|
@@ -10,6 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Events = void 0;
|
|
13
|
+
const serializers_1 = require("../common/serializers");
|
|
14
|
+
const event_serializer_1 = require("./serializers/event.serializer");
|
|
13
15
|
class Events {
|
|
14
16
|
constructor(workos) {
|
|
15
17
|
this.workos = workos;
|
|
@@ -19,7 +21,7 @@ class Events {
|
|
|
19
21
|
const { data } = yield this.workos.get(`/events`, {
|
|
20
22
|
query: options,
|
|
21
23
|
});
|
|
22
|
-
return data;
|
|
24
|
+
return (0, serializers_1.deserializeList)(data, event_serializer_1.deserializeEvent);
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
}
|
|
@@ -19,6 +19,14 @@ const mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
|
19
19
|
describe('Event', () => {
|
|
20
20
|
afterEach(() => mock.resetHistory());
|
|
21
21
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
22
|
+
const event = {
|
|
23
|
+
id: 'event_01234ABCD',
|
|
24
|
+
createdAt: '2020-05-06 04:21:48.649164',
|
|
25
|
+
event: 'dsync.user.created',
|
|
26
|
+
data: {
|
|
27
|
+
id: 'event_01234ABCD',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
22
30
|
const eventResponse = {
|
|
23
31
|
id: 'event_01234ABCD',
|
|
24
32
|
created_at: '2020-05-06 04:21:48.649164',
|
|
@@ -35,15 +43,23 @@ describe('Event', () => {
|
|
|
35
43
|
};
|
|
36
44
|
it(`requests Events`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
45
|
mock.onGet('/events', {}).replyOnce(200, eventsListResponse);
|
|
38
|
-
const
|
|
39
|
-
expect(
|
|
46
|
+
const subject = yield workos.events.listEvents({});
|
|
47
|
+
expect(subject).toEqual({
|
|
48
|
+
object: 'list',
|
|
49
|
+
data: [event],
|
|
50
|
+
listMetadata: {},
|
|
51
|
+
});
|
|
40
52
|
}));
|
|
41
53
|
it(`requests Events with a valid event name`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
54
|
mock.onGet('/events').replyOnce(200, eventsListResponse);
|
|
43
55
|
const list = yield workos.events.listEvents({
|
|
44
56
|
events: ['connection.activated'],
|
|
45
57
|
});
|
|
46
|
-
expect(list).toEqual(
|
|
58
|
+
expect(list).toEqual({
|
|
59
|
+
object: 'list',
|
|
60
|
+
data: [event],
|
|
61
|
+
listMetadata: {},
|
|
62
|
+
});
|
|
47
63
|
}));
|
|
48
64
|
});
|
|
49
65
|
});
|