@lyxa.ai/core 1.4.297 → 1.4.298

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 (995) hide show
  1. package/dist/libraries/index.d.ts +6 -0
  2. package/dist/libraries/index.js +57 -26
  3. package/dist/libraries/index.js.map +1 -1
  4. package/dist/libraries/mongo/models/bob-finance.model.js +2 -5
  5. package/dist/libraries/mongo/models/bob-finance.model.js.map +1 -1
  6. package/dist/libraries/mongo/models/providers/referral-reward-coupon.model.d.ts +2 -0
  7. package/dist/libraries/mongo/models/providers/referral-reward-coupon.model.js +6 -0
  8. package/dist/libraries/mongo/models/providers/referral-reward-coupon.model.js.map +1 -1
  9. package/dist/libraries/upload/index.js +3 -3
  10. package/dist/libraries/upload/index.js.map +1 -1
  11. package/dist/types/README.md +1 -1
  12. package/dist/types/index.js.map +1 -0
  13. package/dist/types/libraries/auth/index.d.ts +77 -0
  14. package/dist/types/libraries/auth/index.js +270 -0
  15. package/dist/types/libraries/auth/index.js.map +1 -0
  16. package/dist/types/libraries/auth/refreshtoken.d.ts +15 -0
  17. package/dist/types/libraries/auth/refreshtoken.js +91 -0
  18. package/dist/types/libraries/auth/refreshtoken.js.map +1 -0
  19. package/dist/types/libraries/auth/repository.d.ts +18 -0
  20. package/dist/types/libraries/auth/repository.js +43 -0
  21. package/dist/types/libraries/auth/repository.js.map +1 -0
  22. package/dist/types/libraries/bullmq/bull-mq-service.d.ts +9 -0
  23. package/dist/types/libraries/bullmq/bull-mq-service.js +42 -0
  24. package/dist/types/libraries/bullmq/bull-mq-service.js.map +1 -0
  25. package/dist/types/libraries/cache/settings/index.d.ts +7 -0
  26. package/dist/types/libraries/cache/settings/index.js +56 -0
  27. package/dist/types/libraries/cache/settings/index.js.map +1 -0
  28. package/dist/types/libraries/cash-settlement/cashSettlementService.d.ts +16 -0
  29. package/dist/types/libraries/cash-settlement/cashSettlementService.js +53 -0
  30. package/dist/types/libraries/cash-settlement/cashSettlementService.js.map +1 -0
  31. package/dist/types/libraries/cash-settlement/index.d.ts +2 -0
  32. package/dist/types/libraries/cash-settlement/index.js +19 -0
  33. package/dist/types/libraries/cash-settlement/index.js.map +1 -0
  34. package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.d.ts +24 -0
  35. package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.js +10 -0
  36. package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.js.map +1 -0
  37. package/dist/types/libraries/cash-settlement/providers/bob.d.ts +45 -0
  38. package/dist/types/libraries/cash-settlement/providers/bob.js +634 -0
  39. package/dist/types/libraries/cash-settlement/providers/bob.js.map +1 -0
  40. package/dist/types/libraries/cash-settlement/providers/index.d.ts +1 -0
  41. package/dist/types/libraries/cash-settlement/providers/index.js +18 -0
  42. package/dist/types/libraries/cash-settlement/providers/index.js.map +1 -0
  43. package/dist/types/libraries/cloud-storage/CloudStorageFactory.d.ts +7 -0
  44. package/dist/types/libraries/cloud-storage/CloudStorageFactory.js +18 -0
  45. package/dist/types/libraries/cloud-storage/CloudStorageFactory.js.map +1 -0
  46. package/dist/types/libraries/cloud-storage/index.d.ts +4 -0
  47. package/dist/types/libraries/cloud-storage/index.js +21 -0
  48. package/dist/types/libraries/cloud-storage/index.js.map +1 -0
  49. package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.d.ts +8 -0
  50. package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.js +3 -0
  51. package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.js.map +1 -0
  52. package/dist/types/libraries/cloud-storage/providers/GcsStorageService.d.ts +11 -0
  53. package/dist/types/libraries/cloud-storage/providers/GcsStorageService.js +63 -0
  54. package/dist/types/libraries/cloud-storage/providers/GcsStorageService.js.map +1 -0
  55. package/dist/types/libraries/cloud-storage/types/FileUploadResult.d.ts +11 -0
  56. package/dist/types/libraries/cloud-storage/types/FileUploadResult.js +3 -0
  57. package/dist/types/libraries/cloud-storage/types/FileUploadResult.js.map +1 -0
  58. package/dist/types/libraries/configuration/index.d.ts +39 -0
  59. package/dist/types/libraries/configuration/index.js +84 -0
  60. package/dist/types/libraries/configuration/index.js.map +1 -0
  61. package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.d.ts +9 -0
  62. package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.js +14 -0
  63. package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.js.map +1 -0
  64. package/dist/types/libraries/dispatcher/index.d.ts +10 -0
  65. package/dist/types/libraries/dispatcher/index.js +43 -0
  66. package/dist/types/libraries/dispatcher/index.js.map +1 -0
  67. package/dist/types/libraries/event/BaseEvent.d.ts +7 -0
  68. package/dist/types/libraries/event/BaseEvent.js +19 -0
  69. package/dist/types/libraries/event/BaseEvent.js.map +1 -0
  70. package/dist/types/libraries/event/EventEnums.d.ts +26 -0
  71. package/dist/types/libraries/event/EventEnums.js +31 -0
  72. package/dist/types/libraries/event/EventEnums.js.map +1 -0
  73. package/dist/types/libraries/event/decorators/metadata.d.ts +13 -0
  74. package/dist/types/libraries/event/decorators/metadata.js +20 -0
  75. package/dist/types/libraries/event/decorators/metadata.js.map +1 -0
  76. package/dist/types/libraries/event/events/index.d.ts +2 -0
  77. package/dist/types/libraries/event/events/index.js +19 -0
  78. package/dist/types/libraries/event/events/index.js.map +1 -0
  79. package/dist/types/libraries/event/events/payout/index.d.ts +1 -0
  80. package/dist/types/libraries/event/events/payout/index.js +18 -0
  81. package/dist/types/libraries/event/events/payout/index.js.map +1 -0
  82. package/dist/types/libraries/event/events/payout/payout-schedule.event.d.ts +9 -0
  83. package/dist/types/libraries/event/events/payout/payout-schedule.event.js +12 -0
  84. package/dist/types/libraries/event/events/payout/payout-schedule.event.js.map +1 -0
  85. package/dist/types/libraries/event/events/rider/cash/index.d.ts +5 -0
  86. package/dist/types/libraries/event/events/rider/cash/index.js +14 -0
  87. package/dist/types/libraries/event/events/rider/cash/index.js.map +1 -0
  88. package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.d.ts +11 -0
  89. package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.js +19 -0
  90. package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.js.map +1 -0
  91. package/dist/types/libraries/event/events/rider/cash/rider-cash-event.d.ts +11 -0
  92. package/dist/types/libraries/event/events/rider/cash/rider-cash-event.js +18 -0
  93. package/dist/types/libraries/event/events/rider/cash/rider-cash-event.js.map +1 -0
  94. package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.d.ts +10 -0
  95. package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.js +17 -0
  96. package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.js.map +1 -0
  97. package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.d.ts +11 -0
  98. package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.js +19 -0
  99. package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.js.map +1 -0
  100. package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.d.ts +10 -0
  101. package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.js +17 -0
  102. package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.js.map +1 -0
  103. package/dist/types/libraries/event/events/rider/index.d.ts +2 -0
  104. package/dist/types/libraries/event/events/rider/index.js +19 -0
  105. package/dist/types/libraries/event/events/rider/index.js.map +1 -0
  106. package/dist/types/libraries/event/events/rider/scoring/index.d.ts +7 -0
  107. package/dist/types/libraries/event/events/rider/scoring/index.js +18 -0
  108. package/dist/types/libraries/event/events/rider/scoring/index.js.map +1 -0
  109. package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.d.ts +11 -0
  110. package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.js +20 -0
  111. package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.js.map +1 -0
  112. package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.d.ts +13 -0
  113. package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js +24 -0
  114. package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js.map +1 -0
  115. package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.d.ts +11 -0
  116. package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.js +20 -0
  117. package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.js.map +1 -0
  118. package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.d.ts +13 -0
  119. package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.js +24 -0
  120. package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.js.map +1 -0
  121. package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.d.ts +19 -0
  122. package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.js +36 -0
  123. package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.js.map +1 -0
  124. package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.d.ts +13 -0
  125. package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.js +18 -0
  126. package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.js.map +1 -0
  127. package/dist/types/libraries/event/events/rider/scoring/rider-score-event.d.ts +14 -0
  128. package/dist/types/libraries/event/events/rider/scoring/rider-score-event.js +21 -0
  129. package/dist/types/libraries/event/events/rider/scoring/rider-score-event.js.map +1 -0
  130. package/dist/types/libraries/event/index.d.ts +11 -0
  131. package/dist/types/libraries/event/index.js +152 -0
  132. package/dist/types/libraries/event/index.js.map +1 -0
  133. package/dist/types/libraries/event/registry/SubscriptionRegistry.d.ts +11 -0
  134. package/dist/types/libraries/event/registry/SubscriptionRegistry.js +14 -0
  135. package/dist/types/libraries/event/registry/SubscriptionRegistry.js.map +1 -0
  136. package/dist/types/libraries/firebase/index.d.ts +16 -0
  137. package/dist/types/libraries/firebase/index.js +107 -0
  138. package/dist/types/libraries/firebase/index.js.map +1 -0
  139. package/dist/types/libraries/google-translate/google-translate.client.d.ts +5 -0
  140. package/dist/types/libraries/google-translate/google-translate.client.js +44 -0
  141. package/dist/types/libraries/google-translate/google-translate.client.js.map +1 -0
  142. package/dist/types/libraries/google-translate/google-translate.dto.d.ts +13 -0
  143. package/dist/types/libraries/google-translate/google-translate.dto.js +3 -0
  144. package/dist/types/libraries/google-translate/google-translate.dto.js.map +1 -0
  145. package/dist/types/libraries/google-translate/google-translate.service.d.ts +9 -0
  146. package/dist/types/libraries/google-translate/google-translate.service.js +102 -0
  147. package/dist/types/libraries/google-translate/google-translate.service.js.map +1 -0
  148. package/dist/types/libraries/google-translate/index.d.ts +1 -0
  149. package/dist/types/libraries/google-translate/index.js +18 -0
  150. package/dist/types/libraries/google-translate/index.js.map +1 -0
  151. package/dist/types/libraries/index.d.ts +43 -0
  152. package/dist/types/libraries/index.js +102 -0
  153. package/dist/types/libraries/index.js.map +1 -0
  154. package/dist/types/libraries/llm/interfaces/common-llm-interfaces.d.ts +28 -0
  155. package/dist/types/libraries/llm/interfaces/common-llm-interfaces.js +3 -0
  156. package/dist/types/libraries/llm/interfaces/common-llm-interfaces.js.map +1 -0
  157. package/dist/types/libraries/llm/llm-provider-service.d.ts +13 -0
  158. package/dist/types/libraries/llm/llm-provider-service.js +47 -0
  159. package/dist/types/libraries/llm/llm-provider-service.js.map +1 -0
  160. package/dist/types/libraries/llm/providers/openai-provider.d.ts +19 -0
  161. package/dist/types/libraries/llm/providers/openai-provider.js +223 -0
  162. package/dist/types/libraries/llm/providers/openai-provider.js.map +1 -0
  163. package/dist/types/libraries/logger/index.d.ts +8 -0
  164. package/dist/types/libraries/logger/index.js +75 -0
  165. package/dist/types/libraries/logger/index.js.map +1 -0
  166. package/dist/types/libraries/logger-kit/index.d.ts +3 -0
  167. package/dist/types/libraries/logger-kit/index.js +22 -0
  168. package/dist/types/libraries/logger-kit/index.js.map +1 -0
  169. package/dist/types/libraries/logger-kit/logger.service.d.ts +117 -0
  170. package/dist/types/libraries/logger-kit/logger.service.js +304 -0
  171. package/dist/types/libraries/logger-kit/logger.service.js.map +1 -0
  172. package/dist/types/libraries/logger-kit/types.d.ts +34 -0
  173. package/dist/types/libraries/logger-kit/types.js +3 -0
  174. package/dist/types/libraries/logger-kit/types.js.map +1 -0
  175. package/dist/types/libraries/map/index.d.ts +2 -0
  176. package/dist/types/libraries/map/index.js +19 -0
  177. package/dist/types/libraries/map/index.js.map +1 -0
  178. package/dist/types/libraries/map/interfaces/IMapService.d.ts +43 -0
  179. package/dist/types/libraries/map/interfaces/IMapService.js +9 -0
  180. package/dist/types/libraries/map/interfaces/IMapService.js.map +1 -0
  181. package/dist/types/libraries/map/mapService.d.ts +21 -0
  182. package/dist/types/libraries/map/mapService.js +57 -0
  183. package/dist/types/libraries/map/mapService.js.map +1 -0
  184. package/dist/types/libraries/map/providers/google-maps.d.ts +27 -0
  185. package/dist/types/libraries/map/providers/google-maps.js +462 -0
  186. package/dist/types/libraries/map/providers/google-maps.js.map +1 -0
  187. package/dist/types/libraries/map/providers/index.d.ts +1 -0
  188. package/dist/types/libraries/map/providers/index.js +18 -0
  189. package/dist/types/libraries/map/providers/index.js.map +1 -0
  190. package/dist/types/libraries/map/providers/osrm.d.ts +13 -0
  191. package/dist/types/libraries/map/providers/osrm.js +137 -0
  192. package/dist/types/libraries/map/providers/osrm.js.map +1 -0
  193. package/dist/types/libraries/mongo/index.d.ts +7 -0
  194. package/dist/types/libraries/mongo/index.js +87 -0
  195. package/dist/types/libraries/mongo/index.js.map +1 -0
  196. package/dist/types/libraries/mongo/models/activity-log.model.d.ts +10 -0
  197. package/dist/types/libraries/mongo/models/activity-log.model.js +48 -0
  198. package/dist/types/libraries/mongo/models/activity-log.model.js.map +1 -0
  199. package/dist/types/libraries/mongo/models/admin-access-control.model.d.ts +11 -0
  200. package/dist/types/libraries/mongo/models/admin-access-control.model.js +75 -0
  201. package/dist/types/libraries/mongo/models/admin-access-control.model.js.map +1 -0
  202. package/dist/types/libraries/mongo/models/admin.model.d.ts +11 -0
  203. package/dist/types/libraries/mongo/models/admin.model.js +65 -0
  204. package/dist/types/libraries/mongo/models/admin.model.js.map +1 -0
  205. package/dist/types/libraries/mongo/models/agent-performance.model.d.ts +15 -0
  206. package/dist/types/libraries/mongo/models/agent-performance.model.js +73 -0
  207. package/dist/types/libraries/mongo/models/agent-performance.model.js.map +1 -0
  208. package/dist/types/libraries/mongo/models/app-appearance.model.d.ts +25 -0
  209. package/dist/types/libraries/mongo/models/app-appearance.model.js +102 -0
  210. package/dist/types/libraries/mongo/models/app-appearance.model.js.map +1 -0
  211. package/dist/types/libraries/mongo/models/app-instance.model.d.ts +10 -0
  212. package/dist/types/libraries/mongo/models/app-instance.model.js +54 -0
  213. package/dist/types/libraries/mongo/models/app-instance.model.js.map +1 -0
  214. package/dist/types/libraries/mongo/models/attribute.model.d.ts +13 -0
  215. package/dist/types/libraries/mongo/models/attribute.model.js +58 -0
  216. package/dist/types/libraries/mongo/models/attribute.model.js.map +1 -0
  217. package/dist/types/libraries/mongo/models/banner.model.d.ts +27 -0
  218. package/dist/types/libraries/mongo/models/banner.model.js +118 -0
  219. package/dist/types/libraries/mongo/models/banner.model.js.map +1 -0
  220. package/dist/types/libraries/mongo/models/base/base-coupon.model.d.ts +19 -0
  221. package/dist/types/libraries/mongo/models/base/base-coupon.model.js +90 -0
  222. package/dist/types/libraries/mongo/models/base/base-coupon.model.js.map +1 -0
  223. package/dist/types/libraries/mongo/models/bob-finance.model.d.ts +19 -0
  224. package/dist/types/libraries/mongo/models/bob-finance.model.js +88 -0
  225. package/dist/types/libraries/mongo/models/bob-finance.model.js.map +1 -0
  226. package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.d.ts +9 -0
  227. package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.js +48 -0
  228. package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.js.map +1 -0
  229. package/dist/types/libraries/mongo/models/brand.model.d.ts +5 -0
  230. package/dist/types/libraries/mongo/models/brand.model.js +32 -0
  231. package/dist/types/libraries/mongo/models/brand.model.js.map +1 -0
  232. package/dist/types/libraries/mongo/models/cancellation-reason.model.d.ts +8 -0
  233. package/dist/types/libraries/mongo/models/cancellation-reason.model.js +55 -0
  234. package/dist/types/libraries/mongo/models/cancellation-reason.model.js.map +1 -0
  235. package/dist/types/libraries/mongo/models/card.model.d.ts +19 -0
  236. package/dist/types/libraries/mongo/models/card.model.js +88 -0
  237. package/dist/types/libraries/mongo/models/card.model.js.map +1 -0
  238. package/dist/types/libraries/mongo/models/cart-participant.model.d.ts +29 -0
  239. package/dist/types/libraries/mongo/models/cart-participant.model.js +130 -0
  240. package/dist/types/libraries/mongo/models/cart-participant.model.js.map +1 -0
  241. package/dist/types/libraries/mongo/models/cart.model.d.ts +39 -0
  242. package/dist/types/libraries/mongo/models/cart.model.js +184 -0
  243. package/dist/types/libraries/mongo/models/cart.model.js.map +1 -0
  244. package/dist/types/libraries/mongo/models/category.model.d.ts +12 -0
  245. package/dist/types/libraries/mongo/models/category.model.js +68 -0
  246. package/dist/types/libraries/mongo/models/category.model.js.map +1 -0
  247. package/dist/types/libraries/mongo/models/chat-room.model.d.ts +28 -0
  248. package/dist/types/libraries/mongo/models/chat-room.model.js +99 -0
  249. package/dist/types/libraries/mongo/models/chat-room.model.js.map +1 -0
  250. package/dist/types/libraries/mongo/models/copy-attribute-map.model.d.ts +8 -0
  251. package/dist/types/libraries/mongo/models/copy-attribute-map.model.js +38 -0
  252. package/dist/types/libraries/mongo/models/copy-attribute-map.model.js.map +1 -0
  253. package/dist/types/libraries/mongo/models/copy-product-job.model.d.ts +21 -0
  254. package/dist/types/libraries/mongo/models/copy-product-job.model.js +101 -0
  255. package/dist/types/libraries/mongo/models/copy-product-job.model.js.map +1 -0
  256. package/dist/types/libraries/mongo/models/copy-product-map.model.d.ts +8 -0
  257. package/dist/types/libraries/mongo/models/copy-product-map.model.js +38 -0
  258. package/dist/types/libraries/mongo/models/copy-product-map.model.js.map +1 -0
  259. package/dist/types/libraries/mongo/models/copy-shop-category-map.model.d.ts +8 -0
  260. package/dist/types/libraries/mongo/models/copy-shop-category-map.model.js +38 -0
  261. package/dist/types/libraries/mongo/models/copy-shop-category-map.model.js.map +1 -0
  262. package/dist/types/libraries/mongo/models/core-auth-identity.model.d.ts +7 -0
  263. package/dist/types/libraries/mongo/models/core-auth-identity.model.js +32 -0
  264. package/dist/types/libraries/mongo/models/core-auth-identity.model.js.map +1 -0
  265. package/dist/types/libraries/mongo/models/core-user.model.d.ts +16 -0
  266. package/dist/types/libraries/mongo/models/core-user.model.js +85 -0
  267. package/dist/types/libraries/mongo/models/core-user.model.js.map +1 -0
  268. package/dist/types/libraries/mongo/models/counter.model.d.ts +8 -0
  269. package/dist/types/libraries/mongo/models/counter.model.js +42 -0
  270. package/dist/types/libraries/mongo/models/counter.model.js.map +1 -0
  271. package/dist/types/libraries/mongo/models/coupon.model.d.ts +13 -0
  272. package/dist/types/libraries/mongo/models/coupon.model.js +60 -0
  273. package/dist/types/libraries/mongo/models/coupon.model.js.map +1 -0
  274. package/dist/types/libraries/mongo/models/deal-setting.model.d.ts +10 -0
  275. package/dist/types/libraries/mongo/models/deal-setting.model.js +52 -0
  276. package/dist/types/libraries/mongo/models/deal-setting.model.js.map +1 -0
  277. package/dist/types/libraries/mongo/models/default-chat.model.d.ts +4 -0
  278. package/dist/types/libraries/mongo/models/default-chat.model.js +26 -0
  279. package/dist/types/libraries/mongo/models/default-chat.model.js.map +1 -0
  280. package/dist/types/libraries/mongo/models/delivery-charges.model.d.ts +13 -0
  281. package/dist/types/libraries/mongo/models/delivery-charges.model.js +63 -0
  282. package/dist/types/libraries/mongo/models/delivery-charges.model.js.map +1 -0
  283. package/dist/types/libraries/mongo/models/dish.model.d.ts +18 -0
  284. package/dist/types/libraries/mongo/models/dish.model.js +92 -0
  285. package/dist/types/libraries/mongo/models/dish.model.js.map +1 -0
  286. package/dist/types/libraries/mongo/models/embedded/address-change-history.model.d.ts +25 -0
  287. package/dist/types/libraries/mongo/models/embedded/address-change-history.model.js +112 -0
  288. package/dist/types/libraries/mongo/models/embedded/address-change-history.model.js.map +1 -0
  289. package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.d.ts +33 -0
  290. package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.js +133 -0
  291. package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.js.map +1 -0
  292. package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.d.ts +4 -0
  293. package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.js +27 -0
  294. package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.js.map +1 -0
  295. package/dist/types/libraries/mongo/models/embedded/app-force-update.d.ts +9 -0
  296. package/dist/types/libraries/mongo/models/embedded/app-force-update.js +52 -0
  297. package/dist/types/libraries/mongo/models/embedded/app-force-update.js.map +1 -0
  298. package/dist/types/libraries/mongo/models/embedded/attribute-item.model.d.ts +5 -0
  299. package/dist/types/libraries/mongo/models/embedded/attribute-item.model.js +32 -0
  300. package/dist/types/libraries/mongo/models/embedded/attribute-item.model.js.map +1 -0
  301. package/dist/types/libraries/mongo/models/embedded/attribute-map.model.d.ts +7 -0
  302. package/dist/types/libraries/mongo/models/embedded/attribute-map.model.js +29 -0
  303. package/dist/types/libraries/mongo/models/embedded/attribute-map.model.js.map +1 -0
  304. package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.d.ts +4 -0
  305. package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.js +27 -0
  306. package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.js.map +1 -0
  307. package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.d.ts +9 -0
  308. package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.js +52 -0
  309. package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.js.map +1 -0
  310. package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.d.ts +5 -0
  311. package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.js +32 -0
  312. package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.js.map +1 -0
  313. package/dist/types/libraries/mongo/models/embedded/charge.model.d.ts +5 -0
  314. package/dist/types/libraries/mongo/models/embedded/charge.model.js +28 -0
  315. package/dist/types/libraries/mongo/models/embedded/charge.model.js.map +1 -0
  316. package/dist/types/libraries/mongo/models/embedded/chat-participant.model.d.ts +18 -0
  317. package/dist/types/libraries/mongo/models/embedded/chat-participant.model.js +64 -0
  318. package/dist/types/libraries/mongo/models/embedded/chat-participant.model.js.map +1 -0
  319. package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.d.ts +4 -0
  320. package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.js +27 -0
  321. package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.js.map +1 -0
  322. package/dist/types/libraries/mongo/models/embedded/company-info.model.d.ts +6 -0
  323. package/dist/types/libraries/mongo/models/embedded/company-info.model.js +37 -0
  324. package/dist/types/libraries/mongo/models/embedded/company-info.model.js.map +1 -0
  325. package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.d.ts +9 -0
  326. package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.js +36 -0
  327. package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.js.map +1 -0
  328. package/dist/types/libraries/mongo/models/embedded/courier-setting.model.d.ts +4 -0
  329. package/dist/types/libraries/mongo/models/embedded/courier-setting.model.js +27 -0
  330. package/dist/types/libraries/mongo/models/embedded/courier-setting.model.js.map +1 -0
  331. package/dist/types/libraries/mongo/models/embedded/currency-setting.model.d.ts +7 -0
  332. package/dist/types/libraries/mongo/models/embedded/currency-setting.model.js +38 -0
  333. package/dist/types/libraries/mongo/models/embedded/currency-setting.model.js.map +1 -0
  334. package/dist/types/libraries/mongo/models/embedded/currency.model.d.ts +5 -0
  335. package/dist/types/libraries/mongo/models/embedded/currency.model.js +32 -0
  336. package/dist/types/libraries/mongo/models/embedded/currency.model.js.map +1 -0
  337. package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.d.ts +4 -0
  338. package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.js +27 -0
  339. package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.js.map +1 -0
  340. package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.d.ts +4 -0
  341. package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.js +27 -0
  342. package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.js.map +1 -0
  343. package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.d.ts +10 -0
  344. package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.js +51 -0
  345. package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.js.map +1 -0
  346. package/dist/types/libraries/mongo/models/embedded/delivery-info.model.d.ts +4 -0
  347. package/dist/types/libraries/mongo/models/embedded/delivery-info.model.js +27 -0
  348. package/dist/types/libraries/mongo/models/embedded/delivery-info.model.js.map +1 -0
  349. package/dist/types/libraries/mongo/models/embedded/external-ref.model.d.ts +4 -0
  350. package/dist/types/libraries/mongo/models/embedded/external-ref.model.js +32 -0
  351. package/dist/types/libraries/mongo/models/embedded/external-ref.model.js.map +1 -0
  352. package/dist/types/libraries/mongo/models/embedded/featured-item.mode.d.ts +6 -0
  353. package/dist/types/libraries/mongo/models/embedded/featured-item.mode.js +33 -0
  354. package/dist/types/libraries/mongo/models/embedded/featured-item.mode.js.map +1 -0
  355. package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.d.ts +7 -0
  356. package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.js +38 -0
  357. package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.js.map +1 -0
  358. package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.d.ts +17 -0
  359. package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.js +63 -0
  360. package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.js.map +1 -0
  361. package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.d.ts +46 -0
  362. package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.js +178 -0
  363. package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.js.map +1 -0
  364. package/dist/types/libraries/mongo/models/embedded/order-cancel.model.d.ts +26 -0
  365. package/dist/types/libraries/mongo/models/embedded/order-cancel.model.js +110 -0
  366. package/dist/types/libraries/mongo/models/embedded/order-cancel.model.js.map +1 -0
  367. package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.d.ts +12 -0
  368. package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.js +67 -0
  369. package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.js.map +1 -0
  370. package/dist/types/libraries/mongo/models/embedded/order-finance.model.d.ts +18 -0
  371. package/dist/types/libraries/mongo/models/embedded/order-finance.model.js +64 -0
  372. package/dist/types/libraries/mongo/models/embedded/order-finance.model.js.map +1 -0
  373. package/dist/types/libraries/mongo/models/embedded/order-pricing.model.d.ts +34 -0
  374. package/dist/types/libraries/mongo/models/embedded/order-pricing.model.js +163 -0
  375. package/dist/types/libraries/mongo/models/embedded/order-pricing.model.js.map +1 -0
  376. package/dist/types/libraries/mongo/models/embedded/order-refund.model.d.ts +28 -0
  377. package/dist/types/libraries/mongo/models/embedded/order-refund.model.js +113 -0
  378. package/dist/types/libraries/mongo/models/embedded/order-refund.model.js.map +1 -0
  379. package/dist/types/libraries/mongo/models/embedded/otp-fields.model.d.ts +7 -0
  380. package/dist/types/libraries/mongo/models/embedded/otp-fields.model.js +46 -0
  381. package/dist/types/libraries/mongo/models/embedded/otp-fields.model.js.map +1 -0
  382. package/dist/types/libraries/mongo/models/embedded/package.model.d.ts +25 -0
  383. package/dist/types/libraries/mongo/models/embedded/package.model.js +86 -0
  384. package/dist/types/libraries/mongo/models/embedded/package.model.js.map +1 -0
  385. package/dist/types/libraries/mongo/models/embedded/parent-document.model.d.ts +5 -0
  386. package/dist/types/libraries/mongo/models/embedded/parent-document.model.js +32 -0
  387. package/dist/types/libraries/mongo/models/embedded/parent-document.model.js.map +1 -0
  388. package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.d.ts +7 -0
  389. package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.js +38 -0
  390. package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.js.map +1 -0
  391. package/dist/types/libraries/mongo/models/embedded/payment-record.model.d.ts +10 -0
  392. package/dist/types/libraries/mongo/models/embedded/payment-record.model.js +53 -0
  393. package/dist/types/libraries/mongo/models/embedded/payment-record.model.js.map +1 -0
  394. package/dist/types/libraries/mongo/models/embedded/payout-setting.model.d.ts +5 -0
  395. package/dist/types/libraries/mongo/models/embedded/payout-setting.model.js +28 -0
  396. package/dist/types/libraries/mongo/models/embedded/payout-setting.model.js.map +1 -0
  397. package/dist/types/libraries/mongo/models/embedded/plus-settings.model.d.ts +6 -0
  398. package/dist/types/libraries/mongo/models/embedded/plus-settings.model.js +33 -0
  399. package/dist/types/libraries/mongo/models/embedded/plus-settings.model.js.map +1 -0
  400. package/dist/types/libraries/mongo/models/embedded/preparing-time.model.d.ts +4 -0
  401. package/dist/types/libraries/mongo/models/embedded/preparing-time.model.js +27 -0
  402. package/dist/types/libraries/mongo/models/embedded/preparing-time.model.js.map +1 -0
  403. package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.d.ts +16 -0
  404. package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.js +80 -0
  405. package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.js.map +1 -0
  406. package/dist/types/libraries/mongo/models/embedded/product-category.model.d.ts +4 -0
  407. package/dist/types/libraries/mongo/models/embedded/product-category.model.js +32 -0
  408. package/dist/types/libraries/mongo/models/embedded/product-category.model.js.map +1 -0
  409. package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.d.ts +17 -0
  410. package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.js +72 -0
  411. package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.js.map +1 -0
  412. package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.d.ts +5 -0
  413. package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.js +32 -0
  414. package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.js.map +1 -0
  415. package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.d.ts +12 -0
  416. package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.js +60 -0
  417. package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.js.map +1 -0
  418. package/dist/types/libraries/mongo/models/embedded/product-snap.model.d.ts +16 -0
  419. package/dist/types/libraries/mongo/models/embedded/product-snap.model.js +79 -0
  420. package/dist/types/libraries/mongo/models/embedded/product-snap.model.js.map +1 -0
  421. package/dist/types/libraries/mongo/models/embedded/profit.model.d.ts +22 -0
  422. package/dist/types/libraries/mongo/models/embedded/profit.model.js +96 -0
  423. package/dist/types/libraries/mongo/models/embedded/profit.model.js.map +1 -0
  424. package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.d.ts +6 -0
  425. package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.js +38 -0
  426. package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.js.map +1 -0
  427. package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.d.ts +18 -0
  428. package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.js +73 -0
  429. package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.js.map +1 -0
  430. package/dist/types/libraries/mongo/models/embedded/replacement-order.model.d.ts +28 -0
  431. package/dist/types/libraries/mongo/models/embedded/replacement-order.model.js +109 -0
  432. package/dist/types/libraries/mongo/models/embedded/replacement-order.model.js.map +1 -0
  433. package/dist/types/libraries/mongo/models/embedded/rest-password.model.d.ts +4 -0
  434. package/dist/types/libraries/mongo/models/embedded/rest-password.model.js +27 -0
  435. package/dist/types/libraries/mongo/models/embedded/rest-password.model.js.map +1 -0
  436. package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.d.ts +9 -0
  437. package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.js +44 -0
  438. package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.js.map +1 -0
  439. package/dist/types/libraries/mongo/models/embedded/rider-batches.model.d.ts +4 -0
  440. package/dist/types/libraries/mongo/models/embedded/rider-batches.model.js +27 -0
  441. package/dist/types/libraries/mongo/models/embedded/rider-batches.model.js.map +1 -0
  442. package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.d.ts +4 -0
  443. package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.js +27 -0
  444. package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.js.map +1 -0
  445. package/dist/types/libraries/mongo/models/embedded/rider-setting.model.d.ts +8 -0
  446. package/dist/types/libraries/mongo/models/embedded/rider-setting.model.js +47 -0
  447. package/dist/types/libraries/mongo/models/embedded/rider-setting.model.js.map +1 -0
  448. package/dist/types/libraries/mongo/models/embedded/rider-statistics.d.ts +11 -0
  449. package/dist/types/libraries/mongo/models/embedded/rider-statistics.js +62 -0
  450. package/dist/types/libraries/mongo/models/embedded/rider-statistics.js.map +1 -0
  451. package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.d.ts +18 -0
  452. package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.js +77 -0
  453. package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.js.map +1 -0
  454. package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.d.ts +23 -0
  455. package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.js +85 -0
  456. package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.js.map +1 -0
  457. package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.d.ts +24 -0
  458. package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.js +127 -0
  459. package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.js.map +1 -0
  460. package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.d.ts +16 -0
  461. package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.js +70 -0
  462. package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.js.map +1 -0
  463. package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.d.ts +19 -0
  464. package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.js +76 -0
  465. package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.js.map +1 -0
  466. package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.d.ts +9 -0
  467. package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.js +57 -0
  468. package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.js.map +1 -0
  469. package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.d.ts +5 -0
  470. package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.js +28 -0
  471. package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.js.map +1 -0
  472. package/dist/types/libraries/mongo/models/embedded/service-line-item.model.d.ts +38 -0
  473. package/dist/types/libraries/mongo/models/embedded/service-line-item.model.js +154 -0
  474. package/dist/types/libraries/mongo/models/embedded/service-line-item.model.js.map +1 -0
  475. package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.d.ts +5 -0
  476. package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.js +32 -0
  477. package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.js.map +1 -0
  478. package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.d.ts +12 -0
  479. package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.js +47 -0
  480. package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.js.map +1 -0
  481. package/dist/types/libraries/mongo/models/embedded/shop-document.model.d.ts +6 -0
  482. package/dist/types/libraries/mongo/models/embedded/shop-document.model.js +37 -0
  483. package/dist/types/libraries/mongo/models/embedded/shop-document.model.js.map +1 -0
  484. package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.d.ts +15 -0
  485. package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.js +75 -0
  486. package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.js.map +1 -0
  487. package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.d.ts +8 -0
  488. package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.js +43 -0
  489. package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.js.map +1 -0
  490. package/dist/types/libraries/mongo/models/embedded/status-timeline.model.d.ts +25 -0
  491. package/dist/types/libraries/mongo/models/embedded/status-timeline.model.js +97 -0
  492. package/dist/types/libraries/mongo/models/embedded/status-timeline.model.js.map +1 -0
  493. package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.d.ts +8 -0
  494. package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.js +47 -0
  495. package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.js.map +1 -0
  496. package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.d.ts +4 -0
  497. package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.js +27 -0
  498. package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.js.map +1 -0
  499. package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.d.ts +28 -0
  500. package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.js +134 -0
  501. package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.js.map +1 -0
  502. package/dist/types/libraries/mongo/models/embedded/vat.model.d.ts +5 -0
  503. package/dist/types/libraries/mongo/models/embedded/vat.model.js +32 -0
  504. package/dist/types/libraries/mongo/models/embedded/vat.model.js.map +1 -0
  505. package/dist/types/libraries/mongo/models/embedded/wallet.model.d.ts +5 -0
  506. package/dist/types/libraries/mongo/models/embedded/wallet.model.js +32 -0
  507. package/dist/types/libraries/mongo/models/embedded/wallet.model.js.map +1 -0
  508. package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.d.ts +5 -0
  509. package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.js +28 -0
  510. package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.js.map +1 -0
  511. package/dist/types/libraries/mongo/models/favourite.model.d.ts +14 -0
  512. package/dist/types/libraries/mongo/models/favourite.model.js +52 -0
  513. package/dist/types/libraries/mongo/models/favourite.model.js.map +1 -0
  514. package/dist/types/libraries/mongo/models/featured-setting.model.d.ts +7 -0
  515. package/dist/types/libraries/mongo/models/featured-setting.model.js +33 -0
  516. package/dist/types/libraries/mongo/models/featured-setting.model.js.map +1 -0
  517. package/dist/types/libraries/mongo/models/filter-container.model.d.ts +10 -0
  518. package/dist/types/libraries/mongo/models/filter-container.model.js +63 -0
  519. package/dist/types/libraries/mongo/models/filter-container.model.js.map +1 -0
  520. package/dist/types/libraries/mongo/models/finance-settlement.model.d.ts +41 -0
  521. package/dist/types/libraries/mongo/models/finance-settlement.model.js +175 -0
  522. package/dist/types/libraries/mongo/models/finance-settlement.model.js.map +1 -0
  523. package/dist/types/libraries/mongo/models/flag.model.d.ts +22 -0
  524. package/dist/types/libraries/mongo/models/flag.model.js +83 -0
  525. package/dist/types/libraries/mongo/models/flag.model.js.map +1 -0
  526. package/dist/types/libraries/mongo/models/gallery-upload.model.d.ts +17 -0
  527. package/dist/types/libraries/mongo/models/gallery-upload.model.js +77 -0
  528. package/dist/types/libraries/mongo/models/gallery-upload.model.js.map +1 -0
  529. package/dist/types/libraries/mongo/models/gallery.model.d.ts +13 -0
  530. package/dist/types/libraries/mongo/models/gallery.model.js +59 -0
  531. package/dist/types/libraries/mongo/models/gallery.model.js.map +1 -0
  532. package/dist/types/libraries/mongo/models/google-maps-usage.model.d.ts +21 -0
  533. package/dist/types/libraries/mongo/models/google-maps-usage.model.js +255 -0
  534. package/dist/types/libraries/mongo/models/google-maps-usage.model.js.map +1 -0
  535. package/dist/types/libraries/mongo/models/index.d.ts +395 -0
  536. package/dist/types/libraries/mongo/models/index.js +485 -0
  537. package/dist/types/libraries/mongo/models/index.js.map +1 -0
  538. package/dist/types/libraries/mongo/models/integration-configuration.model.d.ts +5 -0
  539. package/dist/types/libraries/mongo/models/integration-configuration.model.js +33 -0
  540. package/dist/types/libraries/mongo/models/integration-configuration.model.js.map +1 -0
  541. package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.d.ts +9 -0
  542. package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.js +45 -0
  543. package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.js.map +1 -0
  544. package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.d.ts +14 -0
  545. package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.js +76 -0
  546. package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.js.map +1 -0
  547. package/dist/types/libraries/mongo/models/limited-time-offer-config.d.ts +6 -0
  548. package/dist/types/libraries/mongo/models/limited-time-offer-config.js +36 -0
  549. package/dist/types/libraries/mongo/models/limited-time-offer-config.js.map +1 -0
  550. package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.d.ts +22 -0
  551. package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.js +96 -0
  552. package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.js.map +1 -0
  553. package/dist/types/libraries/mongo/models/line-item.model.d.ts +47 -0
  554. package/dist/types/libraries/mongo/models/line-item.model.js +205 -0
  555. package/dist/types/libraries/mongo/models/line-item.model.js.map +1 -0
  556. package/dist/types/libraries/mongo/models/list-container.model.d.ts +19 -0
  557. package/dist/types/libraries/mongo/models/list-container.model.js +92 -0
  558. package/dist/types/libraries/mongo/models/list-container.model.js.map +1 -0
  559. package/dist/types/libraries/mongo/models/log.model.d.ts +35 -0
  560. package/dist/types/libraries/mongo/models/log.model.js +163 -0
  561. package/dist/types/libraries/mongo/models/log.model.js.map +1 -0
  562. package/dist/types/libraries/mongo/models/marketing.model.d.ts +18 -0
  563. package/dist/types/libraries/mongo/models/marketing.model.js +88 -0
  564. package/dist/types/libraries/mongo/models/marketing.model.js.map +1 -0
  565. package/dist/types/libraries/mongo/models/meal-plan.model.d.ts +9 -0
  566. package/dist/types/libraries/mongo/models/meal-plan.model.js +51 -0
  567. package/dist/types/libraries/mongo/models/meal-plan.model.js.map +1 -0
  568. package/dist/types/libraries/mongo/models/message.model.d.ts +25 -0
  569. package/dist/types/libraries/mongo/models/message.model.js +105 -0
  570. package/dist/types/libraries/mongo/models/message.model.js.map +1 -0
  571. package/dist/types/libraries/mongo/models/notification.model.d.ts +53 -0
  572. package/dist/types/libraries/mongo/models/notification.model.js +201 -0
  573. package/dist/types/libraries/mongo/models/notification.model.js.map +1 -0
  574. package/dist/types/libraries/mongo/models/nutrition.model.d.ts +6 -0
  575. package/dist/types/libraries/mongo/models/nutrition.model.js +33 -0
  576. package/dist/types/libraries/mongo/models/nutrition.model.js.map +1 -0
  577. package/dist/types/libraries/mongo/models/order.model.d.ts +66 -0
  578. package/dist/types/libraries/mongo/models/order.model.js +350 -0
  579. package/dist/types/libraries/mongo/models/order.model.js.map +1 -0
  580. package/dist/types/libraries/mongo/models/parent.model.d.ts +29 -0
  581. package/dist/types/libraries/mongo/models/parent.model.js +144 -0
  582. package/dist/types/libraries/mongo/models/parent.model.js.map +1 -0
  583. package/dist/types/libraries/mongo/models/payment-configuration.model.d.ts +6 -0
  584. package/dist/types/libraries/mongo/models/payment-configuration.model.js +33 -0
  585. package/dist/types/libraries/mongo/models/payment-configuration.model.js.map +1 -0
  586. package/dist/types/libraries/mongo/models/payment-intent.model.d.ts +17 -0
  587. package/dist/types/libraries/mongo/models/payment-intent.model.js +79 -0
  588. package/dist/types/libraries/mongo/models/payment-intent.model.js.map +1 -0
  589. package/dist/types/libraries/mongo/models/payout.model.d.ts +15 -0
  590. package/dist/types/libraries/mongo/models/payout.model.js +86 -0
  591. package/dist/types/libraries/mongo/models/payout.model.js.map +1 -0
  592. package/dist/types/libraries/mongo/models/product-brand.model.d.ts +7 -0
  593. package/dist/types/libraries/mongo/models/product-brand.model.js +38 -0
  594. package/dist/types/libraries/mongo/models/product-brand.model.js.map +1 -0
  595. package/dist/types/libraries/mongo/models/product-marketing.model.d.ts +13 -0
  596. package/dist/types/libraries/mongo/models/product-marketing.model.js +57 -0
  597. package/dist/types/libraries/mongo/models/product-marketing.model.js.map +1 -0
  598. package/dist/types/libraries/mongo/models/product-stock-tracker.model.d.ts +15 -0
  599. package/dist/types/libraries/mongo/models/product-stock-tracker.model.js +57 -0
  600. package/dist/types/libraries/mongo/models/product-stock-tracker.model.js.map +1 -0
  601. package/dist/types/libraries/mongo/models/product-upload.model.d.ts +25 -0
  602. package/dist/types/libraries/mongo/models/product-upload.model.js +105 -0
  603. package/dist/types/libraries/mongo/models/product-upload.model.js.map +1 -0
  604. package/dist/types/libraries/mongo/models/product.model.d.ts +63 -0
  605. package/dist/types/libraries/mongo/models/product.model.js +339 -0
  606. package/dist/types/libraries/mongo/models/product.model.js.map +1 -0
  607. package/dist/types/libraries/mongo/models/professional-blocked-time.model.d.ts +10 -0
  608. package/dist/types/libraries/mongo/models/professional-blocked-time.model.js +49 -0
  609. package/dist/types/libraries/mongo/models/professional-blocked-time.model.js.map +1 -0
  610. package/dist/types/libraries/mongo/models/professional.model.d.ts +17 -0
  611. package/dist/types/libraries/mongo/models/professional.model.js +91 -0
  612. package/dist/types/libraries/mongo/models/professional.model.js.map +1 -0
  613. package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.d.ts +16 -0
  614. package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.js +62 -0
  615. package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.js.map +1 -0
  616. package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.d.ts +5 -0
  617. package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.js +28 -0
  618. package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.js.map +1 -0
  619. package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.d.ts +9 -0
  620. package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.js +69 -0
  621. package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.js.map +1 -0
  622. package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.d.ts +5 -0
  623. package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.js +28 -0
  624. package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.js.map +1 -0
  625. package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.d.ts +6 -0
  626. package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.js +29 -0
  627. package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.js.map +1 -0
  628. package/dist/types/libraries/mongo/models/providers/courier-order.model.d.ts +41 -0
  629. package/dist/types/libraries/mongo/models/providers/courier-order.model.js +151 -0
  630. package/dist/types/libraries/mongo/models/providers/courier-order.model.js.map +1 -0
  631. package/dist/types/libraries/mongo/models/providers/custom-coupon.model.d.ts +13 -0
  632. package/dist/types/libraries/mongo/models/providers/custom-coupon.model.js +43 -0
  633. package/dist/types/libraries/mongo/models/providers/custom-coupon.model.js.map +1 -0
  634. package/dist/types/libraries/mongo/models/providers/discount-marketing.model.d.ts +22 -0
  635. package/dist/types/libraries/mongo/models/providers/discount-marketing.model.js +92 -0
  636. package/dist/types/libraries/mongo/models/providers/discount-marketing.model.js.map +1 -0
  637. package/dist/types/libraries/mongo/models/providers/featured-marketing.model.d.ts +6 -0
  638. package/dist/types/libraries/mongo/models/providers/featured-marketing.model.js +25 -0
  639. package/dist/types/libraries/mongo/models/providers/featured-marketing.model.js.map +1 -0
  640. package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.d.ts +7 -0
  641. package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.js +30 -0
  642. package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.js.map +1 -0
  643. package/dist/types/libraries/mongo/models/providers/global-coupon.model.d.ts +5 -0
  644. package/dist/types/libraries/mongo/models/providers/global-coupon.model.js +10 -0
  645. package/dist/types/libraries/mongo/models/providers/global-coupon.model.js.map +1 -0
  646. package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.d.ts +12 -0
  647. package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.js +42 -0
  648. package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -0
  649. package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.d.ts +13 -0
  650. package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.js +43 -0
  651. package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -0
  652. package/dist/types/libraries/mongo/models/providers/punch-marketing.model.d.ts +11 -0
  653. package/dist/types/libraries/mongo/models/providers/punch-marketing.model.js +50 -0
  654. package/dist/types/libraries/mongo/models/providers/punch-marketing.model.js.map +1 -0
  655. package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.d.ts +9 -0
  656. package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.js +27 -0
  657. package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.js.map +1 -0
  658. package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.d.ts +11 -0
  659. package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.js +37 -0
  660. package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.js.map +1 -0
  661. package/dist/types/libraries/mongo/models/providers/regular-order.model.d.ts +54 -0
  662. package/dist/types/libraries/mongo/models/providers/regular-order.model.js +204 -0
  663. package/dist/types/libraries/mongo/models/providers/regular-order.model.js.map +1 -0
  664. package/dist/types/libraries/mongo/models/providers/rider-payout.model.d.ts +23 -0
  665. package/dist/types/libraries/mongo/models/providers/rider-payout.model.js +94 -0
  666. package/dist/types/libraries/mongo/models/providers/rider-payout.model.js.map +1 -0
  667. package/dist/types/libraries/mongo/models/providers/rider-review.model.d.ts +10 -0
  668. package/dist/types/libraries/mongo/models/providers/rider-review.model.js +32 -0
  669. package/dist/types/libraries/mongo/models/providers/rider-review.model.js.map +1 -0
  670. package/dist/types/libraries/mongo/models/providers/service-package-review.model.d.ts +14 -0
  671. package/dist/types/libraries/mongo/models/providers/service-package-review.model.js +44 -0
  672. package/dist/types/libraries/mongo/models/providers/service-package-review.model.js.map +1 -0
  673. package/dist/types/libraries/mongo/models/providers/shop-courier.model.d.ts +26 -0
  674. package/dist/types/libraries/mongo/models/providers/shop-courier.model.js +93 -0
  675. package/dist/types/libraries/mongo/models/providers/shop-courier.model.js.map +1 -0
  676. package/dist/types/libraries/mongo/models/providers/shop-payout.model.d.ts +62 -0
  677. package/dist/types/libraries/mongo/models/providers/shop-payout.model.js +244 -0
  678. package/dist/types/libraries/mongo/models/providers/shop-payout.model.js.map +1 -0
  679. package/dist/types/libraries/mongo/models/providers/shop-review.model.d.ts +12 -0
  680. package/dist/types/libraries/mongo/models/providers/shop-review.model.js +38 -0
  681. package/dist/types/libraries/mongo/models/providers/shop-review.model.js.map +1 -0
  682. package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.d.ts +13 -0
  683. package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.js +47 -0
  684. package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.js.map +1 -0
  685. package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.d.ts +11 -0
  686. package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.js +46 -0
  687. package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.js.map +1 -0
  688. package/dist/types/libraries/mongo/models/providers/vendor-payout.model.d.ts +50 -0
  689. package/dist/types/libraries/mongo/models/providers/vendor-payout.model.js +192 -0
  690. package/dist/types/libraries/mongo/models/providers/vendor-payout.model.js.map +1 -0
  691. package/dist/types/libraries/mongo/models/providers/vendor-review.model.d.ts +12 -0
  692. package/dist/types/libraries/mongo/models/providers/vendor-review.model.js +38 -0
  693. package/dist/types/libraries/mongo/models/providers/vendor-review.model.js.map +1 -0
  694. package/dist/types/libraries/mongo/models/punch-marketing-history.model.d.ts +24 -0
  695. package/dist/types/libraries/mongo/models/punch-marketing-history.model.js +101 -0
  696. package/dist/types/libraries/mongo/models/punch-marketing-history.model.js.map +1 -0
  697. package/dist/types/libraries/mongo/models/rating-setting.model.d.ts +8 -0
  698. package/dist/types/libraries/mongo/models/rating-setting.model.js +46 -0
  699. package/dist/types/libraries/mongo/models/rating-setting.model.js.map +1 -0
  700. package/dist/types/libraries/mongo/models/referral-setting.model.d.ts +6 -0
  701. package/dist/types/libraries/mongo/models/referral-setting.model.js +32 -0
  702. package/dist/types/libraries/mongo/models/referral-setting.model.js.map +1 -0
  703. package/dist/types/libraries/mongo/models/request-area.model.d.ts +8 -0
  704. package/dist/types/libraries/mongo/models/request-area.model.js +33 -0
  705. package/dist/types/libraries/mongo/models/request-area.model.js.map +1 -0
  706. package/dist/types/libraries/mongo/models/review.model.d.ts +15 -0
  707. package/dist/types/libraries/mongo/models/review.model.js +68 -0
  708. package/dist/types/libraries/mongo/models/review.model.js.map +1 -0
  709. package/dist/types/libraries/mongo/models/reward.model.d.ts +16 -0
  710. package/dist/types/libraries/mongo/models/reward.model.js +70 -0
  711. package/dist/types/libraries/mongo/models/reward.model.js.map +1 -0
  712. package/dist/types/libraries/mongo/models/rider-timeout.model.d.ts +10 -0
  713. package/dist/types/libraries/mongo/models/rider-timeout.model.js +47 -0
  714. package/dist/types/libraries/mongo/models/rider-timeout.model.js.map +1 -0
  715. package/dist/types/libraries/mongo/models/rider-tracking.model.d.ts +10 -0
  716. package/dist/types/libraries/mongo/models/rider-tracking.model.js +47 -0
  717. package/dist/types/libraries/mongo/models/rider-tracking.model.js.map +1 -0
  718. package/dist/types/libraries/mongo/models/rider.model.d.ts +70 -0
  719. package/dist/types/libraries/mongo/models/rider.model.js +358 -0
  720. package/dist/types/libraries/mongo/models/rider.model.js.map +1 -0
  721. package/dist/types/libraries/mongo/models/service-addon.model.d.ts +16 -0
  722. package/dist/types/libraries/mongo/models/service-addon.model.js +86 -0
  723. package/dist/types/libraries/mongo/models/service-addon.model.js.map +1 -0
  724. package/dist/types/libraries/mongo/models/service-booking.model.d.ts +68 -0
  725. package/dist/types/libraries/mongo/models/service-booking.model.js +310 -0
  726. package/dist/types/libraries/mongo/models/service-booking.model.js.map +1 -0
  727. package/dist/types/libraries/mongo/models/service-cart.model.d.ts +14 -0
  728. package/dist/types/libraries/mongo/models/service-cart.model.js +51 -0
  729. package/dist/types/libraries/mongo/models/service-cart.model.js.map +1 -0
  730. package/dist/types/libraries/mongo/models/service-category.model.d.ts +14 -0
  731. package/dist/types/libraries/mongo/models/service-category.model.js +87 -0
  732. package/dist/types/libraries/mongo/models/service-category.model.js.map +1 -0
  733. package/dist/types/libraries/mongo/models/service-control.model.d.ts +8 -0
  734. package/dist/types/libraries/mongo/models/service-control.model.js +50 -0
  735. package/dist/types/libraries/mongo/models/service-control.model.js.map +1 -0
  736. package/dist/types/libraries/mongo/models/service-flag.model.d.ts +19 -0
  737. package/dist/types/libraries/mongo/models/service-flag.model.js +72 -0
  738. package/dist/types/libraries/mongo/models/service-flag.model.js.map +1 -0
  739. package/dist/types/libraries/mongo/models/service-package.model.d.ts +27 -0
  740. package/dist/types/libraries/mongo/models/service-package.model.js +142 -0
  741. package/dist/types/libraries/mongo/models/service-package.model.js.map +1 -0
  742. package/dist/types/libraries/mongo/models/service-promotion.model.d.ts +27 -0
  743. package/dist/types/libraries/mongo/models/service-promotion.model.js +120 -0
  744. package/dist/types/libraries/mongo/models/service-promotion.model.js.map +1 -0
  745. package/dist/types/libraries/mongo/models/service.model.d.ts +8 -0
  746. package/dist/types/libraries/mongo/models/service.model.js +43 -0
  747. package/dist/types/libraries/mongo/models/service.model.js.map +1 -0
  748. package/dist/types/libraries/mongo/models/setting.model.d.ts +51 -0
  749. package/dist/types/libraries/mongo/models/setting.model.js +201 -0
  750. package/dist/types/libraries/mongo/models/setting.model.js.map +1 -0
  751. package/dist/types/libraries/mongo/models/shared/address.model.d.ts +38 -0
  752. package/dist/types/libraries/mongo/models/shared/address.model.js +158 -0
  753. package/dist/types/libraries/mongo/models/shared/address.model.js.map +1 -0
  754. package/dist/types/libraries/mongo/models/shared/duration.model.d.ts +14 -0
  755. package/dist/types/libraries/mongo/models/shared/duration.model.js +59 -0
  756. package/dist/types/libraries/mongo/models/shared/duration.model.js.map +1 -0
  757. package/dist/types/libraries/mongo/models/shared/geo-location.model.d.ts +5 -0
  758. package/dist/types/libraries/mongo/models/shared/geo-location.model.js +28 -0
  759. package/dist/types/libraries/mongo/models/shared/geo-location.model.js.map +1 -0
  760. package/dist/types/libraries/mongo/models/shared/work-hour.model.d.ts +19 -0
  761. package/dist/types/libraries/mongo/models/shared/work-hour.model.js +81 -0
  762. package/dist/types/libraries/mongo/models/shared/work-hour.model.js.map +1 -0
  763. package/dist/types/libraries/mongo/models/shop-access-control.model.d.ts +16 -0
  764. package/dist/types/libraries/mongo/models/shop-access-control.model.js +81 -0
  765. package/dist/types/libraries/mongo/models/shop-access-control.model.js.map +1 -0
  766. package/dist/types/libraries/mongo/models/shop-category.model.d.ts +13 -0
  767. package/dist/types/libraries/mongo/models/shop-category.model.js +64 -0
  768. package/dist/types/libraries/mongo/models/shop-category.model.js.map +1 -0
  769. package/dist/types/libraries/mongo/models/shop-meal-plan.model.d.ts +12 -0
  770. package/dist/types/libraries/mongo/models/shop-meal-plan.model.js +45 -0
  771. package/dist/types/libraries/mongo/models/shop-meal-plan.model.js.map +1 -0
  772. package/dist/types/libraries/mongo/models/shop-section.model.d.ts +18 -0
  773. package/dist/types/libraries/mongo/models/shop-section.model.js +89 -0
  774. package/dist/types/libraries/mongo/models/shop-section.model.js.map +1 -0
  775. package/dist/types/libraries/mongo/models/shop.model.d.ts +65 -0
  776. package/dist/types/libraries/mongo/models/shop.model.js +304 -0
  777. package/dist/types/libraries/mongo/models/shop.model.js.map +1 -0
  778. package/dist/types/libraries/mongo/models/spend-to-get-history.model.d.ts +13 -0
  779. package/dist/types/libraries/mongo/models/spend-to-get-history.model.js +51 -0
  780. package/dist/types/libraries/mongo/models/spend-to-get-history.model.js.map +1 -0
  781. package/dist/types/libraries/mongo/models/subscription.model.d.ts +20 -0
  782. package/dist/types/libraries/mongo/models/subscription.model.js +93 -0
  783. package/dist/types/libraries/mongo/models/subscription.model.js.map +1 -0
  784. package/dist/types/libraries/mongo/models/support-reason.model.d.ts +10 -0
  785. package/dist/types/libraries/mongo/models/support-reason.model.js +61 -0
  786. package/dist/types/libraries/mongo/models/support-reason.model.js.map +1 -0
  787. package/dist/types/libraries/mongo/models/tag.model.d.ts +10 -0
  788. package/dist/types/libraries/mongo/models/tag.model.js +64 -0
  789. package/dist/types/libraries/mongo/models/tag.model.js.map +1 -0
  790. package/dist/types/libraries/mongo/models/terms-and-conditions.model.d.ts +8 -0
  791. package/dist/types/libraries/mongo/models/terms-and-conditions.model.js +51 -0
  792. package/dist/types/libraries/mongo/models/terms-and-conditions.model.js.map +1 -0
  793. package/dist/types/libraries/mongo/models/ticket-action.model.d.ts +4 -0
  794. package/dist/types/libraries/mongo/models/ticket-action.model.js +31 -0
  795. package/dist/types/libraries/mongo/models/ticket-action.model.js.map +1 -0
  796. package/dist/types/libraries/mongo/models/ticket.model.d.ts +35 -0
  797. package/dist/types/libraries/mongo/models/ticket.model.js +144 -0
  798. package/dist/types/libraries/mongo/models/ticket.model.js.map +1 -0
  799. package/dist/types/libraries/mongo/models/tournament-participant.model.d.ts +22 -0
  800. package/dist/types/libraries/mongo/models/tournament-participant.model.js +84 -0
  801. package/dist/types/libraries/mongo/models/tournament-participant.model.js.map +1 -0
  802. package/dist/types/libraries/mongo/models/tournament.model.d.ts +65 -0
  803. package/dist/types/libraries/mongo/models/tournament.model.js +273 -0
  804. package/dist/types/libraries/mongo/models/tournament.model.js.map +1 -0
  805. package/dist/types/libraries/mongo/models/user-action.model.d.ts +29 -0
  806. package/dist/types/libraries/mongo/models/user-action.model.js +113 -0
  807. package/dist/types/libraries/mongo/models/user-action.model.js.map +1 -0
  808. package/dist/types/libraries/mongo/models/user-app-section-setting.model.d.ts +24 -0
  809. package/dist/types/libraries/mongo/models/user-app-section-setting.model.js +103 -0
  810. package/dist/types/libraries/mongo/models/user-app-section-setting.model.js.map +1 -0
  811. package/dist/types/libraries/mongo/models/user.model.d.ts +39 -0
  812. package/dist/types/libraries/mongo/models/user.model.js +150 -0
  813. package/dist/types/libraries/mongo/models/user.model.js.map +1 -0
  814. package/dist/types/libraries/mongo/models/vendor-access-control.model.d.ts +14 -0
  815. package/dist/types/libraries/mongo/models/vendor-access-control.model.js +75 -0
  816. package/dist/types/libraries/mongo/models/vendor-access-control.model.js.map +1 -0
  817. package/dist/types/libraries/mongo/models/vendor-parent.model.d.ts +25 -0
  818. package/dist/types/libraries/mongo/models/vendor-parent.model.js +121 -0
  819. package/dist/types/libraries/mongo/models/vendor-parent.model.js.map +1 -0
  820. package/dist/types/libraries/mongo/models/vendor.model.d.ts +33 -0
  821. package/dist/types/libraries/mongo/models/vendor.model.js +150 -0
  822. package/dist/types/libraries/mongo/models/vendor.model.js.map +1 -0
  823. package/dist/types/libraries/mongo/models/zone-extra-time.d.ts +12 -0
  824. package/dist/types/libraries/mongo/models/zone-extra-time.js +54 -0
  825. package/dist/types/libraries/mongo/models/zone-extra-time.js.map +1 -0
  826. package/dist/types/libraries/mongo/models/zone.model.d.ts +17 -0
  827. package/dist/types/libraries/mongo/models/zone.model.js +80 -0
  828. package/dist/types/libraries/mongo/models/zone.model.js.map +1 -0
  829. package/dist/types/libraries/mongo/plugins/normalize-field.plugin.d.ts +4 -0
  830. package/dist/types/libraries/mongo/plugins/normalize-field.plugin.js +42 -0
  831. package/dist/types/libraries/mongo/plugins/normalize-field.plugin.js.map +1 -0
  832. package/dist/types/libraries/mongo/plugins/soft-delete-plugin.d.ts +32 -0
  833. package/dist/types/libraries/mongo/plugins/soft-delete-plugin.js +145 -0
  834. package/dist/types/libraries/mongo/plugins/soft-delete-plugin.js.map +1 -0
  835. package/dist/types/libraries/mongo/utilities/shop.hooks.d.ts +9 -0
  836. package/dist/types/libraries/mongo/utilities/shop.hooks.js +11 -0
  837. package/dist/types/libraries/mongo/utilities/shop.hooks.js.map +1 -0
  838. package/dist/types/libraries/mongo/utilities/sorting-order.hooks.d.ts +14 -0
  839. package/dist/types/libraries/mongo/utilities/sorting-order.hooks.js +58 -0
  840. package/dist/types/libraries/mongo/utilities/sorting-order.hooks.js.map +1 -0
  841. package/dist/types/libraries/mongo/utilities/unique-id.hooks.d.ts +6 -0
  842. package/dist/types/libraries/mongo/utilities/unique-id.hooks.js +17 -0
  843. package/dist/types/libraries/mongo/utilities/unique-id.hooks.js.map +1 -0
  844. package/dist/types/libraries/notification/firebase-fcm.service.d.ts +7 -0
  845. package/dist/types/libraries/notification/firebase-fcm.service.js +40 -0
  846. package/dist/types/libraries/notification/firebase-fcm.service.js.map +1 -0
  847. package/dist/types/libraries/notification/firebase-message.builder.d.ts +22 -0
  848. package/dist/types/libraries/notification/firebase-message.builder.js +107 -0
  849. package/dist/types/libraries/notification/firebase-message.builder.js.map +1 -0
  850. package/dist/types/libraries/notification/lyxa-fcm-sender.d.ts +19 -0
  851. package/dist/types/libraries/notification/lyxa-fcm-sender.js +127 -0
  852. package/dist/types/libraries/notification/lyxa-fcm-sender.js.map +1 -0
  853. package/dist/types/libraries/notification/lyxa-fcm.service.d.ts +40 -0
  854. package/dist/types/libraries/notification/lyxa-fcm.service.js +177 -0
  855. package/dist/types/libraries/notification/lyxa-fcm.service.js.map +1 -0
  856. package/dist/types/libraries/redis/index.d.ts +25 -0
  857. package/dist/types/libraries/redis/index.js +137 -0
  858. package/dist/types/libraries/redis/index.js.map +1 -0
  859. package/dist/types/libraries/secrets/index.d.ts +10 -0
  860. package/dist/types/libraries/secrets/index.js +64 -0
  861. package/dist/types/libraries/secrets/index.js.map +1 -0
  862. package/dist/types/libraries/socket/BaseSocketEvent.d.ts +27 -0
  863. package/dist/types/libraries/socket/BaseSocketEvent.js +47 -0
  864. package/dist/types/libraries/socket/BaseSocketEvent.js.map +1 -0
  865. package/dist/types/libraries/socket/PushNotificationEvent.d.ts +36 -0
  866. package/dist/types/libraries/socket/PushNotificationEvent.js +45 -0
  867. package/dist/types/libraries/socket/PushNotificationEvent.js.map +1 -0
  868. package/dist/types/libraries/socket/connections/batch.d.ts +12 -0
  869. package/dist/types/libraries/socket/connections/batch.js +58 -0
  870. package/dist/types/libraries/socket/connections/batch.js.map +1 -0
  871. package/dist/types/libraries/socket/connections/cache.d.ts +9 -0
  872. package/dist/types/libraries/socket/connections/cache.js +36 -0
  873. package/dist/types/libraries/socket/connections/cache.js.map +1 -0
  874. package/dist/types/libraries/socket/connections/constants.d.ts +2 -0
  875. package/dist/types/libraries/socket/connections/constants.js +6 -0
  876. package/dist/types/libraries/socket/connections/constants.js.map +1 -0
  877. package/dist/types/libraries/socket/connections/index.d.ts +7 -0
  878. package/dist/types/libraries/socket/connections/index.js +24 -0
  879. package/dist/types/libraries/socket/connections/index.js.map +1 -0
  880. package/dist/types/libraries/socket/connections/instance-disconnect.d.ts +2 -0
  881. package/dist/types/libraries/socket/connections/instance-disconnect.js +43 -0
  882. package/dist/types/libraries/socket/connections/instance-disconnect.js.map +1 -0
  883. package/dist/types/libraries/socket/connections/keys.d.ts +10 -0
  884. package/dist/types/libraries/socket/connections/keys.js +23 -0
  885. package/dist/types/libraries/socket/connections/keys.js.map +1 -0
  886. package/dist/types/libraries/socket/connections/presence.d.ts +6 -0
  887. package/dist/types/libraries/socket/connections/presence.js +39 -0
  888. package/dist/types/libraries/socket/connections/presence.js.map +1 -0
  889. package/dist/types/libraries/socket/connections/redis-helpers.d.ts +2 -0
  890. package/dist/types/libraries/socket/connections/redis-helpers.js +14 -0
  891. package/dist/types/libraries/socket/connections/redis-helpers.js.map +1 -0
  892. package/dist/types/libraries/socket/connections/subscription.d.ts +13 -0
  893. package/dist/types/libraries/socket/connections/subscription.js +73 -0
  894. package/dist/types/libraries/socket/connections/subscription.js.map +1 -0
  895. package/dist/types/libraries/socket/core/index.d.ts +6 -0
  896. package/dist/types/libraries/socket/core/index.js +23 -0
  897. package/dist/types/libraries/socket/core/index.js.map +1 -0
  898. package/dist/types/libraries/socket/core/local-subscription-registry.d.ts +17 -0
  899. package/dist/types/libraries/socket/core/local-subscription-registry.js +60 -0
  900. package/dist/types/libraries/socket/core/local-subscription-registry.js.map +1 -0
  901. package/dist/types/libraries/socket/core/socket-event-consumer.d.ts +1 -0
  902. package/dist/types/libraries/socket/core/socket-event-consumer.js +14 -0
  903. package/dist/types/libraries/socket/core/socket-event-consumer.js.map +1 -0
  904. package/dist/types/libraries/socket/core/socket-event-publisher.d.ts +6 -0
  905. package/dist/types/libraries/socket/core/socket-event-publisher.js +82 -0
  906. package/dist/types/libraries/socket/core/socket-event-publisher.js.map +1 -0
  907. package/dist/types/libraries/socket/core/socket-event-registry.d.ts +12 -0
  908. package/dist/types/libraries/socket/core/socket-event-registry.js +23 -0
  909. package/dist/types/libraries/socket/core/socket-event-registry.js.map +1 -0
  910. package/dist/types/libraries/socket/core/socket-event-registry.map.d.ts +34 -0
  911. package/dist/types/libraries/socket/core/socket-event-registry.map.js +34 -0
  912. package/dist/types/libraries/socket/core/socket-event-registry.map.js.map +1 -0
  913. package/dist/types/libraries/socket/core/zAsyncIterable.d.ts +7 -0
  914. package/dist/types/libraries/socket/core/zAsyncIterable.js +35 -0
  915. package/dist/types/libraries/socket/core/zAsyncIterable.js.map +1 -0
  916. package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.d.ts +153 -0
  917. package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.js +44 -0
  918. package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.js.map +1 -0
  919. package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.d.ts +286 -0
  920. package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.js +96 -0
  921. package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -0
  922. package/dist/types/libraries/socket/events/index.d.ts +7 -0
  923. package/dist/types/libraries/socket/events/index.js +24 -0
  924. package/dist/types/libraries/socket/events/index.js.map +1 -0
  925. package/dist/types/libraries/socket/events/order-actions.socket.event.d.ts +297 -0
  926. package/dist/types/libraries/socket/events/order-actions.socket.event.js +82 -0
  927. package/dist/types/libraries/socket/events/order-actions.socket.event.js.map +1 -0
  928. package/dist/types/libraries/socket/events/rider-connect.socket.event.d.ts +13 -0
  929. package/dist/types/libraries/socket/events/rider-connect.socket.event.js +22 -0
  930. package/dist/types/libraries/socket/events/rider-connect.socket.event.js.map +1 -0
  931. package/dist/types/libraries/socket/events/rider-location-update.socket.event.d.ts +76 -0
  932. package/dist/types/libraries/socket/events/rider-location-update.socket.event.js +39 -0
  933. package/dist/types/libraries/socket/events/rider-location-update.socket.event.js.map +1 -0
  934. package/dist/types/libraries/socket/events/socketNotificationEvent.d.ts +46 -0
  935. package/dist/types/libraries/socket/events/socketNotificationEvent.js +29 -0
  936. package/dist/types/libraries/socket/events/socketNotificationEvent.js.map +1 -0
  937. package/dist/types/libraries/socket/events/ticket-actions.socket.event.d.ts +106 -0
  938. package/dist/types/libraries/socket/events/ticket-actions.socket.event.js +62 -0
  939. package/dist/types/libraries/socket/events/ticket-actions.socket.event.js.map +1 -0
  940. package/dist/types/libraries/socket/events/ticket-assign.socket.event.d.ts +161 -0
  941. package/dist/types/libraries/socket/events/ticket-assign.socket.event.js +42 -0
  942. package/dist/types/libraries/socket/events/ticket-assign.socket.event.js.map +1 -0
  943. package/dist/types/libraries/socket/events/ticket-unassign.socket.event.d.ts +27 -0
  944. package/dist/types/libraries/socket/events/ticket-unassign.socket.event.js +31 -0
  945. package/dist/types/libraries/socket/events/ticket-unassign.socket.event.js.map +1 -0
  946. package/dist/types/libraries/trpc/context.d.ts +37 -0
  947. package/dist/types/libraries/trpc/context.js +43 -0
  948. package/dist/types/libraries/trpc/context.js.map +1 -0
  949. package/dist/types/libraries/trpc/index.d.ts +75 -0
  950. package/dist/types/libraries/trpc/index.js +80 -0
  951. package/dist/types/libraries/trpc/index.js.map +1 -0
  952. package/dist/types/libraries/twilio/index.d.ts +6 -0
  953. package/dist/types/libraries/twilio/index.js +42 -0
  954. package/dist/types/libraries/twilio/index.js.map +1 -0
  955. package/dist/types/libraries/upload/index.d.ts +50 -0
  956. package/dist/types/libraries/upload/index.js +312 -0
  957. package/dist/types/libraries/upload/index.js.map +1 -0
  958. package/dist/types/package.json +1 -1
  959. package/dist/types/utilities/auth-ref.mapper.d.ts +4 -0
  960. package/dist/types/utilities/auth-ref.mapper.js +22 -0
  961. package/dist/types/utilities/auth-ref.mapper.js.map +1 -0
  962. package/dist/types/utilities/dayjs/dayjs.d.ts +14 -0
  963. package/dist/types/utilities/dayjs/dayjs.js +47 -0
  964. package/dist/types/utilities/dayjs/dayjs.js.map +1 -0
  965. package/dist/types/utilities/dayjs/index.d.ts +2 -0
  966. package/dist/types/utilities/dayjs/index.js +9 -0
  967. package/dist/types/utilities/dayjs/index.js.map +1 -0
  968. package/dist/types/utilities/environment/rabbitmq-environments.d.ts +2 -0
  969. package/dist/types/utilities/environment/rabbitmq-environments.js +14 -0
  970. package/dist/types/utilities/environment/rabbitmq-environments.js.map +1 -0
  971. package/dist/types/utilities/environment/redis-environments.d.ts +2 -0
  972. package/dist/types/utilities/environment/redis-environments.js +14 -0
  973. package/dist/types/utilities/environment/redis-environments.js.map +1 -0
  974. package/dist/types/utilities/error-common.d.ts +10 -0
  975. package/dist/types/utilities/error-common.js +76 -0
  976. package/dist/types/utilities/error-common.js.map +1 -0
  977. package/dist/types/utilities/id-generator.d.ts +6 -0
  978. package/dist/types/utilities/id-generator.js +161 -0
  979. package/dist/types/utilities/id-generator.js.map +1 -0
  980. package/dist/types/utilities/instance.utils.d.ts +1 -0
  981. package/dist/types/utilities/instance.utils.js +12 -0
  982. package/dist/types/utilities/instance.utils.js.map +1 -0
  983. package/dist/types/utilities/normalize.d.ts +6 -0
  984. package/dist/types/utilities/normalize.js +51 -0
  985. package/dist/types/utilities/normalize.js.map +1 -0
  986. package/dist/types/utilities/password.d.ts +2 -0
  987. package/dist/types/utilities/password.js +20 -0
  988. package/dist/types/utilities/password.js.map +1 -0
  989. package/dist/types/utilities/projection.d.ts +8 -0
  990. package/dist/types/utilities/projection.js +37 -0
  991. package/dist/types/utilities/projection.js.map +1 -0
  992. package/dist/types/utilities/time.d.ts +13 -0
  993. package/dist/types/utilities/time.js +128 -0
  994. package/dist/types/utilities/time.js.map +1 -0
  995. package/package.json +1 -5
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.disconnectAllEntitiesFromInstance = disconnectAllEntitiesFromInstance;
4
+ const instance_utils_1 = require("../../../utilities/instance.utils");
5
+ const __1 = require("../../..");
6
+ const keys_1 = require("./keys");
7
+ const redis_helpers_1 = require("./redis-helpers");
8
+ async function disconnectAllEntitiesFromInstance(entityType) {
9
+ const instanceId = (0, instance_utils_1.getInstanceId)();
10
+ const redis = (0, __1.getLibraries)().getRedisService();
11
+ const pattern = entityType
12
+ ? `socket:active_subscriptions:${entityType}:*`
13
+ : 'socket:active_subscriptions:*';
14
+ const ledgerKeys = await (0, redis_helpers_1.scanKeys)(redis.redisClient, pattern);
15
+ const affectedEvents = new Set();
16
+ await Promise.all(ledgerKeys.map(async (ledgerKey) => {
17
+ const [, , type, id] = ledgerKey.split(':');
18
+ const entity = {
19
+ id,
20
+ type: type === 'default' ? undefined : type,
21
+ };
22
+ const eventKeys = await redis.getSetMembers(ledgerKey);
23
+ const pipeline = redis.redisClient.pipeline();
24
+ for (const eventKey of eventKeys) {
25
+ const entityEventKey = (0, keys_1.kEntityEventSockets)(entity, eventKey);
26
+ const sockets = await redis.getSetMembers(entityEventKey);
27
+ const toRemove = sockets.filter(s => {
28
+ const [sInstanceId] = s.split('|');
29
+ return sInstanceId === instanceId;
30
+ });
31
+ for (const s of toRemove) {
32
+ pipeline.srem(entityEventKey, s);
33
+ }
34
+ if (sockets.length - toRemove.length === 0) {
35
+ pipeline.del(entityEventKey);
36
+ pipeline.srem(ledgerKey, eventKey);
37
+ }
38
+ affectedEvents.add(eventKey);
39
+ }
40
+ await pipeline.exec();
41
+ }));
42
+ }
43
+ //# sourceMappingURL=instance-disconnect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance-disconnect.js","sourceRoot":"/","sources":["libraries/socket/connections/instance-disconnect.ts"],"names":[],"mappings":";;AAgBA,8EAqCC;AApDD,sEAAkE;AAClE,gCAAwC;AACxC,iCAA0F;AAC1F,mDAA2C;AAYpC,KAAK,UAAU,iCAAiC,CAAC,UAA2B;IAClF,MAAM,UAAU,GAAG,IAAA,8BAAa,GAAE,CAAC;IACnC,MAAM,KAAK,GAAG,IAAA,gBAAY,GAAE,CAAC,eAAe,EAAE,CAAC;IAC/C,MAAM,OAAO,GAAG,UAAU;QACzB,CAAC,CAAC,+BAA+B,UAAU,IAAI;QAC/C,CAAC,CAAC,+BAA+B,CAAC;IACnC,MAAM,UAAU,GAAG,MAAM,IAAA,wBAAQ,EAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;IACzC,MAAM,OAAO,CAAC,GAAG,CAChB,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,SAAS,EAAC,EAAE;QAChC,MAAM,CAAC,EAAE,AAAD,EAAG,IAAI,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAuB;YAClC,EAAE;YACF,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,IAAuB;SAC/D,CAAC;QACF,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QACvD,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC9C,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,MAAM,cAAc,GAAG,IAAA,0BAAmB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YAC7D,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;YAE1D,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;gBACnC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACnC,OAAO,WAAW,KAAK,UAAU,CAAC;YACnC,CAAC,CAAC,CAAC;YACH,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;gBAC1B,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;YAClC,CAAC;YACD,IAAI,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5C,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;gBAC7B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YACpC,CAAC;YACD,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC;QACD,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC,CAAC,CACF,CAAC;AACH,CAAC","sourcesContent":["// Instance disconnect logic for socket Redis\nimport { getInstanceId } from '../../../utilities/instance.utils';\nimport { getLibraries } from '../../..';\nimport { kEntityEvent, kEntityEventSockets, entityKey, EntitySubscription } from './keys';\nimport { scanKeys } from './redis-helpers';\nimport { AuthEntityType } from '../../auth';\nimport { LRUCache } from './cache';\n\n/**\n * Removes all sockets belonging to the current instance.\n * Used on shutdown or crash recovery.\n * Cleans entity-event keys, event subscribers, and ledgers in bulk.\n *\n * NOTE: This currently scans all ledgers (SCAN), which is acceptable for small/medium scale and infrequent use.\n * For very large scale or frequent shutdowns, consider maintaining a reverse index (instance → ledgers) to avoid SCAN entirely.\n */\nexport async function disconnectAllEntitiesFromInstance(entityType?: AuthEntityType) {\n\tconst instanceId = getInstanceId();\n\tconst redis = getLibraries().getRedisService();\n\tconst pattern = entityType\n\t\t? `socket:active_subscriptions:${entityType}:*`\n\t\t: 'socket:active_subscriptions:*';\n\tconst ledgerKeys = await scanKeys(redis.redisClient, pattern);\n\tconst affectedEvents = new Set<string>();\n\tawait Promise.all(\n\t\tledgerKeys.map(async ledgerKey => {\n\t\t\tconst [, , type, id] = ledgerKey.split(':');\n\t\t\tconst entity: EntitySubscription = {\n\t\t\t\tid,\n\t\t\t\ttype: type === 'default' ? undefined : (type as AuthEntityType),\n\t\t\t};\n\t\t\tconst eventKeys = await redis.getSetMembers(ledgerKey);\n\t\t\tconst pipeline = redis.redisClient.pipeline();\n\t\t\tfor (const eventKey of eventKeys) {\n\t\t\t\tconst entityEventKey = kEntityEventSockets(entity, eventKey);\n\t\t\t\tconst sockets = await redis.getSetMembers(entityEventKey);\n\t\t\t\t// Remove all sockets for this instance\n\t\t\t\tconst toRemove = sockets.filter(s => {\n\t\t\t\t\tconst [sInstanceId] = s.split('|');\n\t\t\t\t\treturn sInstanceId === instanceId;\n\t\t\t\t});\n\t\t\t\tfor (const s of toRemove) {\n\t\t\t\t\tpipeline.srem(entityEventKey, s);\n\t\t\t\t}\n\t\t\t\tif (sockets.length - toRemove.length === 0) {\n\t\t\t\t\tpipeline.del(entityEventKey);\n\t\t\t\t\tpipeline.srem(ledgerKey, eventKey);\n\t\t\t\t}\n\t\t\t\taffectedEvents.add(eventKey);\n\t\t\t}\n\t\t\tawait pipeline.exec();\n\t\t})\n\t);\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { AuthEntityType } from '../../auth';
2
+ export type EntitySubscription = {
3
+ id: string;
4
+ type?: AuthEntityType;
5
+ };
6
+ export declare const entityKey: (entity: EntitySubscription) => string;
7
+ export declare const kEventEntity: (eventKey: string) => string;
8
+ export declare const kEntityEvent: (entity: EntitySubscription) => string;
9
+ export declare const kOnlineEntities: (type: AuthEntityType) => string;
10
+ export declare const kEntityEventSockets: (entity: EntitySubscription, eventKey: string) => string;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.kEntityEventSockets = exports.kOnlineEntities = exports.kEntityEvent = exports.kEventEntity = exports.entityKey = void 0;
4
+ const keyCache = new Map();
5
+ const entityKey = (entity) => {
6
+ const cacheKey = `${entity.type}:${entity.id}`;
7
+ let key = keyCache.get(cacheKey);
8
+ if (!key) {
9
+ key = `${entity.type ?? 'default'}:${entity.id}`;
10
+ keyCache.set(cacheKey, key);
11
+ }
12
+ return key;
13
+ };
14
+ exports.entityKey = entityKey;
15
+ const kEventEntity = (eventKey) => `socket:event:${eventKey}`;
16
+ exports.kEventEntity = kEventEntity;
17
+ const kEntityEvent = (entity) => `socket:subscriptions:${(0, exports.entityKey)(entity)}`;
18
+ exports.kEntityEvent = kEntityEvent;
19
+ const kOnlineEntities = (type) => `socket:online:${type}`;
20
+ exports.kOnlineEntities = kOnlineEntities;
21
+ const kEntityEventSockets = (entity, eventKey) => `socket:entity:${(0, exports.entityKey)(entity)}:${eventKey}`;
22
+ exports.kEntityEventSockets = kEntityEventSockets;
23
+ //# sourceMappingURL=keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keys.js","sourceRoot":"/","sources":["libraries/socket/connections/keys.ts"],"names":[],"mappings":";;;AAOA,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEpC,MAAM,SAAS,GAAG,CAAC,MAA0B,EAAU,EAAE;IAC/D,MAAM,QAAQ,GAAG,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;IAC/C,IAAI,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,CAAC,GAAG,EAAE,CAAC;QACV,GAAG,GAAG,GAAG,MAAM,CAAC,IAAI,IAAI,SAAS,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;QACjD,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AARW,QAAA,SAAS,aAQpB;AAEK,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,gBAAgB,QAAQ,EAAE,CAAC;AAAhE,QAAA,YAAY,gBAAoD;AAEtE,MAAM,YAAY,GAAG,CAAC,MAA0B,EAAE,EAAE,CAAC,wBAAwB,IAAA,iBAAS,EAAC,MAAM,CAAC,EAAE,CAAC;AAA3F,QAAA,YAAY,gBAA+E;AAEjG,MAAM,eAAe,GAAG,CAAC,IAAoB,EAAE,EAAE,CAAC,iBAAiB,IAAI,EAAE,CAAC;AAApE,QAAA,eAAe,mBAAqD;AAE1E,MAAM,mBAAmB,GAAG,CAAC,MAA0B,EAAE,QAAgB,EAAE,EAAE,CACnF,iBAAiB,IAAA,iBAAS,EAAC,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;AADrC,QAAA,mBAAmB,uBACkB","sourcesContent":["import { AuthEntityType } from '../../auth';\n\nexport type EntitySubscription = {\n\tid: string;\n\ttype?: AuthEntityType;\n};\n\nconst keyCache = new Map<string, string>();\n\nexport const entityKey = (entity: EntitySubscription): string => {\n\tconst cacheKey = `${entity.type}:${entity.id}`;\n\tlet key = keyCache.get(cacheKey);\n\tif (!key) {\n\t\tkey = `${entity.type ?? 'default'}:${entity.id}`;\n\t\tkeyCache.set(cacheKey, key);\n\t}\n\treturn key;\n};\n\nexport const kEventEntity = (eventKey: string) => `socket:event:${eventKey}`;\n\nexport const kEntityEvent = (entity: EntitySubscription) => `socket:subscriptions:${entityKey(entity)}`;\n\nexport const kOnlineEntities = (type: AuthEntityType) => `socket:online:${type}`;\n\nexport const kEntityEventSockets = (entity: EntitySubscription, eventKey: string) =>\n\t`socket:entity:${entityKey(entity)}:${eventKey}`;\n"]}
@@ -0,0 +1,6 @@
1
+ import { AuthEntityType } from '../../auth';
2
+ export declare function setUserOnline(userId: string, type: AuthEntityType, timestamp?: number): Promise<void>;
3
+ export declare function setUserOffline(userId: string, type: AuthEntityType): Promise<void>;
4
+ export declare function getOnlineUsers(type: AuthEntityType, page?: number, pageSize?: number): Promise<string[]>;
5
+ export declare function getOnlineUsersCount(type: AuthEntityType, activeWindowMs?: number): Promise<number>;
6
+ export declare function isUserOnline(userId: string, type: AuthEntityType): Promise<boolean>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setUserOnline = setUserOnline;
4
+ exports.setUserOffline = setUserOffline;
5
+ exports.getOnlineUsers = getOnlineUsers;
6
+ exports.getOnlineUsersCount = getOnlineUsersCount;
7
+ exports.isUserOnline = isUserOnline;
8
+ const __1 = require("../../..");
9
+ const dayjs_1 = require("../../../utilities/dayjs");
10
+ const keys_1 = require("./keys");
11
+ async function setUserOnline(userId, type, timestamp = Date.now()) {
12
+ const redis = (0, __1.getLibraries)().getRedisService().redisClient;
13
+ await redis.zadd((0, keys_1.kOnlineEntities)(type), timestamp, userId);
14
+ }
15
+ async function setUserOffline(userId, type) {
16
+ const redis = (0, __1.getLibraries)().getRedisService().redisClient;
17
+ await redis.zrem((0, keys_1.kOnlineEntities)(type), userId);
18
+ }
19
+ async function getOnlineUsers(type, page = 1, pageSize = 100) {
20
+ const redis = (0, __1.getLibraries)().getRedisService().redisClient;
21
+ const zsetKey = (0, keys_1.kOnlineEntities)(type);
22
+ const start = (page - 1) * pageSize;
23
+ const end = start + pageSize - 1;
24
+ return await redis.zrange(zsetKey, start, end);
25
+ }
26
+ async function getOnlineUsersCount(type, activeWindowMs = 60000) {
27
+ const redis = (0, __1.getLibraries)().getRedisService().redisClient;
28
+ const zsetKey = (0, keys_1.kOnlineEntities)(type);
29
+ const now = (0, dayjs_1.dayjs)().valueOf();
30
+ const min = now - activeWindowMs;
31
+ await redis.zremrangebyscore(zsetKey, 0, min);
32
+ return await redis.zcount(zsetKey, min, now);
33
+ }
34
+ async function isUserOnline(userId, type) {
35
+ const redis = (0, __1.getLibraries)().getRedisService().redisClient;
36
+ const score = await redis.zscore((0, keys_1.kOnlineEntities)(type), userId);
37
+ return score !== null;
38
+ }
39
+ //# sourceMappingURL=presence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presence.js","sourceRoot":"/","sources":["libraries/socket/connections/presence.ts"],"names":[],"mappings":";;AASA,sCAGC;AAKD,wCAGC;AAKD,wCAUC;AAED,kDAaC;AAED,oCAIC;AAxDD,gCAAwC;AACxC,oDAAiD;AAEjD,iCAAyC;AAMlC,KAAK,UAAU,aAAa,CAAC,MAAc,EAAE,IAAoB,EAAE,YAAoB,IAAI,CAAC,GAAG,EAAE;IACvG,MAAM,KAAK,GAAG,IAAA,gBAAY,GAAE,CAAC,eAAe,EAAE,CAAC,WAAoB,CAAC;IACpE,MAAM,KAAK,CAAC,IAAI,CAAC,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC;AAKM,KAAK,UAAU,cAAc,CAAC,MAAc,EAAE,IAAoB;IACxE,MAAM,KAAK,GAAG,IAAA,gBAAY,GAAE,CAAC,eAAe,EAAE,CAAC,WAAoB,CAAC;IACpE,MAAM,KAAK,CAAC,IAAI,CAAC,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAKM,KAAK,UAAU,cAAc,CACnC,IAAoB,EACpB,OAAe,CAAC,EAChB,WAAmB,GAAG;IAEtB,MAAM,KAAK,GAAG,IAAA,gBAAY,GAAE,CAAC,eAAe,EAAE,CAAC,WAAoB,CAAC;IACpE,MAAM,OAAO,GAAG,IAAA,sBAAe,EAAC,IAAI,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IACpC,MAAM,GAAG,GAAG,KAAK,GAAG,QAAQ,GAAG,CAAC,CAAC;IACjC,OAAO,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAChD,CAAC;AAEM,KAAK,UAAU,mBAAmB,CACxC,IAAoB,EACpB,iBAAyB,KAAK;IAE9B,MAAM,KAAK,GAAG,IAAA,gBAAY,GAAE,CAAC,eAAe,EAAE,CAAC,WAAoB,CAAC;IACpE,MAAM,OAAO,GAAG,IAAA,sBAAe,EAAC,IAAI,CAAC,CAAC;IAEtC,MAAM,GAAG,GAAG,IAAA,aAAK,GAAE,CAAC,OAAO,EAAE,CAAC;IAC9B,MAAM,GAAG,GAAG,GAAG,GAAG,cAAc,CAAC;IAEjC,MAAM,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAE9C,OAAO,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAEM,KAAK,UAAU,YAAY,CAAC,MAAc,EAAE,IAAoB;IACtE,MAAM,KAAK,GAAG,IAAA,gBAAY,GAAE,CAAC,eAAe,EAAE,CAAC,WAAoB,CAAC;IACpE,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IAChE,OAAO,KAAK,KAAK,IAAI,CAAC;AACvB,CAAC","sourcesContent":["import { getLibraries } from '../../..';\nimport { dayjs } from '../../../utilities/dayjs';\nimport { AuthEntityType } from '../../auth';\nimport { kOnlineEntities } from './keys';\nimport type { Redis } from 'ioredis';\n\n/**\n * Add or update a user as online in the type-based ZSET.\n */\nexport async function setUserOnline(userId: string, type: AuthEntityType, timestamp: number = Date.now()) {\n\tconst redis = getLibraries().getRedisService().redisClient as Redis;\n\tawait redis.zadd(kOnlineEntities(type), timestamp, userId);\n}\n\n/**\n * Remove a user from the type-based online ZSET (on disconnect).\n */\nexport async function setUserOffline(userId: string, type: AuthEntityType) {\n\tconst redis = getLibraries().getRedisService().redisClient as Redis;\n\tawait redis.zrem(kOnlineEntities(type), userId);\n}\n\n/**\n * Paginate online users for a given entity type (deep pagination, scalable).\n */\nexport async function getOnlineUsers(\n\ttype: AuthEntityType,\n\tpage: number = 1,\n\tpageSize: number = 100\n): Promise<string[]> {\n\tconst redis = getLibraries().getRedisService().redisClient as Redis;\n\tconst zsetKey = kOnlineEntities(type);\n\tconst start = (page - 1) * pageSize;\n\tconst end = start + pageSize - 1;\n\treturn await redis.zrange(zsetKey, start, end);\n}\n\nexport async function getOnlineUsersCount(\n\ttype: AuthEntityType,\n\tactiveWindowMs: number = 60000\n): Promise<number> {\n\tconst redis = getLibraries().getRedisService().redisClient as Redis;\n\tconst zsetKey = kOnlineEntities(type);\n\n\tconst now = dayjs().valueOf();\n\tconst min = now - activeWindowMs;\n\n\tawait redis.zremrangebyscore(zsetKey, 0, min);\n\n\treturn await redis.zcount(zsetKey, min, now);\n}\n\nexport async function isUserOnline(userId: string, type: AuthEntityType): Promise<boolean> {\n\tconst redis = getLibraries().getRedisService().redisClient as Redis;\n\tconst score = await redis.zscore(kOnlineEntities(type), userId);\n\treturn score !== null;\n}\n\n/**\n * Example usage:\n *\n * import { getConnectedEntityByType } from './type-queries';\n *\n * // For entity type 'user', get page 2, 100 per page:\n * const users = await getConnectedEntityByType('user', 2, 100);\n */\n"]}
@@ -0,0 +1,2 @@
1
+ import type { Redis } from 'ioredis';
2
+ export declare function scanKeys(redis: Redis, pattern: string): Promise<string[]>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scanKeys = scanKeys;
4
+ async function scanKeys(redis, pattern) {
5
+ const keys = [];
6
+ let cursor = '0';
7
+ do {
8
+ const [newCursor, foundKeys] = await redis.scan(cursor, 'MATCH', pattern, 'COUNT', 100);
9
+ cursor = newCursor;
10
+ keys.push(...foundKeys);
11
+ } while (cursor !== '0');
12
+ return keys;
13
+ }
14
+ //# sourceMappingURL=redis-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis-helpers.js","sourceRoot":"/","sources":["libraries/socket/connections/redis-helpers.ts"],"names":[],"mappings":";;AAGA,4BASC;AATM,KAAK,UAAU,QAAQ,CAAC,KAAY,EAAE,OAAe;IAC3D,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,MAAM,GAAG,GAAG,CAAC;IACjB,GAAG,CAAC;QACH,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACxF,MAAM,GAAG,SAAS,CAAC;QACnB,IAAI,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IACzB,CAAC,QAAQ,MAAM,KAAK,GAAG,EAAE;IACzB,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["// Redis set helpers for socket logic\nimport type { Redis } from 'ioredis';\n\nexport async function scanKeys(redis: Redis, pattern: string): Promise<string[]> {\n\tconst keys: string[] = [];\n\tlet cursor = '0';\n\tdo {\n\t\tconst [newCursor, foundKeys] = await redis.scan(cursor, 'MATCH', pattern, 'COUNT', 100);\n\t\tcursor = newCursor;\n\t\tkeys.push(...foundKeys);\n\t} while (cursor !== '0');\n\treturn keys;\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { EntitySubscription } from './keys';
2
+ export interface SocketRedisEventInformation {
3
+ eventKey: string;
4
+ instanceId: string;
5
+ socketId: string;
6
+ }
7
+ export declare function connectEntityToSocketEvent(entity: EntitySubscription, socketRedisEventInformation: SocketRedisEventInformation): Promise<void>;
8
+ export declare function disconnectEntityFromSocketEvent(entity: EntitySubscription, socketRedisEventInformation: SocketRedisEventInformation): Promise<{
9
+ removed: boolean;
10
+ socketsRemoved: number;
11
+ subscribersRemoved: number;
12
+ }>;
13
+ export declare function refreshEntityEventTTL(entity: EntitySubscription): Promise<void>;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.connectEntityToSocketEvent = connectEntityToSocketEvent;
4
+ exports.disconnectEntityFromSocketEvent = disconnectEntityFromSocketEvent;
5
+ exports.refreshEntityEventTTL = refreshEntityEventTTL;
6
+ const __1 = require("../../..");
7
+ const keys_1 = require("./keys");
8
+ const constants_1 = require("./constants");
9
+ const cache_1 = require("./cache");
10
+ const subscriptionCache = new cache_1.LRUCache(10000);
11
+ const eventSubscribersCache = new cache_1.LRUCache(5000);
12
+ async function connectEntityToSocketEvent(entity, socketRedisEventInformation) {
13
+ const redis = (0, __1.getLibraries)().getRedisService();
14
+ const entityKeyStr = (0, keys_1.entityKey)(entity);
15
+ const { instanceId, socketId, eventKey } = socketRedisEventInformation;
16
+ const socketData = `${instanceId}|${socketId}`;
17
+ const subscriberData = `${entityKeyStr}|${instanceId}|${socketId}`;
18
+ const entityEventKey = (0, keys_1.kEntityEventSockets)(entity, eventKey);
19
+ const eventSubsKey = (0, keys_1.kEventEntity)(eventKey);
20
+ const ledgerKey = (0, keys_1.kEntityEvent)(entity);
21
+ await Promise.all([
22
+ redis.addToSet(entityEventKey, socketData),
23
+ redis.addToSet(eventSubsKey, subscriberData),
24
+ redis.addToSet(ledgerKey, eventKey),
25
+ ]);
26
+ await Promise.all([
27
+ redis.redisClient.expire(entityEventKey, constants_1.REDIS_KEY_TTL_SECONDS),
28
+ redis.redisClient.expire(eventSubsKey, constants_1.REDIS_KEY_TTL_SECONDS),
29
+ redis.redisClient.expire(ledgerKey, constants_1.REDIS_KEY_TTL_SECONDS),
30
+ ]);
31
+ subscriptionCache.delete(`${entityKeyStr}:${eventKey}`);
32
+ eventSubscribersCache.delete(eventKey);
33
+ }
34
+ async function disconnectEntityFromSocketEvent(entity, socketRedisEventInformation) {
35
+ const redis = (0, __1.getLibraries)().getRedisService();
36
+ const entityKeyStr = (0, keys_1.entityKey)(entity);
37
+ const { instanceId, socketId, eventKey } = socketRedisEventInformation;
38
+ const entityEventKey = (0, keys_1.kEntityEventSockets)(entity, eventKey);
39
+ const eventSubsKey = (0, keys_1.kEventEntity)(eventKey);
40
+ const ledgerKey = (0, keys_1.kEntityEvent)(entity);
41
+ const socketData = `${instanceId}|${socketId}`;
42
+ const subscriberData = `${entityKeyStr}|${instanceId}|${socketId}`;
43
+ await Promise.all([
44
+ redis.removeFromSet(entityEventKey, socketData),
45
+ redis.removeFromSet(eventSubsKey, subscriberData),
46
+ ]);
47
+ const entitySockets = await redis.getSetMembers(entityEventKey);
48
+ if (entitySockets.length === 0) {
49
+ await Promise.all([redis.deleteCachedObject(entityEventKey), redis.removeFromSet(ledgerKey, eventKey)]);
50
+ }
51
+ subscriptionCache.delete(`${entityKeyStr}:${eventKey}`);
52
+ eventSubscribersCache.delete(eventKey);
53
+ return {
54
+ removed: true,
55
+ socketsRemoved: 1,
56
+ subscribersRemoved: 1,
57
+ };
58
+ }
59
+ async function refreshEntityEventTTL(entity) {
60
+ const redis = (0, __1.getLibraries)().getRedisService();
61
+ const ledgerKey = (0, keys_1.kEntityEvent)(entity);
62
+ const activeEvents = await redis.getSetMembers(ledgerKey);
63
+ if (!activeEvents.length)
64
+ return;
65
+ const pipeline = redis.redisClient.pipeline();
66
+ pipeline.expire(ledgerKey, constants_1.REDIS_KEY_TTL_SECONDS);
67
+ for (const eventKey of activeEvents) {
68
+ pipeline.expire((0, keys_1.kEntityEventSockets)(entity, eventKey), constants_1.REDIS_KEY_TTL_SECONDS);
69
+ pipeline.expire((0, keys_1.kEventEntity)(eventKey), constants_1.REDIS_KEY_TTL_SECONDS);
70
+ }
71
+ await pipeline.exec();
72
+ }
73
+ //# sourceMappingURL=subscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription.js","sourceRoot":"/","sources":["libraries/socket/connections/subscription.ts"],"names":[],"mappings":"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","sourcesContent":["// Subscription management logic for socket Redis\nimport { getLibraries } from '../../..';\nimport { kEntityEventSockets, kEventEntity, kEntityEvent, entityKey, EntitySubscription } from './keys';\nimport { REDIS_KEY_TTL_SECONDS } from './constants';\nimport { LRUCache } from './cache';\n\nexport interface SocketRedisEventInformation {\n\teventKey: string;\n\tinstanceId: string;\n\tsocketId: string;\n}\n\nconst subscriptionCache = new LRUCache<\n\tstring,\n\t{ isSubscribed: boolean; instances: string[]; timestamp: number }\n>(10000);\nconst eventSubscribersCache = new LRUCache<string, { subscribers: EntitySubscription[]; timestamp: number }>(\n\t5000\n);\n\nexport async function connectEntityToSocketEvent(\n\tentity: EntitySubscription,\n\tsocketRedisEventInformation: SocketRedisEventInformation\n) {\n\tconst redis = getLibraries().getRedisService();\n\tconst entityKeyStr = entityKey(entity);\n\tconst { instanceId, socketId, eventKey } = socketRedisEventInformation;\n\tconst socketData = `${instanceId}|${socketId}`;\n\tconst subscriberData = `${entityKeyStr}|${instanceId}|${socketId}`;\n\tconst entityEventKey = kEntityEventSockets(entity, eventKey);\n\tconst eventSubsKey = kEventEntity(eventKey);\n\tconst ledgerKey = kEntityEvent(entity);\n\tawait Promise.all([\n\t\tredis.addToSet(entityEventKey, socketData),\n\t\tredis.addToSet(eventSubsKey, subscriberData),\n\t\tredis.addToSet(ledgerKey, eventKey),\n\t]);\n\tawait Promise.all([\n\t\tredis.redisClient.expire(entityEventKey, REDIS_KEY_TTL_SECONDS),\n\t\tredis.redisClient.expire(eventSubsKey, REDIS_KEY_TTL_SECONDS),\n\t\tredis.redisClient.expire(ledgerKey, REDIS_KEY_TTL_SECONDS),\n\t]);\n\tsubscriptionCache.delete(`${entityKeyStr}:${eventKey}`);\n\teventSubscribersCache.delete(eventKey);\n}\n\nexport async function disconnectEntityFromSocketEvent(\n\tentity: EntitySubscription,\n\tsocketRedisEventInformation: SocketRedisEventInformation\n) {\n\tconst redis = getLibraries().getRedisService();\n\tconst entityKeyStr = entityKey(entity);\n\tconst { instanceId, socketId, eventKey } = socketRedisEventInformation;\n\tconst entityEventKey = kEntityEventSockets(entity, eventKey);\n\tconst eventSubsKey = kEventEntity(eventKey);\n\tconst ledgerKey = kEntityEvent(entity);\n\tconst socketData = `${instanceId}|${socketId}`;\n\tconst subscriberData = `${entityKeyStr}|${instanceId}|${socketId}`;\n\tawait Promise.all([\n\t\tredis.removeFromSet(entityEventKey, socketData),\n\t\tredis.removeFromSet(eventSubsKey, subscriberData),\n\t]);\n\tconst entitySockets = await redis.getSetMembers(entityEventKey);\n\tif (entitySockets.length === 0) {\n\t\tawait Promise.all([redis.deleteCachedObject(entityEventKey), redis.removeFromSet(ledgerKey, eventKey)]);\n\t}\n\tsubscriptionCache.delete(`${entityKeyStr}:${eventKey}`);\n\teventSubscribersCache.delete(eventKey);\n\treturn {\n\t\tremoved: true,\n\t\tsocketsRemoved: 1,\n\t\tsubscribersRemoved: 1,\n\t};\n}\n\nexport async function refreshEntityEventTTL(entity: EntitySubscription) {\n\tconst redis = getLibraries().getRedisService();\n\tconst ledgerKey = kEntityEvent(entity);\n\tconst activeEvents = await redis.getSetMembers(ledgerKey);\n\tif (!activeEvents.length) return;\n\tconst pipeline = redis.redisClient.pipeline();\n\tpipeline.expire(ledgerKey, REDIS_KEY_TTL_SECONDS);\n\tfor (const eventKey of activeEvents) {\n\t\tpipeline.expire(kEntityEventSockets(entity, eventKey), REDIS_KEY_TTL_SECONDS);\n\t\tpipeline.expire(kEventEntity(eventKey), REDIS_KEY_TTL_SECONDS);\n\t}\n\tawait pipeline.exec();\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export * from '../BaseSocketEvent';
2
+ export * from './local-subscription-registry';
3
+ export * from './socket-event-registry';
4
+ export * from './zAsyncIterable';
5
+ export * from './socket-event-publisher';
6
+ export * from './socket-event-consumer';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("../BaseSocketEvent"), exports);
18
+ __exportStar(require("./local-subscription-registry"), exports);
19
+ __exportStar(require("./socket-event-registry"), exports);
20
+ __exportStar(require("./zAsyncIterable"), exports);
21
+ __exportStar(require("./socket-event-publisher"), exports);
22
+ __exportStar(require("./socket-event-consumer"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/socket/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,gEAA8C;AAC9C,0DAAwC;AACxC,mDAAiC;AACjC,2DAAyC;AACzC,0DAAwC","sourcesContent":["export * from '../BaseSocketEvent';\nexport * from './local-subscription-registry';\nexport * from './socket-event-registry';\nexport * from './zAsyncIterable';\nexport * from './socket-event-publisher';\nexport * from './socket-event-consumer';\n"]}
@@ -0,0 +1,17 @@
1
+ import EventEmitter from 'events';
2
+ import { EntitySubscription } from '../connections';
3
+ type EventKey = string;
4
+ type SocketId = string;
5
+ export declare class LocalEventEmitter {
6
+ readonly ee: EventEmitter;
7
+ readonly socketId: SocketId;
8
+ constructor(socketId: SocketId);
9
+ }
10
+ declare class LocalSubscriptionRegistry {
11
+ private listeners;
12
+ bind(entity: EntitySubscription, eventKey: EventKey, ee: LocalEventEmitter): void;
13
+ unbind(entity: EntitySubscription, eventKey: EventKey, ee: LocalEventEmitter): void;
14
+ emit(entity: EntitySubscription, eventKey: EventKey, payload: unknown): void;
15
+ }
16
+ export declare const LocalSubs: LocalSubscriptionRegistry;
17
+ export {};
@@ -0,0 +1,60 @@
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.LocalSubs = exports.LocalEventEmitter = void 0;
7
+ const events_1 = __importDefault(require("events"));
8
+ const keyCache = new Map();
9
+ const entityKey = (entity) => {
10
+ const raw = `${entity.type ?? 'default'}:${entity.id}`;
11
+ let cached = keyCache.get(raw);
12
+ if (!cached) {
13
+ cached = raw;
14
+ keyCache.set(raw, cached);
15
+ }
16
+ return cached;
17
+ };
18
+ class LocalEventEmitter {
19
+ ee;
20
+ socketId;
21
+ constructor(socketId) {
22
+ this.ee = new events_1.default();
23
+ this.ee.setMaxListeners(0);
24
+ this.socketId = socketId;
25
+ }
26
+ }
27
+ exports.LocalEventEmitter = LocalEventEmitter;
28
+ class LocalSubscriptionRegistry {
29
+ listeners = new Map();
30
+ bind(entity, eventKey, ee) {
31
+ const key = `${entityKey(entity)}:${eventKey}`;
32
+ let listenerSet = this.listeners.get(key);
33
+ if (!listenerSet) {
34
+ listenerSet = new Set();
35
+ this.listeners.set(key, listenerSet);
36
+ }
37
+ listenerSet.add(ee);
38
+ }
39
+ unbind(entity, eventKey, ee) {
40
+ const key = `${entityKey(entity)}:${eventKey}`;
41
+ const listenerSet = this.listeners.get(key);
42
+ if (listenerSet) {
43
+ listenerSet.delete(ee);
44
+ if (listenerSet.size === 0) {
45
+ this.listeners.delete(key);
46
+ }
47
+ }
48
+ }
49
+ emit(entity, eventKey, payload) {
50
+ const key = `${entityKey(entity)}:${eventKey}`;
51
+ const listeners = this.listeners.get(key);
52
+ if (!listeners)
53
+ return;
54
+ for (const listener of listeners) {
55
+ listener.ee.emit(eventKey, payload);
56
+ }
57
+ }
58
+ }
59
+ exports.LocalSubs = new LocalSubscriptionRegistry();
60
+ //# sourceMappingURL=local-subscription-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-subscription-registry.js","sourceRoot":"/","sources":["libraries/socket/core/local-subscription-registry.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAkC;AAOlC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC3C,MAAM,SAAS,GAAG,CAAC,MAA0B,EAAU,EAAE;IACxD,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,IAAI,IAAI,SAAS,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;IACvD,IAAI,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAGF,MAAa,iBAAiB;IACpB,EAAE,CAAe;IACjB,QAAQ,CAAW;IAE5B,YAAY,QAAkB;QAC7B,IAAI,CAAC,EAAE,GAAG,IAAI,gBAAY,EAAE,CAAC;QAC7B,IAAI,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACD;AATD,8CASC;AAED,MAAM,yBAAyB;IAEtB,SAAS,GAAG,IAAI,GAAG,EAAkC,CAAC;IAE9D,IAAI,CAAC,MAA0B,EAAE,QAAkB,EAAE,EAAqB;QACzE,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC/C,IAAI,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE1C,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;YACxB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QACtC,CAAC;QAED,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,MAA0B,EAAE,QAAkB,EAAE,EAAqB;QAC3E,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE5C,IAAI,WAAW,EAAE,CAAC;YACjB,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACvB,IAAI,WAAW,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC5B,CAAC;QACF,CAAC;IACF,CAAC;IAGD,IAAI,CAAC,MAA0B,EAAE,QAAkB,EAAE,OAAgB;QACpE,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC/C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE1C,IAAI,CAAC,SAAS;YAAE,OAAO;QAGvB,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;CACD;AAEY,QAAA,SAAS,GAAG,IAAI,yBAAyB,EAAE,CAAC","sourcesContent":["import EventEmitter from 'events';\nimport { EntitySubscription } from '../connections';\n\ntype EventKey = string;\ntype SocketId = string;\n\n// Zero-overhead key with memoization\nconst keyCache = new Map<string, string>();\nconst entityKey = (entity: EntitySubscription): string => {\n\tconst raw = `${entity.type ?? 'default'}:${entity.id}`;\n\tlet cached = keyCache.get(raw);\n\tif (!cached) {\n\t\tcached = raw;\n\t\tkeyCache.set(raw, cached);\n\t}\n\treturn cached;\n};\n\n// Remove wrapper class - direct EventEmitter usage\nexport class LocalEventEmitter {\n\treadonly ee: EventEmitter;\n\treadonly socketId: SocketId;\n\n\tconstructor(socketId: SocketId) {\n\t\tthis.ee = new EventEmitter();\n\t\tthis.ee.setMaxListeners(0); // Unlimited listeners\n\t\tthis.socketId = socketId;\n\t}\n}\n\nclass LocalSubscriptionRegistry {\n\t// Direct map for O(1) lookups with minimal overhead\n\tprivate listeners = new Map<string, Set<LocalEventEmitter>>();\n\n\tbind(entity: EntitySubscription, eventKey: EventKey, ee: LocalEventEmitter): void {\n\t\tconst key = `${entityKey(entity)}:${eventKey}`;\n\t\tlet listenerSet = this.listeners.get(key);\n\n\t\tif (!listenerSet) {\n\t\t\tlistenerSet = new Set();\n\t\t\tthis.listeners.set(key, listenerSet);\n\t\t}\n\n\t\tlistenerSet.add(ee);\n\t}\n\n\tunbind(entity: EntitySubscription, eventKey: EventKey, ee: LocalEventEmitter): void {\n\t\tconst key = `${entityKey(entity)}:${eventKey}`;\n\t\tconst listenerSet = this.listeners.get(key);\n\n\t\tif (listenerSet) {\n\t\t\tlistenerSet.delete(ee);\n\t\t\tif (listenerSet.size === 0) {\n\t\t\t\tthis.listeners.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Zero-overhead emit - inline fast path\n\temit(entity: EntitySubscription, eventKey: EventKey, payload: unknown): void {\n\t\tconst key = `${entityKey(entity)}:${eventKey}`;\n\t\tconst listeners = this.listeners.get(key);\n\n\t\tif (!listeners) return;\n\n\t\t// Direct iteration - fastest possible\n\t\tfor (const listener of listeners) {\n\t\t\tlistener.ee.emit(eventKey, payload);\n\t\t}\n\t}\n}\n\nexport const LocalSubs = new LocalSubscriptionRegistry();\n"]}
@@ -0,0 +1 @@
1
+ export declare function subscribeToSocketEvent(): Promise<void>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribeToSocketEvent = subscribeToSocketEvent;
4
+ const instance_utils_1 = require("../../../utilities/instance.utils");
5
+ const event_1 = require("../../event");
6
+ const local_subscription_registry_1 = require("./local-subscription-registry");
7
+ async function subscribeToSocketEvent() {
8
+ const instanceId = (0, instance_utils_1.getInstanceId)();
9
+ await (0, event_1.subscribeToQueue)(`socket-events-${instanceId}`, `instance.${instanceId}`, (msg) => {
10
+ const { localKey, payload, recipient } = msg;
11
+ local_subscription_registry_1.LocalSubs.emit(recipient, localKey, payload);
12
+ }, { requeue: false });
13
+ }
14
+ //# sourceMappingURL=socket-event-consumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socket-event-consumer.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-consumer.ts"],"names":[],"mappings":";;AAIA,wDAWC;AAfD,sEAAkE;AAClE,uCAA+C;AAC/C,+EAA0D;AAEnD,KAAK,UAAU,sBAAsB;IAC3C,MAAM,UAAU,GAAG,IAAA,8BAAa,GAAE,CAAC;IACnC,MAAM,IAAA,wBAAgB,EACrB,iBAAiB,UAAU,EAAE,EAC7B,YAAY,UAAU,EAAE,EACxB,CAAC,GAAY,EAAE,EAAE;QAChB,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,GAA6D,CAAC;QACvG,uCAAS,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC,EACD,EAAE,OAAO,EAAE,KAAK,EAAE,CAClB,CAAC;AACH,CAAC","sourcesContent":["import { getInstanceId } from '../../../utilities/instance.utils';\nimport { subscribeToQueue } from '../../event';\nimport { LocalSubs } from './local-subscription-registry';\n\nexport async function subscribeToSocketEvent(): Promise<void> {\n\tconst instanceId = getInstanceId();\n\tawait subscribeToQueue(\n\t\t`socket-events-${instanceId}`,\n\t\t`instance.${instanceId}`,\n\t\t(msg: unknown) => {\n\t\t\tconst { localKey, payload, recipient } = msg as { localKey: string; payload: unknown; recipient: any };\n\t\t\tLocalSubs.emit(recipient, localKey, payload);\n\t\t},\n\t\t{ requeue: false }\n\t);\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { BaseSocketEvent } from '../BaseSocketEvent';
2
+ import { SocketNotificationEvent } from '../events';
3
+ import type { ZodTypeAny } from 'zod';
4
+ import { EntitySubscription } from '../connections';
5
+ export declare function publishSocketEvent(event: BaseSocketEvent<ZodTypeAny, ZodTypeAny, ZodTypeAny | undefined>, recipients: EntitySubscription[]): Promise<void>;
6
+ export declare function publishNotificationSocketEvent(event: SocketNotificationEvent, recipients: EntitySubscription[]): Promise<void>;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.publishSocketEvent = publishSocketEvent;
4
+ exports.publishNotificationSocketEvent = publishNotificationSocketEvent;
5
+ const __1 = require("../../..");
6
+ const event_1 = require("../../event");
7
+ const PushNotificationEvent_1 = require("../PushNotificationEvent");
8
+ const connections_1 = require("../connections");
9
+ function fanOutToInstances(recipientsWithInstances, localKey, payload) {
10
+ if (recipientsWithInstances.length === 0)
11
+ return;
12
+ for (const { recipient, instances } of recipientsWithInstances) {
13
+ const message = { localKey, payload, recipient };
14
+ for (const instanceId of instances) {
15
+ (0, event_1.publish)(`instance.${instanceId}`, message).catch((error) => {
16
+ console.error(`[Socket] Publish failed for instance ${instanceId}`, error);
17
+ });
18
+ }
19
+ }
20
+ }
21
+ async function getActiveSubscribedRecipients(recipients, localKey) {
22
+ if (recipients.length === 0)
23
+ return { subscribed: [], unsubscribed: [] };
24
+ const redis = (0, __1.getLibraries)().getRedisService();
25
+ const subscribed = [];
26
+ const unsubscribed = [];
27
+ await Promise.all(recipients.map(async (recipient) => {
28
+ const sockets = await redis.getSetMembers((0, connections_1.kEntityEventSockets)(recipient, localKey));
29
+ if (sockets.length === 0) {
30
+ unsubscribed.push(recipient);
31
+ return;
32
+ }
33
+ const instances = [...new Set(sockets.map(s => s.split('|')[0]).filter(Boolean))];
34
+ if (instances.length > 0)
35
+ subscribed.push({ recipient, instances });
36
+ else
37
+ unsubscribed.push(recipient);
38
+ }));
39
+ return { subscribed, unsubscribed };
40
+ }
41
+ async function publishSocketEvent(event, recipients) {
42
+ const logger = (0, __1.getLibraries)().getLogger().logger;
43
+ if (recipients.length === 0)
44
+ return;
45
+ const localKey = event.getSubscriptionKey();
46
+ const payload = event.payload();
47
+ const { subscribed, unsubscribed } = await getActiveSubscribedRecipients(recipients, localKey);
48
+ logger.debug({ subscribed }, '[Socket] Subscribed recipients:');
49
+ logger.debug({ unsubscribed }, '[Socket] Unsubscribed recipients:');
50
+ if (subscribed.length > 0)
51
+ fanOutToInstances(subscribed, localKey, payload);
52
+ if (unsubscribed.length > 0) {
53
+ logger.debug({ unsubscribed }, '[Socket] Processing unsubscribed recipients');
54
+ if (event.notificationSettings?.isPushNotification) {
55
+ const pushNotificationPayload = event.getPushNotificationPayload();
56
+ await (0, event_1.publishEvent)(new PushNotificationEvent_1.PushNotificationEvent(event.eventType(), pushNotificationPayload, unsubscribed, event.notificationSettings)).catch(err => console.error('[Socket] Push notification failed:', err));
57
+ }
58
+ const socketNotificationPayload = event.getSocketNotificationEvent();
59
+ logger.debug({ socketNotificationPayload }, '[Socket] Socket notification payload');
60
+ if (socketNotificationPayload) {
61
+ await publishNotificationSocketEvent(socketNotificationPayload, unsubscribed);
62
+ }
63
+ }
64
+ }
65
+ async function publishNotificationSocketEvent(event, recipients) {
66
+ if (recipients.length === 0)
67
+ return;
68
+ const eventKey = event.getSubscriptionKey();
69
+ const redis = (0, __1.getLibraries)().getRedisService();
70
+ const validInstances = [];
71
+ await Promise.all(recipients.map(async (recipient) => {
72
+ const sockets = await redis.getSetMembers((0, connections_1.kEntityEventSockets)(recipient, eventKey));
73
+ if (sockets.length === 0)
74
+ return;
75
+ const instances = [...new Set(sockets.map(s => s.split('|')[0]).filter(Boolean))];
76
+ if (instances.length > 0)
77
+ validInstances.push({ recipient, instances });
78
+ }));
79
+ if (validInstances.length > 0)
80
+ fanOutToInstances(validInstances, eventKey, event.payload());
81
+ }
82
+ //# sourceMappingURL=socket-event-publisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socket-event-publisher.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-publisher.ts"],"names":[],"mappings":"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","sourcesContent":["import { getLibraries } from '../../..';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { SocketNotificationEvent } from '../events';\nimport { publish, publishEvent } from '../../event';\nimport { PushNotificationEvent } from '../PushNotificationEvent';\nimport type { ZodTypeAny } from 'zod';\nimport { EntitySubscription, kEntityEventSockets } from '../connections';\n\nfunction fanOutToInstances(\n\trecipientsWithInstances: Array<{ recipient: EntitySubscription; instances: string[] }>,\n\tlocalKey: string,\n\tpayload: unknown\n): void {\n\tif (recipientsWithInstances.length === 0) return;\n\n\tfor (const { recipient, instances } of recipientsWithInstances) {\n\t\tconst message = { localKey, payload, recipient };\n\t\tfor (const instanceId of instances) {\n\t\t\tpublish(`instance.${instanceId}`, message).catch((error: unknown) => {\n\t\t\t\tconsole.error(`[Socket] Publish failed for instance ${instanceId}`, error);\n\t\t\t});\n\t\t}\n\t}\n}\n\nasync function getActiveSubscribedRecipients(\n\trecipients: EntitySubscription[],\n\tlocalKey: string\n): Promise<{\n\tsubscribed: Array<{ recipient: EntitySubscription; instances: string[] }>;\n\tunsubscribed: EntitySubscription[];\n}> {\n\tif (recipients.length === 0) return { subscribed: [], unsubscribed: [] };\n\n\tconst redis = getLibraries().getRedisService();\n\tconst subscribed: Array<{ recipient: EntitySubscription; instances: string[] }> = [];\n\tconst unsubscribed: EntitySubscription[] = [];\n\n\tawait Promise.all(\n\t\trecipients.map(async recipient => {\n\t\t\tconst sockets = await redis.getSetMembers(kEntityEventSockets(recipient, localKey));\n\t\t\tif (sockets.length === 0) {\n\t\t\t\tunsubscribed.push(recipient);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst instances = [...new Set(sockets.map(s => s.split('|')[0]).filter(Boolean))];\n\t\t\tif (instances.length > 0) subscribed.push({ recipient, instances });\n\t\t\telse unsubscribed.push(recipient);\n\t\t})\n\t);\n\n\treturn { subscribed, unsubscribed };\n}\n\nexport async function publishSocketEvent(\n\tevent: BaseSocketEvent<ZodTypeAny, ZodTypeAny, ZodTypeAny | undefined>,\n\trecipients: EntitySubscription[]\n): Promise<void> {\n\tconst logger = getLibraries().getLogger().logger;\n\tif (recipients.length === 0) return;\n\n\tconst localKey = event.getSubscriptionKey();\n\tconst payload = event.payload();\n\n\tconst { subscribed, unsubscribed } = await getActiveSubscribedRecipients(recipients, localKey);\n\n\tlogger.debug({ subscribed }, '[Socket] Subscribed recipients:');\n\tlogger.debug({ unsubscribed }, '[Socket] Unsubscribed recipients:');\n\n\tif (subscribed.length > 0) fanOutToInstances(subscribed, localKey, payload);\n\n\tif (unsubscribed.length > 0) {\n\t\tlogger.debug({ unsubscribed }, '[Socket] Processing unsubscribed recipients');\n\n\t\tif (event.notificationSettings?.isPushNotification) {\n\t\t\tconst pushNotificationPayload = event.getPushNotificationPayload();\n\t\t\tawait publishEvent(\n\t\t\t\tnew PushNotificationEvent(event.eventType(), pushNotificationPayload, unsubscribed, event.notificationSettings)\n\t\t\t).catch(err => console.error('[Socket] Push notification failed:', err));\n\t\t}\n\n\t\tconst socketNotificationPayload = event.getSocketNotificationEvent();\n\t\tlogger.debug({ socketNotificationPayload }, '[Socket] Socket notification payload');\n\n\t\tif (socketNotificationPayload) {\n\t\t\tawait publishNotificationSocketEvent(socketNotificationPayload, unsubscribed);\n\t\t}\n\t}\n}\n\nexport async function publishNotificationSocketEvent(\n\tevent: SocketNotificationEvent,\n\trecipients: EntitySubscription[]\n): Promise<void> {\n\tif (recipients.length === 0) return;\n\n\tconst eventKey = event.getSubscriptionKey();\n\tconst redis = getLibraries().getRedisService();\n\tconst validInstances: Array<{ recipient: EntitySubscription; instances: string[] }> = [];\n\n\tawait Promise.all(\n\t\trecipients.map(async recipient => {\n\t\t\tconst sockets = await redis.getSetMembers(kEntityEventSockets(recipient, eventKey));\n\t\t\tif (sockets.length === 0) return;\n\t\t\tconst instances = [...new Set(sockets.map(s => s.split('|')[0]).filter(Boolean))];\n\t\t\tif (instances.length > 0) validInstances.push({ recipient, instances });\n\t\t})\n\t);\n\n\tif (validInstances.length > 0) fanOutToInstances(validInstances, eventKey, event.payload());\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import type { z } from 'zod';
2
+ import type { SocketEventType } from '../../../utilities/enum';
3
+ import { REGISTRY } from './socket-event-registry.map';
4
+ type InputFor<T extends SocketEventType> = z.infer<(typeof REGISTRY)[T]['schemas']['input']>;
5
+ type OutputFor<T extends SocketEventType> = z.infer<(typeof REGISTRY)[T]['schemas']['output']>;
6
+ type EventFor<T extends SocketEventType> = InstanceType<(typeof REGISTRY)[T]>;
7
+ export declare class EventFactory {
8
+ static getEventClass<T extends SocketEventType>(eventType: T): (typeof REGISTRY)[T];
9
+ static getSubscriptionKey<T extends SocketEventType>(eventType: T, input: InputFor<T>): string;
10
+ static createEvent<T extends SocketEventType>(eventType: T, data: OutputFor<T>): EventFor<T>;
11
+ }
12
+ export type { EventFor, InputFor, OutputFor };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventFactory = void 0;
4
+ const socket_event_registry_map_1 = require("./socket-event-registry.map");
5
+ class EventFactory {
6
+ static getEventClass(eventType) {
7
+ return socket_event_registry_map_1.REGISTRY[eventType];
8
+ }
9
+ static getSubscriptionKey(eventType, input) {
10
+ const eventClass = this.getEventClass(eventType);
11
+ const schemas = (0, socket_event_registry_map_1.getSchemas)(eventClass);
12
+ const identifier = (0, socket_event_registry_map_1.getIdentifier)(eventClass);
13
+ const validatedInput = schemas.input.parse(input);
14
+ const key = typeof identifier === 'function' ? identifier(validatedInput) : 'default';
15
+ return `${eventType}:${key}`;
16
+ }
17
+ static createEvent(eventType, data) {
18
+ const EventClass = this.getEventClass(eventType);
19
+ return new EventClass(data);
20
+ }
21
+ }
22
+ exports.EventFactory = EventFactory;
23
+ //# sourceMappingURL=socket-event-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socket-event-registry.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-registry.ts"],"names":[],"mappings":";;;AAEA,2EAAkF;AAOlF,MAAa,YAAY;IAExB,MAAM,CAAC,aAAa,CAA4B,SAAY;QAC3D,OAAO,oCAAQ,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAGD,MAAM,CAAC,kBAAkB,CAA4B,SAAY,EAAE,KAAkB;QACpF,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,IAAA,sCAAU,EAAC,UAAU,CAAC,CAAC;QACvC,MAAM,UAAU,GAAG,IAAA,yCAAa,EAAC,UAAU,CAAC,CAAC;QAE7C,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,GAAG,GAAG,OAAO,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEtF,OAAO,GAAG,SAAS,IAAI,GAAG,EAAE,CAAC;IAC9B,CAAC;IAGD,MAAM,CAAC,WAAW,CAA4B,SAAY,EAAE,IAAkB;QAC7E,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QACjD,OAAO,IAAI,UAAU,CAAC,IAAI,CAAgB,CAAC;IAC5C,CAAC;CACD;AAvBD,oCAuBC","sourcesContent":["import type { z } from 'zod';\nimport type { SocketEventType } from '../../../utilities/enum';\nimport { getIdentifier, getSchemas, REGISTRY } from './socket-event-registry.map';\n\n// Infer types directly from the registry\ntype InputFor<T extends SocketEventType> = z.infer<(typeof REGISTRY)[T]['schemas']['input']>;\ntype OutputFor<T extends SocketEventType> = z.infer<(typeof REGISTRY)[T]['schemas']['output']>;\ntype EventFor<T extends SocketEventType> = InstanceType<(typeof REGISTRY)[T]>;\n\nexport class EventFactory {\n\t// Get the event class constructor\n\tstatic getEventClass<T extends SocketEventType>(eventType: T): (typeof REGISTRY)[T] {\n\t\treturn REGISTRY[eventType];\n\t}\n\n\t// Create a subscription key for an event with validated input\n\tstatic getSubscriptionKey<T extends SocketEventType>(eventType: T, input: InputFor<T>): string {\n\t\tconst eventClass = this.getEventClass(eventType);\n\t\tconst schemas = getSchemas(eventClass);\n\t\tconst identifier = getIdentifier(eventClass);\n\n\t\tconst validatedInput = schemas.input.parse(input);\n\t\tconst key = typeof identifier === 'function' ? identifier(validatedInput) : 'default';\n\n\t\treturn `${eventType}:${key}`;\n\t}\n\n\t// Create an event instance from validated output data\n\tstatic createEvent<T extends SocketEventType>(eventType: T, data: OutputFor<T>): EventFor<T> {\n\t\tconst EventClass = this.getEventClass(eventType);\n\t\treturn new EventClass(data) as EventFor<T>;\n\t}\n}\n\nexport type { EventFor, InputFor, OutputFor };\n"]}