@workos-inc/node 7.27.3 → 7.27.4
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/README.md +1 -1
- package/lib/common/net/http-client.d.ts +1 -1
- package/lib/common/net/http-client.js +1 -1
- package/lib/index.worker.d.ts +2 -0
- package/lib/index.worker.js +5 -0
- package/lib/workos.js +1 -6
- package/lib/workos.spec.js +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ export declare abstract class HttpClient implements HttpClientInterface {
|
|
|
3
3
|
readonly baseURL: string;
|
|
4
4
|
readonly options?: RequestInit | undefined;
|
|
5
5
|
constructor(baseURL: string, options?: RequestInit | undefined);
|
|
6
|
-
/** The HTTP client name used for
|
|
6
|
+
/** The HTTP client name used for diagnostics */
|
|
7
7
|
getClientName(): string;
|
|
8
8
|
abstract get(path: string, options: RequestOptions): Promise<HttpClientResponseInterface>;
|
|
9
9
|
abstract post<Entity = any>(path: string, entity: Entity, options: RequestOptions): Promise<HttpClientResponseInterface>;
|
package/lib/index.worker.d.ts
CHANGED
package/lib/index.worker.js
CHANGED
|
@@ -47,5 +47,10 @@ class WorkOSWorker extends workos_1.WorkOS {
|
|
|
47
47
|
createIronSessionProvider() {
|
|
48
48
|
return new edge_iron_session_provider_1.EdgeIronSessionProvider();
|
|
49
49
|
}
|
|
50
|
+
/** @override */
|
|
51
|
+
emitWarning(warning) {
|
|
52
|
+
// tslint:disable-next-line:no-console
|
|
53
|
+
return console.warn(`WorkOS: ${warning}`);
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
56
|
exports.WorkOS = WorkOSWorker;
|
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.27.
|
|
30
|
+
const VERSION = '7.27.4';
|
|
31
31
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
32
32
|
const HEADER_AUTHORIZATION = 'Authorization';
|
|
33
33
|
const HEADER_IDEMPOTENCY_KEY = 'Idempotency-Key';
|
|
@@ -170,11 +170,6 @@ class WorkOS {
|
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
emitWarning(warning) {
|
|
173
|
-
// process might be undefined in some environments
|
|
174
|
-
if (typeof (process === null || process === void 0 ? void 0 : process.emitWarning) !== 'function') {
|
|
175
|
-
// tslint:disable:no-console
|
|
176
|
-
return console.warn(`WorkOS: ${warning}`);
|
|
177
|
-
}
|
|
178
173
|
return process.emitWarning(warning, 'WorkOS');
|
|
179
174
|
}
|
|
180
175
|
handleHttpError({ path, error }) {
|
package/lib/workos.spec.js
CHANGED
|
@@ -249,5 +249,19 @@ describe('WorkOS', () => {
|
|
|
249
249
|
// tslint:disable-next-line
|
|
250
250
|
expect(workos.webhooks['cryptoProvider']).toBeInstanceOf(subtle_crypto_provider_1.SubtleCryptoProvider);
|
|
251
251
|
});
|
|
252
|
+
it('uses console.warn to emit warnings', () => {
|
|
253
|
+
const workos = new index_worker_1.WorkOS('sk_test_key');
|
|
254
|
+
const warnSpy = jest.spyOn(console, 'warn');
|
|
255
|
+
workos.emitWarning('foo');
|
|
256
|
+
expect(warnSpy).toHaveBeenCalledWith('WorkOS: foo');
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
describe('when in a node environment', () => {
|
|
260
|
+
it('uses process.emitWarning to emit warnings', () => {
|
|
261
|
+
const workos = new index_1.WorkOS('sk_test_key');
|
|
262
|
+
const warnSpy = jest.spyOn(process, 'emitWarning');
|
|
263
|
+
workos.emitWarning('foo');
|
|
264
|
+
expect(warnSpy).toHaveBeenCalledWith('foo', 'WorkOS');
|
|
265
|
+
});
|
|
252
266
|
});
|
|
253
267
|
});
|
package/package.json
CHANGED