@intuitionrobotics/firebase 0.41.68 → 0.41.71
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 +6 -6
|
@@ -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,74 +25,40 @@ 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.FirestoreWrapper = void 0;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
_this.firestore = firestore_1.getFirestore(firebaseSession.app);
|
|
79
|
-
return _this;
|
|
30
|
+
const FirestoreCollection_1 = require("./FirestoreCollection");
|
|
31
|
+
const FirebaseBaseWrapper_1 = require("../auth/FirebaseBaseWrapper");
|
|
32
|
+
const firestore_1 = require("firebase-admin/firestore");
|
|
33
|
+
class FirestoreWrapper extends FirebaseBaseWrapper_1.FirebaseBaseWrapper {
|
|
34
|
+
constructor(firebaseSession) {
|
|
35
|
+
super(firebaseSession);
|
|
36
|
+
this.collections = {};
|
|
37
|
+
this.firestore = firestore_1.getFirestore(firebaseSession.app);
|
|
80
38
|
}
|
|
81
|
-
|
|
82
|
-
|
|
39
|
+
getCollection(name, externalFilterKeys) {
|
|
40
|
+
const collection = this.collections[name];
|
|
83
41
|
if (collection)
|
|
84
42
|
return collection;
|
|
85
43
|
return this.collections[name] = new FirestoreCollection_1.FirestoreCollection(name, this, externalFilterKeys);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
collection.wrapper.firestore.doc(collection.name
|
|
44
|
+
}
|
|
45
|
+
listen(collection, doc) {
|
|
46
|
+
collection.wrapper.firestore.doc(`${collection.name}/${doc}`).onSnapshot(_snapshot => {
|
|
89
47
|
console.log('recieved snapshot!');
|
|
90
48
|
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
return
|
|
95
|
-
return [2 /*return*/, this.getCollection(name).deleteAll()];
|
|
96
|
-
});
|
|
49
|
+
}
|
|
50
|
+
deleteCollection(name) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
return this.getCollection(name).deleteAll();
|
|
97
53
|
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return [2 /*return*/, this.firestore.listCollections()];
|
|
105
|
-
});
|
|
54
|
+
}
|
|
55
|
+
listCollections() {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
if (!this.firestore.listCollections)
|
|
58
|
+
return [];
|
|
59
|
+
return this.firestore.listCollections();
|
|
106
60
|
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
}(FirebaseBaseWrapper_1.FirebaseBaseWrapper));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
110
63
|
exports.FirestoreWrapper = FirestoreWrapper;
|
|
111
64
|
//# sourceMappingURL=FirestoreWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirestoreWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG
|
|
1
|
+
{"version":3,"file":"FirestoreWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH,+DAA2D;AAO3D,qEAAgE;AAEhE,wDAAsD;AAEtD,MAAa,gBACZ,SAAQ,yCAAmB;IAK3B,YAAY,eAA0C;QACrD,KAAK,CAAC,eAAe,CAAC,CAAC;QAHP,gBAAW,GAA2D,EAAE,CAAC;QAIzF,IAAI,CAAC,SAAS,GAAG,wBAAY,CAAC,eAAe,CAAC,GAAG,CAAC,CAAA;IACnD,CAAC;IAEM,aAAa,CAAsB,IAAY,EAAE,kBAAqC;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