wiil-core-js 0.0.82

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 (261) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -0
  3. package/dist/core/account/index.d.ts +7 -0
  4. package/dist/core/account/index.js +23 -0
  5. package/dist/core/account/organization.schema.d.ts +118 -0
  6. package/dist/core/account/organization.schema.js +91 -0
  7. package/dist/core/account/project.schema.d.ts +121 -0
  8. package/dist/core/account/project.schema.js +102 -0
  9. package/dist/core/account/supported-business-verticals.d.ts +8 -0
  10. package/dist/core/account/supported-business-verticals.js +23 -0
  11. package/dist/core/assistant-setups/assistant-setup-result.schema.d.ts +115 -0
  12. package/dist/core/assistant-setups/assistant-setup-result.schema.js +17 -0
  13. package/dist/core/assistant-setups/base-assistant-setup.schema.d.ts +61 -0
  14. package/dist/core/assistant-setups/base-assistant-setup.schema.js +29 -0
  15. package/dist/core/assistant-setups/index.d.ts +4 -0
  16. package/dist/core/assistant-setups/index.js +21 -0
  17. package/dist/core/assistant-setups/phone-assistant-setup.schema.d.ts +63 -0
  18. package/dist/core/assistant-setups/phone-assistant-setup.schema.js +14 -0
  19. package/dist/core/assistant-setups/web-assitant-setup.schema.d.ts +56 -0
  20. package/dist/core/assistant-setups/web-assitant-setup.schema.js +17 -0
  21. package/dist/core/base.schema.d.ts +34 -0
  22. package/dist/core/base.schema.js +36 -0
  23. package/dist/core/business-mgt/appointment-additional-info.schema.d.ts +63 -0
  24. package/dist/core/business-mgt/appointment-additional-info.schema.js +53 -0
  25. package/dist/core/business-mgt/appointment-field-config.schema.d.ts +251 -0
  26. package/dist/core/business-mgt/appointment-field-config.schema.js +49 -0
  27. package/dist/core/business-mgt/bookings.shared.schema.d.ts +47 -0
  28. package/dist/core/business-mgt/bookings.shared.schema.js +60 -0
  29. package/dist/core/business-mgt/business-location.schema.d.ts +327 -0
  30. package/dist/core/business-mgt/business-location.schema.js +176 -0
  31. package/dist/core/business-mgt/customer-management/customer-group.schema.d.ts +87 -0
  32. package/dist/core/business-mgt/customer-management/customer-group.schema.js +53 -0
  33. package/dist/core/business-mgt/customer-management/customer.schema.d.ts +156 -0
  34. package/dist/core/business-mgt/customer-management/customer.schema.js +93 -0
  35. package/dist/core/business-mgt/customer-management/index.d.ts +7 -0
  36. package/dist/core/business-mgt/customer-management/index.js +23 -0
  37. package/dist/core/business-mgt/customer-management/shipping-address.schema.d.ts +112 -0
  38. package/dist/core/business-mgt/customer-management/shipping-address.schema.js +79 -0
  39. package/dist/core/business-mgt/customer.schema.d.ts +111 -0
  40. package/dist/core/business-mgt/customer.schema.js +73 -0
  41. package/dist/core/business-mgt/discount-rule.schema.d.ts +183 -0
  42. package/dist/core/business-mgt/discount-rule.schema.js +108 -0
  43. package/dist/core/business-mgt/index.d.ts +16 -0
  44. package/dist/core/business-mgt/index.js +38 -0
  45. package/dist/core/business-mgt/menu-config.schema.d.ts +165 -0
  46. package/dist/core/business-mgt/menu-config.schema.js +86 -0
  47. package/dist/core/business-mgt/menu-management/index.d.ts +11 -0
  48. package/dist/core/business-mgt/menu-management/index.js +27 -0
  49. package/dist/core/business-mgt/menu-management/menu-catalog.schema.d.ts +386 -0
  50. package/dist/core/business-mgt/menu-management/menu-catalog.schema.js +58 -0
  51. package/dist/core/business-mgt/menu-management/menu-config.schema.d.ts +301 -0
  52. package/dist/core/business-mgt/menu-management/menu-config.schema.js +169 -0
  53. package/dist/core/business-mgt/menu-management/menu-item-variant.schema.d.ts +143 -0
  54. package/dist/core/business-mgt/menu-management/menu-item-variant.schema.js +86 -0
  55. package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.d.ts +239 -0
  56. package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.js +117 -0
  57. package/dist/core/business-mgt/menu-management/menu-set.schema.d.ts +420 -0
  58. package/dist/core/business-mgt/menu-management/menu-set.schema.js +283 -0
  59. package/dist/core/business-mgt/menu-management/menu.order.schema.d.ts +654 -0
  60. package/dist/core/business-mgt/menu-management/menu.order.schema.js +204 -0
  61. package/dist/core/business-mgt/menu-management/modifier.schema.d.ts +585 -0
  62. package/dist/core/business-mgt/menu-management/modifier.schema.js +341 -0
  63. package/dist/core/business-mgt/menu.order.schema.d.ts +335 -0
  64. package/dist/core/business-mgt/menu.order.schema.js +149 -0
  65. package/dist/core/business-mgt/order.schema.d.ts +222 -0
  66. package/dist/core/business-mgt/order.schema.js +205 -0
  67. package/dist/core/business-mgt/pricing-rule.shared.schema.d.ts +56 -0
  68. package/dist/core/business-mgt/pricing-rule.shared.schema.js +68 -0
  69. package/dist/core/business-mgt/product-config.schema.d.ts +177 -0
  70. package/dist/core/business-mgt/product-config.schema.js +106 -0
  71. package/dist/core/business-mgt/product-management/index.d.ts +12 -0
  72. package/dist/core/business-mgt/product-management/index.js +28 -0
  73. package/dist/core/business-mgt/product-management/product-axis-binding.schema.d.ts +54 -0
  74. package/dist/core/business-mgt/product-management/product-axis-binding.schema.js +54 -0
  75. package/dist/core/business-mgt/product-management/product-config.schema.d.ts +1042 -0
  76. package/dist/core/business-mgt/product-management/product-config.schema.js +392 -0
  77. package/dist/core/business-mgt/product-management/product-display.schema.d.ts +548 -0
  78. package/dist/core/business-mgt/product-management/product-display.schema.js +80 -0
  79. package/dist/core/business-mgt/product-management/product-order.schema.d.ts +493 -0
  80. package/dist/core/business-mgt/product-management/product-order.schema.js +158 -0
  81. package/dist/core/business-mgt/product-management/product-pricing-rule.schema.d.ts +167 -0
  82. package/dist/core/business-mgt/product-management/product-pricing-rule.schema.js +68 -0
  83. package/dist/core/business-mgt/product-management/product-set.schema.d.ts +488 -0
  84. package/dist/core/business-mgt/product-management/product-set.schema.js +273 -0
  85. package/dist/core/business-mgt/product-management/product-variant-axis.schema.d.ts +156 -0
  86. package/dist/core/business-mgt/product-management/product-variant-axis.schema.js +98 -0
  87. package/dist/core/business-mgt/product-management/product-variant.schema.d.ts +219 -0
  88. package/dist/core/business-mgt/product-management/product-variant.schema.js +130 -0
  89. package/dist/core/business-mgt/product-order.schema.d.ts +326 -0
  90. package/dist/core/business-mgt/product-order.schema.js +153 -0
  91. package/dist/core/business-mgt/property-config.schema.d.ts +621 -0
  92. package/dist/core/business-mgt/property-config.schema.js +224 -0
  93. package/dist/core/business-mgt/property-inquiry.schema.d.ts +222 -0
  94. package/dist/core/business-mgt/property-inquiry.schema.js +112 -0
  95. package/dist/core/business-mgt/property-management/index.d.ts +6 -0
  96. package/dist/core/business-mgt/property-management/index.js +22 -0
  97. package/dist/core/business-mgt/property-management/property-config.schema.d.ts +1306 -0
  98. package/dist/core/business-mgt/property-management/property-config.schema.js +367 -0
  99. package/dist/core/business-mgt/property-management/property-inquiry.schema.d.ts +254 -0
  100. package/dist/core/business-mgt/property-management/property-inquiry.schema.js +131 -0
  101. package/dist/core/business-mgt/reservation-mgt/assignment/index.d.ts +3 -0
  102. package/dist/core/business-mgt/reservation-mgt/assignment/index.js +19 -0
  103. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.d.ts +139 -0
  104. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.js +90 -0
  105. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.d.ts +104 -0
  106. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.js +70 -0
  107. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.d.ts +104 -0
  108. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.js +72 -0
  109. package/dist/core/business-mgt/reservation-mgt/index.d.ts +14 -0
  110. package/dist/core/business-mgt/reservation-mgt/index.js +31 -0
  111. package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.d.ts +180 -0
  112. package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.js +75 -0
  113. package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.d.ts +91 -0
  114. package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.js +57 -0
  115. package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.d.ts +334 -0
  116. package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.js +179 -0
  117. package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.d.ts +195 -0
  118. package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.js +106 -0
  119. package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.d.ts +402 -0
  120. package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.js +198 -0
  121. package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.d.ts +229 -0
  122. package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.js +127 -0
  123. package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.d.ts +382 -0
  124. package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.js +322 -0
  125. package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.d.ts +123 -0
  126. package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.js +83 -0
  127. package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.d.ts +167 -0
  128. package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.js +84 -0
  129. package/dist/core/business-mgt/reservation-mgt/reservation.schema.d.ts +0 -0
  130. package/dist/core/business-mgt/reservation-mgt/reservation.schema.js +153 -0
  131. package/dist/core/business-mgt/reservation-mgt/resource/index.d.ts +4 -0
  132. package/dist/core/business-mgt/reservation-mgt/resource/index.js +20 -0
  133. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.d.ts +157 -0
  134. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.js +76 -0
  135. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.d.ts +137 -0
  136. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.js +94 -0
  137. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.d.ts +713 -0
  138. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.js +363 -0
  139. package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.d.ts +151 -0
  140. package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.js +147 -0
  141. package/dist/core/business-mgt/reservation-resource.schema.d.ts +154 -0
  142. package/dist/core/business-mgt/reservation-resource.schema.js +100 -0
  143. package/dist/core/business-mgt/reservation.schema.d.ts +119 -0
  144. package/dist/core/business-mgt/reservation.schema.js +89 -0
  145. package/dist/core/business-mgt/service-appointment.schema.d.ts +105 -0
  146. package/dist/core/business-mgt/service-appointment.schema.js +69 -0
  147. package/dist/core/business-mgt/service-config.schema.d.ts +453 -0
  148. package/dist/core/business-mgt/service-config.schema.js +102 -0
  149. package/dist/core/business-mgt/service-management/appointment-additional-info.schema.d.ts +110 -0
  150. package/dist/core/business-mgt/service-management/appointment-additional-info.schema.js +78 -0
  151. package/dist/core/business-mgt/service-management/appointment-field-config.schema.d.ts +304 -0
  152. package/dist/core/business-mgt/service-management/appointment-field-config.schema.js +75 -0
  153. package/dist/core/business-mgt/service-management/business-service-config.schema.d.ts +1226 -0
  154. package/dist/core/business-mgt/service-management/business-service-config.schema.js +317 -0
  155. package/dist/core/business-mgt/service-management/index.d.ts +13 -0
  156. package/dist/core/business-mgt/service-management/index.js +29 -0
  157. package/dist/core/business-mgt/service-management/service-appointment.schema.d.ts +531 -0
  158. package/dist/core/business-mgt/service-management/service-appointment.schema.js +116 -0
  159. package/dist/core/business-mgt/service-management/service-person.schema.d.ts +122 -0
  160. package/dist/core/business-mgt/service-management/service-person.schema.js +66 -0
  161. package/dist/core/business-mgt/service-management/service-pricing-rule.schema.d.ts +221 -0
  162. package/dist/core/business-mgt/service-management/service-pricing-rule.schema.js +118 -0
  163. package/dist/core/business-mgt/service-management/service-provider.schema.d.ts +90 -0
  164. package/dist/core/business-mgt/service-management/service-provider.schema.js +54 -0
  165. package/dist/core/business-mgt/service-management/service-slot-query.schema.d.ts +90 -0
  166. package/dist/core/business-mgt/service-management/service-slot-query.schema.js +113 -0
  167. package/dist/core/business-mgt/service-management/service-time-off.schema.d.ts +121 -0
  168. package/dist/core/business-mgt/service-management/service-time-off.schema.js +95 -0
  169. package/dist/core/business-mgt/service-person.schema.d.ts +43 -0
  170. package/dist/core/business-mgt/service-person.schema.js +38 -0
  171. package/dist/core/business-mgt/tax-rule.schema.d.ts +161 -0
  172. package/dist/core/business-mgt/tax-rule.schema.js +90 -0
  173. package/dist/core/conversation/conversation-config.schema.d.ts +644 -0
  174. package/dist/core/conversation/conversation-config.schema.js +351 -0
  175. package/dist/core/conversation/conversation-message.schema.d.ts +307 -0
  176. package/dist/core/conversation/conversation-message.schema.js +275 -0
  177. package/dist/core/conversation/index.d.ts +12 -0
  178. package/dist/core/conversation/index.js +28 -0
  179. package/dist/core/conversation/outbound-call.schema.d.ts +209 -0
  180. package/dist/core/conversation/outbound-call.schema.js +116 -0
  181. package/dist/core/conversation/outbound-email.schema.d.ts +338 -0
  182. package/dist/core/conversation/outbound-email.schema.js +150 -0
  183. package/dist/core/conversation/outbound-sms.schema.d.ts +163 -0
  184. package/dist/core/conversation/outbound-sms.schema.js +85 -0
  185. package/dist/core/conversation/outbound-template.schema.d.ts +375 -0
  186. package/dist/core/conversation/outbound-template.schema.js +160 -0
  187. package/dist/core/conversation/translation-config.schema.d.ts +92 -0
  188. package/dist/core/conversation/translation-config.schema.js +88 -0
  189. package/dist/core/conversation/translation-conversation.schema.d.ts +469 -0
  190. package/dist/core/conversation/translation-conversation.schema.js +175 -0
  191. package/dist/core/index.d.ts +12 -0
  192. package/dist/core/index.js +30 -0
  193. package/dist/core/service-configuration/agent-config.schema.d.ts +236 -0
  194. package/dist/core/service-configuration/agent-config.schema.js +152 -0
  195. package/dist/core/service-configuration/base-agent-setup.d.ts +147 -0
  196. package/dist/core/service-configuration/base-agent-setup.js +123 -0
  197. package/dist/core/service-configuration/call-transfer-config.schema.d.ts +60 -0
  198. package/dist/core/service-configuration/call-transfer-config.schema.js +53 -0
  199. package/dist/core/service-configuration/deployment-config.schema.d.ts +522 -0
  200. package/dist/core/service-configuration/deployment-config.schema.js +271 -0
  201. package/dist/core/service-configuration/dynamic_setup/base-agent-setup.d.ts +130 -0
  202. package/dist/core/service-configuration/dynamic_setup/base-agent-setup.js +110 -0
  203. package/dist/core/service-configuration/dynamic_setup/index.d.ts +10 -0
  204. package/dist/core/service-configuration/dynamic_setup/index.js +26 -0
  205. package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.d.ts +111 -0
  206. package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.js +56 -0
  207. package/dist/core/service-configuration/dynamic_setup/web-agent-setup.d.ts +113 -0
  208. package/dist/core/service-configuration/dynamic_setup/web-agent-setup.js +55 -0
  209. package/dist/core/service-configuration/index.d.ts +17 -0
  210. package/dist/core/service-configuration/index.js +33 -0
  211. package/dist/core/service-configuration/instruction-config.schema.d.ts +183 -0
  212. package/dist/core/service-configuration/instruction-config.schema.js +139 -0
  213. package/dist/core/service-configuration/interaction-channels.schema.d.ts +469 -0
  214. package/dist/core/service-configuration/interaction-channels.schema.js +390 -0
  215. package/dist/core/service-configuration/knowledge.schema.d.ts +107 -0
  216. package/dist/core/service-configuration/knowledge.schema.js +106 -0
  217. package/dist/core/service-configuration/phone-config.schema.d.ts +206 -0
  218. package/dist/core/service-configuration/phone-config.schema.js +121 -0
  219. package/dist/core/service-configuration/phone-number.schema.d.ts +236 -0
  220. package/dist/core/service-configuration/phone-number.schema.js +211 -0
  221. package/dist/core/service-configuration/provisioning-config.d.ts +429 -0
  222. package/dist/core/service-configuration/provisioning-config.js +307 -0
  223. package/dist/core/service-configuration/support-llm.d.ts +95 -0
  224. package/dist/core/service-configuration/support-llm.js +76 -0
  225. package/dist/core/service-configuration/voice-language.schema.d.ts +200 -0
  226. package/dist/core/service-configuration/voice-language.schema.js +166 -0
  227. package/dist/core/type-definitions/account-definitions.d.ts +82 -0
  228. package/dist/core/type-definitions/account-definitions.js +88 -0
  229. package/dist/core/type-definitions/business-definitions.d.ts +394 -0
  230. package/dist/core/type-definitions/business-definitions.js +447 -0
  231. package/dist/core/type-definitions/conversation.type.definition.d.ts +223 -0
  232. package/dist/core/type-definitions/conversation.type.definition.js +236 -0
  233. package/dist/core/type-definitions/display-order.d.ts +154 -0
  234. package/dist/core/type-definitions/display-order.js +154 -0
  235. package/dist/core/type-definitions/dynamic-fields/field-definition.schema.d.ts +165 -0
  236. package/dist/core/type-definitions/dynamic-fields/field-definition.schema.js +97 -0
  237. package/dist/core/type-definitions/dynamic-fields/field-types.d.ts +49 -0
  238. package/dist/core/type-definitions/dynamic-fields/field-types.js +104 -0
  239. package/dist/core/type-definitions/dynamic-fields/index.d.ts +9 -0
  240. package/dist/core/type-definitions/dynamic-fields/index.js +25 -0
  241. package/dist/core/type-definitions/index.d.ts +10 -0
  242. package/dist/core/type-definitions/index.js +26 -0
  243. package/dist/core/type-definitions/knowledge-definitions.d.ts +30 -0
  244. package/dist/core/type-definitions/knowledge-definitions.js +37 -0
  245. package/dist/core/type-definitions/service-config.definitions.d.ts +112 -0
  246. package/dist/core/type-definitions/service-config.definitions.js +135 -0
  247. package/dist/core/validators/channel-validation.d.ts +19 -0
  248. package/dist/core/validators/channel-validation.js +40 -0
  249. package/dist/core/validators/index.d.ts +5 -0
  250. package/dist/core/validators/index.js +21 -0
  251. package/dist/index.d.ts +6 -0
  252. package/dist/index.js +24 -0
  253. package/dist/request/index.d.ts +5 -0
  254. package/dist/request/index.js +21 -0
  255. package/dist/request/models/index.d.ts +6 -0
  256. package/dist/request/models/index.js +22 -0
  257. package/dist/request/models/paginated-quest.schema.d.ts +33 -0
  258. package/dist/request/models/paginated-quest.schema.js +35 -0
  259. package/dist/request/models/paginated-result.schema.d.ts +124 -0
  260. package/dist/request/models/paginated-result.schema.js +94 -0
  261. package/package.json +43 -0
@@ -0,0 +1,209 @@
1
+ import { z } from "zod";
2
+ import { CallRequestStatus, ScheduleType } from "../type-definitions";
3
+ /**
4
+ * @fileoverview Outbound call request schema definitions.
5
+ * @module conversation/outbound-call
6
+ *
7
+ * Outbound call requests represent scheduled or immediate AI-powered voice calls
8
+ * to customers. Supports scheduling, retry logic, calling hours compliance, and
9
+ * integration with agent configurations for AI behavior.
10
+ */
11
+ /**
12
+ * Calling hours configuration for outbound calls.
13
+ *
14
+ * This schema represents the **Time Window** configuration:
15
+ *
16
+ * ```
17
+ * Call Request
18
+ * │
19
+ * ▼ restricted by
20
+ * Calling Hours ← THIS SCHEMA
21
+ * │
22
+ * ▼ queued until
23
+ * Next Available Window
24
+ * ```
25
+ *
26
+ * Ensures compliance with TCPA regulations and respects customer preferences.
27
+ *
28
+ * @see BusinessCallRequestSchema - Uses this for time-restricted campaigns
29
+ */
30
+ export declare const CallingHoursSchema: z.ZodObject<{
31
+ startTime: z.ZodString;
32
+ endTime: z.ZodString;
33
+ daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
34
+ }, z.core.$strip>;
35
+ export type CallingHours = z.infer<typeof CallingHoursSchema>;
36
+ /**
37
+ * Business call request schema.
38
+ *
39
+ * @typedef {Object} BusinessCallRequest
40
+ * @property {string} [phoneConfigurationId] - Phone configuration for caller ID
41
+ * @property {string} to - Destination phone number in E.164 format
42
+ * @property {string} from - Caller ID phone number in E.164 format
43
+ * @property {string} agentConfigurationId - Agent configuration for AI behavior
44
+ * @property {string} [instructionConfigurationId] - Instruction override for call
45
+ * @property {number} [maxDuration] - Maximum call duration in seconds
46
+ * @property {string} scheduleType - Call timing strategy
47
+ * @property {string} [serviceConversationConfigId] - Linked conversation record
48
+ * @property {string} [timeZone] - IANA timezone identifier
49
+ * @property {number} [scheduledAt] - Unix timestamp for scheduled execution
50
+ * @property {Object} [callingHours] - Permitted calling window configuration
51
+ * @property {number} [maxRetries] - Maximum retry attempts (0-5)
52
+ * @property {number} [retryDelayMinutes] - Delay between retries in minutes
53
+ * @property {string} status - Current call request status
54
+ * @property {Object} [metadata] - Additional custom metadata
55
+ */
56
+ export declare const BusinessCallRequestSchema: z.ZodObject<{
57
+ id: z.ZodString;
58
+ createdAt: z.ZodOptional<z.ZodNumber>;
59
+ updatedAt: z.ZodOptional<z.ZodNumber>;
60
+ phoneConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ to: z.ZodString;
62
+ from: z.ZodString;
63
+ agentConfigurationId: z.ZodString;
64
+ instructionConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ maxDuration: z.ZodOptional<z.ZodNumber>;
66
+ scheduleType: z.ZodEnum<typeof ScheduleType>;
67
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ timeZone: z.ZodOptional<z.ZodString>;
69
+ scheduledAt: z.ZodOptional<z.ZodNumber>;
70
+ callingHours: z.ZodOptional<z.ZodNullable<z.ZodObject<{
71
+ startTime: z.ZodString;
72
+ endTime: z.ZodString;
73
+ daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
74
+ }, z.core.$strip>>>;
75
+ maxRetries: z.ZodOptional<z.ZodNumber>;
76
+ retryDelayMinutes: z.ZodOptional<z.ZodNumber>;
77
+ status: z.ZodDefault<z.ZodEnum<typeof CallRequestStatus>>;
78
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
79
+ }, z.core.$strip>;
80
+ /**
81
+ * Schema for creating a new call request.
82
+ * Omits auto-generated fields.
83
+ */
84
+ export declare const CreateCallRequestSchema: z.ZodObject<{
85
+ status: z.ZodDefault<z.ZodEnum<typeof CallRequestStatus>>;
86
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
87
+ instructionConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ agentConfigurationId: z.ZodString;
89
+ phoneConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
90
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
91
+ from: z.ZodString;
92
+ to: z.ZodString;
93
+ maxDuration: z.ZodOptional<z.ZodNumber>;
94
+ scheduleType: z.ZodEnum<typeof ScheduleType>;
95
+ timeZone: z.ZodOptional<z.ZodString>;
96
+ scheduledAt: z.ZodOptional<z.ZodNumber>;
97
+ callingHours: z.ZodOptional<z.ZodNullable<z.ZodObject<{
98
+ startTime: z.ZodString;
99
+ endTime: z.ZodString;
100
+ daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
101
+ }, z.core.$strip>>>;
102
+ maxRetries: z.ZodOptional<z.ZodNumber>;
103
+ retryDelayMinutes: z.ZodOptional<z.ZodNumber>;
104
+ }, z.core.$strip>;
105
+ /**
106
+ * Schema for updating an existing call request.
107
+ * All fields optional except id (required).
108
+ */
109
+ export declare const UpdateCallRequestSchema: z.ZodObject<{
110
+ status: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof CallRequestStatus>>>;
111
+ metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
112
+ instructionConfigurationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
113
+ agentConfigurationId: z.ZodOptional<z.ZodString>;
114
+ phoneConfigurationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
115
+ serviceConversationConfigId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
116
+ from: z.ZodOptional<z.ZodString>;
117
+ to: z.ZodOptional<z.ZodString>;
118
+ maxDuration: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
119
+ scheduleType: z.ZodOptional<z.ZodEnum<typeof ScheduleType>>;
120
+ timeZone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
121
+ scheduledAt: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
122
+ callingHours: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
123
+ startTime: z.ZodString;
124
+ endTime: z.ZodString;
125
+ daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
126
+ }, z.core.$strip>>>>;
127
+ maxRetries: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
128
+ retryDelayMinutes: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
129
+ id: z.ZodString;
130
+ }, z.core.$strip>;
131
+ /**
132
+ * Call request result schema.
133
+ * Response payload from telephony provider after initiating a call.
134
+ */
135
+ export declare const CallRequestResultSchema: z.ZodObject<{
136
+ success: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
137
+ request: z.ZodNullable<z.ZodOptional<z.ZodObject<{
138
+ id: z.ZodString;
139
+ createdAt: z.ZodOptional<z.ZodNumber>;
140
+ updatedAt: z.ZodOptional<z.ZodNumber>;
141
+ phoneConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ to: z.ZodString;
143
+ from: z.ZodString;
144
+ agentConfigurationId: z.ZodString;
145
+ instructionConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
146
+ maxDuration: z.ZodOptional<z.ZodNumber>;
147
+ scheduleType: z.ZodEnum<typeof ScheduleType>;
148
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
149
+ timeZone: z.ZodOptional<z.ZodString>;
150
+ scheduledAt: z.ZodOptional<z.ZodNumber>;
151
+ callingHours: z.ZodOptional<z.ZodNullable<z.ZodObject<{
152
+ startTime: z.ZodString;
153
+ endTime: z.ZodString;
154
+ daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
155
+ }, z.core.$strip>>>;
156
+ maxRetries: z.ZodOptional<z.ZodNumber>;
157
+ retryDelayMinutes: z.ZodOptional<z.ZodNumber>;
158
+ status: z.ZodDefault<z.ZodEnum<typeof CallRequestStatus>>;
159
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
160
+ }, z.core.$strip>>>;
161
+ error_message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
162
+ }, z.core.$strip>;
163
+ export type BusinessCallRequest = z.infer<typeof BusinessCallRequestSchema>;
164
+ export type CreateCallRequest = z.infer<typeof CreateCallRequestSchema>;
165
+ export type UpdateCallRequest = z.infer<typeof UpdateCallRequestSchema>;
166
+ export type CallRequestResult = z.infer<typeof CallRequestResultSchema>;
167
+ /**
168
+ * Call request filter options.
169
+ * @interface CallRequestFilters
170
+ */
171
+ export interface CallRequestFilters {
172
+ /** Text search across phone numbers */
173
+ search?: string;
174
+ /** Filter by call status */
175
+ status?: CallRequestStatus;
176
+ /** Filter by schedule type */
177
+ scheduleType?: ScheduleType;
178
+ /** Filter by agent configuration ID */
179
+ agentConfigurationId?: string;
180
+ /** Filter by date range (scheduledAt) */
181
+ dateRange?: {
182
+ start?: Date;
183
+ end?: Date;
184
+ };
185
+ }
186
+ /**
187
+ * Call request sorting options.
188
+ * @interface CallRequestSorting
189
+ */
190
+ export interface CallRequestSorting {
191
+ /** Field to sort by */
192
+ field: "scheduledAt" | "status" | "createdAt";
193
+ /** Sort direction */
194
+ direction: "asc" | "desc";
195
+ }
196
+ /**
197
+ * Call request query options.
198
+ * @interface CallRequestQueryOptions
199
+ */
200
+ export interface CallRequestQueryOptions {
201
+ /** Page number (1-indexed) */
202
+ page: number;
203
+ /** Items per page */
204
+ pageSize: number;
205
+ /** Optional filters */
206
+ filters?: CallRequestFilters;
207
+ /** Optional sorting */
208
+ sorting?: CallRequestSorting;
209
+ }
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallRequestResultSchema = exports.UpdateCallRequestSchema = exports.CreateCallRequestSchema = exports.BusinessCallRequestSchema = exports.CallingHoursSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const type_definitions_1 = require("../type-definitions");
6
+ const base_schema_1 = require("../base.schema");
7
+ /**
8
+ * @fileoverview Outbound call request schema definitions.
9
+ * @module conversation/outbound-call
10
+ *
11
+ * Outbound call requests represent scheduled or immediate AI-powered voice calls
12
+ * to customers. Supports scheduling, retry logic, calling hours compliance, and
13
+ * integration with agent configurations for AI behavior.
14
+ */
15
+ // ============================================================================
16
+ // CALLING HOURS SCHEMA
17
+ // ============================================================================
18
+ /**
19
+ * Calling hours configuration for outbound calls.
20
+ *
21
+ * This schema represents the **Time Window** configuration:
22
+ *
23
+ * ```
24
+ * Call Request
25
+ * │
26
+ * ▼ restricted by
27
+ * Calling Hours ← THIS SCHEMA
28
+ * │
29
+ * ▼ queued until
30
+ * Next Available Window
31
+ * ```
32
+ *
33
+ * Ensures compliance with TCPA regulations and respects customer preferences.
34
+ *
35
+ * @see BusinessCallRequestSchema - Uses this for time-restricted campaigns
36
+ */
37
+ exports.CallingHoursSchema = zod_1.z.object({
38
+ startTime: zod_1.z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/).describe("Start time for permitted calling window in HH:MM 24-hour format (e.g., '09:00' for 9 AM). Calls before this time are queued until the window opens."),
39
+ endTime: zod_1.z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/).describe("End time for permitted calling window in HH:MM 24-hour format (e.g., '17:00' for 5 PM). Calls after this time are queued until the next available window."),
40
+ daysOfWeek: zod_1.z.array(zod_1.z.number().int().min(0).max(6)).default([1, 2, 3, 4, 5]).describe("Array of permitted days of week for calling (0=Sunday through 6=Saturday). Defaults to weekdays [1,2,3,4,5]. Use [0,1,2,3,4,5,6] for all days."),
41
+ });
42
+ // ============================================================================
43
+ // BUSINESS CALL REQUEST SCHEMA
44
+ // ============================================================================
45
+ /**
46
+ * Business call request schema.
47
+ *
48
+ * @typedef {Object} BusinessCallRequest
49
+ * @property {string} [phoneConfigurationId] - Phone configuration for caller ID
50
+ * @property {string} to - Destination phone number in E.164 format
51
+ * @property {string} from - Caller ID phone number in E.164 format
52
+ * @property {string} agentConfigurationId - Agent configuration for AI behavior
53
+ * @property {string} [instructionConfigurationId] - Instruction override for call
54
+ * @property {number} [maxDuration] - Maximum call duration in seconds
55
+ * @property {string} scheduleType - Call timing strategy
56
+ * @property {string} [serviceConversationConfigId] - Linked conversation record
57
+ * @property {string} [timeZone] - IANA timezone identifier
58
+ * @property {number} [scheduledAt] - Unix timestamp for scheduled execution
59
+ * @property {Object} [callingHours] - Permitted calling window configuration
60
+ * @property {number} [maxRetries] - Maximum retry attempts (0-5)
61
+ * @property {number} [retryDelayMinutes] - Delay between retries in minutes
62
+ * @property {string} status - Current call request status
63
+ * @property {Object} [metadata] - Additional custom metadata
64
+ */
65
+ exports.BusinessCallRequestSchema = base_schema_1.BaseModelSchema.safeExtend({
66
+ phoneConfigurationId: zod_1.z.string().nullable().optional().describe("Phone configuration ID for caller ID display and telephony routing settings (references PhoneConfiguration). When omitted, uses organization default."),
67
+ to: zod_1.z.string().min(1, "Destination phone number is required").describe("Destination phone number in E.164 international format (e.g., '+12125551234'). Must be a valid, dialable phone number for outbound calling."),
68
+ from: zod_1.z.string().min(1, "Caller ID is required").describe("Caller ID phone number in E.164 format displayed to the recipient. Must be a verified number owned by the organization in PhoneConfiguration."),
69
+ agentConfigurationId: zod_1.z.string().min(1, "Agent configuration is required").describe("Agent configuration ID defining AI behavior, persona, and capabilities for this call (references AgentConfiguration). Determines how the AI handles the conversation."),
70
+ instructionConfigurationId: zod_1.z.string().nullable().optional().describe("Optional instruction configuration ID to override agent defaults with call-specific behavioral guidelines and prompts (references InstructionConfiguration)."),
71
+ maxDuration: zod_1.z.number().int().positive().optional().describe("Maximum call duration in seconds to prevent runaway calls. Call automatically terminates with graceful goodbye when limit is reached."),
72
+ scheduleType: zod_1.z.enum(type_definitions_1.ScheduleType).describe("Call timing strategy: 'immediate' executes ASAP within calling hours, 'scheduled' executes at scheduledAt timestamp, 'recurring' executes on callingHours schedule."),
73
+ serviceConversationConfigId: zod_1.z.string().nullable().optional().describe("Linked conversation record ID for tracking call outcomes, messages, and analytics (references ServiceConversationConfig). Created automatically when call connects."),
74
+ // Time constraints
75
+ timeZone: zod_1.z.string().optional().describe("IANA timezone identifier for interpreting scheduledAt and callingHours (e.g., 'America/New_York', 'Europe/London'). Defaults to UTC if not specified."),
76
+ scheduledAt: zod_1.z.number().optional().describe("Unix timestamp in milliseconds for scheduled call execution. Required when scheduleType is 'scheduled'. Call executes at this time if within callingHours."),
77
+ callingHours: exports.CallingHoursSchema.nullable().optional().describe("Permitted calling window configuration restricting when calls can be placed. Ensures TCPA compliance and respects customer preferences. Calls outside window are queued."),
78
+ // Retry configuration
79
+ maxRetries: zod_1.z.number().int().min(0).max(5).optional().describe("Maximum number of retry attempts if call fails due to no answer, busy signal, or technical error (0-5). Set to 0 to disable retries."),
80
+ retryDelayMinutes: zod_1.z.number().int().positive().optional().describe("Delay in minutes between retry attempts. Provides spacing to increase likelihood of reaching the recipient on subsequent attempts."),
81
+ // Status tracking
82
+ status: zod_1.z.enum(type_definitions_1.CallRequestStatus).default(type_definitions_1.CallRequestStatus.PENDING).describe("Current status of the call request lifecycle (pending, scheduled, in_progress, completed, failed, cancelled)."),
83
+ // Extensibility
84
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Additional custom metadata as key-value pairs for campaign tracking, CRM integration, or application-specific data. Not processed by the platform."),
85
+ });
86
+ // ============================================================================
87
+ // CREATE/UPDATE SCHEMAS
88
+ // ============================================================================
89
+ /**
90
+ * Schema for creating a new call request.
91
+ * Omits auto-generated fields.
92
+ */
93
+ exports.CreateCallRequestSchema = exports.BusinessCallRequestSchema.omit({
94
+ id: true,
95
+ createdAt: true,
96
+ updatedAt: true,
97
+ });
98
+ /**
99
+ * Schema for updating an existing call request.
100
+ * All fields optional except id (required).
101
+ */
102
+ exports.UpdateCallRequestSchema = exports.CreateCallRequestSchema.partial().safeExtend({
103
+ id: zod_1.z.string().describe("Unique identifier of the CallRequest to update"),
104
+ });
105
+ // ============================================================================
106
+ // CALL REQUEST RESULT SCHEMA
107
+ // ============================================================================
108
+ /**
109
+ * Call request result schema.
110
+ * Response payload from telephony provider after initiating a call.
111
+ */
112
+ exports.CallRequestResultSchema = zod_1.z.object({
113
+ success: zod_1.z.boolean().optional().default(false).describe("Whether the telephony request was successful"),
114
+ request: exports.BusinessCallRequestSchema.optional().nullable().describe("Original call request details"),
115
+ error_message: zod_1.z.string().optional().nullable().describe("Error message if the request failed"),
116
+ });
@@ -0,0 +1,338 @@
1
+ import { z } from "zod";
2
+ import { EmailStatus } from "../type-definitions";
3
+ /**
4
+ * @fileoverview Outbound email request and delivery tracking schema definitions.
5
+ * @module conversation/outbound-email
6
+ *
7
+ * Email requests represent outbound email communications sent through the platform.
8
+ * Supports scheduling, templates, attachments, and delivery tracking with retry logic.
9
+ */
10
+ /**
11
+ * Email recipient schema (embedded in EmailRequestSchema).
12
+ *
13
+ * @see EmailRequestSchema - Uses this for recipient arrays
14
+ */
15
+ export declare const EmailRecipientSchema: z.ZodObject<{
16
+ email: z.ZodString;
17
+ name: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export type EmailRecipient = z.infer<typeof EmailRecipientSchema>;
20
+ /**
21
+ * Email attachment schema (embedded in EmailRequestSchema).
22
+ *
23
+ * @see EmailRequestSchema - Uses this for file attachments
24
+ */
25
+ export declare const EmailAttachmentSchema: z.ZodObject<{
26
+ filename: z.ZodString;
27
+ content: z.ZodString;
28
+ contentType: z.ZodString;
29
+ }, z.core.$strip>;
30
+ export type EmailAttachment = z.infer<typeof EmailAttachmentSchema>;
31
+ /**
32
+ * Email request schema.
33
+ *
34
+ * @typedef {Object} EmailRequest
35
+ * @property {string} [emailConfigurationId] - Email configuration for sender settings. May be provided or system falls back to default platform email
36
+ * @property {string} [configuredEmailAddress] - Configured sender email address. May be provided or system falls back to default platform email
37
+ * @property {string} [templateId] - Pre-defined template ID for structured content
38
+ * @property {Array} to - Primary recipients (required, at least one)
39
+ * @property {Array} [cc] - Carbon copy recipients
40
+ * @property {Array} [bcc] - Blind carbon copy recipients
41
+ * @property {string} [replyTo] - Reply-to email address
42
+ * @property {string} subject - Email subject line
43
+ * @property {string} bodyHtml - HTML content of the email body
44
+ * @property {string} [bodyText] - Plain text alternative content
45
+ * @property {Object} [variables] - Template variable substitutions
46
+ * @property {Array} [attachments] - File attachments
47
+ * @property {number} [scheduledAt] - Unix timestamp for scheduled delivery
48
+ * @property {string} [serviceConversationConfigId] - Linked conversation record
49
+ * @property {Object} [metadata] - Additional custom metadata
50
+ */
51
+ export declare const EmailRequestSchema: z.ZodObject<{
52
+ id: z.ZodString;
53
+ createdAt: z.ZodOptional<z.ZodNumber>;
54
+ updatedAt: z.ZodOptional<z.ZodNumber>;
55
+ emailConfigurationId: z.ZodOptional<z.ZodString>;
56
+ configuredEmailAddress: z.ZodOptional<z.ZodString>;
57
+ templateId: z.ZodOptional<z.ZodString>;
58
+ to: z.ZodArray<z.ZodObject<{
59
+ email: z.ZodString;
60
+ name: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strip>>;
62
+ cc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
63
+ email: z.ZodString;
64
+ name: z.ZodOptional<z.ZodString>;
65
+ }, z.core.$strip>>>>;
66
+ bcc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
67
+ email: z.ZodString;
68
+ name: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strip>>>>;
70
+ replyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ subject: z.ZodString;
72
+ bodyHtml: z.ZodString;
73
+ bodyText: z.ZodOptional<z.ZodString>;
74
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
75
+ attachments: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
76
+ filename: z.ZodString;
77
+ content: z.ZodString;
78
+ contentType: z.ZodString;
79
+ }, z.core.$strip>>>>;
80
+ scheduledAt: z.ZodOptional<z.ZodNumber>;
81
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ status: z.ZodDefault<z.ZodEnum<typeof EmailStatus>>;
83
+ maxRetries: z.ZodOptional<z.ZodNumber>;
84
+ retryCount: z.ZodDefault<z.ZodNumber>;
85
+ retryDelayMinutes: z.ZodOptional<z.ZodNumber>;
86
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
87
+ }, z.core.$strip>;
88
+ /**
89
+ * Schema for creating a new email request.
90
+ * Omits auto-generated fields.
91
+ */
92
+ export declare const CreateEmailRequestSchema: z.ZodObject<{
93
+ status: z.ZodDefault<z.ZodEnum<typeof EmailStatus>>;
94
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
95
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
96
+ to: z.ZodArray<z.ZodObject<{
97
+ email: z.ZodString;
98
+ name: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strip>>;
100
+ subject: z.ZodString;
101
+ scheduledAt: z.ZodOptional<z.ZodNumber>;
102
+ maxRetries: z.ZodOptional<z.ZodNumber>;
103
+ retryDelayMinutes: z.ZodOptional<z.ZodNumber>;
104
+ emailConfigurationId: z.ZodOptional<z.ZodString>;
105
+ configuredEmailAddress: z.ZodOptional<z.ZodString>;
106
+ templateId: z.ZodOptional<z.ZodString>;
107
+ cc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
108
+ email: z.ZodString;
109
+ name: z.ZodOptional<z.ZodString>;
110
+ }, z.core.$strip>>>>;
111
+ bcc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
112
+ email: z.ZodString;
113
+ name: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$strip>>>>;
115
+ replyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
116
+ bodyHtml: z.ZodString;
117
+ bodyText: z.ZodOptional<z.ZodString>;
118
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
119
+ attachments: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
120
+ filename: z.ZodString;
121
+ content: z.ZodString;
122
+ contentType: z.ZodString;
123
+ }, z.core.$strip>>>>;
124
+ retryCount: z.ZodDefault<z.ZodNumber>;
125
+ }, z.core.$strip>;
126
+ /**
127
+ * Schema for updating an existing email request.
128
+ * All fields optional except id (required).
129
+ */
130
+ export declare const UpdateEmailRequestSchema: z.ZodObject<{
131
+ status: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof EmailStatus>>>;
132
+ metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
133
+ serviceConversationConfigId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
134
+ to: z.ZodOptional<z.ZodArray<z.ZodObject<{
135
+ email: z.ZodString;
136
+ name: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strip>>>;
138
+ subject: z.ZodOptional<z.ZodString>;
139
+ scheduledAt: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
140
+ maxRetries: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
141
+ retryDelayMinutes: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
142
+ emailConfigurationId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
143
+ configuredEmailAddress: z.ZodOptional<z.ZodOptional<z.ZodString>>;
144
+ templateId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
145
+ cc: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
146
+ email: z.ZodString;
147
+ name: z.ZodOptional<z.ZodString>;
148
+ }, z.core.$strip>>>>>;
149
+ bcc: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
150
+ email: z.ZodString;
151
+ name: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strip>>>>>;
153
+ replyTo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
154
+ bodyHtml: z.ZodOptional<z.ZodString>;
155
+ bodyText: z.ZodOptional<z.ZodOptional<z.ZodString>>;
156
+ variables: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
157
+ attachments: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
158
+ filename: z.ZodString;
159
+ content: z.ZodString;
160
+ contentType: z.ZodString;
161
+ }, z.core.$strip>>>>>;
162
+ retryCount: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
163
+ id: z.ZodString;
164
+ }, z.core.$strip>;
165
+ /**
166
+ * Email record schema for tracking delivery status.
167
+ *
168
+ * Records individual delivery events and status updates from email providers.
169
+ * Links to the original EmailRequest and tracks provider-specific message IDs.
170
+ *
171
+ * @typedef {Object} EmailRecord
172
+ * @property {string} emailRequestId - Reference to the original email request
173
+ * @property {string} providerMessageId - Provider-specific message ID
174
+ * @property {EmailStatus} status - Current delivery status
175
+ * @property {number} [sentAt] - Timestamp when email was sent
176
+ * @property {number} [deliveredAt] - Timestamp when email was delivered
177
+ * @property {number} [bouncedAt] - Timestamp when email bounced
178
+ * @property {string} [errorCode] - Provider error code if failed
179
+ * @property {string} [errorMessage] - Provider error message if failed
180
+ * @property {Object} [metadata] - Additional provider metadata
181
+ */
182
+ export declare const EmailRecordSchema: z.ZodObject<{
183
+ id: z.ZodString;
184
+ createdAt: z.ZodOptional<z.ZodNumber>;
185
+ updatedAt: z.ZodOptional<z.ZodNumber>;
186
+ emailRequestId: z.ZodString;
187
+ providerMessageId: z.ZodString;
188
+ status: z.ZodEnum<typeof EmailStatus>;
189
+ sentAt: z.ZodOptional<z.ZodNumber>;
190
+ deliveredAt: z.ZodOptional<z.ZodNumber>;
191
+ bouncedAt: z.ZodOptional<z.ZodNumber>;
192
+ errorCode: z.ZodOptional<z.ZodString>;
193
+ errorMessage: z.ZodOptional<z.ZodString>;
194
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
195
+ }, z.core.$strip>;
196
+ /**
197
+ * Email request result schema.
198
+ * Response payload after submitting an email request.
199
+ */
200
+ export declare const EmailRequestResultSchema: z.ZodObject<{
201
+ success: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
202
+ request: z.ZodNullable<z.ZodOptional<z.ZodObject<{
203
+ id: z.ZodString;
204
+ createdAt: z.ZodOptional<z.ZodNumber>;
205
+ updatedAt: z.ZodOptional<z.ZodNumber>;
206
+ emailConfigurationId: z.ZodOptional<z.ZodString>;
207
+ configuredEmailAddress: z.ZodOptional<z.ZodString>;
208
+ templateId: z.ZodOptional<z.ZodString>;
209
+ to: z.ZodArray<z.ZodObject<{
210
+ email: z.ZodString;
211
+ name: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strip>>;
213
+ cc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
214
+ email: z.ZodString;
215
+ name: z.ZodOptional<z.ZodString>;
216
+ }, z.core.$strip>>>>;
217
+ bcc: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
218
+ email: z.ZodString;
219
+ name: z.ZodOptional<z.ZodString>;
220
+ }, z.core.$strip>>>>;
221
+ replyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
222
+ subject: z.ZodString;
223
+ bodyHtml: z.ZodString;
224
+ bodyText: z.ZodOptional<z.ZodString>;
225
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
226
+ attachments: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
227
+ filename: z.ZodString;
228
+ content: z.ZodString;
229
+ contentType: z.ZodString;
230
+ }, z.core.$strip>>>>;
231
+ scheduledAt: z.ZodOptional<z.ZodNumber>;
232
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
233
+ status: z.ZodDefault<z.ZodEnum<typeof EmailStatus>>;
234
+ maxRetries: z.ZodOptional<z.ZodNumber>;
235
+ retryCount: z.ZodDefault<z.ZodNumber>;
236
+ retryDelayMinutes: z.ZodOptional<z.ZodNumber>;
237
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
238
+ }, z.core.$strip>>>;
239
+ error_message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
240
+ }, z.core.$strip>;
241
+ export type EmailRequest = z.infer<typeof EmailRequestSchema>;
242
+ export type CreateEmailRequest = z.infer<typeof CreateEmailRequestSchema>;
243
+ export type UpdateEmailRequest = z.infer<typeof UpdateEmailRequestSchema>;
244
+ export type EmailRecord = z.infer<typeof EmailRecordSchema>;
245
+ export type EmailRequestResult = z.infer<typeof EmailRequestResultSchema>;
246
+ /**
247
+ * Email request filter options.
248
+ * @interface EmailRequestFilters
249
+ */
250
+ export interface EmailRequestFilters {
251
+ /** Text search across subject */
252
+ search?: string;
253
+ /** Filter by email configuration ID */
254
+ emailConfigurationId?: string;
255
+ /** Filter by configured email address */
256
+ configuredEmailAddress?: string;
257
+ /** Filter by template ID */
258
+ templateId?: string;
259
+ /** Filter by delivery status */
260
+ status?: EmailStatus;
261
+ /** Filter by linked conversation ID */
262
+ serviceConversationConfigId?: string;
263
+ /** Filter by scheduled date range */
264
+ scheduledAtRange?: {
265
+ from?: number;
266
+ to?: number;
267
+ };
268
+ }
269
+ /**
270
+ * Email request sorting options.
271
+ * @interface EmailRequestSorting
272
+ */
273
+ export interface EmailRequestSorting {
274
+ /** Field to sort by */
275
+ field: "createdAt" | "scheduledAt" | "status" | "subject" | "retryCount";
276
+ /** Sort direction */
277
+ direction: "asc" | "desc";
278
+ }
279
+ /**
280
+ * Email request query options.
281
+ * @interface EmailRequestQueryOptions
282
+ */
283
+ export interface EmailRequestQueryOptions {
284
+ /** Page number (1-indexed) */
285
+ page: number;
286
+ /** Items per page */
287
+ pageSize: number;
288
+ /** Optional filters */
289
+ filters?: EmailRequestFilters;
290
+ /** Optional sorting */
291
+ sorting?: EmailRequestSorting;
292
+ }
293
+ /**
294
+ * Email record filter options.
295
+ * @interface EmailRecordFilters
296
+ */
297
+ export interface EmailRecordFilters {
298
+ /** Filter by email request ID */
299
+ emailRequestId?: string;
300
+ /** Filter by provider message ID */
301
+ providerMessageId?: string;
302
+ /** Filter by delivery status */
303
+ status?: EmailStatus;
304
+ /** Filter by sent date range */
305
+ sentAtRange?: {
306
+ from?: number;
307
+ to?: number;
308
+ };
309
+ /** Filter by delivered date range */
310
+ deliveredAtRange?: {
311
+ from?: number;
312
+ to?: number;
313
+ };
314
+ }
315
+ /**
316
+ * Email record sorting options.
317
+ * @interface EmailRecordSorting
318
+ */
319
+ export interface EmailRecordSorting {
320
+ /** Field to sort by */
321
+ field: "createdAt" | "status" | "sentAt" | "deliveredAt";
322
+ /** Sort direction */
323
+ direction: "asc" | "desc";
324
+ }
325
+ /**
326
+ * Email record query options.
327
+ * @interface EmailRecordQueryOptions
328
+ */
329
+ export interface EmailRecordQueryOptions {
330
+ /** Page number (1-indexed) */
331
+ page: number;
332
+ /** Items per page */
333
+ pageSize: number;
334
+ /** Optional filters */
335
+ filters?: EmailRecordFilters;
336
+ /** Optional sorting */
337
+ sorting?: EmailRecordSorting;
338
+ }