@naturalcycles/cloud-storage-lib 2.0.0 → 2.0.2
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.
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/testing/commonStorageTest.d.ts +1 -1
- package/dist/testing/commonStorageTest.js +3 -2
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +1 -0
- package/package.json +4 -4
- package/src/index.ts +0 -1
- package/src/testing/commonStorageTest.ts +7 -2
- package/src/testing/index.ts +1 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,4 +2,4 @@ import type { CommonStorage } from '../commonStorage.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* This test suite must be idempotent.
|
|
4
4
|
*/
|
|
5
|
-
export declare function runCommonStorageTest(storage: CommonStorage, bucketName: string): void
|
|
5
|
+
export declare function runCommonStorageTest(storage: CommonStorage, bucketName: string): Promise<void>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { _range, _substringAfterLast, pMap } from '@naturalcycles/js-lib';
|
|
2
|
-
import { expect, test } from 'vitest';
|
|
3
2
|
const TEST_FOLDER = 'test/subdir';
|
|
4
3
|
const TEST_ITEMS = _range(10).map(n => ({
|
|
5
4
|
id: `id_${n + 1}`,
|
|
@@ -25,7 +24,9 @@ const TEST_FILES = [TEST_ITEMS, TEST_ITEMS2, TEST_ITEMS3].map((obj, i) => ({
|
|
|
25
24
|
/**
|
|
26
25
|
* This test suite must be idempotent.
|
|
27
26
|
*/
|
|
28
|
-
export function runCommonStorageTest(storage, bucketName) {
|
|
27
|
+
export async function runCommonStorageTest(storage, bucketName) {
|
|
28
|
+
// this is because vitest cannot be "required" from cjs
|
|
29
|
+
const { test, expect } = await import('vitest');
|
|
29
30
|
// test('createBucket', async () => {
|
|
30
31
|
// await storage.createBucket(bucketName)
|
|
31
32
|
// })
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './commonStorageTest.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './commonStorageTest.js';
|
package/package.json
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@google-cloud/storage": "^7",
|
|
14
14
|
"@naturalcycles/db-lib": "^10",
|
|
15
|
-
"@naturalcycles/js-lib": "^
|
|
16
|
-
"@naturalcycles/nodejs-lib": "^
|
|
15
|
+
"@naturalcycles/js-lib": "^15",
|
|
16
|
+
"@naturalcycles/nodejs-lib": "^14"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@naturalcycles/dev-lib": "^
|
|
19
|
+
"@naturalcycles/dev-lib": "^18",
|
|
20
20
|
"@types/node": "^22",
|
|
21
21
|
"@vitest/coverage-v8": "^3",
|
|
22
22
|
"firebase-admin": "^13",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=22.12.0"
|
|
45
45
|
},
|
|
46
|
-
"version": "2.0.
|
|
46
|
+
"version": "2.0.2",
|
|
47
47
|
"description": "CommonStorage implementation based on Google Cloud Storage",
|
|
48
48
|
"author": "Natural Cycles Team",
|
|
49
49
|
"license": "MIT"
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { StringMap } from '@naturalcycles/js-lib'
|
|
2
2
|
import { _range, _substringAfterLast, pMap } from '@naturalcycles/js-lib'
|
|
3
|
-
import { expect, test } from 'vitest'
|
|
4
3
|
import type { CommonStorage, FileEntry } from '../commonStorage.js'
|
|
5
4
|
|
|
6
5
|
const TEST_FOLDER = 'test/subdir'
|
|
@@ -33,7 +32,13 @@ const TEST_FILES: FileEntry[] = [TEST_ITEMS, TEST_ITEMS2, TEST_ITEMS3].map((obj,
|
|
|
33
32
|
/**
|
|
34
33
|
* This test suite must be idempotent.
|
|
35
34
|
*/
|
|
36
|
-
export function runCommonStorageTest(
|
|
35
|
+
export async function runCommonStorageTest(
|
|
36
|
+
storage: CommonStorage,
|
|
37
|
+
bucketName: string,
|
|
38
|
+
): Promise<void> {
|
|
39
|
+
// this is because vitest cannot be "required" from cjs
|
|
40
|
+
const { test, expect } = await import('vitest')
|
|
41
|
+
|
|
37
42
|
// test('createBucket', async () => {
|
|
38
43
|
// await storage.createBucket(bucketName)
|
|
39
44
|
// })
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './commonStorageTest.js'
|