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,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentCapabilities = exports.AgentRoleTemplateIdentifier = exports.LLMRequestType = exports.SupportedLLMKit = exports.SupportedProprietor = exports.LLMType = exports.AssistantType = exports.DeploymentProvisioningType = exports.OttCommunicationType = exports.MobilePlatform = exports.PhoneNumberType = exports.PhoneStatus = exports.PhonePurchaseStatus = exports.EmailProviderType = exports.ProviderType = exports.DeploymentStatus = exports.DeploymentType = void 0;
4
+ const account_definitions_1 = require("./account-definitions");
5
+ // Enums
6
+ var DeploymentType;
7
+ (function (DeploymentType) {
8
+ DeploymentType["CALLS"] = "calls";
9
+ DeploymentType["SMS"] = "sms";
10
+ DeploymentType["WEB"] = "web";
11
+ DeploymentType["MOBILE"] = "mobile-app";
12
+ DeploymentType["WHATSAPP"] = "whatsapp";
13
+ DeploymentType["EMAIL"] = "email";
14
+ })(DeploymentType || (exports.DeploymentType = DeploymentType = {}));
15
+ var DeploymentStatus;
16
+ (function (DeploymentStatus) {
17
+ DeploymentStatus["PENDING"] = "pending";
18
+ DeploymentStatus["ACTIVE"] = "active";
19
+ DeploymentStatus["PAUSED"] = "paused";
20
+ DeploymentStatus["ARCHIVED"] = "archived";
21
+ })(DeploymentStatus || (exports.DeploymentStatus = DeploymentStatus = {}));
22
+ var ProviderType;
23
+ (function (ProviderType) {
24
+ ProviderType["TWILIO"] = "twilio";
25
+ ProviderType["SIGNALWIRE"] = "signal-wire";
26
+ ProviderType["TELNYX"] = "telnyx";
27
+ ProviderType["MESSAGEBIRD"] = "messagebird";
28
+ ProviderType["SNS"] = "sns";
29
+ })(ProviderType || (exports.ProviderType = ProviderType = {}));
30
+ var EmailProviderType;
31
+ (function (EmailProviderType) {
32
+ EmailProviderType["GOOGLE"] = "google";
33
+ EmailProviderType["OUTLOOK"] = "outlook";
34
+ EmailProviderType["SENDGRID"] = "sendgrid";
35
+ EmailProviderType["SES"] = "ses";
36
+ EmailProviderType["MAILGUN"] = "mailgun";
37
+ EmailProviderType["POSTMARK"] = "postmark";
38
+ EmailProviderType["SMTP"] = "smtp";
39
+ })(EmailProviderType || (exports.EmailProviderType = EmailProviderType = {}));
40
+ var PhonePurchaseStatus;
41
+ (function (PhonePurchaseStatus) {
42
+ PhonePurchaseStatus["PENDING"] = "pending";
43
+ PhonePurchaseStatus["COMPLETED"] = "completed";
44
+ PhonePurchaseStatus["FAILED"] = "failed";
45
+ PhonePurchaseStatus["CANCELLED"] = "cancelled";
46
+ })(PhonePurchaseStatus || (exports.PhonePurchaseStatus = PhonePurchaseStatus = {}));
47
+ var PhoneStatus;
48
+ (function (PhoneStatus) {
49
+ PhoneStatus["ACTIVE"] = "ACTIVE";
50
+ PhoneStatus["INACTIVE"] = "INACTIVE";
51
+ PhoneStatus["SMS_ACTIVE"] = "SMS_ACTIVE";
52
+ PhoneStatus["CALL_ACTIVE"] = "CALL_ACTIVE";
53
+ })(PhoneStatus || (exports.PhoneStatus = PhoneStatus = {}));
54
+ var PhoneNumberType;
55
+ (function (PhoneNumberType) {
56
+ PhoneNumberType["LOCAL"] = "local";
57
+ PhoneNumberType["TOLL_FREE"] = "toll-free";
58
+ })(PhoneNumberType || (exports.PhoneNumberType = PhoneNumberType = {}));
59
+ var MobilePlatform;
60
+ (function (MobilePlatform) {
61
+ MobilePlatform["IOS"] = "ios";
62
+ MobilePlatform["ANDROID"] = "android";
63
+ // WEB = 'web',
64
+ })(MobilePlatform || (exports.MobilePlatform = MobilePlatform = {}));
65
+ // Communication types enum
66
+ var OttCommunicationType;
67
+ (function (OttCommunicationType) {
68
+ OttCommunicationType["TEXT"] = "text";
69
+ OttCommunicationType["VOICE"] = "voice";
70
+ OttCommunicationType["UNIFIED"] = "unified";
71
+ })(OttCommunicationType || (exports.OttCommunicationType = OttCommunicationType = {}));
72
+ var DeploymentProvisioningType;
73
+ (function (DeploymentProvisioningType) {
74
+ DeploymentProvisioningType["DIRECT"] = "direct";
75
+ DeploymentProvisioningType["CHAINED"] = "chained";
76
+ })(DeploymentProvisioningType || (exports.DeploymentProvisioningType = DeploymentProvisioningType = {}));
77
+ var AssistantType;
78
+ (function (AssistantType) {
79
+ AssistantType["PHONE"] = "phone";
80
+ AssistantType["WEB"] = "web";
81
+ AssistantType["EMAIL"] = "email";
82
+ AssistantType["GENERAL"] = "general";
83
+ })(AssistantType || (exports.AssistantType = AssistantType = {}));
84
+ var LLMType;
85
+ (function (LLMType) {
86
+ LLMType["STS"] = "sts";
87
+ LLMType["TTS"] = "tts";
88
+ LLMType["STT"] = "stt";
89
+ LLMType["TRANSCRIBE"] = "transcribe";
90
+ LLMType["TEXT_PROCESSING"] = "text";
91
+ // IMAGE = 'image',
92
+ // VIDEO = 'video',
93
+ LLMType["MULTI_MODE"] = "multi_mode";
94
+ })(LLMType || (exports.LLMType = LLMType = {}));
95
+ var SupportedProprietor;
96
+ (function (SupportedProprietor) {
97
+ SupportedProprietor["OPENAI"] = "OpenAI";
98
+ SupportedProprietor["GOOGLE"] = "Google";
99
+ SupportedProprietor["ANTHROPIC"] = "Anthropic";
100
+ SupportedProprietor["GROQ"] = "Groq";
101
+ SupportedProprietor["XAI"] = "xAI";
102
+ SupportedProprietor["DEEPGRAM"] = "Deepgram";
103
+ SupportedProprietor["ELEVENLABS"] = "ElevenLabs";
104
+ SupportedProprietor["DEEPSEEK"] = "DeepSeek";
105
+ SupportedProprietor["CARTESIA"] = "Cartesia";
106
+ })(SupportedProprietor || (exports.SupportedProprietor = SupportedProprietor = {}));
107
+ var SupportedLLMKit;
108
+ (function (SupportedLLMKit) {
109
+ SupportedLLMKit["OPEN_AI"] = "openai-kit";
110
+ SupportedLLMKit["GOOGLE"] = "google-kit";
111
+ SupportedLLMKit["ANTHROPIC"] = "anthropic-kit";
112
+ SupportedLLMKit["GROQ"] = "groq-kit";
113
+ SupportedLLMKit["XAI"] = "xai-kit";
114
+ SupportedLLMKit["DEEPGRAM"] = "deepgram-kit";
115
+ SupportedLLMKit["ELEVENLABS"] = "elevenlabs-kit";
116
+ SupportedLLMKit["DEEPSEEK"] = "deepseek-kit";
117
+ SupportedLLMKit["CARTESIA"] = "cartesia-kit";
118
+ })(SupportedLLMKit || (exports.SupportedLLMKit = SupportedLLMKit = {}));
119
+ var LLMRequestType;
120
+ (function (LLMRequestType) {
121
+ LLMRequestType["TEXT"] = "text";
122
+ LLMRequestType["AUDIO"] = "audio";
123
+ LLMRequestType["IMAGE"] = "image";
124
+ LLMRequestType["VIDEO"] = "video";
125
+ LLMRequestType["MULTIMODAL"] = "multimodal";
126
+ })(LLMRequestType || (exports.LLMRequestType = LLMRequestType = {}));
127
+ var AgentRoleTemplateIdentifier;
128
+ (function (AgentRoleTemplateIdentifier) {
129
+ AgentRoleTemplateIdentifier["CUSTOMER_SUPPORT_GENERAL"] = "customer-support-general";
130
+ AgentRoleTemplateIdentifier["TECHNICAL_SUPPORT_SPECIALIST"] = "technical-support-specialist";
131
+ AgentRoleTemplateIdentifier["SALES_REPRESENTATIVE"] = "sales-representative";
132
+ AgentRoleTemplateIdentifier["ONBOARDING_SPECIALIST"] = "onboarding-specialist";
133
+ AgentRoleTemplateIdentifier["BILLING_SUPPORT_SPECIALIST"] = "billing-support-specialist";
134
+ })(AgentRoleTemplateIdentifier || (exports.AgentRoleTemplateIdentifier = AgentRoleTemplateIdentifier = {}));
135
+ exports.AgentCapabilities = account_definitions_1.BusinessSupportServices;
@@ -0,0 +1,19 @@
1
+ import { DeploymentChannelType } from "../service-configuration/interaction-channels.schema";
2
+ import { DeploymentType } from "../type-definitions";
3
+ /**
4
+ * Helper function for runtime type checking.
5
+ *
6
+ * Returns the deployment type of a channel.
7
+ *
8
+ * @param channel - The deployment channel to check
9
+ * @returns The deployment type
10
+ */
11
+ export declare function getDeploymentChannelType(channel: DeploymentChannelType): DeploymentType;
12
+ /**
13
+ * Validation helper that provides better error messages.
14
+ *
15
+ * @param data - The data to validate as a deployment channel
16
+ * @returns Validated deployment channel
17
+ * @throws Error with specific message for validation failures
18
+ */
19
+ export declare function validateDeploymentChannel(data: unknown): DeploymentChannelType;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getDeploymentChannelType = getDeploymentChannelType;
7
+ exports.validateDeploymentChannel = validateDeploymentChannel;
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const interaction_channels_schema_1 = require("../service-configuration/interaction-channels.schema");
10
+ /**
11
+ * Helper function for runtime type checking.
12
+ *
13
+ * Returns the deployment type of a channel.
14
+ *
15
+ * @param channel - The deployment channel to check
16
+ * @returns The deployment type
17
+ */
18
+ function getDeploymentChannelType(channel) {
19
+ return channel.deploymentType;
20
+ }
21
+ /**
22
+ * Validation helper that provides better error messages.
23
+ *
24
+ * @param data - The data to validate as a deployment channel
25
+ * @returns Validated deployment channel
26
+ * @throws Error with specific message for validation failures
27
+ */
28
+ function validateDeploymentChannel(data) {
29
+ try {
30
+ return interaction_channels_schema_1.DeploymentChannelSchema.parse(data);
31
+ }
32
+ catch (error) {
33
+ if (error instanceof zod_1.default.ZodError) {
34
+ const deploymentType = data?.deploymentType;
35
+ console.error(`Validation failed for deployment type: ${deploymentType}`, error.issues);
36
+ throw new Error(`Invalid deployment channel configuration for type: ${deploymentType}`);
37
+ }
38
+ throw error;
39
+ }
40
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @fileoverview Central export point for validation utilities.
3
+ * @module validators
4
+ */
5
+ export * from './channel-validation';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Central export point for validation utilities.
4
+ * @module validators
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./channel-validation"), exports);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @fileoverview Main entry point for the Wiil Platform Data Model Definitions.
3
+ * @module wiil-core-js
4
+ */
5
+ export * from './core';
6
+ export * from './request';
package/dist/index.js ADDED
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Main entry point for the Wiil Platform Data Model Definitions.
4
+ * @module wiil-core-js
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ // Core schemas and types
22
+ __exportStar(require("./core"), exports);
23
+ // Request schemas and utilities
24
+ __exportStar(require("./request"), exports);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @fileoverview Central export point for request schemas and utilities.
3
+ * @module request
4
+ */
5
+ export * from './models';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Central export point for request schemas and utilities.
4
+ * @module request
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./models"), exports);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @fileoverview Central export point for request model schemas.
3
+ * @module request/models
4
+ */
5
+ export * from './paginated-quest.schema';
6
+ export * from './paginated-result.schema';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Central export point for request model schemas.
4
+ * @module request/models
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./paginated-quest.schema"), exports);
22
+ __exportStar(require("./paginated-result.schema"), exports);
@@ -0,0 +1,33 @@
1
+ import z from "zod";
2
+ /**
3
+ * @fileoverview Timestamp-based query schema definitions for filtering records.
4
+ * @module request/models/paginated-quest
5
+ */
6
+ /**
7
+ * Schema for queries based on a specific timestamp.
8
+ *
9
+ * @typedef {Object} TimestampQuery
10
+ * @property {number} fromTimestamp - Unix timestamp to filter records (e.g., for fetching updates since this time)
11
+ * @property {number} [toTimestamp] - Optional end Unix timestamp to filter records up to this time
12
+ */
13
+ export declare const TimestampQuerySchema: z.ZodObject<{
14
+ fromTimestamp: z.ZodNumber;
15
+ toTimestamp: z.ZodOptional<z.ZodNumber>;
16
+ }, z.core.$strip>;
17
+ export type TimestampQuery = z.infer<typeof TimestampQuerySchema>;
18
+ /**
19
+ * Schema for paginated queries based on a specific timestamp.
20
+ *
21
+ * @typedef {Object} AccountPaginatedTimestampQuery
22
+ * @property {number} fromTimestamp - Unix timestamp to filter records
23
+ * @property {number} [toTimestamp] - Optional end Unix timestamp
24
+ * @property {number} page - Page number for pagination, starting from 1
25
+ * @property {number} pageSize - Number of records per page, max 100
26
+ */
27
+ export declare const AccountPaginatedTimestampQuerySchema: z.ZodObject<{
28
+ fromTimestamp: z.ZodNumber;
29
+ toTimestamp: z.ZodOptional<z.ZodNumber>;
30
+ page: z.ZodDefault<z.ZodNumber>;
31
+ pageSize: z.ZodDefault<z.ZodNumber>;
32
+ }, z.core.$strip>;
33
+ export type AccountPaginatedTimestampQuery = z.infer<typeof AccountPaginatedTimestampQuerySchema>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AccountPaginatedTimestampQuerySchema = exports.TimestampQuerySchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ /**
9
+ * @fileoverview Timestamp-based query schema definitions for filtering records.
10
+ * @module request/models/paginated-quest
11
+ */
12
+ /**
13
+ * Schema for queries based on a specific timestamp.
14
+ *
15
+ * @typedef {Object} TimestampQuery
16
+ * @property {number} fromTimestamp - Unix timestamp to filter records (e.g., for fetching updates since this time)
17
+ * @property {number} [toTimestamp] - Optional end Unix timestamp to filter records up to this time
18
+ */
19
+ exports.TimestampQuerySchema = zod_1.default.object({
20
+ fromTimestamp: zod_1.default.number(),
21
+ toTimestamp: zod_1.default.number().optional(),
22
+ });
23
+ /**
24
+ * Schema for paginated queries based on a specific timestamp.
25
+ *
26
+ * @typedef {Object} AccountPaginatedTimestampQuery
27
+ * @property {number} fromTimestamp - Unix timestamp to filter records
28
+ * @property {number} [toTimestamp] - Optional end Unix timestamp
29
+ * @property {number} page - Page number for pagination, starting from 1
30
+ * @property {number} pageSize - Number of records per page, max 100
31
+ */
32
+ exports.AccountPaginatedTimestampQuerySchema = exports.TimestampQuerySchema.safeExtend({
33
+ page: zod_1.default.number().min(1).default(1),
34
+ pageSize: zod_1.default.number().min(1).max(100).default(20),
35
+ });
@@ -0,0 +1,124 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * @fileoverview Pagination schema definitions for paginated API responses.
4
+ * @module request/models/paginated-result
5
+ */
6
+ /**
7
+ * Pagination metadata schema.
8
+ *
9
+ * @typedef {Object} PaginationMeta
10
+ * @property {number} page - Current page number (1-based indexing)
11
+ * @property {number} pageSize - Number of items per page - limited to 1000 for performance
12
+ * @property {number} totalCount - Total number of items across all pages
13
+ * @property {number} totalPages - Total number of pages available
14
+ * @property {boolean} hasNextPage - Whether there is a next page available for navigation
15
+ * @property {boolean} hasPreviousPage - Whether there is a previous page available for navigation
16
+ */
17
+ export declare const PaginationMetaSchema: z.ZodObject<{
18
+ page: z.ZodNumber;
19
+ pageSize: z.ZodNumber;
20
+ totalCount: z.ZodNumber;
21
+ totalPages: z.ZodNumber;
22
+ hasNextPage: z.ZodBoolean;
23
+ hasPreviousPage: z.ZodBoolean;
24
+ }, z.core.$strip>;
25
+ /**
26
+ * Generic function to create a paginated result schema.
27
+ * Use this with any data schema to create typed paginated responses.
28
+ *
29
+ * @example
30
+ * const PaginatedCustomers = createPaginatedResultSchema(CustomerSchema);
31
+ */
32
+ export declare const createPaginatedResultSchema: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodObject<{
33
+ data: z.ZodArray<T>;
34
+ meta: z.ZodObject<{
35
+ page: z.ZodNumber;
36
+ pageSize: z.ZodNumber;
37
+ totalCount: z.ZodNumber;
38
+ totalPages: z.ZodNumber;
39
+ hasNextPage: z.ZodBoolean;
40
+ hasPreviousPage: z.ZodBoolean;
41
+ }, z.core.$strip>;
42
+ }, z.core.$strip>;
43
+ /**
44
+ * Basic paginated result schema for any data type.
45
+ * Use this when you need a flexible paginated result without specific data typing.
46
+ *
47
+ * @typedef {Object} BasePaginatedResult
48
+ * @property {Array} data - Array of data items for the current page
49
+ * @property {Object} meta - Pagination metadata including page info and navigation flags
50
+ */
51
+ export declare const BasePaginatedResultSchema: z.ZodObject<{
52
+ data: z.ZodArray<z.ZodAny>;
53
+ meta: z.ZodObject<{
54
+ page: z.ZodNumber;
55
+ pageSize: z.ZodNumber;
56
+ totalCount: z.ZodNumber;
57
+ totalPages: z.ZodNumber;
58
+ hasNextPage: z.ZodBoolean;
59
+ hasPreviousPage: z.ZodBoolean;
60
+ }, z.core.$strip>;
61
+ }, z.core.$strip>;
62
+ /**
63
+ * Schema for paginated account requests.
64
+ *
65
+ * @typedef {Object} PaginatedAccountRequest
66
+ * @property {number} page - Page number to retrieve (1-based)
67
+ * @property {number} pageSize - Number of items per page (max 1000)
68
+ */
69
+ export declare const PaginatedAccountRequestSchema: z.ZodObject<{
70
+ page: z.ZodDefault<z.ZodNumber>;
71
+ pageSize: z.ZodDefault<z.ZodNumber>;
72
+ }, z.core.$strip>;
73
+ /**
74
+ * Generic pagination request schema.
75
+ *
76
+ * @typedef {Object} PaginationRequest
77
+ * @property {number} page - Page number to retrieve (1-based)
78
+ * @property {number} pageSize - Number of items per page (max 1000)
79
+ * @property {string} [sortBy] - Field name to sort by
80
+ * @property {string} sortDirection - Sort direction - ascending or descending
81
+ */
82
+ export declare const PaginationRequestSchema: z.ZodObject<{
83
+ page: z.ZodDefault<z.ZodNumber>;
84
+ pageSize: z.ZodDefault<z.ZodNumber>;
85
+ sortBy: z.ZodOptional<z.ZodString>;
86
+ sortDirection: z.ZodDefault<z.ZodEnum<{
87
+ asc: "asc";
88
+ desc: "desc";
89
+ }>>;
90
+ }, z.core.$strip>;
91
+ /**
92
+ * Schema for search-enabled pagination requests.
93
+ *
94
+ * @typedef {Object} SearchablePaginationRequest
95
+ * @property {number} page - Page number to retrieve
96
+ * @property {number} pageSize - Number of items per page
97
+ * @property {string} [sortBy] - Field name to sort by
98
+ * @property {string} sortDirection - Sort direction
99
+ * @property {string} [search] - Search query to filter results
100
+ * @property {string[]} [searchFields] - Specific fields to search within
101
+ */
102
+ export declare const SearchablePaginationRequestSchema: z.ZodObject<{
103
+ page: z.ZodDefault<z.ZodNumber>;
104
+ pageSize: z.ZodDefault<z.ZodNumber>;
105
+ sortBy: z.ZodOptional<z.ZodString>;
106
+ sortDirection: z.ZodDefault<z.ZodEnum<{
107
+ asc: "asc";
108
+ desc: "desc";
109
+ }>>;
110
+ search: z.ZodOptional<z.ZodString>;
111
+ searchFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
112
+ }, z.core.$strip>;
113
+ export type PaginationMetaType = z.infer<typeof PaginationMetaSchema>;
114
+ export type BasePaginatedResult = z.infer<typeof BasePaginatedResultSchema>;
115
+ export type PaginatedAccountRequest = z.infer<typeof PaginatedAccountRequestSchema>;
116
+ export type PaginationRequest = z.infer<typeof PaginationRequestSchema>;
117
+ export type SearchablePaginationRequest = z.infer<typeof SearchablePaginationRequestSchema>;
118
+ /**
119
+ * Helper type for creating typed paginated results.
120
+ */
121
+ export type PaginatedResultType<T> = {
122
+ data: T[];
123
+ meta: PaginationMetaType;
124
+ };
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SearchablePaginationRequestSchema = exports.PaginationRequestSchema = exports.PaginatedAccountRequestSchema = exports.BasePaginatedResultSchema = exports.createPaginatedResultSchema = exports.PaginationMetaSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * @fileoverview Pagination schema definitions for paginated API responses.
7
+ * @module request/models/paginated-result
8
+ */
9
+ /**
10
+ * Pagination metadata schema.
11
+ *
12
+ * @typedef {Object} PaginationMeta
13
+ * @property {number} page - Current page number (1-based indexing)
14
+ * @property {number} pageSize - Number of items per page - limited to 1000 for performance
15
+ * @property {number} totalCount - Total number of items across all pages
16
+ * @property {number} totalPages - Total number of pages available
17
+ * @property {boolean} hasNextPage - Whether there is a next page available for navigation
18
+ * @property {boolean} hasPreviousPage - Whether there is a previous page available for navigation
19
+ */
20
+ exports.PaginationMetaSchema = zod_1.z.object({
21
+ page: zod_1.z.number().int().positive(),
22
+ pageSize: zod_1.z.number().int().positive().max(1000),
23
+ totalCount: zod_1.z.number().int().nonnegative(),
24
+ totalPages: zod_1.z.number().int().nonnegative(),
25
+ hasNextPage: zod_1.z.boolean(),
26
+ hasPreviousPage: zod_1.z.boolean(),
27
+ });
28
+ /**
29
+ * Generic function to create a paginated result schema.
30
+ * Use this with any data schema to create typed paginated responses.
31
+ *
32
+ * @example
33
+ * const PaginatedCustomers = createPaginatedResultSchema(CustomerSchema);
34
+ */
35
+ const createPaginatedResultSchema = (dataSchema) => {
36
+ return zod_1.z.object({
37
+ data: zod_1.z.array(dataSchema),
38
+ meta: exports.PaginationMetaSchema,
39
+ });
40
+ };
41
+ exports.createPaginatedResultSchema = createPaginatedResultSchema;
42
+ /**
43
+ * Basic paginated result schema for any data type.
44
+ * Use this when you need a flexible paginated result without specific data typing.
45
+ *
46
+ * @typedef {Object} BasePaginatedResult
47
+ * @property {Array} data - Array of data items for the current page
48
+ * @property {Object} meta - Pagination metadata including page info and navigation flags
49
+ */
50
+ exports.BasePaginatedResultSchema = zod_1.z.object({
51
+ data: zod_1.z.array(zod_1.z.any()),
52
+ meta: exports.PaginationMetaSchema,
53
+ });
54
+ /**
55
+ * Schema for paginated account requests.
56
+ *
57
+ * @typedef {Object} PaginatedAccountRequest
58
+ * @property {number} page - Page number to retrieve (1-based)
59
+ * @property {number} pageSize - Number of items per page (max 1000)
60
+ */
61
+ exports.PaginatedAccountRequestSchema = zod_1.z.object({
62
+ page: zod_1.z.number().int().positive().default(1),
63
+ pageSize: zod_1.z.number().int().positive().max(1000).default(20),
64
+ });
65
+ /**
66
+ * Generic pagination request schema.
67
+ *
68
+ * @typedef {Object} PaginationRequest
69
+ * @property {number} page - Page number to retrieve (1-based)
70
+ * @property {number} pageSize - Number of items per page (max 1000)
71
+ * @property {string} [sortBy] - Field name to sort by
72
+ * @property {string} sortDirection - Sort direction - ascending or descending
73
+ */
74
+ exports.PaginationRequestSchema = zod_1.z.object({
75
+ page: zod_1.z.number().int().positive().default(1),
76
+ pageSize: zod_1.z.number().int().positive().max(1000).default(20),
77
+ sortBy: zod_1.z.string().optional(),
78
+ sortDirection: zod_1.z.enum(['asc', 'desc']).default('asc'),
79
+ });
80
+ /**
81
+ * Schema for search-enabled pagination requests.
82
+ *
83
+ * @typedef {Object} SearchablePaginationRequest
84
+ * @property {number} page - Page number to retrieve
85
+ * @property {number} pageSize - Number of items per page
86
+ * @property {string} [sortBy] - Field name to sort by
87
+ * @property {string} sortDirection - Sort direction
88
+ * @property {string} [search] - Search query to filter results
89
+ * @property {string[]} [searchFields] - Specific fields to search within
90
+ */
91
+ exports.SearchablePaginationRequestSchema = exports.PaginationRequestSchema.safeExtend({
92
+ search: zod_1.z.string().optional(),
93
+ searchFields: zod_1.z.array(zod_1.z.string()).optional(),
94
+ });
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "wiil-core-js",
3
+ "version": "0.0.82",
4
+ "license": "MIT",
5
+ "author": "WIIL",
6
+ "type": "commonjs",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/wiil-io/core-js.git"
12
+ },
13
+ "files": [
14
+ "dist/**/*"
15
+ ],
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "watch": "tsc --watch",
19
+ "docs": "typedoc",
20
+ "docs:watch": "typedoc --watch",
21
+ "tag:bash": "bash ./scripts/tag-script.sh",
22
+ "git:commit": "bash ./scripts/commit-script.sh",
23
+ "prepare": "npm run build"
24
+ },
25
+ "keywords": [
26
+ "wiil",
27
+ "data defintions",
28
+ "data models",
29
+ "dtos",
30
+ "schemas"
31
+ ],
32
+ "description": "Wiil Platform JavaScript Data Model Definitions. Core schemas for the wiil platform, providing TypeScript types and validation schemas using Zod.",
33
+ "devDependencies": {
34
+ "@types/node": "^22.13.14",
35
+ "typedoc": "^0.28.14",
36
+ "typedoc-plugin-markdown": "^4.9.0",
37
+ "typedoc-plugin-zod": "^1.4.3",
38
+ "typescript": "^5.8.2"
39
+ },
40
+ "dependencies": {
41
+ "zod": "4.1.12"
42
+ }
43
+ }