@naturalcycles/firestore-lib 2.6.0 → 2.7.0

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.
@@ -20,17 +20,17 @@ export declare class FirestoreDB extends BaseCommonDB implements CommonDB {
20
20
  constructor(cfg: FirestoreDBCfg);
21
21
  support: CommonDBSupport;
22
22
  getByIds<ROW extends ObjectWithId>(table: string, ids: string[], opt?: FirestoreDBReadOptions): Promise<ROW[]>;
23
- multiGetByIds<ROW extends ObjectWithId>(map: StringMap<string[]>, opt?: CommonDBReadOptions): Promise<StringMap<ROW[]>>;
23
+ multiGet<ROW extends ObjectWithId>(map: StringMap<string[]>, opt?: CommonDBReadOptions): Promise<StringMap<ROW[]>>;
24
24
  runQuery<ROW extends ObjectWithId>(q: DBQuery<ROW>, opt?: FirestoreDBOptions): Promise<RunQueryResult<ROW>>;
25
25
  runFirestoreQuery<ROW extends ObjectWithId>(q: Query): Promise<ROW[]>;
26
26
  runQueryCount<ROW extends ObjectWithId>(q: DBQuery<ROW>, _opt?: FirestoreDBOptions): Promise<number>;
27
27
  streamQuery<ROW extends ObjectWithId>(q: DBQuery<ROW>, _opt?: CommonDBStreamOptions): ReadableTyped<ROW>;
28
28
  saveBatch<ROW extends ObjectWithId>(table: string, rows: ROW[], opt?: FirestoreDBSaveOptions<ROW>): Promise<void>;
29
- multiSaveBatch<ROW extends ObjectWithId>(map: StringMap<ROW[]>, opt?: FirestoreDBSaveOptions<ROW>): Promise<void>;
29
+ multiSave<ROW extends ObjectWithId>(map: StringMap<ROW[]>, opt?: FirestoreDBSaveOptions<ROW>): Promise<void>;
30
30
  patchById<ROW extends ObjectWithId>(table: string, id: string, patch: Partial<ROW>, opt?: FirestoreDBOptions): Promise<void>;
31
31
  deleteByQuery<ROW extends ObjectWithId>(q: DBQuery<ROW>, opt?: FirestoreDBOptions): Promise<number>;
32
32
  deleteByIds(table: string, ids: string[], opt?: FirestoreDBOptions): Promise<number>;
33
- multiDeleteByIds(map: StringMap<string[]>, opt?: FirestoreDBOptions): Promise<number>;
33
+ multiDelete(map: StringMap<string[]>, opt?: FirestoreDBOptions): Promise<number>;
34
34
  private querySnapshotToArray;
35
35
  runInTransaction(fn: DBTransactionFn, opt?: CommonDBTransactionOptions): Promise<void>;
36
36
  /**
@@ -47,7 +47,7 @@ export class FirestoreDB extends BaseCommonDB {
47
47
  })
48
48
  .filter(_isTruthy);
49
49
  }
50
- async multiGetByIds(map, opt = {}) {
50
+ async multiGet(map, opt = {}) {
51
51
  const result = {};
52
52
  const { firestore } = this.cfg;
53
53
  const refs = [];
@@ -132,7 +132,7 @@ export class FirestoreDB extends BaseCommonDB {
132
132
  await batch.commit();
133
133
  }, { concurrency: FIRESTORE_RECOMMENDED_CONCURRENCY });
134
134
  }
135
- async multiSaveBatch(map, opt = {}) {
135
+ async multiSave(map, opt = {}) {
136
136
  const { firestore } = this.cfg;
137
137
  const method = methodMap[opt.saveMethod] || 'set';
138
138
  if (opt.tx) {
@@ -206,7 +206,7 @@ export class FirestoreDB extends BaseCommonDB {
206
206
  }, { concurrency: FIRESTORE_RECOMMENDED_CONCURRENCY });
207
207
  return ids.length;
208
208
  }
209
- async multiDeleteByIds(map, opt = {}) {
209
+ async multiDelete(map, opt = {}) {
210
210
  const { firestore } = this.cfg;
211
211
  const refs = [];
212
212
  for (const [table, ids] of _stringMapEntries(map)) {
package/package.json CHANGED
@@ -38,7 +38,7 @@
38
38
  "engines": {
39
39
  "node": ">=22.12.0"
40
40
  },
41
- "version": "2.6.0",
41
+ "version": "2.7.0",
42
42
  "description": "Firestore implementation of CommonDB interface",
43
43
  "author": "Natural Cycles Team",
44
44
  "license": "MIT",
@@ -95,7 +95,7 @@ export class FirestoreDB extends BaseCommonDB implements CommonDB {
95
95
  .filter(_isTruthy)
96
96
  }
97
97
 
98
- override async multiGetByIds<ROW extends ObjectWithId>(
98
+ override async multiGet<ROW extends ObjectWithId>(
99
99
  map: StringMap<string[]>,
100
100
  opt: CommonDBReadOptions = {},
101
101
  ): Promise<StringMap<ROW[]>> {
@@ -230,7 +230,7 @@ export class FirestoreDB extends BaseCommonDB implements CommonDB {
230
230
  )
231
231
  }
232
232
 
233
- override async multiSaveBatch<ROW extends ObjectWithId>(
233
+ override async multiSave<ROW extends ObjectWithId>(
234
234
  map: StringMap<ROW[]>,
235
235
  opt: FirestoreDBSaveOptions<ROW> = {},
236
236
  ): Promise<void> {
@@ -361,7 +361,7 @@ export class FirestoreDB extends BaseCommonDB implements CommonDB {
361
361
  return ids.length
362
362
  }
363
363
 
364
- override async multiDeleteByIds(
364
+ override async multiDelete(
365
365
  map: StringMap<string[]>,
366
366
  opt: FirestoreDBOptions = {},
367
367
  ): Promise<number> {