@workos-inc/node 7.11.2 → 7.11.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.
|
@@ -9,6 +9,7 @@ export declare class NodeHttpClient extends HttpClient implements HttpClientInte
|
|
|
9
9
|
private httpsAgent;
|
|
10
10
|
constructor(baseURL: string, options?: RequestInit | undefined);
|
|
11
11
|
getClientName(): string;
|
|
12
|
+
static getBody(entity: unknown): string | null;
|
|
12
13
|
get(path: string, options: RequestOptions): Promise<HttpClientResponseInterface>;
|
|
13
14
|
post<Entity = any>(path: string, entity: Entity, options: RequestOptions): Promise<HttpClientResponseInterface>;
|
|
14
15
|
put<Entity = any>(path: string, entity: Entity, options: RequestOptions): Promise<HttpClientResponseInterface>;
|
|
@@ -55,6 +55,15 @@ class NodeHttpClient extends http_client_1.HttpClient {
|
|
|
55
55
|
getClientName() {
|
|
56
56
|
return 'node';
|
|
57
57
|
}
|
|
58
|
+
static getBody(entity) {
|
|
59
|
+
if (entity === null || entity === undefined) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
if (entity instanceof URLSearchParams) {
|
|
63
|
+
return entity.toString();
|
|
64
|
+
}
|
|
65
|
+
return JSON.stringify(entity);
|
|
66
|
+
}
|
|
58
67
|
get(path, options) {
|
|
59
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
69
|
const resourceURL = http_client_1.HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
@@ -64,13 +73,13 @@ class NodeHttpClient extends http_client_1.HttpClient {
|
|
|
64
73
|
post(path, entity, options) {
|
|
65
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
75
|
const resourceURL = http_client_1.HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
67
|
-
return yield this.nodeRequest(resourceURL, 'POST',
|
|
76
|
+
return yield this.nodeRequest(resourceURL, 'POST', NodeHttpClient.getBody(entity), Object.assign(Object.assign({}, http_client_1.HttpClient.getContentTypeHeader(entity)), options.headers));
|
|
68
77
|
});
|
|
69
78
|
}
|
|
70
79
|
put(path, entity, options) {
|
|
71
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
81
|
const resourceURL = http_client_1.HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
73
|
-
return yield this.nodeRequest(resourceURL, 'PUT',
|
|
82
|
+
return yield this.nodeRequest(resourceURL, 'PUT', NodeHttpClient.getBody(entity), Object.assign(Object.assign({}, http_client_1.HttpClient.getContentTypeHeader(entity)), options.headers));
|
|
74
83
|
});
|
|
75
84
|
}
|
|
76
85
|
delete(path, options) {
|
package/lib/workos.js
CHANGED
|
@@ -26,7 +26,7 @@ const bad_request_exception_1 = require("./common/exceptions/bad-request.excepti
|
|
|
26
26
|
const http_client_1 = require("./common/net/http-client");
|
|
27
27
|
const subtle_crypto_provider_1 = require("./common/crypto/subtle-crypto-provider");
|
|
28
28
|
const fetch_client_1 = require("./common/net/fetch-client");
|
|
29
|
-
const VERSION = '7.11.
|
|
29
|
+
const VERSION = '7.11.4';
|
|
30
30
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
31
31
|
class WorkOS {
|
|
32
32
|
constructor(key, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "7.11.
|
|
2
|
+
"version": "7.11.4",
|
|
3
3
|
"name": "@workos-inc/node",
|
|
4
4
|
"author": "WorkOS",
|
|
5
5
|
"description": "A Node wrapper for the WorkOS API",
|
|
@@ -55,10 +55,12 @@
|
|
|
55
55
|
"exports": {
|
|
56
56
|
"types": "./lib/index.d.ts",
|
|
57
57
|
"worker": {
|
|
58
|
-
"import": "./lib/index.worker.js"
|
|
58
|
+
"import": "./lib/index.worker.js",
|
|
59
|
+
"default": "./lib/index.worker.js"
|
|
59
60
|
},
|
|
60
61
|
"default": {
|
|
61
|
-
"import": "./lib/index.js"
|
|
62
|
+
"import": "./lib/index.js",
|
|
63
|
+
"default": "./lib/index.js"
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
}
|