@workos-inc/node 1.6.0 → 2.0.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.
- package/lib/audit-trail/audit-trail.spec.js +2 -2
- package/lib/common/interfaces/list.interface.d.ts +2 -1
- package/lib/directory-sync/interfaces/directory.interface.d.ts +1 -1
- package/lib/organizations/fixtures/list-organizations.json +1 -1
- package/lib/organizations/organizations.spec.js +1 -1
- package/lib/sso/interfaces/connection.interface.d.ts +1 -1
- package/lib/sso/interfaces/profile.interface.d.ts +1 -1
- package/lib/webhooks/interfaces/index.d.ts +1 -0
- package/lib/webhooks/interfaces/index.js +1 -0
- package/lib/webhooks/interfaces/webhook-directory.interface.d.ts +4 -0
- package/lib/webhooks/interfaces/webhook-directory.interface.js +2 -0
- package/lib/webhooks/interfaces/webhook.interface.d.ts +76 -3
- package/lib/workos.js +1 -1
- package/package.json +1 -1
|
@@ -127,7 +127,7 @@ describe('AuditTrail', () => {
|
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
],
|
|
130
|
-
|
|
130
|
+
list_metadata: { before: null, after: null },
|
|
131
131
|
});
|
|
132
132
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
133
133
|
const events = yield workos.auditTrail.listEvents();
|
|
@@ -159,7 +159,7 @@ describe('AuditTrail', () => {
|
|
|
159
159
|
},
|
|
160
160
|
},
|
|
161
161
|
],
|
|
162
|
-
|
|
162
|
+
list_metadata: { before: null, after: null },
|
|
163
163
|
});
|
|
164
164
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
165
165
|
const events = yield workos.auditTrail.listEvents({
|
|
@@ -28,7 +28,7 @@ describe('Organizations', () => {
|
|
|
28
28
|
describe('without any options', () => {
|
|
29
29
|
it('returns organizations and metadata', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
30
|
mock.onGet().reply(200, list_organizations_json_1.default);
|
|
31
|
-
const { data, listMetadata } = yield workos.organizations.listOrganizations();
|
|
31
|
+
const { data, list_metadata: listMetadata } = yield workos.organizations.listOrganizations();
|
|
32
32
|
expect(mock.history.get[0].params).toBeUndefined();
|
|
33
33
|
expect(mock.history.get[0].url).toEqual('/organizations');
|
|
34
34
|
expect(data).toHaveLength(7);
|
|
@@ -1,5 +1,78 @@
|
|
|
1
|
-
|
|
1
|
+
import { Group, User } from '../../directory-sync/interfaces';
|
|
2
|
+
import { Connection } from '../../sso/interfaces';
|
|
3
|
+
import { WebhookDirectory as Directory } from './webhook-directory.interface';
|
|
4
|
+
interface WebhookBase {
|
|
2
5
|
id: string;
|
|
3
|
-
event: string;
|
|
4
|
-
data: Record<string, any>;
|
|
5
6
|
}
|
|
7
|
+
export interface ConnectionActivatedWebhook extends WebhookBase {
|
|
8
|
+
event: 'connection.activated';
|
|
9
|
+
data: Connection;
|
|
10
|
+
}
|
|
11
|
+
export interface ConnectionDeactivatedWebhook extends WebhookBase {
|
|
12
|
+
event: 'connection.deactivated';
|
|
13
|
+
data: Connection;
|
|
14
|
+
}
|
|
15
|
+
export interface ConnectionDeletedWebhook extends WebhookBase {
|
|
16
|
+
event: 'connection.deleted';
|
|
17
|
+
data: Connection;
|
|
18
|
+
}
|
|
19
|
+
export interface DsyncActivatedWebhook extends WebhookBase {
|
|
20
|
+
event: 'dsync.activated';
|
|
21
|
+
data: Directory;
|
|
22
|
+
}
|
|
23
|
+
export interface DsyncDeactivatedWebhook extends WebhookBase {
|
|
24
|
+
event: 'dsync.deactivated';
|
|
25
|
+
data: Directory;
|
|
26
|
+
}
|
|
27
|
+
export interface DsyncDeletedWebhook extends WebhookBase {
|
|
28
|
+
event: 'dsync.deleted';
|
|
29
|
+
data: Directory;
|
|
30
|
+
}
|
|
31
|
+
export interface DsyncGroupCreatedWebhook extends WebhookBase {
|
|
32
|
+
event: 'dsync.group.created';
|
|
33
|
+
data: Group & {
|
|
34
|
+
directory_id: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface DsyncGroupDeletedWebhook extends WebhookBase {
|
|
38
|
+
event: 'dsync.group.deleted';
|
|
39
|
+
data: Group & {
|
|
40
|
+
directory_id: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface DsyncGroupUpdatedWebhook extends WebhookBase {
|
|
44
|
+
event: 'dsync.group.updated';
|
|
45
|
+
data: Group & {
|
|
46
|
+
directory_id: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface DsyncGroupUserAddedWebhook extends WebhookBase {
|
|
50
|
+
event: 'dsync.group.user_added';
|
|
51
|
+
data: {
|
|
52
|
+
directory_id: string;
|
|
53
|
+
user: User;
|
|
54
|
+
group: Group;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export interface DsyncGroupUserRemovedWebhook extends WebhookBase {
|
|
58
|
+
event: 'dsync.group.user_removed';
|
|
59
|
+
data: {
|
|
60
|
+
directory_id: string;
|
|
61
|
+
user: User;
|
|
62
|
+
group: Group;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface DsyncUserCreatedWebhook extends WebhookBase {
|
|
66
|
+
event: 'dsync.user.created';
|
|
67
|
+
data: User;
|
|
68
|
+
}
|
|
69
|
+
export interface DsyncUserDeletedWebhook extends WebhookBase {
|
|
70
|
+
event: 'dsync.user.deleted';
|
|
71
|
+
data: User;
|
|
72
|
+
}
|
|
73
|
+
export interface DsyncUserUpdatedWebhook extends WebhookBase {
|
|
74
|
+
event: 'dsync.user.updated';
|
|
75
|
+
data: User;
|
|
76
|
+
}
|
|
77
|
+
export declare type Webhook = ConnectionActivatedWebhook | ConnectionDeactivatedWebhook | ConnectionDeletedWebhook | DsyncActivatedWebhook | DsyncDeactivatedWebhook | DsyncDeletedWebhook | DsyncGroupCreatedWebhook | DsyncGroupUpdatedWebhook | DsyncGroupDeletedWebhook | DsyncGroupUserAddedWebhook | DsyncGroupUserRemovedWebhook | DsyncUserCreatedWebhook | DsyncUserUpdatedWebhook | DsyncUserDeletedWebhook;
|
|
78
|
+
export {};
|
package/lib/workos.js
CHANGED
|
@@ -22,7 +22,7 @@ const passwordless_1 = require("./passwordless/passwordless");
|
|
|
22
22
|
const portal_1 = require("./portal/portal");
|
|
23
23
|
const sso_1 = require("./sso/sso");
|
|
24
24
|
const webhooks_1 = require("./webhooks/webhooks");
|
|
25
|
-
const VERSION = '
|
|
25
|
+
const VERSION = '2.0.0';
|
|
26
26
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
27
27
|
class WorkOS {
|
|
28
28
|
constructor(key, options = {}) {
|
package/package.json
CHANGED