@bool-ts/core 1.9.0 → 1.9.1

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,5 +1,5 @@
1
1
  import type { ServerWebSocket } from "bun";
2
- import type { TWebSocketUpgradeData } from "./decorators/webSocket";
2
+ import type { TWebSocketUpgradeData } from "../dist/decorators/webSocket";
3
3
 
4
4
  import {
5
5
  WebSocket,
@@ -42,6 +42,7 @@ export type TArgumentsMetadata = {
42
42
  index: number;
43
43
  type: typeof routeModelArgsKey;
44
44
  };
45
+ export type TArgumentsMetadataCollection = Record<`argumentIndexes.${number}`, TArgumentsMetadata>;
45
46
  export declare const RequestHeaders: (schema?: Zod.Schema) => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => void;
46
47
  export declare const RequestHeader: (key: string, schema?: Zod.Schema) => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => void;
47
48
  export declare const RequestBody: (schema?: Zod.Schema, parser?: "arrayBuffer" | "blob" | "formData" | "json" | "text") => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => void;
@@ -0,0 +1,29 @@
1
+ import type { IModule } from "../interfaces";
2
+ type TInstances = Array<new (...args: any[]) => any>;
3
+ type TLoaders<TConfig extends {} = {}> = Record<string | symbol, (args: {
4
+ config: TConfig;
5
+ }) => [string | symbol, any] | Promise<[string | symbol, any]>>;
6
+ export type TContainerOptions<TConfig extends {} = {}> = (Required<{
7
+ modules: TInstances;
8
+ }> & Partial<{
9
+ config: TConfig | (() => TConfig | Promise<TConfig>);
10
+ dependencies: TInstances;
11
+ loaders: TLoaders<TConfig>;
12
+ middlewares: TInstances;
13
+ guards: TInstances;
14
+ dispatchers: TInstances;
15
+ }>) | undefined;
16
+ export type TContainerMetadata<TConfig extends {} = {}> = (Required<{
17
+ modules: TInstances;
18
+ }> & Partial<{
19
+ config: TConfig | ((...args: any[]) => TConfig | Promise<TConfig>);
20
+ dependencies: TInstances;
21
+ loaders: TLoaders<TConfig>;
22
+ middlewares: TInstances;
23
+ guards: TInstances;
24
+ dispatchers: TInstances;
25
+ }>) | undefined;
26
+ export declare const Container: <TConfig extends {} = {}>(args?: TContainerOptions<TConfig>) => <T extends {
27
+ new (...args: any[]): IModule;
28
+ }>(target: T) => void;
29
+ export default Container;
@@ -1,8 +1,10 @@
1
+ import type { TArgumentsMetadataCollection } from "./arguments";
1
2
  export type TRoute = {
2
3
  path: string;
3
4
  httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS";
4
5
  methodName: string;
5
6
  descriptor: TypedPropertyDescriptor<any>;
7
+ argumentsMetadata: TArgumentsMetadataCollection;
6
8
  };
7
9
  export type THttpMetadata = Array<TRoute>;
8
10
  /**
@@ -1,10 +1,12 @@
1
1
  import type { IWebSocket } from "../interfaces";
2
+ import type { TArgumentsMetadataCollection } from "./arguments";
2
3
  import type { TWebSocketEventMetadata } from "./webSocketEvent";
3
4
  export type TWebSocketHttpRouteMetadata = {
4
5
  path: string;
5
6
  httpMethod: "GET" | "POST";
6
7
  methodName: symbol;
7
8
  descriptor: PropertyDescriptor;
9
+ argumentsMetadata: TArgumentsMetadataCollection;
8
10
  };
9
11
  export type TWebSocketUpgradeData = {
10
12
  pathname: string;
@@ -1,8 +1,10 @@
1
+ import type { TArgumentsMetadataCollection } from "../decorators/arguments";
1
2
  import type { THttpMethods } from "../http";
2
3
  export type THttpRouteModel<T = unknown> = Readonly<{
3
4
  class: new (...args: Array<any>) => T;
4
5
  funcName: string | symbol;
5
6
  func: (...args: Array<any>) => unknown;
7
+ argumentsMetadata: TArgumentsMetadataCollection;
6
8
  }>;
7
9
  export declare class HttpRoute {
8
10
  static rootPattern: string;
@@ -51,6 +53,7 @@ export declare class HttpRoute {
51
53
  class: new (...args: Array<any>) => unknown;
52
54
  funcName: string | symbol;
53
55
  func: (...args: Array<any>) => unknown;
56
+ argumentsMetadata: TArgumentsMetadataCollection;
54
57
  }>>;
55
58
  /**
56
59
  *
@@ -61,6 +64,7 @@ export declare class HttpRoute {
61
64
  class: new (...args: Array<any>) => unknown;
62
65
  funcName: string | symbol;
63
66
  func: (...args: Array<any>) => unknown;
67
+ argumentsMetadata: TArgumentsMetadataCollection;
64
68
  }>>;
65
69
  /**
66
70
  *
@@ -71,6 +75,7 @@ export declare class HttpRoute {
71
75
  class: new (...args: Array<any>) => unknown;
72
76
  funcName: string | symbol;
73
77
  func: (...args: Array<any>) => unknown;
78
+ argumentsMetadata: TArgumentsMetadataCollection;
74
79
  }>>;
75
80
  /**
76
81
  *
@@ -81,6 +86,7 @@ export declare class HttpRoute {
81
86
  class: new (...args: Array<any>) => unknown;
82
87
  funcName: string | symbol;
83
88
  func: (...args: Array<any>) => unknown;
89
+ argumentsMetadata: TArgumentsMetadataCollection;
84
90
  }>>;
85
91
  /**
86
92
  *
@@ -1,9 +1,11 @@
1
+ import type { TArgumentsMetadataCollection } from "../decorators/arguments";
1
2
  import "reflect-metadata";
2
3
  import Qs from "qs";
3
4
  export type TGroupElementModel<TFuncName extends keyof TClass, TClass extends Object = Object, TFunc = TClass[TFuncName]> = Readonly<{
4
5
  class: TClass;
5
6
  func: TFunc;
6
7
  funcName: TFuncName;
8
+ argumentsMetadata: TArgumentsMetadataCollection;
7
9
  }>;
8
10
  export type TBoolFactoryOptions = Required<{
9
11
  port: number;