@lyxa.ai/core 1.4.298 → 1.4.300
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 +2 -2
- package/dist/libraries/llm/interfaces/common-llm-interfaces.js.map +1 -1
- package/dist/libraries/llm/providers/openai-provider.js +6 -6
- package/dist/libraries/llm/providers/openai-provider.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/status-timeline.model.d.ts +1 -1
- package/dist/libraries/mongo/models/embedded/status-timeline.model.js +5 -5
- package/dist/libraries/mongo/models/embedded/status-timeline.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/libraries/auth/index.d.ts +0 -77
- package/dist/types/libraries/auth/index.js +0 -270
- package/dist/types/libraries/auth/index.js.map +0 -1
- package/dist/types/libraries/auth/refreshtoken.d.ts +0 -15
- package/dist/types/libraries/auth/refreshtoken.js +0 -91
- package/dist/types/libraries/auth/refreshtoken.js.map +0 -1
- package/dist/types/libraries/auth/repository.d.ts +0 -18
- package/dist/types/libraries/auth/repository.js +0 -43
- package/dist/types/libraries/auth/repository.js.map +0 -1
- package/dist/types/libraries/bullmq/bull-mq-service.d.ts +0 -9
- package/dist/types/libraries/bullmq/bull-mq-service.js +0 -42
- package/dist/types/libraries/bullmq/bull-mq-service.js.map +0 -1
- package/dist/types/libraries/cache/settings/index.d.ts +0 -7
- package/dist/types/libraries/cache/settings/index.js +0 -56
- package/dist/types/libraries/cache/settings/index.js.map +0 -1
- package/dist/types/libraries/cash-settlement/cashSettlementService.d.ts +0 -16
- package/dist/types/libraries/cash-settlement/cashSettlementService.js +0 -53
- package/dist/types/libraries/cash-settlement/cashSettlementService.js.map +0 -1
- package/dist/types/libraries/cash-settlement/index.d.ts +0 -2
- package/dist/types/libraries/cash-settlement/index.js +0 -19
- package/dist/types/libraries/cash-settlement/index.js.map +0 -1
- package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.d.ts +0 -24
- package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.js +0 -10
- package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.js.map +0 -1
- package/dist/types/libraries/cash-settlement/providers/bob.d.ts +0 -45
- package/dist/types/libraries/cash-settlement/providers/bob.js +0 -634
- package/dist/types/libraries/cash-settlement/providers/bob.js.map +0 -1
- package/dist/types/libraries/cash-settlement/providers/index.d.ts +0 -1
- package/dist/types/libraries/cash-settlement/providers/index.js +0 -18
- package/dist/types/libraries/cash-settlement/providers/index.js.map +0 -1
- package/dist/types/libraries/cloud-storage/CloudStorageFactory.d.ts +0 -7
- package/dist/types/libraries/cloud-storage/CloudStorageFactory.js +0 -18
- package/dist/types/libraries/cloud-storage/CloudStorageFactory.js.map +0 -1
- package/dist/types/libraries/cloud-storage/index.d.ts +0 -4
- package/dist/types/libraries/cloud-storage/index.js +0 -21
- package/dist/types/libraries/cloud-storage/index.js.map +0 -1
- package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.d.ts +0 -8
- package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.js +0 -3
- package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.js.map +0 -1
- package/dist/types/libraries/cloud-storage/providers/GcsStorageService.d.ts +0 -11
- package/dist/types/libraries/cloud-storage/providers/GcsStorageService.js +0 -63
- package/dist/types/libraries/cloud-storage/providers/GcsStorageService.js.map +0 -1
- package/dist/types/libraries/cloud-storage/types/FileUploadResult.d.ts +0 -11
- package/dist/types/libraries/cloud-storage/types/FileUploadResult.js +0 -3
- package/dist/types/libraries/cloud-storage/types/FileUploadResult.js.map +0 -1
- package/dist/types/libraries/configuration/index.d.ts +0 -39
- package/dist/types/libraries/configuration/index.js +0 -84
- package/dist/types/libraries/configuration/index.js.map +0 -1
- package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.d.ts +0 -9
- package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.js +0 -14
- package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.js.map +0 -1
- package/dist/types/libraries/dispatcher/index.d.ts +0 -10
- package/dist/types/libraries/dispatcher/index.js +0 -43
- package/dist/types/libraries/dispatcher/index.js.map +0 -1
- package/dist/types/libraries/event/BaseEvent.d.ts +0 -7
- package/dist/types/libraries/event/BaseEvent.js +0 -19
- package/dist/types/libraries/event/BaseEvent.js.map +0 -1
- package/dist/types/libraries/event/EventEnums.d.ts +0 -26
- package/dist/types/libraries/event/EventEnums.js +0 -31
- package/dist/types/libraries/event/EventEnums.js.map +0 -1
- package/dist/types/libraries/event/decorators/metadata.d.ts +0 -13
- package/dist/types/libraries/event/decorators/metadata.js +0 -20
- package/dist/types/libraries/event/decorators/metadata.js.map +0 -1
- package/dist/types/libraries/event/events/index.d.ts +0 -2
- package/dist/types/libraries/event/events/index.js +0 -19
- package/dist/types/libraries/event/events/index.js.map +0 -1
- package/dist/types/libraries/event/events/payout/index.d.ts +0 -1
- package/dist/types/libraries/event/events/payout/index.js +0 -18
- package/dist/types/libraries/event/events/payout/index.js.map +0 -1
- package/dist/types/libraries/event/events/payout/payout-schedule.event.d.ts +0 -9
- package/dist/types/libraries/event/events/payout/payout-schedule.event.js +0 -12
- package/dist/types/libraries/event/events/payout/payout-schedule.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/cash/index.d.ts +0 -5
- package/dist/types/libraries/event/events/rider/cash/index.js +0 -14
- package/dist/types/libraries/event/events/rider/cash/index.js.map +0 -1
- package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.d.ts +0 -11
- package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.js +0 -19
- package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/cash/rider-cash-event.d.ts +0 -11
- package/dist/types/libraries/event/events/rider/cash/rider-cash-event.js +0 -18
- package/dist/types/libraries/event/events/rider/cash/rider-cash-event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.d.ts +0 -10
- package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.js +0 -17
- package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.d.ts +0 -11
- package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.js +0 -19
- package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.d.ts +0 -10
- package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.js +0 -17
- package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/index.d.ts +0 -2
- package/dist/types/libraries/event/events/rider/index.js +0 -19
- package/dist/types/libraries/event/events/rider/index.js.map +0 -1
- package/dist/types/libraries/event/events/rider/scoring/index.d.ts +0 -7
- package/dist/types/libraries/event/events/rider/scoring/index.js +0 -18
- package/dist/types/libraries/event/events/rider/scoring/index.js.map +0 -1
- package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.d.ts +0 -11
- package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.js +0 -20
- package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.d.ts +0 -13
- package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js +0 -24
- package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.d.ts +0 -11
- package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.js +0 -20
- package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.d.ts +0 -13
- package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.js +0 -24
- package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.d.ts +0 -19
- package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.js +0 -36
- package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.d.ts +0 -13
- package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.js +0 -18
- package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.js.map +0 -1
- package/dist/types/libraries/event/events/rider/scoring/rider-score-event.d.ts +0 -14
- package/dist/types/libraries/event/events/rider/scoring/rider-score-event.js +0 -21
- package/dist/types/libraries/event/events/rider/scoring/rider-score-event.js.map +0 -1
- package/dist/types/libraries/event/index.d.ts +0 -11
- package/dist/types/libraries/event/index.js +0 -152
- package/dist/types/libraries/event/index.js.map +0 -1
- package/dist/types/libraries/event/registry/SubscriptionRegistry.d.ts +0 -11
- package/dist/types/libraries/event/registry/SubscriptionRegistry.js +0 -14
- package/dist/types/libraries/event/registry/SubscriptionRegistry.js.map +0 -1
- package/dist/types/libraries/firebase/index.d.ts +0 -16
- package/dist/types/libraries/firebase/index.js +0 -107
- package/dist/types/libraries/firebase/index.js.map +0 -1
- package/dist/types/libraries/google-translate/google-translate.client.d.ts +0 -5
- package/dist/types/libraries/google-translate/google-translate.client.js +0 -44
- package/dist/types/libraries/google-translate/google-translate.client.js.map +0 -1
- package/dist/types/libraries/google-translate/google-translate.dto.d.ts +0 -13
- package/dist/types/libraries/google-translate/google-translate.dto.js +0 -3
- package/dist/types/libraries/google-translate/google-translate.dto.js.map +0 -1
- package/dist/types/libraries/google-translate/google-translate.service.d.ts +0 -9
- package/dist/types/libraries/google-translate/google-translate.service.js +0 -102
- package/dist/types/libraries/google-translate/google-translate.service.js.map +0 -1
- package/dist/types/libraries/google-translate/index.d.ts +0 -1
- package/dist/types/libraries/google-translate/index.js +0 -18
- package/dist/types/libraries/google-translate/index.js.map +0 -1
- package/dist/types/libraries/index.d.ts +0 -43
- package/dist/types/libraries/index.js +0 -102
- package/dist/types/libraries/index.js.map +0 -1
- package/dist/types/libraries/llm/interfaces/common-llm-interfaces.d.ts +0 -28
- package/dist/types/libraries/llm/interfaces/common-llm-interfaces.js +0 -3
- package/dist/types/libraries/llm/interfaces/common-llm-interfaces.js.map +0 -1
- package/dist/types/libraries/llm/llm-provider-service.d.ts +0 -13
- package/dist/types/libraries/llm/llm-provider-service.js +0 -47
- package/dist/types/libraries/llm/llm-provider-service.js.map +0 -1
- package/dist/types/libraries/llm/providers/openai-provider.d.ts +0 -19
- package/dist/types/libraries/llm/providers/openai-provider.js +0 -223
- package/dist/types/libraries/llm/providers/openai-provider.js.map +0 -1
- package/dist/types/libraries/logger/index.d.ts +0 -8
- package/dist/types/libraries/logger/index.js +0 -75
- package/dist/types/libraries/logger/index.js.map +0 -1
- package/dist/types/libraries/logger-kit/index.d.ts +0 -3
- package/dist/types/libraries/logger-kit/index.js +0 -22
- package/dist/types/libraries/logger-kit/index.js.map +0 -1
- package/dist/types/libraries/logger-kit/logger.service.d.ts +0 -117
- package/dist/types/libraries/logger-kit/logger.service.js +0 -304
- package/dist/types/libraries/logger-kit/logger.service.js.map +0 -1
- package/dist/types/libraries/logger-kit/types.d.ts +0 -34
- package/dist/types/libraries/logger-kit/types.js +0 -3
- package/dist/types/libraries/logger-kit/types.js.map +0 -1
- package/dist/types/libraries/map/index.d.ts +0 -2
- package/dist/types/libraries/map/index.js +0 -19
- package/dist/types/libraries/map/index.js.map +0 -1
- package/dist/types/libraries/map/interfaces/IMapService.d.ts +0 -43
- package/dist/types/libraries/map/interfaces/IMapService.js +0 -9
- package/dist/types/libraries/map/interfaces/IMapService.js.map +0 -1
- package/dist/types/libraries/map/mapService.d.ts +0 -21
- package/dist/types/libraries/map/mapService.js +0 -57
- package/dist/types/libraries/map/mapService.js.map +0 -1
- package/dist/types/libraries/map/providers/google-maps.d.ts +0 -27
- package/dist/types/libraries/map/providers/google-maps.js +0 -462
- package/dist/types/libraries/map/providers/google-maps.js.map +0 -1
- package/dist/types/libraries/map/providers/index.d.ts +0 -1
- package/dist/types/libraries/map/providers/index.js +0 -18
- package/dist/types/libraries/map/providers/index.js.map +0 -1
- package/dist/types/libraries/map/providers/osrm.d.ts +0 -13
- package/dist/types/libraries/map/providers/osrm.js +0 -137
- package/dist/types/libraries/map/providers/osrm.js.map +0 -1
- package/dist/types/libraries/mongo/index.d.ts +0 -7
- package/dist/types/libraries/mongo/index.js +0 -87
- package/dist/types/libraries/mongo/index.js.map +0 -1
- package/dist/types/libraries/mongo/models/activity-log.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/activity-log.model.js +0 -48
- package/dist/types/libraries/mongo/models/activity-log.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/admin-access-control.model.d.ts +0 -11
- package/dist/types/libraries/mongo/models/admin-access-control.model.js +0 -75
- package/dist/types/libraries/mongo/models/admin-access-control.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/admin.model.d.ts +0 -11
- package/dist/types/libraries/mongo/models/admin.model.js +0 -65
- package/dist/types/libraries/mongo/models/admin.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/agent-performance.model.d.ts +0 -15
- package/dist/types/libraries/mongo/models/agent-performance.model.js +0 -73
- package/dist/types/libraries/mongo/models/agent-performance.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/app-appearance.model.d.ts +0 -25
- package/dist/types/libraries/mongo/models/app-appearance.model.js +0 -102
- package/dist/types/libraries/mongo/models/app-appearance.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/app-instance.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/app-instance.model.js +0 -54
- package/dist/types/libraries/mongo/models/app-instance.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/attribute.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/attribute.model.js +0 -58
- package/dist/types/libraries/mongo/models/attribute.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/banner.model.d.ts +0 -27
- package/dist/types/libraries/mongo/models/banner.model.js +0 -118
- package/dist/types/libraries/mongo/models/banner.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/base/base-coupon.model.d.ts +0 -19
- package/dist/types/libraries/mongo/models/base/base-coupon.model.js +0 -90
- package/dist/types/libraries/mongo/models/base/base-coupon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/bob-finance.model.d.ts +0 -19
- package/dist/types/libraries/mongo/models/bob-finance.model.js +0 -88
- package/dist/types/libraries/mongo/models/bob-finance.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.d.ts +0 -9
- package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.js +0 -48
- package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/brand.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/brand.model.js +0 -32
- package/dist/types/libraries/mongo/models/brand.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/cancellation-reason.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/cancellation-reason.model.js +0 -55
- package/dist/types/libraries/mongo/models/cancellation-reason.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/card.model.d.ts +0 -19
- package/dist/types/libraries/mongo/models/card.model.js +0 -88
- package/dist/types/libraries/mongo/models/card.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/cart-participant.model.d.ts +0 -29
- package/dist/types/libraries/mongo/models/cart-participant.model.js +0 -130
- package/dist/types/libraries/mongo/models/cart-participant.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/cart.model.d.ts +0 -39
- package/dist/types/libraries/mongo/models/cart.model.js +0 -184
- package/dist/types/libraries/mongo/models/cart.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/category.model.d.ts +0 -12
- package/dist/types/libraries/mongo/models/category.model.js +0 -68
- package/dist/types/libraries/mongo/models/category.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/chat-room.model.d.ts +0 -28
- package/dist/types/libraries/mongo/models/chat-room.model.js +0 -99
- package/dist/types/libraries/mongo/models/chat-room.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/copy-attribute-map.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/copy-attribute-map.model.js +0 -38
- package/dist/types/libraries/mongo/models/copy-attribute-map.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/copy-product-job.model.d.ts +0 -21
- package/dist/types/libraries/mongo/models/copy-product-job.model.js +0 -101
- package/dist/types/libraries/mongo/models/copy-product-job.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/copy-product-map.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/copy-product-map.model.js +0 -38
- package/dist/types/libraries/mongo/models/copy-product-map.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/copy-shop-category-map.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/copy-shop-category-map.model.js +0 -38
- package/dist/types/libraries/mongo/models/copy-shop-category-map.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/core-auth-identity.model.d.ts +0 -7
- package/dist/types/libraries/mongo/models/core-auth-identity.model.js +0 -32
- package/dist/types/libraries/mongo/models/core-auth-identity.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/core-user.model.d.ts +0 -16
- package/dist/types/libraries/mongo/models/core-user.model.js +0 -85
- package/dist/types/libraries/mongo/models/core-user.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/counter.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/counter.model.js +0 -42
- package/dist/types/libraries/mongo/models/counter.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/coupon.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/coupon.model.js +0 -60
- package/dist/types/libraries/mongo/models/coupon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/deal-setting.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/deal-setting.model.js +0 -52
- package/dist/types/libraries/mongo/models/deal-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/default-chat.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/default-chat.model.js +0 -26
- package/dist/types/libraries/mongo/models/default-chat.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/delivery-charges.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/delivery-charges.model.js +0 -63
- package/dist/types/libraries/mongo/models/delivery-charges.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/dish.model.d.ts +0 -18
- package/dist/types/libraries/mongo/models/dish.model.js +0 -92
- package/dist/types/libraries/mongo/models/dish.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/address-change-history.model.d.ts +0 -25
- package/dist/types/libraries/mongo/models/embedded/address-change-history.model.js +0 -112
- package/dist/types/libraries/mongo/models/embedded/address-change-history.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.d.ts +0 -33
- package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.js +0 -133
- package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/app-force-update.d.ts +0 -9
- package/dist/types/libraries/mongo/models/embedded/app-force-update.js +0 -52
- package/dist/types/libraries/mongo/models/embedded/app-force-update.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/attribute-item.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/attribute-item.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/attribute-item.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/attribute-map.model.d.ts +0 -7
- package/dist/types/libraries/mongo/models/embedded/attribute-map.model.js +0 -29
- package/dist/types/libraries/mongo/models/embedded/attribute-map.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.d.ts +0 -9
- package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.js +0 -52
- package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/charge.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/charge.model.js +0 -28
- package/dist/types/libraries/mongo/models/embedded/charge.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/chat-participant.model.d.ts +0 -18
- package/dist/types/libraries/mongo/models/embedded/chat-participant.model.js +0 -64
- package/dist/types/libraries/mongo/models/embedded/chat-participant.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/company-info.model.d.ts +0 -6
- package/dist/types/libraries/mongo/models/embedded/company-info.model.js +0 -37
- package/dist/types/libraries/mongo/models/embedded/company-info.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.d.ts +0 -9
- package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.js +0 -36
- package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/courier-setting.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/courier-setting.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/courier-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/currency-setting.model.d.ts +0 -7
- package/dist/types/libraries/mongo/models/embedded/currency-setting.model.js +0 -38
- package/dist/types/libraries/mongo/models/embedded/currency-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/currency.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/currency.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/currency.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.js +0 -51
- package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/delivery-info.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/delivery-info.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/delivery-info.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/external-ref.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/external-ref.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/external-ref.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/featured-item.mode.d.ts +0 -6
- package/dist/types/libraries/mongo/models/embedded/featured-item.mode.js +0 -33
- package/dist/types/libraries/mongo/models/embedded/featured-item.mode.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.d.ts +0 -7
- package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.js +0 -38
- package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.d.ts +0 -17
- package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.js +0 -63
- package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.d.ts +0 -46
- package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.js +0 -178
- package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/order-cancel.model.d.ts +0 -26
- package/dist/types/libraries/mongo/models/embedded/order-cancel.model.js +0 -110
- package/dist/types/libraries/mongo/models/embedded/order-cancel.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.d.ts +0 -12
- package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.js +0 -67
- package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/order-finance.model.d.ts +0 -18
- package/dist/types/libraries/mongo/models/embedded/order-finance.model.js +0 -64
- package/dist/types/libraries/mongo/models/embedded/order-finance.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/order-pricing.model.d.ts +0 -34
- package/dist/types/libraries/mongo/models/embedded/order-pricing.model.js +0 -163
- package/dist/types/libraries/mongo/models/embedded/order-pricing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/order-refund.model.d.ts +0 -28
- package/dist/types/libraries/mongo/models/embedded/order-refund.model.js +0 -113
- package/dist/types/libraries/mongo/models/embedded/order-refund.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/otp-fields.model.d.ts +0 -7
- package/dist/types/libraries/mongo/models/embedded/otp-fields.model.js +0 -46
- package/dist/types/libraries/mongo/models/embedded/otp-fields.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/package.model.d.ts +0 -25
- package/dist/types/libraries/mongo/models/embedded/package.model.js +0 -86
- package/dist/types/libraries/mongo/models/embedded/package.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/parent-document.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/parent-document.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/parent-document.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.d.ts +0 -7
- package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.js +0 -38
- package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/payment-record.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/embedded/payment-record.model.js +0 -53
- package/dist/types/libraries/mongo/models/embedded/payment-record.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/payout-setting.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/payout-setting.model.js +0 -28
- package/dist/types/libraries/mongo/models/embedded/payout-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/plus-settings.model.d.ts +0 -6
- package/dist/types/libraries/mongo/models/embedded/plus-settings.model.js +0 -33
- package/dist/types/libraries/mongo/models/embedded/plus-settings.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/preparing-time.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/preparing-time.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/preparing-time.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.d.ts +0 -16
- package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.js +0 -80
- package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/product-category.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/product-category.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/product-category.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.d.ts +0 -17
- package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.js +0 -72
- package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.d.ts +0 -12
- package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.js +0 -60
- package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/product-snap.model.d.ts +0 -16
- package/dist/types/libraries/mongo/models/embedded/product-snap.model.js +0 -79
- package/dist/types/libraries/mongo/models/embedded/product-snap.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/profit.model.d.ts +0 -22
- package/dist/types/libraries/mongo/models/embedded/profit.model.js +0 -96
- package/dist/types/libraries/mongo/models/embedded/profit.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.d.ts +0 -6
- package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.js +0 -38
- package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.d.ts +0 -18
- package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.js +0 -73
- package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/replacement-order.model.d.ts +0 -28
- package/dist/types/libraries/mongo/models/embedded/replacement-order.model.js +0 -109
- package/dist/types/libraries/mongo/models/embedded/replacement-order.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/rest-password.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/rest-password.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/rest-password.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.d.ts +0 -9
- package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.js +0 -44
- package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/rider-batches.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/rider-batches.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/rider-batches.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/rider-setting.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/embedded/rider-setting.model.js +0 -47
- package/dist/types/libraries/mongo/models/embedded/rider-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/rider-statistics.d.ts +0 -11
- package/dist/types/libraries/mongo/models/embedded/rider-statistics.js +0 -62
- package/dist/types/libraries/mongo/models/embedded/rider-statistics.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.d.ts +0 -18
- package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.js +0 -77
- package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.d.ts +0 -23
- package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.js +0 -85
- package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.d.ts +0 -24
- package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.js +0 -127
- package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.d.ts +0 -16
- package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.js +0 -70
- package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.d.ts +0 -19
- package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.js +0 -76
- package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.d.ts +0 -9
- package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.js +0 -57
- package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.js +0 -28
- package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/service-line-item.model.d.ts +0 -38
- package/dist/types/libraries/mongo/models/embedded/service-line-item.model.js +0 -154
- package/dist/types/libraries/mongo/models/embedded/service-line-item.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.d.ts +0 -12
- package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.js +0 -47
- package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/shop-document.model.d.ts +0 -6
- package/dist/types/libraries/mongo/models/embedded/shop-document.model.js +0 -37
- package/dist/types/libraries/mongo/models/embedded/shop-document.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.d.ts +0 -15
- package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.js +0 -75
- package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.js +0 -43
- package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/status-timeline.model.d.ts +0 -25
- package/dist/types/libraries/mongo/models/embedded/status-timeline.model.js +0 -97
- package/dist/types/libraries/mongo/models/embedded/status-timeline.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.js +0 -47
- package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.js +0 -27
- package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.d.ts +0 -28
- package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.js +0 -134
- package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/vat.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/vat.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/vat.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/wallet.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/wallet.model.js +0 -32
- package/dist/types/libraries/mongo/models/embedded/wallet.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.d.ts +0 -5
- package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.js +0 -28
- package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.js.map +0 -1
- package/dist/types/libraries/mongo/models/favourite.model.d.ts +0 -14
- package/dist/types/libraries/mongo/models/favourite.model.js +0 -52
- package/dist/types/libraries/mongo/models/favourite.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/featured-setting.model.d.ts +0 -7
- package/dist/types/libraries/mongo/models/featured-setting.model.js +0 -33
- package/dist/types/libraries/mongo/models/featured-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/filter-container.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/filter-container.model.js +0 -63
- package/dist/types/libraries/mongo/models/filter-container.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/finance-settlement.model.d.ts +0 -41
- package/dist/types/libraries/mongo/models/finance-settlement.model.js +0 -175
- package/dist/types/libraries/mongo/models/finance-settlement.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/flag.model.d.ts +0 -22
- package/dist/types/libraries/mongo/models/flag.model.js +0 -83
- package/dist/types/libraries/mongo/models/flag.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/gallery-upload.model.d.ts +0 -17
- package/dist/types/libraries/mongo/models/gallery-upload.model.js +0 -77
- package/dist/types/libraries/mongo/models/gallery-upload.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/gallery.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/gallery.model.js +0 -59
- package/dist/types/libraries/mongo/models/gallery.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/google-maps-usage.model.d.ts +0 -21
- package/dist/types/libraries/mongo/models/google-maps-usage.model.js +0 -255
- package/dist/types/libraries/mongo/models/google-maps-usage.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/index.d.ts +0 -395
- package/dist/types/libraries/mongo/models/index.js +0 -485
- package/dist/types/libraries/mongo/models/index.js.map +0 -1
- package/dist/types/libraries/mongo/models/integration-configuration.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/integration-configuration.model.js +0 -33
- package/dist/types/libraries/mongo/models/integration-configuration.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.d.ts +0 -9
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.js +0 -45
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.d.ts +0 -14
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.js +0 -76
- package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/limited-time-offer-config.d.ts +0 -6
- package/dist/types/libraries/mongo/models/limited-time-offer-config.js +0 -36
- package/dist/types/libraries/mongo/models/limited-time-offer-config.js.map +0 -1
- package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.d.ts +0 -22
- package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.js +0 -96
- package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/line-item.model.d.ts +0 -47
- package/dist/types/libraries/mongo/models/line-item.model.js +0 -205
- package/dist/types/libraries/mongo/models/line-item.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/list-container.model.d.ts +0 -19
- package/dist/types/libraries/mongo/models/list-container.model.js +0 -92
- package/dist/types/libraries/mongo/models/list-container.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/log.model.d.ts +0 -35
- package/dist/types/libraries/mongo/models/log.model.js +0 -163
- package/dist/types/libraries/mongo/models/log.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/marketing.model.d.ts +0 -18
- package/dist/types/libraries/mongo/models/marketing.model.js +0 -88
- package/dist/types/libraries/mongo/models/marketing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/meal-plan.model.d.ts +0 -9
- package/dist/types/libraries/mongo/models/meal-plan.model.js +0 -51
- package/dist/types/libraries/mongo/models/meal-plan.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/message.model.d.ts +0 -25
- package/dist/types/libraries/mongo/models/message.model.js +0 -105
- package/dist/types/libraries/mongo/models/message.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/notification.model.d.ts +0 -53
- package/dist/types/libraries/mongo/models/notification.model.js +0 -201
- package/dist/types/libraries/mongo/models/notification.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/nutrition.model.d.ts +0 -6
- package/dist/types/libraries/mongo/models/nutrition.model.js +0 -33
- package/dist/types/libraries/mongo/models/nutrition.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/order.model.d.ts +0 -66
- package/dist/types/libraries/mongo/models/order.model.js +0 -350
- package/dist/types/libraries/mongo/models/order.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/parent.model.d.ts +0 -29
- package/dist/types/libraries/mongo/models/parent.model.js +0 -144
- package/dist/types/libraries/mongo/models/parent.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/payment-configuration.model.d.ts +0 -6
- package/dist/types/libraries/mongo/models/payment-configuration.model.js +0 -33
- package/dist/types/libraries/mongo/models/payment-configuration.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/payment-intent.model.d.ts +0 -17
- package/dist/types/libraries/mongo/models/payment-intent.model.js +0 -79
- package/dist/types/libraries/mongo/models/payment-intent.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/payout.model.d.ts +0 -15
- package/dist/types/libraries/mongo/models/payout.model.js +0 -86
- package/dist/types/libraries/mongo/models/payout.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/product-brand.model.d.ts +0 -7
- package/dist/types/libraries/mongo/models/product-brand.model.js +0 -38
- package/dist/types/libraries/mongo/models/product-brand.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/product-marketing.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/product-marketing.model.js +0 -57
- package/dist/types/libraries/mongo/models/product-marketing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/product-stock-tracker.model.d.ts +0 -15
- package/dist/types/libraries/mongo/models/product-stock-tracker.model.js +0 -57
- package/dist/types/libraries/mongo/models/product-stock-tracker.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/product-upload.model.d.ts +0 -25
- package/dist/types/libraries/mongo/models/product-upload.model.js +0 -105
- package/dist/types/libraries/mongo/models/product-upload.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/product.model.d.ts +0 -63
- package/dist/types/libraries/mongo/models/product.model.js +0 -339
- package/dist/types/libraries/mongo/models/product.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/professional-blocked-time.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/professional-blocked-time.model.js +0 -49
- package/dist/types/libraries/mongo/models/professional-blocked-time.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/professional.model.d.ts +0 -17
- package/dist/types/libraries/mongo/models/professional.model.js +0 -91
- package/dist/types/libraries/mongo/models/professional.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.d.ts +0 -16
- package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.js +0 -62
- package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.js +0 -28
- package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.d.ts +0 -9
- package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.js +0 -69
- package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.js +0 -28
- package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.d.ts +0 -6
- package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.js +0 -29
- package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/courier-order.model.d.ts +0 -41
- package/dist/types/libraries/mongo/models/providers/courier-order.model.js +0 -151
- package/dist/types/libraries/mongo/models/providers/courier-order.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/custom-coupon.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/providers/custom-coupon.model.js +0 -43
- package/dist/types/libraries/mongo/models/providers/custom-coupon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/discount-marketing.model.d.ts +0 -22
- package/dist/types/libraries/mongo/models/providers/discount-marketing.model.js +0 -92
- package/dist/types/libraries/mongo/models/providers/discount-marketing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/featured-marketing.model.d.ts +0 -6
- package/dist/types/libraries/mongo/models/providers/featured-marketing.model.js +0 -25
- package/dist/types/libraries/mongo/models/providers/featured-marketing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.d.ts +0 -7
- package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.js +0 -30
- package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/global-coupon.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/providers/global-coupon.model.js +0 -10
- package/dist/types/libraries/mongo/models/providers/global-coupon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.d.ts +0 -12
- package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.js +0 -42
- package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.js +0 -43
- package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/punch-marketing.model.d.ts +0 -11
- package/dist/types/libraries/mongo/models/providers/punch-marketing.model.js +0 -50
- package/dist/types/libraries/mongo/models/providers/punch-marketing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.d.ts +0 -9
- package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.js +0 -27
- package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.d.ts +0 -11
- package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.js +0 -37
- package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/regular-order.model.d.ts +0 -54
- package/dist/types/libraries/mongo/models/providers/regular-order.model.js +0 -204
- package/dist/types/libraries/mongo/models/providers/regular-order.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/rider-payout.model.d.ts +0 -23
- package/dist/types/libraries/mongo/models/providers/rider-payout.model.js +0 -94
- package/dist/types/libraries/mongo/models/providers/rider-payout.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/rider-review.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/providers/rider-review.model.js +0 -32
- package/dist/types/libraries/mongo/models/providers/rider-review.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/service-package-review.model.d.ts +0 -14
- package/dist/types/libraries/mongo/models/providers/service-package-review.model.js +0 -44
- package/dist/types/libraries/mongo/models/providers/service-package-review.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/shop-courier.model.d.ts +0 -26
- package/dist/types/libraries/mongo/models/providers/shop-courier.model.js +0 -93
- package/dist/types/libraries/mongo/models/providers/shop-courier.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/shop-payout.model.d.ts +0 -62
- package/dist/types/libraries/mongo/models/providers/shop-payout.model.js +0 -244
- package/dist/types/libraries/mongo/models/providers/shop-payout.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/shop-review.model.d.ts +0 -12
- package/dist/types/libraries/mongo/models/providers/shop-review.model.js +0 -38
- package/dist/types/libraries/mongo/models/providers/shop-review.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.js +0 -47
- package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.d.ts +0 -11
- package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.js +0 -46
- package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/vendor-payout.model.d.ts +0 -50
- package/dist/types/libraries/mongo/models/providers/vendor-payout.model.js +0 -192
- package/dist/types/libraries/mongo/models/providers/vendor-payout.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/providers/vendor-review.model.d.ts +0 -12
- package/dist/types/libraries/mongo/models/providers/vendor-review.model.js +0 -38
- package/dist/types/libraries/mongo/models/providers/vendor-review.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/punch-marketing-history.model.d.ts +0 -24
- package/dist/types/libraries/mongo/models/punch-marketing-history.model.js +0 -101
- package/dist/types/libraries/mongo/models/punch-marketing-history.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/rating-setting.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/rating-setting.model.js +0 -46
- package/dist/types/libraries/mongo/models/rating-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/referral-setting.model.d.ts +0 -6
- package/dist/types/libraries/mongo/models/referral-setting.model.js +0 -32
- package/dist/types/libraries/mongo/models/referral-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/request-area.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/request-area.model.js +0 -33
- package/dist/types/libraries/mongo/models/request-area.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/review.model.d.ts +0 -15
- package/dist/types/libraries/mongo/models/review.model.js +0 -68
- package/dist/types/libraries/mongo/models/review.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/reward.model.d.ts +0 -16
- package/dist/types/libraries/mongo/models/reward.model.js +0 -70
- package/dist/types/libraries/mongo/models/reward.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/rider-timeout.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/rider-timeout.model.js +0 -47
- package/dist/types/libraries/mongo/models/rider-timeout.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/rider-tracking.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/rider-tracking.model.js +0 -47
- package/dist/types/libraries/mongo/models/rider-tracking.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/rider.model.d.ts +0 -70
- package/dist/types/libraries/mongo/models/rider.model.js +0 -358
- package/dist/types/libraries/mongo/models/rider.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/service-addon.model.d.ts +0 -16
- package/dist/types/libraries/mongo/models/service-addon.model.js +0 -86
- package/dist/types/libraries/mongo/models/service-addon.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/service-booking.model.d.ts +0 -68
- package/dist/types/libraries/mongo/models/service-booking.model.js +0 -310
- package/dist/types/libraries/mongo/models/service-booking.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/service-cart.model.d.ts +0 -14
- package/dist/types/libraries/mongo/models/service-cart.model.js +0 -51
- package/dist/types/libraries/mongo/models/service-cart.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/service-category.model.d.ts +0 -14
- package/dist/types/libraries/mongo/models/service-category.model.js +0 -87
- package/dist/types/libraries/mongo/models/service-category.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/service-control.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/service-control.model.js +0 -50
- package/dist/types/libraries/mongo/models/service-control.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/service-flag.model.d.ts +0 -19
- package/dist/types/libraries/mongo/models/service-flag.model.js +0 -72
- package/dist/types/libraries/mongo/models/service-flag.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/service-package.model.d.ts +0 -27
- package/dist/types/libraries/mongo/models/service-package.model.js +0 -142
- package/dist/types/libraries/mongo/models/service-package.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/service-promotion.model.d.ts +0 -27
- package/dist/types/libraries/mongo/models/service-promotion.model.js +0 -120
- package/dist/types/libraries/mongo/models/service-promotion.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/service.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/service.model.js +0 -43
- package/dist/types/libraries/mongo/models/service.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/setting.model.d.ts +0 -51
- package/dist/types/libraries/mongo/models/setting.model.js +0 -201
- package/dist/types/libraries/mongo/models/setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/shared/address.model.d.ts +0 -38
- package/dist/types/libraries/mongo/models/shared/address.model.js +0 -158
- package/dist/types/libraries/mongo/models/shared/address.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/shared/duration.model.d.ts +0 -14
- package/dist/types/libraries/mongo/models/shared/duration.model.js +0 -59
- package/dist/types/libraries/mongo/models/shared/duration.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/shared/geo-location.model.d.ts +0 -5
- package/dist/types/libraries/mongo/models/shared/geo-location.model.js +0 -28
- package/dist/types/libraries/mongo/models/shared/geo-location.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/shared/work-hour.model.d.ts +0 -19
- package/dist/types/libraries/mongo/models/shared/work-hour.model.js +0 -81
- package/dist/types/libraries/mongo/models/shared/work-hour.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/shop-access-control.model.d.ts +0 -16
- package/dist/types/libraries/mongo/models/shop-access-control.model.js +0 -81
- package/dist/types/libraries/mongo/models/shop-access-control.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/shop-category.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/shop-category.model.js +0 -64
- package/dist/types/libraries/mongo/models/shop-category.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/shop-meal-plan.model.d.ts +0 -12
- package/dist/types/libraries/mongo/models/shop-meal-plan.model.js +0 -45
- package/dist/types/libraries/mongo/models/shop-meal-plan.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/shop-section.model.d.ts +0 -18
- package/dist/types/libraries/mongo/models/shop-section.model.js +0 -89
- package/dist/types/libraries/mongo/models/shop-section.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/shop.model.d.ts +0 -65
- package/dist/types/libraries/mongo/models/shop.model.js +0 -304
- package/dist/types/libraries/mongo/models/shop.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/spend-to-get-history.model.d.ts +0 -13
- package/dist/types/libraries/mongo/models/spend-to-get-history.model.js +0 -51
- package/dist/types/libraries/mongo/models/spend-to-get-history.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/subscription.model.d.ts +0 -20
- package/dist/types/libraries/mongo/models/subscription.model.js +0 -93
- package/dist/types/libraries/mongo/models/subscription.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/support-reason.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/support-reason.model.js +0 -61
- package/dist/types/libraries/mongo/models/support-reason.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/tag.model.d.ts +0 -10
- package/dist/types/libraries/mongo/models/tag.model.js +0 -64
- package/dist/types/libraries/mongo/models/tag.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/terms-and-conditions.model.d.ts +0 -8
- package/dist/types/libraries/mongo/models/terms-and-conditions.model.js +0 -51
- package/dist/types/libraries/mongo/models/terms-and-conditions.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/ticket-action.model.d.ts +0 -4
- package/dist/types/libraries/mongo/models/ticket-action.model.js +0 -31
- package/dist/types/libraries/mongo/models/ticket-action.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/ticket.model.d.ts +0 -35
- package/dist/types/libraries/mongo/models/ticket.model.js +0 -144
- package/dist/types/libraries/mongo/models/ticket.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/tournament-participant.model.d.ts +0 -22
- package/dist/types/libraries/mongo/models/tournament-participant.model.js +0 -84
- package/dist/types/libraries/mongo/models/tournament-participant.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/tournament.model.d.ts +0 -65
- package/dist/types/libraries/mongo/models/tournament.model.js +0 -273
- package/dist/types/libraries/mongo/models/tournament.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/user-action.model.d.ts +0 -29
- package/dist/types/libraries/mongo/models/user-action.model.js +0 -113
- package/dist/types/libraries/mongo/models/user-action.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/user-app-section-setting.model.d.ts +0 -24
- package/dist/types/libraries/mongo/models/user-app-section-setting.model.js +0 -103
- package/dist/types/libraries/mongo/models/user-app-section-setting.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/user.model.d.ts +0 -39
- package/dist/types/libraries/mongo/models/user.model.js +0 -150
- package/dist/types/libraries/mongo/models/user.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/vendor-access-control.model.d.ts +0 -14
- package/dist/types/libraries/mongo/models/vendor-access-control.model.js +0 -75
- package/dist/types/libraries/mongo/models/vendor-access-control.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/vendor-parent.model.d.ts +0 -25
- package/dist/types/libraries/mongo/models/vendor-parent.model.js +0 -121
- package/dist/types/libraries/mongo/models/vendor-parent.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/vendor.model.d.ts +0 -33
- package/dist/types/libraries/mongo/models/vendor.model.js +0 -150
- package/dist/types/libraries/mongo/models/vendor.model.js.map +0 -1
- package/dist/types/libraries/mongo/models/zone-extra-time.d.ts +0 -12
- package/dist/types/libraries/mongo/models/zone-extra-time.js +0 -54
- package/dist/types/libraries/mongo/models/zone-extra-time.js.map +0 -1
- package/dist/types/libraries/mongo/models/zone.model.d.ts +0 -17
- package/dist/types/libraries/mongo/models/zone.model.js +0 -80
- package/dist/types/libraries/mongo/models/zone.model.js.map +0 -1
- package/dist/types/libraries/mongo/plugins/normalize-field.plugin.d.ts +0 -4
- package/dist/types/libraries/mongo/plugins/normalize-field.plugin.js +0 -42
- package/dist/types/libraries/mongo/plugins/normalize-field.plugin.js.map +0 -1
- package/dist/types/libraries/mongo/plugins/soft-delete-plugin.d.ts +0 -32
- package/dist/types/libraries/mongo/plugins/soft-delete-plugin.js +0 -145
- package/dist/types/libraries/mongo/plugins/soft-delete-plugin.js.map +0 -1
- package/dist/types/libraries/mongo/utilities/shop.hooks.d.ts +0 -9
- package/dist/types/libraries/mongo/utilities/shop.hooks.js +0 -11
- package/dist/types/libraries/mongo/utilities/shop.hooks.js.map +0 -1
- package/dist/types/libraries/mongo/utilities/sorting-order.hooks.d.ts +0 -14
- package/dist/types/libraries/mongo/utilities/sorting-order.hooks.js +0 -58
- package/dist/types/libraries/mongo/utilities/sorting-order.hooks.js.map +0 -1
- package/dist/types/libraries/mongo/utilities/unique-id.hooks.d.ts +0 -6
- package/dist/types/libraries/mongo/utilities/unique-id.hooks.js +0 -17
- package/dist/types/libraries/mongo/utilities/unique-id.hooks.js.map +0 -1
- package/dist/types/libraries/notification/firebase-fcm.service.d.ts +0 -7
- package/dist/types/libraries/notification/firebase-fcm.service.js +0 -40
- package/dist/types/libraries/notification/firebase-fcm.service.js.map +0 -1
- package/dist/types/libraries/notification/firebase-message.builder.d.ts +0 -22
- package/dist/types/libraries/notification/firebase-message.builder.js +0 -107
- package/dist/types/libraries/notification/firebase-message.builder.js.map +0 -1
- package/dist/types/libraries/notification/lyxa-fcm-sender.d.ts +0 -19
- package/dist/types/libraries/notification/lyxa-fcm-sender.js +0 -127
- package/dist/types/libraries/notification/lyxa-fcm-sender.js.map +0 -1
- package/dist/types/libraries/notification/lyxa-fcm.service.d.ts +0 -40
- package/dist/types/libraries/notification/lyxa-fcm.service.js +0 -177
- package/dist/types/libraries/notification/lyxa-fcm.service.js.map +0 -1
- package/dist/types/libraries/redis/index.d.ts +0 -25
- package/dist/types/libraries/redis/index.js +0 -137
- package/dist/types/libraries/redis/index.js.map +0 -1
- package/dist/types/libraries/secrets/index.d.ts +0 -10
- package/dist/types/libraries/secrets/index.js +0 -64
- package/dist/types/libraries/secrets/index.js.map +0 -1
- package/dist/types/libraries/socket/BaseSocketEvent.d.ts +0 -27
- package/dist/types/libraries/socket/BaseSocketEvent.js +0 -47
- package/dist/types/libraries/socket/BaseSocketEvent.js.map +0 -1
- package/dist/types/libraries/socket/PushNotificationEvent.d.ts +0 -36
- package/dist/types/libraries/socket/PushNotificationEvent.js +0 -45
- package/dist/types/libraries/socket/PushNotificationEvent.js.map +0 -1
- package/dist/types/libraries/socket/connections/batch.d.ts +0 -12
- package/dist/types/libraries/socket/connections/batch.js +0 -58
- package/dist/types/libraries/socket/connections/batch.js.map +0 -1
- package/dist/types/libraries/socket/connections/cache.d.ts +0 -9
- package/dist/types/libraries/socket/connections/cache.js +0 -36
- package/dist/types/libraries/socket/connections/cache.js.map +0 -1
- package/dist/types/libraries/socket/connections/constants.d.ts +0 -2
- package/dist/types/libraries/socket/connections/constants.js +0 -6
- package/dist/types/libraries/socket/connections/constants.js.map +0 -1
- package/dist/types/libraries/socket/connections/index.d.ts +0 -7
- package/dist/types/libraries/socket/connections/index.js +0 -24
- package/dist/types/libraries/socket/connections/index.js.map +0 -1
- package/dist/types/libraries/socket/connections/instance-disconnect.d.ts +0 -2
- package/dist/types/libraries/socket/connections/instance-disconnect.js +0 -43
- package/dist/types/libraries/socket/connections/instance-disconnect.js.map +0 -1
- package/dist/types/libraries/socket/connections/keys.d.ts +0 -10
- package/dist/types/libraries/socket/connections/keys.js +0 -23
- package/dist/types/libraries/socket/connections/keys.js.map +0 -1
- package/dist/types/libraries/socket/connections/presence.d.ts +0 -6
- package/dist/types/libraries/socket/connections/presence.js +0 -39
- package/dist/types/libraries/socket/connections/presence.js.map +0 -1
- package/dist/types/libraries/socket/connections/redis-helpers.d.ts +0 -2
- package/dist/types/libraries/socket/connections/redis-helpers.js +0 -14
- package/dist/types/libraries/socket/connections/redis-helpers.js.map +0 -1
- package/dist/types/libraries/socket/connections/subscription.d.ts +0 -13
- package/dist/types/libraries/socket/connections/subscription.js +0 -73
- package/dist/types/libraries/socket/connections/subscription.js.map +0 -1
- package/dist/types/libraries/socket/core/index.d.ts +0 -6
- package/dist/types/libraries/socket/core/index.js +0 -23
- package/dist/types/libraries/socket/core/index.js.map +0 -1
- package/dist/types/libraries/socket/core/local-subscription-registry.d.ts +0 -17
- package/dist/types/libraries/socket/core/local-subscription-registry.js +0 -60
- package/dist/types/libraries/socket/core/local-subscription-registry.js.map +0 -1
- package/dist/types/libraries/socket/core/socket-event-consumer.d.ts +0 -1
- package/dist/types/libraries/socket/core/socket-event-consumer.js +0 -14
- package/dist/types/libraries/socket/core/socket-event-consumer.js.map +0 -1
- package/dist/types/libraries/socket/core/socket-event-publisher.d.ts +0 -6
- package/dist/types/libraries/socket/core/socket-event-publisher.js +0 -82
- package/dist/types/libraries/socket/core/socket-event-publisher.js.map +0 -1
- package/dist/types/libraries/socket/core/socket-event-registry.d.ts +0 -12
- package/dist/types/libraries/socket/core/socket-event-registry.js +0 -23
- package/dist/types/libraries/socket/core/socket-event-registry.js.map +0 -1
- package/dist/types/libraries/socket/core/socket-event-registry.map.d.ts +0 -34
- package/dist/types/libraries/socket/core/socket-event-registry.map.js +0 -34
- package/dist/types/libraries/socket/core/socket-event-registry.map.js.map +0 -1
- package/dist/types/libraries/socket/core/zAsyncIterable.d.ts +0 -7
- package/dist/types/libraries/socket/core/zAsyncIterable.js +0 -35
- package/dist/types/libraries/socket/core/zAsyncIterable.js.map +0 -1
- package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.d.ts +0 -153
- package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.js +0 -44
- package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.js.map +0 -1
- package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.d.ts +0 -286
- package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.js +0 -96
- package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.js.map +0 -1
- package/dist/types/libraries/socket/events/index.d.ts +0 -7
- package/dist/types/libraries/socket/events/index.js +0 -24
- package/dist/types/libraries/socket/events/index.js.map +0 -1
- package/dist/types/libraries/socket/events/order-actions.socket.event.d.ts +0 -297
- package/dist/types/libraries/socket/events/order-actions.socket.event.js +0 -82
- package/dist/types/libraries/socket/events/order-actions.socket.event.js.map +0 -1
- package/dist/types/libraries/socket/events/rider-connect.socket.event.d.ts +0 -13
- package/dist/types/libraries/socket/events/rider-connect.socket.event.js +0 -22
- package/dist/types/libraries/socket/events/rider-connect.socket.event.js.map +0 -1
- package/dist/types/libraries/socket/events/rider-location-update.socket.event.d.ts +0 -76
- package/dist/types/libraries/socket/events/rider-location-update.socket.event.js +0 -39
- package/dist/types/libraries/socket/events/rider-location-update.socket.event.js.map +0 -1
- package/dist/types/libraries/socket/events/socketNotificationEvent.d.ts +0 -46
- package/dist/types/libraries/socket/events/socketNotificationEvent.js +0 -29
- package/dist/types/libraries/socket/events/socketNotificationEvent.js.map +0 -1
- package/dist/types/libraries/socket/events/ticket-actions.socket.event.d.ts +0 -106
- package/dist/types/libraries/socket/events/ticket-actions.socket.event.js +0 -62
- package/dist/types/libraries/socket/events/ticket-actions.socket.event.js.map +0 -1
- package/dist/types/libraries/socket/events/ticket-assign.socket.event.d.ts +0 -161
- package/dist/types/libraries/socket/events/ticket-assign.socket.event.js +0 -42
- package/dist/types/libraries/socket/events/ticket-assign.socket.event.js.map +0 -1
- package/dist/types/libraries/socket/events/ticket-unassign.socket.event.d.ts +0 -27
- package/dist/types/libraries/socket/events/ticket-unassign.socket.event.js +0 -31
- package/dist/types/libraries/socket/events/ticket-unassign.socket.event.js.map +0 -1
- package/dist/types/libraries/trpc/context.d.ts +0 -37
- package/dist/types/libraries/trpc/context.js +0 -43
- package/dist/types/libraries/trpc/context.js.map +0 -1
- package/dist/types/libraries/trpc/index.d.ts +0 -75
- package/dist/types/libraries/trpc/index.js +0 -80
- package/dist/types/libraries/trpc/index.js.map +0 -1
- package/dist/types/libraries/twilio/index.d.ts +0 -6
- package/dist/types/libraries/twilio/index.js +0 -42
- package/dist/types/libraries/twilio/index.js.map +0 -1
- package/dist/types/libraries/upload/index.d.ts +0 -50
- package/dist/types/libraries/upload/index.js +0 -312
- package/dist/types/libraries/upload/index.js.map +0 -1
- package/dist/types/utilities/auth-ref.mapper.d.ts +0 -4
- package/dist/types/utilities/auth-ref.mapper.js +0 -22
- package/dist/types/utilities/auth-ref.mapper.js.map +0 -1
- package/dist/types/utilities/dayjs/dayjs.d.ts +0 -14
- package/dist/types/utilities/dayjs/dayjs.js +0 -47
- package/dist/types/utilities/dayjs/dayjs.js.map +0 -1
- package/dist/types/utilities/dayjs/index.d.ts +0 -2
- package/dist/types/utilities/dayjs/index.js +0 -9
- package/dist/types/utilities/dayjs/index.js.map +0 -1
- package/dist/types/utilities/environment/rabbitmq-environments.d.ts +0 -2
- package/dist/types/utilities/environment/rabbitmq-environments.js +0 -14
- package/dist/types/utilities/environment/rabbitmq-environments.js.map +0 -1
- package/dist/types/utilities/environment/redis-environments.d.ts +0 -2
- package/dist/types/utilities/environment/redis-environments.js +0 -14
- package/dist/types/utilities/environment/redis-environments.js.map +0 -1
- package/dist/types/utilities/error-common.d.ts +0 -10
- package/dist/types/utilities/error-common.js +0 -76
- package/dist/types/utilities/error-common.js.map +0 -1
- package/dist/types/utilities/id-generator.d.ts +0 -6
- package/dist/types/utilities/id-generator.js +0 -161
- package/dist/types/utilities/id-generator.js.map +0 -1
- package/dist/types/utilities/instance.utils.d.ts +0 -1
- package/dist/types/utilities/instance.utils.js +0 -12
- package/dist/types/utilities/instance.utils.js.map +0 -1
- package/dist/types/utilities/normalize.d.ts +0 -6
- package/dist/types/utilities/normalize.js +0 -51
- package/dist/types/utilities/normalize.js.map +0 -1
- package/dist/types/utilities/password.d.ts +0 -2
- package/dist/types/utilities/password.js +0 -20
- package/dist/types/utilities/password.js.map +0 -1
- package/dist/types/utilities/projection.d.ts +0 -8
- package/dist/types/utilities/projection.js +0 -37
- package/dist/types/utilities/projection.js.map +0 -1
- package/dist/types/utilities/time.d.ts +0 -13
- package/dist/types/utilities/time.js +0 -128
- package/dist/types/utilities/time.js.map +0 -1
|
@@ -10,7 +10,7 @@ export interface IAICompletionProvider {
|
|
|
10
10
|
}): Promise<TextVariantResult[]>;
|
|
11
11
|
}
|
|
12
12
|
export interface TextVariantResult {
|
|
13
|
-
|
|
13
|
+
id: string;
|
|
14
14
|
original: string;
|
|
15
15
|
arabic?: string[];
|
|
16
16
|
arabizi?: string[];
|
|
@@ -23,6 +23,6 @@ export interface AiConfiguration {
|
|
|
23
23
|
prompt?: string;
|
|
24
24
|
}
|
|
25
25
|
export interface ItemTextInput {
|
|
26
|
-
|
|
26
|
+
id: string;
|
|
27
27
|
text: string;
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-llm-interfaces.js","sourceRoot":"/","sources":["libraries/llm/interfaces/common-llm-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import { LLMProvider } from '../llm-provider-service';\n\nexport interface IAICompletionProvider {\n\tgenerateSearchVariantsChunksInBatch(\n\t\titems: ItemTextInput[],\n\t\tmodel?: string,\n\t\tinstructions?: string,\n\t\toptions?: {\n\t\t\tchunkSize?: number;\n\t\t\tmaxArabic?: number;\n\t\t\tmaxArabizi?: number;\n\t\t\tmaxTransliteration?: number;\n\t\t\tpollIntervalMs?: number;\n\t\t\tmaxWaitMs?: number;\n\t\t}\n\t): Promise<TextVariantResult[]>;\n}\n\nexport interface TextVariantResult {\n\
|
|
1
|
+
{"version":3,"file":"common-llm-interfaces.js","sourceRoot":"/","sources":["libraries/llm/interfaces/common-llm-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import { LLMProvider } from '../llm-provider-service';\n\nexport interface IAICompletionProvider {\n\tgenerateSearchVariantsChunksInBatch(\n\t\titems: ItemTextInput[],\n\t\tmodel?: string,\n\t\tinstructions?: string,\n\t\toptions?: {\n\t\t\tchunkSize?: number;\n\t\t\tmaxArabic?: number;\n\t\t\tmaxArabizi?: number;\n\t\t\tmaxTransliteration?: number;\n\t\t\tpollIntervalMs?: number;\n\t\t\tmaxWaitMs?: number;\n\t\t}\n\t): Promise<TextVariantResult[]>;\n}\n\nexport interface TextVariantResult {\n\tid: string;\n\toriginal: string;\n\tarabic?: string[];\n\tarabizi?: string[];\n\tarabicTransliteration?: string[];\n}\n\nexport interface AiConfiguration {\n\tprovider: LLMProvider;\n\tmodel?: string;\n\tinstructions?: string;\n\tprompt?: string;\n}\n\nexport interface ItemTextInput {\n\tid: string;\n\ttext: string;\n}\n"]}
|
|
@@ -72,7 +72,7 @@ class OpenAICompletionProvider {
|
|
|
72
72
|
body: {
|
|
73
73
|
model: finalModel,
|
|
74
74
|
instructions: finalInstructions,
|
|
75
|
-
input: JSON.stringify(chunkItems.map(({
|
|
75
|
+
input: JSON.stringify(chunkItems.map(({ id, text }) => ({ id: id, text }))),
|
|
76
76
|
text: {
|
|
77
77
|
format: {
|
|
78
78
|
type: 'json_schema',
|
|
@@ -125,13 +125,13 @@ class OpenAICompletionProvider {
|
|
|
125
125
|
console.error(`generateSearchVariantsChunksInBatch: failed to parse output for ${chunkId}`, outputText);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
return items.map(({
|
|
129
|
-
const r = resultsById.get(
|
|
128
|
+
return items.map(({ id, text }) => {
|
|
129
|
+
const r = resultsById.get(id);
|
|
130
130
|
if (!r) {
|
|
131
|
-
console.error(`generateSearchVariantsChunksInBatch: no result for itemId=${
|
|
132
|
-
return {
|
|
131
|
+
console.error(`generateSearchVariantsChunksInBatch: no result for itemId=${id}`);
|
|
132
|
+
return { id, original: text };
|
|
133
133
|
}
|
|
134
|
-
return {
|
|
134
|
+
return { id, original: text, ...r };
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-provider.js","sourceRoot":"/","sources":["libraries/llm/providers/openai-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAwC;AAGxC,MAAa,wBAAwB;IACnB,MAAM,CAAS;IACf,KAAK,CAAS;IAE/B,YAAY,MAA0B,EAAE,QAAgB,YAAY;QACnE,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACrF,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAcD,KAAK,CAAC,mCAAmC,CACxC,KAAsB,EACtB,KAAc,EACd,YAAqB,EACrB,OAOC;QAED,MAAM,UAAU,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC;QACvC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,GAAG,CAAC;QAC5C,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,CAAC,CAAC;QAC1C,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,CAAC,CAAC;QAC5C,MAAM,kBAAkB,GAAG,OAAO,EAAE,kBAAkB,IAAI,CAAC,CAAC;QAE5D,IAAI,CAAC;YACJ,MAAM,iBAAiB,GACtB,YAAY;gBACZ,IAAI,CAAC,0BAA0B,CAAC;oBAC/B,SAAS;oBACT,UAAU;oBACV,kBAAkB;iBAClB,CAAC,CAAC;YAEJ,MAAM,WAAW,GAAG,IAAI,CAAC,yBAAyB,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC,CAAC;YAElG,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YAEjD,IAAI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MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;QAC/D,CAAC;IACF,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,MAAiC;QAC5D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAe,CAAC;QACtC,IAAI,CAAC,MAAM;YAAE,OAAO,MAAM,CAAC;QAE3B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;QAEvC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YACrD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAzRD,4DAyRC","sourcesContent":["import OpenAI, { toFile } from 'openai';\nimport { IAICompletionProvider, ItemTextInput, TextVariantResult } from '../interfaces/common-llm-interfaces';\n\nexport class OpenAICompletionProvider implements IAICompletionProvider {\n\tprivate readonly client: OpenAI;\n\tprivate readonly model: string;\n\n\tconstructor(apiKey: string | undefined, model: string = 'gpt-5-nano') {\n\t\tif (!apiKey) {\n\t\t\tthrow new Error('OPENAI_API_KEY is required to construct OpenAICompletionProvider');\n\t\t}\n\t\tthis.client = new OpenAI({ apiKey });\n\t\tthis.model = model;\n\t}\n\n\t// ── Cost-optimized batch path ────────────────────────────────────\n\t// Implements everything discussed:\n\t// 1. Chunking — groups items (default 200/chunk) into one line per\n\t// chunk, so `instructions` is billed once per chunk instead of\n\t// once per item (biggest single cost lever).\n\t// 2. Short output keys — model emits {id, ar, az, tr} instead of\n\t// {itemId, arabic, arabizi, arabicTransliteration}; mapped back\n\t// to full field names locally, at zero token cost.\n\t// 3. Capped array lengths — schema enforces maxItems (not just a\n\t// prose suggestion), so the model can't drift to longer arrays.\n\t// 4. No echoed fields — model never re-emits itemId/original text;\n\t// both are re-attached locally from the input you already have.\n\tasync generateSearchVariantsChunksInBatch(\n\t\titems: ItemTextInput[],\n\t\tmodel?: string,\n\t\tinstructions?: string,\n\t\toptions?: {\n\t\t\tchunkSize?: number; // items per chunk/line — tune after testing token usage\n\t\t\tmaxArabic?: number; // cap on `arabic` variants (set to 1 for a single string-like result)\n\t\t\tmaxArabizi?: number; // cap on `arabizi` variants\n\t\t\tmaxTransliteration?: number; // cap on `arabicTransliteration` variants\n\t\t\tpollIntervalMs?: number;\n\t\t\tmaxWaitMs?: number;\n\t\t}\n\t): Promise<TextVariantResult[]> {\n\t\tconst finalModel = model ?? this.model;\n\t\tconst chunkSize = options?.chunkSize ?? 200;\n\t\tconst maxArabic = options?.maxArabic ?? 1;\n\t\tconst maxArabizi = options?.maxArabizi ?? 2;\n\t\tconst maxTransliteration = options?.maxTransliteration ?? 1;\n\n\t\ttry {\n\t\t\tconst finalInstructions =\n\t\t\t\tinstructions ??\n\t\t\t\tthis.buildOptimizedInstructions({\n\t\t\t\t\tmaxArabic,\n\t\t\t\t\tmaxArabizi,\n\t\t\t\t\tmaxTransliteration,\n\t\t\t\t});\n\n\t\t\tconst chunkSchema = this.buildOptimizedChunkSchema({ maxArabic, maxArabizi, maxTransliteration });\n\n\t\t\tconst chunks = this.chunkItems(items, chunkSize);\n\n\t\t\tif (chunks.length > 50_000) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Too many chunks (${chunks.length}) for a single batch file — increase chunkSize or split into multiple batch submissions.`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconsole.log(\n\t\t\t\t`generateSearchVariantsChunksInBatch: model=${finalModel} items=${items.length} chunkSize=${chunkSize} chunks=${chunks.length}`\n\t\t\t);\n\n\t\t\t// 1. Build JSONL — ONE line per chunk, not per item\n\t\t\tconst jsonl = chunks\n\t\t\t\t.map((chunkItems, i) =>\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\tcustom_id: `chunk-${i}`,\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\turl: '/v1/responses',\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tmodel: finalModel,\n\t\t\t\t\t\t\tinstructions: finalInstructions,\n\t\t\t\t\t\t\t// Only send what the model needs to generate from: id + text.\n\t\t\t\t\t\t\t// No other fields, no restating of instructions per item.\n\t\t\t\t\t\t\tinput: JSON.stringify(chunkItems.map(({ itemId, text }) => ({ id: itemId, text }))),\n\t\t\t\t\t\t\ttext: {\n\t\t\t\t\t\t\t\tformat: {\n\t\t\t\t\t\t\t\t\ttype: 'json_schema',\n\t\t\t\t\t\t\t\t\tname: 'text_variants_batch',\n\t\t\t\t\t\t\t\t\tschema: chunkSchema,\n\t\t\t\t\t\t\t\t\tstrict: true,\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)\n\t\t\t\t.join('\\n');\n\n\t\t\t// 2. Upload input file\n\t\t\tconst inputFile = await this.client.files.create({\n\t\t\t\tfile: await toFile(Buffer.from(jsonl, 'utf-8'), 'batch-input-optimized.jsonl'),\n\t\t\t\tpurpose: 'batch',\n\t\t\t});\n\n\t\t\t// 3. Create batch job\n\t\t\tlet batch = await this.client.batches.create({\n\t\t\t\tinput_file_id: inputFile.id,\n\t\t\t\tendpoint: '/v1/responses',\n\t\t\t\tcompletion_window: '24h',\n\t\t\t});\n\n\t\t\t// 4. Poll until done\n\t\t\tbatch = await this.pollBatch(batch.id, options?.pollIntervalMs, options?.maxWaitMs);\n\n\t\t\tif (batch.status !== 'completed') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Batch ${batch.id} ended with status \"${batch.status}\" (${batch.request_counts?.failed ?? 0} failed)`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// 5. Parse output — keyed by chunk custom_id, each containing an array of per-item results\n\t\t\tconst outputByChunk = await this.readJsonlFile(batch.output_file_id);\n\t\t\tconst errorsByChunk = await this.readJsonlFile(batch.error_file_id);\n\n\t\t\t// 6. Flatten chunk results into a per-itemId map, expanding short keys back to full field names\n\t\t\tconst resultsById = new Map<string, Partial<TextVariantResult>>();\n\n\t\t\tfor (const [chunkId, record] of outputByChunk.entries()) {\n\t\t\t\tconst body = record?.response?.body;\n\t\t\t\tconst outputText =\n\t\t\t\t\tbody?.output_text ??\n\t\t\t\t\tbody?.output\n\t\t\t\t\t\t?.find((o: any) => o.type === 'message')\n\t\t\t\t\t\t?.content?.find((c: any) => c.type === 'output_text')?.text;\n\n\t\t\t\tif (!outputText) {\n\t\t\t\t\tconst err = errorsByChunk.get(chunkId);\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`generateSearchVariantsChunksInBatch: no output for ${chunkId}`,\n\t\t\t\t\t\terr ?? record?.error\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tconst parsed = JSON.parse(outputText) as {\n\t\t\t\t\t\tresults: Array<{ id: string; ar: string[]; az: string[]; tr: string[] }>;\n\t\t\t\t\t};\n\t\t\t\t\tfor (const r of parsed.results) {\n\t\t\t\t\t\tresultsById.set(r.id, {\n\t\t\t\t\t\t\tarabic: r.ar,\n\t\t\t\t\t\t\tarabizi: r.az,\n\t\t\t\t\t\t\tarabicTransliteration: r.tr,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`generateSearchVariantsChunksInBatch: failed to parse output for ${chunkId}`,\n\t\t\t\t\t\toutputText\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 7. Merge back with original items, preserving order and filling gaps\n\t\t\treturn items.map(({ itemId, text }) => {\n\t\t\t\tconst r = resultsById.get(itemId);\n\t\t\t\tif (!r) {\n\t\t\t\t\tconsole.error(`generateSearchVariantsChunksInBatch: no result for itemId=${itemId}`);\n\t\t\t\t\treturn { itemId, original: text };\n\t\t\t\t}\n\t\t\t\treturn { itemId, original: text, ...r } as TextVariantResult;\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.error('generateSearchVariantsChunksInBatch failed', {\n\t\t\t\terror,\n\t\t\t\titemCount: items.length,\n\t\t\t\tmodel: finalModel,\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t// ── Helpers ──────────────────────────────────────────────────────\n\n\t// Compact instructions for the optimized path: short-key output format,\n\t// explicit array caps stated in prose (schema also enforces them),\n\t// and an explicit \"no commentary inside values\" rule to stop the model\n\t// padding fields with parenthetical notes.\n\tprivate buildOptimizedInstructions(caps: {\n\t\tmaxArabic: number;\n\t\tmaxArabizi: number;\n\t\tmaxTransliteration: number;\n\t}): string {\n\t\treturn [\n\t\t\t'You generate search-name variants for a food delivery app product/shop name.',\n\t\t\t'You will receive a JSON array of items, each with \"id\" and \"text\".',\n\t\t\t'For EACH item, return an object with:',\n\t\t\t`- id: the exact id provided (unchanged)`,\n\t\t\t`- ar: Arabic translation(s) in Arabic script, max ${caps.maxArabic}.`,\n\t\t\t`- az: Arabizi spelling(s) (Latin script/numerals, e.g. \"zaytoon\"), max ${caps.maxArabizi}.`,\n\t\t\t`- tr: Arabic-script transliteration(s) of the original word (not translated), max ${caps.maxTransliteration}.`,\n\t\t\t'Return one result per input item, same order, no items skipped or merged.',\n\t\t\t'Values must contain only the term itself — no parenthetical notes, no commentary.',\n\t\t\t'Return strict JSON matching the schema. No extra commentary, no extra fields.',\n\t\t].join('\\n');\n\t}\n\n\t// Schema for the OPTIMIZED chunk path: wraps a `results` array (one\n\t// entry per item in the chunk), short keys, and hard maxItems caps.\n\tprivate buildOptimizedChunkSchema(caps: {\n\t\tmaxArabic: number;\n\t\tmaxArabizi: number;\n\t\tmaxTransliteration: number;\n\t}) {\n\t\treturn {\n\t\t\ttype: 'object',\n\t\t\tproperties: {\n\t\t\t\tresults: {\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\titems: {\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tid: { type: 'string' },\n\t\t\t\t\t\t\tar: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: caps.maxArabic },\n\t\t\t\t\t\t\taz: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: caps.maxArabizi },\n\t\t\t\t\t\t\ttr: {\n\t\t\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\t\t\titems: { type: 'string' },\n\t\t\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\t\t\tmaxItems: caps.maxTransliteration,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\trequired: ['id', 'ar', 'az', 'tr'],\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: ['results'],\n\t\t\tadditionalProperties: false,\n\t\t};\n\t}\n\n\tprivate chunkItems<T>(items: T[], size: number): T[][] {\n\t\tconst out: T[][] = [];\n\t\tfor (let i = 0; i < items.length; i += size) {\n\t\t\tout.push(items.slice(i, i + size));\n\t\t}\n\t\treturn out;\n\t}\n\n\tprivate async pollBatch(\n\t\tbatchId: string,\n\t\tintervalMs = 5000,\n\t\tmaxWaitMs = 24 * 60 * 60 * 1000\n\t): Promise<OpenAI.Batches.Batch> {\n\t\tconst terminal = new Set(['completed', 'failed', 'expired', 'cancelled']);\n\t\tconst start = Date.now();\n\n\t\twhile (true) {\n\t\t\tconst batch = await this.client.batches.retrieve(batchId);\n\t\t\tconsole.log(\n\t\t\t\t`pollBatch: ${batchId} status=${batch.status} elapsed=${Math.round((Date.now() - start) / 1000)}s`\n\t\t\t);\n\t\t\tif (terminal.has(batch.status)) return batch;\n\n\t\t\tif (Date.now() - start > maxWaitMs) {\n\t\t\t\tthrow new Error(`Batch ${batchId} did not finish within ${maxWaitMs}ms (status: ${batch.status})`);\n\t\t\t}\n\n\t\t\tawait new Promise(resolve => setTimeout(resolve, intervalMs));\n\t\t}\n\t}\n\n\tprivate async readJsonlFile(fileId: string | null | undefined): Promise<Map<string, any>> {\n\t\tconst result = new Map<string, any>();\n\t\tif (!fileId) return result;\n\n\t\tconst fileResponse = await this.client.files.content(fileId);\n\t\tconst text = await fileResponse.text();\n\n\t\tfor (const line of text.split('\\n').filter(Boolean)) {\n\t\t\tconst record = JSON.parse(line);\n\t\t\tresult.set(record.custom_id, record);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"openai-provider.js","sourceRoot":"/","sources":["libraries/llm/providers/openai-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAwC;AAGxC,MAAa,wBAAwB;IACnB,MAAM,CAAS;IACf,KAAK,CAAS;IAE/B,YAAY,MAA0B,EAAE,QAAgB,YAAY;QACnE,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACrF,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAcD,KAAK,CAAC,mCAAmC,CACxC,KAAsB,EACtB,KAAc,EACd,YAAqB,EACrB,OAOC;QAED,MAAM,UAAU,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC;QACvC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,GAAG,CAAC;QAC5C,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,CAAC,CAAC;QAC1C,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,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interfaces/common-llm-interfaces';\n\nexport class OpenAICompletionProvider implements IAICompletionProvider {\n\tprivate readonly client: OpenAI;\n\tprivate readonly model: string;\n\n\tconstructor(apiKey: string | undefined, model: string = 'gpt-5-nano') {\n\t\tif (!apiKey) {\n\t\t\tthrow new Error('OPENAI_API_KEY is required to construct OpenAICompletionProvider');\n\t\t}\n\t\tthis.client = new OpenAI({ apiKey });\n\t\tthis.model = model;\n\t}\n\n\t// ── Cost-optimized batch path ────────────────────────────────────\n\t// Implements everything discussed:\n\t// 1. Chunking — groups items (default 200/chunk) into one line per\n\t// chunk, so `instructions` is billed once per chunk instead of\n\t// once per item (biggest single cost lever).\n\t// 2. Short output keys — model emits {id, ar, az, tr} instead of\n\t// {id, arabic, arabizi, arabicTransliteration}; mapped back\n\t// to full field names locally, at zero token cost.\n\t// 3. Capped array lengths — schema enforces maxItems (not just a\n\t// prose suggestion), so the model can't drift to longer arrays.\n\t// 4. No echoed fields — model never re-emits id/original text;\n\t// both are re-attached locally from the input you already have.\n\tasync generateSearchVariantsChunksInBatch(\n\t\titems: ItemTextInput[],\n\t\tmodel?: string,\n\t\tinstructions?: string,\n\t\toptions?: {\n\t\t\tchunkSize?: number; // items per chunk/line — tune after testing token usage\n\t\t\tmaxArabic?: number; // cap on `arabic` variants (set to 1 for a single string-like result)\n\t\t\tmaxArabizi?: number; // cap on `arabizi` variants\n\t\t\tmaxTransliteration?: number; // cap on `arabicTransliteration` variants\n\t\t\tpollIntervalMs?: number;\n\t\t\tmaxWaitMs?: number;\n\t\t}\n\t): Promise<TextVariantResult[]> {\n\t\tconst finalModel = model ?? this.model;\n\t\tconst chunkSize = options?.chunkSize ?? 200;\n\t\tconst maxArabic = options?.maxArabic ?? 1;\n\t\tconst maxArabizi = options?.maxArabizi ?? 2;\n\t\tconst maxTransliteration = options?.maxTransliteration ?? 1;\n\n\t\ttry {\n\t\t\tconst finalInstructions =\n\t\t\t\tinstructions ??\n\t\t\t\tthis.buildOptimizedInstructions({\n\t\t\t\t\tmaxArabic,\n\t\t\t\t\tmaxArabizi,\n\t\t\t\t\tmaxTransliteration,\n\t\t\t\t});\n\n\t\t\tconst chunkSchema = this.buildOptimizedChunkSchema({ maxArabic, maxArabizi, maxTransliteration });\n\n\t\t\tconst chunks = this.chunkItems(items, chunkSize);\n\n\t\t\tif (chunks.length > 50_000) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Too many chunks (${chunks.length}) for a single batch file — increase chunkSize or split into multiple batch submissions.`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconsole.log(\n\t\t\t\t`generateSearchVariantsChunksInBatch: model=${finalModel} items=${items.length} chunkSize=${chunkSize} chunks=${chunks.length}`\n\t\t\t);\n\n\t\t\t// 1. Build JSONL — ONE line per chunk, not per item\n\t\t\tconst jsonl = chunks\n\t\t\t\t.map((chunkItems, i) =>\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\tcustom_id: `chunk-${i}`,\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\turl: '/v1/responses',\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tmodel: finalModel,\n\t\t\t\t\t\t\tinstructions: finalInstructions,\n\t\t\t\t\t\t\t// Only send what the model needs to generate from: id + text.\n\t\t\t\t\t\t\t// No other fields, no restating of instructions per item.\n\t\t\t\t\t\t\tinput: JSON.stringify(chunkItems.map(({ id, text }) => ({ id: id, text }))),\n\t\t\t\t\t\t\ttext: {\n\t\t\t\t\t\t\t\tformat: {\n\t\t\t\t\t\t\t\t\ttype: 'json_schema',\n\t\t\t\t\t\t\t\t\tname: 'text_variants_batch',\n\t\t\t\t\t\t\t\t\tschema: chunkSchema,\n\t\t\t\t\t\t\t\t\tstrict: true,\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)\n\t\t\t\t.join('\\n');\n\n\t\t\t// 2. Upload input file\n\t\t\tconst inputFile = await this.client.files.create({\n\t\t\t\tfile: await toFile(Buffer.from(jsonl, 'utf-8'), 'batch-input-optimized.jsonl'),\n\t\t\t\tpurpose: 'batch',\n\t\t\t});\n\n\t\t\t// 3. Create batch job\n\t\t\tlet batch = await this.client.batches.create({\n\t\t\t\tinput_file_id: inputFile.id,\n\t\t\t\tendpoint: '/v1/responses',\n\t\t\t\tcompletion_window: '24h',\n\t\t\t});\n\n\t\t\t// 4. Poll until done\n\t\t\tbatch = await this.pollBatch(batch.id, options?.pollIntervalMs, options?.maxWaitMs);\n\n\t\t\tif (batch.status !== 'completed') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Batch ${batch.id} ended with status \"${batch.status}\" (${batch.request_counts?.failed ?? 0} failed)`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// 5. Parse output — keyed by chunk custom_id, each containing an array of per-item results\n\t\t\tconst outputByChunk = await this.readJsonlFile(batch.output_file_id);\n\t\t\tconst errorsByChunk = await this.readJsonlFile(batch.error_file_id);\n\n\t\t\t// 6. Flatten chunk results into a per-itemId map, expanding short keys back to full field names\n\t\t\tconst resultsById = new Map<string, Partial<TextVariantResult>>();\n\n\t\t\tfor (const [chunkId, record] of outputByChunk.entries()) {\n\t\t\t\tconst body = record?.response?.body;\n\t\t\t\tconst outputText =\n\t\t\t\t\tbody?.output_text ??\n\t\t\t\t\tbody?.output\n\t\t\t\t\t\t?.find((o: any) => o.type === 'message')\n\t\t\t\t\t\t?.content?.find((c: any) => c.type === 'output_text')?.text;\n\n\t\t\t\tif (!outputText) {\n\t\t\t\t\tconst err = errorsByChunk.get(chunkId);\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`generateSearchVariantsChunksInBatch: no output for ${chunkId}`,\n\t\t\t\t\t\terr ?? record?.error\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tconst parsed = JSON.parse(outputText) as {\n\t\t\t\t\t\tresults: Array<{ id: string; ar: string[]; az: string[]; tr: string[] }>;\n\t\t\t\t\t};\n\t\t\t\t\tfor (const r of parsed.results) {\n\t\t\t\t\t\tresultsById.set(r.id, {\n\t\t\t\t\t\t\tarabic: r.ar,\n\t\t\t\t\t\t\tarabizi: r.az,\n\t\t\t\t\t\t\tarabicTransliteration: r.tr,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`generateSearchVariantsChunksInBatch: failed to parse output for ${chunkId}`,\n\t\t\t\t\t\toutputText\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 7. Merge back with original items, preserving order and filling gaps\n\t\t\treturn items.map(({ id, text }) => {\n\t\t\t\tconst r = resultsById.get(id);\n\t\t\t\tif (!r) {\n\t\t\t\t\tconsole.error(`generateSearchVariantsChunksInBatch: no result for itemId=${id}`);\n\t\t\t\t\treturn { id, original: text };\n\t\t\t\t}\n\t\t\t\treturn { id, original: text, ...r } as TextVariantResult;\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.error('generateSearchVariantsChunksInBatch failed', {\n\t\t\t\terror,\n\t\t\t\titemCount: items.length,\n\t\t\t\tmodel: finalModel,\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t// ── Helpers ──────────────────────────────────────────────────────\n\n\t// Compact instructions for the optimized path: short-key output format,\n\t// explicit array caps stated in prose (schema also enforces them),\n\t// and an explicit \"no commentary inside values\" rule to stop the model\n\t// padding fields with parenthetical notes.\n\tprivate buildOptimizedInstructions(caps: {\n\t\tmaxArabic: number;\n\t\tmaxArabizi: number;\n\t\tmaxTransliteration: number;\n\t}): string {\n\t\treturn [\n\t\t\t'You generate search-name variants for a food delivery app product/shop name.',\n\t\t\t'You will receive a JSON array of items, each with \"id\" and \"text\".',\n\t\t\t'For EACH item, return an object with:',\n\t\t\t`- id: the exact id provided (unchanged)`,\n\t\t\t`- ar: Arabic translation(s) in Arabic script, max ${caps.maxArabic}.`,\n\t\t\t`- az: Arabizi spelling(s) (Latin script/numerals, e.g. \"zaytoon\"), max ${caps.maxArabizi}.`,\n\t\t\t`- tr: Arabic-script transliteration(s) of the original word (not translated), max ${caps.maxTransliteration}.`,\n\t\t\t'Return one result per input item, same order, no items skipped or merged.',\n\t\t\t'Values must contain only the term itself — no parenthetical notes, no commentary.',\n\t\t\t'Return strict JSON matching the schema. No extra commentary, no extra fields.',\n\t\t].join('\\n');\n\t}\n\n\t// Schema for the OPTIMIZED chunk path: wraps a `results` array (one\n\t// entry per item in the chunk), short keys, and hard maxItems caps.\n\tprivate buildOptimizedChunkSchema(caps: {\n\t\tmaxArabic: number;\n\t\tmaxArabizi: number;\n\t\tmaxTransliteration: number;\n\t}) {\n\t\treturn {\n\t\t\ttype: 'object',\n\t\t\tproperties: {\n\t\t\t\tresults: {\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\titems: {\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tid: { type: 'string' },\n\t\t\t\t\t\t\tar: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: caps.maxArabic },\n\t\t\t\t\t\t\taz: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: caps.maxArabizi },\n\t\t\t\t\t\t\ttr: {\n\t\t\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\t\t\titems: { type: 'string' },\n\t\t\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\t\t\tmaxItems: caps.maxTransliteration,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\trequired: ['id', 'ar', 'az', 'tr'],\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: ['results'],\n\t\t\tadditionalProperties: false,\n\t\t};\n\t}\n\n\tprivate chunkItems<T>(items: T[], size: number): T[][] {\n\t\tconst out: T[][] = [];\n\t\tfor (let i = 0; i < items.length; i += size) {\n\t\t\tout.push(items.slice(i, i + size));\n\t\t}\n\t\treturn out;\n\t}\n\n\tprivate async pollBatch(\n\t\tbatchId: string,\n\t\tintervalMs = 5000,\n\t\tmaxWaitMs = 24 * 60 * 60 * 1000\n\t): Promise<OpenAI.Batches.Batch> {\n\t\tconst terminal = new Set(['completed', 'failed', 'expired', 'cancelled']);\n\t\tconst start = Date.now();\n\n\t\twhile (true) {\n\t\t\tconst batch = await this.client.batches.retrieve(batchId);\n\t\t\tconsole.log(\n\t\t\t\t`pollBatch: ${batchId} status=${batch.status} elapsed=${Math.round((Date.now() - start) / 1000)}s`\n\t\t\t);\n\t\t\tif (terminal.has(batch.status)) return batch;\n\n\t\t\tif (Date.now() - start > maxWaitMs) {\n\t\t\t\tthrow new Error(`Batch ${batchId} did not finish within ${maxWaitMs}ms (status: ${batch.status})`);\n\t\t\t}\n\n\t\t\tawait new Promise(resolve => setTimeout(resolve, intervalMs));\n\t\t}\n\t}\n\n\tprivate async readJsonlFile(fileId: string | null | undefined): Promise<Map<string, any>> {\n\t\tconst result = new Map<string, any>();\n\t\tif (!fileId) return result;\n\n\t\tconst fileResponse = await this.client.files.content(fileId);\n\t\tconst text = await fileResponse.text();\n\n\t\tfor (const line of text.split('\\n').filter(Boolean)) {\n\t\t\tconst record = JSON.parse(line);\n\t\t\tresult.set(record.custom_id, record);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n"]}
|
|
@@ -7,6 +7,7 @@ declare class StatusTimeline {
|
|
|
7
7
|
updatedBy?: Ref<Admin>;
|
|
8
8
|
notes?: string;
|
|
9
9
|
requestFrom?: RequestFrom;
|
|
10
|
+
payload?: any;
|
|
10
11
|
}
|
|
11
12
|
export declare class RegularOrderStatusTimeline extends StatusTimeline {
|
|
12
13
|
status?: string;
|
|
@@ -20,6 +21,5 @@ export declare class CourierOrderStatusTimeline extends StatusTimeline {
|
|
|
20
21
|
export declare class ServiceBookingStatusTimeline extends StatusTimeline {
|
|
21
22
|
status?: ServiceBookingStatus;
|
|
22
23
|
timelineType: ServiceBookingStatusTimelineType;
|
|
23
|
-
payload?: any;
|
|
24
24
|
}
|
|
25
25
|
export {};
|
|
@@ -19,6 +19,7 @@ class StatusTimeline {
|
|
|
19
19
|
updatedBy;
|
|
20
20
|
notes;
|
|
21
21
|
requestFrom;
|
|
22
|
+
payload;
|
|
22
23
|
}
|
|
23
24
|
__decorate([
|
|
24
25
|
(0, typegoose_1.prop)({ type: Date, default: new Date() }),
|
|
@@ -36,6 +37,10 @@ __decorate([
|
|
|
36
37
|
(0, typegoose_1.prop)({ type: String, enum: enum_1.RequestFrom }),
|
|
37
38
|
__metadata("design:type", String)
|
|
38
39
|
], StatusTimeline.prototype, "requestFrom", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typegoose_1.prop)({ type: typegoose_1.mongoose.Schema.Types.Mixed }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], StatusTimeline.prototype, "payload", void 0);
|
|
39
44
|
class RegularOrderStatusTimeline extends StatusTimeline {
|
|
40
45
|
status;
|
|
41
46
|
timelineType;
|
|
@@ -79,7 +84,6 @@ __decorate([
|
|
|
79
84
|
class ServiceBookingStatusTimeline extends StatusTimeline {
|
|
80
85
|
status;
|
|
81
86
|
timelineType;
|
|
82
|
-
payload;
|
|
83
87
|
}
|
|
84
88
|
exports.ServiceBookingStatusTimeline = ServiceBookingStatusTimeline;
|
|
85
89
|
__decorate([
|
|
@@ -90,8 +94,4 @@ __decorate([
|
|
|
90
94
|
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceBookingStatusTimelineType }),
|
|
91
95
|
__metadata("design:type", String)
|
|
92
96
|
], ServiceBookingStatusTimeline.prototype, "timelineType", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
(0, typegoose_1.prop)({ type: typegoose_1.mongoose.Schema.Types.Mixed }),
|
|
95
|
-
__metadata("design:type", Object)
|
|
96
|
-
], ServiceBookingStatusTimeline.prototype, "payload", void 0);
|
|
97
97
|
//# sourceMappingURL=status-timeline.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-timeline.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/status-timeline.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2D;AAC3D,gDAAuC;AACvC,qDAOoC;AACpC,8CAAqC;AAErC,MAAM,cAAc;IAEZ,SAAS,CAAQ;IAGjB,SAAS,CAAc;IAGvB,KAAK,CAAU;IAGf,WAAW,CAAe;
|
|
1
|
+
{"version":3,"file":"status-timeline.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/status-timeline.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2D;AAC3D,gDAAuC;AACvC,qDAOoC;AACpC,8CAAqC;AAErC,MAAM,cAAc;IAEZ,SAAS,CAAQ;IAGjB,SAAS,CAAc;IAGvB,KAAK,CAAU;IAGf,WAAW,CAAe;IAG1B,OAAO,CAAO;CACrB;AAbO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;8BACvB,IAAI;iDAAC;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;iDACG;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACD;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;mDACT;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,oBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;;+CACvB;AAGtB,MAAa,0BAA2B,SAAQ,cAAc;IAKtD,MAAM,CAAU;IAMhB,YAAY,CAAU;IAGtB,IAAI,CAAa;CACxB;AAfD,gEAeC;AAVO;IAJN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,yBAAkB;KACxB,CAAC;;0DACqB;AAMhB;IAJN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,yBAAkB;KACxB,CAAC;;gEAC2B;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;wDACF;AAGzB,MAAa,0BAA2B,SAAQ,cAAc;IAEtD,MAAM,CAAsB;IAM5B,YAAY,CAAU;CAC7B;AATD,gEASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAkB,EAAE,CAAC;;0DACd;AAM5B;IAJN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,yBAAkB;KACxB,CAAC;;gEAC2B;AAG9B,MAAa,4BAA6B,SAAQ,cAAc;IAExD,MAAM,CAAwB;IAG9B,YAAY,CAAoC;CACvD;AAND,oEAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAAoB,EAAE,CAAC;;4DACd;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uCAAgC,EAAE,CAAC;;kEACxB","sourcesContent":["import { mongoose, prop, Ref } from '@typegoose/typegoose';\nimport { Admin } from '../admin.model';\nimport {\n\tCourierOrderStatus,\n\tRegularOrderStatus,\n\tRequestFrom,\n\tServiceBookingStatus,\n\tServiceBookingStatusTimelineType,\n\tStatusTimelineType,\n} from '../../../../utilities/enum';\nimport { User } from '../user.model';\n\nclass StatusTimeline {\n\t@prop({ type: Date, default: new Date() })\n\tpublic timestamp?: Date; // scope for discussion to change the name to date\n\n\t@prop({ ref: () => Admin })\n\tpublic updatedBy?: Ref<Admin>;\n\n\t@prop({ type: String })\n\tpublic notes?: string;\n\n\t@prop({ type: String, enum: RequestFrom })\n\tpublic requestFrom?: RequestFrom;\n\n\t@prop({ type: mongoose.Schema.Types.Mixed })\n\tpublic payload?: any;\n}\n\nexport class RegularOrderStatusTimeline extends StatusTimeline {\n\t@prop({\n\t\ttype: String,\n\t\tenum: RegularOrderStatus,\n\t})\n\tpublic status?: string;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: StatusTimelineType,\n\t})\n\tpublic timelineType?: string;\n\n\t@prop({ ref: () => User })\n\tpublic user?: Ref<User>;\n}\n\nexport class CourierOrderStatusTimeline extends StatusTimeline {\n\t@prop({ type: String, enum: CourierOrderStatus })\n\tpublic status?: CourierOrderStatus;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: StatusTimelineType,\n\t})\n\tpublic timelineType?: string;\n}\n\nexport class ServiceBookingStatusTimeline extends StatusTimeline {\n\t@prop({ type: String, enum: ServiceBookingStatus })\n\tpublic status?: ServiceBookingStatus;\n\n\t@prop({ required: true, type: String, enum: ServiceBookingStatusTimelineType })\n\tpublic timelineType!: ServiceBookingStatusTimelineType;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
package/package.json
CHANGED
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,sCA0BC;AAED,8CA4GC;AAED,oCAEC;AAjLD,qFAAqF;AAErF,IAAA,0CAAqB,GAAE,CAAC;AAExB,2CAA6C;AAC7C,mCAAmC;AACnC,6DAAuF;AACvF,+CAAgD;AAChD,6CAAiD;AACjD,6CAAoF;AACpF,iDAA2D;AAC3D,uDAAgE;AAChE,+CAAmD;AACnD,mDAAuD;AACvD,6CAA6E;AAC7E,0FAAuF;AACvF,yCAAgE;AAChE,yDAAmE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E,OAAO,CAAC,CAAC;IAC7D,MAAM,cAAc,GAAG,IAAI,iCAAc,CAAC,aAAa,CAAC,CAAC;IAEzD,kBAAS,CAAC,GAAG,CAAC,yCAAkB,EAAE,UAAU,CAAC,CAAC;IAC9C,kBAAS,CAAC,GAAG,CAAC,iCAAc,EAAE,cAAc,CAAC,CAAC;IAE9C,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAEtC,MAAM,IAAA,8BAAsB,EAAC,sCAAc,CAAC,OAAO,EAAE,WAAW,IAAI,2DAA4B,CAAC,GAAG,CAAC,CAAC,CAAC;IAEvG,MAAM,gBAAgB,GAAG,2CAAoB,CAAC,mBAAmB,EAAE,CAAC;IAEpE,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAiB,CAAC;IAEtD,KAAK,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,gBAAgB,EAAE,CAAC;QAC3E,IAAI,QAAQ,GAAG,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC3D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,QAAQ,GAAG,kBAAS,CAAC,GAAG,CAAC,iBAAwB,CAAC,CAAC;YACnD,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,IAAA,wBAAgB,EAAC,OAAO,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACjF,CAAC;AACF,CAAC;AAED,SAAgB,YAAY;IAC3B,OAAO,kBAAS,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Apply the soft delete plugin globally before any connections or models\nimport { applySoftDeletePlugin } from './libraries/mongo/plugins/soft-delete-plugin';\n\napplySoftDeletePlugin();\n\nimport { LibraryManager } from './libraries';\nimport { Container } from 'typedi';\nimport { ConfigurationOptions, ConfigurationService } from './libraries/configuration';\nimport { LyxaLogger } from './libraries/logger';\nimport { RedisService } from './libraries/redis';\nimport { initGlobalConnection, initLyxaMongoDbConnection } from './libraries/mongo';\nimport { SecretManagerService } from './libraries/secrets';\nimport { MicroServiceDispatcher } from './libraries/dispatcher';\nimport { TwilioService } from './libraries/twilio';\nimport { FirebaseService } from './libraries/firebase';\nimport { initRabbitMQConnection, subscribeToEvent } from './libraries/event';\nimport { SubscriptionRegistry } from './libraries/event/registry/SubscriptionRegistry';\nimport { GoogleMapsService, MapService } from './libraries/map';\nimport { CachedSettingsService } from './libraries/cache/settings';\nimport { FirebaseFcmService } from './libraries/notification/firebase-fcm.service';\nimport { BullMQService } from './libraries/bullmq/bull-mq-service';\nimport { BOBSecrets, BOBService, CashSettlementService } from './libraries/cash-settlement';\nimport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nimport { OsrmMapService } from './libraries/map/providers/osrm';\nimport { RabbitMQUrlMap } from './utilities/environment/rabbitmq-environments';\nimport { disconnectAllEntitiesFromInstance } from './libraries/socket/connections/instance-disconnect';\nimport { LyxaLoggerKit } from './libraries/logger-kit';\nimport { LyxaFcmService } from './libraries/notification/lyxa-fcm.service';\nimport { LyxaFcmSender } from './libraries/notification/lyxa-fcm-sender';\nimport { FirebaseMessageBuilderFactory } from './libraries/notification/firebase-message.builder';\nimport { GoogleTranslateService } from './libraries/google-translate';\nimport { LLMCompletionService, LLMProvider } from './libraries/llm/llm-provider-service';\n\nexport { ConfigurationOptions } from './libraries/configuration';\nexport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nexport { initGlobalConnection } from './libraries/mongo';\nexport * from './libraries/google-translate';\n\nexport async function bootstrapCore(options?: ConfigurationOptions) {\n\ttry {\n\t\tawait registerLibraries(options);\n\t\tgetLibraries().getLogger().logger.info('Successfully bootstrapped lyxa-core.');\n\n\t\tconst gracefulShutdown = async () => {\n\t\t\tgetLibraries().getLogger().logger.info('Received shutdown signal, shutting down gracefully...');\n\t\t\tif (options?.instanceType == 'socket') await disconnectAllEntitiesFromInstance();\n\t\t\tprocess.exit();\n\t\t};\n\n\t\tprocess.on('SIGTERM', gracefulShutdown);\n\t\tprocess.on('SIGINT', gracefulShutdown);\n\t\tprocess.on('uncaughtException', err => {\n\t\t\tconsole.log('err', err);\n\t\t\tgetLibraries().getLogger().logger.error('Uncaught exception, shutting down...', err);\n\t\t\tgracefulShutdown();\n\t\t});\n\t\tprocess.on('exit', code => {\n\t\t\tgetLibraries().getLogger().logger.info(`Exiting with code: ${code}`);\n\t\t});\n\n\t\tconsole.log('Created hooks.');\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n}\n\nexport async function registerLibraries(options?: ConfigurationOptions) {\n\t// Setup configuration.\n\tconst configurationInstance = new ConfigurationService(options);\n\tContainer.set(ConfigurationService, configurationInstance);\n\n\t// Setup redis.\n\tconst redisInstance = new RedisService(configurationInstance.redisURL);\n\tContainer.set(RedisService, redisInstance);\n\n\t// Setup secret\n\tconst secretInstance = new SecretManagerService(configurationInstance, redisInstance);\n\tContainer.set(SecretManagerService, secretInstance);\n\n\t// Setup BullMQ\n\tconst bullMQInstance = new BullMQService(redisInstance);\n\tContainer.set(BullMQService, bullMQInstance);\n\n\tconst mongoUrl = options?.mongoDbUrl\n\t\t? options.mongoDbUrl\n\t\t: await getLibraries().getSecretsService().getKey('MONGO_URL');\n\n\tawait initLyxaMongoDbConnection(mongoUrl!, options);\n\tawait initGlobalConnection(mongoUrl!, options!.environment);\n\n\tconst loggerInstance = new LyxaLogger(options!.instanceType!, mongoUrl!);\n\tContainer.set(LyxaLogger, loggerInstance);\n\n\tconst loggerKit = new LyxaLoggerKit({ instanceType: options!.instanceType! });\n\tContainer.set(LyxaLoggerKit, loggerKit);\n\n\t// Setup firebase\n\tconst firebaseInstance = new FirebaseService(configurationInstance!);\n\tContainer.set(FirebaseService, firebaseInstance);\n\n\t//Setup google translate\n\t// Container.set(GoogleTranslateService, Container.get(GoogleTranslateService));\n\n\t// Setup microservice dispatcher\n\tconst microserviceDispatcherInstance = new MicroServiceDispatcher(secretInstance);\n\tContainer.set(MicroServiceDispatcher, microserviceDispatcherInstance);\n\n\t// Setup twilio\n\tconst twilioServiceInstance = new TwilioService();\n\tContainer.set(TwilioService, twilioServiceInstance);\n\n\t// Setup LLM service\n\tconst llmCompletionService = new LLMCompletionService(LLMProvider.OPENAI);\n\tContainer.set(LLMCompletionService, llmCompletionService);\n\n\t// Setup map service\n\tconst googleMapsKey = await getLibraries().getSecretsService().getKey('GOOGLE_MAPS_API_KEY');\n\tconst googleMapService = new GoogleMapsService(redisInstance, googleMapsKey as string);\n\tconst osrmMapService = new OsrmMapService();\n\tconst mapServiceInstance = new MapService(googleMapService, osrmMapService);\n\tContainer.set(MapService, mapServiceInstance);\n\n\t// Setup cash settlement service\n\tconst bobUsername = await getLibraries().getSecretsService().getKey('BOB_USER_NAME');\n\tconst bobPassword = await getLibraries().getSecretsService().getKey('BOB_PASSWORD');\n\tconst bobURL = await getLibraries().getSecretsService().getKey('BOB_URL');\n\n\tconst bobService = new BOBService({\n\t\tBOB_USER_NAME: bobUsername,\n\t\tBOB_PASSWORD: bobPassword,\n\t\tBOB_URL: bobURL,\n\t} as BOBSecrets);\n\tconst cashSettlementServiceInstance = new CashSettlementService(bobService);\n\tContainer.set(CashSettlementService, cashSettlementServiceInstance);\n\tContainer.set(BOBService, bobService);\n\n\tconst settingsServiceInstance = new CachedSettingsService(redisInstance);\n\tContainer.set(CachedSettingsService, settingsServiceInstance);\n\n\ttry {\n\t\tconst settings = await settingsServiceInstance.getSettings();\n\t\tconst { _setTimezone } = await import('./utilities/dayjs/dayjs');\n\t\t_setTimezone(settings?.timezone || 'Asia/Beirut');\n\t\tconsole.log('Timezone initialized:', settings?.timezone || 'Asia/Beirut');\n\t} catch (error) {\n\t\tconsole.error('Failed to initialize timezone:', error);\n\t}\n\n\t// Setup fcm service\n\tconst fcmService = new FirebaseFcmService();\n\tconst builder = new FirebaseMessageBuilderFactory();\n\tconst lyxaFcmSender = new LyxaFcmSender(fcmService, builder);\n\tconst lyxaFcmService = new LyxaFcmService(lyxaFcmSender);\n\n\tContainer.set(FirebaseFcmService, fcmService);\n\tContainer.set(LyxaFcmService, lyxaFcmService);\n\n\tconsole.log('Initialized everything');\n\n\tawait initRabbitMQConnection(RabbitMQUrlMap[options?.environment ?? EnvironmentConfigurationType.DEV]);\n\n\tconst allSubscriptions = SubscriptionRegistry.getAllSubscriptions();\n\n\tconst instantiatedServices = new Map<Function, any>();\n\n\tfor (const { eventId, targetConstructor, methodName } of allSubscriptions) {\n\t\tlet instance = instantiatedServices.get(targetConstructor);\n\t\tif (!instance) {\n\t\t\tinstance = Container.get(targetConstructor as any);\n\t\t\tinstantiatedServices.set(targetConstructor, instance);\n\t\t}\n\n\t\tawait subscribeToEvent(eventId, async payload => instance[methodName](payload));\n\t}\n}\n\nexport function getLibraries(): LibraryManager {\n\treturn Container.get(LibraryManager);\n}\n"]}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { SignOptions } from 'jsonwebtoken';
|
|
2
|
-
import { EntityContext } from '../trpc/context';
|
|
3
|
-
import { RefreshToken } from './refreshtoken';
|
|
4
|
-
import { ReturnModelType } from '@typegoose/typegoose';
|
|
5
|
-
import { Rider } from '../mongo/models';
|
|
6
|
-
import { AuthEntityType } from '../../utilities/enum';
|
|
7
|
-
export { AuthEntityType };
|
|
8
|
-
export declare enum TokenType {
|
|
9
|
-
ACCESS = "ACCESS",
|
|
10
|
-
REFRESH = "REFRESH"
|
|
11
|
-
}
|
|
12
|
-
export interface RefreshTokenRecord {
|
|
13
|
-
token: string;
|
|
14
|
-
entityId: string;
|
|
15
|
-
entityType: AuthEntityType;
|
|
16
|
-
expiresAt: Date;
|
|
17
|
-
isRevoked: boolean;
|
|
18
|
-
metadata?: Record<string, unknown>;
|
|
19
|
-
}
|
|
20
|
-
export declare function getRefreshTokenModel(): ReturnModelType<typeof RefreshToken>;
|
|
21
|
-
export declare function getRiderModel(): ReturnModelType<typeof Rider>;
|
|
22
|
-
export declare function initializeRefreshTokenModel(globalConnection: any): void;
|
|
23
|
-
export declare function signAccessToken(entity: {
|
|
24
|
-
id: string;
|
|
25
|
-
type: AuthEntityType;
|
|
26
|
-
parameters: Record<string, unknown>;
|
|
27
|
-
}, options?: SignOptions): Promise<string>;
|
|
28
|
-
export declare function generateRefreshToken(entity: {
|
|
29
|
-
id: string;
|
|
30
|
-
type: AuthEntityType;
|
|
31
|
-
parameters?: Record<string, unknown>;
|
|
32
|
-
}, options?: {
|
|
33
|
-
expiresIn?: string | number;
|
|
34
|
-
}): Promise<string>;
|
|
35
|
-
export declare function verifyAccessToken(entityTypes: AuthEntityType[], token: string): Promise<EntityContext | undefined>;
|
|
36
|
-
export declare function validateRefreshToken(token: string): Promise<{
|
|
37
|
-
valid: boolean;
|
|
38
|
-
entity?: {
|
|
39
|
-
id: string;
|
|
40
|
-
type: AuthEntityType;
|
|
41
|
-
parameters?: Record<string, unknown>;
|
|
42
|
-
};
|
|
43
|
-
}>;
|
|
44
|
-
export declare function refreshTokens(refreshToken: string): Promise<{
|
|
45
|
-
accessToken: string;
|
|
46
|
-
refreshToken: string;
|
|
47
|
-
entity: {
|
|
48
|
-
id: string;
|
|
49
|
-
type: AuthEntityType;
|
|
50
|
-
};
|
|
51
|
-
} | null>;
|
|
52
|
-
export declare function revokeRefreshToken(token: string): Promise<boolean>;
|
|
53
|
-
export declare function revokeAllRefreshTokens(entityId: string, entityType: AuthEntityType): Promise<boolean>;
|
|
54
|
-
export declare function signTokenPair(entity: {
|
|
55
|
-
id: string;
|
|
56
|
-
type: AuthEntityType;
|
|
57
|
-
parameters?: Record<string, unknown>;
|
|
58
|
-
}, options?: {
|
|
59
|
-
accessTokenOptions?: SignOptions;
|
|
60
|
-
refreshTokenExpiresIn?: string | number;
|
|
61
|
-
}): Promise<{
|
|
62
|
-
accessToken: string;
|
|
63
|
-
refreshToken: string;
|
|
64
|
-
}>;
|
|
65
|
-
export declare function handleTokenRenewal(refreshToken: string): Promise<{
|
|
66
|
-
success: boolean;
|
|
67
|
-
entity?: {
|
|
68
|
-
id: string;
|
|
69
|
-
type: AuthEntityType;
|
|
70
|
-
parameters: Record<string, unknown>;
|
|
71
|
-
};
|
|
72
|
-
tokenStatus: 'valid' | 'expired' | 'revoked' | 'invalid';
|
|
73
|
-
newTokens?: {
|
|
74
|
-
accessToken: string;
|
|
75
|
-
refreshToken?: string | null;
|
|
76
|
-
};
|
|
77
|
-
}>;
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TokenType = exports.AuthEntityType = void 0;
|
|
7
|
-
exports.getRefreshTokenModel = getRefreshTokenModel;
|
|
8
|
-
exports.getRiderModel = getRiderModel;
|
|
9
|
-
exports.initializeRefreshTokenModel = initializeRefreshTokenModel;
|
|
10
|
-
exports.signAccessToken = signAccessToken;
|
|
11
|
-
exports.generateRefreshToken = generateRefreshToken;
|
|
12
|
-
exports.verifyAccessToken = verifyAccessToken;
|
|
13
|
-
exports.validateRefreshToken = validateRefreshToken;
|
|
14
|
-
exports.refreshTokens = refreshTokens;
|
|
15
|
-
exports.revokeRefreshToken = revokeRefreshToken;
|
|
16
|
-
exports.revokeAllRefreshTokens = revokeAllRefreshTokens;
|
|
17
|
-
exports.signTokenPair = signTokenPair;
|
|
18
|
-
exports.handleTokenRenewal = handleTokenRenewal;
|
|
19
|
-
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
20
|
-
const crypto_1 = require("crypto");
|
|
21
|
-
const refreshtoken_1 = require("./refreshtoken");
|
|
22
|
-
const index_1 = require("../../index");
|
|
23
|
-
const typegoose_1 = require("@typegoose/typegoose");
|
|
24
|
-
const models_1 = require("../mongo/models");
|
|
25
|
-
const enum_1 = require("../../utilities/enum");
|
|
26
|
-
Object.defineProperty(exports, "AuthEntityType", { enumerable: true, get: function () { return enum_1.AuthEntityType; } });
|
|
27
|
-
var TokenType;
|
|
28
|
-
(function (TokenType) {
|
|
29
|
-
TokenType["ACCESS"] = "ACCESS";
|
|
30
|
-
TokenType["REFRESH"] = "REFRESH";
|
|
31
|
-
})(TokenType || (exports.TokenType = TokenType = {}));
|
|
32
|
-
let actualRefreshTokenModel = null;
|
|
33
|
-
let riderModel = null;
|
|
34
|
-
function getRefreshTokenModel() {
|
|
35
|
-
if (!actualRefreshTokenModel) {
|
|
36
|
-
throw new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');
|
|
37
|
-
}
|
|
38
|
-
return actualRefreshTokenModel;
|
|
39
|
-
}
|
|
40
|
-
function getRiderModel() {
|
|
41
|
-
if (!riderModel) {
|
|
42
|
-
throw new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');
|
|
43
|
-
}
|
|
44
|
-
return riderModel;
|
|
45
|
-
}
|
|
46
|
-
function initializeRefreshTokenModel(globalConnection) {
|
|
47
|
-
actualRefreshTokenModel = (0, typegoose_1.getModelForClass)(refreshtoken_1.RefreshToken, { existingConnection: globalConnection });
|
|
48
|
-
riderModel = (0, typegoose_1.getModelForClass)(models_1.Rider, { existingConnection: globalConnection });
|
|
49
|
-
console.log('✅ RefreshToken model initialized');
|
|
50
|
-
}
|
|
51
|
-
async function signAccessToken(entity, options) {
|
|
52
|
-
if (!entity?.type) {
|
|
53
|
-
throw new Error('Entity type is required to sign token');
|
|
54
|
-
}
|
|
55
|
-
const secret = await (0, index_1.getLibraries)().getSecretsService().getKey(`${entity.type.toUpperCase()}_JWT_TOKEN`);
|
|
56
|
-
if (!secret) {
|
|
57
|
-
throw new Error(`No secret found for entity type ${entity.type}`);
|
|
58
|
-
}
|
|
59
|
-
const payload = {
|
|
60
|
-
id: entity.id,
|
|
61
|
-
type: entity.type,
|
|
62
|
-
parameters: entity.parameters,
|
|
63
|
-
tokenType: TokenType.ACCESS,
|
|
64
|
-
};
|
|
65
|
-
const tokenOptions = {
|
|
66
|
-
...options,
|
|
67
|
-
expiresIn: options?.expiresIn || '1d',
|
|
68
|
-
};
|
|
69
|
-
return jsonwebtoken_1.default.sign(payload, secret, tokenOptions);
|
|
70
|
-
}
|
|
71
|
-
async function generateRefreshToken(entity, options) {
|
|
72
|
-
const tokenValue = (0, crypto_1.randomBytes)(40).toString('hex');
|
|
73
|
-
const expiresIn = options?.expiresIn || '7d';
|
|
74
|
-
const expiresAt = new Date();
|
|
75
|
-
if (typeof expiresIn === 'string') {
|
|
76
|
-
const match = expiresIn.match(/^(\d+)([smhdwy])$/);
|
|
77
|
-
if (match) {
|
|
78
|
-
const value = parseInt(match[1]);
|
|
79
|
-
const unit = match[2];
|
|
80
|
-
switch (unit) {
|
|
81
|
-
case 's':
|
|
82
|
-
expiresAt.setSeconds(expiresAt.getSeconds() + value);
|
|
83
|
-
break;
|
|
84
|
-
case 'm':
|
|
85
|
-
expiresAt.setMinutes(expiresAt.getMinutes() + value);
|
|
86
|
-
break;
|
|
87
|
-
case 'h':
|
|
88
|
-
expiresAt.setHours(expiresAt.getHours() + value);
|
|
89
|
-
break;
|
|
90
|
-
case 'd':
|
|
91
|
-
expiresAt.setDate(expiresAt.getDate() + value);
|
|
92
|
-
break;
|
|
93
|
-
case 'w':
|
|
94
|
-
expiresAt.setDate(expiresAt.getDate() + value * 7);
|
|
95
|
-
break;
|
|
96
|
-
case 'y':
|
|
97
|
-
expiresAt.setFullYear(expiresAt.getFullYear() + value);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
expiresAt.setDate(expiresAt.getDate() + 7);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
else if (typeof expiresIn === 'number') {
|
|
106
|
-
expiresAt.setSeconds(expiresAt.getSeconds() + expiresIn);
|
|
107
|
-
}
|
|
108
|
-
await storeRefreshToken({
|
|
109
|
-
token: tokenValue,
|
|
110
|
-
entityId: entity.id,
|
|
111
|
-
entityType: entity.type,
|
|
112
|
-
expiresAt,
|
|
113
|
-
isRevoked: false,
|
|
114
|
-
metadata: entity.parameters,
|
|
115
|
-
});
|
|
116
|
-
return tokenValue;
|
|
117
|
-
}
|
|
118
|
-
async function storeRefreshToken(tokenRecord) {
|
|
119
|
-
const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
|
|
120
|
-
await tokenRepository.saveRefreshToken(tokenRecord);
|
|
121
|
-
}
|
|
122
|
-
async function verifyAccessToken(entityTypes, token) {
|
|
123
|
-
for (const entityType of entityTypes) {
|
|
124
|
-
const secret = await (0, index_1.getLibraries)()
|
|
125
|
-
.getSecretsService()
|
|
126
|
-
.getKey(entityType.toUpperCase() + '_JWT_TOKEN');
|
|
127
|
-
try {
|
|
128
|
-
const decoded = jsonwebtoken_1.default.verify(token, secret);
|
|
129
|
-
if (decoded.tokenType !== TokenType.ACCESS) {
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
return decoded;
|
|
133
|
-
}
|
|
134
|
-
catch (err) {
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return undefined;
|
|
138
|
-
}
|
|
139
|
-
async function validateRefreshToken(token) {
|
|
140
|
-
const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
|
|
141
|
-
const storedToken = await tokenRepository.findRefreshToken(token);
|
|
142
|
-
if (storedToken && storedToken?.entityType === enum_1.AuthEntityType.DELIVERY_BOY) {
|
|
143
|
-
const rider = await getRiderModel().findOne({ _id: storedToken.entityId }).lean();
|
|
144
|
-
if (rider && storedToken.metadata && rider.lastLoginDeviceId !== storedToken.metadata.deviceId) {
|
|
145
|
-
return { valid: false };
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (!storedToken) {
|
|
149
|
-
return { valid: false };
|
|
150
|
-
}
|
|
151
|
-
if (storedToken.expiresAt && new Date() > storedToken.expiresAt) {
|
|
152
|
-
return { valid: false };
|
|
153
|
-
}
|
|
154
|
-
if (storedToken.isRevoked) {
|
|
155
|
-
return { valid: false };
|
|
156
|
-
}
|
|
157
|
-
return {
|
|
158
|
-
valid: true,
|
|
159
|
-
entity: {
|
|
160
|
-
id: storedToken.entityId,
|
|
161
|
-
type: storedToken.entityType,
|
|
162
|
-
parameters: storedToken.metadata,
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
async function refreshTokens(refreshToken) {
|
|
167
|
-
const validation = await validateRefreshToken(refreshToken);
|
|
168
|
-
if (!validation.valid || !validation.entity) {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
await revokeRefreshToken(refreshToken);
|
|
172
|
-
const entity = validation.entity;
|
|
173
|
-
const newAccessToken = await signAccessToken({
|
|
174
|
-
id: entity.id,
|
|
175
|
-
type: entity.type,
|
|
176
|
-
parameters: entity.parameters || {},
|
|
177
|
-
});
|
|
178
|
-
const newRefreshToken = await generateRefreshToken({
|
|
179
|
-
id: entity.id,
|
|
180
|
-
type: entity.type,
|
|
181
|
-
parameters: entity.parameters,
|
|
182
|
-
});
|
|
183
|
-
return {
|
|
184
|
-
accessToken: newAccessToken,
|
|
185
|
-
refreshToken: newRefreshToken,
|
|
186
|
-
entity: {
|
|
187
|
-
id: entity.id,
|
|
188
|
-
type: entity.type,
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
async function revokeRefreshToken(token) {
|
|
193
|
-
const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
|
|
194
|
-
return tokenRepository.revokeRefreshToken(token);
|
|
195
|
-
}
|
|
196
|
-
async function revokeAllRefreshTokens(entityId, entityType) {
|
|
197
|
-
const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
|
|
198
|
-
return tokenRepository.revokeAllRefreshTokensForEntity(entityId, entityType);
|
|
199
|
-
}
|
|
200
|
-
async function signTokenPair(entity, options) {
|
|
201
|
-
const accessToken = await signAccessToken({
|
|
202
|
-
id: entity.id,
|
|
203
|
-
type: entity.type,
|
|
204
|
-
parameters: entity.parameters || {},
|
|
205
|
-
}, options?.accessTokenOptions);
|
|
206
|
-
const refreshToken = await generateRefreshToken({
|
|
207
|
-
id: entity.id,
|
|
208
|
-
type: entity.type,
|
|
209
|
-
parameters: entity.parameters,
|
|
210
|
-
}, { expiresIn: options?.refreshTokenExpiresIn });
|
|
211
|
-
return {
|
|
212
|
-
accessToken,
|
|
213
|
-
refreshToken,
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
async function handleTokenRenewal(refreshToken) {
|
|
217
|
-
const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
|
|
218
|
-
const storedToken = await tokenRepository.findRefreshToken(refreshToken);
|
|
219
|
-
if (!storedToken) {
|
|
220
|
-
return {
|
|
221
|
-
success: false,
|
|
222
|
-
tokenStatus: 'invalid',
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
const isRevoked = storedToken.isRevoked;
|
|
226
|
-
if (isRevoked) {
|
|
227
|
-
return {
|
|
228
|
-
success: false,
|
|
229
|
-
tokenStatus: 'revoked',
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
const isExpired = storedToken.isExpired();
|
|
233
|
-
const entityData = {
|
|
234
|
-
id: storedToken.entityId,
|
|
235
|
-
type: storedToken.entityType,
|
|
236
|
-
parameters: storedToken.metadata || {},
|
|
237
|
-
};
|
|
238
|
-
if (isExpired) {
|
|
239
|
-
const newTokens = await signTokenPair({
|
|
240
|
-
id: storedToken.entityId,
|
|
241
|
-
type: storedToken.entityType,
|
|
242
|
-
parameters: storedToken.metadata || {},
|
|
243
|
-
});
|
|
244
|
-
await tokenRepository.revokeRefreshToken(refreshToken);
|
|
245
|
-
return {
|
|
246
|
-
success: true,
|
|
247
|
-
entity: entityData,
|
|
248
|
-
tokenStatus: 'expired',
|
|
249
|
-
newTokens: {
|
|
250
|
-
accessToken: newTokens.accessToken,
|
|
251
|
-
refreshToken: newTokens.refreshToken,
|
|
252
|
-
},
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
const newAccessToken = await signAccessToken({
|
|
256
|
-
id: storedToken.entityId,
|
|
257
|
-
type: storedToken.entityType,
|
|
258
|
-
parameters: storedToken.metadata || {},
|
|
259
|
-
});
|
|
260
|
-
return {
|
|
261
|
-
success: true,
|
|
262
|
-
entity: entityData,
|
|
263
|
-
tokenStatus: 'valid',
|
|
264
|
-
newTokens: {
|
|
265
|
-
accessToken: newAccessToken,
|
|
266
|
-
refreshToken: null,
|
|
267
|
-
},
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
//# sourceMappingURL=index.js.map
|