perimeterx-js-core 0.4.0 → 0.4.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/README.md
CHANGED
|
@@ -77,23 +77,20 @@ While you will need to create a custom implementation for the request context, y
|
|
|
77
77
|
### HTTP
|
|
78
78
|
|
|
79
79
|
Every framework has a different API for creating and sending HTTP requests and responses. This library reduces this functionality
|
|
80
|
-
into
|
|
80
|
+
into several interfaces:
|
|
81
81
|
|
|
82
|
-
`
|
|
82
|
+
`IIncomingRequest` - Represents an HTTP request from the user.
|
|
83
83
|
|
|
84
|
-
`
|
|
84
|
+
`IOutgoingResponse` - Represents an HTTP response which is returned to the user.
|
|
85
85
|
|
|
86
|
-
`
|
|
86
|
+
`IOutgoingRequest` - Represents an HTTP request that can be executed (sent to other origin)
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
objects such that they conform to these interfaces. Of course, you are free to extend these interfaces as needed.
|
|
88
|
+
`IIncomingResponse` - Represents an HTTP response that received from sending `IOutgoingRequest`
|
|
90
89
|
|
|
91
|
-
|
|
92
|
-
encapsulating request and response body handling to a single `IBodyReader` interface.
|
|
90
|
+
`IHttpClient` - Represents a client that can send an `IIncomingRequest` and return an `IOutgoingResponse`.
|
|
93
91
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
class to parse request and response bodies provided as strings.
|
|
92
|
+
When developing your JavaScript/TypeScript enforcer with this library, you will need to wrap the native HTTP request/response
|
|
93
|
+
objects such that they conform to these interfaces. Of course, you are free to extend these interfaces as needed.
|
|
97
94
|
|
|
98
95
|
You will also need to implement an HTTP client. You can do this however you see fit: use the platform's built-in API
|
|
99
96
|
or use an external library (e.g., `phin`, `axios`) if needed.
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./ReadOnlyHeaders"), exports);
|
|
18
18
|
__exportStar(require("./IHttpClient"), exports);
|
|
19
19
|
__exportStar(require("./IIncomingResponse"), exports);
|
|
20
|
+
__exportStar(require("./IIncomingRequest"), exports);
|
|
20
21
|
__exportStar(require("./IMinimalResponse"), exports);
|
|
21
22
|
__exportStar(require("./IOutgoingRequest"), exports);
|
|
22
23
|
__exportStar(require("./IOutgoingResponse"), exports);
|
package/lib/utils/constants.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export declare const BYPASS_MONITOR_HEADER_VALUE = "1";
|
|
|
7
7
|
export declare const X_PX_AUTHORIZATION_HEADER_NAME = "x-px-authorization";
|
|
8
8
|
export declare const X_PX_ORIGINAL_TOKEN_HEADER_NAME = "x-px-original-token";
|
|
9
9
|
export declare const X_PX_BYPASS_REASON_HEADER_NAME = "x-px-bypass-reason";
|
|
10
|
-
export declare const CORE_MODULE_VERSION = "JS Core 0.4.
|
|
10
|
+
export declare const CORE_MODULE_VERSION = "JS Core 0.4.1";
|
package/lib/utils/constants.js
CHANGED
|
@@ -10,4 +10,4 @@ exports.BYPASS_MONITOR_HEADER_VALUE = '1';
|
|
|
10
10
|
exports.X_PX_AUTHORIZATION_HEADER_NAME = 'x-px-authorization';
|
|
11
11
|
exports.X_PX_ORIGINAL_TOKEN_HEADER_NAME = 'x-px-original-token';
|
|
12
12
|
exports.X_PX_BYPASS_REASON_HEADER_NAME = 'x-px-bypass-reason';
|
|
13
|
-
exports.CORE_MODULE_VERSION = 'JS Core 0.4.
|
|
13
|
+
exports.CORE_MODULE_VERSION = 'JS Core 0.4.1';
|