@wabot-dev/framework 0.2.0 → 0.2.1-beta.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.
- package/dist/src/addon/auth/api-key/@apiKeyGuard.js +1 -0
- package/dist/src/addon/auth/jwt/@jwtGuard.js +1 -0
- package/dist/src/core/validation/metadata/ValidationMetadataStore.js +1 -0
- package/dist/src/core/validation/validators/is-record/@isRecord.js +18 -0
- package/dist/src/core/validation/validators/is-record/validateIsRecord.js +35 -0
- package/dist/src/feature/rest-controller/RestRequest.js +14 -0
- package/dist/src/feature/rest-controller/runRestControllers.js +19 -14
- package/dist/src/index.d.ts +14 -1
- package/dist/src/index.js +3 -0
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
|
6
6
|
import '../../../feature/express/ExpressProvider.js';
|
|
7
7
|
import 'express';
|
|
8
8
|
import 'path';
|
|
9
|
+
import '../../../feature/rest-controller/RestRequest.js';
|
|
9
10
|
import { ApiKeyGuardMiddleware } from './ApiKeyGuardMiddleware.js';
|
|
10
11
|
|
|
11
12
|
function apiKeyGuard() {
|
|
@@ -6,6 +6,7 @@ import '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
|
6
6
|
import '../../../feature/express/ExpressProvider.js';
|
|
7
7
|
import 'express';
|
|
8
8
|
import 'path';
|
|
9
|
+
import '../../../feature/rest-controller/RestRequest.js';
|
|
9
10
|
import { JwtGuardMiddleware } from './JwtGuardMiddleware.js';
|
|
10
11
|
|
|
11
12
|
function jwtGuard() {
|
|
@@ -58,6 +58,7 @@ let ValidationMetadataStore = class ValidationMetadataStore {
|
|
|
58
58
|
constructors.unshift(modelConstructor);
|
|
59
59
|
const modelValidators = {
|
|
60
60
|
modelConstructor: modelConstructor,
|
|
61
|
+
modelHierarchy: constructors,
|
|
61
62
|
properties: Object.assign({}, ...constructors.map((x) => this.getConstructorPropertiesValidatorsInfo(x))),
|
|
62
63
|
};
|
|
63
64
|
return modelValidators;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { container } from '../../../injection/index.js';
|
|
2
|
+
import { ValidationMetadataStore } from '../../metadata/ValidationMetadataStore.js';
|
|
3
|
+
import { validateIsRecord } from './validateIsRecord.js';
|
|
4
|
+
|
|
5
|
+
function isRecord(keyType, valueType) {
|
|
6
|
+
return function (target, propertyKey) {
|
|
7
|
+
const propertyName = propertyKey.toString();
|
|
8
|
+
const store = container.resolve(ValidationMetadataStore);
|
|
9
|
+
store.saveValidatorMetadata({
|
|
10
|
+
modelConstructor: target.constructor,
|
|
11
|
+
propertyName,
|
|
12
|
+
validator: validateIsRecord,
|
|
13
|
+
validatorOptions: { keyType, valueType },
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { isRecord };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function validateIsRecord(value, options) {
|
|
2
|
+
if (value == null) {
|
|
3
|
+
return {
|
|
4
|
+
error: { description: `null is not allowed` },
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
if (typeof value !== 'object') {
|
|
8
|
+
return {
|
|
9
|
+
error: { description: `value should be an object` },
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
if (Array.isArray(value)) {
|
|
13
|
+
return {
|
|
14
|
+
error: { description: `array is not allowed` },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
for (const key in value) {
|
|
18
|
+
if (typeof key !== options.keyType) {
|
|
19
|
+
return {
|
|
20
|
+
error: { description: `record keys should be ${options.keyType}` },
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const keyValue = value[key];
|
|
24
|
+
if (typeof keyValue !== options.valueType) {
|
|
25
|
+
return {
|
|
26
|
+
error: { description: `record values should be ${options.valueType}` },
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
value,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { validateIsRecord };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
2
|
+
import '../../core/injection/index.js';
|
|
3
|
+
import '../../core/validation/metadata/ValidationMetadataStore.js';
|
|
4
|
+
import { isRecord } from '../../core/validation/validators/is-record/@isRecord.js';
|
|
5
|
+
|
|
6
|
+
class RestRequest {
|
|
7
|
+
headers;
|
|
8
|
+
}
|
|
9
|
+
__decorate([
|
|
10
|
+
isRecord('string', 'string'),
|
|
11
|
+
__metadata("design:type", Object)
|
|
12
|
+
], RestRequest.prototype, "headers", void 0);
|
|
13
|
+
|
|
14
|
+
export { RestRequest };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { CustomError } from '../../core/error/CustomError.js';
|
|
2
2
|
import { container } from '../../core/injection/index.js';
|
|
3
3
|
import { Logger } from '../../core/logger/Logger.js';
|
|
4
|
-
import '../../core/validation/
|
|
5
|
-
import {
|
|
4
|
+
import { validateModel } from '../../core/validation/core/validateModel.js';
|
|
5
|
+
import { ValidationMetadataStore } from '../../core/validation/metadata/ValidationMetadataStore.js';
|
|
6
6
|
import { ExpressProvider } from '../express/ExpressProvider.js';
|
|
7
7
|
import { json, urlencoded } from 'express';
|
|
8
8
|
import path__default from 'path';
|
|
9
9
|
import { EXPRESS_REQ, EXPRESS_RES } from './injection-tokens.js';
|
|
10
10
|
import { RestControllerMetadataStore } from './metadata/RestControllerMetadataStore.js';
|
|
11
|
+
import { RestRequest } from './RestRequest.js';
|
|
11
12
|
|
|
12
13
|
function buildRequest(req) {
|
|
13
14
|
return Object.assign({}, req.body, req.query, req.params);
|
|
@@ -16,6 +17,7 @@ function runRestControllers(controllers) {
|
|
|
16
17
|
const logger = new Logger('wabot:rest');
|
|
17
18
|
const metadataStore = container.resolve(RestControllerMetadataStore);
|
|
18
19
|
const expressProvider = container.resolve(ExpressProvider);
|
|
20
|
+
const validationMetadataStore = container.resolve(ValidationMetadataStore);
|
|
19
21
|
const expressApp = expressProvider.getExpress();
|
|
20
22
|
controllers.forEach((controller) => {
|
|
21
23
|
const endPoints = metadataStore.getControllerEndPointsInfo(controller);
|
|
@@ -43,20 +45,23 @@ function runRestControllers(controllers) {
|
|
|
43
45
|
}
|
|
44
46
|
const controllerInstance = requestContainer.resolve(endPoint.controllerConstructor);
|
|
45
47
|
const endPointArgs = [];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
if (endPoint.paramsTypes.length > 1) {
|
|
49
|
+
throw new Error(`rest controller endpoints should have zero or one parameter only`);
|
|
50
|
+
}
|
|
51
|
+
if (endPoint.paramsTypes.length === 1) {
|
|
52
|
+
const paramType = endPoint.paramsTypes[0];
|
|
53
|
+
if (typeof paramType !== 'function') {
|
|
54
|
+
throw new Error(`invalid rest controller endpoint parameter type`);
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
const paramInfo = validationMetadataStore.getModelValidatorsInfo(paramType);
|
|
57
|
+
const validableReq = paramInfo.modelHierarchy.includes(RestRequest)
|
|
58
|
+
? req
|
|
59
|
+
: buildRequest(req);
|
|
60
|
+
const { value, error } = validateModel(validableReq, paramInfo);
|
|
61
|
+
if (error) {
|
|
62
|
+
throw new CustomError({ httpCode: 400, message: error.description, info: error });
|
|
59
63
|
}
|
|
64
|
+
endPointArgs.push(value);
|
|
60
65
|
}
|
|
61
66
|
const response = await controllerInstance[endPoint.functionName].apply(controllerInstance, endPointArgs);
|
|
62
67
|
res.status(200).json(response ?? null);
|
package/dist/src/index.d.ts
CHANGED
|
@@ -175,6 +175,7 @@ interface IPropertyValidatorInfo {
|
|
|
175
175
|
}
|
|
176
176
|
type IModelValidatorsInfo<V> = {
|
|
177
177
|
modelConstructor: IConstructor<V>;
|
|
178
|
+
modelHierarchy: IConstructor<any>[];
|
|
178
179
|
properties: {
|
|
179
180
|
[prop: string]: {
|
|
180
181
|
isOptional?: boolean;
|
|
@@ -265,6 +266,14 @@ interface IValidateMinOptions {
|
|
|
265
266
|
}
|
|
266
267
|
declare function validateMin(value: any, options: IValidateMinOptions): IValidationResult<any>;
|
|
267
268
|
|
|
269
|
+
declare function isRecord(keyType: 'number' | 'string', valueType: 'number' | 'string' | 'boolean'): (target: object, propertyKey: string | symbol) => void;
|
|
270
|
+
|
|
271
|
+
interface IValidateIsRecordOptions {
|
|
272
|
+
keyType: 'string' | 'number';
|
|
273
|
+
valueType: 'string' | 'number' | 'boolean';
|
|
274
|
+
}
|
|
275
|
+
declare function validateIsRecord(value: any, options: IValidateIsRecordOptions): IValidationResult<any>;
|
|
276
|
+
|
|
268
277
|
declare class Mapper {
|
|
269
278
|
map<T>(data: IValidateInputShape<T>, ctor: IConstructor<T>): T;
|
|
270
279
|
}
|
|
@@ -915,6 +924,10 @@ declare function runRestControllers(controllers: IConstructor<any>[]): void;
|
|
|
915
924
|
declare const EXPRESS_REQ = "EXPRESS_REQ";
|
|
916
925
|
declare const EXPRESS_RES = "EXPRESS_RES";
|
|
917
926
|
|
|
927
|
+
declare class RestRequest {
|
|
928
|
+
headers?: Record<string, string>;
|
|
929
|
+
}
|
|
930
|
+
|
|
918
931
|
declare class SocketServerProvider {
|
|
919
932
|
private httpServerProvider;
|
|
920
933
|
private socketServer;
|
|
@@ -1625,4 +1638,4 @@ declare function HtmlModule(options: IHtmlModuleOptions): {
|
|
|
1625
1638
|
new (): {};
|
|
1626
1639
|
};
|
|
1627
1640
|
|
|
1628
|
-
export { AnthropicChatAdapter, ApiKey, ApiKeyGuardMiddleware, ApiKeyHandshakeGuardMiddleware, ApiKeyRepository, Async, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, CmdChannel, Command, CommandMetadataStore, Container, ControllerMetadataStore, CustomError, DeepSeekChatAdapter, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, ExpressProvider, GoogleChatAdapter, type GoogleChatAdapterV2Options, HtmlModule, HttpServerProvider, type IApiKeyData, type IApiKeyRepository, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterNextItemsReq, type IChatAdapterNextItemsRes, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatRepository, type IChatType, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICrudRepository, type ICustomErrorData, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IFunctionCall, type IFunctionCallItem, type IGenerateApiKeyReq, type IGenerateApiKeyRes, type IGetWhatsAppTemplateRequest, type IHandshakeMiddleware, type IHandshakeMiddlewareMetadata, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobEvent, type IJobEventListener, type IJobRepository, type IJwtRefreshTokenData, type IJwtRefreshTokenRepository, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type IMessageContext, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetDecoration, type IMindsetFunctionConfig, type IMindsetFunctionDecoration, type IMindsetFunctionMetadata, type IMindsetFunctionParamMetadata, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleDecoration, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IParamConfig, type IParamDecoration, type IPersistentData, type IPgRepositoryConfig, type IPrimitive, type IPropertyValidatorInfo, type IReceivedMessage, type IRemoteApiKeyFetcher, type IRestControllerConfig, type IRestControllerMetadata, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelReceivedMessage, type ISocketControllerConfig, type ISocketControllerMetadata, type ISocketEventConfig, type ISocketEventMetadata, type IStorableData, type ITelegramChannelConfig, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateInputShape, type IValidateIsInOptions, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppCloudContact, type IWhatsAppCloudMessage, type IWhatsAppCloudMessageMetadata, type IWhatsAppCloudTemplate, type IWhatsAppCloudTemplateComponent, type IWhatsAppCloudTemplateMessage, type IWhatsAppCloudTemplateParameter, type IWhatsAppCloudTemplateResponse, type IWhatsAppCloudWebhookPayload, type IWhatsAppData, type IWhatsAppMessageListener, type IWhatsAppProxyListenMessageEventData, type IWhatsAppProxyListenMessageEventReq, type IWhatsAppProxyMessage, type IWhatsAppProxyMessageContent, type IWhatsAppProxyMessageEventReq, type IWhatsAppProxySendMessageEventReq, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, JobsEventsHub, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtHandshakeGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Logger, MINDSET_DECORATION_MINDSET, MINDSET_FUNCTION_DECORATION_FUNCTION, MINDSET_MODULE_DECORATION_MODULE, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenaiChatAdapter, PARAM_DECORATION_IS_OPTIONAL, PARAM_DECORATION_PARAM, Password, type PasswordHashOptions, Persistent, PgApiKeyRepository, PgChatMemory, PgChatRepository, PgCrudRepository, PgJobRepository, PgJwtRefreshTokenRepository, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RemoteApiKeyRepository, RestControllerMetadataStore, SocketChannel, SocketChannelConfig, SocketChannelReceivedMessage, SocketControllerMetadataStore, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT, WabotChatAdapter, WhatsApp, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByCloudApi, WhatsAppReceiverByWabotProxy, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByWabotProxy, WhatsAppWabotProxyConnection, WhatsappChannelConfig, apiKeyGuard, apiKeyHandshakeGuard, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, container, handshakeMiddlewares, inject, injectable, isArray, isBoolean, isDate, isIn, isModel, isNotEmpty, isNumber, isOptional, isPresent, isString, jwtGuard, jwtHandshakeGuard, max, middleware, min, mindset, mindsetFunction, mindsetModule, modelInfo, onDelete, onGet, onPost, onPut, onSocketEvent, param, readJsonFromFile, restController, runAsyncCommandHandlers, runChatControllers, runRestControllers, runSocketControllers, scoped, singleton, socket, socketController, telegram, validateAndTransform, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsApp, writeJsonToFile };
|
|
1641
|
+
export { AnthropicChatAdapter, ApiKey, ApiKeyGuardMiddleware, ApiKeyHandshakeGuardMiddleware, ApiKeyRepository, Async, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, CmdChannel, Command, CommandMetadataStore, Container, ControllerMetadataStore, CustomError, DeepSeekChatAdapter, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, ExpressProvider, GoogleChatAdapter, type GoogleChatAdapterV2Options, HtmlModule, HttpServerProvider, type IApiKeyData, type IApiKeyRepository, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterNextItemsReq, type IChatAdapterNextItemsRes, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatRepository, type IChatType, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICrudRepository, type ICustomErrorData, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IFunctionCall, type IFunctionCallItem, type IGenerateApiKeyReq, type IGenerateApiKeyRes, type IGetWhatsAppTemplateRequest, type IHandshakeMiddleware, type IHandshakeMiddlewareMetadata, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobEvent, type IJobEventListener, type IJobRepository, type IJwtRefreshTokenData, type IJwtRefreshTokenRepository, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type IMessageContext, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetDecoration, type IMindsetFunctionConfig, type IMindsetFunctionDecoration, type IMindsetFunctionMetadata, type IMindsetFunctionParamMetadata, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleDecoration, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IParamConfig, type IParamDecoration, type IPersistentData, type IPgRepositoryConfig, type IPrimitive, type IPropertyValidatorInfo, type IReceivedMessage, type IRemoteApiKeyFetcher, type IRestControllerConfig, type IRestControllerMetadata, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelReceivedMessage, type ISocketControllerConfig, type ISocketControllerMetadata, type ISocketEventConfig, type ISocketEventMetadata, type IStorableData, type ITelegramChannelConfig, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateInputShape, type IValidateIsInOptions, type IValidateIsRecordOptions, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppCloudContact, type IWhatsAppCloudMessage, type IWhatsAppCloudMessageMetadata, type IWhatsAppCloudTemplate, type IWhatsAppCloudTemplateComponent, type IWhatsAppCloudTemplateMessage, type IWhatsAppCloudTemplateParameter, type IWhatsAppCloudTemplateResponse, type IWhatsAppCloudWebhookPayload, type IWhatsAppData, type IWhatsAppMessageListener, type IWhatsAppProxyListenMessageEventData, type IWhatsAppProxyListenMessageEventReq, type IWhatsAppProxyMessage, type IWhatsAppProxyMessageContent, type IWhatsAppProxyMessageEventReq, type IWhatsAppProxySendMessageEventReq, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, JobsEventsHub, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtHandshakeGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Logger, MINDSET_DECORATION_MINDSET, MINDSET_FUNCTION_DECORATION_FUNCTION, MINDSET_MODULE_DECORATION_MODULE, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenaiChatAdapter, PARAM_DECORATION_IS_OPTIONAL, PARAM_DECORATION_PARAM, Password, type PasswordHashOptions, Persistent, PgApiKeyRepository, PgChatMemory, PgChatRepository, PgCrudRepository, PgJobRepository, PgJwtRefreshTokenRepository, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RemoteApiKeyRepository, RestControllerMetadataStore, RestRequest, SocketChannel, SocketChannelConfig, SocketChannelReceivedMessage, SocketControllerMetadataStore, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT, WabotChatAdapter, WhatsApp, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByCloudApi, WhatsAppReceiverByWabotProxy, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByWabotProxy, WhatsAppWabotProxyConnection, WhatsappChannelConfig, apiKeyGuard, apiKeyHandshakeGuard, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, container, handshakeMiddlewares, inject, injectable, isArray, isBoolean, isDate, isIn, isModel, isNotEmpty, isNumber, isOptional, isPresent, isRecord, isString, jwtGuard, jwtHandshakeGuard, max, middleware, min, mindset, mindsetFunction, mindsetModule, modelInfo, onDelete, onGet, onPost, onPut, onSocketEvent, param, readJsonFromFile, restController, runAsyncCommandHandlers, runChatControllers, runRestControllers, runSocketControllers, scoped, singleton, socket, socketController, telegram, validateAndTransform, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsRecord, validateIsString, validateMax, validateMin, validateModel, whatsApp, writeJsonToFile };
|
package/dist/src/index.js
CHANGED
|
@@ -34,6 +34,8 @@ export { max } from './core/validation/validators/max/@max.js';
|
|
|
34
34
|
export { validateMax } from './core/validation/validators/max/validateMax.js';
|
|
35
35
|
export { min } from './core/validation/validators/min/@min.js';
|
|
36
36
|
export { validateMin } from './core/validation/validators/min/validateMin.js';
|
|
37
|
+
export { isRecord } from './core/validation/validators/is-record/@isRecord.js';
|
|
38
|
+
export { validateIsRecord } from './core/validation/validators/is-record/validateIsRecord.js';
|
|
37
39
|
export { command } from './feature/async/@command.js';
|
|
38
40
|
export { commandHandler } from './feature/async/@commandHandler.js';
|
|
39
41
|
export { Async } from './feature/async/Async.js';
|
|
@@ -83,6 +85,7 @@ export { restController } from './feature/rest-controller/metadata/@restControll
|
|
|
83
85
|
export { RestControllerMetadataStore } from './feature/rest-controller/metadata/RestControllerMetadataStore.js';
|
|
84
86
|
export { runRestControllers } from './feature/rest-controller/runRestControllers.js';
|
|
85
87
|
export { EXPRESS_REQ, EXPRESS_RES } from './feature/rest-controller/injection-tokens.js';
|
|
88
|
+
export { RestRequest } from './feature/rest-controller/RestRequest.js';
|
|
86
89
|
export { SocketServerProvider } from './feature/socket/SocketServerProvider.js';
|
|
87
90
|
export { handshakeMiddlewares } from './feature/socket-controller/metadata/@handshakeMiddlewares.js';
|
|
88
91
|
export { socketController } from './feature/socket-controller/metadata/@socketController.js';
|