@lyxa.ai/core 1.4.312 → 1.4.313-alpha-2
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/llm/interfaces/common-llm-interfaces.d.ts +0 -4
- package/dist/libraries/llm/interfaces/common-llm-interfaces.js.map +1 -1
- package/dist/libraries/llm/llm-provider-service.js +1 -1
- package/dist/libraries/llm/llm-provider-service.js.map +1 -1
- package/dist/libraries/llm/providers/openai-provider.d.ts +0 -4
- package/dist/libraries/llm/providers/openai-provider.js +13 -42
- package/dist/libraries/llm/providers/openai-provider.js.map +1 -1
- package/dist/libraries/map/providers/osrm.js.map +1 -1
- package/dist/libraries/mongo/models/banner.model.d.ts +6 -6
- package/dist/libraries/mongo/models/banner.model.js +6 -6
- package/dist/libraries/mongo/models/banner.model.js.map +1 -1
- package/dist/libraries/mongo/models/cart.model.d.ts +2 -2
- package/dist/libraries/mongo/models/cart.model.js +1 -1
- package/dist/libraries/mongo/models/cart.model.js.map +1 -1
- package/dist/libraries/mongo/models/category.model.d.ts +2 -2
- package/dist/libraries/mongo/models/category.model.js +1 -1
- package/dist/libraries/mongo/models/category.model.js.map +1 -1
- package/dist/libraries/mongo/models/deal-setting.model.d.ts +1 -2
- package/dist/libraries/mongo/models/deal-setting.model.js +1 -2
- package/dist/libraries/mongo/models/deal-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/service-control-product-config.model.d.ts +9 -0
- package/dist/libraries/mongo/models/embedded/service-control-product-config.model.js +52 -0
- package/dist/libraries/mongo/models/embedded/service-control-product-config.model.js.map +1 -0
- package/dist/libraries/mongo/models/featured-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/filter-container.model.d.ts +2 -2
- package/dist/libraries/mongo/models/filter-container.model.js +1 -1
- package/dist/libraries/mongo/models/filter-container.model.js.map +1 -1
- package/dist/libraries/mongo/models/finance-settlement.model.js.map +1 -1
- package/dist/libraries/mongo/models/line-item.model.d.ts +2 -2
- package/dist/libraries/mongo/models/line-item.model.js +1 -1
- package/dist/libraries/mongo/models/line-item.model.js.map +1 -1
- package/dist/libraries/mongo/models/list-container.model.d.ts +2 -2
- package/dist/libraries/mongo/models/list-container.model.js +1 -1
- package/dist/libraries/mongo/models/list-container.model.js.map +1 -1
- package/dist/libraries/mongo/models/order.model.js.map +1 -1
- package/dist/libraries/mongo/models/parent.model.d.ts +2 -2
- package/dist/libraries/mongo/models/parent.model.js +1 -1
- package/dist/libraries/mongo/models/parent.model.js.map +1 -1
- package/dist/libraries/mongo/models/product.model.d.ts +2 -2
- package/dist/libraries/mongo/models/product.model.js +1 -1
- package/dist/libraries/mongo/models/product.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/custom-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/shops-categories-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-control.model.d.ts +11 -2
- package/dist/libraries/mongo/models/service-control.model.js +47 -6
- package/dist/libraries/mongo/models/service-control.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop.model.d.ts +2 -2
- package/dist/libraries/mongo/models/shop.model.js +1 -1
- package/dist/libraries/mongo/models/shop.model.js.map +1 -1
- package/dist/libraries/mongo/models/tag.model.d.ts +2 -2
- package/dist/libraries/mongo/models/tag.model.js +1 -1
- package/dist/libraries/mongo/models/tag.model.js.map +1 -1
- package/dist/libraries/mongo/models/user-app-section-setting.model.d.ts +2 -2
- package/dist/libraries/mongo/models/user-app-section-setting.model.js +1 -1
- package/dist/libraries/mongo/models/user-app-section-setting.model.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/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 +49 -0
- package/dist/types/libraries/index.js +133 -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 +85 -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 +9 -0
- package/dist/types/libraries/mongo/models/deal-setting.model.js +51 -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 +19 -0
- package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.js +78 -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 +9 -0
- package/dist/types/libraries/mongo/models/embedded/rider-setting.model.js +52 -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-control-product-config.model.d.ts +9 -0
- package/dist/types/libraries/mongo/models/embedded/service-control-product-config.model.js +52 -0
- package/dist/types/libraries/mongo/models/embedded/service-control-product-config.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 +40 -0
- package/dist/types/libraries/mongo/models/embedded/service-line-item.model.js +164 -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 +398 -0
- package/dist/types/libraries/mongo/models/index.js +488 -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 +67 -0
- package/dist/types/libraries/mongo/models/order.model.js +355 -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/new-user-discount-marketing.model.d.ts +19 -0
- package/dist/types/libraries/mongo/models/providers/new-user-discount-marketing.model.js +73 -0
- package/dist/types/libraries/mongo/models/providers/new-user-discount-marketing.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 +13 -0
- package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.js +43 -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 +69 -0
- package/dist/types/libraries/mongo/models/service-booking.model.js +315 -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 +17 -0
- package/dist/types/libraries/mongo/models/service-control.model.js +91 -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 +50 -0
- package/dist/types/libraries/mongo/models/setting.model.js +196 -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 +40 -0
- package/dist/types/libraries/mongo/models/user.model.js +155 -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/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/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/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/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/enum.d.ts +9 -0
- package/dist/types/utilities/enum.js +15 -4
- package/dist/types/utilities/enum.js.map +1 -1
- 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/shared/common-methods.d.ts +4 -3
- package/dist/types/utilities/shared/common-methods.js +59 -10
- package/dist/types/utilities/shared/common-methods.js.map +1 -1
- 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/dist/utilities/enum.d.ts +9 -0
- package/dist/utilities/enum.js +15 -4
- package/dist/utilities/enum.js.map +1 -1
- package/dist/utilities/shared/common-methods.d.ts +4 -3
- package/dist/utilities/shared/common-methods.js +59 -10
- package/dist/utilities/shared/common-methods.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebase-fcm.service.js","sourceRoot":"/","sources":["libraries/notification/firebase-fcm.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAA2C;AAC3C,6BAAqC;AACrC,mCAAiC;AACjC,yDAAgD;AAGzC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACb,YAAY,CAAuC;IAEpE;QACC,MAAM,QAAQ,GAAG,IAAA,gBAAY,GAAE,CAAC,kBAAkB,EAAE,CAAC;QACrD,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC;YAC3B,CAAC,6BAAU,CAAC,IAAI,EAAE,IAAA,0BAAS,EAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC9C,CAAC,6BAAU,CAAC,KAAK,EAAE,IAAA,0BAAS,EAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChD,CAAC,6BAAU,CAAC,IAAI,EAAE,IAAA,0BAAS,EAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC9C,CAAC,6BAAU,CAAC,MAAM,EAAE,IAAA,0BAAS,EAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SAClD,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,OAAmB,EAAE,OAAmC;QAChF,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,OAAO,EAAE,CAAC,CAAC;QACzE,OAAO,MAAM,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;CACD,CAAA;AAlBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,gBAAO,GAAE;;GACG,kBAAkB,CAkB9B","sourcesContent":["import { messaging } from 'firebase-admin';\nimport { getLibraries } from '../..';\nimport { Service } from 'typedi';\nimport { FcmProject } from './lyxa-fcm.service';\n\n@Service()\nexport class FirebaseFcmService {\n\tprivate readonly messagingMap: Map<FcmProject, messaging.Messaging>;\n\n\tconstructor() {\n\t\tconst firebase = getLibraries().getFirebaseService();\n\t\tthis.messagingMap = new Map([\n\t\t\t[FcmProject.USER, messaging(firebase.userApp)],\n\t\t\t[FcmProject.RIDER, messaging(firebase.riderApp)],\n\t\t\t[FcmProject.SHOP, messaging(firebase.shopApp)],\n\t\t\t[FcmProject.CPANEL, messaging(firebase.cpanelApp)],\n\t\t]);\n\t}\n\n\tpublic async sendMessage(project: FcmProject, message: messaging.MulticastMessage) {\n\t\tconst m = this.messagingMap.get(project);\n\t\tif (!m) throw new Error(`No messaging instance for project: ${project}`);\n\t\treturn await m.sendEachForMulticast(message);\n\t}\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { messaging } from 'firebase-admin';
|
|
2
|
+
import { FCMNotificationPayload } from './lyxa-fcm.service';
|
|
3
|
+
export declare enum MultiMessageType {
|
|
4
|
+
OLD = "old",
|
|
5
|
+
CONSOLE = "console",
|
|
6
|
+
DEFAULT = "default"
|
|
7
|
+
}
|
|
8
|
+
export interface IFirebaseMessageBuilder {
|
|
9
|
+
buildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage;
|
|
10
|
+
}
|
|
11
|
+
export declare class FirebaseMessageBuilderFactory {
|
|
12
|
+
buildMessage(type: MultiMessageType, payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage;
|
|
13
|
+
}
|
|
14
|
+
export declare class DefaultMessageBuilder implements IFirebaseMessageBuilder {
|
|
15
|
+
buildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage;
|
|
16
|
+
}
|
|
17
|
+
export declare class OldMessageBuilder implements IFirebaseMessageBuilder {
|
|
18
|
+
buildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage;
|
|
19
|
+
}
|
|
20
|
+
export declare class ConsoleMessageBuilder implements IFirebaseMessageBuilder {
|
|
21
|
+
buildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage;
|
|
22
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConsoleMessageBuilder = exports.OldMessageBuilder = exports.DefaultMessageBuilder = exports.FirebaseMessageBuilderFactory = exports.MultiMessageType = void 0;
|
|
4
|
+
var MultiMessageType;
|
|
5
|
+
(function (MultiMessageType) {
|
|
6
|
+
MultiMessageType["OLD"] = "old";
|
|
7
|
+
MultiMessageType["CONSOLE"] = "console";
|
|
8
|
+
MultiMessageType["DEFAULT"] = "default";
|
|
9
|
+
})(MultiMessageType || (exports.MultiMessageType = MultiMessageType = {}));
|
|
10
|
+
class FirebaseMessageBuilderFactory {
|
|
11
|
+
buildMessage(type, payload, tokens) {
|
|
12
|
+
switch (type) {
|
|
13
|
+
case MultiMessageType.CONSOLE:
|
|
14
|
+
return new ConsoleMessageBuilder().buildMessage(payload, tokens);
|
|
15
|
+
case MultiMessageType.OLD:
|
|
16
|
+
return new OldMessageBuilder().buildMessage(payload, tokens);
|
|
17
|
+
default:
|
|
18
|
+
return new DefaultMessageBuilder().buildMessage(payload, tokens);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.FirebaseMessageBuilderFactory = FirebaseMessageBuilderFactory;
|
|
23
|
+
class DefaultMessageBuilder {
|
|
24
|
+
buildMessage(payload, tokens) {
|
|
25
|
+
const isInvisible = payload.invisible === true;
|
|
26
|
+
const channelId = payload.sound ? 'order_alert' : 'default';
|
|
27
|
+
return {
|
|
28
|
+
data: { ...payload.data, channelId: isInvisible ? 'silent' : channelId },
|
|
29
|
+
notification: {
|
|
30
|
+
title: payload.title,
|
|
31
|
+
body: payload.body,
|
|
32
|
+
},
|
|
33
|
+
tokens: tokens,
|
|
34
|
+
android: {
|
|
35
|
+
priority: 'high',
|
|
36
|
+
notification: {
|
|
37
|
+
channelId: 'silent',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
apns: {
|
|
41
|
+
payload: {
|
|
42
|
+
aps: {
|
|
43
|
+
sound: payload.sound || 'default',
|
|
44
|
+
contentAvailable: true,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
headers: {
|
|
48
|
+
'apns-push-type': 'background',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DefaultMessageBuilder = DefaultMessageBuilder;
|
|
55
|
+
class OldMessageBuilder {
|
|
56
|
+
buildMessage(payload, tokens) {
|
|
57
|
+
const isInvisible = payload.invisible === true;
|
|
58
|
+
const message = {
|
|
59
|
+
data: payload.data || {},
|
|
60
|
+
notification: {
|
|
61
|
+
title: payload.title,
|
|
62
|
+
body: payload.body,
|
|
63
|
+
},
|
|
64
|
+
tokens: tokens,
|
|
65
|
+
android: { priority: 'high' },
|
|
66
|
+
apns: {
|
|
67
|
+
payload: {
|
|
68
|
+
aps: {
|
|
69
|
+
sound: payload.sound || 'default',
|
|
70
|
+
contentAvailable: true,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
if (!isInvisible) {
|
|
76
|
+
message.notification = {
|
|
77
|
+
title: payload.title,
|
|
78
|
+
body: payload.body,
|
|
79
|
+
};
|
|
80
|
+
message.android = {
|
|
81
|
+
priority: 'high',
|
|
82
|
+
notification: {
|
|
83
|
+
channelId: payload.sound ? 'android_Push_Notification_Channel_1' : 'default',
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return message;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.OldMessageBuilder = OldMessageBuilder;
|
|
91
|
+
class ConsoleMessageBuilder {
|
|
92
|
+
buildMessage(payload, tokens) {
|
|
93
|
+
const isInvisible = payload.invisible === true;
|
|
94
|
+
const channelId = payload.sound ? 'order_alert' : 'default';
|
|
95
|
+
return {
|
|
96
|
+
data: {
|
|
97
|
+
...payload.data,
|
|
98
|
+
channelId: isInvisible ? 'silent' : channelId,
|
|
99
|
+
notificationTitle: payload.title ?? '',
|
|
100
|
+
notificationBody: payload.body ?? '',
|
|
101
|
+
},
|
|
102
|
+
tokens: tokens,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.ConsoleMessageBuilder = ConsoleMessageBuilder;
|
|
107
|
+
//# sourceMappingURL=firebase-message.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebase-message.builder.js","sourceRoot":"/","sources":["libraries/notification/firebase-message.builder.ts"],"names":[],"mappings":";;;AAGA,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC3B,+BAAW,CAAA;IACX,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;AACpB,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAMD,MAAa,6BAA6B;IAClC,YAAY,CAClB,IAAsB,EACtB,OAA+B,EAC/B,MAAgB;QAEhB,QAAQ,IAAI,EAAE,CAAC;YACd,KAAK,gBAAgB,CAAC,OAAO;gBAC5B,OAAO,IAAI,qBAAqB,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClE,KAAK,gBAAgB,CAAC,GAAG;gBACxB,OAAO,IAAI,iBAAiB,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAG9D;gBACC,OAAO,IAAI,qBAAqB,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACnE,CAAC;IACF,CAAC;CACD;AAjBD,sEAiBC;AAED,MAAa,qBAAqB;IACjC,YAAY,CAAC,OAA+B,EAAE,MAAgB;QAC7D,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC;QAC/C,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;QAE5D,OAAO;YACN,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE;YACxE,YAAY,EAAE;gBACb,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,IAAI,EAAE,OAAO,C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ACD,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CACD;AAtCD,8CAsCC;AAED,MAAa,qBAAqB;IACjC,YAAY,CAAC,OAA+B,EAAE,MAAgB;QAC7D,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC;QAC/C,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5D,OAAO;YACN,IAAI,EAAE;gBACL,GAAG,OAAO,CAAC,IAAI;gBACf,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;gBAC7C,iBAAiB,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;gBACtC,gBAAgB,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE;aACpC;YACD,MAAM,EAAE,MAAM;SACd,CAAC;IACH,CAAC;CACD;AAdD,sDAcC","sourcesContent":["import { messaging } from 'firebase-admin';\nimport { FCMNotificationPayload } from './lyxa-fcm.service';\n\nexport enum MultiMessageType {\n\tOLD = 'old',\n\tCONSOLE = 'console',\n\tDEFAULT = 'default',\n}\n\nexport interface IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage;\n}\n\nexport class FirebaseMessageBuilderFactory {\n\tpublic buildMessage(\n\t\ttype: MultiMessageType,\n\t\tpayload: FCMNotificationPayload,\n\t\ttokens: string[]\n\t): messaging.MulticastMessage {\n\t\tswitch (type) {\n\t\t\tcase MultiMessageType.CONSOLE:\n\t\t\t\treturn new ConsoleMessageBuilder().buildMessage(payload, tokens);\n\t\t\tcase MultiMessageType.OLD:\n\t\t\t\treturn new OldMessageBuilder().buildMessage(payload, tokens);\n\t\t\t// case MultiMessageType.DEFAULT:\n\t\t\t// \treturn new DefaultMessageBuilder().buildMessage(payload, tokens);\n\t\t\tdefault:\n\t\t\t\treturn new DefaultMessageBuilder().buildMessage(payload, tokens);\n\t\t}\n\t}\n}\n\nexport class DefaultMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\tconst isInvisible = payload.invisible === true;\n\t\tconst channelId = payload.sound ? 'order_alert' : 'default';\n\n\t\treturn {\n\t\t\tdata: { ...payload.data, channelId: isInvisible ? 'silent' : channelId },\n\t\t\tnotification: {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t\tandroid: {\n\t\t\t\tpriority: 'high',\n\t\t\t\tnotification: {\n\t\t\t\t\tchannelId: 'silent',\n\t\t\t\t},\n\t\t\t},\n\t\t\tapns: {\n\t\t\t\tpayload: {\n\t\t\t\t\taps: {\n\t\t\t\t\t\tsound: payload.sound || 'default',\n\t\t\t\t\t\tcontentAvailable: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\theaders: {\n\t\t\t\t\t'apns-push-type': 'background',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport class OldMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\tconst isInvisible = payload.invisible === true;\n\n\t\tconst message: messaging.MulticastMessage = {\n\t\t\tdata: payload.data || {},\n\t\t\tnotification: {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t\tandroid: { priority: 'high' },\n\t\t\tapns: {\n\t\t\t\tpayload: {\n\t\t\t\t\taps: {\n\t\t\t\t\t\tsound: payload.sound || 'default',\n\t\t\t\t\t\tcontentAvailable: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\tif (!isInvisible) {\n\t\t\tmessage.notification = {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t};\n\n\t\t\tmessage.android = {\n\t\t\t\tpriority: 'high',\n\t\t\t\tnotification: {\n\t\t\t\t\tchannelId: payload.sound ? 'android_Push_Notification_Channel_1' : 'default',\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn message;\n\t}\n}\n\nexport class ConsoleMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\tconst isInvisible = payload.invisible === true;\n\t\tconst channelId = payload.sound ? 'order_alert' : 'default';\n\t\treturn {\n\t\t\tdata: {\n\t\t\t\t...payload.data,\n\t\t\t\tchannelId: isInvisible ? 'silent' : channelId,\n\t\t\t\tnotificationTitle: payload.title ?? '',\n\t\t\t\tnotificationBody: payload.body ?? '',\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t};\n\t}\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FirebaseFcmService } from './firebase-fcm.service';
|
|
2
|
+
import { FirebaseMessageBuilderFactory, MultiMessageType } from './firebase-message.builder';
|
|
3
|
+
import { FCMNotificationPayload, FcmProject } from './lyxa-fcm.service';
|
|
4
|
+
export interface FcmSendResult {
|
|
5
|
+
failedTokens: string[];
|
|
6
|
+
tokensToDelete: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare class LyxaFcmSender {
|
|
9
|
+
private readonly fcmService;
|
|
10
|
+
private readonly builder;
|
|
11
|
+
static readonly MAX_BATCH = 500;
|
|
12
|
+
private static readonly REMOVABLE_TOKEN_ERROR_CODES;
|
|
13
|
+
constructor(fcmService: FirebaseFcmService, builder: FirebaseMessageBuilderFactory);
|
|
14
|
+
sendMessages(project: FcmProject, type: MultiMessageType, tokens: string[], payload: FCMNotificationPayload): Promise<FcmSendResult>;
|
|
15
|
+
private buildMultiCastMessages;
|
|
16
|
+
private chunkArray;
|
|
17
|
+
private sendToAllTokens;
|
|
18
|
+
private shouldRemoveToken;
|
|
19
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
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 LyxaFcmSender_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.LyxaFcmSender = void 0;
|
|
14
|
+
const typedi_1 = require("typedi");
|
|
15
|
+
const firebase_fcm_service_1 = require("./firebase-fcm.service");
|
|
16
|
+
const firebase_message_builder_1 = require("./firebase-message.builder");
|
|
17
|
+
const __1 = require("../..");
|
|
18
|
+
let LyxaFcmSender = class LyxaFcmSender {
|
|
19
|
+
static { LyxaFcmSender_1 = this; }
|
|
20
|
+
fcmService;
|
|
21
|
+
builder;
|
|
22
|
+
static MAX_BATCH = 500;
|
|
23
|
+
static REMOVABLE_TOKEN_ERROR_CODES = new Set([
|
|
24
|
+
'messaging/registration-token-not-registered',
|
|
25
|
+
'messaging/invalid-registration-token',
|
|
26
|
+
]);
|
|
27
|
+
constructor(fcmService, builder) {
|
|
28
|
+
this.fcmService = fcmService;
|
|
29
|
+
this.builder = builder;
|
|
30
|
+
}
|
|
31
|
+
async sendMessages(project, type, tokens, payload) {
|
|
32
|
+
if (!tokens.length)
|
|
33
|
+
return { failedTokens: [], tokensToDelete: [] };
|
|
34
|
+
const messages = this.buildMultiCastMessages(type, tokens, payload);
|
|
35
|
+
return await this.sendToAllTokens(project, type, payload, messages);
|
|
36
|
+
}
|
|
37
|
+
buildMultiCastMessages(type, tokens, payload) {
|
|
38
|
+
const tokenChunks = this.chunkArray(tokens, LyxaFcmSender_1.MAX_BATCH);
|
|
39
|
+
return tokenChunks.map(chunk => this.builder.buildMessage(type, payload, chunk));
|
|
40
|
+
}
|
|
41
|
+
chunkArray(arr, size) {
|
|
42
|
+
const chunks = [];
|
|
43
|
+
for (let i = 0; i < arr.length; i += size) {
|
|
44
|
+
chunks.push(arr.slice(i, i + size));
|
|
45
|
+
}
|
|
46
|
+
return chunks;
|
|
47
|
+
}
|
|
48
|
+
async sendToAllTokens(project, type, payload, messages) {
|
|
49
|
+
const logger = (0, __1.getLibraries)().getLoggerKit();
|
|
50
|
+
const failedTokens = [];
|
|
51
|
+
const tokensToDelete = [];
|
|
52
|
+
await Promise.all(messages.map(async (message) => {
|
|
53
|
+
let logData;
|
|
54
|
+
try {
|
|
55
|
+
const result = await this.fcmService.sendMessage(project, message);
|
|
56
|
+
const payloadKnownValid = result.successCount > 0;
|
|
57
|
+
result.responses.forEach((r, i) => {
|
|
58
|
+
if (r.success)
|
|
59
|
+
return;
|
|
60
|
+
failedTokens.push(message.tokens[i]);
|
|
61
|
+
if (this.shouldRemoveToken(r.error?.code, payloadKnownValid)) {
|
|
62
|
+
tokensToDelete.push(message.tokens[i]);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
logData = {
|
|
66
|
+
timestamp: new Date().toISOString(),
|
|
67
|
+
project,
|
|
68
|
+
type,
|
|
69
|
+
consoleNotification: type === firebase_message_builder_1.MultiMessageType.CONSOLE,
|
|
70
|
+
groupTokens: message.tokens,
|
|
71
|
+
groupPayload: payload,
|
|
72
|
+
message,
|
|
73
|
+
response: {
|
|
74
|
+
successCount: result.successCount,
|
|
75
|
+
failureCount: result.failureCount,
|
|
76
|
+
responses: result.responses.map((r, i) => ({
|
|
77
|
+
token: message.tokens[i],
|
|
78
|
+
success: r.success,
|
|
79
|
+
...(r.error && {
|
|
80
|
+
errorCode: r.error.code,
|
|
81
|
+
errorMessage: r.error.message,
|
|
82
|
+
willDelete: this.shouldRemoveToken(r.error.code, payloadKnownValid),
|
|
83
|
+
}),
|
|
84
|
+
})),
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
logger.info('Called Firebase function sendEachForMulticast', {
|
|
88
|
+
tag: 'notification.attempted.new',
|
|
89
|
+
data: logData,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
failedTokens.push(...message.tokens);
|
|
94
|
+
logData = {
|
|
95
|
+
timestamp: new Date().toISOString(),
|
|
96
|
+
project,
|
|
97
|
+
type,
|
|
98
|
+
consoleNotification: type === firebase_message_builder_1.MultiMessageType.CONSOLE,
|
|
99
|
+
groupTokens: message.tokens,
|
|
100
|
+
groupPayload: payload,
|
|
101
|
+
message,
|
|
102
|
+
};
|
|
103
|
+
logger.error('Called Firebase function sendEachForMulticast', err, {
|
|
104
|
+
tag: 'notification.attempted.new',
|
|
105
|
+
data: logData,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}));
|
|
109
|
+
return { failedTokens, tokensToDelete };
|
|
110
|
+
}
|
|
111
|
+
shouldRemoveToken(errorCode, payloadKnownValid) {
|
|
112
|
+
if (!errorCode)
|
|
113
|
+
return false;
|
|
114
|
+
if (LyxaFcmSender_1.REMOVABLE_TOKEN_ERROR_CODES.has(errorCode))
|
|
115
|
+
return true;
|
|
116
|
+
if (errorCode === 'messaging/invalid-argument')
|
|
117
|
+
return payloadKnownValid;
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
exports.LyxaFcmSender = LyxaFcmSender;
|
|
122
|
+
exports.LyxaFcmSender = LyxaFcmSender = LyxaFcmSender_1 = __decorate([
|
|
123
|
+
(0, typedi_1.Service)(),
|
|
124
|
+
__metadata("design:paramtypes", [firebase_fcm_service_1.FirebaseFcmService,
|
|
125
|
+
firebase_message_builder_1.FirebaseMessageBuilderFactory])
|
|
126
|
+
], LyxaFcmSender);
|
|
127
|
+
//# sourceMappingURL=lyxa-fcm-sender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lyxa-fcm-sender.js","sourceRoot":"/","sources":["libraries/notification/lyxa-fcm-sender.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAiC;AACjC,iEAA4D;AAC5D,yEAA6F;AAG7F,6BAAqC;AAU9B,IAAM,aAAa,GAAnB,MAAM,aAAa;;IAsBP;IACA;IAtBX,MAAM,CAAU,SAAS,GAAG,GAAG,CAAC;IAa/B,MAAM,CAAU,2BAA2B,GAAwB,IAAI,GAAG,CAAC;QAElF,6CAA6C;QAE7C,sCAAsC;KACtC,CAAC,CAAC;IAEH,YACkB,UAA8B,EAC9B,OAAsC;QADtC,eAAU,GAAV,UAAU,CAAoB;QAC9B,YAAO,GAAP,OAAO,CAA+B;IACrD,CAAC;IAQG,KAAK,CAAC,YAAY,CACxB,OAAmB,EACnB,IAAsB,EACtB,MAAgB,EAChB,OAA+B;QAE/B,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;QACpE,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QACpE,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACrE,CAAC;IAEO,sBAAsB,CAC7B,IAAsB,EACtB,MAAgB,EAChB,OAA+B;QAE/B,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,eAAa,CAAC,SAAS,CAAC,CAAC;QACrE,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC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AI,EAAE,CAAC,WAAW,EAAE;oBACnC,OAAO;oBACP,IAAI;oBACJ,mBAAmB,EAAE,IAAI,KAAK,2CAAgB,CAAC,OAAO;oBACtD,WAAW,EAAE,OAAO,CAAC,MAAM;oBAC3B,YAAY,EAAE,OAAO;oBACrB,OAAO;iBACP,CAAC;gBACF,MAAM,CAAC,KAAK,CAAC,+CAA+C,EAAE,GAAG,EAAE;oBAClE,GAAG,EAAE,4BAA4B;oBACjC,IAAI,EAAE,OAAO;iBACb,CAAC,CAAC;YACJ,CAAC;QACF,CAAC,CAAC,CACF,CAAC;QAEF,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;IACzC,CAAC;IAcO,iBAAiB,CAAC,SAA6B,EAAE,iBAA0B;QAClF,IAAI,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAC7B,IAAI,eAAa,CAAC,2BAA2B,CAAC,GAAG,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAC1E,IAAI,SAAS,KAAK,4BAA4B;YAAE,OAAO,iBAAiB,CAAC;QACzE,OAAO,KAAK,CAAC;IACd,CAAC;;AA/JW,sCAAa;wBAAb,aAAa;IADzB,IAAA,gBAAO,GAAE;qCAuBqB,yCAAkB;QACrB,wDAA6B;GAvB5C,aAAa,CAgKzB","sourcesContent":["import { Service } from 'typedi';\nimport { FirebaseFcmService } from './firebase-fcm.service';\nimport { FirebaseMessageBuilderFactory, MultiMessageType } from './firebase-message.builder';\nimport { messaging } from 'firebase-admin';\nimport { FCMNotificationPayload, FcmProject } from './lyxa-fcm.service';\nimport { getLibraries } from '../..';\n\nexport interface FcmSendResult {\n\t/** Every token that failed to receive the message, for any reason. */\n\tfailedTokens: string[];\n\t/** Subset of failedTokens that are confirmed invalid and must be deleted. */\n\ttokensToDelete: string[];\n}\n\n@Service()\nexport class LyxaFcmSender {\n\tpublic static readonly MAX_BATCH = 500;\n\n\t/**\n\t * FCM error codes that unambiguously mean the registration token itself is\n\t * malformed or no longer registered, so it will never be valid again and is\n\t * safe to delete from our records.\n\t *\n\t * Everything else (server/internal errors, rate limits, auth/credential\n\t * issues, transport failures) is transient and must NOT cause deletion.\n\t *\n\t * @see https://firebase.google.com/docs/cloud-messaging/manage-tokens#ensuring-registration-token-freshness\n\t * @see https://firebase.google.com/docs/cloud-messaging/manage-tokens\n\t */\n\tprivate static readonly REMOVABLE_TOKEN_ERROR_CODES: ReadonlySet<string> = new Set([\n\t\t// UNREGISTERED (404): token was unregistered (app uninstalled / token refreshed).\n\t\t'messaging/registration-token-not-registered',\n\t\t// Token is not a valid FCM registration token (wrong format).\n\t\t'messaging/invalid-registration-token',\n\t]);\n\n\tconstructor(\n\t\tprivate readonly fcmService: FirebaseFcmService,\n\t\tprivate readonly builder: FirebaseMessageBuilderFactory\n\t) {}\n\n\t/**\n\t * Sends notifications and reports the outcome. `failedTokens` contains every\n\t * failure; `tokensToDelete` is the subset that is confirmed invalid and must\n\t * be removed from our records. Transient failures stay out of\n\t * `tokensToDelete` so they never trigger token deletion.\n\t */\n\tpublic async sendMessages(\n\t\tproject: FcmProject,\n\t\ttype: MultiMessageType,\n\t\ttokens: string[],\n\t\tpayload: FCMNotificationPayload\n\t): Promise<FcmSendResult> {\n\t\tif (!tokens.length) return { failedTokens: [], tokensToDelete: [] };\n\t\tconst messages = this.buildMultiCastMessages(type, tokens, payload);\n\t\treturn await this.sendToAllTokens(project, type, payload, messages);\n\t}\n\n\tprivate buildMultiCastMessages(\n\t\ttype: MultiMessageType,\n\t\ttokens: string[],\n\t\tpayload: FCMNotificationPayload\n\t): messaging.MulticastMessage[] {\n\t\tconst tokenChunks = this.chunkArray(tokens, LyxaFcmSender.MAX_BATCH);\n\t\treturn tokenChunks.map(chunk => this.builder.buildMessage(type, payload, chunk));\n\t}\n\n\tprivate chunkArray<T>(arr: T[], size: number): T[][] {\n\t\tconst chunks: T[][] = [];\n\t\tfor (let i = 0; i < arr.length; i += size) {\n\t\t\tchunks.push(arr.slice(i, i + size));\n\t\t}\n\t\treturn chunks;\n\t}\n\n\tprivate async sendToAllTokens(\n\t\tproject: FcmProject,\n\t\ttype: MultiMessageType,\n\t\tpayload: FCMNotificationPayload,\n\t\tmessages: messaging.MulticastMessage[]\n\t): Promise<FcmSendResult> {\n\t\tconst logger = getLibraries().getLoggerKit();\n\t\tconst failedTokens: string[] = [];\n\t\tconst tokensToDelete: string[] = [];\n\n\t\tawait Promise.all(\n\t\t\tmessages.map(async message => {\n\t\t\t\tlet logData: Record<string, unknown>;\n\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await this.fcmService.sendMessage(project, message);\n\n\t\t\t\t\t// A sibling token succeeding with the identical payload proves the\n\t\t\t\t\t// payload is valid, which is required before treating an\n\t\t\t\t\t// INVALID_ARGUMENT error as a bad token (see shouldRemoveToken).\n\t\t\t\t\tconst payloadKnownValid = result.successCount > 0;\n\n\t\t\t\t\tresult.responses.forEach((r, i) => {\n\t\t\t\t\t\tif (r.success) return;\n\t\t\t\t\t\tfailedTokens.push(message.tokens[i]);\n\t\t\t\t\t\tif (this.shouldRemoveToken(r.error?.code, payloadKnownValid)) {\n\t\t\t\t\t\t\ttokensToDelete.push(message.tokens[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tlogData = {\n\t\t\t\t\t\ttimestamp: new Date().toISOString(),\n\t\t\t\t\t\tproject,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tconsoleNotification: type === MultiMessageType.CONSOLE,\n\t\t\t\t\t\tgroupTokens: message.tokens,\n\t\t\t\t\t\tgroupPayload: payload,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tsuccessCount: result.successCount,\n\t\t\t\t\t\t\tfailureCount: result.failureCount,\n\t\t\t\t\t\t\tresponses: result.responses.map((r, i) => ({\n\t\t\t\t\t\t\t\ttoken: message.tokens[i],\n\t\t\t\t\t\t\t\tsuccess: r.success,\n\t\t\t\t\t\t\t\t...(r.error && {\n\t\t\t\t\t\t\t\t\terrorCode: r.error.code,\n\t\t\t\t\t\t\t\t\terrorMessage: r.error.message,\n\t\t\t\t\t\t\t\t\twillDelete: this.shouldRemoveToken(r.error.code, payloadKnownValid),\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tlogger.info('Called Firebase function sendEachForMulticast', {\n\t\t\t\t\t\ttag: 'notification.attempted.new',\n\t\t\t\t\t\tdata: logData,\n\t\t\t\t\t});\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// The whole batch send threw (transport/auth/infra failure), not a\n\t\t\t\t\t// per-token rejection. They count as failed, but are not proven\n\t\t\t\t\t// invalid, so they must not be deleted.\n\t\t\t\t\tfailedTokens.push(...message.tokens);\n\n\t\t\t\t\tlogData = {\n\t\t\t\t\t\ttimestamp: new Date().toISOString(),\n\t\t\t\t\t\tproject,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tconsoleNotification: type === MultiMessageType.CONSOLE,\n\t\t\t\t\t\tgroupTokens: message.tokens,\n\t\t\t\t\t\tgroupPayload: payload,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t};\n\t\t\t\t\tlogger.error('Called Firebase function sendEachForMulticast', err, {\n\t\t\t\t\t\ttag: 'notification.attempted.new',\n\t\t\t\t\t\tdata: logData,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\treturn { failedTokens, tokensToDelete };\n\t}\n\n\t/**\n\t * Decides whether a per-token FCM failure means the token should be removed.\n\t *\n\t * Only the codes in {@link LyxaFcmSender.REMOVABLE_TOKEN_ERROR_CODES} are\n\t * unconditionally removable. `messaging/invalid-argument` (INVALID_ARGUMENT)\n\t * is special: Firebase notes it \"can also be returned in cases of issues in\n\t * the message payload, so it signals an invalid token only if the payload is\n\t * completely valid.\" We therefore only remove on it when we know the payload\n\t * was valid (a sibling token in the same batch succeeded).\n\t *\n\t * @see https://firebase.google.com/docs/cloud-messaging/manage-tokens\n\t */\n\tprivate shouldRemoveToken(errorCode: string | undefined, payloadKnownValid: boolean): boolean {\n\t\tif (!errorCode) return false;\n\t\tif (LyxaFcmSender.REMOVABLE_TOKEN_ERROR_CODES.has(errorCode)) return true;\n\t\tif (errorCode === 'messaging/invalid-argument') return payloadKnownValid;\n\t\treturn false;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AppPlatform, NotificationAccountType } from '../../utilities/enum';
|
|
2
|
+
import { FcmSendResult, LyxaFcmSender } from './lyxa-fcm-sender';
|
|
3
|
+
export declare enum FcmProject {
|
|
4
|
+
USER = "fcm.service.user",
|
|
5
|
+
RIDER = "fcm.service.rider",
|
|
6
|
+
SHOP = "fcm.service.shop",
|
|
7
|
+
CPANEL = "fcm.service.cpanel"
|
|
8
|
+
}
|
|
9
|
+
export interface FCMNotificationPayload {
|
|
10
|
+
title?: string;
|
|
11
|
+
body?: string;
|
|
12
|
+
data?: Record<string, string>;
|
|
13
|
+
sound?: string;
|
|
14
|
+
invisible?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface NotificationTokenTarget {
|
|
17
|
+
token: string;
|
|
18
|
+
entityType: NotificationAccountType;
|
|
19
|
+
deviceId?: string;
|
|
20
|
+
entityId?: string;
|
|
21
|
+
platform?: AppPlatform;
|
|
22
|
+
appVersion?: string;
|
|
23
|
+
}
|
|
24
|
+
export type LyxaTokens = {
|
|
25
|
+
oldTokens: string[];
|
|
26
|
+
newTokens: string[];
|
|
27
|
+
consoleTokens: string[];
|
|
28
|
+
};
|
|
29
|
+
export declare class LyxaFcmService {
|
|
30
|
+
private readonly lyxaFcmSender;
|
|
31
|
+
constructor(lyxaFcmSender: LyxaFcmSender);
|
|
32
|
+
private deduplicateTargets;
|
|
33
|
+
private separateTokens;
|
|
34
|
+
static getProjectForAccountType(accountType: NotificationAccountType): FcmProject;
|
|
35
|
+
sendToTokens(project: FcmProject, payload: FCMNotificationPayload, targets: NotificationTokenTarget[]): Promise<FcmSendResult>;
|
|
36
|
+
private isNotifiableEntityType;
|
|
37
|
+
private isConsoleEntityType;
|
|
38
|
+
private compareVersions;
|
|
39
|
+
private shouldUseNewStructure;
|
|
40
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
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.LyxaFcmService = exports.FcmProject = void 0;
|
|
13
|
+
const typedi_1 = require("typedi");
|
|
14
|
+
const firebase_message_builder_1 = require("./firebase-message.builder");
|
|
15
|
+
const enum_1 = require("../../utilities/enum");
|
|
16
|
+
const lyxa_fcm_sender_1 = require("./lyxa-fcm-sender");
|
|
17
|
+
const __1 = require("../..");
|
|
18
|
+
var FcmProject;
|
|
19
|
+
(function (FcmProject) {
|
|
20
|
+
FcmProject["USER"] = "fcm.service.user";
|
|
21
|
+
FcmProject["RIDER"] = "fcm.service.rider";
|
|
22
|
+
FcmProject["SHOP"] = "fcm.service.shop";
|
|
23
|
+
FcmProject["CPANEL"] = "fcm.service.cpanel";
|
|
24
|
+
})(FcmProject || (exports.FcmProject = FcmProject = {}));
|
|
25
|
+
const NotificationVersionRules = {
|
|
26
|
+
[enum_1.NotificationAccountType.RIDER]: {
|
|
27
|
+
[enum_1.AppPlatform.IOS]: '2.0.3',
|
|
28
|
+
[enum_1.AppPlatform.ANDROID]: '2.0.4',
|
|
29
|
+
},
|
|
30
|
+
[enum_1.NotificationAccountType.USER]: {
|
|
31
|
+
[enum_1.AppPlatform.IOS]: '2.0.3',
|
|
32
|
+
[enum_1.AppPlatform.ANDROID]: '2.0.3',
|
|
33
|
+
},
|
|
34
|
+
[enum_1.NotificationAccountType.SHOP]: {
|
|
35
|
+
[enum_1.AppPlatform.IOS]: '2.0.3',
|
|
36
|
+
[enum_1.AppPlatform.ANDROID]: '2.0.3',
|
|
37
|
+
},
|
|
38
|
+
[enum_1.NotificationAccountType.PROFESSIONAL]: {
|
|
39
|
+
[enum_1.AppPlatform.IOS]: '2.0.3',
|
|
40
|
+
[enum_1.AppPlatform.ANDROID]: '2.0.3',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
let LyxaFcmService = class LyxaFcmService {
|
|
44
|
+
lyxaFcmSender;
|
|
45
|
+
constructor(lyxaFcmSender) {
|
|
46
|
+
this.lyxaFcmSender = lyxaFcmSender;
|
|
47
|
+
}
|
|
48
|
+
deduplicateTargets(targets) {
|
|
49
|
+
const sorted = targets.slice().sort((a, b) => {
|
|
50
|
+
if (a.token !== b.token)
|
|
51
|
+
return a.token < b.token ? -1 : 1;
|
|
52
|
+
if (!a.appVersion && !b.appVersion)
|
|
53
|
+
return 0;
|
|
54
|
+
if (!a.appVersion)
|
|
55
|
+
return 1;
|
|
56
|
+
if (!b.appVersion)
|
|
57
|
+
return -1;
|
|
58
|
+
return this.compareVersions(b.appVersion, a.appVersion);
|
|
59
|
+
});
|
|
60
|
+
return sorted.filter((t, i) => i === 0 || t.token !== sorted[i - 1].token);
|
|
61
|
+
}
|
|
62
|
+
separateTokens(targets) {
|
|
63
|
+
const oldTokens = [];
|
|
64
|
+
const newTokens = [];
|
|
65
|
+
const consoleTokens = [];
|
|
66
|
+
for (const t of targets) {
|
|
67
|
+
if (this.isConsoleEntityType(t.entityType)) {
|
|
68
|
+
consoleTokens.push(t.token);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const useNew = this.shouldUseNewStructure(t.entityType, t.platform, t.appVersion);
|
|
72
|
+
if (useNew)
|
|
73
|
+
newTokens.push(t.token);
|
|
74
|
+
else
|
|
75
|
+
oldTokens.push(t.token);
|
|
76
|
+
}
|
|
77
|
+
if (true) {
|
|
78
|
+
(0, __1.getLibraries)()
|
|
79
|
+
.getLoggerKit()
|
|
80
|
+
.debug('FCM token separation', {
|
|
81
|
+
tag: 'notification.token.separated',
|
|
82
|
+
data: {
|
|
83
|
+
totalTargets: targets.length,
|
|
84
|
+
buckets: {
|
|
85
|
+
old: oldTokens.length,
|
|
86
|
+
new: newTokens.length,
|
|
87
|
+
console: consoleTokens.length,
|
|
88
|
+
},
|
|
89
|
+
targets: targets.map(t => ({
|
|
90
|
+
entityId: t.entityId,
|
|
91
|
+
entityType: t.entityType,
|
|
92
|
+
platform: t.platform,
|
|
93
|
+
appVersion: t.appVersion,
|
|
94
|
+
bucket: this.isConsoleEntityType(t.entityType)
|
|
95
|
+
? 'console'
|
|
96
|
+
: this.shouldUseNewStructure(t.entityType, t.platform, t.appVersion)
|
|
97
|
+
? 'new'
|
|
98
|
+
: 'old',
|
|
99
|
+
})),
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
oldTokens,
|
|
105
|
+
newTokens,
|
|
106
|
+
consoleTokens,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
static getProjectForAccountType(accountType) {
|
|
110
|
+
switch (accountType) {
|
|
111
|
+
case enum_1.NotificationAccountType.USER:
|
|
112
|
+
return FcmProject.USER;
|
|
113
|
+
case enum_1.NotificationAccountType.SHOP:
|
|
114
|
+
case enum_1.NotificationAccountType.PROFESSIONAL:
|
|
115
|
+
return FcmProject.SHOP;
|
|
116
|
+
case enum_1.NotificationAccountType.RIDER:
|
|
117
|
+
return FcmProject.RIDER;
|
|
118
|
+
default:
|
|
119
|
+
return FcmProject.USER;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async sendToTokens(project, payload, targets) {
|
|
123
|
+
if (!targets.length)
|
|
124
|
+
return { failedTokens: [], tokensToDelete: [] };
|
|
125
|
+
console.log('targets', targets);
|
|
126
|
+
const cleanedTargets = this.deduplicateTargets(targets);
|
|
127
|
+
console.log('cleanedTargets', cleanedTargets);
|
|
128
|
+
const tokens = this.separateTokens(cleanedTargets);
|
|
129
|
+
const results = await Promise.all([
|
|
130
|
+
this.lyxaFcmSender.sendMessages(project, firebase_message_builder_1.MultiMessageType.OLD, tokens.oldTokens, payload),
|
|
131
|
+
this.lyxaFcmSender.sendMessages(project, firebase_message_builder_1.MultiMessageType.DEFAULT, tokens.newTokens, payload),
|
|
132
|
+
this.lyxaFcmSender.sendMessages(FcmProject.CPANEL, firebase_message_builder_1.MultiMessageType.CONSOLE, tokens.consoleTokens, payload),
|
|
133
|
+
]);
|
|
134
|
+
return {
|
|
135
|
+
failedTokens: results.flatMap(r => r.failedTokens),
|
|
136
|
+
tokensToDelete: results.flatMap(r => r.tokensToDelete),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
isNotifiableEntityType(type) {
|
|
140
|
+
return (type === enum_1.NotificationAccountType.USER ||
|
|
141
|
+
type === enum_1.NotificationAccountType.RIDER ||
|
|
142
|
+
type === enum_1.NotificationAccountType.SHOP ||
|
|
143
|
+
type === enum_1.NotificationAccountType.PROFESSIONAL);
|
|
144
|
+
}
|
|
145
|
+
isConsoleEntityType(type) {
|
|
146
|
+
return (type === enum_1.NotificationAccountType.SHOP_CONSOLE ||
|
|
147
|
+
type === enum_1.NotificationAccountType.PARENT ||
|
|
148
|
+
type === enum_1.NotificationAccountType.VENDOR ||
|
|
149
|
+
type === enum_1.NotificationAccountType.VENDOR_PARENT);
|
|
150
|
+
}
|
|
151
|
+
compareVersions(v1, v2) {
|
|
152
|
+
const a = v1.split('.').map(Number);
|
|
153
|
+
const b = v2.split('.').map(Number);
|
|
154
|
+
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
|
155
|
+
const diff = (a[i] || 0) - (b[i] || 0);
|
|
156
|
+
if (diff !== 0)
|
|
157
|
+
return diff;
|
|
158
|
+
}
|
|
159
|
+
return 0;
|
|
160
|
+
}
|
|
161
|
+
shouldUseNewStructure(entityType, platform, version) {
|
|
162
|
+
if (!this.isNotifiableEntityType(entityType))
|
|
163
|
+
return false;
|
|
164
|
+
if (!platform || !version)
|
|
165
|
+
return false;
|
|
166
|
+
const minVersion = NotificationVersionRules?.[entityType]?.[platform];
|
|
167
|
+
if (!minVersion)
|
|
168
|
+
return false;
|
|
169
|
+
return this.compareVersions(version, minVersion) >= 0;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
exports.LyxaFcmService = LyxaFcmService;
|
|
173
|
+
exports.LyxaFcmService = LyxaFcmService = __decorate([
|
|
174
|
+
(0, typedi_1.Service)(),
|
|
175
|
+
__metadata("design:paramtypes", [lyxa_fcm_sender_1.LyxaFcmSender])
|
|
176
|
+
], LyxaFcmService);
|
|
177
|
+
//# sourceMappingURL=lyxa-fcm.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lyxa-fcm.service.js","sourceRoot":"/","sources":["libraries/notification/lyxa-fcm.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAiC;AACjC,yEAA8D;AAC9D,+CAA4E;AAC5E,uDAAiE;AACjE,6BAAqC;AAErC,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,uCAAyB,CAAA;IACzB,yCAA2B,CAAA;IAC3B,uCAAyB,CAAA;IACzB,2CAA6B,CAAA;AAC9B,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAyBD,MAAM,wBAAwB,GAAuE;IACpG,CAAC,8BAAuB,CAAC,KAAK,CAA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esContent":["import { Service } from 'typedi';\nimport { MultiMessageType } from './firebase-message.builder';\nimport { AppPlatform, NotificationAccountType } from '../../utilities/enum';\nimport { FcmSendResult, LyxaFcmSender } from './lyxa-fcm-sender';\nimport { getLibraries } from '../..';\n\nexport enum FcmProject {\n\tUSER = 'fcm.service.user',\n\tRIDER = 'fcm.service.rider',\n\tSHOP = 'fcm.service.shop',\n\tCPANEL = 'fcm.service.cpanel',\n}\n\nexport interface FCMNotificationPayload {\n\ttitle?: string;\n\tbody?: string;\n\tdata?: Record<string, string>;\n\tsound?: string;\n\tinvisible?: boolean;\n}\n\nexport interface NotificationTokenTarget {\n\ttoken: string;\n\tentityType: NotificationAccountType;\n\tdeviceId?: string;\n\tentityId?: string;\n\tplatform?: AppPlatform;\n\tappVersion?: string;\n}\n\ntype NotifiableEntityType =\n\t| NotificationAccountType.USER\n\t| NotificationAccountType.SHOP\n\t| NotificationAccountType.RIDER\n\t| NotificationAccountType.PROFESSIONAL;\n\nconst NotificationVersionRules: Record<NotifiableEntityType, Partial<Record<AppPlatform, string>>> = {\n\t[NotificationAccountType.RIDER]: {\n\t\t[AppPlatform.IOS]: '2.0.3',\n\t\t[AppPlatform.ANDROID]: '2.0.4',\n\t},\n\n\t[NotificationAccountType.USER]: {\n\t\t[AppPlatform.IOS]: '2.0.3',\n\t\t[AppPlatform.ANDROID]: '2.0.3',\n\t},\n\n\t[NotificationAccountType.SHOP]: {\n\t\t[AppPlatform.IOS]: '2.0.3',\n\t\t[AppPlatform.ANDROID]: '2.0.3',\n\t},\n\n\t[NotificationAccountType.PROFESSIONAL]: {\n\t\t[AppPlatform.IOS]: '2.0.3',\n\t\t[AppPlatform.ANDROID]: '2.0.3',\n\t},\n};\n\nexport type LyxaTokens = {\n\toldTokens: string[];\n\tnewTokens: string[];\n\tconsoleTokens: string[];\n};\n\n@Service()\nexport class LyxaFcmService {\n\tconstructor(private readonly lyxaFcmSender: LyxaFcmSender) {}\n\n\tprivate deduplicateTargets(targets: NotificationTokenTarget[]): NotificationTokenTarget[] {\n\t\tconst sorted = targets.slice().sort((a, b) => {\n\t\t\tif (a.token !== b.token) return a.token < b.token ? -1 : 1;\n\t\t\tif (!a.appVersion && !b.appVersion) return 0;\n\t\t\tif (!a.appVersion) return 1;\n\t\t\tif (!b.appVersion) return -1;\n\t\t\treturn this.compareVersions(b.appVersion, a.appVersion);\n\t\t});\n\t\treturn sorted.filter((t, i) => i === 0 || t.token !== sorted[i - 1].token);\n\t}\n\n\tprivate separateTokens(targets: NotificationTokenTarget[]): LyxaTokens {\n\t\tconst oldTokens: string[] = [];\n\t\tconst newTokens: string[] = [];\n\t\tconst consoleTokens: string[] = [];\n\n\t\tfor (const t of targets) {\n\t\t\tif (this.isConsoleEntityType(t.entityType)) {\n\t\t\t\tconsoleTokens.push(t.token);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst useNew = this.shouldUseNewStructure(t.entityType, t.platform, t.appVersion);\n\n\t\t\tif (useNew) newTokens.push(t.token);\n\t\t\telse oldTokens.push(t.token);\n\t\t}\n\n\t\tif (true) {\n\t\t\tgetLibraries()\n\t\t\t\t.getLoggerKit()\n\t\t\t\t.debug('FCM token separation', {\n\t\t\t\t\ttag: 'notification.token.separated',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\ttotalTargets: targets.length,\n\t\t\t\t\t\tbuckets: {\n\t\t\t\t\t\t\told: oldTokens.length,\n\t\t\t\t\t\t\tnew: newTokens.length,\n\t\t\t\t\t\t\tconsole: consoleTokens.length,\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttargets: targets.map(t => ({\n\t\t\t\t\t\t\tentityId: t.entityId,\n\t\t\t\t\t\t\tentityType: t.entityType,\n\t\t\t\t\t\t\tplatform: t.platform,\n\t\t\t\t\t\t\tappVersion: t.appVersion,\n\t\t\t\t\t\t\tbucket: this.isConsoleEntityType(t.entityType)\n\t\t\t\t\t\t\t\t? 'console'\n\t\t\t\t\t\t\t\t: this.shouldUseNewStructure(t.entityType, t.platform, t.appVersion)\n\t\t\t\t\t\t\t\t\t? 'new'\n\t\t\t\t\t\t\t\t\t: 'old',\n\t\t\t\t\t\t})),\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\toldTokens,\n\t\t\tnewTokens,\n\t\t\tconsoleTokens,\n\t\t};\n\t}\n\n\tpublic static getProjectForAccountType(accountType: NotificationAccountType): FcmProject {\n\t\tswitch (accountType) {\n\t\t\tcase NotificationAccountType.USER:\n\t\t\t\treturn FcmProject.USER;\n\t\t\tcase NotificationAccountType.SHOP:\n\t\t\tcase NotificationAccountType.PROFESSIONAL:\n\t\t\t\treturn FcmProject.SHOP;\n\t\t\tcase NotificationAccountType.RIDER:\n\t\t\t\treturn FcmProject.RIDER;\n\t\t\tdefault:\n\t\t\t\treturn FcmProject.USER;\n\t\t}\n\t}\n\n\tpublic async sendToTokens(\n\t\tproject: FcmProject,\n\t\tpayload: FCMNotificationPayload,\n\t\ttargets: NotificationTokenTarget[]\n\t): Promise<FcmSendResult> {\n\t\tif (!targets.length) return { failedTokens: [], tokensToDelete: [] };\n\t\tconsole.log('targets', targets);\n\t\tconst cleanedTargets = this.deduplicateTargets(targets);\n\t\tconsole.log('cleanedTargets', cleanedTargets);\n\t\tconst tokens = this.separateTokens(cleanedTargets);\n\n\t\tconst results = await Promise.all([\n\t\t\tthis.lyxaFcmSender.sendMessages(project, MultiMessageType.OLD, tokens.oldTokens, payload),\n\t\t\tthis.lyxaFcmSender.sendMessages(project, MultiMessageType.DEFAULT, tokens.newTokens, payload),\n\t\t\tthis.lyxaFcmSender.sendMessages(\n\t\t\t\tFcmProject.CPANEL,\n\t\t\t\tMultiMessageType.CONSOLE,\n\t\t\t\ttokens.consoleTokens,\n\t\t\t\tpayload\n\t\t\t),\n\t\t]);\n\n\t\treturn {\n\t\t\tfailedTokens: results.flatMap(r => r.failedTokens),\n\t\t\ttokensToDelete: results.flatMap(r => r.tokensToDelete),\n\t\t};\n\t}\n\n\tprivate isNotifiableEntityType(type: NotificationAccountType): type is NotifiableEntityType {\n\t\treturn (\n\t\t\ttype === NotificationAccountType.USER ||\n\t\t\ttype === NotificationAccountType.RIDER ||\n\t\t\ttype === NotificationAccountType.SHOP ||\n\t\t\ttype === NotificationAccountType.PROFESSIONAL\n\t\t);\n\t}\n\n\tprivate isConsoleEntityType(type: NotificationAccountType): type is NotifiableEntityType {\n\t\treturn (\n\t\t\ttype === NotificationAccountType.SHOP_CONSOLE ||\n\t\t\ttype === NotificationAccountType.PARENT ||\n\t\t\ttype === NotificationAccountType.VENDOR ||\n\t\t\ttype === NotificationAccountType.VENDOR_PARENT\n\t\t);\n\t}\n\n\tprivate compareVersions(v1: string, v2: string): number {\n\t\tconst a = v1.split('.').map(Number);\n\t\tconst b = v2.split('.').map(Number);\n\n\t\tfor (let i = 0; i < Math.max(a.length, b.length); i++) {\n\t\t\tconst diff = (a[i] || 0) - (b[i] || 0);\n\t\t\tif (diff !== 0) return diff;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tprivate shouldUseNewStructure(\n\t\tentityType: NotificationAccountType,\n\t\tplatform?: AppPlatform,\n\t\tversion?: string\n\t): boolean {\n\t\tif (!this.isNotifiableEntityType(entityType)) return false;\n\n\t\tif (!platform || !version) return false;\n\n\t\tconst minVersion = NotificationVersionRules?.[entityType]?.[platform];\n\n\t\tif (!minVersion) return false;\n\n\t\treturn this.compareVersions(version, minVersion) >= 0;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Redis from 'ioredis';
|
|
2
|
+
interface LockOptions {
|
|
3
|
+
maxRetries?: number;
|
|
4
|
+
retryDelayMs?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class RedisService {
|
|
7
|
+
private _redisClient;
|
|
8
|
+
constructor(redisURL: string);
|
|
9
|
+
get redisClient(): Redis;
|
|
10
|
+
getCachedObject<T>(key: string): Promise<T | undefined>;
|
|
11
|
+
cacheObject<T>(key: string, object: T, expiry?: number): Promise<boolean>;
|
|
12
|
+
deleteCachedObject(key: string): Promise<boolean>;
|
|
13
|
+
getCachedObjectByGroup<T>(group: string, key: string): Promise<T | undefined>;
|
|
14
|
+
setCachedObjectByGroup<T>(group: string, key: string, object: T): Promise<boolean>;
|
|
15
|
+
deleteCachedObjectByGroup<T>(group: string, key: string): Promise<boolean>;
|
|
16
|
+
sanitizeKey(key: string): string;
|
|
17
|
+
addToSet(group: string, member: string): Promise<boolean>;
|
|
18
|
+
removeFromSet(group: string, member: string): Promise<boolean>;
|
|
19
|
+
isMemberOfSet(group: string, member: string): Promise<boolean>;
|
|
20
|
+
getSetMembers(group: string): Promise<string[]>;
|
|
21
|
+
acquireLock(key: string, ttl?: number): Promise<string | null>;
|
|
22
|
+
releaseLock(key: string, lockValue: string): Promise<boolean>;
|
|
23
|
+
executeWithLock<T>(key: string, ttl: number, callback: () => Promise<T>, errorMessage?: string, options?: LockOptions): Promise<T>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|