@dereekb/firebase-server 9.1.2 → 9.3.1

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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [9.3.1](https://github.com/dereekb/dbx-components/compare/v9.3.0-dev...v9.3.1) (2022-08-21)
6
+
7
+
8
+
9
+ # [9.3.0](https://github.com/dereekb/dbx-components/compare/v9.2.0-dev...v9.3.0) (2022-08-20)
10
+
11
+
12
+
13
+ # [9.2.0](https://github.com/dereekb/dbx-components/compare/v9.1.2-dev...v9.2.0) (2022-08-18)
14
+
15
+
16
+
5
17
  ## [9.1.2](https://github.com/dereekb/dbx-components/compare/v9.1.1-dev...v9.1.2) (2022-08-16)
6
18
 
7
19
 
package/package.json CHANGED
@@ -1,32 +1,33 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server",
3
- "version": "9.1.2",
3
+ "version": "9.3.1",
4
4
  "devDependencies": {
5
5
  "firebase-functions-test": "2.0.2"
6
6
  },
7
7
  "peerDependencies": {
8
8
  "jsonwebtoken": "^8.0.0",
9
- "@dereekb/firebase": "9.1.2",
9
+ "@dereekb/firebase": "9.3.1",
10
10
  "rxjs": "^7.5.0",
11
11
  "firebase": "^9.9.2",
12
- "@dereekb/util": "9.1.2",
12
+ "@dereekb/util": "9.3.1",
13
13
  "lodash.isequal": "^4.5.0",
14
14
  "make-error": "^1.3.0",
15
15
  "ts-essentials": "^9.1.2",
16
16
  "extra-set": "^2.2.11",
17
- "@dereekb/rxjs": "9.1.2",
17
+ "@dereekb/rxjs": "9.3.1",
18
18
  "ms": "^3.0.0-canary.1",
19
- "@dereekb/model": "9.1.2",
19
+ "@dereekb/model": "9.3.1",
20
20
  "class-transformer": "^0.5.1",
21
21
  "class-validator": "^0.13.2",
22
- "@dereekb/date": "9.1.2",
22
+ "@dereekb/date": "9.3.1",
23
23
  "date-fns": "^2.29.0",
24
24
  "date-fns-tz": "^1.3.0",
25
25
  "rrule": "git+https://git@github.com/dereekb/rrule#2b13b1ea881059ba2ecfec380e12ef244ef54570",
26
+ "@vvo/tzdb": "^6.56.0",
26
27
  "firebase-functions": "^3.22.0",
27
28
  "firebase-admin": "^11.0.0",
28
29
  "@nestjs/common": "^9.0.0",
29
- "@dereekb/nestjs": "9.1.2",
30
+ "@dereekb/nestjs": "9.3.1",
30
31
  "@nestjs/config": "^2.0.1",
31
32
  "@google-cloud/firestore": "^5.0.2",
32
33
  "@nestjs/core": "^9.0.0",
@@ -9,3 +9,11 @@ export declare function assertContextHasAuth(context: functions.https.CallableCo
9
9
  * @returns
10
10
  */
11
11
  export declare function assertSnapshotData<D extends FirestoreDocument<any>>(document: D, message?: string): Promise<FirestoreDocumentData<D>>;
12
+ /**
13
+ * Asserts that the document exists. A modelNotAvailableError is thrown if the document does not exist.
14
+ *
15
+ * @param document
16
+ * @param message
17
+ * @returns
18
+ */
19
+ export declare function assertDocumentExists<D extends FirestoreDocument<any>>(document: D, message?: string): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assertSnapshotData = exports.assertContextHasAuth = void 0;
3
+ exports.assertDocumentExists = exports.assertSnapshotData = exports.assertContextHasAuth = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const context_1 = require("./context");
6
6
  const error_1 = require("./error");
@@ -29,4 +29,22 @@ function assertSnapshotData(document, message) {
29
29
  });
30
30
  }
31
31
  exports.assertSnapshotData = assertSnapshotData;
32
+ /**
33
+ * Asserts that the document exists. A modelNotAvailableError is thrown if the document does not exist.
34
+ *
35
+ * @param document
36
+ * @param message
37
+ * @returns
38
+ */
39
+ function assertDocumentExists(document, message) {
40
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
41
+ const exists = yield document.exists();
42
+ if (!exists) {
43
+ throw (0, error_1.modelNotAvailableError)({
44
+ message: message !== null && message !== void 0 ? message : `The ${document.modelType} was unavailable.`
45
+ });
46
+ }
47
+ });
48
+ }
49
+ exports.assertDocumentExists = assertDocumentExists;
32
50
  //# sourceMappingURL=assert.js.map
@@ -1 +1 @@
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"}
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;AAED;;;;;;GAMG;AACH,SAAsB,oBAAoB,CAAmC,QAAW,EAAE,OAAgB;;QACxG,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC;QAEvC,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAA,8BAAsB,EAAC;gBAC3B,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,OAAO,QAAQ,CAAC,SAAS,mBAAmB;aACjE,CAAC,CAAC;SACJ;IACH,CAAC;CAAA;AARD,oDAQC"}
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
+ ## [9.3.1](https://github.com/dereekb/dbx-components/compare/v9.3.0-dev...v9.3.1) (2022-08-21)
6
+
7
+
8
+
9
+ # [9.3.0](https://github.com/dereekb/dbx-components/compare/v9.2.0-dev...v9.3.0) (2022-08-20)
10
+
11
+
12
+
13
+ # [9.2.0](https://github.com/dereekb/dbx-components/compare/v9.1.2-dev...v9.2.0) (2022-08-18)
14
+
15
+
16
+
5
17
  ## [9.1.2](https://github.com/dereekb/dbx-components/compare/v9.1.1-dev...v9.1.2) (2022-08-16)
6
18
 
7
19
 
package/test/package.json CHANGED
@@ -1,37 +1,38 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/test",
3
- "version": "9.1.2",
3
+ "version": "9.3.1",
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": "9.1.2",
9
+ "@dereekb/firebase": "9.3.1",
10
10
  "rxjs": "^7.5.0",
11
11
  "firebase": "^9.9.2",
12
- "@dereekb/util": "9.1.2",
12
+ "@dereekb/util": "9.3.1",
13
13
  "lodash.isequal": "^4.5.0",
14
14
  "make-error": "^1.3.0",
15
15
  "ts-essentials": "^9.1.2",
16
16
  "extra-set": "^2.2.11",
17
- "@dereekb/rxjs": "9.1.2",
17
+ "@dereekb/rxjs": "9.3.1",
18
18
  "ms": "^3.0.0-canary.1",
19
- "@dereekb/model": "9.1.2",
19
+ "@dereekb/model": "9.3.1",
20
20
  "class-transformer": "^0.5.1",
21
21
  "class-validator": "^0.13.2",
22
- "@dereekb/date": "9.1.2",
22
+ "@dereekb/date": "9.3.1",
23
23
  "date-fns": "^2.29.0",
24
24
  "date-fns-tz": "^1.3.0",
25
25
  "rrule": "git+https://git@github.com/dereekb/rrule#2b13b1ea881059ba2ecfec380e12ef244ef54570",
26
- "@dereekb/util/test": "9.1.2",
26
+ "@vvo/tzdb": "^6.56.0",
27
+ "@dereekb/util/test": "9.3.1",
27
28
  "firebase-admin": "^11.0.0",
28
29
  "jsonwebtoken": "^8.0.0",
29
30
  "firebase-functions": "^3.22.0",
30
31
  "@nestjs/common": "^9.0.0",
31
32
  "@google-cloud/firestore": "^5.0.2",
32
- "@dereekb/firebase/test": "9.1.2",
33
- "@dereekb/firebase-server": "9.1.2",
34
- "@dereekb/nestjs": "9.1.2",
33
+ "@dereekb/firebase/test": "9.3.1",
34
+ "@dereekb/firebase-server": "9.3.1",
35
+ "@dereekb/nestjs": "9.3.1",
35
36
  "@nestjs/config": "^2.0.1",
36
37
  "@nestjs/core": "^9.0.0",
37
38
  "@nestjs/platform-express": "^9.0.0",