@naturalcycles/datastore-lib 4.5.0 → 4.6.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.
- package/dist/DatastoreStreamReadable.d.ts +1 -1
- package/dist/DatastoreStreamReadable.js +2 -1
- package/dist/datastore.db.d.ts +3 -1
- package/dist/datastore.db.js +5 -1
- package/dist/datastore.model.d.ts +2 -1
- package/dist/datastoreKeyValueDB.d.ts +1 -1
- package/dist/datastoreKeyValueDB.js +3 -2
- package/dist/query.util.d.ts +1 -1
- package/package.json +1 -1
- package/src/DatastoreStreamReadable.ts +4 -2
- package/src/datastore.db.ts +9 -16
- package/src/datastore.model.ts +2 -1
- package/src/datastoreKeyValueDB.ts +5 -4
- package/src/query.util.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import type { Query } from '@google-cloud/datastore';
|
|
3
|
-
import type { CommonLogger } from '@naturalcycles/js-lib';
|
|
3
|
+
import type { CommonLogger } from '@naturalcycles/js-lib/log';
|
|
4
4
|
import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream';
|
|
5
5
|
import type { DatastoreDBStreamOptions } from './datastore.model.js';
|
|
6
6
|
export declare class DatastoreStreamReadable<T = any> extends Readable implements ReadableTyped<T> {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
|
-
import { _ms
|
|
2
|
+
import { _ms } from '@naturalcycles/js-lib/datetime';
|
|
3
|
+
import { pRetry } from '@naturalcycles/js-lib/promise';
|
|
3
4
|
export class DatastoreStreamReadable extends Readable {
|
|
4
5
|
q;
|
|
5
6
|
logger;
|
package/dist/datastore.db.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Datastore, Key, Transaction } from '@google-cloud/datastore';
|
|
2
2
|
import type { CommonDB, CommonDBOptions, CommonDBReadOptions, CommonDBSaveOptions, CommonDBSupport, CommonDBTransactionOptions, DBQuery, DBTransaction, DBTransactionFn, RunQueryResult } from '@naturalcycles/db-lib';
|
|
3
3
|
import { BaseCommonDB } from '@naturalcycles/db-lib';
|
|
4
|
-
import type {
|
|
4
|
+
import type { JsonSchemaObject, JsonSchemaRootObject } from '@naturalcycles/js-lib/json-schema';
|
|
5
|
+
import type { CommonLogger } from '@naturalcycles/js-lib/log';
|
|
6
|
+
import type { ObjectWithId } from '@naturalcycles/js-lib/types';
|
|
5
7
|
import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream';
|
|
6
8
|
import type { DatastoreDBCfg, DatastoreDBOptions, DatastoreDBReadOptions, DatastoreDBSaveOptions, DatastoreDBStreamOptions, DatastorePropertyStats, DatastoreStats } from './datastore.model.js';
|
|
7
9
|
/**
|
package/dist/datastore.db.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Transform } from 'node:stream';
|
|
2
2
|
import { BaseCommonDB, commonDBFullSupport } from '@naturalcycles/db-lib';
|
|
3
|
-
import {
|
|
3
|
+
import { _chunk } from '@naturalcycles/js-lib';
|
|
4
|
+
import { _assert, _errorDataAppend, TimeoutError } from '@naturalcycles/js-lib/error';
|
|
5
|
+
import { commonLoggerMinLevel } from '@naturalcycles/js-lib/log';
|
|
6
|
+
import { _omit } from '@naturalcycles/js-lib/object';
|
|
7
|
+
import { pMap, pRetry, pRetryFn, pTimeout } from '@naturalcycles/js-lib/promise';
|
|
4
8
|
import { boldWhite } from '@naturalcycles/nodejs-lib/colors';
|
|
5
9
|
import { DatastoreType } from './datastore.model.js';
|
|
6
10
|
import { DatastoreStreamReadable } from './DatastoreStreamReadable.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DatastoreOptions, Key } from '@google-cloud/datastore';
|
|
2
2
|
import type { CommonDBOptions, CommonDBReadOptions, CommonDBSaveOptions } from '@naturalcycles/db-lib';
|
|
3
|
-
import type { CommonLogger
|
|
3
|
+
import type { CommonLogger } from '@naturalcycles/js-lib/log';
|
|
4
|
+
import type { NumberOfSeconds, ObjectWithId } from '@naturalcycles/js-lib/types';
|
|
4
5
|
export interface DatastorePayload<T = any> {
|
|
5
6
|
key: Key;
|
|
6
7
|
data: T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommonKeyValueDB, IncrementTuple, KeyValueDBTuple } from '@naturalcycles/db-lib';
|
|
1
|
+
import type { CommonKeyValueDB, IncrementTuple, KeyValueDBTuple } from '@naturalcycles/db-lib/kv';
|
|
2
2
|
import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream';
|
|
3
3
|
import { DatastoreDB } from './datastore.db.js';
|
|
4
4
|
import type { DatastoreDBCfg } from './datastore.model.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DBQuery } from '@naturalcycles/db-lib';
|
|
2
|
+
import { commonKeyValueDBFullSupport } from '@naturalcycles/db-lib/kv';
|
|
3
|
+
import { AppError } from '@naturalcycles/js-lib/error';
|
|
3
4
|
import { DatastoreDB } from './datastore.db.js';
|
|
4
5
|
const excludeFromIndexes = ['v'];
|
|
5
6
|
export class DatastoreKeyValueDB {
|
package/dist/query.util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PropertyFilter, Query } from '@google-cloud/datastore';
|
|
2
2
|
import type { DBQuery } from '@naturalcycles/db-lib';
|
|
3
|
-
import type { ObjectWithId } from '@naturalcycles/js-lib';
|
|
3
|
+
import type { ObjectWithId } from '@naturalcycles/js-lib/types';
|
|
4
4
|
export declare function dbQueryToDatastoreQuery<ROW extends ObjectWithId>(dbQuery: Readonly<DBQuery<ROW>>, emptyQuery: Query, propertyFilterClass: typeof PropertyFilter): Query;
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Readable } from 'node:stream'
|
|
2
2
|
import type { Query } from '@google-cloud/datastore'
|
|
3
3
|
import type { RunQueryInfo, RunQueryOptions } from '@google-cloud/datastore/build/src/query.js'
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { _ms } from '@naturalcycles/js-lib/datetime'
|
|
5
|
+
import type { CommonLogger } from '@naturalcycles/js-lib/log'
|
|
6
|
+
import { pRetry } from '@naturalcycles/js-lib/promise'
|
|
7
|
+
import type { UnixTimestampMillis } from '@naturalcycles/js-lib/types'
|
|
6
8
|
import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream'
|
|
7
9
|
import type { DatastoreDBStreamOptions } from './datastore.model.js'
|
|
8
10
|
|
package/src/datastore.db.ts
CHANGED
|
@@ -15,8 +15,9 @@ import type {
|
|
|
15
15
|
RunQueryResult,
|
|
16
16
|
} from '@naturalcycles/db-lib'
|
|
17
17
|
import { BaseCommonDB, commonDBFullSupport } from '@naturalcycles/db-lib'
|
|
18
|
+
import { _chunk } from '@naturalcycles/js-lib'
|
|
19
|
+
import { _assert, _errorDataAppend, TimeoutError } from '@naturalcycles/js-lib/error'
|
|
18
20
|
import type {
|
|
19
|
-
CommonLogger,
|
|
20
21
|
JsonSchemaAny,
|
|
21
22
|
JsonSchemaBoolean,
|
|
22
23
|
JsonSchemaNull,
|
|
@@ -24,21 +25,13 @@ import type {
|
|
|
24
25
|
JsonSchemaObject,
|
|
25
26
|
JsonSchemaRootObject,
|
|
26
27
|
JsonSchemaString,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} from '@naturalcycles/js-lib'
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
_omit,
|
|
35
|
-
commonLoggerMinLevel,
|
|
36
|
-
pMap,
|
|
37
|
-
pRetry,
|
|
38
|
-
pRetryFn,
|
|
39
|
-
pTimeout,
|
|
40
|
-
TimeoutError,
|
|
41
|
-
} from '@naturalcycles/js-lib'
|
|
28
|
+
} from '@naturalcycles/js-lib/json-schema'
|
|
29
|
+
import type { CommonLogger } from '@naturalcycles/js-lib/log'
|
|
30
|
+
import { commonLoggerMinLevel } from '@naturalcycles/js-lib/log'
|
|
31
|
+
import { _omit } from '@naturalcycles/js-lib/object'
|
|
32
|
+
import type { PRetryOptions } from '@naturalcycles/js-lib/promise'
|
|
33
|
+
import { pMap, pRetry, pRetryFn, pTimeout } from '@naturalcycles/js-lib/promise'
|
|
34
|
+
import type { ObjectWithId } from '@naturalcycles/js-lib/types'
|
|
42
35
|
import { boldWhite } from '@naturalcycles/nodejs-lib/colors'
|
|
43
36
|
import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream'
|
|
44
37
|
import type {
|
package/src/datastore.model.ts
CHANGED
|
@@ -4,7 +4,8 @@ import type {
|
|
|
4
4
|
CommonDBReadOptions,
|
|
5
5
|
CommonDBSaveOptions,
|
|
6
6
|
} from '@naturalcycles/db-lib'
|
|
7
|
-
import type { CommonLogger
|
|
7
|
+
import type { CommonLogger } from '@naturalcycles/js-lib/log'
|
|
8
|
+
import type { NumberOfSeconds, ObjectWithId } from '@naturalcycles/js-lib/types'
|
|
8
9
|
|
|
9
10
|
export interface DatastorePayload<T = any> {
|
|
10
11
|
key: Key
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { AppError } from '@naturalcycles/js-lib'
|
|
1
|
+
import { DBQuery } from '@naturalcycles/db-lib'
|
|
2
|
+
import type { CommonKeyValueDB, IncrementTuple, KeyValueDBTuple } from '@naturalcycles/db-lib/kv'
|
|
3
|
+
import { commonKeyValueDBFullSupport } from '@naturalcycles/db-lib/kv'
|
|
4
|
+
import { AppError } from '@naturalcycles/js-lib/error'
|
|
5
|
+
import type { ObjectWithId } from '@naturalcycles/js-lib/types'
|
|
5
6
|
import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream'
|
|
6
7
|
import { DatastoreDB } from './datastore.db.js'
|
|
7
8
|
import type { DatastoreDBCfg } from './datastore.model.js'
|
package/src/query.util.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropertyFilter, Query } from '@google-cloud/datastore'
|
|
2
2
|
import type { DBQuery, DBQueryFilterOperator } from '@naturalcycles/db-lib'
|
|
3
|
-
import type { ObjectWithId, StringMap } from '@naturalcycles/js-lib'
|
|
3
|
+
import type { ObjectWithId, StringMap } from '@naturalcycles/js-lib/types'
|
|
4
4
|
|
|
5
5
|
const FNAME_MAP: StringMap = {
|
|
6
6
|
id: '__key__',
|