proto.io 0.0.166 → 0.0.167
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/client.js +1 -1
- package/dist/client.mjs +2 -2
- package/dist/index.js +3 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -12
- package/dist/index.mjs.map +1 -1
- package/dist/internals/{index-B-pq8xkP.js → index-CyzpkgJB.js} +5 -2
- package/dist/internals/index-CyzpkgJB.js.map +1 -0
- package/dist/internals/{index-CUJMde7V.mjs → index-Dyfia5Om.mjs} +6 -3
- package/dist/internals/index-Dyfia5Om.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/internals/index-B-pq8xkP.js.map +0 -1
- package/dist/internals/index-CUJMde7V.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import _ from 'lodash';
|
|
|
2
2
|
import { Server } from '@o2ter/server-js';
|
|
3
3
|
import { Q as QueryValidator, r as resolveColumn, a as resolveDataType, g as generateId } from './internals/random-DrURPPxr.mjs';
|
|
4
4
|
import { P as PVK } from './internals/private-BUpLAMZi.mjs';
|
|
5
|
-
import { asyncStream, asyncIterableToArray, isBinaryData, base64ToBuffer } from '@o2ter/utils-js';
|
|
6
|
-
import { T as TQuery, M as MASTER_USER_HEADER_NAME, a as MASTER_PASS_HEADER_NAME, A as AUTH_COOKIE_KEY, b as TUser, P as ProtoType, s as serialize, d as deserialize, U as UPLOAD_TOKEN_HEADER_NAME } from './internals/index-
|
|
7
|
-
export { c as ProtoClient, e as classExtends, j as isFile, f as isObject, i as isQuery, h as isRole, g as isUser } from './internals/index-
|
|
5
|
+
import { prototypes, asyncStream, asyncIterableToArray, isBinaryData, base64ToBuffer } from '@o2ter/utils-js';
|
|
6
|
+
import { T as TQuery, M as MASTER_USER_HEADER_NAME, a as MASTER_PASS_HEADER_NAME, A as AUTH_COOKIE_KEY, b as TUser, P as ProtoType, s as serialize, d as deserialize, U as UPLOAD_TOKEN_HEADER_NAME } from './internals/index-Dyfia5Om.mjs';
|
|
7
|
+
export { c as ProtoClient, e as classExtends, j as isFile, f as isObject, i as isQuery, h as isRole, g as isUser } from './internals/index-Dyfia5Om.mjs';
|
|
8
8
|
import { i as isPointer, a as isRelation, d as decodeUpdateOp, T as TObject, b as isShape, c as defaultObjectKeyTypes, e as isPrimitive } from './internals/index-BYbMU-Ao.mjs';
|
|
9
9
|
import jwt from 'jsonwebtoken';
|
|
10
10
|
import { Blob } from 'node:buffer';
|
|
@@ -246,14 +246,7 @@ const dispatcher = (proto, options, disableSecurity) => {
|
|
|
246
246
|
const proxy = (x) => {
|
|
247
247
|
const self = x;
|
|
248
248
|
const proxy = _.create(self);
|
|
249
|
-
const
|
|
250
|
-
const prototype = Object.getPrototypeOf(x);
|
|
251
|
-
if (_.isNil(prototype) || prototype === Object.prototype)
|
|
252
|
-
return [];
|
|
253
|
-
return [prototype, ..._prototypes(prototype)];
|
|
254
|
-
};
|
|
255
|
-
const prototypes = _prototypes(proxy);
|
|
256
|
-
for (const name of _.uniq(_.flatMap(prototypes, x => Object.getOwnPropertyNames(x)))) {
|
|
249
|
+
for (const name of _.uniq(_.flatMap(prototypes(proxy), x => Object.getOwnPropertyNames(x)))) {
|
|
257
250
|
if (name === 'constructor')
|
|
258
251
|
continue;
|
|
259
252
|
if (_.isFunction(self[name])) {
|
|
@@ -1668,7 +1661,7 @@ const encodeError = (error) => {
|
|
|
1668
1661
|
if (error instanceof String)
|
|
1669
1662
|
return { message: error };
|
|
1670
1663
|
if (error instanceof Error)
|
|
1671
|
-
return {
|
|
1664
|
+
return { message: error.message };
|
|
1672
1665
|
return error;
|
|
1673
1666
|
};
|
|
1674
1667
|
const response = async (res, callback) => {
|