@workos-inc/node 3.1.0 → 3.1.1
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/common/interfaces/index.d.ts +0 -1
- package/lib/common/interfaces/index.js +0 -1
- package/lib/directory-sync/directory-sync.js +1 -1
- package/lib/directory-sync/directory-sync.spec.js +2 -0
- package/lib/directory-sync/interfaces/list-directories-options.interface.d.ts +5 -0
- package/lib/directory-sync/serializers/index.d.ts +1 -0
- package/lib/directory-sync/serializers/index.js +1 -0
- package/lib/directory-sync/serializers/list-directories-options.serializer.d.ts +2 -0
- package/lib/directory-sync/serializers/list-directories-options.serializer.js +13 -0
- package/lib/sso/serializers/index.d.ts +1 -0
- package/lib/sso/serializers/index.js +1 -0
- package/lib/sso/serializers/list-connections-options.serializer.d.ts +2 -0
- package/lib/sso/serializers/list-connections-options.serializer.js +13 -0
- package/lib/sso/sso.js +1 -1
- package/lib/sso/sso.spec.js +3 -1
- package/lib/users/interfaces/update-user-options.interface.d.ts +3 -8
- package/lib/workos.js +1 -1
- package/package.json +2 -2
- package/lib/common/interfaces/at-least-one-property-of.interface.d.ts +0 -7
- package/lib/common/interfaces/at-least-one-property-of.interface.js +0 -2
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./at-least-one-property-of.interface"), exports);
|
|
18
17
|
__exportStar(require("./event.interface"), exports);
|
|
19
18
|
__exportStar(require("./get-options.interface"), exports);
|
|
20
19
|
__exportStar(require("./list.interface"), exports);
|
|
@@ -19,7 +19,7 @@ class DirectorySync {
|
|
|
19
19
|
}
|
|
20
20
|
listDirectories(options) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
return new pagination_1.AutoPaginatable(yield (0, fetch_and_deserialize_1.fetchAndDeserialize)(this.workos, '/directories', serializers_1.deserializeDirectory, options), (params) => (0, fetch_and_deserialize_1.fetchAndDeserialize)(this.workos, '/directories', serializers_1.deserializeDirectory, params), options);
|
|
22
|
+
return new pagination_1.AutoPaginatable(yield (0, fetch_and_deserialize_1.fetchAndDeserialize)(this.workos, '/directories', serializers_1.deserializeDirectory, options ? (0, serializers_1.serializeListDirectoriesOptions)(options) : undefined), (params) => (0, fetch_and_deserialize_1.fetchAndDeserialize)(this.workos, '/directories', serializers_1.deserializeDirectory, params), options);
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
getDirectory(id) {
|
|
@@ -130,10 +130,12 @@ describe('DirectorySync', () => {
|
|
|
130
130
|
mock
|
|
131
131
|
.onGet('/directories', {
|
|
132
132
|
domain: 'google.com',
|
|
133
|
+
organization_id: 'org_1234',
|
|
133
134
|
})
|
|
134
135
|
.replyOnce(200, directoryListResponse);
|
|
135
136
|
const subject = yield workos.directorySync.listDirectories({
|
|
136
137
|
domain: 'google.com',
|
|
138
|
+
organizationId: 'org_1234',
|
|
137
139
|
});
|
|
138
140
|
expect(subject).toMatchObject({
|
|
139
141
|
object: 'list',
|
|
@@ -4,3 +4,8 @@ export interface ListDirectoriesOptions extends PaginationOptions {
|
|
|
4
4
|
organizationId?: string;
|
|
5
5
|
search?: string;
|
|
6
6
|
}
|
|
7
|
+
export interface SerializedListDirectoriesOptions extends PaginationOptions {
|
|
8
|
+
domain?: string;
|
|
9
|
+
organization_id?: string;
|
|
10
|
+
search?: string;
|
|
11
|
+
}
|
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./directory-group.serializer"), exports);
|
|
18
18
|
__exportStar(require("./directory-user.serializer"), exports);
|
|
19
19
|
__exportStar(require("./directory.serializer"), exports);
|
|
20
|
+
__exportStar(require("./list-directories-options.serializer"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeListDirectoriesOptions = void 0;
|
|
4
|
+
const serializeListDirectoriesOptions = (options) => ({
|
|
5
|
+
domain: options.domain,
|
|
6
|
+
organization_id: options.organizationId,
|
|
7
|
+
search: options.search,
|
|
8
|
+
limit: options.limit,
|
|
9
|
+
before: options.before,
|
|
10
|
+
after: options.after,
|
|
11
|
+
order: options.order,
|
|
12
|
+
});
|
|
13
|
+
exports.serializeListDirectoriesOptions = serializeListDirectoriesOptions;
|
|
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./connection.serializer"), exports);
|
|
18
|
+
__exportStar(require("./list-connections-options.serializer"), exports);
|
|
18
19
|
__exportStar(require("./profile-and-token.serializer"), exports);
|
|
19
20
|
__exportStar(require("./profile.serializer"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeListConnectionsOptions = void 0;
|
|
4
|
+
const serializeListConnectionsOptions = (options) => ({
|
|
5
|
+
connection_type: options.connectionType,
|
|
6
|
+
domain: options.domain,
|
|
7
|
+
organization_id: options.organizationId,
|
|
8
|
+
limit: options.limit,
|
|
9
|
+
before: options.before,
|
|
10
|
+
after: options.after,
|
|
11
|
+
order: options.order,
|
|
12
|
+
});
|
|
13
|
+
exports.serializeListConnectionsOptions = serializeListConnectionsOptions;
|
package/lib/sso/sso.js
CHANGED
|
@@ -30,7 +30,7 @@ class SSO {
|
|
|
30
30
|
}
|
|
31
31
|
listConnections(options) {
|
|
32
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
return new pagination_1.AutoPaginatable(yield (0, fetch_and_deserialize_1.fetchAndDeserialize)(this.workos, '/connections', serializers_1.deserializeConnection, options), (params) => (0, fetch_and_deserialize_1.fetchAndDeserialize)(this.workos, '/connections', serializers_1.deserializeConnection, params), options);
|
|
33
|
+
return new pagination_1.AutoPaginatable(yield (0, fetch_and_deserialize_1.fetchAndDeserialize)(this.workos, '/connections', serializers_1.deserializeConnection, options ? (0, serializers_1.serializeListConnectionsOptions)(options) : undefined), (params) => (0, fetch_and_deserialize_1.fetchAndDeserialize)(this.workos, '/connections', serializers_1.deserializeConnection, params), options);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
deleteConnection(id) {
|
package/lib/sso/sso.spec.js
CHANGED
|
@@ -309,7 +309,9 @@ describe('SSO', () => {
|
|
|
309
309
|
list_metadata: {},
|
|
310
310
|
});
|
|
311
311
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
312
|
-
const subject = yield workos.sso.listConnections(
|
|
312
|
+
const subject = yield workos.sso.listConnections({
|
|
313
|
+
organizationId: 'org_1234',
|
|
314
|
+
});
|
|
313
315
|
expect(mock.history.get[0].url).toEqual('/connections');
|
|
314
316
|
expect(subject.data).toHaveLength(1);
|
|
315
317
|
}));
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
interface BaseUpdateUserOptions {
|
|
1
|
+
export interface UpdateUserOptions {
|
|
3
2
|
userId: string;
|
|
3
|
+
firstName?: string;
|
|
4
|
+
lastName?: string;
|
|
4
5
|
}
|
|
5
|
-
interface UpdateUserOptionsProperties {
|
|
6
|
-
firstName: string;
|
|
7
|
-
lastName: string;
|
|
8
|
-
}
|
|
9
|
-
export type UpdateUserOptions = BaseUpdateUserOptions & AtLeastOnePropertyOf<UpdateUserOptionsProperties>;
|
|
10
6
|
export interface SerializedUpdateUserOptions {
|
|
11
7
|
first_name?: string;
|
|
12
8
|
last_name?: string;
|
|
13
9
|
}
|
|
14
|
-
export {};
|
package/lib/workos.js
CHANGED
|
@@ -27,7 +27,7 @@ const mfa_1 = require("./mfa/mfa");
|
|
|
27
27
|
const audit_logs_1 = require("./audit-logs/audit-logs");
|
|
28
28
|
const users_1 = require("./users/users");
|
|
29
29
|
const bad_request_exception_1 = require("./common/exceptions/bad-request.exception");
|
|
30
|
-
const VERSION = '3.1.
|
|
30
|
+
const VERSION = '3.1.1';
|
|
31
31
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
32
32
|
class WorkOS {
|
|
33
33
|
constructor(key, options = {}) {
|
package/package.json
CHANGED