Compare commits

..

4 Commits

Author SHA1 Message Date
1e570813a3 1.0.21 2021-11-10 17:35:55 +01:00
0199e8ef17 fix(core): update 2021-11-10 17:35:55 +01:00
68def29c80 1.0.20 2021-10-23 00:27:47 +02:00
106eb12a7f fix(core): update 2021-10-23 00:27:46 +02:00
4 changed files with 10 additions and 9 deletions

5
package-lock.json generated
View File

@@ -1,18 +1,17 @@
{
"name": "@apiglobal/typedsocket",
"version": "1.0.19",
"version": "1.0.21",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@apiglobal/typedsocket",
"version": "1.0.19",
"version": "1.0.21",
"license": "MIT",
"dependencies": {
"@apiglobal/typedrequest": "^1.0.58",
"@apiglobal/typedrequest-interfaces": "^1.0.15",
"@pushrocks/isohash": "^1.0.2",
"@pushrocks/smartexpress": "^3.0.107",
"@pushrocks/smartsocket": "^1.2.8",
"@pushrocks/smartstring": "^3.0.24"
},

View File

@@ -1,6 +1,6 @@
{
"name": "@apiglobal/typedsocket",
"version": "1.0.19",
"version": "1.0.21",
"private": false,
"description": "a typedrequest extension supporting websockets",
"main": "dist_ts/index.js",
@@ -24,7 +24,6 @@
"@apiglobal/typedrequest": "^1.0.58",
"@apiglobal/typedrequest-interfaces": "^1.0.15",
"@pushrocks/isohash": "^1.0.2",
"@pushrocks/smartexpress": "^3.0.107",
"@pushrocks/smartsocket": "^1.2.8",
"@pushrocks/smartstring": "^3.0.24"
},

View File

@@ -34,11 +34,15 @@ tap.test('should add some handlers', async () => {
tap.test('should create Server and Client', async (tools) => {
testTypedSocketServer = await typedsocket.TypedSocket.createServer(testTypedRouter);
testTypedSocketClient = await typedsocket.TypedSocket.createClient(testTypedRouter, 'http://localhost:3000');
await tools.delayFor(1000);
console.log('test: waiting 5 seconds');
await tools.delayFor(5000);
await testTypedSocketServer.stop();
// lets create another server
testTypedSocketServer = await typedsocket.TypedSocket.createServer(testTypedRouter);
// lets see if auto reconnect works
console.log('test: waiting 60 seconds for reconnect');
await tools.delayFor(60000);
});

View File

@@ -1,5 +1,4 @@
import * as plugins from './typedsocket.plugins';
import type * as smartexpress from '@pushrocks/smartexpress';
const publicRoleName = 'publicRoleName';
const publicRolePass = 'publicRolePass';
@@ -14,7 +13,7 @@ export class TypedSocket {
*/
public static async createServer(
typedrouterArg: plugins.typedrequest.TypedRouter,
smartexpressServerArg?: smartexpress.Server
smartexpressServerArg?: any
): Promise<TypedSocket> {
const smartsocketServer = new plugins.smartsocket.Smartsocket({
port: 3000,
@@ -50,7 +49,7 @@ export class TypedSocket {
);
targetConnectionArg = smartsocketServer.socketConnections.getArray()[0];
} else {
throw new Error('you need to specify the wanted targetConnection');
throw new Error('you need to specify the wanted targetConnection. Currently no target is selectable automatically.');
}
}
const response: T = await smartsocketServer.clientCall(