proto.io 0.0.205 → 0.0.206
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.d.ts +3 -3
- package/dist/adapters/file/database.d.ts +2 -2
- package/dist/adapters/file/database.js +2 -2
- package/dist/adapters/file/database.mjs +2 -2
- package/dist/adapters/file/filesystem.d.ts +3 -3
- package/dist/adapters/file/google-cloud-storage.d.ts +3 -3
- package/dist/adapters/storage/progres.d.ts +5 -8
- package/dist/adapters/storage/progres.js +13 -17
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +13 -17
- package/dist/adapters/storage/progres.mjs.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +3 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +4 -3
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +30 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -12
- package/dist/index.mjs.map +1 -1
- package/dist/internals/{base-Cf7WkDhO.d.ts → base-Be7PFKEC.d.ts} +2 -2
- package/dist/internals/base-Be7PFKEC.d.ts.map +1 -0
- package/dist/internals/{chunk-ONaLyXL0.d.ts → chunk-CEQtSsWb.d.ts} +3 -3
- package/dist/internals/chunk-CEQtSsWb.d.ts.map +1 -0
- package/dist/internals/{index-DByHjIHI.js → index-BFZlY3IO.js} +23 -23
- package/dist/internals/index-BFZlY3IO.js.map +1 -0
- package/dist/internals/{index-DtCgllhg.mjs → index-CSnRU_KQ.mjs} +23 -23
- package/dist/internals/index-CSnRU_KQ.mjs.map +1 -0
- package/dist/internals/{index-DI-jPA6f.d.ts → index-CURcwPBG.d.ts} +3 -3
- package/dist/internals/index-CURcwPBG.d.ts.map +1 -0
- package/dist/internals/{index-B8TESzd9.js → index-CsmAYB_t.js} +2 -1
- package/dist/internals/{index-B8TESzd9.js.map → index-CsmAYB_t.js.map} +1 -1
- package/dist/internals/{index-C4vwSN74.js → index-CyPxh5dl.js} +241 -2
- package/dist/internals/index-CyPxh5dl.js.map +1 -0
- package/dist/internals/{index-JdEs5VLY.d.ts → index-DnbbpIaO.d.ts} +15 -18
- package/dist/internals/index-DnbbpIaO.d.ts.map +1 -0
- package/dist/internals/{index-al1N-qi7.mjs → index-DpN9tcbY.mjs} +2 -2
- package/dist/internals/{index-al1N-qi7.mjs.map → index-DpN9tcbY.mjs.map} +1 -1
- package/dist/internals/{index-Blw7vAq5.mjs → index-iRVgw566.mjs} +241 -2
- package/dist/internals/index-iRVgw566.mjs.map +1 -0
- package/dist/internals/{random-6nHcBOxn.mjs → random-BnGB_bVS.mjs} +3 -3
- package/dist/internals/{random-6nHcBOxn.mjs.map → random-BnGB_bVS.mjs.map} +1 -1
- package/dist/internals/{random-Dk3OhDNU.js → random-D7S1XD7F.js} +3 -3
- package/dist/internals/{random-Dk3OhDNU.js.map → random-D7S1XD7F.js.map} +1 -1
- package/package.json +1 -1
- package/dist/internals/base-Cf7WkDhO.d.ts.map +0 -1
- package/dist/internals/chunk-ONaLyXL0.d.ts.map +0 -1
- package/dist/internals/index-Blw7vAq5.mjs.map +0 -1
- package/dist/internals/index-C4vwSN74.js.map +0 -1
- package/dist/internals/index-DByHjIHI.js.map +0 -1
- package/dist/internals/index-DI-jPA6f.d.ts.map +0 -1
- package/dist/internals/index-DtCgllhg.mjs.map +0 -1
- package/dist/internals/index-JdEs5VLY.d.ts.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, f as isJob, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-
|
|
1
|
+
import { P as ProtoClient } from './internals/index-CURcwPBG.js';
|
|
2
|
+
export { c as classExtends, e as isFile, f as isJob, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-CURcwPBG.js';
|
|
3
3
|
export { Decimal } from 'decimal.js';
|
|
4
|
-
export { D as DeserializeOptions, S as SerializeOptions, e as
|
|
4
|
+
export { D as DeserializeOptions, S as SerializeOptions, e as TNumber, f as TSerializable, g as deserialize, s as serialize } from './internals/index-DnbbpIaO.js';
|
|
5
5
|
import '@o2ter/utils-js';
|
|
6
6
|
import 'socket.io-client';
|
|
7
7
|
import '@socket.io/component-emitter';
|
package/dist/client.js
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./internals/index-
|
|
5
|
+
var index = require('./internals/index-BFZlY3IO.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
|
-
require('./internals/index-
|
|
10
|
+
require('./internals/index-CsmAYB_t.js');
|
|
11
11
|
require('axios');
|
|
12
12
|
require('@o2ter/server-js/dist/const');
|
|
13
13
|
require('socket.io-client');
|
|
14
|
+
require('@o2ter/crypto-js');
|
|
14
15
|
|
|
15
16
|
//
|
|
16
17
|
// index.ts
|
package/dist/client.js.map
CHANGED
|
@@ -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 '../common';\n\nexport { ProtoClient };\n\nexport default ProtoClient;"],"names":[],"mappings":"
|
|
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 '../common';\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,13 +1,14 @@
|
|
|
1
|
-
import { e as ProtoClient } from './internals/index-
|
|
2
|
-
export { f as classExtends, d as deserialize, k as isFile, l as isJob, g as isObject, i as isQuery, j as isRole, h as isUser, s as serialize } from './internals/index-
|
|
1
|
+
import { e as ProtoClient } from './internals/index-CSnRU_KQ.mjs';
|
|
2
|
+
export { f as classExtends, d as deserialize, k as isFile, l as isJob, g as isObject, i as isQuery, j as isRole, h as isUser, s as serialize } from './internals/index-CSnRU_KQ.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
|
-
import './internals/index-
|
|
7
|
+
import './internals/index-DpN9tcbY.mjs';
|
|
8
8
|
import 'axios';
|
|
9
9
|
import '@o2ter/server-js/dist/const';
|
|
10
10
|
import 'socket.io-client';
|
|
11
|
+
import '@o2ter/crypto-js';
|
|
11
12
|
|
|
12
13
|
//
|
|
13
14
|
// index.ts
|
package/dist/client.mjs.map
CHANGED
|
@@ -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 '../common';\n\nexport { ProtoClient };\n\nexport default ProtoClient;"],"names":[],"mappings":"
|
|
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 '../common';\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
|
@@ -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, a as TValueWithoutObject, P as ProtoService, b as ProtoServiceOptions, c as ProtoServiceKeyOptions } from './internals/index-
|
|
5
|
-
export { D as DeserializeOptions, S as SerializeOptions, d as TFileStorage, e as
|
|
4
|
+
import { T as TSchema, a as TValueWithoutObject, P as ProtoService, b as ProtoServiceOptions, c as ProtoServiceKeyOptions } from './internals/index-DnbbpIaO.js';
|
|
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-DnbbpIaO.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, f as isJob, 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, f as isJob, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-CURcwPBG.js';
|
|
9
9
|
import '@o2ter/utils-js';
|
|
10
10
|
import 'jsonwebtoken';
|
|
11
11
|
import 'lodash';
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,11 @@ 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-D7S1XD7F.js');
|
|
8
8
|
var _private = require('./internals/private-Ciddhure.js');
|
|
9
9
|
var utilsJs = require('@o2ter/utils-js');
|
|
10
|
-
var index = require('./internals/index-
|
|
11
|
-
var index$1 = require('./internals/index-
|
|
10
|
+
var index = require('./internals/index-BFZlY3IO.js');
|
|
11
|
+
var index$1 = require('./internals/index-CsmAYB_t.js');
|
|
12
12
|
var jwt = require('jsonwebtoken');
|
|
13
13
|
var node_buffer = require('node:buffer');
|
|
14
14
|
var node_stream = require('node:stream');
|
|
@@ -16,7 +16,7 @@ var node_crypto = require('node:crypto');
|
|
|
16
16
|
var util = require('util');
|
|
17
17
|
var cryptoJs = require('@o2ter/crypto-js');
|
|
18
18
|
var Decimal = require('decimal.js');
|
|
19
|
-
var index$2 = require('./internals/index-
|
|
19
|
+
var index$2 = require('./internals/index-CyPxh5dl.js');
|
|
20
20
|
var queryType = require('query-types');
|
|
21
21
|
var busboy = require('busboy');
|
|
22
22
|
require('axios');
|
|
@@ -358,18 +358,18 @@ class _ProtoQuery extends index.TQuery {
|
|
|
358
358
|
return result;
|
|
359
359
|
}
|
|
360
360
|
async insertMany(values, options) {
|
|
361
|
-
return this._dispatcher(options).insertMany({
|
|
361
|
+
return this._objectMethods(await this._dispatcher(options).insertMany({
|
|
362
362
|
className: this.className,
|
|
363
363
|
includes: this[_private.PVK].options.includes,
|
|
364
364
|
matches: this[_private.PVK].options.matches,
|
|
365
365
|
countMatches: this[_private.PVK].options.countMatches,
|
|
366
|
-
}, values);
|
|
366
|
+
}, values));
|
|
367
367
|
}
|
|
368
368
|
async updateOne(update, options) {
|
|
369
369
|
return this._objectMethods(await this._dispatcher(options).updateOne(this._queryOptions, update));
|
|
370
370
|
}
|
|
371
371
|
async updateMany(update, options) {
|
|
372
|
-
return this._dispatcher(options).updateMany(this._queryOptions, update);
|
|
372
|
+
return this._objectMethods(await this._dispatcher(options).updateMany(this._queryOptions, update));
|
|
373
373
|
}
|
|
374
374
|
async upsertOne(update, setOnInsert, options) {
|
|
375
375
|
const result = this._objectMethods(await this._dispatcher(options).upsertOne(this._queryOptions, update, setOnInsert));
|
|
@@ -378,13 +378,13 @@ class _ProtoQuery extends index.TQuery {
|
|
|
378
378
|
return result;
|
|
379
379
|
}
|
|
380
380
|
async upsertMany(update, setOnInsert, options) {
|
|
381
|
-
return this._dispatcher(options).upsertMany(this._queryOptions, update, setOnInsert);
|
|
381
|
+
return this._objectMethods(await this._dispatcher(options).upsertMany(this._queryOptions, update, setOnInsert));
|
|
382
382
|
}
|
|
383
383
|
async deleteOne(options) {
|
|
384
384
|
return this._objectMethods(await this._dispatcher(options).deleteOne(this._queryOptions));
|
|
385
385
|
}
|
|
386
386
|
async deleteMany(options) {
|
|
387
|
-
return this._dispatcher(options).deleteMany(this._queryOptions);
|
|
387
|
+
return this._objectMethods(await this._dispatcher(options).deleteMany(this._queryOptions));
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
class ProtoQuery extends _ProtoQuery {
|
|
@@ -1643,8 +1643,11 @@ class ProtoService extends index.ProtoType {
|
|
|
1643
1643
|
notify(data) {
|
|
1644
1644
|
return this[_private.PVK].notify(this, data);
|
|
1645
1645
|
}
|
|
1646
|
-
listen(callback) {
|
|
1646
|
+
listen(callback, selector) {
|
|
1647
|
+
const _selector = !_.isNil(selector) ? index$2.QuerySelector.decode(selector) : undefined;
|
|
1647
1648
|
return this[_private.PVK].listen(this, data => {
|
|
1649
|
+
if (_selector && !_selector.eval(data))
|
|
1650
|
+
return;
|
|
1648
1651
|
callback(data);
|
|
1649
1652
|
});
|
|
1650
1653
|
}
|
|
@@ -2516,10 +2519,13 @@ const ProtoRoute = async (options) => {
|
|
|
2516
2519
|
const registerProtoSocket = (proto, server, endpoint) => {
|
|
2517
2520
|
const io = endpoint ? server.socket().of(endpoint) : server.socket();
|
|
2518
2521
|
io.on('connection', async (socket) => {
|
|
2522
|
+
let listeners = {};
|
|
2519
2523
|
const connect = async (token) => {
|
|
2520
2524
|
const payload = await proto.connectWithSessionToken(token);
|
|
2521
2525
|
const { remove } = payload.listen(data => {
|
|
2522
|
-
|
|
2526
|
+
const ids = _.keys(_.pickBy(listeners, v => v instanceof index$2.QuerySelector ? v.eval(data) : v));
|
|
2527
|
+
if (!_.isEmpty(ids))
|
|
2528
|
+
socket.emit('data', { ids, data });
|
|
2523
2529
|
});
|
|
2524
2530
|
return remove;
|
|
2525
2531
|
};
|
|
@@ -2532,6 +2538,19 @@ const registerProtoSocket = (proto, server, endpoint) => {
|
|
|
2532
2538
|
socket.on('disconnect', () => {
|
|
2533
2539
|
remove.then(rm => rm());
|
|
2534
2540
|
});
|
|
2541
|
+
socket.on('register', (payload) => {
|
|
2542
|
+
listeners = _.mapValues(payload, v => {
|
|
2543
|
+
if (_.isBoolean(v))
|
|
2544
|
+
return true;
|
|
2545
|
+
try {
|
|
2546
|
+
return index$2.QuerySelector.decode(v);
|
|
2547
|
+
}
|
|
2548
|
+
catch (error) {
|
|
2549
|
+
console.error(error);
|
|
2550
|
+
return false;
|
|
2551
|
+
}
|
|
2552
|
+
});
|
|
2553
|
+
});
|
|
2535
2554
|
});
|
|
2536
2555
|
return io;
|
|
2537
2556
|
};
|