Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/logger": "workspace:^",
"@rocket.chat/model-typings": "workspace:~",
"@rocket.chat/random": "workspace:^",
"@rocket.chat/rest-typings": "workspace:^",
Expand Down
7 changes: 7 additions & 0 deletions packages/models/src/models/LivechatDepartment.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import type { ILivechatDepartment, LivechatDepartmentDTO, RocketChatRecordDeleted } from '@rocket.chat/core-typings';
import type { ILivechatDepartmentModel } from '@rocket.chat/model-typings';
import { Logger } from '@rocket.chat/logger';

Check failure on line 3 in packages/models/src/models/LivechatDepartment.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

`@rocket.chat/logger` import should occur before type import of `@rocket.chat/model-typings`
import { escapeRegExp } from '@rocket.chat/tools';
import type { Collection, FindCursor, Db, Filter, FindOptions, UpdateResult, Document, IndexDescription, AggregationCursor } from 'mongodb';

import { LivechatDepartmentAgents, LivechatUnitMonitors } from '../index';
import { BaseRaw } from './BaseRaw';

const logger = new Logger('LivechatDepartment');

export class LivechatDepartmentRaw extends BaseRaw<ILivechatDepartment> implements ILivechatDepartmentModel {
constructor(db: Db, trash?: Collection<RocketChatRecordDeleted<ILivechatDepartment>>) {
super(db, 'livechat_department', trash);
Expand Down Expand Up @@ -76,6 +79,10 @@
conditions: Filter<ILivechatDepartment> = {},
options: FindOptions<ILivechatDepartment> = {},
): FindCursor<ILivechatDepartment> {
if (Object.keys(conditions).length > 0) {
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
logger.warn('The parameter "conditions" in "findByNameRegexWithExceptionsAndConditions" is deprecated and will be removed in 9.0.0');
}

if (!Array.isArray(exceptions)) {
exceptions = [exceptions];
}
Expand Down
7 changes: 7 additions & 0 deletions packages/models/src/models/LivechatVisitors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { IVisitorExternalIdentifier, ILivechatVisitor, RocketChatRecordDeleted } from '@rocket.chat/core-typings';
import type { FindPaginated, ILivechatVisitorsModel } from '@rocket.chat/model-typings';
import { Logger } from '@rocket.chat/logger';

Check failure on line 3 in packages/models/src/models/LivechatVisitors.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

`@rocket.chat/logger` import should occur before type import of `@rocket.chat/model-typings`
import { escapeRegExp } from '@rocket.chat/tools';
import type {
AggregationCursor,
Expand All @@ -21,6 +22,8 @@
import { Settings } from '../index';
import { BaseRaw } from './BaseRaw';

const logger = new Logger('LivechatVisitors');

export class LivechatVisitorsRaw extends BaseRaw<ILivechatVisitor> implements ILivechatVisitorsModel {
constructor(db: Db, trash?: Collection<RocketChatRecordDeleted<ILivechatVisitor>>) {
super(db, 'livechat_visitor', trash);
Expand Down Expand Up @@ -180,6 +183,10 @@
custom_name: string;
}
> {
if (Object.keys(conditions).length > 0) {
Comment thread
tassoevan marked this conversation as resolved.
Outdated
logger.warn('The parameter "conditions" in "findByNameRegexWithExceptionsAndConditions" is deprecated and will be removed in 9.0.0');
}

if (!Array.isArray(exceptions)) {
exceptions = [exceptions];
}
Expand Down
Loading