@workos-inc/node 3.8.0 → 3.9.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/organization-domains/fixtures/get-organization-domain-pending.json +2 -1
- package/lib/organization-domains/fixtures/{get-organization-domain-unverified.json → get-organization-domain-verified.json} +3 -1
- package/lib/organization-domains/interfaces/organization-domain.interface.d.ts +1 -1
- package/lib/organization-domains/interfaces/organization-domain.interface.js +1 -1
- package/lib/organization-domains/organization-domains.spec.js +8 -4
- package/lib/workos.js +1 -1
- package/package.json +2 -2
|
@@ -14,5 +14,5 @@ var OrganizationDomainState;
|
|
|
14
14
|
var OrganizationDomainVerificationStrategy;
|
|
15
15
|
(function (OrganizationDomainVerificationStrategy) {
|
|
16
16
|
OrganizationDomainVerificationStrategy["Dns"] = "dns";
|
|
17
|
-
OrganizationDomainVerificationStrategy["
|
|
17
|
+
OrganizationDomainVerificationStrategy["Manual"] = "manual";
|
|
18
18
|
})(OrganizationDomainVerificationStrategy || (exports.OrganizationDomainVerificationStrategy = OrganizationDomainVerificationStrategy = {}));
|
|
@@ -16,7 +16,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
16
16
|
const axios_mock_adapter_1 = __importDefault(require("axios-mock-adapter"));
|
|
17
17
|
const workos_1 = require("../workos");
|
|
18
18
|
const get_organization_domain_pending_json_1 = __importDefault(require("./fixtures/get-organization-domain-pending.json"));
|
|
19
|
-
const
|
|
19
|
+
const get_organization_domain_verified_json_1 = __importDefault(require("./fixtures/get-organization-domain-verified.json"));
|
|
20
20
|
const interfaces_1 = require("./interfaces");
|
|
21
21
|
const mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
22
22
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
@@ -26,13 +26,14 @@ describe('OrganizationDomains', () => {
|
|
|
26
26
|
it('requests an Organization Domain', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
27
|
mock
|
|
28
28
|
.onGet('/organization_domains/org_domain_01HCZRAP3TPQ0X0DKJHR32TATG')
|
|
29
|
-
.replyOnce(200,
|
|
29
|
+
.replyOnce(200, get_organization_domain_verified_json_1.default);
|
|
30
30
|
const subject = yield workos.organizationDomains.get('org_domain_01HCZRAP3TPQ0X0DKJHR32TATG');
|
|
31
31
|
expect(mock.history.get[0].url).toEqual('/organization_domains/org_domain_01HCZRAP3TPQ0X0DKJHR32TATG');
|
|
32
32
|
expect(subject.id).toEqual('org_domain_01HCZRAP3TPQ0X0DKJHR32TATG');
|
|
33
33
|
expect(subject.domain).toEqual('workos.com');
|
|
34
|
-
expect(subject.state).toEqual(interfaces_1.OrganizationDomainState.
|
|
35
|
-
expect(subject.verificationToken).
|
|
34
|
+
expect(subject.state).toEqual(interfaces_1.OrganizationDomainState.Verified);
|
|
35
|
+
expect(subject.verificationToken).toBeNull();
|
|
36
|
+
expect(subject.verificationStrategy).toEqual('manual');
|
|
36
37
|
}));
|
|
37
38
|
it('requests an Organization Domain', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
39
|
mock
|
|
@@ -44,6 +45,7 @@ describe('OrganizationDomains', () => {
|
|
|
44
45
|
expect(subject.domain).toEqual('workos.com');
|
|
45
46
|
expect(subject.state).toEqual(interfaces_1.OrganizationDomainState.Pending);
|
|
46
47
|
expect(subject.verificationToken).toEqual('F06PGMsZIO0shrveGWuGxgCj7');
|
|
48
|
+
expect(subject.verificationStrategy).toEqual('dns');
|
|
47
49
|
}));
|
|
48
50
|
});
|
|
49
51
|
describe('verify', () => {
|
|
@@ -57,6 +59,7 @@ describe('OrganizationDomains', () => {
|
|
|
57
59
|
expect(subject.domain).toEqual('workos.com');
|
|
58
60
|
expect(subject.state).toEqual(interfaces_1.OrganizationDomainState.Pending);
|
|
59
61
|
expect(subject.verificationToken).toEqual('F06PGMsZIO0shrveGWuGxgCj7');
|
|
62
|
+
expect(subject.verificationStrategy).toEqual('dns');
|
|
60
63
|
}));
|
|
61
64
|
});
|
|
62
65
|
describe('create', () => {
|
|
@@ -80,6 +83,7 @@ describe('OrganizationDomains', () => {
|
|
|
80
83
|
expect(subject.domain).toEqual('workos.com');
|
|
81
84
|
expect(subject.state).toEqual(interfaces_1.OrganizationDomainState.Pending);
|
|
82
85
|
expect(subject.verificationToken).toEqual('F06PGMsZIO0shrveGWuGxgCj7');
|
|
86
|
+
expect(subject.verificationStrategy).toEqual('dns');
|
|
83
87
|
}));
|
|
84
88
|
});
|
|
85
89
|
});
|
package/lib/workos.js
CHANGED
|
@@ -28,7 +28,7 @@ const mfa_1 = require("./mfa/mfa");
|
|
|
28
28
|
const audit_logs_1 = require("./audit-logs/audit-logs");
|
|
29
29
|
const users_1 = require("./users/users");
|
|
30
30
|
const bad_request_exception_1 = require("./common/exceptions/bad-request.exception");
|
|
31
|
-
const VERSION = '3.
|
|
31
|
+
const VERSION = '3.9.1';
|
|
32
32
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
33
33
|
class WorkOS {
|
|
34
34
|
constructor(key, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.
|
|
2
|
+
"version": "3.9.1",
|
|
3
3
|
"name": "@workos-inc/node",
|
|
4
4
|
"author": "WorkOS",
|
|
5
5
|
"description": "A Node wrapper for the WorkOS API",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"prepublishOnly": "yarn run build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"axios": "1.
|
|
37
|
+
"axios": "1.6.0",
|
|
38
38
|
"pluralize": "8.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|