@naturalcycles/datastore-lib 4.8.0 → 4.8.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.
- package/dist/datastore.db.js +3 -1
- package/package.json +2 -2
- package/src/datastore.db.ts +3 -1
package/dist/datastore.db.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Transform } from 'node:stream';
|
|
2
2
|
import { BaseCommonDB, commonDBFullSupport } from '@naturalcycles/db-lib';
|
|
3
|
+
import { _round } from '@naturalcycles/js-lib';
|
|
3
4
|
import { _chunk } from '@naturalcycles/js-lib/array/array.util.js';
|
|
4
5
|
import { _assert } from '@naturalcycles/js-lib/error/assert.js';
|
|
5
6
|
import { _errorDataAppend, TimeoutError } from '@naturalcycles/js-lib/error/error.util.js';
|
|
@@ -471,7 +472,8 @@ export class DatastoreDB extends BaseCommonDB {
|
|
|
471
472
|
return {};
|
|
472
473
|
return {
|
|
473
474
|
// Datastore expects UnixTimestamp in milliseconds
|
|
474
|
-
|
|
475
|
+
// Datastore requires the timestamp to be rounded to the whole minutes
|
|
476
|
+
readTime: _round(opt.readAt, 60) * 1000,
|
|
475
477
|
};
|
|
476
478
|
}
|
|
477
479
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/datastore-lib",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.8.
|
|
4
|
+
"version": "4.8.1",
|
|
5
5
|
"description": "Opinionated library to work with Google Datastore, implements CommonDB",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@google-cloud/datastore": "^10",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/node": "^24",
|
|
14
|
-
"@naturalcycles/dev-lib": "
|
|
14
|
+
"@naturalcycles/dev-lib": "18.4.2"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js"
|
package/src/datastore.db.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
RunQueryResult,
|
|
16
16
|
} from '@naturalcycles/db-lib'
|
|
17
17
|
import { BaseCommonDB, commonDBFullSupport } from '@naturalcycles/db-lib'
|
|
18
|
+
import { _round } from '@naturalcycles/js-lib'
|
|
18
19
|
import { _chunk } from '@naturalcycles/js-lib/array/array.util.js'
|
|
19
20
|
import { _assert } from '@naturalcycles/js-lib/error/assert.js'
|
|
20
21
|
import { _errorDataAppend, TimeoutError } from '@naturalcycles/js-lib/error/error.util.js'
|
|
@@ -660,7 +661,8 @@ export class DatastoreDB extends BaseCommonDB implements CommonDB {
|
|
|
660
661
|
|
|
661
662
|
return {
|
|
662
663
|
// Datastore expects UnixTimestamp in milliseconds
|
|
663
|
-
|
|
664
|
+
// Datastore requires the timestamp to be rounded to the whole minutes
|
|
665
|
+
readTime: _round(opt.readAt, 60) * 1000,
|
|
664
666
|
}
|
|
665
667
|
}
|
|
666
668
|
}
|