@webitel/api-services 1.0.15 → 1.0.16

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": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,3 +1,7 @@
1
+ import type {
2
+ ListCallExportsParams,
3
+ ListScreenrecordingExportsParams,
4
+ } from '@webitel/api-services/gen/models';
1
5
  import { getShallowFieldsToSendFromZodSchema } from '@webitel/api-services/gen/utils';
2
6
  import {
3
7
  CreateCallExportBody,
@@ -7,6 +11,10 @@ import {
7
11
  ListCallExportsQueryParams,
8
12
  ListScreenrecordingExportsQueryParams,
9
13
  } from '../../../gen-wire';
14
+ import type {
15
+ ListCallExportsParams as ListCallExportsWireParams,
16
+ ListScreenrecordingExportsParams as ListScreenrecordingExportsWireParams,
17
+ } from '../../../gen-wire/_models';
10
18
  import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
11
19
  import {
12
20
  applyTransform,
@@ -47,25 +55,28 @@ const createScreenrecordingExport = async ({
47
55
  }
48
56
  };
49
57
 
50
- const listScreenrecordingExports = async (params: { agentId: ApiId }) => {
58
+ const listScreenrecordingExports = async (
59
+ params: ListScreenrecordingExportsParams & {
60
+ agentId: ApiId;
61
+ },
62
+ ) => {
51
63
  const fieldsToSend = getShallowFieldsToSendFromZodSchema(
52
64
  ListScreenrecordingExportsQueryParams,
53
65
  );
54
66
 
55
- const { page, size, sort } = applyTransform(params, [
56
- merge(getDefaultGetParams()),
57
- sanitizeToWire(fieldsToSend),
58
- camelToSnake(),
59
- ]);
67
+ const requestParams = applyTransform<ListScreenrecordingExportsWireParams>(
68
+ params,
69
+ [
70
+ merge(getDefaultGetParams()),
71
+ sanitizeToWire(fieldsToSend),
72
+ camelToSnake(),
73
+ ],
74
+ );
60
75
 
61
76
  try {
62
77
  const response = await getPdfService().listScreenrecordingExports(
63
78
  String(params.agentId),
64
- {
65
- page,
66
- size,
67
- sort,
68
- },
79
+ requestParams,
69
80
  );
70
81
  const { items, next } = applyTransform(response.data, [
71
82
  merge(getDefaultGetListResponse()),
@@ -110,12 +121,16 @@ const createCallExport = async ({
110
121
  }
111
122
  };
112
123
 
113
- const listCallExports = async (params: { callId: ApiId }) => {
124
+ const listCallExports = async (
125
+ params: ListCallExportsParams & {
126
+ callId: ApiId;
127
+ },
128
+ ) => {
114
129
  const fieldsToSend = getShallowFieldsToSendFromZodSchema(
115
130
  ListCallExportsQueryParams,
116
131
  );
117
132
 
118
- const { page, size, sort } = applyTransform(params, [
133
+ const requestParams = applyTransform<ListCallExportsWireParams>(params, [
119
134
  merge(getDefaultGetParams()),
120
135
  sanitizeToWire(fieldsToSend),
121
136
  camelToSnake(),
@@ -124,11 +139,7 @@ const listCallExports = async (params: { callId: ApiId }) => {
124
139
  try {
125
140
  const response = await getPdfService().listCallExports(
126
141
  String(params.callId),
127
- {
128
- page,
129
- size,
130
- sort,
131
- },
142
+ requestParams,
132
143
  );
133
144
  const { items, next } = applyTransform(response.data, [
134
145
  merge(getDefaultGetListResponse()),