Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b58d8084e9 | |||
| f765e60e1f | |||
| b726669c4b | |||
| 4f0066b5ca | |||
| 0edc903900 | |||
| fa41192377 | |||
| 725e3c65c6 | |||
| 4e9108f7df | |||
| 420d634e83 | |||
| eb596e5dd8 | |||
| 5748bd8280 | |||
| 4e8ea21df2 | |||
| 6f4be3baaa | |||
| a484060888 | |||
| c1b15daaca | |||
| f9397feaf0 | |||
| 889ec9c8ec | |||
| 5d460cf002 | |||
| 5e6ec0d311 | |||
| dd834590cc | |||
| 96b7354dae | |||
| 3a5533c4fe | |||
| 1f5f84763d | |||
| 6474112275 | |||
| a46c0cf395 | |||
| 8be5c352f4 |
@@ -64,7 +64,7 @@ testBuild:
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
- npmci npm build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "apiglobal",
|
||||
"gitscope": "api.global",
|
||||
"gitrepo": "typedsocket",
|
||||
"description": "a typedrequest extension supporting websockets",
|
||||
"npmPackagename": "@apiglobal/typedsocket",
|
||||
"npmPackagename": "@api.global/typedsocket",
|
||||
"license": "MIT",
|
||||
"projectDomain": "api.global"
|
||||
}
|
||||
|
||||
31
package.json
31
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/typedsocket",
|
||||
"version": "2.0.13",
|
||||
"name": "@api.global/typedsocket",
|
||||
"version": "2.0.26",
|
||||
"private": false,
|
||||
"description": "a typedrequest extension supporting websockets",
|
||||
"main": "dist_ts/index.js",
|
||||
@@ -14,21 +14,22 @@
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.63",
|
||||
"@gitzone/tsbundle": "^2.0.6",
|
||||
"@gitzone/tsrun": "^1.2.39",
|
||||
"@gitzone/tstest": "^1.0.74",
|
||||
"@pushrocks/smartenv": "^5.0.2",
|
||||
"@pushrocks/tapbundle": "^5.0.4",
|
||||
"@types/node": "^18.11.18"
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsbundle": "^2.0.8",
|
||||
"@gitzone/tsrun": "^1.2.44",
|
||||
"@gitzone/tstest": "^1.0.77",
|
||||
"@push.rocks/smartenv": "^5.0.5",
|
||||
"@push.rocks/tapbundle": "^5.0.12",
|
||||
"@types/node": "^20.4.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^2.0.8",
|
||||
"@apiglobal/typedrequest-interfaces": "2.0.1",
|
||||
"@pushrocks/isohash": "^2.0.0",
|
||||
"@pushrocks/smartjson": "^5.0.5",
|
||||
"@pushrocks/smartsocket": "^2.0.11",
|
||||
"@pushrocks/smartstring": "^4.0.2"
|
||||
"@api.global/typedrequest": "^3.0.1",
|
||||
"@api.global/typedrequest-interfaces": "^3.0.1",
|
||||
"@push.rocks/isohash": "^2.0.0",
|
||||
"@push.rocks/smartjson": "^5.0.5",
|
||||
"@push.rocks/smartsocket": "^2.0.20",
|
||||
"@push.rocks/smartstring": "^4.0.2",
|
||||
"@push.rocks/smarturl": "^3.0.5"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
|
||||
3326
pnpm-lock.yaml
generated
3326
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,6 @@ Code Style | [](htt
|
||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -37,7 +36,6 @@ We are always happy for code contributions. If you are not the code contributing
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
## Legal
|
||||
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { tap, expect } from '@pushrocks/tapbundle';
|
||||
import { tap, expect } from '@push.rocks/tapbundle';
|
||||
|
||||
import * as typedsocket from '../ts/index.js';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import * as typedrequest from '@apiglobal/typedrequest';
|
||||
import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiglobal/typedsocket',
|
||||
version: '2.0.13',
|
||||
name: '@api.global/typedsocket',
|
||||
version: '2.0.26',
|
||||
description: 'a typedrequest extension supporting websockets'
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from './typedsocket.classes.typedsocket.js';
|
||||
export * from './typedsocket.classes.typedsocket.js';
|
||||
@@ -97,15 +97,25 @@ export class TypedSocket {
|
||||
},
|
||||
smartsocketClient
|
||||
);
|
||||
|
||||
console.log(`typedsocket triggering smartsocket to connect...`);
|
||||
const before = Date.now();
|
||||
await smartsocketClient.connect();
|
||||
console.log(`typedsocket triggered smartsocket connected in ${Date.now() - before}ms!!!`)
|
||||
|
||||
return typedsocket;
|
||||
}
|
||||
|
||||
public static useWindowLocationOriginUrl = () => {
|
||||
const windowLocationResult = plugins.smarturl.Smarturl.createFromUrl(globalThis.location.origin).toString();
|
||||
return windowLocationResult;
|
||||
}
|
||||
|
||||
// INSTANCE
|
||||
public side: TTypedSocketSide;
|
||||
public typedrouter: plugins.typedrequest.TypedRouter;
|
||||
public get eventSubject() {
|
||||
return this.socketServerOrClient.eventSubject;
|
||||
}
|
||||
private postMethod: plugins.typedrequest.IPostMethod &
|
||||
((
|
||||
typedRequestPostObject: plugins.typedrequestInterfaces.ITypedRequest,
|
||||
@@ -126,7 +136,10 @@ export class TypedSocket {
|
||||
this.socketServerOrClient = socketServerOrClientArg;
|
||||
}
|
||||
|
||||
public addTag<T extends plugins.typedrequestInterfaces.ITag = any>(nameArg: T['name'], payloadArg: T['payload']) {
|
||||
public addTag<T extends plugins.typedrequestInterfaces.ITag = any>(
|
||||
nameArg: T['name'],
|
||||
payloadArg: T['payload']
|
||||
) {
|
||||
if (
|
||||
this.side === 'client' &&
|
||||
this.socketServerOrClient instanceof plugins.smartsocket.SmartsocketClient
|
||||
@@ -189,7 +202,9 @@ export class TypedSocket {
|
||||
return allMatching[0];
|
||||
}
|
||||
|
||||
public async findAllTargetConnectionsByTag<TTag extends plugins.typedrequestInterfaces.ITag = any>(keyArg: TTag['name'], payloadArg?: TTag['payload']) {
|
||||
public async findAllTargetConnectionsByTag<
|
||||
TTag extends plugins.typedrequestInterfaces.ITag = any
|
||||
>(keyArg: TTag['name'], payloadArg?: TTag['payload']) {
|
||||
return this.findAllTargetConnections(async (socketConnectionArg) => {
|
||||
let result: boolean;
|
||||
if (!payloadArg) {
|
||||
@@ -204,7 +219,10 @@ export class TypedSocket {
|
||||
});
|
||||
}
|
||||
|
||||
public async findTargetConnectionByTag<TTag extends plugins.typedrequestInterfaces.ITag = any>(keyArg: TTag['name'], payloadArg?: TTag['payload']) {
|
||||
public async findTargetConnectionByTag<TTag extends plugins.typedrequestInterfaces.ITag = any>(
|
||||
keyArg: TTag['name'],
|
||||
payloadArg?: TTag['payload']
|
||||
) {
|
||||
const allResults = await this.findAllTargetConnectionsByTag(keyArg, payloadArg);
|
||||
return allResults[0];
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
// @apiglobal scope
|
||||
import * as typedrequest from '@apiglobal/typedrequest';
|
||||
import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
|
||||
import * as typedrequest from '@api.global/typedrequest';
|
||||
import * as typedrequestInterfaces from '@api.global/typedrequest-interfaces';
|
||||
|
||||
export { typedrequest, typedrequestInterfaces };
|
||||
|
||||
// @pushrocks scope
|
||||
import * as isohash from '@pushrocks/isohash';
|
||||
import * as smartjson from '@pushrocks/smartjson';
|
||||
import * as smartsocket from '@pushrocks/smartsocket';
|
||||
import * as smartstring from '@pushrocks/smartstring';
|
||||
import * as isohash from '@push.rocks/isohash';
|
||||
import * as smartjson from '@push.rocks/smartjson';
|
||||
import * as smartsocket from '@push.rocks/smartsocket';
|
||||
import * as smartstring from '@push.rocks/smartstring';
|
||||
import * as smarturl from '@push.rocks/smarturl';
|
||||
|
||||
export { isohash, smartjson, smartsocket, smartstring };
|
||||
export { isohash, smartjson, smartsocket, smartstring, smarturl };
|
||||
|
||||
Reference in New Issue
Block a user