@ccci/micro-server 1.0.167 → 1.0.168

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.
Files changed (36) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +62763 -68782
  3. package/package.json +1 -1
  4. package/dist/decorators/Endpoints.d.ts +0 -12
  5. package/dist/types/ApplicationOptionType.d.ts +0 -36
  6. package/dist/types/AttachmentMetadataTypes.d.ts +0 -9
  7. package/dist/types/BaseControllerTypes.d.ts +0 -42
  8. package/dist/types/BaseModelTypes.d.ts +0 -33
  9. package/dist/types/BaseRouterTypes.d.ts +0 -9
  10. package/dist/types/BaseSocketType.d.ts +0 -6
  11. package/dist/types/BrokerType.d.ts +0 -13
  12. package/dist/types/NotificationTypes.d.ts +0 -9
  13. package/dist/types/UploadedFileType.d.ts +0 -9
  14. package/dist/utils/ApplicationServer.d.ts +0 -27
  15. package/dist/utils/BaseAuthenticatorModel.d.ts +0 -7
  16. package/dist/utils/BaseConsumer.d.ts +0 -44
  17. package/dist/utils/BaseController.d.ts +0 -96
  18. package/dist/utils/BaseControllerHelper.d.ts +0 -27
  19. package/dist/utils/BaseKafka.d.ts +0 -37
  20. package/dist/utils/BaseModel.d.ts +0 -37
  21. package/dist/utils/BaseProducer.d.ts +0 -42
  22. package/dist/utils/BaseRouter.d.ts +0 -91
  23. package/dist/utils/BaseSocketHandler.d.ts +0 -37
  24. package/dist/utils/DatabaseConnector.d.ts +0 -26
  25. package/dist/utils/ErrorHandler.d.ts +0 -5
  26. package/dist/utils/IBaseModel.d.ts +0 -9
  27. package/dist/utils/Logger.d.ts +0 -7
  28. package/dist/utils/Mailer.d.ts +0 -23
  29. package/dist/utils/Mixins.d.ts +0 -39
  30. package/dist/utils/PushNotifier.d.ts +0 -19
  31. package/dist/utils/RouterFactory.d.ts +0 -12
  32. package/dist/utils/ServeKafka.d.ts +0 -16
  33. package/dist/utils/TokenGenerator.d.ts +0 -11
  34. package/dist/utils/Uploader.d.ts +0 -31
  35. package/dist/utils/WebsocketServer.d.ts +0 -29
  36. package/dist/utils/uploader-s3.d.ts +0 -67
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.167",
3
+ "version": "1.0.168",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,12 +0,0 @@
1
- export declare const endpoint: (target: any, methodName: string, descriptor: PropertyDescriptor) => void;
2
- export declare const PublicAccess: <T extends new (...args: any[]) => {}>(constructor: T) => {
3
- new (...args: any[]): {
4
- grantPublicAccess: boolean;
5
- };
6
- } & T;
7
- export declare const PrivateAccess: <T extends new (...args: any[]) => {}>(constructor: T) => {
8
- new (...args: any[]): {
9
- grantPublicAccess: boolean;
10
- };
11
- } & T;
12
- //# sourceMappingURL=Endpoints.d.ts.map
@@ -1,36 +0,0 @@
1
- export type ApplicationOptionType = {
2
- routeContext?: string;
3
- configDir?: string;
4
- modelDir?: string;
5
- controllerDir?: string;
6
- routeDir?: string;
7
- websocketPort?: number;
8
- websocketDir?: string;
9
- enableRedis?: boolean;
10
- enableMinio?: boolean;
11
- enableKafka?: boolean;
12
- enableS3?: boolean;
13
- enableWebSocket?: boolean;
14
- enableFirebase?: boolean;
15
- enableEmail?: boolean;
16
- clientId?: string;
17
- brokers?: string[];
18
- consumersPath?: string;
19
- producersPath?: string;
20
- minioHost?: string;
21
- minioPort?: number;
22
- minioAccessKey?: string;
23
- minioSecretKey?: string;
24
- minioUseSSL?: boolean;
25
- smtpService?: string;
26
- smtpHost?: string;
27
- smtpUser?: string;
28
- smtpPassword?: string;
29
- enablePushNotifications?: boolean;
30
- s3ForcePathStyle?: boolean;
31
- s3Endpoint?: string;
32
- s3region?: string;
33
- s3AccessKeyId?: string;
34
- s3SecretAccessKey?: string;
35
- };
36
- //# sourceMappingURL=ApplicationOptionType.d.ts.map
@@ -1,9 +0,0 @@
1
- export type AttachmentMetadataType = {
2
- Bucket?: string;
3
- Etag?: string;
4
- Key?: string;
5
- Location?: string;
6
- MimeType?: string;
7
- };
8
- export declare const mimeTypes: Record<string, string>;
9
- //# sourceMappingURL=AttachmentMetadataTypes.d.ts.map
@@ -1,42 +0,0 @@
1
- import { Order, WhereOptions } from "sequelize";
2
- export type RequestQuery = {
3
- search?: string;
4
- limit?: number;
5
- page?: number;
6
- includes?: string;
7
- fields?: string;
8
- paranoid?: string;
9
- sort?: string;
10
- paginate?: string;
11
- date_range?: string;
12
- others?: any;
13
- scan?: string;
14
- groupBy?: string;
15
- };
16
- export type QueryOptions = {
17
- where?: WhereOptions<any>;
18
- limit?: number;
19
- offset?: number;
20
- attributes?: Array<string>;
21
- order?: Order;
22
- paranoid?: boolean;
23
- includes?: Array<string | IncludeType>;
24
- };
25
- export type ResponseType = {
26
- success: boolean;
27
- error?: number;
28
- statusCode?: number;
29
- errorMessage?: string;
30
- errorDescription?: string;
31
- response?: object;
32
- version?: string;
33
- errors?: string[];
34
- };
35
- export type IncludeType = {
36
- association?: string;
37
- include?: Array<IncludeType>;
38
- };
39
- export type CommonType = {
40
- [x: string | symbol]: any;
41
- };
42
- //# sourceMappingURL=BaseControllerTypes.d.ts.map
@@ -1,33 +0,0 @@
1
- export declare enum FindTypeEnum {
2
- FIND_ALL = "findAndCountAll",
3
- FIND_PK = "findByPk",
4
- FIND_ONE = "findOne",
5
- COUNT = "count"
6
- }
7
- export type IncludesType = {
8
- path?: string;
9
- association?: AssociationType;
10
- };
11
- export type AssociationType = {
12
- include: Array<string> | Array<object>;
13
- association?: string;
14
- where?: object;
15
- };
16
- export type QueryType = {
17
- where?: object;
18
- limit?: number;
19
- offset?: number;
20
- select?: object;
21
- order?: object;
22
- attributes?: object;
23
- returning?: boolean;
24
- raw?: boolean;
25
- nest?: boolean;
26
- distinct?: string;
27
- include?: object;
28
- };
29
- export type RequestUserType = {
30
- id?: number;
31
- email?: string;
32
- };
33
- //# sourceMappingURL=BaseModelTypes.d.ts.map
@@ -1,9 +0,0 @@
1
- import { Request, Response, NextFunction } from 'express';
2
- import { ResponseType } from './BaseControllerTypes';
3
- export type Mappings = {
4
- path: string;
5
- method: string;
6
- function: (req: Request, res: Response, next: NextFunction) => Promise<void | ResponseType>;
7
- middleware?: (req: Request, res: Response, next: NextFunction) => Promise<void>;
8
- };
9
- //# sourceMappingURL=BaseRouterTypes.d.ts.map
@@ -1,6 +0,0 @@
1
- export type WebSocketData = {
2
- userId?: number;
3
- channel?: string;
4
- room?: string;
5
- };
6
- //# sourceMappingURL=BaseSocketType.d.ts.map
@@ -1,13 +0,0 @@
1
- export type PublishType = {
2
- topic: string;
3
- headers?: Record<string, string>;
4
- event: string;
5
- message: Record<string, any>;
6
- };
7
- export type MessageType = {
8
- headers?: Record<string, string>;
9
- event: string;
10
- data: any;
11
- };
12
- export type MessageHandler = (message: MessageType) => Promise<void>;
13
- //# sourceMappingURL=BrokerType.d.ts.map
@@ -1,9 +0,0 @@
1
- export type NotificationType = {
2
- title: string;
3
- body: string;
4
- imageUrl?: string;
5
- };
6
- export type NotificationOptions = {
7
- isBroadcast?: Boolean;
8
- };
9
- //# sourceMappingURL=NotificationTypes.d.ts.map
@@ -1,9 +0,0 @@
1
- export type UploadedFileType = {
2
- etag?: string;
3
- path?: string;
4
- bucket?: string;
5
- directory?: string;
6
- objectName?: string;
7
- mimeType?: string;
8
- };
9
- //# sourceMappingURL=UploadedFileType.d.ts.map
@@ -1,27 +0,0 @@
1
- import { Application } from 'express';
2
- import BaseSocketHandler from './BaseSocketHandler';
3
- import { ApplicationOptionType } from '@/types/ApplicationOptionType';
4
- /**
5
- * Application Sever class
6
- */
7
- export default class ApplicationServer {
8
- static app: Application;
9
- static socketHandlers: Array<{
10
- path: string;
11
- handler: BaseSocketHandler;
12
- }>;
13
- /**
14
- * Initializes the application server
15
- * @param {number} port port for the micro service
16
- * @param {ApplicationOptionType} options additional server configuration
17
- * @param {Array<String>} sync models to be sync to the database
18
- *
19
- */
20
- static bootstrap(port: number, options?: ApplicationOptionType, sync?: Array<string> | Boolean): Promise<void>;
21
- static getInstance(): Application;
22
- static getWebsocketHandlers(): Array<{
23
- path: string;
24
- handler: any;
25
- }>;
26
- }
27
- //# sourceMappingURL=ApplicationServer.d.ts.map
@@ -1,7 +0,0 @@
1
- import BaseModel from "./BaseModel";
2
- export default class BaseAuthenticatorModel extends BaseModel {
3
- password?: string;
4
- authenticate(password: string): boolean;
5
- updatePassword(password?: string): string | undefined;
6
- }
7
- //# sourceMappingURL=BaseAuthenticatorModel.d.ts.map
@@ -1,44 +0,0 @@
1
- import { type ConsumerConfig } from "kafkajs";
2
- import { BaseKafka } from "./BaseKafka";
3
- import type { MessageHandler } from "../types/BrokerType";
4
- /**
5
- * BaseConsumer class provides basic functionality for consuming messages from a Kafka topic.
6
- * It manages the connection, subscription, and message handling logic for Kafka consumers.
7
- */
8
- export declare class BaseConsumer {
9
- private consumer;
10
- private kafka;
11
- /**
12
- * Creates an instance of BaseConsumer using a BaseKafka instance.
13
- *
14
- * @param {BaseKafka} baseKafka - The instance of the BaseKafka class which provides access to the Kafka client.
15
- */
16
- constructor(baseKafka: BaseKafka);
17
- /**
18
- * Connects the consumer to the Kafka cluster with the specified group ID and optional consumer configuration.
19
- * If the consumer is already connected, it logs a message and does nothing.
20
- *
21
- * @param {string} groupId - The consumer group ID to join.
22
- * @param {ConsumerConfig} [config] - Optional additional configuration for the consumer.
23
- * @returns {Promise<void>} - A promise that resolves once the consumer is connected.
24
- */
25
- connect(groupId: string, config?: ConsumerConfig): Promise<void>;
26
- /**
27
- * Disconnects the consumer from the Kafka cluster.
28
- * If the consumer is already disconnected, it logs a message and does nothing.
29
- *
30
- * @returns {Promise<void>} - A promise that resolves once the consumer is disconnected.
31
- */
32
- disconnect(): Promise<void>;
33
- /**
34
- * Subscribes the consumer to a Kafka topic and starts processing messages from the topic.
35
- * The consumer runs the provided message handler for each received message.
36
- *
37
- * @param {string} topic - The Kafka topic to subscribe to.
38
- * @param {MessageHandler} messageHandler - A function to handle the processed messages.
39
- * @returns {Promise<void>} - A promise that resolves once the consumer has successfully subscribed and started processing messages.
40
- * @throws {Error} - Throws an error if the consumer is not connected before subscribing.
41
- */
42
- subscribe(topic: string, messageHandler: MessageHandler): Promise<void>;
43
- }
44
- //# sourceMappingURL=BaseConsumer.d.ts.map
@@ -1,96 +0,0 @@
1
- import { Request, Response, NextFunction } from 'express';
2
- import { ResponseType } from '../types/BaseControllerTypes';
3
- export default class BaseController {
4
- protected _model: import("sequelize").ModelCtor<import("sequelize").Model<any, any>> | undefined;
5
- _modelName: string | undefined;
6
- protected broadcastOnCreate: boolean;
7
- protected broadcastOnUpdate: boolean;
8
- protected broadcastOnDelete: boolean;
9
- constructor(model?: string);
10
- /**
11
- * Find all the rows matching your query, within a specified offset / limit,
12
- * and get the total number of rows matching your query.
13
- * ```js
14
- * Controller.find(req, res, next)
15
- * ```
16
- * @param req
17
- * @param res
18
- * @param next
19
- */
20
- find(req: Request, res: Response, next?: NextFunction): Promise<ResponseType>;
21
- /**
22
- * Search for a single instance by its primary key.
23
- * This applies LIMIT 1, so the listener will always be called with a single instance.
24
- * @param req
25
- * @param res
26
- * @param next
27
- */
28
- findById(req: Request, res: Response, next?: NextFunction): Promise<ResponseType>;
29
- /**
30
- *
31
- * @param req
32
- * @param res
33
- * @param next
34
- */
35
- create(req: Request, res: Response, next?: NextFunction): Promise<ResponseType>;
36
- /**
37
- * Update multiple instances that match the where options. The promise returns an array with one or two elements. The first element is always the number of affected rows, while the second element is the actual affected rows (only supported in postgres and mssql with options.returning true.)
38
- * @param req
39
- * @param res
40
- * @param next
41
- */
42
- update(req: Request, res: Response, next?: NextFunction): Promise<ResponseType>;
43
- /**
44
- * Delete multiple instances, or set their deletedAt timestamp to the current time if paranoid is enabled.
45
- * @param req
46
- * @param res
47
- * @param next
48
- */
49
- delete(req: Request, res: Response, next?: NextFunction): Promise<ResponseType>;
50
- /**
51
- * Find all the rows matching your query, within a specified offset / limit,
52
- * and get the total number of rows matching your query.
53
- * ```js
54
- * Controller.find(req, res, next)
55
- * ```
56
- * @param req
57
- * @param res
58
- * @param next
59
- */
60
- archives(req: Request, res: Response, next?: NextFunction): Promise<ResponseType>;
61
- restore(req: Request, res: Response, next?: NextFunction): Promise<ResponseType>;
62
- /**
63
- * count total number of records
64
- * @param req
65
- * @param res
66
- * @param next
67
- * @returns
68
- */
69
- count(req: Request, res: Response, next?: NextFunction): Promise<{
70
- count: number;
71
- }>;
72
- /**
73
- * Return a basic statistics based on the query and group provided.
74
- * ```js
75
- * Controller.find(req, res, next)
76
- * ```
77
- * @param req
78
- * @param res
79
- * @param next
80
- */
81
- stats(req: Request, res: Response, next?: NextFunction): Promise<any>;
82
- /**
83
- * ###############################################################
84
- * ###################### LIFE CYCLE HOOKS #######################
85
- * ###############################################################
86
- */
87
- beforeCreate(req: Request): Promise<void>;
88
- afterCreate(req: Request, rec: any): Promise<void>;
89
- beforeUpdate(req: Request): Promise<void>;
90
- afterUpdate(req: Request, rec: any, orig: any): Promise<void>;
91
- beforeDelete(req: Request): Promise<void>;
92
- afterDelete(req: Request, rec: any): Promise<void>;
93
- beforeFind(req: Request): Promise<void>;
94
- afterFind(req: Request): Promise<void>;
95
- }
96
- //# sourceMappingURL=BaseController.d.ts.map
@@ -1,27 +0,0 @@
1
- import { BaseError, UniqueConstraintError } from "sequelize";
2
- import { RequestQuery, QueryOptions, ResponseType } from "../types/BaseControllerTypes";
3
- /**
4
- * Constructs a Sequelize query object based on the provided request query.
5
- * This function dynamically builds the `where` clause, allows for sorting,
6
- * pagination, field selection, and includes related models.
7
- *
8
- * @param {RequestQuery} query - The incoming request query parameters.
9
- * @returns {QueryOptions} - Returns a Sequelize query options object to be used for querying the database.
10
- */
11
- export declare function ConstructQuery(query: RequestQuery): QueryOptions;
12
- /**
13
- * A helper function to structure a successful response.
14
- *
15
- * @param {any} response - Data to include in the response.
16
- * @returns {ResponseType} - An object with success status and response data.
17
- */
18
- export declare function ResponseHelper(response?: any): ResponseType;
19
- /**
20
- * Handles errors and constructs an error response based on the type of error (Sequelize, database, or validation).
21
- *
22
- * @param {UniqueConstraintError | BaseError | Error | any} error - The error encountered during execution.
23
- * @returns {ResponseType} - Returns a structured error response with error codes and messages.
24
- */
25
- export declare function ErrorResponseHandler(error: UniqueConstraintError | BaseError | Error | any): ResponseType;
26
- export { ResponseType };
27
- //# sourceMappingURL=BaseControllerHelper.d.ts.map
@@ -1,37 +0,0 @@
1
- import { Kafka, type KafkaConfig } from "kafkajs";
2
- /**
3
- * BaseKafka class provides basic functionality for interacting with a Kafka cluster.
4
- * It allows creating Kafka topics and fetching the Kafka instance for producing/consuming messages.
5
- */
6
- export declare class BaseKafka {
7
- private kafka;
8
- private consumerPath;
9
- private producerPath;
10
- /**
11
- * Creates an instance of BaseKafka with the provided Kafka configuration.
12
- *
13
- * @param {KafkaConfig} config - Kafka configuration object containing client settings.
14
- */
15
- constructor(config: KafkaConfig);
16
- /**
17
- * Returns the Kafka instance to be used for producing and consuming messages.
18
- *
19
- * @returns {Kafka} - Kafka instance.
20
- */
21
- getKafka(): Kafka;
22
- /**
23
- * Creates Kafka topics if they don't already exist.
24
- *
25
- * This method checks if the specified topics exist, and if not, it creates them with the given
26
- * number of partitions and replication factor.
27
- *
28
- * @param {Array<{ topic: string; partitions: number; replicationFactor: number }>} topics - List of topics to be created with their partitions and replication factor.
29
- * @returns {Promise<void>} - A promise that resolves once the topics are created (or skipped if they already exist).
30
- */
31
- createTopics(topics: {
32
- topic: string;
33
- partitions: number;
34
- replicationFactor: number;
35
- }[]): Promise<void>;
36
- }
37
- //# sourceMappingURL=BaseKafka.d.ts.map
@@ -1,37 +0,0 @@
1
- import { DataTypes, Model } from 'sequelize';
2
- import type { ModelAttributes } from "sequelize";
3
- import type IBaseModel from './IBaseModel';
4
- export default class BaseModel extends Model implements IBaseModel {
5
- id?: number;
6
- /**
7
- * Sets common model attributes
8
- * @returns
9
- */
10
- static getCommonAttributes(defaultAttributes: boolean): {
11
- createdById: {
12
- type: DataTypes.IntegerDataType;
13
- comment: string;
14
- };
15
- updatedById: {
16
- type: DataTypes.IntegerDataType;
17
- comment: string;
18
- };
19
- isActive: {
20
- type: DataTypes.AbstractDataType;
21
- comment: string;
22
- allowNull: boolean;
23
- defaultValue: boolean;
24
- };
25
- } | null;
26
- static getCommonAssociations(): void;
27
- /**
28
- *
29
- * @param {ModelAttributes} fields table columns
30
- * @param {string} tableName name of the table
31
- * @param {string} schema this will overwrite the default schema
32
- * @param {boolean} paranoid paranoid option. defaults to true
33
- * @param {boolean} defaultAttributes need to inherit default attributes. defaults to true
34
- */
35
- static initialize(fields: ModelAttributes, tableName: string, schema?: string, paranoid?: boolean, defaultAttributes?: boolean): void;
36
- }
37
- //# sourceMappingURL=BaseModel.d.ts.map
@@ -1,42 +0,0 @@
1
- import { type ProducerConfig } from "kafkajs";
2
- import { BaseKafka } from "./BaseKafka";
3
- import type { PublishType } from "../types/BrokerType";
4
- /**
5
- * BaseProducer class provides basic functionality for producing messages to a Kafka topic.
6
- * It manages the connection, disconnection, and message publishing logic for Kafka producers.
7
- */
8
- export declare class BaseProducer {
9
- private producer;
10
- private kafka;
11
- /**
12
- * Creates an instance of BaseProducer using a BaseKafka instance.
13
- *
14
- * @param {BaseKafka} baseKafka - The instance of the BaseKafka class which provides access to the Kafka client.
15
- */
16
- constructor(baseKafka: BaseKafka);
17
- /**
18
- * Connects the producer to the Kafka cluster with the specified optional configuration.
19
- * If the producer is already connected, it logs a message and does nothing.
20
- *
21
- * @param {ProducerConfig} [config] - Optional additional configuration for the producer.
22
- * @returns {Promise<void>} - A promise that resolves once the producer is connected.
23
- */
24
- connect(config?: ProducerConfig): Promise<void>;
25
- /**
26
- * Disconnects the producer from the Kafka cluster.
27
- * If the producer is already disconnected, it logs a message and does nothing.
28
- *
29
- * @returns {Promise<void>} - A promise that resolves once the producer is disconnected.
30
- */
31
- disconnect(): Promise<void>;
32
- /**
33
- * Publishes a message to a Kafka topic.
34
- * If the producer is not connected, it throws an error.
35
- *
36
- * @param {PublishType} data - The data to publish, including the topic, event, headers, and message content.
37
- * @returns {Promise<boolean>} - A promise that resolves to true if the message was successfully sent, false otherwise.
38
- * @throws {Error} - Throws an error if the producer is not connected.
39
- */
40
- publish(data: PublishType): Promise<boolean>;
41
- }
42
- //# sourceMappingURL=BaseProducer.d.ts.map
@@ -1,91 +0,0 @@
1
- import { Request, Response, NextFunction, Router } from 'express';
2
- import BaseController from './BaseController';
3
- import { Mappings } from '../types/BaseRouterTypes';
4
- export default class BaseRouter<T extends BaseController> {
5
- grantPublicAccess: boolean;
6
- controller: T;
7
- /**
8
- *
9
- * @param {Controller} controller
10
- */
11
- constructor(controller: T);
12
- /**
13
- * @description GET route
14
- * @param {Request} req
15
- * @param {Response} res
16
- * @param {NextFunction} next
17
- */
18
- get(req: Request, res: Response, next: NextFunction): Promise<void>;
19
- /**
20
- * @description GET ARCHIVES route
21
- * @param {Request} req
22
- * @param {Response} res
23
- * @param {NextFunction} next
24
- */
25
- archives(req: Request, res: Response, next: NextFunction): Promise<void>;
26
- /**
27
- * @description POST route
28
- * @param {Request} req
29
- * @param {Response} res
30
- * @param {NextFunction} next
31
- */
32
- post(req: Request, res: Response, next: NextFunction): Promise<void>;
33
- /**
34
- * @description GET route (/:id)
35
- * @param {HttpRequest} req
36
- * @param {HttpResponse} res
37
- * @param {*} next
38
- */
39
- getId(req: Request, res: Response, next: NextFunction): Promise<void>;
40
- /**
41
- * @description PUT route (/:id)
42
- * @param {HttpRequest} req
43
- * @param {HttpResponse} res
44
- * @param {*} next
45
- */
46
- update(req: Request, res: Response, next: NextFunction): Promise<void>;
47
- /**
48
- *
49
- * @param req
50
- * @param res
51
- * @param next
52
- */
53
- delete(req: Request, res: Response, next: NextFunction): Promise<void>;
54
- /**
55
- *
56
- * @param req
57
- * @param res
58
- * @param next
59
- */
60
- restore(req: Request, res: Response, next: NextFunction): Promise<void>;
61
- /**
62
- * /count route
63
- * @param req
64
- * @param res
65
- * @param next
66
- */
67
- count(req: Request, res: Response, next: NextFunction): Promise<void>;
68
- /**
69
- * /stats get count by group
70
- * @param req
71
- * @param res
72
- * @param next
73
- */
74
- stats(req: Request, res: Response, next: NextFunction): Promise<void>;
75
- /**
76
- * @description default mappings that will be inherited across all router class
77
- * @returns {Array} mappings
78
- */
79
- getMapping: () => Mappings[];
80
- /**
81
- * @description additional mappings placeholder, designed to be overriden
82
- * @returns {Array} mappings
83
- */
84
- getAdditionalMapping: () => Mappings[];
85
- /**
86
- * @description create the express router
87
- * @returns {Router} router
88
- */
89
- getRoutes(): Router;
90
- }
91
- //# sourceMappingURL=BaseRouter.d.ts.map
@@ -1,37 +0,0 @@
1
- /// <reference types="bun-types" />
2
- /// <reference types="node" />
3
- /// <reference types="bun-types" />
4
- import type { Server, ServerWebSocket } from 'bun';
5
- export default class BaseSocketHandler {
6
- static channel: string;
7
- static server: Server;
8
- static websocket: ServerWebSocket;
9
- /**
10
- *
11
- * @param req {Request}
12
- * @param server {Server}
13
- * @returns
14
- */
15
- upgrade(req: Request, server: Server): Promise<void>;
16
- /**
17
- *
18
- * @param ws {ServerWebSocket}
19
- * @param message {String}
20
- */
21
- accept(ws: ServerWebSocket, message: string): Promise<void>;
22
- /**
23
- *
24
- * @param ws {ServerWebSocket}
25
- */
26
- connect(ws: ServerWebSocket): Promise<void>;
27
- /**
28
- *
29
- * @param ws {ServerWebSocket}
30
- * @param code {number}
31
- * @param reason {reason}
32
- */
33
- disconnect(ws: ServerWebSocket, code: number, reason: string): Promise<void>;
34
- getInstance(): ServerWebSocket;
35
- static parse(url: String): any;
36
- }
37
- //# sourceMappingURL=BaseSocketHandler.d.ts.map