proto.io 0.0.213 → 0.0.215
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.js.map +1 -1
- package/dist/adapters/file/database.mjs +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 +1 -1
- package/dist/adapters/storage/progres.js +133 -82
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +95 -44
- package/dist/adapters/storage/progres.mjs.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +42 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internals/{base-CZGalGrd.d.ts → base-Cp5le5dC.d.ts} +2 -2
- package/dist/internals/base-Cp5le5dC.d.ts.map +1 -0
- package/dist/internals/{chunk-BsT9SYny.d.ts → chunk--Vo2-p-z.d.ts} +3 -3
- package/dist/internals/chunk--Vo2-p-z.d.ts.map +1 -0
- package/dist/internals/{index-NF-U_3zG.d.ts → index-CZUGnb-y.d.ts} +2 -2
- package/dist/internals/index-CZUGnb-y.d.ts.map +1 -0
- package/dist/internals/{index-Boxwkqe0.d.ts → index-YLrO0f2D.d.ts} +12 -8
- package/dist/internals/index-YLrO0f2D.d.ts.map +1 -0
- package/dist/internals/random-CYjWDvex.mjs +37 -0
- package/dist/internals/random-CYjWDvex.mjs.map +1 -0
- package/dist/internals/random-nkOQ9U6S.js +39 -0
- package/dist/internals/random-nkOQ9U6S.js.map +1 -0
- package/dist/internals/{index-DG9HHO_U.mjs → validator-ChrCrz_C.mjs} +618 -3
- package/dist/internals/validator-ChrCrz_C.mjs.map +1 -0
- package/dist/internals/{index-D8O7SinR.js → validator-m6wY35c6.js} +622 -2
- package/dist/internals/validator-m6wY35c6.js.map +1 -0
- package/package.json +1 -1
- package/dist/internals/base-CZGalGrd.d.ts.map +0 -1
- package/dist/internals/chunk-BsT9SYny.d.ts.map +0 -1
- package/dist/internals/index-Boxwkqe0.d.ts.map +0 -1
- package/dist/internals/index-D8O7SinR.js.map +0 -1
- package/dist/internals/index-DG9HHO_U.mjs.map +0 -1
- package/dist/internals/index-NF-U_3zG.d.ts.map +0 -1
- package/dist/internals/random-CufRbivU.mjs +0 -526
- package/dist/internals/random-CufRbivU.mjs.map +0 -1
- package/dist/internals/random-DzvxbWAc.js +0 -532
- package/dist/internals/random-DzvxbWAc.js.map +0 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as ProtoClient } from './internals/index-
|
|
2
|
-
export { c as classExtends, e as isFile, f as isJob, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-
|
|
1
|
+
import { P as ProtoClient } from './internals/index-CZUGnb-y.js';
|
|
2
|
+
export { c as classExtends, e as isFile, f as isJob, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-CZUGnb-y.js';
|
|
3
3
|
export { Decimal } from 'decimal.js';
|
|
4
|
-
export { D as DeserializeOptions, S as SerializeOptions, e as TNumber, f as TSerializable, g as deserialize, s as serialize } from './internals/index-
|
|
4
|
+
export { D as DeserializeOptions, S as SerializeOptions, e as TNumber, f as TSerializable, g as deserialize, s as serialize } from './internals/index-YLrO0f2D.js';
|
|
5
5
|
import '@o2ter/utils-js';
|
|
6
6
|
import 'socket.io-client';
|
|
7
7
|
import '@socket.io/component-emitter';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as socket_io from 'socket.io';
|
|
2
2
|
import { Router } from 'express';
|
|
3
3
|
import { Server } from '@o2ter/server-js';
|
|
4
|
-
import { T as TSchema, a as TValueWithoutObject, P as ProtoService, b as ProtoServiceOptions, c as ProtoServiceKeyOptions } from './internals/index-
|
|
5
|
-
export { D as DeserializeOptions, S as SerializeOptions, d as TFileStorage, e as TNumber, f as TSerializable, g as deserialize, s as serialize } from './internals/index-
|
|
4
|
+
import { T as TSchema, a as TValueWithoutObject, P as ProtoService, b as ProtoServiceOptions, c as ProtoServiceKeyOptions } from './internals/index-YLrO0f2D.js';
|
|
5
|
+
export { D as DeserializeOptions, S as SerializeOptions, d as TFileStorage, e as TNumber, f as TSerializable, g as deserialize, s as serialize } from './internals/index-YLrO0f2D.js';
|
|
6
6
|
import Decimal from 'decimal.js';
|
|
7
7
|
export { Decimal } from 'decimal.js';
|
|
8
|
-
export { P as ProtoClient, c as classExtends, e as isFile, f as isJob, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-
|
|
8
|
+
export { P as ProtoClient, c as classExtends, e as isFile, f as isJob, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-CZUGnb-y.js';
|
|
9
9
|
import '@o2ter/utils-js';
|
|
10
10
|
import 'jsonwebtoken';
|
|
11
11
|
import 'lodash';
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _ = require('lodash');
|
|
6
6
|
var serverJs = require('@o2ter/server-js');
|
|
7
|
-
var
|
|
7
|
+
var validator = require('./internals/validator-m6wY35c6.js');
|
|
8
8
|
var _private = require('./internals/private-Ciddhure.js');
|
|
9
9
|
var utilsJs = require('@o2ter/utils-js');
|
|
10
10
|
var index = require('./internals/index-DfnPpl1I.js');
|
|
@@ -12,11 +12,11 @@ var index$1 = require('./internals/index-B8TESzd9.js');
|
|
|
12
12
|
var jwt = require('jsonwebtoken');
|
|
13
13
|
var node_buffer = require('node:buffer');
|
|
14
14
|
var node_stream = require('node:stream');
|
|
15
|
+
var random = require('./internals/random-nkOQ9U6S.js');
|
|
15
16
|
var node_crypto = require('node:crypto');
|
|
16
17
|
var util = require('util');
|
|
17
18
|
var cryptoJs = require('@o2ter/crypto-js');
|
|
18
19
|
var _const = require('./internals/const-C3I6cfav.js');
|
|
19
|
-
var index$2 = require('./internals/index-D8O7SinR.js');
|
|
20
20
|
var Decimal = require('decimal.js');
|
|
21
21
|
var queryType = require('query-types');
|
|
22
22
|
var busboy = require('busboy');
|
|
@@ -85,15 +85,15 @@ const normalize = (x) => {
|
|
|
85
85
|
const fetchUserPerms = async (proto) => _.uniq(_.compact([..._.map(await proto.currentRoles(), x => `role:${x}`), (await proto.currentUser())?.objectId]));
|
|
86
86
|
const dispatcher = (proto, options) => {
|
|
87
87
|
const acls = async () => options.master ? [] : await fetchUserPerms(proto);
|
|
88
|
-
const validator = async () => new
|
|
88
|
+
const validator$1 = async () => new validator.QueryValidator(proto, await acls(), {
|
|
89
89
|
master: options.master ?? false,
|
|
90
90
|
disableSecurity: options.disableSecurity,
|
|
91
91
|
});
|
|
92
92
|
const createFile = options.createFile;
|
|
93
93
|
return {
|
|
94
94
|
async explain(query) {
|
|
95
|
-
|
|
96
|
-
const _validator = await validator();
|
|
95
|
+
validator.QueryValidator.recursiveCheck(query);
|
|
96
|
+
const _validator = await validator$1();
|
|
97
97
|
const decoded = _validator.decodeQuery(normalize(query), 'read');
|
|
98
98
|
const isGet = _validator.isGetMethod(decoded.filter);
|
|
99
99
|
if (!_validator.validateCLPs(query.className, isGet ? 'get' : 'find'))
|
|
@@ -101,15 +101,15 @@ const dispatcher = (proto, options) => {
|
|
|
101
101
|
return proto.storage.explain(decoded);
|
|
102
102
|
},
|
|
103
103
|
async count(query) {
|
|
104
|
-
|
|
105
|
-
const _validator = await validator();
|
|
104
|
+
validator.QueryValidator.recursiveCheck(query);
|
|
105
|
+
const _validator = await validator$1();
|
|
106
106
|
if (!_validator.validateCLPs(query.className, 'count'))
|
|
107
107
|
throw Error('No permission');
|
|
108
108
|
return proto.storage.count(_validator.decodeQuery(normalize(query), 'read'));
|
|
109
109
|
},
|
|
110
110
|
async find(query) {
|
|
111
|
-
|
|
112
|
-
const _validator = await validator();
|
|
111
|
+
validator.QueryValidator.recursiveCheck(query);
|
|
112
|
+
const _validator = await validator$1();
|
|
113
113
|
const decoded = _validator.decodeQuery(normalize(query), 'read');
|
|
114
114
|
const isGet = _validator.isGetMethod(decoded.filter);
|
|
115
115
|
if (!_validator.validateCLPs(query.className, isGet ? 'get' : 'find'))
|
|
@@ -117,8 +117,8 @@ const dispatcher = (proto, options) => {
|
|
|
117
117
|
return proto.storage.find(decoded);
|
|
118
118
|
},
|
|
119
119
|
async nonrefs(query) {
|
|
120
|
-
|
|
121
|
-
const _validator = await validator();
|
|
120
|
+
validator.QueryValidator.recursiveCheck(query);
|
|
121
|
+
const _validator = await validator$1();
|
|
122
122
|
const decoded = _validator.decodeQuery(normalize(query), 'read');
|
|
123
123
|
const isGet = _validator.isGetMethod(decoded.filter);
|
|
124
124
|
if (!_validator.validateCLPs(query.className, isGet ? 'get' : 'find'))
|
|
@@ -126,27 +126,27 @@ const dispatcher = (proto, options) => {
|
|
|
126
126
|
return proto.storage.nonrefs(decoded);
|
|
127
127
|
},
|
|
128
128
|
async random(query, opts) {
|
|
129
|
-
|
|
130
|
-
const _validator = await validator();
|
|
129
|
+
validator.QueryValidator.recursiveCheck(query);
|
|
130
|
+
const _validator = await validator$1();
|
|
131
131
|
const decoded = _validator.decodeQuery(normalize(query), 'read');
|
|
132
132
|
const isGet = _validator.isGetMethod(decoded.filter);
|
|
133
133
|
if (!_validator.validateCLPs(query.className, isGet ? 'get' : 'find'))
|
|
134
134
|
throw Error('No permission');
|
|
135
|
-
if (opts?.weight && !_validator.validateKey(query.className, opts.weight, 'read',
|
|
135
|
+
if (opts?.weight && !_validator.validateKey(query.className, opts.weight, 'read', validator.QueryValidator.patterns.path))
|
|
136
136
|
throw Error('No permission');
|
|
137
137
|
return proto.storage.random(decoded, opts);
|
|
138
138
|
},
|
|
139
139
|
async insert(options, values) {
|
|
140
140
|
if (!createFile && options.className === 'File')
|
|
141
141
|
throw Error('File is not support insert');
|
|
142
|
-
|
|
143
|
-
const _validator = await validator();
|
|
142
|
+
validator.QueryValidator.recursiveCheck(values);
|
|
143
|
+
const _validator = await validator$1();
|
|
144
144
|
const _groupMatches = _validator.decodeGroupMatches(options.className, options.groupMatches ?? {});
|
|
145
145
|
const _includes = _validator.decodeIncludes(options.className, options.includes ?? ['*'], _groupMatches);
|
|
146
146
|
const _matches = _validator.decodeMatches(options.className, options.matches ?? {}, _includes);
|
|
147
147
|
if (!_validator.validateCLPs(options.className, 'create'))
|
|
148
148
|
throw Error('No permission');
|
|
149
|
-
const _attrs = normalize(_.map(values, attr => _validator.validateFields(options.className, attr, 'create',
|
|
149
|
+
const _attrs = normalize(_.map(values, attr => _validator.validateFields(options.className, attr, 'create', validator.QueryValidator.patterns.path)));
|
|
150
150
|
while (true) {
|
|
151
151
|
try {
|
|
152
152
|
return await proto.storage.atomic((storage) => storage.insert({
|
|
@@ -165,22 +165,22 @@ const dispatcher = (proto, options) => {
|
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
167
|
async update(query, update) {
|
|
168
|
-
|
|
169
|
-
const _validator = await validator();
|
|
168
|
+
validator.QueryValidator.recursiveCheck(query, update);
|
|
169
|
+
const _validator = await validator$1();
|
|
170
170
|
if (!_validator.validateCLPs(query.className, 'update'))
|
|
171
171
|
throw Error('No permission');
|
|
172
|
-
return proto.storage.atomic((storage) => storage.update(_validator.decodeQuery(normalize(query), 'update'), normalize(_validator.validateFields(query.className, update, 'update',
|
|
172
|
+
return proto.storage.atomic((storage) => storage.update(_validator.decodeQuery(normalize(query), 'update'), normalize(_validator.validateFields(query.className, update, 'update', validator.QueryValidator.patterns.path))));
|
|
173
173
|
},
|
|
174
174
|
async upsert(query, update, setOnInsert) {
|
|
175
175
|
if (query.className === 'File')
|
|
176
176
|
throw Error('File is not support upsert');
|
|
177
|
-
|
|
178
|
-
const _validator = await validator();
|
|
177
|
+
validator.QueryValidator.recursiveCheck(query, update, setOnInsert);
|
|
178
|
+
const _validator = await validator$1();
|
|
179
179
|
if (!_validator.validateCLPs(query.className, 'create', 'update'))
|
|
180
180
|
throw Error('No permission');
|
|
181
181
|
const _query = _validator.decodeQuery(normalize(query), 'update');
|
|
182
|
-
const _update = normalize(_validator.validateFields(query.className, update, 'update',
|
|
183
|
-
const _setOnInsert = normalize(_validator.validateFields(query.className, setOnInsert, 'create',
|
|
182
|
+
const _update = normalize(_validator.validateFields(query.className, update, 'update', validator.QueryValidator.patterns.path));
|
|
183
|
+
const _setOnInsert = normalize(_validator.validateFields(query.className, setOnInsert, 'create', validator.QueryValidator.patterns.path));
|
|
184
184
|
while (true) {
|
|
185
185
|
try {
|
|
186
186
|
return await proto.storage.atomic((storage) => storage.upsert(_query, _update, _setOnInsert), { lockTable: query.className, retry: true });
|
|
@@ -193,8 +193,8 @@ const dispatcher = (proto, options) => {
|
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
195
|
async delete(query) {
|
|
196
|
-
|
|
197
|
-
const _validator = await validator();
|
|
196
|
+
validator.QueryValidator.recursiveCheck(query);
|
|
197
|
+
const _validator = await validator$1();
|
|
198
198
|
if (!_validator.validateCLPs(query.className, 'delete'))
|
|
199
199
|
throw Error('No permission');
|
|
200
200
|
return proto.storage.atomic((storage) => storage.delete(_validator.decodeQuery(normalize(query), 'update')));
|
|
@@ -430,7 +430,7 @@ class ProtoRelationQuery extends _ProtoQuery {
|
|
|
430
430
|
}
|
|
431
431
|
get className() {
|
|
432
432
|
const { className, key } = this._opts.relatedBy;
|
|
433
|
-
const { dataType } =
|
|
433
|
+
const { dataType } = validator.resolveColumn(this._proto.schema, className, key);
|
|
434
434
|
if (!index$1.isPointer(dataType) && !index$1.isRelation(dataType))
|
|
435
435
|
throw Error(`Invalid relation key: ${key}`);
|
|
436
436
|
return dataType.target;
|
|
@@ -693,7 +693,7 @@ const validateForeignField = (schema, key, dataType) => {
|
|
|
693
693
|
return;
|
|
694
694
|
if (_.isNil(schema[dataType.target]))
|
|
695
695
|
throw Error(`Invalid foreign field: ${key}`);
|
|
696
|
-
const foreignField =
|
|
696
|
+
const foreignField = validator.resolveDataType(schema, dataType.target, dataType.foreignField);
|
|
697
697
|
if (_.isNil(foreignField))
|
|
698
698
|
throw Error(`Invalid foreign field: ${key}`);
|
|
699
699
|
if (index$1.isPrimitive(foreignField))
|
|
@@ -705,7 +705,7 @@ const validateShapedObject = (schema, dataType) => {
|
|
|
705
705
|
if (_.isEmpty(dataType.shape))
|
|
706
706
|
throw Error('Invalid empty shape');
|
|
707
707
|
for (const [key, type] of _.entries(dataType.shape)) {
|
|
708
|
-
if (!key.match(
|
|
708
|
+
if (!key.match(validator.QueryValidator.patterns.fieldName))
|
|
709
709
|
throw Error(`Invalid field name: ${key}`);
|
|
710
710
|
if (index$1.isShape(type)) {
|
|
711
711
|
validateShapedObject(schema, type);
|
|
@@ -729,10 +729,10 @@ const validateSchemaName = (schema) => {
|
|
|
729
729
|
};
|
|
730
730
|
const validateSchema = (schema) => {
|
|
731
731
|
for (const [className, _schema] of _.toPairs(schema)) {
|
|
732
|
-
if (!className.match(
|
|
732
|
+
if (!className.match(validator.QueryValidator.patterns.className))
|
|
733
733
|
throw Error(`Invalid class name: ${className}`);
|
|
734
734
|
for (const [key, dataType] of _.toPairs(_schema.fields)) {
|
|
735
|
-
if (!key.match(
|
|
735
|
+
if (!key.match(validator.QueryValidator.patterns.fieldName))
|
|
736
736
|
throw Error(`Invalid field name: ${key}`);
|
|
737
737
|
if (index$1.isShape(dataType)) {
|
|
738
738
|
validateShapedObject(schema, dataType);
|
|
@@ -797,7 +797,7 @@ class ProtoInternal {
|
|
|
797
797
|
const schema = mergeSchema(defaultSchema, options.fileStorage.schema, options.schema);
|
|
798
798
|
validateSchema(schema);
|
|
799
799
|
if (!_.every(options.roleResolver?.inheritKeys, k => {
|
|
800
|
-
const type =
|
|
800
|
+
const type = validator.resolveDataType(schema, 'Role', k);
|
|
801
801
|
return type && index$1.isRelation(type) && _.includes(['User', 'Role'], type.target);
|
|
802
802
|
})) {
|
|
803
803
|
throw Error(`Invalid role keys`);
|
|
@@ -1096,7 +1096,7 @@ class ProtoInternal {
|
|
|
1096
1096
|
};
|
|
1097
1097
|
}
|
|
1098
1098
|
liveQuery(proto, event, className, filter, callback) {
|
|
1099
|
-
const _filter = _.isEmpty(filter) ? true :
|
|
1099
|
+
const _filter = _.isEmpty(filter) ? true : validator.QuerySelector.decode(filter);
|
|
1100
1100
|
return this._liveQuery(proto, (ev, objs) => {
|
|
1101
1101
|
if (event !== ev)
|
|
1102
1102
|
return;
|
|
@@ -1596,11 +1596,11 @@ class ProtoService extends index.ProtoType {
|
|
|
1596
1596
|
const defaultResolver = async () => {
|
|
1597
1597
|
const schema = self.schema;
|
|
1598
1598
|
const userKeys = _.filter(inheritKeys, k => {
|
|
1599
|
-
const type =
|
|
1599
|
+
const type = validator.resolveDataType(schema, 'Role', k);
|
|
1600
1600
|
return !!type && index$1.isRelation(type) && type.target === 'User';
|
|
1601
1601
|
});
|
|
1602
1602
|
const roleKeys = _.filter(inheritKeys, k => {
|
|
1603
|
-
const type =
|
|
1603
|
+
const type = validator.resolveDataType(schema, 'Role', k);
|
|
1604
1604
|
return !!type && index$1.isRelation(type) && type.target === 'Role';
|
|
1605
1605
|
});
|
|
1606
1606
|
let queue = await self.Query('Role')
|
|
@@ -1717,7 +1717,7 @@ class ProtoService extends index.ProtoType {
|
|
|
1717
1717
|
return this[_private.PVK].notify(this, data);
|
|
1718
1718
|
}
|
|
1719
1719
|
listen(callback, selector) {
|
|
1720
|
-
const _selector = !_.isNil(selector) ?
|
|
1720
|
+
const _selector = !_.isNil(selector) ? validator.QuerySelector.decode(selector) : undefined;
|
|
1721
1721
|
return this[_private.PVK].listen(this, async (data) => {
|
|
1722
1722
|
if (_selector && !_selector.eval(data))
|
|
1723
1723
|
return;
|
|
@@ -1740,7 +1740,7 @@ class ProtoService extends index.ProtoType {
|
|
|
1740
1740
|
if (className === 'File') {
|
|
1741
1741
|
const found = this.storage.find({
|
|
1742
1742
|
className: 'File',
|
|
1743
|
-
filter:
|
|
1743
|
+
filter: validator.QuerySelector.decode({ _expired_at: { $lt: time } }),
|
|
1744
1744
|
matches: {},
|
|
1745
1745
|
groupMatches: {},
|
|
1746
1746
|
includes: ['_id', '_expired_at', 'token'],
|
|
@@ -1754,7 +1754,7 @@ class ProtoService extends index.ProtoType {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
await this.storage.delete({
|
|
1756
1756
|
className,
|
|
1757
|
-
filter:
|
|
1757
|
+
filter: validator.QuerySelector.decode({ _expired_at: { $lt: time } }),
|
|
1758
1758
|
includes: ['_id', '_expired_at'],
|
|
1759
1759
|
matches: {},
|
|
1760
1760
|
groupMatches: {},
|
|
@@ -2597,7 +2597,7 @@ const registerProtoSocket = (proto, server, endpoint) => {
|
|
|
2597
2597
|
const connect = async (token) => {
|
|
2598
2598
|
const payload = await proto.connectWithSessionToken(token);
|
|
2599
2599
|
const { remove: remove_basic } = payload.listen(data => {
|
|
2600
|
-
const ids = _.keys(_.pickBy(events, v => v instanceof
|
|
2600
|
+
const ids = _.keys(_.pickBy(events, v => v instanceof validator.QuerySelector ? v.eval(data) : v));
|
|
2601
2601
|
const payload = JSON.parse(index.serialize(data));
|
|
2602
2602
|
if (!_.isEmpty(ids))
|
|
2603
2603
|
socket.emit('ON_EV_NOTIFY', { ids, data: payload });
|
|
@@ -2608,7 +2608,7 @@ const registerProtoSocket = (proto, server, endpoint) => {
|
|
|
2608
2608
|
ids[obj.objectId] = _.keys(_.pickBy(queries, v => {
|
|
2609
2609
|
if (v.event !== ev || v.className !== obj.className)
|
|
2610
2610
|
return false;
|
|
2611
|
-
return v.filter instanceof
|
|
2611
|
+
return v.filter instanceof validator.QuerySelector ? v.filter.eval(obj) : v.filter;
|
|
2612
2612
|
}));
|
|
2613
2613
|
}
|
|
2614
2614
|
if (_.isEmpty(ids))
|
|
@@ -2635,7 +2635,7 @@ const registerProtoSocket = (proto, server, endpoint) => {
|
|
|
2635
2635
|
if (_.isBoolean(v))
|
|
2636
2636
|
return true;
|
|
2637
2637
|
try {
|
|
2638
|
-
return
|
|
2638
|
+
return validator.QuerySelector.decode(v);
|
|
2639
2639
|
}
|
|
2640
2640
|
catch (error) {
|
|
2641
2641
|
proto.logger.error(error);
|
|
@@ -2649,7 +2649,7 @@ const registerProtoSocket = (proto, server, endpoint) => {
|
|
|
2649
2649
|
if (_.isBoolean(v))
|
|
2650
2650
|
return { event, className, filter: true };
|
|
2651
2651
|
try {
|
|
2652
|
-
return { event, className, filter:
|
|
2652
|
+
return { event, className, filter: validator.QuerySelector.decode(filter) };
|
|
2653
2653
|
}
|
|
2654
2654
|
catch (error) {
|
|
2655
2655
|
proto.logger.error(error);
|