@koala-ts/framework 2.3.0 → 2.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationFactory.d.ts","sourceRoot":"","sources":["../../src/Application/ApplicationFactory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAK5C,wBAAgB,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAcvD"}
1
+ {"version":3,"file":"ApplicationFactory.d.ts","sourceRoot":"","sources":["../../src/Application/ApplicationFactory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAK5C,wBAAgB,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAiBvD"}
@@ -11,9 +11,11 @@ export function create(config) {
11
11
  if (undefined !== config.globalMiddleware)
12
12
  registerGlobalMiddleware(app, config.globalMiddleware);
13
13
  app.use(serveStaticFiles(config.staticFiles));
14
+ // Register routes
14
15
  const router = createRouter();
15
16
  app.use(router.routes());
16
17
  app.use(router.allowedMethods());
18
+ registerEventSubscribers(app, config.eventSubscribers);
17
19
  return app;
18
20
  }
19
21
  function createRouter() {
@@ -32,4 +34,16 @@ function registerGlobalMiddleware(app, middleware) {
32
34
  app.use(mw);
33
35
  }
34
36
  }
37
+ function registerEventSubscribers(app, map) {
38
+ if (undefined === map)
39
+ return;
40
+ for (const [event, subscribers] of Object.entries(map)) {
41
+ if (Array.isArray(subscribers)) {
42
+ for (const subscriber of subscribers)
43
+ app.on(event, subscriber);
44
+ continue;
45
+ }
46
+ app.on(event, subscribers);
47
+ }
48
+ }
35
49
  //# sourceMappingURL=ApplicationFactory.js.map
@@ -1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KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/B,KAAK,MAAM,UAAU,IAAI,WAAW;gBAAE,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YAChE,SAAS;QACX,CAAC;QAED,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { type EventSubscriber } from '../Event/index.js';
1
2
  import { type HttpMiddleware } from '../Http/index.js';
2
3
  import { type StaticFilesOptions } from '../Http/Files/index.js';
3
4
  export type Controller = new (...args: unknown[]) => unknown;
@@ -5,5 +6,6 @@ export interface KoalaConfig {
5
6
  controllers: Controller[];
6
7
  globalMiddleware?: HttpMiddleware[];
7
8
  staticFiles?: StaticFilesOptions;
9
+ eventSubscribers?: Record<string, EventSubscriber | EventSubscriber[]>;
8
10
  }
9
11
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Config/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,KAAI,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,cAAc,EAAE,CAAC;IACpC,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Config/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,KAAI,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,cAAc,EAAE,CAAC;IACpC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,EAAE,CAAC,CAAC;CACxE"}
@@ -0,0 +1,7 @@
1
+ import { type EventBusStorage, type EventEmitter } from '../Event/types.js';
2
+ import { type HttpRequest, type HttpResponse, type HttpScope, type NextMiddleware, type ScopeStore } from '../Http/index.js';
3
+ export declare function eventBusMiddleware(scope: HttpScope, next: NextMiddleware, storage?: ScopeStore<EventBusStorage>): Promise<void>;
4
+ export declare function useEmit(storage?: ScopeStore<EventBusStorage>): EventEmitter;
5
+ export declare function useRequest(storage?: ScopeStore<EventBusStorage>): HttpRequest;
6
+ export declare function useResponse(storage?: ScopeStore<EventBusStorage>): HttpResponse;
7
+ //# sourceMappingURL=EventBus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventBus.d.ts","sourceRoot":"","sources":["../../src/Event/EventBus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAe,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIhI,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE,UAAU,CAAC,eAAe,CAAmB,GACrD,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,OAAO,CAAC,OAAO,GAAE,UAAU,CAAC,eAAe,CAAmB,GAAG,YAAY,CAE5F;AAED,wBAAgB,UAAU,CAAC,OAAO,GAAE,UAAU,CAAC,eAAe,CAAmB,GAAG,WAAW,CAE9F;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,UAAU,CAAC,eAAe,CAAmB,GAAG,YAAY,CAEhG"}
@@ -0,0 +1,15 @@
1
+ import { createStore } from '../Http/index.js';
2
+ const eventBusStorage = createStore();
3
+ export async function eventBusMiddleware(scope, next, storage = eventBusStorage) {
4
+ await storage.run({ eventEmitter: scope.app, scope }, next);
5
+ }
6
+ export function useEmit(storage = eventBusStorage) {
7
+ return storage.get('eventEmitter');
8
+ }
9
+ export function useRequest(storage = eventBusStorage) {
10
+ return storage.get('scope').request;
11
+ }
12
+ export function useResponse(storage = eventBusStorage) {
13
+ return storage.get('scope').response;
14
+ }
15
+ //# sourceMappingURL=EventBus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventBus.js","sourceRoot":"","sources":["../../src/Event/EventBus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAA6F,MAAM,QAAQ,CAAC;AAEhI,MAAM,eAAe,GAAG,WAAW,EAAmB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAgB,EAChB,IAAoB,EACpB,UAAuC,eAAe;IAEtD,MAAM,OAAO,CAAC,GAAG,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,UAAuC,eAAe;IAC5E,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,UAAuC,eAAe;IAC/E,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,UAAuC,eAAe;IAChF,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;AACvC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EventBus.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventBus.test.d.ts","sourceRoot":"","sources":["../../src/Event/EventBus.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ import { describe, expect, test, vi } from 'vitest';
2
+ import { eventBusMiddleware, useEmit, useRequest, useResponse } from '../Event/EventBus.js';
3
+ describe('Event bus', () => {
4
+ test('middleware should init storage', async () => {
5
+ const scope = { app: vi.fn() };
6
+ const next = vi.fn();
7
+ const storage = { run: vi.fn() };
8
+ await eventBusMiddleware(scope, next, storage);
9
+ expect(storage.run).toHaveBeenCalledWith({ eventEmitter: scope.app, scope }, next);
10
+ });
11
+ test('useEmit should return emitter from storage', () => {
12
+ const storage = { get: vi.fn().mockReturnValue('eventEmitter') };
13
+ const emitter = useEmit(storage);
14
+ expect(storage.get).toHaveBeenCalledWith('eventEmitter');
15
+ expect(emitter).toBe('eventEmitter');
16
+ });
17
+ test('useRequest should return request from storage', () => {
18
+ const request = { headers: { host: 'localhost' } };
19
+ const storage = { get: vi.fn().mockReturnValue({ request }) };
20
+ const req = useRequest(storage);
21
+ expect(storage.get).toHaveBeenCalledWith('scope');
22
+ expect(req).toBe(request);
23
+ });
24
+ test('useResponse should return response from storage', () => {
25
+ const response = { status: 200, body: 'OK' };
26
+ const storage = { get: vi.fn().mockReturnValue({ response }) };
27
+ const res = useResponse(storage);
28
+ expect(storage.get).toHaveBeenCalledWith('scope');
29
+ expect(res).toBe(response);
30
+ });
31
+ });
32
+ //# sourceMappingURL=EventBus.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventBus.test.js","sourceRoot":"","sources":["../../src/Event/EventBus.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM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AAE,EAAE,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;QAE9D,MAAM,GAAG,GAAG,UAAU,CAAC,OAAiD,CAAC,CAAC;QAE1E,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iDAAiD,EAAE,GAAG,EAAE;QAC3D,MAAM,QAAQ,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;QAE/D,MAAM,GAAG,GAAG,WAAW,CAAC,OAAiD,CAAC,CAAC;QAE3E,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './types.js';
2
+ export * from './EventBus.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Event/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './types.js';
2
+ export * from './EventBus.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Event/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type HttpScope } from '../Http/index.js';
2
+ export interface EventEmitter {
3
+ emit(event: string, ...args: unknown[]): void;
4
+ }
5
+ export interface EventBusStorage {
6
+ eventEmitter: EventEmitter;
7
+ scope: HttpScope;
8
+ }
9
+ export type EventSubscriber = (...args: unknown[]) => void;
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Event/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/Event/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@koala-ts/framework",
3
3
  "main": "dist/index.js",
4
4
  "type": "module",
5
- "version": "2.3.0",
5
+ "version": "2.4.0",
6
6
  "description": "A NodeJS framework for lazy developers",
7
7
  "keywords": [
8
8
  "koala",
@@ -53,7 +53,7 @@
53
53
  "@arethetypeswrong/cli": "^0.18.2",
54
54
  "@eslint/js": "^9.38.0",
55
55
  "@stylistic/eslint-plugin": "^5.5.0",
56
- "@vitest/coverage-v8": "^3.2.4",
56
+ "@vitest/coverage-v8": "^4.0.12",
57
57
  "eslint": "^9.38.0",
58
58
  "eslint-plugin-import": "^2.32.0",
59
59
  "eslint-plugin-n": "^17.23.1",
@@ -64,7 +64,7 @@
64
64
  "tsx": "^4.20.6",
65
65
  "typescript": "^5.9.3",
66
66
  "typescript-eslint": "^8.46.2",
67
- "vitest": "^3.2.4"
67
+ "vitest": "^4.0.10"
68
68
  },
69
69
  "publishConfig": {
70
70
  "access": "public",