mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
Merge branch 'main' into fix/channel-data-inference-type-issue
This commit is contained in:
@@ -56,7 +56,7 @@ import { SubscriberService } from '../services/subscriber.service';
|
||||
@UseInterceptors(CsrfInterceptor)
|
||||
@Controller('message')
|
||||
export class MessageController extends BaseController<
|
||||
Message,
|
||||
AnyMessage,
|
||||
MessageStub,
|
||||
MessagePopulate,
|
||||
MessageFull
|
||||
|
||||
@@ -72,7 +72,7 @@ export class MessageRepository extends BaseRepository<
|
||||
until = new Date(),
|
||||
limit: number = 30,
|
||||
) {
|
||||
return await this.findPage(
|
||||
return await this.find(
|
||||
{
|
||||
$or: [{ recipient: subscriber.id }, { sender: subscriber.id }],
|
||||
createdAt: { $lt: until },
|
||||
@@ -96,7 +96,7 @@ export class MessageRepository extends BaseRepository<
|
||||
since = new Date(),
|
||||
limit: number = 30,
|
||||
) {
|
||||
return await this.findPage(
|
||||
return await this.find(
|
||||
{
|
||||
$or: [{ recipient: subscriber.id }, { sender: subscriber.id }],
|
||||
createdAt: { $gt: since },
|
||||
|
||||
@@ -106,7 +106,7 @@ export class SubscriberRepository extends BaseRepository<
|
||||
* @returns The constructed query object.
|
||||
*/
|
||||
findByForeignIdQuery(id: string) {
|
||||
return this.findPageQuery(
|
||||
return this.findQuery(
|
||||
{ foreign_id: id },
|
||||
{ skip: 0, limit: 1, sort: ['lastvisit', 'desc'] },
|
||||
);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { ChannelName } from '@/channel/types';
|
||||
import { Nlp } from '@/helper/types';
|
||||
import { NLU } from '@/helper/types';
|
||||
|
||||
import { Subscriber } from '../subscriber.schema';
|
||||
|
||||
@@ -17,7 +17,7 @@ export interface Context {
|
||||
channel?: ChannelName;
|
||||
text?: string;
|
||||
payload?: Payload | string;
|
||||
nlp?: Nlp.ParseEntities | null;
|
||||
nlp?: NLU.ParseEntities | null;
|
||||
vars: { [key: string]: any };
|
||||
user_location: {
|
||||
address?: Record<string, string>;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { AttachmentService } from '@/attachment/services/attachment.service';
|
||||
import EventWrapper from '@/channel/lib/EventWrapper';
|
||||
import { ContentService } from '@/cms/services/content.service';
|
||||
import { CONSOLE_CHANNEL_NAME } from '@/extensions/channels/console/settings';
|
||||
import { Nlp } from '@/helper/types';
|
||||
import { NLU } from '@/helper/types';
|
||||
import { I18nService } from '@/i18n/services/i18n.service';
|
||||
import { LanguageService } from '@/i18n/services/language.service';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
@@ -254,7 +254,7 @@ export class BlockService extends BaseService<Block, BlockPopulate, BlockFull> {
|
||||
* @returns The NLP patterns that matches
|
||||
*/
|
||||
matchNLP(
|
||||
nlp: Nlp.ParseEntities,
|
||||
nlp: NLU.ParseEntities,
|
||||
block: Block | BlockFull,
|
||||
): NlpPattern[] | undefined {
|
||||
// No nlp entities to check against
|
||||
|
||||
@@ -126,7 +126,7 @@ export class MessageService extends BaseService<
|
||||
* @returns The message history since the specified date.
|
||||
*/
|
||||
async findLastMessages(subscriber: Subscriber, limit: number = 5) {
|
||||
const lastMessages = await this.findPage(
|
||||
const lastMessages = await this.find(
|
||||
{
|
||||
$or: [{ sender: subscriber.id }, { recipient: subscriber.id }],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user