@intuitionrobotics/firebase 0.45.0 → 0.45.3
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 +4 -1
- package/app-backend/FirebaseModule.js +28 -11
- 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 +20 -3
- package/app-backend/auth/FirebaseSession_Admin.js.map +1 -1
- package/app-backend/auth/FirebaseSession_UserPassword.js +22 -0
- package/app-backend/auth/FirebaseSession_UserPassword.js.map +1 -1
- package/app-backend/auth/firebase-session.d.ts +2 -2
- 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 +1 -1
- package/app-backend/database/DatabaseWrapper.js +26 -10
- package/app-backend/database/DatabaseWrapper.js.map +1 -1
- package/app-backend/database/types.js +17 -0
- package/app-backend/database/types.js.map +1 -1
- package/app-backend/firestore/FirestoreCollection.d.ts +6 -4
- 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.js +17 -0
- package/app-backend/firestore/FirestoreV2Collection.js.map +1 -1
- 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 +5 -4
- package/app-backend/functions/firebase-function.js +73 -30
- 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 +17 -0
- package/app-backend/push/PushMessagesWrapper.js.map +1 -1
- package/app-backend/push/types.js +17 -0
- package/app-backend/push/types.js.map +1 -1
- package/app-backend/storage/StorageWrapper.js +24 -8
- package/app-backend/storage/StorageWrapper.js.map +1 -1
- package/app-backend/storage/types.js +17 -0
- package/app-backend/storage/types.js.map +1 -1
- package/app-frontend/FirebaseModule.d.ts +5 -2
- package/app-frontend/FirebaseModule.js +25 -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 +20 -2
- package/app-frontend/analytics/AnalyticsWrapper.js.map +1 -1
- package/app-frontend/analytics/types.js +18 -0
- package/app-frontend/analytics/types.js.map +1 -1
- package/app-frontend/auth/FirebaseSession.d.ts +5 -2
- package/app-frontend/auth/FirebaseSession.js +25 -5
- package/app-frontend/auth/FirebaseSession.js.map +1 -1
- package/app-frontend/auth/SwFirebaseSession.d.ts +4 -1
- package/app-frontend/auth/SwFirebaseSession.js +21 -2
- package/app-frontend/auth/SwFirebaseSession.js.map +1 -1
- package/app-frontend/database/DatabaseWrapper.d.ts +1 -1
- package/app-frontend/database/DatabaseWrapper.js +25 -9
- package/app-frontend/database/DatabaseWrapper.js.map +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 +19 -2
- package/app-frontend/messaging/MessagingWrapper.js.map +1 -1
- package/app-frontend/messaging/SwMessagingWrapper.d.ts +1 -1
- package/app-frontend/messaging/SwMessagingWrapper.js +20 -2
- package/app-frontend/messaging/SwMessagingWrapper.js.map +1 -1
- 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 +31 -0
- package/backend-functions.js.map +1 -0
- package/backend.d.ts +13 -0
- package/backend.js +44 -0
- package/backend.js.map +1 -0
- package/frontend.d.ts +4 -0
- package/frontend.js +35 -0
- package/frontend.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +29 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/shared/types.d.ts +4 -1
- package/shared/types.js +17 -0
- package/shared/types.js.map +1 -1
|
@@ -1,10 +1,25 @@
|
|
|
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
|
exports.FirestoreInterface = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const tools_1 = require("@intuitionrobotics/ts-common/utils/tools");
|
|
7
|
-
const object_tools_1 = require("@intuitionrobotics/ts-common/utils/object-tools");
|
|
21
|
+
const __1 = require("../..");
|
|
22
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
8
23
|
class FirestoreInterface {
|
|
9
24
|
static buildQuery(collection, query) {
|
|
10
25
|
let myQuery = collection;
|
|
@@ -21,7 +36,7 @@ class FirestoreInterface {
|
|
|
21
36
|
const valueType = typeof _whereValue;
|
|
22
37
|
if (Array.isArray(_whereValue)) {
|
|
23
38
|
if (_whereValue.length === 0 || _whereValue.length > 10)
|
|
24
|
-
throw new
|
|
39
|
+
throw new ts_common_1.BadImplementationException("While querying in an array you can only provide one or more values to query by and not more than 10... this " +
|
|
25
40
|
"is due to Firestore limitation... ");
|
|
26
41
|
if (_whereValue.length === 1)
|
|
27
42
|
return _query.where(whereKey, 'array-contains', _whereValue[0]);
|
|
@@ -29,7 +44,7 @@ class FirestoreInterface {
|
|
|
29
44
|
}
|
|
30
45
|
if (this.isQueryObject(_whereValue)) {
|
|
31
46
|
// @ts-ignore
|
|
32
|
-
return _query.where(whereKey,
|
|
47
|
+
return _query.where(whereKey, __1.ComparatorMap[Object.keys(_whereValue)[0]], Object.values(_whereValue)[0]);
|
|
33
48
|
}
|
|
34
49
|
if (valueType === "string" || valueType === "number" || valueType === "boolean")
|
|
35
50
|
return ___query.where(whereKey, "==", _whereValue);
|
|
@@ -38,7 +53,7 @@ class FirestoreInterface {
|
|
|
38
53
|
return processObject(__query, `${whereKey}.${key}`, _whereValue[key]);
|
|
39
54
|
}, ___query);
|
|
40
55
|
}
|
|
41
|
-
throw new
|
|
56
|
+
throw new ts_common_1.ImplementationMissingException(`Could not compose where clause for '${whereKey}' with value type '${valueType}'in query: ${ts_common_1.__stringify(___query)}`);
|
|
42
57
|
};
|
|
43
58
|
return processObject(_query, whereField, whereValue);
|
|
44
59
|
}, myQuery);
|
|
@@ -65,16 +80,16 @@ class FirestoreInterface {
|
|
|
65
80
|
}
|
|
66
81
|
static assertUniqueDocument(results, query, collectionName) {
|
|
67
82
|
if (results.length > 1)
|
|
68
|
-
throw new
|
|
83
|
+
throw new ts_common_1.BadImplementationException(`too many results for query: ${ts_common_1.__stringify(query)} in collection: ${collectionName}`);
|
|
69
84
|
if (results.length === 0)
|
|
70
85
|
return;
|
|
71
86
|
return results[0];
|
|
72
87
|
}
|
|
73
88
|
;
|
|
74
89
|
static buildUniqueQuery(collection, instance) {
|
|
75
|
-
|
|
90
|
+
ts_common_1._keys(instance).forEach((key) => {
|
|
76
91
|
if (instance[key] === undefined || instance[key] === null) {
|
|
77
|
-
throw new
|
|
92
|
+
throw new ts_common_1.BadImplementationException(`No where properties are allowed to be null or undefined.\nWhile querying collection '${collection.name}' we found property '${key}' to be '${instance[key]}'`);
|
|
78
93
|
}
|
|
79
94
|
});
|
|
80
95
|
const where = collection.externalUniqueFilter(instance);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirestoreInterface.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreInterface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"FirestoreInterface.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreInterface.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,6BAGe;AAMf,4DAKsC;AAGtC,MAAa,kBAAkB;IAE9B,MAAM,CAAC,UAAU,CAAsB,UAAqC,EAAE,KAA4B;QACzG,IAAI,OAAO,GAAe,UAAU,CAAC;QACrC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM;YACxB,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAkB,CAAC,CAAC;QAEvD,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE;YACzB,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC;YAChC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,MAA2B,EAAE,WAAW,EAAE,EAAE;gBACtF,MAAM,UAAU,GAAG,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C;YACjB,UAAU,CAAC,MAAM,CAAC;YAClB,UAAU,CAAC,KAAK,CAAC;YACjB,UAAU,CAAC,MAAM,CAAC;YAClB,UAAU,CAAC,MAAM,CAAC;YAClB,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,oBAAoB,CAAC,OAA8C,EAAE,KAA0B,EAAE,cAAsB;QAC7H,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YACrB,MAAM,IAAI,sCAA0B,CAAC,+BAA+B,uBAAW,CAAC,KAAK,CAAC,mBAAmB,cAAc,EAAE,CAAC,CAAC;QAE5H,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YACvB,OAAO;QAER,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IAAA,CAAC;IAEF,MAAM,CAAC,gBAAgB,CAAsB,UAAqC,EAAE,QAAc;QACjG,iBAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/B,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;gBAC1D,MAAM,IAAI,sCAA0B,CACnC,wFAAwF,UAAU,CAAC,IAAI,wBAAwB,GAAG,YAAY,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;aAChK;QACF,CAAC,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,UAAU,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QACxD,OAAO,EAAC,KAAK,EAAC,CAAC;IAChB,CAAC;CACD;AAlGD,gDAkGC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as admin from "firebase-admin";
|
|
2
2
|
import { firestore } from "firebase-admin";
|
|
3
3
|
import { FirestoreCollection } from "./FirestoreCollection";
|
|
4
|
+
import { Subset } from "@intuitionrobotics/ts-common";
|
|
4
5
|
import { FirestoreQuery } from "../../shared/types";
|
|
5
6
|
import { SetOptions } from "firebase-admin/firestore";
|
|
6
|
-
import { Subset } from "@intuitionrobotics/ts-common/utils/types";
|
|
7
7
|
import Transaction = firestore.Transaction;
|
|
8
8
|
export declare class FirestoreTransaction {
|
|
9
9
|
private transaction;
|
|
@@ -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,9 +27,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
27
|
};
|
|
11
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
29
|
exports.FirestoreTransaction = void 0;
|
|
30
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
13
31
|
const FirestoreInterface_1 = require("./FirestoreInterface");
|
|
14
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
15
|
-
const merge_tools_1 = require("@intuitionrobotics/ts-common/utils/merge-tools");
|
|
16
32
|
class FirestoreTransaction {
|
|
17
33
|
constructor(transaction) {
|
|
18
34
|
this.transaction = transaction;
|
|
@@ -90,7 +106,7 @@ class FirestoreTransaction {
|
|
|
90
106
|
upsertAll(collection, instances) {
|
|
91
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
108
|
if (instances.length > 500)
|
|
93
|
-
throw new
|
|
109
|
+
throw new ts_common_1.BadImplementationException('Firestore transaction supports maximum 500 at a time');
|
|
94
110
|
return (yield this.upsertAll_Read(collection, instances))();
|
|
95
111
|
});
|
|
96
112
|
}
|
|
@@ -109,9 +125,9 @@ class FirestoreTransaction {
|
|
|
109
125
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
126
|
const doc = yield this._queryItem(collection, instance);
|
|
111
127
|
if (!doc)
|
|
112
|
-
throw new
|
|
128
|
+
throw new ts_common_1.BadImplementationException(`Patching a non existent doc for query ${FirestoreInterface_1.FirestoreInterface.buildUniqueQuery(collection, instance)}`);
|
|
113
129
|
return () => {
|
|
114
|
-
const patchedInstance =
|
|
130
|
+
const patchedInstance = ts_common_1.merge(doc.data(), instance);
|
|
115
131
|
this.transaction.set(doc.ref, patchedInstance);
|
|
116
132
|
return patchedInstance;
|
|
117
133
|
};
|
|
@@ -126,7 +142,7 @@ class FirestoreTransaction {
|
|
|
126
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
143
|
const docs = yield this._query(collection, ourQuery);
|
|
128
144
|
if (docs.length > 500)
|
|
129
|
-
throw new
|
|
145
|
+
throw new ts_common_1.BadImplementationException(`Trying to delete ${docs.length} documents. Not allowed more then 5oo in a single transaction`);
|
|
130
146
|
return () => {
|
|
131
147
|
const toReturn = docs.map(doc => doc.data());
|
|
132
148
|
docs.forEach((doc) => this.transaction.delete(doc.ref));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirestoreTransaction.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreTransaction.ts"],"names":[],"mappings":";;;;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AM,CAAsB,UAAqC,EAAE,QAAc,EAAE,EAAU;QACzF,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC5E,CAAC;IAED,cAAc;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CACJ;AArKD,oDAqKC"}
|
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
exports.enhanceCollection = void 0;
|
|
4
21
|
const FirestoreInterface_1 = require("./FirestoreInterface");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirestoreV2Collection.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreV2Collection.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"FirestoreV2Collection.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreV2Collection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAGH,6DAAwD;AAQjD,MAAM,iBAAiB,GAAG,CAAsB,UAAqC,EAA+B,EAAE;IACzH,MAAM,aAAa,GAAG,UAAyC,CAAC;IAChE,aAAa,CAAC,UAAU,GAAG,CAAC,QAA+B,EAAe,EAAE;QACxE,OAAO,uCAAkB,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/D,CAAC,CAAC;IAEF,OAAO,aAAa,CAAC;AACzB,CAAC,CAAC;AAPW,QAAA,iBAAiB,qBAO5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirestoreWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA0D;AAI1D,qEAAgE;AAChE,wDAA2E;AAC3E,mEAAiF;
|
|
1
|
+
{"version":3,"file":"FirestoreWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA0D;AAI1D,qEAAgE;AAChE,wDAA2E;AAC3E,mEAAiF;AAGjF,MAAa,gBACT,SAAQ,yCAAmB;IAM3B,YAAY,eAA0C;QAClD,KAAK,CAAC,eAAe,CAAC,CAAC;QAJV,gBAAW,GAA2D,EAAE,CAAC;QACzE,kBAAa,GAA6D,EAAE,CAAC;QAI1F,IAAI,CAAC,SAAS,GAAG,wBAAY,CAAC,eAAe,CAAC,GAAG,CAAC,CAAA;IACtD,CAAC;IAEM,aAAa,CAAsB,IAAY,EAAE,kBAAqC;QACzF,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,UAAU;YACV,OAAO,UAAU,CAAC;QAEtB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,yCAAmB,CAAO,IAAI,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAClG,CAAC;IAEM,eAAe,CAAsB,IAAY;QACpD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,UAAU;YACV,OAAO,UAAU,CAAC;QAEtB,MAAM,mBAAmB,GAAG,yCAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAA8B,CAA+B,CAAC;QAC1I,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC;IAC1D,CAAC;IAED,cAAc;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAEY,gBAAgB,CAAC,IAAY;;YACtC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;QAChD,CAAC;KAAA;IAEY,eAAe;;YACxB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe;gBAC/B,OAAO,EAAE,CAAC;YAEd,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;QAC5C,CAAC;KAAA;CACJ;AA3CD,4CA2CC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare type FirestoreType_Collection<T extends any = any> = firestore.CollectionReference<T>;
|
|
3
|
-
export declare type FirestoreType_QueryDocumentSnapshot<T extends any = any> = firestore.QueryDocumentSnapshot<T>;
|
|
4
|
-
export declare type FirestoreType_DocumentSnapshot<T extends any = any> = firestore.DocumentSnapshot<T>;
|
|
5
|
-
export declare type FirestoreType_QuerySnapshot<T> = firestore.QuerySnapshot<T>;
|
|
6
|
-
export declare type FirestoreType_Query = firestore.Query;
|
|
7
|
-
export declare type FirestoreType_DocumentReference = firestore.DocumentReference;
|
|
8
|
-
export declare type FirestoreType = firestore.Firestore;
|
|
9
|
-
export declare type FirestoreType_Transaction = firestore.Transaction;
|
|
1
|
+
import * as admin from "firebase-admin";
|
|
2
|
+
export declare type FirestoreType_Collection<T extends any = any> = admin.firestore.CollectionReference<T>;
|
|
3
|
+
export declare type FirestoreType_QueryDocumentSnapshot<T extends any = any> = admin.firestore.QueryDocumentSnapshot<T>;
|
|
4
|
+
export declare type FirestoreType_DocumentSnapshot<T extends any = any> = admin.firestore.DocumentSnapshot<T>;
|
|
5
|
+
export declare type FirestoreType_QuerySnapshot<T> = admin.firestore.QuerySnapshot<T>;
|
|
6
|
+
export declare type FirestoreType_Query = admin.firestore.Query;
|
|
7
|
+
export declare type FirestoreType_DocumentReference = admin.firestore.DocumentReference;
|
|
8
|
+
export declare type FirestoreType = admin.firestore.Firestore;
|
|
9
|
+
export declare type FirestoreType_Transaction = admin.firestore.Transaction;
|
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
20
|
// export type FirestoreType_Collection = admin.firestore.CollectionReference | firebase.firestore.CollectionReference;
|
|
4
21
|
// export type FirestoreType_DocumentSnapshot = admin.firestore.QueryDocumentSnapshot | firebase.firestore.QueryDocumentSnapshot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/types.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;AAaH,uHAAuH;AACvH,iIAAiI;AACjI,mJAAmJ;AACnJ,0HAA0H;AAC1H,8JAA8J;AAC9J,wGAAwG;AACxG,EAAE"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as functions from "firebase-functions";
|
|
2
2
|
import { EventContext, HttpsFunction, RuntimeOptions } from "firebase-functions";
|
|
3
|
-
import { Module } from "@intuitionrobotics/ts-common/core/module";
|
|
4
3
|
import { Express, Request, Response } from "express";
|
|
4
|
+
import { Module, StringMap } from "@intuitionrobotics/ts-common";
|
|
5
5
|
import { ObjectMetadata } from "firebase-functions/lib/v1/providers/storage";
|
|
6
|
-
import { StringMap } from "@intuitionrobotics/ts-common/utils/types";
|
|
7
6
|
export interface FirebaseFunctionInterface {
|
|
8
7
|
getFunction(): HttpsFunction;
|
|
9
8
|
}
|
|
@@ -48,7 +47,10 @@ export declare abstract class FirestoreFunctionModule<DataType extends object, C
|
|
|
48
47
|
}, before?: DataType, after?: DataType): Promise<any>;
|
|
49
48
|
getFunction: () => functions.CloudFunction<functions.Change<functions.firestore.DocumentSnapshot>>;
|
|
50
49
|
}
|
|
51
|
-
export declare
|
|
50
|
+
export declare type ScheduledConfig = RuntimeOptsConfigs & {
|
|
51
|
+
timeZone?: string;
|
|
52
|
+
};
|
|
53
|
+
export declare abstract class FirebaseScheduledFunction<Config extends ScheduledConfig = any> extends FirebaseFunction<Config> {
|
|
52
54
|
private function;
|
|
53
55
|
private schedule?;
|
|
54
56
|
private runningCondition;
|
|
@@ -65,7 +67,6 @@ export declare type BucketConfigs = RuntimeOptsConfigs & {
|
|
|
65
67
|
};
|
|
66
68
|
export declare abstract class Firebase_StorageFunction<Config extends BucketConfigs = BucketConfigs> extends FirebaseFunction<Config> {
|
|
67
69
|
private function;
|
|
68
|
-
private runtimeOpts;
|
|
69
70
|
abstract onFinalize(object: ObjectMetadata, context: EventContext): Promise<any>;
|
|
70
71
|
getFunction: () => functions.CloudFunction<functions.storage.ObjectMetadata>;
|
|
71
72
|
}
|
|
@@ -11,12 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Firebase_PubSubFunction = exports.Firebase_StorageFunction = exports.FirebaseScheduledFunction = exports.FirestoreFunctionModule = exports.FirebaseFunctionModule = exports.Firebase_HttpsFunction = exports.Firebase_ExpressFunction = exports.FirebaseFunction = void 0;
|
|
13
13
|
const functions = require("firebase-functions");
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
17
|
-
const tools_1 = require("@intuitionrobotics/ts-common/utils/tools");
|
|
18
|
-
const error_handling_1 = require("@intuitionrobotics/ts-common/core/error-handling");
|
|
19
|
-
class FirebaseFunction extends module_1.Module {
|
|
14
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
15
|
+
class FirebaseFunction extends ts_common_1.Module {
|
|
20
16
|
}
|
|
21
17
|
exports.FirebaseFunction = FirebaseFunction;
|
|
22
18
|
class Firebase_ExpressFunction {
|
|
@@ -24,7 +20,13 @@ class Firebase_ExpressFunction {
|
|
|
24
20
|
this.getFunction = () => {
|
|
25
21
|
if (this.function)
|
|
26
22
|
return this.function;
|
|
27
|
-
|
|
23
|
+
const runtimeOptions = Object.assign({ labels: {
|
|
24
|
+
infra: "thunderstorm",
|
|
25
|
+
function_name: getFormattedFunctionName(this.getName()),
|
|
26
|
+
type: "https",
|
|
27
|
+
version: "v1"
|
|
28
|
+
} }, Firebase_ExpressFunction.config);
|
|
29
|
+
return this.function = functions.runWith(runtimeOptions).https.onRequest(this.express);
|
|
28
30
|
};
|
|
29
31
|
this.express = _express;
|
|
30
32
|
this.name = name;
|
|
@@ -44,7 +46,15 @@ class Firebase_HttpsFunction extends FirebaseFunction {
|
|
|
44
46
|
this.getFunction = () => {
|
|
45
47
|
if (this.function)
|
|
46
48
|
return this.function;
|
|
47
|
-
|
|
49
|
+
const runtimeOptions = {
|
|
50
|
+
labels: {
|
|
51
|
+
infra: "thunderstorm",
|
|
52
|
+
function_name: getFormattedFunctionName(this.getName()),
|
|
53
|
+
type: "https",
|
|
54
|
+
version: "v1"
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return this.function = functions.runWith(runtimeOptions).https.onRequest((req, res) => this.process(req, res));
|
|
48
58
|
};
|
|
49
59
|
this.onFunctionReady = () => __awaiter(this, void 0, void 0, function* () {
|
|
50
60
|
return;
|
|
@@ -60,10 +70,16 @@ class FirebaseFunctionModule extends FirebaseFunction {
|
|
|
60
70
|
var _a;
|
|
61
71
|
if (this.function)
|
|
62
72
|
return this.function;
|
|
63
|
-
|
|
73
|
+
const runtimeOptions = Object.assign({ labels: {
|
|
74
|
+
infra: "thunderstorm",
|
|
75
|
+
function_name: getFormattedFunctionName(this.getName()),
|
|
76
|
+
type: "realtime-db-listener",
|
|
77
|
+
version: "v1"
|
|
78
|
+
} }, (_a = this.config) === null || _a === void 0 ? void 0 : _a.runtimeOpts);
|
|
79
|
+
return this.function = functions.runWith(runtimeOptions).database.ref(this.listeningPath).onWrite((change, context) => {
|
|
64
80
|
const before = change.before && change.before.val();
|
|
65
81
|
const after = change.after && change.after.val();
|
|
66
|
-
const params =
|
|
82
|
+
const params = ts_common_1.deepClone(context.params);
|
|
67
83
|
return this.processChanges(before, after, params);
|
|
68
84
|
});
|
|
69
85
|
};
|
|
@@ -79,10 +95,16 @@ class FirestoreFunctionModule extends FirebaseFunction {
|
|
|
79
95
|
var _a;
|
|
80
96
|
if (this.function)
|
|
81
97
|
return this.function;
|
|
82
|
-
|
|
98
|
+
const runtimeOptions = Object.assign({ labels: {
|
|
99
|
+
infra: "thunderstorm",
|
|
100
|
+
function_name: getFormattedFunctionName(this.getName()),
|
|
101
|
+
type: "firestore-listener",
|
|
102
|
+
version: "v1"
|
|
103
|
+
} }, (_a = this.config) === null || _a === void 0 ? void 0 : _a.runTimeOptions);
|
|
104
|
+
return this.function = functions.runWith(runtimeOptions).firestore.document(`${this.collectionName}/{docId}`).onWrite((change, context) => {
|
|
83
105
|
const before = change.before && change.before.data();
|
|
84
106
|
const after = change.after && change.after.data();
|
|
85
|
-
const params =
|
|
107
|
+
const params = ts_common_1.deepClone(context.params);
|
|
86
108
|
return this.processChanges(params, before, after);
|
|
87
109
|
});
|
|
88
110
|
};
|
|
@@ -95,12 +117,23 @@ class FirebaseScheduledFunction extends FirebaseFunction {
|
|
|
95
117
|
super(...arguments);
|
|
96
118
|
this.runningCondition = [];
|
|
97
119
|
this.getFunction = () => {
|
|
98
|
-
var _a;
|
|
120
|
+
var _a, _b;
|
|
99
121
|
if (!this.schedule)
|
|
100
|
-
throw new
|
|
122
|
+
throw new ts_common_1.ImplementationMissingException("MUST set schedule !!");
|
|
101
123
|
if (this.function)
|
|
102
124
|
return this.function;
|
|
103
|
-
|
|
125
|
+
const runtimeOptions = Object.assign({ labels: {
|
|
126
|
+
infra: "thunderstorm",
|
|
127
|
+
function_name: getFormattedFunctionName(this.getName()),
|
|
128
|
+
type: "pubsub-schedule",
|
|
129
|
+
version: "v1"
|
|
130
|
+
} }, (_a = this.config) === null || _a === void 0 ? void 0 : _a.runtimeOpts);
|
|
131
|
+
return this.function = functions
|
|
132
|
+
.runWith(runtimeOptions)
|
|
133
|
+
.pubsub
|
|
134
|
+
.schedule(this.schedule)
|
|
135
|
+
.timeZone(((_b = this.config) === null || _b === void 0 ? void 0 : _b.timeZone) || "Etc/UTC")
|
|
136
|
+
.onRun(() => __awaiter(this, void 0, void 0, function* () {
|
|
104
137
|
const results = yield Promise.all(this.runningCondition.map(condition => condition()));
|
|
105
138
|
if (results.includes(false)) {
|
|
106
139
|
this.logDebug("will not execute backup.. running conditions didn't pass: ", results);
|
|
@@ -111,7 +144,7 @@ class FirebaseScheduledFunction extends FirebaseFunction {
|
|
|
111
144
|
};
|
|
112
145
|
}
|
|
113
146
|
addRunningCondition(runningCondition) {
|
|
114
|
-
this.runningCondition
|
|
147
|
+
ts_common_1.addItemToArray(this.runningCondition, runningCondition);
|
|
115
148
|
return this;
|
|
116
149
|
}
|
|
117
150
|
setSchedule(schedule) {
|
|
@@ -123,26 +156,27 @@ exports.FirebaseScheduledFunction = FirebaseScheduledFunction;
|
|
|
123
156
|
class Firebase_StorageFunction extends FirebaseFunction {
|
|
124
157
|
constructor() {
|
|
125
158
|
super(...arguments);
|
|
126
|
-
this.runtimeOpts = {};
|
|
127
159
|
this.getFunction = () => {
|
|
128
|
-
var _a
|
|
160
|
+
var _a;
|
|
129
161
|
if (this.function)
|
|
130
162
|
return this.function;
|
|
131
163
|
this.logInfo(`Initializing ${this.getName()} with configs ${JSON.stringify(this.config)}`);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
164
|
+
const runtimeOptions = Object.assign({ labels: {
|
|
165
|
+
infra: "thunderstorm",
|
|
166
|
+
function_name: getFormattedFunctionName(this.getName()),
|
|
167
|
+
type: "https",
|
|
168
|
+
version: "v1"
|
|
169
|
+
}, timeoutSeconds: 300, memory: "2GB" }, (_a = this.config) === null || _a === void 0 ? void 0 : _a.runtimeOpts);
|
|
170
|
+
return this.function = functions.runWith(runtimeOptions).storage.bucket(this.config.bucketName).object().onFinalize((object, context) => __awaiter(this, void 0, void 0, function* () {
|
|
137
171
|
try {
|
|
138
172
|
return yield this.onFinalize(object, context);
|
|
139
173
|
}
|
|
140
174
|
catch (e) {
|
|
141
175
|
const _message = `Error handling callback to onFinalize bucket listener method` +
|
|
142
|
-
"\n" + `File changed ${object.name}` + "\n with attributes: " +
|
|
176
|
+
"\n" + `File changed ${object.name}` + "\n with attributes: " + ts_common_1.__stringify(context) + "\n" + ts_common_1.__stringify(e);
|
|
143
177
|
this.logError(_message);
|
|
144
178
|
try {
|
|
145
|
-
yield
|
|
179
|
+
yield ts_common_1.dispatch_onServerError.dispatchModuleAsync([ts_common_1.ServerErrorSeverity.Critical, this, _message]);
|
|
146
180
|
}
|
|
147
181
|
catch (_e) {
|
|
148
182
|
this.logError("Error while handing bucket listener error", _e);
|
|
@@ -153,6 +187,9 @@ class Firebase_StorageFunction extends FirebaseFunction {
|
|
|
153
187
|
}
|
|
154
188
|
}
|
|
155
189
|
exports.Firebase_StorageFunction = Firebase_StorageFunction;
|
|
190
|
+
function getFormattedFunctionName(name) {
|
|
191
|
+
return name.replace(/([A-Z])/g, "_$1").toLowerCase().replace(/\s/g, "_");
|
|
192
|
+
}
|
|
156
193
|
class Firebase_PubSubFunction extends FirebaseFunction {
|
|
157
194
|
constructor(topic, name) {
|
|
158
195
|
super(name);
|
|
@@ -161,11 +198,11 @@ class Firebase_PubSubFunction extends FirebaseFunction {
|
|
|
161
198
|
return yield this.onPublish(object, originalMessage, context);
|
|
162
199
|
}
|
|
163
200
|
catch (e) {
|
|
164
|
-
const _message = `Error publishing pub/sub message` +
|
|
165
|
-
"\n" + ` to topic ${this.topic}` + "\n with attributes: " +
|
|
201
|
+
const _message = `Error publishing pub/sub message` + ts_common_1.__stringify(object) +
|
|
202
|
+
"\n" + ` to topic ${this.topic}` + "\n with attributes: " + ts_common_1.__stringify(originalMessage.attributes) + "\n" + ts_common_1.__stringify(e);
|
|
166
203
|
this.logError(_message);
|
|
167
204
|
try {
|
|
168
|
-
yield
|
|
205
|
+
yield ts_common_1.dispatch_onServerError.dispatchModuleAsync([ts_common_1.ServerErrorSeverity.Critical, this, _message]);
|
|
169
206
|
}
|
|
170
207
|
catch (_e) {
|
|
171
208
|
this.logError("Error while handing pubsub error", _e);
|
|
@@ -176,7 +213,13 @@ class Firebase_PubSubFunction extends FirebaseFunction {
|
|
|
176
213
|
var _a;
|
|
177
214
|
if (this.function)
|
|
178
215
|
return this.function;
|
|
179
|
-
|
|
216
|
+
const runtimeOptions = Object.assign({ labels: {
|
|
217
|
+
infra: "thunderstorm",
|
|
218
|
+
function_name: getFormattedFunctionName(this.getName()),
|
|
219
|
+
type: "pubsub-topic-publish",
|
|
220
|
+
version: "v1"
|
|
221
|
+
} }, (_a = this.config) === null || _a === void 0 ? void 0 : _a.runtimeOpts);
|
|
222
|
+
return this.function = functions.runWith(runtimeOptions).pubsub.topic(this.topic).onPublish((message, context) => __awaiter(this, void 0, void 0, function* () {
|
|
180
223
|
// need to validate etc...
|
|
181
224
|
const originalMessage = message.toJSON();
|
|
182
225
|
let data;
|
|
@@ -185,7 +228,7 @@ class Firebase_PubSubFunction extends FirebaseFunction {
|
|
|
185
228
|
}
|
|
186
229
|
catch (e) {
|
|
187
230
|
this.logError(`Error parsing the data attribute from pub/sub message to topic ${this.topic}` +
|
|
188
|
-
"\n" +
|
|
231
|
+
"\n" + ts_common_1.__stringify(originalMessage.data) + "\n" + ts_common_1.__stringify(e));
|
|
189
232
|
}
|
|
190
233
|
return this._onPublish(data, originalMessage, context);
|
|
191
234
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firebase-function.js","sourceRoot":"","sources":["../../../src/main/app-backend/functions/firebase-function.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAgD;AAGhD,
|
|
1
|
+
{"version":3,"file":"firebase-function.js","sourceRoot":"","sources":["../../../src/main/app-backend/functions/firebase-function.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAgD;AAGhD,4DASsC;AAUtC,MAAsB,gBAClB,SAAQ,kBAAc;CAIzB;AALD,4CAKC;AAED,MAAa,wBAAwB;IAOjC,YAAY,QAAiB,EAAE,IAAI,GAAG,KAAK;QAa3C,gBAAW,GAAG,GAAG,EAAE;YACf,IAAI,IAAI,CAAC,QAAQ;gBACb,OAAO,IAAI,CAAC,QAAQ,CAAC;YAEzB,MAAM,cAAc,mBAChB,MAAM,EAAE;oBACJ,KAAK,EAAE,cAAc;oBACrB,aAAa,EAAE,wBAAwB,CAAC,IA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aseBaseWrapper } from "../auth/FirebaseBaseWrapper";
|
|
3
3
|
import { FirebaseSession } from "../auth/firebase-session";
|
|
4
|
-
import { StringMap } from "@intuitionrobotics/ts-common
|
|
4
|
+
import { StringMap } from "@intuitionrobotics/ts-common";
|
|
5
5
|
export declare class PushMessagesWrapper extends FirebaseBaseWrapper {
|
|
6
6
|
private readonly messaging;
|
|
7
7
|
constructor(firebaseSession: FirebaseSession<any, any>);
|
|
@@ -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) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushMessagesWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/push/PushMessagesWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"PushMessagesWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/push/PushMessagesWrapper.ts"],"names":[],"mappings":";AAAA;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