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.
Files changed (50) hide show
  1. package/dist/adapters/file/aliyun-oss.js.map +1 -1
  2. package/dist/adapters/file/aliyun-oss.mjs.map +1 -1
  3. package/dist/adapters/file/database.js.map +1 -1
  4. package/dist/adapters/file/database.mjs.map +1 -1
  5. package/dist/adapters/file/filesystem.js.map +1 -1
  6. package/dist/adapters/file/filesystem.mjs.map +1 -1
  7. package/dist/adapters/file/google-cloud-storage.js.map +1 -1
  8. package/dist/adapters/file/google-cloud-storage.mjs.map +1 -1
  9. package/dist/adapters/storage/progres.js +1 -1
  10. package/dist/adapters/storage/progres.js.map +1 -1
  11. package/dist/adapters/storage/progres.mjs +1 -1
  12. package/dist/adapters/storage/progres.mjs.map +1 -1
  13. package/dist/client.d.ts +2 -2
  14. package/dist/client.js +2 -2
  15. package/dist/client.js.map +1 -1
  16. package/dist/client.mjs +3 -3
  17. package/dist/client.mjs.map +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +7 -5
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +8 -6
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/internals/base-DYc1_peK.mjs.map +1 -1
  24. package/dist/internals/base-NsJYo2MG.js.map +1 -1
  25. package/dist/internals/chunk-BuKmyceG.js.map +1 -1
  26. package/dist/internals/chunk-bpt1C6W4.mjs.map +1 -1
  27. package/dist/internals/{const-C3I6cfav.js → const-BCYpEfJg.js} +3 -1
  28. package/dist/internals/const-BCYpEfJg.js.map +1 -0
  29. package/dist/internals/{const-Dkp7Nsv5.mjs → const-DqPhhmor.mjs} +3 -2
  30. package/dist/internals/const-DqPhhmor.mjs.map +1 -0
  31. package/dist/internals/index-CLKTEIj0.js.map +1 -1
  32. package/dist/internals/{index-CWhqANZM.d.ts → index-Cc-yXi8f.d.ts} +5 -1
  33. package/dist/internals/index-Cc-yXi8f.d.ts.map +1 -0
  34. package/dist/internals/{index-CZ5fKgiJ.mjs → index-CsclRNTO.mjs} +10 -5
  35. package/dist/internals/index-CsclRNTO.mjs.map +1 -0
  36. package/dist/internals/{index-xHeu-AjT.js → index-dk8iIkyr.js} +10 -5
  37. package/dist/internals/index-dk8iIkyr.js.map +1 -0
  38. package/dist/internals/index-gWcE22mf.mjs.map +1 -1
  39. package/dist/internals/private-CNw40LZ7.mjs.map +1 -1
  40. package/dist/internals/private-Ciddhure.js.map +1 -1
  41. package/dist/internals/random-CYjWDvex.mjs.map +1 -1
  42. package/dist/internals/random-nkOQ9U6S.js.map +1 -1
  43. package/dist/internals/validator-B5yHpyvb.js.map +1 -1
  44. package/dist/internals/validator-DX2nXeQo.mjs.map +1 -1
  45. package/package.json +25 -3
  46. package/dist/internals/const-C3I6cfav.js.map +0 -1
  47. package/dist/internals/const-Dkp7Nsv5.mjs.map +0 -1
  48. package/dist/internals/index-CWhqANZM.d.ts.map +0 -1
  49. package/dist/internals/index-CZ5fKgiJ.mjs.map +0 -1
  50. package/dist/internals/index-xHeu-AjT.js.map +0 -1
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ProtoClient } from './internals/index-CWhqANZM.js';
2
- export { c as classExtends } from './internals/index-CWhqANZM.js';
1
+ import { P as ProtoClient } from './internals/index-Cc-yXi8f.js';
2
+ export { c as classExtends } from './internals/index-Cc-yXi8f.js';
3
3
  export { D as DeserializeOptions, S as SerializeOptions, e as TNumber, f as TSerializable, g as deserialize, s as serialize } from './internals/index-82GLvDiN.js';
4
4
  export { Decimal } from 'decimal.js';
5
5
  import '@o2ter/utils-js';
package/dist/client.js CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./internals/index-xHeu-AjT.js');
5
+ var index = require('./internals/index-dk8iIkyr.js');
6
6
  var Decimal = require('decimal.js');
7
7
  require('@o2ter/utils-js');
8
8
  require('./internals/private-Ciddhure.js');
9
9
  require('lodash');
10
10
  require('./internals/index-CLKTEIj0.js');
11
11
  require('axios');
12
- require('./internals/const-C3I6cfav.js');
12
+ require('./internals/const-BCYpEfJg.js');
13
13
  require('@o2ter/server-js/dist/const');
14
14
  require('socket.io-client');
15
15
  require('@o2ter/crypto-js');
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sources":["../../src/client/index.ts"],"sourcesContent":["//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ProtoClient } from './proto';\n\nexport * from '../internals/codec';\nexport { classExtends } from '../internals/utils';\n\nexport { ProtoClient };\n\nexport default ProtoClient;"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"client.js","sources":["../src/client/index.ts"],"sourcesContent":["//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ProtoClient } from './proto';\n\nexport * from '../internals/codec';\nexport { classExtends } from '../internals/utils';\n\nexport { ProtoClient };\n\nexport default ProtoClient;"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;"}
package/dist/client.mjs CHANGED
@@ -1,12 +1,12 @@
1
- import { b as ProtoClient } from './internals/index-CZ5fKgiJ.mjs';
2
- export { c as classExtends, d as deserialize, s as serialize } from './internals/index-CZ5fKgiJ.mjs';
1
+ import { b as ProtoClient } from './internals/index-CsclRNTO.mjs';
2
+ export { c as classExtends, d as deserialize, s as serialize } from './internals/index-CsclRNTO.mjs';
3
3
  export { Decimal } from 'decimal.js';
4
4
  import '@o2ter/utils-js';
5
5
  import './internals/private-CNw40LZ7.mjs';
6
6
  import 'lodash';
7
7
  import './internals/index-gWcE22mf.mjs';
8
8
  import 'axios';
9
- import './internals/const-Dkp7Nsv5.mjs';
9
+ import './internals/const-DqPhhmor.mjs';
10
10
  import '@o2ter/server-js/dist/const';
11
11
  import 'socket.io-client';
12
12
  import '@o2ter/crypto-js';
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","sources":["../../src/client/index.ts"],"sourcesContent":["//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ProtoClient } from './proto';\n\nexport * from '../internals/codec';\nexport { classExtends } from '../internals/utils';\n\nexport { ProtoClient };\n\nexport default ProtoClient;"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"client.mjs","sources":["../src/client/index.ts"],"sourcesContent":["//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ProtoClient } from './proto';\n\nexport * from '../internals/codec';\nexport { classExtends } from '../internals/utils';\n\nexport { ProtoClient };\n\nexport default ProtoClient;"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { T as TSchema, a as TValueWithoutObject, P as ProtoService, b as ProtoSe
5
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-82GLvDiN.js';
6
6
  import Decimal from 'decimal.js';
7
7
  export { Decimal } from 'decimal.js';
8
- export { P as ProtoClient, c as classExtends } from './internals/index-CWhqANZM.js';
8
+ export { P as ProtoClient, c as classExtends } from './internals/index-Cc-yXi8f.js';
9
9
  import '@o2ter/utils-js';
10
10
  import 'jsonwebtoken';
11
11
  import 'lodash';
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ var serverJs = require('@o2ter/server-js');
7
7
  var validator = require('./internals/validator-B5yHpyvb.js');
8
8
  var _private = require('./internals/private-Ciddhure.js');
9
9
  var utilsJs = require('@o2ter/utils-js');
10
- var index = require('./internals/index-xHeu-AjT.js');
10
+ var index = require('./internals/index-dk8iIkyr.js');
11
11
  var index$1 = require('./internals/index-CLKTEIj0.js');
12
12
  var jwt = require('jsonwebtoken');
13
13
  var node_buffer = require('node:buffer');
@@ -16,7 +16,7 @@ var random = require('./internals/random-nkOQ9U6S.js');
16
16
  var node_crypto = require('node:crypto');
17
17
  var util = require('util');
18
18
  var cryptoJs = require('@o2ter/crypto-js');
19
- var _const = require('./internals/const-C3I6cfav.js');
19
+ var _const = require('./internals/const-BCYpEfJg.js');
20
20
  var queryType = require('query-types');
21
21
  var busboy = require('busboy');
22
22
  var Decimal = require('decimal.js');
@@ -1307,14 +1307,15 @@ const _session = (proto, request) => {
1307
1307
  const jwtToken = proto[_private.PVK].options.jwtToken;
1308
1308
  if (_.isEmpty(jwtToken))
1309
1309
  throw Error('Invalid jwt token');
1310
+ const cookieKey = _.last(_.castArray(request.headers[_const.AUTH_ALT_COOKIE_KEY] || [])) || _const.AUTH_COOKIE_KEY;
1310
1311
  let authorization = '';
1311
1312
  if (request.headers.authorization) {
1312
1313
  const parts = request.headers.authorization.split(' ');
1313
1314
  if (parts.length === 2 && parts[0] === 'Bearer')
1314
1315
  authorization = parts[1];
1315
1316
  }
1316
- else if (request.cookies[_const.AUTH_COOKIE_KEY]) {
1317
- authorization = request.cookies[_const.AUTH_COOKIE_KEY];
1317
+ else if (request.cookies[cookieKey]) {
1318
+ authorization = request.cookies[cookieKey];
1318
1319
  }
1319
1320
  if (_.isEmpty(authorization))
1320
1321
  return;
@@ -1393,7 +1394,8 @@ const signUser = async (proto, res, user, options) => {
1393
1394
  user: user?.id,
1394
1395
  cookieOptions,
1395
1396
  }, options?.jwtSignOptions ?? 'login');
1396
- res.cookie(_const.AUTH_COOKIE_KEY, token, cookieOptions);
1397
+ const cookieKey = _.last(_.castArray(res.req.headers[_const.AUTH_ALT_COOKIE_KEY] || [])) || _const.AUTH_COOKIE_KEY;
1398
+ res.cookie(cookieKey, token, cookieOptions);
1397
1399
  sessionInfoMap.set(res.req, user ? await fetchSessionInfo(proto, user.id) : {});
1398
1400
  };
1399
1401