@intuitionrobotics/firebase 0.46.0 → 0.47.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/app-backend/FirebaseModule.d.ts +3 -3
- package/app-backend/FirebaseModule.js +9 -12
- package/app-backend/FirebaseModule.js.map +1 -1
- package/app-backend/auth/FirebaseBaseWrapper.d.ts +1 -1
- package/app-backend/auth/FirebaseBaseWrapper.js +19 -2
- package/app-backend/auth/FirebaseBaseWrapper.js.map +1 -1
- package/app-backend/auth/FirebaseSession_Admin.js +23 -6
- package/app-backend/auth/FirebaseSession_Admin.js.map +1 -1
- package/app-backend/auth/FirebaseSession_UserPassword.js.map +1 -1
- package/app-backend/auth/firebase-session.d.ts +3 -3
- package/app-backend/auth/firebase-session.js +19 -2
- package/app-backend/auth/firebase-session.js.map +1 -1
- package/app-backend/database/DatabaseWrapper.d.ts +3 -3
- package/app-backend/database/DatabaseWrapper.js +10 -11
- package/app-backend/database/DatabaseWrapper.js.map +1 -1
- package/app-backend/database/types.d.ts +3 -3
- package/app-backend/database/types.js +17 -0
- package/app-backend/database/types.js.map +1 -1
- package/app-backend/firestore/FirestoreCollection.d.ts +7 -5
- package/app-backend/firestore/FirestoreCollection.js +22 -7
- package/app-backend/firestore/FirestoreCollection.js.map +1 -1
- package/app-backend/firestore/FirestoreInterface.d.ts +1 -1
- package/app-backend/firestore/FirestoreInterface.js +25 -10
- package/app-backend/firestore/FirestoreInterface.js.map +1 -1
- package/app-backend/firestore/FirestoreTransaction.d.ts +1 -1
- package/app-backend/firestore/FirestoreTransaction.js +22 -6
- package/app-backend/firestore/FirestoreTransaction.js.map +1 -1
- package/app-backend/firestore/FirestoreV2Collection.d.ts +1 -1
- package/app-backend/firestore/FirestoreV2Collection.js +17 -0
- package/app-backend/firestore/FirestoreV2Collection.js.map +1 -1
- package/app-backend/firestore/FirestoreWrapper.js +2 -2
- package/app-backend/firestore/FirestoreWrapper.js.map +1 -1
- package/app-backend/firestore/types.d.ts +9 -9
- package/app-backend/firestore/types.js +17 -0
- package/app-backend/firestore/types.js.map +1 -1
- package/app-backend/functions/firebase-function.d.ts +18 -12
- package/app-backend/functions/firebase-function.js +78 -32
- 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 +18 -1
- package/app-backend/push/PushMessagesWrapper.js.map +1 -1
- package/app-backend/push/types.d.ts +8 -8
- package/app-backend/push/types.js +17 -0
- package/app-backend/push/types.js.map +1 -1
- package/app-backend/storage/StorageWrapper.js +25 -9
- package/app-backend/storage/StorageWrapper.js.map +1 -1
- package/app-backend/storage/types.d.ts +4 -4
- package/app-backend/storage/types.js +17 -0
- package/app-backend/storage/types.js.map +1 -1
- package/app-frontend/FirebaseModule.d.ts +3 -3
- package/app-frontend/FirebaseModule.js +5 -6
- package/app-frontend/FirebaseModule.js.map +1 -1
- package/app-frontend/analytics/AnalyticsModule.d.ts +1 -1
- package/app-frontend/analytics/AnalyticsModule.js +21 -5
- package/app-frontend/analytics/AnalyticsModule.js.map +1 -1
- package/app-frontend/analytics/AnalyticsWrapper.d.ts +1 -1
- package/app-frontend/analytics/AnalyticsWrapper.js +24 -6
- package/app-frontend/analytics/AnalyticsWrapper.js.map +1 -1
- package/app-frontend/analytics/types.d.ts +3 -3
- package/app-frontend/analytics/types.js +18 -0
- package/app-frontend/analytics/types.js.map +1 -1
- package/app-frontend/auth/FirebaseSession.d.ts +2 -2
- package/app-frontend/auth/FirebaseSession.js +11 -12
- package/app-frontend/auth/FirebaseSession.js.map +1 -1
- package/app-frontend/auth/SwFirebaseSession.d.ts +1 -1
- package/app-frontend/auth/SwFirebaseSession.js +4 -3
- package/app-frontend/auth/SwFirebaseSession.js.map +1 -1
- package/app-frontend/database/DatabaseWrapper.d.ts +1 -1
- package/app-frontend/database/DatabaseWrapper.js +33 -16
- package/app-frontend/database/DatabaseWrapper.js.map +1 -1
- package/app-frontend/database/types.d.ts +1 -1
- package/app-frontend/database/types.js +17 -0
- package/app-frontend/database/types.js.map +1 -1
- package/app-frontend/messaging/MessagingWrapper.d.ts +1 -1
- package/app-frontend/messaging/MessagingWrapper.js +21 -4
- package/app-frontend/messaging/MessagingWrapper.js.map +1 -1
- package/app-frontend/messaging/SwMessagingWrapper.d.ts +1 -1
- package/app-frontend/messaging/SwMessagingWrapper.js +21 -3
- package/app-frontend/messaging/SwMessagingWrapper.js.map +1 -1
- package/app-frontend/messaging/types.d.ts +2 -2
- package/app-frontend/messaging/types.js +17 -0
- package/app-frontend/messaging/types.js.map +1 -1
- package/backend-functions.d.ts +1 -0
- package/backend-functions.js +35 -0
- package/backend-functions.js.map +1 -0
- package/backend.d.ts +13 -0
- package/backend.js +48 -0
- package/backend.js.map +1 -0
- package/frontend.d.ts +4 -0
- package/frontend.js +39 -0
- package/frontend.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +33 -0
- package/index.js.map +1 -1
- package/package.json +6 -6
- package/shared/types.d.ts +18 -15
- package/shared/types.js +17 -0
- package/shared/types.js.map +1 -1
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Firebase is a simpler Typescript wrapper to all of firebase services.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
20
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
21
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -10,10 +27,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
27
|
};
|
|
11
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
29
|
exports.FirebaseAnalyticsModule = void 0;
|
|
13
|
-
const
|
|
14
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
30
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
15
31
|
const FirebaseModule_1 = require("../FirebaseModule");
|
|
16
|
-
class FirebaseAnalyticsModule_Class extends
|
|
32
|
+
class FirebaseAnalyticsModule_Class extends ts_common_1.Module {
|
|
17
33
|
constructor() {
|
|
18
34
|
super("FirebaseAnalyticsModule");
|
|
19
35
|
this._init = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -27,12 +43,12 @@ class FirebaseAnalyticsModule_Class extends module_1.Module {
|
|
|
27
43
|
}
|
|
28
44
|
logEvent(eventName, eventParams) {
|
|
29
45
|
if (!this.analytics)
|
|
30
|
-
throw new
|
|
46
|
+
throw new ts_common_1.ImplementationMissingException('Missing analytics wrapper');
|
|
31
47
|
return this.analytics.logEvent(eventName, eventParams);
|
|
32
48
|
}
|
|
33
49
|
setCurrentScreen(screenName) {
|
|
34
50
|
if (!this.analytics)
|
|
35
|
-
throw new
|
|
51
|
+
throw new ts_common_1.ImplementationMissingException('Missing analytics wrapper');
|
|
36
52
|
return this.analytics.setCurrentScreen(screenName);
|
|
37
53
|
}
|
|
38
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/AnalyticsModule.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AnalyticsModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/AnalyticsModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH,4DAAoF;AACpF,sDAAiD;AAGjD,MAAM,6BACF,SAAQ,kBAAM;IAEd;QACI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAS7B,UAAK,GAAG,GAAS,EAAE;YACvB,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;QACvD,CAAC,CAAA,CAAC;IAbF,CAAC;IAIS,IAAI;QACV,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IASD,QAAQ,CAAC,SAAiB,EAAE,WAAoC;QAC5D,IAAI,CAAC,IAAI,CAAC,SAAS;YACf,MAAM,IAAI,0CAA8B,CAAC,2BAA2B,CAAC,CAAC;QAE1E,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC3D,CAAC;IAED,gBAAgB,CAAC,UAAkB;QAC/B,IAAI,CAAC,IAAI,CAAC,SAAS;YACf,MAAM,IAAI,0CAA8B,CAAC,2BAA2B,CAAC,CAAC;QAE1E,OAAO,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC;CACJ;AAEY,QAAA,uBAAuB,GAAG,IAAI,6BAA6B,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Logger } from "@intuitionrobotics/ts-common
|
|
1
|
+
import { Logger } from "@intuitionrobotics/ts-common";
|
|
2
2
|
import { FirebaseType_Analytics, FirebaseType_CallOptions, FirebaseType_EventNameString } from "./types";
|
|
3
3
|
import { CustomParams } from "firebase/analytics";
|
|
4
4
|
export declare class AnalyticsWrapper extends Logger {
|
|
@@ -1,28 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Permissions management system, define access level for each of
|
|
4
|
+
* your server apis, and restrict users by giving them access levels
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
2
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
21
|
exports.AnalyticsWrapper = void 0;
|
|
4
|
-
const
|
|
22
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
5
23
|
// tslint:disable:no-import-side-effect
|
|
6
24
|
const analytics_1 = require("firebase/analytics");
|
|
7
|
-
class AnalyticsWrapper extends
|
|
25
|
+
class AnalyticsWrapper extends ts_common_1.Logger {
|
|
8
26
|
constructor(analytics) {
|
|
9
27
|
super();
|
|
10
28
|
this.analytics = analytics;
|
|
11
29
|
}
|
|
12
30
|
setUserId(userId, options) {
|
|
13
|
-
analytics_1.setUserId(this.analytics, userId, options);
|
|
31
|
+
(0, analytics_1.setUserId)(this.analytics, userId, options);
|
|
14
32
|
}
|
|
15
33
|
setCurrentScreen(screenName, options) {
|
|
16
34
|
this.logEvent("screen_view", { screenName }, options);
|
|
17
35
|
}
|
|
18
36
|
setAnalyticsCollectionEnabled(enabled) {
|
|
19
|
-
analytics_1.setAnalyticsCollectionEnabled(this.analytics, enabled);
|
|
37
|
+
(0, analytics_1.setAnalyticsCollectionEnabled)(this.analytics, enabled);
|
|
20
38
|
}
|
|
21
39
|
setUserProperties(properties, options) {
|
|
22
|
-
analytics_1.setUserProperties(this.analytics, properties);
|
|
40
|
+
(0, analytics_1.setUserProperties)(this.analytics, properties);
|
|
23
41
|
}
|
|
24
42
|
logEvent(eventName, eventParams, options) {
|
|
25
|
-
return analytics_1.logEvent(this.analytics, eventName, eventParams, options);
|
|
43
|
+
return (0, analytics_1.logEvent)(this.analytics, eventName, eventParams, options);
|
|
26
44
|
}
|
|
27
45
|
}
|
|
28
46
|
exports.AnalyticsWrapper = AnalyticsWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/AnalyticsWrapper.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AnalyticsWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/AnalyticsWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,4DAAoD;AAMpD,uCAAuC;AACvC,kDAM4B;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,IAAA,qBAAS,EAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,gBAAgB,CAAC,UAAkB,EAAE,OAAkC;QACtE,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAC,EAAC,UAAU,EAAC,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAED,6BAA6B,CAAC,OAAgB;QAC7C,IAAA,yCAA6B,EAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED,iBAAiB,CAAC,UAAwB,EAAE,OAAkC;QAC7E,IAAA,6BAAiB,EAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,QAAQ,CACP,SAAgD,EAChD,WAAoC,EACpC,OAAkC;QAElC,OAAO,IAAA,oBAAQ,EAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CAED;AAlCD,4CAkCC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Analytics, EventNameString, AnalyticsCallOptions } from "firebase/analytics";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type FirebaseType_Analytics = Analytics;
|
|
3
|
+
export type FirebaseType_CallOptions = AnalyticsCallOptions;
|
|
4
|
+
export type FirebaseType_EventNameString = EventNameString;
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Permissions management system, define access level for each of
|
|
4
|
+
* your server apis, and restrict users by giving them access levels
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
2
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
21
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-frontend/analytics/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "firebase/auth";
|
|
2
2
|
import { FirebaseApp } from "firebase/app";
|
|
3
|
-
import { Logger } from "@intuitionrobotics/ts-common
|
|
3
|
+
import { Logger } from "@intuitionrobotics/ts-common";
|
|
4
|
+
import { FirebaseConfig } from "../../index";
|
|
4
5
|
import { MessagingWrapper } from "../messaging/MessagingWrapper";
|
|
5
6
|
import { AnalyticsWrapper } from "../analytics/AnalyticsWrapper";
|
|
6
7
|
import { DatabaseWrapper } from "../database/DatabaseWrapper";
|
|
7
|
-
import { FirebaseConfig } from "../../shared/types";
|
|
8
8
|
export declare class FirebaseSession extends Logger {
|
|
9
9
|
app: FirebaseApp;
|
|
10
10
|
protected config: FirebaseConfig;
|
|
@@ -14,8 +14,7 @@ exports.FirebaseSession = void 0;
|
|
|
14
14
|
require("firebase/auth");
|
|
15
15
|
const auth_1 = require("firebase/auth");
|
|
16
16
|
const app_1 = require("firebase/app");
|
|
17
|
-
const
|
|
18
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
17
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
19
18
|
const MessagingWrapper_1 = require("../messaging/MessagingWrapper");
|
|
20
19
|
const AnalyticsWrapper_1 = require("../analytics/AnalyticsWrapper");
|
|
21
20
|
const DatabaseWrapper_1 = require("../database/DatabaseWrapper");
|
|
@@ -23,49 +22,49 @@ const messaging_1 = require("firebase/messaging");
|
|
|
23
22
|
const analytics_1 = require("firebase/analytics");
|
|
24
23
|
const database_1 = require("firebase/database");
|
|
25
24
|
const firestore_1 = require("firebase/firestore");
|
|
26
|
-
class FirebaseSession extends
|
|
25
|
+
class FirebaseSession extends ts_common_1.Logger {
|
|
27
26
|
constructor(sessionName, config) {
|
|
28
27
|
super(`firebase: ${sessionName}`);
|
|
29
28
|
this.sessionName = sessionName;
|
|
30
29
|
this.config = config;
|
|
31
30
|
}
|
|
32
31
|
connect() {
|
|
33
|
-
this.app = app_1.initializeApp(this.config, this.sessionName);
|
|
32
|
+
this.app = (0, app_1.initializeApp)(this.config, this.sessionName);
|
|
34
33
|
}
|
|
35
34
|
getMessaging() {
|
|
36
35
|
if (this.messaging)
|
|
37
36
|
return this.messaging;
|
|
38
|
-
return this.messaging = new MessagingWrapper_1.MessagingWrapper(messaging_1.getMessaging(this.app));
|
|
37
|
+
return this.messaging = new MessagingWrapper_1.MessagingWrapper((0, messaging_1.getMessaging)(this.app));
|
|
39
38
|
}
|
|
40
39
|
getAnalytics() {
|
|
41
40
|
if (this.analytics)
|
|
42
41
|
return this.analytics;
|
|
43
|
-
return this.analytics = new AnalyticsWrapper_1.AnalyticsWrapper(analytics_1.getAnalytics(this.app));
|
|
42
|
+
return this.analytics = new AnalyticsWrapper_1.AnalyticsWrapper((0, analytics_1.getAnalytics)(this.app));
|
|
44
43
|
}
|
|
45
44
|
getDatabase() {
|
|
46
45
|
if (this.database)
|
|
47
46
|
return this.database;
|
|
48
|
-
return this.database = new DatabaseWrapper_1.DatabaseWrapper(database_1.getDatabase(this.app));
|
|
47
|
+
return this.database = new DatabaseWrapper_1.DatabaseWrapper((0, database_1.getDatabase)(this.app));
|
|
49
48
|
}
|
|
50
49
|
signInWithToken(token) {
|
|
51
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
return auth_1.signInWithCustomToken(auth_1.getAuth(this.app), token);
|
|
51
|
+
return (0, auth_1.signInWithCustomToken)((0, auth_1.getAuth)(this.app), token);
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
;
|
|
56
55
|
getFirestore() {
|
|
57
|
-
return firestore_1.getFirestore(this.app);
|
|
56
|
+
return (0, firestore_1.getFirestore)(this.app);
|
|
58
57
|
}
|
|
59
58
|
signOut() {
|
|
60
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
return auth_1.signOut(auth_1.getAuth(this.app));
|
|
60
|
+
return (0, auth_1.signOut)((0, auth_1.getAuth)(this.app));
|
|
62
61
|
});
|
|
63
62
|
}
|
|
64
63
|
getProjectId() {
|
|
65
64
|
if (!this.config)
|
|
66
|
-
throw new
|
|
65
|
+
throw new ts_common_1.ThisShouldNotHappenException("Missing config. Probably init not resolved yet!");
|
|
67
66
|
if (!this.config.projectId)
|
|
68
|
-
throw new
|
|
67
|
+
throw new ts_common_1.ThisShouldNotHappenException("Could not deduce project id from session config.. if you need the functionality.. add it to the config!!");
|
|
69
68
|
return this.config.projectId;
|
|
70
69
|
}
|
|
71
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirebaseSession.js","sourceRoot":"","sources":["../../../src/main/app-frontend/auth/FirebaseSession.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAuC;AACvC,yBAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"FirebaseSession.js","sourceRoot":"","sources":["../../../src/main/app-frontend/auth/FirebaseSession.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAuC;AACvC,yBAAuB;AACvB,wCAAoE;AACpE,sCAGsB;AACtB,4DAGsC;AAGtC,oEAA+D;AAC/D,oEAA+D;AAC/D,iEAA4D;AAC5D,kDAAgD;AAChD,kDAAgD;AAChD,gDAA8C;AAC9C,kDAAkD;AAElD,MAAa,eACZ,SAAQ,kBAAM;IASd,YAAY,WAAmB,EAAE,MAAsB;QACtD,KAAK,CAAC,aAAa,WAAW,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GA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AAI,CAAC,MAAM,CAAC,SAAS;YACzB,MAAM,IAAI,wCAA4B,CAAC,0GAA0G,CAAC,CAAC;QAEpJ,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC9B,CAAC;CACD;AA9DD,0CA8DC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FirebaseApp } from "firebase/app";
|
|
2
2
|
import "firebase/auth";
|
|
3
|
-
import { Logger } from "@intuitionrobotics/ts-common
|
|
3
|
+
import { Logger } from "@intuitionrobotics/ts-common";
|
|
4
4
|
import { SwMessagingWrapper } from "../messaging/SwMessagingWrapper";
|
|
5
5
|
export declare class SwFirebaseSession extends Logger {
|
|
6
6
|
app: FirebaseApp;
|
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SwFirebaseSession = void 0;
|
|
4
4
|
// tslint:disable:no-import-side-effect
|
|
5
5
|
require("firebase/auth");
|
|
6
|
-
const
|
|
6
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
7
|
+
// noinspection TypeScriptPreferShortImport
|
|
7
8
|
const SwMessagingWrapper_1 = require("../messaging/SwMessagingWrapper");
|
|
8
9
|
const messaging_1 = require("firebase/messaging");
|
|
9
|
-
class SwFirebaseSession extends
|
|
10
|
+
class SwFirebaseSession extends ts_common_1.Logger {
|
|
10
11
|
constructor(sessionName, app) {
|
|
11
12
|
super(`service worker firebase: ${sessionName}`);
|
|
12
13
|
this.sessionName = sessionName;
|
|
@@ -15,7 +16,7 @@ class SwFirebaseSession extends Logger_1.Logger {
|
|
|
15
16
|
getMessaging() {
|
|
16
17
|
if (this.messaging)
|
|
17
18
|
return this.messaging;
|
|
18
|
-
return this.messaging = new SwMessagingWrapper_1.SwMessagingWrapper(messaging_1.getMessaging(this.app));
|
|
19
|
+
return this.messaging = new SwMessagingWrapper_1.SwMessagingWrapper((0, messaging_1.getMessaging)(this.app));
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
exports.SwFirebaseSession = SwFirebaseSession;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwFirebaseSession.js","sourceRoot":"","sources":["../../../src/main/app-frontend/auth/SwFirebaseSession.ts"],"names":[],"mappings":";;;AACA,uCAAuC;AACvC,yBAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"SwFirebaseSession.js","sourceRoot":"","sources":["../../../src/main/app-frontend/auth/SwFirebaseSession.ts"],"names":[],"mappings":";;;AACA,uCAAuC;AACvC,yBAAuB;AACvB,4DAAoD;AACpD,2CAA2C;AAC3C,wEAAmE;AACnE,kDAAgD;AAGhD,MAAa,iBACZ,SAAQ,kBAAM;IAMd,YAAY,WAAmB,EAAE,GAAgB;QAChD,KAAK,CAAC,4BAA4B,WAAW,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IAChB,CAAC;IAED,YAAY;QACX,IAAI,IAAI,CAAC,SAAS;YACjB,OAAO,IAAI,CAAC,SAAS,CAAC;QAEvB,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,uCAAkB,CAAC,IAAA,wBAAY,EAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACxE,CAAC;CACD;AApBD,8CAoBC"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Firebase is a simpler Typescript wrapper to all of firebase services.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
20
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
21
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -10,20 +27,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
27
|
};
|
|
11
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
29
|
exports.DatabaseWrapper = void 0;
|
|
13
|
-
const
|
|
14
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
30
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
15
31
|
// tslint:disable:no-import-side-effect
|
|
16
32
|
const database_1 = require("firebase/database");
|
|
17
|
-
class DatabaseWrapper extends
|
|
33
|
+
class DatabaseWrapper extends ts_common_1.Logger {
|
|
18
34
|
constructor(database) {
|
|
19
35
|
super();
|
|
20
|
-
this.getRef = (path) => database_1.ref(this.database, path);
|
|
36
|
+
this.getRef = (path) => (0, database_1.ref)(this.database, path);
|
|
21
37
|
this.database = database;
|
|
22
38
|
}
|
|
23
39
|
get(path) {
|
|
24
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
41
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
database_1.onValue(this.getRef(path), snapshot => {
|
|
42
|
+
(0, database_1.onValue)(this.getRef(path), snapshot => {
|
|
27
43
|
resolve(snapshot.val());
|
|
28
44
|
}, (error) => {
|
|
29
45
|
reject(error);
|
|
@@ -32,24 +48,25 @@ class DatabaseWrapper extends Logger_1.Logger {
|
|
|
32
48
|
});
|
|
33
49
|
}
|
|
34
50
|
listen(path, callback) {
|
|
35
|
-
return database_1.onValue(this.getRef(path), snapshot => {
|
|
51
|
+
return (0, database_1.onValue)(this.getRef(path), snapshot => {
|
|
36
52
|
callback(snapshot.val());
|
|
37
53
|
}, (error) => {
|
|
38
|
-
throw new
|
|
54
|
+
throw new ts_common_1.BadImplementationException(`Error while getting value from path: ${path}`, error);
|
|
39
55
|
}, { onlyOnce: false });
|
|
40
56
|
}
|
|
41
57
|
listenWithError(path, callback, errorCallback, onlyOnce = false) {
|
|
42
|
-
return database_1.onValue(this.getRef(path), snapshot => {
|
|
58
|
+
return (0, database_1.onValue)(this.getRef(path), snapshot => {
|
|
43
59
|
callback(snapshot.val());
|
|
44
60
|
}, (error) => errorCallback(error), { onlyOnce });
|
|
45
61
|
}
|
|
46
62
|
set(path, value) {
|
|
47
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
64
|
try {
|
|
49
|
-
yield database_1.set(this.getRef(path), value);
|
|
65
|
+
yield (0, database_1.set)(this.getRef(path), value);
|
|
50
66
|
}
|
|
51
67
|
catch (e) {
|
|
52
|
-
|
|
68
|
+
this.logError(`Error while setting value to path: ${path}`, e);
|
|
69
|
+
throw new ts_common_1.BadImplementationException(`Error while setting value to path: ${path}`);
|
|
53
70
|
}
|
|
54
71
|
});
|
|
55
72
|
}
|
|
@@ -63,10 +80,10 @@ class DatabaseWrapper extends Logger_1.Logger {
|
|
|
63
80
|
patch(path, value) {
|
|
64
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
82
|
try {
|
|
66
|
-
yield database_1.update(this.getRef(path), value);
|
|
83
|
+
yield (0, database_1.update)(this.getRef(path), value);
|
|
67
84
|
}
|
|
68
85
|
catch (e) {
|
|
69
|
-
throw new
|
|
86
|
+
throw new ts_common_1.BadImplementationException(`Error while updating value to path: ${path}`);
|
|
70
87
|
}
|
|
71
88
|
});
|
|
72
89
|
}
|
|
@@ -80,14 +97,14 @@ class DatabaseWrapper extends Logger_1.Logger {
|
|
|
80
97
|
delete(path, assertionRegexp = "^/.*?/.*") {
|
|
81
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
82
99
|
if (!path)
|
|
83
|
-
throw new
|
|
100
|
+
throw new ts_common_1.BadImplementationException(`Falsy value, path: '${path}'`);
|
|
84
101
|
if (!path.match(new RegExp(assertionRegexp)))
|
|
85
|
-
throw new
|
|
102
|
+
throw new ts_common_1.BadImplementationException(`path: '${path}' does not match assertion: '${assertionRegexp}'`);
|
|
86
103
|
try {
|
|
87
|
-
yield database_1.remove(this.getRef(path));
|
|
104
|
+
yield (0, database_1.remove)(this.getRef(path));
|
|
88
105
|
}
|
|
89
106
|
catch (e) {
|
|
90
|
-
throw new
|
|
107
|
+
throw new ts_common_1.BadImplementationException(`Error while removing path: ${path}`);
|
|
91
108
|
}
|
|
92
109
|
});
|
|
93
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/database/DatabaseWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DatabaseWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/database/DatabaseWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH,4DAGsC;AAEtC,uCAAuC;AACvC,gDAM2B;AAE3B,MAAa,eACZ,SAAQ,kBAAM;IAId,YAAY,QAAyB;QACpC,KAAK,EAAE,CAAC;QA6BD,WAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAA,cAAG,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QA5B3D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;IAGY,GAAG,CAAI,IAAY;;YAC/B,OAAO,IAAI,OAAO,CAAW,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;gBACtD,IAAA,kBAAO,EAAC,IAAI,CAAC,MAAM,CAAC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,OAAO,CAAC,EAAE,CAAC;gBACZ,MAAM,IAAI,sCAA0B,CAAC,8BAA8B,IAAI,EAAE,CAAC,CAAC;YAC5E,CAAC;QACF,CAAC;KAAA;CACD;AA/ED,0CA+EC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Database } from "firebase/database";
|
|
2
|
-
export
|
|
2
|
+
export type FirebaseType_DB = Database;
|
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Firebase is a simpler Typescript wrapper to all of firebase services.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-frontend/database/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-frontend/database/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Logger } from "@intuitionrobotics/ts-common
|
|
1
|
+
import { Logger } from "@intuitionrobotics/ts-common";
|
|
2
2
|
import { FirebaseType_Messaging, FirebaseType_Unsubscribe } from "./types";
|
|
3
3
|
import { GetTokenOptions, MessagePayload, NextFn, Observer } from "firebase/messaging";
|
|
4
4
|
export declare class MessagingWrapper extends Logger {
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Firebase is a simpler Typescript wrapper to all of firebase services.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
20
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
21
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -10,16 +27,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
27
|
};
|
|
11
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
29
|
exports.MessagingWrapper = void 0;
|
|
13
|
-
const
|
|
30
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
14
31
|
const messaging_1 = require("firebase/messaging");
|
|
15
|
-
class MessagingWrapper extends
|
|
32
|
+
class MessagingWrapper extends ts_common_1.Logger {
|
|
16
33
|
constructor(messaging) {
|
|
17
34
|
super();
|
|
18
35
|
this.messaging = messaging;
|
|
19
36
|
}
|
|
20
37
|
getToken(options) {
|
|
21
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
this.token = yield messaging_1.getToken(this.messaging, options);
|
|
39
|
+
this.token = yield (0, messaging_1.getToken)(this.messaging, options);
|
|
23
40
|
if (this.callback)
|
|
24
41
|
this.onMessage(this.callback);
|
|
25
42
|
return this.token;
|
|
@@ -29,7 +46,7 @@ class MessagingWrapper extends Logger_1.Logger {
|
|
|
29
46
|
this.callback = callback;
|
|
30
47
|
if (!this.token)
|
|
31
48
|
return;
|
|
32
|
-
return messaging_1.onMessage(this.messaging, callback);
|
|
49
|
+
return (0, messaging_1.onMessage)(this.messaging, callback);
|
|
33
50
|
}
|
|
34
51
|
}
|
|
35
52
|
exports.MessagingWrapper = MessagingWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagingWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/messaging/MessagingWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MessagingWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/messaging/MessagingWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH,4DAAoD;AAEpD,kDAA0G;AAE1G,MAAa,gBACZ,SAAQ,kBAAM;IAMd,YAAY,SAAiC;QAC5C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAEK,QAAQ,CAAC,OAAyB;;YACvC,IAAI,CAAC,KAAK,GAAG,MAAM,IAAA,oBAAQ,EAAC,IAAI,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;YACpD,IAAI,IAAI,CAAC,QAAQ;gBAChB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAE/B,OAAO,IAAI,CAAC,KAAK,CAAC;QACnB,CAAC;KAAA;IAED,SAAS,CAAC,QAA2D;QACpE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,KAAK;YACd,OAAO;QAER,OAAO,IAAA,qBAAS,EAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACD;AA3BD,4CA2BC"}
|
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Permissions management system, define access level for each of
|
|
4
|
+
* your server apis, and restrict users by giving them access levels
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
2
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
21
|
exports.SwMessagingWrapper = void 0;
|
|
4
|
-
const
|
|
22
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
5
23
|
const sw_1 = require("firebase/messaging/sw");
|
|
6
|
-
class SwMessagingWrapper extends
|
|
24
|
+
class SwMessagingWrapper extends ts_common_1.Logger {
|
|
7
25
|
constructor(messaging) {
|
|
8
26
|
super();
|
|
9
27
|
this.messaging = messaging;
|
|
@@ -14,7 +32,7 @@ class SwMessagingWrapper extends Logger_1.Logger {
|
|
|
14
32
|
if (!self || !("ServiceWorkerGlobalScope" in self))
|
|
15
33
|
return this.logWarning("Not a service worker context");
|
|
16
34
|
this.logInfo("This is a service worker context");
|
|
17
|
-
return sw_1.onBackgroundMessage(this.messaging, {
|
|
35
|
+
return (0, sw_1.onBackgroundMessage)(this.messaging, {
|
|
18
36
|
next: callback,
|
|
19
37
|
error: error => this.logWarning(error),
|
|
20
38
|
complete: () => this.logInfo("Successfully set on background messaging")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwMessagingWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/messaging/SwMessagingWrapper.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SwMessagingWrapper.js","sourceRoot":"","sources":["../../../src/main/app-frontend/messaging/SwMessagingWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,4DAAoD;AAEpD,8CAA0D;AAE1D,MAAa,kBACZ,SAAQ,kBAAM;IAId,YAAY,SAAiC;QAC5C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,mBAAmB,CAAC,QAAgC;QACnD,sIAAsI;QACtI,sIAAsI;QACtI,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,0BAA0B,IAAI,IAAI,CAAC;YACjD,OAAO,IAAI,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;QAExD,IAAI,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;QACjD,OAAO,IAAA,wBAAmB,EAAC,IAAI,CAAC,SAAS,EAAE;YAC1C,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;YACtC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,0CAA0C,CAAC;SACxE,CAAC,CAAC;IACJ,CAAC;CAED;AAxBD,gDAwBC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Messaging, Unsubscribe } from "firebase/messaging";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type FirebaseType_Messaging = Messaging;
|
|
3
|
+
export type FirebaseType_Unsubscribe = Unsubscribe;
|
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Firebase is a simpler Typescript wrapper to all of firebase services.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-frontend/messaging/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-frontend/messaging/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./app-backend/functions/firebase-function";
|