proto.io 0.0.181 → 0.0.183
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/database.d.ts +2 -2
- package/dist/adapters/file/filesystem.d.ts +2 -2
- package/dist/adapters/file/google-cloud-storage.d.ts +2 -2
- package/dist/adapters/storage/progres.d.ts +16 -35
- package/dist/adapters/storage/progres.js +32 -27
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +32 -27
- 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 +13 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internals/index-BnDahEvz.js.map +1 -1
- package/dist/internals/{index-BZupzq1Y.d.ts → index-C1pF5Xzm.d.ts} +2 -2
- package/dist/internals/index-C1pF5Xzm.d.ts.map +1 -0
- package/dist/internals/index-CmJh3t_k.mjs.map +1 -1
- package/dist/internals/{index-YpB-hXxf.d.ts → index-YJ0pBNzy.d.ts} +7 -11
- package/dist/internals/index-YJ0pBNzy.d.ts.map +1 -0
- package/dist/internals/{index-cKx59cIc.d.ts → index-Z57iS68O.d.ts} +2 -2
- package/dist/internals/index-Z57iS68O.d.ts.map +1 -0
- package/dist/internals/{random-CDtFUuES.js → random-80Vpxbxh.js} +9 -11
- package/dist/internals/random-80Vpxbxh.js.map +1 -0
- package/dist/internals/{random-BSyWEK8G.mjs → random-BtYyzHJD.mjs} +9 -11
- package/dist/internals/random-BtYyzHJD.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/internals/index-BZupzq1Y.d.ts.map +0 -1
- package/dist/internals/index-YpB-hXxf.d.ts.map +0 -1
- package/dist/internals/index-cKx59cIc.d.ts.map +0 -1
- package/dist/internals/random-BSyWEK8G.mjs.map +0 -1
- package/dist/internals/random-CDtFUuES.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, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-
|
|
1
|
+
import { P as ProtoClient } from './internals/index-Z57iS68O.js';
|
|
2
|
+
export { c as classExtends, e as isFile, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-Z57iS68O.js';
|
|
3
3
|
export { Decimal } from 'decimal.js';
|
|
4
|
-
export { D as DeserializeOptions, S as SerializeOptions, d as TSerializable, e as deserialize, s as serialize } from './internals/index-
|
|
4
|
+
export { D as DeserializeOptions, S as SerializeOptions, d as TSerializable, e as deserialize, s as serialize } from './internals/index-YJ0pBNzy.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, _ as _TValue, P as ProtoService, a as ProtoServiceOptions, b as ProtoServiceKeyOptions } from './internals/index-
|
|
5
|
-
export { D as DeserializeOptions, S as SerializeOptions, c as TFileStorage, d as TSerializable, e as deserialize, s as serialize } from './internals/index-
|
|
4
|
+
import { T as TSchema, _ as _TValue, P as ProtoService, a as ProtoServiceOptions, b as ProtoServiceKeyOptions } from './internals/index-YJ0pBNzy.js';
|
|
5
|
+
export { D as DeserializeOptions, S as SerializeOptions, c as TFileStorage, d as TSerializable, e as deserialize, s as serialize } from './internals/index-YJ0pBNzy.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, 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, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-Z57iS68O.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 random = require('./internals/random-
|
|
7
|
+
var random = require('./internals/random-80Vpxbxh.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-BnDahEvz.js');
|
|
@@ -82,9 +82,12 @@ const normalize = (x) => {
|
|
|
82
82
|
// THE SOFTWARE.
|
|
83
83
|
//
|
|
84
84
|
const fetchUserPerms = async (proto) => _.uniq(_.compact([..._.map(await proto.currentRoles(), x => `role:${x}`), (await proto.currentUser())?.objectId]));
|
|
85
|
-
const dispatcher = (proto, options
|
|
85
|
+
const dispatcher = (proto, options) => {
|
|
86
86
|
const acls = async () => options.master ? [] : await fetchUserPerms(proto);
|
|
87
|
-
const validator = async () => new random.QueryValidator(proto, await acls(),
|
|
87
|
+
const validator = async () => new random.QueryValidator(proto, await acls(), {
|
|
88
|
+
master: options.master ?? false,
|
|
89
|
+
disableSecurity: options.disableSecurity,
|
|
90
|
+
});
|
|
88
91
|
return {
|
|
89
92
|
async explain(query) {
|
|
90
93
|
random.QueryValidator.recursiveCheck(query);
|
|
@@ -318,11 +321,17 @@ class _ProtoQuery extends index.TQuery {
|
|
|
318
321
|
};
|
|
319
322
|
}
|
|
320
323
|
_dispatcher(options) {
|
|
324
|
+
const schema = this._proto.schema[this.className];
|
|
325
|
+
if (_.isNil(schema))
|
|
326
|
+
throw Error('Invalid className');
|
|
321
327
|
if (this._opts.insecure) {
|
|
322
328
|
if (options?.master !== true)
|
|
323
329
|
throw Error('No permission');
|
|
324
330
|
}
|
|
325
|
-
return dispatcher(_serviceOf(options) ?? this._proto,
|
|
331
|
+
return dispatcher(_serviceOf(options) ?? this._proto, {
|
|
332
|
+
...options ?? {},
|
|
333
|
+
disableSecurity: !!this._opts.insecure,
|
|
334
|
+
});
|
|
326
335
|
}
|
|
327
336
|
explain(options) {
|
|
328
337
|
return this._dispatcher(options).explain(this._queryOptions);
|