@workos-inc/node 7.76.0 → 7.79.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/feature-flags/feature-flags.d.ts +13 -0
- package/lib/feature-flags/feature-flags.js +56 -0
- package/lib/feature-flags/feature-flags.spec.d.ts +1 -0
- package/lib/feature-flags/feature-flags.spec.js +173 -0
- package/lib/feature-flags/fixtures/disable-feature-flag.json +12 -0
- package/lib/feature-flags/fixtures/enable-feature-flag.json +12 -0
- package/lib/feature-flags/fixtures/get-feature-flag.json +12 -0
- package/lib/feature-flags/fixtures/list-feature-flags.json +45 -0
- package/lib/feature-flags/interfaces/add-flag-target-options.interface.d.ts +4 -0
- package/lib/feature-flags/interfaces/add-flag-target-options.interface.js +2 -0
- package/lib/feature-flags/interfaces/feature-flag.interface.d.ts +8 -2
- package/lib/feature-flags/interfaces/index.d.ts +3 -0
- package/lib/feature-flags/interfaces/index.js +3 -0
- package/lib/feature-flags/interfaces/list-feature-flags-options.interface.d.ts +2 -0
- package/lib/feature-flags/interfaces/list-feature-flags-options.interface.js +2 -0
- package/lib/feature-flags/interfaces/remove-flag-target-options.interface.d.ts +4 -0
- package/lib/feature-flags/interfaces/remove-flag-target-options.interface.js +2 -0
- package/lib/feature-flags/serializers/feature-flag.serializer.js +3 -0
- package/lib/feature-flags/serializers/index.d.ts +1 -0
- package/lib/feature-flags/serializers/index.js +17 -0
- package/lib/organizations/fixtures/list-organization-feature-flags.json +10 -1
- package/lib/organizations/organizations.js +2 -2
- package/lib/organizations/organizations.spec.js +10 -1
- 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/user-management/fixtures/list-user-feature-flags.json +10 -1
- package/lib/user-management/interfaces/authenticate-with-session-cookie.interface.d.ts +3 -2
- package/lib/user-management/session.js +2 -0
- package/lib/user-management/user-management.js +42 -40
- package/lib/user-management/user-management.spec.js +10 -1
- package/lib/vault/vault-live-test.spec.js +33 -4
- package/lib/vault/vault.d.ts +1 -0
- package/lib/vault/vault.js +6 -0
- package/lib/vault/vault.spec.js +25 -0
- package/lib/workos.d.ts +9 -5
- package/lib/workos.js +9 -5
- package/package.json +4 -4
package/lib/vault/vault.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare class Vault {
|
|
|
11
11
|
listObjects(options?: PaginationOptions | undefined): Promise<List<ObjectDigest>>;
|
|
12
12
|
listObjectVersions(options: ReadObjectOptions): Promise<ObjectVersion[]>;
|
|
13
13
|
readObject(options: ReadObjectOptions): Promise<VaultObject>;
|
|
14
|
+
readObjectByName(name: string): Promise<VaultObject>;
|
|
14
15
|
describeObject(options: ReadObjectOptions): Promise<VaultObject>;
|
|
15
16
|
updateObject(options: UpdateObjectOptions): Promise<VaultObject>;
|
|
16
17
|
deleteObject(options: DeleteObjectOptions): Promise<void>;
|
package/lib/vault/vault.js
CHANGED
|
@@ -95,6 +95,12 @@ class Vault {
|
|
|
95
95
|
return (0, vault_object_serializer_1.deserializeObject)(data);
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
readObjectByName(name) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const { data } = yield this.workos.get(`/vault/v1/kv/name/${encodeURIComponent(name)}`);
|
|
101
|
+
return (0, vault_object_serializer_1.deserializeObject)(data);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
98
104
|
describeObject(options) {
|
|
99
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
106
|
const { data } = yield this.workos.get(`/vault/v1/kv/${encodeURIComponent(options.id)}/metadata`);
|
package/lib/vault/vault.spec.js
CHANGED
|
@@ -121,6 +121,31 @@ describe('Vault', () => {
|
|
|
121
121
|
});
|
|
122
122
|
}));
|
|
123
123
|
});
|
|
124
|
+
describe('readObjectByName', () => {
|
|
125
|
+
it('reads an object by name', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
|
+
const objectName = 'lima';
|
|
127
|
+
const objectId = 'secret1';
|
|
128
|
+
(0, test_utils_1.fetchOnce)({
|
|
129
|
+
id: objectId,
|
|
130
|
+
metadata: {
|
|
131
|
+
id: objectId,
|
|
132
|
+
context: { emporer: 'groove' },
|
|
133
|
+
environment_id: 'environment_d',
|
|
134
|
+
key_id: 'key1',
|
|
135
|
+
updated_at: '2025-03-11T02:18:54.250931Z',
|
|
136
|
+
updated_by: { id: 'key_xxx', name: 'Local Test Key' },
|
|
137
|
+
version_id: 'version1',
|
|
138
|
+
},
|
|
139
|
+
name: objectName,
|
|
140
|
+
value: 'Pull the lever Gronk',
|
|
141
|
+
});
|
|
142
|
+
const resource = yield workos.vault.readObjectByName(objectName);
|
|
143
|
+
expect((0, test_utils_1.fetchURL)()).toContain(`/vault/v1/kv/name/${objectName}`);
|
|
144
|
+
expect((0, test_utils_1.fetchMethod)()).toBe('GET');
|
|
145
|
+
expect(resource.name).toBe(objectName);
|
|
146
|
+
expect(resource.id).toBe(objectId);
|
|
147
|
+
}));
|
|
148
|
+
});
|
|
124
149
|
describe('listSecrets', () => {
|
|
125
150
|
it('gets a paginated list of secrets', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
151
|
(0, test_utils_1.fetchOnce)({
|
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';
|
|
@@ -12,6 +13,7 @@ import { Mfa } from './mfa/mfa';
|
|
|
12
13
|
import { AuditLogs } from './audit-logs/audit-logs';
|
|
13
14
|
import { UserManagement } from './user-management/user-management';
|
|
14
15
|
import { FGA } from './fga/fga';
|
|
16
|
+
import { FeatureFlags } from './feature-flags/feature-flags';
|
|
15
17
|
import { HttpClient } from './common/net/http-client';
|
|
16
18
|
import { IronSessionProvider } from './common/iron-session/iron-session-provider';
|
|
17
19
|
import { Widgets } from './widgets/widgets';
|
|
@@ -28,18 +30,20 @@ export declare class WorkOS {
|
|
|
28
30
|
readonly apiKeys: ApiKeys;
|
|
29
31
|
readonly auditLogs: AuditLogs;
|
|
30
32
|
readonly directorySync: DirectorySync;
|
|
33
|
+
readonly events: Events;
|
|
34
|
+
readonly featureFlags: FeatureFlags;
|
|
35
|
+
readonly fga: FGA;
|
|
36
|
+
readonly mfa: Mfa;
|
|
31
37
|
readonly organizations: Organizations;
|
|
32
38
|
readonly organizationDomains: OrganizationDomains;
|
|
33
39
|
readonly passwordless: Passwordless;
|
|
40
|
+
readonly pipes: Pipes;
|
|
34
41
|
readonly portal: Portal;
|
|
35
42
|
readonly sso: SSO;
|
|
36
|
-
readonly webhooks: Webhooks;
|
|
37
|
-
readonly mfa: Mfa;
|
|
38
|
-
readonly events: Events;
|
|
39
43
|
readonly userManagement: UserManagement;
|
|
40
|
-
readonly fga: FGA;
|
|
41
|
-
readonly widgets: Widgets;
|
|
42
44
|
readonly vault: Vault;
|
|
45
|
+
readonly webhooks: Webhooks;
|
|
46
|
+
readonly widgets: Widgets;
|
|
43
47
|
constructor(key?: string | undefined, options?: WorkOSOptions);
|
|
44
48
|
createWebhookClient(): Webhooks;
|
|
45
49
|
createActionsClient(): Actions;
|
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");
|
|
@@ -25,6 +26,7 @@ const audit_logs_1 = require("./audit-logs/audit-logs");
|
|
|
25
26
|
const user_management_1 = require("./user-management/user-management");
|
|
26
27
|
const fga_1 = require("./fga/fga");
|
|
27
28
|
const bad_request_exception_1 = require("./common/exceptions/bad-request.exception");
|
|
29
|
+
const feature_flags_1 = require("./feature-flags/feature-flags");
|
|
28
30
|
const http_client_1 = require("./common/net/http-client");
|
|
29
31
|
const subtle_crypto_provider_1 = require("./common/crypto/subtle-crypto-provider");
|
|
30
32
|
const fetch_client_1 = require("./common/net/fetch-client");
|
|
@@ -33,7 +35,7 @@ const actions_1 = require("./actions/actions");
|
|
|
33
35
|
const vault_1 = require("./vault/vault");
|
|
34
36
|
const conflict_exception_1 = require("./common/exceptions/conflict.exception");
|
|
35
37
|
const parse_error_1 = require("./common/exceptions/parse-error");
|
|
36
|
-
const VERSION = '7.
|
|
38
|
+
const VERSION = '7.79.2';
|
|
37
39
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
38
40
|
const HEADER_AUTHORIZATION = 'Authorization';
|
|
39
41
|
const HEADER_IDEMPOTENCY_KEY = 'Idempotency-Key';
|
|
@@ -45,16 +47,18 @@ class WorkOS {
|
|
|
45
47
|
this.apiKeys = new api_keys_1.ApiKeys(this);
|
|
46
48
|
this.auditLogs = new audit_logs_1.AuditLogs(this);
|
|
47
49
|
this.directorySync = new directory_sync_1.DirectorySync(this);
|
|
50
|
+
this.events = new events_1.Events(this);
|
|
51
|
+
this.featureFlags = new feature_flags_1.FeatureFlags(this);
|
|
52
|
+
this.fga = new fga_1.FGA(this);
|
|
53
|
+
this.mfa = new mfa_1.Mfa(this);
|
|
48
54
|
this.organizations = new organizations_1.Organizations(this);
|
|
49
55
|
this.organizationDomains = new organization_domains_1.OrganizationDomains(this);
|
|
50
56
|
this.passwordless = new passwordless_1.Passwordless(this);
|
|
57
|
+
this.pipes = new pipes_1.Pipes(this);
|
|
51
58
|
this.portal = new portal_1.Portal(this);
|
|
52
59
|
this.sso = new sso_1.SSO(this);
|
|
53
|
-
this.mfa = new mfa_1.Mfa(this);
|
|
54
|
-
this.events = new events_1.Events(this);
|
|
55
|
-
this.fga = new fga_1.FGA(this);
|
|
56
|
-
this.widgets = new widgets_1.Widgets(this);
|
|
57
60
|
this.vault = new vault_1.Vault(this);
|
|
61
|
+
this.widgets = new widgets_1.Widgets(this);
|
|
58
62
|
if (!key) {
|
|
59
63
|
// process might be undefined in some environments
|
|
60
64
|
this.key =
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "7.
|
|
2
|
+
"version": "7.79.2",
|
|
3
3
|
"name": "@workos-inc/node",
|
|
4
4
|
"author": "WorkOS",
|
|
5
5
|
"description": "A Node wrapper for the WorkOS API",
|
|
6
|
-
"homepage": "https://github.com/workos
|
|
6
|
+
"homepage": "https://github.com/workos/workos-node",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"workos"
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
],
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/workos
|
|
20
|
+
"url": "git+https://github.com/workos/workos-node.git"
|
|
21
21
|
},
|
|
22
22
|
"bugs": {
|
|
23
|
-
"url": "https://github.com/workos
|
|
23
|
+
"url": "https://github.com/workos/workos-node/issues"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"clean": "rm -rf lib",
|