@riavzon/bot-detector 1.0.13 → 1.0.14

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/main.cjs CHANGED
@@ -516,7 +516,7 @@ async function updateBannedIP(cookie, ipAddress, country, user_agent, info) {
516
516
  //#endregion
517
517
  //#region src/botDetector/db/updateIsBot.ts
518
518
  async function updateIsBot(isBot, cookie) {
519
- const params = [isBot, cookie];
519
+ const params = [isBot ? 1 : 0, cookie];
520
520
  const db = getDb();
521
521
  const log = getLogger().child({
522
522
  service: "BOT DETECTOR",
@@ -572,7 +572,7 @@ async function updateVisitor(u) {
572
572
  browserVersion,
573
573
  os,
574
574
  Number(activity_score) || 0
575
- ].map((value) => value === void 0 ? null : value);
575
+ ].map((value) => value === void 0 ? null : typeof value === "boolean" ? value ? 1 : 0 : value);
576
576
  const ex = (col) => excluded(db, col);
577
577
  const upsert = onUpsert(db, "canary_id");
578
578
  try {
@@ -3234,8 +3234,8 @@ async function updateVisitors(data, cookie, visitor_id) {
3234
3234
  data.as,
3235
3235
  data.device_type,
3236
3236
  data.browser,
3237
- data.proxy,
3238
- data.hosting,
3237
+ data.proxy ? 1 : 0,
3238
+ data.hosting ? 1 : 0,
3239
3239
  data.deviceVendor,
3240
3240
  data.deviceModel,
3241
3241
  data.browserType,