@webitel/api-services 26.12.21 → 26.12.23

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 (103) hide show
  1. package/package.json +1 -1
  2. package/src/api/clients/_shared/appUrls.ts +11 -0
  3. package/src/api/clients/chatGateways/__tests__/chatGatewayChannels.spec.ts +84 -0
  4. package/src/api/clients/chatGateways/__tests__/chatGateways.spec.ts +115 -0
  5. package/src/api/clients/chatGateways/chatGatewayChannels.ts +162 -0
  6. package/src/api/clients/chatGateways/chatGateways.ts +66 -25
  7. package/src/api/clients/chatGateways/defaults/chatGatewayProviderDefaults.ts +91 -0
  8. package/src/api/clients/chatGateways/defaults/defaultChatGateway.ts +3 -1
  9. package/src/api/clients/chatGateways/defaults/webChatGateway.ts +8 -5
  10. package/src/api/clients/cognitiveProfiles/cognitiveProfiles.ts +8 -32
  11. package/src/api/clients/cognitiveProfiles/defaults/cognitiveProfileDefaults.ts +39 -0
  12. package/src/api/clients/emailProfiles/emailProfiles.ts +6 -19
  13. package/src/api/clients/gateways/__tests__/gateways.spec.ts +138 -0
  14. package/src/api/clients/gateways/gateways.ts +60 -52
  15. package/src/api/clients/importTemplates/importTemplates.ts +36 -21
  16. package/src/api/clients/index.ts +2 -0
  17. package/src/api/clients/storagePolicies/storagePolicies.ts +24 -36
  18. package/src/api/clients/triggers/triggerJobs.ts +22 -12
  19. package/src/api/clients/triggers/triggers.ts +12 -37
  20. package/src/enums/ChatGatewayChannelSetup/ChatGatewayChannelSetup.ts +10 -0
  21. package/src/enums/GatewayIpAclProtocol/GatewayIpAclProtocol.ts +8 -0
  22. package/src/enums/GatewayRegisterState/GatewayRegisterState.ts +17 -0
  23. package/src/enums/StorageType/StorageType.ts +10 -0
  24. package/src/enums/WebchatAlternativeChannel/WebchatAlternativeChannel.ts +15 -0
  25. package/src/enums/index.ts +10 -0
  26. package/src/locale/en/en.ts +8 -0
  27. package/src/locale/es/es.ts +8 -0
  28. package/src/locale/kz/kz.ts +8 -0
  29. package/src/locale/pl/pl.ts +8 -0
  30. package/src/locale/ro/ro.ts +8 -0
  31. package/src/locale/ru/ru.ts +8 -0
  32. package/src/locale/uk/uk.ts +8 -0
  33. package/src/locale/uz/uz.ts +8 -0
  34. package/src/locale/vi/vi.ts +8 -0
  35. package/src/scripts/convertDuration/__tests__/convertDurationWithMilliseconds.spec.ts +19 -0
  36. package/src/scripts/convertDuration/convertDurationWithMilliseconds.ts +18 -0
  37. package/src/scripts/index.ts +2 -0
  38. package/src/validations/_shared/ip.validations.ts +10 -0
  39. package/src/validations/backendProfile/__tests__/backendProfile.validations.spec.ts +104 -0
  40. package/src/validations/backendProfile/backendProfile.validations.ts +79 -0
  41. package/src/validations/chatGateway/__tests__/chatGateway.validations.spec.ts +189 -0
  42. package/src/validations/chatGateway/chatGateway.validations.ts +452 -0
  43. package/src/validations/cognitiveProfile/__tests__/cognitiveProfile.validations.spec.ts +83 -0
  44. package/src/validations/cognitiveProfile/cognitiveProfile.validations.ts +74 -0
  45. package/src/validations/device/device.validations.ts +2 -8
  46. package/src/validations/emailProfile/__tests__/emailProfile.validations.spec.ts +105 -0
  47. package/src/validations/emailProfile/emailProfile.validations.ts +113 -0
  48. package/src/validations/gateway/__tests__/gateway.validations.spec.ts +168 -0
  49. package/src/validations/gateway/gateway.validations.ts +138 -0
  50. package/src/validations/importTemplate/__tests__/importTemplate.validations.spec.ts +77 -0
  51. package/src/validations/importTemplate/importTemplate.validations.ts +56 -0
  52. package/src/validations/index.ts +8 -0
  53. package/src/validations/storagePolicy/__tests__/storagePolicy.validations.spec.ts +52 -0
  54. package/src/validations/storagePolicy/storagePolicy.validations.ts +36 -0
  55. package/src/validations/trigger/__tests__/trigger.validations.spec.ts +92 -0
  56. package/src/validations/trigger/trigger.validations.ts +82 -0
  57. package/types/.tsbuildinfo +1 -1
  58. package/types/api/clients/_shared/appUrls.d.ts +11 -0
  59. package/types/api/clients/chatGateways/chatGatewayChannels.d.ts +62 -0
  60. package/types/api/clients/chatGateways/chatGateways.d.ts +4 -4
  61. package/types/api/clients/chatGateways/defaults/chatGatewayProviderDefaults.d.ts +21 -0
  62. package/types/api/clients/chatGateways/defaults/defaultChatGateway.d.ts +3 -1
  63. package/types/api/clients/chatGateways/defaults/webChatGateway.d.ts +5 -4
  64. package/types/api/clients/cognitiveProfiles/cognitiveProfiles.d.ts +1 -1
  65. package/types/api/clients/cognitiveProfiles/defaults/cognitiveProfileDefaults.d.ts +13 -0
  66. package/types/api/clients/importTemplates/importTemplates.d.ts +2 -2
  67. package/types/api/clients/index.d.ts +2 -0
  68. package/types/enums/ChatGatewayChannelSetup/ChatGatewayChannelSetup.d.ts +8 -0
  69. package/types/enums/GatewayIpAclProtocol/GatewayIpAclProtocol.d.ts +6 -0
  70. package/types/enums/GatewayRegisterState/GatewayRegisterState.d.ts +15 -0
  71. package/types/enums/StorageType/StorageType.d.ts +9 -0
  72. package/types/enums/WebchatAlternativeChannel/WebchatAlternativeChannel.d.ts +13 -0
  73. package/types/enums/index.d.ts +6 -1
  74. package/types/locale/en/en.d.ts +7 -0
  75. package/types/locale/es/es.d.ts +7 -0
  76. package/types/locale/index.d.ts +63 -0
  77. package/types/locale/kz/kz.d.ts +7 -0
  78. package/types/locale/pl/pl.d.ts +7 -0
  79. package/types/locale/ro/ro.d.ts +7 -0
  80. package/types/locale/ru/ru.d.ts +7 -0
  81. package/types/locale/uk/uk.d.ts +7 -0
  82. package/types/locale/uz/uz.d.ts +7 -0
  83. package/types/locale/vi/vi.d.ts +7 -0
  84. package/types/scripts/convertDuration/convertDurationWithMilliseconds.d.ts +6 -0
  85. package/types/scripts/index.d.ts +2 -1
  86. package/types/validations/_shared/ip.validations.d.ts +4 -0
  87. package/types/validations/backendProfile/backendProfile.validations.d.ts +24 -0
  88. package/types/validations/chatGateway/chatGateway.validations.d.ts +165 -0
  89. package/types/validations/cognitiveProfile/cognitiveProfile.validations.d.ts +28 -0
  90. package/types/validations/emailProfile/emailProfile.validations.d.ts +36 -0
  91. package/types/validations/gateway/gateway.validations.d.ts +48 -0
  92. package/types/validations/importTemplate/importTemplate.validations.d.ts +62 -0
  93. package/types/validations/index.d.ts +8 -0
  94. package/types/validations/storagePolicy/storagePolicy.validations.d.ts +26 -0
  95. package/types/validations/trigger/trigger.validations.d.ts +38 -0
  96. package/src/api/clients/chatGateways/enums/WebchatAlternativeChannel.enum.ts +0 -12
  97. package/src/api/clients/gateways/defaults/defaultGateway.ts +0 -9
  98. package/src/api/clients/gateways/defaults/registerGateway.ts +0 -12
  99. package/src/api/clients/gateways/defaults/trunkingGateway.ts +0 -16
  100. package/types/api/clients/chatGateways/enums/WebchatAlternativeChannel.enum.d.ts +0 -12
  101. package/types/api/clients/gateways/defaults/defaultGateway.d.ts +0 -8
  102. package/types/api/clients/gateways/defaults/registerGateway.d.ts +0 -13
  103. package/types/api/clients/gateways/defaults/trunkingGateway.d.ts +0 -16
@@ -0,0 +1,165 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * [Claude] Every provider keeps its settings in `metadata`, so it is one loose
4
+ * object with all known keys optional: `.passthrough()` keeps the keys this
5
+ * schema does not list (regle syncs the parsed value back into the form).
6
+ * Which keys a provider requires is checked in `superRefine` below.
7
+ */
8
+ declare const chatGatewayMetadataSchema: z.ZodObject<{
9
+ token: z.ZodOptional<z.ZodString>;
10
+ apiId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
11
+ apiHash: z.ZodOptional<z.ZodString>;
12
+ clientId: z.ZodOptional<z.ZodString>;
13
+ clientSecret: z.ZodOptional<z.ZodString>;
14
+ version: z.ZodOptional<z.ZodString>;
15
+ instagramComments: z.ZodOptional<z.ZodBoolean>;
16
+ instagramMentions: z.ZodOptional<z.ZodBoolean>;
17
+ whatsappToken: z.ZodOptional<z.ZodString>;
18
+ apiKey: z.ZodOptional<z.ZodString>;
19
+ url: z.ZodOptional<z.ZodString>;
20
+ botName: z.ZodOptional<z.ZodString>;
21
+ btnBackColor: z.ZodOptional<z.ZodString>;
22
+ btnFontColor: z.ZodOptional<z.ZodString>;
23
+ secret: z.ZodOptional<z.ZodString>;
24
+ webhook: z.ZodOptional<z.ZodString>;
25
+ allowOrigin: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
+ readTimeout: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
27
+ writeTimeout: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
28
+ handshakeTimeout: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
29
+ mediaMaxSize: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
30
+ _btnCodeDirty: z.ZodOptional<z.ZodBoolean>;
31
+ view: z.ZodOptional<z.ZodObject<{
32
+ logoUrl: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$loose>>;
34
+ captcha: z.ZodOptional<z.ZodObject<{
35
+ enabled: z.ZodOptional<z.ZodBoolean>;
36
+ sitekey: z.ZodOptional<z.ZodString>;
37
+ secret: z.ZodOptional<z.ZodString>;
38
+ threshold: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
39
+ showFlag: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>>;
40
+ }, z.core.$loose>>;
41
+ chat: z.ZodOptional<z.ZodObject<{
42
+ enabled: z.ZodOptional<z.ZodBoolean>;
43
+ timeoutIsActive: z.ZodOptional<z.ZodBoolean>;
44
+ openTimeout: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
45
+ }, z.core.$loose>>;
46
+ appointment: z.ZodOptional<z.ZodObject<{
47
+ enabled: z.ZodOptional<z.ZodBoolean>;
48
+ queue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
49
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
50
+ name: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>>>;
52
+ communicationType: z.ZodOptional<z.ZodNullable<z.ZodObject<{
53
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
54
+ name: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>>>;
56
+ duration: z.ZodOptional<z.ZodString>;
57
+ days: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
58
+ availableAgents: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
59
+ }, z.core.$loose>>;
60
+ call: z.ZodOptional<z.ZodObject<{
61
+ enabled: z.ZodOptional<z.ZodBoolean>;
62
+ url: z.ZodOptional<z.ZodString>;
63
+ flow: z.ZodOptional<z.ZodNullable<z.ZodObject<{
64
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
65
+ name: z.ZodOptional<z.ZodString>;
66
+ }, z.core.$strip>>>;
67
+ }, z.core.$loose>>;
68
+ alternativeChannels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
69
+ url: z.ZodOptional<z.ZodString>;
70
+ enabled: z.ZodOptional<z.ZodBoolean>;
71
+ }, z.core.$loose>>>;
72
+ }, z.core.$loose>;
73
+ /**
74
+ * [Claude] One flat schema for all providers rather than a union on `provider`:
75
+ * a union would make regle's `validationFields` a union too, and every tab would
76
+ * have to narrow it first. The per-provider rules live in `superRefine`, with
77
+ * dotted paths, so `metadata.token` lands on `validationFields.metadata.$fields.token`.
78
+ */
79
+ export declare const chatGatewaySchema: z.ZodObject<{
80
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
81
+ name: z.ZodDefault<z.ZodString>;
82
+ uri: z.ZodDefault<z.ZodString>;
83
+ flow: z.ZodOptional<z.ZodNullable<z.ZodObject<{
84
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
85
+ name: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strip>>>;
87
+ enabled: z.ZodDefault<z.ZodBoolean>;
88
+ provider: z.ZodDefault<z.ZodString>;
89
+ metadata: z.ZodDefault<z.ZodObject<{
90
+ token: z.ZodOptional<z.ZodString>;
91
+ apiId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
92
+ apiHash: z.ZodOptional<z.ZodString>;
93
+ clientId: z.ZodOptional<z.ZodString>;
94
+ clientSecret: z.ZodOptional<z.ZodString>;
95
+ version: z.ZodOptional<z.ZodString>;
96
+ instagramComments: z.ZodOptional<z.ZodBoolean>;
97
+ instagramMentions: z.ZodOptional<z.ZodBoolean>;
98
+ whatsappToken: z.ZodOptional<z.ZodString>;
99
+ apiKey: z.ZodOptional<z.ZodString>;
100
+ url: z.ZodOptional<z.ZodString>;
101
+ botName: z.ZodOptional<z.ZodString>;
102
+ btnBackColor: z.ZodOptional<z.ZodString>;
103
+ btnFontColor: z.ZodOptional<z.ZodString>;
104
+ secret: z.ZodOptional<z.ZodString>;
105
+ webhook: z.ZodOptional<z.ZodString>;
106
+ allowOrigin: z.ZodOptional<z.ZodArray<z.ZodString>>;
107
+ readTimeout: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
108
+ writeTimeout: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
109
+ handshakeTimeout: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
110
+ mediaMaxSize: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
111
+ _btnCodeDirty: z.ZodOptional<z.ZodBoolean>;
112
+ view: z.ZodOptional<z.ZodObject<{
113
+ logoUrl: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$loose>>;
115
+ captcha: z.ZodOptional<z.ZodObject<{
116
+ enabled: z.ZodOptional<z.ZodBoolean>;
117
+ sitekey: z.ZodOptional<z.ZodString>;
118
+ secret: z.ZodOptional<z.ZodString>;
119
+ threshold: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
120
+ showFlag: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>>;
121
+ }, z.core.$loose>>;
122
+ chat: z.ZodOptional<z.ZodObject<{
123
+ enabled: z.ZodOptional<z.ZodBoolean>;
124
+ timeoutIsActive: z.ZodOptional<z.ZodBoolean>;
125
+ openTimeout: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
126
+ }, z.core.$loose>>;
127
+ appointment: z.ZodOptional<z.ZodObject<{
128
+ enabled: z.ZodOptional<z.ZodBoolean>;
129
+ queue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
130
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
131
+ name: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$strip>>>;
133
+ communicationType: z.ZodOptional<z.ZodNullable<z.ZodObject<{
134
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
135
+ name: z.ZodOptional<z.ZodString>;
136
+ }, z.core.$strip>>>;
137
+ duration: z.ZodOptional<z.ZodString>;
138
+ days: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
139
+ availableAgents: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
140
+ }, z.core.$loose>>;
141
+ call: z.ZodOptional<z.ZodObject<{
142
+ enabled: z.ZodOptional<z.ZodBoolean>;
143
+ url: z.ZodOptional<z.ZodString>;
144
+ flow: z.ZodOptional<z.ZodNullable<z.ZodObject<{
145
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
146
+ name: z.ZodOptional<z.ZodString>;
147
+ }, z.core.$strip>>>;
148
+ }, z.core.$loose>>;
149
+ alternativeChannels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
150
+ url: z.ZodOptional<z.ZodString>;
151
+ enabled: z.ZodOptional<z.ZodBoolean>;
152
+ }, z.core.$loose>>>;
153
+ }, z.core.$loose>>;
154
+ updates: z.ZodOptional<z.ZodObject<{
155
+ title: z.ZodOptional<z.ZodString>;
156
+ close: z.ZodOptional<z.ZodString>;
157
+ join: z.ZodOptional<z.ZodString>;
158
+ left: z.ZodOptional<z.ZodString>;
159
+ filePolicyFail: z.ZodOptional<z.ZodString>;
160
+ }, z.core.$loose>>;
161
+ }, z.core.$loose>;
162
+ export type ChatGatewayFormShape = z.input<typeof chatGatewaySchema>;
163
+ export type ChatGatewayCard = ChatGatewayFormShape;
164
+ export type ChatGatewayMetadata = z.input<typeof chatGatewayMetadataSchema>;
165
+ export {};
@@ -0,0 +1,28 @@
1
+ import { type StorageCognitiveProfile } from '@webitel/api-services/gen/models';
2
+ import { z } from 'zod';
3
+ /** [Claude] the generated model leaves out `properties`, the provider's own settings */
4
+ export type CognitiveProfileCard = StorageCognitiveProfile & {
5
+ properties?: Record<string, unknown>;
6
+ };
7
+ /**
8
+ * [Claude] Cognitive profile card schema.
9
+ *
10
+ * A saved key is not sent back, so an empty key on update means "keep the
11
+ * current one": microsoft and elevenlabs require it only when creating. A
12
+ * google key comes from a file, so it is required until a file is chosen.
13
+ */
14
+ export declare const cognitiveProfileSchema: z.ZodObject<{
15
+ id: z.ZodOptional<z.ZodString>;
16
+ name: z.ZodDefault<z.ZodString>;
17
+ provider: z.ZodString;
18
+ service: z.ZodString;
19
+ default: z.ZodDefault<z.ZodBoolean>;
20
+ enabled: z.ZodDefault<z.ZodBoolean>;
21
+ description: z.ZodOptional<z.ZodString>;
22
+ properties: z.ZodPrefault<z.ZodObject<{
23
+ key: z.ZodOptional<z.ZodUnknown>;
24
+ keyFilename: z.ZodOptional<z.ZodString>;
25
+ region: z.ZodOptional<z.ZodString>;
26
+ locale: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$loose>>;
28
+ }, z.core.$loose>;
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ /** [Claude] the highest tcp port, the limit of the imap and smtp port fields */
3
+ export declare const EMAIL_PROFILE_MAX_PORT = 65535;
4
+ /**
5
+ * [Claude] Email profile card schema.
6
+ *
7
+ * Plain auth signs in with a password, oauth2 with the app's client settings.
8
+ * The password is required only when creating: an empty one on update means
9
+ * "keep the current one".
10
+ */
11
+ export declare const emailProfileSchema: z.ZodObject<{
12
+ activityAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
13
+ authType?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
14
+ createdAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
15
+ createdBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
16
+ description?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
17
+ enabled?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
18
+ fetchError?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
19
+ fetchInterval?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
20
+ id?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
21
+ imapHost?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
22
+ imapPort?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
23
+ listen?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
24
+ logged?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
25
+ login?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
26
+ mailbox?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
27
+ name?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
28
+ params?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
29
+ password?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
30
+ schema?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
31
+ smtpHost?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
32
+ smtpPort?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
33
+ state?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
34
+ updatedAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
35
+ updatedBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
36
+ }, z.core.$loose>;
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ export declare const gatewayIpAclSchema: z.ZodObject<{
3
+ ip: z.ZodString;
4
+ proto: z.ZodDefault<z.ZodEnum<{
5
+ readonly Any: "any";
6
+ readonly Udp: "udp";
7
+ readonly Tcp: "tcp";
8
+ }>>;
9
+ port: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
10
+ }, z.core.$strip>;
11
+ export declare const GATEWAY_EXPIRES_MIN = 32;
12
+ export declare const GATEWAY_EXPIRES_MAX = 3600;
13
+ /**
14
+ * [Claude] One schema for both gateway types, `register` tells them apart:
15
+ * a SIP registration needs account, password (on create) and expires,
16
+ * a SIP trunk needs host and an ip for every ACL entry.
17
+ */
18
+ export declare const gatewaySchema: z.ZodObject<{
19
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
20
+ name: z.ZodDefault<z.ZodString>;
21
+ register: z.ZodDefault<z.ZodBoolean>;
22
+ enable: z.ZodDefault<z.ZodBoolean>;
23
+ proxy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
24
+ schema: z.ZodDefault<z.ZodOptional<z.ZodObject<{
25
+ id: z.ZodOptional<z.ZodString>;
26
+ name: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>>>;
28
+ usage: z.ZodDefault<z.ZodString>;
29
+ account: z.ZodDefault<z.ZodOptional<z.ZodString>>;
30
+ username: z.ZodDefault<z.ZodString>;
31
+ password: z.ZodDefault<z.ZodOptional<z.ZodString>>;
32
+ expires: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
33
+ host: z.ZodDefault<z.ZodOptional<z.ZodString>>;
34
+ ipacl: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ ip: z.ZodString;
36
+ proto: z.ZodDefault<z.ZodEnum<{
37
+ readonly Any: "any";
38
+ readonly Udp: "udp";
39
+ readonly Tcp: "tcp";
40
+ }>>;
41
+ port: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
42
+ }, z.core.$strip>>>>;
43
+ }, z.core.$strip>;
44
+ export type GatewayFormShape = z.input<typeof gatewaySchema>;
45
+ export type GatewayCard = GatewayFormShape & {
46
+ rState?: number;
47
+ };
48
+ export type GatewayIpAcl = z.input<typeof gatewayIpAclSchema>;
@@ -0,0 +1,62 @@
1
+ import { type StorageImportTemplate } from '@webitel/api-services/gen/models';
2
+ import { z } from 'zod';
3
+ declare const importTemplateParametersSchema: z.ZodObject<{
4
+ charset: z.ZodDefault<z.ZodObject<{
5
+ name: z.ZodString;
6
+ value: z.ZodString;
7
+ }, z.core.$strip>>;
8
+ separator: z.ZodDefault<z.ZodString>;
9
+ skipHeaders: z.ZodDefault<z.ZodBoolean>;
10
+ clearMembers: z.ZodDefault<z.ZodBoolean>;
11
+ mappings: z.ZodPrefault<z.ZodObject<{
12
+ name: z.ZodDefault<z.ZodString>;
13
+ timezoneId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
14
+ priority: z.ZodDefault<z.ZodOptional<z.ZodString>>;
15
+ expireAt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
16
+ bucketId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
17
+ agentId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
18
+ variables: z.ZodDefault<z.ZodArray<z.ZodString>>;
19
+ destination: z.ZodDefault<z.ZodArray<z.ZodString>>;
20
+ commPriority: z.ZodDefault<z.ZodArray<z.ZodString>>;
21
+ code: z.ZodDefault<z.ZodArray<z.ZodString>>;
22
+ description: z.ZodDefault<z.ZodArray<z.ZodString>>;
23
+ dtmf: z.ZodDefault<z.ZodArray<z.ZodString>>;
24
+ }, z.core.$strip>>;
25
+ }, z.core.$strip>;
26
+ export type ImportTemplateCard = Omit<StorageImportTemplate, 'parameters'> & {
27
+ parameters?: z.infer<typeof importTemplateParametersSchema>;
28
+ };
29
+ export declare const importTemplateSchema: z.ZodObject<{
30
+ id: z.ZodOptional<z.ZodNumber>;
31
+ name: z.ZodDefault<z.ZodString>;
32
+ description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
33
+ source: z.ZodPrefault<z.ZodObject<{
34
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
35
+ name: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>>;
37
+ sourceType: z.ZodDefault<z.ZodString>;
38
+ parameters: z.ZodPrefault<z.ZodObject<{
39
+ charset: z.ZodDefault<z.ZodObject<{
40
+ name: z.ZodString;
41
+ value: z.ZodString;
42
+ }, z.core.$strip>>;
43
+ separator: z.ZodDefault<z.ZodString>;
44
+ skipHeaders: z.ZodDefault<z.ZodBoolean>;
45
+ clearMembers: z.ZodDefault<z.ZodBoolean>;
46
+ mappings: z.ZodPrefault<z.ZodObject<{
47
+ name: z.ZodDefault<z.ZodString>;
48
+ timezoneId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
49
+ priority: z.ZodDefault<z.ZodOptional<z.ZodString>>;
50
+ expireAt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
51
+ bucketId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
52
+ agentId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
53
+ variables: z.ZodDefault<z.ZodArray<z.ZodString>>;
54
+ destination: z.ZodDefault<z.ZodArray<z.ZodString>>;
55
+ commPriority: z.ZodDefault<z.ZodArray<z.ZodString>>;
56
+ code: z.ZodDefault<z.ZodArray<z.ZodString>>;
57
+ description: z.ZodDefault<z.ZodArray<z.ZodString>>;
58
+ dtmf: z.ZodDefault<z.ZodArray<z.ZodString>>;
59
+ }, z.core.$strip>>;
60
+ }, z.core.$strip>>;
61
+ }, z.core.$strip>;
62
+ export {};
@@ -12,6 +12,7 @@ export * from './agentPauseCause/agentPauseCause.validations';
12
12
  export * from './agentSkill/agentSkill.validations';
13
13
  export * from './agentSubordinate/agentSubordinate.validations';
14
14
  export * from './auditForm/auditForm.validations';
15
+ export * from './backendProfile/backendProfile.validations';
15
16
  export * from './blacklist/blacklist.validations';
16
17
  export * from './blacklistNumber/blacklistNumber.validations';
17
18
  export * from './bucket/bucket.validations';
@@ -28,7 +29,9 @@ export * from './caseServiceCatalog/caseServiceCatalog.validations';
28
29
  export * from './caseSource/caseSource.validations';
29
30
  export * from './caseStatus/caseStatus.validations';
30
31
  export * from './caseStatusCondition/caseStatusCondition.validations';
32
+ export * from './chatGateway/chatGateway.validations';
31
33
  export * from './chatplan/chatplan.validations';
34
+ export * from './cognitiveProfile/cognitiveProfile.validations';
32
35
  export * from './communicationType/communicationType.validations';
33
36
  export * from './contact/contact.validations';
34
37
  export * from './contactEmail/contactEmail.validations';
@@ -37,7 +40,10 @@ export * from './contactGroupCondition/contactGroupCondition.validations';
37
40
  export * from './contactPhone/contactPhone.validations';
38
41
  export * from './device/device.validations';
39
42
  export * from './dialplan/dialplan.validations';
43
+ export * from './emailProfile/emailProfile.validations';
40
44
  export * from './flow/flow.validations';
45
+ export * from './gateway/gateway.validations';
46
+ export * from './importTemplate/importTemplate.validations';
41
47
  export * from './license/licenseImport.validations';
42
48
  export * from './OAuth/OAuth.validations';
43
49
  export * from './onlineSkill/onlineSkill.validations';
@@ -63,11 +69,13 @@ export * from './shiftTemplate/shiftTemplate.validations';
63
69
  export * from './skill/skill.validations';
64
70
  export * from './sla/sla.validations';
65
71
  export * from './slaCondition/slaCondition.validations';
72
+ export * from './storagePolicy/storagePolicy.validations';
66
73
  export * from './team/team.validations';
67
74
  export * from './teamAgent/teamAgent.validations';
68
75
  export * from './teamFlow/teamFlow.validations';
69
76
  export * from './teamHook/teamHook.validations';
70
77
  export * from './textToSpeech/textToSpeech.validations';
78
+ export * from './trigger/trigger.validations';
71
79
  export * from './typeExtension/typeExtension.validations';
72
80
  export * from './types';
73
81
  export * from './user/user.validations';
@@ -0,0 +1,26 @@
1
+ import type { StorageFilePolicy } from '@webitel/api-services/gen/models';
2
+ import { z } from 'zod';
3
+ /** [Claude] the api keeps speeds and the upload size as int64 strings, the form edits them as numbers */
4
+ export type StoragePolicyCard = Omit<StorageFilePolicy, 'speedDownload' | 'speedUpload' | 'maxUploadSize'> & {
5
+ speedDownload?: string | number;
6
+ speedUpload?: string | number;
7
+ maxUploadSize?: string | number;
8
+ };
9
+ export declare const storagePolicySchema: z.ZodObject<{
10
+ channels?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
11
+ createdAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
12
+ createdBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
13
+ description?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
14
+ enabled?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
15
+ encrypt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
16
+ id?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
17
+ maxUploadSize?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
18
+ mimeTypes?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
19
+ name?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
20
+ position?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
21
+ retentionDays?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
22
+ speedDownload?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
23
+ speedUpload?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
24
+ updatedAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
25
+ updatedBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
26
+ }, z.core.$strip>;
@@ -0,0 +1,38 @@
1
+ import { type EngineTrigger } from '@webitel/api-services/gen/models';
2
+ import { z } from 'zod';
3
+ import { type VariablePair } from '../_shared/variablePair.validations';
4
+ /** [Claude] the card's trigger: `variables` is the editable pair list, the api takes a map */
5
+ export type TriggerCard = Omit<EngineTrigger, 'variables'> & {
6
+ variables?: VariablePair[];
7
+ };
8
+ /**
9
+ * [Claude] Trigger card schema.
10
+ *
11
+ * A cron trigger runs on a schedule, so it needs the expression and its
12
+ * timezone; an event trigger runs on an object's event, so it needs both of
13
+ * those. Whether the expression is a valid cron is left to the app, which
14
+ * has the cron parser.
15
+ */
16
+ export declare const triggerSchema: z.ZodObject<{
17
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
18
+ name: z.ZodDefault<z.ZodString>;
19
+ description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
20
+ enabled: z.ZodDefault<z.ZodBoolean>;
21
+ type: z.ZodDefault<z.ZodString>;
22
+ schema: z.ZodPrefault<z.ZodObject<{
23
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
24
+ name: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>>;
26
+ timeout: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
27
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
28
+ key: z.ZodString;
29
+ value: z.ZodString;
30
+ }, z.core.$strip>>>;
31
+ expression: z.ZodDefault<z.ZodOptional<z.ZodString>>;
32
+ timezone: z.ZodDefault<z.ZodOptional<z.ZodObject<{
33
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
34
+ name: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strip>>>;
36
+ object: z.ZodDefault<z.ZodOptional<z.ZodString>>;
37
+ event: z.ZodDefault<z.ZodOptional<z.ZodString>>;
38
+ }, z.core.$loose>;
@@ -1,12 +0,0 @@
1
- /**
2
- * Difference between MessangerType enum and WebchatAlternativeChannel:
3
- * MessangerType - backend fields naming, provider
4
- * WebchatAlternativeChannel - front-end only "simple" channel naming
5
- */
6
- export const WebchatAlternativeChannel = Object.freeze({
7
- VIBER: 'viber',
8
- WHATSAPP: 'whatsapp',
9
- TELEGRAM: 'telegram',
10
- MESSENGER: 'messenger',
11
- EMAIL: 'email',
12
- });
@@ -1,9 +0,0 @@
1
- const defaultGateway = () => ({
2
- name: '',
3
- usage: '',
4
- proxy: '',
5
- schema: {},
6
- enable: true,
7
- });
8
-
9
- export default defaultGateway;
@@ -1,12 +0,0 @@
1
- import defaultGateway from './defaultGateway';
2
-
3
- const registerGateway = () => ({
4
- ...defaultGateway(),
5
- register: true,
6
- account: '',
7
- username: '',
8
- expires: 600,
9
- password: '',
10
- });
11
-
12
- export default registerGateway;
@@ -1,16 +0,0 @@
1
- import defaultGateway from './defaultGateway';
2
-
3
- export interface GatewayIpAcl {
4
- ip: string;
5
- proto: string;
6
- port: number | null;
7
- }
8
-
9
- const trunkingGateway = () => ({
10
- ...defaultGateway(),
11
- register: false,
12
- host: '',
13
- ipacl: [] as GatewayIpAcl[],
14
- });
15
-
16
- export default trunkingGateway;
@@ -1,12 +0,0 @@
1
- /**
2
- * Difference between MessangerType enum and WebchatAlternativeChannel:
3
- * MessangerType - backend fields naming, provider
4
- * WebchatAlternativeChannel - front-end only "simple" channel naming
5
- */
6
- export declare const WebchatAlternativeChannel: Readonly<{
7
- VIBER: "viber";
8
- WHATSAPP: "whatsapp";
9
- TELEGRAM: "telegram";
10
- MESSENGER: "messenger";
11
- EMAIL: "email";
12
- }>;
@@ -1,8 +0,0 @@
1
- declare const defaultGateway: () => {
2
- name: string;
3
- usage: string;
4
- proxy: string;
5
- schema: {};
6
- enable: boolean;
7
- };
8
- export default defaultGateway;
@@ -1,13 +0,0 @@
1
- declare const registerGateway: () => {
2
- register: boolean;
3
- account: string;
4
- username: string;
5
- expires: number;
6
- password: string;
7
- name: string;
8
- usage: string;
9
- proxy: string;
10
- schema: {};
11
- enable: boolean;
12
- };
13
- export default registerGateway;
@@ -1,16 +0,0 @@
1
- export interface GatewayIpAcl {
2
- ip: string;
3
- proto: string;
4
- port: number | null;
5
- }
6
- declare const trunkingGateway: () => {
7
- register: boolean;
8
- host: string;
9
- ipacl: GatewayIpAcl[];
10
- name: string;
11
- usage: string;
12
- proxy: string;
13
- schema: {};
14
- enable: boolean;
15
- };
16
- export default trunkingGateway;