@knymbus/firestoredb 1.0.14 → 1.0.15

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.
@@ -79,7 +79,7 @@ class FirestoreDB {
79
79
  * Basic implementation. For production, you'd expand the 'filter' to handle where clauses.
80
80
  */
81
81
  this.find = (filter = {}) => {
82
- this._checkPermission('read');
82
+ this._checkPermission('read', null, filter);
83
83
  return new FirestoreQuery_1.FirestoreQuery(this._db, this._collectionName, this._collectionRef, filter, this._sdk, this._buildConstraints.bind(this), //Pass the private helper
84
84
  this.countDocuments.bind(this), // pass the count helper
85
85
  this._isSoftDeleteEnabled);
@@ -6,5 +6,5 @@ import { DBOptions, FirestoreSDK } from "../types";
6
6
  *
7
7
  * @returns Returns a generator function to create collection-specific instances.
8
8
  */
9
- export declare const createFirestoreDB: (db: Firestore, sdk: FirestoreSDK, FirestoreOptions?: DBOptions) => (collectionName: string, options?: DBOptions) => FirestoreDB<unknown>;
9
+ export declare const createFirestoreDB: <T>(db: Firestore, sdk: FirestoreSDK, FirestoreOptions?: DBOptions) => (collectionName: string, options?: DBOptions) => FirestoreDB<T>;
10
10
  //# sourceMappingURL=createFirestoreDB.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createFirestoreDB.d.ts","sourceRoot":"","sources":["../../../src/utils/createFirestoreDB.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,IAAI,SAAS,EAAE,KAAK,YAAY,EAAE,mBAAkB,SAAc,MAMxF,gBAAgB,MAAM,EAAE,UAAS,SAA4B,yBAGxE,CAAC"}
1
+ {"version":3,"file":"createFirestoreDB.d.ts","sourceRoot":"","sources":["../../../src/utils/createFirestoreDB.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,IAAI,SAAS,EAAE,KAAK,YAAY,EAAE,mBAAkB,SAAc,MAM3F,gBAAgB,MAAM,EAAE,UAAS,SAAc,mBAG1D,CAAC"}
@@ -12,8 +12,8 @@ const createFirestoreDB = (db, sdk, FirestoreOptions = {}) => {
12
12
  * @param collectionName - The name of the Firestore collection
13
13
  * @param options - Optional: { softDelete: true }
14
14
  */
15
- return (collectionName, options = FirestoreOptions) => {
16
- return new FirestoreDB_1.FirestoreDB(db, collectionName, sdk, options);
15
+ return (collectionName, options = {}) => {
16
+ return new FirestoreDB_1.FirestoreDB(db, collectionName, sdk, Object.assign(options, FirestoreOptions));
17
17
  };
18
18
  };
19
19
  exports.createFirestoreDB = createFirestoreDB;
@@ -79,7 +79,7 @@ class FirestoreDB {
79
79
  * Basic implementation. For production, you'd expand the 'filter' to handle where clauses.
80
80
  */
81
81
  this.find = (filter = {}) => {
82
- this._checkPermission('read');
82
+ this._checkPermission('read', null, filter);
83
83
  return new FirestoreQuery_1.FirestoreQuery(this._db, this._collectionName, this._collectionRef, filter, this._sdk, this._buildConstraints.bind(this), //Pass the private helper
84
84
  this.countDocuments.bind(this), // pass the count helper
85
85
  this._isSoftDeleteEnabled);
@@ -6,5 +6,5 @@ import { DBOptions, FirestoreSDK } from "../types";
6
6
  *
7
7
  * @returns Returns a generator function to create collection-specific instances.
8
8
  */
9
- export declare const createFirestoreDB: (db: Firestore, sdk: FirestoreSDK, FirestoreOptions?: DBOptions) => (collectionName: string, options?: DBOptions) => FirestoreDB<unknown>;
9
+ export declare const createFirestoreDB: <T>(db: Firestore, sdk: FirestoreSDK, FirestoreOptions?: DBOptions) => (collectionName: string, options?: DBOptions) => FirestoreDB<T>;
10
10
  //# sourceMappingURL=createFirestoreDB.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createFirestoreDB.d.ts","sourceRoot":"","sources":["../../../src/utils/createFirestoreDB.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,IAAI,SAAS,EAAE,KAAK,YAAY,EAAE,mBAAkB,SAAc,MAMxF,gBAAgB,MAAM,EAAE,UAAS,SAA4B,yBAGxE,CAAC"}
1
+ {"version":3,"file":"createFirestoreDB.d.ts","sourceRoot":"","sources":["../../../src/utils/createFirestoreDB.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,IAAI,SAAS,EAAE,KAAK,YAAY,EAAE,mBAAkB,SAAc,MAM3F,gBAAgB,MAAM,EAAE,UAAS,SAAc,mBAG1D,CAAC"}
@@ -12,8 +12,8 @@ const createFirestoreDB = (db, sdk, FirestoreOptions = {}) => {
12
12
  * @param collectionName - The name of the Firestore collection
13
13
  * @param options - Optional: { softDelete: true }
14
14
  */
15
- return (collectionName, options = FirestoreOptions) => {
16
- return new FirestoreDB_1.FirestoreDB(db, collectionName, sdk, options);
15
+ return (collectionName, options = {}) => {
16
+ return new FirestoreDB_1.FirestoreDB(db, collectionName, sdk, Object.assign(options, FirestoreOptions));
17
17
  };
18
18
  };
19
19
  exports.createFirestoreDB = createFirestoreDB;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knymbus/firestoredb",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "MongoDB-style wrapper for Firestore with parallel streaming and caching.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",