@workos-inc/node 7.17.1 → 7.19.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/common/iron-session/edge-iron-session-provider.d.ts +10 -0
- package/lib/common/iron-session/edge-iron-session-provider.js +32 -0
- package/lib/common/iron-session/iron-session-provider.d.ts +19 -0
- package/lib/common/iron-session/iron-session-provider.js +14 -0
- package/lib/common/iron-session/web-iron-session-provider.d.ts +10 -0
- package/lib/common/iron-session/web-iron-session-provider.js +32 -0
- package/lib/common/net/fetch-client.js +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +5 -0
- package/lib/index.worker.d.ts +3 -0
- package/lib/index.worker.js +5 -0
- package/lib/user-management/interfaces/authenticate-with-refresh-token-options.interface.d.ts +2 -0
- package/lib/user-management/serializers/authenticate-with-refresh-token.options.serializer.js +1 -0
- package/lib/user-management/user-management.d.ts +3 -1
- package/lib/user-management/user-management.js +8 -6
- package/lib/worker.spec.d.ts +4 -0
- package/lib/worker.spec.js +9 -0
- package/lib/workos.d.ts +2 -0
- package/lib/workos.js +5 -2
- package/package.json +3 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IronSessionProvider, SealDataOptions, UnsealedDataType } from './iron-session-provider';
|
|
2
|
+
/**
|
|
3
|
+
* EdgeIronSessionProvider which uses the base iron-session seal/unseal methods.
|
|
4
|
+
*/
|
|
5
|
+
export declare class EdgeIronSessionProvider extends IronSessionProvider {
|
|
6
|
+
/** @override */
|
|
7
|
+
sealData(data: unknown, options: SealDataOptions): Promise<string>;
|
|
8
|
+
/** @override */
|
|
9
|
+
unsealData<T = UnsealedDataType>(seal: string, options: SealDataOptions): Promise<T>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EdgeIronSessionProvider = void 0;
|
|
13
|
+
const edge_1 = require("iron-session/edge");
|
|
14
|
+
const iron_session_provider_1 = require("./iron-session-provider");
|
|
15
|
+
/**
|
|
16
|
+
* EdgeIronSessionProvider which uses the base iron-session seal/unseal methods.
|
|
17
|
+
*/
|
|
18
|
+
class EdgeIronSessionProvider extends iron_session_provider_1.IronSessionProvider {
|
|
19
|
+
/** @override */
|
|
20
|
+
sealData(data, options) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
return (0, edge_1.sealData)(data, options);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** @override */
|
|
26
|
+
unsealData(seal, options) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return (0, edge_1.unsealData)(seal, options);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.EdgeIronSessionProvider = EdgeIronSessionProvider;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type SealDataOptions = {
|
|
2
|
+
password: string | {
|
|
3
|
+
[id: string]: string;
|
|
4
|
+
};
|
|
5
|
+
ttl?: number | undefined;
|
|
6
|
+
};
|
|
7
|
+
export type UnsealedDataType = Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Interface encapsulating the sealData/unsealData methods for separate iron-session implementations.
|
|
10
|
+
*
|
|
11
|
+
* This allows for different implementations of the iron-session library to be used in
|
|
12
|
+
* worker/edge vs. regular web environments, which is required because of the different crypto APIs available.
|
|
13
|
+
* Once we drop support for Node 16 and upgrade to iron-session 8+, we can remove this abstraction as iron-session 8+
|
|
14
|
+
* handles this on its own.
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class IronSessionProvider {
|
|
17
|
+
abstract sealData(data: unknown, options: SealDataOptions): Promise<string>;
|
|
18
|
+
abstract unsealData<T = UnsealedDataType>(seal: string, options: SealDataOptions): Promise<T>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IronSessionProvider = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Interface encapsulating the sealData/unsealData methods for separate iron-session implementations.
|
|
6
|
+
*
|
|
7
|
+
* This allows for different implementations of the iron-session library to be used in
|
|
8
|
+
* worker/edge vs. regular web environments, which is required because of the different crypto APIs available.
|
|
9
|
+
* Once we drop support for Node 16 and upgrade to iron-session 8+, we can remove this abstraction as iron-session 8+
|
|
10
|
+
* handles this on its own.
|
|
11
|
+
*/
|
|
12
|
+
class IronSessionProvider {
|
|
13
|
+
}
|
|
14
|
+
exports.IronSessionProvider = IronSessionProvider;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IronSessionProvider, SealDataOptions, UnsealedDataType } from './iron-session-provider';
|
|
2
|
+
/**
|
|
3
|
+
* WebIronSessionProvider which uses the base iron-session seal/unseal methods.
|
|
4
|
+
*/
|
|
5
|
+
export declare class WebIronSessionProvider extends IronSessionProvider {
|
|
6
|
+
/** @override */
|
|
7
|
+
sealData(data: unknown, options: SealDataOptions): Promise<string>;
|
|
8
|
+
/** @override */
|
|
9
|
+
unsealData<T = UnsealedDataType>(seal: string, options: SealDataOptions): Promise<T>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.WebIronSessionProvider = void 0;
|
|
13
|
+
const iron_session_1 = require("iron-session");
|
|
14
|
+
const iron_session_provider_1 = require("./iron-session-provider");
|
|
15
|
+
/**
|
|
16
|
+
* WebIronSessionProvider which uses the base iron-session seal/unseal methods.
|
|
17
|
+
*/
|
|
18
|
+
class WebIronSessionProvider extends iron_session_provider_1.IronSessionProvider {
|
|
19
|
+
/** @override */
|
|
20
|
+
sealData(data, options) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
return (0, iron_session_1.sealData)(data, options);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** @override */
|
|
26
|
+
unsealData(seal, options) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return (0, iron_session_1.unsealData)(seal, options);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.WebIronSessionProvider = WebIronSessionProvider;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { HttpClient } from './common/net/http-client';
|
|
|
2
2
|
import { Webhooks } from './webhooks/webhooks';
|
|
3
3
|
import { WorkOS } from './workos';
|
|
4
4
|
import { WorkOSOptions } from './common/interfaces';
|
|
5
|
+
import { IronSessionProvider } from './common/iron-session/iron-session-provider';
|
|
5
6
|
export * from './audit-logs/interfaces';
|
|
6
7
|
export * from './common/exceptions';
|
|
7
8
|
export * from './common/interfaces';
|
|
@@ -19,5 +20,7 @@ declare class WorkOSNode extends WorkOS {
|
|
|
19
20
|
createHttpClient(options: WorkOSOptions, userAgent: string): HttpClient;
|
|
20
21
|
/** @override */
|
|
21
22
|
createWebhookClient(): Webhooks;
|
|
23
|
+
/** @override */
|
|
24
|
+
createIronSessionProvider(): IronSessionProvider;
|
|
22
25
|
}
|
|
23
26
|
export { WorkOSNode as WorkOS };
|
package/lib/index.js
CHANGED
|
@@ -21,6 +21,7 @@ const fetch_client_1 = require("./common/net/fetch-client");
|
|
|
21
21
|
const node_client_1 = require("./common/net/node-client");
|
|
22
22
|
const webhooks_1 = require("./webhooks/webhooks");
|
|
23
23
|
const workos_1 = require("./workos");
|
|
24
|
+
const web_iron_session_provider_1 = require("./common/iron-session/web-iron-session-provider");
|
|
24
25
|
__exportStar(require("./audit-logs/interfaces"), exports);
|
|
25
26
|
__exportStar(require("./common/exceptions"), exports);
|
|
26
27
|
__exportStar(require("./common/interfaces"), exports);
|
|
@@ -57,5 +58,9 @@ class WorkOSNode extends workos_1.WorkOS {
|
|
|
57
58
|
}
|
|
58
59
|
return new webhooks_1.Webhooks(cryptoProvider);
|
|
59
60
|
}
|
|
61
|
+
/** @override */
|
|
62
|
+
createIronSessionProvider() {
|
|
63
|
+
return new web_iron_session_provider_1.WebIronSessionProvider();
|
|
64
|
+
}
|
|
60
65
|
}
|
|
61
66
|
exports.WorkOS = WorkOSNode;
|
package/lib/index.worker.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IronSessionProvider } from './common/iron-session/iron-session-provider';
|
|
1
2
|
import { HttpClient } from './common/net/http-client';
|
|
2
3
|
import { WorkOSOptions } from './index.worker';
|
|
3
4
|
import { Webhooks } from './webhooks/webhooks';
|
|
@@ -19,5 +20,7 @@ declare class WorkOSWorker extends WorkOS {
|
|
|
19
20
|
createHttpClient(options: WorkOSOptions, userAgent: string): HttpClient;
|
|
20
21
|
/** @override */
|
|
21
22
|
createWebhookClient(): Webhooks;
|
|
23
|
+
/** @override */
|
|
24
|
+
createIronSessionProvider(): IronSessionProvider;
|
|
22
25
|
}
|
|
23
26
|
export { WorkOSWorker as WorkOS };
|
package/lib/index.worker.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.WorkOS = void 0;
|
|
18
18
|
const subtle_crypto_provider_1 = require("./common/crypto/subtle-crypto-provider");
|
|
19
|
+
const edge_iron_session_provider_1 = require("./common/iron-session/edge-iron-session-provider");
|
|
19
20
|
const fetch_client_1 = require("./common/net/fetch-client");
|
|
20
21
|
const webhooks_1 = require("./webhooks/webhooks");
|
|
21
22
|
const workos_1 = require("./workos");
|
|
@@ -42,5 +43,9 @@ class WorkOSWorker extends workos_1.WorkOS {
|
|
|
42
43
|
const cryptoProvider = new subtle_crypto_provider_1.SubtleCryptoProvider();
|
|
43
44
|
return new webhooks_1.Webhooks(cryptoProvider);
|
|
44
45
|
}
|
|
46
|
+
/** @override */
|
|
47
|
+
createIronSessionProvider() {
|
|
48
|
+
return new edge_iron_session_provider_1.EdgeIronSessionProvider();
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
51
|
exports.WorkOS = WorkOSWorker;
|
package/lib/user-management/interfaces/authenticate-with-refresh-token-options.interface.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AuthenticateWithOptionsBase, SerializedAuthenticateWithOptionsBase } from './authenticate-with-options-base.interface';
|
|
2
2
|
export interface AuthenticateWithRefreshTokenOptions extends AuthenticateWithOptionsBase {
|
|
3
3
|
refreshToken: string;
|
|
4
|
+
organizationId?: string;
|
|
4
5
|
}
|
|
5
6
|
export interface AuthenticateUserWithRefreshTokenCredentials {
|
|
6
7
|
clientSecret: string | undefined;
|
|
@@ -8,4 +9,5 @@ export interface AuthenticateUserWithRefreshTokenCredentials {
|
|
|
8
9
|
export interface SerializedAuthenticateWithRefreshTokenOptions extends SerializedAuthenticateWithOptionsBase {
|
|
9
10
|
grant_type: 'refresh_token';
|
|
10
11
|
refresh_token: string;
|
|
12
|
+
organization_id: string | undefined;
|
|
11
13
|
}
|
package/lib/user-management/serializers/authenticate-with-refresh-token.options.serializer.js
CHANGED
|
@@ -6,6 +6,7 @@ const serializeAuthenticateWithRefreshTokenOptions = (options) => ({
|
|
|
6
6
|
client_id: options.clientId,
|
|
7
7
|
client_secret: options.clientSecret,
|
|
8
8
|
refresh_token: options.refreshToken,
|
|
9
|
+
organization_id: options.organizationId,
|
|
9
10
|
ip_address: options.ipAddress,
|
|
10
11
|
user_agent: options.userAgent,
|
|
11
12
|
});
|
|
@@ -18,10 +18,12 @@ import { RevokeSessionOptions } from './interfaces/revoke-session-options.interf
|
|
|
18
18
|
import { SendInvitationOptions } from './interfaces/send-invitation-options.interface';
|
|
19
19
|
import { SessionHandlerOptions } from './interfaces/session-handler-options.interface';
|
|
20
20
|
import { UpdateOrganizationMembershipOptions } from './interfaces/update-organization-membership-options.interface';
|
|
21
|
+
import { IronSessionProvider } from '../common/iron-session/iron-session-provider';
|
|
21
22
|
export declare class UserManagement {
|
|
22
23
|
private readonly workos;
|
|
24
|
+
private readonly ironSessionProvider;
|
|
23
25
|
private jwks;
|
|
24
|
-
constructor(workos: WorkOS);
|
|
26
|
+
constructor(workos: WorkOS, ironSessionProvider: IronSessionProvider);
|
|
25
27
|
getUser(userId: string): Promise<User>;
|
|
26
28
|
listUsers(options?: ListUsersOptions): Promise<AutoPaginatable<User>>;
|
|
27
29
|
createUser(payload: CreateUserOptions): Promise<User>;
|
|
@@ -21,7 +21,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.UserManagement = void 0;
|
|
24
|
-
const iron_session_1 = require("iron-session");
|
|
25
24
|
const jose_1 = require("jose");
|
|
26
25
|
const oauth_exception_1 = require("../common/exceptions/oauth.exception");
|
|
27
26
|
const fetch_and_deserialize_1 = require("../common/utils/fetch-and-deserialize");
|
|
@@ -55,8 +54,9 @@ const toQueryString = (options) => {
|
|
|
55
54
|
return searchParams.toString();
|
|
56
55
|
};
|
|
57
56
|
class UserManagement {
|
|
58
|
-
constructor(workos) {
|
|
57
|
+
constructor(workos, ironSessionProvider) {
|
|
59
58
|
this.workos = workos;
|
|
59
|
+
this.ironSessionProvider = ironSessionProvider;
|
|
60
60
|
const { clientId } = workos.options;
|
|
61
61
|
// Set the JWKS URL. This is used to verify if the JWT is still valid
|
|
62
62
|
this.jwks = clientId
|
|
@@ -164,7 +164,7 @@ class UserManagement {
|
|
|
164
164
|
reason: authenticate_with_session_cookie_interface_1.AuthenticateWithSessionCookieFailureReason.NO_SESSION_COOKIE_PROVIDED,
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
|
-
const session = yield
|
|
167
|
+
const session = yield this.ironSessionProvider.unsealData(sessionData, {
|
|
168
168
|
password: cookiePassword,
|
|
169
169
|
});
|
|
170
170
|
if (!session.accessToken) {
|
|
@@ -214,7 +214,7 @@ class UserManagement {
|
|
|
214
214
|
reason: refresh_and_seal_session_data_interface_1.RefreshAndSealSessionDataFailureReason.NO_SESSION_COOKIE_PROVIDED,
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
const session = yield
|
|
217
|
+
const session = yield this.ironSessionProvider.unsealData(sessionData, {
|
|
218
218
|
password: cookiePassword,
|
|
219
219
|
});
|
|
220
220
|
if (!session.refreshToken || !session.user) {
|
|
@@ -274,7 +274,9 @@ class UserManagement {
|
|
|
274
274
|
refreshToken: authenticationResponse.refreshToken,
|
|
275
275
|
impersonator: authenticationResponse.impersonator,
|
|
276
276
|
};
|
|
277
|
-
return
|
|
277
|
+
return this.ironSessionProvider.sealData(sessionData, {
|
|
278
|
+
password: cookiePassword,
|
|
279
|
+
});
|
|
278
280
|
});
|
|
279
281
|
}
|
|
280
282
|
getSessionFromCookie({ sessionData, cookiePassword = process.env.WORKOS_COOKIE_PASSWORD, }) {
|
|
@@ -283,7 +285,7 @@ class UserManagement {
|
|
|
283
285
|
throw new Error('Cookie password is required');
|
|
284
286
|
}
|
|
285
287
|
if (sessionData) {
|
|
286
|
-
return
|
|
288
|
+
return this.ironSessionProvider.unsealData(sessionData, {
|
|
287
289
|
password: cookiePassword,
|
|
288
290
|
});
|
|
289
291
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @jest-environment miniflare
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const index_worker_1 = require("./index.worker");
|
|
7
|
+
test('WorkOS is initialized without errors', () => {
|
|
8
|
+
expect(() => new index_worker_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU')).not.toThrow();
|
|
9
|
+
});
|
package/lib/workos.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { AuditLogs } from './audit-logs/audit-logs';
|
|
|
12
12
|
import { UserManagement } from './user-management/user-management';
|
|
13
13
|
import { FGA } from './fga/fga';
|
|
14
14
|
import { HttpClient } from './common/net/http-client';
|
|
15
|
+
import { IronSessionProvider } from './common/iron-session/iron-session-provider';
|
|
15
16
|
export declare class WorkOS {
|
|
16
17
|
readonly key?: string | undefined;
|
|
17
18
|
readonly options: WorkOSOptions;
|
|
@@ -33,6 +34,7 @@ export declare class WorkOS {
|
|
|
33
34
|
constructor(key?: string | undefined, options?: WorkOSOptions);
|
|
34
35
|
createWebhookClient(): Webhooks;
|
|
35
36
|
createHttpClient(options: WorkOSOptions, userAgent: string): HttpClient;
|
|
37
|
+
createIronSessionProvider(): IronSessionProvider;
|
|
36
38
|
get version(): string;
|
|
37
39
|
post<Result = any, Entity = any>(path: string, entity: Entity, options?: PostOptions): Promise<{
|
|
38
40
|
data: Result;
|
package/lib/workos.js
CHANGED
|
@@ -27,7 +27,7 @@ const bad_request_exception_1 = require("./common/exceptions/bad-request.excepti
|
|
|
27
27
|
const http_client_1 = require("./common/net/http-client");
|
|
28
28
|
const subtle_crypto_provider_1 = require("./common/crypto/subtle-crypto-provider");
|
|
29
29
|
const fetch_client_1 = require("./common/net/fetch-client");
|
|
30
|
-
const VERSION = '7.
|
|
30
|
+
const VERSION = '7.19.0';
|
|
31
31
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
32
32
|
const HEADER_AUTHORIZATION = 'Authorization';
|
|
33
33
|
const HEADER_IDEMPOTENCY_KEY = 'Idempotency-Key';
|
|
@@ -72,7 +72,7 @@ class WorkOS {
|
|
|
72
72
|
}
|
|
73
73
|
this.webhooks = this.createWebhookClient();
|
|
74
74
|
// Must initialize UserManagement after baseURL is configured
|
|
75
|
-
this.userManagement = new user_management_1.UserManagement(this);
|
|
75
|
+
this.userManagement = new user_management_1.UserManagement(this, this.createIronSessionProvider());
|
|
76
76
|
this.client = this.createHttpClient(options, userAgent);
|
|
77
77
|
}
|
|
78
78
|
createWebhookClient() {
|
|
@@ -82,6 +82,9 @@ class WorkOS {
|
|
|
82
82
|
var _a;
|
|
83
83
|
return new fetch_client_1.FetchHttpClient(this.baseURL, Object.assign(Object.assign({}, options.config), { headers: Object.assign(Object.assign({}, (_a = options.config) === null || _a === void 0 ? void 0 : _a.headers), { Authorization: `Bearer ${this.key}`, 'User-Agent': userAgent }) }));
|
|
84
84
|
}
|
|
85
|
+
createIronSessionProvider() {
|
|
86
|
+
throw new Error('IronSessionProvider not implemented. Use WorkOSNode or WorkOSWorker instead.');
|
|
87
|
+
}
|
|
85
88
|
get version() {
|
|
86
89
|
return VERSION;
|
|
87
90
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "7.
|
|
2
|
+
"version": "7.19.0",
|
|
3
3
|
"name": "@workos-inc/node",
|
|
4
4
|
"author": "WorkOS",
|
|
5
5
|
"description": "A Node wrapper for the WorkOS API",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"lint": "tslint -p tsconfig.json -c tslint.json",
|
|
33
33
|
"test": "jest",
|
|
34
34
|
"test:watch": "jest --watch",
|
|
35
|
+
"test:worker": "jest src/worker.spec.ts",
|
|
35
36
|
"prettier": "prettier \"src/**/*.{js,ts,tsx}\" --check",
|
|
36
37
|
"format": "prettier \"src/**/*.{js,ts,tsx}\" --write",
|
|
37
38
|
"prepublishOnly": "yarn run build"
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
"@types/node": "14.18.54",
|
|
48
49
|
"@types/pluralize": "0.0.30",
|
|
49
50
|
"jest": "29.6.2",
|
|
51
|
+
"jest-environment-miniflare": "^2.14.2",
|
|
50
52
|
"jest-fetch-mock": "^3.0.3",
|
|
51
53
|
"prettier": "2.8.8",
|
|
52
54
|
"supertest": "6.3.3",
|