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,375 @@
1
+ import { z } from "zod";
2
+ import { OutboundTemplateChannel } from "../type-definitions";
3
+ /**
4
+ * @fileoverview Outbound Template schema definitions for message templates.
5
+ * @module conversation/outbound-template
6
+ *
7
+ * Outbound templates define reusable message templates for email, SMS,
8
+ * and WhatsApp channels with variable substitution support.
9
+ */
10
+ /**
11
+ * Template variable schema.
12
+ * Defines a variable placeholder within a message template.
13
+ *
14
+ * @typedef {Object} TemplateVariable
15
+ * @property {string} key - Variable key/name for substitution
16
+ * @property {boolean} required - Whether variable must be provided
17
+ * @property {string} [description] - Description of the variable
18
+ * @property {string} [defaultValue] - Default value if not provided
19
+ */
20
+ export declare const TemplateVariableSchema: z.ZodObject<{
21
+ key: z.ZodString;
22
+ required: z.ZodDefault<z.ZodBoolean>;
23
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
+ }, z.core.$strip>;
26
+ /**
27
+ * Outbound template base schema.
28
+ * Common fields shared across all template types.
29
+ *
30
+ * @typedef {Object} OutboundTemplateBase
31
+ * @property {string} name - Template display name
32
+ * @property {string} code - Unique template code identifier
33
+ * @property {OutboundTemplateChannel} channel - Communication channel
34
+ * @property {boolean} isActive - Whether template is active
35
+ * @property {string} [description] - Template description
36
+ * @property {TemplateVariable[]} variables - Template variables
37
+ * @property {string[]} tags - Categorization tags
38
+ * @property {Object} [metadata] - Additional metadata
39
+ */
40
+ export declare const OutboundTemplateBaseSchema: z.ZodObject<{
41
+ id: z.ZodString;
42
+ createdAt: z.ZodOptional<z.ZodNumber>;
43
+ updatedAt: z.ZodOptional<z.ZodNumber>;
44
+ name: z.ZodString;
45
+ code: z.ZodString;
46
+ channel: z.ZodEnum<typeof OutboundTemplateChannel>;
47
+ isActive: z.ZodDefault<z.ZodBoolean>;
48
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
50
+ key: z.ZodString;
51
+ required: z.ZodDefault<z.ZodBoolean>;
52
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ }, z.core.$strip>>>;
55
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
56
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
57
+ }, z.core.$strip>;
58
+ /**
59
+ * Email template schema.
60
+ * Template for email messages with subject and body.
61
+ *
62
+ * @typedef {Object} EmailTemplate
63
+ * @property {string} subjectTemplate - Email subject template
64
+ * @property {string} bodyHtmlTemplate - HTML body template
65
+ * @property {string} [bodyTextTemplate] - Plain text body template
66
+ * @property {string} [defaultReplyTo] - Default reply-to address
67
+ */
68
+ export declare const EmailTemplateSchema: z.ZodObject<{
69
+ id: z.ZodString;
70
+ createdAt: z.ZodOptional<z.ZodNumber>;
71
+ updatedAt: z.ZodOptional<z.ZodNumber>;
72
+ code: z.ZodString;
73
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
74
+ name: z.ZodString;
75
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
76
+ isActive: z.ZodDefault<z.ZodBoolean>;
77
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
78
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
79
+ key: z.ZodString;
80
+ required: z.ZodDefault<z.ZodBoolean>;
81
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
+ }, z.core.$strip>>>;
84
+ channel: z.ZodLiteral<OutboundTemplateChannel.EMAIL>;
85
+ subjectTemplate: z.ZodString;
86
+ bodyHtmlTemplate: z.ZodString;
87
+ bodyTextTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ defaultReplyTo: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
89
+ }, z.core.$strip>;
90
+ /**
91
+ * SMS template schema.
92
+ * Template for SMS text messages.
93
+ *
94
+ * @typedef {Object} SmsTemplate
95
+ * @property {string} bodyTemplate - SMS body template
96
+ */
97
+ export declare const SmsTemplateSchema: z.ZodObject<{
98
+ id: z.ZodString;
99
+ createdAt: z.ZodOptional<z.ZodNumber>;
100
+ updatedAt: z.ZodOptional<z.ZodNumber>;
101
+ code: z.ZodString;
102
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
103
+ name: z.ZodString;
104
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
105
+ isActive: z.ZodDefault<z.ZodBoolean>;
106
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
107
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
108
+ key: z.ZodString;
109
+ required: z.ZodDefault<z.ZodBoolean>;
110
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
112
+ }, z.core.$strip>>>;
113
+ channel: z.ZodLiteral<OutboundTemplateChannel.SMS>;
114
+ bodyTemplate: z.ZodString;
115
+ }, z.core.$strip>;
116
+ /**
117
+ * WhatsApp template schema.
118
+ * Template for WhatsApp messages.
119
+ *
120
+ * @typedef {Object} WhatsappTemplate
121
+ * @property {string} bodyTemplate - WhatsApp body template
122
+ */
123
+ export declare const WhatsappTemplateSchema: z.ZodObject<{
124
+ id: z.ZodString;
125
+ createdAt: z.ZodOptional<z.ZodNumber>;
126
+ updatedAt: z.ZodOptional<z.ZodNumber>;
127
+ code: z.ZodString;
128
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
129
+ name: z.ZodString;
130
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
131
+ isActive: z.ZodDefault<z.ZodBoolean>;
132
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
133
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
134
+ key: z.ZodString;
135
+ required: z.ZodDefault<z.ZodBoolean>;
136
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
138
+ }, z.core.$strip>>>;
139
+ channel: z.ZodLiteral<OutboundTemplateChannel.WHATSAPP>;
140
+ bodyTemplate: z.ZodString;
141
+ }, z.core.$strip>;
142
+ /**
143
+ * Union schema for all template types.
144
+ */
145
+ export declare const OutboundTemplateSchema: z.ZodUnion<readonly [z.ZodObject<{
146
+ id: z.ZodString;
147
+ createdAt: z.ZodOptional<z.ZodNumber>;
148
+ updatedAt: z.ZodOptional<z.ZodNumber>;
149
+ code: z.ZodString;
150
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
151
+ name: z.ZodString;
152
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
153
+ isActive: z.ZodDefault<z.ZodBoolean>;
154
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
155
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
156
+ key: z.ZodString;
157
+ required: z.ZodDefault<z.ZodBoolean>;
158
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
160
+ }, z.core.$strip>>>;
161
+ channel: z.ZodLiteral<OutboundTemplateChannel.EMAIL>;
162
+ subjectTemplate: z.ZodString;
163
+ bodyHtmlTemplate: z.ZodString;
164
+ bodyTextTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
165
+ defaultReplyTo: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
166
+ }, z.core.$strip>, z.ZodObject<{
167
+ id: z.ZodString;
168
+ createdAt: z.ZodOptional<z.ZodNumber>;
169
+ updatedAt: z.ZodOptional<z.ZodNumber>;
170
+ code: z.ZodString;
171
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
172
+ name: z.ZodString;
173
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
174
+ isActive: z.ZodDefault<z.ZodBoolean>;
175
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
176
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
177
+ key: z.ZodString;
178
+ required: z.ZodDefault<z.ZodBoolean>;
179
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
181
+ }, z.core.$strip>>>;
182
+ channel: z.ZodLiteral<OutboundTemplateChannel.SMS>;
183
+ bodyTemplate: z.ZodString;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ id: z.ZodString;
186
+ createdAt: z.ZodOptional<z.ZodNumber>;
187
+ updatedAt: z.ZodOptional<z.ZodNumber>;
188
+ code: z.ZodString;
189
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
190
+ name: z.ZodString;
191
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
192
+ isActive: z.ZodDefault<z.ZodBoolean>;
193
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
194
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
195
+ key: z.ZodString;
196
+ required: z.ZodDefault<z.ZodBoolean>;
197
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
198
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
199
+ }, z.core.$strip>>>;
200
+ channel: z.ZodLiteral<OutboundTemplateChannel.WHATSAPP>;
201
+ bodyTemplate: z.ZodString;
202
+ }, z.core.$strip>]>;
203
+ /**
204
+ * Schema for creating a new email template.
205
+ */
206
+ export declare const CreateEmailTemplateSchema: z.ZodObject<{
207
+ code: z.ZodString;
208
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
209
+ name: z.ZodString;
210
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
211
+ channel: z.ZodLiteral<OutboundTemplateChannel.EMAIL>;
212
+ isActive: z.ZodDefault<z.ZodBoolean>;
213
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
214
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
215
+ key: z.ZodString;
216
+ required: z.ZodDefault<z.ZodBoolean>;
217
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
+ }, z.core.$strip>>>;
220
+ subjectTemplate: z.ZodString;
221
+ bodyHtmlTemplate: z.ZodString;
222
+ bodyTextTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
223
+ defaultReplyTo: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
224
+ }, z.core.$strip>;
225
+ /**
226
+ * Schema for creating a new SMS template.
227
+ */
228
+ export declare const CreateSmsTemplateSchema: z.ZodObject<{
229
+ code: z.ZodString;
230
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
231
+ name: z.ZodString;
232
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
233
+ channel: z.ZodLiteral<OutboundTemplateChannel.SMS>;
234
+ isActive: z.ZodDefault<z.ZodBoolean>;
235
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
236
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
237
+ key: z.ZodString;
238
+ required: z.ZodDefault<z.ZodBoolean>;
239
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
240
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
241
+ }, z.core.$strip>>>;
242
+ bodyTemplate: z.ZodString;
243
+ }, z.core.$strip>;
244
+ /**
245
+ * Schema for creating a new WhatsApp template.
246
+ */
247
+ export declare const CreateWhatsappTemplateSchema: z.ZodObject<{
248
+ code: z.ZodString;
249
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
250
+ name: z.ZodString;
251
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
252
+ channel: z.ZodLiteral<OutboundTemplateChannel.WHATSAPP>;
253
+ isActive: z.ZodDefault<z.ZodBoolean>;
254
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
255
+ variables: z.ZodDefault<z.ZodArray<z.ZodObject<{
256
+ key: z.ZodString;
257
+ required: z.ZodDefault<z.ZodBoolean>;
258
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
259
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
260
+ }, z.core.$strip>>>;
261
+ bodyTemplate: z.ZodString;
262
+ }, z.core.$strip>;
263
+ /**
264
+ * Schema for updating an existing email template.
265
+ */
266
+ export declare const UpdateEmailTemplateSchema: z.ZodObject<{
267
+ code: z.ZodOptional<z.ZodString>;
268
+ metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
269
+ name: z.ZodOptional<z.ZodString>;
270
+ description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
271
+ channel: z.ZodOptional<z.ZodLiteral<OutboundTemplateChannel.EMAIL>>;
272
+ isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
273
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
274
+ variables: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
275
+ key: z.ZodString;
276
+ required: z.ZodDefault<z.ZodBoolean>;
277
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
278
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
+ }, z.core.$strip>>>>;
280
+ subjectTemplate: z.ZodOptional<z.ZodString>;
281
+ bodyHtmlTemplate: z.ZodOptional<z.ZodString>;
282
+ bodyTextTemplate: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
283
+ defaultReplyTo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEmail>>>;
284
+ id: z.ZodString;
285
+ }, z.core.$strip>;
286
+ /**
287
+ * Schema for updating an existing SMS template.
288
+ */
289
+ export declare const UpdateSmsTemplateSchema: z.ZodObject<{
290
+ code: z.ZodOptional<z.ZodString>;
291
+ metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
292
+ name: z.ZodOptional<z.ZodString>;
293
+ description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
294
+ channel: z.ZodOptional<z.ZodLiteral<OutboundTemplateChannel.SMS>>;
295
+ isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
296
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
297
+ variables: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
298
+ key: z.ZodString;
299
+ required: z.ZodDefault<z.ZodBoolean>;
300
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
302
+ }, z.core.$strip>>>>;
303
+ bodyTemplate: z.ZodOptional<z.ZodString>;
304
+ id: z.ZodString;
305
+ }, z.core.$strip>;
306
+ /**
307
+ * Schema for updating an existing WhatsApp template.
308
+ */
309
+ export declare const UpdateWhatsappTemplateSchema: z.ZodObject<{
310
+ code: z.ZodOptional<z.ZodString>;
311
+ metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
312
+ name: z.ZodOptional<z.ZodString>;
313
+ description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
314
+ channel: z.ZodOptional<z.ZodLiteral<OutboundTemplateChannel.WHATSAPP>>;
315
+ isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
316
+ tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
317
+ variables: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
318
+ key: z.ZodString;
319
+ required: z.ZodDefault<z.ZodBoolean>;
320
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
321
+ defaultValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
322
+ }, z.core.$strip>>>>;
323
+ bodyTemplate: z.ZodOptional<z.ZodString>;
324
+ id: z.ZodString;
325
+ }, z.core.$strip>;
326
+ export type TemplateVariable = z.infer<typeof TemplateVariableSchema>;
327
+ export type OutboundTemplateBase = z.infer<typeof OutboundTemplateBaseSchema>;
328
+ export type EmailTemplate = z.infer<typeof EmailTemplateSchema>;
329
+ export type SmsTemplate = z.infer<typeof SmsTemplateSchema>;
330
+ export type WhatsappTemplate = z.infer<typeof WhatsappTemplateSchema>;
331
+ export type OutboundTemplate = z.infer<typeof OutboundTemplateSchema>;
332
+ export type CreateEmailTemplate = z.infer<typeof CreateEmailTemplateSchema>;
333
+ export type CreateSmsTemplate = z.infer<typeof CreateSmsTemplateSchema>;
334
+ export type CreateWhatsappTemplate = z.infer<typeof CreateWhatsappTemplateSchema>;
335
+ export type UpdateEmailTemplate = z.infer<typeof UpdateEmailTemplateSchema>;
336
+ export type UpdateSmsTemplate = z.infer<typeof UpdateSmsTemplateSchema>;
337
+ export type UpdateWhatsappTemplate = z.infer<typeof UpdateWhatsappTemplateSchema>;
338
+ /**
339
+ * Outbound template filter options.
340
+ * @interface OutboundTemplateFilters
341
+ */
342
+ export interface OutboundTemplateFilters {
343
+ /** Text search across name/code/description */
344
+ search?: string;
345
+ /** Filter by channel type */
346
+ channel?: OutboundTemplateChannel;
347
+ /** Filter by active status */
348
+ isActive?: boolean;
349
+ /** Filter by tags */
350
+ tags?: string[];
351
+ }
352
+ /**
353
+ * Outbound template sorting options.
354
+ * @interface OutboundTemplateSorting
355
+ */
356
+ export interface OutboundTemplateSorting {
357
+ /** Field to sort by */
358
+ field: "name" | "code" | "channel" | "createdAt" | "updatedAt";
359
+ /** Sort direction */
360
+ direction: "asc" | "desc";
361
+ }
362
+ /**
363
+ * Outbound template query options.
364
+ * @interface OutboundTemplateQueryOptions
365
+ */
366
+ export interface OutboundTemplateQueryOptions {
367
+ /** Page number (1-indexed) */
368
+ page: number;
369
+ /** Items per page */
370
+ pageSize: number;
371
+ /** Optional filters */
372
+ filters?: OutboundTemplateFilters;
373
+ /** Optional sorting */
374
+ sorting?: OutboundTemplateSorting;
375
+ }
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateWhatsappTemplateSchema = exports.UpdateSmsTemplateSchema = exports.UpdateEmailTemplateSchema = exports.CreateWhatsappTemplateSchema = exports.CreateSmsTemplateSchema = exports.CreateEmailTemplateSchema = exports.OutboundTemplateSchema = exports.WhatsappTemplateSchema = exports.SmsTemplateSchema = exports.EmailTemplateSchema = exports.OutboundTemplateBaseSchema = exports.TemplateVariableSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const base_schema_1 = require("../base.schema");
6
+ const type_definitions_1 = require("../type-definitions");
7
+ /**
8
+ * @fileoverview Outbound Template schema definitions for message templates.
9
+ * @module conversation/outbound-template
10
+ *
11
+ * Outbound templates define reusable message templates for email, SMS,
12
+ * and WhatsApp channels with variable substitution support.
13
+ */
14
+ // ============================================================================
15
+ // TEMPLATE VARIABLE SCHEMA
16
+ // ============================================================================
17
+ /**
18
+ * Template variable schema.
19
+ * Defines a variable placeholder within a message template.
20
+ *
21
+ * @typedef {Object} TemplateVariable
22
+ * @property {string} key - Variable key/name for substitution
23
+ * @property {boolean} required - Whether variable must be provided
24
+ * @property {string} [description] - Description of the variable
25
+ * @property {string} [defaultValue] - Default value if not provided
26
+ */
27
+ exports.TemplateVariableSchema = zod_1.z.object({
28
+ key: zod_1.z.string().min(1).describe("Variable key/name for substitution (e.g., 'customerName')"),
29
+ required: zod_1.z.boolean().default(false).describe("Whether this variable must be provided when using the template"),
30
+ description: zod_1.z.string().nullable().optional().describe("Description of what this variable represents"),
31
+ defaultValue: zod_1.z.string().nullable().optional().describe("Default value if variable is not provided"),
32
+ });
33
+ // ============================================================================
34
+ // BASE TEMPLATE SCHEMA
35
+ // ============================================================================
36
+ /**
37
+ * Outbound template base schema.
38
+ * Common fields shared across all template types.
39
+ *
40
+ * @typedef {Object} OutboundTemplateBase
41
+ * @property {string} name - Template display name
42
+ * @property {string} code - Unique template code identifier
43
+ * @property {OutboundTemplateChannel} channel - Communication channel
44
+ * @property {boolean} isActive - Whether template is active
45
+ * @property {string} [description] - Template description
46
+ * @property {TemplateVariable[]} variables - Template variables
47
+ * @property {string[]} tags - Categorization tags
48
+ * @property {Object} [metadata] - Additional metadata
49
+ */
50
+ exports.OutboundTemplateBaseSchema = base_schema_1.BaseModelSchema.safeExtend({
51
+ name: zod_1.z.string().min(1).describe("Template display name"),
52
+ code: zod_1.z.string().min(1).describe("Unique template code identifier for programmatic access"),
53
+ channel: zod_1.z.enum(type_definitions_1.OutboundTemplateChannel).describe("Communication channel for this template"),
54
+ isActive: zod_1.z.boolean().default(true).describe("Whether this template is active and available for use"),
55
+ description: zod_1.z.string().nullable().optional().describe("Template description for documentation"),
56
+ variables: zod_1.z.array(exports.TemplateVariableSchema).default([]).describe("Variable placeholders used in the template"),
57
+ tags: zod_1.z.array(zod_1.z.string()).default([]).describe("Categorization tags for filtering and organization"),
58
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullable().optional().describe("Additional metadata for custom integrations"),
59
+ });
60
+ // ============================================================================
61
+ // CHANNEL-SPECIFIC TEMPLATE SCHEMAS
62
+ // ============================================================================
63
+ /**
64
+ * Email template schema.
65
+ * Template for email messages with subject and body.
66
+ *
67
+ * @typedef {Object} EmailTemplate
68
+ * @property {string} subjectTemplate - Email subject template
69
+ * @property {string} bodyHtmlTemplate - HTML body template
70
+ * @property {string} [bodyTextTemplate] - Plain text body template
71
+ * @property {string} [defaultReplyTo] - Default reply-to address
72
+ */
73
+ exports.EmailTemplateSchema = exports.OutboundTemplateBaseSchema.omit({
74
+ channel: true,
75
+ }).safeExtend({
76
+ channel: zod_1.z.literal(type_definitions_1.OutboundTemplateChannel.EMAIL).describe("Email channel identifier"),
77
+ subjectTemplate: zod_1.z.string().min(1).describe("Email subject line template with variable placeholders"),
78
+ bodyHtmlTemplate: zod_1.z.string().min(1).describe("HTML body template with variable placeholders"),
79
+ bodyTextTemplate: zod_1.z.string().nullable().optional().describe("Plain text body template for non-HTML clients"),
80
+ defaultReplyTo: zod_1.z.email().nullable().optional().describe("Default reply-to email address"),
81
+ });
82
+ /**
83
+ * SMS template schema.
84
+ * Template for SMS text messages.
85
+ *
86
+ * @typedef {Object} SmsTemplate
87
+ * @property {string} bodyTemplate - SMS body template
88
+ */
89
+ exports.SmsTemplateSchema = exports.OutboundTemplateBaseSchema.omit({
90
+ channel: true,
91
+ }).safeExtend({
92
+ channel: zod_1.z.literal(type_definitions_1.OutboundTemplateChannel.SMS).describe("SMS channel identifier"),
93
+ bodyTemplate: zod_1.z.string().min(1).describe("SMS message body template with variable placeholders"),
94
+ });
95
+ /**
96
+ * WhatsApp template schema.
97
+ * Template for WhatsApp messages.
98
+ *
99
+ * @typedef {Object} WhatsappTemplate
100
+ * @property {string} bodyTemplate - WhatsApp body template
101
+ */
102
+ exports.WhatsappTemplateSchema = exports.OutboundTemplateBaseSchema.omit({
103
+ channel: true,
104
+ }).safeExtend({
105
+ channel: zod_1.z.literal(type_definitions_1.OutboundTemplateChannel.WHATSAPP).describe("WhatsApp channel identifier"),
106
+ bodyTemplate: zod_1.z.string().min(1).describe("WhatsApp message body template with variable placeholders"),
107
+ });
108
+ /**
109
+ * Union schema for all template types.
110
+ */
111
+ exports.OutboundTemplateSchema = zod_1.z.union([
112
+ exports.EmailTemplateSchema,
113
+ exports.SmsTemplateSchema,
114
+ exports.WhatsappTemplateSchema,
115
+ ]);
116
+ // ============================================================================
117
+ // CREATE/UPDATE SCHEMAS
118
+ // ============================================================================
119
+ /**
120
+ * Schema for creating a new email template.
121
+ */
122
+ exports.CreateEmailTemplateSchema = exports.EmailTemplateSchema.omit({
123
+ id: true,
124
+ createdAt: true,
125
+ updatedAt: true,
126
+ });
127
+ /**
128
+ * Schema for creating a new SMS template.
129
+ */
130
+ exports.CreateSmsTemplateSchema = exports.SmsTemplateSchema.omit({
131
+ id: true,
132
+ createdAt: true,
133
+ updatedAt: true,
134
+ });
135
+ /**
136
+ * Schema for creating a new WhatsApp template.
137
+ */
138
+ exports.CreateWhatsappTemplateSchema = exports.WhatsappTemplateSchema.omit({
139
+ id: true,
140
+ createdAt: true,
141
+ updatedAt: true,
142
+ });
143
+ /**
144
+ * Schema for updating an existing email template.
145
+ */
146
+ exports.UpdateEmailTemplateSchema = exports.CreateEmailTemplateSchema.partial().safeExtend({
147
+ id: zod_1.z.string().describe("Unique identifier of the EmailTemplate to update"),
148
+ });
149
+ /**
150
+ * Schema for updating an existing SMS template.
151
+ */
152
+ exports.UpdateSmsTemplateSchema = exports.CreateSmsTemplateSchema.partial().safeExtend({
153
+ id: zod_1.z.string().describe("Unique identifier of the SmsTemplate to update"),
154
+ });
155
+ /**
156
+ * Schema for updating an existing WhatsApp template.
157
+ */
158
+ exports.UpdateWhatsappTemplateSchema = exports.CreateWhatsappTemplateSchema.partial().safeExtend({
159
+ id: zod_1.z.string().describe("Unique identifier of the WhatsappTemplate to update"),
160
+ });
@@ -0,0 +1,92 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * @fileoverview Translation configuration schema definitions for translation services.
4
+ *
5
+ * Translation configurations manage real-time language translation sessions between participants speaking
6
+ * different languages. Enables cross-language communication through speech-to-text transcription, translation,
7
+ * and text-to-speech synthesis. Used for multilingual customer support, international business meetings,
8
+ * and cross-border communications.
9
+ *
10
+ * @module conversation/translation-config
11
+ */
12
+ /**
13
+ * Translation service request schema.
14
+ *
15
+ * Request payload for initiating a real-time translation session between two participants speaking
16
+ * different languages. Specifies participant identifiers, their native languages, and optional
17
+ * configuration for the translation service provisioning.
18
+ *
19
+ * @remarks
20
+ * **Architecture Context:**
21
+ * - **Extends**: BaseModelSchema with translation-specific fields
22
+ * - **Creates**: TranslationServiceLog when session is initiated
23
+ * - **Participants**: 1:N - One request can lead to multiple participant records
24
+ * - **Session Tracking**: session_id enables grouping related translation requests
25
+ *
26
+ * **Translation Flow:**
27
+ * 1. Client submits TranslationServiceRequest with participant details
28
+ * 2. System creates TranslationServiceLog and participant records
29
+ * 3. Real-time translation session begins with bidirectional audio streaming
30
+ * 4. Speech transcribed → translated → synthesized for each participant
31
+ *
32
+ * **Use Cases:**
33
+ * - Customer calling support in different language than agent
34
+ * - International business calls requiring real-time translation
35
+ * - Multilingual conference calls with language bridges
36
+ */
37
+ export declare const TranslationServiceRequestSchema: z.ZodObject<{
38
+ id: z.ZodString;
39
+ createdAt: z.ZodOptional<z.ZodNumber>;
40
+ updatedAt: z.ZodOptional<z.ZodNumber>;
41
+ initiator_id: z.ZodString;
42
+ initiator_language_code: z.ZodString;
43
+ participant_language_code: z.ZodString;
44
+ session_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
45
+ translation_config_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
46
+ }, z.core.$strip>;
47
+ /**
48
+ * Translation conversation configuration schema.
49
+ *
50
+ * Configuration details for an active translation session including WebRTC connection identifiers,
51
+ * channel information, and participant access credentials. Returned when a translation session is
52
+ * successfully initiated, providing clients with necessary connection parameters.
53
+ *
54
+ * @remarks
55
+ * **Architecture Context:**
56
+ * - **Generated By**: Translation service initialization endpoint
57
+ * - **Used For**: Establishing WebRTC connections for real-time audio streaming
58
+ * - **Participants**: Contains access credentials for both initiator and participant
59
+ * - **Security**: Tokens are short-lived and session-specific for secure communication
60
+ *
61
+ * **WebRTC Connection:**
62
+ * - sdrtn_id: Session Description for Real-Time Networking identifier
63
+ * - Enables peer-to-peer audio streaming with low latency
64
+ * - Supports bidirectional translation in real-time
65
+ *
66
+ * **Participant Authentication:**
67
+ * - Each participant receives unique access_id and token
68
+ * - Tokens authenticate WebRTC connections
69
+ * - Session-scoped credentials prevent unauthorized access
70
+ */
71
+ export declare const TranslationConversationConfigSchema: z.ZodObject<{
72
+ sdrtn_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
73
+ channel_identifier: z.ZodString;
74
+ initiator_access_id: z.ZodString;
75
+ initiator_token: z.ZodString;
76
+ participant_access_id: z.ZodString;
77
+ participant_token: z.ZodString;
78
+ }, z.core.$strip>;
79
+ /**
80
+ * Schema for creating a new translation service request.
81
+ * Omits auto-generated fields.
82
+ */
83
+ export declare const CreateTranslationServiceRequestSchema: z.ZodObject<{
84
+ initiator_id: z.ZodString;
85
+ initiator_language_code: z.ZodString;
86
+ participant_language_code: z.ZodString;
87
+ session_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
88
+ translation_config_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
89
+ }, z.core.$strip>;
90
+ export type TranslationServiceRequest = z.infer<typeof TranslationServiceRequestSchema>;
91
+ export type CreateTranslationServiceRequest = z.infer<typeof CreateTranslationServiceRequestSchema>;
92
+ export type TranslationConversationConfig = z.infer<typeof TranslationConversationConfigSchema>;