@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,7 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by tacb0ss on 25/08/2018.
|
|
3
|
+
*/
|
|
4
|
+
import { Module } from "@intuitionrobotics/ts-common";
|
|
1
5
|
import { FirebaseSession_Admin } from "./auth/FirebaseSession_Admin";
|
|
2
6
|
import { Firebase_UserCredential } from "./auth/firebase-session";
|
|
3
7
|
import { FirebaseProjectCollections } from "../shared/types";
|
|
4
|
-
import { Module } from "@intuitionrobotics/ts-common/core/module";
|
|
5
8
|
export declare type JWTInput = {
|
|
6
9
|
type?: string;
|
|
7
10
|
client_email?: string;
|
|
@@ -1,13 +1,30 @@
|
|
|
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.FirebaseModule = exports.FirebaseModule_Class = void 0;
|
|
21
|
+
/**
|
|
22
|
+
* Created by tacb0ss on 25/08/2018.
|
|
23
|
+
*/
|
|
24
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
4
25
|
const FirebaseSession_Admin_1 = require("./auth/FirebaseSession_Admin");
|
|
5
26
|
const fs_1 = require("fs");
|
|
6
|
-
|
|
7
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
8
|
-
const module_manager_1 = require("@intuitionrobotics/ts-common/core/module-manager");
|
|
9
|
-
const object_tools_1 = require("@intuitionrobotics/ts-common/utils/object-tools");
|
|
10
|
-
class FirebaseModule_Class extends module_1.Module {
|
|
27
|
+
class FirebaseModule_Class extends ts_common_1.Module {
|
|
11
28
|
constructor() {
|
|
12
29
|
super("FirebaseModule");
|
|
13
30
|
// private readonly tokenSessions: { [s: string]: FirebaseSession_UserPassword; } = {};
|
|
@@ -23,7 +40,7 @@ class FirebaseModule_Class extends module_1.Module {
|
|
|
23
40
|
let projectId;
|
|
24
41
|
if (FirebaseModule_Class.localAdminConfigId)
|
|
25
42
|
if (!this.config[FirebaseModule_Class.localAdminConfigId])
|
|
26
|
-
throw new
|
|
43
|
+
throw new ts_common_1.ImplementationMissingException(`Forgot to define a service account for project Id: ${FirebaseModule_Class.localAdminConfigId}`);
|
|
27
44
|
else
|
|
28
45
|
projectId = FirebaseModule_Class.localAdminConfigId;
|
|
29
46
|
if (!projectId)
|
|
@@ -31,7 +48,7 @@ class FirebaseModule_Class extends module_1.Module {
|
|
|
31
48
|
if (!projectId)
|
|
32
49
|
projectId = process.env.GCLOUD_PROJECT;
|
|
33
50
|
if (!projectId)
|
|
34
|
-
throw new
|
|
51
|
+
throw new ts_common_1.ThisShouldNotHappenException("Could not resolve project id...");
|
|
35
52
|
return projectId;
|
|
36
53
|
}
|
|
37
54
|
connect() {
|
|
@@ -70,11 +87,11 @@ class FirebaseModule_Class extends module_1.Module {
|
|
|
70
87
|
this.logInfo(`Creating Firebase session for project id: ${projectId}`);
|
|
71
88
|
let config = this.getProjectAuth(projectId);
|
|
72
89
|
if (!config && _projectId && this.localProjectId && this.localProjectId !== _projectId)
|
|
73
|
-
throw new
|
|
90
|
+
throw new ts_common_1.BadImplementationException(`Config for key ${_projectId} is not defined`);
|
|
74
91
|
if (typeof config === "string")
|
|
75
92
|
config = JSON.parse(fs_1.readFileSync(config, "utf8"));
|
|
76
93
|
if (config && (!config.client_email || !config.private_key))
|
|
77
|
-
throw new
|
|
94
|
+
throw new ts_common_1.BadImplementationException(`Config for key ${projectId} is not an Admin credentials pattern`);
|
|
78
95
|
session = new FirebaseSession_Admin_1.FirebaseSession_Admin(sessionName, config);
|
|
79
96
|
this.adminSessions[sessionName] = session;
|
|
80
97
|
session.connect();
|
|
@@ -85,9 +102,9 @@ class FirebaseModule_Class extends module_1.Module {
|
|
|
85
102
|
return (_a = this.config) === null || _a === void 0 ? void 0 : _a[projectId];
|
|
86
103
|
}
|
|
87
104
|
listCollectionsInModules() {
|
|
88
|
-
const modules =
|
|
105
|
+
const modules = ts_common_1.moduleResolver();
|
|
89
106
|
const firebaseProjectCollections = modules.reduce((toRet, module) => {
|
|
90
|
-
const keys =
|
|
107
|
+
const keys = ts_common_1._keys(module);
|
|
91
108
|
const _collections = keys
|
|
92
109
|
.filter(key => { var _a; return typeof module[key] === "object" && ((_a = module[key].constructor) === null || _a === void 0 ? void 0 : _a["name"].startsWith("FirestoreCollection")); })
|
|
93
110
|
.map(key => module[key])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirebaseModule.js","sourceRoot":"","sources":["../../src/main/app-backend/FirebaseModule.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"FirebaseModule.js","sourceRoot":"","sources":["../../src/main/app-backend/FirebaseModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH;;GAEG;AAEH,4DAOsC;AACtC,wEAAmE;AACnE,2BAAgC;AAmBhC,MAAa,oBACT,SAAQ,kBAAkB;IAO1B;QACI,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAN5B,uFAAuF;QACtE,kBAAa,GAA4C,EAAE,CAAC;IAM7E,CAAC;IAES,IAAI;QACV,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACtD,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAEO,oBAAoB;QACxB,IAAI,SAAS,CAAC;QACd,IAAI,oBAAoB,CAAC,kBAAkB;YACvC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,kBAAkB,CAAC;gBACrD,MAAM,IAAI,0CAA8B,CAAC,sDAAsD,oBAAoB,CAAC,kBAAkB,EAAE,CAAC,CAAC;;gBAE1I,SAAS,GAAG,oBAAoB,CAAC,kBAAkB,CAAC;QAE5D,IAAI,CAAC,SAAS;YACV,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;QAExC,IAAI,CAAC,SAAS;YACV,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;QAE3C,IAAI,CAAC,SAAS;YACV,MAAM,IAAI,wCAA4B,CAAC,iCAAiC,CAAC,CAAC;QAE9E,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,OAAO;QACb,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACjC,OAAO,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC;IAES,UAAU;QAChB,OAAO,IAAI,OAAO,CAAO,CAA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C5C;YAED,OAAO,KAAK,CAAC;QACjB,CAAC,EAAE,EAAiD,CAAC,CAAC;QACtD,OAAO,MAAM,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;IACrD,CAAC;CAEJ;AAzHD,oDAyHC;AAEY,QAAA,cAAc,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FirebaseSession } from "./firebase-session";
|
|
2
|
-
import { Logger } from "@intuitionrobotics/ts-common
|
|
2
|
+
import { Logger } from "@intuitionrobotics/ts-common";
|
|
3
3
|
export declare abstract class FirebaseBaseWrapper extends Logger {
|
|
4
4
|
readonly firebaseSession: FirebaseSession<any, any>;
|
|
5
5
|
protected constructor(firebaseSession: FirebaseSession<any, any>);
|
|
@@ -1,8 +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.FirebaseBaseWrapper = void 0;
|
|
4
|
-
const
|
|
5
|
-
class FirebaseBaseWrapper extends
|
|
21
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
22
|
+
class FirebaseBaseWrapper extends ts_common_1.Logger {
|
|
6
23
|
constructor(firebaseSession) {
|
|
7
24
|
super();
|
|
8
25
|
this.firebaseSession = firebaseSession;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirebaseBaseWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/auth/FirebaseBaseWrapper.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"FirebaseBaseWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/auth/FirebaseBaseWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAGH,4DAAoD;AAEpD,MAAsB,mBACrB,SAAQ,kBAAM;IAId,YAAsB,eAA0C;QAC/D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACxC,CAAC;IAED,OAAO;QACN,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;IACvC,CAAC;CACD;AAbD,kDAaC"}
|
|
@@ -1,9 +1,26 @@
|
|
|
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.FirebaseSession_Admin = void 0;
|
|
4
21
|
const firebase_admin_1 = require("firebase-admin");
|
|
5
22
|
const firebase_session_1 = require("./firebase-session");
|
|
6
|
-
const
|
|
23
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
7
24
|
const auth_1 = require("firebase-admin/auth");
|
|
8
25
|
const app_1 = require("firebase-admin/app");
|
|
9
26
|
class FirebaseSession_Admin extends firebase_session_1.FirebaseSession {
|
|
@@ -16,11 +33,11 @@ class FirebaseSession_Admin extends firebase_session_1.FirebaseSession {
|
|
|
16
33
|
getProjectId() {
|
|
17
34
|
if (!this.config) {
|
|
18
35
|
if (!process.env.GCLOUD_PROJECT)
|
|
19
|
-
throw new
|
|
36
|
+
throw new ts_common_1.ThisShouldNotHappenException("Could not deduce project id from function const!!");
|
|
20
37
|
return process.env.GCLOUD_PROJECT;
|
|
21
38
|
}
|
|
22
39
|
if (!this.config.project_id)
|
|
23
|
-
throw new
|
|
40
|
+
throw new ts_common_1.ThisShouldNotHappenException("Could not deduce project id from session config.. if you need the functionality.. add it to the config!!");
|
|
24
41
|
return this.config.project_id;
|
|
25
42
|
}
|
|
26
43
|
createApp() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirebaseSession_Admin.js","sourceRoot":"","sources":["../../../src/main/app-backend/auth/FirebaseSession_Admin.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"FirebaseSession_Admin.js","sourceRoot":"","sources":["../../../src/main/app-backend/auth/FirebaseSession_Admin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,mDAGwB;AACxB,yDAAmD;AACnD,4DAA0E;AAC1E,8CAG6B;AAC7B,4CAG4B;AAG5B,MAAa,qBACZ,SAAQ,kCAAqE;IAE7E,YAAY,WAAmB,EAAE,MAAiB;QACjD,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC5B,CAAC;IAEM,OAAO;QACb,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAC7B,CAAC;IAED,YAAY;QACX,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc;gBAC9B,MAAM,IAAI,wCAA4B,CAAC,mDAAmD,CAAC,CAAA;YAE5F,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;SAClC;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU;YAC1B,MAAM,IAAI,wCAA4B,CAAC,0GAA0G,CAAC,CAAA;QAEnJ,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;IAC/B,CAAC;IAEO,SAAS;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM;YACf,OAAO,mBAAa,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAEnD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,WAAW,IAAI,CAAC,MAAM,CAAC,UAAU,iBAAiB,CAAC;QAClG,OAAO,mBAAa,CAAC;YACC,UAAU,EAAE,2BAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAwB,CAAC;YAC1D,WAAW,EAAE,WAAW;SACxB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;IAEM,OAAO;QACb,OAAO,cAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;CACD;AAvCD,sDAuCC"}
|
|
@@ -1,4 +1,26 @@
|
|
|
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
|
+
// */
|
|
19
|
+
//
|
|
20
|
+
// /**
|
|
21
|
+
// * Created by tacb0ss on 19/09/2018.
|
|
22
|
+
// */
|
|
23
|
+
//
|
|
2
24
|
// import {
|
|
3
25
|
// auth,
|
|
4
26
|
// initializeApp
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirebaseSession_UserPassword.js","sourceRoot":"","sources":["../../../src/main/app-backend/auth/FirebaseSession_UserPassword.ts"],"names":[],"mappings":";AAAA,WAAW;AACX,SAAS;AACT,iBAAiB;AACjB,qBAAqB;AACrB,EAAE;AACF,WAAW;AACX,4BAA4B;AAC5B,mBAAmB;AACnB,+BAA+B;AAC/B,EAAE;AACF,EAAE;AACF,4CAA4C;AAC5C,sDAAsD;AACtD,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,uEAAuE;AACvE,uCAAuC;AACvC,KAAK;AACL,EAAE;AACF,4BAA4B;AAC5B,6BAA6B;AAC7B,KAAK;AACL,EAAE;AACF,4BAA4B;AAC5B,mFAAmF;AACnF,yEAAyE;AACzE,2IAA2I;AAC3I,uEAAuE;AACvE,oDAAoD;AACpD,KAAK;AACL,IAAI"}
|
|
1
|
+
{"version":3,"file":"FirebaseSession_UserPassword.js","sourceRoot":"","sources":["../../../src/main/app-backend/auth/FirebaseSession_UserPassword.ts"],"names":[],"mappings":";AAAA,KAAK;AACL,2EAA2E;AAC3E,KAAK;AACL,2CAA2C;AAC3C,KAAK;AACL,qEAAqE;AACrE,sEAAsE;AACtE,6CAA6C;AAC7C,KAAK;AACL,oDAAoD;AACpD,KAAK;AACL,yEAAyE;AACzE,uEAAuE;AACvE,8EAA8E;AAC9E,yEAAyE;AACzE,oCAAoC;AACpC,MAAM;AACN,EAAE;AACF,MAAM;AACN,uCAAuC;AACvC,MAAM;AACN,EAAE;AACF,WAAW;AACX,SAAS;AACT,iBAAiB;AACjB,qBAAqB;AACrB,EAAE;AACF,WAAW;AACX,4BAA4B;AAC5B,mBAAmB;AACnB,+BAA+B;AAC/B,EAAE;AACF,EAAE;AACF,4CAA4C;AAC5C,sDAAsD;AACtD,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,uEAAuE;AACvE,uCAAuC;AACvC,KAAK;AACL,EAAE;AACF,4BAA4B;AAC5B,6BAA6B;AAC7B,KAAK;AACL,EAAE;AACF,4BAA4B;AAC5B,mFAAmF;AACnF,yEAAyE;AACzE,2IAA2I;AAC3I,uEAAuE;AACvE,oDAAoD;AACpD,KAAK;AACL,IAAI"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Logger } from "@intuitionrobotics/ts-common
|
|
1
|
+
import { Logger } from "@intuitionrobotics/ts-common";
|
|
2
2
|
import { FirestoreWrapper } from "../firestore/FirestoreWrapper";
|
|
3
3
|
import { DatabaseWrapper } from "../database/DatabaseWrapper";
|
|
4
4
|
import { StorageWrapper } from "../storage/StorageWrapper";
|
|
5
5
|
import { PushMessagesWrapper } from "../push/PushMessagesWrapper";
|
|
6
|
-
import { FirebaseConfig } from "
|
|
6
|
+
import { FirebaseConfig } from "../..";
|
|
7
7
|
export declare type Firebase_UserCredential = {
|
|
8
8
|
config: FirebaseConfig;
|
|
9
9
|
credentials: {
|
|
@@ -1,12 +1,29 @@
|
|
|
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.FirebaseSession = void 0;
|
|
4
|
-
const
|
|
21
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
5
22
|
const FirestoreWrapper_1 = require("../firestore/FirestoreWrapper");
|
|
6
23
|
const DatabaseWrapper_1 = require("../database/DatabaseWrapper");
|
|
7
24
|
const StorageWrapper_1 = require("../storage/StorageWrapper");
|
|
8
25
|
const PushMessagesWrapper_1 = require("../push/PushMessagesWrapper");
|
|
9
|
-
class FirebaseSession extends
|
|
26
|
+
class FirebaseSession extends ts_common_1.Logger {
|
|
10
27
|
constructor(config, sessionName, _admin = true) {
|
|
11
28
|
super(`firebase: ${sessionName}`);
|
|
12
29
|
this.sessionName = sessionName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firebase-session.js","sourceRoot":"","sources":["../../../src/main/app-backend/auth/firebase-session.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"firebase-session.js","sourceRoot":"","sources":["../../../src/main/app-backend/auth/firebase-session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,4DAAoD;AACpD,oEAA+D;AAC/D,iEAA4D;AAC5D,8DAAyD;AACzD,qEAAgE;AAWhE,MAAsB,eACrB,SAAQ,kBAAM;IAWd,YAAsB,MAAc,EAAE,WAAmB,EAAE,MAAM,GAAG,IAAI;QACvE,KAAK,CAAC,aAAa,WAAW,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;IACrB,CAAC;IAIM,OAAO;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAIM,WAAW;QACjB,IAAI,IAAI,CAAC,QAAQ;YAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;QAEtB,OAAO,IAAI,CAAC,QAAQ,GAAG,IAAI,iCAAe,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAEM,UAAU;QAChB,IAAI,IAAI,CAAC,OAAO;YACf,OAAO,IAAI,CAAC,OAAO,CAAC;QAErB,OAAO,IAAI,CAAC,OAAO,GAAG,IAAI,+BAAc,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAEM,YAAY;QAClB,IAAI,IAAI,CAAC,SAAS;YACjB,OAAO,IAAI,CAAC,SAAS,CAAC;QAEvB,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,mCAAgB,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAEM,YAAY;QAClB,IAAI,IAAI,CAAC,SAAS;YACjB,OAAO,IAAI,CAAC,SAAS,CAAC;QAEvB,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,yCAAmB,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;CACD;AAtDD,0CAsDC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FirebaseListener } from "./types";
|
|
2
|
+
import { ObjectTS } from "@intuitionrobotics/ts-common";
|
|
2
3
|
import { FirebaseSession } from "../auth/firebase-session";
|
|
3
4
|
import { FirebaseBaseWrapper } from "../auth/FirebaseBaseWrapper";
|
|
4
|
-
import { ObjectTS } from "@intuitionrobotics/ts-common/utils/types";
|
|
5
5
|
export declare class DatabaseWrapper extends FirebaseBaseWrapper {
|
|
6
6
|
private readonly database;
|
|
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) {
|
|
@@ -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.DatabaseWrapper = void 0;
|
|
30
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
13
31
|
const FirebaseBaseWrapper_1 = require("../auth/FirebaseBaseWrapper");
|
|
14
32
|
const database_1 = require("firebase-admin/database");
|
|
15
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
16
|
-
const tools_1 = require("@intuitionrobotics/ts-common/utils/tools");
|
|
17
33
|
class DatabaseWrapper extends FirebaseBaseWrapper_1.FirebaseBaseWrapper {
|
|
18
34
|
constructor(firebaseSession) {
|
|
19
35
|
super(firebaseSession);
|
|
@@ -35,7 +51,7 @@ class DatabaseWrapper extends FirebaseBaseWrapper_1.FirebaseBaseWrapper {
|
|
|
35
51
|
return this.database.ref(path).on("value", (snapshot) => callback(snapshot ? snapshot.val() : undefined));
|
|
36
52
|
}
|
|
37
53
|
catch (e) {
|
|
38
|
-
throw new
|
|
54
|
+
throw new ts_common_1.BadImplementationException(`Error while getting value from path: ${path}`, e);
|
|
39
55
|
}
|
|
40
56
|
}
|
|
41
57
|
stopListening(path, listener) {
|
|
@@ -43,7 +59,7 @@ class DatabaseWrapper extends FirebaseBaseWrapper_1.FirebaseBaseWrapper {
|
|
|
43
59
|
this.database.ref(path).off("value", listener);
|
|
44
60
|
}
|
|
45
61
|
catch (e) {
|
|
46
|
-
throw new
|
|
62
|
+
throw new ts_common_1.BadImplementationException(`Error while getting value from path: ${path}`, e);
|
|
47
63
|
}
|
|
48
64
|
}
|
|
49
65
|
set(path, value) {
|
|
@@ -52,7 +68,7 @@ class DatabaseWrapper extends FirebaseBaseWrapper_1.FirebaseBaseWrapper {
|
|
|
52
68
|
return yield this.database.ref(path).set(value);
|
|
53
69
|
}
|
|
54
70
|
catch (e) {
|
|
55
|
-
throw new
|
|
71
|
+
throw new ts_common_1.BadImplementationException(`Error while setting value to path: ${path}`, e);
|
|
56
72
|
}
|
|
57
73
|
});
|
|
58
74
|
}
|
|
@@ -60,7 +76,7 @@ class DatabaseWrapper extends FirebaseBaseWrapper_1.FirebaseBaseWrapper {
|
|
|
60
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
77
|
for (const key in data) {
|
|
62
78
|
const node = `${parentPath}/${key}`;
|
|
63
|
-
if (
|
|
79
|
+
if (ts_common_1.calculateJsonSizeMb(data[key]) < maxSizeMB)
|
|
64
80
|
yield this.set(node, data[key]);
|
|
65
81
|
else
|
|
66
82
|
yield this.uploadByChunks(node, data[key], maxSizeMB, itemsToRef);
|
|
@@ -81,7 +97,7 @@ class DatabaseWrapper extends FirebaseBaseWrapper_1.FirebaseBaseWrapper {
|
|
|
81
97
|
}
|
|
82
98
|
catch (e) {
|
|
83
99
|
this.logError(e);
|
|
84
|
-
throw new
|
|
100
|
+
throw new ts_common_1.BadImplementationException(`Error while updating value to path: ${path}`, e);
|
|
85
101
|
}
|
|
86
102
|
});
|
|
87
103
|
}
|
|
@@ -94,9 +110,9 @@ class DatabaseWrapper extends FirebaseBaseWrapper_1.FirebaseBaseWrapper {
|
|
|
94
110
|
delete(path, assertionRegexp = "^/.*?/.*") {
|
|
95
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
96
112
|
if (!path)
|
|
97
|
-
throw new
|
|
113
|
+
throw new ts_common_1.BadImplementationException(`Falsy value, path: '${path}'`);
|
|
98
114
|
if (!path.match(new RegExp(assertionRegexp)))
|
|
99
|
-
throw new
|
|
115
|
+
throw new ts_common_1.BadImplementationException(`path: '${path}' does not match assertion: '${assertionRegexp}'`);
|
|
100
116
|
try {
|
|
101
117
|
return new Promise((resolve, reject) => {
|
|
102
118
|
let val;
|
|
@@ -114,7 +130,7 @@ class DatabaseWrapper extends FirebaseBaseWrapper_1.FirebaseBaseWrapper {
|
|
|
114
130
|
});
|
|
115
131
|
}
|
|
116
132
|
catch (e) {
|
|
117
|
-
throw new
|
|
133
|
+
throw new ts_common_1.BadImplementationException(`Error while removing path: ${path}`, e);
|
|
118
134
|
}
|
|
119
135
|
});
|
|
120
136
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/database/DatabaseWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DatabaseWrapper.js","sourceRoot":"","sources":["../../../src/main/app-backend/database/DatabaseWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAQH,4DAIsC;AAEtC,qEAAgE;AAChE,sDAAmD;AAEnD,MAAa,eACZ,SAAQ,y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CACD;AA9GD,0CA8GC"}
|
|
@@ -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-backend/database/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-backend/database/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Subset } from "@intuitionrobotics/ts-common";
|
|
1
2
|
import { FirestoreType_Collection, FirestoreType_DocumentSnapshot, FirestoreType_QuerySnapshot } from "./types";
|
|
2
3
|
import { Clause_Select, Clause_Where, FilterKeys, FirestoreQuery } from "../../shared/types";
|
|
3
4
|
import { FirestoreWrapper } from "./FirestoreWrapper";
|
|
4
5
|
import { FirestoreTransaction } from "./FirestoreTransaction";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { firestore } from "firebase-admin";
|
|
7
|
+
import { SetOptions } from "firebase-admin/lib/firestore";
|
|
8
|
+
import WriteResult = firestore.WriteResult;
|
|
7
9
|
export declare class FirestoreCollection<Type extends object> {
|
|
8
10
|
readonly name: string;
|
|
9
11
|
readonly wrapper: FirestoreWrapper;
|
|
@@ -33,9 +35,9 @@ export declare class FirestoreCollection<Type extends object> {
|
|
|
33
35
|
deleteAll(): Promise<Type[]>;
|
|
34
36
|
getAll(select?: Clause_Select<Type>): Promise<Type[]>;
|
|
35
37
|
runInTransaction<ReturnType>(processor: (transaction: FirestoreTransaction) => Promise<ReturnType>): Promise<ReturnType>;
|
|
36
|
-
createDocumentReference(id?: string):
|
|
38
|
+
createDocumentReference(id?: string): firestore.DocumentReference<Type>;
|
|
37
39
|
set(instance: Type, id: string): Promise<WriteResult>;
|
|
38
40
|
set(instance: Partial<Type>, id: string, options: SetOptions): Promise<WriteResult>;
|
|
39
|
-
create(instance: Type, id: string): Promise<WriteResult>;
|
|
41
|
+
create(instance: Type, id: string): Promise<firestore.WriteResult>;
|
|
40
42
|
getUniqueFilter: () => (object: Subset<Type>) => Clause_Where<Type>;
|
|
41
43
|
}
|
|
@@ -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,11 +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.FirestoreCollection = void 0;
|
|
30
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
13
31
|
const FirestoreInterface_1 = require("./FirestoreInterface");
|
|
14
32
|
const FirestoreTransaction_1 = require("./FirestoreTransaction");
|
|
15
|
-
const exceptions_1 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
16
|
-
const array_tools_1 = require("@intuitionrobotics/ts-common/utils/array-tools");
|
|
17
|
-
const random_tools_1 = require("@intuitionrobotics/ts-common/utils/random-tools");
|
|
18
33
|
class FirestoreCollection {
|
|
19
34
|
constructor(name, wrapper, externalFilterKeys) {
|
|
20
35
|
this.getUniqueFilter = () => this.externalUniqueFilter;
|
|
@@ -25,7 +40,7 @@ class FirestoreCollection {
|
|
|
25
40
|
this.collection = wrapper.firestore.collection(name);
|
|
26
41
|
this.externalUniqueFilter = (instance) => {
|
|
27
42
|
if (!externalFilterKeys)
|
|
28
|
-
throw new
|
|
43
|
+
throw new ts_common_1.BadImplementationException("In order to use a unique query your collection MUST have a unique filter");
|
|
29
44
|
return externalFilterKeys.reduce((where, key) => {
|
|
30
45
|
// @ts-ignore
|
|
31
46
|
where[key] = instance[key];
|
|
@@ -88,7 +103,7 @@ class FirestoreCollection {
|
|
|
88
103
|
}
|
|
89
104
|
upsertAll(instances) {
|
|
90
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
return
|
|
106
|
+
return ts_common_1.batchAction(instances, 500, (chunked) => __awaiter(this, void 0, void 0, function* () { return this.runInTransaction(transaction => transaction.upsertAll(this, chunked)); }));
|
|
92
107
|
});
|
|
93
108
|
}
|
|
94
109
|
patch(instance) {
|
|
@@ -116,7 +131,7 @@ class FirestoreCollection {
|
|
|
116
131
|
}
|
|
117
132
|
deleteBatch(docRefs) {
|
|
118
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
yield
|
|
134
|
+
yield ts_common_1.batchAction(docRefs, 500, (elements) => __awaiter(this, void 0, void 0, function* () {
|
|
120
135
|
const batch = this.collection.firestore.batch();
|
|
121
136
|
elements.forEach(doc => batch.delete(doc.ref));
|
|
122
137
|
yield batch.commit();
|
|
@@ -142,7 +157,7 @@ class FirestoreCollection {
|
|
|
142
157
|
}));
|
|
143
158
|
});
|
|
144
159
|
}
|
|
145
|
-
createDocumentReference(id =
|
|
160
|
+
createDocumentReference(id = ts_common_1.generateHex(16)) {
|
|
146
161
|
return this.collection.doc(id);
|
|
147
162
|
}
|
|
148
163
|
set(instance, id, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirestoreCollection.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreCollection.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"FirestoreCollection.js","sourceRoot":"","sources":["../../../src/main/app-backend/firestore/FirestoreCollection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH,4DAA0G;AAS1G,6DAAwD;AACxD,iEAA4D;AAO5D,MAAa,mBAAmB;IAU5B,YAAY,IAAY,EAAE,OAAyB,EAAE,kBAAqC;QAmI1F,oBAAe,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC;QAlI9C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;YACxB,O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C,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAU,CAAC,CAAC;QAC9C,CAAC;KAAA;IAEK,SAAS;;YACX,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;KAAA;IAGK,MAAM,CAAC,MAA4B;;YACrC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAC,MAAM,EAAyB,CAAC,CAAC;QACxD,CAAC;KAAA;IAEK,gBAAgB,CAAa,SAAqE;;YACpG,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,cAAc,CAAa,CAAO,WAAwC,EAAE,EAAE;gBAC3G,OAAO,SAAS,CAAC,IAAI,2CAAoB,CAAC,WAAW,CAAC,CAAC,CAAC;YAC5D,CAAC,CAAA,CAAC,CAAC;QACP,CAAC;KAAA;IAED,uBAAuB,CAAC,EAAE,GAAG,uBAAW,CAAC,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACnC,CAAC;IAKK,GAAG,CAAC,QAAa,EAAE,EAAU,EAAE,OAAa;;YAC9C,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC1D,CAAC;KAAA;IAEK,MAAM,CAAC,QAAc,EAAE,EAAU;;YACnC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpD,CAAC;KAAA;CAIJ;AA/ID,kDA+IC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { FirestoreQuery } from "../..";
|
|
1
2
|
import { FirestoreType_QueryDocumentSnapshot } from "./types";
|
|
2
3
|
import { FirestoreCollection } from "./FirestoreCollection";
|
|
3
4
|
import { CollectionReference, Query } from "firebase-admin/firestore";
|
|
4
|
-
import { FirestoreQuery } from "../../shared/types";
|
|
5
5
|
export declare class FirestoreInterface {
|
|
6
6
|
static buildQuery<Type extends object>(collection: CollectionReference<Type>, query?: FirestoreQuery<Type>): Query<Type>;
|
|
7
7
|
private static isQueryObject;
|