@castleio/sdk 1.0.3 → 1.2.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/CHANGELOG.md +30 -2
- package/README.md +17 -138
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +17 -14
- package/dist/src/api/api.module.js +5 -1
- package/dist/src/api/api.module.js.map +1 -1
- package/dist/src/api/services/api-risk.service.js +3 -0
- package/dist/src/api/services/api-risk.service.js.map +1 -1
- package/dist/src/api/services/index.js +5 -1
- package/dist/src/api/services/index.js.map +1 -1
- package/dist/src/client-id/client-id.module.js +5 -1
- package/dist/src/client-id/client-id.module.js.map +1 -1
- package/dist/src/client-id/services/index.js +5 -1
- package/dist/src/client-id/services/index.js.map +1 -1
- package/dist/src/command/command.module.js +5 -1
- package/dist/src/command/command.module.js.map +1 -1
- package/dist/src/command/services/command-authenticate.service.js.map +1 -1
- package/dist/src/command/services/command-filter.service.js.map +1 -1
- package/dist/src/command/services/command-generate.service.js +3 -1
- package/dist/src/command/services/command-generate.service.js.map +1 -1
- package/dist/src/command/services/command-log.service.js.map +1 -1
- package/dist/src/command/services/command-risk.service.js.map +1 -1
- package/dist/src/command/services/command-track.service.js.map +1 -1
- package/dist/src/command/services/index.js +5 -1
- package/dist/src/command/services/index.js.map +1 -1
- package/dist/src/configuraton.js +1 -1
- package/dist/src/configuraton.js.map +1 -1
- package/dist/src/constants.js +1 -2
- package/dist/src/constants.js.map +1 -1
- package/dist/src/context/context.module.js +5 -1
- package/dist/src/context/context.module.js.map +1 -1
- package/dist/src/context/services/context-get-default.service.js +3 -3
- package/dist/src/context/services/context-get-default.service.js.map +1 -1
- package/dist/src/context/services/context-prepare.service.js +3 -3
- package/dist/src/context/services/context-prepare.service.js.map +1 -1
- package/dist/src/context/services/context-sanitize.service.js.map +1 -1
- package/dist/src/context/services/index.js +5 -1
- package/dist/src/context/services/index.js.map +1 -1
- package/dist/src/core/core.module.js +5 -1
- package/dist/src/core/core.module.js.map +1 -1
- package/dist/src/core/services/core-generate-request-body.service.js +1 -1
- package/dist/src/core/services/core-generate-request-body.service.js.map +1 -1
- package/dist/src/core/services/core-process-response.service.js +5 -1
- package/dist/src/core/services/core-process-response.service.js.map +1 -1
- package/dist/src/core/services/index.js +5 -1
- package/dist/src/core/services/index.js.map +1 -1
- package/dist/src/errors.js +8 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/failover/failover.module.js +5 -1
- package/dist/src/failover/failover.module.js.map +1 -1
- package/dist/src/failover/models/index.js +5 -1
- package/dist/src/failover/models/index.js.map +1 -1
- package/dist/src/headers/headers.module.js +5 -1
- package/dist/src/headers/headers.module.js.map +1 -1
- package/dist/src/headers/services/headers-extract.service.js +1 -1
- package/dist/src/headers/services/headers-extract.service.js.map +1 -1
- package/dist/src/headers/services/index.js +5 -1
- package/dist/src/headers/services/index.js.map +1 -1
- package/dist/src/ips/ips.module.js +5 -1
- package/dist/src/ips/ips.module.js.map +1 -1
- package/dist/src/ips/services/index.js +5 -1
- package/dist/src/ips/services/index.js.map +1 -1
- package/dist/src/logger/logger.module.js +5 -1
- package/dist/src/logger/logger.module.js.map +1 -1
- package/dist/src/logger/models/index.js +5 -1
- package/dist/src/logger/models/index.js.map +1 -1
- package/dist/src/logger/services/index.js +5 -1
- package/dist/src/logger/services/index.js.map +1 -1
- package/dist/src/models/index.js +5 -1
- package/dist/src/models/index.js.map +1 -1
- package/dist/src/payload/models/index.js +5 -1
- package/dist/src/payload/models/index.js.map +1 -1
- package/dist/src/payload/payload.module.js +5 -1
- package/dist/src/payload/payload.module.js.map +1 -1
- package/dist/src/payload/services/index.js +5 -1
- package/dist/src/payload/services/index.js.map +1 -1
- package/dist/src/payload/services/payload-prepare-service.js +3 -3
- package/dist/src/payload/services/payload-prepare-service.js.map +1 -1
- package/dist/src/validator/services/index.js +5 -1
- package/dist/src/validator/services/index.js.map +1 -1
- package/dist/src/validator/validator.module.js +5 -1
- package/dist/src/validator/validator.module.js.map +1 -1
- package/package.json +17 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
**BugFix:**
|
|
6
|
+
|
|
7
|
+
- [#132](https://github.com/castle/castle-node/pull/132)
|
|
8
|
+
* fixed how options in the context prepare are merged
|
|
9
|
+
* changed/fixed how payload prepare options are merge
|
|
10
|
+
|
|
11
|
+
**Enhancements**
|
|
12
|
+
|
|
13
|
+
- [#133](https://github.com/castle/castle-node/pull/133)
|
|
14
|
+
* increased default timeout from 1000 to 1500
|
|
15
|
+
- [#133](https://github.com/castle/castle-node/pull/133)
|
|
16
|
+
* exposed ContextPrepareService
|
|
17
|
+
|
|
18
|
+
## 1.1.1
|
|
19
|
+
|
|
20
|
+
**Enhancements**
|
|
21
|
+
|
|
22
|
+
- [#131](https://github.com/castle/castle-node/pull/131)
|
|
23
|
+
* failover response enhancement, removed X-Castle header from allowlist
|
|
24
|
+
|
|
25
|
+
## 1.1.0
|
|
26
|
+
|
|
27
|
+
**Enhancements**
|
|
28
|
+
|
|
29
|
+
- [#127](https://github.com/castle/castle-node/pull/127)
|
|
30
|
+
* Introduce a new exception `InvalidRequestTokenError` for facilitating handling of all request token related errors
|
|
31
|
+
|
|
3
32
|
## 1.0.3
|
|
4
33
|
|
|
5
34
|
**BugFix:**
|
|
@@ -36,7 +65,7 @@
|
|
|
36
65
|
- dropped EVENTS const with list of events
|
|
37
66
|
* [#97](https://github.com/castle/castle-node/pull/114)
|
|
38
67
|
**Enhancements:**
|
|
39
|
-
- restructuring the codebase
|
|
68
|
+
- restructuring the codebase
|
|
40
69
|
* [#89](https://github.com/castle/castle-node/pull/89)
|
|
41
70
|
* [#90](https://github.com/castle/castle-node/pull/90)
|
|
42
71
|
* [#91](https://github.com/castle/castle-node/pull/91)
|
|
@@ -83,4 +112,3 @@
|
|
|
83
112
|
**Enhancements:**
|
|
84
113
|
|
|
85
114
|
- Re-publish to fix broken build
|
|
86
|
-
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Castle SDK for Node
|
|
2
2
|
|
|
3
|
-
**[Castle](https://castle.io) analyzes
|
|
3
|
+
**[Castle](https://castle.io) analyzes user behavior in web and mobile apps to stop fraud before it happens.**
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
See the [documentation](https://docs.castle.io) for how to use this SDK with the Castle APIs
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -36,138 +36,17 @@ const castle = new Castle({ apiSecret: 'YOUR SECRET HERE' });
|
|
|
36
36
|
|
|
37
37
|
#### Config options
|
|
38
38
|
|
|
39
|
-
| Config option | Explanation |
|
|
40
|
-
| ----------------- | ----------- |
|
|
41
|
-
| apiSecret | `string`
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
| trustProxyChain
|
|
52
|
-
|
|
|
53
|
-
|
|
54
|
-
## Actions
|
|
55
|
-
|
|
56
|
-
The `castle` instance exposes two methods, `track` and `authenticate`. In order to provide the information required in both these methods, you'll need access to the logged in user information (if that is available at that stage in the user flow), as well as request information. In node connect/express, the user is often found in the `session` object, or directly on the `request` object in the `user` property, if you are using passport.
|
|
57
|
-
|
|
58
|
-
### track
|
|
59
|
-
|
|
60
|
-
This is the asynchronous version of the castle integration. This is for events where you don't require a response.
|
|
61
|
-
|
|
62
|
-
```js
|
|
63
|
-
|
|
64
|
-
castle.track({
|
|
65
|
-
event: '$profile_update.failed',
|
|
66
|
-
user_id: user.id,
|
|
67
|
-
user_traits: {
|
|
68
|
-
email: user.email,
|
|
69
|
-
registered_at: user.registered_at,
|
|
70
|
-
},
|
|
71
|
-
context: {
|
|
72
|
-
ip: request.ip,
|
|
73
|
-
client_id: request.cookies['__cid'],
|
|
74
|
-
headers: request.headers,
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### authenticate
|
|
80
|
-
|
|
81
|
-
This is the synchronous version of the castle integration. This is for events where you require a response. It is used in the same way as `track`, except that you have the option of waiting for a response.
|
|
82
|
-
|
|
83
|
-
```js
|
|
84
|
-
let response;
|
|
85
|
-
try {
|
|
86
|
-
response = await castle.authenticate({
|
|
87
|
-
event: '$login.succeeded',
|
|
88
|
-
user_id: user.id,
|
|
89
|
-
user_traits: {
|
|
90
|
-
email: user.email,
|
|
91
|
-
registered_at: user.registered_at,
|
|
92
|
-
},
|
|
93
|
-
context: {
|
|
94
|
-
ip: request.ip,
|
|
95
|
-
client_id: request.cookies['__cid'],
|
|
96
|
-
headers: request.headers,
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
} catch (e) {
|
|
100
|
-
console.error(e);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
console.log(response); // { "action": "allow", "user_id": 123, "device_token": "eyj...." }
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
####
|
|
107
|
-
|
|
108
|
-
Response format
|
|
109
|
-
|
|
110
|
-
| Response key | value |
|
|
111
|
-
| --------------- | --------------------------------------------------------------------------------------------------- |
|
|
112
|
-
| action | `string` - The recommended action for the given event. Options: `allow`, `challenge`, `deny`. |
|
|
113
|
-
| user_id | `string` - The `user_id` of the end user. |
|
|
114
|
-
| policy | `object` - object containing risk policy information, such as `id`,`revision_id`, `name` |
|
|
115
|
-
| signals | `object` - object containing hash with signals names |
|
|
116
|
-
| device_token | `string` - Our token for the device that generated the event. |
|
|
117
|
-
| failover | `boolean` - An optional property indicating the request failed and the response is a failover. |
|
|
118
|
-
| failover_reason | `string` - A message indicating why the request failed. |
|
|
119
|
-
|
|
120
|
-
### All config options for `track` and `authenticate`
|
|
121
|
-
|
|
122
|
-
| Config option | Explanation |
|
|
123
|
-
| ------------- | ----------- |
|
|
124
|
-
| event | `string` - The event generated by the user |
|
|
125
|
-
| user_id | `string` - The `user_id` of the end user. |
|
|
126
|
-
| user_traits | `object` - An optional, recommended, object containing user information, such as `email` and `registered_at`. |
|
|
127
|
-
| properties | `object` - An optional object containing custom information. |
|
|
128
|
-
| created_at | `string` - An optional ISO date string indicating when the event occurred, in cases where this might be different from the time when the request is made. |
|
|
129
|
-
| device_token | `string` - The optional device token, used for mitigating or escalating. |
|
|
130
|
-
| context | `object` - The request context information. |
|
|
131
|
-
|
|
132
|
-
## Device management
|
|
133
|
-
|
|
134
|
-
This SDK allows issuing requests to [Castle's Device Management Endpoints](https://docs.castle.io/device_management_tool/). Use these endpoints for admin-level management of end-user devices (i.e., for an internal dashboard).
|
|
135
|
-
|
|
136
|
-
Fetching device data, approving a device, reporting a device requires a valid `device_token`.
|
|
137
|
-
|
|
138
|
-
```js
|
|
139
|
-
// Get device data
|
|
140
|
-
castle.getDevice({ device_token })
|
|
141
|
-
// Approve a device
|
|
142
|
-
castle.approveDevice({ device_token })
|
|
143
|
-
// Report a device
|
|
144
|
-
castle.reportDevice({ device_token })
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Fetching available devices that belong to a given user requires a valid `user_id`.
|
|
148
|
-
|
|
149
|
-
```js
|
|
150
|
-
// Get user's devices data
|
|
151
|
-
castle.getDevicesForUser({ user_id })
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Payload
|
|
155
|
-
|
|
156
|
-
To generate the payload, use the following command:
|
|
157
|
-
```js
|
|
158
|
-
const payload = PayloadPrepareService.call(
|
|
159
|
-
{
|
|
160
|
-
event: '$login.succeeded',
|
|
161
|
-
user_id: user.id,
|
|
162
|
-
properties: {
|
|
163
|
-
key: 'value'
|
|
164
|
-
},
|
|
165
|
-
user_traits: {
|
|
166
|
-
key: 'value'
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
request,
|
|
170
|
-
castle.configuration
|
|
171
|
-
)
|
|
172
|
-
castle.track(payload)
|
|
173
|
-
```
|
|
39
|
+
| Config option | Type | Default | Explanation |
|
|
40
|
+
| ----------------- | ---- |-------- | ----------- |
|
|
41
|
+
| apiSecret | `string` | | API key which can be found in the Castle dashboard https://dashboard.castle.io/settings/general |
|
|
42
|
+
| timeout | `number` | 1500 | Time before returning the failover strategy. |
|
|
43
|
+
| allowlisted | `string[]` | [] | by default, the SDK sends all HTTP headers, except for Cookie and Authorization. <br/><br/> If you decide to use a allowlist, the SDK will:<br/>- always send the User-Agent header<br/>- send scrubbed values of non-allowlisted headers<br/>- send proper values of allowlisted headers.<br/><br/>We highly suggest using denylist instead of allowlist, so that Castle can use as many data points as possible to secure your users. If you want to use the allowlist, this is the minimal amount of headers we recommend: DEFAULT_ALLOWLIST |
|
|
44
|
+
| denylisted | `string[]` | [] | Denylisted headers take precedence over allowlisted elements. We always denylist Cookie and Authentication headers. If you use any other headers that might contain sensitive information, you should denylist them |
|
|
45
|
+
| failoverStrategy | `FailoverStrategy` | `FailoverStrategy.allow` | If the request to our service would for some reason time out, this is where you select the automatic response from `authenticate`. Options are `FailoverStrategy.allow`, `FailoverStrategy.deny`, `FailoverStrategy.challenge`. |
|
|
46
|
+
| logger | `any` | | Logs Castle API requests and responses, has to respond to `info` method. |
|
|
47
|
+
| doNotTrack | `boolean` | False | setting it to true turns off all requests and triggers automatic failover on `authenticate`. Used for development and testing. |
|
|
48
|
+
| ipHeaders | `string[]` | [] | Castle needs the original IP of the client, not the IP of your proxy or load balancer. The SDK will only trust the proxy chain as defined in the configuration.We try to fetch the client IP based on X-Forwarded-For or Remote-Addr headers in that order, but sometimes the client IP may be stored in a different header or order. The SDK can be configured to look for the client IP address in headers that you specify.<br/>Sometimes, Cloud providers do not use consistent IP addresses to proxy requests. In this case, the client IP is usually preserved in a custom header. <br/>Example: Cloudflare preserves the client request in the 'Cf-Connecting-Ip' header. |
|
|
49
|
+
| trustedProxies | `string[]` | [] | If the specified header or X-Forwarded-For default contains a proxy chain with public IP addresses, then you must choose only one of the following (but not both): <br/>1. The trusted_proxies value must match the known proxy IPs. This option is preferable if the IP is static. <br/>2. The trusted_proxy_depth value must be set to the number of known trusted proxies in the chain (see below).This option is preferable if the IPs are ephemeral, but the depth is consistent. <br/>Additionally to make X-Forwarded-For and other headers work better discovering client ip address,and not the address of a reverse proxy server, you can define trusted proxies which will help to fetch proper ip from those headers. <br/>In order to extract the client IP of the X-Forwarded-For header and not the address of a reverse proxy server, you must define all trusted public proxies you can achieve this by listing all the proxies ip defined by string or regular expressions in the trusted_proxies setting <br/> |
|
|
50
|
+
| trustedProxyDepth | `number` | 0 | ...or by providing number of trusted proxies used in the chain, (note that you must pick one approach over the other. either trustProxyChain orr trustedProxies) |
|
|
51
|
+
| trustProxyChain | `boolean` | False | If there is no possibility to define options above and there is no other header that holds the client IP, then you may set this option to True to trust all of the proxy IPs in X-Forwarded-For , *Warning*: this mode is highly promiscuous and could lead to wrongly trusting a spoofed IP if the request passes through a malicious proxy |
|
|
52
|
+
| baseUrl | `string` | `https://api.castle.io/v1` | base Castle API url |
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PayloadPrepareService = exports.FailoverStrategy = exports.DEFAULT_ALLOWLIST = exports.Castle = void 0;
|
|
3
|
+
exports.ContextPrepareService = exports.PayloadPrepareService = exports.FailoverStrategy = exports.DEFAULT_ALLOWLIST = exports.Castle = void 0;
|
|
4
4
|
var Castle_1 = require("./src/Castle");
|
|
5
5
|
Object.defineProperty(exports, "Castle", { enumerable: true, get: function () { return Castle_1.Castle; } });
|
|
6
6
|
var constants_1 = require("./src/constants");
|
|
@@ -9,4 +9,6 @@ var failover_module_1 = require("./src/failover/failover.module");
|
|
|
9
9
|
Object.defineProperty(exports, "FailoverStrategy", { enumerable: true, get: function () { return failover_module_1.FailoverStrategy; } });
|
|
10
10
|
var payload_module_1 = require("./src/payload/payload.module");
|
|
11
11
|
Object.defineProperty(exports, "PayloadPrepareService", { enumerable: true, get: function () { return payload_module_1.PayloadPrepareService; } });
|
|
12
|
+
var context_module_1 = require("./src/context/context.module");
|
|
13
|
+
Object.defineProperty(exports, "ContextPrepareService", { enumerable: true, get: function () { return context_module_1.ContextPrepareService; } });
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,gGAAA,MAAM,OAAA;AACf,6CAAoD;AAA3C,8GAAA,iBAAiB,OAAA;AAC1B,kEAAkE;AAAzD,mHAAA,gBAAgB,OAAA;AACzB,+DAAqE;AAA5D,uHAAA,qBAAqB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,gGAAA,MAAM,OAAA;AACf,6CAAoD;AAA3C,8GAAA,iBAAiB,OAAA;AAC1B,kEAAkE;AAAzD,mHAAA,gBAAgB,OAAA;AACzB,+DAAqE;AAA5D,uHAAA,qBAAqB,OAAA;AAC9B,+DAAqE;AAA5D,uHAAA,qBAAqB,OAAA"}
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json.schemastore.org/package",
|
|
3
3
|
"name": "@castleio/sdk",
|
|
4
4
|
"description": "Castle SDK for Node",
|
|
5
|
-
"version": "1.0
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"repository": "git@github.com:castle/castle-node.git",
|
|
8
8
|
"author": {
|
|
@@ -24,40 +24,43 @@
|
|
|
24
24
|
"prepush": "yarn build && yarn lint-fix && yarn prettier-verify",
|
|
25
25
|
"prepublishOnly": "yarn build"
|
|
26
26
|
},
|
|
27
|
-
"files": [
|
|
27
|
+
"files": [
|
|
28
|
+
"dist/*"
|
|
29
|
+
],
|
|
28
30
|
"husky": {
|
|
29
31
|
"hooks": {
|
|
30
32
|
"pre-push": "yarn prepush"
|
|
31
33
|
}
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
34
|
-
"@types/fetch-mock": "7.3.
|
|
35
|
-
"@types/jest": "
|
|
36
|
+
"@types/fetch-mock": "7.3.5",
|
|
37
|
+
"@types/jest": "27.4.1",
|
|
36
38
|
"@types/lodash.get": "4.4.6",
|
|
37
39
|
"@types/lodash.isempty": "4.4.6",
|
|
38
40
|
"@types/lodash.merge": "4.6.6",
|
|
39
41
|
"@types/lodash.pickby": "4.6.6",
|
|
40
42
|
"@types/lodash.reduce": "4.6.6",
|
|
41
43
|
"@types/mockdate": "3.0.0",
|
|
42
|
-
"@types/node": "
|
|
43
|
-
"@types/node-fetch": "2.
|
|
44
|
-
"@types/pino": "
|
|
44
|
+
"@types/node": "17.0.23",
|
|
45
|
+
"@types/node-fetch": "2.6.1",
|
|
46
|
+
"@types/pino": "7.0.5",
|
|
45
47
|
"fetch-mock": "9.11.0",
|
|
46
|
-
"husky": "
|
|
47
|
-
"jest": "27.
|
|
48
|
+
"husky": "7.0.4",
|
|
49
|
+
"jest": "27.5.1",
|
|
48
50
|
"mockdate": "3.0.5",
|
|
49
|
-
"prettier": "2.
|
|
51
|
+
"prettier": "2.6.1",
|
|
50
52
|
"rimraf": "3.0.2",
|
|
51
|
-
"source-map-support": "^0.5.
|
|
52
|
-
"ts-jest": "27.
|
|
53
|
-
"ts-node": "10.
|
|
53
|
+
"source-map-support": "^0.5.21",
|
|
54
|
+
"ts-jest": "27.1.4",
|
|
55
|
+
"ts-node": "10.7.0",
|
|
54
56
|
"tslint": "6.1.3",
|
|
55
57
|
"tslint-config-prettier": "1.18.0",
|
|
56
58
|
"tslint-config-standard": "9.0.0",
|
|
57
|
-
"typescript": "4.3
|
|
59
|
+
"typescript": "4.6.3"
|
|
58
60
|
},
|
|
59
61
|
"dependencies": {
|
|
60
62
|
"abort-controller": "^3.0.0",
|
|
63
|
+
"express": "4.17.3",
|
|
61
64
|
"lodash.get": "^4.4.2",
|
|
62
65
|
"lodash.isempty": "^4.4.0",
|
|
63
66
|
"lodash.merge": "^4.6.2",
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.module.js","sourceRoot":"","sources":["../../../src/api/api.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.module.js","sourceRoot":"","sources":["../../../src/api/api.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-risk.service.js","sourceRoot":"","sources":["../../../../src/api/services/api-risk.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,yCAAmD;AACnD,iEAAkE;AAClE,oEAAkE;AAClE,+CAA2C;AAC3C,wEAA+C;AAE/C,MAAM,cAAc,GAAG,CACrB,MAAc,EACd,MAAc,EACd,aAA4B,EAC5B,GAAW,EACH,EAAE;IAIV,IAAI,aAAa,CAAC,gBAAgB,KAAK,kCAAgB,CAAC,KAAK,EAAE;QAC7D,MAAM,GAAG,CAAC;KACX;IAED,OAAO;QACL,MAAM,EAAE,aAAa,CAAC,gBAAgB;QACtC,QAAQ,EAAE,IAAI;QACd,eAAe,EAAE,MAAM;KACxB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC;AAEhD,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,CAAO,OAAY,EAAE,aAA4B,EAAmB,EAAE;QAC1E,MAAM,UAAU,GAAG,IAAI,0BAAe,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,mCAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QAE5E,IAAI,iBAAiB,CAAC;QACtB,IAAI;YACF,iBAAiB,GAAG,MAAM,wBAAU,CAAC,IAAI,CACvC,UAAU,EACV,OAAO,EACP,aAAa,CACd,CAAC;SACH;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;gBACrB,OAAO,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;aACrE;iBAAM,IAAI,CAAC,YAAY,4BAAmB,EAAE;gBAC3C,OAAO,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;aACvE;iBAAM;gBACL,MAAM,CAAC,CAAC;aACT;SACF;QAED,OAAO,iBAAiB,CAAC;IAC3B,CAAC,CAAA;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"api-risk.service.js","sourceRoot":"","sources":["../../../../src/api/services/api-risk.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,yCAAmD;AACnD,iEAAkE;AAClE,oEAAkE;AAClE,+CAA2C;AAC3C,wEAA+C;AAE/C,MAAM,cAAc,GAAG,CACrB,MAAc,EACd,MAAc,EACd,aAA4B,EAC5B,GAAW,EACH,EAAE;IAIV,IAAI,aAAa,CAAC,gBAAgB,KAAK,kCAAgB,CAAC,KAAK,EAAE;QAC7D,MAAM,GAAG,CAAC;KACX;IAED,OAAO;QACL,MAAM,EAAE;YACN,MAAM,EAAE,aAAa,CAAC,gBAAgB;SACvC;QACD,MAAM,EAAE,aAAa,CAAC,gBAAgB;QACtC,QAAQ,EAAE,IAAI;QACd,eAAe,EAAE,MAAM;KACxB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC;AAEhD,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,CAAO,OAAY,EAAE,aAA4B,EAAmB,EAAE;QAC1E,MAAM,UAAU,GAAG,IAAI,0BAAe,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,mCAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QAE5E,IAAI,iBAAiB,CAAC;QACtB,IAAI;YACF,iBAAiB,GAAG,MAAM,wBAAU,CAAC,IAAI,CACvC,UAAU,EACV,OAAO,EACP,aAAa,CACd,CAAC;SACH;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;gBACrB,OAAO,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;aACrE;iBAAM,IAAI,CAAC,YAAY,4BAAmB,EAAE;gBAC3C,OAAO,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;aACvE;iBAAM;gBACL,MAAM,CAAC,CAAC;aACT;SACF;QAED,OAAO,iBAAiB,CAAC;IAC3B,CAAC,CAAA;CACF,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/services/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,+DAA6C;AAC7C,6DAA2C;AAC3C,2DAAyC;AACzC,qEAAmD;AACnD,8DAA4C;AAC5C,sDAAoC;AACpC,qDAAmC;AACnC,oDAAkC;AAClC,uDAAqC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-id.module.js","sourceRoot":"","sources":["../../../src/client-id/client-id.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client-id.module.js","sourceRoot":"","sources":["../../../src/client-id/client-id.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client-id/services/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client-id/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.module.js","sourceRoot":"","sources":["../../../src/command/command.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.module.js","sourceRoot":"","sources":["../../../src/command/command.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-authenticate.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-authenticate.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AAEtE,yEAAoE;AAEvD,QAAA,0BAA0B,GAAG;IACxC,IAAI,EAAE,CAAC,UAAU,EAAE,OAAgB,EAAE,aAA4B,EAAE,EAAE;QACnE,MAAM,OAAO,GAAG,uCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,iDAAsB,CAAC,IAAI,CAChC,UAAU,EACV,cAAc,
|
|
1
|
+
{"version":3,"file":"command-authenticate.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-authenticate.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AAEtE,yEAAoE;AAEvD,QAAA,0BAA0B,GAAG;IACxC,IAAI,EAAE,CAAC,UAAU,EAAE,OAAgB,EAAE,aAA4B,EAAE,EAAE;QACnE,MAAM,OAAO,GAAG,uCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,iDAAsB,CAAC,IAAI,CAChC,UAAU,EACV,cAAc,EACd,gCAAK,OAAO,GAAK,EAAE,OAAO,EAAE,CAAa,EACzC,MAAM,EACN,aAAa,CACd,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-filter.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-filter.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AAEtE,yEAAoE;AAEvD,QAAA,oBAAoB,GAAG;IAClC,IAAI,EAAE,CAAC,UAAU,EAAE,OAAsB,EAAE,aAA4B,EAAE,EAAE;QACzE,MAAM,OAAO,GAAG,uCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,iDAAsB,CAAC,IAAI,CAChC,UAAU,EACV,QAAQ,
|
|
1
|
+
{"version":3,"file":"command-filter.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-filter.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AAEtE,yEAAoE;AAEvD,QAAA,oBAAoB,GAAG;IAClC,IAAI,EAAE,CAAC,UAAU,EAAE,OAAsB,EAAE,aAA4B,EAAE,EAAE;QACzE,MAAM,OAAO,GAAG,uCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,iDAAsB,CAAC,IAAI,CAChC,UAAU,EACV,QAAQ,EACR,gCAAK,OAAO,GAAK,EAAE,OAAO,EAAE,CAAmB,EAC/C,MAAM,EACN,aAAa,CACd,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -9,7 +9,9 @@ exports.CommandGenerateService = {
|
|
|
9
9
|
call: (controller, path, options, method, configuration) => {
|
|
10
10
|
return {
|
|
11
11
|
requestUrl: new URL(combineURLs(configuration.baseUrl.toString(), path)),
|
|
12
|
-
requestOptions: Object.assign({ signal: controller.signal, method, headers: core_module_1.CoreGenerateDefaultHeadersService.call(configuration) }, (method !== 'GET' && {
|
|
12
|
+
requestOptions: Object.assign({ signal: controller.signal, method, headers: core_module_1.CoreGenerateDefaultHeadersService.call(configuration) }, (method !== 'GET' && {
|
|
13
|
+
body: core_module_1.CoreGenerateRequestBody.call(options, configuration),
|
|
14
|
+
})),
|
|
13
15
|
};
|
|
14
16
|
},
|
|
15
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-generate.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-generate.service.ts"],"names":[],"mappings":";;;AACA,wDAGgC;
|
|
1
|
+
{"version":3,"file":"command-generate.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-generate.service.ts"],"names":[],"mappings":";;;AACA,wDAGgC;AAQhC,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE;IAC3C,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC7E,CAAC,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,CACJ,UAAU,EACV,IAAY,EACZ,OAA2D,EAC3D,MAAc,EACd,aAA4B,EAC5B,EAAE;QACF,OAAO;YACL,UAAU,EAAE,IAAI,GAAG,CAAC,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;YACxE,cAAc,kBACZ,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,MAAM,EACN,OAAO,EAAE,+CAAiC,CAAC,IAAI,CAAC,aAAa,CAAC,IAC3D,CAAC,MAAM,KAAK,KAAK,IAAI;gBACtB,IAAI,EAAE,qCAAuB,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC;aAC3D,CAAC,CACH;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-log.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-log.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AAEtE,yEAAoE;AAEvD,QAAA,iBAAiB,GAAG;IAC/B,IAAI,EAAE,CAAC,UAAU,EAAE,OAAmB,EAAE,aAA4B,EAAE,EAAE;QACtE,MAAM,OAAO,GAAG,uCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,iDAAsB,CAAC,IAAI,CAChC,UAAU,EACV,KAAK,
|
|
1
|
+
{"version":3,"file":"command-log.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-log.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AAEtE,yEAAoE;AAEvD,QAAA,iBAAiB,GAAG;IAC/B,IAAI,EAAE,CAAC,UAAU,EAAE,OAAmB,EAAE,aAA4B,EAAE,EAAE;QACtE,MAAM,OAAO,GAAG,uCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,iDAAsB,CAAC,IAAI,CAChC,UAAU,EACV,KAAK,EACL,gCAAK,OAAO,GAAK,EAAE,OAAO,EAAE,CAAgB,EAC5C,MAAM,EACN,aAAa,CACd,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-risk.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-risk.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AACtE,yEAAoE;
|
|
1
|
+
{"version":3,"file":"command-risk.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-risk.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AACtE,yEAAoE;AAGvD,QAAA,kBAAkB,GAAG;IAChC,IAAI,EAAE,CAAC,UAAU,EAAE,OAAoB,EAAE,aAA4B,EAAE,EAAE;QACvE,MAAM,OAAO,GAAG,uCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,iDAAsB,CAAC,IAAI,CAChC,UAAU,EACV,MAAM,EACN,gCAAK,OAAO,GAAK,EAAE,OAAO,EAAE,CAAiB,EAC7C,MAAM,EACN,aAAa,CACd,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-track.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-track.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AAEtE,yEAAoE;AAEvD,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,CAAC,UAAU,EAAE,OAAgB,EAAE,aAA4B,EAAE,EAAE;QACnE,MAAM,OAAO,GAAG,uCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,iDAAsB,CAAC,IAAI,CAChC,UAAU,EACV,OAAO,
|
|
1
|
+
{"version":3,"file":"command-track.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-track.service.ts"],"names":[],"mappings":";;;AACA,iEAAsE;AAEtE,yEAAoE;AAEvD,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,CAAC,UAAU,EAAE,OAAgB,EAAE,aAA4B,EAAE,EAAE;QACnE,MAAM,OAAO,GAAG,uCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,iDAAsB,CAAC,IAAI,CAChC,UAAU,EACV,OAAO,EACP,gCAAK,OAAO,GAAK,EAAE,OAAO,EAAE,CAAa,EACzC,MAAM,EACN,aAAa,CACd,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/command/services/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/command/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,iEAA+C;AAC/C,6DAA2C;AAC3C,+DAA6C;AAC7C,yEAAuD;AACvD,kEAAgD;AAChD,0DAAwC;AACxC,2DAAyC;AACzC,wDAAsC;AACtC,yDAAuC"}
|
package/dist/src/configuraton.js
CHANGED
|
@@ -10,7 +10,7 @@ const constants_1 = require("./constants");
|
|
|
10
10
|
const errors_1 = require("./errors");
|
|
11
11
|
const failover_strategy_1 = require("./failover/models/failover-strategy");
|
|
12
12
|
class Configuration {
|
|
13
|
-
constructor({ apiSecret, baseUrl = constants_1.DEFAULT_API_URL, timeout = constants_1.DEFAULT_TIMEOUT, allowlisted = [], denylisted = [], overrideFetch = node_fetch_1.default, failoverStrategy = failover_strategy_1.FailoverStrategy.allow, doNotTrack = false, ipHeaders = [], trustedProxies = [], trustProxyChain = false, trustedProxyDepth = 0, logger = pino_1.default({
|
|
13
|
+
constructor({ apiSecret, baseUrl = constants_1.DEFAULT_API_URL, timeout = constants_1.DEFAULT_TIMEOUT, allowlisted = [], denylisted = [], overrideFetch = node_fetch_1.default, failoverStrategy = failover_strategy_1.FailoverStrategy.allow, doNotTrack = false, ipHeaders = [], trustedProxies = [], trustProxyChain = false, trustedProxyDepth = 0, logger = (0, pino_1.default)({
|
|
14
14
|
prettyPrint: {
|
|
15
15
|
levelFirst: true,
|
|
16
16
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuraton.js","sourceRoot":"","sources":["../../src/configuraton.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,4DAA+B;AAE/B,2CAA+D;AAC/D,qCAA8C;AAC9C,2EAAuE;AAkBvE,MAAa,aAAa;IAexB,YAAY,EACV,SAAS,EACT,OAAO,GAAG,2BAAe,EACzB,OAAO,GAAG,2BAAe,EACzB,WAAW,GAAG,EAAE,EAChB,UAAU,GAAG,EAAE,EACf,aAAa,GAAG,oBAAK,EACrB,gBAAgB,GAAG,oCAAgB,CAAC,KAAK,EACzC,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,EAAE,EACd,cAAc,GAAG,EAAE,EACnB,eAAe,GAAG,KAAK,EACvB,iBAAiB,GAAG,CAAC,EACrB,MAAM,GAAG,cAAI,
|
|
1
|
+
{"version":3,"file":"configuraton.js","sourceRoot":"","sources":["../../src/configuraton.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,4DAA+B;AAE/B,2CAA+D;AAC/D,qCAA8C;AAC9C,2EAAuE;AAkBvE,MAAa,aAAa;IAexB,YAAY,EACV,SAAS,EACT,OAAO,GAAG,2BAAe,EACzB,OAAO,GAAG,2BAAe,EACzB,WAAW,GAAG,EAAE,EAChB,UAAU,GAAG,EAAE,EACf,aAAa,GAAG,oBAAK,EACrB,gBAAgB,GAAG,oCAAgB,CAAC,KAAK,EACzC,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,EAAE,EACd,cAAc,GAAG,EAAE,EACnB,eAAe,GAAG,KAAK,EACvB,iBAAiB,GAAG,CAAC,EACrB,MAAM,GAAG,IAAA,cAAI,EAAC;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,IAAI;SACjB;KACF,CAAC,GACsB;QACxB,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,2BAAkB,CAC1B,qEAAqE,CACtE,CAAC;SACH;QAED,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAtDD,sCAsDC"}
|
package/dist/src/constants.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TRUSTED_PROXIES = exports.DEFAULT_ALLOWLIST = exports.DEFAULT_TIMEOUT = exports.DEFAULT_API_URL = void 0;
|
|
4
4
|
exports.DEFAULT_API_URL = 'https://api.castle.io/v1';
|
|
5
|
-
exports.DEFAULT_TIMEOUT =
|
|
5
|
+
exports.DEFAULT_TIMEOUT = 1500;
|
|
6
6
|
exports.DEFAULT_ALLOWLIST = [
|
|
7
7
|
'accept',
|
|
8
8
|
'accept-charset',
|
|
@@ -25,7 +25,6 @@ exports.DEFAULT_ALLOWLIST = [
|
|
|
25
25
|
'te',
|
|
26
26
|
'upgrade-insecure-requests',
|
|
27
27
|
'user-agent',
|
|
28
|
-
'x-castle-client-id',
|
|
29
28
|
'x-requested-with',
|
|
30
29
|
];
|
|
31
30
|
exports.TRUSTED_PROXIES = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAC7C,QAAA,eAAe,GAAG,IAAI,CAAC;AACvB,QAAA,iBAAiB,GAAG;IAC/B,QAAQ;IACR,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,cAAc;IACd,KAAK;IACL,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,IAAI;IACJ,2BAA2B;IAC3B,YAAY;IACZ,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAC7C,QAAA,eAAe,GAAG,IAAI,CAAC;AACvB,QAAA,iBAAiB,GAAG;IAC/B,QAAQ;IACR,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,cAAc;IACd,KAAK;IACL,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,IAAI;IACJ,2BAA2B;IAC3B,YAAY;IACZ,kBAAkB;CACnB,CAAC;AACW,QAAA,eAAe,GAAG;IAC7B,IAAI,MAAM,CACR;QACE,iBAAiB;QACjB,8CAA8C;QAC9C,4BAA4B;QAC5B,cAAc;QACd,SAAS;QACT,QAAQ;KACT;SACE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;SACpB,IAAI,CAAC,EAAE,CAAC,CACZ;CACF,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.module.js","sourceRoot":"","sources":["../../../src/context/context.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.module.js","sourceRoot":"","sources":["../../../src/context/context.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -12,10 +12,10 @@ const headers_module_1 = require("../../headers/headers.module");
|
|
|
12
12
|
const ips_module_1 = require("../../ips/ips.module");
|
|
13
13
|
const package_json_1 = require("../../../package.json");
|
|
14
14
|
const requestContextData = (request, cookies, configuration) => {
|
|
15
|
-
if (lodash_isempty_1.default(request)) {
|
|
15
|
+
if ((0, lodash_isempty_1.default)(request)) {
|
|
16
16
|
return {};
|
|
17
17
|
}
|
|
18
|
-
const cookiesForClientId = cookies || lodash_get_1.default(request, 'headers.cookies');
|
|
18
|
+
const cookiesForClientId = cookies || (0, lodash_get_1.default)(request, 'headers.cookies');
|
|
19
19
|
return {
|
|
20
20
|
client_id: client_id_module_1.ClientIdExtractService.call(request.headers, cookiesForClientId) || false,
|
|
21
21
|
active: true,
|
|
@@ -25,7 +25,7 @@ const requestContextData = (request, cookies, configuration) => {
|
|
|
25
25
|
};
|
|
26
26
|
exports.ContextGetDefaultService = {
|
|
27
27
|
call: (request, cookies, configuration) => {
|
|
28
|
-
return Object.assign(Object.assign({}, lodash_pickby_1.default(requestContextData(request, cookies, configuration))), { library: {
|
|
28
|
+
return Object.assign(Object.assign({}, (0, lodash_pickby_1.default)(requestContextData(request, cookies, configuration))), { library: {
|
|
29
29
|
name: 'castle-node',
|
|
30
30
|
version: package_json_1.version,
|
|
31
31
|
} });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-get-default.service.js","sourceRoot":"","sources":["../../../../src/context/services/context-get-default.service.ts"],"names":[],"mappings":";;;;;;AAAA,oEAAqC;AACrC,4DAA6B;AAC7B,kEAAmC;AAEnC,uEAA0E;AAC1E,iEAAqE;AACrE,qDAAyD;AACzD,wDAAgD;
|
|
1
|
+
{"version":3,"file":"context-get-default.service.js","sourceRoot":"","sources":["../../../../src/context/services/context-get-default.service.ts"],"names":[],"mappings":";;;;;;AAAA,oEAAqC;AACrC,4DAA6B;AAC7B,kEAAmC;AAEnC,uEAA0E;AAC1E,iEAAqE;AACrE,qDAAyD;AACzD,wDAAgD;AAGhD,MAAM,kBAAkB,GAAG,CACzB,OAAuB,EACvB,OAA2B,EAC3B,aAA4B,EACJ,EAAE;IAC1B,IAAI,IAAA,wBAAO,EAAC,OAAO,CAAC,EAAE;QACpB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,kBAAkB,GAAG,OAAO,IAAI,IAAA,oBAAG,EAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IACtE,OAAO;QACL,SAAS,EACP,yCAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI,KAAK;QAC3E,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,sCAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC;QACnE,EAAE,EAAE,8BAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC;KAC3D,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACtC,IAAI,EAAE,CACJ,OAAuB,EACvB,OAA2B,EAC3B,aAA4B,EACJ,EAAE;QAC1B,uCACK,IAAA,uBAAM,EAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,KAC9D,OAAO,EAAE;gBACP,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAP,sBAAO;aACR,IACD;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -7,9 +7,9 @@ exports.ContextPrepareService = void 0;
|
|
|
7
7
|
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
8
8
|
const context_get_default_service_1 = require("./context-get-default.service");
|
|
9
9
|
exports.ContextPrepareService = {
|
|
10
|
-
call: (
|
|
11
|
-
const defaultContext = context_get_default_service_1.ContextGetDefaultService.call(
|
|
12
|
-
return lodash_merge_1.default(
|
|
10
|
+
call: (request, options, configuration) => {
|
|
11
|
+
const defaultContext = context_get_default_service_1.ContextGetDefaultService.call(request, options === null || options === void 0 ? void 0 : options.cookies, configuration);
|
|
12
|
+
return (0, lodash_merge_1.default)(defaultContext, options === null || options === void 0 ? void 0 : options.context);
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=context-prepare.service.js.map
|