@naturalcycles/datastore-lib 3.23.1 → 3.23.3

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.
@@ -206,8 +206,8 @@ class DatastoreDB extends db_lib_1.BaseCommonDB {
206
206
  const tx = this.ds().transaction();
207
207
  try {
208
208
  await tx.run();
209
- const ops = (0, db_lib_1.mergeDBOperations)(_tx.ops);
210
- for await (const op of ops) {
209
+ // const ops = mergeDBOperations(_tx.ops)
210
+ for await (const op of _tx.ops) {
211
211
  if (op.type === 'saveBatch') {
212
212
  await this.saveBatch(op.table, op.rows, { ...opt, tx });
213
213
  }
@@ -1,6 +1,6 @@
1
1
  import type { DatastoreOptions, Key, Transaction } from '@google-cloud/datastore';
2
2
  import { CommonDBOptions, CommonDBSaveOptions } from '@naturalcycles/db-lib';
3
- import { AnyObjectWithId, CommonLogger, ObjectWithId } from '@naturalcycles/js-lib';
3
+ import { CommonLogger, ObjectWithId } from '@naturalcycles/js-lib';
4
4
  export interface DatastorePayload<T = any> {
5
5
  key: Key;
6
6
  data: T;
@@ -99,7 +99,7 @@ export interface DatastoreDBStreamOptions extends DatastoreDBOptions {
99
99
  export interface DatastoreDBOptions extends CommonDBOptions {
100
100
  tx?: Transaction;
101
101
  }
102
- export interface DatastoreDBSaveOptions<ROW extends Partial<ObjectWithId> = AnyObjectWithId> extends CommonDBSaveOptions<ROW> {
102
+ export interface DatastoreDBSaveOptions<ROW extends Partial<ObjectWithId> = any> extends CommonDBSaveOptions<ROW> {
103
103
  tx?: Transaction;
104
104
  }
105
105
  export interface DatastoreStats {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/datastore-lib",
3
- "version": "3.23.1",
3
+ "version": "3.23.3",
4
4
  "description": "Opinionated library to work with Google Datastore",
5
5
  "scripts": {
6
6
  "prepare": "husky install"
@@ -6,7 +6,6 @@ import {
6
6
  CommonDBSaveMethod,
7
7
  DBQuery,
8
8
  DBTransaction,
9
- mergeDBOperations,
10
9
  RunQueryResult,
11
10
  } from '@naturalcycles/db-lib'
12
11
  import {
@@ -334,9 +333,9 @@ export class DatastoreDB extends BaseCommonDB implements CommonDB {
334
333
  try {
335
334
  await tx.run()
336
335
 
337
- const ops = mergeDBOperations(_tx.ops)
336
+ // const ops = mergeDBOperations(_tx.ops)
338
337
 
339
- for await (const op of ops) {
338
+ for await (const op of _tx.ops) {
340
339
  if (op.type === 'saveBatch') {
341
340
  await this.saveBatch(op.table, op.rows, { ...opt, tx })
342
341
  } else if (op.type === 'deleteByIds') {
@@ -1,6 +1,6 @@
1
1
  import type { DatastoreOptions, Key, Transaction } from '@google-cloud/datastore'
2
2
  import { CommonDBOptions, CommonDBSaveOptions } from '@naturalcycles/db-lib'
3
- import { AnyObjectWithId, CommonLogger, ObjectWithId } from '@naturalcycles/js-lib'
3
+ import { CommonLogger, ObjectWithId } from '@naturalcycles/js-lib'
4
4
 
5
5
  export interface DatastorePayload<T = any> {
6
6
  key: Key
@@ -114,7 +114,7 @@ export interface DatastoreDBStreamOptions extends DatastoreDBOptions {
114
114
  export interface DatastoreDBOptions extends CommonDBOptions {
115
115
  tx?: Transaction
116
116
  }
117
- export interface DatastoreDBSaveOptions<ROW extends Partial<ObjectWithId> = AnyObjectWithId>
117
+ export interface DatastoreDBSaveOptions<ROW extends Partial<ObjectWithId> = any>
118
118
  extends CommonDBSaveOptions<ROW> {
119
119
  tx?: Transaction
120
120
  }