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,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailRequestResultSchema = exports.EmailRecordSchema = exports.UpdateEmailRequestSchema = exports.CreateEmailRequestSchema = exports.EmailRequestSchema = exports.EmailAttachmentSchema = exports.EmailRecipientSchema = 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 email request and delivery tracking schema definitions.
9
+ * @module conversation/outbound-email
10
+ *
11
+ * Email requests represent outbound email communications sent through the platform.
12
+ * Supports scheduling, templates, attachments, and delivery tracking with retry logic.
13
+ */
14
+ // ============================================================================
15
+ // EMAIL RECIPIENT SCHEMA
16
+ // ============================================================================
17
+ /**
18
+ * Email recipient schema (embedded in EmailRequestSchema).
19
+ *
20
+ * @see EmailRequestSchema - Uses this for recipient arrays
21
+ */
22
+ exports.EmailRecipientSchema = zod_1.z.object({
23
+ email: zod_1.z.string().email("Must be a valid email address").describe("Email address of the recipient in standard format (e.g., 'user@example.com'). Must be a valid, deliverable email address."),
24
+ name: zod_1.z.string().optional().describe("Optional display name for the recipient shown in email clients (e.g., 'John Smith'). When provided, email displays as 'John Smith <user@example.com>'."),
25
+ });
26
+ // ============================================================================
27
+ // EMAIL ATTACHMENT SCHEMA
28
+ // ============================================================================
29
+ /**
30
+ * Email attachment schema (embedded in EmailRequestSchema).
31
+ *
32
+ * @see EmailRequestSchema - Uses this for file attachments
33
+ */
34
+ exports.EmailAttachmentSchema = zod_1.z.object({
35
+ filename: zod_1.z.string().min(1, "Filename is required").describe("Name of the attachment file as displayed to the recipient (e.g., 'invoice.pdf', 'report.xlsx'). Include appropriate file extension."),
36
+ content: zod_1.z.string().min(1, "Content is required").describe("Base64-encoded file content. Encode binary files to base64 string for safe transmission in JSON payloads."),
37
+ contentType: zod_1.z.string().min(1, "Content type is required").describe("MIME type of the attachment indicating file format (e.g., 'application/pdf', 'image/png', 'text/csv'). Ensures correct handling by email clients."),
38
+ });
39
+ // ============================================================================
40
+ // EMAIL REQUEST SCHEMA
41
+ // ============================================================================
42
+ /**
43
+ * Email request schema.
44
+ *
45
+ * @typedef {Object} EmailRequest
46
+ * @property {string} [emailConfigurationId] - Email configuration for sender settings. May be provided or system falls back to default platform email
47
+ * @property {string} [configuredEmailAddress] - Configured sender email address. May be provided or system falls back to default platform email
48
+ * @property {string} [templateId] - Pre-defined template ID for structured content
49
+ * @property {Array} to - Primary recipients (required, at least one)
50
+ * @property {Array} [cc] - Carbon copy recipients
51
+ * @property {Array} [bcc] - Blind carbon copy recipients
52
+ * @property {string} [replyTo] - Reply-to email address
53
+ * @property {string} subject - Email subject line
54
+ * @property {string} bodyHtml - HTML content of the email body
55
+ * @property {string} [bodyText] - Plain text alternative content
56
+ * @property {Object} [variables] - Template variable substitutions
57
+ * @property {Array} [attachments] - File attachments
58
+ * @property {number} [scheduledAt] - Unix timestamp for scheduled delivery
59
+ * @property {string} [serviceConversationConfigId] - Linked conversation record
60
+ * @property {Object} [metadata] - Additional custom metadata
61
+ */
62
+ exports.EmailRequestSchema = base_schema_1.BaseModelSchema.safeExtend({
63
+ emailConfigurationId: zod_1.z.string().optional().describe("Email configuration ID for sender settings, API credentials, and domain authentication (references EmailConfiguration). May be provided or system falls back to default platform email."),
64
+ configuredEmailAddress: zod_1.z.string().optional().describe("Configured sender email address for this request. May be provided or system falls back to default platform email."),
65
+ templateId: zod_1.z.string().optional().describe("Pre-defined email template ID for structured content with variable placeholders (references EmailTemplate). Template content merged with variables field."),
66
+ // Recipients
67
+ to: zod_1.z.array(exports.EmailRecipientSchema).min(1, "At least one recipient is required").describe("Array of primary email recipients. Each recipient includes email address and optional display name. At least one recipient required."),
68
+ cc: zod_1.z.array(exports.EmailRecipientSchema).nullable().optional().describe("Array of carbon copy recipients who receive a copy of the email with visibility to other recipients. Use for stakeholders who should be informed."),
69
+ bcc: zod_1.z.array(exports.EmailRecipientSchema).nullable().optional().describe("Array of blind carbon copy recipients who receive a copy without visibility to other recipients. Use for compliance, archiving, or discrete notifications."),
70
+ replyTo: zod_1.z.string().nullable().optional().describe("Reply-to email address that receives responses when recipients reply to this email. Useful for directing replies to support queues or specific team members."),
71
+ // Content
72
+ subject: zod_1.z.string().min(1, "Subject is required").describe("Email subject line displayed in recipient inbox. Keep concise and descriptive (50-60 characters recommended). Supports variable substitution with {{variable}} syntax."),
73
+ bodyHtml: zod_1.z.string().min(1, "HTML body is required").describe("HTML content of the email body supporting rich formatting, images, links, and styling. Ensure HTML is well-formed and includes plain text fallback for accessibility."),
74
+ bodyText: zod_1.z.string().optional().describe("Plain text alternative content displayed when HTML cannot be rendered. Recommended for accessibility and email client compatibility. Auto-generated from HTML if omitted."),
75
+ variables: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Template variable substitutions as key-value pairs. Keys correspond to {{placeholder}} syntax in subject, bodyHtml, and bodyText fields."),
76
+ attachments: zod_1.z.array(exports.EmailAttachmentSchema).nullable().optional().describe("Array of file attachments to include with the email. Each attachment includes filename, base64-encoded content, and MIME type. Total size should not exceed 25MB."),
77
+ // Scheduling
78
+ scheduledAt: zod_1.z.number().optional().describe("Unix timestamp in milliseconds for scheduled email delivery. Email queued until this time, then sent automatically. Omit for immediate delivery."),
79
+ serviceConversationConfigId: zod_1.z.string().nullable().optional().describe("Linked conversation record ID for email thread tracking and conversation history aggregation (references ServiceConversationConfig). Enables email conversation threading."),
80
+ // Status
81
+ status: zod_1.z.enum(type_definitions_1.EmailStatus).default(type_definitions_1.EmailStatus.QUEUED).describe("Current delivery status of the email request (queued, sent, delivered, bounced, failed, complained)."),
82
+ // Retry configuration
83
+ maxRetries: zod_1.z.number().int().min(0).max(5).optional().describe("Maximum number of retry attempts if email delivery fails (0-5). Set to 0 to disable retries."),
84
+ retryCount: zod_1.z.number().int().min(0).max(5).default(0).describe("Current count of retry attempts made for this email request."),
85
+ retryDelayMinutes: zod_1.z.number().int().positive().optional().describe("Delay in minutes between retry attempts for failed deliveries."),
86
+ // Extensibility
87
+ 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."),
88
+ });
89
+ // ============================================================================
90
+ // CREATE/UPDATE SCHEMAS
91
+ // ============================================================================
92
+ /**
93
+ * Schema for creating a new email request.
94
+ * Omits auto-generated fields.
95
+ */
96
+ exports.CreateEmailRequestSchema = exports.EmailRequestSchema.omit({
97
+ id: true,
98
+ createdAt: true,
99
+ updatedAt: true,
100
+ });
101
+ /**
102
+ * Schema for updating an existing email request.
103
+ * All fields optional except id (required).
104
+ */
105
+ exports.UpdateEmailRequestSchema = exports.CreateEmailRequestSchema.partial().safeExtend({
106
+ id: zod_1.z.string().describe("Unique identifier of the EmailRequest to update"),
107
+ });
108
+ // ============================================================================
109
+ // EMAIL RECORD SCHEMA (DELIVERY TRACKING)
110
+ // ============================================================================
111
+ /**
112
+ * Email record schema for tracking delivery status.
113
+ *
114
+ * Records individual delivery events and status updates from email providers.
115
+ * Links to the original EmailRequest and tracks provider-specific message IDs.
116
+ *
117
+ * @typedef {Object} EmailRecord
118
+ * @property {string} emailRequestId - Reference to the original email request
119
+ * @property {string} providerMessageId - Provider-specific message ID
120
+ * @property {EmailStatus} status - Current delivery status
121
+ * @property {number} [sentAt] - Timestamp when email was sent
122
+ * @property {number} [deliveredAt] - Timestamp when email was delivered
123
+ * @property {number} [bouncedAt] - Timestamp when email bounced
124
+ * @property {string} [errorCode] - Provider error code if failed
125
+ * @property {string} [errorMessage] - Provider error message if failed
126
+ * @property {Object} [metadata] - Additional provider metadata
127
+ */
128
+ exports.EmailRecordSchema = base_schema_1.BaseModelSchema.safeExtend({
129
+ emailRequestId: zod_1.z.string().describe("Reference to the original EmailRequest this record tracks"),
130
+ providerMessageId: zod_1.z.string().describe("Provider-specific message ID from the email service (SendGrid, SES, etc.)"),
131
+ status: zod_1.z.enum(type_definitions_1.EmailStatus).describe("Current delivery status from provider webhooks"),
132
+ sentAt: zod_1.z.number().optional().describe("Unix timestamp when email was sent to provider"),
133
+ deliveredAt: zod_1.z.number().optional().describe("Unix timestamp when email was confirmed delivered"),
134
+ bouncedAt: zod_1.z.number().optional().describe("Unix timestamp when email bounced"),
135
+ errorCode: zod_1.z.string().optional().describe("Provider-specific error code if delivery failed"),
136
+ errorMessage: zod_1.z.string().optional().describe("Provider error message describing failure reason"),
137
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Additional provider-specific metadata from webhooks"),
138
+ });
139
+ // ============================================================================
140
+ // EMAIL REQUEST RESULT SCHEMA
141
+ // ============================================================================
142
+ /**
143
+ * Email request result schema.
144
+ * Response payload after submitting an email request.
145
+ */
146
+ exports.EmailRequestResultSchema = zod_1.z.object({
147
+ success: zod_1.z.boolean().optional().default(false).describe("Whether the email request was successful"),
148
+ request: exports.EmailRequestSchema.optional().nullable().describe("Original email request details"),
149
+ error_message: zod_1.z.string().optional().nullable().describe("Error message if the request failed"),
150
+ });
@@ -0,0 +1,163 @@
1
+ import { z } from "zod";
2
+ import { SmsStatus } from "../type-definitions";
3
+ /**
4
+ * @fileoverview Outbound SMS request schema definitions.
5
+ * @module conversation/outbound-sms
6
+ *
7
+ * SMS requests represent outbound text message communications sent through the platform.
8
+ * Supports scheduling, templates, delivery tracking, and retry logic for failed deliveries.
9
+ */
10
+ /**
11
+ * SMS request schema.
12
+ *
13
+ * @typedef {Object} SmsRequest
14
+ * @property {string} [phoneConfigurationId] - Phone configuration for sender number
15
+ * @property {string} to - Recipient phone number in E.164 format
16
+ * @property {string} [from] - Sender phone number in E.164 format
17
+ * @property {string} body - Text content of the SMS message
18
+ * @property {string} [templateId] - Pre-defined template ID for structured content
19
+ * @property {Object} [variables] - Template variable substitutions
20
+ * @property {number} [scheduledAt] - Unix timestamp for scheduled delivery
21
+ * @property {SmsStatus} status - Current delivery status
22
+ * @property {string} [serviceConversationConfigId] - Linked conversation record
23
+ * @property {number} [maxRetries] - Maximum retry attempts (0-5)
24
+ * @property {number} retryCount - Current retry attempt count
25
+ * @property {number} [retryDelayMinutes] - Delay between retries in minutes
26
+ * @property {Object} [metadata] - Additional custom metadata
27
+ */
28
+ export declare const SmsRequestSchema: z.ZodObject<{
29
+ id: z.ZodString;
30
+ createdAt: z.ZodOptional<z.ZodNumber>;
31
+ updatedAt: z.ZodOptional<z.ZodNumber>;
32
+ phoneConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
+ to: z.ZodString;
34
+ from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
+ body: z.ZodString;
36
+ templateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ variables: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
38
+ scheduledAt: z.ZodOptional<z.ZodNumber>;
39
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
+ status: z.ZodDefault<z.ZodEnum<typeof SmsStatus>>;
41
+ maxRetries: z.ZodOptional<z.ZodNumber>;
42
+ retryCount: z.ZodDefault<z.ZodNumber>;
43
+ retryDelayMinutes: z.ZodOptional<z.ZodNumber>;
44
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
45
+ }, z.core.$strip>;
46
+ /**
47
+ * Schema for creating a new SMS request.
48
+ * Omits auto-generated fields.
49
+ */
50
+ export declare const CreateSmsRequestSchema: z.ZodObject<{
51
+ status: z.ZodDefault<z.ZodEnum<typeof SmsStatus>>;
52
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
53
+ phoneConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
+ to: z.ZodString;
57
+ scheduledAt: z.ZodOptional<z.ZodNumber>;
58
+ maxRetries: z.ZodOptional<z.ZodNumber>;
59
+ retryDelayMinutes: z.ZodOptional<z.ZodNumber>;
60
+ templateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ variables: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
62
+ retryCount: z.ZodDefault<z.ZodNumber>;
63
+ body: z.ZodString;
64
+ }, z.core.$strip>;
65
+ /**
66
+ * Schema for updating an existing SMS request.
67
+ * All fields optional except id (required).
68
+ */
69
+ export declare const UpdateSmsRequestSchema: z.ZodObject<{
70
+ status: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof SmsStatus>>>;
71
+ metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
72
+ phoneConfigurationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
73
+ serviceConversationConfigId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
74
+ from: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
75
+ to: z.ZodOptional<z.ZodString>;
76
+ scheduledAt: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
77
+ maxRetries: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
78
+ retryDelayMinutes: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
79
+ templateId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
80
+ variables: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
81
+ retryCount: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
82
+ body: z.ZodOptional<z.ZodString>;
83
+ id: z.ZodString;
84
+ }, z.core.$strip>;
85
+ /**
86
+ * SMS request result schema.
87
+ * Response payload after submitting an SMS request.
88
+ */
89
+ export declare const SmsRequestResultSchema: z.ZodObject<{
90
+ success: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
91
+ request: z.ZodNullable<z.ZodOptional<z.ZodObject<{
92
+ id: z.ZodString;
93
+ createdAt: z.ZodOptional<z.ZodNumber>;
94
+ updatedAt: z.ZodOptional<z.ZodNumber>;
95
+ phoneConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
96
+ to: z.ZodString;
97
+ from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
+ body: z.ZodString;
99
+ templateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
100
+ variables: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
101
+ scheduledAt: z.ZodOptional<z.ZodNumber>;
102
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
+ status: z.ZodDefault<z.ZodEnum<typeof SmsStatus>>;
104
+ maxRetries: z.ZodOptional<z.ZodNumber>;
105
+ retryCount: z.ZodDefault<z.ZodNumber>;
106
+ retryDelayMinutes: z.ZodOptional<z.ZodNumber>;
107
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
108
+ }, z.core.$strip>>>;
109
+ error_message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
110
+ }, z.core.$strip>;
111
+ export type SmsRequest = z.infer<typeof SmsRequestSchema>;
112
+ export type CreateSmsRequest = z.infer<typeof CreateSmsRequestSchema>;
113
+ export type UpdateSmsRequest = z.infer<typeof UpdateSmsRequestSchema>;
114
+ export type SmsRequestResult = z.infer<typeof SmsRequestResultSchema>;
115
+ /**
116
+ * SMS request filter options.
117
+ * @interface SmsRequestFilters
118
+ */
119
+ export interface SmsRequestFilters {
120
+ /** Text search across phone numbers and body */
121
+ search?: string;
122
+ /** Filter by phone configuration ID */
123
+ phoneConfigurationId?: string;
124
+ /** Filter by recipient phone number */
125
+ to?: string;
126
+ /** Filter by sender phone number */
127
+ from?: string;
128
+ /** Filter by template ID */
129
+ templateId?: string;
130
+ /** Filter by delivery status */
131
+ status?: SmsStatus;
132
+ /** Filter by linked conversation ID */
133
+ serviceConversationConfigId?: string;
134
+ /** Filter by scheduled date range */
135
+ scheduledAtRange?: {
136
+ from?: number;
137
+ to?: number;
138
+ };
139
+ }
140
+ /**
141
+ * SMS request sorting options.
142
+ * @interface SmsRequestSorting
143
+ */
144
+ export interface SmsRequestSorting {
145
+ /** Field to sort by */
146
+ field: "createdAt" | "scheduledAt" | "status" | "retryCount";
147
+ /** Sort direction */
148
+ direction: "asc" | "desc";
149
+ }
150
+ /**
151
+ * SMS request query options.
152
+ * @interface SmsRequestQueryOptions
153
+ */
154
+ export interface SmsRequestQueryOptions {
155
+ /** Page number (1-indexed) */
156
+ page: number;
157
+ /** Items per page */
158
+ pageSize: number;
159
+ /** Optional filters */
160
+ filters?: SmsRequestFilters;
161
+ /** Optional sorting */
162
+ sorting?: SmsRequestSorting;
163
+ }
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SmsRequestResultSchema = exports.UpdateSmsRequestSchema = exports.CreateSmsRequestSchema = exports.SmsRequestSchema = 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 SMS request schema definitions.
9
+ * @module conversation/outbound-sms
10
+ *
11
+ * SMS requests represent outbound text message communications sent through the platform.
12
+ * Supports scheduling, templates, delivery tracking, and retry logic for failed deliveries.
13
+ */
14
+ // ============================================================================
15
+ // SMS REQUEST SCHEMA
16
+ // ============================================================================
17
+ /**
18
+ * SMS request schema.
19
+ *
20
+ * @typedef {Object} SmsRequest
21
+ * @property {string} [phoneConfigurationId] - Phone configuration for sender number
22
+ * @property {string} to - Recipient phone number in E.164 format
23
+ * @property {string} [from] - Sender phone number in E.164 format
24
+ * @property {string} body - Text content of the SMS message
25
+ * @property {string} [templateId] - Pre-defined template ID for structured content
26
+ * @property {Object} [variables] - Template variable substitutions
27
+ * @property {number} [scheduledAt] - Unix timestamp for scheduled delivery
28
+ * @property {SmsStatus} status - Current delivery status
29
+ * @property {string} [serviceConversationConfigId] - Linked conversation record
30
+ * @property {number} [maxRetries] - Maximum retry attempts (0-5)
31
+ * @property {number} retryCount - Current retry attempt count
32
+ * @property {number} [retryDelayMinutes] - Delay between retries in minutes
33
+ * @property {Object} [metadata] - Additional custom metadata
34
+ */
35
+ exports.SmsRequestSchema = base_schema_1.BaseModelSchema.safeExtend({
36
+ phoneConfigurationId: zod_1.z.string().nullable().optional().describe("Phone configuration ID for sender number settings and carrier routing (references PhoneConfiguration). When omitted, uses organization default SMS-enabled number."),
37
+ to: zod_1.z.string().min(1, "Recipient phone number is required").describe("Recipient phone number in E.164 international format (e.g., '+12125551234'). Must be a valid mobile number capable of receiving SMS messages."),
38
+ from: zod_1.z.string().nullable().optional().describe("Sender phone number in E.164 format or short code (e.g., '12345') displayed to the recipient. Must be a verified SMS-enabled number or short code owned by the organization. Uses default from phoneConfigurationId if omitted."),
39
+ // Content
40
+ body: zod_1.z.string().min(1, "Message body is required").describe("Text content of the SMS message. Standard SMS supports 160 characters (GSM-7), unicode messages 70 characters per segment. Longer messages automatically split into multiple segments."),
41
+ templateId: zod_1.z.string().nullable().optional().describe("Pre-defined SMS template ID for structured content with variable placeholders (references SmsTemplate). Template content merged with variables field for personalization."),
42
+ variables: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable().optional().describe("Template variable substitutions as key-value pairs. Keys correspond to {{placeholder}} syntax in body field (e.g., {firstName: 'John', appointmentTime: '3:00 PM'})."),
43
+ // Scheduling
44
+ scheduledAt: zod_1.z.number().optional().describe("Unix timestamp in milliseconds for scheduled SMS delivery. Message queued until this time, then sent automatically. Omit for immediate delivery."),
45
+ serviceConversationConfigId: zod_1.z.string().nullable().optional().describe("Linked conversation record ID for SMS thread tracking and conversation history aggregation (references ServiceConversationConfig). Enables SMS conversation threading."),
46
+ // Status
47
+ status: zod_1.z.enum(type_definitions_1.SmsStatus).default(type_definitions_1.SmsStatus.QUEUED).describe("Current delivery status of the SMS request (queued, sent, delivered, failed, undelivered)."),
48
+ // Retry configuration
49
+ maxRetries: zod_1.z.number().int().min(0).max(5).optional().describe("Maximum number of retry attempts if SMS delivery fails (0-5). Set to 0 to disable retries."),
50
+ retryCount: zod_1.z.number().int().min(0).max(5).default(0).describe("Current count of retry attempts made for this SMS request."),
51
+ retryDelayMinutes: zod_1.z.number().int().positive().optional().describe("Delay in minutes between retry attempts for failed deliveries."),
52
+ // Extensibility
53
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable().optional().describe("Additional custom metadata as key-value pairs for campaign tracking, CRM integration, or application-specific data. Not processed by the platform."),
54
+ });
55
+ // ============================================================================
56
+ // CREATE/UPDATE SCHEMAS
57
+ // ============================================================================
58
+ /**
59
+ * Schema for creating a new SMS request.
60
+ * Omits auto-generated fields.
61
+ */
62
+ exports.CreateSmsRequestSchema = exports.SmsRequestSchema.omit({
63
+ id: true,
64
+ createdAt: true,
65
+ updatedAt: true,
66
+ });
67
+ /**
68
+ * Schema for updating an existing SMS request.
69
+ * All fields optional except id (required).
70
+ */
71
+ exports.UpdateSmsRequestSchema = exports.CreateSmsRequestSchema.partial().safeExtend({
72
+ id: zod_1.z.string().describe("Unique identifier of the SmsRequest to update"),
73
+ });
74
+ // ============================================================================
75
+ // SMS REQUEST RESULT SCHEMA
76
+ // ============================================================================
77
+ /**
78
+ * SMS request result schema.
79
+ * Response payload after submitting an SMS request.
80
+ */
81
+ exports.SmsRequestResultSchema = zod_1.z.object({
82
+ success: zod_1.z.boolean().optional().default(false).describe("Whether the SMS request was successful"),
83
+ request: exports.SmsRequestSchema.optional().nullable().describe("Original SMS request details"),
84
+ error_message: zod_1.z.string().optional().nullable().describe("Error message if the request failed"),
85
+ });