@netacea/netaceaintegrationbase 2.0.115 → 2.0.116
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/dist/index.cjs +12 -2
- package/dist/index.d.ts +22 -61
- package/dist/index.mjs +12 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -119,7 +119,7 @@ const mitigateMap = {
|
|
|
119
119
|
1: 'blocked',
|
|
120
120
|
2: 'allow',
|
|
121
121
|
3: 'hardblocked',
|
|
122
|
-
4: '
|
|
122
|
+
4: 'flagged'
|
|
123
123
|
};
|
|
124
124
|
const captchaMap = {
|
|
125
125
|
0: '',
|
|
@@ -156,7 +156,7 @@ const bestMitigationMap = {
|
|
|
156
156
|
1: mitigationTypes.block,
|
|
157
157
|
2: mitigationTypes.none,
|
|
158
158
|
3: mitigationTypes.block,
|
|
159
|
-
4: mitigationTypes.
|
|
159
|
+
4: mitigationTypes.none
|
|
160
160
|
};
|
|
161
161
|
const bestMitigationCaptchaMap = {
|
|
162
162
|
1: mitigationTypes.captcha,
|
|
@@ -586,6 +586,16 @@ function parseSetCookie(setCookie) {
|
|
|
586
586
|
const name = setCookie.slice(0, eqIndex);
|
|
587
587
|
const valueWithAttributes = setCookie.slice(eqIndex + 1);
|
|
588
588
|
const semiIndex = valueWithAttributes.indexOf(';');
|
|
589
|
+
if (semiIndex < 0) {
|
|
590
|
+
// No semicolon means no attributes
|
|
591
|
+
const value = valueWithAttributes;
|
|
592
|
+
const attributes = '';
|
|
593
|
+
return {
|
|
594
|
+
name,
|
|
595
|
+
value,
|
|
596
|
+
attributes
|
|
597
|
+
};
|
|
598
|
+
}
|
|
589
599
|
const value = valueWithAttributes.slice(0, semiIndex);
|
|
590
600
|
const attributes = valueWithAttributes.slice(semiIndex).trimStart();
|
|
591
601
|
return {
|
package/dist/index.d.ts
CHANGED
|
@@ -222,79 +222,36 @@ interface ComposeResultResponse {
|
|
|
222
222
|
injectHeaders?: InjectHeaders;
|
|
223
223
|
}
|
|
224
224
|
interface IngestArgs {
|
|
225
|
-
/**
|
|
226
|
-
* Client IP Address
|
|
227
|
-
*/
|
|
228
|
-
ip: string;
|
|
229
|
-
/**
|
|
230
|
-
* Client User-Agent header value
|
|
231
|
-
*/
|
|
232
|
-
userAgent: string;
|
|
233
|
-
/**
|
|
234
|
-
* Response status code
|
|
235
|
-
* Should be 403 if Netacea mitigated
|
|
236
|
-
*/
|
|
237
|
-
status: string;
|
|
238
|
-
/**
|
|
239
|
-
* Request method
|
|
240
|
-
*/
|
|
241
|
-
method: string;
|
|
242
|
-
/**
|
|
243
|
-
* Request path
|
|
244
|
-
*/
|
|
245
|
-
path: string;
|
|
246
|
-
/**
|
|
247
|
-
* Request protocol
|
|
248
|
-
*/
|
|
249
|
-
protocol: string | null;
|
|
250
|
-
/**
|
|
251
|
-
* Request referer header value
|
|
252
|
-
*/
|
|
253
|
-
referer: string;
|
|
254
|
-
/**
|
|
255
|
-
* Request content-length header, or body size
|
|
256
|
-
*/
|
|
257
225
|
bytesSent: string | number;
|
|
258
|
-
/**
|
|
259
|
-
* The time the request was started, in unix milliseconds format.
|
|
260
|
-
*/
|
|
261
|
-
timeUnixMsUTC?: number;
|
|
262
|
-
/**
|
|
263
|
-
* Time taken to serve request
|
|
264
|
-
*/
|
|
265
|
-
requestTime: string | number;
|
|
266
|
-
/**
|
|
267
|
-
* Netacea mitata cookie value.
|
|
268
|
-
* Should be request's cookie value if Netacea was not called.
|
|
269
|
-
*/
|
|
270
|
-
mitataCookie?: string;
|
|
271
|
-
/**
|
|
272
|
-
* Session status from `ComposeResultResponse`
|
|
273
|
-
*/
|
|
274
|
-
sessionStatus?: string;
|
|
275
|
-
/**
|
|
276
|
-
* Type of the integration, for example "Cloudflare" or "Cloudfront"
|
|
277
|
-
*/
|
|
278
|
-
integrationType?: string;
|
|
279
|
-
/**
|
|
280
|
-
* SEMVER string indicating the version of the integration
|
|
281
|
-
* Example: 1.2.3
|
|
282
|
-
*/
|
|
283
|
-
integrationVersion?: string;
|
|
284
|
-
/**
|
|
285
|
-
* IP values set by a CDN under "x-forwarded-for" header
|
|
286
|
-
*/
|
|
287
226
|
cookieFingerprint?: string;
|
|
288
227
|
gqlOpName?: string;
|
|
289
228
|
gqlOpType?: string;
|
|
290
229
|
headerFingerprint?: string;
|
|
291
230
|
integrationMode?: string;
|
|
231
|
+
integrationType?: string;
|
|
232
|
+
integrationVersion?: string;
|
|
233
|
+
ip: string;
|
|
292
234
|
ipHeader?: string;
|
|
235
|
+
method: string;
|
|
236
|
+
mitataCookie?: string;
|
|
293
237
|
mitigationLatency?: number;
|
|
294
238
|
mitigationStatus?: number;
|
|
295
239
|
netaceaCookieStatus?: number;
|
|
240
|
+
path: string;
|
|
241
|
+
protocol: string | null;
|
|
242
|
+
query?: string;
|
|
243
|
+
referer: string;
|
|
244
|
+
reqHandlerId?: string;
|
|
245
|
+
reqHandlerMs?: number;
|
|
296
246
|
requestHost?: string;
|
|
297
247
|
requestId?: string;
|
|
248
|
+
requestTime: string | number;
|
|
249
|
+
resHandlerId?: string;
|
|
250
|
+
resHandlerMs?: number;
|
|
251
|
+
sessionStatus?: string;
|
|
252
|
+
status: string;
|
|
253
|
+
timeUnixMsUTC?: number;
|
|
254
|
+
userAgent: string;
|
|
298
255
|
workerInstanceId?: string;
|
|
299
256
|
xForwardedFor?: string;
|
|
300
257
|
}
|
|
@@ -316,10 +273,14 @@ interface WebLog {
|
|
|
316
273
|
Query?: string;
|
|
317
274
|
RealIp: string;
|
|
318
275
|
Referer: string;
|
|
276
|
+
ReqHandlerId?: string;
|
|
277
|
+
ReqHandlerMs?: number;
|
|
319
278
|
Request: string;
|
|
320
279
|
RequestHost?: string;
|
|
321
280
|
RequestId?: string;
|
|
322
281
|
RequestTime: string;
|
|
282
|
+
ResHandlerId?: string;
|
|
283
|
+
ResHandlerMs?: number;
|
|
323
284
|
Status: string;
|
|
324
285
|
TimeLocal: string;
|
|
325
286
|
TimeUnixMsUTC?: number;
|
package/dist/index.mjs
CHANGED
|
@@ -117,7 +117,7 @@ const mitigateMap = {
|
|
|
117
117
|
1: 'blocked',
|
|
118
118
|
2: 'allow',
|
|
119
119
|
3: 'hardblocked',
|
|
120
|
-
4: '
|
|
120
|
+
4: 'flagged'
|
|
121
121
|
};
|
|
122
122
|
const captchaMap = {
|
|
123
123
|
0: '',
|
|
@@ -154,7 +154,7 @@ const bestMitigationMap = {
|
|
|
154
154
|
1: mitigationTypes.block,
|
|
155
155
|
2: mitigationTypes.none,
|
|
156
156
|
3: mitigationTypes.block,
|
|
157
|
-
4: mitigationTypes.
|
|
157
|
+
4: mitigationTypes.none
|
|
158
158
|
};
|
|
159
159
|
const bestMitigationCaptchaMap = {
|
|
160
160
|
1: mitigationTypes.captcha,
|
|
@@ -584,6 +584,16 @@ function parseSetCookie(setCookie) {
|
|
|
584
584
|
const name = setCookie.slice(0, eqIndex);
|
|
585
585
|
const valueWithAttributes = setCookie.slice(eqIndex + 1);
|
|
586
586
|
const semiIndex = valueWithAttributes.indexOf(';');
|
|
587
|
+
if (semiIndex < 0) {
|
|
588
|
+
// No semicolon means no attributes
|
|
589
|
+
const value = valueWithAttributes;
|
|
590
|
+
const attributes = '';
|
|
591
|
+
return {
|
|
592
|
+
name,
|
|
593
|
+
value,
|
|
594
|
+
attributes
|
|
595
|
+
};
|
|
596
|
+
}
|
|
587
597
|
const value = valueWithAttributes.slice(0, semiIndex);
|
|
588
598
|
const attributes = valueWithAttributes.slice(semiIndex).trimStart();
|
|
589
599
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netacea/netaceaintegrationbase",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.116",
|
|
4
4
|
"description": "Base package for Netacea CDN integrations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "UNLICENSED",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@netacea/kinesisingest": "^1.5.
|
|
27
|
+
"@netacea/kinesisingest": "^1.5.134"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "77ef9b6b2727165f2137461efd91e8770318518c"
|
|
30
30
|
}
|