proto.io 0.0.220 → 0.0.222
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.js.map +1 -1
- package/dist/adapters/file/aliyun-oss.mjs.map +1 -1
- package/dist/adapters/file/database.js.map +1 -1
- package/dist/adapters/file/database.mjs.map +1 -1
- package/dist/adapters/file/filesystem.js.map +1 -1
- package/dist/adapters/file/filesystem.mjs.map +1 -1
- package/dist/adapters/file/google-cloud-storage.js.map +1 -1
- package/dist/adapters/file/google-cloud-storage.mjs.map +1 -1
- package/dist/adapters/storage/progres.js +1 -1
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +1 -1
- package/dist/adapters/storage/progres.mjs.map +1 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +3 -3
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internals/base-DYc1_peK.mjs.map +1 -1
- package/dist/internals/base-NsJYo2MG.js.map +1 -1
- package/dist/internals/chunk-BuKmyceG.js.map +1 -1
- package/dist/internals/chunk-bpt1C6W4.mjs.map +1 -1
- package/dist/internals/{const-C3I6cfav.js → const-BCYpEfJg.js} +3 -1
- package/dist/internals/const-BCYpEfJg.js.map +1 -0
- package/dist/internals/{const-Dkp7Nsv5.mjs → const-DqPhhmor.mjs} +3 -2
- package/dist/internals/const-DqPhhmor.mjs.map +1 -0
- package/dist/internals/index-CLKTEIj0.js.map +1 -1
- package/dist/internals/{index-CWhqANZM.d.ts → index-Cc-yXi8f.d.ts} +5 -1
- package/dist/internals/index-Cc-yXi8f.d.ts.map +1 -0
- package/dist/internals/{index-CZ5fKgiJ.mjs → index-CsclRNTO.mjs} +10 -5
- package/dist/internals/index-CsclRNTO.mjs.map +1 -0
- package/dist/internals/{index-xHeu-AjT.js → index-dk8iIkyr.js} +10 -5
- package/dist/internals/index-dk8iIkyr.js.map +1 -0
- package/dist/internals/index-gWcE22mf.mjs.map +1 -1
- package/dist/internals/private-CNw40LZ7.mjs.map +1 -1
- package/dist/internals/private-Ciddhure.js.map +1 -1
- package/dist/internals/random-CYjWDvex.mjs.map +1 -1
- package/dist/internals/random-nkOQ9U6S.js.map +1 -1
- package/dist/internals/validator-B5yHpyvb.js.map +1 -1
- package/dist/internals/validator-DX2nXeQo.mjs.map +1 -1
- package/package.json +25 -3
- package/dist/internals/const-C3I6cfav.js.map +0 -1
- package/dist/internals/const-Dkp7Nsv5.mjs.map +0 -1
- package/dist/internals/index-CWhqANZM.d.ts.map +0 -1
- package/dist/internals/index-CZ5fKgiJ.mjs.map +0 -1
- package/dist/internals/index-xHeu-AjT.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import { Server } from '@o2ter/server-js';
|
|
|
3
3
|
import { Q as QueryValidator, a as QueryExpression, r as resolveColumn, b as resolveDataType, c as QuerySelector } from './internals/validator-DX2nXeQo.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 } 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-CsclRNTO.mjs';
|
|
7
|
+
export { b as ProtoClient, c as classExtends } from './internals/index-CsclRNTO.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-gWcE22mf.mjs';
|
|
9
9
|
import jwt from 'jsonwebtoken';
|
|
10
10
|
import { Blob } from 'node:buffer';
|
|
@@ -13,7 +13,7 @@ import { g as generateId } from './internals/random-CYjWDvex.mjs';
|
|
|
13
13
|
import { scrypt } from 'node:crypto';
|
|
14
14
|
import { promisify } from 'util';
|
|
15
15
|
import { randomBytes, randomUUID } from '@o2ter/crypto-js';
|
|
16
|
-
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-
|
|
16
|
+
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_ALT_COOKIE_KEY, c as AUTH_COOKIE_KEY, U as UPLOAD_TOKEN_HEADER_NAME } from './internals/const-DqPhhmor.mjs';
|
|
17
17
|
import queryType from 'query-types';
|
|
18
18
|
import busboy from 'busboy';
|
|
19
19
|
export { Decimal } from 'decimal.js';
|
|
@@ -1304,14 +1304,15 @@ const _session = (proto, request) => {
|
|
|
1304
1304
|
const jwtToken = proto[PVK].options.jwtToken;
|
|
1305
1305
|
if (_.isEmpty(jwtToken))
|
|
1306
1306
|
throw Error('Invalid jwt token');
|
|
1307
|
+
const cookieKey = _.last(_.castArray(request.headers[AUTH_ALT_COOKIE_KEY] || [])) || AUTH_COOKIE_KEY;
|
|
1307
1308
|
let authorization = '';
|
|
1308
1309
|
if (request.headers.authorization) {
|
|
1309
1310
|
const parts = request.headers.authorization.split(' ');
|
|
1310
1311
|
if (parts.length === 2 && parts[0] === 'Bearer')
|
|
1311
1312
|
authorization = parts[1];
|
|
1312
1313
|
}
|
|
1313
|
-
else if (request.cookies[
|
|
1314
|
-
authorization = request.cookies[
|
|
1314
|
+
else if (request.cookies[cookieKey]) {
|
|
1315
|
+
authorization = request.cookies[cookieKey];
|
|
1315
1316
|
}
|
|
1316
1317
|
if (_.isEmpty(authorization))
|
|
1317
1318
|
return;
|
|
@@ -1390,7 +1391,8 @@ const signUser = async (proto, res, user, options) => {
|
|
|
1390
1391
|
user: user?.id,
|
|
1391
1392
|
cookieOptions,
|
|
1392
1393
|
}, options?.jwtSignOptions ?? 'login');
|
|
1393
|
-
res.
|
|
1394
|
+
const cookieKey = _.last(_.castArray(res.req.headers[AUTH_ALT_COOKIE_KEY] || [])) || AUTH_COOKIE_KEY;
|
|
1395
|
+
res.cookie(cookieKey, token, cookieOptions);
|
|
1394
1396
|
sessionInfoMap.set(res.req, user ? await fetchSessionInfo(proto, user.id) : {});
|
|
1395
1397
|
};
|
|
1396
1398
|
|