@xapp/arachne-parsers
Advanced tools
Comparing version 1.8.8 to 1.8.9
@@ -5,4 +5,7 @@ /*! Copyright (c) 2024, XAPP AI */ | ||
export declare const SERVICE_TITAN_CHAT_TO_TEXT_HOST = "text2chat-widget.servicetitan.com"; | ||
export declare const SERVICE_TITAN_SCHEDULER = "ServiceTitan Scheduler"; | ||
export declare const SERVICE_TITAN_SCHEDULER_HOST = "scheduler.servicetitan.com"; | ||
export declare const SERVICE_TITAN_SCHEDULER_HOST_2 = "webscheduler-widget.servicetitan.com"; | ||
export declare class ServiceTitanDetector extends AbstractDetector { | ||
detect(): Promise<DetectorResult[]>; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ServiceTitanDetector = exports.SERVICE_TITAN_CHAT_TO_TEXT_HOST = exports.SERVICE_TITAN_CHAT_TO_TEXT = void 0; | ||
exports.ServiceTitanDetector = exports.SERVICE_TITAN_SCHEDULER_HOST_2 = exports.SERVICE_TITAN_SCHEDULER_HOST = exports.SERVICE_TITAN_SCHEDULER = exports.SERVICE_TITAN_CHAT_TO_TEXT_HOST = exports.SERVICE_TITAN_CHAT_TO_TEXT = void 0; | ||
/*! Copyright (c) 2024, XAPP AI */ | ||
@@ -8,6 +8,11 @@ const Detector_1 = require("./Detector"); | ||
exports.SERVICE_TITAN_CHAT_TO_TEXT_HOST = "text2chat-widget.servicetitan.com"; | ||
exports.SERVICE_TITAN_SCHEDULER = "ServiceTitan Scheduler"; | ||
// iframe src | ||
exports.SERVICE_TITAN_SCHEDULER_HOST = "scheduler.servicetitan.com"; | ||
exports.SERVICE_TITAN_SCHEDULER_HOST_2 = "webscheduler-widget.servicetitan.com"; | ||
class ServiceTitanDetector extends Detector_1.AbstractDetector { | ||
async detect() { | ||
const iframes = this.cheerio("iframe"); | ||
let installed = false; | ||
let chatInstalled = false; | ||
let schedulerInstalled = false; | ||
iframes.each((index, element) => { | ||
@@ -22,4 +27,7 @@ // Type guard to ensure the element is not a TextElement | ||
if (urlWithoutProtocol.toLowerCase().includes(exports.SERVICE_TITAN_CHAT_TO_TEXT_HOST)) { | ||
installed = true; | ||
chatInstalled = true; | ||
} | ||
if (urlWithoutProtocol.toLowerCase().includes(exports.SERVICE_TITAN_SCHEDULER_HOST) || urlWithoutProtocol.toLowerCase().includes(exports.SERVICE_TITAN_SCHEDULER_HOST_2)) { | ||
schedulerInstalled = true; | ||
} | ||
} | ||
@@ -32,7 +40,14 @@ catch (e) { | ||
}); | ||
return [{ | ||
return [ | ||
{ | ||
technology: exports.SERVICE_TITAN_CHAT_TO_TEXT, | ||
installed, | ||
installed: chatInstalled, | ||
type: "CHAT" | ||
}]; | ||
}, | ||
{ | ||
technology: exports.SERVICE_TITAN_SCHEDULER, | ||
installed: schedulerInstalled, | ||
type: "SCHEDULER" | ||
} | ||
]; | ||
} | ||
@@ -39,0 +54,0 @@ } |
{ | ||
"name": "@xapp/arachne-parsers", | ||
"version": "1.8.8", | ||
"version": "1.8.9", | ||
"types": "lib/index", | ||
@@ -45,3 +45,3 @@ "main": "lib/index", | ||
}, | ||
"gitHead": "7fc8d89cdbb5d3e233393fc87f765e2d7351ed07" | ||
"gitHead": "18426f064f5e40d51818909ef6cfbfa3678e1f6d" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231436
3560