@webitel/api-services 0.0.69 → 0.0.71

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/api-services",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "make-all": "npm run gen:api && npm version patch && (npm run build:types || true) && (npm run format:all || true) && npm run publish-lib",
@@ -31,7 +31,7 @@ const getAgentsList = async (params) => {
31
31
  const fieldsToSend = [
32
32
  'page',
33
33
  'size',
34
- 'search',
34
+ 'q',
35
35
  'sort',
36
36
  'fields',
37
37
  'id',
@@ -52,6 +52,10 @@ const getAgentsList = async (params) => {
52
52
  const requestParams = applyTransform(params, [
53
53
  camelToSnake(),
54
54
  merge(getDefaultGetListResponse()),
55
+ (params) => ({
56
+ ...params,
57
+ q: params.search,
58
+ }),
55
59
  sanitize(fieldsToSend),
56
60
  ]);
57
61
 
@@ -208,7 +212,7 @@ const getAgentUsersOptions = async (params) => {
208
212
  const response = await getAgentService().searchLookupUsersAgentNotExists({
209
213
  page,
210
214
  size,
211
- search,
215
+ q: search,
212
216
  });
213
217
  const { items, next } = applyTransform(response.data, [
214
218
  snakeToCamel(),
@@ -224,18 +228,15 @@ const getAgentUsersOptions = async (params) => {
224
228
  };
225
229
 
226
230
  const getUsersStatus = async (params) => {
227
- const fieldsToSend = [
228
- 'page',
229
- 'size',
230
- 'search',
231
- 'sort',
232
- 'fields',
233
- 'not_user_id',
234
- ];
231
+ const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'not_user_id'];
235
232
  const requestParams = applyTransform(params, [
236
233
  camelToSnake(),
237
234
  merge(getDefaultGetParams()),
238
235
  starToSearch('search'),
236
+ (params) => ({
237
+ ...params,
238
+ q: params.search,
239
+ }),
239
240
  sanitize(fieldsToSend),
240
241
  ]);
241
242
 
@@ -14,15 +14,26 @@ import {
14
14
  const fieldsToSend = ['name', 'queues', 'article', 'teams', 'text'];
15
15
 
16
16
  const getQuickRepliesList = async (params) => {
17
- const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id'];
17
+ const fieldsToSend = [
18
+ 'page',
19
+ 'size',
20
+ 'q',
21
+ 'sort',
22
+ 'fields',
23
+ 'id',
24
+ 'restrictToAgent',
25
+ ];
18
26
 
19
- const { page, size, fields, sort, id, q } = applyTransform(params, [
20
- merge(getDefaultGetParams()),
21
- (params) => ({ ...params, q: params.search }),
22
- sanitize(fieldsToSend),
23
- starToSearch('q'),
24
- camelToSnake(),
25
- ]);
27
+ const { page, size, fields, sort, id, q, restrict_to_agent } = applyTransform(
28
+ params,
29
+ [
30
+ merge(getDefaultGetParams()),
31
+ (params) => ({ ...params, q: params.search }),
32
+ sanitize(fieldsToSend),
33
+ starToSearch('q'),
34
+ camelToSnake(),
35
+ ],
36
+ );
26
37
 
27
38
  try {
28
39
  const response = await getQuickRepliesService().searchQuickReplies({
@@ -32,6 +43,7 @@ const getQuickRepliesList = async (params) => {
32
43
  sort,
33
44
  id,
34
45
  q,
46
+ restrict_to_agent,
35
47
  });
36
48
  const { items, next } = applyTransform(response.data, [
37
49
  merge(getDefaultGetListResponse()),
@@ -13,4 +13,5 @@ export type SearchQuickRepliesParams = {
13
13
  fields?: string[];
14
14
  id?: number[];
15
15
  queue?: number[];
16
+ restrictToAgent?: boolean;
16
17
  };
@@ -14,6 +14,7 @@ export const searchQuickRepliesQueryParams = zod.object({
14
14
  fields: zod.array(zod.string()).optional(),
15
15
  id: zod.array(zod.number()).optional(),
16
16
  queue: zod.array(zod.number()).optional(),
17
+ restrictToAgent: zod.boolean().optional(),
17
18
  });
18
19
 
19
20
  export const searchQuickRepliesResponse = zod.object({
@@ -12,4 +12,5 @@ export type SearchQuickRepliesParams = {
12
12
  fields?: string[];
13
13
  id?: number[];
14
14
  queue?: number[];
15
+ restrictToAgent?: boolean;
15
16
  };
@@ -13,6 +13,7 @@ export declare const searchQuickRepliesQueryParams: zod.ZodObject<{
13
13
  fields: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
14
14
  id: zod.ZodOptional<zod.ZodArray<zod.ZodNumber>>;
15
15
  queue: zod.ZodOptional<zod.ZodArray<zod.ZodNumber>>;
16
+ restrictToAgent: zod.ZodOptional<zod.ZodBoolean>;
16
17
  }, zod.core.$strip>;
17
18
  export declare const searchQuickRepliesResponse: zod.ZodObject<{
18
19
  items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{