@intuitionrobotics/firebase 0.41.69 → 0.41.72
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/app-backend/FirebaseModule.js +46 -63
- package/app-backend/FirebaseModule.js.map +1 -1
- package/app-backend/auth/FirebaseBaseWrapper.d.ts +2 -2
- package/app-backend/auth/FirebaseBaseWrapper.js +8 -24
- package/app-backend/auth/FirebaseBaseWrapper.js.map +1 -1
- package/app-backend/auth/FirebaseSession_Admin.d.ts +4 -6
- package/app-backend/auth/FirebaseSession_Admin.js +21 -37
- package/app-backend/auth/FirebaseSession_Admin.js.map +1 -1
- package/app-backend/auth/firebase-session.d.ts +2 -7
- package/app-backend/auth/firebase-session.js +22 -42
- package/app-backend/auth/firebase-session.js.map +1 -1
- package/app-backend/database/DatabaseWrapper.d.ts +1 -1
- package/app-backend/database/DatabaseWrapper.js +91 -195
- package/app-backend/database/DatabaseWrapper.js.map +1 -1
- package/app-backend/firestore/FirestoreCollection.js +92 -216
- package/app-backend/firestore/FirestoreCollection.js.map +1 -1
- package/app-backend/firestore/FirestoreInterface.js +30 -34
- package/app-backend/firestore/FirestoreInterface.js.map +1 -1
- package/app-backend/firestore/FirestoreTransaction.js +125 -321
- package/app-backend/firestore/FirestoreTransaction.js.map +1 -1
- package/app-backend/firestore/FirestoreWrapper.d.ts +1 -1
- package/app-backend/firestore/FirestoreWrapper.js +25 -72
- package/app-backend/firestore/FirestoreWrapper.js.map +1 -1
- package/app-backend/functions/firebase-function.js +178 -327
- package/app-backend/functions/firebase-function.js.map +1 -1
- package/app-backend/push/PushMessagesWrapper.d.ts +1 -1
- package/app-backend/push/PushMessagesWrapper.js +31 -86
- package/app-backend/push/PushMessagesWrapper.js.map +1 -1
- package/app-backend/storage/StorageWrapper.d.ts +2 -2
- package/app-backend/storage/StorageWrapper.js +166 -347
- package/app-backend/storage/StorageWrapper.js.map +1 -1
- package/app-frontend/FirebaseModule.js +81 -169
- package/app-frontend/FirebaseModule.js.map +1 -1
- package/app-frontend/analytics/AnalyticsModule.js +17 -68
- package/app-frontend/analytics/AnalyticsModule.js.map +1 -1
- package/app-frontend/analytics/AnalyticsWrapper.js +17 -33
- package/app-frontend/analytics/AnalyticsWrapper.js.map +1 -1
- package/app-frontend/auth/FirebaseSession.js +33 -80
- package/app-frontend/auth/FirebaseSession.js.map +1 -1
- package/app-frontend/auth/SwFirebaseSession.js +11 -27
- package/app-frontend/auth/SwFirebaseSession.js.map +1 -1
- package/app-frontend/database/DatabaseWrapper.js +64 -148
- package/app-frontend/database/DatabaseWrapper.js.map +1 -1
- package/app-frontend/messaging/MessagingWrapper.js +16 -68
- package/app-frontend/messaging/MessagingWrapper.js.map +1 -1
- package/app-frontend/messaging/SwMessagingWrapper.js +11 -28
- package/app-frontend/messaging/SwMessagingWrapper.js.map +1 -1
- package/package.json +8 -8
|
@@ -16,19 +16,6 @@
|
|
|
16
16
|
* See the License for the specific language governing permissions and
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
|
-
var __extends = (this && this.__extends) || (function () {
|
|
20
|
-
var extendStatics = function (d, b) {
|
|
21
|
-
extendStatics = Object.setPrototypeOf ||
|
|
22
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
23
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
24
|
-
return extendStatics(d, b);
|
|
25
|
-
};
|
|
26
|
-
return function (d, b) {
|
|
27
|
-
extendStatics(d, b);
|
|
28
|
-
function __() { this.constructor = d; }
|
|
29
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
30
|
-
};
|
|
31
|
-
})();
|
|
32
19
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
20
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
21
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -38,178 +25,103 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
38
25
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
26
|
});
|
|
40
27
|
};
|
|
41
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
|
-
function step(op) {
|
|
46
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
-
while (_) try {
|
|
48
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
49
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
|
-
switch (op[0]) {
|
|
51
|
-
case 0: case 1: t = op; break;
|
|
52
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
53
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
54
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
55
|
-
default:
|
|
56
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
57
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
58
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
60
|
-
if (t[2]) _.ops.pop();
|
|
61
|
-
_.trys.pop(); continue;
|
|
62
|
-
}
|
|
63
|
-
op = body.call(thisArg, _);
|
|
64
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
65
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69
29
|
exports.FirebaseModule = exports.FirebaseModule_Class = void 0;
|
|
70
30
|
/**
|
|
71
31
|
* Created by tacb0ss on 25/08/2018.
|
|
72
32
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
case 2:
|
|
94
|
-
config = _b.sent();
|
|
95
|
-
// @ts-ignore
|
|
96
|
-
this.setConfig((_a = {}, _a[localSessionId] = config, _a));
|
|
97
|
-
return [2 /*return*/, config];
|
|
98
|
-
case 3:
|
|
99
|
-
e_1 = _b.sent();
|
|
100
|
-
throw new ts_common_1.ImplementationMissingException("Either specify configs for the 'FirebaseModule' or use SDK auto-configuration with firebase hosting");
|
|
101
|
-
case 4: return [2 /*return*/];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}); };
|
|
105
|
-
return _this;
|
|
33
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
34
|
+
const FirebaseSession_1 = require("./auth/FirebaseSession");
|
|
35
|
+
const SwFirebaseSession_1 = require("./auth/SwFirebaseSession");
|
|
36
|
+
const localSessionId = 'local';
|
|
37
|
+
class FirebaseModule_Class extends ts_common_1.Module {
|
|
38
|
+
constructor() {
|
|
39
|
+
super("firebase fe");
|
|
40
|
+
this.sessions = {};
|
|
41
|
+
this.fetchLocalConfig = () => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
const resp = yield fetch('/__/firebase/init.json');
|
|
44
|
+
const config = yield resp.json();
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
this.setConfig({ [localSessionId]: config });
|
|
47
|
+
return config;
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
throw new ts_common_1.ImplementationMissingException(`Either specify configs for the 'FirebaseModule' or use SDK auto-configuration with firebase hosting`);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
106
53
|
}
|
|
107
|
-
|
|
108
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (swSession)
|
|
115
|
-
return [2 /*return*/, swSession];
|
|
116
|
-
return [4 /*yield*/, this.createLocalSession()];
|
|
117
|
-
case 1:
|
|
118
|
-
localSession = _a.sent();
|
|
119
|
-
return [2 /*return*/, this.swSession = new SwFirebaseSession_1.SwFirebaseSession(localSessionId, localSession.app)];
|
|
120
|
-
}
|
|
121
|
-
});
|
|
54
|
+
createSwSession() {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const swSession = this.swSession;
|
|
57
|
+
if (swSession)
|
|
58
|
+
return swSession;
|
|
59
|
+
const localSession = yield this.createLocalSession();
|
|
60
|
+
return this.swSession = new SwFirebaseSession_1.SwFirebaseSession(localSessionId, localSession.app);
|
|
122
61
|
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
_a.label = 2;
|
|
139
|
-
case 2:
|
|
140
|
-
this.checkConfig(localConfig, localSessionId);
|
|
141
|
-
// I need to recheck because since it is an async op there might be race conditions
|
|
142
|
-
session = this.sessions[localSessionId];
|
|
143
|
-
if (session)
|
|
144
|
-
return [2 /*return*/, session];
|
|
145
|
-
return [2 /*return*/, this.initiateSession(localSessionId, localConfig, token)];
|
|
146
|
-
}
|
|
147
|
-
});
|
|
62
|
+
}
|
|
63
|
+
createLocalSession(token) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
let session = this.sessions[localSessionId];
|
|
66
|
+
if (session)
|
|
67
|
+
return session;
|
|
68
|
+
let localConfig = this.getProjectAuth(localSessionId);
|
|
69
|
+
if (!localConfig)
|
|
70
|
+
localConfig = yield this.fetchLocalConfig();
|
|
71
|
+
this.checkConfig(localConfig, localSessionId);
|
|
72
|
+
// I need to recheck because since it is an async op there might be race conditions
|
|
73
|
+
session = this.sessions[localSessionId];
|
|
74
|
+
if (session)
|
|
75
|
+
return session;
|
|
76
|
+
return this.initiateSession(localSessionId, localConfig, token);
|
|
148
77
|
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
session
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this.checkConfig(config, projectId);
|
|
164
|
-
return [2 /*return*/, this.initiateSession(projectId, config, token)];
|
|
165
|
-
});
|
|
78
|
+
}
|
|
79
|
+
createSession(projectId, token) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
if (!projectId)
|
|
82
|
+
return this.createLocalSession(token);
|
|
83
|
+
if (typeof projectId === "object")
|
|
84
|
+
return this.createSessionWithConfigs(projectId, token);
|
|
85
|
+
const session = this.sessions[projectId];
|
|
86
|
+
if (session)
|
|
87
|
+
return session;
|
|
88
|
+
this.logInfo(`Creating session for config: ${projectId}`);
|
|
89
|
+
const config = this.getProjectAuth(projectId);
|
|
90
|
+
this.checkConfig(config, projectId);
|
|
91
|
+
return this.initiateSession(projectId, config, token);
|
|
166
92
|
});
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
// @ts-ignore
|
|
177
|
-
this.setConfig((_a = {}, _a[projectId] = config, _a));
|
|
178
|
-
return [2 /*return*/, this.createSession(projectId, token)];
|
|
179
|
-
});
|
|
93
|
+
}
|
|
94
|
+
createSessionWithConfigs(config, token) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
if (!config || !config.projectId || !config.databaseURL || !config.authDomain || !config.apiKey)
|
|
97
|
+
throw new ts_common_1.BadImplementationException(`Config: ${ts_common_1.__stringify(config)} is not a credentials pattern`);
|
|
98
|
+
const projectId = config.projectId + (token || '');
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
this.setConfig({ [projectId]: config });
|
|
101
|
+
return this.createSession(projectId, token);
|
|
180
102
|
});
|
|
181
|
-
}
|
|
182
|
-
|
|
103
|
+
}
|
|
104
|
+
getProjectAuth(projectId) {
|
|
183
105
|
var _a;
|
|
184
106
|
return (_a = this.config) === null || _a === void 0 ? void 0 : _a[projectId];
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
session.connect();
|
|
195
|
-
if (!token) return [3 /*break*/, 2];
|
|
196
|
-
return [4 /*yield*/, session.signInWithToken(token)];
|
|
197
|
-
case 1:
|
|
198
|
-
_a.sent();
|
|
199
|
-
_a.label = 2;
|
|
200
|
-
case 2: return [2 /*return*/, session];
|
|
201
|
-
}
|
|
202
|
-
});
|
|
107
|
+
}
|
|
108
|
+
initiateSession(projectId, config, token) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const session = new FirebaseSession_1.FirebaseSession(projectId, config);
|
|
111
|
+
this.sessions[projectId] = session;
|
|
112
|
+
session.connect();
|
|
113
|
+
if (token)
|
|
114
|
+
yield session.signInWithToken(token);
|
|
115
|
+
return session;
|
|
203
116
|
});
|
|
204
|
-
}
|
|
205
|
-
|
|
117
|
+
}
|
|
118
|
+
checkConfig(config, projectId) {
|
|
206
119
|
if (!config)
|
|
207
120
|
throw new ts_common_1.BadImplementationException('Did you forget to add FirebaseModule to the main.ts in the modules array?');
|
|
208
121
|
if (!config || !config.projectId || !config.apiKey || !config.authDomain)
|
|
209
|
-
throw new ts_common_1.BadImplementationException(
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
}(ts_common_1.Module));
|
|
122
|
+
throw new ts_common_1.BadImplementationException(`Config for key ${projectId} is not an Admin credentials pattern`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
213
125
|
exports.FirebaseModule_Class = FirebaseModule_Class;
|
|
214
126
|
exports.FirebaseModule = new FirebaseModule_Class();
|
|
215
127
|
//# sourceMappingURL=FirebaseModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirebaseModule.js","sourceRoot":"","sources":["../../src/main/app-frontend/FirebaseModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG
|
|
1
|
+
{"version":3,"file":"FirebaseModule.js","sourceRoot":"","sources":["../../src/main/app-frontend/FirebaseModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH;;GAEG;AAEH,4DAKsC;AAEtC,4DAAuD;AACvD,gEAA2D;AAE3D,MAAM,cAAc,GAAG,OAAO,CAAC;AAM/B,MAAa,oBACZ,SAAQ,kBAAkB;IAK1B;QACC,KAAK,CAAC,aAAa,CAAC,CAAC;QAJd,aAAQ,GAA6C,EAAE,CAAC;QAqCxD,qBAAgB,GAAG,GAAS,EAAE;YACrC,IAAI;gBACH,MAAM,IAAI,GAAG,MAA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,CAAC,SAAiB,EAAE,MAAsB,EAAE,KAAc;;YACtF,MAAM,OAAO,GAAG,IAAI,iCAAe,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YACvD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;YAEnC,OAAO,CAAC,OAAO,EAAE,CAAC;YAElB,IAAI,KAAK;gBACR,MAAM,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAEtC,OAAO,OAAO,CAAC;QAChB,CAAC;KAAA;IAEO,WAAW,CAAC,MAAsB,EAAE,SAAiB;QAC5D,IAAI,CAAC,MAAM;YACV,MAAM,IAAI,sCAA0B,CAAC,2EAA2E,CAAC,CAAC;QAEnH,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU;YACvE,MAAM,IAAI,sCAA0B,CAAC,kBAAkB,SAAS,sCAAsC,CAAC,CAAC;IAE1G,CAAC;CACD;AA3GD,oDA2GC;AAEY,QAAA,cAAc,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -16,19 +16,6 @@
|
|
|
16
16
|
* See the License for the specific language governing permissions and
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
|
-
var __extends = (this && this.__extends) || (function () {
|
|
20
|
-
var extendStatics = function (d, b) {
|
|
21
|
-
extendStatics = Object.setPrototypeOf ||
|
|
22
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
23
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
24
|
-
return extendStatics(d, b);
|
|
25
|
-
};
|
|
26
|
-
return function (d, b) {
|
|
27
|
-
extendStatics(d, b);
|
|
28
|
-
function __() { this.constructor = d; }
|
|
29
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
30
|
-
};
|
|
31
|
-
})();
|
|
32
19
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
20
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
21
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -38,70 +25,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
38
25
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
26
|
});
|
|
40
27
|
};
|
|
41
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
|
-
function step(op) {
|
|
46
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
-
while (_) try {
|
|
48
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
49
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
|
-
switch (op[0]) {
|
|
51
|
-
case 0: case 1: t = op; break;
|
|
52
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
53
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
54
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
55
|
-
default:
|
|
56
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
57
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
58
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
60
|
-
if (t[2]) _.ops.pop();
|
|
61
|
-
_.trys.pop(); continue;
|
|
62
|
-
}
|
|
63
|
-
op = body.call(thisArg, _);
|
|
64
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
65
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69
29
|
exports.FirebaseAnalyticsModule = void 0;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
case 0: return [4 /*yield*/, FirebaseModule_1.FirebaseModule.createSession()];
|
|
81
|
-
case 1:
|
|
82
|
-
session = _a.sent();
|
|
83
|
-
this.analytics = session.getAnalytics();
|
|
84
|
-
this.analytics.setAnalyticsCollectionEnabled(true);
|
|
85
|
-
return [2 /*return*/];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}); };
|
|
89
|
-
return _this;
|
|
30
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
31
|
+
const FirebaseModule_1 = require("../FirebaseModule");
|
|
32
|
+
class FirebaseAnalyticsModule_Class extends ts_common_1.Module {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this._init = () => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const session = yield FirebaseModule_1.FirebaseModule.createSession();
|
|
37
|
+
this.analytics = session.getAnalytics();
|
|
38
|
+
this.analytics.setAnalyticsCollectionEnabled(true);
|
|
39
|
+
});
|
|
90
40
|
}
|
|
91
|
-
|
|
41
|
+
init() {
|
|
92
42
|
this.runAsync('Init Analytics', this._init);
|
|
93
|
-
}
|
|
94
|
-
|
|
43
|
+
}
|
|
44
|
+
logEvent(eventName, eventParams) {
|
|
95
45
|
if (!this.analytics)
|
|
96
46
|
throw new ts_common_1.ImplementationMissingException('Missing analytics wrapper');
|
|
97
47
|
return this.analytics.logEvent(eventName, eventParams);
|
|
98
|
-
}
|
|
99
|
-
|
|
48
|
+
}
|
|
49
|
+
setCurrentScreen(screenName) {
|
|
100
50
|
if (!this.analytics)
|
|
101
51
|
throw new ts_common_1.ImplementationMissingException('Missing analytics wrapper');
|
|
102
52
|
return this.analytics.setCurrentScreen(screenName);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
}(ts_common_1.Module));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
106
55
|
exports.FirebaseAnalyticsModule = new FirebaseAnalyticsModule_Class();
|
|
107
56
|
//# sourceMappingURL=AnalyticsModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/AnalyticsModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG
|
|
1
|
+
{"version":3,"file":"AnalyticsModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/AnalyticsModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH,4DAGsC;AACtC,sDAAiD;AAGjD,MAAM,6BACL,SAAQ,kBAAM;IADf;;QASS,UAAK,GAAG,GAAS,EAAE;YAC1B,MAAM,OAAO,GAAG,MAAM,+BAAc,CAAC,aAAa,EAAE,CAAC;YAErD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YACxC,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC;QACpD,CAAC,CAAA,CAAC;IAeH,CAAC;IAxBU,IAAI;QACb,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IASD,QAAQ,CAAC,SAAiB,EAAE,WAAoC;QAC/D,IAAI,CAAC,IAAI,CAAC,SAAS;YAClB,MAAM,IAAI,0CAA8B,CAAC,2BAA2B,CAAC,CAAC;QAEvE,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACxD,CAAC;IAED,gBAAgB,CAAC,UAAkB;QAClC,IAAI,CAAC,IAAI,CAAC,SAAS;YAClB,MAAM,IAAI,0CAA8B,CAAC,2BAA2B,CAAC,CAAC;QAEvE,OAAO,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACpD,CAAC;CACD;AAEY,QAAA,uBAAuB,GAAG,IAAI,6BAA6B,EAAE,CAAC"}
|
|
@@ -17,47 +17,31 @@
|
|
|
17
17
|
* See the License for the specific language governing permissions and
|
|
18
18
|
* limitations under the License.
|
|
19
19
|
*/
|
|
20
|
-
var __extends = (this && this.__extends) || (function () {
|
|
21
|
-
var extendStatics = function (d, b) {
|
|
22
|
-
extendStatics = Object.setPrototypeOf ||
|
|
23
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
24
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
25
|
-
return extendStatics(d, b);
|
|
26
|
-
};
|
|
27
|
-
return function (d, b) {
|
|
28
|
-
extendStatics(d, b);
|
|
29
|
-
function __() { this.constructor = d; }
|
|
30
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
33
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
21
|
exports.AnalyticsWrapper = void 0;
|
|
35
|
-
|
|
22
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
36
23
|
// tslint:disable:no-import-side-effect
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_this.analytics = analytics;
|
|
43
|
-
return _this;
|
|
24
|
+
const analytics_1 = require("firebase/analytics");
|
|
25
|
+
class AnalyticsWrapper extends ts_common_1.Logger {
|
|
26
|
+
constructor(analytics) {
|
|
27
|
+
super();
|
|
28
|
+
this.analytics = analytics;
|
|
44
29
|
}
|
|
45
|
-
|
|
30
|
+
setUserId(userId, options) {
|
|
46
31
|
analytics_1.setUserId(this.analytics, userId, options);
|
|
47
|
-
}
|
|
48
|
-
|
|
32
|
+
}
|
|
33
|
+
setCurrentScreen(screenName, options) {
|
|
49
34
|
analytics_1.setCurrentScreen(this.analytics, screenName, options);
|
|
50
|
-
}
|
|
51
|
-
|
|
35
|
+
}
|
|
36
|
+
setAnalyticsCollectionEnabled(enabled) {
|
|
52
37
|
analytics_1.setAnalyticsCollectionEnabled(this.analytics, enabled);
|
|
53
|
-
}
|
|
54
|
-
|
|
38
|
+
}
|
|
39
|
+
setUserProperties(properties, options) {
|
|
55
40
|
analytics_1.setUserProperties(this.analytics, properties);
|
|
56
|
-
}
|
|
57
|
-
|
|
41
|
+
}
|
|
42
|
+
logEvent(eventName, eventParams, options) {
|
|
58
43
|
return analytics_1.logEvent(this.analytics, eventName, eventParams, options);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
}(ts_common_1.Logger));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
62
46
|
exports.AnalyticsWrapper = AnalyticsWrapper;
|
|
63
47
|
//# sourceMappingURL=AnalyticsWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/AnalyticsWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG
|
|
1
|
+
{"version":3,"file":"AnalyticsWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/AnalyticsWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,4DAAoD;AAMpD,uCAAuC;AACvC,kDAO4B;AAE5B,MAAa,gBACZ,SAAQ,kBAAM;IAId,YAAY,SAAiC;QAC5C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,SAAS,CAAC,MAAc,EAAE,OAAkC;QAC3D,qBAAS,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,gBAAgB,CAAC,UAAkB,EAAE,OAAkC;QACtE,4BAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,6BAA6B,CAAC,OAAgB;QAC7C,yCAA6B,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED,iBAAiB,CAAC,UAAwB,EAAE,OAAkC;QAC7E,6BAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,QAAQ,CACP,SAAgD,EAChD,WAAoC,EACpC,OAAkC;QAElC,OAAO,oBAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CAED;AAlCD,4CAkCC"}
|