@netacea/netaceaintegrationbase 2.0.114 → 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 CHANGED
@@ -119,7 +119,7 @@ const mitigateMap = {
119
119
  1: 'blocked',
120
120
  2: 'allow',
121
121
  3: 'hardblocked',
122
- 4: 'block'
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.block
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,103 +222,70 @@ 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;
227
+ gqlOpName?: string;
228
+ gqlOpType?: string;
288
229
  headerFingerprint?: string;
289
230
  integrationMode?: string;
231
+ integrationType?: string;
232
+ integrationVersion?: string;
233
+ ip: string;
290
234
  ipHeader?: string;
235
+ method: string;
236
+ mitataCookie?: string;
291
237
  mitigationLatency?: number;
292
238
  mitigationStatus?: number;
293
239
  netaceaCookieStatus?: number;
240
+ path: string;
241
+ protocol: string | null;
242
+ query?: string;
243
+ referer: string;
244
+ reqHandlerId?: string;
245
+ reqHandlerMs?: number;
294
246
  requestHost?: string;
295
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;
296
255
  workerInstanceId?: string;
297
256
  xForwardedFor?: string;
298
257
  }
299
258
  interface WebLog {
300
- BytesSent: string;
259
+ BytesReceived?: number;
260
+ BytesSent: number | string;
261
+ GraphQL?: Record<string, string>;
301
262
  HeaderHash?: string;
302
263
  IntegrationType?: string;
303
264
  IntegrationVersion?: string;
304
265
  IpFromHeader?: string;
305
266
  NetaceaMitigationApplied: string;
306
- NetaceaUserIdCookie: string;
267
+ NetaceaUserIdCookie?: string;
307
268
  NetaceaUserIdCookieStatus?: number;
308
269
  optional?: Record<string, unknown>;
309
270
  ProtectionMode?: string;
310
271
  ProtectorLatencyMs?: number;
311
272
  ProtectorStatus?: number;
273
+ Query?: string;
312
274
  RealIp: string;
313
275
  Referer: string;
276
+ ReqHandlerId?: string;
277
+ ReqHandlerMs?: number;
314
278
  Request: string;
315
279
  RequestHost?: string;
316
280
  RequestId?: string;
317
281
  RequestTime: string;
282
+ ResHandlerId?: string;
283
+ ResHandlerMs?: number;
318
284
  Status: string;
319
285
  TimeLocal: string;
320
286
  TimeUnixMsUTC?: number;
321
287
  UserAgent: string;
288
+ UserId?: string;
322
289
  WorkerInstanceId?: string;
323
290
  XForwardedFor?: string;
324
291
  }
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: 'block'
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.block
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.114",
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.132"
27
+ "@netacea/kinesisingest": "^1.5.134"
28
28
  },
29
- "gitHead": "ed358a03a5bbcb78307205e72a95bfc513bf9e41"
29
+ "gitHead": "77ef9b6b2727165f2137461efd91e8770318518c"
30
30
  }