@zerooneit/expressive-tea 1.3.0-beta.4 → 1.3.0-beta.6
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/.eslintrc.js +44 -0
- package/.gitattributes +4 -0
- package/classes/Boot.d.ts +7 -4
- package/classes/Boot.js +53 -46
- package/classes/Engine.d.ts +15 -0
- package/classes/Engine.js +30 -0
- package/classes/LoadBalancer.js +1 -1
- package/classes/ProxyRoute.d.ts +3 -3
- package/decorators/annotations.d.ts +1 -1
- package/decorators/module.d.ts +4 -3
- package/decorators/module.js +2 -1
- package/decorators/proxy.d.ts +2 -2
- package/decorators/proxy.js +5 -1
- package/decorators/router.d.ts +4 -4
- package/decorators/router.js +6 -4
- package/decorators/server.d.ts +4 -4
- package/engines/constants/constants.d.ts +2 -0
- package/engines/constants/constants.js +5 -0
- package/engines/http/index.d.ts +5 -6
- package/engines/http/index.js +20 -22
- package/engines/socketio/index.d.ts +9 -0
- package/engines/socketio/index.js +23 -0
- package/engines/teacup/index.d.ts +5 -7
- package/engines/teacup/index.js +35 -52
- package/engines/teapot/index.d.ts +9 -10
- package/engines/teapot/index.js +51 -81
- package/engines/websocket/index.d.ts +5 -5
- package/engines/websocket/index.js +10 -13
- package/exceptions/RequestExceptions.d.ts +1 -1
- package/helpers/boot-helper.d.ts +2 -2
- package/helpers/boot-helper.js +3 -2
- package/helpers/promise-helper.d.ts +1 -0
- package/helpers/promise-helper.js +7 -0
- package/helpers/server.d.ts +5 -5
- package/helpers/server.js +12 -10
- package/helpers/teapot-helper.d.ts +6 -4
- package/helpers/teapot-helper.js +19 -4
- package/helpers/websocket-helper.d.ts +2 -2
- package/interfaces/index.d.ts +4 -0
- package/interfaces/index.js +2 -0
- package/inversify.config.d.ts +4 -4
- package/package.json +42 -33
- package/services/DependencyInjection.d.ts +4 -2
- package/services/DependencyInjection.js +2 -2
- package/services/WebsocketService.d.ts +2 -2
- package/tsconfig.linter.json +24 -0
- package/tslint-to-eslint-config.log +12 -0
- package/.circleci/config.yml +0 -58
package/inversify.config.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Container } from 'inversify';
|
|
2
2
|
declare const container: Container;
|
|
3
3
|
export declare const decorators: {
|
|
4
|
-
lazyInject: (serviceIdentifier: string | symbol | import("inversify
|
|
5
|
-
lazyInjectNamed: (serviceIdentifier: string | symbol | import("inversify
|
|
6
|
-
lazyInjectTagged: (serviceIdentifier: string | symbol | import("inversify
|
|
7
|
-
lazyMultiInject: (serviceIdentifier: string | symbol | import("inversify
|
|
4
|
+
lazyInject: (serviceIdentifier: string | symbol | import("inversify").interfaces.Newable<any> | import("inversify").interfaces.Abstract<any>) => (proto: any, key: string) => void;
|
|
5
|
+
lazyInjectNamed: (serviceIdentifier: string | symbol | import("inversify").interfaces.Newable<any> | import("inversify").interfaces.Abstract<any>, named: string) => (proto: any, key: string) => void;
|
|
6
|
+
lazyInjectTagged: (serviceIdentifier: string | symbol | import("inversify").interfaces.Newable<any> | import("inversify").interfaces.Abstract<any>, key: string, value: any) => (proto: any, propertyName: string) => void;
|
|
7
|
+
lazyMultiInject: (serviceIdentifier: string | symbol | import("inversify").interfaces.Newable<any> | import("inversify").interfaces.Abstract<any>) => (proto: any, key: string) => void;
|
|
8
8
|
};
|
|
9
9
|
export default container;
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerooneit/expressive-tea",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
3
|
+
"version": "1.3.0-beta.6",
|
|
4
4
|
"description": "A REST API over Express and Typescript",
|
|
5
5
|
"main": "classes/Boot.js",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
7
|
+
"node": ">=18.0.0"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"test": "npm run linter && jest --clearCache && jest --coverage --ci --detectOpenHandles --forceExit --silent
|
|
10
|
+
"test": "npm run linter && jest --clearCache && jest --coverage --ci --detectOpenHandles --forceExit --silent",
|
|
11
11
|
"test:dev": "npm run linter && jest --clearCache && jest --detectOpenHandles --forceExit",
|
|
12
|
-
"
|
|
12
|
+
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
|
|
13
|
+
"linter": "eslint --ext .ts . --fix",
|
|
14
|
+
"linter:ci": "eslint --ext .ts",
|
|
13
15
|
"build:dev": "tsc --project tsconfig.json --watch",
|
|
14
16
|
"build": "tsc --project tsconfig.json",
|
|
15
17
|
"clean:build": "trash '**/*.js' '**/*.d.ts' '**/*.js.map' '**/*.d.ts.map' '!node_modules/**/*' '!docs/**/*' '!coverage/**/*' '!gulpfile.js' '!tasks/*.js' '!jest.config.js' '!tools/**/*'",
|
|
@@ -26,44 +28,48 @@
|
|
|
26
28
|
"license": "Apache-2.0",
|
|
27
29
|
"devDependencies": {
|
|
28
30
|
"@expressive-tea/commons": "^1.0.1",
|
|
29
|
-
"@expressive-tea/plugin": "1.0.
|
|
30
|
-
"@types/
|
|
31
|
-
"@types/express": "
|
|
32
|
-
"@types/express-
|
|
33
|
-
"@types/
|
|
34
|
-
"@types/
|
|
35
|
-
"@types/
|
|
36
|
-
"@types/node": "18.11.18",
|
|
31
|
+
"@expressive-tea/plugin": "1.0.3",
|
|
32
|
+
"@types/express": "4.17.21",
|
|
33
|
+
"@types/express-http-proxy": "1.6.6",
|
|
34
|
+
"@types/express-serve-static-core": "4.19.0",
|
|
35
|
+
"@types/jest": "29.5.12",
|
|
36
|
+
"@types/lodash": "4.17.0",
|
|
37
|
+
"@types/node": "20.12.7",
|
|
37
38
|
"@types/reflect-metadata": "0.1.0",
|
|
38
39
|
"@types/socket.io": "3.0.2",
|
|
39
40
|
"@types/socket.io-client": "3.0.0",
|
|
40
|
-
"@types/ws": "8.5.
|
|
41
|
+
"@types/ws": "8.5.10",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "7.7.0",
|
|
43
|
+
"@typescript-eslint/parser": "7.7.0",
|
|
44
|
+
"eslint": "8.57.0",
|
|
45
|
+
"eslint-config-love": "^47.0.0",
|
|
46
|
+
"eslint-config-prettier": "9.1.0",
|
|
47
|
+
"eslint-plugin-jsdoc": "^48.2.3",
|
|
48
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
41
49
|
"http-terminator": "3.2.0",
|
|
42
|
-
"jest": "29.
|
|
50
|
+
"jest": "29.7.0",
|
|
43
51
|
"jest-express": "1.12.0",
|
|
44
|
-
"jest-junit": "
|
|
45
|
-
"reflect-metadata": "0.
|
|
46
|
-
"rimraf": "
|
|
47
|
-
"supertest": "6.3.
|
|
52
|
+
"jest-junit": "16.0.0",
|
|
53
|
+
"reflect-metadata": "0.2.2",
|
|
54
|
+
"rimraf": "5.0.5",
|
|
55
|
+
"supertest": "6.3.4",
|
|
48
56
|
"toast-jsdoc": "1.0.2",
|
|
49
57
|
"trash-cli": "5.0.0",
|
|
50
|
-
"ts-jest": "29.
|
|
51
|
-
"ts-node": "10.9.
|
|
52
|
-
"
|
|
53
|
-
"typescript": "4.
|
|
58
|
+
"ts-jest": "29.1.2",
|
|
59
|
+
"ts-node": "10.9.2",
|
|
60
|
+
"tslib": "^2.6.2",
|
|
61
|
+
"typescript": "5.4.5"
|
|
54
62
|
},
|
|
55
63
|
"dependencies": {
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"express-http-proxy": "1.6.3",
|
|
60
|
-
"inversify": "6.0.1",
|
|
64
|
+
"express": "4.19.2",
|
|
65
|
+
"express-http-proxy": "2.0.0",
|
|
66
|
+
"inversify": "6.0.2",
|
|
61
67
|
"inversify-inject-decorators": "3.1.0",
|
|
62
68
|
"lodash": "4.17.21",
|
|
63
|
-
"socket.io": "4.5
|
|
64
|
-
"socket.io-client": "4.5
|
|
69
|
+
"socket.io": "4.7.5",
|
|
70
|
+
"socket.io-client": "4.7.5",
|
|
65
71
|
"url-scheme": "1.0.5",
|
|
66
|
-
"ws": "8.
|
|
72
|
+
"ws": "8.16.0"
|
|
67
73
|
},
|
|
68
74
|
"repository": {
|
|
69
75
|
"type": "git",
|
|
@@ -106,11 +112,14 @@
|
|
|
106
112
|
},
|
|
107
113
|
"homepage": "https://github.com/Expressive-Tea/expresive-tea#readme",
|
|
108
114
|
"optionalDependencies": {
|
|
109
|
-
"bufferutil": "4.0.
|
|
115
|
+
"bufferutil": "4.0.8",
|
|
110
116
|
"utf-8-validate": "^6.0.0"
|
|
111
117
|
},
|
|
112
118
|
"resolutions": {
|
|
113
119
|
"set-value": "4.1.0",
|
|
114
|
-
"glob-parent": "6.0.2"
|
|
115
|
-
|
|
120
|
+
"glob-parent": "6.0.2",
|
|
121
|
+
"engine.io": "6.4.2",
|
|
122
|
+
"@typescript-eslint/eslint-plugin": "7.7.0"
|
|
123
|
+
},
|
|
124
|
+
"packageManager": "yarn@4.1.1"
|
|
116
125
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Container } from 'inversify';
|
|
1
|
+
import { Container, interfaces } from 'inversify';
|
|
2
|
+
import ServiceIdentifier = interfaces.ServiceIdentifier;
|
|
3
|
+
import Newable = interfaces.Newable;
|
|
2
4
|
/**
|
|
3
5
|
* @module Services
|
|
4
6
|
*/
|
|
@@ -26,7 +28,7 @@ declare class DependencyInjection {
|
|
|
26
28
|
* @param {string | symbol |never } [providerName="ClassName"] - Provide the provider identification.
|
|
27
29
|
* @summary Add Provider to Dependency Injection Providers
|
|
28
30
|
*/
|
|
29
|
-
static setProvider(ProviderFactory: any
|
|
31
|
+
static setProvider(ProviderFactory: Newable<any>, providerName?: ServiceIdentifier<string | symbol>): void;
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
34
|
* @module Decorators/DependencyInjection
|
|
@@ -27,8 +27,8 @@ class DependencyInjection {
|
|
|
27
27
|
* @summary Add Provider to Dependency Injection Providers
|
|
28
28
|
*/
|
|
29
29
|
static setProvider(ProviderFactory, providerName) {
|
|
30
|
-
if (!rootContainer.isBound(providerName
|
|
31
|
-
rootContainer.bind(providerName
|
|
30
|
+
if (!rootContainer.isBound(providerName !== null && providerName !== void 0 ? providerName : ProviderFactory.name)) {
|
|
31
|
+
rootContainer.bind(providerName !== null && providerName !== void 0 ? providerName : ProviderFactory.name).to(ProviderFactory);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import WebSocket from 'ws';
|
|
4
|
-
import * as http from 'http';
|
|
3
|
+
import type WebSocket from 'ws';
|
|
4
|
+
import type * as http from 'http';
|
|
5
5
|
import * as https from 'https';
|
|
6
6
|
export default class WebsocketService {
|
|
7
7
|
static instance: WebsocketService;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"noImplicitAny": false,
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"target": "es2017",
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"strictNullChecks": true,
|
|
9
|
+
"strict": false,
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"allowSyntheticDefaultImports": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"baseUrl": ".",
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"lib": [
|
|
17
|
+
"es2017",
|
|
18
|
+
"dom"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"exclude": [
|
|
22
|
+
"node_modules"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
5 ESLint rules behave differently from their TSLint counterparts:
|
|
2
|
+
* no-invalid-this:
|
|
3
|
+
- Functions in methods will no longer be ignored.
|
|
4
|
+
* @typescript-eslint/no-unused-expressions:
|
|
5
|
+
- The TSLint optional config "allow-new" is the default ESLint behavior and will no longer be ignored.
|
|
6
|
+
* prefer-arrow/prefer-arrow-functions:
|
|
7
|
+
- ESLint (eslint-plugin-prefer-arrow plugin) does not support allowing named functions defined with the function keyword.
|
|
8
|
+
* eqeqeq:
|
|
9
|
+
- Option "smart" allows for comparing two literal values, evaluating the value of typeof and null comparisons.
|
|
10
|
+
* no-underscore-dangle:
|
|
11
|
+
- Leading and trailing underscores (_) on identifiers will now be ignored.
|
|
12
|
+
|
package/.circleci/config.yml
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Use the latest 2.1 version of CircleCI pipeline process engine.
|
|
2
|
-
# See: https://circleci.com/docs/2.0/configuration-reference
|
|
3
|
-
version: 2.1
|
|
4
|
-
|
|
5
|
-
orbs:
|
|
6
|
-
# The Node.js orb contains a set of prepackaged CircleCI configuration you can utilize
|
|
7
|
-
# Orbs reduce the amount of configuration required for common tasks.
|
|
8
|
-
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/node
|
|
9
|
-
node: circleci/node@4.7
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
# Below is the definition of your job to build and test your app, you can rename and customize it as you want.
|
|
13
|
-
build-and-test:
|
|
14
|
-
# These next lines define a Docker executor: https://circleci.com/docs/2.0/executor-types/
|
|
15
|
-
# You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
|
|
16
|
-
# A list of available CircleCI Docker Convenience Images are available here: https://circleci.com/developer/images/image/cimg/node
|
|
17
|
-
docker:
|
|
18
|
-
- image: cimg/node:16.10
|
|
19
|
-
# Then run your tests!
|
|
20
|
-
# CircleCI will report the results back to your VCS provider.
|
|
21
|
-
steps:
|
|
22
|
-
# Checkout the code as the first step.
|
|
23
|
-
- checkout
|
|
24
|
-
# Next, the node orb's install-packages step will install the dependencies from a package.json.
|
|
25
|
-
# The orb install-packages step will also automatically cache them for faster future runs.
|
|
26
|
-
- restore_cache:
|
|
27
|
-
keys:
|
|
28
|
-
- expressive-tea-{{ checksum "package.json" }}
|
|
29
|
-
- expressive-tea-
|
|
30
|
-
|
|
31
|
-
- node/install-packages:
|
|
32
|
-
# If you are using yarn, change the line below from "npm" to "yarn"
|
|
33
|
-
pkg-manager: yarn
|
|
34
|
-
- save_cache:
|
|
35
|
-
paths:
|
|
36
|
-
- node_modules
|
|
37
|
-
key: expressive-tea-{{ checksum "package.json" }}
|
|
38
|
-
- run:
|
|
39
|
-
name: Expressive Tea Tests
|
|
40
|
-
command: npm test
|
|
41
|
-
environment:
|
|
42
|
-
JEST_JUNIT_OUTPUT_DIR: "./coverage"
|
|
43
|
-
JUNIT_REPORT_NAME: "junit.xml"
|
|
44
|
-
- store_test_results:
|
|
45
|
-
path: ./coverage
|
|
46
|
-
- store_artifacts:
|
|
47
|
-
path: ./coverage
|
|
48
|
-
|
|
49
|
-
workflows:
|
|
50
|
-
# Below is the definition of your workflow.
|
|
51
|
-
# Inside the workflow, you provide the jobs you want to run, e.g this workflow runs the build-and-test job above.
|
|
52
|
-
# CircleCI will run this workflow on every commit.
|
|
53
|
-
# For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows
|
|
54
|
-
Testing:
|
|
55
|
-
jobs:
|
|
56
|
-
- build-and-test
|
|
57
|
-
# For running simple node tests, you could optionally use the node/test job from the orb to replicate and replace the job above in fewer lines.
|
|
58
|
-
# - node/test
|