@webitel/api-services 26.12.5 → 26.12.7

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 (131) hide show
  1. package/package.json +1 -1
  2. package/src/api/clients/userTokens/userTokens.ts +9 -1
  3. package/src/gen/_models/index.ts +3 -14
  4. package/src/gen/_models/listSpacesParams.ts +8 -0
  5. package/src/gen/_models/listSpacesState.ts +15 -0
  6. package/src/gen/_models/threadManagementSearchLeftParams.ts +2 -0
  7. package/src/gen/_models/webitelImApiGatewayV1Thread.ts +8 -0
  8. package/src/gen/_models/webitelImApiGatewayV1ThreadChannelType.ts +4 -0
  9. package/src/gen/_models/webitelImApiGatewayV1ThreadQueue.ts +16 -0
  10. package/src/gen/_models/webitelKbArticle.ts +2 -0
  11. package/src/gen/_models/webitelKbInputArticle.ts +2 -0
  12. package/src/gen/_models/webitelKbInputSpace.ts +7 -3
  13. package/src/gen/_models/webitelKbSpace.ts +7 -1
  14. package/src/gen/_models/webitelKbSpaceState.ts +21 -0
  15. package/src/gen-wire/_models/index.ts +3 -14
  16. package/src/gen-wire/_models/listSpacesParams.ts +8 -0
  17. package/src/gen-wire/_models/listSpacesState.ts +15 -0
  18. package/src/gen-wire/_models/threadManagementSearchLeftParams.ts +2 -0
  19. package/src/gen-wire/_models/webitelImApiGatewayV1Thread.ts +8 -0
  20. package/src/gen-wire/_models/webitelImApiGatewayV1ThreadChannelType.ts +4 -0
  21. package/src/gen-wire/_models/webitelImApiGatewayV1ThreadQueue.ts +16 -0
  22. package/src/gen-wire/_models/webitelKbArticle.ts +2 -0
  23. package/src/gen-wire/_models/webitelKbInputArticle.ts +2 -0
  24. package/src/gen-wire/_models/webitelKbInputSpace.ts +7 -3
  25. package/src/gen-wire/_models/webitelKbSpace.ts +7 -1
  26. package/src/gen-wire/_models/webitelKbSpaceState.ts +21 -0
  27. package/src/gen-wire/articles/articles.zod.ts +58 -0
  28. package/src/gen-wire/devices/devices.ts +0 -18
  29. package/src/gen-wire/devices/devices.zod.ts +0 -44
  30. package/src/gen-wire/domains/domains.ts +0 -86
  31. package/src/gen-wire/domains/domains.zod.ts +0 -192
  32. package/src/gen-wire/email-profile-service/email-profile-service.ts +0 -13
  33. package/src/gen-wire/email-profile-service/email-profile-service.zod.ts +0 -11
  34. package/src/gen-wire/index.ts +11 -25
  35. package/src/gen-wire/spaces/spaces.zod.ts +123 -21
  36. package/src/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.zod.ts +58 -6
  37. package/src/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.zod.ts +14 -1
  38. package/src/validations/userToken/userToken.validations.ts +5 -1
  39. package/types/.tsbuildinfo +1 -1
  40. package/types/gen/_models/index.d.ts +3 -14
  41. package/types/gen/_models/listSpacesParams.d.ts +8 -0
  42. package/types/gen/_models/listSpacesState.d.ts +12 -0
  43. package/types/gen/_models/threadManagementSearchLeftParams.d.ts +2 -0
  44. package/types/gen/_models/webitelImApiGatewayV1Thread.d.ts +8 -0
  45. package/types/gen/_models/webitelImApiGatewayV1ThreadChannelType.d.ts +4 -0
  46. package/types/gen/_models/webitelImApiGatewayV1ThreadQueue.d.ts +15 -0
  47. package/types/gen/_models/webitelKbArticle.d.ts +2 -0
  48. package/types/gen/_models/webitelKbInputArticle.d.ts +2 -0
  49. package/types/gen/_models/webitelKbInputSpace.d.ts +7 -3
  50. package/types/gen/_models/webitelKbSpace.d.ts +7 -1
  51. package/types/gen/_models/webitelKbSpaceState.d.ts +18 -0
  52. package/types/gen-wire/_models/index.d.ts +3 -14
  53. package/types/gen-wire/_models/listSpacesParams.d.ts +8 -0
  54. package/types/gen-wire/_models/listSpacesState.d.ts +12 -0
  55. package/types/gen-wire/_models/threadManagementSearchLeftParams.d.ts +2 -0
  56. package/types/gen-wire/_models/webitelImApiGatewayV1Thread.d.ts +8 -0
  57. package/types/gen-wire/_models/webitelImApiGatewayV1ThreadChannelType.d.ts +4 -0
  58. package/types/gen-wire/_models/webitelImApiGatewayV1ThreadQueue.d.ts +15 -0
  59. package/types/gen-wire/_models/webitelKbArticle.d.ts +2 -0
  60. package/types/gen-wire/_models/webitelKbInputArticle.d.ts +2 -0
  61. package/types/gen-wire/_models/webitelKbInputSpace.d.ts +7 -3
  62. package/types/gen-wire/_models/webitelKbSpace.d.ts +7 -1
  63. package/types/gen-wire/_models/webitelKbSpaceState.d.ts +18 -0
  64. package/types/gen-wire/articles/articles.zod.d.ts +13 -0
  65. package/types/gen-wire/devices/devices.d.ts +1 -3
  66. package/types/gen-wire/devices/devices.zod.d.ts +0 -32
  67. package/types/gen-wire/domains/domains.d.ts +1 -13
  68. package/types/gen-wire/domains/domains.zod.d.ts +0 -160
  69. package/types/gen-wire/email-profile-service/email-profile-service.d.ts +1 -3
  70. package/types/gen-wire/email-profile-service/email-profile-service.zod.d.ts +0 -9
  71. package/types/gen-wire/index.d.ts +3 -3
  72. package/types/gen-wire/spaces/spaces.zod.d.ts +60 -3
  73. package/types/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.zod.d.ts +32 -0
  74. package/types/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.zod.d.ts +8 -0
  75. package/types/validations/userToken/userToken.validations.d.ts +5 -0
  76. package/src/gen/_models/apiCreateDomainRequest.ts +0 -13
  77. package/src/gen/_models/apiCreateDomainResponse.ts +0 -10
  78. package/src/gen/_models/apiListRegistrationsResponse.ts +0 -14
  79. package/src/gen/_models/apiRegistration.ts +0 -22
  80. package/src/gen/_models/apiSearchDomainsResponse.ts +0 -11
  81. package/src/gen/_models/apiUpdateDomainResponse.ts +0 -11
  82. package/src/gen/_models/deleteDomain2Params.ts +0 -10
  83. package/src/gen/_models/domainsUpdateDomainBody.ts +0 -11
  84. package/src/gen/_models/domainsUpdateDomainBodyBody.ts +0 -9
  85. package/src/gen/_models/domainsUpdateDomainBodyDomain.ts +0 -23
  86. package/src/gen/_models/engineTestEmailProfileResponse.ts +0 -10
  87. package/src/gen/_models/listRegistrationsParams.ts +0 -21
  88. package/src/gen/_models/readDomain2Params.ts +0 -10
  89. package/src/gen/_models/searchDomainsParams.ts +0 -20
  90. package/src/gen-wire/_models/apiCreateDomainRequest.ts +0 -13
  91. package/src/gen-wire/_models/apiCreateDomainResponse.ts +0 -10
  92. package/src/gen-wire/_models/apiListRegistrationsResponse.ts +0 -14
  93. package/src/gen-wire/_models/apiRegistration.ts +0 -22
  94. package/src/gen-wire/_models/apiSearchDomainsResponse.ts +0 -11
  95. package/src/gen-wire/_models/apiUpdateDomainResponse.ts +0 -11
  96. package/src/gen-wire/_models/deleteDomain2Params.ts +0 -10
  97. package/src/gen-wire/_models/domainsUpdateDomainBody.ts +0 -11
  98. package/src/gen-wire/_models/domainsUpdateDomainBodyBody.ts +0 -9
  99. package/src/gen-wire/_models/domainsUpdateDomainBodyDomain.ts +0 -23
  100. package/src/gen-wire/_models/engineTestEmailProfileResponse.ts +0 -10
  101. package/src/gen-wire/_models/listRegistrationsParams.ts +0 -21
  102. package/src/gen-wire/_models/readDomain2Params.ts +0 -10
  103. package/src/gen-wire/_models/searchDomainsParams.ts +0 -20
  104. package/types/gen/_models/apiCreateDomainRequest.d.ts +0 -12
  105. package/types/gen/_models/apiCreateDomainResponse.d.ts +0 -9
  106. package/types/gen/_models/apiListRegistrationsResponse.d.ts +0 -13
  107. package/types/gen/_models/apiRegistration.d.ts +0 -21
  108. package/types/gen/_models/apiSearchDomainsResponse.d.ts +0 -10
  109. package/types/gen/_models/apiUpdateDomainResponse.d.ts +0 -10
  110. package/types/gen/_models/deleteDomain2Params.d.ts +0 -9
  111. package/types/gen/_models/domainsUpdateDomainBody.d.ts +0 -10
  112. package/types/gen/_models/domainsUpdateDomainBodyBody.d.ts +0 -8
  113. package/types/gen/_models/domainsUpdateDomainBodyDomain.d.ts +0 -22
  114. package/types/gen/_models/engineTestEmailProfileResponse.d.ts +0 -9
  115. package/types/gen/_models/listRegistrationsParams.d.ts +0 -20
  116. package/types/gen/_models/readDomain2Params.d.ts +0 -9
  117. package/types/gen/_models/searchDomainsParams.d.ts +0 -19
  118. package/types/gen-wire/_models/apiCreateDomainRequest.d.ts +0 -12
  119. package/types/gen-wire/_models/apiCreateDomainResponse.d.ts +0 -9
  120. package/types/gen-wire/_models/apiListRegistrationsResponse.d.ts +0 -13
  121. package/types/gen-wire/_models/apiRegistration.d.ts +0 -21
  122. package/types/gen-wire/_models/apiSearchDomainsResponse.d.ts +0 -10
  123. package/types/gen-wire/_models/apiUpdateDomainResponse.d.ts +0 -10
  124. package/types/gen-wire/_models/deleteDomain2Params.d.ts +0 -9
  125. package/types/gen-wire/_models/domainsUpdateDomainBody.d.ts +0 -10
  126. package/types/gen-wire/_models/domainsUpdateDomainBodyBody.d.ts +0 -8
  127. package/types/gen-wire/_models/domainsUpdateDomainBodyDomain.d.ts +0 -22
  128. package/types/gen-wire/_models/engineTestEmailProfileResponse.d.ts +0 -9
  129. package/types/gen-wire/_models/listRegistrationsParams.d.ts +0 -20
  130. package/types/gen-wire/_models/readDomain2Params.d.ts +0 -9
  131. package/types/gen-wire/_models/searchDomainsParams.d.ts +0 -19
@@ -903,9 +903,6 @@ export {
903
903
  DeleteDeviceParams,
904
904
  DeleteDeviceQueryParams,
905
905
  DeleteDeviceResponse,
906
- ListRegistrationsParams,
907
- ListRegistrationsQueryParams,
908
- ListRegistrationsResponse,
909
906
  ReadDeviceParams,
910
907
  ReadDeviceQueryParams,
911
908
  ReadDeviceResponse,
@@ -989,28 +986,7 @@ export {
989
986
  updateTypeResponseFieldsItemKindDefault,
990
987
  } from './dictionaries/dictionaries.zod';
991
988
  export * from './domains/domains';
992
- export {
993
- CreateDomainBody,
994
- CreateDomainResponse,
995
- DeleteDomain2Params,
996
- DeleteDomain2QueryParams,
997
- DeleteDomain2Response,
998
- DeleteDomainQueryParams,
999
- DeleteDomainResponse,
1000
- ReadDomain2Params,
1001
- ReadDomain2QueryParams,
1002
- ReadDomain2Response,
1003
- ReadDomainQueryParams,
1004
- ReadDomainResponse,
1005
- SearchDomainsQueryParams,
1006
- SearchDomainsResponse,
1007
- UpdateDomain2Body,
1008
- UpdateDomain2Params,
1009
- UpdateDomain2Response,
1010
- UpdateDomainBody,
1011
- UpdateDomainParams,
1012
- UpdateDomainResponse,
1013
- } from './domains/domains.zod';
989
+ export * from './domains/domains.zod';
1014
990
  export * from './dynamic-conditions/dynamic-conditions';
1015
991
  export {
1016
992
  CreateConditionBody,
@@ -2239,11 +2215,14 @@ export {
2239
2215
  CreateSpaceSpacesBodyItem,
2240
2216
  CreateSpaceSpacesQueryParams,
2241
2217
  CreateSpaceSpacesResponse,
2218
+ createSpaceBodyStateDefault,
2219
+ createSpaceResponseStateDefault,
2242
2220
  DeleteSpaceParams,
2243
2221
  DeleteSpaceResponse,
2244
2222
  DeleteSpaceSpacesParams,
2245
2223
  DeleteSpaceSpacesQueryParams,
2246
2224
  DeleteSpaceSpacesResponse,
2225
+ deleteSpaceResponseStateDefault,
2247
2226
  deleteSpaceSpacesPathEtagRegExp,
2248
2227
  ListSpacesQueryParams,
2249
2228
  ListSpacesResponse,
@@ -2254,9 +2233,12 @@ export {
2254
2233
  LocateSpaceSpacesParams,
2255
2234
  LocateSpaceSpacesQueryParams,
2256
2235
  LocateSpaceSpacesResponse,
2236
+ listSpacesQueryStateDefault,
2237
+ listSpacesResponseItemsItemStateDefault,
2257
2238
  listSpacesSpacesQueryFieldsItemDefault,
2258
2239
  listSpacesSpacesQuerySortItemDefault,
2259
2240
  listSpacesSpacesQuerySortItemRegExp,
2241
+ locateSpaceResponseStateDefault,
2260
2242
  UpdateSpace2Body,
2261
2243
  UpdateSpace2Params,
2262
2244
  UpdateSpace2QueryParams,
@@ -2269,6 +2251,10 @@ export {
2269
2251
  UpdateSpaceSpacesParams,
2270
2252
  UpdateSpaceSpacesQueryParams,
2271
2253
  UpdateSpaceSpacesResponse,
2254
+ updateSpace2BodyStateDefault,
2255
+ updateSpace2ResponseStateDefault,
2256
+ updateSpaceBodyStateDefault,
2257
+ updateSpaceResponseStateDefault,
2272
2258
  } from './spaces/spaces.zod';
2273
2259
  export * from './status-conditions/status-conditions';
2274
2260
  export {
@@ -553,6 +553,8 @@ export const UpdateSpaceSpacesResponse = zod.object({
553
553
  /**
554
554
  * @summary ListSpaces returns spaces in the caller's domain.
555
555
  */
556
+ export const listSpacesQueryStateDefault = `SPACE_STATE_UNSPECIFIED`;
557
+
556
558
  export const ListSpacesQueryParams = zod.object({
557
559
  size: zod.int().optional().describe('Page size.'),
558
560
  page: zod.int().optional().describe('Page number (1-based).'),
@@ -562,8 +564,20 @@ export const ListSpacesQueryParams = zod.object({
562
564
  .array(zod.string())
563
565
  .optional()
564
566
  .describe('Set of fields to return.'),
567
+ state: zod
568
+ .enum([
569
+ 'SPACE_STATE_UNSPECIFIED',
570
+ 'SPACE_STATE_ACTIVE',
571
+ 'SPACE_STATE_INACTIVE',
572
+ ])
573
+ .default(listSpacesQueryStateDefault)
574
+ .describe(
575
+ 'Optional state filter.\n\n - SPACE_STATE_ACTIVE: Articles of the space are retrievable.\n - SPACE_STATE_INACTIVE: Articles are kept but excluded from search and suggestions.',
576
+ ),
565
577
  });
566
578
 
579
+ export const listSpacesResponseItemsItemStateDefault = `SPACE_STATE_UNSPECIFIED`;
580
+
567
581
  export const ListSpacesResponse = zod
568
582
  .object({
569
583
  items: zod
@@ -619,6 +633,14 @@ export const ListSpacesResponse = zod
619
633
  .string()
620
634
  .optional()
621
635
  .describe('Reranker model id (type=reranker).'),
636
+ state: zod
637
+ .enum([
638
+ 'SPACE_STATE_UNSPECIFIED',
639
+ 'SPACE_STATE_ACTIVE',
640
+ 'SPACE_STATE_INACTIVE',
641
+ ])
642
+ .default(listSpacesResponseItemsItemStateDefault)
643
+ .describe('Lifecycle state.'),
622
644
  target_embedding_model_id: zod
623
645
  .string()
624
646
  .optional()
@@ -651,7 +673,7 @@ export const ListSpacesResponse = zod
651
673
  .boolean()
652
674
  .optional()
653
675
  .describe(
654
- 'Whether articles in this space are embedded for vector search.',
676
+ 'Whether vector search is on. Without a model the space is searched by\ntext alone.',
655
677
  ),
656
678
  })
657
679
  .describe('Space is a knowledge-base space read model.'),
@@ -665,6 +687,8 @@ export const ListSpacesResponse = zod
665
687
  /**
666
688
  * @summary CreateSpace creates a space; language is immutable after creation.
667
689
  */
690
+ export const createSpaceBodyStateDefault = `SPACE_STATE_UNSPECIFIED`;
691
+
668
692
  export const CreateSpaceBody = zod
669
693
  .object({
670
694
  chunking_strategy: zod
@@ -676,10 +700,6 @@ export const CreateSpaceBody = zod
676
700
  .string()
677
701
  .optional()
678
702
  .describe('Active embedding model id.'),
679
- home_article_id: zod
680
- .string()
681
- .optional()
682
- .describe('Article used as the space home page.'),
683
703
  language: zod
684
704
  .string()
685
705
  .optional()
@@ -690,6 +710,16 @@ export const CreateSpaceBody = zod
690
710
  .optional()
691
711
  .describe('Whether reranking is applied.'),
692
712
  reranker_model_id: zod.string().optional().describe('Reranker model id.'),
713
+ state: zod
714
+ .enum([
715
+ 'SPACE_STATE_UNSPECIFIED',
716
+ 'SPACE_STATE_ACTIVE',
717
+ 'SPACE_STATE_INACTIVE',
718
+ ])
719
+ .default(createSpaceBodyStateDefault)
720
+ .describe(
721
+ 'Lifecycle state; unspecified keeps the current one, active on create.',
722
+ ),
693
723
  team_ids: zod
694
724
  .array(zod.string())
695
725
  .optional()
@@ -699,10 +729,14 @@ export const CreateSpaceBody = zod
699
729
  vector_search_enabled: zod
700
730
  .boolean()
701
731
  .optional()
702
- .describe('Whether articles are embedded for vector search.'),
732
+ .describe(
733
+ 'Whether vector search is on; on when omitted at creation. Without a\nmodel the space is searched by text alone.',
734
+ ),
703
735
  })
704
736
  .describe('InputSpace carries the writable fields of a space.');
705
737
 
738
+ export const createSpaceResponseStateDefault = `SPACE_STATE_UNSPECIFIED`;
739
+
706
740
  export const CreateSpaceResponse = zod
707
741
  .object({
708
742
  chunking_strategy: zod
@@ -746,6 +780,14 @@ export const CreateSpaceResponse = zod
746
780
  .string()
747
781
  .optional()
748
782
  .describe('Reranker model id (type=reranker).'),
783
+ state: zod
784
+ .enum([
785
+ 'SPACE_STATE_UNSPECIFIED',
786
+ 'SPACE_STATE_ACTIVE',
787
+ 'SPACE_STATE_INACTIVE',
788
+ ])
789
+ .default(createSpaceResponseStateDefault)
790
+ .describe('Lifecycle state.'),
749
791
  target_embedding_model_id: zod
750
792
  .string()
751
793
  .optional()
@@ -776,7 +818,7 @@ export const CreateSpaceResponse = zod
776
818
  .boolean()
777
819
  .optional()
778
820
  .describe(
779
- 'Whether articles in this space are embedded for vector search.',
821
+ 'Whether vector search is on. Without a model the space is searched by\ntext alone.',
780
822
  ),
781
823
  })
782
824
  .describe('Space is a knowledge-base space read model.');
@@ -788,6 +830,8 @@ export const DeleteSpaceParams = zod.object({
788
830
  id: zod.string().describe('Space id.'),
789
831
  });
790
832
 
833
+ export const deleteSpaceResponseStateDefault = `SPACE_STATE_UNSPECIFIED`;
834
+
791
835
  export const DeleteSpaceResponse = zod
792
836
  .object({
793
837
  chunking_strategy: zod
@@ -831,6 +875,14 @@ export const DeleteSpaceResponse = zod
831
875
  .string()
832
876
  .optional()
833
877
  .describe('Reranker model id (type=reranker).'),
878
+ state: zod
879
+ .enum([
880
+ 'SPACE_STATE_UNSPECIFIED',
881
+ 'SPACE_STATE_ACTIVE',
882
+ 'SPACE_STATE_INACTIVE',
883
+ ])
884
+ .default(deleteSpaceResponseStateDefault)
885
+ .describe('Lifecycle state.'),
834
886
  target_embedding_model_id: zod
835
887
  .string()
836
888
  .optional()
@@ -861,7 +913,7 @@ export const DeleteSpaceResponse = zod
861
913
  .boolean()
862
914
  .optional()
863
915
  .describe(
864
- 'Whether articles in this space are embedded for vector search.',
916
+ 'Whether vector search is on. Without a model the space is searched by\ntext alone.',
865
917
  ),
866
918
  })
867
919
  .describe('Space is a knowledge-base space read model.');
@@ -873,6 +925,8 @@ export const LocateSpaceParams = zod.object({
873
925
  id: zod.string().describe('Space id.'),
874
926
  });
875
927
 
928
+ export const locateSpaceResponseStateDefault = `SPACE_STATE_UNSPECIFIED`;
929
+
876
930
  export const LocateSpaceResponse = zod
877
931
  .object({
878
932
  chunking_strategy: zod
@@ -916,6 +970,14 @@ export const LocateSpaceResponse = zod
916
970
  .string()
917
971
  .optional()
918
972
  .describe('Reranker model id (type=reranker).'),
973
+ state: zod
974
+ .enum([
975
+ 'SPACE_STATE_UNSPECIFIED',
976
+ 'SPACE_STATE_ACTIVE',
977
+ 'SPACE_STATE_INACTIVE',
978
+ ])
979
+ .default(locateSpaceResponseStateDefault)
980
+ .describe('Lifecycle state.'),
919
981
  target_embedding_model_id: zod
920
982
  .string()
921
983
  .optional()
@@ -946,7 +1008,7 @@ export const LocateSpaceResponse = zod
946
1008
  .boolean()
947
1009
  .optional()
948
1010
  .describe(
949
- 'Whether articles in this space are embedded for vector search.',
1011
+ 'Whether vector search is on. Without a model the space is searched by\ntext alone.',
950
1012
  ),
951
1013
  })
952
1014
  .describe('Space is a knowledge-base space read model.');
@@ -967,6 +1029,8 @@ export const UpdateSpace2QueryParams = zod.object({
967
1029
  ),
968
1030
  });
969
1031
 
1032
+ export const updateSpace2BodyStateDefault = `SPACE_STATE_UNSPECIFIED`;
1033
+
970
1034
  export const UpdateSpace2Body = zod
971
1035
  .object({
972
1036
  chunking_strategy: zod
@@ -978,10 +1042,6 @@ export const UpdateSpace2Body = zod
978
1042
  .string()
979
1043
  .optional()
980
1044
  .describe('Active embedding model id.'),
981
- home_article_id: zod
982
- .string()
983
- .optional()
984
- .describe('Article used as the space home page.'),
985
1045
  language: zod
986
1046
  .string()
987
1047
  .optional()
@@ -992,6 +1052,16 @@ export const UpdateSpace2Body = zod
992
1052
  .optional()
993
1053
  .describe('Whether reranking is applied.'),
994
1054
  reranker_model_id: zod.string().optional().describe('Reranker model id.'),
1055
+ state: zod
1056
+ .enum([
1057
+ 'SPACE_STATE_UNSPECIFIED',
1058
+ 'SPACE_STATE_ACTIVE',
1059
+ 'SPACE_STATE_INACTIVE',
1060
+ ])
1061
+ .default(updateSpace2BodyStateDefault)
1062
+ .describe(
1063
+ 'Lifecycle state; unspecified keeps the current one, active on create.',
1064
+ ),
995
1065
  team_ids: zod
996
1066
  .array(zod.string())
997
1067
  .optional()
@@ -1001,10 +1071,14 @@ export const UpdateSpace2Body = zod
1001
1071
  vector_search_enabled: zod
1002
1072
  .boolean()
1003
1073
  .optional()
1004
- .describe('Whether articles are embedded for vector search.'),
1074
+ .describe(
1075
+ 'Whether vector search is on; on when omitted at creation. Without a\nmodel the space is searched by text alone.',
1076
+ ),
1005
1077
  })
1006
1078
  .describe('InputSpace carries the writable fields of a space.');
1007
1079
 
1080
+ export const updateSpace2ResponseStateDefault = `SPACE_STATE_UNSPECIFIED`;
1081
+
1008
1082
  export const UpdateSpace2Response = zod
1009
1083
  .object({
1010
1084
  chunking_strategy: zod
@@ -1048,6 +1122,14 @@ export const UpdateSpace2Response = zod
1048
1122
  .string()
1049
1123
  .optional()
1050
1124
  .describe('Reranker model id (type=reranker).'),
1125
+ state: zod
1126
+ .enum([
1127
+ 'SPACE_STATE_UNSPECIFIED',
1128
+ 'SPACE_STATE_ACTIVE',
1129
+ 'SPACE_STATE_INACTIVE',
1130
+ ])
1131
+ .default(updateSpace2ResponseStateDefault)
1132
+ .describe('Lifecycle state.'),
1051
1133
  target_embedding_model_id: zod
1052
1134
  .string()
1053
1135
  .optional()
@@ -1078,7 +1160,7 @@ export const UpdateSpace2Response = zod
1078
1160
  .boolean()
1079
1161
  .optional()
1080
1162
  .describe(
1081
- 'Whether articles in this space are embedded for vector search.',
1163
+ 'Whether vector search is on. Without a model the space is searched by\ntext alone.',
1082
1164
  ),
1083
1165
  })
1084
1166
  .describe('Space is a knowledge-base space read model.');
@@ -1099,6 +1181,8 @@ export const UpdateSpaceQueryParams = zod.object({
1099
1181
  ),
1100
1182
  });
1101
1183
 
1184
+ export const updateSpaceBodyStateDefault = `SPACE_STATE_UNSPECIFIED`;
1185
+
1102
1186
  export const UpdateSpaceBody = zod
1103
1187
  .object({
1104
1188
  chunking_strategy: zod
@@ -1110,10 +1194,6 @@ export const UpdateSpaceBody = zod
1110
1194
  .string()
1111
1195
  .optional()
1112
1196
  .describe('Active embedding model id.'),
1113
- home_article_id: zod
1114
- .string()
1115
- .optional()
1116
- .describe('Article used as the space home page.'),
1117
1197
  language: zod
1118
1198
  .string()
1119
1199
  .optional()
@@ -1124,6 +1204,16 @@ export const UpdateSpaceBody = zod
1124
1204
  .optional()
1125
1205
  .describe('Whether reranking is applied.'),
1126
1206
  reranker_model_id: zod.string().optional().describe('Reranker model id.'),
1207
+ state: zod
1208
+ .enum([
1209
+ 'SPACE_STATE_UNSPECIFIED',
1210
+ 'SPACE_STATE_ACTIVE',
1211
+ 'SPACE_STATE_INACTIVE',
1212
+ ])
1213
+ .default(updateSpaceBodyStateDefault)
1214
+ .describe(
1215
+ 'Lifecycle state; unspecified keeps the current one, active on create.',
1216
+ ),
1127
1217
  team_ids: zod
1128
1218
  .array(zod.string())
1129
1219
  .optional()
@@ -1133,10 +1223,14 @@ export const UpdateSpaceBody = zod
1133
1223
  vector_search_enabled: zod
1134
1224
  .boolean()
1135
1225
  .optional()
1136
- .describe('Whether articles are embedded for vector search.'),
1226
+ .describe(
1227
+ 'Whether vector search is on; on when omitted at creation. Without a\nmodel the space is searched by text alone.',
1228
+ ),
1137
1229
  })
1138
1230
  .describe('InputSpace carries the writable fields of a space.');
1139
1231
 
1232
+ export const updateSpaceResponseStateDefault = `SPACE_STATE_UNSPECIFIED`;
1233
+
1140
1234
  export const UpdateSpaceResponse = zod
1141
1235
  .object({
1142
1236
  chunking_strategy: zod
@@ -1180,6 +1274,14 @@ export const UpdateSpaceResponse = zod
1180
1274
  .string()
1181
1275
  .optional()
1182
1276
  .describe('Reranker model id (type=reranker).'),
1277
+ state: zod
1278
+ .enum([
1279
+ 'SPACE_STATE_UNSPECIFIED',
1280
+ 'SPACE_STATE_ACTIVE',
1281
+ 'SPACE_STATE_INACTIVE',
1282
+ ])
1283
+ .default(updateSpaceResponseStateDefault)
1284
+ .describe('Lifecycle state.'),
1183
1285
  target_embedding_model_id: zod
1184
1286
  .string()
1185
1287
  .optional()
@@ -1210,7 +1312,7 @@ export const UpdateSpaceResponse = zod
1210
1312
  .boolean()
1211
1313
  .optional()
1212
1314
  .describe(
1213
- 'Whether articles in this space are embedded for vector search.',
1315
+ 'Whether vector search is on. Without a model the space is searched by\ntext alone.',
1214
1316
  ),
1215
1317
  })
1216
1318
  .describe('Space is a knowledge-base space read model.');
@@ -137,6 +137,10 @@ export const ThreadManagementSearchResponse = zod
137
137
  'THREAD_CHANNEL_TYPE_PORTAL',
138
138
  'THREAD_CHANNEL_TYPE_WIDGET',
139
139
  'THREAD_CHANNEL_TYPE_CUSTOM',
140
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_BOT',
141
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_APP',
142
+ 'THREAD_CHANNEL_TYPE_VIBER',
143
+ 'THREAD_CHANNEL_TYPE_INSTAGRAM',
140
144
  ])
141
145
  .default(
142
146
  threadManagementSearchResponseItemsItemChannelTypeDefault,
@@ -147,7 +151,7 @@ export const ThreadManagementSearchResponse = zod
147
151
  })
148
152
  .optional()
149
153
  .describe(
150
- 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).',
154
+ 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).\nSearch sorts by channel.name with the sort-only key "channel_name"\n(+channel_name / -channel_name); threads without a gate name sort last.',
151
155
  ),
152
156
  created_at: zod
153
157
  .string()
@@ -1502,6 +1506,15 @@ export const ThreadManagementSearchResponse = zod
1502
1506
  )
1503
1507
  .optional()
1504
1508
  .describe('Detailed member information.'),
1509
+ queue: zod
1510
+ .object({
1511
+ id: zod.string().optional().describe('Queue id.'),
1512
+ name: zod.string().optional().describe('Queue display name.'),
1513
+ })
1514
+ .optional()
1515
+ .describe(
1516
+ 'Queue through which the calling participant received the thread. Set by Search; unset when unknown.\nSearch sorts by queue.name with the sort-only key "queue_name".',
1517
+ ),
1505
1518
  read_states: zod
1506
1519
  .array(
1507
1520
  zod
@@ -1917,13 +1930,17 @@ export const ThreadManagementCreateResponse = zod
1917
1930
  'THREAD_CHANNEL_TYPE_PORTAL',
1918
1931
  'THREAD_CHANNEL_TYPE_WIDGET',
1919
1932
  'THREAD_CHANNEL_TYPE_CUSTOM',
1933
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_BOT',
1934
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_APP',
1935
+ 'THREAD_CHANNEL_TYPE_VIBER',
1936
+ 'THREAD_CHANNEL_TYPE_INSTAGRAM',
1920
1937
  ])
1921
1938
  .default(threadManagementCreateResponseThreadChannelTypeDefault)
1922
1939
  .describe('Channel kind; drives the logo shown to the operator.'),
1923
1940
  })
1924
1941
  .optional()
1925
1942
  .describe(
1926
- 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).',
1943
+ 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).\nSearch sorts by channel.name with the sort-only key "channel_name"\n(+channel_name / -channel_name); threads without a gate name sort last.',
1927
1944
  ),
1928
1945
  created_at: zod
1929
1946
  .string()
@@ -3256,6 +3273,15 @@ export const ThreadManagementCreateResponse = zod
3256
3273
  )
3257
3274
  .optional()
3258
3275
  .describe('Detailed member information.'),
3276
+ queue: zod
3277
+ .object({
3278
+ id: zod.string().optional().describe('Queue id.'),
3279
+ name: zod.string().optional().describe('Queue display name.'),
3280
+ })
3281
+ .optional()
3282
+ .describe(
3283
+ 'Queue through which the calling participant received the thread. Set by Search; unset when unknown.\nSearch sorts by queue.name with the sort-only key "queue_name".',
3284
+ ),
3259
3285
  read_states: zod
3260
3286
  .array(
3261
3287
  zod
@@ -3640,7 +3666,7 @@ export const ThreadManagementSearchLeftQueryParams = zod.object({
3640
3666
  .array(zod.string())
3641
3667
  .optional()
3642
3668
  .describe(
3643
- 'List of fields that should be returned in the response.\nIf empty, a default set of fields is returned.\nUsed for response optimization.',
3669
+ 'List of fields that should be returned in the response.\nIf empty, a default set of fields is returned.\nUsed for response optimization.\nThe default set includes "channel" and "queue".',
3644
3670
  ),
3645
3671
  types: zod
3646
3672
  .array(
@@ -3659,7 +3685,7 @@ export const ThreadManagementSearchLeftQueryParams = zod.object({
3659
3685
  .string()
3660
3686
  .optional()
3661
3687
  .describe(
3662
- 'Sorting field.\nOptional "+" or "-" prefix indicates ascending or descending order.\nExample: "-created_at", "subject"',
3688
+ 'Sorting field.\nOptional "+" or "-" prefix indicates ascending or descending order.\nExample: "-created_at", "subject"\nSort-only keys: "channel_name", "queue_name" (threads without a value sort last).',
3663
3689
  ),
3664
3690
  size: zod
3665
3691
  .int()
@@ -3730,6 +3756,10 @@ export const ThreadManagementSearchLeftResponse = zod.object({
3730
3756
  'THREAD_CHANNEL_TYPE_PORTAL',
3731
3757
  'THREAD_CHANNEL_TYPE_WIDGET',
3732
3758
  'THREAD_CHANNEL_TYPE_CUSTOM',
3759
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_BOT',
3760
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_APP',
3761
+ 'THREAD_CHANNEL_TYPE_VIBER',
3762
+ 'THREAD_CHANNEL_TYPE_INSTAGRAM',
3733
3763
  ])
3734
3764
  .default(
3735
3765
  threadManagementSearchLeftResponseItemsItemChannelTypeDefault,
@@ -3740,7 +3770,7 @@ export const ThreadManagementSearchLeftResponse = zod.object({
3740
3770
  })
3741
3771
  .optional()
3742
3772
  .describe(
3743
- 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).',
3773
+ 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).\nSearch sorts by channel.name with the sort-only key "channel_name"\n(+channel_name / -channel_name); threads without a gate name sort last.',
3744
3774
  ),
3745
3775
  created_at: zod
3746
3776
  .string()
@@ -5082,6 +5112,15 @@ export const ThreadManagementSearchLeftResponse = zod.object({
5082
5112
  )
5083
5113
  .optional()
5084
5114
  .describe('Detailed member information.'),
5115
+ queue: zod
5116
+ .object({
5117
+ id: zod.string().optional().describe('Queue id.'),
5118
+ name: zod.string().optional().describe('Queue display name.'),
5119
+ })
5120
+ .optional()
5121
+ .describe(
5122
+ 'Queue through which the calling participant received the thread. Set by Search; unset when unknown.\nSearch sorts by queue.name with the sort-only key "queue_name".',
5123
+ ),
5085
5124
  read_states: zod
5086
5125
  .array(
5087
5126
  zod
@@ -5488,13 +5527,17 @@ export const ThreadManagementGetResponse = zod
5488
5527
  'THREAD_CHANNEL_TYPE_PORTAL',
5489
5528
  'THREAD_CHANNEL_TYPE_WIDGET',
5490
5529
  'THREAD_CHANNEL_TYPE_CUSTOM',
5530
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_BOT',
5531
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_APP',
5532
+ 'THREAD_CHANNEL_TYPE_VIBER',
5533
+ 'THREAD_CHANNEL_TYPE_INSTAGRAM',
5491
5534
  ])
5492
5535
  .default(threadManagementGetResponseChannelTypeDefault)
5493
5536
  .describe('Channel kind; drives the logo shown to the operator.'),
5494
5537
  })
5495
5538
  .optional()
5496
5539
  .describe(
5497
- 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).',
5540
+ 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).\nSearch sorts by channel.name with the sort-only key "channel_name"\n(+channel_name / -channel_name); threads without a gate name sort last.',
5498
5541
  ),
5499
5542
  created_at: zod
5500
5543
  .string()
@@ -6762,6 +6805,15 @@ export const ThreadManagementGetResponse = zod
6762
6805
  )
6763
6806
  .optional()
6764
6807
  .describe('Detailed member information.'),
6808
+ queue: zod
6809
+ .object({
6810
+ id: zod.string().optional().describe('Queue id.'),
6811
+ name: zod.string().optional().describe('Queue display name.'),
6812
+ })
6813
+ .optional()
6814
+ .describe(
6815
+ 'Queue through which the calling participant received the thread. Set by Search; unset when unknown.\nSearch sorts by queue.name with the sort-only key "queue_name".',
6816
+ ),
6765
6817
  read_states: zod
6766
6818
  .array(
6767
6819
  zod
@@ -258,6 +258,10 @@ export const UpdatesGetUpdatesResponse = zod.object({
258
258
  'THREAD_CHANNEL_TYPE_PORTAL',
259
259
  'THREAD_CHANNEL_TYPE_WIDGET',
260
260
  'THREAD_CHANNEL_TYPE_CUSTOM',
261
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_BOT',
262
+ 'THREAD_CHANNEL_TYPE_TELEGRAM_APP',
263
+ 'THREAD_CHANNEL_TYPE_VIBER',
264
+ 'THREAD_CHANNEL_TYPE_INSTAGRAM',
261
265
  ])
262
266
  .default(
263
267
  updatesGetUpdatesResponseThreadsItemDialogChannelTypeDefault,
@@ -268,7 +272,7 @@ export const UpdatesGetUpdatesResponse = zod.object({
268
272
  })
269
273
  .optional()
270
274
  .describe(
271
- 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).',
275
+ 'Channel the external participant reaches the thread through: a provider\ngate (WhatsApp, Facebook, Viber BM, custom) or a portal / widget\napplication. Unset when it cannot be resolved (e.g. an internal thread).\nSearch sorts by channel.name with the sort-only key "channel_name"\n(+channel_name / -channel_name); threads without a gate name sort last.',
272
276
  ),
273
277
  created_at: zod
274
278
  .string()
@@ -1623,6 +1627,15 @@ export const UpdatesGetUpdatesResponse = zod.object({
1623
1627
  )
1624
1628
  .optional()
1625
1629
  .describe('Detailed member information.'),
1630
+ queue: zod
1631
+ .object({
1632
+ id: zod.string().optional().describe('Queue id.'),
1633
+ name: zod.string().optional().describe('Queue display name.'),
1634
+ })
1635
+ .optional()
1636
+ .describe(
1637
+ 'Queue through which the calling participant received the thread. Set by Search; unset when unknown.\nSearch sorts by queue.name with the sort-only key "queue_name".',
1638
+ ),
1626
1639
  read_states: zod
1627
1640
  .array(
1628
1641
  zod
@@ -1,5 +1,9 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ import { flexibleLookupSchema } from '../_shared/lookup.validations';
4
+
3
5
  export const userTokenSchema = z.object({
4
- usage: z.string().default(''),
6
+ usage: z.string().min(1).default(''),
7
+ expiryDays: z.number().int().min(0).nullish(),
8
+ notifyUsers: z.array(flexibleLookupSchema).optional().default([]),
5
9
  });