@naturalcycles/firestore-lib 1.1.8 → 1.1.11

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.
@@ -1,9 +1,9 @@
1
- import { Query } from '@google-cloud/firestore';
2
- import { BaseCommonDB, CommonDB, CommonDBOptions, CommonDBSaveOptions, CommonDBStreamOptions, DBQuery, DBTransaction, ObjectWithId, RunQueryResult, AnyObjectWithId } from '@naturalcycles/db-lib';
1
+ import { Firestore, Query } from '@google-cloud/firestore';
2
+ import { BaseCommonDB, CommonDB, CommonDBOptions, CommonDBSaveOptions, CommonDBStreamOptions, DBQuery, DBTransaction, RunQueryResult } from '@naturalcycles/db-lib';
3
+ import { ObjectWithId, AnyObjectWithId } from '@naturalcycles/js-lib';
3
4
  import { ReadableTyped } from '@naturalcycles/nodejs-lib';
4
- import * as firebaseAdmin from 'firebase-admin';
5
5
  export interface FirestoreDBCfg {
6
- firestore: firebaseAdmin.firestore.Firestore;
6
+ firestore: Firestore;
7
7
  }
8
8
  export interface FirestoreDBOptions extends CommonDBOptions {
9
9
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
+ import { Firestore } from '@google-cloud/firestore';
1
2
  import { FirestoreDB, FirestoreDBCfg, FirestoreDBOptions, FirestoreDBSaveOptions } from './firestore.db';
2
3
  import { dbQueryToFirestoreQuery } from './query.util';
3
4
  export type { FirestoreDBCfg, FirestoreDBOptions, FirestoreDBSaveOptions };
4
- export { FirestoreDB, dbQueryToFirestoreQuery };
5
+ export { Firestore, FirestoreDB, dbQueryToFirestoreQuery };
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dbQueryToFirestoreQuery = exports.FirestoreDB = void 0;
3
+ exports.dbQueryToFirestoreQuery = exports.FirestoreDB = exports.Firestore = void 0;
4
+ const firestore_1 = require("@google-cloud/firestore");
5
+ Object.defineProperty(exports, "Firestore", { enumerable: true, get: function () { return firestore_1.Firestore; } });
4
6
  const firestore_db_1 = require("./firestore.db");
5
7
  Object.defineProperty(exports, "FirestoreDB", { enumerable: true, get: function () { return firestore_db_1.FirestoreDB; } });
6
8
  const query_util_1 = require("./query.util");
@@ -1,3 +1,4 @@
1
1
  import { Query } from '@google-cloud/firestore';
2
- import { DBQuery, ObjectWithId } from '@naturalcycles/db-lib';
2
+ import { DBQuery } from '@naturalcycles/db-lib';
3
+ import { ObjectWithId } from '@naturalcycles/js-lib';
3
4
  export declare function dbQueryToFirestoreQuery<ROW extends ObjectWithId>(dbQuery: DBQuery<ROW>, emptyQuery: Query): Query;
package/package.json CHANGED
@@ -4,19 +4,17 @@
4
4
  "prepare": "husky install"
5
5
  },
6
6
  "dependencies": {
7
+ "@google-cloud/firestore": "^4.5.0",
7
8
  "@naturalcycles/db-lib": "^8.2.0",
8
9
  "@naturalcycles/js-lib": "^14.6.0",
9
- "@naturalcycles/nodejs-lib": "^12.4.0"
10
- },
11
- "peerDependencies": {
12
- "firebase-admin": ">=9.3.0"
10
+ "@naturalcycles/nodejs-lib": "^12.4.0",
11
+ "firebase-admin": "^10.0.0"
13
12
  },
14
13
  "devDependencies": {
15
14
  "@naturalcycles/dev-lib": "^12.1.2",
16
15
  "@naturalcycles/test-lib": "^1.0.3",
17
- "@types/node": "^16.7.1",
18
- "dotenv": "^10.0.0",
19
- "firebase-admin": "^10.0.0",
16
+ "@types/node": "^17.0.22",
17
+ "dotenv": "^16.0.0",
20
18
  "jest": "^27.0.6"
21
19
  },
22
20
  "files": [
@@ -37,9 +35,9 @@
37
35
  "url": "https://github.com/NaturalCycles/firestore-lib"
38
36
  },
39
37
  "engines": {
40
- "node": ">=12.13"
38
+ "node": ">=14.15.0"
41
39
  },
42
- "version": "1.1.8",
40
+ "version": "1.1.11",
43
41
  "description": "Firestore implementation of CommonDB interface",
44
42
  "author": "Natural Cycles Team",
45
43
  "license": "MIT"
package/readme.md CHANGED
@@ -8,10 +8,3 @@
8
8
  # Features
9
9
 
10
10
  - ...
11
-
12
- # Packaging
13
-
14
- - `engines.node >= 10.13`: Latest Node.js LTS
15
- - `main: dist/index.js`: commonjs, es2018
16
- - `types: dist/index.d.ts`: typescript types
17
- - `/src` folder with source `*.ts` files included
@@ -1,4 +1,4 @@
1
- import { Query, QueryDocumentSnapshot, QuerySnapshot } from '@google-cloud/firestore'
1
+ import { Firestore, Query, QueryDocumentSnapshot, QuerySnapshot } from '@google-cloud/firestore'
2
2
  import {
3
3
  BaseCommonDB,
4
4
  CommonDB,
@@ -7,18 +7,23 @@ import {
7
7
  CommonDBStreamOptions,
8
8
  DBQuery,
9
9
  DBTransaction,
10
- ObjectWithId,
11
10
  RunQueryResult,
12
- AnyObjectWithId,
13
11
  } from '@naturalcycles/db-lib'
14
- import { ErrorMode, pMap, _chunk, _omit, _filterUndefinedValues } from '@naturalcycles/js-lib'
12
+ import {
13
+ ErrorMode,
14
+ pMap,
15
+ _chunk,
16
+ _omit,
17
+ _filterUndefinedValues,
18
+ ObjectWithId,
19
+ AnyObjectWithId,
20
+ } from '@naturalcycles/js-lib'
15
21
  import { ReadableTyped, transformMapSimple } from '@naturalcycles/nodejs-lib'
16
- import * as firebaseAdmin from 'firebase-admin'
17
22
  import { escapeDocId, unescapeDocId } from './firestore.util'
18
23
  import { dbQueryToFirestoreQuery } from './query.util'
19
24
 
20
25
  export interface FirestoreDBCfg {
21
- firestore: firebaseAdmin.firestore.Firestore
26
+ firestore: Firestore
22
27
  }
23
28
 
24
29
  export interface FirestoreDBOptions extends CommonDBOptions {}
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Firestore } from '@google-cloud/firestore'
1
2
  import {
2
3
  FirestoreDB,
3
4
  FirestoreDBCfg,
@@ -8,4 +9,4 @@ import { dbQueryToFirestoreQuery } from './query.util'
8
9
 
9
10
  export type { FirestoreDBCfg, FirestoreDBOptions, FirestoreDBSaveOptions }
10
11
 
11
- export { FirestoreDB, dbQueryToFirestoreQuery }
12
+ export { Firestore, FirestoreDB, dbQueryToFirestoreQuery }
package/src/query.util.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Query, WhereFilterOp } from '@google-cloud/firestore'
2
- import { DBQuery, DBQueryFilterOperator, ObjectWithId } from '@naturalcycles/db-lib'
2
+ import { DBQuery, DBQueryFilterOperator } from '@naturalcycles/db-lib'
3
+ import { ObjectWithId } from '@naturalcycles/js-lib'
3
4
 
4
5
  // Map DBQueryFilterOp to WhereFilterOp
5
6
  // Currently it's fully aligned!
package/CHANGELOG.md DELETED
@@ -1,133 +0,0 @@
1
- ## [1.1.8](https://github.com/NaturalCycles/firestore-lib/compare/v1.1.7...v1.1.8) (2021-10-18)
2
-
3
-
4
- ### Bug Fixes
5
-
6
- * correctly filter undefined values on save ([1eff2b4](https://github.com/NaturalCycles/firestore-lib/commit/1eff2b40fdb2ccfd137be268871d449ea2cbc74f))
7
-
8
- ## [1.1.7](https://github.com/NaturalCycles/firestore-lib/compare/v1.1.6...v1.1.7) (2021-10-18)
9
-
10
-
11
- ### Bug Fixes
12
-
13
- * stop removing null values on save ([03b8f21](https://github.com/NaturalCycles/firestore-lib/commit/03b8f218c9c030d55ff769a653a6332580ab44dc))
14
-
15
- ## [1.1.6](https://github.com/NaturalCycles/firestore-lib/compare/v1.1.5...v1.1.6) (2021-10-17)
16
-
17
-
18
- ### Bug Fixes
19
-
20
- * db-lib compat ([ad28580](https://github.com/NaturalCycles/firestore-lib/commit/ad28580cf772b9ff05d07cc89e6ee19be52981e3))
21
-
22
- ## [1.1.5](https://github.com/NaturalCycles/firestore-lib/compare/v1.1.4...v1.1.5) (2021-10-17)
23
-
24
-
25
- ### Bug Fixes
26
-
27
- * adapt to latest db-lib ([e64d4ca](https://github.com/NaturalCycles/firestore-lib/commit/e64d4cad792a2f24d3e592dbbff59492017a9d60))
28
-
29
- ## [1.1.4](https://github.com/NaturalCycles/firestore-lib/compare/v1.1.3...v1.1.4) (2021-10-01)
30
-
31
-
32
- ### Bug Fixes
33
-
34
- * adapt to db-lib ([05cbc49](https://github.com/NaturalCycles/firestore-lib/commit/05cbc4996efe5a3f1091835b016e2534b59befde))
35
-
36
- ## [1.1.3](https://github.com/NaturalCycles/firestore-lib/compare/v1.1.2...v1.1.3) (2021-08-25)
37
-
38
-
39
- ### Bug Fixes
40
-
41
- * deps ([541438a](https://github.com/NaturalCycles/firestore-lib/commit/541438aab99613d5b0c69b48b68008d6e0fbe06f))
42
-
43
- ## [1.1.2](https://github.com/NaturalCycles/firestore-lib/compare/v1.1.1...v1.1.2) (2021-02-27)
44
-
45
-
46
- ### Bug Fixes
47
-
48
- * deps ([741c1cb](https://github.com/NaturalCycles/firestore-lib/commit/741c1cbd2fbc913a32bdd26d394a14ea9e548f76))
49
-
50
- ## [1.1.1](https://github.com/NaturalCycles/firestore-lib/compare/v1.1.0...v1.1.1) (2020-11-05)
51
-
52
-
53
- ### Bug Fixes
54
-
55
- * adapt to db-lib ([032f821](https://github.com/NaturalCycles/firestore-lib/commit/032f82164f200d75fb5ed6c72ba12209fce45e9c))
56
-
57
- # [1.1.0](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.9...v1.1.0) (2020-10-25)
58
-
59
-
60
- ### Features
61
-
62
- * adapt to current db-lib ([4c2f228](https://github.com/NaturalCycles/firestore-lib/commit/4c2f228c4f80711735a53b20fc75a9a74878ffb9))
63
-
64
- ## [1.0.9](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.8...v1.0.9) (2020-03-22)
65
-
66
-
67
- ### Bug Fixes
68
-
69
- * deps ([53f70bb](https://github.com/NaturalCycles/firestore-lib/commit/53f70bbe9b746c500bb394d506bc0a707f09b4f2))
70
-
71
- ## [1.0.8](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.7...v1.0.8) (2019-09-21)
72
-
73
-
74
- ### Bug Fixes
75
-
76
- * adapt to db-lib ([d046dd6](https://github.com/NaturalCycles/firestore-lib/commit/d046dd6))
77
-
78
- ## [1.0.7](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.6...v1.0.7) (2019-09-20)
79
-
80
-
81
- ### Bug Fixes
82
-
83
- * adapt to new db-lib ([414b97c](https://github.com/NaturalCycles/firestore-lib/commit/414b97c))
84
-
85
- ## [1.0.6](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.5...v1.0.6) (2019-08-24)
86
-
87
-
88
- ### Bug Fixes
89
-
90
- * missing index.ts ([b2b75cd](https://github.com/NaturalCycles/firestore-lib/commit/b2b75cd))
91
-
92
- ## [1.0.5](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.4...v1.0.5) (2019-08-23)
93
-
94
-
95
- ### Bug Fixes
96
-
97
- * adopt to db-lib ([60800db](https://github.com/NaturalCycles/firestore-lib/commit/60800db))
98
-
99
- ## [1.0.4](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.3...v1.0.4) (2019-08-20)
100
-
101
-
102
- ### Bug Fixes
103
-
104
- * return await ([6c6267d](https://github.com/NaturalCycles/firestore-lib/commit/6c6267d))
105
-
106
- ## [1.0.3](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.2...v1.0.3) (2019-08-20)
107
-
108
-
109
- ### Bug Fixes
110
-
111
- * update to recent commondb interface ([d506916](https://github.com/NaturalCycles/firestore-lib/commit/d506916))
112
-
113
- ## [1.0.2](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.1...v1.0.2) (2019-08-18)
114
-
115
-
116
- ### Bug Fixes
117
-
118
- * filterUndefinedValues ([57e0b24](https://github.com/NaturalCycles/firestore-lib/commit/57e0b24))
119
-
120
- ## [1.0.1](https://github.com/NaturalCycles/firestore-lib/compare/v1.0.0...v1.0.1) (2019-08-18)
121
-
122
-
123
- ### Bug Fixes
124
-
125
- * update to recent db-lib ([dbbb093](https://github.com/NaturalCycles/firestore-lib/commit/dbbb093))
126
-
127
- # 1.0.0 (2019-07-28)
128
-
129
-
130
- ### Features
131
-
132
- * first version ([6d129a9](https://github.com/NaturalCycles/firestore-lib/commit/6d129a9))
133
- * init project by create-module ([205703f](https://github.com/NaturalCycles/firestore-lib/commit/205703f))