proto.io 0.0.210 → 0.0.212
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 +1 -1
- package/dist/adapters/file/database.js.map +1 -1
- package/dist/adapters/file/database.mjs +2 -2
- package/dist/adapters/file/database.mjs.map +1 -1
- 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 +8 -6
- package/dist/adapters/storage/progres.js +142 -78
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +143 -79
- package/dist/adapters/storage/progres.mjs.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +1 -1
- package/dist/client.mjs +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -14
- package/dist/index.mjs.map +1 -1
- package/dist/internals/{base-C1ndp06_.d.ts → base-CZGalGrd.d.ts} +2 -2
- package/dist/internals/base-CZGalGrd.d.ts.map +1 -0
- package/dist/internals/{chunk-DF4KyvgB.d.ts → chunk-BsT9SYny.d.ts} +3 -3
- package/dist/internals/chunk-BsT9SYny.d.ts.map +1 -0
- package/dist/internals/{index-DIRjiWPh.d.ts → index-Boxwkqe0.d.ts} +37 -15
- package/dist/internals/index-Boxwkqe0.d.ts.map +1 -0
- package/dist/internals/{index-DPPLcZx8.mjs → index-DG9HHO_U.mjs} +2 -2
- package/dist/internals/{index-DPPLcZx8.mjs.map → index-DG9HHO_U.mjs.map} +1 -1
- package/dist/internals/{index-Clo9hepf.js → index-DfnPpl1I.js} +23 -10
- package/dist/internals/index-DfnPpl1I.js.map +1 -0
- package/dist/internals/{index-l-Mk0lCc.d.ts → index-NF-U_3zG.d.ts} +2 -2
- package/dist/internals/index-NF-U_3zG.d.ts.map +1 -0
- package/dist/internals/{index-BgSBzm-K.mjs → index-ZPbBr9Db.mjs} +23 -10
- package/dist/internals/index-ZPbBr9Db.mjs.map +1 -0
- package/dist/internals/{random-ycCeBd0S.mjs → random-CufRbivU.mjs} +121 -19
- package/dist/internals/random-CufRbivU.mjs.map +1 -0
- package/dist/internals/{random-CyU_Y2Ay.js → random-DzvxbWAc.js} +161 -58
- package/dist/internals/random-DzvxbWAc.js.map +1 -0
- package/package.json +1 -1
- package/dist/internals/base-C1ndp06_.d.ts.map +0 -1
- package/dist/internals/chunk-DF4KyvgB.d.ts.map +0 -1
- package/dist/internals/index-BgSBzm-K.mjs.map +0 -1
- package/dist/internals/index-Clo9hepf.js.map +0 -1
- package/dist/internals/index-DIRjiWPh.d.ts.map +0 -1
- package/dist/internals/index-l-Mk0lCc.d.ts.map +0 -1
- package/dist/internals/random-CyU_Y2Ay.js.map +0 -1
- package/dist/internals/random-ycCeBd0S.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { Server } from '@o2ter/server-js';
|
|
3
|
-
import { Q as QueryValidator, r as resolveColumn, a as resolveDataType, g as generateId } from './internals/random-
|
|
3
|
+
import { Q as QueryValidator, r as resolveColumn, a as resolveDataType, g as generateId } from './internals/random-CufRbivU.mjs';
|
|
4
4
|
import { P as PVK } from './internals/private-CNw40LZ7.mjs';
|
|
5
5
|
import { prototypes, asyncStream, isBinaryData, base64ToBuffer } from '@o2ter/utils-js';
|
|
6
|
-
import { L as LiveQuerySubscription, T as TQuery, d as deserialize, s as serialize, a as TUser, P as ProtoType, _ as _logLevels } from './internals/index-
|
|
7
|
-
export { b as ProtoClient, c as classExtends, h as isFile, j as isJob, e as isObject, i as isQuery, g as isRole, f as isUser } from './internals/index-
|
|
6
|
+
import { L as LiveQuerySubscription, T as TQuery, d as deserialize, s as serialize, a as TUser, P as ProtoType, _ as _logLevels } from './internals/index-ZPbBr9Db.mjs';
|
|
7
|
+
export { b as ProtoClient, c as classExtends, h as isFile, j as isJob, e as isObject, i as isQuery, g as isRole, f as isUser } from './internals/index-ZPbBr9Db.mjs';
|
|
8
8
|
import { i as isPointer, a as isRelation, T as TObject, b as isShape, d as defaultObjectKeyTypes, c as isPrimitive } from './internals/index-al1N-qi7.mjs';
|
|
9
9
|
import jwt from 'jsonwebtoken';
|
|
10
10
|
import { Blob } from 'node:buffer';
|
|
@@ -13,7 +13,7 @@ import { scrypt } from 'node:crypto';
|
|
|
13
13
|
import { promisify } from 'util';
|
|
14
14
|
import { randomBytes, randomUUID } from '@o2ter/crypto-js';
|
|
15
15
|
import { P as PROTO_NOTY_MSG, a as PROTO_LIVEQUERY_MSG, M as MASTER_USER_HEADER_NAME, b as MASTER_PASS_HEADER_NAME, A as AUTH_COOKIE_KEY, U as UPLOAD_TOKEN_HEADER_NAME } from './internals/const-Dkp7Nsv5.mjs';
|
|
16
|
-
import { Q as QuerySelector } from './internals/index-
|
|
16
|
+
import { Q as QuerySelector } from './internals/index-DG9HHO_U.mjs';
|
|
17
17
|
export { Decimal } from 'decimal.js';
|
|
18
18
|
import queryType from 'query-types';
|
|
19
19
|
import busboy from 'busboy';
|
|
@@ -138,8 +138,8 @@ const dispatcher = (proto, options) => {
|
|
|
138
138
|
throw Error('File is not support insert');
|
|
139
139
|
QueryValidator.recursiveCheck(values);
|
|
140
140
|
const _validator = await validator();
|
|
141
|
-
_validator.
|
|
142
|
-
const _includes = _validator.decodeIncludes(options.className, options.includes ?? ['*']);
|
|
141
|
+
const _groupMatches = _validator.decodeGroupMatches(options.className, options.groupMatches ?? {});
|
|
142
|
+
const _includes = _validator.decodeIncludes(options.className, options.includes ?? ['*'], _groupMatches);
|
|
143
143
|
const _matches = _validator.decodeMatches(options.className, options.matches ?? {}, _includes);
|
|
144
144
|
if (!_validator.validateCLPs(options.className, 'create'))
|
|
145
145
|
throw Error('No permission');
|
|
@@ -150,7 +150,7 @@ const dispatcher = (proto, options) => {
|
|
|
150
150
|
className: options.className,
|
|
151
151
|
includes: _includes,
|
|
152
152
|
matches: _matches,
|
|
153
|
-
|
|
153
|
+
groupMatches: _groupMatches,
|
|
154
154
|
objectIdSize: proto[PVK].options.objectIdSize
|
|
155
155
|
}, _attrs), { lockTable: options.className, retry: true });
|
|
156
156
|
}
|
|
@@ -378,7 +378,7 @@ class _ProtoQuery extends TQuery {
|
|
|
378
378
|
className: this.className,
|
|
379
379
|
includes: this[PVK].options.includes,
|
|
380
380
|
matches: this[PVK].options.matches,
|
|
381
|
-
|
|
381
|
+
groupMatches: this[PVK].options.groupMatches,
|
|
382
382
|
}, values));
|
|
383
383
|
if (!options?.silent)
|
|
384
384
|
this._on_upsert(objs);
|
|
@@ -1077,14 +1077,13 @@ class ProtoInternal {
|
|
|
1077
1077
|
(async () => {
|
|
1078
1078
|
try {
|
|
1079
1079
|
const _roles = await roles;
|
|
1080
|
-
const payload = proto.rebind(_.filter(objects, object => {
|
|
1081
|
-
if (isMaster)
|
|
1082
|
-
return true;
|
|
1080
|
+
const payload = proto.rebind(isMaster ? objects : _.filter(objects, object => {
|
|
1083
1081
|
const acl = object.acl();
|
|
1084
1082
|
const clp = proto.schema[object.className].classLevelPermissions?.get ?? ['*'];
|
|
1085
1083
|
return _.some(_roles, x => _.includes(clp, x) && _.includes(acl.read, x));
|
|
1086
1084
|
}));
|
|
1087
|
-
|
|
1085
|
+
if (!_.isEmpty(payload))
|
|
1086
|
+
await callback(event, payload);
|
|
1088
1087
|
}
|
|
1089
1088
|
catch (e) {
|
|
1090
1089
|
proto.logger.error(e);
|
|
@@ -1740,7 +1739,7 @@ class ProtoService extends ProtoType {
|
|
|
1740
1739
|
className: 'File',
|
|
1741
1740
|
filter: QuerySelector.decode({ _expired_at: { $lt: time } }),
|
|
1742
1741
|
matches: {},
|
|
1743
|
-
|
|
1742
|
+
groupMatches: {},
|
|
1744
1743
|
includes: ['_id', '_expired_at', 'token'],
|
|
1745
1744
|
objectIdSize: 0
|
|
1746
1745
|
});
|
|
@@ -1755,7 +1754,7 @@ class ProtoService extends ProtoType {
|
|
|
1755
1754
|
filter: QuerySelector.decode({ _expired_at: { $lt: time } }),
|
|
1756
1755
|
includes: ['_id', '_expired_at'],
|
|
1757
1756
|
matches: {},
|
|
1758
|
-
|
|
1757
|
+
groupMatches: {},
|
|
1759
1758
|
objectIdSize: 0
|
|
1760
1759
|
});
|
|
1761
1760
|
}
|