@naturalcycles/cloud-storage-lib 1.12.1 → 1.13.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.
@@ -29,4 +29,5 @@ export declare class CommonStorageKeyValueDB implements CommonKeyValueDB {
29
29
  streamValues(table: string, limit?: number): ReadableTyped<Buffer>;
30
30
  streamEntries(table: string, limit?: number): ReadableTyped<KeyValueDBTuple>;
31
31
  count(table: string): Promise<number>;
32
+ increment(_table: string, _id: string, _by?: number): Promise<number>;
32
33
  }
@@ -77,5 +77,8 @@ class CommonStorageKeyValueDB {
77
77
  const { bucketName, prefix } = this.getBucketAndPrefix(table);
78
78
  return (await this.cfg.storage.getFileNames(bucketName, { prefix })).length;
79
79
  }
80
+ async increment(_table, _id, _by) {
81
+ throw new js_lib_1.AppError('CommonStorageKeyValueDB.increment() is not implemented');
82
+ }
80
83
  }
81
84
  exports.CommonStorageKeyValueDB = CommonStorageKeyValueDB;
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "@naturalcycles/nodejs-lib": "^13.1.0"
11
11
  },
12
12
  "devDependencies": {
13
- "@naturalcycles/dev-lib": "^13.0.1",
13
+ "@naturalcycles/dev-lib": "^15.18.0",
14
14
  "@types/node": "^20.4.6",
15
15
  "firebase-admin": "^12.0.0",
16
16
  "jest": "^29.1.2"
@@ -35,7 +35,7 @@
35
35
  "engines": {
36
36
  "node": ">=18.12.0"
37
37
  },
38
- "version": "1.12.1",
38
+ "version": "1.13.1",
39
39
  "description": "CommonStorage implementation based on Google Cloud Storage",
40
40
  "author": "Natural Cycles Team",
41
41
  "license": "MIT"
@@ -1,5 +1,5 @@
1
1
  import { CommonDBCreateOptions, CommonKeyValueDB, KeyValueDBTuple } from '@naturalcycles/db-lib'
2
- import { pMap, StringMap } from '@naturalcycles/js-lib'
2
+ import { AppError, pMap, StringMap } from '@naturalcycles/js-lib'
3
3
  import { ReadableTyped } from '@naturalcycles/nodejs-lib'
4
4
  import { CommonStorage } from './commonStorage'
5
5
 
@@ -100,4 +100,8 @@ export class CommonStorageKeyValueDB implements CommonKeyValueDB {
100
100
 
101
101
  return (await this.cfg.storage.getFileNames(bucketName, { prefix })).length
102
102
  }
103
+
104
+ async increment(_table: string, _id: string, _by?: number): Promise<number> {
105
+ throw new AppError('CommonStorageKeyValueDB.increment() is not implemented')
106
+ }
103
107
  }