proto.io 0.0.205 → 0.0.206
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/adapters/file/aliyun-oss.d.ts +3 -3
- package/dist/adapters/file/database.d.ts +2 -2
- package/dist/adapters/file/database.js +2 -2
- package/dist/adapters/file/database.mjs +2 -2
- package/dist/adapters/file/filesystem.d.ts +3 -3
- package/dist/adapters/file/google-cloud-storage.d.ts +3 -3
- package/dist/adapters/storage/progres.d.ts +5 -8
- package/dist/adapters/storage/progres.js +13 -17
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +13 -17
- package/dist/adapters/storage/progres.mjs.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +3 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +4 -3
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +30 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -12
- package/dist/index.mjs.map +1 -1
- package/dist/internals/{base-Cf7WkDhO.d.ts → base-Be7PFKEC.d.ts} +2 -2
- package/dist/internals/base-Be7PFKEC.d.ts.map +1 -0
- package/dist/internals/{chunk-ONaLyXL0.d.ts → chunk-CEQtSsWb.d.ts} +3 -3
- package/dist/internals/chunk-CEQtSsWb.d.ts.map +1 -0
- package/dist/internals/{index-DByHjIHI.js → index-BFZlY3IO.js} +23 -23
- package/dist/internals/index-BFZlY3IO.js.map +1 -0
- package/dist/internals/{index-DtCgllhg.mjs → index-CSnRU_KQ.mjs} +23 -23
- package/dist/internals/index-CSnRU_KQ.mjs.map +1 -0
- package/dist/internals/{index-DI-jPA6f.d.ts → index-CURcwPBG.d.ts} +3 -3
- package/dist/internals/index-CURcwPBG.d.ts.map +1 -0
- package/dist/internals/{index-B8TESzd9.js → index-CsmAYB_t.js} +2 -1
- package/dist/internals/{index-B8TESzd9.js.map → index-CsmAYB_t.js.map} +1 -1
- package/dist/internals/{index-C4vwSN74.js → index-CyPxh5dl.js} +241 -2
- package/dist/internals/index-CyPxh5dl.js.map +1 -0
- package/dist/internals/{index-JdEs5VLY.d.ts → index-DnbbpIaO.d.ts} +15 -18
- package/dist/internals/index-DnbbpIaO.d.ts.map +1 -0
- package/dist/internals/{index-al1N-qi7.mjs → index-DpN9tcbY.mjs} +2 -2
- package/dist/internals/{index-al1N-qi7.mjs.map → index-DpN9tcbY.mjs.map} +1 -1
- package/dist/internals/{index-Blw7vAq5.mjs → index-iRVgw566.mjs} +241 -2
- package/dist/internals/index-iRVgw566.mjs.map +1 -0
- package/dist/internals/{random-6nHcBOxn.mjs → random-BnGB_bVS.mjs} +3 -3
- package/dist/internals/{random-6nHcBOxn.mjs.map → random-BnGB_bVS.mjs.map} +1 -1
- package/dist/internals/{random-Dk3OhDNU.js → random-D7S1XD7F.js} +3 -3
- package/dist/internals/{random-Dk3OhDNU.js.map → random-D7S1XD7F.js.map} +1 -1
- package/package.json +1 -1
- package/dist/internals/base-Cf7WkDhO.d.ts.map +0 -1
- package/dist/internals/chunk-ONaLyXL0.d.ts.map +0 -1
- package/dist/internals/index-Blw7vAq5.mjs.map +0 -1
- package/dist/internals/index-C4vwSN74.js.map +0 -1
- package/dist/internals/index-DByHjIHI.js.map +0 -1
- package/dist/internals/index-DI-jPA6f.d.ts.map +0 -1
- package/dist/internals/index-DtCgllhg.mjs.map +0 -1
- package/dist/internals/index-JdEs5VLY.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as ProtoService } from '../../internals/index-
|
|
1
|
+
import { P as ProtoService } from '../../internals/index-DnbbpIaO.js';
|
|
2
2
|
import OSS from 'ali-oss';
|
|
3
|
-
import { a as FileStorageOptions } from '../../internals/base-
|
|
4
|
-
import { F as FileChunkStorageBase } from '../../internals/chunk-
|
|
3
|
+
import { a as FileStorageOptions } from '../../internals/base-Be7PFKEC.js';
|
|
4
|
+
import { F as FileChunkStorageBase } from '../../internals/chunk-CEQtSsWb.js';
|
|
5
5
|
import '@o2ter/utils-js';
|
|
6
6
|
import 'jsonwebtoken';
|
|
7
7
|
import '@o2ter/server-js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TSchema, P as ProtoService } from '../../internals/index-
|
|
2
|
-
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/base-
|
|
1
|
+
import { T as TSchema, P as ProtoService } from '../../internals/index-DnbbpIaO.js';
|
|
2
|
+
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/base-Be7PFKEC.js';
|
|
3
3
|
import '@o2ter/utils-js';
|
|
4
4
|
import 'jsonwebtoken';
|
|
5
5
|
import '@o2ter/server-js';
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _ = require('lodash');
|
|
6
6
|
var base = require('../../internals/base-BFKQpiws.js');
|
|
7
|
-
var index = require('../../internals/index-
|
|
7
|
+
var index = require('../../internals/index-CyPxh5dl.js');
|
|
8
8
|
var utilsJs = require('@o2ter/utils-js');
|
|
9
9
|
require('util');
|
|
10
10
|
require('zlib');
|
|
11
11
|
require('../../internals/private-Ciddhure.js');
|
|
12
|
-
require('../../internals/index-
|
|
12
|
+
require('../../internals/index-CsmAYB_t.js');
|
|
13
13
|
require('decimal.js');
|
|
14
14
|
|
|
15
15
|
//
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { F as FileStorageBase } from '../../internals/base-CfQi0T0I.mjs';
|
|
3
|
-
import { Q as QuerySelector } from '../../internals/index-
|
|
3
|
+
import { Q as QuerySelector } from '../../internals/index-iRVgw566.mjs';
|
|
4
4
|
import { bufferToBase64, base64ToBuffer } from '@o2ter/utils-js';
|
|
5
5
|
import 'util';
|
|
6
6
|
import 'zlib';
|
|
7
7
|
import '../../internals/private-CNw40LZ7.mjs';
|
|
8
|
-
import '../../internals/index-
|
|
8
|
+
import '../../internals/index-DpN9tcbY.mjs';
|
|
9
9
|
import 'decimal.js';
|
|
10
10
|
|
|
11
11
|
//
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as ProtoService } from '../../internals/index-
|
|
2
|
-
import { a as FileStorageOptions } from '../../internals/base-
|
|
3
|
-
import { F as FileChunkStorageBase } from '../../internals/chunk-
|
|
1
|
+
import { P as ProtoService } from '../../internals/index-DnbbpIaO.js';
|
|
2
|
+
import { a as FileStorageOptions } from '../../internals/base-Be7PFKEC.js';
|
|
3
|
+
import { F as FileChunkStorageBase } from '../../internals/chunk-CEQtSsWb.js';
|
|
4
4
|
import '@o2ter/utils-js';
|
|
5
5
|
import 'jsonwebtoken';
|
|
6
6
|
import '@o2ter/server-js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _google_cloud_storage from '@google-cloud/storage';
|
|
2
2
|
import { File, Storage } from '@google-cloud/storage';
|
|
3
|
-
import { P as ProtoService } from '../../internals/index-
|
|
4
|
-
import { a as FileStorageOptions } from '../../internals/base-
|
|
5
|
-
import { F as FileChunkStorageBase } from '../../internals/chunk-
|
|
3
|
+
import { P as ProtoService } from '../../internals/index-DnbbpIaO.js';
|
|
4
|
+
import { a as FileStorageOptions } from '../../internals/base-Be7PFKEC.js';
|
|
5
|
+
import { F as FileChunkStorageBase } from '../../internals/chunk-CEQtSsWb.js';
|
|
6
6
|
import '@o2ter/utils-js';
|
|
7
7
|
import 'jsonwebtoken';
|
|
8
8
|
import '@o2ter/server-js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Pool, PoolClient, PoolConfig } from 'pg';
|
|
2
|
-
import { a as TValueWithoutObject, T as TSchema,
|
|
2
|
+
import { a as TValueWithoutObject, T as TSchema, u as TValueWithUndefined, v as TValue, w as TUpdateOp, F as FieldSelectorExpression, Q as QueryExpression, R as RelationOptions, x as QuerySelector, y as DecodedSortOption, z as DecodedQuery, A as FindOptions, I as InsertOptions, B as FindOneOptions, C as TStorage, G as TransactionOptions, j as TObject, H as TQueryRandomOptions, J as TPubSub } from '../../internals/index-DnbbpIaO.js';
|
|
3
3
|
import * as _o2ter_utils_js from '@o2ter/utils-js';
|
|
4
4
|
import { asyncStream } from '@o2ter/utils-js';
|
|
5
5
|
import 'jsonwebtoken';
|
|
@@ -191,16 +191,13 @@ declare abstract class SqlStorage implements TStorage {
|
|
|
191
191
|
refs(object: TObject, classNames: string[], roles?: string[]): AsyncGenerator<TObject, void, unknown>;
|
|
192
192
|
nonrefs(query: DecodedQuery<FindOptions>): AsyncGenerator<TObject, void, unknown>;
|
|
193
193
|
insert(options: InsertOptions, attrs: Record<string, TValueWithUndefined>): Promise<TObject | undefined>;
|
|
194
|
-
insertMany(options: InsertOptions, values: Record<string, TValueWithUndefined>[]): Promise<
|
|
194
|
+
insertMany(options: InsertOptions, values: Record<string, TValueWithUndefined>[]): Promise<TObject[]>;
|
|
195
195
|
updateOne(query: DecodedQuery<FindOneOptions>, update: Record<string, TUpdateOp>): Promise<TObject | undefined>;
|
|
196
|
-
updateMany(query: DecodedQuery<FindOptions>, update: Record<string, TUpdateOp>): Promise<
|
|
196
|
+
updateMany(query: DecodedQuery<FindOptions>, update: Record<string, TUpdateOp>): Promise<TObject[]>;
|
|
197
197
|
upsertOne(query: DecodedQuery<FindOneOptions>, update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValueWithUndefined>): Promise<TObject | undefined>;
|
|
198
|
-
upsertMany(query: DecodedQuery<FindOptions>, update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValueWithUndefined>): Promise<
|
|
199
|
-
updated: number;
|
|
200
|
-
inserted: number;
|
|
201
|
-
}>;
|
|
198
|
+
upsertMany(query: DecodedQuery<FindOptions>, update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValueWithUndefined>): Promise<TObject[]>;
|
|
202
199
|
deleteOne(query: DecodedQuery<FindOneOptions>): Promise<TObject | undefined>;
|
|
203
|
-
deleteMany(query: DecodedQuery<FindOptions>): Promise<
|
|
200
|
+
deleteMany(query: DecodedQuery<FindOptions>): Promise<TObject[]>;
|
|
204
201
|
}
|
|
205
202
|
|
|
206
203
|
declare class PostgresStorageClient<Driver extends PostgresClientDriver> extends SqlStorage implements TPubSub {
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _ = require('lodash');
|
|
6
|
-
var index = require('../../internals/index-
|
|
6
|
+
var index = require('../../internals/index-CsmAYB_t.js');
|
|
7
7
|
var pg = require('pg');
|
|
8
8
|
var QueryStream = require('pg-query-stream');
|
|
9
9
|
var utilsJs = require('@o2ter/utils-js');
|
|
10
10
|
var Decimal = require('decimal.js');
|
|
11
11
|
var utils = require('pg/lib/utils');
|
|
12
|
-
var index$1 = require('../../internals/index-
|
|
12
|
+
var index$1 = require('../../internals/index-CyPxh5dl.js');
|
|
13
13
|
require('@o2ter/crypto-js');
|
|
14
|
-
var random$1 = require('../../internals/random-
|
|
14
|
+
var random$1 = require('../../internals/random-D7S1XD7F.js');
|
|
15
15
|
var _private = require('../../internals/private-Ciddhure.js');
|
|
16
16
|
|
|
17
17
|
//
|
|
@@ -100,7 +100,7 @@ class SQL {
|
|
|
100
100
|
query += `${dialect.placeholder(nextIdx())}::DOUBLE PRECISION`;
|
|
101
101
|
values.push(value.value);
|
|
102
102
|
}
|
|
103
|
-
else if (
|
|
103
|
+
else if (value.value instanceof Decimal) {
|
|
104
104
|
query += `${dialect.placeholder(nextIdx())}::DECIMAL`;
|
|
105
105
|
values.push(value.value.toString());
|
|
106
106
|
}
|
|
@@ -469,7 +469,7 @@ class QueryCompiler {
|
|
|
469
469
|
INSERT INTO ${{ identifier: options.className }}
|
|
470
470
|
(${_.map(keys, x => sql `${{ identifier: x }}`)})
|
|
471
471
|
VALUES ${_.map(_values, v => sql `(${_.map(keys, k => sql `${v[k]}`)})`)}
|
|
472
|
-
RETURNING
|
|
472
|
+
RETURNING ${_.map(index.defaultObjectKeys, k => sql `${{ identifier: k }}`)}
|
|
473
473
|
`;
|
|
474
474
|
}
|
|
475
475
|
updateOne(query, update) {
|
|
@@ -492,7 +492,7 @@ class QueryCompiler {
|
|
|
492
492
|
UPDATE ${{ identifier: query.className }}
|
|
493
493
|
SET ${this._encodeUpdateAttrs(query.className, update)}
|
|
494
494
|
WHERE ${{ identifier: query.className }}._id IN (SELECT ${{ identifier: fetchName }}._id FROM ${{ identifier: fetchName }})
|
|
495
|
-
RETURNING
|
|
495
|
+
RETURNING ${_.map(index.defaultObjectKeys, k => sql `${{ identifier: k }}`)}
|
|
496
496
|
`;
|
|
497
497
|
});
|
|
498
498
|
}
|
|
@@ -541,14 +541,14 @@ class QueryCompiler {
|
|
|
541
541
|
UPDATE ${{ identifier: query.className }}
|
|
542
542
|
SET ${this._encodeUpdateAttrs(query.className, update)}
|
|
543
543
|
WHERE ${{ identifier: query.className }}._id IN (SELECT ${{ identifier: fetchName }}._id FROM ${{ identifier: fetchName }})
|
|
544
|
-
RETURNING
|
|
544
|
+
RETURNING ${_.map(index.defaultObjectKeys, k => sql `${{ identifier: k }}`)}
|
|
545
545
|
)
|
|
546
546
|
, ${{ identifier: insertName }} AS (
|
|
547
547
|
INSERT INTO ${{ identifier: query.className }}
|
|
548
548
|
(${_.map(_insert, x => sql `${{ identifier: x[0] }}`)})
|
|
549
549
|
SELECT ${_.map(_insert, x => sql `${x[1]} AS ${{ identifier: x[0] }}`)}
|
|
550
550
|
WHERE NOT EXISTS(SELECT * FROM ${{ identifier: updateName }})
|
|
551
|
-
RETURNING
|
|
551
|
+
RETURNING ${_.map(index.defaultObjectKeys, k => sql `${{ identifier: k }}`)}
|
|
552
552
|
)
|
|
553
553
|
SELECT * FROM ${{ identifier: updateName }}
|
|
554
554
|
UNION
|
|
@@ -582,7 +582,7 @@ class QueryCompiler {
|
|
|
582
582
|
return this._modifyQuery(query, (fetchName) => sql `
|
|
583
583
|
DELETE FROM ${{ identifier: query.className }}
|
|
584
584
|
WHERE ${{ identifier: query.className }}._id IN (SELECT ${{ identifier: fetchName }}._id FROM ${{ identifier: fetchName }})
|
|
585
|
-
RETURNING
|
|
585
|
+
RETURNING ${_.map(index.defaultObjectKeys, k => sql `${{ identifier: k }}`)}
|
|
586
586
|
`);
|
|
587
587
|
}
|
|
588
588
|
}
|
|
@@ -773,7 +773,7 @@ class SqlStorage {
|
|
|
773
773
|
async insertMany(options, values) {
|
|
774
774
|
const compiler = this._makeCompiler(true);
|
|
775
775
|
const result = await this.query(compiler.insertMany(options, values));
|
|
776
|
-
return result.
|
|
776
|
+
return _.map(result, x => this._decodeObject(options.className, x));
|
|
777
777
|
}
|
|
778
778
|
async updateOne(query, update) {
|
|
779
779
|
const compiler = this._makeCompiler(true, query.extraFilter);
|
|
@@ -783,7 +783,7 @@ class SqlStorage {
|
|
|
783
783
|
async updateMany(query, update) {
|
|
784
784
|
const compiler = this._makeCompiler(true, query.extraFilter);
|
|
785
785
|
const updated = await this.query(compiler.updateMany(query, update));
|
|
786
|
-
return updated.
|
|
786
|
+
return _.map(updated, x => this._decodeObject(query.className, x));
|
|
787
787
|
}
|
|
788
788
|
async upsertOne(query, update, setOnInsert) {
|
|
789
789
|
const compiler = this._makeCompiler(true, query.extraFilter);
|
|
@@ -793,11 +793,7 @@ class SqlStorage {
|
|
|
793
793
|
async upsertMany(query, update, setOnInsert) {
|
|
794
794
|
const compiler = this._makeCompiler(true, query.extraFilter);
|
|
795
795
|
const upserted = await this.query(compiler.upsertMany(query, update, setOnInsert));
|
|
796
|
-
|
|
797
|
-
return {
|
|
798
|
-
updated: upserted.length - inserted,
|
|
799
|
-
inserted: inserted,
|
|
800
|
-
};
|
|
796
|
+
return _.map(upserted, x => this._decodeObject(query.className, x));
|
|
801
797
|
}
|
|
802
798
|
async deleteOne(query) {
|
|
803
799
|
const compiler = this._makeCompiler(true, query.extraFilter);
|
|
@@ -807,7 +803,7 @@ class SqlStorage {
|
|
|
807
803
|
async deleteMany(query) {
|
|
808
804
|
const compiler = this._makeCompiler(true, query.extraFilter);
|
|
809
805
|
const deleted = await this.query(compiler.deleteMany(query));
|
|
810
|
-
return deleted.
|
|
806
|
+
return _.map(deleted, x => this._decodeObject(query.className, x));
|
|
811
807
|
}
|
|
812
808
|
}
|
|
813
809
|
|