@naturalcycles/cloud-storage-lib 2.1.0 → 2.2.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.
@@ -1,6 +1,6 @@
1
1
  import type { Storage, StorageOptions } from '@google-cloud/storage';
2
2
  import type { CommonLogger, LocalTimeInput } from '@naturalcycles/js-lib';
3
- import type { ReadableBinary, ReadableTyped, WritableBinary } from '@naturalcycles/nodejs-lib';
3
+ import type { ReadableBinary, ReadableTyped, WritableBinary } from '@naturalcycles/nodejs-lib/stream';
4
4
  import type { CommonStorage, CommonStorageGetOptions, FileEntry } from './commonStorage.js';
5
5
  import type { GCPServiceAccount } from './model.js';
6
6
  export type { Storage, StorageOptions, };
@@ -1,5 +1,5 @@
1
1
  import type { LocalTimeInput } from '@naturalcycles/js-lib';
2
- import type { ReadableBinary, ReadableTyped, WritableBinary } from '@naturalcycles/nodejs-lib';
2
+ import type { ReadableBinary, ReadableTyped, WritableBinary } from '@naturalcycles/nodejs-lib/stream';
3
3
  export interface FileEntry {
4
4
  filePath: string;
5
5
  content: Buffer;
@@ -1,5 +1,5 @@
1
1
  import type { Readable, Writable } from 'node:stream';
2
- import type { ReadableTyped } from '@naturalcycles/nodejs-lib';
2
+ import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream';
3
3
  import type { CommonStorage, CommonStorageGetOptions, FileEntry } from './commonStorage.js';
4
4
  export interface CommonStorageBucketCfg {
5
5
  storage: CommonStorage;
@@ -1,5 +1,5 @@
1
1
  import type { CommonDBCreateOptions, CommonKeyValueDB, IncrementTuple, KeyValueDBTuple } from '@naturalcycles/db-lib';
2
- import type { ReadableTyped } from '@naturalcycles/nodejs-lib';
2
+ import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream';
3
3
  import type { CommonStorage } from './commonStorage.js';
4
4
  export interface CommonStorageKeyValueDBCfg {
5
5
  storage: CommonStorage;
@@ -1,5 +1,5 @@
1
1
  import type { LocalTimeInput, StringMap } from '@naturalcycles/js-lib';
2
- import type { ReadableBinary, ReadableTyped, WritableBinary } from '@naturalcycles/nodejs-lib';
2
+ import { type ReadableBinary, type ReadableTyped, type WritableBinary } from '@naturalcycles/nodejs-lib/stream';
3
3
  import type { CommonStorage, CommonStorageGetOptions, FileEntry } from './commonStorage.js';
4
4
  export declare class InMemoryCommonStorage implements CommonStorage {
5
5
  /**
@@ -1,5 +1,7 @@
1
1
  import { _assert, _isTruthy, _stringMapEntries, _substringAfterLast, localTime, } from '@naturalcycles/js-lib';
2
- import { fs2, md5, readableFrom } from '@naturalcycles/nodejs-lib';
2
+ import { md5 } from '@naturalcycles/nodejs-lib';
3
+ import { fs2 } from '@naturalcycles/nodejs-lib/fs2';
4
+ import { readableFrom, } from '@naturalcycles/nodejs-lib/stream';
3
5
  export class InMemoryCommonStorage {
4
6
  /**
5
7
  * data[bucketName][filePath] = Buffer
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "@google-cloud/storage": "^7",
6
6
  "@naturalcycles/db-lib": "^10",
7
7
  "@naturalcycles/js-lib": "^15",
8
- "@naturalcycles/nodejs-lib": "^14",
8
+ "@naturalcycles/nodejs-lib": "^15",
9
9
  "tslib": "^2"
10
10
  },
11
11
  "devDependencies": {
@@ -13,6 +13,9 @@
13
13
  "@types/node": "^24",
14
14
  "firebase-admin": "^13"
15
15
  },
16
+ "exports": {
17
+ ".": "./dist/index.js"
18
+ },
16
19
  "files": [
17
20
  "dist",
18
21
  "src",
@@ -34,7 +37,7 @@
34
37
  "engines": {
35
38
  "node": ">=22.12.0"
36
39
  },
37
- "version": "2.1.0",
40
+ "version": "2.2.0",
38
41
  "description": "CommonStorage implementation based on Google Cloud Storage",
39
42
  "author": "Natural Cycles Team",
40
43
  "license": "MIT",
@@ -9,7 +9,11 @@ import {
9
9
  pMap,
10
10
  SKIP,
11
11
  } from '@naturalcycles/js-lib'
12
- import type { ReadableBinary, ReadableTyped, WritableBinary } from '@naturalcycles/nodejs-lib'
12
+ import type {
13
+ ReadableBinary,
14
+ ReadableTyped,
15
+ WritableBinary,
16
+ } from '@naturalcycles/nodejs-lib/stream'
13
17
  import type { CommonStorage, CommonStorageGetOptions, FileEntry } from './commonStorage.js'
14
18
  import type { GCPServiceAccount } from './model.js'
15
19
 
@@ -1,5 +1,9 @@
1
1
  import type { LocalTimeInput } from '@naturalcycles/js-lib'
2
- import type { ReadableBinary, ReadableTyped, WritableBinary } from '@naturalcycles/nodejs-lib'
2
+ import type {
3
+ ReadableBinary,
4
+ ReadableTyped,
5
+ WritableBinary,
6
+ } from '@naturalcycles/nodejs-lib/stream'
3
7
 
4
8
  export interface FileEntry {
5
9
  filePath: string
@@ -1,6 +1,6 @@
1
1
  import type { Readable, Writable } from 'node:stream'
2
2
  import { AppError, pMap } from '@naturalcycles/js-lib'
3
- import type { ReadableTyped } from '@naturalcycles/nodejs-lib'
3
+ import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream'
4
4
  import type { CommonStorage, CommonStorageGetOptions, FileEntry } from './commonStorage.js'
5
5
 
6
6
  export interface CommonStorageBucketCfg {
@@ -7,7 +7,7 @@ import type {
7
7
  import { commonKeyValueDBFullSupport } from '@naturalcycles/db-lib'
8
8
  import type { StringMap } from '@naturalcycles/js-lib'
9
9
  import { AppError, pMap } from '@naturalcycles/js-lib'
10
- import type { ReadableTyped } from '@naturalcycles/nodejs-lib'
10
+ import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream'
11
11
  import type { CommonStorage } from './commonStorage.js'
12
12
 
13
13
  export interface CommonStorageKeyValueDBCfg {
@@ -6,8 +6,14 @@ import {
6
6
  _substringAfterLast,
7
7
  localTime,
8
8
  } from '@naturalcycles/js-lib'
9
- import type { ReadableBinary, ReadableTyped, WritableBinary } from '@naturalcycles/nodejs-lib'
10
- import { fs2, md5, readableFrom } from '@naturalcycles/nodejs-lib'
9
+ import { md5 } from '@naturalcycles/nodejs-lib'
10
+ import { fs2 } from '@naturalcycles/nodejs-lib/fs2'
11
+ import {
12
+ type ReadableBinary,
13
+ readableFrom,
14
+ type ReadableTyped,
15
+ type WritableBinary,
16
+ } from '@naturalcycles/nodejs-lib/stream'
11
17
  import type { CommonStorage, CommonStorageGetOptions, FileEntry } from './commonStorage.js'
12
18
 
13
19
  export class InMemoryCommonStorage implements CommonStorage {