@fr-data-fabric/chatbot-api-nest 0.0.7 → 0.0.8
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,20 +1,17 @@
|
|
|
1
|
-
import { ConversationEntity } from './domain/entities/ConversationEntity';
|
|
2
1
|
import { UserEntity } from './domain/entities/UserEntity';
|
|
3
|
-
import { ConversationRepository } from './domain/interfaces/ConversationRepository';
|
|
4
2
|
import { SendChatUC } from './domain/use-cases/chats/SendChatUC';
|
|
5
3
|
import { ICreateConversationUC } from './domain/use-cases/conversations/CreateConversationUC';
|
|
6
4
|
import { IGetConversationsUC } from './domain/use-cases/conversations/GetConversationsUC';
|
|
7
5
|
import { IGetConversationUC } from './domain/use-cases/conversations/GetConversationUC';
|
|
8
6
|
import { DynamicModule, Type } from '@nestjs/common';
|
|
9
7
|
import { GqlTypeReference } from '@nestjs/graphql';
|
|
10
|
-
export type ChatbotApiModuleOptions<TUser extends UserEntity
|
|
8
|
+
export type ChatbotApiModuleOptions<TUser extends UserEntity> = {
|
|
11
9
|
useCases: {
|
|
12
10
|
getConversation: Type<IGetConversationUC<TUser>>;
|
|
13
11
|
getConversations: Type<IGetConversationsUC<TUser>>;
|
|
14
12
|
createConversation: Type<ICreateConversationUC<TUser>>;
|
|
15
13
|
sendChat: Type<SendChatUC<never, TUser>>;
|
|
16
14
|
};
|
|
17
|
-
conversationRepository: Type<ConversationRepository<TConversation>>;
|
|
18
15
|
gql: {
|
|
19
16
|
GqlConversation: GqlTypeReference;
|
|
20
17
|
GqlChat: GqlTypeReference;
|
|
@@ -25,5 +22,5 @@ export type ChatbotApiModuleOptions<TUser extends UserEntity, TConversation exte
|
|
|
25
22
|
};
|
|
26
23
|
};
|
|
27
24
|
export declare class ChatbotApiModule {
|
|
28
|
-
static register<TUser extends UserEntity
|
|
25
|
+
static register<TUser extends UserEntity>(options: ChatbotApiModuleOptions<TUser>): DynamicModule;
|
|
29
26
|
}
|
|
@@ -8,7 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var ChatbotApiModule_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ChatbotApiModule = void 0;
|
|
11
|
-
const ConversationRepository_1 = require("./domain/interfaces/ConversationRepository");
|
|
12
11
|
const SendChatUC_1 = require("./domain/use-cases/chats/SendChatUC");
|
|
13
12
|
const CreateConversationUC_1 = require("./domain/use-cases/conversations/CreateConversationUC");
|
|
14
13
|
const DeleteConversationUC_1 = require("./domain/use-cases/conversations/DeleteConversationUC");
|
|
@@ -24,11 +23,6 @@ let ChatbotApiModule = ChatbotApiModule_1 = class ChatbotApiModule {
|
|
|
24
23
|
return {
|
|
25
24
|
module: ChatbotApiModule_1,
|
|
26
25
|
providers: [
|
|
27
|
-
// Repositories
|
|
28
|
-
{
|
|
29
|
-
provide: ConversationRepository_1.CONVERSATION_REPOSITORY,
|
|
30
|
-
useClass: options.conversationRepository,
|
|
31
|
-
},
|
|
32
26
|
// Use cases
|
|
33
27
|
{
|
|
34
28
|
provide: GetConversationUC_1.GET_CONVERSATION_UC,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-api.module.js","sourceRoot":"/","sources":["chatbot-api.module.ts"],"names":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"chatbot-api.module.js","sourceRoot":"/","sources":["chatbot-api.module.ts"],"names":[],"mappings":";;;;;;;;;;AACA,mEAA8E;AAC9E,+FAG8D;AAC9D,+FAA4F;AAC5F,2FAG4D;AAC5D,yFAG2D;AAC3D,+FAA4F;AAC5F,yEAAsE;AACtE,mEAAmE;AACnE,mFAAmF;AACnF,2CAA6D;AAqBtD,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CACb,OAAuC;QAEvC,OAAO;YACL,MAAM,EAAE,kBAAgB;YACxB,SAAS,EAAE;gBACT,YAAY;gBACZ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