@ada-support/embed2 1.4.11 → 1.4.12
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
CHANGED
|
@@ -15811,7 +15811,7 @@ const client = new error_tracker_BrowserClient({
|
|
|
15811
15811
|
},
|
|
15812
15812
|
|
|
15813
15813
|
environment: "production",
|
|
15814
|
-
release: "1.4.
|
|
15814
|
+
release: "1.4.12-95c61ad",
|
|
15815
15815
|
sampleRate: 0.25,
|
|
15816
15816
|
autoSessionTracking: false,
|
|
15817
15817
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -16432,7 +16432,7 @@ function getEmbedURL(_ref) {
|
|
|
16432
16432
|
host = "http://".concat(window.location.hostname, ":9001");
|
|
16433
16433
|
}
|
|
16434
16434
|
|
|
16435
|
-
return "".concat(host, "/embed/").concat(frameName, "/").concat("
|
|
16435
|
+
return "".concat(host, "/embed/").concat(frameName, "/").concat("95c61ad", "/index.html");
|
|
16436
16436
|
}
|
|
16437
16437
|
|
|
16438
16438
|
function constructQueryString(query) {
|
|
@@ -18143,12 +18143,69 @@ const persistence = {
|
|
|
18143
18143
|
}
|
|
18144
18144
|
}
|
|
18145
18145
|
};
|
|
18146
|
+
// EXTERNAL MODULE: ./node_modules/lodash.memoize/index.js
|
|
18147
|
+
var lodash_memoize = __webpack_require__(773);
|
|
18148
|
+
var lodash_memoize_default = /*#__PURE__*/__webpack_require__.n(lodash_memoize);
|
|
18149
|
+
;// CONCATENATED MODULE: ./src/services/logger/index.ts
|
|
18150
|
+
|
|
18151
|
+
|
|
18152
|
+
function logger_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18153
|
+
|
|
18154
|
+
function logger_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? logger_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : logger_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18155
|
+
|
|
18156
|
+
|
|
18157
|
+
|
|
18158
|
+
const DEFAULT_LOG_SAMPLE_RATE = 0.01; // 1% of logs will go through
|
|
18159
|
+
|
|
18160
|
+
const DD_BASE_URL = "https://browser-http-intake.logs.datadoghq.com/v1/input/";
|
|
18161
|
+
const DD_TOKEN = "pubfe23baedd2ea322bebb5ed2020fa2fa1"; // We need memoization to ensure consistency of logs
|
|
18162
|
+
|
|
18163
|
+
const shouldLog = lodash_memoize_default()(sampleRate => {
|
|
18164
|
+
if (!DD_TOKEN || sampleRate === 0) {
|
|
18165
|
+
return false;
|
|
18166
|
+
}
|
|
18167
|
+
|
|
18168
|
+
return Math.random() < (sampleRate || DEFAULT_LOG_SAMPLE_RATE);
|
|
18169
|
+
});
|
|
18170
|
+
/**
|
|
18171
|
+
* Sends log to Datadog
|
|
18172
|
+
*/
|
|
18173
|
+
|
|
18174
|
+
async function log(message, extra, options) {
|
|
18175
|
+
if (!shouldLog(options === null || options === void 0 ? void 0 : options.sampleRate)) {
|
|
18176
|
+
return;
|
|
18177
|
+
}
|
|
18178
|
+
|
|
18179
|
+
await httpRequest({
|
|
18180
|
+
url: "".concat(DD_BASE_URL).concat(DD_TOKEN, "?ddsource=browser&ddtags=version:1.5.0,env:").concat("production"),
|
|
18181
|
+
method: "POST",
|
|
18182
|
+
body: JSON.stringify(logger_objectSpread(logger_objectSpread({
|
|
18183
|
+
message
|
|
18184
|
+
}, extra), {}, {
|
|
18185
|
+
sampleRate: (options === null || options === void 0 ? void 0 : options.sampleRate) || DEFAULT_LOG_SAMPLE_RATE,
|
|
18186
|
+
service: "embed",
|
|
18187
|
+
env: "production",
|
|
18188
|
+
embedVersion: 2,
|
|
18189
|
+
version: "1.4.12",
|
|
18190
|
+
isNpm: true,
|
|
18191
|
+
commitHash: "95c61ad"
|
|
18192
|
+
}))
|
|
18193
|
+
});
|
|
18194
|
+
}
|
|
18146
18195
|
;// CONCATENATED MODULE: ./src/services/chat-versioning/manifest.ts
|
|
18147
18196
|
|
|
18197
|
+
|
|
18148
18198
|
const CHAT_MANIFEST_PATH = "https://static.ada.support/chat-manifest.json";
|
|
18149
18199
|
const loadChatManifest = async () => {
|
|
18150
|
-
|
|
18151
|
-
|
|
18200
|
+
try {
|
|
18201
|
+
const r = await fetch(CHAT_MANIFEST_PATH);
|
|
18202
|
+
return r.json();
|
|
18203
|
+
} catch (e) {
|
|
18204
|
+
// handling cases where r is undefined / other fetch errors
|
|
18205
|
+
// by returning undefined, we tell the server to load the unversioned index.html file for chat
|
|
18206
|
+
log("Failed to load chat manifest");
|
|
18207
|
+
return undefined;
|
|
18208
|
+
}
|
|
18152
18209
|
}; // Use one message for different errors to reduce the bundle size
|
|
18153
18210
|
|
|
18154
18211
|
const MANIFEST_VALIDATION_ERROR_MESSAGE = "The format of manifest file is incorrect";
|
|
@@ -18262,57 +18319,13 @@ const getChatVersion = async adaSettings => {
|
|
|
18262
18319
|
}
|
|
18263
18320
|
|
|
18264
18321
|
const manifest = await loadChatManifest();
|
|
18265
|
-
return getChatVersionFromManifest(manifest);
|
|
18266
|
-
};
|
|
18267
|
-
// EXTERNAL MODULE: ./node_modules/lodash.memoize/index.js
|
|
18268
|
-
var lodash_memoize = __webpack_require__(773);
|
|
18269
|
-
var lodash_memoize_default = /*#__PURE__*/__webpack_require__.n(lodash_memoize);
|
|
18270
|
-
;// CONCATENATED MODULE: ./src/services/logger/index.ts
|
|
18271
|
-
|
|
18272
|
-
|
|
18273
|
-
function logger_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18274
|
-
|
|
18275
|
-
function logger_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? logger_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : logger_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18276
|
-
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
const DEFAULT_LOG_SAMPLE_RATE = 0.01; // 1% of logs will go through
|
|
18280
|
-
|
|
18281
|
-
const DD_BASE_URL = "https://browser-http-intake.logs.datadoghq.com/v1/input/";
|
|
18282
|
-
const DD_TOKEN = "pubfe23baedd2ea322bebb5ed2020fa2fa1"; // We need memoization to ensure consistency of logs
|
|
18283
|
-
|
|
18284
|
-
const shouldLog = lodash_memoize_default()(sampleRate => {
|
|
18285
|
-
if (!DD_TOKEN || sampleRate === 0) {
|
|
18286
|
-
return false;
|
|
18287
|
-
}
|
|
18288
|
-
|
|
18289
|
-
return Math.random() < (sampleRate || DEFAULT_LOG_SAMPLE_RATE);
|
|
18290
|
-
});
|
|
18291
|
-
/**
|
|
18292
|
-
* Sends log to Datadog
|
|
18293
|
-
*/
|
|
18294
18322
|
|
|
18295
|
-
|
|
18296
|
-
|
|
18297
|
-
return;
|
|
18323
|
+
if (!manifest) {
|
|
18324
|
+
return undefined;
|
|
18298
18325
|
}
|
|
18299
18326
|
|
|
18300
|
-
|
|
18301
|
-
|
|
18302
|
-
method: "POST",
|
|
18303
|
-
body: JSON.stringify(logger_objectSpread(logger_objectSpread({
|
|
18304
|
-
message
|
|
18305
|
-
}, extra), {}, {
|
|
18306
|
-
sampleRate: (options === null || options === void 0 ? void 0 : options.sampleRate) || DEFAULT_LOG_SAMPLE_RATE,
|
|
18307
|
-
service: "embed",
|
|
18308
|
-
env: "production",
|
|
18309
|
-
embedVersion: 2,
|
|
18310
|
-
version: "1.4.11",
|
|
18311
|
-
isNpm: true,
|
|
18312
|
-
commitHash: "b2dd6e8"
|
|
18313
|
-
}))
|
|
18314
|
-
});
|
|
18315
|
-
}
|
|
18327
|
+
return getChatVersionFromManifest(manifest);
|
|
18328
|
+
};
|
|
18316
18329
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/url.js
|
|
18317
18330
|
var url = __webpack_require__(9969);
|
|
18318
18331
|
var url_default = /*#__PURE__*/__webpack_require__.n(url);
|
|
@@ -18751,7 +18764,7 @@ class ChatFrame extends d {
|
|
|
18751
18764
|
const hostPageUrlParams = new (url_default())(window.location.href).searchParams;
|
|
18752
18765
|
const smsToken = hostPageUrlParams.get("adaSMSToken");
|
|
18753
18766
|
const queryParams = {
|
|
18754
|
-
embedVersion: "
|
|
18767
|
+
embedVersion: "95c61ad".slice(0, 7),
|
|
18755
18768
|
greeting,
|
|
18756
18769
|
language,
|
|
18757
18770
|
skipGreeting,
|
|
@@ -20926,7 +20939,7 @@ class Embed {
|
|
|
20926
20939
|
|
|
20927
20940
|
}
|
|
20928
20941
|
|
|
20929
|
-
_defineProperty(Embed, "embed2Version", "
|
|
20942
|
+
_defineProperty(Embed, "embed2Version", "95c61ad");
|
|
20930
20943
|
;// CONCATENATED MODULE: ./src/common/helpers/startup.ts
|
|
20931
20944
|
|
|
20932
20945
|
|
|
@@ -5,6 +5,6 @@ export interface Manifest {
|
|
|
5
5
|
weight: number;
|
|
6
6
|
}[];
|
|
7
7
|
}
|
|
8
|
-
export declare const loadChatManifest: () => Promise<Manifest>;
|
|
8
|
+
export declare const loadChatManifest: () => Promise<Manifest | undefined>;
|
|
9
9
|
export declare const MANIFEST_VALIDATION_ERROR_MESSAGE = "The format of manifest file is incorrect";
|
|
10
10
|
export declare const isManifest: (input: unknown) => input is Manifest;
|