@ada-support/embed2 1.14.23 → 1.14.24
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/npm-entry/index.js +21 -14
- package/package.json +1 -1
package/dist/npm-entry/index.js
CHANGED
|
@@ -16119,7 +16119,7 @@ const client = new BrowserClient({
|
|
|
16119
16119
|
return event;
|
|
16120
16120
|
},
|
|
16121
16121
|
environment: "production",
|
|
16122
|
-
release: "1.14.
|
|
16122
|
+
release: "1.14.24-b964ecf",
|
|
16123
16123
|
sampleRate: 0.25,
|
|
16124
16124
|
autoSessionTracking: false,
|
|
16125
16125
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -16750,7 +16750,7 @@ function getEmbedURL(_ref) {
|
|
|
16750
16750
|
} else {
|
|
16751
16751
|
host = `http://${handle}.localhost:${ports.localhost.default}`;
|
|
16752
16752
|
}
|
|
16753
|
-
return `${host}/embed/${frameName}/${"
|
|
16753
|
+
return `${host}/embed/${frameName}/${"b964ecf"}/index.html`;
|
|
16754
16754
|
}
|
|
16755
16755
|
function constructQueryString(query) {
|
|
16756
16756
|
return Object.keys(query).map(key => {
|
|
@@ -17586,9 +17586,9 @@ async function log(message, extra, options) {
|
|
|
17586
17586
|
service: "embed",
|
|
17587
17587
|
env: "production",
|
|
17588
17588
|
embedVersion: 2,
|
|
17589
|
-
version: "1.14.
|
|
17589
|
+
version: "1.14.24",
|
|
17590
17590
|
isNpm: true,
|
|
17591
|
-
commitHash: "
|
|
17591
|
+
commitHash: "b964ecf"
|
|
17592
17592
|
}))
|
|
17593
17593
|
});
|
|
17594
17594
|
}
|
|
@@ -17597,21 +17597,28 @@ function getProcessedPath(path) {
|
|
|
17597
17597
|
const regex = /^http(s)?:\/\/(www.)?/;
|
|
17598
17598
|
return path.trim().replace(regex, "");
|
|
17599
17599
|
}
|
|
17600
|
+
|
|
17601
|
+
// Only "*" is a wildcard ("match anything"); every other character — including
|
|
17602
|
+
// regex metacharacters in a customer URL like "." or "(" — is matched literally,
|
|
17603
|
+
// so they are escaped rather than interpreted (or throwing on an unbalanced "("
|
|
17604
|
+
// or a trailing "\").
|
|
17605
|
+
function escapeLiteralsExpandWildcards(value) {
|
|
17606
|
+
return value.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
|
|
17607
|
+
}
|
|
17600
17608
|
function getPathSearchRegex(path) {
|
|
17601
17609
|
const params = path.split("?");
|
|
17602
17610
|
if (params.length > 1) {
|
|
17603
|
-
|
|
17604
|
-
|
|
17611
|
+
// The pre-"?" half needs the same escaping as the wildcard branch below: an
|
|
17612
|
+
// unescaped "|" here is a top-level alternation, which discards the "^…$"
|
|
17613
|
+
// anchoring and silently widens the condition to a prefix wildcard.
|
|
17614
|
+
const escapedPath = escapeLiteralsExpandWildcards(params[0]);
|
|
17615
|
+
return new RegExp(`^${escapedPath}\\?${escapeLiteralsExpandWildcards(params[1])}$`);
|
|
17605
17616
|
}
|
|
17606
17617
|
|
|
17607
|
-
//
|
|
17608
|
-
// regex metacharacters in a customer URL like "." or "(" — is matched literally,
|
|
17609
|
-
// so they are escaped rather than interpreted (or throwing on an unbalanced "("
|
|
17610
|
-
// or a trailing "\"). A trailing "/*" is optional: "/help/*" also matches "/help"
|
|
17611
|
-
// with nothing after it.
|
|
17618
|
+
// A trailing "/*" is optional: "/help/*" also matches "/help" with nothing after it.
|
|
17612
17619
|
const hasTrailingWildcard = path.endsWith("/*");
|
|
17613
17620
|
const base = hasTrailingWildcard ? path.slice(0, -2) : path;
|
|
17614
|
-
const escaped = base
|
|
17621
|
+
const escaped = escapeLiteralsExpandWildcards(base);
|
|
17615
17622
|
const newPath = hasTrailingWildcard ? `${escaped}(/.*)?` : escaped;
|
|
17616
17623
|
return new RegExp(`^${newPath}$`);
|
|
17617
17624
|
}
|
|
@@ -20401,7 +20408,7 @@ class ChatFrame extends d {
|
|
|
20401
20408
|
log("Chat frame mount", {
|
|
20402
20409
|
handle,
|
|
20403
20410
|
chatUrl: this.url,
|
|
20404
|
-
embedVersion: "
|
|
20411
|
+
embedVersion: "b964ecf".slice(0, 7),
|
|
20405
20412
|
embedSettings: adaSettings
|
|
20406
20413
|
});
|
|
20407
20414
|
|
|
@@ -20489,7 +20496,7 @@ class ChatFrame extends d {
|
|
|
20489
20496
|
const hostPageUrlParams = new URL(window.location.href).searchParams;
|
|
20490
20497
|
const smsToken = hostPageUrlParams.get("adaSMSToken");
|
|
20491
20498
|
const queryParams = {
|
|
20492
|
-
embedVersion: "
|
|
20499
|
+
embedVersion: "b964ecf".slice(0, 7),
|
|
20493
20500
|
greeting,
|
|
20494
20501
|
language,
|
|
20495
20502
|
skipGreeting,
|