@zerooneit/expressive-tea 1.3.0-beta.6 → 2.0.0
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/.swcrc +61 -0
- package/README.md +564 -174
- package/classes/Boot.d.ts +89 -2
- package/classes/Boot.js +149 -31
- package/classes/Engine.d.ts +58 -10
- package/classes/Engine.js +69 -9
- package/classes/EngineRegistry.d.ts +154 -0
- package/classes/EngineRegistry.js +247 -0
- package/classes/LoadBalancer.js +2 -5
- package/classes/ProxyRoute.js +5 -5
- package/classes/Settings.d.ts +31 -2
- package/classes/Settings.js +64 -11
- package/decorators/annotations.d.ts +1 -1
- package/decorators/annotations.js +17 -17
- package/decorators/env.d.ts +145 -0
- package/decorators/env.js +177 -0
- package/decorators/health.d.ts +115 -0
- package/decorators/health.js +124 -0
- package/decorators/module.d.ts +15 -16
- package/decorators/module.js +14 -24
- package/decorators/proxy.d.ts +26 -11
- package/decorators/proxy.js +35 -49
- package/decorators/router.d.ts +17 -16
- package/decorators/router.js +31 -53
- package/decorators/server.d.ts +7 -7
- package/decorators/server.js +48 -50
- package/engines/health/index.d.ts +120 -0
- package/engines/health/index.js +179 -0
- package/engines/http/index.d.ts +6 -10
- package/engines/http/index.js +18 -17
- package/engines/index.d.ts +32 -0
- package/engines/index.js +112 -0
- package/engines/socketio/index.d.ts +2 -4
- package/engines/socketio/index.js +14 -7
- package/engines/teacup/index.d.ts +12 -2
- package/engines/teacup/index.js +56 -10
- package/engines/teapot/index.d.ts +12 -2
- package/engines/teapot/index.js +58 -17
- package/engines/websocket/index.d.ts +1 -1
- package/engines/websocket/index.js +8 -3
- package/eslint.config.mjs +138 -0
- package/exceptions/RequestExceptions.d.ts +3 -3
- package/helpers/boot-helper.d.ts +4 -4
- package/helpers/boot-helper.js +27 -22
- package/helpers/decorators.js +7 -6
- package/helpers/promise-helper.d.ts +1 -1
- package/helpers/promise-helper.js +1 -2
- package/helpers/server.d.ts +31 -5
- package/helpers/server.js +98 -60
- package/helpers/teapot-helper.d.ts +2 -3
- package/helpers/teapot-helper.js +34 -8
- package/helpers/websocket-helper.d.ts +1 -3
- package/helpers/websocket-helper.js +3 -3
- package/interfaces/index.d.ts +1 -1
- package/inversify.config.d.ts +4 -4
- package/inversify.config.js +1 -1
- package/libs/utilities.d.ts +21910 -0
- package/libs/utilities.js +420 -0
- package/mixins/module.d.ts +45 -0
- package/mixins/module.js +71 -0
- package/mixins/proxy.d.ts +46 -0
- package/mixins/proxy.js +86 -0
- package/mixins/route.d.ts +48 -0
- package/mixins/route.js +96 -0
- package/package.json +85 -73
- package/services/DependencyInjection.d.ts +94 -8
- package/services/DependencyInjection.js +121 -3
- package/services/WebsocketService.d.ts +2 -4
- package/services/WebsocketService.js +5 -3
- package/types/core.d.ts +14 -0
- package/types/core.js +2 -0
- package/types/injection-types.d.ts +6 -0
- package/types/injection-types.js +10 -0
- package/types/inversify.d.ts +5 -0
- package/types/inversify.js +3 -0
- package/.eslintrc.js +0 -44
- package/tsconfig.linter.json +0 -24
- package/tslint-to-eslint-config.log +0 -12
package/helpers/server.d.ts
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
import { type NextFunction, type Request, type Response } from 'express';
|
|
2
|
-
import { type ExpressiveTeaAnnotations, type ExpressiveTeaArgumentOptions } from '@expressive-tea/commons
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { type ExpressiveTeaAnnotations, type ExpressiveTeaArgumentOptions } from '@expressive-tea/commons';
|
|
3
|
+
import { type ExpressiveTeaHandlerOptionsWithInstrospectedArgs } from '../interfaces';
|
|
4
|
+
import { TFunction } from '../types/core';
|
|
5
|
+
import { type ExpressiveTeaServerProps } from '@expressive-tea/commons';
|
|
6
|
+
interface ExecuteRequestContext {
|
|
7
|
+
options: ExpressiveTeaHandlerOptionsWithInstrospectedArgs;
|
|
8
|
+
decoratedArguments: ExpressiveTeaArgumentOptions[];
|
|
9
|
+
annotations: ExpressiveTeaAnnotations[];
|
|
10
|
+
self: any;
|
|
11
|
+
}
|
|
12
|
+
export interface FileSettingsResult {
|
|
13
|
+
config: ExpressiveTeaServerProps;
|
|
14
|
+
source: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function autoResponse(_: any, response: Response, annotations: ExpressiveTeaAnnotations[], responseResult?: any): void;
|
|
17
|
+
export declare function executeRequest(this: ExecuteRequestContext, request: Request, response: Response, next: NextFunction): Promise<void>;
|
|
5
18
|
export declare function mapArguments(decoratedArguments: ExpressiveTeaArgumentOptions[], request: Request, response: Response, next: NextFunction, introspectedArgs?: string[]): any[];
|
|
6
19
|
export declare function extractParameters(target: unknown, args?: string | string[], propertyName?: string): any;
|
|
7
20
|
export declare function generateRoute(route: string, verb: string, ...settings: any): (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
8
|
-
export declare function router(verb: string, route: string, target: any, handler:
|
|
9
|
-
|
|
21
|
+
export declare function router(verb: string, route: string, target: any, handler: TFunction, propertyKey: string | symbol, settings?: any): void;
|
|
22
|
+
/**
|
|
23
|
+
* Load configuration from .expressive-tea files.
|
|
24
|
+
*
|
|
25
|
+
* Supports YAML (.yaml, .yml) and JSON formats with priority order:
|
|
26
|
+
* 1. .expressive-tea.yaml (highest)
|
|
27
|
+
* 2. .expressive-tea.yml
|
|
28
|
+
* 3. .expressive-tea (JSON, lowest)
|
|
29
|
+
*
|
|
30
|
+
* @returns Configuration object and source file path
|
|
31
|
+
* @throws {Error} If config file is invalid (JSON/YAML parse error)
|
|
32
|
+
* @since 2.0.1
|
|
33
|
+
*/
|
|
34
|
+
export declare function fileSettings(): FileSettingsResult;
|
|
35
|
+
export {};
|
package/helpers/server.js
CHANGED
|
@@ -1,103 +1,141 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
exports.autoResponse = autoResponse;
|
|
4
|
+
exports.executeRequest = executeRequest;
|
|
5
|
+
exports.mapArguments = mapArguments;
|
|
6
|
+
exports.extractParameters = extractParameters;
|
|
7
|
+
exports.generateRoute = generateRoute;
|
|
8
|
+
exports.router = router;
|
|
9
|
+
exports.fileSettings = fileSettings;
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return */
|
|
11
|
+
const utilities_1 = require("../libs/utilities");
|
|
12
|
+
const commons_1 = require("@expressive-tea/commons");
|
|
13
|
+
const commons_2 = require("@expressive-tea/commons");
|
|
14
|
+
const commons_3 = require("@expressive-tea/commons");
|
|
15
|
+
const fs = require("node:fs");
|
|
16
|
+
const yaml = require("js-yaml");
|
|
17
|
+
const path = require("node:path");
|
|
18
|
+
function autoResponse(_, response, annotations, responseResult) {
|
|
19
|
+
const view = (0, utilities_1.find)(annotations, { type: 'view' });
|
|
20
|
+
if (view && view.arguments) {
|
|
13
21
|
response.render(view.arguments[0], responseResult);
|
|
14
22
|
return;
|
|
15
23
|
}
|
|
16
|
-
response.send((0,
|
|
24
|
+
response.send((0, utilities_1.isNumber)(responseResult) ? responseResult.toString() : responseResult);
|
|
17
25
|
}
|
|
18
|
-
exports.autoResponse = autoResponse;
|
|
19
26
|
async function executeRequest(request, response, next) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
next(error);
|
|
27
|
+
let isNextUsed = false;
|
|
28
|
+
const nextWrapper = (error) => {
|
|
29
|
+
if (error) {
|
|
24
30
|
isNextUsed = true;
|
|
25
|
-
|
|
26
|
-
const result = await this.options.handler.apply(this.self, mapArguments(this.decoratedArguments, request, response, nextWrapper(), this.options.introspectedArgs));
|
|
27
|
-
if (!response.headersSent && !isNextUsed) {
|
|
28
|
-
autoResponse(request, response, this.annotations, result);
|
|
31
|
+
return next(error);
|
|
29
32
|
}
|
|
33
|
+
isNextUsed = true;
|
|
34
|
+
next();
|
|
35
|
+
};
|
|
36
|
+
const result = await this.options.handler.apply(this.self, mapArguments(this.decoratedArguments, request, response, nextWrapper, this.options.introspectedArgs));
|
|
37
|
+
if (!response.headersSent && !isNextUsed) {
|
|
38
|
+
autoResponse(request, response, this.annotations, result);
|
|
30
39
|
}
|
|
31
|
-
|
|
32
|
-
if (e instanceof RequestExceptions_1.GenericRequestException) {
|
|
33
|
-
next(e);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
next(new RequestExceptions_1.GenericRequestException(e.message || 'System Error'));
|
|
37
|
-
}
|
|
40
|
+
// Express 5 handles async rejections automatically
|
|
38
41
|
}
|
|
39
|
-
exports.executeRequest = executeRequest;
|
|
40
42
|
function mapArguments(decoratedArguments, request, response, next, introspectedArgs = []) {
|
|
41
|
-
return (0,
|
|
43
|
+
return (0, utilities_1.chain)(decoratedArguments)
|
|
42
44
|
.sortBy('index')
|
|
43
45
|
.map((argument) => {
|
|
44
46
|
switch (argument.type) {
|
|
45
|
-
case
|
|
47
|
+
case commons_2.ARGUMENT_TYPES.REQUEST:
|
|
46
48
|
return request;
|
|
47
|
-
case
|
|
49
|
+
case commons_2.ARGUMENT_TYPES.RESPONSE:
|
|
48
50
|
return response;
|
|
49
|
-
case
|
|
51
|
+
case commons_2.ARGUMENT_TYPES.NEXT:
|
|
50
52
|
return next;
|
|
51
|
-
case
|
|
52
|
-
return extractParameters(request.query, argument.arguments, (0,
|
|
53
|
-
case
|
|
54
|
-
return extractParameters(request.body, argument.arguments, (0,
|
|
55
|
-
case
|
|
56
|
-
return extractParameters(request.params, argument.arguments, (0,
|
|
53
|
+
case commons_2.ARGUMENT_TYPES.QUERY:
|
|
54
|
+
return extractParameters(request.query, argument.arguments, (0, utilities_1.get)(introspectedArgs, argument.index));
|
|
55
|
+
case commons_2.ARGUMENT_TYPES.BODY:
|
|
56
|
+
return extractParameters(request.body, argument.arguments, (0, utilities_1.get)(introspectedArgs, argument.index));
|
|
57
|
+
case commons_2.ARGUMENT_TYPES.GET_PARAM:
|
|
58
|
+
return extractParameters(request.params, argument.arguments, (0, utilities_1.get)(introspectedArgs, argument.index));
|
|
57
59
|
default:
|
|
58
60
|
return undefined;
|
|
59
61
|
}
|
|
60
62
|
})
|
|
61
|
-
.thru((args) => (0,
|
|
63
|
+
.thru((args) => (0, utilities_1.size)(args) ? args : [request, response, next])
|
|
62
64
|
.value();
|
|
63
65
|
}
|
|
64
|
-
exports.mapArguments = mapArguments;
|
|
65
66
|
function extractParameters(target, args, propertyName) {
|
|
66
67
|
if (!args && !target) {
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
|
-
if ((0,
|
|
70
|
+
if (args && (0, utilities_1.size)(args)) {
|
|
70
71
|
if (Array.isArray(args)) {
|
|
71
|
-
return (0,
|
|
72
|
+
return (0, utilities_1.pick)(target, args);
|
|
72
73
|
}
|
|
73
|
-
return (0,
|
|
74
|
+
return (0, utilities_1.get)(target, args);
|
|
74
75
|
}
|
|
75
|
-
if ((0,
|
|
76
|
-
return (0,
|
|
76
|
+
if (propertyName && (0, utilities_1.has)(target, propertyName)) {
|
|
77
|
+
return (0, utilities_1.get)(target, propertyName);
|
|
77
78
|
}
|
|
78
79
|
return target;
|
|
79
80
|
}
|
|
80
|
-
exports.extractParameters = extractParameters;
|
|
81
81
|
function generateRoute(route, verb, ...settings) {
|
|
82
|
-
return (target, propertyKey, descriptor) => {
|
|
82
|
+
return (target, propertyKey, descriptor) => {
|
|
83
|
+
router(verb, route, target, descriptor.value, propertyKey, settings);
|
|
84
|
+
};
|
|
83
85
|
}
|
|
84
|
-
exports.generateRoute = generateRoute;
|
|
85
86
|
function router(verb, route, target, handler, propertyKey, settings) {
|
|
86
|
-
const introspectedArgs = (0,
|
|
87
|
-
const existedRoutesHandlers =
|
|
87
|
+
const introspectedArgs = (0, commons_3.getOwnArgumentNames)(handler);
|
|
88
|
+
const existedRoutesHandlers = commons_1.Metadata.get(commons_2.ROUTER_HANDLERS_KEY, target) || [];
|
|
88
89
|
existedRoutesHandlers.unshift({ verb, route, handler, target, propertyKey, settings, introspectedArgs });
|
|
89
|
-
|
|
90
|
+
commons_1.Metadata.set(commons_2.ROUTER_HANDLERS_KEY, existedRoutesHandlers, target);
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Load configuration from .expressive-tea files.
|
|
94
|
+
*
|
|
95
|
+
* Supports YAML (.yaml, .yml) and JSON formats with priority order:
|
|
96
|
+
* 1. .expressive-tea.yaml (highest)
|
|
97
|
+
* 2. .expressive-tea.yml
|
|
98
|
+
* 3. .expressive-tea (JSON, lowest)
|
|
99
|
+
*
|
|
100
|
+
* @returns Configuration object and source file path
|
|
101
|
+
* @throws {Error} If config file is invalid (JSON/YAML parse error)
|
|
102
|
+
* @since 2.0.1
|
|
103
|
+
*/
|
|
92
104
|
function fileSettings() {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
const cwd = process.cwd();
|
|
106
|
+
// Priority order: YAML > YML > JSON
|
|
107
|
+
const configFiles = [
|
|
108
|
+
{ path: '.expressive-tea.yaml', type: 'yaml' },
|
|
109
|
+
{ path: '.expressive-tea.yml', type: 'yaml' },
|
|
110
|
+
{ path: '.expressive-tea', type: 'json' }
|
|
111
|
+
];
|
|
112
|
+
for (const file of configFiles) {
|
|
113
|
+
const filePath = path.join(cwd, file.path);
|
|
114
|
+
if (fs.existsSync(filePath)) {
|
|
115
|
+
try {
|
|
116
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
117
|
+
let config;
|
|
118
|
+
if (file.type === 'yaml') {
|
|
119
|
+
const parsed = yaml.load(content);
|
|
120
|
+
// yaml.load returns undefined for empty strings and null for whitespace/comments
|
|
121
|
+
// Treat empty YAML files as empty configuration objects
|
|
122
|
+
config = (parsed !== null && parsed !== void 0 ? parsed : {});
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
config = JSON.parse(content);
|
|
126
|
+
}
|
|
127
|
+
// Debug log which file was loaded
|
|
128
|
+
console.debug(`[Expressive Tea] Loaded configuration from: ${file.path}`);
|
|
129
|
+
return { config, source: file.path };
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
const errorMsg = file.type === 'yaml'
|
|
133
|
+
? `Invalid YAML in ${file.path}: ${error.message}`
|
|
134
|
+
: `Invalid JSON in ${file.path}: ${error.message}`;
|
|
135
|
+
throw new Error(errorMsg);
|
|
136
|
+
}
|
|
97
137
|
}
|
|
98
138
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
139
|
+
// No config file found
|
|
140
|
+
return { config: {}, source: null };
|
|
102
141
|
}
|
|
103
|
-
exports.fileSettings = fileSettings;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { type KeyPairSyncResult } from 'crypto';
|
|
1
|
+
import { type KeyPairSyncResult } from 'node:crypto';
|
|
4
2
|
import { type NextFunction, type Request, type Response } from 'express';
|
|
5
3
|
import type ProxyRoute from '../classes/ProxyRoute';
|
|
6
4
|
export interface EncryptedMessage {
|
|
7
5
|
iv: string;
|
|
8
6
|
message: string;
|
|
7
|
+
authTag: string;
|
|
9
8
|
}
|
|
10
9
|
export type TeaGatewayMessage = Record<string, any>;
|
|
11
10
|
export default class TeaGatewayHelper {
|
package/helpers/teapot-helper.js
CHANGED
|
@@ -1,21 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const crypto = require("crypto");
|
|
4
|
-
|
|
3
|
+
const crypto = require("node:crypto");
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return */
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
6
|
class TeaGatewayHelper {
|
|
6
7
|
static encrypt(data, signature) {
|
|
7
8
|
const iv = crypto.randomBytes(16);
|
|
8
9
|
const packet = JSON.stringify(data);
|
|
9
|
-
|
|
10
|
+
// HKDF key derivation - separate encryption key from signature
|
|
11
|
+
const derivedKey = Buffer.from(crypto.hkdfSync('sha256', signature, Buffer.alloc(32), 'expressive-tea-encryption', 32));
|
|
12
|
+
// AES-256-GCM - authenticated encryption
|
|
13
|
+
const cipher = crypto.createCipheriv('aes-256-gcm', derivedKey, iv);
|
|
10
14
|
const encrypted = Buffer.concat([cipher.update(packet), cipher.final()]);
|
|
11
|
-
|
|
15
|
+
const authTag = cipher.getAuthTag();
|
|
16
|
+
return {
|
|
17
|
+
iv: iv.toString('hex'),
|
|
18
|
+
message: encrypted.toString('base64'),
|
|
19
|
+
authTag: authTag.toString('hex')
|
|
20
|
+
};
|
|
12
21
|
}
|
|
13
22
|
static decrypt(data, signature) {
|
|
23
|
+
// Input validation
|
|
24
|
+
if (!data || !data.iv || !data.message || !data.authTag) {
|
|
25
|
+
throw new Error('Invalid encrypted message format');
|
|
26
|
+
}
|
|
27
|
+
if (!signature || signature.length !== 64) {
|
|
28
|
+
throw new Error('Invalid signature');
|
|
29
|
+
}
|
|
14
30
|
const iv = Buffer.from(data.iv, 'hex');
|
|
15
31
|
const message = Buffer.from(data.message, 'base64');
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
32
|
+
const authTag = Buffer.from(data.authTag, 'hex');
|
|
33
|
+
// HKDF key derivation - same as encrypt
|
|
34
|
+
const derivedKey = Buffer.from(crypto.hkdfSync('sha256', signature, Buffer.alloc(32), 'expressive-tea-encryption', 32));
|
|
35
|
+
// AES-256-GCM with auth tag verification
|
|
36
|
+
const decipher = crypto.createDecipheriv('aes-256-gcm', derivedKey, iv);
|
|
37
|
+
decipher.setAuthTag(authTag);
|
|
38
|
+
try {
|
|
39
|
+
const decrypted = Buffer.concat([decipher.update(message), decipher.final()]);
|
|
40
|
+
return JSON.parse(decrypted.toString());
|
|
41
|
+
}
|
|
42
|
+
catch (_a) {
|
|
43
|
+
throw new Error('Decryption failed: message tampered or wrong key');
|
|
44
|
+
}
|
|
19
45
|
}
|
|
20
46
|
static sign(data, privateKey, passphrase) {
|
|
21
47
|
return crypto.sign(null, Buffer.from(data), {
|
|
@@ -29,7 +55,7 @@ class TeaGatewayHelper {
|
|
|
29
55
|
}, signature);
|
|
30
56
|
}
|
|
31
57
|
static generateKeys(passphrase) {
|
|
32
|
-
return (0,
|
|
58
|
+
return (0, node_crypto_1.generateKeyPairSync)('ed25519', {
|
|
33
59
|
modulusLength: 2048,
|
|
34
60
|
publicKeyEncoding: {
|
|
35
61
|
type: 'spki',
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import type * as http from 'http';
|
|
4
2
|
import type * as https from 'https';
|
|
5
|
-
export declare function initWebsocket(server: http.Server, secureServer: https.Server):
|
|
3
|
+
export declare function initWebsocket(server: http.Server, secureServer: https.Server): void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initWebsocket =
|
|
3
|
+
exports.initWebsocket = initWebsocket;
|
|
4
4
|
const WebsocketService_1 = require("../services/WebsocketService");
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
5
6
|
const WebSocket = require("ws");
|
|
6
7
|
const Settings_1 = require("../classes/Settings");
|
|
7
|
-
|
|
8
|
+
function initWebsocket(server, secureServer) {
|
|
8
9
|
const settings = Settings_1.default.getInstance();
|
|
9
10
|
const isDetached = settings.get('detachWebsocket');
|
|
10
11
|
if (settings.get('startWebsocket')) {
|
|
@@ -17,4 +18,3 @@ async function initWebsocket(server, secureServer) {
|
|
|
17
18
|
WebsocketService_1.default.getInstance().setHttpServer(secureServer);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
exports.initWebsocket = initWebsocket;
|
package/interfaces/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ExpressiveTeaHandlerOptions } from '@expressive-tea/commons
|
|
1
|
+
import { type ExpressiveTeaHandlerOptions } from '@expressive-tea/commons';
|
|
2
2
|
export interface ExpressiveTeaHandlerOptionsWithInstrospectedArgs extends ExpressiveTeaHandlerOptions {
|
|
3
3
|
introspectedArgs: string[];
|
|
4
4
|
}
|
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 |
|
|
5
|
-
lazyInjectNamed: (serviceIdentifier: string | symbol |
|
|
6
|
-
lazyInjectTagged: (serviceIdentifier: string | symbol |
|
|
7
|
-
lazyMultiInject: (serviceIdentifier: string | symbol |
|
|
4
|
+
lazyInject: (serviceIdentifier: string | symbol | interfaces.Newable<any> | interfaces.Abstract<any>) => (proto: any, key: string) => void;
|
|
5
|
+
lazyInjectNamed: (serviceIdentifier: string | symbol | interfaces.Newable<any> | interfaces.Abstract<any>, named: string) => (proto: any, key: string) => void;
|
|
6
|
+
lazyInjectTagged: (serviceIdentifier: string | symbol | interfaces.Newable<any> | interfaces.Abstract<any>, key: string, value: any) => (proto: any, propertyName: string) => void;
|
|
7
|
+
lazyMultiInject: (serviceIdentifier: string | symbol | interfaces.Newable<any> | interfaces.Abstract<any>) => (proto: any, key: string) => void;
|
|
8
8
|
};
|
|
9
9
|
export default container;
|
package/inversify.config.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.decorators = void 0;
|
|
4
4
|
const inversify_1 = require("inversify");
|
|
5
5
|
const inversify_inject_decorators_1 = require("inversify-inject-decorators");
|
|
6
|
-
const container = new inversify_1.Container({
|
|
6
|
+
const container = new inversify_1.Container({ autobind: true });
|
|
7
7
|
exports.decorators = (0, inversify_inject_decorators_1.default)(container);
|
|
8
8
|
exports.default = container;
|