@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,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.AuditLogs = void 0;
|
|
13
|
+
const serializers_1 = require("./serializers");
|
|
13
14
|
class AuditLogs {
|
|
14
15
|
constructor(workos) {
|
|
15
16
|
this.workos = workos;
|
|
@@ -17,21 +18,21 @@ class AuditLogs {
|
|
|
17
18
|
createEvent(organization, event, options = {}) {
|
|
18
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
20
|
yield this.workos.post('/audit_logs/events', {
|
|
20
|
-
event,
|
|
21
|
+
event: (0, serializers_1.serializeCreateAuditLogEventOptions)(event),
|
|
21
22
|
organization_id: organization,
|
|
22
23
|
}, options);
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
createExport(options) {
|
|
26
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
const { data } = yield this.workos.post('/audit_logs/exports', options);
|
|
28
|
-
return data;
|
|
28
|
+
const { data } = yield this.workos.post('/audit_logs/exports', (0, serializers_1.serializeAuditLogExportOptions)(options));
|
|
29
|
+
return (0, serializers_1.deserializeAuditLogExport)(data);
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
32
|
getExport(auditLogExportId) {
|
|
32
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
34
|
const { data } = yield this.workos.get(`/audit_logs/exports/${auditLogExportId}`);
|
|
34
|
-
return data;
|
|
35
|
+
return (0, serializers_1.deserializeAuditLogExport)(data);
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -8,30 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
-
};
|
|
25
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const axios_1 =
|
|
27
|
-
const axios_mock_adapter_1 = __importDefault(require("axios-mock-adapter"));
|
|
12
|
+
const axios_1 = require("axios");
|
|
28
13
|
const exceptions_1 = require("../common/exceptions");
|
|
29
14
|
const bad_request_exception_1 = require("../common/exceptions/bad-request.exception");
|
|
15
|
+
const workos_mock_response_1 = require("../common/utils/workos-mock-response");
|
|
30
16
|
const workos_1 = require("../workos");
|
|
31
|
-
const
|
|
17
|
+
const serializers_1 = require("./serializers");
|
|
32
18
|
const event = {
|
|
33
19
|
action: 'document.updated',
|
|
34
|
-
|
|
20
|
+
occurredAt: new Date(),
|
|
35
21
|
actor: {
|
|
36
22
|
id: 'user_1',
|
|
37
23
|
name: 'Jon Smith',
|
|
@@ -44,93 +30,91 @@ const event = {
|
|
|
44
30
|
},
|
|
45
31
|
],
|
|
46
32
|
context: {
|
|
47
|
-
location: '
|
|
48
|
-
|
|
33
|
+
location: '192.0.0.8',
|
|
34
|
+
userAgent: 'Firefox',
|
|
49
35
|
},
|
|
50
36
|
metadata: {
|
|
51
37
|
successful: true,
|
|
52
38
|
},
|
|
53
39
|
};
|
|
54
|
-
const serializeEventOptions = (options) => (Object.assign(Object.assign({}, options), { occurred_at: options.occurred_at.toISOString() }));
|
|
55
40
|
describe('AuditLogs', () => {
|
|
56
41
|
describe('createEvent', () => {
|
|
57
42
|
describe('with an idempotency key', () => {
|
|
58
43
|
it('includes an idempotency key with request', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
event: serializeEventOptions(event),
|
|
62
|
-
organization_id: 'org_123',
|
|
63
|
-
})
|
|
64
|
-
.replyOnce(201, { success: true });
|
|
44
|
+
const workosSpy = jest.spyOn(workos_1.WorkOS.prototype, 'post');
|
|
45
|
+
workosSpy.mockResolvedValueOnce((0, workos_mock_response_1.mockWorkOsResponse)(201, { success: true }));
|
|
65
46
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
66
47
|
yield expect(workos.auditLogs.createEvent('org_123', event, {
|
|
67
48
|
idempotencyKey: 'the-idempotency-key',
|
|
68
49
|
})).resolves.toBeUndefined();
|
|
69
|
-
expect(
|
|
50
|
+
expect(workosSpy).toHaveBeenCalledWith('/audit_logs/events', {
|
|
51
|
+
event: (0, serializers_1.serializeCreateAuditLogEventOptions)(event),
|
|
52
|
+
organization_id: 'org_123',
|
|
53
|
+
}, { idempotencyKey: 'the-idempotency-key' });
|
|
70
54
|
}));
|
|
71
55
|
});
|
|
72
56
|
describe('when the api responds with a 200', () => {
|
|
73
57
|
it('returns void', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
organization_id: 'org_123',
|
|
77
|
-
event: serializeEventOptions(event),
|
|
78
|
-
})
|
|
79
|
-
.replyOnce(201, { success: true });
|
|
58
|
+
const workosSpy = jest.spyOn(workos_1.WorkOS.prototype, 'post');
|
|
59
|
+
workosSpy.mockResolvedValueOnce((0, workos_mock_response_1.mockWorkOsResponse)(201, { success: true }));
|
|
80
60
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
81
61
|
yield expect(workos.auditLogs.createEvent('org_123', event)).resolves.toBeUndefined();
|
|
62
|
+
expect(workosSpy).toHaveBeenCalledWith('/audit_logs/events', {
|
|
63
|
+
event: (0, serializers_1.serializeCreateAuditLogEventOptions)(event),
|
|
64
|
+
organization_id: 'org_123',
|
|
65
|
+
}, {});
|
|
82
66
|
}));
|
|
83
67
|
});
|
|
84
68
|
describe('when the api responds with a 401', () => {
|
|
85
69
|
it('throws an UnauthorizedException', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})
|
|
91
|
-
.replyOnce(401, {
|
|
92
|
-
message: 'Unauthorized',
|
|
93
|
-
}, { 'X-Request-ID': 'a-request-id' });
|
|
70
|
+
const workosSpy = jest.spyOn(workos_1.WorkOS.prototype, 'post');
|
|
71
|
+
workosSpy.mockImplementationOnce(() => {
|
|
72
|
+
throw new axios_1.AxiosError('Could not authorize the request. Maybe your API key is invalid?', '401');
|
|
73
|
+
});
|
|
94
74
|
const workos = new workos_1.WorkOS('invalid apikey');
|
|
95
|
-
yield expect(workos.auditLogs.createEvent('org_123', event)).rejects.
|
|
75
|
+
yield expect(workos.auditLogs.createEvent('org_123', event)).rejects.toThrowError(new exceptions_1.UnauthorizedException('a-request-id'));
|
|
96
76
|
}));
|
|
97
77
|
});
|
|
98
78
|
describe('when the api responds with a 400', () => {
|
|
99
79
|
it('throws an BadRequestException', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
+
const workosSpy = jest.spyOn(workos_1.WorkOS.prototype, 'post');
|
|
100
81
|
const errors = [
|
|
101
82
|
{
|
|
102
83
|
field: 'occurred_at',
|
|
103
84
|
code: 'occurred_at must be an ISO 8601 date string',
|
|
104
85
|
},
|
|
105
86
|
];
|
|
106
|
-
|
|
107
|
-
.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
errors,
|
|
115
|
-
}, { 'X-Request-ID': 'a-request-id' });
|
|
87
|
+
workosSpy.mockImplementationOnce(() => {
|
|
88
|
+
throw new bad_request_exception_1.BadRequestException({
|
|
89
|
+
code: '400',
|
|
90
|
+
errors,
|
|
91
|
+
message: 'Audit Log could not be processed due to missing or incorrect data.',
|
|
92
|
+
requestID: 'a-request-id',
|
|
93
|
+
});
|
|
94
|
+
});
|
|
116
95
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
117
96
|
yield expect(workos.auditLogs.createEvent('org_123', event)).rejects.toThrow(bad_request_exception_1.BadRequestException);
|
|
118
97
|
}));
|
|
119
98
|
});
|
|
120
99
|
});
|
|
121
100
|
describe('createExport', () => {
|
|
122
|
-
const serializeExportOptions = (_a) => {
|
|
123
|
-
var { range_end, range_start } = _a, options = __rest(_a, ["range_end", "range_start"]);
|
|
124
|
-
return (Object.assign({ range_start: range_start.toISOString(), range_end: range_end.toISOString() }, options));
|
|
125
|
-
};
|
|
126
101
|
describe('when the api responds with a 201', () => {
|
|
127
102
|
it('returns `audit_log_export`', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
103
|
+
const workosSpy = jest.spyOn(workos_1.WorkOS.prototype, 'post');
|
|
128
104
|
const options = {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
105
|
+
organizationId: 'org_123',
|
|
106
|
+
rangeStart: new Date(),
|
|
107
|
+
rangeEnd: new Date(),
|
|
132
108
|
};
|
|
133
109
|
const auditLogExport = {
|
|
110
|
+
object: 'audit_log_export',
|
|
111
|
+
id: 'audit_log_export_1234',
|
|
112
|
+
state: 'pending',
|
|
113
|
+
url: undefined,
|
|
114
|
+
createdAt: new Date().toISOString(),
|
|
115
|
+
updatedAt: new Date().toISOString(),
|
|
116
|
+
};
|
|
117
|
+
const auditLogExportResponse = {
|
|
134
118
|
object: 'audit_log_export',
|
|
135
119
|
id: 'audit_log_export_1234',
|
|
136
120
|
state: 'pending',
|
|
@@ -138,26 +122,34 @@ describe('AuditLogs', () => {
|
|
|
138
122
|
created_at: new Date().toISOString(),
|
|
139
123
|
updated_at: new Date().toISOString(),
|
|
140
124
|
};
|
|
141
|
-
|
|
142
|
-
.onPost('/audit_logs/exports', serializeExportOptions(options))
|
|
143
|
-
.replyOnce(201, auditLogExport);
|
|
125
|
+
workosSpy.mockResolvedValueOnce((0, workos_mock_response_1.mockWorkOsResponse)(201, auditLogExportResponse));
|
|
144
126
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
145
127
|
yield expect(workos.auditLogs.createExport(options)).resolves.toEqual(auditLogExport);
|
|
128
|
+
expect(workosSpy).toHaveBeenCalledWith('/audit_logs/exports', (0, serializers_1.serializeAuditLogExportOptions)(options));
|
|
146
129
|
}));
|
|
147
130
|
});
|
|
148
131
|
describe('when additional filters are defined', () => {
|
|
149
132
|
it('returns `audit_log_export`', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
133
|
+
const workosSpy = jest.spyOn(workos_1.WorkOS.prototype, 'post');
|
|
150
134
|
const options = {
|
|
151
135
|
actions: ['foo', 'bar'],
|
|
152
136
|
actors: ['Jon', 'Smith'],
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
137
|
+
actorNames: ['Jon', 'Smith'],
|
|
138
|
+
actorIds: ['user_foo', 'user_bar'],
|
|
139
|
+
organizationId: 'org_123',
|
|
140
|
+
rangeEnd: new Date(),
|
|
141
|
+
rangeStart: new Date(),
|
|
158
142
|
targets: ['user', 'team'],
|
|
159
143
|
};
|
|
160
144
|
const auditLogExport = {
|
|
145
|
+
object: 'audit_log_export',
|
|
146
|
+
id: 'audit_log_export_1234',
|
|
147
|
+
state: 'pending',
|
|
148
|
+
url: undefined,
|
|
149
|
+
createdAt: new Date().toISOString(),
|
|
150
|
+
updatedAt: new Date().toISOString(),
|
|
151
|
+
};
|
|
152
|
+
const auditLogExportResponse = {
|
|
161
153
|
object: 'audit_log_export',
|
|
162
154
|
id: 'audit_log_export_1234',
|
|
163
155
|
state: 'pending',
|
|
@@ -165,34 +157,41 @@ describe('AuditLogs', () => {
|
|
|
165
157
|
created_at: new Date().toISOString(),
|
|
166
158
|
updated_at: new Date().toISOString(),
|
|
167
159
|
};
|
|
168
|
-
|
|
169
|
-
.onPost('/audit_logs/exports', serializeExportOptions(options))
|
|
170
|
-
.replyOnce(201, auditLogExport);
|
|
160
|
+
workosSpy.mockResolvedValueOnce((0, workos_mock_response_1.mockWorkOsResponse)(201, auditLogExportResponse));
|
|
171
161
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
172
162
|
yield expect(workos.auditLogs.createExport(options)).resolves.toEqual(auditLogExport);
|
|
163
|
+
expect(workosSpy).toHaveBeenCalledWith('/audit_logs/exports', (0, serializers_1.serializeAuditLogExportOptions)(options));
|
|
173
164
|
}));
|
|
174
165
|
});
|
|
175
166
|
describe('when the api responds with a 401', () => {
|
|
176
167
|
it('throws an UnauthorizedException', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
168
|
+
const workosSpy = jest.spyOn(workos_1.WorkOS.prototype, 'post');
|
|
177
169
|
const options = {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
170
|
+
organizationId: 'org_123',
|
|
171
|
+
rangeStart: new Date(),
|
|
172
|
+
rangeEnd: new Date(),
|
|
181
173
|
};
|
|
182
|
-
|
|
183
|
-
.
|
|
184
|
-
|
|
185
|
-
message: 'Unauthorized',
|
|
186
|
-
}, { 'X-Request-ID': 'a-request-id' });
|
|
174
|
+
workosSpy.mockImplementationOnce(() => {
|
|
175
|
+
throw new axios_1.AxiosError('Could not authorize the request. Maybe your API key is invalid?', '401');
|
|
176
|
+
});
|
|
187
177
|
const workos = new workos_1.WorkOS('invalid apikey');
|
|
188
|
-
yield expect(workos.auditLogs.createExport(options)).rejects.
|
|
178
|
+
yield expect(workos.auditLogs.createExport(options)).rejects.toThrowError(new exceptions_1.UnauthorizedException('a-request-id'));
|
|
189
179
|
}));
|
|
190
180
|
});
|
|
191
181
|
});
|
|
192
182
|
describe('getExport', () => {
|
|
193
183
|
describe('when the api responds with a 201', () => {
|
|
194
184
|
it('returns `audit_log_export`', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
185
|
+
const workosSpy = jest.spyOn(workos_1.WorkOS.prototype, 'get');
|
|
195
186
|
const auditLogExport = {
|
|
187
|
+
object: 'audit_log_export',
|
|
188
|
+
id: 'audit_log_export_1234',
|
|
189
|
+
state: 'pending',
|
|
190
|
+
url: undefined,
|
|
191
|
+
createdAt: new Date().toISOString(),
|
|
192
|
+
updatedAt: new Date().toISOString(),
|
|
193
|
+
};
|
|
194
|
+
const auditLogExportResponse = {
|
|
196
195
|
object: 'audit_log_export',
|
|
197
196
|
id: 'audit_log_export_1234',
|
|
198
197
|
state: 'pending',
|
|
@@ -200,20 +199,21 @@ describe('AuditLogs', () => {
|
|
|
200
199
|
created_at: new Date().toISOString(),
|
|
201
200
|
updated_at: new Date().toISOString(),
|
|
202
201
|
};
|
|
203
|
-
|
|
204
|
-
.onGet(`/audit_logs/exports/${auditLogExport.id}`)
|
|
205
|
-
.replyOnce(200, auditLogExport);
|
|
202
|
+
workosSpy.mockResolvedValueOnce((0, workos_mock_response_1.mockWorkOsResponse)(201, auditLogExportResponse));
|
|
206
203
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
207
204
|
yield expect(workos.auditLogs.getExport(auditLogExport.id)).resolves.toEqual(auditLogExport);
|
|
205
|
+
expect(workosSpy).toHaveBeenCalledWith(`/audit_logs/exports/${auditLogExport.id}`);
|
|
208
206
|
}));
|
|
209
207
|
});
|
|
210
208
|
describe('when the api responds with a 401', () => {
|
|
211
209
|
it('throws an UnauthorizedException', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
210
|
+
const workosSpy = jest.spyOn(workos_1.WorkOS.prototype, 'get');
|
|
211
|
+
workosSpy.mockImplementationOnce(() => {
|
|
212
|
+
throw new axios_1.AxiosError('Could not authorize the request. Maybe your API key is invalid?', '401');
|
|
213
|
+
});
|
|
215
214
|
const workos = new workos_1.WorkOS('invalid apikey');
|
|
216
|
-
yield expect(workos.auditLogs.getExport('audit_log_export_1234')).rejects.
|
|
215
|
+
yield expect(workos.auditLogs.getExport('audit_log_export_1234')).rejects.toThrowError(new exceptions_1.UnauthorizedException('a-request-id'));
|
|
216
|
+
expect(workosSpy).toHaveBeenCalledWith(`/audit_logs/exports/audit_log_export_1234`);
|
|
217
217
|
}));
|
|
218
218
|
});
|
|
219
219
|
});
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
export interface AuditLogExportOptions {
|
|
2
2
|
actions?: string[];
|
|
3
3
|
/**
|
|
4
|
-
* @deprecated Please use `
|
|
4
|
+
* @deprecated Please use `actorNames` instead.
|
|
5
5
|
*/
|
|
6
6
|
actors?: string[];
|
|
7
|
+
actorNames?: string[];
|
|
8
|
+
actorIds?: string[];
|
|
9
|
+
organizationId: string;
|
|
10
|
+
rangeEnd: Date;
|
|
11
|
+
rangeStart: Date;
|
|
12
|
+
targets?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface SerializedAuditLogExportOptions {
|
|
15
|
+
actions?: string[];
|
|
16
|
+
actors?: string[];
|
|
7
17
|
actor_names?: string[];
|
|
8
18
|
actor_ids?: string[];
|
|
9
19
|
organization_id: string;
|
|
10
|
-
range_end:
|
|
11
|
-
range_start:
|
|
20
|
+
range_end: string;
|
|
21
|
+
range_start: string;
|
|
12
22
|
targets?: string[];
|
|
13
23
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export interface AuditLogExport {
|
|
2
|
+
object: 'audit_log_export';
|
|
3
|
+
id: string;
|
|
4
|
+
state: 'pending' | 'ready' | 'error';
|
|
5
|
+
url?: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
updatedAt: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AuditLogExportResponse {
|
|
2
10
|
object: 'audit_log_export';
|
|
3
11
|
id: string;
|
|
4
12
|
state: 'pending' | 'ready' | 'error';
|
|
@@ -14,7 +14,19 @@ export interface AuditLogTarget {
|
|
|
14
14
|
export interface CreateAuditLogEventOptions {
|
|
15
15
|
action: string;
|
|
16
16
|
version?: number;
|
|
17
|
-
|
|
17
|
+
occurredAt: Date;
|
|
18
|
+
actor: AuditLogActor;
|
|
19
|
+
targets: AuditLogTarget[];
|
|
20
|
+
context: {
|
|
21
|
+
location: string;
|
|
22
|
+
userAgent?: string;
|
|
23
|
+
};
|
|
24
|
+
metadata?: Record<string, string | number | boolean>;
|
|
25
|
+
}
|
|
26
|
+
export interface SerializedCreateAuditLogEventOptions {
|
|
27
|
+
action: string;
|
|
28
|
+
version?: number;
|
|
29
|
+
occurred_at: string;
|
|
18
30
|
actor: AuditLogActor;
|
|
19
31
|
targets: AuditLogTarget[];
|
|
20
32
|
context: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeAuditLogExportOptions = void 0;
|
|
4
|
+
const serializeAuditLogExportOptions = (options) => ({
|
|
5
|
+
actions: options.actions,
|
|
6
|
+
actors: options.actors,
|
|
7
|
+
actor_names: options.actorNames,
|
|
8
|
+
actor_ids: options.actorIds,
|
|
9
|
+
organization_id: options.organizationId,
|
|
10
|
+
range_end: options.rangeEnd.toISOString(),
|
|
11
|
+
range_start: options.rangeStart.toISOString(),
|
|
12
|
+
targets: options.targets,
|
|
13
|
+
});
|
|
14
|
+
exports.serializeAuditLogExportOptions = serializeAuditLogExportOptions;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeAuditLogExport = void 0;
|
|
4
|
+
const deserializeAuditLogExport = (auditLogExport) => ({
|
|
5
|
+
object: auditLogExport.object,
|
|
6
|
+
id: auditLogExport.id,
|
|
7
|
+
state: auditLogExport.state,
|
|
8
|
+
url: auditLogExport.url,
|
|
9
|
+
createdAt: auditLogExport.created_at,
|
|
10
|
+
updatedAt: auditLogExport.updated_at,
|
|
11
|
+
});
|
|
12
|
+
exports.deserializeAuditLogExport = deserializeAuditLogExport;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeCreateAuditLogEventOptions = void 0;
|
|
4
|
+
const serializeCreateAuditLogEventOptions = (event) => ({
|
|
5
|
+
action: event.action,
|
|
6
|
+
version: event.version,
|
|
7
|
+
occurred_at: event.occurredAt.toISOString(),
|
|
8
|
+
actor: event.actor,
|
|
9
|
+
targets: event.targets,
|
|
10
|
+
context: {
|
|
11
|
+
location: event.context.location,
|
|
12
|
+
user_agent: event.context.userAgent,
|
|
13
|
+
},
|
|
14
|
+
metadata: event.metadata,
|
|
15
|
+
});
|
|
16
|
+
exports.serializeCreateAuditLogEventOptions = serializeCreateAuditLogEventOptions;
|
|
@@ -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("./audit-log-export.serializer"), exports);
|
|
18
|
+
__exportStar(require("./audit-log-export-options.serializer"), exports);
|
|
19
|
+
__exportStar(require("./create-audit-log-event-options.serializer"), exports);
|
|
@@ -34,6 +34,7 @@ describe('AuditTrail', () => {
|
|
|
34
34
|
describe('when the api responds with a 201 CREATED', () => {
|
|
35
35
|
describe('with an idempotency key', () => {
|
|
36
36
|
it('includes an idempotency key with request', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
var _a;
|
|
37
38
|
mock
|
|
38
39
|
.onPost('/events', serializeEventOptions(event))
|
|
39
40
|
.replyOnce(201, { success: true });
|
|
@@ -41,7 +42,7 @@ describe('AuditTrail', () => {
|
|
|
41
42
|
yield expect(workos.auditTrail.createEvent(event, {
|
|
42
43
|
idempotencyKey: 'the-idempotency-key',
|
|
43
44
|
})).resolves.toBeUndefined();
|
|
44
|
-
expect(mock.history.post[0].headers['Idempotency-Key']).toEqual('the-idempotency-key');
|
|
45
|
+
expect((_a = mock.history.post[0].headers) === null || _a === void 0 ? void 0 : _a['Idempotency-Key']).toEqual('the-idempotency-key');
|
|
45
46
|
}));
|
|
46
47
|
});
|
|
47
48
|
it('posts Event successfully', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './get-options.interface';
|
|
2
|
+
export * from './list.interface';
|
|
2
3
|
export * from './post-options.interface';
|
|
3
4
|
export * from './put-options.interface';
|
|
4
5
|
export * from './unprocessable-entity-error.interface';
|
|
5
6
|
export * from './workos-options.interface';
|
|
7
|
+
export * from './workos-response-error.interface';
|
|
@@ -15,7 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./get-options.interface"), exports);
|
|
18
|
+
__exportStar(require("./list.interface"), exports);
|
|
18
19
|
__exportStar(require("./post-options.interface"), exports);
|
|
19
20
|
__exportStar(require("./put-options.interface"), exports);
|
|
20
21
|
__exportStar(require("./unprocessable-entity-error.interface"), exports);
|
|
21
22
|
__exportStar(require("./workos-options.interface"), exports);
|
|
23
|
+
__exportStar(require("./workos-response-error.interface"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './list.serializer';
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./list.serializer"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeList = void 0;
|
|
4
|
+
const deserializeList = (list, deserializer) => ({
|
|
5
|
+
object: 'list',
|
|
6
|
+
data: list.data.map(deserializer),
|
|
7
|
+
listMetadata: list.list_metadata,
|
|
8
|
+
});
|
|
9
|
+
exports.deserializeList = deserializeList;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mockWorkOsResponse = void 0;
|
|
4
|
+
const mockWorkOsResponse = (status, data) => ({
|
|
5
|
+
data,
|
|
6
|
+
status,
|
|
7
|
+
headers: {},
|
|
8
|
+
statusText: '',
|
|
9
|
+
config: {},
|
|
10
|
+
});
|
|
11
|
+
exports.mockWorkOsResponse = mockWorkOsResponse;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { WorkOS } from '../workos';
|
|
2
|
-
import { Directory } from './interfaces
|
|
3
|
-
import {
|
|
4
|
-
import { Group } from './interfaces/group.interface';
|
|
5
|
-
import { DefaultCustomAttributes, UserWithGroups } from './interfaces/user.interface';
|
|
6
|
-
import { ListDirectoriesOptions } from './interfaces/list-directories-options.interface';
|
|
7
|
-
import { ListGroupsOptions } from './interfaces/list-groups-options.interface';
|
|
8
|
-
import { ListUsersOptions } from './interfaces/list-users-options.interface';
|
|
2
|
+
import { DefaultCustomAttributes, Directory, DirectoryGroup, DirectoryUserWithGroups, ListDirectoriesOptions, ListDirectoryUsersOptions, ListGroupsOptions } from './interfaces';
|
|
3
|
+
import { DeserializedList } from '../common/interfaces';
|
|
9
4
|
export declare class DirectorySync {
|
|
10
5
|
private readonly workos;
|
|
11
6
|
constructor(workos: WorkOS);
|
|
12
|
-
listDirectories(options?: ListDirectoriesOptions): Promise<
|
|
7
|
+
listDirectories(options?: ListDirectoriesOptions): Promise<DeserializedList<Directory>>;
|
|
13
8
|
getDirectory(id: string): Promise<Directory>;
|
|
14
9
|
deleteDirectory(id: string): Promise<void>;
|
|
15
|
-
listGroups(options: ListGroupsOptions): Promise<
|
|
16
|
-
listUsers<TCustomAttributes extends object = DefaultCustomAttributes>(options:
|
|
17
|
-
getUser<TCustomAttributes extends object = DefaultCustomAttributes>(user: string): Promise<
|
|
18
|
-
getGroup(group: string): Promise<
|
|
10
|
+
listGroups(options: ListGroupsOptions): Promise<DeserializedList<DirectoryGroup>>;
|
|
11
|
+
listUsers<TCustomAttributes extends object = DefaultCustomAttributes>(options: ListDirectoryUsersOptions): Promise<DeserializedList<DirectoryUserWithGroups<TCustomAttributes>>>;
|
|
12
|
+
getUser<TCustomAttributes extends object = DefaultCustomAttributes>(user: string): Promise<DirectoryUserWithGroups<TCustomAttributes>>;
|
|
13
|
+
getGroup(group: string): Promise<DirectoryGroup>;
|
|
19
14
|
}
|