@amplitude/analytics-core 2.55.0-video-analytics.0 → 2.55.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/config.d.ts +0 -1
- package/lib/cjs/config.d.ts.map +1 -1
- package/lib/cjs/config.js +0 -1
- package/lib/cjs/config.js.map +1 -1
- package/lib/cjs/core-client.d.ts.map +1 -1
- package/lib/cjs/core-client.js +6 -1
- package/lib/cjs/core-client.js.map +1 -1
- package/lib/cjs/diagnostics/diagnostics-client.d.ts +7 -1
- package/lib/cjs/diagnostics/diagnostics-client.d.ts.map +1 -1
- package/lib/cjs/diagnostics/diagnostics-client.js +11 -2
- package/lib/cjs/diagnostics/diagnostics-client.js.map +1 -1
- package/lib/cjs/index.d.ts +2 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/observers/video.d.ts +1 -3
- package/lib/cjs/observers/video.d.ts.map +1 -1
- package/lib/cjs/observers/video.js +2 -30
- package/lib/cjs/observers/video.js.map +1 -1
- package/lib/cjs/plugins/destination.d.ts +1 -19
- package/lib/cjs/plugins/destination.d.ts.map +1 -1
- package/lib/cjs/plugins/destination.js +25 -161
- package/lib/cjs/plugins/destination.js.map +1 -1
- package/lib/cjs/types/config/core-config.d.ts +0 -5
- package/lib/cjs/types/config/core-config.d.ts.map +1 -1
- package/lib/cjs/types/config/core-config.js.map +1 -1
- package/lib/cjs/types/config/node-config.d.ts +7 -1
- package/lib/cjs/types/config/node-config.d.ts.map +1 -1
- package/lib/cjs/types/config/node-config.js.map +1 -1
- package/lib/cjs/types/event/base-event.d.ts +0 -1
- package/lib/cjs/types/event/base-event.d.ts.map +1 -1
- package/lib/cjs/types/event/base-event.js.map +1 -1
- package/lib/cjs/types/messages.d.ts +1 -0
- package/lib/cjs/types/messages.d.ts.map +1 -1
- package/lib/cjs/types/messages.js +2 -1
- package/lib/cjs/types/messages.js.map +1 -1
- package/lib/cjs/types/payload.d.ts +0 -5
- package/lib/cjs/types/payload.d.ts.map +1 -1
- package/lib/cjs/types/payload.js.map +1 -1
- package/lib/esm/config.d.ts +0 -1
- package/lib/esm/config.d.ts.map +1 -1
- package/lib/esm/config.js +0 -1
- package/lib/esm/config.js.map +1 -1
- package/lib/esm/core-client.d.ts.map +1 -1
- package/lib/esm/core-client.js +7 -2
- package/lib/esm/core-client.js.map +1 -1
- package/lib/esm/diagnostics/diagnostics-client.d.ts +7 -1
- package/lib/esm/diagnostics/diagnostics-client.d.ts.map +1 -1
- package/lib/esm/diagnostics/diagnostics-client.js +11 -2
- package/lib/esm/diagnostics/diagnostics-client.js.map +1 -1
- package/lib/esm/index.d.ts +2 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/observers/video.d.ts +1 -3
- package/lib/esm/observers/video.d.ts.map +1 -1
- package/lib/esm/observers/video.js +2 -30
- package/lib/esm/observers/video.js.map +1 -1
- package/lib/esm/plugins/destination.d.ts +1 -19
- package/lib/esm/plugins/destination.d.ts.map +1 -1
- package/lib/esm/plugins/destination.js +26 -162
- package/lib/esm/plugins/destination.js.map +1 -1
- package/lib/esm/types/config/core-config.d.ts +0 -5
- package/lib/esm/types/config/core-config.d.ts.map +1 -1
- package/lib/esm/types/config/core-config.js.map +1 -1
- package/lib/esm/types/config/node-config.d.ts +7 -1
- package/lib/esm/types/config/node-config.d.ts.map +1 -1
- package/lib/esm/types/config/node-config.js.map +1 -1
- package/lib/esm/types/event/base-event.d.ts +0 -1
- package/lib/esm/types/event/base-event.d.ts.map +1 -1
- package/lib/esm/types/event/base-event.js.map +1 -1
- package/lib/esm/types/messages.d.ts +1 -0
- package/lib/esm/types/messages.d.ts.map +1 -1
- package/lib/esm/types/messages.js +1 -0
- package/lib/esm/types/messages.js.map +1 -1
- package/lib/esm/types/payload.d.ts +0 -5
- package/lib/esm/types/payload.d.ts.map +1 -1
- package/lib/esm/types/payload.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VideoEvent, EmbeddedVideoPlayer, MuxElement, Vendor } from '../video-analytics/types';
|
|
2
2
|
export type { Vendor };
|
|
3
|
-
type PlaybackState = 'playing' | 'paused' | 'ended' | 'error' | 'seeking'
|
|
3
|
+
type PlaybackState = 'playing' | 'paused' | 'ended' | 'error' | 'seeking';
|
|
4
4
|
export type State = {
|
|
5
5
|
playbackState: PlaybackState;
|
|
6
6
|
errorMessage?: string;
|
|
@@ -17,7 +17,6 @@ export type VideoObserverParams = {
|
|
|
17
17
|
};
|
|
18
18
|
export declare class VideoObserver {
|
|
19
19
|
private state;
|
|
20
|
-
private waitingInterval;
|
|
21
20
|
private untrack;
|
|
22
21
|
private onStateChange;
|
|
23
22
|
private handler;
|
|
@@ -25,7 +24,6 @@ export declare class VideoObserver {
|
|
|
25
24
|
private stateChangeHandler;
|
|
26
25
|
private updateStateWithError;
|
|
27
26
|
private updatePlaybackState;
|
|
28
|
-
private clearWaitingInterval;
|
|
29
27
|
private updateTime;
|
|
30
28
|
private updateState;
|
|
31
29
|
destroy(): void;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -7,7 +7,6 @@ var VideoObserver = /** @class */ (function () {
|
|
|
7
7
|
this.state = {
|
|
8
8
|
playbackState: 'paused',
|
|
9
9
|
};
|
|
10
|
-
this.waitingInterval = null;
|
|
11
10
|
this.handler = {
|
|
12
11
|
onPlay: function (evt) {
|
|
13
12
|
_this.updatePlaybackState('playing', evt);
|
|
@@ -50,44 +49,18 @@ var VideoObserver = /** @class */ (function () {
|
|
|
50
49
|
}
|
|
51
50
|
};
|
|
52
51
|
VideoObserver.prototype.updateStateWithError = function (error) {
|
|
53
|
-
this.clearWaitingInterval();
|
|
54
52
|
var previousState = this.state;
|
|
55
53
|
var nextState = __assign(__assign({}, previousState), { playbackState: 'error', errorMessage: error });
|
|
56
54
|
this.updateState(nextState);
|
|
57
55
|
};
|
|
58
56
|
VideoObserver.prototype.updatePlaybackState = function (playbackState, event) {
|
|
59
|
-
var _this = this;
|
|
60
57
|
var nextState = __assign(__assign({}, this.state), { playbackState: playbackState, lastEvent: event, position: event.last_position });
|
|
61
58
|
this.updateState(nextState);
|
|
62
|
-
this.clearWaitingInterval();
|
|
63
|
-
if (playbackState !== 'playing') {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
// if it's in a playing state, but the playhead is not moving,
|
|
67
|
-
// then transition playback from 'playing' to 'waiting'
|
|
68
|
-
// (the "waiting" listener isn't reliable, so this is a fallback)
|
|
69
|
-
var prevPosition = this.state.position;
|
|
70
|
-
this.waitingInterval = setInterval(function () {
|
|
71
|
-
var position = _this.state.position;
|
|
72
|
-
if (_this.state.playbackState === 'playing' && typeof prevPosition === 'number' && prevPosition === position) {
|
|
73
|
-
// no new player event backs this transition, so carry the current position and metadata over
|
|
74
|
-
_this.updateState(__assign(__assign({}, _this.state), { playbackState: 'waiting' }));
|
|
75
|
-
}
|
|
76
|
-
prevPosition = position;
|
|
77
|
-
}, 1000);
|
|
78
|
-
};
|
|
79
|
-
VideoObserver.prototype.clearWaitingInterval = function () {
|
|
80
|
-
if (this.waitingInterval) {
|
|
81
|
-
clearInterval(this.waitingInterval);
|
|
82
|
-
this.waitingInterval = null;
|
|
83
|
-
}
|
|
84
59
|
};
|
|
85
60
|
VideoObserver.prototype.updateTime = function (event) {
|
|
86
61
|
var _a, _b;
|
|
87
62
|
var lastVideoEvent = this.state.lastEvent;
|
|
88
|
-
|
|
89
|
-
var isPlaying = this.state.playbackState === 'playing';
|
|
90
|
-
if (!lastVideoEvent || (!isPlaying && !isWaiting)) {
|
|
63
|
+
if (!lastVideoEvent || this.state.playbackState !== 'playing') {
|
|
91
64
|
return;
|
|
92
65
|
}
|
|
93
66
|
var isSeeking = event.isSeeking || this.state.isSeeking;
|
|
@@ -98,7 +71,7 @@ var VideoObserver = /** @class */ (function () {
|
|
|
98
71
|
return;
|
|
99
72
|
}
|
|
100
73
|
var timeDelta = nextPosition - lastPosition;
|
|
101
|
-
var nextState = __assign(__assign({}, this.state), {
|
|
74
|
+
var nextState = __assign(__assign({}, this.state), { position: nextPosition, watchTime: ((_b = this.state.watchTime) !== null && _b !== void 0 ? _b : 0) + timeDelta });
|
|
102
75
|
this.updateState(nextState);
|
|
103
76
|
};
|
|
104
77
|
VideoObserver.prototype.updateState = function (nextState) {
|
|
@@ -107,7 +80,6 @@ var VideoObserver = /** @class */ (function () {
|
|
|
107
80
|
this.stateChangeHandler(previousState, nextState);
|
|
108
81
|
};
|
|
109
82
|
VideoObserver.prototype.destroy = function () {
|
|
110
|
-
this.clearWaitingInterval();
|
|
111
83
|
this.untrack();
|
|
112
84
|
};
|
|
113
85
|
return VideoObserver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../../src/observers/video.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AA8BpF;
|
|
1
|
+
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../../src/observers/video.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AA8BpF;IAwCE,uBAAY,EAAmE;YAAjE,OAAO,aAAA,EAAE,aAAa,mBAAA,EAAE,MAAM,YAAA,EAAE,UAAU,gBAAA;QAAxD,iBAOC;QA9CO,UAAK,GAAU;YACrB,aAAa,EAAE,QAAQ;SACxB,CAAC;QAIM,YAAO,GAAiB;YAC9B,MAAM,E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,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","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"]}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { DestinationPlugin } from '../types/plugin';
|
|
2
2
|
import { Event } from '../types/event/event';
|
|
3
|
-
import { Delay } from '../types/event/base-event';
|
|
4
3
|
import { Result } from '../types/result';
|
|
5
4
|
import { Response, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse, SuccessResponse } from '../types/response';
|
|
6
5
|
import { IConfig } from '../types/config/core-config';
|
|
7
6
|
import { EventCallback } from '../types/event-callback';
|
|
8
7
|
import { IDiagnosticsClient } from '../diagnostics/diagnostics-client';
|
|
9
|
-
import { DelayedPayload, Payload } from '../types/payload';
|
|
10
8
|
export interface Context {
|
|
11
9
|
event: Event;
|
|
12
10
|
attempts: number;
|
|
13
11
|
callback: EventCallback;
|
|
14
12
|
timeout: number;
|
|
15
|
-
delay?: Delay;
|
|
16
13
|
}
|
|
17
|
-
type DelayedEventsById = Record<string, Context[]>;
|
|
18
14
|
export declare function getResponseBodyString(res: Response): string;
|
|
19
15
|
export declare class Destination implements DestinationPlugin {
|
|
20
16
|
name: string;
|
|
@@ -28,30 +24,17 @@ export declare class Destination implements DestinationPlugin {
|
|
|
28
24
|
flushId: ReturnType<typeof setTimeout> | null;
|
|
29
25
|
queue: Context[];
|
|
30
26
|
diagnosticsClient: IDiagnosticsClient | undefined;
|
|
31
|
-
inFlightDelayedEvents: Record<string, boolean>;
|
|
32
27
|
constructor(context?: {
|
|
33
28
|
diagnosticsClient: IDiagnosticsClient;
|
|
34
29
|
});
|
|
35
30
|
setup(config: IConfig): Promise<undefined>;
|
|
36
31
|
execute(event: Event): Promise<Result>;
|
|
37
|
-
/**
|
|
38
|
-
* If a stale delayed event is sitting in the queue, and it is not in flight,
|
|
39
|
-
* remove it and resolve as "stale" with status code 0.
|
|
40
|
-
*
|
|
41
|
-
* If this delayed event is already in flight, mark it as fresh, so that
|
|
42
|
-
* when it completes, it won't clean-up the updated event.
|
|
43
|
-
* @param incomingEvent { Event } the new event to check old events against
|
|
44
|
-
* @returns void
|
|
45
|
-
*/
|
|
46
|
-
private removeStaleDelayedEvents;
|
|
47
32
|
removeEventsExceedFlushMaxRetries(list: Context[]): Context[];
|
|
48
33
|
scheduleEvents(list: Context[]): void;
|
|
49
34
|
schedule(timeout: number): void;
|
|
50
35
|
resetSchedule(): void;
|
|
51
36
|
flush(useRetry?: boolean): Promise<void>;
|
|
52
|
-
|
|
53
|
-
translatePayloadToDelayedPayload(payload: Payload & Partial<DelayedPayload>, list: Context[]): void;
|
|
54
|
-
send(list: Context[], useRetry?: boolean, delay?: boolean): Promise<void>;
|
|
37
|
+
send(list: Context[], useRetry?: boolean): Promise<void>;
|
|
55
38
|
handleResponse(res: Response, list: Context[]): void;
|
|
56
39
|
handleSuccessResponse(res: SuccessResponse, list: Context[]): void;
|
|
57
40
|
handleInvalidResponse(res: InvalidResponse, list: Context[]): void;
|
|
@@ -72,5 +55,4 @@ export declare class Destination implements DestinationPlugin {
|
|
|
72
55
|
*/
|
|
73
56
|
removeEvents(eventsToRemove: Context[]): void;
|
|
74
57
|
}
|
|
75
|
-
export {};
|
|
76
58
|
//# sourceMappingURL=destination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destination.d.ts","sourceRoot":"","sources":["../../../src/plugins/destination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"destination.d.ts","sourceRoot":"","sources":["../../../src/plugins/destination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EACL,QAAQ,EACR,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAmB3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,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE;IAuC7C,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE;IAI3D,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE;IA+B3D,6BAA6B,CAAC,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAE,OAAO,EAAE;IAe3E,uBAAuB,CAAC,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,EAAE;IA+B/D,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE;IAUnC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAiB7D;;;;;;OAMG;IACH,UAAU;IASV;;OAEG;IACH,YAAY,CAAC,cAAc,EAAE,OAAO,EAAE;CAOvC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter, __generator, __read, __rest, __spreadArray
|
|
1
|
+
import { __awaiter, __generator, __read, __rest, __spreadArray } from "tslib";
|
|
2
2
|
import { Status } from '../types/status';
|
|
3
3
|
import { INVALID_API_KEY, MAX_RETRIES_EXCEEDED_MESSAGE, MISSING_API_KEY_MESSAGE, SUCCESS_MESSAGE, UNEXPECTED_ERROR_MESSAGE, } from '../types/messages';
|
|
4
4
|
import { AMPLITUDE_BATCH_SERVER_URL, AMPLITUDE_SERVER_URL, EU_AMPLITUDE_BATCH_SERVER_URL, EU_AMPLITUDE_SERVER_URL, STORAGE_PREFIX, } from '../types/constants';
|
|
@@ -56,7 +56,6 @@ var Destination = /** @class */ (function () {
|
|
|
56
56
|
// When flush resolves, set `flushId` to null
|
|
57
57
|
this.flushId = null;
|
|
58
58
|
this.queue = [];
|
|
59
|
-
this.inFlightDelayedEvents = {};
|
|
60
59
|
this.diagnosticsClient = context === null || context === void 0 ? void 0 : context.diagnosticsClient;
|
|
61
60
|
}
|
|
62
61
|
Destination.prototype.setup = function (config) {
|
|
@@ -93,49 +92,11 @@ var Destination = /** @class */ (function () {
|
|
|
93
92
|
callback: function (result) { return resolve(result); },
|
|
94
93
|
timeout: 0,
|
|
95
94
|
};
|
|
96
|
-
_this.removeStaleDelayedEvents(event);
|
|
97
95
|
_this.queue.push(context);
|
|
98
96
|
_this.schedule(_this.config.flushIntervalMillis);
|
|
99
97
|
_this.saveEvents();
|
|
100
98
|
});
|
|
101
99
|
};
|
|
102
|
-
/**
|
|
103
|
-
* If a stale delayed event is sitting in the queue, and it is not in flight,
|
|
104
|
-
* remove it and resolve as "stale" with status code 0.
|
|
105
|
-
*
|
|
106
|
-
* If this delayed event is already in flight, mark it as fresh, so that
|
|
107
|
-
* when it completes, it won't clean-up the updated event.
|
|
108
|
-
* @param incomingEvent { Event } the new event to check old events against
|
|
109
|
-
* @returns void
|
|
110
|
-
*/
|
|
111
|
-
Destination.prototype.removeStaleDelayedEvents = function (incomingEvent) {
|
|
112
|
-
var _this = this;
|
|
113
|
-
var _a;
|
|
114
|
-
try {
|
|
115
|
-
if (!((_a = incomingEvent.delay) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
/* istanbul ignore next */
|
|
119
|
-
this.queue = this.queue.filter(function (context) {
|
|
120
|
-
if (incomingEvent.delay &&
|
|
121
|
-
context.event.delay &&
|
|
122
|
-
context.event.delay.id === incomingEvent.delay.id &&
|
|
123
|
-
context.event.insert_id === incomingEvent.insert_id) {
|
|
124
|
-
if (_this.inFlightDelayedEvents[incomingEvent.delay.id]) {
|
|
125
|
-
incomingEvent.delay.isFresh = true;
|
|
126
|
-
return true;
|
|
127
|
-
}
|
|
128
|
-
context.callback(buildResult(context.event, 0, 'Stale event overwritten'));
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
return true;
|
|
132
|
-
});
|
|
133
|
-
/* istanbul ignore next */
|
|
134
|
-
}
|
|
135
|
-
catch (e) {
|
|
136
|
-
// swallow error
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
100
|
Destination.prototype.removeEventsExceedFlushMaxRetries = function (list) {
|
|
140
101
|
var _this = this;
|
|
141
102
|
return list.filter(function (context) {
|
|
@@ -186,7 +147,7 @@ var Destination = /** @class */ (function () {
|
|
|
186
147
|
Destination.prototype.flush = function (useRetry) {
|
|
187
148
|
if (useRetry === void 0) { useRetry = false; }
|
|
188
149
|
return __awaiter(this, void 0, void 0, function () {
|
|
189
|
-
var list,
|
|
150
|
+
var list, later, batches;
|
|
190
151
|
var _this = this;
|
|
191
152
|
return __generator(this, function (_a) {
|
|
192
153
|
switch (_a.label) {
|
|
@@ -205,40 +166,25 @@ var Destination = /** @class */ (function () {
|
|
|
205
166
|
this.flushId = this.scheduleId;
|
|
206
167
|
this.resetSchedule();
|
|
207
168
|
list = [];
|
|
208
|
-
delayed = {};
|
|
209
169
|
later = [];
|
|
210
|
-
this.queue.forEach(function (context) {
|
|
211
|
-
var _a;
|
|
212
|
-
if (context.timeout !== 0) {
|
|
213
|
-
later.push(context);
|
|
214
|
-
}
|
|
215
|
-
else if ((_a = context.event.delay) === null || _a === void 0 ? void 0 : _a.id) {
|
|
216
|
-
var delay = context.event.delay;
|
|
217
|
-
delayed[delay.id] = delayed[delay.id] || [];
|
|
218
|
-
delayed[delay.id].push(context);
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
list.push(context);
|
|
222
|
-
}
|
|
223
|
-
});
|
|
170
|
+
this.queue.forEach(function (context) { return (context.timeout === 0 ? list.push(context) : later.push(context)); });
|
|
224
171
|
batches = chunk(list, this.config.flushQueueSize);
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
eventPromises.push(this.sendDelayedEvents(delayed, useRetry));
|
|
239
|
-
}
|
|
240
|
-
return [4 /*yield*/, Promise.all(eventPromises)];
|
|
172
|
+
// Promise.all() doesn't guarantee resolve order.
|
|
173
|
+
// Sequentially resolve to make sure backend receives events in order
|
|
174
|
+
return [4 /*yield*/, batches.reduce(function (promise, batch) { return __awaiter(_this, void 0, void 0, function () {
|
|
175
|
+
return __generator(this, function (_a) {
|
|
176
|
+
switch (_a.label) {
|
|
177
|
+
case 0: return [4 /*yield*/, promise];
|
|
178
|
+
case 1:
|
|
179
|
+
_a.sent();
|
|
180
|
+
return [4 /*yield*/, this.send(batch, useRetry)];
|
|
181
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}); }, Promise.resolve())];
|
|
241
185
|
case 1:
|
|
186
|
+
// Promise.all() doesn't guarantee resolve order.
|
|
187
|
+
// Sequentially resolve to make sure backend receives events in order
|
|
242
188
|
_a.sent();
|
|
243
189
|
// Mark current flush is done
|
|
244
190
|
this.flushId = null;
|
|
@@ -248,77 +194,11 @@ var Destination = /** @class */ (function () {
|
|
|
248
194
|
});
|
|
249
195
|
});
|
|
250
196
|
};
|
|
251
|
-
Destination.prototype.
|
|
252
|
-
var e_1, _a;
|
|
253
|
-
var _this = this;
|
|
254
|
-
var eventPromises = [];
|
|
255
|
-
try {
|
|
256
|
-
var _loop_1 = function (delayId, contexts) {
|
|
257
|
-
this_1.inFlightDelayedEvents[delayId] = true;
|
|
258
|
-
var delayedEventsSend = this_1.send(contexts, useRetry, true);
|
|
259
|
-
eventPromises.push(delayedEventsSend);
|
|
260
|
-
delayedEventsSend.finally(function () {
|
|
261
|
-
delete _this.inFlightDelayedEvents[delayId];
|
|
262
|
-
});
|
|
263
|
-
};
|
|
264
|
-
var this_1 = this;
|
|
265
|
-
try {
|
|
266
|
-
for (var _b = __values(Object.entries(delayed)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
267
|
-
var _d = __read(_c.value, 2), delayId = _d[0], contexts = _d[1];
|
|
268
|
-
_loop_1(delayId, contexts);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
272
|
-
finally {
|
|
273
|
-
try {
|
|
274
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
275
|
-
}
|
|
276
|
-
finally { if (e_1) throw e_1.error; }
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
catch (e) {
|
|
280
|
-
// swallow error
|
|
281
|
-
}
|
|
282
|
-
return eventPromises.reduce(function (promise, batch) { return __awaiter(_this, void 0, void 0, function () {
|
|
283
|
-
return __generator(this, function (_a) {
|
|
284
|
-
switch (_a.label) {
|
|
285
|
-
case 0: return [4 /*yield*/, promise];
|
|
286
|
-
case 1:
|
|
287
|
-
_a.sent();
|
|
288
|
-
return [4 /*yield*/, batch];
|
|
289
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
}); }, Promise.resolve());
|
|
293
|
-
};
|
|
294
|
-
Destination.prototype.translatePayloadToDelayedPayload = function (payload, list) {
|
|
295
|
-
var _a, _b;
|
|
296
|
-
var delayedEvents = [];
|
|
297
|
-
var instantEvents = [];
|
|
298
|
-
var delayedContexts = [];
|
|
299
|
-
var instantContexts = [];
|
|
300
|
-
list.forEach(function (context, index) {
|
|
301
|
-
if (context.event.delay.timeout) {
|
|
302
|
-
delayedEvents.push(payload.events[index]);
|
|
303
|
-
delayedContexts.push(context);
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
instantEvents.push(payload.events[index]);
|
|
307
|
-
instantContexts.push(context);
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
list.splice.apply(list, __spreadArray(__spreadArray([0, list.length], __read(delayedContexts), false), __read(instantContexts), false));
|
|
311
|
-
/* istanbul ignore next */
|
|
312
|
-
payload.timeout = (_b = (_a = delayedContexts[0]) === null || _a === void 0 ? void 0 : _a.event.delay.timeout) !== null && _b !== void 0 ? _b : 0;
|
|
313
|
-
payload.id = list[0].event.delay.id;
|
|
314
|
-
payload.events = delayedEvents;
|
|
315
|
-
payload.instant_events = instantEvents;
|
|
316
|
-
};
|
|
317
|
-
Destination.prototype.send = function (list, useRetry, delay) {
|
|
197
|
+
Destination.prototype.send = function (list, useRetry) {
|
|
318
198
|
var _a;
|
|
319
199
|
if (useRetry === void 0) { useRetry = true; }
|
|
320
200
|
return __awaiter(this, void 0, void 0, function () {
|
|
321
|
-
var payload, serverUrl, shouldCompressUploadBody, res,
|
|
201
|
+
var payload, serverUrl, shouldCompressUploadBody, res, e_1, errorMessage;
|
|
322
202
|
return __generator(this, function (_b) {
|
|
323
203
|
switch (_b.label) {
|
|
324
204
|
case 0:
|
|
@@ -329,28 +209,21 @@ var Destination = /** @class */ (function () {
|
|
|
329
209
|
api_key: this.config.apiKey,
|
|
330
210
|
events: list.map(function (context) {
|
|
331
211
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
332
|
-
var _a = context.event, extra = _a.extra,
|
|
212
|
+
var _a = context.event, extra = _a.extra, eventWithoutExtra = __rest(_a, ["extra"]);
|
|
333
213
|
return eventWithoutExtra;
|
|
334
214
|
}),
|
|
335
215
|
options: {
|
|
336
216
|
min_id_length: this.config.minIdLength,
|
|
337
217
|
},
|
|
338
218
|
client_upload_time: new Date().toISOString(),
|
|
339
|
-
request_metadata:
|
|
219
|
+
request_metadata: this.config.requestMetadata,
|
|
340
220
|
};
|
|
341
|
-
|
|
342
|
-
this.config.requestMetadata = new RequestMetadata();
|
|
343
|
-
}
|
|
221
|
+
this.config.requestMetadata = new RequestMetadata();
|
|
344
222
|
_b.label = 1;
|
|
345
223
|
case 1:
|
|
346
224
|
_b.trys.push([1, 3, , 4]);
|
|
347
225
|
serverUrl = createServerConfig(this.config.serverUrl, this.config.serverZone, this.config.useBatch).serverUrl;
|
|
348
226
|
shouldCompressUploadBody = shouldCompressUploadBodyForRequest(serverUrl, this.config.enableRequestBodyCompression);
|
|
349
|
-
if (delay) {
|
|
350
|
-
serverUrl = this.config.delayedEventsServerUrl || "".concat(serverUrl, "/delayed");
|
|
351
|
-
this.translatePayloadToDelayedPayload(payload, list);
|
|
352
|
-
shouldCompressUploadBody = false; // delayed events doesn't support compression
|
|
353
|
-
}
|
|
354
227
|
return [4 /*yield*/, this.config.transportProvider.send(serverUrl, payload, shouldCompressUploadBody)];
|
|
355
228
|
case 2:
|
|
356
229
|
res = _b.sent();
|
|
@@ -370,8 +243,8 @@ var Destination = /** @class */ (function () {
|
|
|
370
243
|
this.handleResponse(res, list);
|
|
371
244
|
return [3 /*break*/, 4];
|
|
372
245
|
case 3:
|
|
373
|
-
|
|
374
|
-
errorMessage = getErrorMessage(
|
|
246
|
+
e_1 = _b.sent();
|
|
247
|
+
errorMessage = getErrorMessage(e_1);
|
|
375
248
|
this.config.loggerProvider.error(errorMessage);
|
|
376
249
|
(_a = this.diagnosticsClient) === null || _a === void 0 ? void 0 : _a.recordEvent('analytics.events.unsuccessful.from.catch.error', {
|
|
377
250
|
events: list.map(function (context) { return context.event.event_type; }),
|
|
@@ -529,16 +402,7 @@ var Destination = /** @class */ (function () {
|
|
|
529
402
|
* This is called on response comes back for a request
|
|
530
403
|
*/
|
|
531
404
|
Destination.prototype.removeEvents = function (eventsToRemove) {
|
|
532
|
-
|
|
533
|
-
this.queue = this.queue.filter(function (queuedContext) {
|
|
534
|
-
return !eventsToRemove.some(function (context) { var _a; return context.event.insert_id === queuedContext.event.insert_id && !((_a = queuedContext.event.delay) === null || _a === void 0 ? void 0 : _a.isFresh); });
|
|
535
|
-
});
|
|
536
|
-
this.queue.forEach(function (context) {
|
|
537
|
-
var _a;
|
|
538
|
-
if (((_a = context.event.delay) === null || _a === void 0 ? void 0 : _a.isFresh) && insertIdsBeingRemoved.has(context.event.insert_id)) {
|
|
539
|
-
delete context.event.delay.isFresh;
|
|
540
|
-
}
|
|
541
|
-
});
|
|
405
|
+
this.queue = this.queue.filter(function (queuedContext) { return !eventsToRemove.some(function (context) { return context.event.insert_id === queuedContext.event.insert_id; }); });
|
|
542
406
|
this.saveEvents();
|
|
543
407
|
};
|
|
544
408
|
return Destination;
|