@amplitude/analytics-core 2.44.2-SR-3115-rc2.0 → 2.46.0
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/lib/cjs/index.d.ts +4 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +6 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/observers/video.d.ts +13 -7
- package/lib/cjs/observers/video.d.ts.map +1 -1
- package/lib/cjs/observers/video.js +50 -14
- package/lib/cjs/observers/video.js.map +1 -1
- package/lib/cjs/types/config/browser-config.d.ts +28 -1
- package/lib/cjs/types/config/browser-config.d.ts.map +1 -1
- package/lib/cjs/types/config/browser-config.js.map +1 -1
- package/lib/cjs/types/frustration-interactions.d.ts +0 -2
- package/lib/cjs/types/frustration-interactions.d.ts.map +1 -1
- package/lib/cjs/types/frustration-interactions.js.map +1 -1
- package/lib/cjs/utils/omit-undefined.d.ts +2 -0
- package/lib/cjs/utils/omit-undefined.d.ts.map +1 -0
- package/lib/cjs/utils/omit-undefined.js +15 -0
- package/lib/cjs/utils/omit-undefined.js.map +1 -0
- package/lib/cjs/video-analytics/track-video.d.ts +3 -13
- package/lib/cjs/video-analytics/track-video.d.ts.map +1 -1
- package/lib/cjs/video-analytics/track-video.js +108 -67
- package/lib/cjs/video-analytics/track-video.js.map +1 -1
- package/lib/cjs/video-analytics/types.d.ts +16 -4
- package/lib/cjs/video-analytics/types.d.ts.map +1 -1
- package/lib/cjs/video-analytics/types.js.map +1 -1
- package/lib/esm/index.d.ts +4 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +2 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/observers/video.d.ts +13 -7
- package/lib/esm/observers/video.d.ts.map +1 -1
- package/lib/esm/observers/video.js +51 -15
- package/lib/esm/observers/video.js.map +1 -1
- package/lib/esm/types/config/browser-config.d.ts +28 -1
- package/lib/esm/types/config/browser-config.d.ts.map +1 -1
- package/lib/esm/types/config/browser-config.js.map +1 -1
- package/lib/esm/types/frustration-interactions.d.ts +0 -2
- package/lib/esm/types/frustration-interactions.d.ts.map +1 -1
- package/lib/esm/types/frustration-interactions.js.map +1 -1
- package/lib/esm/utils/omit-undefined.d.ts +2 -0
- package/lib/esm/utils/omit-undefined.d.ts.map +1 -0
- package/lib/esm/utils/omit-undefined.js +11 -0
- package/lib/esm/utils/omit-undefined.js.map +1 -0
- package/lib/esm/video-analytics/track-video.d.ts +3 -13
- package/lib/esm/video-analytics/track-video.d.ts.map +1 -1
- package/lib/esm/video-analytics/track-video.js +106 -62
- package/lib/esm/video-analytics/track-video.js.map +1 -1
- package/lib/esm/video-analytics/types.d.ts +16 -4
- package/lib/esm/video-analytics/types.d.ts.map +1 -1
- package/lib/esm/video-analytics/types.js.map +1 -1
- package/package.json +1 -1
package/lib/cjs/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { UUID } from './utils/uuid';
|
|
|
21
21
|
export { createIdentifyEvent } from './utils/event-builder';
|
|
22
22
|
export { isUrlMatchAllowlist, getDecodeURI } from './utils/url-utils';
|
|
23
23
|
export { generateHashCode, isTimestampInSample } from './utils/sampling';
|
|
24
|
+
export { omitUndefined } from './utils/omit-undefined';
|
|
24
25
|
export { MemoryStorage } from './storage/memory';
|
|
25
26
|
export { CookieStorage, isDomainEqual, decodeCookieValue } from './storage/cookie';
|
|
26
27
|
export { getStorageKey } from './storage/helpers';
|
|
@@ -62,7 +63,7 @@ export { Campaign, UTMParameters, ReferrerParameters, ClickIdParameters, ICampai
|
|
|
62
63
|
export { EMPTY_VALUE, BASE_CAMPAIGN, MKTG } from './types/constants';
|
|
63
64
|
export { CampaignParser } from './campaign/campaign-parser';
|
|
64
65
|
export { getPageTitle, TEXT_MASK_ATTRIBUTE, MASKED_TEXT_VALUE, replaceSensitiveString, CC_REGEX, SSN_REGEX, EMAIL_REGEX, } from './plugins/helpers';
|
|
65
|
-
export { BrowserConfig, BrowserOptions, DefaultTrackingOptions, TrackingOptions, AutocaptureOptions, CookieOptions, AttributionOptions, RemoteConfigOptions, } from './types/config/browser-config';
|
|
66
|
+
export { BrowserConfig, BrowserOptions, DefaultTrackingOptions, TrackingOptions, TrackingMethod, AutocaptureOptions, CookieOptions, AttributionOptions, RemoteConfigOptions, } from './types/config/browser-config';
|
|
66
67
|
export { BrowserClient } from './types/client/browser-client';
|
|
67
68
|
export { NodeClient } from './types/client/node-client';
|
|
68
69
|
export { NodeConfig, NodeOptions } from './types/config/node-config';
|
|
@@ -76,4 +77,6 @@ export { getOrCreateWindowMessenger } from './messenger/base-window-messenger';
|
|
|
76
77
|
export { enableBackgroundCapture } from './messenger/background-capture';
|
|
77
78
|
export { AMPLITUDE_ORIGIN, AMPLITUDE_ORIGIN_EU, AMPLITUDE_ORIGIN_STAGING, AMPLITUDE_ORIGINS_MAP, AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL, } from './messenger/constants';
|
|
78
79
|
export { ExcludeInternalReferrersOptions, EXCLUDE_INTERNAL_REFERRERS_CONDITIONS } from './types/config/browser-config';
|
|
80
|
+
export { VideoObserver, State as VideoState, type VideoObserverParams } from './observers/video';
|
|
81
|
+
export { EmbeddedVideoPlayer, type Vendor as VideoVendor } from './video-analytics/types';
|
|
79
82
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CA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AC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,uCAAuC,GACxC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,+BAA+B,EAAE,qCAAqC,EAAE,MAAM,+BAA+B,CAAC;AAEvH,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,UAAU,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,KAAK,MAAM,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.EXCLUDE_INTERNAL_REFERRERS_CONDITIONS = exports.AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL = exports.AMPLITUDE_ORIGINS_MAP = exports.AMPLITUDE_ORIGIN_STAGING = exports.AMPLITUDE_ORIGIN_EU = exports.AMPLITUDE_ORIGIN = exports.enableBackgroundCapture = exports.getOrCreateWindowMessenger = exports.safeJsonStringify = exports.multicast = exports.merge = exports.asyncMap = exports.Observable = exports.EMAIL_REGEX = exports.SSN_REGEX = exports.CC_REGEX = exports.replaceSensitiveString = exports.MASKED_TEXT_VALUE = exports.TEXT_MASK_ATTRIBUTE = exports.getPageTitle = exports.CampaignParser = exports.MKTG = exports.BASE_CAMPAIGN = exports.EMPTY_VALUE = exports.FORBIDDEN_HEADERS = exports.SAFE_HEADERS = exports.NetworkRequestEvent = exports.networkObserver = exports.NetworkEventCallback = exports.Status = exports.DEFAULT_DEAD_CLICK_WINDOW_MS = exports.DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD = exports.DEFAULT_RAGE_CLICK_WINDOW_MS = exports.DEFAULT_RAGE_CLICK_THRESHOLD = exports.DEFAULT_ERROR_CLICK_ALLOWLIST = exports.DEFAULT_RAGE_CLICK_ALLOWLIST = exports.DEFAULT_DEAD_CLICK_ALLOWLIST = exports.DEFAULT_EXPOSURE_DURATION = exports.DEFAULT_ACTION_CLICK_ALLOWLIST = exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = void 0;
|
|
3
|
+
exports.ServerZone = exports.SpecialEventType = exports.IdentifyOperation = exports.consoleObserver = exports.STORAGE_PREFIX = exports.AMPLITUDE_PREFIX = exports.LogLevel = exports.RemoteConfigClient = exports.MIN_GZIP_UPLOAD_BODY_SIZE_BYTES = exports.isCompressionStreamAvailable = exports.compressToGzipArrayBuffer = exports.FetchTransport = exports.BaseTransport = exports.registerSdkLoaderMetadata = exports.DiagnosticsClient = exports.BrowserStorage = exports.getStorageKey = exports.decodeCookieValue = exports.isDomainEqual = exports.CookieStorage = exports.MemoryStorage = exports.omitUndefined = exports.isTimestampInSample = exports.generateHashCode = exports.getDecodeURI = exports.isUrlMatchAllowlist = exports.createIdentifyEvent = exports.UUID = exports.getClientStates = exports.getClientLogConfig = exports.debugWrapper = exports.returnWrapper = exports.getQueryParams = exports.getLanguage = exports.getOldCookieName = exports.getCookieName = exports.isNewSession = exports.setConnectorUserId = exports.setConnectorDeviceId = exports.getAnalyticsConnector = exports.getGlobalScope = exports.Logger = exports.RequestMetadata = exports.Config = exports.IdentityEventSender = exports.Destination = exports.RevenueProperty = exports.Revenue = exports.Identify = exports.AmplitudeCore = void 0;
|
|
4
|
+
exports.VideoObserver = exports.EXCLUDE_INTERNAL_REFERRERS_CONDITIONS = exports.AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL = exports.AMPLITUDE_ORIGINS_MAP = exports.AMPLITUDE_ORIGIN_STAGING = exports.AMPLITUDE_ORIGIN_EU = exports.AMPLITUDE_ORIGIN = exports.enableBackgroundCapture = exports.getOrCreateWindowMessenger = exports.safeJsonStringify = exports.multicast = exports.merge = exports.asyncMap = exports.Observable = exports.EMAIL_REGEX = exports.SSN_REGEX = exports.CC_REGEX = exports.replaceSensitiveString = exports.MASKED_TEXT_VALUE = exports.TEXT_MASK_ATTRIBUTE = exports.getPageTitle = exports.CampaignParser = exports.MKTG = exports.BASE_CAMPAIGN = exports.EMPTY_VALUE = exports.FORBIDDEN_HEADERS = exports.SAFE_HEADERS = exports.NetworkRequestEvent = exports.networkObserver = exports.NetworkEventCallback = exports.Status = exports.DEFAULT_DEAD_CLICK_WINDOW_MS = exports.DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD = exports.DEFAULT_RAGE_CLICK_WINDOW_MS = exports.DEFAULT_RAGE_CLICK_THRESHOLD = exports.DEFAULT_ERROR_CLICK_ALLOWLIST = exports.DEFAULT_RAGE_CLICK_ALLOWLIST = exports.DEFAULT_DEAD_CLICK_ALLOWLIST = exports.DEFAULT_EXPOSURE_DURATION = exports.DEFAULT_ACTION_CLICK_ALLOWLIST = exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = exports.OfflineDisabled = void 0;
|
|
5
5
|
var core_client_1 = require("./core-client");
|
|
6
6
|
Object.defineProperty(exports, "AmplitudeCore", { enumerable: true, get: function () { return core_client_1.AmplitudeCore; } });
|
|
7
7
|
var identify_1 = require("./identify");
|
|
@@ -49,6 +49,8 @@ Object.defineProperty(exports, "getDecodeURI", { enumerable: true, get: function
|
|
|
49
49
|
var sampling_1 = require("./utils/sampling");
|
|
50
50
|
Object.defineProperty(exports, "generateHashCode", { enumerable: true, get: function () { return sampling_1.generateHashCode; } });
|
|
51
51
|
Object.defineProperty(exports, "isTimestampInSample", { enumerable: true, get: function () { return sampling_1.isTimestampInSample; } });
|
|
52
|
+
var omit_undefined_1 = require("./utils/omit-undefined");
|
|
53
|
+
Object.defineProperty(exports, "omitUndefined", { enumerable: true, get: function () { return omit_undefined_1.omitUndefined; } });
|
|
52
54
|
var memory_1 = require("./storage/memory");
|
|
53
55
|
Object.defineProperty(exports, "MemoryStorage", { enumerable: true, get: function () { return memory_1.MemoryStorage; } });
|
|
54
56
|
var cookie_1 = require("./storage/cookie");
|
|
@@ -143,4 +145,6 @@ Object.defineProperty(exports, "AMPLITUDE_ORIGINS_MAP", { enumerable: true, get:
|
|
|
143
145
|
Object.defineProperty(exports, "AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL", { enumerable: true, get: function () { return constants_4.AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL; } });
|
|
144
146
|
var browser_config_1 = require("./types/config/browser-config");
|
|
145
147
|
Object.defineProperty(exports, "EXCLUDE_INTERNAL_REFERRERS_CONDITIONS", { enumerable: true, get: function () { return browser_config_1.EXCLUDE_INTERNAL_REFERRERS_CONDITIONS; } });
|
|
148
|
+
var video_1 = require("./observers/video");
|
|
149
|
+
Object.defineProperty(exports, "VideoObserver", { enumerable: true, get: function () { return video_1.VideoObserver; } });
|
|
146
150
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,6CAA8C;AAArC,4GAAA,aAAa,OAAA;AAItB,uCAAoE;AAA3D,oGAAA,QAAQ,OAAA;AACjB,qCAA+D;AAAtD,kGAAA,OAAO,OAAA;AAAY,0GAAA,eAAe,OAAA;AAC3C,qDAAoD;AAA3C,0GAAA,WAAW,OAAA;AACpB,+CAAyD;AAAhD,+GAAA,mBAAmB,OAAA;AAC5B,mCAAmD;AAA1C,gGAAA,MAAM,OAAA;AA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;AAAE,sGAAA,QAAQ,OAAA;AAAE,mGAAA,KAAK,OAAA;AAAE,uGAAA,SAAS,OAAA;AAG/C,yDAA2D;AAAlD,mHAAA,iBAAiB,OAAA;AAI1B,2EAA+E;AAAtE,mIAAA,0BAA0B,OAAA;AACnC,qEAAyE;AAAhE,6HAAA,uBAAuB,OAAA;AAChC,mDAM+B;AAL7B,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,qHAAA,wBAAwB,OAAA;AACxB,kHAAA,qBAAqB,OAAA;AACrB,oIAAA,uCAAuC,OAAA;AAGzC,gEAAuH;AAA7E,uIAAA,qCAAqC,OAAA;AAE/E,2CAAiG;AAAxF,sGAAA,aAAa,OAAA","sourcesContent":["export { AmplitudeCore } from './core-client';\nexport { CoreClient, PluginHost } from './types/client/core-client';\nexport { AnalyticsClient } from './types/client/analytics-client';\nexport { AmplitudeContext } from './types/amplitude-context';\nexport { Identify, IIdentify, ValidPropertyType } from './identify';\nexport { Revenue, IRevenue, RevenueProperty } from './revenue';\nexport { Destination } from './plugins/destination';\nexport { IdentityEventSender } from './plugins/identity';\nexport { Config, RequestMetadata } from './config';\nexport { IConfig } from './types/config/core-config';\nexport { Logger, ILogger, LogConfig } from './logger';\nexport { getGlobalScope } from './global-scope';\nexport { getAnalyticsConnector, setConnectorDeviceId, setConnectorUserId } from './analytics-connector';\nexport { isNewSession } from './session';\nexport { getCookieName, getOldCookieName } from './cookie-name';\nexport { getLanguage } from './language';\nexport { getQueryParams } from './query-params';\n\nexport { returnWrapper, AmplitudeReturn } from './utils/return-wrapper';\nexport { debugWrapper, getClientLogConfig, getClientStates } from './utils/debug';\nexport { UUID } from './utils/uuid';\nexport { createIdentifyEvent } from './utils/event-builder';\nexport { isUrlMatchAllowlist, getDecodeURI } from './utils/url-utils';\nexport { generateHashCode, isTimestampInSample } from './utils/sampling';\nexport { omitUndefined } from './utils/omit-undefined';\n\nexport { MemoryStorage } from './storage/memory';\nexport { CookieStorage, isDomainEqual, decodeCookieValue } from './storage/cookie';\nexport { getStorageKey } from './storage/helpers';\n\nexport { BrowserStorage } from './storage/browser-storage';\n\nexport { DiagnosticsClient, IDiagnosticsClient } from './diagnostics/diagnostics-client';\nexport { registerSdkLoaderMetadata } from './diagnostics/uncaught-sdk-errors';\n\nexport { BaseTransport } from './transports/base';\nexport { FetchTransport } from './transports/fetch';\nexport {\n compressToGzipArrayBuffer,\n isCompressionStreamAvailable,\n MIN_GZIP_UPLOAD_BODY_SIZE_BYTES,\n} from './transports/gzip';\n\nexport { RemoteConfigClient, IRemoteConfigClient, RemoteConfig, Source } from './remote-config/remote-config';\n\nexport { LogLevel } from './types/loglevel';\nexport { AMPLITUDE_PREFIX, STORAGE_PREFIX } from './types/constants';\nexport { Storage, IdentityStorageType, CookieStorageConfig } from './types/storage';\nexport { consoleObserver } from './observers/console';\nexport {\n Event,\n IdentifyOperation,\n SpecialEventType,\n IdentifyEvent,\n GroupIdentifyEvent,\n IdentifyUserProperties,\n} from './types/event/event';\nexport { EventOptions, BaseEvent } from './types/event/base-event';\nexport { IngestionMetadata } from './types/event/ingestion-metadata';\nexport { ServerZoneType, ServerZone } from './types/server-zone';\nexport { OfflineDisabled } from './types/offline';\nexport { Plan } from './types/event/plan';\nexport { TransportType, Transport, TransportOptions, TransportTypeOrOptions } from './types/transport';\nexport { Payload } from './types/payload';\nexport { Response } from './types/response';\nexport { UserSession } from './types/user-session';\nexport {\n Plugin,\n BeforePlugin,\n DestinationPlugin,\n EnrichmentPlugin,\n PluginType,\n AnalyticsIdentity,\n} from './types/plugin';\nexport { Result } from './types/result';\nexport {\n ElementInteractionsOptions,\n Messenger,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n DEFAULT_ACTION_CLICK_ALLOWLIST,\n DEFAULT_EXPOSURE_DURATION,\n LabeledEvent,\n Trigger,\n DataSource,\n} from './types/element-interactions';\n\nexport {\n FrustrationInteractionsOptions,\n DEFAULT_DEAD_CLICK_ALLOWLIST,\n DEFAULT_RAGE_CLICK_ALLOWLIST,\n DEFAULT_ERROR_CLICK_ALLOWLIST,\n DEFAULT_RAGE_CLICK_THRESHOLD,\n DEFAULT_RAGE_CLICK_WINDOW_MS,\n DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD,\n DEFAULT_DEAD_CLICK_WINDOW_MS,\n} from './types/frustration-interactions';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './types/page-view-tracking';\nexport { FormInteractionsOptions } from './types/form-interactions';\nexport { Status } from './types/status';\n\nexport { NetworkEventCallback, networkObserver } from './observers/network';\nexport { NetworkRequestEvent, IRequestWrapper, JsonObject, JsonValue, JsonArray } from './network-request-event';\nexport { NetworkTrackingOptions, NetworkCaptureRule } from './types/network-tracking';\nexport { SAFE_HEADERS, FORBIDDEN_HEADERS } from './types/constants';\n\nexport { PageUrlEnrichmentOptions } from './types/page-url-enrichment';\nexport { CustomEnrichmentOptions } from './types/custom-enrichment';\n\n// Campaign\nexport { Campaign, UTMParameters, ReferrerParameters, ClickIdParameters, ICampaignParser } from './types/campaign';\nexport { EMPTY_VALUE, BASE_CAMPAIGN, MKTG } from './types/constants';\nexport { CampaignParser } from './campaign/campaign-parser';\nexport {\n getPageTitle,\n TEXT_MASK_ATTRIBUTE,\n MASKED_TEXT_VALUE,\n replaceSensitiveString,\n CC_REGEX,\n SSN_REGEX,\n EMAIL_REGEX,\n} from './plugins/helpers';\n\n// Browser\nexport {\n BrowserConfig,\n BrowserOptions,\n DefaultTrackingOptions,\n TrackingOptions,\n TrackingMethod,\n AutocaptureOptions,\n CookieOptions,\n AttributionOptions,\n RemoteConfigOptions,\n} from './types/config/browser-config';\nexport { BrowserClient } from './types/client/browser-client';\n\n// Node\nexport { NodeClient } from './types/client/node-client';\nexport { NodeConfig, NodeOptions } from './types/config/node-config';\n\n// React Native\nexport {\n ReactNativeConfig,\n ReactNativeTrackingOptions,\n ReactNativeOptions,\n ReactNativeAttributionOptions,\n} from './types/config/react-native-config';\nexport { ReactNativeClient } from './types/client/react-native-client';\n\nexport { Observable, asyncMap, merge, multicast, Unsubscribable } from './utils/observable';\n\nexport { InstanceProxy } from './types/proxy';\nexport { safeJsonStringify } from './utils/safe-stringify';\n\n// Messenger (cross-window communication)\nexport type { BaseWindowMessenger, ActionHandler } from './messenger/base-window-messenger';\nexport { getOrCreateWindowMessenger } from './messenger/base-window-messenger';\nexport { enableBackgroundCapture } from './messenger/background-capture';\nexport {\n AMPLITUDE_ORIGIN,\n AMPLITUDE_ORIGIN_EU,\n AMPLITUDE_ORIGIN_STAGING,\n AMPLITUDE_ORIGINS_MAP,\n AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL,\n} from './messenger/constants';\n\nexport { ExcludeInternalReferrersOptions, EXCLUDE_INTERNAL_REFERRERS_CONDITIONS } from './types/config/browser-config';\n\nexport { VideoObserver, State as VideoState, type VideoObserverParams } from './observers/video';\nexport { EmbeddedVideoPlayer, type Vendor as VideoVendor } from './video-analytics/types';\n"]}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import type { VideoEvent,
|
|
2
|
-
type
|
|
3
|
-
type
|
|
4
|
-
type State = {
|
|
1
|
+
import type { VideoEvent, EmbeddedVideoPlayer, MuxElement, Vendor } from '../video-analytics/types';
|
|
2
|
+
export type { Vendor };
|
|
3
|
+
type PlaybackState = 'playing' | 'paused' | 'ended' | 'error' | 'seeking';
|
|
4
|
+
export type State = {
|
|
5
5
|
playbackState: PlaybackState;
|
|
6
6
|
errorMessage?: string;
|
|
7
7
|
lastEvent?: VideoEvent;
|
|
8
|
+
watchTime?: number;
|
|
9
|
+
position?: number | null;
|
|
10
|
+
isSeeking?: boolean;
|
|
8
11
|
};
|
|
9
|
-
type VideoObserverParams = {
|
|
10
|
-
videoEl: HTMLVideoElement |
|
|
12
|
+
export type VideoObserverParams = {
|
|
13
|
+
videoEl: HTMLVideoElement | EmbeddedVideoPlayer | MuxElement;
|
|
11
14
|
onStateChange: (previousState: State, nextState: State) => void;
|
|
12
15
|
vendor?: Vendor;
|
|
13
16
|
isEmbedded?: boolean;
|
|
@@ -18,8 +21,11 @@ export declare class VideoObserver {
|
|
|
18
21
|
private onStateChange;
|
|
19
22
|
private handler;
|
|
20
23
|
constructor({ videoEl, onStateChange, vendor, isEmbedded }: VideoObserverParams);
|
|
24
|
+
private stateChangeHandler;
|
|
25
|
+
private updateStateWithError;
|
|
26
|
+
private updatePlaybackState;
|
|
27
|
+
private updateTime;
|
|
21
28
|
private updateState;
|
|
22
29
|
destroy(): void;
|
|
23
30
|
}
|
|
24
|
-
export {};
|
|
25
31
|
//# sourceMappingURL=video.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../src/observers/video.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../src/observers/video.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,MAAM,EAEP,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,MAAM,EAAE,CAAC;AAEvB,KAAK,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAE1E,MAAM,MAAM,KAAK,GAAG;IAClB,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,GAAG,UAAU,CAAC;IAC7D,aAAa,EAAE,CAAC,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,KAAK,IAAI,CAAC;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAEX;IAEF,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,aAAa,CAAmD;IACxE,OAAO,CAAC,OAAO,CA+Bb;gBAEU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,mBAAmB;IAS/E,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,WAAW;IAMnB,OAAO;CAGR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VideoObserver = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
4
5
|
var track_video_1 = require("../video-analytics/track-video");
|
|
5
6
|
var VideoObserver = /** @class */ (function () {
|
|
6
7
|
function VideoObserver(_a) {
|
|
@@ -11,34 +12,38 @@ var VideoObserver = /** @class */ (function () {
|
|
|
11
12
|
};
|
|
12
13
|
this.handler = {
|
|
13
14
|
onPlay: function (evt) {
|
|
14
|
-
_this.
|
|
15
|
+
_this.updatePlaybackState('playing', evt);
|
|
15
16
|
},
|
|
16
17
|
onPause: function (evt) {
|
|
17
|
-
_this.
|
|
18
|
+
_this.updatePlaybackState('paused', evt);
|
|
18
19
|
},
|
|
19
20
|
onEnded: function (evt) {
|
|
20
|
-
_this.
|
|
21
|
+
_this.updatePlaybackState('ended', evt);
|
|
21
22
|
},
|
|
22
|
-
|
|
23
|
-
_this.
|
|
23
|
+
onSeeking: function () {
|
|
24
|
+
var nextState = tslib_1.__assign(tslib_1.__assign({}, _this.state), { isSeeking: true });
|
|
25
|
+
_this.updateState(nextState);
|
|
26
|
+
},
|
|
27
|
+
onSeeked: function (event) {
|
|
28
|
+
var nextState = tslib_1.__assign(tslib_1.__assign({}, _this.state), { isSeeking: false, position: event.last_position });
|
|
29
|
+
_this.updateState(nextState);
|
|
30
|
+
},
|
|
31
|
+
onError: function (errorMessage) {
|
|
32
|
+
_this.updateStateWithError(errorMessage);
|
|
33
|
+
},
|
|
34
|
+
onTimeUpdate: function (evt) {
|
|
35
|
+
_this.updateTime(evt);
|
|
24
36
|
},
|
|
25
37
|
};
|
|
26
38
|
this.onStateChange = onStateChange;
|
|
27
39
|
if (isEmbedded) {
|
|
28
|
-
|
|
29
|
-
this.untrack = (0, track_video_1.trackMuxEmbeddedVideo)(videoEl, this.handler);
|
|
40
|
+
this.untrack = (0, track_video_1.trackEmbeddedVideo)(videoEl, this.handler, vendor);
|
|
30
41
|
}
|
|
31
42
|
else {
|
|
32
43
|
this.untrack = (0, track_video_1.trackHtmlVideo)(videoEl, this.handler, vendor);
|
|
33
44
|
}
|
|
34
45
|
}
|
|
35
|
-
VideoObserver.prototype.
|
|
36
|
-
var previousState = this.state;
|
|
37
|
-
var nextState = {
|
|
38
|
-
playbackState: playbackState,
|
|
39
|
-
lastEvent: event,
|
|
40
|
-
};
|
|
41
|
-
this.state = nextState;
|
|
46
|
+
VideoObserver.prototype.stateChangeHandler = function (previousState, nextState) {
|
|
42
47
|
try {
|
|
43
48
|
this.onStateChange(previousState, nextState);
|
|
44
49
|
}
|
|
@@ -46,6 +51,37 @@ var VideoObserver = /** @class */ (function () {
|
|
|
46
51
|
// Swallow callback errors to keep observer state consistent.
|
|
47
52
|
}
|
|
48
53
|
};
|
|
54
|
+
VideoObserver.prototype.updateStateWithError = function (error) {
|
|
55
|
+
var previousState = this.state;
|
|
56
|
+
var nextState = tslib_1.__assign(tslib_1.__assign({}, previousState), { playbackState: 'error', errorMessage: error });
|
|
57
|
+
this.updateState(nextState);
|
|
58
|
+
};
|
|
59
|
+
VideoObserver.prototype.updatePlaybackState = function (playbackState, event) {
|
|
60
|
+
var nextState = tslib_1.__assign(tslib_1.__assign({}, this.state), { playbackState: playbackState, lastEvent: event, position: event.last_position });
|
|
61
|
+
this.updateState(nextState);
|
|
62
|
+
};
|
|
63
|
+
VideoObserver.prototype.updateTime = function (event) {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
var lastVideoEvent = this.state.lastEvent;
|
|
66
|
+
if (!lastVideoEvent || this.state.playbackState !== 'playing') {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
var isSeeking = event.isSeeking || this.state.isSeeking;
|
|
70
|
+
var lastPosition = (_a = this.state.position) !== null && _a !== void 0 ? _a : 0;
|
|
71
|
+
var nextPosition = event.position;
|
|
72
|
+
if (isSeeking) {
|
|
73
|
+
this.state = tslib_1.__assign(tslib_1.__assign({}, this.state), { position: nextPosition });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
var timeDelta = nextPosition - lastPosition;
|
|
77
|
+
var nextState = tslib_1.__assign(tslib_1.__assign({}, this.state), { position: nextPosition, watchTime: ((_b = this.state.watchTime) !== null && _b !== void 0 ? _b : 0) + timeDelta });
|
|
78
|
+
this.updateState(nextState);
|
|
79
|
+
};
|
|
80
|
+
VideoObserver.prototype.updateState = function (nextState) {
|
|
81
|
+
var previousState = this.state;
|
|
82
|
+
this.state = nextState;
|
|
83
|
+
this.stateChangeHandler(previousState, nextState);
|
|
84
|
+
};
|
|
49
85
|
VideoObserver.prototype.destroy = function () {
|
|
50
86
|
this.untrack();
|
|
51
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../../src/observers/video.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../../src/observers/video.ts"],"names":[],"mappings":";;;;AAAA,8DAAoF;AA8BpF;IAwCE,uBAAY,EAAmE;YAAjE,OA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,IAAI,CAAC,KAAK,KACb,QAAQ,EAAE,YAAY,GACvB,CAAC;YACF,OAAO;SACR;QACD,IAAM,SAAS,GAAG,YAAY,GAAG,YAAY,CAAC;QAC9C,IAAM,SAAS,yCACV,IAAI,CAAC,KAAK,KACb,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,mCAAI,CAAC,CAAC,GAAG,SAAS,GACnD,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAEO,mCAAW,GAAnB,UAAoB,SAAgB;QAClC,IAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IACpD,CAAC;IAED,+BAAO,GAAP;QACE,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IACH,oBAAC;AAAD,CAAC,AA9GD,IA8GC;AA9GY,sCAAa","sourcesContent":["import { trackHtmlVideo, trackEmbeddedVideo } from '../video-analytics/track-video';\nimport type {\n VideoHandler,\n VideoEvent,\n EmbeddedVideoPlayer,\n MuxElement,\n Vendor,\n TimeUpdateEvent,\n} from '../video-analytics/types';\n\nexport type { Vendor };\n\ntype PlaybackState = 'playing' | 'paused' | 'ended' | 'error' | 'seeking';\n\nexport type State = {\n playbackState: PlaybackState;\n errorMessage?: string;\n lastEvent?: VideoEvent;\n watchTime?: number;\n position?: number | null;\n isSeeking?: boolean;\n};\n\nexport type VideoObserverParams = {\n videoEl: HTMLVideoElement | EmbeddedVideoPlayer | MuxElement;\n onStateChange: (previousState: State, nextState: State) => void;\n vendor?: Vendor;\n isEmbedded?: boolean;\n};\n\nexport class VideoObserver {\n private state: State = {\n playbackState: 'paused',\n };\n\n private untrack: () => void;\n private onStateChange: (previousState: State, nextState: State) => void;\n private handler: VideoHandler = {\n onPlay: (evt: VideoEvent) => {\n this.updatePlaybackState('playing', evt);\n },\n onPause: (evt: VideoEvent) => {\n this.updatePlaybackState('paused', evt);\n },\n onEnded: (evt: VideoEvent) => {\n this.updatePlaybackState('ended', evt);\n },\n onSeeking: () => {\n const nextState: State = {\n ...this.state,\n isSeeking: true,\n };\n this.updateState(nextState);\n },\n onSeeked: (event: VideoEvent) => {\n const nextState: State = {\n ...this.state,\n isSeeking: false,\n position: event.last_position,\n };\n this.updateState(nextState);\n },\n onError: (errorMessage: string) => {\n this.updateStateWithError(errorMessage);\n },\n onTimeUpdate: (evt: TimeUpdateEvent) => {\n this.updateTime(evt);\n },\n };\n\n constructor({ videoEl, onStateChange, vendor, isEmbedded }: VideoObserverParams) {\n this.onStateChange = onStateChange;\n if (isEmbedded) {\n this.untrack = trackEmbeddedVideo(videoEl as EmbeddedVideoPlayer, this.handler, vendor);\n } else {\n this.untrack = trackHtmlVideo(videoEl as HTMLVideoElement, this.handler, vendor);\n }\n }\n\n private stateChangeHandler(previousState: State, nextState: State) {\n try {\n this.onStateChange(previousState, nextState);\n } catch (_error) {\n // Swallow callback errors to keep observer state consistent.\n }\n }\n\n private updateStateWithError(error: string) {\n const previousState = this.state;\n const nextState: State = {\n ...previousState,\n playbackState: 'error',\n errorMessage: error,\n };\n this.updateState(nextState);\n }\n\n private updatePlaybackState(playbackState: PlaybackState, event: VideoEvent) {\n const nextState: State = {\n ...this.state,\n playbackState,\n lastEvent: event,\n position: event.last_position,\n };\n this.updateState(nextState);\n }\n\n private updateTime(event: TimeUpdateEvent) {\n const lastVideoEvent = this.state.lastEvent;\n if (!lastVideoEvent || this.state.playbackState !== 'playing') {\n return;\n }\n const isSeeking = event.isSeeking || this.state.isSeeking;\n const lastPosition = this.state.position ?? 0;\n const nextPosition = event.position;\n if (isSeeking) {\n this.state = {\n ...this.state,\n position: nextPosition,\n };\n return;\n }\n const timeDelta = nextPosition - lastPosition;\n const nextState: State = {\n ...this.state,\n position: nextPosition,\n watchTime: (this.state.watchTime ?? 0) + timeDelta,\n };\n this.updateState(nextState);\n }\n\n private updateState(nextState: State) {\n const previousState = this.state;\n this.state = nextState;\n this.stateChangeHandler(previousState, nextState);\n }\n\n destroy() {\n this.untrack();\n }\n}\n"]}
|
|
@@ -222,29 +222,56 @@ export interface TrackingOptions {
|
|
|
222
222
|
*/
|
|
223
223
|
platform?: boolean;
|
|
224
224
|
}
|
|
225
|
+
export type TrackingMethod = 'userProperty' | 'eventProperty';
|
|
225
226
|
export interface AttributionOptions {
|
|
226
227
|
/**
|
|
227
228
|
* The rules to determine which referrers are excluded from being tracked as traffic source.
|
|
229
|
+
* Applies only to `userProperty` tracking.
|
|
230
|
+
* Ignored by `eventProperty` tracking.
|
|
228
231
|
* @defaultValue `[/your-domain\.com$/]`
|
|
229
232
|
*/
|
|
230
233
|
excludeReferrers?: (string | RegExp)[];
|
|
231
234
|
/**
|
|
232
235
|
* Exclude internal referrers from campaign attribution.
|
|
233
236
|
* (a referrer is 'internal' if it is on the same domain as the current page)
|
|
234
|
-
*
|
|
237
|
+
* Applies only to `userProperty` tracking.
|
|
238
|
+
* Ignored by `eventProperty` tracking.
|
|
235
239
|
* @defaultValue `false`
|
|
236
240
|
*/
|
|
237
241
|
excludeInternalReferrers?: true | false | ExcludeInternalReferrersOptions;
|
|
238
242
|
/**
|
|
239
243
|
* The value to represent undefined/no initial campaign parameter for first-touch attribution.
|
|
244
|
+
* Applies only to `userProperty` tracking.
|
|
245
|
+
* Ignored by `eventProperty` tracking.
|
|
240
246
|
* @defaultValue `"EMPTY"`
|
|
241
247
|
*/
|
|
242
248
|
initialEmptyValue?: string;
|
|
243
249
|
/**
|
|
244
250
|
* The flag of if Amplitude to start a new session if any campaign parameter changes.
|
|
251
|
+
* Applies only to `userProperty` tracking.
|
|
252
|
+
* Ignored by `eventProperty` tracking.
|
|
245
253
|
* @defaultValue `false`
|
|
246
254
|
*/
|
|
247
255
|
resetSessionOnNewCampaign?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* The attribution persistence strategy for campaign parameters.
|
|
258
|
+
* Provide a single method to enable one strategy, or an array to enable multiple methods at the same time.
|
|
259
|
+
* When multiple methods are provided, each enabled method runs independently and their behaviors are combined.
|
|
260
|
+
* For example, `['userProperty', 'eventProperty']` updates user properties and also attaches campaign params
|
|
261
|
+
* to event properties.
|
|
262
|
+
* @experimental this feature is experimental and may not be stable
|
|
263
|
+
* @defaultValue `"userProperty"`
|
|
264
|
+
*/
|
|
265
|
+
trackingMethod?: TrackingMethod | TrackingMethod[];
|
|
266
|
+
/**
|
|
267
|
+
* Fires an `[Amplitude] Attribution` event as a heartbeat on every page view,
|
|
268
|
+
* such as on page load and SPA URL changes.
|
|
269
|
+
* Applies only to `eventProperty` tracking.
|
|
270
|
+
* Ignored by `userProperty` tracking.
|
|
271
|
+
* @experimental this feature is experimental and may not be stable
|
|
272
|
+
* @defaultValue `false`
|
|
273
|
+
*/
|
|
274
|
+
fallbackAttributionEvent?: boolean;
|
|
248
275
|
}
|
|
249
276
|
export declare const EXCLUDE_INTERNAL_REFERRERS_CONDITIONS: {
|
|
250
277
|
readonly always: "always";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-config.d.ts","sourceRoot":"","sources":["../../../../src/types/config/browser-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,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E,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,KAAK,aAAa,GAAG,QAAQ,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,2CAA2C,CAAC;AAGtH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,aAAa,CAAC;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-config.js","sourceRoot":"","sources":["../../../../src/types/config/browser-config.ts"],"names":[],"mappings":";;;AA+Pa,QAAA,qCAAqC,GAAG;IACnD,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,iBAAiB;CAC1B,CAAC","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport, TransportTypeOrOptions } from '../transport';\nimport { IConfig } from './core-config';\nimport { ElementInteractionsOptions } from '../element-interactions';\nimport { FormInteractionsOptions } from '../form-interactions';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { NetworkTrackingOptions } from '../network-tracking';\nimport { FrustrationInteractionsOptions } from '../frustration-interactions';\nimport { IDiagnosticsClient } from '../../diagnostics/diagnostics-client';\nimport { IRemoteConfigClient } from '../../remote-config/remote-config';\nimport { CustomEnrichmentOptions } from '../custom-enrichment';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends IConfig {\n /**\n * An app version for events tracked. This can be the version of your application.\n * @defaultValue `undefined`\n */\n appVersion?: string;\n /**\n * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.\n * The default event tracking configuration.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.\n * @defaultValue `true`\n */\n defaultTracking?: boolean | DefaultTrackingOptions;\n /**\n * The configurations for auto-captured events.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.\n */\n autocapture?: boolean | AutocaptureOptions;\n /**\n * The configurations for custom enrichment.\n * @defaultValue `false`\n */\n customEnrichment?: boolean | CustomEnrichmentOptions;\n /**\n * The identifier for the device running your application.\n * @defaultValue `UUID()`\n */\n deviceId?: string;\n /**\n * Configuration for cookie.\n */\n cookieOptions?: CookieOptions;\n /**\n * The storage for user identify.\n * @defaultValue `\"cookie\"`\n */\n identityStorage?: IdentityStorageType;\n /**\n * The partner identifier.\n * Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.\n * @defaultValue `undefined`\n */\n partnerId?: string;\n /**\n * The custom Session ID for the current session.\n * @defaultValue `timestamp`\n */\n sessionId?: number;\n /**\n * The period of inactivity from the last tracked event before a session expires in milliseconds.\n * @defaultValue `1,800,000` (30 minutes)\n */\n sessionTimeout: number;\n /**\n * The configurations for tracking additional properties.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.\n */\n trackingOptions: TrackingOptions;\n /**\n * Network transport mechanism used to send events.\n * @defaultValue `\"fetch\"`\n */\n transport?: TransportTypeOrOptions;\n /**\n * The identifier for the user being tracked.\n * @defaultValue `undefined`\n */\n userId?: string;\n /**\n * User's Nth instance of performing a default Page Viewed event within a session.\n * Used for landing page analysis.\n */\n pageCounter?: number;\n /**\n * Whether to fetch remote configuration. The remote configuration can be updated in the Amplitude platform here:\n * https://app.amplitude.com/data/amplitude/{your_org_name}/settings/autocapture\n * @defaultValue `true`\n * @deprecated This property is deprecated and will be removed in future versions. Please use `remoteConfig.fetchRemoteConfig` instead.\n */\n fetchRemoteConfig?: boolean;\n /**\n * Remote configuration options.\n * @defaultValue `undefined`\n */\n remoteConfig?: RemoteConfigOptions;\n /**\n * Captures network requests and responses.\n * @defaultValue `undefined`\n * @deprecated use autocapture.networkTracking instead\n */\n networkTrackingOptions?: NetworkTrackingOptions;\n /**\n * Whether to enable diagnostics.\n * @defaultValue `true`\n */\n enableDiagnostics?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n version?: string;\n diagnosticsSampleRate?: number;\n diagnosticsClient?: IDiagnosticsClient;\n remoteConfigClient?: IRemoteConfigClient;\n deferredSessionId?: number;\n topLevelDomain?: string;\n _enableRequestBodyCompressionExperimental?: boolean;\n}\n\n/**\n * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.\n */\nexport interface DefaultTrackingOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking or configures with detailed options.\n * @defaultValue `true`\n */\n formInteractions?: boolean | FormInteractionsOptions;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n}\n\nexport interface AutocaptureOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking or configures with detailed options.\n * @defaultValue `true`\n */\n formInteractions?: boolean | FormInteractionsOptions;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n /**\n * Enables/disables user interactions tracking.\n * @defaultValue `false`\n */\n elementInteractions?: boolean | ElementInteractionsOptions;\n /**\n * Enables/disables frustration interactions tracking.\n * @defaultValue `false`\n */\n frustrationInteractions?: boolean | FrustrationInteractionsOptions;\n /**\n * Enables/disables network request tracking or config with detailed network tracking options.\n * @defaultValue `false`\n */\n networkTracking?: boolean | NetworkTrackingOptions;\n /**\n * Enables/disables web vitals tracking.\n * @defaultValue `false`\n */\n webVitals?: boolean;\n /**\n * Enables/disables page url enrichment.\n * @defaultValue `true`\n * @experimental This feature is experimental and may not be stable\n */\n pageUrlEnrichment?: boolean;\n}\n\nexport interface TrackingOptions {\n /**\n * Enables/disables ip address tracking.\n * @defaultValue `true`\n */\n ipAddress?: boolean;\n /**\n * Enables/disables language tracking.\n * @defaultValue `true`\n */\n language?: boolean;\n /**\n * Enables/disables plantform tracking.\n * @defaultValue `true`\n */\n platform?: boolean;\n}\n\nexport interface AttributionOptions {\n /**\n * The rules to determine which referrers are excluded from being tracked as traffic source.\n * @defaultValue `[/your-domain\\.com$/]`\n */\n excludeReferrers?: (string | RegExp)[];\n /**\n * Exclude internal referrers from campaign attribution.\n * (a referrer is 'internal' if it is on the same domain as the current page)\n * @experimental this feature is experimental and may not be stable\n * @defaultValue `false`\n */\n excludeInternalReferrers?: true | false | ExcludeInternalReferrersOptions;\n /**\n * The value to represent undefined/no initial campaign parameter for first-touch attribution.\n * @defaultValue `\"EMPTY\"`\n */\n initialEmptyValue?: string;\n /**\n * The flag of if Amplitude to start a new session if any campaign parameter changes.\n * @defaultValue `false`\n */\n resetSessionOnNewCampaign?: boolean;\n}\n\nexport const EXCLUDE_INTERNAL_REFERRERS_CONDITIONS = {\n always: 'always',\n ifEmptyCampaign: 'ifEmptyCampaign',\n} as const;\n\ntype ExcludeInternalReferrersCondition =\n (typeof EXCLUDE_INTERNAL_REFERRERS_CONDITIONS)[keyof typeof EXCLUDE_INTERNAL_REFERRERS_CONDITIONS];\n\nexport interface ExcludeInternalReferrersOptions {\n /*\n * The condition on which to exclude internal referrers for campaign attribution.\n * @defaultValue `\"always\"`\n */\n condition?: ExcludeInternalReferrersCondition;\n}\n\nexport interface RemoteConfigOptions {\n /**\n * Whether to fetch remote configuration. The remote configuration can be updated in the Amplitude platform here:\n * https://app.amplitude.com/data/amplitude/{your_org_name}/settings/autocapture\n * @defaultValue `true`\n */\n fetchRemoteConfig?: boolean;\n /**\n * Custom server URL for remote configuration requests. If not provided, defaults to the standard\n * Amplitude remote config endpoint based on serverZone (US or EU).\n * Use this to proxy remote config requests through your own server.\n * @defaultValue `undefined` (uses standard Amplitude remote config endpoint)\n */\n serverUrl?: string;\n}\n\nexport interface CookieOptions {\n /**\n * The domain property of cookies created.\n * @defaultValue `Your top level domain`\n */\n domain?: string;\n /**\n * The expiration of cookies created in days.\n * @defaultValue `365`\n */\n expiration?: number;\n /**\n * How cookies are sent with cross-site requests.\n * @defaultValue `\"Lax\"`\n */\n sameSite?: 'Strict' | 'Lax' | 'None';\n /**\n * The flag of if send cookies over secure protocols.\n * @defaultValue `false`\n */\n secure?: boolean;\n /**\n * The flag of if upgrade the cookies created by maintenance Browser SDK.\n * @defaultValue `true`\n */\n upgrade?: boolean;\n}\n\ntype HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata' | '_enableRequestBodyCompressionExperimental';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {}\n"]}
|
|
1
|
+
{"version":3,"file":"browser-config.js","sourceRoot":"","sources":["../../../../src/types/config/browser-config.ts"],"names":[],"mappings":";;;AA2Ra,QAAA,qCAAqC,GAAG;IACnD,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,iBAAiB;CAC1B,CAAC","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport, TransportTypeOrOptions } from '../transport';\nimport { IConfig } from './core-config';\nimport { ElementInteractionsOptions } from '../element-interactions';\nimport { FormInteractionsOptions } from '../form-interactions';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { NetworkTrackingOptions } from '../network-tracking';\nimport { FrustrationInteractionsOptions } from '../frustration-interactions';\nimport { IDiagnosticsClient } from '../../diagnostics/diagnostics-client';\nimport { IRemoteConfigClient } from '../../remote-config/remote-config';\nimport { CustomEnrichmentOptions } from '../custom-enrichment';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends IConfig {\n /**\n * An app version for events tracked. This can be the version of your application.\n * @defaultValue `undefined`\n */\n appVersion?: string;\n /**\n * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.\n * The default event tracking configuration.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.\n * @defaultValue `true`\n */\n defaultTracking?: boolean | DefaultTrackingOptions;\n /**\n * The configurations for auto-captured events.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.\n */\n autocapture?: boolean | AutocaptureOptions;\n /**\n * The configurations for custom enrichment.\n * @defaultValue `false`\n */\n customEnrichment?: boolean | CustomEnrichmentOptions;\n /**\n * The identifier for the device running your application.\n * @defaultValue `UUID()`\n */\n deviceId?: string;\n /**\n * Configuration for cookie.\n */\n cookieOptions?: CookieOptions;\n /**\n * The storage for user identify.\n * @defaultValue `\"cookie\"`\n */\n identityStorage?: IdentityStorageType;\n /**\n * The partner identifier.\n * Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.\n * @defaultValue `undefined`\n */\n partnerId?: string;\n /**\n * The custom Session ID for the current session.\n * @defaultValue `timestamp`\n */\n sessionId?: number;\n /**\n * The period of inactivity from the last tracked event before a session expires in milliseconds.\n * @defaultValue `1,800,000` (30 minutes)\n */\n sessionTimeout: number;\n /**\n * The configurations for tracking additional properties.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.\n */\n trackingOptions: TrackingOptions;\n /**\n * Network transport mechanism used to send events.\n * @defaultValue `\"fetch\"`\n */\n transport?: TransportTypeOrOptions;\n /**\n * The identifier for the user being tracked.\n * @defaultValue `undefined`\n */\n userId?: string;\n /**\n * User's Nth instance of performing a default Page Viewed event within a session.\n * Used for landing page analysis.\n */\n pageCounter?: number;\n /**\n * Whether to fetch remote configuration. The remote configuration can be updated in the Amplitude platform here:\n * https://app.amplitude.com/data/amplitude/{your_org_name}/settings/autocapture\n * @defaultValue `true`\n * @deprecated This property is deprecated and will be removed in future versions. Please use `remoteConfig.fetchRemoteConfig` instead.\n */\n fetchRemoteConfig?: boolean;\n /**\n * Remote configuration options.\n * @defaultValue `undefined`\n */\n remoteConfig?: RemoteConfigOptions;\n /**\n * Captures network requests and responses.\n * @defaultValue `undefined`\n * @deprecated use autocapture.networkTracking instead\n */\n networkTrackingOptions?: NetworkTrackingOptions;\n /**\n * Whether to enable diagnostics.\n * @defaultValue `true`\n */\n enableDiagnostics?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n version?: string;\n diagnosticsSampleRate?: number;\n diagnosticsClient?: IDiagnosticsClient;\n remoteConfigClient?: IRemoteConfigClient;\n deferredSessionId?: number;\n topLevelDomain?: string;\n _enableRequestBodyCompressionExperimental?: boolean;\n}\n\n/**\n * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.\n */\nexport interface DefaultTrackingOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking or configures with detailed options.\n * @defaultValue `true`\n */\n formInteractions?: boolean | FormInteractionsOptions;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n}\n\nexport interface AutocaptureOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking or configures with detailed options.\n * @defaultValue `true`\n */\n formInteractions?: boolean | FormInteractionsOptions;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n /**\n * Enables/disables user interactions tracking.\n * @defaultValue `false`\n */\n elementInteractions?: boolean | ElementInteractionsOptions;\n /**\n * Enables/disables frustration interactions tracking.\n * @defaultValue `false`\n */\n frustrationInteractions?: boolean | FrustrationInteractionsOptions;\n /**\n * Enables/disables network request tracking or config with detailed network tracking options.\n * @defaultValue `false`\n */\n networkTracking?: boolean | NetworkTrackingOptions;\n /**\n * Enables/disables web vitals tracking.\n * @defaultValue `false`\n */\n webVitals?: boolean;\n /**\n * Enables/disables page url enrichment.\n * @defaultValue `true`\n * @experimental This feature is experimental and may not be stable\n */\n pageUrlEnrichment?: boolean;\n}\n\nexport interface TrackingOptions {\n /**\n * Enables/disables ip address tracking.\n * @defaultValue `true`\n */\n ipAddress?: boolean;\n /**\n * Enables/disables language tracking.\n * @defaultValue `true`\n */\n language?: boolean;\n /**\n * Enables/disables plantform tracking.\n * @defaultValue `true`\n */\n platform?: boolean;\n}\n\nexport type TrackingMethod = 'userProperty' | 'eventProperty';\n\nexport interface AttributionOptions {\n /**\n * The rules to determine which referrers are excluded from being tracked as traffic source.\n * Applies only to `userProperty` tracking.\n * Ignored by `eventProperty` tracking.\n * @defaultValue `[/your-domain\\.com$/]`\n */\n excludeReferrers?: (string | RegExp)[];\n /**\n * Exclude internal referrers from campaign attribution.\n * (a referrer is 'internal' if it is on the same domain as the current page)\n * Applies only to `userProperty` tracking.\n * Ignored by `eventProperty` tracking.\n * @defaultValue `false`\n */\n excludeInternalReferrers?: true | false | ExcludeInternalReferrersOptions;\n /**\n * The value to represent undefined/no initial campaign parameter for first-touch attribution.\n * Applies only to `userProperty` tracking.\n * Ignored by `eventProperty` tracking.\n * @defaultValue `\"EMPTY\"`\n */\n initialEmptyValue?: string;\n /**\n * The flag of if Amplitude to start a new session if any campaign parameter changes.\n * Applies only to `userProperty` tracking.\n * Ignored by `eventProperty` tracking.\n * @defaultValue `false`\n */\n resetSessionOnNewCampaign?: boolean;\n /**\n * The attribution persistence strategy for campaign parameters.\n * Provide a single method to enable one strategy, or an array to enable multiple methods at the same time.\n * When multiple methods are provided, each enabled method runs independently and their behaviors are combined.\n * For example, `['userProperty', 'eventProperty']` updates user properties and also attaches campaign params\n * to event properties.\n * @experimental this feature is experimental and may not be stable\n * @defaultValue `\"userProperty\"`\n */\n trackingMethod?: TrackingMethod | TrackingMethod[];\n /**\n * Fires an `[Amplitude] Attribution` event as a heartbeat on every page view,\n * such as on page load and SPA URL changes.\n * Applies only to `eventProperty` tracking.\n * Ignored by `userProperty` tracking.\n * @experimental this feature is experimental and may not be stable\n * @defaultValue `false`\n */\n fallbackAttributionEvent?: boolean;\n}\n\nexport const EXCLUDE_INTERNAL_REFERRERS_CONDITIONS = {\n always: 'always',\n ifEmptyCampaign: 'ifEmptyCampaign',\n} as const;\n\ntype ExcludeInternalReferrersCondition =\n (typeof EXCLUDE_INTERNAL_REFERRERS_CONDITIONS)[keyof typeof EXCLUDE_INTERNAL_REFERRERS_CONDITIONS];\n\nexport interface ExcludeInternalReferrersOptions {\n /*\n * The condition on which to exclude internal referrers for campaign attribution.\n * @defaultValue `\"always\"`\n */\n condition?: ExcludeInternalReferrersCondition;\n}\n\nexport interface RemoteConfigOptions {\n /**\n * Whether to fetch remote configuration. The remote configuration can be updated in the Amplitude platform here:\n * https://app.amplitude.com/data/amplitude/{your_org_name}/settings/autocapture\n * @defaultValue `true`\n */\n fetchRemoteConfig?: boolean;\n /**\n * Custom server URL for remote configuration requests. If not provided, defaults to the standard\n * Amplitude remote config endpoint based on serverZone (US or EU).\n * Use this to proxy remote config requests through your own server.\n * @defaultValue `undefined` (uses standard Amplitude remote config endpoint)\n */\n serverUrl?: string;\n}\n\nexport interface CookieOptions {\n /**\n * The domain property of cookies created.\n * @defaultValue `Your top level domain`\n */\n domain?: string;\n /**\n * The expiration of cookies created in days.\n * @defaultValue `365`\n */\n expiration?: number;\n /**\n * How cookies are sent with cross-site requests.\n * @defaultValue `\"Lax\"`\n */\n sameSite?: 'Strict' | 'Lax' | 'None';\n /**\n * The flag of if send cookies over secure protocols.\n * @defaultValue `false`\n */\n secure?: boolean;\n /**\n * The flag of if upgrade the cookies created by maintenance Browser SDK.\n * @defaultValue `true`\n */\n upgrade?: boolean;\n}\n\ntype HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata' | '_enableRequestBodyCompressionExperimental';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {}\n"]}
|
|
@@ -98,7 +98,6 @@ export interface FrustrationInteractionsOptions {
|
|
|
98
98
|
* Set to `false` to disable error click tracking.
|
|
99
99
|
* Set to `true` or an options object to enable with default settings.
|
|
100
100
|
* Default is false.
|
|
101
|
-
* @experimental this feature is experimental and may not be stable
|
|
102
101
|
*/
|
|
103
102
|
errorClicks?: boolean | ErrorClickOptions;
|
|
104
103
|
/**
|
|
@@ -106,7 +105,6 @@ export interface FrustrationInteractionsOptions {
|
|
|
106
105
|
* Set to `false` to disable thrashed cursor tracking.
|
|
107
106
|
* Set to `true` or an options object to enable with default settings.
|
|
108
107
|
* Default is false.
|
|
109
|
-
* @experimental this feature is experimental and may not be stable
|
|
110
108
|
*/
|
|
111
109
|
thrashedCursor?: boolean | ThrashedCursorOptions;
|
|
112
110
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frustration-interactions.d.ts","sourceRoot":"","sources":["../../../src/types/frustration-interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEvC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEzC;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC;IAEpF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IAExC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IAExC
|
|
1
|
+
{"version":3,"file":"frustration-interactions.d.ts","sourceRoot":"","sources":["../../../src/types/frustration-interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,EA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O,MAAM,4BAA4B,OAAQ,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,4BAA4B,OAAQ,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,0CAA0C,KAAK,CAAC;AAK7D,KAAK,UAAU,GAAG,OAAO,UAAU,SAAS;IAC1C,OAAO,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;CACxC,GACG,CAAC,GACD,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frustration-interactions.js","sourceRoot":"","sources":["../../../src/types/frustration-interactions.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"frustration-interactions.js","sourceRoot":"","sources":["../../../src/types/frustration-interactions.ts"],"names":[],"mappings":";;;;AA+HA,IAAM,2BAA2B,GAAG;IAClC,GAAG;IACH,QAAQ;IACR,iBAAiB;IACjB,eAAe;IACf,mBAAmB;IACnB,2BAA2B;IAC3B,wBAAwB;IACxB,iBAAiB;IACjB,cAAc;IACd,mBAAmB;IACnB,4BAA4B;CAC7B,CAAC;AAEF,IAAM,sCAAsC;IAC1C,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;kBACjB,2BAA2B,SAC/B,CAAC;AAEF;;GAEG;AACU,QAAA,4BAA4B,GAAG,sCAAsC,CAAC;AAEnF;;GAEG;AACU,QAAA,6BAA6B,GAAG,sCAAsC,CAAC;AAEpF;;GAEG;AACU,QAAA,4BAA4B,GAAG,CAAC,GAAG,CAAC,CAAC;AAElD;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAK,CAAC;AAElD;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAK,CAAC;AAElD;;GAEG;AACU,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAE9C;;GAEG;AACU,QAAA,0CAA0C,GAAG,EAAE,CAAC,CAAC,SAAS","sourcesContent":["import { ActionType } from './element-interactions';\n\n/**\n * Configuration options for dead clicks tracking\n */\nexport interface DeadClickOptions {\n /**\n * CSS selectors to define which elements on the page to track for dead clicks.\n * A dead click is a click that doesn't result in any visible change or navigation.\n */\n cssSelectorAllowlist?: string[];\n}\n\n/**\n * Configuration options for rage clicks tracking\n */\nexport interface RageClickOptions {\n /**\n * CSS selectors to define which elements on the page to track for rage clicks.\n * A rage click is multiple rapid clicks on the same element within a 3s time window.\n */\n cssSelectorAllowlist?: string[];\n}\n\n/**\n * Configuration options for thrashed cursor tracking\n */\nexport interface ThrashedCursorOptions {\n /**\n * Number of direction changes required to consider a thrashed cursor.\n * Minimum of 5\n * (x axis changes and y axis changes are counted separately)\n * @default 20\n */\n directionChanges?: number;\n /**\n * Time window in milliseconds to consider a thrashed cursor.\n * Maximum of of 4000\n * @default 2000\n */\n threshold?: number;\n}\n\n/**\n * Configuration options for error clicks tracking\n */\nexport interface ErrorClickOptions {\n /**\n * CSS selectors to define which elements on the page to track for error clicks.\n * An error click is a click that results in an error.\n */\n cssSelectorAllowlist?: string[];\n}\n\n/**\n * Configuration options for frustration interactions tracking.\n * This includes dead clicks and rage clicks tracking.\n */\nexport interface FrustrationInteractionsOptions {\n /**\n * List of page URLs to allow auto tracking on.\n * When provided, only allow tracking on these URLs.\n * Both full URLs and regex are supported.\n */\n pageUrlAllowlist?: (string | RegExp)[];\n\n /**\n * List of page URLs to exclude from auto tracking.\n * When provided, tracking will be blocked on these URLs.\n * Both full URLs and regex are supported.\n * This takes precedence over pageUrlAllowlist.\n */\n pageUrlExcludelist?: (string | RegExp)[];\n\n /**\n * Function to determine whether an event should be tracked.\n * When provided, this function overwrites all other allowlists and configurations.\n * If the function returns true, the event will be tracked.\n * If the function returns false, the event will not be tracked.\n * @param actionType - The type of action that triggered the event.\n * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.\n */\n shouldTrackEventResolver?: (actionType: ActionType, element: DomElement) => boolean;\n\n /**\n * Prefix for data attributes to allow auto collecting.\n * Default is 'data-amp-track-'.\n */\n dataAttributePrefix?: string;\n\n /**\n * Configuration for dead clicks tracking.\n * Set to `false` to disable dead click tracking.\n * Set to `true` or an options object to enable with default or custom settings.\n * Default is false.\n */\n deadClicks?: boolean | DeadClickOptions;\n\n /**\n * Configuration for rage clicks tracking.\n * Set to `false` to disable rage click tracking.\n * Set to `true` or an options object to enable with default settings.\n * Default is false.\n */\n rageClicks?: boolean | RageClickOptions;\n\n /**\n * Configuration for error clicks tracking\n * Set to `false` to disable error click tracking.\n * Set to `true` or an options object to enable with default settings.\n * Default is false.\n */\n errorClicks?: boolean | ErrorClickOptions;\n /**\n * Configuration for thrashed cursor tracking.\n * Set to `false` to disable thrashed cursor tracking.\n * Set to `true` or an options object to enable with default settings.\n * Default is false.\n */\n thrashedCursor?: boolean | ThrashedCursorOptions;\n\n /**\n * RegExp pattern list to allow custom patterns for text masking\n */\n maskTextRegex?: (RegExp | { pattern: string; description: string })[];\n}\n\nconst CLICKABLE_ELEMENT_SELECTORS = [\n 'a',\n 'button',\n '[role=\"button\"]',\n '[role=\"link\"]',\n '[role=\"menuitem\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n '[role=\"option\"]',\n '[role=\"tab\"]',\n '[role=\"treeitem\"]',\n '[contenteditable=\"true\" i]',\n];\n\nconst DEFAULT_ERROR_AND_DEAD_CLICK_ALLOWLIST = [\n 'input[type=\"button\"]',\n 'input[type=\"submit\"]',\n 'input[type=\"reset\"]',\n 'input[type=\"image\"]',\n 'input[type=\"file\"]',\n ...CLICKABLE_ELEMENT_SELECTORS,\n];\n\n/**\n * Default CSS selectors for dead clicks tracking\n */\nexport const DEFAULT_DEAD_CLICK_ALLOWLIST = DEFAULT_ERROR_AND_DEAD_CLICK_ALLOWLIST;\n\n/**\n * Default CSS selectors for error tracking\n */\nexport const DEFAULT_ERROR_CLICK_ALLOWLIST = DEFAULT_ERROR_AND_DEAD_CLICK_ALLOWLIST;\n\n/**\n * Default CSS selectors for rage clicks tracking\n */\nexport const DEFAULT_RAGE_CLICK_ALLOWLIST = ['*'];\n\n/**\n * Default time window for dead clicks (3 seconds)\n */\nexport const DEFAULT_DEAD_CLICK_WINDOW_MS = 3_000;\n\n/**\n * Default time window for rage clicks (1 second)\n */\nexport const DEFAULT_RAGE_CLICK_WINDOW_MS = 1_000;\n\n/**\n * Default threshold for rage clicks (4 clicks)\n */\nexport const DEFAULT_RAGE_CLICK_THRESHOLD = 4;\n\n/**\n * Default threshold for rage clicks to be considered out of bounds (50 pixels)\n */\nexport const DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD = 50; // pixels\n\n// DomElement is [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) if the dom library is included in tsconfig.json\n// and never if it is not included\n// eslint-disable-next-line no-restricted-globals\ntype DomElement = typeof globalThis extends {\n Element: new (...args: any) => infer T;\n}\n ? T\n : never;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omit-undefined.d.ts","sourceRoot":"","sources":["../../../src/utils/omit-undefined.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,UAAW,OAAO,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,2BAStE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.omitUndefined = void 0;
|
|
4
|
+
var omitUndefined = function (input) {
|
|
5
|
+
var obj = {};
|
|
6
|
+
for (var key in input) {
|
|
7
|
+
var val = input[key];
|
|
8
|
+
if (val) {
|
|
9
|
+
obj[key] = val;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
};
|
|
14
|
+
exports.omitUndefined = omitUndefined;
|
|
15
|
+
//# sourceMappingURL=omit-undefined.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omit-undefined.js","sourceRoot":"","sources":["../../../src/utils/omit-undefined.ts"],"names":[],"mappings":";;;AAAO,IAAM,aAAa,GAAG,UAAC,KAAyC;IACrE,IAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,IAAM,GAAG,IAAI,KAAK,EAAE;QACvB,IAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,GAAG,EAAE;YACP,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;SAChB;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AATW,QAAA,aAAa,iBASxB","sourcesContent":["export const omitUndefined = (input: Record<string, string | undefined>) => {\n const obj: Record<string, string> = {};\n for (const key in input) {\n const val = input[key];\n if (val) {\n obj[key] = val;\n }\n }\n return obj;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VideoHandler,
|
|
1
|
+
import { VideoHandler, EmbeddedVideoPlayer, MuxElement, Vendor } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Track a standard HTML video element.
|
|
4
4
|
*
|
|
@@ -6,16 +6,6 @@ import { VideoHandler, MuxEmbeddedPlayer, MuxElement } from './types';
|
|
|
6
6
|
* @param handlers - The video handlers to call when on video lifecycle events.
|
|
7
7
|
* @returns A function to untrack the video.
|
|
8
8
|
*/
|
|
9
|
-
export declare function trackHtmlVideo(videoEl: HTMLVideoElement | MuxElement, handlers: VideoHandler, vendor?:
|
|
10
|
-
|
|
11
|
-
* Track a Mux HTML video element.
|
|
12
|
-
*
|
|
13
|
-
* @param videoEl - The HTML Mux video element to track.
|
|
14
|
-
* @param handlers - The video handlers to call when on video lifecycle events.
|
|
15
|
-
* @returns A function to untrack the video.
|
|
16
|
-
*/
|
|
17
|
-
export declare function trackMuxHtmlVideo(videoEl: MuxElement, handlers: VideoHandler): () => void;
|
|
18
|
-
export declare function trackMuxEmbeddedVideo(player: MuxEmbeddedPlayer, handlers: VideoHandler): () => void;
|
|
19
|
-
export declare function trackYoutubeEmbeddedVideo(): void;
|
|
20
|
-
export declare function trackVimeoEmbeddedVideo(): void;
|
|
9
|
+
export declare function trackHtmlVideo(videoEl: HTMLVideoElement | MuxElement, handlers: VideoHandler, vendor?: Vendor): () => void;
|
|
10
|
+
export declare function trackEmbeddedVideo(player: EmbeddedVideoPlayer, handlers: VideoHandler, vendor?: Vendor | null): () => void;
|
|
21
11
|
//# sourceMappingURL=track-video.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track-video.d.ts","sourceRoot":"","sources":["../../../src/video-analytics/track-video.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"track-video.d.ts","sourceRoot":"","sources":["../../../src/video-analytics/track-video.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,mBAAmB,EACnB,UAAU,EACV,MAAM,EAGP,MAAM,SAAS,CAAC;AA+BjB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM,cAgE7G;AAwCD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,cA0FnH"}
|