proto.io 0.0.151 → 0.0.153
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 +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internals/{index-DoamtgZq.d.ts → index-DQm5Xz3Q.d.ts} +2 -2
- package/dist/internals/index-DQm5Xz3Q.d.ts.map +1 -0
- package/dist/internals/{index-Wck9rIH6.d.ts → index-DeD3CiUK.d.ts} +2 -2
- package/dist/internals/index-DeD3CiUK.d.ts.map +1 -0
- package/dist/internals/{index-DGI4rZSw.d.ts → index-m4WmZoWj.d.ts} +3 -1
- package/dist/internals/index-m4WmZoWj.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/internals/index-DGI4rZSw.d.ts.map +0 -1
- package/dist/internals/index-DoamtgZq.d.ts.map +0 -1
- package/dist/internals/index-Wck9rIH6.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TSchema, P as ProtoService } from '../../internals/index-
|
|
2
|
-
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-
|
|
1
|
+
import { T as TSchema, P as ProtoService } from '../../internals/index-m4WmZoWj.js';
|
|
2
|
+
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-DeD3CiUK.js';
|
|
3
3
|
import '@o2ter/utils-js';
|
|
4
4
|
import 'jsonwebtoken';
|
|
5
5
|
import '@o2ter/server-js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProtoService } from '../../internals/index-
|
|
2
|
-
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-
|
|
1
|
+
import { P as ProtoService } from '../../internals/index-m4WmZoWj.js';
|
|
2
|
+
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-DeD3CiUK.js';
|
|
3
3
|
import '@o2ter/utils-js';
|
|
4
4
|
import 'jsonwebtoken';
|
|
5
5
|
import '@o2ter/server-js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _google_cloud_storage from '@google-cloud/storage';
|
|
2
2
|
import { Storage } from '@google-cloud/storage';
|
|
3
|
-
import { P as ProtoService } from '../../internals/index-
|
|
4
|
-
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-
|
|
3
|
+
import { P as ProtoService } from '../../internals/index-m4WmZoWj.js';
|
|
4
|
+
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-DeD3CiUK.js';
|
|
5
5
|
import '@o2ter/utils-js';
|
|
6
6
|
import 'jsonwebtoken';
|
|
7
7
|
import '@o2ter/server-js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Pool, PoolClient, PoolConfig } from 'pg';
|
|
2
|
-
import { _ as _TValue, n as EventData, T as TSchema, o as DecodedQuery, F as FindOptions, Q as QuerySelector, p as DecodedSortOption, I as InsertOptions, q as TValue, r as FindOneOptions, t as TUpdateOp, u as FieldSelectorExpression, v as QueryExpression, w as TStorage, x as TransactionOptions, h as TObject, y as TQueryRandomOptions, z as TPubSub } from '../../internals/index-
|
|
2
|
+
import { _ as _TValue, n as EventData, T as TSchema, o as DecodedQuery, F as FindOptions, Q as QuerySelector, p as DecodedSortOption, I as InsertOptions, q as TValue, r as FindOneOptions, t as TUpdateOp, u as FieldSelectorExpression, v as QueryExpression, w as TStorage, x as TransactionOptions, h as TObject, y as TQueryRandomOptions, z as TPubSub } from '../../internals/index-m4WmZoWj.js';
|
|
3
3
|
import * as _o2ter_utils_js from '@o2ter/utils-js';
|
|
4
4
|
import { asyncStream } from '@o2ter/utils-js';
|
|
5
5
|
import 'jsonwebtoken';
|
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-DQm5Xz3Q.js';
|
|
2
|
+
export { c as classExtends, e as isFile, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-DQm5Xz3Q.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-m4WmZoWj.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
|
@@ -2,11 +2,11 @@ import * as socket_io from 'socket.io';
|
|
|
2
2
|
import * as socket_io_dist_typed_events from 'socket.io/dist/typed-events';
|
|
3
3
|
import * as express_serve_static_core from 'express-serve-static-core';
|
|
4
4
|
import { Server, RequestHandler } from '@o2ter/server-js';
|
|
5
|
-
import { T as TSchema, _ as _TValue, P as ProtoService, a as ProtoServiceOptions, b as ProtoServiceKeyOptions } from './internals/index-
|
|
6
|
-
export { D as DeserializeOptions, S as SerializeOptions, c as TFileStorage, d as TSerializable, e as deserialize, s as serialize } from './internals/index-
|
|
5
|
+
import { T as TSchema, _ as _TValue, P as ProtoService, a as ProtoServiceOptions, b as ProtoServiceKeyOptions } from './internals/index-m4WmZoWj.js';
|
|
6
|
+
export { D as DeserializeOptions, S as SerializeOptions, c as TFileStorage, d as TSerializable, e as deserialize, s as serialize } from './internals/index-m4WmZoWj.js';
|
|
7
7
|
import Decimal from 'decimal.js';
|
|
8
8
|
export { Decimal } from 'decimal.js';
|
|
9
|
-
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-
|
|
9
|
+
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-DQm5Xz3Q.js';
|
|
10
10
|
import '@o2ter/utils-js';
|
|
11
11
|
import 'jsonwebtoken';
|
|
12
12
|
import 'lodash';
|
package/dist/index.js
CHANGED
|
@@ -1115,7 +1115,10 @@ const _session = (proto, request) => {
|
|
|
1115
1115
|
const cached = sessionMap.get(request);
|
|
1116
1116
|
if (cached)
|
|
1117
1117
|
return cached;
|
|
1118
|
-
sessionMap.set(request, {
|
|
1118
|
+
sessionMap.set(request, {
|
|
1119
|
+
sessionId: cryptoJs.randomUUID(),
|
|
1120
|
+
createdAt: new Date,
|
|
1121
|
+
});
|
|
1119
1122
|
const jwtToken = proto[_private.PVK].options.jwtToken;
|
|
1120
1123
|
if (_.isEmpty(jwtToken))
|
|
1121
1124
|
throw Error('Invalid jwt token');
|
|
@@ -1134,8 +1137,9 @@ const _session = (proto, request) => {
|
|
|
1134
1137
|
if (!_.isObject(payload))
|
|
1135
1138
|
return;
|
|
1136
1139
|
const session = {
|
|
1137
|
-
sessionId: payload.sessionId ?? cryptoJs.randomUUID(),
|
|
1138
1140
|
...payload,
|
|
1141
|
+
sessionId: payload.sessionId ?? cryptoJs.randomUUID(),
|
|
1142
|
+
createdAt: payload.createdAt && _.isSafeInteger(payload.createdAt) ? new Date(payload.createdAt) : new Date,
|
|
1139
1143
|
};
|
|
1140
1144
|
sessionMap.set(request, session);
|
|
1141
1145
|
return session;
|
|
@@ -1179,9 +1183,13 @@ const signUser = async (proto, res, user, options) => {
|
|
|
1179
1183
|
if (_.isNil(proto[_private.PVK].options.jwtToken))
|
|
1180
1184
|
return;
|
|
1181
1185
|
const session = _session(proto, res.req);
|
|
1182
|
-
const sessionId = sessionMap.get(res.req)?.sessionId ?? session?.sessionId ?? cryptoJs.randomUUID();
|
|
1183
1186
|
const cookieOptions = options?.cookieOptions ?? session?.cookieOptions ?? proto[_private.PVK].options.cookieOptions;
|
|
1184
|
-
const token = proto[_private.PVK].jwtSign({
|
|
1187
|
+
const token = proto[_private.PVK].jwtSign({
|
|
1188
|
+
sessionId: session?.sessionId ?? cryptoJs.randomUUID(),
|
|
1189
|
+
createdAt: session?.createdAt?.getTime() ?? Date.now(),
|
|
1190
|
+
user: user?.objectId,
|
|
1191
|
+
cookieOptions,
|
|
1192
|
+
}, options?.jwtSignOptions ?? 'login');
|
|
1185
1193
|
res.cookie(index.AUTH_COOKIE_KEY, token, cookieOptions);
|
|
1186
1194
|
sessionInfoMap.set(res.req, user ? await fetchSessionInfo(proto, user.objectId) : {});
|
|
1187
1195
|
};
|