@dereekb/firebase-server 8.12.1 → 8.12.4
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/CHANGELOG.md +12 -0
- package/package.json +7 -7
- package/src/lib/function/assert.d.ts +9 -0
- package/src/lib/function/assert.js +21 -1
- package/src/lib/function/assert.js.map +1 -1
- package/test/CHANGELOG.md +12 -0
- package/test/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [8.12.4](https://github.com/dereekb/dbx-components/compare/v8.12.3-dev...v8.12.4) (2022-07-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [8.12.3](https://github.com/dereekb/dbx-components/compare/v8.12.2-dev...v8.12.3) (2022-07-09)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [8.12.2](https://github.com/dereekb/dbx-components/compare/v8.12.1-dev...v8.12.2) (2022-07-08)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
5
17
|
## [8.12.1](https://github.com/dereekb/dbx-components/compare/v8.12.0-dev...v8.12.1) (2022-07-08)
|
|
6
18
|
|
|
7
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.4",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"firebase-functions-test": "2.0.2"
|
|
6
6
|
},
|
|
@@ -20,27 +20,27 @@
|
|
|
20
20
|
"typings": "./src/index.d.ts",
|
|
21
21
|
"dependencies": {},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@dereekb/firebase": "8.12.
|
|
23
|
+
"@dereekb/firebase": "8.12.4",
|
|
24
24
|
"rxfire": "^6.0.3",
|
|
25
25
|
"rxjs": "^7.0.0",
|
|
26
26
|
"firebase": "^9.8.0",
|
|
27
|
-
"@dereekb/util": "8.12.
|
|
27
|
+
"@dereekb/util": "8.12.4",
|
|
28
28
|
"make-error": "^1.3.0",
|
|
29
29
|
"ts-essentials": "^9.1.2",
|
|
30
30
|
"extra-set": "^2.2.11",
|
|
31
|
-
"@dereekb/rxjs": "8.12.
|
|
31
|
+
"@dereekb/rxjs": "8.12.4",
|
|
32
32
|
"ms": "^3.0.0-canary.1",
|
|
33
|
-
"@dereekb/model": "8.12.
|
|
33
|
+
"@dereekb/model": "8.12.4",
|
|
34
34
|
"class-transformer": "^0.5.1",
|
|
35
35
|
"class-validator": "^0.13.2",
|
|
36
|
-
"@dereekb/date": "8.12.
|
|
36
|
+
"@dereekb/date": "8.12.4",
|
|
37
37
|
"date-fns": "^2.28.0",
|
|
38
38
|
"date-fns-tz": "^1.3.0",
|
|
39
39
|
"rrule": "2.7.0",
|
|
40
40
|
"firebase-functions": "^3.22.0",
|
|
41
41
|
"firebase-admin": "^11.0.0",
|
|
42
42
|
"@nestjs/common": "^8.4.0",
|
|
43
|
-
"@dereekb/nestjs": "8.12.
|
|
43
|
+
"@dereekb/nestjs": "8.12.4",
|
|
44
44
|
"@nestjs/config": "^2.0.1",
|
|
45
45
|
"@google-cloud/firestore": "^5.0.2",
|
|
46
46
|
"@nestjs/core": "^8.4.0",
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import { FirestoreDocument, FirestoreDocumentData } from '@dereekb/firebase';
|
|
1
2
|
import * as functions from 'firebase-functions';
|
|
2
3
|
export declare function assertContextHasAuth(context: functions.https.CallableContext): void;
|
|
4
|
+
/**
|
|
5
|
+
* Attempts to load data from the document. A modelNotAvailableError is thrown if the snapshot data is null/undefined (the document does not exist).
|
|
6
|
+
*
|
|
7
|
+
* @param document
|
|
8
|
+
* @param message
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function assertSnapshotData<D extends FirestoreDocument<any>>(document: D, message?: string): Promise<FirestoreDocumentData<D>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertContextHasAuth = void 0;
|
|
3
|
+
exports.assertSnapshotData = exports.assertContextHasAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const context_1 = require("./context");
|
|
5
6
|
const error_1 = require("./error");
|
|
6
7
|
function assertContextHasAuth(context) {
|
|
@@ -9,4 +10,23 @@ function assertContextHasAuth(context) {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
exports.assertContextHasAuth = assertContextHasAuth;
|
|
13
|
+
/**
|
|
14
|
+
* Attempts to load data from the document. A modelNotAvailableError is thrown if the snapshot data is null/undefined (the document does not exist).
|
|
15
|
+
*
|
|
16
|
+
* @param document
|
|
17
|
+
* @param message
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
function assertSnapshotData(document, message) {
|
|
21
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const data = yield document.snapshotData();
|
|
23
|
+
if (data == null) {
|
|
24
|
+
throw (0, error_1.modelNotAvailableError)({
|
|
25
|
+
message: message !== null && message !== void 0 ? message : `The ${document.modelType} was unavailable.`
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return data;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.assertSnapshotData = assertSnapshotData;
|
|
12
32
|
//# sourceMappingURL=assert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/function/assert.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../../../../packages/firebase-server/src/lib/function/assert.ts"],"names":[],"mappings":";;;;AAEA,uCAAkD;AAClD,mCAAsF;AAEtF,SAAgB,oBAAoB,CAAC,OAAwC;IAC3E,IAAI,CAAC,IAAA,+BAAqB,EAAC,OAAO,CAAC,EAAE;QACnC,MAAM,IAAA,2CAAmC,GAAE,CAAC;KAC7C;AACH,CAAC;AAJD,oDAIC;AAED;;;;;;GAMG;AACH,SAAsB,kBAAkB,CAAmC,QAAW,EAAE,OAAgB;;QACtG,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,CAAC;QAE3C,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,MAAM,IAAA,8BAAsB,EAAC;gBAC3B,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,OAAO,QAAQ,CAAC,SAAS,mBAAmB;aACjE,CAAC,CAAC;SACJ;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AAVD,gDAUC"}
|
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [8.12.4](https://github.com/dereekb/dbx-components/compare/v8.12.3-dev...v8.12.4) (2022-07-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [8.12.3](https://github.com/dereekb/dbx-components/compare/v8.12.2-dev...v8.12.3) (2022-07-09)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [8.12.2](https://github.com/dereekb/dbx-components/compare/v8.12.1-dev...v8.12.2) (2022-07-08)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
5
17
|
## [8.12.1](https://github.com/dereekb/dbx-components/compare/v8.12.0-dev...v8.12.1) (2022-07-08)
|
|
6
18
|
|
|
7
19
|
|
package/test/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/test",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.4",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@dereekb/firebase": "8.12.
|
|
9
|
+
"@dereekb/firebase": "8.12.4",
|
|
10
10
|
"rxfire": "^6.0.3",
|
|
11
11
|
"rxjs": "^7.0.0",
|
|
12
12
|
"firebase": "^9.8.0",
|
|
13
|
-
"@dereekb/util": "8.12.
|
|
13
|
+
"@dereekb/util": "8.12.4",
|
|
14
14
|
"make-error": "^1.3.0",
|
|
15
15
|
"ts-essentials": "^9.1.2",
|
|
16
16
|
"extra-set": "^2.2.11",
|
|
17
|
-
"@dereekb/rxjs": "8.12.
|
|
17
|
+
"@dereekb/rxjs": "8.12.4",
|
|
18
18
|
"ms": "^3.0.0-canary.1",
|
|
19
|
-
"@dereekb/model": "8.12.
|
|
19
|
+
"@dereekb/model": "8.12.4",
|
|
20
20
|
"class-transformer": "^0.5.1",
|
|
21
21
|
"class-validator": "^0.13.2",
|
|
22
|
-
"@dereekb/date": "8.12.
|
|
22
|
+
"@dereekb/date": "8.12.4",
|
|
23
23
|
"date-fns": "^2.28.0",
|
|
24
24
|
"date-fns-tz": "^1.3.0",
|
|
25
25
|
"rrule": "2.7.0",
|
|
26
|
-
"@dereekb/util/test": "8.12.
|
|
26
|
+
"@dereekb/util/test": "8.12.4",
|
|
27
27
|
"firebase-admin": "^11.0.0",
|
|
28
28
|
"jsonwebtoken": "^8.0.0",
|
|
29
29
|
"firebase-functions": "^3.22.0",
|
|
30
30
|
"@nestjs/common": "^8.4.0",
|
|
31
31
|
"@google-cloud/firestore": "^5.0.2",
|
|
32
|
-
"@dereekb/firebase/test": "8.12.
|
|
33
|
-
"@dereekb/firebase-server": "8.12.
|
|
34
|
-
"@dereekb/nestjs": "8.12.
|
|
32
|
+
"@dereekb/firebase/test": "8.12.4",
|
|
33
|
+
"@dereekb/firebase-server": "8.12.4",
|
|
34
|
+
"@dereekb/nestjs": "8.12.4",
|
|
35
35
|
"@nestjs/config": "^2.0.1",
|
|
36
36
|
"@nestjs/core": "^8.4.0",
|
|
37
37
|
"@nestjs/platform-express": "^8.4.0",
|