@amplitude/analytics-core 2.32.1 → 2.33.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 +1 -1
- package/lib/cjs/config.d.ts.map +1 -1
- package/lib/cjs/config.js.map +1 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +6 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/plugins/destination.d.ts.map +1 -1
- package/lib/cjs/plugins/destination.js +14 -6
- package/lib/cjs/plugins/destination.js.map +1 -1
- package/lib/cjs/types/element-interactions.d.ts +6 -2
- package/lib/cjs/types/element-interactions.d.ts.map +1 -1
- package/lib/cjs/types/element-interactions.js.map +1 -1
- package/lib/cjs/utils/observable.d.ts +24 -0
- package/lib/cjs/utils/observable.d.ts.map +1 -0
- package/lib/cjs/utils/observable.js +183 -0
- package/lib/cjs/utils/observable.js.map +1 -0
- package/lib/esm/config.d.ts +1 -1
- package/lib/esm/config.d.ts.map +1 -1
- package/lib/esm/config.js.map +1 -1
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/plugins/destination.d.ts.map +1 -1
- package/lib/esm/plugins/destination.js +14 -6
- package/lib/esm/plugins/destination.js.map +1 -1
- package/lib/esm/types/element-interactions.d.ts +6 -2
- package/lib/esm/types/element-interactions.d.ts.map +1 -1
- package/lib/esm/types/element-interactions.js.map +1 -1
- package/lib/esm/utils/observable.d.ts +24 -0
- package/lib/esm/utils/observable.d.ts.map +1 -0
- package/lib/esm/utils/observable.js +177 -0
- package/lib/esm/utils/observable.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { Observable } from 'zen-observable-ts';
|
|
2
|
+
import { Observable as ZenObservable } from 'zen-observable-ts';
|
|
3
|
+
/**
|
|
4
|
+
* asyncMap operator for Zen Observable
|
|
5
|
+
*
|
|
6
|
+
* Maps each value emitted by the source Observable using an async function,
|
|
7
|
+
* emitting the resolved values in the same order they arrive.
|
|
8
|
+
*/
|
|
9
|
+
declare function asyncMap<T, R>(observable: ZenObservable<T>, fn: (value: T) => Promise<R>): ZenObservable<R>;
|
|
10
|
+
type Unsubscribable = {
|
|
11
|
+
unsubscribe: () => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* merge operator for Zen Observable
|
|
15
|
+
*
|
|
16
|
+
* Merges two observables into a single observable, emitting values from both sources in the order they arrive.
|
|
17
|
+
* @param sourceA Observable to merge
|
|
18
|
+
* @param sourceB Observable to merge
|
|
19
|
+
* @returns Unsubscribable cleanup function
|
|
20
|
+
*/
|
|
21
|
+
declare function merge<A, B>(sourceA: ZenObservable<A>, sourceB: ZenObservable<B>): ZenObservable<A | B>;
|
|
22
|
+
declare function multicast<T>(source: ZenObservable<T>): ZenObservable<T>;
|
|
23
|
+
export { asyncMap, multicast, merge, Unsubscribable };
|
|
24
|
+
//# sourceMappingURL=observable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observable.d.ts","sourceRoot":"","sources":["../../../src/utils/observable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,UAAU,IAAI,aAAa,EAA0B,MAAM,mBAAmB,CAAC;AAExF;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAoBpG;AAED,KAAK,cAAc,GAAG;IACpB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,iBAAS,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAgD/F;AAGD,iBAAS,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAkDhE;AAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { __values } from "tslib";
|
|
2
|
+
export { Observable } from 'zen-observable-ts';
|
|
3
|
+
import { Observable as ZenObservable } from 'zen-observable-ts';
|
|
4
|
+
/**
|
|
5
|
+
* asyncMap operator for Zen Observable
|
|
6
|
+
*
|
|
7
|
+
* Maps each value emitted by the source Observable using an async function,
|
|
8
|
+
* emitting the resolved values in the same order they arrive.
|
|
9
|
+
*/
|
|
10
|
+
function asyncMap(observable, fn) {
|
|
11
|
+
return new ZenObservable(function (observer) {
|
|
12
|
+
observable.subscribe({
|
|
13
|
+
next: function (value) {
|
|
14
|
+
fn(value)
|
|
15
|
+
.then(function (result) {
|
|
16
|
+
return observer.next(result);
|
|
17
|
+
})
|
|
18
|
+
.catch(function (error) { return observer.error(error); });
|
|
19
|
+
},
|
|
20
|
+
error: function (error) {
|
|
21
|
+
observer.error(error);
|
|
22
|
+
},
|
|
23
|
+
complete: function () {
|
|
24
|
+
observer.complete();
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* merge operator for Zen Observable
|
|
31
|
+
*
|
|
32
|
+
* Merges two observables into a single observable, emitting values from both sources in the order they arrive.
|
|
33
|
+
* @param sourceA Observable to merge
|
|
34
|
+
* @param sourceB Observable to merge
|
|
35
|
+
* @returns Unsubscribable cleanup function
|
|
36
|
+
*/
|
|
37
|
+
function merge(sourceA, sourceB) {
|
|
38
|
+
return new ZenObservable(function (observer) {
|
|
39
|
+
var closed = false;
|
|
40
|
+
var subscriptions = new Set();
|
|
41
|
+
var cleanup = function () {
|
|
42
|
+
var e_1, _a;
|
|
43
|
+
closed = true;
|
|
44
|
+
try {
|
|
45
|
+
for (var subscriptions_1 = __values(subscriptions), subscriptions_1_1 = subscriptions_1.next(); !subscriptions_1_1.done; subscriptions_1_1 = subscriptions_1.next()) {
|
|
46
|
+
var sub = subscriptions_1_1.value;
|
|
47
|
+
try {
|
|
48
|
+
sub.unsubscribe();
|
|
49
|
+
}
|
|
50
|
+
catch (_b) {
|
|
51
|
+
/* do nothing */
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
56
|
+
finally {
|
|
57
|
+
try {
|
|
58
|
+
if (subscriptions_1_1 && !subscriptions_1_1.done && (_a = subscriptions_1.return)) _a.call(subscriptions_1);
|
|
59
|
+
}
|
|
60
|
+
finally { if (e_1) throw e_1.error; }
|
|
61
|
+
}
|
|
62
|
+
subscriptions.clear();
|
|
63
|
+
};
|
|
64
|
+
var subscribeTo = function (source) {
|
|
65
|
+
var sub = source.subscribe({
|
|
66
|
+
next: function (value) {
|
|
67
|
+
if (!closed)
|
|
68
|
+
observer.next(value);
|
|
69
|
+
},
|
|
70
|
+
error: function (err) {
|
|
71
|
+
if (!closed) {
|
|
72
|
+
closed = true;
|
|
73
|
+
observer.error(err);
|
|
74
|
+
cleanup();
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
complete: function () {
|
|
78
|
+
subscriptions.delete(sub);
|
|
79
|
+
if (!closed && subscriptions.size === 0) {
|
|
80
|
+
observer.complete();
|
|
81
|
+
cleanup();
|
|
82
|
+
closed = true;
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
subscriptions.add(sub);
|
|
87
|
+
};
|
|
88
|
+
subscribeTo(sourceA);
|
|
89
|
+
subscribeTo(sourceB);
|
|
90
|
+
return cleanup;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
// function share() {
|
|
94
|
+
function multicast(source) {
|
|
95
|
+
var observers = new Set();
|
|
96
|
+
var subscription = null;
|
|
97
|
+
function cleanup() {
|
|
98
|
+
/* istanbul ignore next */
|
|
99
|
+
subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();
|
|
100
|
+
subscription = null;
|
|
101
|
+
observers.clear();
|
|
102
|
+
}
|
|
103
|
+
return new ZenObservable(function (observer) {
|
|
104
|
+
observers.add(observer);
|
|
105
|
+
if (subscription === null) {
|
|
106
|
+
subscription = source.subscribe({
|
|
107
|
+
next: function (value) {
|
|
108
|
+
var e_2, _a;
|
|
109
|
+
var _b;
|
|
110
|
+
try {
|
|
111
|
+
for (var observers_1 = __values(observers), observers_1_1 = observers_1.next(); !observers_1_1.done; observers_1_1 = observers_1.next()) {
|
|
112
|
+
var obs = observers_1_1.value;
|
|
113
|
+
/* istanbul ignore next */
|
|
114
|
+
(_b = obs.next) === null || _b === void 0 ? void 0 : _b.call(obs, value);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
118
|
+
finally {
|
|
119
|
+
try {
|
|
120
|
+
if (observers_1_1 && !observers_1_1.done && (_a = observers_1.return)) _a.call(observers_1);
|
|
121
|
+
}
|
|
122
|
+
finally { if (e_2) throw e_2.error; }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
error: function (err) {
|
|
126
|
+
var e_3, _a;
|
|
127
|
+
var _b;
|
|
128
|
+
try {
|
|
129
|
+
for (var observers_2 = __values(observers), observers_2_1 = observers_2.next(); !observers_2_1.done; observers_2_1 = observers_2.next()) {
|
|
130
|
+
var obs = observers_2_1.value;
|
|
131
|
+
/* istanbul ignore next */
|
|
132
|
+
(_b = obs.error) === null || _b === void 0 ? void 0 : _b.call(obs, err);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
136
|
+
finally {
|
|
137
|
+
try {
|
|
138
|
+
if (observers_2_1 && !observers_2_1.done && (_a = observers_2.return)) _a.call(observers_2);
|
|
139
|
+
}
|
|
140
|
+
finally { if (e_3) throw e_3.error; }
|
|
141
|
+
}
|
|
142
|
+
cleanup();
|
|
143
|
+
},
|
|
144
|
+
complete: function () {
|
|
145
|
+
var e_4, _a;
|
|
146
|
+
var _b;
|
|
147
|
+
try {
|
|
148
|
+
for (var observers_3 = __values(observers), observers_3_1 = observers_3.next(); !observers_3_1.done; observers_3_1 = observers_3.next()) {
|
|
149
|
+
var obs = observers_3_1.value;
|
|
150
|
+
/* istanbul ignore next */
|
|
151
|
+
(_b = obs.complete) === null || _b === void 0 ? void 0 : _b.call(obs);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
155
|
+
finally {
|
|
156
|
+
try {
|
|
157
|
+
if (observers_3_1 && !observers_3_1.done && (_a = observers_3.return)) _a.call(observers_3);
|
|
158
|
+
}
|
|
159
|
+
finally { if (e_4) throw e_4.error; }
|
|
160
|
+
}
|
|
161
|
+
cleanup();
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
// Return unsubscribe function for this observer
|
|
166
|
+
return function () {
|
|
167
|
+
observers.delete(observer);
|
|
168
|
+
// If no observers left, unsubscribe from the source
|
|
169
|
+
if (observers.size === 0 && subscription) {
|
|
170
|
+
subscription.unsubscribe();
|
|
171
|
+
subscription = null;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
export { asyncMap, multicast, merge };
|
|
177
|
+
//# sourceMappingURL=observable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observable.js","sourceRoot":"","sources":["../../../src/utils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,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAExB,IAAI,YAAY,KAAK,IAAI,EAAE;YACzB,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC;gBAC9B,IAAI,YAAC,KAAK;;;;wBACR,KAAkB,IAAA,cAAA,SAAA,SAAS,CAAA,oCAAA,2DAAE;4BAAxB,IAAM,GAAG,sBAAA;4BACZ,0BAA0B;4BAC1B,MAAA,GAAG,CAAC,IAAI,oDAAG,KAAK,CAAC,CAAC;yBACnB;;;;;;;;;gBACH,CAAC;gBACD,KAAK,YAAC,GAAG;;;;wBACP,KAAkB,IAAA,cAAA,SAAA,SAAS,CAAA,oCAAA,2DAAE;4BAAxB,IAAM,GAAG,sBAAA;4BACZ,0BAA0B;4BAC1B,MAAA,GAAG,CAAC,KAAK,oDAAG,GAAG,CAAC,CAAC;yBAClB;;;;;;;;;oBACD,OAAO,EAAE,CAAC;gBACZ,CAAC;gBACD,QAAQ;;;;wBACN,KAAkB,IAAA,cAAA,SAAA,SAAS,CAAA,oCAAA,2DAAE;4BAAxB,IAAM,GAAG,sBAAA;4BACZ,0BAA0B;4BAC1B,MAAA,GAAG,CAAC,QAAQ,mDAAI,CAAC;yBAClB;;;;;;;;;oBACD,OAAO,EAAE,CAAC;gBACZ,CAAC;aACF,CAAC,CAAC;SACJ;QAED,gDAAgD;QAChD,OAAO;YACL,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAE3B,oDAAoD;YACpD,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,IAAI,YAAY,EAAE;gBACxC,YAAY,CAAC,WAAW,EAAE,CAAC;gBAC3B,YAAY,GAAG,IAAI,CAAC;aACrB;QACH,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAkB,CAAC","sourcesContent":["export { Observable } from 'zen-observable-ts';\n\nimport { Observable as ZenObservable, Observer, Subscription } from 'zen-observable-ts';\n\n/**\n * asyncMap operator for Zen Observable\n *\n * Maps each value emitted by the source Observable using an async function,\n * emitting the resolved values in the same order they arrive.\n */\nfunction asyncMap<T, R>(observable: ZenObservable<T>, fn: (value: T) => Promise<R>): ZenObservable<R> {\n return new ZenObservable(\n (observer: { next: (value: R) => void; error: (error: any) => void; complete: () => void }) => {\n observable.subscribe({\n next: (value: T) => {\n fn(value)\n .then((result: R) => {\n return observer.next(result);\n })\n .catch((error: any) => observer.error(error));\n },\n error: (error: any) => {\n observer.error(error);\n },\n complete: () => {\n observer.complete();\n },\n });\n },\n );\n}\n\ntype Unsubscribable = {\n unsubscribe: () => void;\n};\n\n/**\n * merge operator for Zen Observable\n *\n * Merges two observables into a single observable, emitting values from both sources in the order they arrive.\n * @param sourceA Observable to merge\n * @param sourceB Observable to merge\n * @returns Unsubscribable cleanup function\n */\nfunction merge<A, B>(sourceA: ZenObservable<A>, sourceB: ZenObservable<B>): ZenObservable<A | B> {\n return new ZenObservable<A | B>((observer) => {\n let closed = false;\n\n const subscriptions: Set<Unsubscribable> = new Set();\n\n const cleanup = (): void => {\n closed = true;\n for (const sub of subscriptions) {\n try {\n sub.unsubscribe();\n } catch {\n /* do nothing */\n }\n }\n subscriptions.clear();\n };\n\n const subscribeTo = <T>(source: ZenObservable<T>) => {\n const sub = source.subscribe({\n next(value: T) {\n if (!closed) observer.next(value as A | B);\n },\n error(err) {\n if (!closed) {\n closed = true;\n observer.error(err);\n cleanup();\n }\n },\n complete() {\n subscriptions.delete(sub);\n if (!closed && subscriptions.size === 0) {\n observer.complete();\n cleanup();\n closed = true;\n }\n },\n });\n\n subscriptions.add(sub);\n };\n\n subscribeTo(sourceA);\n subscribeTo(sourceB);\n\n return cleanup;\n });\n}\n\n// function share() {\nfunction multicast<T>(source: ZenObservable<T>): ZenObservable<T> {\n const observers: Set<Observer<T>> = new Set();\n let subscription: Subscription | null = null;\n\n function cleanup() {\n /* istanbul ignore next */\n subscription?.unsubscribe();\n subscription = null;\n observers.clear();\n }\n\n return new ZenObservable<T>((observer) => {\n observers.add(observer);\n\n if (subscription === null) {\n subscription = source.subscribe({\n next(value) {\n for (const obs of observers) {\n /* istanbul ignore next */\n obs.next?.(value);\n }\n },\n error(err) {\n for (const obs of observers) {\n /* istanbul ignore next */\n obs.error?.(err);\n }\n cleanup();\n },\n complete() {\n for (const obs of observers) {\n /* istanbul ignore next */\n obs.complete?.();\n }\n cleanup();\n },\n });\n }\n\n // Return unsubscribe function for this observer\n return () => {\n observers.delete(observer);\n\n // If no observers left, unsubscribe from the source\n if (observers.size === 0 && subscription) {\n subscription.unsubscribe();\n subscription = null;\n }\n };\n });\n}\n\nexport { asyncMap, multicast, merge, Unsubscribable };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/analytics-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.33.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Amplitude Inc",
|
|
6
6
|
"homepage": "https://github.com/amplitude/Amplitude-TypeScript",
|
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@amplitude/analytics-connector": "^1.6.4",
|
|
40
|
-
"tslib": "^2.4.1"
|
|
40
|
+
"tslib": "^2.4.1",
|
|
41
|
+
"zen-observable-ts": "^1.1.0"
|
|
41
42
|
},
|
|
42
43
|
"files": [
|
|
43
44
|
"lib"
|
|
44
45
|
],
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "7c5687aa0e3527c3769a38858d887e51fdf85c06"
|
|
46
47
|
}
|