@amplitude/analytics-browser 2.0.0 → 2.1.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/README.md +1 -1
- package/lib/cjs/__mocks__/det-notification.d.ts +3 -0
- package/lib/cjs/__mocks__/det-notification.d.ts.map +1 -0
- package/lib/cjs/__mocks__/det-notification.js +7 -0
- package/lib/cjs/__mocks__/det-notification.js.map +1 -0
- package/lib/cjs/browser-client.d.ts.map +1 -1
- package/lib/cjs/browser-client.js +3 -0
- package/lib/cjs/browser-client.js.map +1 -1
- package/lib/cjs/config.d.ts +2 -1
- package/lib/cjs/config.d.ts.map +1 -1
- package/lib/cjs/config.js +3 -0
- package/lib/cjs/config.js.map +1 -1
- package/lib/cjs/det-notification.d.ts +8 -0
- package/lib/cjs/det-notification.d.ts.map +1 -0
- package/lib/cjs/det-notification.js +36 -0
- package/lib/cjs/det-notification.js.map +1 -0
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/storage/browser-storage.d.ts +12 -0
- package/lib/cjs/storage/browser-storage.d.ts.map +1 -0
- package/lib/cjs/storage/browser-storage.js +121 -0
- package/lib/cjs/storage/browser-storage.js.map +1 -0
- package/lib/cjs/storage/local-storage.d.ts +3 -8
- package/lib/cjs/storage/local-storage.d.ts.map +1 -1
- package/lib/cjs/storage/local-storage.js +6 -112
- package/lib/cjs/storage/local-storage.js.map +1 -1
- package/lib/cjs/storage/session-storage.d.ts +5 -0
- package/lib/cjs/storage/session-storage.d.ts.map +1 -0
- package/lib/cjs/storage/session-storage.js +15 -0
- package/lib/cjs/storage/session-storage.js.map +1 -0
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/__mocks__/det-notification.d.ts +3 -0
- package/lib/esm/__mocks__/det-notification.d.ts.map +1 -0
- package/lib/esm/__mocks__/det-notification.js +3 -0
- package/lib/esm/__mocks__/det-notification.js.map +1 -0
- package/lib/esm/browser-client.d.ts.map +1 -1
- package/lib/esm/browser-client.js +3 -0
- package/lib/esm/browser-client.js.map +1 -1
- package/lib/esm/config.d.ts +2 -1
- package/lib/esm/config.d.ts.map +1 -1
- package/lib/esm/config.js +3 -0
- package/lib/esm/config.js.map +1 -1
- package/lib/esm/det-notification.d.ts +8 -0
- package/lib/esm/det-notification.d.ts.map +1 -0
- package/lib/esm/det-notification.js +32 -0
- package/lib/esm/det-notification.js.map +1 -0
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/storage/browser-storage.d.ts +12 -0
- package/lib/esm/storage/browser-storage.d.ts.map +1 -0
- package/lib/esm/storage/browser-storage.js +119 -0
- package/lib/esm/storage/browser-storage.js.map +1 -0
- package/lib/esm/storage/local-storage.d.ts +3 -8
- package/lib/esm/storage/local-storage.d.ts.map +1 -1
- package/lib/esm/storage/local-storage.js +7 -113
- package/lib/esm/storage/local-storage.js.map +1 -1
- package/lib/esm/storage/session-storage.d.ts +5 -0
- package/lib/esm/storage/session-storage.d.ts.map +1 -0
- package/lib/esm/storage/session-storage.js +13 -0
- package/lib/esm/storage/session-storage.js.map +1 -0
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/__mocks__/det-notification.d.ts +3 -0
- package/lib/scripts/__mocks__/det-notification.d.ts.map +1 -0
- package/lib/scripts/amplitude-min.js +1 -1
- package/lib/scripts/amplitude-min.js.gz +0 -0
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/amplitude-snippet-instructions.html +1 -1
- package/lib/scripts/amplitude-snippet-min.js +1 -1
- package/lib/scripts/browser-client.d.ts.map +1 -1
- package/lib/scripts/config.d.ts +2 -1
- package/lib/scripts/config.d.ts.map +1 -1
- package/lib/scripts/det-notification.d.ts +8 -0
- package/lib/scripts/det-notification.d.ts.map +1 -0
- package/lib/scripts/index.d.ts +1 -1
- package/lib/scripts/index.d.ts.map +1 -1
- package/lib/scripts/storage/browser-storage.d.ts +12 -0
- package/lib/scripts/storage/browser-storage.d.ts.map +1 -0
- package/lib/scripts/storage/local-storage.d.ts +3 -8
- package/lib/scripts/storage/local-storage.d.ts.map +1 -1
- package/lib/scripts/storage/session-storage.d.ts +5 -0
- package/lib/scripts/storage/session-storage.d.ts.map +1 -0
- package/lib/scripts/version.d.ts +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
2
|
+
var BrowserStorage = /** @class */ (function () {
|
|
3
|
+
function BrowserStorage(storage) {
|
|
4
|
+
this.storage = storage;
|
|
5
|
+
}
|
|
6
|
+
BrowserStorage.prototype.isEnabled = function () {
|
|
7
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8
|
+
var random, testStorage, testKey, value, _a;
|
|
9
|
+
return __generator(this, function (_b) {
|
|
10
|
+
switch (_b.label) {
|
|
11
|
+
case 0:
|
|
12
|
+
/* istanbul ignore if */
|
|
13
|
+
if (!this.storage) {
|
|
14
|
+
return [2 /*return*/, false];
|
|
15
|
+
}
|
|
16
|
+
random = String(Date.now());
|
|
17
|
+
testStorage = new BrowserStorage(this.storage);
|
|
18
|
+
testKey = 'AMP_TEST';
|
|
19
|
+
_b.label = 1;
|
|
20
|
+
case 1:
|
|
21
|
+
_b.trys.push([1, 4, 5, 7]);
|
|
22
|
+
return [4 /*yield*/, testStorage.set(testKey, random)];
|
|
23
|
+
case 2:
|
|
24
|
+
_b.sent();
|
|
25
|
+
return [4 /*yield*/, testStorage.get(testKey)];
|
|
26
|
+
case 3:
|
|
27
|
+
value = _b.sent();
|
|
28
|
+
return [2 /*return*/, value === random];
|
|
29
|
+
case 4:
|
|
30
|
+
_a = _b.sent();
|
|
31
|
+
/* istanbul ignore next */
|
|
32
|
+
return [2 /*return*/, false];
|
|
33
|
+
case 5: return [4 /*yield*/, testStorage.remove(testKey)];
|
|
34
|
+
case 6:
|
|
35
|
+
_b.sent();
|
|
36
|
+
return [7 /*endfinally*/];
|
|
37
|
+
case 7: return [2 /*return*/];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
BrowserStorage.prototype.get = function (key) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
+
var value, _a;
|
|
45
|
+
return __generator(this, function (_b) {
|
|
46
|
+
switch (_b.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
_b.trys.push([0, 2, , 3]);
|
|
49
|
+
return [4 /*yield*/, this.getRaw(key)];
|
|
50
|
+
case 1:
|
|
51
|
+
value = _b.sent();
|
|
52
|
+
if (!value) {
|
|
53
|
+
return [2 /*return*/, undefined];
|
|
54
|
+
}
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
56
|
+
return [2 /*return*/, JSON.parse(value)];
|
|
57
|
+
case 2:
|
|
58
|
+
_a = _b.sent();
|
|
59
|
+
console.error("[Amplitude] Error: Could not get value from storage");
|
|
60
|
+
return [2 /*return*/, undefined];
|
|
61
|
+
case 3: return [2 /*return*/];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
BrowserStorage.prototype.getRaw = function (key) {
|
|
67
|
+
var _a;
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
return __generator(this, function (_b) {
|
|
70
|
+
return [2 /*return*/, ((_a = this.storage) === null || _a === void 0 ? void 0 : _a.getItem(key)) || undefined];
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
BrowserStorage.prototype.set = function (key, value) {
|
|
75
|
+
var _a;
|
|
76
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
+
return __generator(this, function (_b) {
|
|
78
|
+
try {
|
|
79
|
+
(_a = this.storage) === null || _a === void 0 ? void 0 : _a.setItem(key, JSON.stringify(value));
|
|
80
|
+
}
|
|
81
|
+
catch (_c) {
|
|
82
|
+
//
|
|
83
|
+
}
|
|
84
|
+
return [2 /*return*/];
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
BrowserStorage.prototype.remove = function (key) {
|
|
89
|
+
var _a;
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
return __generator(this, function (_b) {
|
|
92
|
+
try {
|
|
93
|
+
(_a = this.storage) === null || _a === void 0 ? void 0 : _a.removeItem(key);
|
|
94
|
+
}
|
|
95
|
+
catch (_c) {
|
|
96
|
+
//
|
|
97
|
+
}
|
|
98
|
+
return [2 /*return*/];
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
BrowserStorage.prototype.reset = function () {
|
|
103
|
+
var _a;
|
|
104
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
105
|
+
return __generator(this, function (_b) {
|
|
106
|
+
try {
|
|
107
|
+
(_a = this.storage) === null || _a === void 0 ? void 0 : _a.clear();
|
|
108
|
+
}
|
|
109
|
+
catch (_c) {
|
|
110
|
+
//
|
|
111
|
+
}
|
|
112
|
+
return [2 /*return*/];
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
return BrowserStorage;
|
|
117
|
+
}());
|
|
118
|
+
export { BrowserStorage };
|
|
119
|
+
//# sourceMappingURL=browser-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-storage.js","sourceRoot":"","sources":["../../../src/storage/browser-storage.ts"],"names":[],"mappings":";AAEA;IACE,wBAAoB,OAAiB;QAAjB,YAAO,GAAP,OAAO,CAAU;IAAG,CAAC;IAEnC,kCAAS,GAAf;;;;;;wBACE,wBAAwB;wBACxB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;4BACjB,sBAAO,KAAK,EAAC;yBACd;wBAEK,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;wBAC5B,WAAW,GAAG,IAAI,cAAc,CAAS,IAAI,CAAC,OAAO,CAAC,CAAC;wBACvD,OAAO,GAAG,UAAU,CAAC;;;;wBAEzB,qBAAM,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;;wBAAtC,SAAsC,CAAC;wBACzB,qBAAM,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAA;;wBAAtC,KAAK,GAAG,SAA8B;wBAC5C,sBAAO,KAAK,KAAK,MAAM,EAAC;;;wBAExB,0BAA0B;wBAC1B,sBAAO,KAAK,EAAC;4BAEb,qBAAM,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,EAAA;;wBAAjC,SAAiC,CAAC;;;;;;KAErC;IAEK,4BAAG,GAAT,UAAU,GAAW;;;;;;;wBAEH,qBAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAA;;wBAA9B,KAAK,GAAG,SAAsB;wBACpC,IAAI,CAAC,KAAK,EAAE;4BACV,sBAAO,SAAS,EAAC;yBAClB;wBACD,+DAA+D;wBAC/D,sBAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAC;;;wBAEzB,OAAO,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;wBACrE,sBAAO,SAAS,EAAC;;;;;KAEpB;IAEK,+BAAM,GAAZ,UAAa,GAAW;;;;gBACtB,sBAAO,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,CAAC,GAAG,CAAC,KAAI,SAAS,EAAC;;;KAChD;IAEK,4BAAG,GAAT,UAAU,GAAW,EAAE,KAAQ;;;;gBAC7B,IAAI;oBACF,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;iBACnD;gBAAC,WAAM;oBACN,EAAE;iBACH;;;;KACF;IAEK,+BAAM,GAAZ,UAAa,GAAW;;;;gBACtB,IAAI;oBACF,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAC,GAAG,CAAC,CAAC;iBAC/B;gBAAC,WAAM;oBACN,EAAE;iBACH;;;;KACF;IAEK,8BAAK,GAAX;;;;gBACE,IAAI;oBACF,MAAA,IAAI,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;iBACvB;gBAAC,WAAM;oBACN,EAAE;iBACH;;;;KACF;IACH,qBAAC;AAAD,CAAC,AAjED,IAiEC","sourcesContent":["import { Storage as AmplitudeStorage } from '@amplitude/analytics-types';\n\nexport class BrowserStorage<T> implements AmplitudeStorage<T> {\n constructor(private storage?: Storage) {}\n\n async isEnabled(): Promise<boolean> {\n /* istanbul ignore if */\n if (!this.storage) {\n return false;\n }\n\n const random = String(Date.now());\n const testStorage = new BrowserStorage<string>(this.storage);\n const testKey = 'AMP_TEST';\n try {\n await testStorage.set(testKey, random);\n const value = await testStorage.get(testKey);\n return value === random;\n } catch {\n /* istanbul ignore next */\n return false;\n } finally {\n await testStorage.remove(testKey);\n }\n }\n\n async get(key: string): Promise<T | undefined> {\n try {\n const value = await this.getRaw(key);\n if (!value) {\n return undefined;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return JSON.parse(value);\n } catch {\n console.error(`[Amplitude] Error: Could not get value from storage`);\n return undefined;\n }\n }\n\n async getRaw(key: string): Promise<string | undefined> {\n return this.storage?.getItem(key) || undefined;\n }\n\n async set(key: string, value: T): Promise<void> {\n try {\n this.storage?.setItem(key, JSON.stringify(value));\n } catch {\n //\n }\n }\n\n async remove(key: string): Promise<void> {\n try {\n this.storage?.removeItem(key);\n } catch {\n //\n }\n }\n\n async reset(): Promise<void> {\n try {\n this.storage?.clear();\n } catch {\n //\n }\n }\n}\n"]}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class LocalStorage<T>
|
|
3
|
-
|
|
4
|
-
get(key: string): Promise<T | undefined>;
|
|
5
|
-
getRaw(key: string): Promise<string | undefined>;
|
|
6
|
-
set(key: string, value: T): Promise<void>;
|
|
7
|
-
remove(key: string): Promise<void>;
|
|
8
|
-
reset(): Promise<void>;
|
|
1
|
+
import { BrowserStorage } from './browser-storage';
|
|
2
|
+
export declare class LocalStorage<T> extends BrowserStorage<T> {
|
|
3
|
+
constructor();
|
|
9
4
|
}
|
|
10
5
|
//# sourceMappingURL=local-storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../../src/storage/local-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../../src/storage/local-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qBAAa,YAAY,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;;CAIrD"}
|
|
@@ -1,119 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
2
|
import { getGlobalScope } from '@amplitude/analytics-client-common';
|
|
3
|
-
|
|
3
|
+
import { BrowserStorage } from './browser-storage';
|
|
4
|
+
var LocalStorage = /** @class */ (function (_super) {
|
|
5
|
+
__extends(LocalStorage, _super);
|
|
4
6
|
function LocalStorage() {
|
|
5
|
-
}
|
|
6
|
-
LocalStorage.prototype.isEnabled = function () {
|
|
7
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
8
|
-
var random, testStorage, testKey, value, _a;
|
|
9
|
-
return __generator(this, function (_b) {
|
|
10
|
-
switch (_b.label) {
|
|
11
|
-
case 0:
|
|
12
|
-
/* istanbul ignore if */
|
|
13
|
-
if (!getGlobalScope()) {
|
|
14
|
-
return [2 /*return*/, false];
|
|
15
|
-
}
|
|
16
|
-
random = String(Date.now());
|
|
17
|
-
testStorage = new LocalStorage();
|
|
18
|
-
testKey = 'AMP_TEST';
|
|
19
|
-
_b.label = 1;
|
|
20
|
-
case 1:
|
|
21
|
-
_b.trys.push([1, 4, 5, 7]);
|
|
22
|
-
return [4 /*yield*/, testStorage.set(testKey, random)];
|
|
23
|
-
case 2:
|
|
24
|
-
_b.sent();
|
|
25
|
-
return [4 /*yield*/, testStorage.get(testKey)];
|
|
26
|
-
case 3:
|
|
27
|
-
value = _b.sent();
|
|
28
|
-
return [2 /*return*/, value === random];
|
|
29
|
-
case 4:
|
|
30
|
-
_a = _b.sent();
|
|
31
|
-
/* istanbul ignore next */
|
|
32
|
-
return [2 /*return*/, false];
|
|
33
|
-
case 5: return [4 /*yield*/, testStorage.remove(testKey)];
|
|
34
|
-
case 6:
|
|
35
|
-
_b.sent();
|
|
36
|
-
return [7 /*endfinally*/];
|
|
37
|
-
case 7: return [2 /*return*/];
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
LocalStorage.prototype.get = function (key) {
|
|
43
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
-
var value, _a;
|
|
45
|
-
return __generator(this, function (_b) {
|
|
46
|
-
switch (_b.label) {
|
|
47
|
-
case 0:
|
|
48
|
-
_b.trys.push([0, 2, , 3]);
|
|
49
|
-
return [4 /*yield*/, this.getRaw(key)];
|
|
50
|
-
case 1:
|
|
51
|
-
value = _b.sent();
|
|
52
|
-
if (!value) {
|
|
53
|
-
return [2 /*return*/, undefined];
|
|
54
|
-
}
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
56
|
-
return [2 /*return*/, JSON.parse(value)];
|
|
57
|
-
case 2:
|
|
58
|
-
_a = _b.sent();
|
|
59
|
-
/* istanbul ignore next */
|
|
60
|
-
return [2 /*return*/, undefined];
|
|
61
|
-
case 3: return [2 /*return*/];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
LocalStorage.prototype.getRaw = function (key) {
|
|
67
|
-
var _a;
|
|
68
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
-
return __generator(this, function (_b) {
|
|
70
|
-
return [2 /*return*/, ((_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.getItem(key)) || undefined];
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
LocalStorage.prototype.set = function (key, value) {
|
|
75
|
-
var _a;
|
|
76
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
-
return __generator(this, function (_b) {
|
|
78
|
-
try {
|
|
79
|
-
(_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.setItem(key, JSON.stringify(value));
|
|
80
|
-
}
|
|
81
|
-
catch (_c) {
|
|
82
|
-
//
|
|
83
|
-
}
|
|
84
|
-
return [2 /*return*/];
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
LocalStorage.prototype.remove = function (key) {
|
|
89
7
|
var _a;
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
try {
|
|
93
|
-
(_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.removeItem(key);
|
|
94
|
-
}
|
|
95
|
-
catch (_c) {
|
|
96
|
-
//
|
|
97
|
-
}
|
|
98
|
-
return [2 /*return*/];
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
LocalStorage.prototype.reset = function () {
|
|
103
|
-
var _a;
|
|
104
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
105
|
-
return __generator(this, function (_b) {
|
|
106
|
-
try {
|
|
107
|
-
(_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.clear();
|
|
108
|
-
}
|
|
109
|
-
catch (_c) {
|
|
110
|
-
//
|
|
111
|
-
}
|
|
112
|
-
return [2 /*return*/];
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
};
|
|
8
|
+
return _super.call(this, (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage) || this;
|
|
9
|
+
}
|
|
116
10
|
return LocalStorage;
|
|
117
|
-
}());
|
|
11
|
+
}(BrowserStorage));
|
|
118
12
|
export { LocalStorage };
|
|
119
13
|
//# sourceMappingURL=local-storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage.js","sourceRoot":"","sources":["../../../src/storage/local-storage.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"local-storage.js","sourceRoot":"","sources":["../../../src/storage/local-storage.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;IAAqC,gCAAiB;IACpD;;eACE,kBAAM,MAAA,cAAc,EAAE,0CAAE,YAAY,CAAC;IACvC,CAAC;IACH,mBAAC;AAAD,CAAC,AAJD,CAAqC,cAAc,GAIlD","sourcesContent":["import { getGlobalScope } from '@amplitude/analytics-client-common';\nimport { BrowserStorage } from './browser-storage';\n\nexport class LocalStorage<T> extends BrowserStorage<T> {\n constructor() {\n super(getGlobalScope()?.localStorage);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-storage.d.ts","sourceRoot":"","sources":["../../../src/storage/session-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qBAAa,cAAc,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;;CAIvD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { getGlobalScope } from '@amplitude/analytics-client-common';
|
|
3
|
+
import { BrowserStorage } from './browser-storage';
|
|
4
|
+
var SessionStorage = /** @class */ (function (_super) {
|
|
5
|
+
__extends(SessionStorage, _super);
|
|
6
|
+
function SessionStorage() {
|
|
7
|
+
var _a;
|
|
8
|
+
return _super.call(this, (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.sessionStorage) || this;
|
|
9
|
+
}
|
|
10
|
+
return SessionStorage;
|
|
11
|
+
}(BrowserStorage));
|
|
12
|
+
export { SessionStorage };
|
|
13
|
+
//# sourceMappingURL=session-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-storage.js","sourceRoot":"","sources":["../../../src/storage/session-storage.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;IAAuC,kCAAiB;IACtD;;eACE,kBAAM,MAAA,cAAc,EAAE,0CAAE,cAAc,CAAC;IACzC,CAAC;IACH,qBAAC;AAAD,CAAC,AAJD,CAAuC,cAAc,GAIpD","sourcesContent":["import { getGlobalScope } from '@amplitude/analytics-client-common';\nimport { BrowserStorage } from './browser-storage';\n\nexport class SessionStorage<T> extends BrowserStorage<T> {\n constructor() {\n super(getGlobalScope()?.sessionStorage);\n }\n}\n"]}
|
package/lib/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var VERSION = '2.
|
|
1
|
+
export var VERSION = '2.1.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/lib/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '2.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '2.1.0';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"det-notification.d.ts","sourceRoot":"","sources":["../../../src/__mocks__/det-notification.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,iBAAkB,CAAC;AAEzC,eAAO,MAAM,WAAW,iBAAkB,CAAC"}
|