@workos-inc/node 7.75.1 → 7.77.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/directory-sync/directory-sync.spec.js +5 -3
- package/lib/directory-sync/interfaces/directory-user.interface.d.ts +2 -0
- package/lib/directory-sync/serializers/directory-user.serializer.js +2 -0
- package/lib/pipes/fixtures/get-access-token-needs-reauth.json +4 -0
- package/lib/pipes/fixtures/get-access-token-no-expiry.json +10 -0
- package/lib/pipes/fixtures/get-access-token-not-installed.json +4 -0
- package/lib/pipes/fixtures/get-access-token-success.json +10 -0
- package/lib/pipes/interfaces/access-token.interface.d.ts +14 -0
- package/lib/pipes/interfaces/access-token.interface.js +2 -0
- package/lib/pipes/interfaces/get-access-token.interface.d.ts +27 -0
- package/lib/pipes/interfaces/get-access-token.interface.js +2 -0
- package/lib/pipes/pipes.d.ts +9 -0
- package/lib/pipes/pipes.js +37 -0
- package/lib/pipes/pipes.spec.d.ts +1 -0
- package/lib/pipes/pipes.spec.js +109 -0
- package/lib/pipes/serializers/access-token.serializer.d.ts +2 -0
- package/lib/pipes/serializers/access-token.serializer.js +15 -0
- package/lib/pipes/serializers/get-access-token.serializer.d.ts +3 -0
- package/lib/pipes/serializers/get-access-token.serializer.js +24 -0
- package/lib/sso/interfaces/profile.interface.d.ts +2 -0
- package/lib/sso/serializers/profile.serializer.js +1 -0
- package/lib/sso/sso.spec.js +5 -0
- package/lib/workos.d.ts +2 -0
- package/lib/workos.js +3 -1
- package/package.json +1 -1
|
@@ -120,7 +120,7 @@ describe('DirectorySync', () => {
|
|
|
120
120
|
created_at: '2021-10-27 15:21:50.640959',
|
|
121
121
|
updated_at: '2021-12-13 12:15:45.531847',
|
|
122
122
|
};
|
|
123
|
-
const
|
|
123
|
+
const userWithRoles = {
|
|
124
124
|
object: 'directory_user',
|
|
125
125
|
id: 'directory_user_456',
|
|
126
126
|
customAttributes: {
|
|
@@ -145,6 +145,7 @@ describe('DirectorySync', () => {
|
|
|
145
145
|
state: 'active',
|
|
146
146
|
username: 'jonsnow',
|
|
147
147
|
role: { slug: 'super_admin' },
|
|
148
|
+
roles: [{ slug: 'super_admin' }],
|
|
148
149
|
createdAt: '2021-10-27 15:21:50.640959',
|
|
149
150
|
updatedAt: '2021-12-13 12:15:45.531847',
|
|
150
151
|
};
|
|
@@ -173,6 +174,7 @@ describe('DirectorySync', () => {
|
|
|
173
174
|
state: 'active',
|
|
174
175
|
username: 'jonsnow',
|
|
175
176
|
role: { slug: 'super_admin' },
|
|
177
|
+
roles: [{ slug: 'super_admin' }],
|
|
176
178
|
created_at: '2021-10-27 15:21:50.640959',
|
|
177
179
|
updated_at: '2021-12-13 12:15:45.531847',
|
|
178
180
|
};
|
|
@@ -409,11 +411,11 @@ describe('DirectorySync', () => {
|
|
|
409
411
|
const subject = yield workos.directorySync.getUser('dir_usr_123');
|
|
410
412
|
expect(subject).toEqual(userWithGroup);
|
|
411
413
|
}));
|
|
412
|
-
describe('with
|
|
414
|
+
describe('with roles', () => {
|
|
413
415
|
it(`requests a Directory User`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
414
416
|
(0, test_utils_1.fetchOnce)(userWithRoleResponse);
|
|
415
417
|
const subject = yield workos.directorySync.getUser('directory_user_456');
|
|
416
|
-
expect(subject).toEqual(
|
|
418
|
+
expect(subject).toEqual(userWithRoles);
|
|
417
419
|
}));
|
|
418
420
|
});
|
|
419
421
|
});
|
|
@@ -33,6 +33,7 @@ export interface DirectoryUser<TCustomAttributes extends object = DefaultCustomA
|
|
|
33
33
|
jobTitle: string | null;
|
|
34
34
|
state: 'active' | 'inactive';
|
|
35
35
|
role?: RoleResponse;
|
|
36
|
+
roles?: RoleResponse[];
|
|
36
37
|
createdAt: string;
|
|
37
38
|
updatedAt: string;
|
|
38
39
|
}
|
|
@@ -68,6 +69,7 @@ export interface DirectoryUserResponse<TCustomAttributes extends object = Defaul
|
|
|
68
69
|
job_title: string | null;
|
|
69
70
|
state: 'active' | 'inactive';
|
|
70
71
|
role?: RoleResponse;
|
|
72
|
+
roles?: RoleResponse[];
|
|
71
73
|
created_at: string;
|
|
72
74
|
updated_at: string;
|
|
73
75
|
}
|
|
@@ -18,6 +18,7 @@ const deserializeDirectoryUser = (directoryUser) => ({
|
|
|
18
18
|
jobTitle: directoryUser.job_title,
|
|
19
19
|
state: directoryUser.state,
|
|
20
20
|
role: directoryUser.role,
|
|
21
|
+
roles: directoryUser.roles,
|
|
21
22
|
createdAt: directoryUser.created_at,
|
|
22
23
|
updatedAt: directoryUser.updated_at,
|
|
23
24
|
});
|
|
@@ -40,6 +41,7 @@ const deserializeUpdatedEventDirectoryUser = (directoryUser) => ({
|
|
|
40
41
|
jobTitle: directoryUser.job_title,
|
|
41
42
|
state: directoryUser.state,
|
|
42
43
|
role: directoryUser.role,
|
|
44
|
+
roles: directoryUser.roles,
|
|
43
45
|
createdAt: directoryUser.created_at,
|
|
44
46
|
updatedAt: directoryUser.updated_at,
|
|
45
47
|
previousAttributes: directoryUser.previous_attributes,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface AccessToken {
|
|
2
|
+
object: 'access_token';
|
|
3
|
+
accessToken: string;
|
|
4
|
+
expiresAt: Date | null;
|
|
5
|
+
scopes: string[];
|
|
6
|
+
missingScopes: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface SerializedAccessToken {
|
|
9
|
+
object: 'access_token';
|
|
10
|
+
access_token: string;
|
|
11
|
+
expires_at: string | null;
|
|
12
|
+
scopes: string[];
|
|
13
|
+
missing_scopes: string[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AccessToken, SerializedAccessToken } from './access-token.interface';
|
|
2
|
+
export interface GetAccessTokenOptions {
|
|
3
|
+
userId: string;
|
|
4
|
+
organizationId?: string | null;
|
|
5
|
+
}
|
|
6
|
+
export interface SerializedGetAccessTokenOptions {
|
|
7
|
+
user_id: string;
|
|
8
|
+
organization_id?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface GetAccessTokenSuccessResponse {
|
|
11
|
+
active: true;
|
|
12
|
+
accessToken: AccessToken;
|
|
13
|
+
}
|
|
14
|
+
export interface GetAccessTokenFailureResponse {
|
|
15
|
+
active: false;
|
|
16
|
+
error: 'not_installed' | 'needs_reauthorization';
|
|
17
|
+
}
|
|
18
|
+
export type GetAccessTokenResponse = GetAccessTokenSuccessResponse | GetAccessTokenFailureResponse;
|
|
19
|
+
export interface SerializedGetAccessTokenSuccessResponse {
|
|
20
|
+
active: true;
|
|
21
|
+
access_token: SerializedAccessToken;
|
|
22
|
+
}
|
|
23
|
+
export interface SerializedGetAccessTokenFailureResponse {
|
|
24
|
+
active: false;
|
|
25
|
+
error: 'not_installed' | 'needs_reauthorization';
|
|
26
|
+
}
|
|
27
|
+
export type SerializedGetAccessTokenResponse = SerializedGetAccessTokenSuccessResponse | SerializedGetAccessTokenFailureResponse;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkOS } from '../workos';
|
|
2
|
+
import { GetAccessTokenOptions, GetAccessTokenResponse } from './interfaces/get-access-token.interface';
|
|
3
|
+
export declare class Pipes {
|
|
4
|
+
private readonly workos;
|
|
5
|
+
constructor(workos: WorkOS);
|
|
6
|
+
getAccessToken({ provider, ...options }: GetAccessTokenOptions & {
|
|
7
|
+
provider: string;
|
|
8
|
+
}): Promise<GetAccessTokenResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.Pipes = void 0;
|
|
24
|
+
const get_access_token_serializer_1 = require("./serializers/get-access-token.serializer");
|
|
25
|
+
class Pipes {
|
|
26
|
+
constructor(workos) {
|
|
27
|
+
this.workos = workos;
|
|
28
|
+
}
|
|
29
|
+
getAccessToken(_a) {
|
|
30
|
+
var { provider } = _a, options = __rest(_a, ["provider"]);
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const { data } = yield this.workos.post(`data-integrations/${provider}/token`, (0, get_access_token_serializer_1.serializeGetAccessTokenOptions)(options));
|
|
33
|
+
return (0, get_access_token_serializer_1.deserializeGetAccessTokenResponse)(data);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.Pipes = Pipes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const jest_fetch_mock_1 = __importDefault(require("jest-fetch-mock"));
|
|
16
|
+
const test_utils_1 = require("../common/utils/test-utils");
|
|
17
|
+
const workos_1 = require("../workos");
|
|
18
|
+
const get_access_token_success_json_1 = __importDefault(require("./fixtures/get-access-token-success.json"));
|
|
19
|
+
const get_access_token_no_expiry_json_1 = __importDefault(require("./fixtures/get-access-token-no-expiry.json"));
|
|
20
|
+
const get_access_token_not_installed_json_1 = __importDefault(require("./fixtures/get-access-token-not-installed.json"));
|
|
21
|
+
const get_access_token_needs_reauth_json_1 = __importDefault(require("./fixtures/get-access-token-needs-reauth.json"));
|
|
22
|
+
describe('Pipes', () => {
|
|
23
|
+
let workos;
|
|
24
|
+
beforeAll(() => {
|
|
25
|
+
workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU', {
|
|
26
|
+
apiHostname: 'api.workos.test',
|
|
27
|
+
clientId: 'proj_123',
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
beforeEach(() => jest_fetch_mock_1.default.resetMocks());
|
|
31
|
+
describe('getAccessToken', () => {
|
|
32
|
+
it('returns access token with expiry date', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
(0, test_utils_1.fetchOnce)(get_access_token_success_json_1.default);
|
|
34
|
+
const response = yield workos.pipes.getAccessToken({
|
|
35
|
+
provider: 'test-provider',
|
|
36
|
+
userId: 'user_123',
|
|
37
|
+
organizationId: 'org_456',
|
|
38
|
+
});
|
|
39
|
+
expect((0, test_utils_1.fetchURL)()).toContain('/data-integrations/test-provider/token');
|
|
40
|
+
expect((0, test_utils_1.fetchBody)()).toEqual({
|
|
41
|
+
user_id: 'user_123',
|
|
42
|
+
organization_id: 'org_456',
|
|
43
|
+
});
|
|
44
|
+
expect(response).toEqual({
|
|
45
|
+
active: true,
|
|
46
|
+
accessToken: {
|
|
47
|
+
object: 'access_token',
|
|
48
|
+
accessToken: 'test_access_token_123',
|
|
49
|
+
expiresAt: new Date('2025-10-18T12:00:00.000Z'),
|
|
50
|
+
scopes: ['read:users', 'write:users'],
|
|
51
|
+
missingScopes: [],
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}));
|
|
55
|
+
it('returns access token without expiry date', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
(0, test_utils_1.fetchOnce)(get_access_token_no_expiry_json_1.default);
|
|
57
|
+
const response = yield workos.pipes.getAccessToken({
|
|
58
|
+
provider: 'test-provider',
|
|
59
|
+
userId: 'user_789',
|
|
60
|
+
});
|
|
61
|
+
expect((0, test_utils_1.fetchURL)()).toContain('/data-integrations/test-provider/token');
|
|
62
|
+
expect((0, test_utils_1.fetchBody)()).toEqual({
|
|
63
|
+
user_id: 'user_789',
|
|
64
|
+
organization_id: undefined,
|
|
65
|
+
});
|
|
66
|
+
expect(response).toEqual({
|
|
67
|
+
active: true,
|
|
68
|
+
accessToken: {
|
|
69
|
+
object: 'access_token',
|
|
70
|
+
accessToken: 'test_access_token_456',
|
|
71
|
+
expiresAt: null,
|
|
72
|
+
scopes: ['read:data'],
|
|
73
|
+
missingScopes: ['write:data'],
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}));
|
|
77
|
+
it('returns not_installed failure when integration is not installed', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
+
(0, test_utils_1.fetchOnce)(get_access_token_not_installed_json_1.default);
|
|
79
|
+
const response = yield workos.pipes.getAccessToken({
|
|
80
|
+
provider: 'test-provider',
|
|
81
|
+
userId: 'user_123',
|
|
82
|
+
});
|
|
83
|
+
expect((0, test_utils_1.fetchURL)()).toContain('/data-integrations/test-provider/token');
|
|
84
|
+
expect(response).toEqual({
|
|
85
|
+
active: false,
|
|
86
|
+
error: 'not_installed',
|
|
87
|
+
});
|
|
88
|
+
}));
|
|
89
|
+
it('returns needs_reauthorization failure when token needs refresh', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
90
|
+
(0, test_utils_1.fetchOnce)(get_access_token_needs_reauth_json_1.default);
|
|
91
|
+
const response = yield workos.pipes.getAccessToken({
|
|
92
|
+
provider: 'test-provider',
|
|
93
|
+
userId: 'user_123',
|
|
94
|
+
});
|
|
95
|
+
expect((0, test_utils_1.fetchURL)()).toContain('/data-integrations/test-provider/token');
|
|
96
|
+
expect(response).toEqual({
|
|
97
|
+
active: false,
|
|
98
|
+
error: 'needs_reauthorization',
|
|
99
|
+
});
|
|
100
|
+
}));
|
|
101
|
+
it('throws error for server errors', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
|
+
(0, test_utils_1.fetchOnce)({ message: 'Internal Server Error' }, { status: 500 });
|
|
103
|
+
yield expect(workos.pipes.getAccessToken({
|
|
104
|
+
provider: 'test-provider',
|
|
105
|
+
userId: 'user_123',
|
|
106
|
+
})).rejects.toThrow();
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
109
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeAccessToken = void 0;
|
|
4
|
+
function deserializeAccessToken(serialized) {
|
|
5
|
+
return {
|
|
6
|
+
object: 'access_token',
|
|
7
|
+
accessToken: serialized.access_token,
|
|
8
|
+
expiresAt: serialized.expires_at
|
|
9
|
+
? new Date(Date.parse(serialized.expires_at))
|
|
10
|
+
: null,
|
|
11
|
+
scopes: serialized.scopes,
|
|
12
|
+
missingScopes: serialized.missing_scopes,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.deserializeAccessToken = deserializeAccessToken;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GetAccessTokenOptions, GetAccessTokenResponse, SerializedGetAccessTokenOptions, SerializedGetAccessTokenResponse } from '../interfaces/get-access-token.interface';
|
|
2
|
+
export declare function serializeGetAccessTokenOptions(options: GetAccessTokenOptions): SerializedGetAccessTokenOptions;
|
|
3
|
+
export declare function deserializeGetAccessTokenResponse(response: SerializedGetAccessTokenResponse): GetAccessTokenResponse;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeGetAccessTokenResponse = exports.serializeGetAccessTokenOptions = void 0;
|
|
4
|
+
const access_token_serializer_1 = require("./access-token.serializer");
|
|
5
|
+
function serializeGetAccessTokenOptions(options) {
|
|
6
|
+
return {
|
|
7
|
+
user_id: options.userId,
|
|
8
|
+
organization_id: options.organizationId,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
exports.serializeGetAccessTokenOptions = serializeGetAccessTokenOptions;
|
|
12
|
+
function deserializeGetAccessTokenResponse(response) {
|
|
13
|
+
if (response.active) {
|
|
14
|
+
return {
|
|
15
|
+
active: true,
|
|
16
|
+
accessToken: (0, access_token_serializer_1.deserializeAccessToken)(response.access_token),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
active: false,
|
|
21
|
+
error: response.error,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.deserializeGetAccessTokenResponse = deserializeGetAccessTokenResponse;
|
|
@@ -11,6 +11,7 @@ export interface Profile<CustomAttributesType extends UnknownRecord> {
|
|
|
11
11
|
firstName?: string;
|
|
12
12
|
lastName?: string;
|
|
13
13
|
role?: RoleResponse;
|
|
14
|
+
roles?: RoleResponse[];
|
|
14
15
|
groups?: string[];
|
|
15
16
|
customAttributes?: CustomAttributesType;
|
|
16
17
|
rawAttributes?: {
|
|
@@ -27,6 +28,7 @@ export interface ProfileResponse<CustomAttributesType extends UnknownRecord> {
|
|
|
27
28
|
first_name?: string;
|
|
28
29
|
last_name?: string;
|
|
29
30
|
role?: RoleResponse;
|
|
31
|
+
roles?: RoleResponse[];
|
|
30
32
|
groups?: string[];
|
|
31
33
|
custom_attributes?: CustomAttributesType;
|
|
32
34
|
raw_attributes?: {
|
|
@@ -11,6 +11,7 @@ const deserializeProfile = (profile) => ({
|
|
|
11
11
|
firstName: profile.first_name,
|
|
12
12
|
lastName: profile.last_name,
|
|
13
13
|
role: profile.role,
|
|
14
|
+
roles: profile.roles,
|
|
14
15
|
groups: profile.groups,
|
|
15
16
|
customAttributes: profile.custom_attributes,
|
|
16
17
|
rawAttributes: profile.raw_attributes,
|
package/lib/sso/sso.spec.js
CHANGED
|
@@ -227,6 +227,7 @@ describe('SSO', () => {
|
|
|
227
227
|
role: {
|
|
228
228
|
slug: 'admin',
|
|
229
229
|
},
|
|
230
|
+
roles: [{ slug: 'admin' }],
|
|
230
231
|
groups: ['Admins', 'Developers'],
|
|
231
232
|
raw_attributes: {
|
|
232
233
|
email: 'foo@test.com',
|
|
@@ -268,6 +269,7 @@ describe('SSO', () => {
|
|
|
268
269
|
role: {
|
|
269
270
|
slug: 'admin',
|
|
270
271
|
},
|
|
272
|
+
roles: [{ slug: 'admin' }],
|
|
271
273
|
raw_attributes: {
|
|
272
274
|
email: 'foo@test.com',
|
|
273
275
|
first_name: 'foo',
|
|
@@ -304,6 +306,7 @@ describe('SSO', () => {
|
|
|
304
306
|
role: {
|
|
305
307
|
slug: 'admin',
|
|
306
308
|
},
|
|
309
|
+
roles: [{ slug: 'admin' }],
|
|
307
310
|
groups: ['Admins', 'Developers'],
|
|
308
311
|
raw_attributes: {
|
|
309
312
|
email: 'foo@test.com',
|
|
@@ -352,6 +355,7 @@ describe('SSO', () => {
|
|
|
352
355
|
role: {
|
|
353
356
|
slug: 'admin',
|
|
354
357
|
},
|
|
358
|
+
roles: [{ slug: 'admin' }],
|
|
355
359
|
raw_attributes: {
|
|
356
360
|
email: 'foo@test.com',
|
|
357
361
|
first_name: 'foo',
|
|
@@ -386,6 +390,7 @@ describe('SSO', () => {
|
|
|
386
390
|
role: {
|
|
387
391
|
slug: 'admin',
|
|
388
392
|
},
|
|
393
|
+
roles: [{ slug: 'admin' }],
|
|
389
394
|
groups: ['Admins', 'Developers'],
|
|
390
395
|
raw_attributes: {
|
|
391
396
|
email: 'foo@test.com',
|
package/lib/workos.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Events } from './events/events';
|
|
|
5
5
|
import { Organizations } from './organizations/organizations';
|
|
6
6
|
import { OrganizationDomains } from './organization-domains/organization-domains';
|
|
7
7
|
import { Passwordless } from './passwordless/passwordless';
|
|
8
|
+
import { Pipes } from './pipes/pipes';
|
|
8
9
|
import { Portal } from './portal/portal';
|
|
9
10
|
import { SSO } from './sso/sso';
|
|
10
11
|
import { Webhooks } from './webhooks/webhooks';
|
|
@@ -31,6 +32,7 @@ export declare class WorkOS {
|
|
|
31
32
|
readonly organizations: Organizations;
|
|
32
33
|
readonly organizationDomains: OrganizationDomains;
|
|
33
34
|
readonly passwordless: Passwordless;
|
|
35
|
+
readonly pipes: Pipes;
|
|
34
36
|
readonly portal: Portal;
|
|
35
37
|
readonly sso: SSO;
|
|
36
38
|
readonly webhooks: Webhooks;
|
package/lib/workos.js
CHANGED
|
@@ -17,6 +17,7 @@ const events_1 = require("./events/events");
|
|
|
17
17
|
const organizations_1 = require("./organizations/organizations");
|
|
18
18
|
const organization_domains_1 = require("./organization-domains/organization-domains");
|
|
19
19
|
const passwordless_1 = require("./passwordless/passwordless");
|
|
20
|
+
const pipes_1 = require("./pipes/pipes");
|
|
20
21
|
const portal_1 = require("./portal/portal");
|
|
21
22
|
const sso_1 = require("./sso/sso");
|
|
22
23
|
const webhooks_1 = require("./webhooks/webhooks");
|
|
@@ -33,7 +34,7 @@ const actions_1 = require("./actions/actions");
|
|
|
33
34
|
const vault_1 = require("./vault/vault");
|
|
34
35
|
const conflict_exception_1 = require("./common/exceptions/conflict.exception");
|
|
35
36
|
const parse_error_1 = require("./common/exceptions/parse-error");
|
|
36
|
-
const VERSION = '7.
|
|
37
|
+
const VERSION = '7.77.0';
|
|
37
38
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
38
39
|
const HEADER_AUTHORIZATION = 'Authorization';
|
|
39
40
|
const HEADER_IDEMPOTENCY_KEY = 'Idempotency-Key';
|
|
@@ -48,6 +49,7 @@ class WorkOS {
|
|
|
48
49
|
this.organizations = new organizations_1.Organizations(this);
|
|
49
50
|
this.organizationDomains = new organization_domains_1.OrganizationDomains(this);
|
|
50
51
|
this.passwordless = new passwordless_1.Passwordless(this);
|
|
52
|
+
this.pipes = new pipes_1.Pipes(this);
|
|
51
53
|
this.portal = new portal_1.Portal(this);
|
|
52
54
|
this.sso = new sso_1.SSO(this);
|
|
53
55
|
this.mfa = new mfa_1.Mfa(this);
|
package/package.json
CHANGED