@webitel/api-services 26.12.8 → 26.12.10

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.
Files changed (39) hide show
  1. package/package.json +1 -1
  2. package/src/gen/_models/engineHistoryCall.ts +1 -0
  3. package/src/gen/_models/engineSystemSettingName.ts +2 -0
  4. package/src/gen/_models/searchSystemSettingNameItem.ts +2 -0
  5. package/src/gen/_models/webitelKbInputArticle.ts +1 -1
  6. package/src/gen/_models/webitelKbInputSpace.ts +1 -1
  7. package/src/gen/_models/webitelKbResolveRequest.ts +1 -1
  8. package/src/gen/_models/webitelKbVersionsRestoreVersionBody.ts +1 -1
  9. package/src/gen-wire/_models/engineHistoryCall.ts +1 -0
  10. package/src/gen-wire/_models/engineSystemSettingName.ts +2 -0
  11. package/src/gen-wire/_models/searchSystemSettingNameItem.ts +2 -0
  12. package/src/gen-wire/_models/webitelKbInputArticle.ts +1 -1
  13. package/src/gen-wire/_models/webitelKbInputSpace.ts +1 -1
  14. package/src/gen-wire/_models/webitelKbResolveRequest.ts +1 -1
  15. package/src/gen-wire/_models/webitelKbVersionsRestoreVersionBody.ts +1 -1
  16. package/src/gen-wire/articles/articles.zod.ts +12 -3
  17. package/src/gen-wire/call-service/call-service.zod.ts +3 -0
  18. package/src/gen-wire/retrieval/retrieval.zod.ts +4 -1
  19. package/src/gen-wire/spaces/spaces.zod.ts +12 -3
  20. package/src/gen-wire/system-setting-service/system-setting-service.zod.ts +16 -0
  21. package/src/gen-wire/versions/versions.zod.ts +1 -1
  22. package/src/utils/gen/index.ts +17 -7
  23. package/types/.tsbuildinfo +1 -1
  24. package/types/gen/_models/engineHistoryCall.d.ts +1 -0
  25. package/types/gen/_models/engineSystemSettingName.d.ts +2 -0
  26. package/types/gen/_models/searchSystemSettingNameItem.d.ts +2 -0
  27. package/types/gen/_models/webitelKbInputArticle.d.ts +1 -1
  28. package/types/gen/_models/webitelKbInputSpace.d.ts +1 -1
  29. package/types/gen/_models/webitelKbResolveRequest.d.ts +1 -1
  30. package/types/gen/_models/webitelKbVersionsRestoreVersionBody.d.ts +1 -1
  31. package/types/gen-wire/_models/engineHistoryCall.d.ts +1 -0
  32. package/types/gen-wire/_models/engineSystemSettingName.d.ts +2 -0
  33. package/types/gen-wire/_models/searchSystemSettingNameItem.d.ts +2 -0
  34. package/types/gen-wire/_models/webitelKbInputArticle.d.ts +1 -1
  35. package/types/gen-wire/_models/webitelKbInputSpace.d.ts +1 -1
  36. package/types/gen-wire/_models/webitelKbResolveRequest.d.ts +1 -1
  37. package/types/gen-wire/_models/webitelKbVersionsRestoreVersionBody.d.ts +1 -1
  38. package/types/gen-wire/call-service/call-service.zod.d.ts +3 -0
  39. package/types/gen-wire/system-setting-service/system-setting-service.zod.d.ts +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/api-services",
3
- "version": "26.12.8",
3
+ "version": "26.12.10",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,6 +55,7 @@ export interface EngineHistoryCall {
55
55
  hangupDisposition?: string;
56
56
  hangupPhrase?: string;
57
57
  hasChildren?: boolean;
58
+ hideNumber?: boolean;
58
59
  hold?: EngineCallHold[];
59
60
  holdSec?: number;
60
61
  id?: string;
@@ -49,4 +49,6 @@ export const EngineSystemSettingName = {
49
49
  DefaultMembersFilter: 'default_members_filter',
50
50
  SelfAssignedCallSoundNotification: 'self_assigned_call_sound_notification',
51
51
  RecordAllCalls: 'record_all_calls',
52
+ MaxLoginAttempts: 'max_login_attempts',
53
+ BlockLoginTime: 'block_login_time',
52
54
  } as const;
@@ -49,4 +49,6 @@ export const SearchSystemSettingNameItem = {
49
49
  DefaultMembersFilter: 'default_members_filter',
50
50
  SelfAssignedCallSoundNotification: 'self_assigned_call_sound_notification',
51
51
  RecordAllCalls: 'record_all_calls',
52
+ MaxLoginAttempts: 'max_login_attempts',
53
+ BlockLoginTime: 'block_login_time',
52
54
  } as const;
@@ -24,7 +24,7 @@ export interface WebitelKbInputArticle {
24
24
  spaceId?: string;
25
25
  /** Lifecycle state. */
26
26
  state?: WebitelKbArticleState;
27
- /** Article subject. */
27
+ /** Article subject, at most 255 characters. */
28
28
  subject?: string;
29
29
  /** Article type. */
30
30
  type?: WebitelKbArticleType;
@@ -18,7 +18,7 @@ export interface WebitelKbInputSpace {
18
18
  embeddingModelId?: string;
19
19
  /** Space language; immutable after creation. */
20
20
  language?: string;
21
- /** Human-readable name. */
21
+ /** Human-readable name, at most 255 characters. */
22
22
  name?: string;
23
23
  /** Whether reranking is applied. */
24
24
  rerankEnabled?: boolean;
@@ -9,7 +9,7 @@
9
9
  * ResolveRequest selects articles by id within the given spaces.
10
10
  */
11
11
  export interface WebitelKbResolveRequest {
12
- /** Article ids to resolve. */
12
+ /** Article ids to resolve, at most 5000. */
13
13
  ids?: string[];
14
14
  /** Spaces the ids are expected in (RBAC scope). */
15
15
  spaceIds?: string[];
@@ -9,6 +9,6 @@
9
9
  * RestoreVersionRequest selects a version to restore.
10
10
  */
11
11
  export interface WebitelKbVersionsRestoreVersionBody {
12
- /** Optional notes for the new version. */
12
+ /** Optional notes for the new version, at most 50 characters. */
13
13
  notes?: string;
14
14
  }
@@ -55,6 +55,7 @@ export interface EngineHistoryCall {
55
55
  hangup_disposition?: string;
56
56
  hangup_phrase?: string;
57
57
  has_children?: boolean;
58
+ hide_number?: boolean;
58
59
  hold?: EngineCallHold[];
59
60
  hold_sec?: number;
60
61
  id?: string;
@@ -49,4 +49,6 @@ export const EngineSystemSettingName = {
49
49
  DefaultMembersFilter: 'default_members_filter',
50
50
  SelfAssignedCallSoundNotification: 'self_assigned_call_sound_notification',
51
51
  RecordAllCalls: 'record_all_calls',
52
+ MaxLoginAttempts: 'max_login_attempts',
53
+ BlockLoginTime: 'block_login_time',
52
54
  } as const;
@@ -49,4 +49,6 @@ export const SearchSystemSettingNameItem = {
49
49
  DefaultMembersFilter: 'default_members_filter',
50
50
  SelfAssignedCallSoundNotification: 'self_assigned_call_sound_notification',
51
51
  RecordAllCalls: 'record_all_calls',
52
+ MaxLoginAttempts: 'max_login_attempts',
53
+ BlockLoginTime: 'block_login_time',
52
54
  } as const;
@@ -24,7 +24,7 @@ export interface WebitelKbInputArticle {
24
24
  space_id?: string;
25
25
  /** Lifecycle state. */
26
26
  state?: WebitelKbArticleState;
27
- /** Article subject. */
27
+ /** Article subject, at most 255 characters. */
28
28
  subject?: string;
29
29
  /** Article type. */
30
30
  type?: WebitelKbArticleType;
@@ -18,7 +18,7 @@ export interface WebitelKbInputSpace {
18
18
  embedding_model_id?: string;
19
19
  /** Space language; immutable after creation. */
20
20
  language?: string;
21
- /** Human-readable name. */
21
+ /** Human-readable name, at most 255 characters. */
22
22
  name?: string;
23
23
  /** Whether reranking is applied. */
24
24
  rerank_enabled?: boolean;
@@ -9,7 +9,7 @@
9
9
  * ResolveRequest selects articles by id within the given spaces.
10
10
  */
11
11
  export interface WebitelKbResolveRequest {
12
- /** Article ids to resolve. */
12
+ /** Article ids to resolve, at most 5000. */
13
13
  ids?: string[];
14
14
  /** Spaces the ids are expected in (RBAC scope). */
15
15
  space_ids?: string[];
@@ -9,6 +9,6 @@
9
9
  * RestoreVersionRequest selects a version to restore.
10
10
  */
11
11
  export interface WebitelKbVersionsRestoreVersionBody {
12
- /** Optional notes for the new version. */
12
+ /** Optional notes for the new version, at most 50 characters. */
13
13
  notes?: string;
14
14
  }
@@ -1186,7 +1186,10 @@ export const CreateArticleBody = zod
1186
1186
  ])
1187
1187
  .default(createArticleBodyStateDefault)
1188
1188
  .describe('Lifecycle state.'),
1189
- subject: zod.string().optional().describe('Article subject.'),
1189
+ subject: zod
1190
+ .string()
1191
+ .optional()
1192
+ .describe('Article subject, at most 255 characters.'),
1190
1193
  type: zod
1191
1194
  .enum([
1192
1195
  'ARTICLE_TYPE_UNSPECIFIED',
@@ -1674,7 +1677,10 @@ export const UpdateArticle2Body = zod
1674
1677
  ])
1675
1678
  .default(updateArticle2BodyStateDefault)
1676
1679
  .describe('Lifecycle state.'),
1677
- subject: zod.string().optional().describe('Article subject.'),
1680
+ subject: zod
1681
+ .string()
1682
+ .optional()
1683
+ .describe('Article subject, at most 255 characters.'),
1678
1684
  type: zod
1679
1685
  .enum([
1680
1686
  'ARTICLE_TYPE_UNSPECIFIED',
@@ -1871,7 +1877,10 @@ export const UpdateArticleBody = zod
1871
1877
  ])
1872
1878
  .default(updateArticleBodyStateDefault)
1873
1879
  .describe('Lifecycle state.'),
1874
- subject: zod.string().optional().describe('Article subject.'),
1880
+ subject: zod
1881
+ .string()
1882
+ .optional()
1883
+ .describe('Article subject, at most 255 characters.'),
1875
1884
  type: zod
1876
1885
  .enum([
1877
1886
  'ARTICLE_TYPE_UNSPECIFIED',
@@ -668,6 +668,7 @@ export const SearchHistoryCallResponse = zod.object({
668
668
  hangup_disposition: zod.string().optional(),
669
669
  hangup_phrase: zod.string().optional(),
670
670
  has_children: zod.boolean().optional(),
671
+ hide_number: zod.boolean().optional(),
671
672
  hold: zod
672
673
  .array(
673
674
  zod.object({
@@ -1089,6 +1090,7 @@ export const SearchHistoryCallPostResponse = zod.object({
1089
1090
  hangup_disposition: zod.string().optional(),
1090
1091
  hangup_phrase: zod.string().optional(),
1091
1092
  has_children: zod.boolean().optional(),
1093
+ hide_number: zod.boolean().optional(),
1092
1094
  hold: zod
1093
1095
  .array(
1094
1096
  zod.object({
@@ -1615,6 +1617,7 @@ export const PatchHistoryCallResponse = zod.object({
1615
1617
  hangup_disposition: zod.string().optional(),
1616
1618
  hangup_phrase: zod.string().optional(),
1617
1619
  has_children: zod.boolean().optional(),
1620
+ hide_number: zod.boolean().optional(),
1618
1621
  hold: zod
1619
1622
  .array(
1620
1623
  zod.object({
@@ -11,7 +11,10 @@ import * as zod from 'zod';
11
11
  */
12
12
  export const ResolveBody = zod
13
13
  .object({
14
- ids: zod.array(zod.string()).optional().describe('Article ids to resolve.'),
14
+ ids: zod
15
+ .array(zod.string())
16
+ .optional()
17
+ .describe('Article ids to resolve, at most 5000.'),
15
18
  space_ids: zod
16
19
  .array(zod.string())
17
20
  .optional()
@@ -704,7 +704,10 @@ export const CreateSpaceBody = zod
704
704
  .string()
705
705
  .optional()
706
706
  .describe('Space language; immutable after creation.'),
707
- name: zod.string().optional().describe('Human-readable name.'),
707
+ name: zod
708
+ .string()
709
+ .optional()
710
+ .describe('Human-readable name, at most 255 characters.'),
708
711
  rerank_enabled: zod
709
712
  .boolean()
710
713
  .optional()
@@ -1046,7 +1049,10 @@ export const UpdateSpace2Body = zod
1046
1049
  .string()
1047
1050
  .optional()
1048
1051
  .describe('Space language; immutable after creation.'),
1049
- name: zod.string().optional().describe('Human-readable name.'),
1052
+ name: zod
1053
+ .string()
1054
+ .optional()
1055
+ .describe('Human-readable name, at most 255 characters.'),
1050
1056
  rerank_enabled: zod
1051
1057
  .boolean()
1052
1058
  .optional()
@@ -1198,7 +1204,10 @@ export const UpdateSpaceBody = zod
1198
1204
  .string()
1199
1205
  .optional()
1200
1206
  .describe('Space language; immutable after creation.'),
1201
- name: zod.string().optional().describe('Human-readable name.'),
1207
+ name: zod
1208
+ .string()
1209
+ .optional()
1210
+ .describe('Human-readable name, at most 255 characters.'),
1202
1211
  rerank_enabled: zod
1203
1212
  .boolean()
1204
1213
  .optional()
@@ -55,6 +55,8 @@ export const SearchSystemSettingQueryParams = zod.object({
55
55
  'default_members_filter',
56
56
  'self_assigned_call_sound_notification',
57
57
  'record_all_calls',
58
+ 'max_login_attempts',
59
+ 'block_login_time',
58
60
  ]),
59
61
  )
60
62
  .optional()
@@ -110,6 +112,8 @@ export const SearchSystemSettingResponse = zod.object({
110
112
  'default_members_filter',
111
113
  'self_assigned_call_sound_notification',
112
114
  'record_all_calls',
115
+ 'max_login_attempts',
116
+ 'block_login_time',
113
117
  ])
114
118
  .default(searchSystemSettingResponseItemsItemNameDefault),
115
119
  }),
@@ -163,6 +167,8 @@ export const CreateSystemSettingBody = zod.object({
163
167
  'default_members_filter',
164
168
  'self_assigned_call_sound_notification',
165
169
  'record_all_calls',
170
+ 'max_login_attempts',
171
+ 'block_login_time',
166
172
  ])
167
173
  .default(createSystemSettingBodyNameDefault),
168
174
  });
@@ -213,6 +219,8 @@ export const CreateSystemSettingResponse = zod.object({
213
219
  'default_members_filter',
214
220
  'self_assigned_call_sound_notification',
215
221
  'record_all_calls',
222
+ 'max_login_attempts',
223
+ 'block_login_time',
216
224
  ])
217
225
  .default(createSystemSettingResponseNameDefault),
218
226
  });
@@ -286,6 +294,8 @@ export const DeleteSystemSettingResponse = zod.object({
286
294
  'default_members_filter',
287
295
  'self_assigned_call_sound_notification',
288
296
  'record_all_calls',
297
+ 'max_login_attempts',
298
+ 'block_login_time',
289
299
  ])
290
300
  .default(deleteSystemSettingResponseNameDefault),
291
301
  });
@@ -340,6 +350,8 @@ export const ReadSystemSettingResponse = zod.object({
340
350
  'default_members_filter',
341
351
  'self_assigned_call_sound_notification',
342
352
  'record_all_calls',
353
+ 'max_login_attempts',
354
+ 'block_login_time',
343
355
  ])
344
356
  .default(readSystemSettingResponseNameDefault),
345
357
  });
@@ -398,6 +410,8 @@ export const PatchSystemSettingResponse = zod.object({
398
410
  'default_members_filter',
399
411
  'self_assigned_call_sound_notification',
400
412
  'record_all_calls',
413
+ 'max_login_attempts',
414
+ 'block_login_time',
401
415
  ])
402
416
  .default(patchSystemSettingResponseNameDefault),
403
417
  });
@@ -454,6 +468,8 @@ export const UpdateSystemSettingResponse = zod.object({
454
468
  'default_members_filter',
455
469
  'self_assigned_call_sound_notification',
456
470
  'record_all_calls',
471
+ 'max_login_attempts',
472
+ 'block_login_time',
457
473
  ])
458
474
  .default(updateSystemSettingResponseNameDefault),
459
475
  });
@@ -141,7 +141,7 @@ export const RestoreVersionBody = zod
141
141
  notes: zod
142
142
  .string()
143
143
  .optional()
144
- .describe('Optional notes for the new version.'),
144
+ .describe('Optional notes for the new version, at most 50 characters.'),
145
145
  })
146
146
  .describe('RestoreVersionRequest selects a version to restore.');
147
147
 
@@ -57,11 +57,21 @@ export const getDefaultsFromZodSchema = (
57
57
  schema: z.ZodType,
58
58
  value?: unknown,
59
59
  ): unknown => {
60
- return (
61
- schema
62
- /* zod validates passed value and throws err before returning defaults,
63
- so we should skip error throwing and return value instead */
64
- .catch(({ value: validatedValue }: { value: unknown }) => validatedValue)
65
- .parse(value)
66
- );
60
+ const result = schema.safeParse(value);
61
+ if (result.success) return result.data;
62
+ if (!(schema instanceof z.ZodObject)) return value;
63
+
64
+ // the value is invalid (e.g. a new card with empty required fields),
65
+ // so take each field's own default and keep what is already filled in
66
+ const defaults: Record<string, unknown> = {};
67
+ for (const [key, fieldSchema] of Object.entries(schema.shape)) {
68
+ const fieldResult = (fieldSchema as z.ZodType).safeParse(undefined);
69
+ if (fieldResult.success && fieldResult.data !== undefined) {
70
+ defaults[key] = fieldResult.data;
71
+ }
72
+ }
73
+ return {
74
+ ...defaults,
75
+ ...(value as object),
76
+ };
67
77
  };