@naturalcycles/backend-lib 4.23.2 → 4.23.3
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/cfg/tsconfig.json +2 -2
- package/dist/db/httpDB.d.ts +2 -1
- package/dist/db/httpDB.js +10 -0
- package/package.json +2 -2
- package/src/db/httpDB.ts +14 -1
package/cfg/tsconfig.json
CHANGED
package/dist/db/httpDB.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseCommonDB, CommonDB, CommonDBOptions, CommonDBSaveOptions, CommonDBStreamOptions, DBQuery, RunQueryResult } from '@naturalcycles/db-lib';
|
|
1
|
+
import { BaseCommonDB, CommonDB, CommonDBOptions, CommonDBSaveOptions, CommonDBStreamOptions, CommonDBSupport, DBQuery, RunQueryResult } from '@naturalcycles/db-lib';
|
|
2
2
|
import { FetcherOptions, JsonSchemaRootObject, ObjectWithId } from '@naturalcycles/js-lib';
|
|
3
3
|
import { ReadableTyped } from '@naturalcycles/nodejs-lib';
|
|
4
4
|
export interface HttpDBCfg extends FetcherOptions {
|
|
@@ -9,6 +9,7 @@ export interface HttpDBCfg extends FetcherOptions {
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class HttpDB extends BaseCommonDB implements CommonDB {
|
|
11
11
|
cfg: HttpDBCfg;
|
|
12
|
+
support: CommonDBSupport;
|
|
12
13
|
constructor(cfg: HttpDBCfg);
|
|
13
14
|
setCfg(cfg: HttpDBCfg): void;
|
|
14
15
|
private fetcher;
|
package/dist/db/httpDB.js
CHANGED
|
@@ -11,6 +11,16 @@ class HttpDB extends db_lib_1.BaseCommonDB {
|
|
|
11
11
|
constructor(cfg) {
|
|
12
12
|
super();
|
|
13
13
|
this.cfg = cfg;
|
|
14
|
+
this.support = {
|
|
15
|
+
...db_lib_1.commonDBFullSupport,
|
|
16
|
+
streaming: false,
|
|
17
|
+
createTable: false,
|
|
18
|
+
bufferValues: false,
|
|
19
|
+
updateSaveMethod: false,
|
|
20
|
+
insertSaveMethod: false,
|
|
21
|
+
transactions: false,
|
|
22
|
+
updateByQuery: false,
|
|
23
|
+
};
|
|
14
24
|
this.setCfg(cfg);
|
|
15
25
|
}
|
|
16
26
|
setCfg(cfg) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/backend-lib",
|
|
3
|
-
"version": "4.23.
|
|
3
|
+
"version": "4.23.3",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepare": "husky install",
|
|
6
6
|
"serve": "APP_ENV=dev nodemon",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@sentry/node": "^7.0.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@naturalcycles/db-lib": "^
|
|
19
|
+
"@naturalcycles/db-lib": "^9.1.0",
|
|
20
20
|
"@naturalcycles/js-lib": "^14.27.0",
|
|
21
21
|
"@naturalcycles/nodejs-lib": "^13.1.0",
|
|
22
22
|
"@types/cookie-parser": "^1.4.1",
|
package/src/db/httpDB.ts
CHANGED
|
@@ -2,9 +2,11 @@ import { Readable } from 'node:stream'
|
|
|
2
2
|
import {
|
|
3
3
|
BaseCommonDB,
|
|
4
4
|
CommonDB,
|
|
5
|
+
commonDBFullSupport,
|
|
5
6
|
CommonDBOptions,
|
|
6
7
|
CommonDBSaveOptions,
|
|
7
8
|
CommonDBStreamOptions,
|
|
9
|
+
CommonDBSupport,
|
|
8
10
|
DBQuery,
|
|
9
11
|
RunQueryResult,
|
|
10
12
|
} from '@naturalcycles/db-lib'
|
|
@@ -25,6 +27,17 @@ export interface HttpDBCfg extends FetcherOptions {
|
|
|
25
27
|
* Implementation of CommonDB that proxies all requests via HTTP to "httpDBRequestHandler".
|
|
26
28
|
*/
|
|
27
29
|
export class HttpDB extends BaseCommonDB implements CommonDB {
|
|
30
|
+
override support: CommonDBSupport = {
|
|
31
|
+
...commonDBFullSupport,
|
|
32
|
+
streaming: false,
|
|
33
|
+
createTable: false,
|
|
34
|
+
bufferValues: false,
|
|
35
|
+
updateSaveMethod: false,
|
|
36
|
+
insertSaveMethod: false,
|
|
37
|
+
transactions: false,
|
|
38
|
+
updateByQuery: false,
|
|
39
|
+
}
|
|
40
|
+
|
|
28
41
|
constructor(public cfg: HttpDBCfg) {
|
|
29
42
|
super()
|
|
30
43
|
this.setCfg(cfg)
|
|
@@ -106,7 +119,7 @@ export class HttpDB extends BaseCommonDB implements CommonDB {
|
|
|
106
119
|
})
|
|
107
120
|
}
|
|
108
121
|
|
|
109
|
-
async deleteByIds(table: string, ids: string[], opt?: CommonDBOptions): Promise<number> {
|
|
122
|
+
override async deleteByIds(table: string, ids: string[], opt?: CommonDBOptions): Promise<number> {
|
|
110
123
|
return await this.fetcher.put(`deleteByIds`, {
|
|
111
124
|
json: {
|
|
112
125
|
table,
|