@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.
- package/dist/libraries/index.d.ts +6 -0
- package/dist/libraries/index.js +57 -26
- package/dist/libraries/index.js.map +1 -1
- package/dist/libraries/mongo/models/bob-finance.model.js +2 -5
- package/dist/libraries/mongo/models/bob-finance.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/referral-reward-coupon.model.d.ts +2 -0
- package/dist/libraries/mongo/models/providers/referral-reward-coupon.model.js +6 -0
- package/dist/libraries/mongo/models/providers/referral-reward-coupon.model.js.map +1 -1
- package/dist/libraries/upload/index.js +3 -3
- package/dist/libraries/upload/index.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/index.js.map +1 -0
- package/dist/types/libraries/auth/index.d.ts +77 -0
- package/dist/types/libraries/auth/index.js +270 -0
- package/dist/types/libraries/auth/index.js.map +1 -0
- package/dist/types/libraries/auth/refreshtoken.d.ts +15 -0
- package/dist/types/libraries/auth/refreshtoken.js +91 -0
- package/dist/types/libraries/auth/refreshtoken.js.map +1 -0
- package/dist/types/libraries/auth/repository.d.ts +18 -0
- package/dist/types/libraries/auth/repository.js +43 -0
- package/dist/types/libraries/auth/repository.js.map +1 -0
- package/dist/types/libraries/bullmq/bull-mq-service.d.ts +9 -0
- package/dist/types/libraries/bullmq/bull-mq-service.js +42 -0
- package/dist/types/libraries/bullmq/bull-mq-service.js.map +1 -0
- package/dist/types/libraries/cache/settings/index.d.ts +7 -0
- package/dist/types/libraries/cache/settings/index.js +56 -0
- package/dist/types/libraries/cache/settings/index.js.map +1 -0
- package/dist/types/libraries/cash-settlement/cashSettlementService.d.ts +16 -0
- package/dist/types/libraries/cash-settlement/cashSettlementService.js +53 -0
- package/dist/types/libraries/cash-settlement/cashSettlementService.js.map +1 -0
- package/dist/types/libraries/cash-settlement/index.d.ts +2 -0
- package/dist/types/libraries/cash-settlement/index.js +19 -0
- package/dist/types/libraries/cash-settlement/index.js.map +1 -0
- package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.d.ts +24 -0
- package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.js +10 -0
- package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.js.map +1 -0
- package/dist/types/libraries/cash-settlement/providers/bob.d.ts +45 -0
- package/dist/types/libraries/cash-settlement/providers/bob.js +634 -0
- package/dist/types/libraries/cash-settlement/providers/bob.js.map +1 -0
- package/dist/types/libraries/cash-settlement/providers/index.d.ts +1 -0
- package/dist/types/libraries/cash-settlement/providers/index.js +18 -0
- package/dist/types/libraries/cash-settlement/providers/index.js.map +1 -0
- package/dist/types/libraries/cloud-storage/CloudStorageFactory.d.ts +7 -0
- package/dist/types/libraries/cloud-storage/CloudStorageFactory.js +18 -0
- package/dist/types/libraries/cloud-storage/CloudStorageFactory.js.map +1 -0
- package/dist/types/libraries/cloud-storage/index.d.ts +4 -0
- package/dist/types/libraries/cloud-storage/index.js +21 -0
- package/dist/types/libraries/cloud-storage/index.js.map +1 -0
- package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.d.ts +8 -0
- package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.js +3 -0
- package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.js.map +1 -0
- package/dist/types/libraries/cloud-storage/providers/GcsStorageService.d.ts +11 -0
- package/dist/types/libraries/cloud-storage/providers/GcsStorageService.js +63 -0
- package/dist/types/libraries/cloud-storage/providers/GcsStorageService.js.map +1 -0
- package/dist/types/libraries/cloud-storage/types/FileUploadResult.d.ts +11 -0
- package/dist/types/libraries/cloud-storage/types/FileUploadResult.js +3 -0
- package/dist/types/libraries/cloud-storage/types/FileUploadResult.js.map +1 -0
- package/dist/types/libraries/configuration/index.d.ts +39 -0
- package/dist/types/libraries/configuration/index.js +84 -0
- package/dist/types/libraries/configuration/index.js.map +1 -0
- package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.d.ts +9 -0
- package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.js +14 -0
- package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.js.map +1 -0
- package/dist/types/libraries/dispatcher/index.d.ts +10 -0
- package/dist/types/libraries/dispatcher/index.js +43 -0
- package/dist/types/libraries/dispatcher/index.js.map +1 -0
- package/dist/types/libraries/event/BaseEvent.d.ts +7 -0
- package/dist/types/libraries/event/BaseEvent.js +19 -0
- package/dist/types/libraries/event/BaseEvent.js.map +1 -0
- package/dist/types/libraries/event/EventEnums.d.ts +26 -0
- package/dist/types/libraries/event/EventEnums.js +31 -0
- package/dist/types/libraries/event/EventEnums.js.map +1 -0
- package/dist/types/libraries/event/decorators/metadata.d.ts +13 -0
- package/dist/types/libraries/event/decorators/metadata.js +20 -0
- package/dist/types/libraries/event/decorators/metadata.js.map +1 -0
- package/dist/types/libraries/event/events/index.d.ts +2 -0
- package/dist/types/libraries/event/events/index.js +19 -0
- package/dist/types/libraries/event/events/index.js.map +1 -0
- package/dist/types/libraries/event/events/payout/index.d.ts +1 -0
- package/dist/types/libraries/event/events/payout/index.js +18 -0
- package/dist/types/libraries/event/events/payout/index.js.map +1 -0
- package/dist/types/libraries/event/events/payout/payout-schedule.event.d.ts +9 -0
- package/dist/types/libraries/event/events/payout/payout-schedule.event.js +12 -0
- package/dist/types/libraries/event/events/payout/payout-schedule.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/cash/index.d.ts +5 -0
- package/dist/types/libraries/event/events/rider/cash/index.js +14 -0
- package/dist/types/libraries/event/events/rider/cash/index.js.map +1 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.d.ts +11 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.js +19 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-event.d.ts +11 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-event.js +18 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.d.ts +10 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.js +17 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.d.ts +11 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.js +19 -0
- package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.d.ts +10 -0
- package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.js +17 -0
- package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/index.d.ts +2 -0
- package/dist/types/libraries/event/events/rider/index.js +19 -0
- package/dist/types/libraries/event/events/rider/index.js.map +1 -0
- package/dist/types/libraries/event/events/rider/scoring/index.d.ts +7 -0
- package/dist/types/libraries/event/events/rider/scoring/index.js +18 -0
- package/dist/types/libraries/event/events/rider/scoring/index.js.map +1 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.d.ts +11 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.js +20 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.d.ts +13 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js +24 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.d.ts +11 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.js +20 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.d.ts +13 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.js +24 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.d.ts +19 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.js +36 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.d.ts +13 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.js +18 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.js.map +1 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-score-event.d.ts +14 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-score-event.js +21 -0
- package/dist/types/libraries/event/events/rider/scoring/rider-score-event.js.map +1 -0
- package/dist/types/libraries/event/index.d.ts +11 -0
- package/dist/types/libraries/event/index.js +152 -0
- package/dist/types/libraries/event/index.js.map +1 -0
- package/dist/types/libraries/event/registry/SubscriptionRegistry.d.ts +11 -0
- package/dist/types/libraries/event/registry/SubscriptionRegistry.js +14 -0
- package/dist/types/libraries/event/registry/SubscriptionRegistry.js.map +1 -0
- package/dist/types/libraries/firebase/index.d.ts +16 -0
- package/dist/types/libraries/firebase/index.js +107 -0
- package/dist/types/libraries/firebase/index.js.map +1 -0
- package/dist/types/libraries/google-translate/google-translate.client.d.ts +5 -0
- package/dist/types/libraries/google-translate/google-translate.client.js +44 -0
- package/dist/types/libraries/google-translate/google-translate.client.js.map +1 -0
- package/dist/types/libraries/google-translate/google-translate.dto.d.ts +13 -0
- package/dist/types/libraries/google-translate/google-translate.dto.js +3 -0
- package/dist/types/libraries/google-translate/google-translate.dto.js.map +1 -0
- package/dist/types/libraries/google-translate/google-translate.service.d.ts +9 -0
- package/dist/types/libraries/google-translate/google-translate.service.js +102 -0
- package/dist/types/libraries/google-translate/google-translate.service.js.map +1 -0
- package/dist/types/libraries/google-translate/index.d.ts +1 -0
- package/dist/types/libraries/google-translate/index.js +18 -0
- package/dist/types/libraries/google-translate/index.js.map +1 -0
- package/dist/types/libraries/index.d.ts +43 -0
- package/dist/types/libraries/index.js +102 -0
- package/dist/types/libraries/index.js.map +1 -0
- package/dist/types/libraries/llm/interfaces/common-llm-interfaces.d.ts +28 -0
- package/dist/types/libraries/llm/interfaces/common-llm-interfaces.js +3 -0
- package/dist/types/libraries/llm/interfaces/common-llm-interfaces.js.map +1 -0
- package/dist/types/libraries/llm/llm-provider-service.d.ts +13 -0
- package/dist/types/libraries/llm/llm-provider-service.js +47 -0
- package/dist/types/libraries/llm/llm-provider-service.js.map +1 -0
- package/dist/types/libraries/llm/providers/openai-provider.d.ts +19 -0
- package/dist/types/libraries/llm/providers/openai-provider.js +223 -0
- package/dist/types/libraries/llm/providers/openai-provider.js.map +1 -0
- package/dist/types/libraries/logger/index.d.ts +8 -0
- package/dist/types/libraries/logger/index.js +75 -0
- package/dist/types/libraries/logger/index.js.map +1 -0
- package/dist/types/libraries/logger-kit/index.d.ts +3 -0
- package/dist/types/libraries/logger-kit/index.js +22 -0
- package/dist/types/libraries/logger-kit/index.js.map +1 -0
- package/dist/types/libraries/logger-kit/logger.service.d.ts +117 -0
- package/dist/types/libraries/logger-kit/logger.service.js +304 -0
- package/dist/types/libraries/logger-kit/logger.service.js.map +1 -0
- package/dist/types/libraries/logger-kit/types.d.ts +34 -0
- package/dist/types/libraries/logger-kit/types.js +3 -0
- package/dist/types/libraries/logger-kit/types.js.map +1 -0
- package/dist/types/libraries/map/index.d.ts +2 -0
- package/dist/types/libraries/map/index.js +19 -0
- package/dist/types/libraries/map/index.js.map +1 -0
- package/dist/types/libraries/map/interfaces/IMapService.d.ts +43 -0
- package/dist/types/libraries/map/interfaces/IMapService.js +9 -0
- package/dist/types/libraries/map/interfaces/IMapService.js.map +1 -0
- package/dist/types/libraries/map/mapService.d.ts +21 -0
- package/dist/types/libraries/map/mapService.js +57 -0
- package/dist/types/libraries/map/mapService.js.map +1 -0
- package/dist/types/libraries/map/providers/google-maps.d.ts +27 -0
- package/dist/types/libraries/map/providers/google-maps.js +462 -0
- package/dist/types/libraries/map/providers/google-maps.js.map +1 -0
- package/dist/types/libraries/map/providers/index.d.ts +1 -0
- package/dist/types/libraries/map/providers/index.js +18 -0
- package/dist/types/libraries/map/providers/index.js.map +1 -0
- package/dist/types/libraries/map/providers/osrm.d.ts +13 -0
- package/dist/types/libraries/map/providers/osrm.js +137 -0
- package/dist/types/libraries/map/providers/osrm.js.map +1 -0
- package/dist/types/libraries/mongo/index.d.ts +7 -0
- package/dist/types/libraries/mongo/index.js +87 -0
- package/dist/types/libraries/mongo/index.js.map +1 -0
- package/dist/types/libraries/mongo/models/activity-log.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/activity-log.model.js +48 -0
- package/dist/types/libraries/mongo/models/activity-log.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/admin-access-control.model.d.ts +11 -0
- package/dist/types/libraries/mongo/models/admin-access-control.model.js +75 -0
- package/dist/types/libraries/mongo/models/admin-access-control.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/admin.model.d.ts +11 -0
- package/dist/types/libraries/mongo/models/admin.model.js +65 -0
- package/dist/types/libraries/mongo/models/admin.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/agent-performance.model.d.ts +15 -0
- package/dist/types/libraries/mongo/models/agent-performance.model.js +73 -0
- package/dist/types/libraries/mongo/models/agent-performance.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/app-appearance.model.d.ts +25 -0
- package/dist/types/libraries/mongo/models/app-appearance.model.js +102 -0
- package/dist/types/libraries/mongo/models/app-appearance.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/app-instance.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/app-instance.model.js +54 -0
- package/dist/types/libraries/mongo/models/app-instance.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/attribute.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/attribute.model.js +58 -0
- package/dist/types/libraries/mongo/models/attribute.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/banner.model.d.ts +27 -0
- package/dist/types/libraries/mongo/models/banner.model.js +118 -0
- package/dist/types/libraries/mongo/models/banner.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/base/base-coupon.model.d.ts +19 -0
- package/dist/types/libraries/mongo/models/base/base-coupon.model.js +90 -0
- package/dist/types/libraries/mongo/models/base/base-coupon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/bob-finance.model.d.ts +19 -0
- package/dist/types/libraries/mongo/models/bob-finance.model.js +88 -0
- package/dist/types/libraries/mongo/models/bob-finance.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.js +48 -0
- package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/brand.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/brand.model.js +32 -0
- package/dist/types/libraries/mongo/models/brand.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/cancellation-reason.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/cancellation-reason.model.js +55 -0
- package/dist/types/libraries/mongo/models/cancellation-reason.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/card.model.d.ts +19 -0
- package/dist/types/libraries/mongo/models/card.model.js +88 -0
- package/dist/types/libraries/mongo/models/card.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/cart-participant.model.d.ts +29 -0
- package/dist/types/libraries/mongo/models/cart-participant.model.js +130 -0
- package/dist/types/libraries/mongo/models/cart-participant.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/cart.model.d.ts +39 -0
- package/dist/types/libraries/mongo/models/cart.model.js +184 -0
- package/dist/types/libraries/mongo/models/cart.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/category.model.d.ts +12 -0
- package/dist/types/libraries/mongo/models/category.model.js +68 -0
- package/dist/types/libraries/mongo/models/category.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/chat-room.model.d.ts +28 -0
- package/dist/types/libraries/mongo/models/chat-room.model.js +99 -0
- package/dist/types/libraries/mongo/models/chat-room.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/copy-attribute-map.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/copy-attribute-map.model.js +38 -0
- package/dist/types/libraries/mongo/models/copy-attribute-map.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/copy-product-job.model.d.ts +21 -0
- package/dist/types/libraries/mongo/models/copy-product-job.model.js +101 -0
- package/dist/types/libraries/mongo/models/copy-product-job.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/copy-product-map.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/copy-product-map.model.js +38 -0
- package/dist/types/libraries/mongo/models/copy-product-map.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/copy-shop-category-map.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/copy-shop-category-map.model.js +38 -0
- package/dist/types/libraries/mongo/models/copy-shop-category-map.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/core-auth-identity.model.d.ts +7 -0
- package/dist/types/libraries/mongo/models/core-auth-identity.model.js +32 -0
- package/dist/types/libraries/mongo/models/core-auth-identity.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/core-user.model.d.ts +16 -0
- package/dist/types/libraries/mongo/models/core-user.model.js +85 -0
- package/dist/types/libraries/mongo/models/core-user.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/counter.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/counter.model.js +42 -0
- package/dist/types/libraries/mongo/models/counter.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/coupon.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/coupon.model.js +60 -0
- package/dist/types/libraries/mongo/models/coupon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/deal-setting.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/deal-setting.model.js +52 -0
- package/dist/types/libraries/mongo/models/deal-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/default-chat.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/default-chat.model.js +26 -0
- package/dist/types/libraries/mongo/models/default-chat.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/delivery-charges.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/delivery-charges.model.js +63 -0
- package/dist/types/libraries/mongo/models/delivery-charges.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/dish.model.d.ts +18 -0
- package/dist/types/libraries/mongo/models/dish.model.js +92 -0
- package/dist/types/libraries/mongo/models/dish.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/address-change-history.model.d.ts +25 -0
- package/dist/types/libraries/mongo/models/embedded/address-change-history.model.js +112 -0
- package/dist/types/libraries/mongo/models/embedded/address-change-history.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.d.ts +33 -0
- package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.js +133 -0
- package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/app-force-update.d.ts +9 -0
- package/dist/types/libraries/mongo/models/embedded/app-force-update.js +52 -0
- package/dist/types/libraries/mongo/models/embedded/app-force-update.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/attribute-item.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/attribute-item.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/attribute-item.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/attribute-map.model.d.ts +7 -0
- package/dist/types/libraries/mongo/models/embedded/attribute-map.model.js +29 -0
- package/dist/types/libraries/mongo/models/embedded/attribute-map.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.js +52 -0
- package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/charge.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/charge.model.js +28 -0
- package/dist/types/libraries/mongo/models/embedded/charge.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/chat-participant.model.d.ts +18 -0
- package/dist/types/libraries/mongo/models/embedded/chat-participant.model.js +64 -0
- package/dist/types/libraries/mongo/models/embedded/chat-participant.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/company-info.model.d.ts +6 -0
- package/dist/types/libraries/mongo/models/embedded/company-info.model.js +37 -0
- package/dist/types/libraries/mongo/models/embedded/company-info.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.js +36 -0
- package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/courier-setting.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/courier-setting.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/courier-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/currency-setting.model.d.ts +7 -0
- package/dist/types/libraries/mongo/models/embedded/currency-setting.model.js +38 -0
- package/dist/types/libraries/mongo/models/embedded/currency-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/currency.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/currency.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/currency.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.js +51 -0
- package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/delivery-info.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/delivery-info.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/delivery-info.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/external-ref.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/external-ref.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/external-ref.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/featured-item.mode.d.ts +6 -0
- package/dist/types/libraries/mongo/models/embedded/featured-item.mode.js +33 -0
- package/dist/types/libraries/mongo/models/embedded/featured-item.mode.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.d.ts +7 -0
- package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.js +38 -0
- package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.d.ts +17 -0
- package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.js +63 -0
- package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.d.ts +46 -0
- package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.js +178 -0
- package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/order-cancel.model.d.ts +26 -0
- package/dist/types/libraries/mongo/models/embedded/order-cancel.model.js +110 -0
- package/dist/types/libraries/mongo/models/embedded/order-cancel.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.d.ts +12 -0
- package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.js +67 -0
- package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/order-finance.model.d.ts +18 -0
- package/dist/types/libraries/mongo/models/embedded/order-finance.model.js +64 -0
- package/dist/types/libraries/mongo/models/embedded/order-finance.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/order-pricing.model.d.ts +34 -0
- package/dist/types/libraries/mongo/models/embedded/order-pricing.model.js +163 -0
- package/dist/types/libraries/mongo/models/embedded/order-pricing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/order-refund.model.d.ts +28 -0
- package/dist/types/libraries/mongo/models/embedded/order-refund.model.js +113 -0
- package/dist/types/libraries/mongo/models/embedded/order-refund.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/otp-fields.model.d.ts +7 -0
- package/dist/types/libraries/mongo/models/embedded/otp-fields.model.js +46 -0
- package/dist/types/libraries/mongo/models/embedded/otp-fields.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/package.model.d.ts +25 -0
- package/dist/types/libraries/mongo/models/embedded/package.model.js +86 -0
- package/dist/types/libraries/mongo/models/embedded/package.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/parent-document.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/parent-document.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/parent-document.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.d.ts +7 -0
- package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.js +38 -0
- package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/payment-record.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/embedded/payment-record.model.js +53 -0
- package/dist/types/libraries/mongo/models/embedded/payment-record.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/payout-setting.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/payout-setting.model.js +28 -0
- package/dist/types/libraries/mongo/models/embedded/payout-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/plus-settings.model.d.ts +6 -0
- package/dist/types/libraries/mongo/models/embedded/plus-settings.model.js +33 -0
- package/dist/types/libraries/mongo/models/embedded/plus-settings.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/preparing-time.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/preparing-time.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/preparing-time.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.d.ts +16 -0
- package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.js +80 -0
- package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/product-category.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/product-category.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/product-category.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.d.ts +17 -0
- package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.js +72 -0
- package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.d.ts +12 -0
- package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.js +60 -0
- package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/product-snap.model.d.ts +16 -0
- package/dist/types/libraries/mongo/models/embedded/product-snap.model.js +79 -0
- package/dist/types/libraries/mongo/models/embedded/product-snap.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/profit.model.d.ts +22 -0
- package/dist/types/libraries/mongo/models/embedded/profit.model.js +96 -0
- package/dist/types/libraries/mongo/models/embedded/profit.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.d.ts +6 -0
- package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.js +38 -0
- package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.d.ts +18 -0
- package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.js +73 -0
- package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/replacement-order.model.d.ts +28 -0
- package/dist/types/libraries/mongo/models/embedded/replacement-order.model.js +109 -0
- package/dist/types/libraries/mongo/models/embedded/replacement-order.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/rest-password.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/rest-password.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/rest-password.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.js +44 -0
- package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/rider-batches.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/rider-batches.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/rider-batches.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/rider-setting.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/embedded/rider-setting.model.js +47 -0
- package/dist/types/libraries/mongo/models/embedded/rider-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/rider-statistics.d.ts +11 -0
- package/dist/types/libraries/mongo/models/embedded/rider-statistics.js +62 -0
- package/dist/types/libraries/mongo/models/embedded/rider-statistics.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.d.ts +18 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.js +77 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.d.ts +23 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.js +85 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.d.ts +24 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.js +127 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.d.ts +16 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.js +70 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.d.ts +19 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.js +76 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.js +57 -0
- package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.js +28 -0
- package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/service-line-item.model.d.ts +38 -0
- package/dist/types/libraries/mongo/models/embedded/service-line-item.model.js +154 -0
- package/dist/types/libraries/mongo/models/embedded/service-line-item.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.d.ts +12 -0
- package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.js +47 -0
- package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/shop-document.model.d.ts +6 -0
- package/dist/types/libraries/mongo/models/embedded/shop-document.model.js +37 -0
- package/dist/types/libraries/mongo/models/embedded/shop-document.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.d.ts +15 -0
- package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.js +75 -0
- package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.js +43 -0
- package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/status-timeline.model.d.ts +25 -0
- package/dist/types/libraries/mongo/models/embedded/status-timeline.model.js +97 -0
- package/dist/types/libraries/mongo/models/embedded/status-timeline.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.js +47 -0
- package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.js +27 -0
- package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.d.ts +28 -0
- package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.js +134 -0
- package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/vat.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/vat.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/vat.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/wallet.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/wallet.model.js +32 -0
- package/dist/types/libraries/mongo/models/embedded/wallet.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.d.ts +5 -0
- package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.js +28 -0
- package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.js.map +1 -0
- package/dist/types/libraries/mongo/models/favourite.model.d.ts +14 -0
- package/dist/types/libraries/mongo/models/favourite.model.js +52 -0
- package/dist/types/libraries/mongo/models/favourite.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/featured-setting.model.d.ts +7 -0
- package/dist/types/libraries/mongo/models/featured-setting.model.js +33 -0
- package/dist/types/libraries/mongo/models/featured-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/filter-container.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/filter-container.model.js +63 -0
- package/dist/types/libraries/mongo/models/filter-container.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/finance-settlement.model.d.ts +41 -0
- package/dist/types/libraries/mongo/models/finance-settlement.model.js +175 -0
- package/dist/types/libraries/mongo/models/finance-settlement.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/flag.model.d.ts +22 -0
- package/dist/types/libraries/mongo/models/flag.model.js +83 -0
- package/dist/types/libraries/mongo/models/flag.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/gallery-upload.model.d.ts +17 -0
- package/dist/types/libraries/mongo/models/gallery-upload.model.js +77 -0
- package/dist/types/libraries/mongo/models/gallery-upload.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/gallery.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/gallery.model.js +59 -0
- package/dist/types/libraries/mongo/models/gallery.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/google-maps-usage.model.d.ts +21 -0
- package/dist/types/libraries/mongo/models/google-maps-usage.model.js +255 -0
- package/dist/types/libraries/mongo/models/google-maps-usage.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/index.d.ts +395 -0
- package/dist/types/libraries/mongo/models/index.js +485 -0
- package/dist/types/libraries/mongo/models/index.js.map +1 -0
- package/dist/types/libraries/mongo/models/integration-configuration.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/integration-configuration.model.js +33 -0
- package/dist/types/libraries/mongo/models/integration-configuration.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.js +45 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.d.ts +14 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.js +76 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-config.d.ts +6 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-config.js +36 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-config.js.map +1 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.d.ts +22 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.js +96 -0
- package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/line-item.model.d.ts +47 -0
- package/dist/types/libraries/mongo/models/line-item.model.js +205 -0
- package/dist/types/libraries/mongo/models/line-item.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/list-container.model.d.ts +19 -0
- package/dist/types/libraries/mongo/models/list-container.model.js +92 -0
- package/dist/types/libraries/mongo/models/list-container.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/log.model.d.ts +35 -0
- package/dist/types/libraries/mongo/models/log.model.js +163 -0
- package/dist/types/libraries/mongo/models/log.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/marketing.model.d.ts +18 -0
- package/dist/types/libraries/mongo/models/marketing.model.js +88 -0
- package/dist/types/libraries/mongo/models/marketing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/meal-plan.model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/meal-plan.model.js +51 -0
- package/dist/types/libraries/mongo/models/meal-plan.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/message.model.d.ts +25 -0
- package/dist/types/libraries/mongo/models/message.model.js +105 -0
- package/dist/types/libraries/mongo/models/message.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/notification.model.d.ts +53 -0
- package/dist/types/libraries/mongo/models/notification.model.js +201 -0
- package/dist/types/libraries/mongo/models/notification.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/nutrition.model.d.ts +6 -0
- package/dist/types/libraries/mongo/models/nutrition.model.js +33 -0
- package/dist/types/libraries/mongo/models/nutrition.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/order.model.d.ts +66 -0
- package/dist/types/libraries/mongo/models/order.model.js +350 -0
- package/dist/types/libraries/mongo/models/order.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/parent.model.d.ts +29 -0
- package/dist/types/libraries/mongo/models/parent.model.js +144 -0
- package/dist/types/libraries/mongo/models/parent.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/payment-configuration.model.d.ts +6 -0
- package/dist/types/libraries/mongo/models/payment-configuration.model.js +33 -0
- package/dist/types/libraries/mongo/models/payment-configuration.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/payment-intent.model.d.ts +17 -0
- package/dist/types/libraries/mongo/models/payment-intent.model.js +79 -0
- package/dist/types/libraries/mongo/models/payment-intent.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/payout.model.d.ts +15 -0
- package/dist/types/libraries/mongo/models/payout.model.js +86 -0
- package/dist/types/libraries/mongo/models/payout.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/product-brand.model.d.ts +7 -0
- package/dist/types/libraries/mongo/models/product-brand.model.js +38 -0
- package/dist/types/libraries/mongo/models/product-brand.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/product-marketing.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/product-marketing.model.js +57 -0
- package/dist/types/libraries/mongo/models/product-marketing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/product-stock-tracker.model.d.ts +15 -0
- package/dist/types/libraries/mongo/models/product-stock-tracker.model.js +57 -0
- package/dist/types/libraries/mongo/models/product-stock-tracker.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/product-upload.model.d.ts +25 -0
- package/dist/types/libraries/mongo/models/product-upload.model.js +105 -0
- package/dist/types/libraries/mongo/models/product-upload.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/product.model.d.ts +63 -0
- package/dist/types/libraries/mongo/models/product.model.js +339 -0
- package/dist/types/libraries/mongo/models/product.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/professional-blocked-time.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/professional-blocked-time.model.js +49 -0
- package/dist/types/libraries/mongo/models/professional-blocked-time.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/professional.model.d.ts +17 -0
- package/dist/types/libraries/mongo/models/professional.model.js +91 -0
- package/dist/types/libraries/mongo/models/professional.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.d.ts +16 -0
- package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.js +62 -0
- package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.js +28 -0
- package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.js +69 -0
- package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.js +28 -0
- package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.d.ts +6 -0
- package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.js +29 -0
- package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/courier-order.model.d.ts +41 -0
- package/dist/types/libraries/mongo/models/providers/courier-order.model.js +151 -0
- package/dist/types/libraries/mongo/models/providers/courier-order.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/custom-coupon.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/providers/custom-coupon.model.js +43 -0
- package/dist/types/libraries/mongo/models/providers/custom-coupon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/discount-marketing.model.d.ts +22 -0
- package/dist/types/libraries/mongo/models/providers/discount-marketing.model.js +92 -0
- package/dist/types/libraries/mongo/models/providers/discount-marketing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/featured-marketing.model.d.ts +6 -0
- package/dist/types/libraries/mongo/models/providers/featured-marketing.model.js +25 -0
- package/dist/types/libraries/mongo/models/providers/featured-marketing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.d.ts +7 -0
- package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.js +30 -0
- package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/global-coupon.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/providers/global-coupon.model.js +10 -0
- package/dist/types/libraries/mongo/models/providers/global-coupon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.d.ts +12 -0
- package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.js +42 -0
- package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.js +43 -0
- package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/punch-marketing.model.d.ts +11 -0
- package/dist/types/libraries/mongo/models/providers/punch-marketing.model.js +50 -0
- package/dist/types/libraries/mongo/models/providers/punch-marketing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.js +27 -0
- package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.d.ts +11 -0
- package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.js +37 -0
- package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/regular-order.model.d.ts +54 -0
- package/dist/types/libraries/mongo/models/providers/regular-order.model.js +204 -0
- package/dist/types/libraries/mongo/models/providers/regular-order.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/rider-payout.model.d.ts +23 -0
- package/dist/types/libraries/mongo/models/providers/rider-payout.model.js +94 -0
- package/dist/types/libraries/mongo/models/providers/rider-payout.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/rider-review.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/providers/rider-review.model.js +32 -0
- package/dist/types/libraries/mongo/models/providers/rider-review.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/service-package-review.model.d.ts +14 -0
- package/dist/types/libraries/mongo/models/providers/service-package-review.model.js +44 -0
- package/dist/types/libraries/mongo/models/providers/service-package-review.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/shop-courier.model.d.ts +26 -0
- package/dist/types/libraries/mongo/models/providers/shop-courier.model.js +93 -0
- package/dist/types/libraries/mongo/models/providers/shop-courier.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/shop-payout.model.d.ts +62 -0
- package/dist/types/libraries/mongo/models/providers/shop-payout.model.js +244 -0
- package/dist/types/libraries/mongo/models/providers/shop-payout.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/shop-review.model.d.ts +12 -0
- package/dist/types/libraries/mongo/models/providers/shop-review.model.js +38 -0
- package/dist/types/libraries/mongo/models/providers/shop-review.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.js +47 -0
- package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.d.ts +11 -0
- package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.js +46 -0
- package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/vendor-payout.model.d.ts +50 -0
- package/dist/types/libraries/mongo/models/providers/vendor-payout.model.js +192 -0
- package/dist/types/libraries/mongo/models/providers/vendor-payout.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/providers/vendor-review.model.d.ts +12 -0
- package/dist/types/libraries/mongo/models/providers/vendor-review.model.js +38 -0
- package/dist/types/libraries/mongo/models/providers/vendor-review.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/punch-marketing-history.model.d.ts +24 -0
- package/dist/types/libraries/mongo/models/punch-marketing-history.model.js +101 -0
- package/dist/types/libraries/mongo/models/punch-marketing-history.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/rating-setting.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/rating-setting.model.js +46 -0
- package/dist/types/libraries/mongo/models/rating-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/referral-setting.model.d.ts +6 -0
- package/dist/types/libraries/mongo/models/referral-setting.model.js +32 -0
- package/dist/types/libraries/mongo/models/referral-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/request-area.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/request-area.model.js +33 -0
- package/dist/types/libraries/mongo/models/request-area.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/review.model.d.ts +15 -0
- package/dist/types/libraries/mongo/models/review.model.js +68 -0
- package/dist/types/libraries/mongo/models/review.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/reward.model.d.ts +16 -0
- package/dist/types/libraries/mongo/models/reward.model.js +70 -0
- package/dist/types/libraries/mongo/models/reward.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/rider-timeout.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/rider-timeout.model.js +47 -0
- package/dist/types/libraries/mongo/models/rider-timeout.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/rider-tracking.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/rider-tracking.model.js +47 -0
- package/dist/types/libraries/mongo/models/rider-tracking.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/rider.model.d.ts +70 -0
- package/dist/types/libraries/mongo/models/rider.model.js +358 -0
- package/dist/types/libraries/mongo/models/rider.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/service-addon.model.d.ts +16 -0
- package/dist/types/libraries/mongo/models/service-addon.model.js +86 -0
- package/dist/types/libraries/mongo/models/service-addon.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/service-booking.model.d.ts +68 -0
- package/dist/types/libraries/mongo/models/service-booking.model.js +310 -0
- package/dist/types/libraries/mongo/models/service-booking.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/service-cart.model.d.ts +14 -0
- package/dist/types/libraries/mongo/models/service-cart.model.js +51 -0
- package/dist/types/libraries/mongo/models/service-cart.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/service-category.model.d.ts +14 -0
- package/dist/types/libraries/mongo/models/service-category.model.js +87 -0
- package/dist/types/libraries/mongo/models/service-category.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/service-control.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/service-control.model.js +50 -0
- package/dist/types/libraries/mongo/models/service-control.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/service-flag.model.d.ts +19 -0
- package/dist/types/libraries/mongo/models/service-flag.model.js +72 -0
- package/dist/types/libraries/mongo/models/service-flag.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/service-package.model.d.ts +27 -0
- package/dist/types/libraries/mongo/models/service-package.model.js +142 -0
- package/dist/types/libraries/mongo/models/service-package.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/service-promotion.model.d.ts +27 -0
- package/dist/types/libraries/mongo/models/service-promotion.model.js +120 -0
- package/dist/types/libraries/mongo/models/service-promotion.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/service.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/service.model.js +43 -0
- package/dist/types/libraries/mongo/models/service.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/setting.model.d.ts +51 -0
- package/dist/types/libraries/mongo/models/setting.model.js +201 -0
- package/dist/types/libraries/mongo/models/setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/shared/address.model.d.ts +38 -0
- package/dist/types/libraries/mongo/models/shared/address.model.js +158 -0
- package/dist/types/libraries/mongo/models/shared/address.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/shared/duration.model.d.ts +14 -0
- package/dist/types/libraries/mongo/models/shared/duration.model.js +59 -0
- package/dist/types/libraries/mongo/models/shared/duration.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/shared/geo-location.model.d.ts +5 -0
- package/dist/types/libraries/mongo/models/shared/geo-location.model.js +28 -0
- package/dist/types/libraries/mongo/models/shared/geo-location.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/shared/work-hour.model.d.ts +19 -0
- package/dist/types/libraries/mongo/models/shared/work-hour.model.js +81 -0
- package/dist/types/libraries/mongo/models/shared/work-hour.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/shop-access-control.model.d.ts +16 -0
- package/dist/types/libraries/mongo/models/shop-access-control.model.js +81 -0
- package/dist/types/libraries/mongo/models/shop-access-control.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/shop-category.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/shop-category.model.js +64 -0
- package/dist/types/libraries/mongo/models/shop-category.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/shop-meal-plan.model.d.ts +12 -0
- package/dist/types/libraries/mongo/models/shop-meal-plan.model.js +45 -0
- package/dist/types/libraries/mongo/models/shop-meal-plan.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/shop-section.model.d.ts +18 -0
- package/dist/types/libraries/mongo/models/shop-section.model.js +89 -0
- package/dist/types/libraries/mongo/models/shop-section.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/shop.model.d.ts +65 -0
- package/dist/types/libraries/mongo/models/shop.model.js +304 -0
- package/dist/types/libraries/mongo/models/shop.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/spend-to-get-history.model.d.ts +13 -0
- package/dist/types/libraries/mongo/models/spend-to-get-history.model.js +51 -0
- package/dist/types/libraries/mongo/models/spend-to-get-history.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/subscription.model.d.ts +20 -0
- package/dist/types/libraries/mongo/models/subscription.model.js +93 -0
- package/dist/types/libraries/mongo/models/subscription.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/support-reason.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/support-reason.model.js +61 -0
- package/dist/types/libraries/mongo/models/support-reason.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/tag.model.d.ts +10 -0
- package/dist/types/libraries/mongo/models/tag.model.js +64 -0
- package/dist/types/libraries/mongo/models/tag.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/terms-and-conditions.model.d.ts +8 -0
- package/dist/types/libraries/mongo/models/terms-and-conditions.model.js +51 -0
- package/dist/types/libraries/mongo/models/terms-and-conditions.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/ticket-action.model.d.ts +4 -0
- package/dist/types/libraries/mongo/models/ticket-action.model.js +31 -0
- package/dist/types/libraries/mongo/models/ticket-action.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/ticket.model.d.ts +35 -0
- package/dist/types/libraries/mongo/models/ticket.model.js +144 -0
- package/dist/types/libraries/mongo/models/ticket.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/tournament-participant.model.d.ts +22 -0
- package/dist/types/libraries/mongo/models/tournament-participant.model.js +84 -0
- package/dist/types/libraries/mongo/models/tournament-participant.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/tournament.model.d.ts +65 -0
- package/dist/types/libraries/mongo/models/tournament.model.js +273 -0
- package/dist/types/libraries/mongo/models/tournament.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/user-action.model.d.ts +29 -0
- package/dist/types/libraries/mongo/models/user-action.model.js +113 -0
- package/dist/types/libraries/mongo/models/user-action.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/user-app-section-setting.model.d.ts +24 -0
- package/dist/types/libraries/mongo/models/user-app-section-setting.model.js +103 -0
- package/dist/types/libraries/mongo/models/user-app-section-setting.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/user.model.d.ts +39 -0
- package/dist/types/libraries/mongo/models/user.model.js +150 -0
- package/dist/types/libraries/mongo/models/user.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/vendor-access-control.model.d.ts +14 -0
- package/dist/types/libraries/mongo/models/vendor-access-control.model.js +75 -0
- package/dist/types/libraries/mongo/models/vendor-access-control.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/vendor-parent.model.d.ts +25 -0
- package/dist/types/libraries/mongo/models/vendor-parent.model.js +121 -0
- package/dist/types/libraries/mongo/models/vendor-parent.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/vendor.model.d.ts +33 -0
- package/dist/types/libraries/mongo/models/vendor.model.js +150 -0
- package/dist/types/libraries/mongo/models/vendor.model.js.map +1 -0
- package/dist/types/libraries/mongo/models/zone-extra-time.d.ts +12 -0
- package/dist/types/libraries/mongo/models/zone-extra-time.js +54 -0
- package/dist/types/libraries/mongo/models/zone-extra-time.js.map +1 -0
- package/dist/types/libraries/mongo/models/zone.model.d.ts +17 -0
- package/dist/types/libraries/mongo/models/zone.model.js +80 -0
- package/dist/types/libraries/mongo/models/zone.model.js.map +1 -0
- package/dist/types/libraries/mongo/plugins/normalize-field.plugin.d.ts +4 -0
- package/dist/types/libraries/mongo/plugins/normalize-field.plugin.js +42 -0
- package/dist/types/libraries/mongo/plugins/normalize-field.plugin.js.map +1 -0
- package/dist/types/libraries/mongo/plugins/soft-delete-plugin.d.ts +32 -0
- package/dist/types/libraries/mongo/plugins/soft-delete-plugin.js +145 -0
- package/dist/types/libraries/mongo/plugins/soft-delete-plugin.js.map +1 -0
- package/dist/types/libraries/mongo/utilities/shop.hooks.d.ts +9 -0
- package/dist/types/libraries/mongo/utilities/shop.hooks.js +11 -0
- package/dist/types/libraries/mongo/utilities/shop.hooks.js.map +1 -0
- package/dist/types/libraries/mongo/utilities/sorting-order.hooks.d.ts +14 -0
- package/dist/types/libraries/mongo/utilities/sorting-order.hooks.js +58 -0
- package/dist/types/libraries/mongo/utilities/sorting-order.hooks.js.map +1 -0
- package/dist/types/libraries/mongo/utilities/unique-id.hooks.d.ts +6 -0
- package/dist/types/libraries/mongo/utilities/unique-id.hooks.js +17 -0
- package/dist/types/libraries/mongo/utilities/unique-id.hooks.js.map +1 -0
- package/dist/types/libraries/notification/firebase-fcm.service.d.ts +7 -0
- package/dist/types/libraries/notification/firebase-fcm.service.js +40 -0
- package/dist/types/libraries/notification/firebase-fcm.service.js.map +1 -0
- package/dist/types/libraries/notification/firebase-message.builder.d.ts +22 -0
- package/dist/types/libraries/notification/firebase-message.builder.js +107 -0
- package/dist/types/libraries/notification/firebase-message.builder.js.map +1 -0
- package/dist/types/libraries/notification/lyxa-fcm-sender.d.ts +19 -0
- package/dist/types/libraries/notification/lyxa-fcm-sender.js +127 -0
- package/dist/types/libraries/notification/lyxa-fcm-sender.js.map +1 -0
- package/dist/types/libraries/notification/lyxa-fcm.service.d.ts +40 -0
- package/dist/types/libraries/notification/lyxa-fcm.service.js +177 -0
- package/dist/types/libraries/notification/lyxa-fcm.service.js.map +1 -0
- package/dist/types/libraries/redis/index.d.ts +25 -0
- package/dist/types/libraries/redis/index.js +137 -0
- package/dist/types/libraries/redis/index.js.map +1 -0
- package/dist/types/libraries/secrets/index.d.ts +10 -0
- package/dist/types/libraries/secrets/index.js +64 -0
- package/dist/types/libraries/secrets/index.js.map +1 -0
- package/dist/types/libraries/socket/BaseSocketEvent.d.ts +27 -0
- package/dist/types/libraries/socket/BaseSocketEvent.js +47 -0
- package/dist/types/libraries/socket/BaseSocketEvent.js.map +1 -0
- package/dist/types/libraries/socket/PushNotificationEvent.d.ts +36 -0
- package/dist/types/libraries/socket/PushNotificationEvent.js +45 -0
- package/dist/types/libraries/socket/PushNotificationEvent.js.map +1 -0
- package/dist/types/libraries/socket/connections/batch.d.ts +12 -0
- package/dist/types/libraries/socket/connections/batch.js +58 -0
- package/dist/types/libraries/socket/connections/batch.js.map +1 -0
- package/dist/types/libraries/socket/connections/cache.d.ts +9 -0
- package/dist/types/libraries/socket/connections/cache.js +36 -0
- package/dist/types/libraries/socket/connections/cache.js.map +1 -0
- package/dist/types/libraries/socket/connections/constants.d.ts +2 -0
- package/dist/types/libraries/socket/connections/constants.js +6 -0
- package/dist/types/libraries/socket/connections/constants.js.map +1 -0
- package/dist/types/libraries/socket/connections/index.d.ts +7 -0
- package/dist/types/libraries/socket/connections/index.js +24 -0
- package/dist/types/libraries/socket/connections/index.js.map +1 -0
- package/dist/types/libraries/socket/connections/instance-disconnect.d.ts +2 -0
- package/dist/types/libraries/socket/connections/instance-disconnect.js +43 -0
- package/dist/types/libraries/socket/connections/instance-disconnect.js.map +1 -0
- package/dist/types/libraries/socket/connections/keys.d.ts +10 -0
- package/dist/types/libraries/socket/connections/keys.js +23 -0
- package/dist/types/libraries/socket/connections/keys.js.map +1 -0
- package/dist/types/libraries/socket/connections/presence.d.ts +6 -0
- package/dist/types/libraries/socket/connections/presence.js +39 -0
- package/dist/types/libraries/socket/connections/presence.js.map +1 -0
- package/dist/types/libraries/socket/connections/redis-helpers.d.ts +2 -0
- package/dist/types/libraries/socket/connections/redis-helpers.js +14 -0
- package/dist/types/libraries/socket/connections/redis-helpers.js.map +1 -0
- package/dist/types/libraries/socket/connections/subscription.d.ts +13 -0
- package/dist/types/libraries/socket/connections/subscription.js +73 -0
- package/dist/types/libraries/socket/connections/subscription.js.map +1 -0
- package/dist/types/libraries/socket/core/index.d.ts +6 -0
- package/dist/types/libraries/socket/core/index.js +23 -0
- package/dist/types/libraries/socket/core/index.js.map +1 -0
- package/dist/types/libraries/socket/core/local-subscription-registry.d.ts +17 -0
- package/dist/types/libraries/socket/core/local-subscription-registry.js +60 -0
- package/dist/types/libraries/socket/core/local-subscription-registry.js.map +1 -0
- package/dist/types/libraries/socket/core/socket-event-consumer.d.ts +1 -0
- package/dist/types/libraries/socket/core/socket-event-consumer.js +14 -0
- package/dist/types/libraries/socket/core/socket-event-consumer.js.map +1 -0
- package/dist/types/libraries/socket/core/socket-event-publisher.d.ts +6 -0
- package/dist/types/libraries/socket/core/socket-event-publisher.js +82 -0
- package/dist/types/libraries/socket/core/socket-event-publisher.js.map +1 -0
- package/dist/types/libraries/socket/core/socket-event-registry.d.ts +12 -0
- package/dist/types/libraries/socket/core/socket-event-registry.js +23 -0
- package/dist/types/libraries/socket/core/socket-event-registry.js.map +1 -0
- package/dist/types/libraries/socket/core/socket-event-registry.map.d.ts +34 -0
- package/dist/types/libraries/socket/core/socket-event-registry.map.js +34 -0
- package/dist/types/libraries/socket/core/socket-event-registry.map.js.map +1 -0
- package/dist/types/libraries/socket/core/zAsyncIterable.d.ts +7 -0
- package/dist/types/libraries/socket/core/zAsyncIterable.js +35 -0
- package/dist/types/libraries/socket/core/zAsyncIterable.js.map +1 -0
- package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.d.ts +153 -0
- package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.js +44 -0
- package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.js.map +1 -0
- package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.d.ts +286 -0
- package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.js +96 -0
- package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -0
- package/dist/types/libraries/socket/events/index.d.ts +7 -0
- package/dist/types/libraries/socket/events/index.js +24 -0
- package/dist/types/libraries/socket/events/index.js.map +1 -0
- package/dist/types/libraries/socket/events/order-actions.socket.event.d.ts +297 -0
- package/dist/types/libraries/socket/events/order-actions.socket.event.js +82 -0
- package/dist/types/libraries/socket/events/order-actions.socket.event.js.map +1 -0
- package/dist/types/libraries/socket/events/rider-connect.socket.event.d.ts +13 -0
- package/dist/types/libraries/socket/events/rider-connect.socket.event.js +22 -0
- package/dist/types/libraries/socket/events/rider-connect.socket.event.js.map +1 -0
- package/dist/types/libraries/socket/events/rider-location-update.socket.event.d.ts +76 -0
- package/dist/types/libraries/socket/events/rider-location-update.socket.event.js +39 -0
- package/dist/types/libraries/socket/events/rider-location-update.socket.event.js.map +1 -0
- package/dist/types/libraries/socket/events/socketNotificationEvent.d.ts +46 -0
- package/dist/types/libraries/socket/events/socketNotificationEvent.js +29 -0
- package/dist/types/libraries/socket/events/socketNotificationEvent.js.map +1 -0
- package/dist/types/libraries/socket/events/ticket-actions.socket.event.d.ts +106 -0
- package/dist/types/libraries/socket/events/ticket-actions.socket.event.js +62 -0
- package/dist/types/libraries/socket/events/ticket-actions.socket.event.js.map +1 -0
- package/dist/types/libraries/socket/events/ticket-assign.socket.event.d.ts +161 -0
- package/dist/types/libraries/socket/events/ticket-assign.socket.event.js +42 -0
- package/dist/types/libraries/socket/events/ticket-assign.socket.event.js.map +1 -0
- package/dist/types/libraries/socket/events/ticket-unassign.socket.event.d.ts +27 -0
- package/dist/types/libraries/socket/events/ticket-unassign.socket.event.js +31 -0
- package/dist/types/libraries/socket/events/ticket-unassign.socket.event.js.map +1 -0
- package/dist/types/libraries/trpc/context.d.ts +37 -0
- package/dist/types/libraries/trpc/context.js +43 -0
- package/dist/types/libraries/trpc/context.js.map +1 -0
- package/dist/types/libraries/trpc/index.d.ts +75 -0
- package/dist/types/libraries/trpc/index.js +80 -0
- package/dist/types/libraries/trpc/index.js.map +1 -0
- package/dist/types/libraries/twilio/index.d.ts +6 -0
- package/dist/types/libraries/twilio/index.js +42 -0
- package/dist/types/libraries/twilio/index.js.map +1 -0
- package/dist/types/libraries/upload/index.d.ts +50 -0
- package/dist/types/libraries/upload/index.js +312 -0
- package/dist/types/libraries/upload/index.js.map +1 -0
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/auth-ref.mapper.d.ts +4 -0
- package/dist/types/utilities/auth-ref.mapper.js +22 -0
- package/dist/types/utilities/auth-ref.mapper.js.map +1 -0
- package/dist/types/utilities/dayjs/dayjs.d.ts +14 -0
- package/dist/types/utilities/dayjs/dayjs.js +47 -0
- package/dist/types/utilities/dayjs/dayjs.js.map +1 -0
- package/dist/types/utilities/dayjs/index.d.ts +2 -0
- package/dist/types/utilities/dayjs/index.js +9 -0
- package/dist/types/utilities/dayjs/index.js.map +1 -0
- package/dist/types/utilities/environment/rabbitmq-environments.d.ts +2 -0
- package/dist/types/utilities/environment/rabbitmq-environments.js +14 -0
- package/dist/types/utilities/environment/rabbitmq-environments.js.map +1 -0
- package/dist/types/utilities/environment/redis-environments.d.ts +2 -0
- package/dist/types/utilities/environment/redis-environments.js +14 -0
- package/dist/types/utilities/environment/redis-environments.js.map +1 -0
- package/dist/types/utilities/error-common.d.ts +10 -0
- package/dist/types/utilities/error-common.js +76 -0
- package/dist/types/utilities/error-common.js.map +1 -0
- package/dist/types/utilities/id-generator.d.ts +6 -0
- package/dist/types/utilities/id-generator.js +161 -0
- package/dist/types/utilities/id-generator.js.map +1 -0
- package/dist/types/utilities/instance.utils.d.ts +1 -0
- package/dist/types/utilities/instance.utils.js +12 -0
- package/dist/types/utilities/instance.utils.js.map +1 -0
- package/dist/types/utilities/normalize.d.ts +6 -0
- package/dist/types/utilities/normalize.js +51 -0
- package/dist/types/utilities/normalize.js.map +1 -0
- package/dist/types/utilities/password.d.ts +2 -0
- package/dist/types/utilities/password.js +20 -0
- package/dist/types/utilities/password.js.map +1 -0
- package/dist/types/utilities/projection.d.ts +8 -0
- package/dist/types/utilities/projection.js +37 -0
- package/dist/types/utilities/projection.js.map +1 -0
- package/dist/types/utilities/time.d.ts +13 -0
- package/dist/types/utilities/time.js +128 -0
- package/dist/types/utilities/time.js.map +1 -0
- package/package.json +1 -5
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RedisService = void 0;
|
|
16
|
+
const ioredis_1 = __importDefault(require("ioredis"));
|
|
17
|
+
const typedi_1 = require("typedi");
|
|
18
|
+
const crypto_1 = require("crypto");
|
|
19
|
+
const trpc_1 = require("../trpc");
|
|
20
|
+
let RedisService = class RedisService {
|
|
21
|
+
_redisClient;
|
|
22
|
+
constructor(redisURL) {
|
|
23
|
+
this._redisClient = new ioredis_1.default(redisURL, {
|
|
24
|
+
maxRetriesPerRequest: null,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
get redisClient() {
|
|
28
|
+
return this._redisClient;
|
|
29
|
+
}
|
|
30
|
+
async getCachedObject(key) {
|
|
31
|
+
const usageResponse = await this._redisClient.get(key);
|
|
32
|
+
if (usageResponse != undefined) {
|
|
33
|
+
return JSON.parse(usageResponse);
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
async cacheObject(key, object, expiry) {
|
|
38
|
+
const stringifiedObject = JSON.stringify(object);
|
|
39
|
+
if (expiry) {
|
|
40
|
+
await this._redisClient.setex(key, expiry, stringifiedObject);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
await this._redisClient.set(key, stringifiedObject);
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
async deleteCachedObject(key) {
|
|
48
|
+
await this._redisClient.del(key);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
async getCachedObjectByGroup(group, key) {
|
|
52
|
+
const usageResponse = await this._redisClient.hget(group, key);
|
|
53
|
+
if (usageResponse != undefined) {
|
|
54
|
+
return JSON.parse(usageResponse);
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
async setCachedObjectByGroup(group, key, object) {
|
|
59
|
+
const stringifiedObject = JSON.stringify(object);
|
|
60
|
+
await this._redisClient.hset(group, key, stringifiedObject);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
async deleteCachedObjectByGroup(group, key) {
|
|
64
|
+
await this._redisClient.hdel(group, key);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
sanitizeKey(key) {
|
|
68
|
+
return key
|
|
69
|
+
.replace(/[^\w\s]/gi, '')
|
|
70
|
+
.replace(/\s+/g, '-')
|
|
71
|
+
.toLowerCase();
|
|
72
|
+
}
|
|
73
|
+
async addToSet(group, member) {
|
|
74
|
+
await this._redisClient.sadd(group, member);
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
async removeFromSet(group, member) {
|
|
78
|
+
await this._redisClient.srem(group, member);
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
async isMemberOfSet(group, member) {
|
|
82
|
+
return (await this._redisClient.sismember(group, member)) === 1;
|
|
83
|
+
}
|
|
84
|
+
async getSetMembers(group) {
|
|
85
|
+
return await this._redisClient.smembers(group);
|
|
86
|
+
}
|
|
87
|
+
async acquireLock(key, ttl = 10000) {
|
|
88
|
+
const lockKey = `lock:${key}`;
|
|
89
|
+
const lockValue = (0, crypto_1.randomUUID)();
|
|
90
|
+
const result = await this._redisClient.set(lockKey, lockValue, 'PX', ttl, 'NX');
|
|
91
|
+
if (result === 'OK') {
|
|
92
|
+
return lockValue;
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
async releaseLock(key, lockValue) {
|
|
97
|
+
const lockKey = `lock:${key}`;
|
|
98
|
+
const luaScript = `
|
|
99
|
+
if redis.call("get", KEYS[1]) == ARGV[1] then
|
|
100
|
+
return redis.call("del", KEYS[1])
|
|
101
|
+
else
|
|
102
|
+
return 0
|
|
103
|
+
end
|
|
104
|
+
`;
|
|
105
|
+
const result = await this._redisClient.eval(luaScript, 1, lockKey, lockValue);
|
|
106
|
+
return result === 1;
|
|
107
|
+
}
|
|
108
|
+
async executeWithLock(key, ttl, callback, errorMessage, options) {
|
|
109
|
+
const maxRetries = options?.maxRetries ?? 10;
|
|
110
|
+
const retryDelayMs = options?.retryDelayMs ?? 500;
|
|
111
|
+
let attempt = 0;
|
|
112
|
+
while (attempt <= maxRetries) {
|
|
113
|
+
const lockValue = await this.acquireLock(key, ttl);
|
|
114
|
+
if (lockValue) {
|
|
115
|
+
try {
|
|
116
|
+
return await callback();
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
await this.releaseLock(key, lockValue);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
await new Promise(r => setTimeout(r, retryDelayMs + Math.random() * 100));
|
|
123
|
+
attempt++;
|
|
124
|
+
}
|
|
125
|
+
throw new trpc_1.TRPCError({
|
|
126
|
+
code: 'CONFLICT',
|
|
127
|
+
message: errorMessage || 'Resource is locked',
|
|
128
|
+
cause: { retryable: true },
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
exports.RedisService = RedisService;
|
|
133
|
+
exports.RedisService = RedisService = __decorate([
|
|
134
|
+
(0, typedi_1.Service)(),
|
|
135
|
+
__metadata("design:paramtypes", [String])
|
|
136
|
+
], RedisService);
|
|
137
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/redis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA4B;AAC5B,mCAAiC;AACjC,mCAAoC;AACpC,kCAAoC;AAQ7B,IAAM,YAAY,GAAlB,MAAM,YAAY;IAChB,YAAY,CAAS;IAE7B,YAAY,QAAgB;QAC3B,IAAI,CAAC,YAAY,GAAG,IAAI,iBAAK,CAAC,QAAQ,EAAE;YACvC,oBAAoB,EAAE,IAAI;SAC1B,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,WAAW;QACd,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,eAAe,CAAI,GAAW;QAC1C,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEvD,IAAI,aAAa,IAAI,SAAS,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAM,CAAC;QACvC,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,WAAW,CAAI,GAAW,EAAE,MAAS,EAAE,MAAe;QAClE,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM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import { randomUUID } from 'crypto';\nimport { TRPCError } from '../trpc';\n\ninterface LockOptions {\n\tmaxRetries?: number;\n\tretryDelayMs?: number;\n}\n\n@Service()\nexport class RedisService {\n\tprivate _redisClient!: Redis;\n\n\tconstructor(redisURL: string) {\n\t\tthis._redisClient = new Redis(redisURL, {\n\t\t\tmaxRetriesPerRequest: null,\n\t\t});\n\t}\n\n\tget redisClient(): Redis {\n\t\treturn this._redisClient;\n\t}\n\n\tpublic async getCachedObject<T>(key: string): Promise<T | undefined> {\n\t\tconst usageResponse = await this._redisClient.get(key);\n\n\t\tif (usageResponse != undefined) {\n\t\t\treturn JSON.parse(usageResponse) as T;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpublic async cacheObject<T>(key: string, object: T, expiry?: number): Promise<boolean> {\n\t\tconst stringifiedObject = JSON.stringify(object);\n\n\t\tif (expiry) {\n\t\t\tawait this._redisClient.setex(key, expiry, stringifiedObject);\n\t\t} else {\n\t\t\tawait this._redisClient.set(key, stringifiedObject);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic async deleteCachedObject(key: string): Promise<boolean> {\n\t\tawait this._redisClient.del(key);\n\t\treturn true;\n\t}\n\n\tpublic async getCachedObjectByGroup<T>(group: string, key: string): Promise<T | undefined> {\n\t\tconst usageResponse = await this._redisClient.hget(group, key);\n\n\t\tif (usageResponse != undefined) {\n\t\t\treturn JSON.parse(usageResponse) as T;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpublic async setCachedObjectByGroup<T>(group: string, key: string, object: T): Promise<boolean> {\n\t\tconst stringifiedObject = JSON.stringify(object);\n\t\tawait this._redisClient.hset(group, key, stringifiedObject);\n\n\t\treturn true;\n\t}\n\n\tpublic async deleteCachedObjectByGroup<T>(group: string, key: string): Promise<boolean> {\n\t\tawait this._redisClient.hdel(group, key);\n\t\treturn true;\n\t}\n\n\tpublic sanitizeKey(key: string) {\n\t\treturn key\n\t\t\t.replace(/[^\\w\\s]/gi, '')\n\t\t\t.replace(/\\s+/g, '-')\n\t\t\t.toLowerCase();\n\t}\n\n\tpublic async addToSet(group: string, member: string): Promise<boolean> {\n\t\tawait this._redisClient.sadd(group, member);\n\t\treturn true;\n\t}\n\n\tpublic async removeFromSet(group: string, member: string): Promise<boolean> {\n\t\tawait this._redisClient.srem(group, member);\n\t\treturn true;\n\t}\n\n\tpublic async isMemberOfSet(group: string, member: string): Promise<boolean> {\n\t\treturn (await this._redisClient.sismember(group, member)) === 1;\n\t}\n\n\tpublic async getSetMembers(group: string): Promise<string[]> {\n\t\treturn await this._redisClient.smembers(group);\n\t}\n\n\tpublic async acquireLock(\n\t\tkey: string,\n\t\tttl: number = 10000 // default 10s\n\t): Promise<string | null> {\n\t\tconst lockKey = `lock:${key}`;\n\t\tconst lockValue = randomUUID(); // unique value per process\n\n\t\tconst result = await this._redisClient.set(lockKey, lockValue, 'PX', ttl, 'NX');\n\n\t\t// If result === 'OK' → lock acquired\n\t\tif (result === 'OK') {\n\t\t\treturn lockValue;\n\t\t}\n\n\t\treturn null; // lock not acquired\n\t}\n\n\tpublic async releaseLock(key: string, lockValue: string): Promise<boolean> {\n\t\tconst lockKey = `lock:${key}`;\n\n\t\tconst luaScript = `\n\t\tif redis.call(\"get\", KEYS[1]) == ARGV[1] then\n\t\t\treturn redis.call(\"del\", KEYS[1])\n\t\telse\n\t\t\treturn 0\n\t\tend\n\t`;\n\n\t\tconst result = await this._redisClient.eval(luaScript, 1, lockKey, lockValue);\n\n\t\treturn result === 1;\n\t}\n\n\tpublic async executeWithLock<T>(\n\t\tkey: string,\n\t\tttl: number,\n\t\tcallback: () => Promise<T>,\n\t\terrorMessage?: string,\n\t\toptions?: LockOptions\n\t): Promise<T> {\n\t\tconst maxRetries = options?.maxRetries ?? 10;\n\t\tconst retryDelayMs = options?.retryDelayMs ?? 500;\n\n\t\tlet attempt = 0;\n\n\t\twhile (attempt <= maxRetries) {\n\t\t\tconst lockValue = await this.acquireLock(key, ttl);\n\n\t\t\tif (lockValue) {\n\t\t\t\ttry {\n\t\t\t\t\treturn await callback();\n\t\t\t\t} finally {\n\t\t\t\t\tawait this.releaseLock(key, lockValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tawait new Promise(r => setTimeout(r, retryDelayMs + Math.random() * 100));\n\n\t\t\tattempt++;\n\t\t}\n\n\t\tthrow new TRPCError({\n\t\t\tcode: 'CONFLICT',\n\t\t\tmessage: errorMessage || 'Resource is locked',\n\t\t\tcause: { retryable: true },\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RedisService } from '../redis';
|
|
2
|
+
import { ConfigurationService } from '../configuration';
|
|
3
|
+
export declare class SecretManagerService {
|
|
4
|
+
private _configurationService;
|
|
5
|
+
private _redisManager;
|
|
6
|
+
private _client;
|
|
7
|
+
constructor(configurationService: ConfigurationService, redisManager: RedisService);
|
|
8
|
+
getKey(key: string): Promise<string | undefined>;
|
|
9
|
+
setKey(key: string, value: string): Promise<string>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SecretManagerService = void 0;
|
|
13
|
+
const secret_manager_1 = require("@google-cloud/secret-manager");
|
|
14
|
+
const typedi_1 = require("typedi");
|
|
15
|
+
const redis_1 = require("../redis");
|
|
16
|
+
const configuration_1 = require("../configuration");
|
|
17
|
+
let SecretManagerService = class SecretManagerService {
|
|
18
|
+
_configurationService;
|
|
19
|
+
_redisManager;
|
|
20
|
+
_client;
|
|
21
|
+
constructor(configurationService, redisManager) {
|
|
22
|
+
this._configurationService = configurationService;
|
|
23
|
+
this._redisManager = redisManager;
|
|
24
|
+
this._client = new secret_manager_1.SecretManagerServiceClient({
|
|
25
|
+
credentials: {
|
|
26
|
+
client_id: '107840895824406590900',
|
|
27
|
+
private_key_id: 'ece1ebdfde57414700f23f1f4014f5e83d4f7644',
|
|
28
|
+
type: 'service_account',
|
|
29
|
+
universe_domain: 'googleapis.com',
|
|
30
|
+
projectId: 'for-poc-325210',
|
|
31
|
+
private_key: '-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDPTk9M5nCDYJhC\nLuyP+gqBXIHPrXegygco5tB50Y7Q9s/f4hm+xp/usYy5UCYyFVNjZ2mdjWQcr3Ta\nT3GZV9OiHej8ejveY0iyFBi0IlfGNm9blYlOIyQT4i6MoevNul7u4EQL8bid/sp/\nJ/XPNC+Jnk8Ke2G9FdfDYs+1O6Nf37HuPUmMwLAzcyl+k1v9UzInrgNPj+nactY7\nEPCVSM6XcZI3UL86n574iQBvUXsMpUt3csYVOxPap1Vd1TBEo1k85jZepMvaXHoK\nJUwQT7p1F1D0weVKJ1BjwQgmADZWfUKdwRyS8zFPbUGeptlA2XlxyVMasGzCCMi4\n6jzJGC81AgMBAAECggEAXoaLnDn7Fbym0I7K6T+PKLtAqaykPpnAOAM/DjzijR/t\nW12idZ3l8RXeX+VO9UlKE6pkuyVsf7P1aVIOL2ifpG1U/kLSJ65HyINnXEPImCXc\nEvuVdx6I5dQde5ydg9o2TV/PR0756njyZpa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jS\ns/ucyyfUssPsTznYW3gXf3To\n-----END PRIVATE KEY-----\n',
|
|
32
|
+
client_email: 'lyxa-core@for-poc-325210.iam.gserviceaccount.com',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async getKey(key) {
|
|
37
|
+
const environmentTransformedKey = this._configurationService?.options?.environment + '_' + key;
|
|
38
|
+
try {
|
|
39
|
+
const data = await this._redisManager.getCachedObjectByGroup(this?._configurationService?.options?.environment + '_KEYS', key);
|
|
40
|
+
if (data != undefined) {
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
const [accessResponse] = await this._client.accessSecretVersion({
|
|
44
|
+
name: 'projects/899369746265/secrets/' + environmentTransformedKey + '/versions/latest',
|
|
45
|
+
});
|
|
46
|
+
const val = accessResponse.payload.data.toString();
|
|
47
|
+
await this.setKey(key, val);
|
|
48
|
+
return val;
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
console.error(e);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async setKey(key, value) {
|
|
55
|
+
await this._redisManager.setCachedObjectByGroup(this._configurationService.options.environment + '_KEYS', key, value);
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.SecretManagerService = SecretManagerService;
|
|
60
|
+
exports.SecretManagerService = SecretManagerService = __decorate([
|
|
61
|
+
(0, typedi_1.Service)(),
|
|
62
|
+
__metadata("design:paramtypes", [configuration_1.ConfigurationService, redis_1.RedisService])
|
|
63
|
+
], SecretManagerService);
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/secrets/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA0E;AAC1E,mCAAiC;AACjC,oCAAwC;AACxC,oDAAwD;AAGjD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACxB,qBAAqB,CAA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OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,KAAa;QAC7C,MAAM,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAC9C,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,EACxD,GAAG,EACH,KAAK,CACL,CAAC;QACF,OAAO,KAAK,CAAC;IACd,CAAC;CACD,CAAA;AAzDY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,gBAAO,GAAE;qCAMyB,oCAAoB,EAAgB,oBAAY;GALtE,oBAAoB,CAyDhC","sourcesContent":["import { SecretManagerServiceClient } from '@google-cloud/secret-manager';\nimport { Service } from 'typedi';\nimport { RedisService } from '../redis';\nimport { ConfigurationService } from '../configuration';\n\n@Service()\nexport class SecretManagerService {\n\tprivate _configurationService!: ConfigurationService;\n\tprivate _redisManager!: RedisService;\n\tprivate _client!: SecretManagerServiceClient;\n\n\tconstructor(configurationService: ConfigurationService, redisManager: RedisService) {\n\t\tthis._configurationService = configurationService;\n\t\tthis._redisManager = redisManager;\n\t\tthis._client = new SecretManagerServiceClient({\n\t\t\tcredentials: {\n\t\t\t\tclient_id: '107840895824406590900',\n\t\t\t\tprivate_key_id: 'ece1ebdfde57414700f23f1f4014f5e83d4f7644',\n\t\t\t\ttype: 'service_account',\n\t\t\t\tuniverse_domain: 'googleapis.com',\n\t\t\t\tprojectId: 'for-poc-325210',\n\t\t\t\tprivate_key:\n\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDPTk9M5nCDYJhC\\nLuyP+gqBXIHPrXegygco5tB50Y7Q9s/f4hm+xp/usYy5UCYyFVNjZ2mdjWQcr3Ta\\nT3GZV9OiHej8ejveY0iyFBi0IlfGNm9blYlOIyQT4i6MoevNul7u4EQL8bid/sp/\\nJ/XPNC+Jnk8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NfS/6Jcbs/KvbAfjCptTkX10wKBgDxb\\nwy5WtlRVcqxaf50ilWzr8I/7fH7YceYDG4EbKxTHD0m+BOjbhrlmAlMO2sIUM3WK\\nfpmPCZiuLyCTmuC+kd8xK5ap79h3libgh/2/ReUpvdBhm+PQDOLC4CtCPYdtIn7T\\nP57jN8dRLXJokIIIBw+nH32dS62AQ9oXWYvZ1UKzAoGBAOWOSphZMnPlLeLN54/4\\nwKPI+D6G1JhzqQrUf8Z99J7m3r3ya+0ug5gRGQCoSRfqz9o87+fLCdSdc38L+j4T\\nBnuwIcY6n4LF+3yAPIF1rnrIBFRqzPta7epYPXHtUTvWOkEkKzNmsFVCZKF7nQjS\\ns/ucyyfUssPsTznYW3gXf3To\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\tclient_email: 'lyxa-core@for-poc-325210.iam.gserviceaccount.com',\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async getKey(key: string): Promise<string | undefined> {\n\t\tconst environmentTransformedKey = this._configurationService?.options?.environment + '_' + key;\n\n\t\ttry {\n\t\t\tconst data = await this._redisManager.getCachedObjectByGroup<string>(\n\t\t\t\tthis?._configurationService?.options?.environment + '_KEYS',\n\t\t\t\tkey\n\t\t\t);\n\n\t\t\tif (data != undefined) {\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tconst [accessResponse] = await this._client.accessSecretVersion({\n\t\t\t\tname: 'projects/899369746265/secrets/' + environmentTransformedKey + '/versions/latest',\n\t\t\t});\n\n\t\t\tconst val = accessResponse.payload!.data!.toString();\n\n\t\t\tawait this.setKey(key, val);\n\n\t\t\treturn val;\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tpublic async setKey(key: string, value: string): Promise<string> {\n\t\tawait this._redisManager.setCachedObjectByGroup<string>(\n\t\t\tthis._configurationService.options.environment + '_KEYS',\n\t\t\tkey,\n\t\t\tvalue\n\t\t);\n\t\treturn value;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import z, { ZodTypeAny } from 'zod';
|
|
2
|
+
import { SocketEventType } from '../../utilities/enum';
|
|
3
|
+
import { NotificationSettings, PushNotificationEvent } from './PushNotificationEvent';
|
|
4
|
+
import { SocketNotificationEvent } from './events';
|
|
5
|
+
export declare abstract class BaseSocketEvent<SIn extends ZodTypeAny, SOut extends ZodTypeAny, SPush extends ZodTypeAny | undefined = undefined> {
|
|
6
|
+
protected readonly _eventType: SocketEventType;
|
|
7
|
+
readonly inputSchema: SIn;
|
|
8
|
+
readonly outputSchema: SOut;
|
|
9
|
+
readonly pushNotificationOutputSchema?: SPush;
|
|
10
|
+
protected readonly data: z.infer<SOut>;
|
|
11
|
+
protected readonly pushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined;
|
|
12
|
+
protected readonly socketNotificationEvent?: SocketNotificationEvent;
|
|
13
|
+
protected abstract getIdentifier(): string;
|
|
14
|
+
get notificationSettings(): NotificationSettings | undefined;
|
|
15
|
+
notification?(): PushNotificationEvent | null;
|
|
16
|
+
pushNotification?: boolean;
|
|
17
|
+
protected constructor(eventType: SocketEventType, schemas: {
|
|
18
|
+
input: SIn;
|
|
19
|
+
output: SOut;
|
|
20
|
+
pushNotificationOutput?: SPush;
|
|
21
|
+
}, data: z.infer<SOut>, pushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined, socketNotificationEvent?: SocketNotificationEvent);
|
|
22
|
+
payload(): z.infer<SOut>;
|
|
23
|
+
getPushNotificationPayload(): SPush extends ZodTypeAny ? z.infer<SPush> | undefined : undefined;
|
|
24
|
+
getSocketNotificationEvent(): SocketNotificationEvent | undefined;
|
|
25
|
+
eventType(): SocketEventType;
|
|
26
|
+
getSubscriptionKey(): string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseSocketEvent = void 0;
|
|
4
|
+
class BaseSocketEvent {
|
|
5
|
+
_eventType;
|
|
6
|
+
inputSchema;
|
|
7
|
+
outputSchema;
|
|
8
|
+
pushNotificationOutputSchema;
|
|
9
|
+
data;
|
|
10
|
+
pushNotificationData;
|
|
11
|
+
socketNotificationEvent;
|
|
12
|
+
get notificationSettings() {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
pushNotification = false;
|
|
16
|
+
constructor(eventType, schemas, data, pushNotificationData, socketNotificationEvent) {
|
|
17
|
+
this._eventType = eventType;
|
|
18
|
+
this.inputSchema = schemas.input;
|
|
19
|
+
this.outputSchema = schemas.output;
|
|
20
|
+
this.data = this.outputSchema.parse(data);
|
|
21
|
+
this.socketNotificationEvent = socketNotificationEvent;
|
|
22
|
+
if (schemas.pushNotificationOutput) {
|
|
23
|
+
this.pushNotificationOutputSchema = schemas.pushNotificationOutput;
|
|
24
|
+
if (pushNotificationData !== undefined) {
|
|
25
|
+
this.pushNotificationData = schemas.pushNotificationOutput.parse(pushNotificationData);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
payload() {
|
|
30
|
+
return this.data;
|
|
31
|
+
}
|
|
32
|
+
getPushNotificationPayload() {
|
|
33
|
+
return this.pushNotificationData;
|
|
34
|
+
}
|
|
35
|
+
getSocketNotificationEvent() {
|
|
36
|
+
return this.socketNotificationEvent;
|
|
37
|
+
}
|
|
38
|
+
eventType() {
|
|
39
|
+
return this._eventType;
|
|
40
|
+
}
|
|
41
|
+
getSubscriptionKey() {
|
|
42
|
+
const identifier = this.getIdentifier();
|
|
43
|
+
return `${this._eventType}:${identifier}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.BaseSocketEvent = BaseSocketEvent;
|
|
47
|
+
//# sourceMappingURL=BaseSocketEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseSocketEvent.js","sourceRoot":"/","sources":["libraries/socket/BaseSocketEvent.ts"],"names":[],"mapp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,IAAI,CAAC,UAAU,IAAI,UAAU,EAAE,CAAC;IAC3C,CAAC;CACD;AAlED,0CAkEC","sourcesContent":["import z, { ZodTypeAny } from 'zod';\nimport { SocketEventType } from '../../utilities/enum';\nimport { NotificationSettings, PushNotificationEvent } from './PushNotificationEvent';\nimport { SocketNotificationEvent } from './events';\n\nexport abstract class BaseSocketEvent<\n\tSIn extends ZodTypeAny,\n\tSOut extends ZodTypeAny,\n\tSPush extends ZodTypeAny | undefined = undefined,\n> {\n\tprotected readonly _eventType: SocketEventType;\n\tpublic readonly inputSchema: SIn;\n\tpublic readonly outputSchema: SOut;\n\tpublic readonly pushNotificationOutputSchema?: SPush;\n\tprotected readonly data: z.infer<SOut>;\n\tprotected readonly pushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined;\n\tprotected readonly socketNotificationEvent?: SocketNotificationEvent;\n\n\tprotected abstract getIdentifier(): string;\n\n\tpublic get notificationSettings(): NotificationSettings | undefined {\n\t\treturn undefined;\n\t}\n\n\tpublic notification?(): PushNotificationEvent | null;\n\tpublic pushNotification?: boolean = false;\n\n\tprotected constructor(\n\t\teventType: SocketEventType,\n\t\tschemas: { input: SIn; output: SOut; pushNotificationOutput?: SPush },\n\t\tdata: z.infer<SOut>,\n\t\tpushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined,\n\t\tsocketNotificationEvent?: SocketNotificationEvent\n\t) {\n\t\tthis._eventType = eventType;\n\t\tthis.inputSchema = schemas.input;\n\t\tthis.outputSchema = schemas.output;\n\t\tthis.data = this.outputSchema.parse(data);\n\t\tthis.socketNotificationEvent = socketNotificationEvent;\n\n\t\t// Set push notification data if schema exists\n\t\tif (schemas.pushNotificationOutput) {\n\t\t\tthis.pushNotificationOutputSchema = schemas.pushNotificationOutput;\n\t\t\t// If pushNotificationData is explicitly provided, use it; otherwise undefined\n\t\t\tif (pushNotificationData !== undefined) {\n\t\t\t\tthis.pushNotificationData = schemas.pushNotificationOutput.parse(\n\t\t\t\t\tpushNotificationData\n\t\t\t\t) as SPush extends ZodTypeAny ? z.infer<SPush> : undefined;\n\t\t\t}\n\t\t}\n\t}\n\tpublic payload(): z.infer<SOut> {\n\t\treturn this.data;\n\t}\n\n\tpublic getPushNotificationPayload(): SPush extends ZodTypeAny ? z.infer<SPush> | undefined : undefined {\n\t\treturn this.pushNotificationData as SPush extends ZodTypeAny ? z.infer<SPush> | undefined : undefined;\n\t}\n\n\tpublic getSocketNotificationEvent(): SocketNotificationEvent | undefined {\n\t\treturn this.socketNotificationEvent;\n\t}\n\n\tpublic eventType(): SocketEventType {\n\t\treturn this._eventType;\n\t}\n\n\tpublic getSubscriptionKey(): string {\n\t\tconst identifier = this.getIdentifier();\n\t\treturn `${this._eventType}:${identifier}`;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseEvent } from '../event/BaseEvent';
|
|
2
|
+
import { ClickType, SocketEventType } from '../../utilities/enum';
|
|
3
|
+
import { REGISTRY } from './core/socket-event-registry.map';
|
|
4
|
+
import { EntitySubscription } from './connections';
|
|
5
|
+
type SocketEventPayloads = {
|
|
6
|
+
[K in SocketEventType]: (typeof REGISTRY)[K] extends {
|
|
7
|
+
schemas: {
|
|
8
|
+
pushNotificationOutput: any;
|
|
9
|
+
};
|
|
10
|
+
} ? import('zod').infer<(typeof REGISTRY)[K]['schemas']['pushNotificationOutput']> : (typeof REGISTRY)[K] extends {
|
|
11
|
+
schemas: {
|
|
12
|
+
output: any;
|
|
13
|
+
};
|
|
14
|
+
} ? import('zod').infer<(typeof REGISTRY)[K]['schemas']['output']> : any;
|
|
15
|
+
};
|
|
16
|
+
export type NotificationSettings = {
|
|
17
|
+
isPushNotification: false;
|
|
18
|
+
} | {
|
|
19
|
+
isPushNotification: true;
|
|
20
|
+
isClickable: boolean;
|
|
21
|
+
clickType: ClickType;
|
|
22
|
+
title?: string | 'new ';
|
|
23
|
+
};
|
|
24
|
+
export type PushNotificationEventData<T extends SocketEventType = SocketEventType> = {
|
|
25
|
+
eventName: T;
|
|
26
|
+
recipients: EntitySubscription[];
|
|
27
|
+
payload: SocketEventPayloads[T];
|
|
28
|
+
notificationSettings: NotificationSettings;
|
|
29
|
+
};
|
|
30
|
+
export declare class PushNotificationEvent<T extends SocketEventType = SocketEventType> extends BaseEvent<PushNotificationEventData<T>> {
|
|
31
|
+
constructor(eventName: T, data: SocketEventPayloads[T], recipients: EntitySubscription[], settings: NotificationSettings);
|
|
32
|
+
get type(): T;
|
|
33
|
+
get recipients(): EntitySubscription[];
|
|
34
|
+
getPayload(): SocketEventPayloads[T];
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PushNotificationEvent = void 0;
|
|
13
|
+
const BaseEvent_1 = require("../event/BaseEvent");
|
|
14
|
+
const metadata_1 = require("../event/decorators/metadata");
|
|
15
|
+
const EventEnums_1 = require("../event/EventEnums");
|
|
16
|
+
let PushNotificationEvent = class PushNotificationEvent extends BaseEvent_1.BaseEvent {
|
|
17
|
+
constructor(eventName, data, recipients, settings) {
|
|
18
|
+
const payload = data;
|
|
19
|
+
super(EventEnums_1.PublishEventEnums.SOCKET_PUSH_NOTIFICATION_EVENT, {
|
|
20
|
+
eventName,
|
|
21
|
+
recipients,
|
|
22
|
+
payload,
|
|
23
|
+
notificationSettings: settings,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
get type() {
|
|
27
|
+
return this.payload.eventName;
|
|
28
|
+
}
|
|
29
|
+
get recipients() {
|
|
30
|
+
return this.payload.recipients;
|
|
31
|
+
}
|
|
32
|
+
getPayload() {
|
|
33
|
+
return this.payload.payload;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.PushNotificationEvent = PushNotificationEvent;
|
|
37
|
+
exports.PushNotificationEvent = PushNotificationEvent = __decorate([
|
|
38
|
+
(0, metadata_1.EventMetadata)('notification.push', [
|
|
39
|
+
{ name: 'eventName', type: 'SocketEventType' },
|
|
40
|
+
{ name: 'recipients', type: 'EntitySubscription[]' },
|
|
41
|
+
{ name: 'payload', type: 'any' },
|
|
42
|
+
]),
|
|
43
|
+
__metadata("design:paramtypes", [String, Object, Array, Object])
|
|
44
|
+
], PushNotificationEvent);
|
|
45
|
+
//# sourceMappingURL=PushNotificationEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PushNotificationEvent.js","sourceRoot":"/","sources":["libraries/socket/PushNotificationEvent.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA+C;AAE/C,2DAA6D;AAC7D,oDAAwD;AAkCjD,IAAM,qBAAqB,GAA3B,MAAM,qBAAmE,SAAQ,qBAEvF;IACA,YACC,SAAY,EACZ,IAA4B,EAC5B,UAAgC,EAChC,QAA8B;QAE9B,MAAM,OAAO,GAAG,IAAI,CAAC;QACrB,KAAK,CAAC,8BAAiB,CAAC,8BAA8B,EAAE;YACvD,SAAS;YACT,UAAU;YACV,OAAO;YACP,oBAAoB,EAAE,QAAQ;SACE,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,IAAI;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,UAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IAChC,CAAC;IAED,UAAU;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7B,CAAC;CACD,CAAA;AA7BY,sDAAqB;gCAArB,qBAAqB;IALjC,IAAA,wBAAa,EAAC,mBAAmB,EAAE;QACnC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,EAAE;QAC9C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,sBAAsB,EAAE;QACpD,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE;KAChC,CAAC;;GACW,qBAAqB,CA6BjC","sourcesContent":["import { BaseEvent } from '../event/BaseEvent';\nimport { ClickType, SocketEventType } from '../../utilities/enum';\nimport { EventMetadata } from '../event/decorators/metadata';\nimport { PublishEventEnums } from '../event/EventEnums';\nimport { REGISTRY } from './core/socket-event-registry.map';\nimport { EntitySubscription } from './connections';\n\n// Extract payload types from the registry - use pushNotificationOutput when available, otherwise output\ntype SocketEventPayloads = {\n\t[K in SocketEventType]: (typeof REGISTRY)[K] extends { schemas: { pushNotificationOutput: any } }\n\t\t? import('zod').infer<(typeof REGISTRY)[K]['schemas']['pushNotificationOutput']>\n\t\t: (typeof REGISTRY)[K] extends { schemas: { output: any } }\n\t\t\t? import('zod').infer<(typeof REGISTRY)[K]['schemas']['output']>\n\t\t\t: any;\n};\n\nexport type NotificationSettings =\n\t| { isPushNotification: false }\n\t| {\n\t\t\tisPushNotification: true;\n\t\t\tisClickable: boolean;\n\t\t\tclickType: ClickType;\n\t\t\ttitle?: string | 'new ';\n\t };\n\nexport type PushNotificationEventData<T extends SocketEventType = SocketEventType> = {\n\teventName: T;\n\trecipients: EntitySubscription[];\n\tpayload: SocketEventPayloads[T];\n\tnotificationSettings: NotificationSettings;\n};\n\n@EventMetadata('notification.push', [\n\t{ name: 'eventName', type: 'SocketEventType' },\n\t{ name: 'recipients', type: 'EntitySubscription[]' },\n\t{ name: 'payload', type: 'any' },\n])\nexport class PushNotificationEvent<T extends SocketEventType = SocketEventType> extends BaseEvent<\n\tPushNotificationEventData<T>\n> {\n\tconstructor(\n\t\teventName: T,\n\t\tdata: SocketEventPayloads[T],\n\t\trecipients: EntitySubscription[],\n\t\tsettings: NotificationSettings\n\t) {\n\t\tconst payload = data;\n\t\tsuper(PublishEventEnums.SOCKET_PUSH_NOTIFICATION_EVENT, {\n\t\t\teventName,\n\t\t\trecipients,\n\t\t\tpayload,\n\t\t\tnotificationSettings: settings,\n\t\t} as PushNotificationEventData<T>);\n\t}\n\n\tget type(): T {\n\t\treturn this.payload.eventName;\n\t}\n\n\tget recipients(): EntitySubscription[] {\n\t\treturn this.payload.recipients;\n\t}\n\n\tgetPayload(): SocketEventPayloads[T] {\n\t\treturn this.payload.payload;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EntitySubscription } from './keys';
|
|
2
|
+
export declare function getEntitySubscriptionInfo(entity: EntitySubscription, eventKey: string): Promise<{
|
|
3
|
+
isSubscribed: boolean;
|
|
4
|
+
instances: string[];
|
|
5
|
+
}>;
|
|
6
|
+
export declare function getEntitySubscriptionInfoBatch(entities: Array<{
|
|
7
|
+
entity: EntitySubscription;
|
|
8
|
+
eventKey: string;
|
|
9
|
+
}>): Promise<Map<string, {
|
|
10
|
+
isSubscribed: boolean;
|
|
11
|
+
instances: string[];
|
|
12
|
+
}>>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEntitySubscriptionInfo = getEntitySubscriptionInfo;
|
|
4
|
+
exports.getEntitySubscriptionInfoBatch = getEntitySubscriptionInfoBatch;
|
|
5
|
+
const __1 = require("../../..");
|
|
6
|
+
const keys_1 = require("./keys");
|
|
7
|
+
const cache_1 = require("./cache");
|
|
8
|
+
const constants_1 = require("./constants");
|
|
9
|
+
const subscriptionCache = new cache_1.LRUCache(10000);
|
|
10
|
+
async function getEntitySubscriptionInfo(entity, eventKey) {
|
|
11
|
+
const cacheKey = `${(0, keys_1.entityKey)(entity)}:${eventKey}`;
|
|
12
|
+
const cached = subscriptionCache.get(cacheKey);
|
|
13
|
+
if (cached && Date.now() - cached.timestamp < constants_1.CACHE_TTL) {
|
|
14
|
+
return { isSubscribed: cached.isSubscribed, instances: cached.instances };
|
|
15
|
+
}
|
|
16
|
+
const redis = (0, __1.getLibraries)().getRedisService();
|
|
17
|
+
const sockets = await redis.getSetMembers((0, keys_1.kEntityEventSockets)(entity, eventKey));
|
|
18
|
+
const instanceSet = new Set();
|
|
19
|
+
for (const s of sockets) {
|
|
20
|
+
const [instanceId] = s.split('|');
|
|
21
|
+
if (instanceId)
|
|
22
|
+
instanceSet.add(instanceId);
|
|
23
|
+
}
|
|
24
|
+
const result = {
|
|
25
|
+
isSubscribed: sockets.length > 0,
|
|
26
|
+
instances: Array.from(instanceSet),
|
|
27
|
+
};
|
|
28
|
+
subscriptionCache.set(cacheKey, { ...result, timestamp: Date.now() });
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
async function getEntitySubscriptionInfoBatch(entities) {
|
|
32
|
+
const redis = (0, __1.getLibraries)().getRedisService();
|
|
33
|
+
const results = new Map();
|
|
34
|
+
const now = Date.now();
|
|
35
|
+
await Promise.all(entities.map(async ({ entity, eventKey }) => {
|
|
36
|
+
const cacheKey = `${(0, keys_1.entityKey)(entity)}:${eventKey}`;
|
|
37
|
+
const cached = subscriptionCache.get(cacheKey);
|
|
38
|
+
if (cached && now - cached.timestamp < constants_1.CACHE_TTL) {
|
|
39
|
+
results.set(cacheKey, cached);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const sockets = await redis.getSetMembers((0, keys_1.kEntityEventSockets)(entity, eventKey));
|
|
43
|
+
const instanceSet = new Set();
|
|
44
|
+
for (const s of sockets) {
|
|
45
|
+
const [instanceId] = s.split('|');
|
|
46
|
+
if (instanceId)
|
|
47
|
+
instanceSet.add(instanceId);
|
|
48
|
+
}
|
|
49
|
+
const result = {
|
|
50
|
+
isSubscribed: sockets.length > 0,
|
|
51
|
+
instances: Array.from(instanceSet),
|
|
52
|
+
};
|
|
53
|
+
subscriptionCache.set(cacheKey, { ...result, timestamp: now });
|
|
54
|
+
results.set(cacheKey, result);
|
|
55
|
+
}));
|
|
56
|
+
return results;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=batch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch.js","sourceRoot":"/","sources":["libraries/socket/connections/batch.ts"],"names":[],"mappings":";;AAWA,8DAsBC;AAED,wEA6BC;AA/DD,gCAAwC;AACxC,iCAA4E;AAC5E,mCAAmC;AACnC,2CAAwC;AAExC,MAAM,iBAAiB,GAAG,IAAI,gBAAQ,CAGpC,KAAK,CAAC,CAAC;AAEF,KAAK,UAAU,yBAAyB,CAC9C,MAA0B,EAC1B,QAAgB;IAEhB,MAAM,QAAQ,GAAG,GAAG,IAAA,gBAAS,EAAC,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;IACpD,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,SAAS,GAAG,qBAAS,EAAE,CAAC;QACzD,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IAC3E,CAAC;IACD,MAAM,KAAK,GAAG,IAAA,gBAAY,GAAE,CAAC,eAAe,EAAE,CAAC;IAC/C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,IAAA,0BAAmB,EAAC,MAAM,EAAE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,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,IAAA,0BAAmB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;QACjF,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;QACtC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACzB,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClC,IAAI,UAAU;gBAAE,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,MAAM,GAAG;YACd,YAAY,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC;YAChC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;SAClC,CAAC;QACF,iBAAiB,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/B,CAAC,CAAC,CACF,CAAC;IACF,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["// Batch and query helpers for socket Redis logic\nimport { getLibraries } from '../../..';\nimport { kEntityEventSockets, entityKey, EntitySubscription } from './keys';\nimport { LRUCache } from './cache';\nimport { CACHE_TTL } from './constants';\n\nconst subscriptionCache = new LRUCache<\n\tstring,\n\t{ isSubscribed: boolean; instances: string[]; timestamp: number }\n>(10000);\n\nexport async function getEntitySubscriptionInfo(\n\tentity: EntitySubscription,\n\teventKey: string\n): Promise<{ isSubscribed: boolean; instances: string[] }> {\n\tconst cacheKey = `${entityKey(entity)}:${eventKey}`;\n\tconst cached = subscriptionCache.get(cacheKey);\n\tif (cached && Date.now() - cached.timestamp < CACHE_TTL) {\n\t\treturn { isSubscribed: cached.isSubscribed, instances: cached.instances };\n\t}\n\tconst redis = getLibraries().getRedisService();\n\tconst sockets = await redis.getSetMembers(kEntityEventSockets(entity, eventKey));\n\tconst instanceSet = new Set<string>();\n\tfor (const s of sockets) {\n\t\tconst [instanceId] = s.split('|');\n\t\tif (instanceId) instanceSet.add(instanceId);\n\t}\n\tconst result = {\n\t\tisSubscribed: sockets.length > 0,\n\t\tinstances: Array.from(instanceSet),\n\t};\n\tsubscriptionCache.set(cacheKey, { ...result, timestamp: Date.now() });\n\treturn result;\n}\n\nexport async function getEntitySubscriptionInfoBatch(\n\tentities: Array<{ entity: EntitySubscription; eventKey: string }>\n): Promise<Map<string, { isSubscribed: boolean; instances: string[] }>> {\n\tconst redis = getLibraries().getRedisService();\n\tconst results = new Map<string, { isSubscribed: boolean; instances: string[] }>();\n\tconst now = Date.now();\n\tawait Promise.all(\n\t\tentities.map(async ({ entity, eventKey }) => {\n\t\t\tconst cacheKey = `${entityKey(entity)}:${eventKey}`;\n\t\t\tconst cached = subscriptionCache.get(cacheKey);\n\t\t\tif (cached && now - cached.timestamp < CACHE_TTL) {\n\t\t\t\tresults.set(cacheKey, cached);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst sockets = await redis.getSetMembers(kEntityEventSockets(entity, eventKey));\n\t\t\tconst instanceSet = new Set<string>();\n\t\t\tfor (const s of sockets) {\n\t\t\t\tconst [instanceId] = s.split('|');\n\t\t\t\tif (instanceId) instanceSet.add(instanceId);\n\t\t\t}\n\t\t\tconst result = {\n\t\t\t\tisSubscribed: sockets.length > 0,\n\t\t\t\tinstances: Array.from(instanceSet),\n\t\t\t};\n\t\t\tsubscriptionCache.set(cacheKey, { ...result, timestamp: now });\n\t\t\tresults.set(cacheKey, result);\n\t\t})\n\t);\n\treturn results;\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LRUCache = void 0;
|
|
4
|
+
class LRUCache {
|
|
5
|
+
cache = new Map();
|
|
6
|
+
maxSize;
|
|
7
|
+
constructor(maxSize = 10000) {
|
|
8
|
+
this.maxSize = maxSize;
|
|
9
|
+
}
|
|
10
|
+
get(key) {
|
|
11
|
+
const value = this.cache.get(key);
|
|
12
|
+
if (value !== undefined) {
|
|
13
|
+
this.cache.delete(key);
|
|
14
|
+
this.cache.set(key, value);
|
|
15
|
+
}
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
set(key, value) {
|
|
19
|
+
this.cache.delete(key);
|
|
20
|
+
if (this.cache.size >= this.maxSize) {
|
|
21
|
+
const firstKey = this.cache.keys().next().value;
|
|
22
|
+
if (firstKey !== undefined) {
|
|
23
|
+
this.cache.delete(firstKey);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
this.cache.set(key, value);
|
|
27
|
+
}
|
|
28
|
+
delete(key) {
|
|
29
|
+
this.cache.delete(key);
|
|
30
|
+
}
|
|
31
|
+
clear() {
|
|
32
|
+
this.cache.clear();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.LRUCache = LRUCache;
|
|
36
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"/","sources":["libraries/socket/connections/cache.ts"],"names":[],"mappings":";;;AACA,MAAa,QAAQ;IACZ,KAAK,GAAG,IAAI,GAAG,EAAQ,CAAC;IACxB,OAAO,CAAS;IAExB,YAAY,OAAO,GAAG,KAAK;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED,GAAG,CAAC,GAAM;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,GAAG,CAAC,GAAM,EAAE,KAAQ;QACnB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC5B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,GAAM;QACZ,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACD;AAnCD,4BAmCC","sourcesContent":["// LRUCache and cache instances for socket Redis logic\nexport class LRUCache<K, V> {\n\tprivate cache = new Map<K, V>();\n\tprivate maxSize: number;\n\n\tconstructor(maxSize = 10000) {\n\t\tthis.maxSize = maxSize;\n\t}\n\n\tget(key: K): V | undefined {\n\t\tconst value = this.cache.get(key);\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key);\n\t\t\tthis.cache.set(key, value);\n\t\t}\n\t\treturn value;\n\t}\n\n\tset(key: K, value: V): void {\n\t\tthis.cache.delete(key);\n\t\tif (this.cache.size >= this.maxSize) {\n\t\t\tconst firstKey = this.cache.keys().next().value;\n\t\t\tif (firstKey !== undefined) {\n\t\t\t\tthis.cache.delete(firstKey);\n\t\t\t}\n\t\t}\n\t\tthis.cache.set(key, value);\n\t}\n\n\tdelete(key: K): void {\n\t\tthis.cache.delete(key);\n\t}\n\n\tclear(): void {\n\t\tthis.cache.clear();\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"/","sources":["libraries/socket/connections/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,qBAAqB,GAAG,IAAI,CAAC","sourcesContent":["// Constants for socket Redis logic\nexport const CACHE_TTL = 5000;\nexport const REDIS_KEY_TTL_SECONDS = 3600;\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
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("./presence"), exports);
|
|
18
|
+
__exportStar(require("./keys"), exports);
|
|
19
|
+
__exportStar(require("./cache"), exports);
|
|
20
|
+
__exportStar(require("./constants"), exports);
|
|
21
|
+
__exportStar(require("./redis-helpers"), exports);
|
|
22
|
+
__exportStar(require("./subscription"), exports);
|
|
23
|
+
__exportStar(require("./batch"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/socket/connections/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,yCAAuB;AACvB,0CAAwB;AACxB,8CAA4B;AAC5B,kDAAgC;AAChC,iDAA+B;AAC/B,0CAAwB","sourcesContent":["export * from './presence';\nexport * from './keys';\nexport * from './cache';\nexport * from './constants';\nexport * from './redis-helpers';\nexport * from './subscription';\nexport * from './batch';\n"]}
|