Skip to content

Commit 275f7aa

Browse files
abhinavkringgazzo
authored andcommitted
chore!: remove deprecated endpoint livechat/inquiries.queued (#33453)
1 parent f0e1adf commit 275f7aa

File tree

4 files changed

+7
-87
lines changed

4 files changed

+7
-87
lines changed

.changeset/sixty-moons-walk.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rocket.chat/rest-typings': major
3+
'@rocket.chat/meteor': major
4+
---
5+
6+
Removes deprecated `livechat/inquiries.queued` endpoint. Moving forward use the `livechat/inquiries.queuedForUser` endpoint.

apps/meteor/app/livechat/imports/server/rest/inquiries.ts

-34
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { LivechatInquiry, LivechatDepartment, Users } from '@rocket.chat/models'
33
import {
44
isGETLivechatInquiriesListParams,
55
isPOSTLivechatInquiriesTakeParams,
6-
isGETLivechatInquiriesQueuedParams,
76
isGETLivechatInquiriesQueuedForUserParams,
87
isGETLivechatInquiriesGetOneParams,
98
} from '@rocket.chat/rest-typings';
@@ -69,39 +68,6 @@ API.v1.addRoute(
6968
},
7069
);
7170

72-
API.v1.addRoute(
73-
'livechat/inquiries.queued',
74-
{
75-
authRequired: true,
76-
permissionsRequired: ['view-l-room'],
77-
validateParams: isGETLivechatInquiriesQueuedParams,
78-
deprecation: {
79-
version: '7.0.0',
80-
alternatives: ['livechat/inquiries.queuedForUser'],
81-
},
82-
},
83-
{
84-
async get() {
85-
const { offset, count } = await getPaginationItems(this.queryParams);
86-
const { sort } = await this.parseJsonQuery();
87-
const { department } = this.queryParams;
88-
89-
return API.v1.success(
90-
await findInquiries({
91-
userId: this.userId,
92-
department,
93-
status: LivechatInquiryStatus.QUEUED,
94-
pagination: {
95-
offset,
96-
count,
97-
sort,
98-
},
99-
}),
100-
);
101-
},
102-
},
103-
);
104-
10571
API.v1.addRoute(
10672
'livechat/inquiries.queuedForUser',
10773
{ authRequired: true, permissionsRequired: ['view-l-room'], validateParams: isGETLivechatInquiriesQueuedForUserParams },

apps/meteor/tests/end-to-end/api/livechat/05-inquiries.ts

+1-23
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,6 @@ describe('LIVECHAT - inquiries', () => {
5252
});
5353
});
5454

55-
describe('livechat/inquiries.queued', () => {
56-
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => {
57-
await updatePermission('view-l-room', []);
58-
await request.get(api('livechat/inquiries.queued')).set(credentials).expect('Content-Type', 'application/json').expect(403);
59-
});
60-
it('should return an array of inquiries', async () => {
61-
await updatePermission('view-l-room', ['admin']);
62-
await request
63-
.get(api('livechat/inquiries.queued'))
64-
.set(credentials)
65-
.expect('Content-Type', 'application/json')
66-
.expect(200)
67-
.expect((res: Response) => {
68-
expect(res.body).to.have.property('success', true);
69-
expect(res.body.inquiries).to.be.an('array');
70-
expect(res.body).to.have.property('offset');
71-
expect(res.body).to.have.property('total');
72-
expect(res.body).to.have.property('count');
73-
});
74-
});
75-
});
76-
7755
describe('livechat/inquiries.getOne', () => {
7856
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => {
7957
await updatePermission('view-l-room', []);
@@ -235,7 +213,7 @@ describe('LIVECHAT - inquiries', () => {
235213
});
236214
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => {
237215
await updatePermission('view-l-room', []);
238-
await request.get(api('livechat/inquiries.queued')).set(credentials).expect('Content-Type', 'application/json').expect(403);
216+
await request.get(api('livechat/inquiries.queuedForUser')).set(credentials).expect('Content-Type', 'application/json').expect(403);
239217
});
240218
it('should return an array of inquiries', async () => {
241219
await restorePermissionToRoles('view-l-room');

packages/rest-typings/src/v1/omnichannel.ts

-30
Original file line numberDiff line numberDiff line change
@@ -2977,33 +2977,6 @@ const POSTLivechatInquiriesTakeParamsSchema = {
29772977

29782978
export const isPOSTLivechatInquiriesTakeParams = ajv.compile<POSTLivechatInquiriesTakeParams>(POSTLivechatInquiriesTakeParamsSchema);
29792979

2980-
type GETLivechatInquiriesQueuedParams = PaginatedRequest<{ department?: string }>;
2981-
2982-
const GETLivechatInquiriesQueuedParamsSchema = {
2983-
type: 'object',
2984-
properties: {
2985-
count: {
2986-
type: 'number',
2987-
nullable: true,
2988-
},
2989-
offset: {
2990-
type: 'number',
2991-
nullable: true,
2992-
},
2993-
sort: {
2994-
type: 'string',
2995-
nullable: true,
2996-
},
2997-
department: {
2998-
type: 'string',
2999-
nullable: true,
3000-
},
3001-
},
3002-
additionalProperties: false,
3003-
};
3004-
3005-
export const isGETLivechatInquiriesQueuedParams = ajv.compile<GETLivechatInquiriesQueuedParams>(GETLivechatInquiriesQueuedParamsSchema);
3006-
30072980
type GETLivechatInquiriesQueuedForUserParams = PaginatedRequest<{ department?: string }>;
30082981

30092982
const GETLivechatInquiriesQueuedForUserParamsSchema = {
@@ -3969,9 +3942,6 @@ export type OmnichannelEndpoints = {
39693942
'/v1/livechat/inquiries.take': {
39703943
POST: (params: POSTLivechatInquiriesTakeParams) => { inquiry: ILivechatInquiryRecord };
39713944
};
3972-
'/v1/livechat/inquiries.queued': {
3973-
GET: (params: GETLivechatInquiriesQueuedParams) => PaginatedResult<{ inquiries: ILivechatInquiryRecord[] }>;
3974-
};
39753945
'/v1/livechat/inquiries.queuedForUser': {
39763946
GET: (params: GETLivechatInquiriesQueuedForUserParams) => PaginatedResult<{ inquiries: ILivechatInquiryRecord[] }>;
39773947
};

0 commit comments

Comments
 (0)