@lyxa.ai/core 1.3.145 → 1.3.146

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.
@@ -12,5 +12,6 @@ export declare enum PublishEventEnums {
12
12
  SYNC_ALL_SHOPS_AVG_PREPARATION_TIME_EVENT = "sync_all_shops_avg_preperation_time_event",
13
13
  SYNC_SINGLE_SHOP_CACHE_EVENT = "sync_single_shop_cache_event",
14
14
  SYNC_SINGLE_SHOP_ORDER_AGAIN_CACHE_EVENT = "sync_single_shop_order_again_cache_event",
15
- SYNC_SINGLE_SHOP_SECTIONS_CACHE_EVENT = "sync_single_shop_sections_cache_event"
15
+ SYNC_SINGLE_SHOP_SECTIONS_CACHE_EVENT = "sync_single_shop_sections_cache_event",
16
+ SYNC_ALL_CUSTOMIZED_SHOP_SECTIONS_CACHE_EVENT = "sync_all_customized_shop_sections_cache_event"
16
17
  }
@@ -17,5 +17,6 @@ var PublishEventEnums;
17
17
  PublishEventEnums["SYNC_SINGLE_SHOP_CACHE_EVENT"] = "sync_single_shop_cache_event";
18
18
  PublishEventEnums["SYNC_SINGLE_SHOP_ORDER_AGAIN_CACHE_EVENT"] = "sync_single_shop_order_again_cache_event";
19
19
  PublishEventEnums["SYNC_SINGLE_SHOP_SECTIONS_CACHE_EVENT"] = "sync_single_shop_sections_cache_event";
20
+ PublishEventEnums["SYNC_ALL_CUSTOMIZED_SHOP_SECTIONS_CACHE_EVENT"] = "sync_all_customized_shop_sections_cache_event";
20
21
  })(PublishEventEnums || (exports.PublishEventEnums = PublishEventEnums = {}));
21
22
  //# sourceMappingURL=EventEnums.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventEnums.js","sourceRoot":"/","sources":["libraries/event/EventEnums.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAeX;AAfD,WAAY,iBAAiB;IAC5B,4EAAuD,CAAA;IACvD,sEAAiD,CAAA;IACjD,4EAAuD,CAAA;IACvD,sEAAiD,CAAA;IACjD,wGAAmF,CAAA;IACnF,sHAAiG,CAAA;IACjG,oGAA+E,CAAA;IAC/E,sFAAiE,CAAA;IACjE,8FAAyE,CAAA;IACzE,sHAAiG,CAAA;IACjG,4GAAuF,CAAA;IACvF,kFAA6D,CAAA;IAC7D,0GAAqF,CAAA;IACrF,oGAA+E,CAAA;AAChF,CAAC,EAfW,iBAAiB,iCAAjB,iBAAiB,QAe5B","sourcesContent":["export enum PublishEventEnums {\n\tADMIN_ACTIVITY_LOGS_EVENT = 'admin_activity_logs_event',\n\tMESSAGE_RECEIVED_EVENT = 'message_received_event',\n\tTICKET_NOTIFICATION_EVENT = 'ticket_notification_event',\n\tCART_ITEM_UPSERT_EVENT = 'cart_item_upsert_event',\n\tSHOP_ACTIVE_TIMINGS_BATCH_PROCESS_EVENT = 'shop_active_timings_batch_process_event',\n\tMONGO_STREAM_CHANGES_BATCH_PROCESS_SHOPS_EVENT = 'mongo_stream_changes_batch_process_shops_event',\n\tBULK_UPDATE_SHOPS_SEARCH_FIELDS_EVENT = 'bulk_update_shops_search_fields_event',\n\tSOCKET_PUSH_NOTIFICATION_EVENT = 'socket_push_notification_event',\n\tBULK_UPDATE_SHOP_ZONE_STATUS_EVENT = 'bulk_update_shop_zone_status_event',\n\tSYNC_ALL_PRODUCTS_PRODUCT_MARKETING_INFO_EVENT = 'sync_all_products_product_marketing_info_event',\n\tSYNC_ALL_SHOPS_AVG_PREPARATION_TIME_EVENT = 'sync_all_shops_avg_preperation_time_event',\n\tSYNC_SINGLE_SHOP_CACHE_EVENT = 'sync_single_shop_cache_event',\n\tSYNC_SINGLE_SHOP_ORDER_AGAIN_CACHE_EVENT = 'sync_single_shop_order_again_cache_event',\n\tSYNC_SINGLE_SHOP_SECTIONS_CACHE_EVENT = 'sync_single_shop_sections_cache_event'\n}\n"]}
1
+ {"version":3,"file":"EventEnums.js","sourceRoot":"/","sources":["libraries/event/EventEnums.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC5B,4EAAuD,CAAA;IACvD,sEAAiD,CAAA;IACjD,4EAAuD,CAAA;IACvD,sEAAiD,CAAA;IACjD,wGAAmF,CAAA;IACnF,sHAAiG,CAAA;IACjG,oGAA+E,CAAA;IAC/E,sFAAiE,CAAA;IACjE,8FAAyE,CAAA;IACzE,sHAAiG,CAAA;IACjG,4GAAuF,CAAA;IACvF,kFAA6D,CAAA;IAC7D,0GAAqF,CAAA;IACrF,oGAA+E,CAAA;IAC/E,oHAA+F,CAAA;AAChG,CAAC,EAhBW,iBAAiB,iCAAjB,iBAAiB,QAgB5B","sourcesContent":["export enum PublishEventEnums {\n\tADMIN_ACTIVITY_LOGS_EVENT = 'admin_activity_logs_event',\n\tMESSAGE_RECEIVED_EVENT = 'message_received_event',\n\tTICKET_NOTIFICATION_EVENT = 'ticket_notification_event',\n\tCART_ITEM_UPSERT_EVENT = 'cart_item_upsert_event',\n\tSHOP_ACTIVE_TIMINGS_BATCH_PROCESS_EVENT = 'shop_active_timings_batch_process_event',\n\tMONGO_STREAM_CHANGES_BATCH_PROCESS_SHOPS_EVENT = 'mongo_stream_changes_batch_process_shops_event',\n\tBULK_UPDATE_SHOPS_SEARCH_FIELDS_EVENT = 'bulk_update_shops_search_fields_event',\n\tSOCKET_PUSH_NOTIFICATION_EVENT = 'socket_push_notification_event',\n\tBULK_UPDATE_SHOP_ZONE_STATUS_EVENT = 'bulk_update_shop_zone_status_event',\n\tSYNC_ALL_PRODUCTS_PRODUCT_MARKETING_INFO_EVENT = 'sync_all_products_product_marketing_info_event',\n\tSYNC_ALL_SHOPS_AVG_PREPARATION_TIME_EVENT = 'sync_all_shops_avg_preperation_time_event',\n\tSYNC_SINGLE_SHOP_CACHE_EVENT = 'sync_single_shop_cache_event',\n\tSYNC_SINGLE_SHOP_ORDER_AGAIN_CACHE_EVENT = 'sync_single_shop_order_again_cache_event',\n\tSYNC_SINGLE_SHOP_SECTIONS_CACHE_EVENT = 'sync_single_shop_sections_cache_event',\n\tSYNC_ALL_CUSTOMIZED_SHOP_SECTIONS_CACHE_EVENT = 'sync_all_customized_shop_sections_cache_event'\n}\n \n"]}
@@ -12,7 +12,8 @@ export declare enum UpdateCollectionAtlasSearchEnum {
12
12
  TAGS = "tags",
13
13
  BRANDS = "brands",
14
14
  PRODUCTS = "products",
15
- CATEGORIES = "categories"
15
+ CATEGORIES = "categories",
16
+ USER_APP_SECTION_SETTING = "userAppSectionSetting"
16
17
  }
17
18
  declare const MongoStreamsBatchProcessShopsSchema: z.ZodObject<{
18
19
  operation: z.ZodNativeEnum<typeof ChangeStreamOperationTypes>;
@@ -19,6 +19,7 @@ var UpdateCollectionAtlasSearchEnum;
19
19
  UpdateCollectionAtlasSearchEnum["BRANDS"] = "brands";
20
20
  UpdateCollectionAtlasSearchEnum["PRODUCTS"] = "products";
21
21
  UpdateCollectionAtlasSearchEnum["CATEGORIES"] = "categories";
22
+ UpdateCollectionAtlasSearchEnum["USER_APP_SECTION_SETTING"] = "userAppSectionSetting";
22
23
  })(UpdateCollectionAtlasSearchEnum || (exports.UpdateCollectionAtlasSearchEnum = UpdateCollectionAtlasSearchEnum = {}));
23
24
  const baseFields = {
24
25
  operation: global_validation_1.ZodValidation.enumType(ChangeStreamOperationTypes, 'Mongo streams operation'),
@@ -1 +1 @@
1
- {"version":3,"file":"mongo-stream-changes-batch-process-shops-event.js","sourceRoot":"/","sources":["libraries/event/events/mongo-stream-changes-batch-process-shops-event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,4CAAyC;AACzC,8CAAkD;AAClD,uFAA0G;AAE1G,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACpC,+CAAiB,CAAA;IACjB,+CAAiB,CAAA;IACjB,iDAAmB,CAAA;IACnB,+CAAiB,CAAA;AACnB,CAAC,EALW,0BAA0B,0CAA1B,0BAA0B,QAKrC;AAED,IAAY,+BAMX;AAND,WAAY,+BAA+B;IACvC,kDAAe,CAAA;IACf,gDAAa,CAAA;IACb,oDAAiB,CAAA;IACjB,wDAAqB,CAAA;IACrB,4DAAyB,CAAA;AAC7B,CAAC,EANW,+BAA+B,+CAA/B,+BAA+B,QAM1C;AAED,MAAM,UAAU,GAAG;IACf,SAAS,EAAE,iCAAa,CAAC,QAAQ,CAAC,0BAA0B,EAAE,yBAAyB,CAAC;IACxF,gBAAgB,EAAE,iCAAa,CAAC,QAAQ,CAAC,+BAA+B,EAAE,oBAAoB,CAAC;IAC/F,aAAa,EAAE,OAAC,CAAC,GAAG,EAAE;IACtB,YAAY,EAAE,OAAC,CAAC,GAAG,EAAE;CACxB,CAAC;AACF,MAAM,aAAa,GAAG,IAAA,uCAAmB,EAAC,UAAU,CAAC,CAAC;AACtD,MAAM,EACF,UAAU,EAAE,mCAAmC,GAClD,GAAG,aAAa,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAIrD,MAAa,kCAAmC,SAAQ,qBAAkC;IACtF,YAAY,OAAyC;QACjD,KAAK,CAAC,8BAAiB,CAAC,8CAA8C,EAAE,OAAkC,CAAC,CAAC;IAChH,CAAC;CACJ;AAJD,gFAIC","sourcesContent":["import { z } from 'zod';\nimport { BaseEvent } from '../BaseEvent';\nimport { PublishEventEnums } from '../EventEnums';\nimport { createSchemaBuilder, DTO, ZodValidation } from '../../../utilities/validation/global-validation';\n\nexport enum ChangeStreamOperationTypes {\n INSERT = \"insert\",\n UPDATE = \"update\",\n REPLACE = \"replace\",\n DELETE = \"delete\"\n}\n\nexport enum UpdateCollectionAtlasSearchEnum {\n SHOPS = 'shops',\n TAGS = 'tags',\n BRANDS = 'brands',\n PRODUCTS = 'products',\n CATEGORIES = 'categories'\n}\n\nconst baseFields = {\n operation: ZodValidation.enumType(ChangeStreamOperationTypes, 'Mongo streams operation'),\n updateCollection: ZodValidation.enumType(UpdateCollectionAtlasSearchEnum, 'Updated collection'),\n updatedFields: z.any(),\n fullDocument: z.any()\n};\nconst schemaBuilder = createSchemaBuilder(baseFields);\nconst {\n BaseSchema: MongoStreamsBatchProcessShopsSchema,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\nexport type MongoStreamsBatchProcessShopsDTO = DTO<typeof MongoStreamsBatchProcessShopsSchema>;\n\nexport class MongoStreamsBatchProcessShopsEvent extends BaseEvent<Record<string, unknown>> {\n constructor(payload: MongoStreamsBatchProcessShopsDTO) {\n super(PublishEventEnums.MONGO_STREAM_CHANGES_BATCH_PROCESS_SHOPS_EVENT, payload as Record<string, unknown>);\t\t\n }\n}"]}
1
+ {"version":3,"file":"mongo-stream-changes-batch-process-shops-event.js","sourceRoot":"/","sources":["libraries/event/events/mongo-stream-changes-batch-process-shops-event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,4CAAyC;AACzC,8CAAkD;AAClD,uFAA0G;AAE1G,IAAY,0BAKX;AALD,WAAY,0BAA0B;IAClC,+CAAiB,CAAA;IACjB,+CAAiB,CAAA;IACjB,iDAAmB,CAAA;IACnB,+CAAiB,CAAA;AACrB,CAAC,EALW,0BAA0B,0CAA1B,0BAA0B,QAKrC;AAED,IAAY,+BAOX;AAPD,WAAY,+BAA+B;IACvC,kDAAe,CAAA;IACf,gDAAa,CAAA;IACb,oDAAiB,CAAA;IACjB,wDAAqB,CAAA;IACrB,4DAAyB,CAAA;IACzB,qFAAkD,CAAA;AACtD,CAAC,EAPW,+BAA+B,+CAA/B,+BAA+B,QAO1C;AAED,MAAM,UAAU,GAAG;IACf,SAAS,EAAE,iCAAa,CAAC,QAAQ,CAAC,0BAA0B,EAAE,yBAAyB,CAAC;IACxF,gBAAgB,EAAE,iCAAa,CAAC,QAAQ,CAAC,+BAA+B,EAAE,oBAAoB,CAAC;IAC/F,aAAa,EAAE,OAAC,CAAC,GAAG,EAAE;IACtB,YAAY,EAAE,OAAC,CAAC,GAAG,EAAE;CACxB,CAAC;AACF,MAAM,aAAa,GAAG,IAAA,uCAAmB,EAAC,UAAU,CAAC,CAAC;AACtD,MAAM,EACF,UAAU,EAAE,mCAAmC,GAClD,GAAG,aAAa,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAIrD,MAAa,kCAAmC,SAAQ,qBAAkC;IACtF,YAAY,OAAyC;QACjD,KAAK,CAAC,8BAAiB,CAAC,8CAA8C,EAAE,OAAkC,CAAC,CAAC;IAChH,CAAC;CACJ;AAJD,gFAIC","sourcesContent":["import { z } from 'zod';\nimport { BaseEvent } from '../BaseEvent';\nimport { PublishEventEnums } from '../EventEnums';\nimport { createSchemaBuilder, DTO, ZodValidation } from '../../../utilities/validation/global-validation';\n\nexport enum ChangeStreamOperationTypes {\n INSERT = \"insert\",\n UPDATE = \"update\",\n REPLACE = \"replace\",\n DELETE = \"delete\"\n}\n\nexport enum UpdateCollectionAtlasSearchEnum {\n SHOPS = 'shops',\n TAGS = 'tags',\n BRANDS = 'brands',\n PRODUCTS = 'products',\n CATEGORIES = 'categories',\n USER_APP_SECTION_SETTING = 'userAppSectionSetting'\n}\n\nconst baseFields = {\n operation: ZodValidation.enumType(ChangeStreamOperationTypes, 'Mongo streams operation'),\n updateCollection: ZodValidation.enumType(UpdateCollectionAtlasSearchEnum, 'Updated collection'),\n updatedFields: z.any(),\n fullDocument: z.any()\n};\nconst schemaBuilder = createSchemaBuilder(baseFields);\nconst {\n BaseSchema: MongoStreamsBatchProcessShopsSchema,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\nexport type MongoStreamsBatchProcessShopsDTO = DTO<typeof MongoStreamsBatchProcessShopsSchema>;\n\nexport class MongoStreamsBatchProcessShopsEvent extends BaseEvent<Record<string, unknown>> {\n constructor(payload: MongoStreamsBatchProcessShopsDTO) {\n super(PublishEventEnums.MONGO_STREAM_CHANGES_BATCH_PROCESS_SHOPS_EVENT, payload as Record<string, unknown>);\n }\n}"]}
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { BaseEvent } from '../BaseEvent';
3
+ import { DTO } from '../../../utilities/validation/global-validation';
4
+ export declare const SynchronizeAllCustomizedShopSectionsCacheSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
5
+ export type SynchronizeAllCustomizedShopSectionsCacheDTO = DTO<typeof SynchronizeAllCustomizedShopSectionsCacheSchema>;
6
+ export declare class SynchronizeAllCustomizedShopSectionsCacheEvent extends BaseEvent<Record<string, unknown>> {
7
+ constructor(payload: SynchronizeAllCustomizedShopSectionsCacheDTO);
8
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SynchronizeAllCustomizedShopSectionsCacheEvent = exports.SynchronizeAllCustomizedShopSectionsCacheSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const BaseEvent_1 = require("../BaseEvent");
6
+ const EventEnums_1 = require("../EventEnums");
7
+ exports.SynchronizeAllCustomizedShopSectionsCacheSchema = zod_1.z.object({});
8
+ class SynchronizeAllCustomizedShopSectionsCacheEvent extends BaseEvent_1.BaseEvent {
9
+ constructor(payload) {
10
+ super(EventEnums_1.PublishEventEnums.SYNC_ALL_CUSTOMIZED_SHOP_SECTIONS_CACHE_EVENT, payload);
11
+ }
12
+ }
13
+ exports.SynchronizeAllCustomizedShopSectionsCacheEvent = SynchronizeAllCustomizedShopSectionsCacheEvent;
14
+ //# sourceMappingURL=sync-all-customized-shop-sections-cache-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-all-customized-shop-sections-cache-event.js","sourceRoot":"/","sources":["libraries/event/events/sync-all-customized-shop-sections-cache-event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,4CAAyC;AACzC,8CAAkD;AAGrC,QAAA,+CAA+C,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAI3E,MAAa,8CAA+C,SAAQ,qBAAkC;IAClG,YAAY,OAAqD;QAC7D,KAAK,CAAC,8BAAiB,CAAC,6CAA6C,EAAE,OAAkC,CAAC,CAAC;IAC/G,CAAC;CACJ;AAJD,wGAIC","sourcesContent":["import { z } from 'zod';\nimport { BaseEvent } from '../BaseEvent';\nimport { PublishEventEnums } from '../EventEnums';\nimport { DTO } from '../../../utilities/validation/global-validation';\n\nexport const SynchronizeAllCustomizedShopSectionsCacheSchema = z.object({})\n \nexport type SynchronizeAllCustomizedShopSectionsCacheDTO = DTO<typeof SynchronizeAllCustomizedShopSectionsCacheSchema>;\n\nexport class SynchronizeAllCustomizedShopSectionsCacheEvent extends BaseEvent<Record<string, unknown>> {\n constructor(payload: SynchronizeAllCustomizedShopSectionsCacheDTO) {\n super(PublishEventEnums.SYNC_ALL_CUSTOMIZED_SHOP_SECTIONS_CACHE_EVENT, payload as Record<string, unknown>);\n }\n}"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.3.145
25
+ Version: 1.3.146
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.3.145",
3
+ "version": "1.3.146",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -26,8 +26,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
26
26
  searchFields?: string[] | undefined;
27
27
  } | undefined;
28
28
  sort?: Record<string, 1 | -1> | undefined;
29
- select?: Record<string, 0 | 1> | undefined;
30
29
  populate?: any;
30
+ select?: Record<string, 0 | 1> | undefined;
31
31
  query?: Record<string, any> | undefined;
32
32
  }, {
33
33
  search?: {
@@ -36,8 +36,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
36
36
  } | undefined;
37
37
  sort?: Record<string, 1 | -1> | undefined;
38
38
  size?: number | undefined;
39
- select?: Record<string, 0 | 1> | undefined;
40
39
  populate?: any;
40
+ select?: Record<string, 0 | 1> | undefined;
41
41
  query?: Record<string, any> | undefined;
42
42
  page?: number | undefined;
43
43
  }>>;
@@ -733,12 +733,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
733
733
  populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
734
734
  }, "strip", z.ZodTypeAny, {
735
735
  _id: import("mongoose").Types.ObjectId;
736
- select?: Record<string, 0 | 1> | undefined;
737
736
  populate?: any;
737
+ select?: Record<string, 0 | 1> | undefined;
738
738
  }, {
739
739
  _id: string | import("mongoose").Types.ObjectId;
740
- select?: Record<string, 0 | 1> | undefined;
741
740
  populate?: any;
741
+ select?: Record<string, 0 | 1> | undefined;
742
742
  }>;
743
743
  export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
744
744
  export declare const GetProductByIdInputSchema: z.ZodObject<{
@@ -751,12 +751,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
751
751
  _id: import("mongoose").Types.ObjectId;
752
752
  withAttributeHiddenItems: boolean;
753
753
  withAddonsHiddenItems: boolean;
754
- select?: Record<string, 0 | 1> | undefined;
755
754
  populate?: any;
755
+ select?: Record<string, 0 | 1> | undefined;
756
756
  }, {
757
757
  _id: string | import("mongoose").Types.ObjectId;
758
- select?: Record<string, 0 | 1> | undefined;
759
758
  populate?: any;
759
+ select?: Record<string, 0 | 1> | undefined;
760
760
  withAttributeHiddenItems?: boolean | undefined;
761
761
  withAddonsHiddenItems?: boolean | undefined;
762
762
  }>;
@@ -768,13 +768,13 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
768
768
  userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
769
769
  }, "strip", z.ZodTypeAny, {
770
770
  _id: import("mongoose").Types.ObjectId;
771
- select?: Record<string, 0 | 1> | undefined;
772
771
  populate?: any;
772
+ select?: Record<string, 0 | 1> | undefined;
773
773
  userOrderCompletionScope?: UserOrderCompletionScope | undefined;
774
774
  }, {
775
775
  _id: string | import("mongoose").Types.ObjectId;
776
- select?: Record<string, 0 | 1> | undefined;
777
776
  populate?: any;
777
+ select?: Record<string, 0 | 1> | undefined;
778
778
  userOrderCompletionScope?: UserOrderCompletionScope | undefined;
779
779
  }>;
780
780
  export type GetOrderByIdInputDTO = DTO<typeof GetOrderByIdInputSchema>;
@@ -782,11 +782,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
782
782
  select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
783
783
  populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
784
784
  }, "strip", z.ZodTypeAny, {
785
- select?: Record<string, 0 | 1> | undefined;
786
785
  populate?: any;
787
- }, {
788
786
  select?: Record<string, 0 | 1> | undefined;
787
+ }, {
789
788
  populate?: any;
789
+ select?: Record<string, 0 | 1> | undefined;
790
790
  }>>;
791
791
  export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
792
792
  export declare const GetOneQuerySchema: z.ZodObject<{
@@ -794,12 +794,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
794
794
  select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
795
795
  populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
796
796
  }, "strip", z.ZodTypeAny, {
797
- select?: Record<string, 0 | 1> | undefined;
798
797
  populate?: any;
798
+ select?: Record<string, 0 | 1> | undefined;
799
799
  query?: Record<string, any> | undefined;
800
800
  }, {
801
- select?: Record<string, 0 | 1> | undefined;
802
801
  populate?: any;
802
+ select?: Record<string, 0 | 1> | undefined;
803
803
  query?: Record<string, any> | undefined;
804
804
  }>;
805
805
  export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
@@ -7,6 +7,7 @@ import { SynchronizeAllShopsAvgPreparationTimeDTO } from '../libraries/event/eve
7
7
  import { SyncSingleShopCacheDTO } from '../libraries/event/events/sync-single-shop-in-cache-event';
8
8
  import { SyncSingleShopOrderAgainCacheDTO } from '../libraries/event/events/sync-order-again-sections-for-shop-event';
9
9
  import { SyncSingleShopSectionsInCacheDTO } from '../libraries/event/events/sync-single-shop-sections-in-cache-event';
10
+ import { SynchronizeAllCustomizedShopSectionsCacheDTO } from '../libraries/event/events/sync-all-customized-shop-sections-cache-event';
10
11
  export declare function getChangedFields<T extends Record<string, any>>(oldDoc: T, newDoc: T, payload?: Partial<T>): Record<keyof T, {
11
12
  old: any;
12
13
  new: any;
@@ -37,3 +38,4 @@ export declare function publishAllShopsAvgPreperationTimeSyncProcessEvent(payloa
37
38
  export declare function publishSyncSingleShopInCacheProcessEvent(payload: SyncSingleShopCacheDTO): Promise<void>;
38
39
  export declare function publishSyncSingleShopOrderAgainSectionsInCacheProcessEvent(payload: SyncSingleShopOrderAgainCacheDTO): Promise<void>;
39
40
  export declare function publishSyncSingleShopSectionsInCacheProcessEvent(payload: SyncSingleShopSectionsInCacheDTO): Promise<void>;
41
+ export declare function publishAllCustomizedShopSectionsCacheProcessEvent(payload: SynchronizeAllCustomizedShopSectionsCacheDTO): Promise<void>;
@@ -13,6 +13,7 @@ exports.publishAllShopsAvgPreperationTimeSyncProcessEvent = publishAllShopsAvgPr
13
13
  exports.publishSyncSingleShopInCacheProcessEvent = publishSyncSingleShopInCacheProcessEvent;
14
14
  exports.publishSyncSingleShopOrderAgainSectionsInCacheProcessEvent = publishSyncSingleShopOrderAgainSectionsInCacheProcessEvent;
15
15
  exports.publishSyncSingleShopSectionsInCacheProcessEvent = publishSyncSingleShopSectionsInCacheProcessEvent;
16
+ exports.publishAllCustomizedShopSectionsCacheProcessEvent = publishAllCustomizedShopSectionsCacheProcessEvent;
16
17
  const event_1 = require("../libraries/event");
17
18
  const mongo_stream_changes_batch_process_shops_event_1 = require("../libraries/event/events/mongo-stream-changes-batch-process-shops-event");
18
19
  const admin_logs_event_1 = require("../libraries/event/events/admin-logs-event");
@@ -24,6 +25,7 @@ const sync_avg_prep_time_in_all_shops_event_1 = require("../libraries/event/even
24
25
  const sync_single_shop_in_cache_event_1 = require("../libraries/event/events/sync-single-shop-in-cache-event");
25
26
  const sync_order_again_sections_for_shop_event_1 = require("../libraries/event/events/sync-order-again-sections-for-shop-event");
26
27
  const sync_single_shop_sections_in_cache_event_1 = require("../libraries/event/events/sync-single-shop-sections-in-cache-event");
28
+ const sync_all_customized_shop_sections_cache_event_1 = require("../libraries/event/events/sync-all-customized-shop-sections-cache-event");
27
29
  function getChangedFields(oldDoc, newDoc, payload) {
28
30
  const changes = {};
29
31
  const oldObj = typeof oldDoc.toObject === 'function' ? oldDoc.toObject() : oldDoc;
@@ -120,4 +122,8 @@ async function publishSyncSingleShopSectionsInCacheProcessEvent(payload) {
120
122
  const syncSingleShopSectionsInCacheSyncEvent = new sync_single_shop_sections_in_cache_event_1.SyncSingleShopSectionsInCacheEvent(payload);
121
123
  await (0, event_1.publishEvent)(syncSingleShopSectionsInCacheSyncEvent);
122
124
  }
125
+ async function publishAllCustomizedShopSectionsCacheProcessEvent(payload) {
126
+ const SyncAllCustomizedShopSectionsCacheProcessEvent = new sync_all_customized_shop_sections_cache_event_1.SynchronizeAllCustomizedShopSectionsCacheEvent({});
127
+ await (0, event_1.publishEvent)(SyncAllCustomizedShopSectionsCacheProcessEvent);
128
+ }
123
129
  //# sourceMappingURL=events-common-methods.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"events-common-methods.js","sourceRoot":"/","sources":["utilities/events-common-methods.ts"],"names":[],"mappings":";;AAuCA,4CAyBC;AAwCD,sDAaC;AAKD,wDAKC;AAED,sDAcC;AAED,gFAIC;AAED,gHAMC;AAED,wGAIC;AAED,oGAIC;AAED,gHAMC;AAED,8GAMC;AAED,4FAKC;AAED,gIAMC;AAED,4G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AK,UAAU,4CAA4C,CAAC,OAAqC;IACvG,MAAM,gCAAgC,GACrC,IAAI,uEAA8B,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,IAAA,oBAAY,EAAC,gCAAgC,CAAC,CAAC;AACtD,CAAC;AAEM,KAAK,UAAU,kDAAkD,CACvE,OAAsD;IAEtD,MAAM,+CAA+C,GACpD,IAAI,gGAA+C,CAAC,EAAE,CAAC,CAAC;IACzD,MAAM,IAAA,oBAAY,EAAC,+CAA+C,CAAC,CAAC;AACrE,CAAC;AAEM,KAAK,UAAU,iDAAiD,CACtE,OAAiD;IAEjD,MAAM,8CAA8C,GACnD,IAAI,kFAA0C,CAAC,EAAE,CAAC,CAAC;IACpD,MAAM,IAAA,oBAAY,EAAC,8CAA8C,CAAC,CAAC;AACpE,CAAC;AAEM,KAAK,UAAU,wCAAwC,CAAC,OAA+B;IAC7F,MAAM,4BAA4B,GAAuC,IAAI,4DAA0B,CACtG,OAAO,CACP,CAAC;IACF,MAAM,IAAA,oBAAY,EAAC,4BAA4B,CAAC,CAAC;AAClD,CAAC;AAEM,KAAK,UAAU,0DAA0D,CAC/E,OAAyC;IAEzC,MAAM,wCAAwC,GAC7C,IAAI,+EAAoC,CAAC,OAAO,CAAC,CAAC;IACnD,MAAM,IAAA,oBAAY,EAAC,wCAAwC,CAAC,CAAC;AAC9D,CAAC;AAEM,KAAK,UAAU,gDAAgD,CACrE,OAAyC;IAEzC,MAAM,sCAAsC,GAC3C,IAAI,6EAAkC,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,IAAA,oBAAY,EAAC,sCAAsC,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["import { mongoose } from '@typegoose/typegoose';\nimport { publishEvent } from '../libraries/event';\nimport { AdminLogsUpdatedFieldsType } from './enum';\nimport { BaseEvent } from '../libraries/event/BaseEvent';\nimport {\n\tMongoStreamsBatchProcessShopsDTO,\n\tMongoStreamsBatchProcessShopsEvent,\n} from '../libraries/event/events/mongo-stream-changes-batch-process-shops-event';\nimport { AdminActivityLogsEvent } from '../libraries/event/events/admin-logs-event';\nimport { ShopActiveTimingsBatchProcessEvent } from '../libraries/event/events/shop-active-timings-batch-process-event';\nimport { BulkUpdateShopsSearchFieldsBatchProcessEvent } from '../libraries/event/events/bulk-update-shops-search-fields-batch-process-event';\nimport {\n\tBulkUpdateShopsZoneStatusDTO,\n\tBulkUpdateShopsZoneStatusEvent,\n} from '../libraries/event/events/bulk-update-zone-status-in-shops-event';\nimport {\n\tSynchronizeAllProductsProductMarketingInfoDTO,\n\tSynchronizeAllProductsProductMarketingInfoEvent,\n} from '../libraries/event/events/sync-all-products-product-marketing-info-event';\nimport {\n\tSynchronizeAllShopsAvgPreparationTimeDTO,\n\tSynchronizeAllShopsAvgPreparationTimeEvent,\n} from '../libraries/event/events/sync-avg-prep-time-in-all-shops-event';\nimport {\n\tSyncSingleShopCacheDTO,\n\tSyncSingleShopInCacheEvent,\n} from '../libraries/event/events/sync-single-shop-in-cache-event';\nimport {\n\tSyncSingleShopOrderAgainCacheDTO,\n\tSyncSingleShopOrderAgainInCacheEvent,\n} from '../libraries/event/events/sync-order-again-sections-for-shop-event';\nimport {\n\tSyncSingleShopSectionsInCacheDTO,\n\tSyncSingleShopSectionsInCacheEvent,\n} from '../libraries/event/events/sync-single-shop-sections-in-cache-event';\n\n/**\n * Returns changed fields between two objects (shallow comparison).\n */\nexport function getChangedFields<T extends Record<string, any>>(\n\toldDoc: T,\n\tnewDoc: T,\n\tpayload?: Partial<T>\n): Record<keyof T, { old: any; new: any }> {\n\tconst changes = {} as Record<keyof T, { old: any; new: any }>;\n\n\tconst oldObj = typeof oldDoc.toObject === 'function' ? oldDoc.toObject() : oldDoc;\n\tconst newObj = typeof newDoc.toObject === 'function' ? newDoc.toObject() : newDoc;\n\n\tconst keysToCheck = payload\n\t\t? Object.keys(payload)\n\t\t: Array.from(new Set([...Object.keys(oldObj), ...Object.keys(newObj)]));\n\n\tfor (const key of keysToCheck) {\n\t\tconst oldValue = oldObj[key];\n\t\tconst newValue = newObj[key];\n\t\tconst cleanedOld = deepCleanSettingsValues(oldValue);\n\t\tconst cleanedNew = deepCleanSettingsValues(newValue);\n\t\tif (payload || JSON.stringify(cleanedOld) !== JSON.stringify(cleanedNew)) {\n\t\t\tchanges[key as keyof T] = { old: oldValue, new: newValue };\n\t\t}\n\t}\n\n\treturn changes;\n}\n\n// removes _id and deletedAt fields from objects, array of objects and prepares for data that has setting changes\nfunction deepCleanSettingsValues(value: any): any {\n\t// CASE 1: Array\n\tif (Array.isArray(value)) {\n\t\t// If array contains primitives → return as-is\n\t\tif (value.every(v => v === null || typeof v !== 'object')) {\n\t\t\treturn value;\n\t\t}\n\n\t\t// If array contains objects → deep clean each object\n\t\treturn value.map(item => deepCleanSettingsValues(item));\n\t}\n\n\t// CASE 2: Null → return as is\n\tif (value === null) return value;\n\n\t// CASE 3: Plain Object\n\tif (typeof value === 'object') {\n\t\tconst cleanedObj: any = {};\n\n\t\tfor (const key in value) {\n\t\t\tif (key === '_id' || key === 'deletedAt' || value[key] === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcleanedObj[key] = deepCleanSettingsValues(value[key]);\n\t\t}\n\n\t\treturn cleanedObj;\n\t}\n\n\t// CASE 4: Primitive (string, number, boolean)\n\treturn value;\n}\n\n/**\n * Filters changed fields to only those that exist in the payload.\n */\nexport function filterRelevantChanges<T>(\n\tallChanges: Record<string, { old: any; new: any }>,\n\tpayload: Partial<T>\n): Record<string, { old: any; new: any }> {\n\treturn Object.keys(payload).reduce(\n\t\t(acc, key) => {\n\t\t\tif (allChanges[key]) {\n\t\t\t\tacc[key] = allChanges[key];\n\t\t\t}\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<string, { old: any; new: any }>\n\t);\n}\n\n/**\n * Extracts either 'old' or 'new' values from the changes object.\n */\nexport function extractChangedDocument(\n\tchanges: Record<string, { old: any; new: any }>,\n\ttype: 'old' | 'new'\n): Record<string, any> {\n\treturn Object.fromEntries(Object.entries(changes).map(([key, value]) => [key, value[type]]));\n}\n\nexport async function publishAdminLogsEvent(payload: {\n\tadmin: mongoose.Types.ObjectId;\n\tupdatedField: AdminLogsUpdatedFieldsType;\n\toldDoc: any;\n\tnewDoc: any;\n}) {\n\tconst { admin, updatedField, oldDoc, newDoc } = payload;\n\tconst adminActivityLogsEvent: BaseEvent<Record<string, unknown>> = new AdminActivityLogsEvent({\n\t\tadmin: admin,\n\t\tupdatedField: updatedField,\n\t\toldDocument: oldDoc,\n\t\tnewDocument: newDoc,\n\t});\n\tawait publishEvent(adminActivityLogsEvent);\n}\n\nexport async function publishShopActiveBatchProcessEvent() {\n\tconst shopActiveTimingsBatchProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew ShopActiveTimingsBatchProcessEvent({});\n\tawait publishEvent(shopActiveTimingsBatchProcessEvent);\n}\n\nexport async function publishMongodbStreamsChangesBatchProcessShopsEvent(\n\tpayload: MongoStreamsBatchProcessShopsDTO\n) {\n\tconst mongodbStreamsBatchProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew MongoStreamsBatchProcessShopsEvent(payload);\n\tawait publishEvent(mongodbStreamsBatchProcessEvent);\n}\n\nexport async function publishUpdateShopsSearchFieldsBulkProcessEvent(payload: any) {\n\tconst bulkUpdateShopsSearchFieldsBatchProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew BulkUpdateShopsSearchFieldsBatchProcessEvent(payload);\n\tawait publishEvent(bulkUpdateShopsSearchFieldsBatchProcessEvent);\n}\n\nexport async function publishBulkUpdateShopsZoneStatusProcessEvent(payload: BulkUpdateShopsZoneStatusDTO) {\n\tconst shopsZoneStatusBatchProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew BulkUpdateShopsZoneStatusEvent(payload);\n\tawait publishEvent(shopsZoneStatusBatchProcessEvent);\n}\n\nexport async function publishAllProductsProductMarketingInfoProcessEvent(\n\tpayload: SynchronizeAllProductsProductMarketingInfoDTO\n) {\n\tconst SyncAllProductsProductMarketingInfoProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew SynchronizeAllProductsProductMarketingInfoEvent({});\n\tawait publishEvent(SyncAllProductsProductMarketingInfoProcessEvent);\n}\n\nexport async function publishAllShopsAvgPreperationTimeSyncProcessEvent(\n\tpayload: SynchronizeAllShopsAvgPreparationTimeDTO\n) {\n\tconst SyncAllShopsAvgPreperationTimeSyncProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew SynchronizeAllShopsAvgPreparationTimeEvent({});\n\tawait publishEvent(SyncAllShopsAvgPreperationTimeSyncProcessEvent);\n}\n\nexport async function publishSyncSingleShopInCacheProcessEvent(payload: SyncSingleShopCacheDTO) {\n\tconst syncSingleShopCacheSyncEvent: BaseEvent<Record<string, unknown>> = new SyncSingleShopInCacheEvent(\n\t\tpayload\n\t);\n\tawait publishEvent(syncSingleShopCacheSyncEvent);\n}\n\nexport async function publishSyncSingleShopOrderAgainSectionsInCacheProcessEvent(\n\tpayload: SyncSingleShopOrderAgainCacheDTO\n) {\n\tconst syncSingleShopOrderAgainInCacheSyncEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew SyncSingleShopOrderAgainInCacheEvent(payload);\n\tawait publishEvent(syncSingleShopOrderAgainInCacheSyncEvent);\n}\n\nexport async function publishSyncSingleShopSectionsInCacheProcessEvent(\n\tpayload: SyncSingleShopSectionsInCacheDTO\n) {\n\tconst syncSingleShopSectionsInCacheSyncEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew SyncSingleShopSectionsInCacheEvent(payload);\n\tawait publishEvent(syncSingleShopSectionsInCacheSyncEvent);\n}\n"]}
1
+ {"version":3,"file":"events-common-methods.js","sourceRoot":"/","sources":["utilities/events-common-methods.ts"],"names":[],"mappings":";;AAwCA,4CAyBC;AAwCD,sDAaC;AAKD,wDAKC;AAED,sDAcC;AAED,gFAIC;AAED,gHAMC;AAED,wGAIC;AAED,oGAIC;AAED,gHAMC;AAED,8GAMC;AAED,4FAKC;AAED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":["import { mongoose } from '@typegoose/typegoose';\nimport { publishEvent } from '../libraries/event';\nimport { AdminLogsUpdatedFieldsType } from './enum';\nimport { BaseEvent } from '../libraries/event/BaseEvent';\nimport {\n\tMongoStreamsBatchProcessShopsDTO,\n\tMongoStreamsBatchProcessShopsEvent,\n} from '../libraries/event/events/mongo-stream-changes-batch-process-shops-event';\nimport { AdminActivityLogsEvent } from '../libraries/event/events/admin-logs-event';\nimport { ShopActiveTimingsBatchProcessEvent } from '../libraries/event/events/shop-active-timings-batch-process-event';\nimport { BulkUpdateShopsSearchFieldsBatchProcessEvent } from '../libraries/event/events/bulk-update-shops-search-fields-batch-process-event';\nimport {\n\tBulkUpdateShopsZoneStatusDTO,\n\tBulkUpdateShopsZoneStatusEvent,\n} from '../libraries/event/events/bulk-update-zone-status-in-shops-event';\nimport {\n\tSynchronizeAllProductsProductMarketingInfoDTO,\n\tSynchronizeAllProductsProductMarketingInfoEvent,\n} from '../libraries/event/events/sync-all-products-product-marketing-info-event';\nimport {\n\tSynchronizeAllShopsAvgPreparationTimeDTO,\n\tSynchronizeAllShopsAvgPreparationTimeEvent,\n} from '../libraries/event/events/sync-avg-prep-time-in-all-shops-event';\nimport {\n\tSyncSingleShopCacheDTO,\n\tSyncSingleShopInCacheEvent,\n} from '../libraries/event/events/sync-single-shop-in-cache-event';\nimport {\n\tSyncSingleShopOrderAgainCacheDTO,\n\tSyncSingleShopOrderAgainInCacheEvent,\n} from '../libraries/event/events/sync-order-again-sections-for-shop-event';\nimport {\n\tSyncSingleShopSectionsInCacheDTO,\n\tSyncSingleShopSectionsInCacheEvent,\n} from '../libraries/event/events/sync-single-shop-sections-in-cache-event';\nimport { SynchronizeAllCustomizedShopSectionsCacheDTO, SynchronizeAllCustomizedShopSectionsCacheEvent } from '../libraries/event/events/sync-all-customized-shop-sections-cache-event';\n\n/**\n * Returns changed fields between two objects (shallow comparison).\n */\nexport function getChangedFields<T extends Record<string, any>>(\n\toldDoc: T,\n\tnewDoc: T,\n\tpayload?: Partial<T>\n): Record<keyof T, { old: any; new: any }> {\n\tconst changes = {} as Record<keyof T, { old: any; new: any }>;\n\n\tconst oldObj = typeof oldDoc.toObject === 'function' ? oldDoc.toObject() : oldDoc;\n\tconst newObj = typeof newDoc.toObject === 'function' ? newDoc.toObject() : newDoc;\n\n\tconst keysToCheck = payload\n\t\t? Object.keys(payload)\n\t\t: Array.from(new Set([...Object.keys(oldObj), ...Object.keys(newObj)]));\n\n\tfor (const key of keysToCheck) {\n\t\tconst oldValue = oldObj[key];\n\t\tconst newValue = newObj[key];\n\t\tconst cleanedOld = deepCleanSettingsValues(oldValue);\n\t\tconst cleanedNew = deepCleanSettingsValues(newValue);\n\t\tif (payload || JSON.stringify(cleanedOld) !== JSON.stringify(cleanedNew)) {\n\t\t\tchanges[key as keyof T] = { old: oldValue, new: newValue };\n\t\t}\n\t}\n\n\treturn changes;\n}\n\n// removes _id and deletedAt fields from objects, array of objects and prepares for data that has setting changes\nfunction deepCleanSettingsValues(value: any): any {\n\t// CASE 1: Array\n\tif (Array.isArray(value)) {\n\t\t// If array contains primitives → return as-is\n\t\tif (value.every(v => v === null || typeof v !== 'object')) {\n\t\t\treturn value;\n\t\t}\n\n\t\t// If array contains objects → deep clean each object\n\t\treturn value.map(item => deepCleanSettingsValues(item));\n\t}\n\n\t// CASE 2: Null → return as is\n\tif (value === null) return value;\n\n\t// CASE 3: Plain Object\n\tif (typeof value === 'object') {\n\t\tconst cleanedObj: any = {};\n\n\t\tfor (const key in value) {\n\t\t\tif (key === '_id' || key === 'deletedAt' || value[key] === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcleanedObj[key] = deepCleanSettingsValues(value[key]);\n\t\t}\n\n\t\treturn cleanedObj;\n\t}\n\n\t// CASE 4: Primitive (string, number, boolean)\n\treturn value;\n}\n\n/**\n * Filters changed fields to only those that exist in the payload.\n */\nexport function filterRelevantChanges<T>(\n\tallChanges: Record<string, { old: any; new: any }>,\n\tpayload: Partial<T>\n): Record<string, { old: any; new: any }> {\n\treturn Object.keys(payload).reduce(\n\t\t(acc, key) => {\n\t\t\tif (allChanges[key]) {\n\t\t\t\tacc[key] = allChanges[key];\n\t\t\t}\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<string, { old: any; new: any }>\n\t);\n}\n\n/**\n * Extracts either 'old' or 'new' values from the changes object.\n */\nexport function extractChangedDocument(\n\tchanges: Record<string, { old: any; new: any }>,\n\ttype: 'old' | 'new'\n): Record<string, any> {\n\treturn Object.fromEntries(Object.entries(changes).map(([key, value]) => [key, value[type]]));\n}\n\nexport async function publishAdminLogsEvent(payload: {\n\tadmin: mongoose.Types.ObjectId;\n\tupdatedField: AdminLogsUpdatedFieldsType;\n\toldDoc: any;\n\tnewDoc: any;\n}) {\n\tconst { admin, updatedField, oldDoc, newDoc } = payload;\n\tconst adminActivityLogsEvent: BaseEvent<Record<string, unknown>> = new AdminActivityLogsEvent({\n\t\tadmin: admin,\n\t\tupdatedField: updatedField,\n\t\toldDocument: oldDoc,\n\t\tnewDocument: newDoc,\n\t});\n\tawait publishEvent(adminActivityLogsEvent);\n}\n\nexport async function publishShopActiveBatchProcessEvent() {\n\tconst shopActiveTimingsBatchProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew ShopActiveTimingsBatchProcessEvent({});\n\tawait publishEvent(shopActiveTimingsBatchProcessEvent);\n}\n\nexport async function publishMongodbStreamsChangesBatchProcessShopsEvent(\n\tpayload: MongoStreamsBatchProcessShopsDTO\n) {\n\tconst mongodbStreamsBatchProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew MongoStreamsBatchProcessShopsEvent(payload);\n\tawait publishEvent(mongodbStreamsBatchProcessEvent);\n}\n\nexport async function publishUpdateShopsSearchFieldsBulkProcessEvent(payload: any) {\n\tconst bulkUpdateShopsSearchFieldsBatchProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew BulkUpdateShopsSearchFieldsBatchProcessEvent(payload);\n\tawait publishEvent(bulkUpdateShopsSearchFieldsBatchProcessEvent);\n}\n\nexport async function publishBulkUpdateShopsZoneStatusProcessEvent(payload: BulkUpdateShopsZoneStatusDTO) {\n\tconst shopsZoneStatusBatchProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew BulkUpdateShopsZoneStatusEvent(payload);\n\tawait publishEvent(shopsZoneStatusBatchProcessEvent);\n}\n\nexport async function publishAllProductsProductMarketingInfoProcessEvent(\n\tpayload: SynchronizeAllProductsProductMarketingInfoDTO\n) {\n\tconst SyncAllProductsProductMarketingInfoProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew SynchronizeAllProductsProductMarketingInfoEvent({});\n\tawait publishEvent(SyncAllProductsProductMarketingInfoProcessEvent);\n}\n\nexport async function publishAllShopsAvgPreperationTimeSyncProcessEvent(\n\tpayload: SynchronizeAllShopsAvgPreparationTimeDTO\n) {\n\tconst SyncAllShopsAvgPreperationTimeSyncProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew SynchronizeAllShopsAvgPreparationTimeEvent({});\n\tawait publishEvent(SyncAllShopsAvgPreperationTimeSyncProcessEvent);\n}\n\nexport async function publishSyncSingleShopInCacheProcessEvent(payload: SyncSingleShopCacheDTO) {\n\tconst syncSingleShopCacheSyncEvent: BaseEvent<Record<string, unknown>> = new SyncSingleShopInCacheEvent(\n\t\tpayload\n\t);\n\tawait publishEvent(syncSingleShopCacheSyncEvent);\n}\n\nexport async function publishSyncSingleShopOrderAgainSectionsInCacheProcessEvent(\n\tpayload: SyncSingleShopOrderAgainCacheDTO\n) {\n\tconst syncSingleShopOrderAgainInCacheSyncEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew SyncSingleShopOrderAgainInCacheEvent(payload);\n\tawait publishEvent(syncSingleShopOrderAgainInCacheSyncEvent);\n}\n\nexport async function publishSyncSingleShopSectionsInCacheProcessEvent(\n\tpayload: SyncSingleShopSectionsInCacheDTO\n) {\n\tconst syncSingleShopSectionsInCacheSyncEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew SyncSingleShopSectionsInCacheEvent(payload);\n\tawait publishEvent(syncSingleShopSectionsInCacheSyncEvent);\n}\n\nexport async function publishAllCustomizedShopSectionsCacheProcessEvent(\n\tpayload: SynchronizeAllCustomizedShopSectionsCacheDTO\n) {\n\tconst SyncAllCustomizedShopSectionsCacheProcessEvent: BaseEvent<Record<string, unknown>> =\n\t\tnew SynchronizeAllCustomizedShopSectionsCacheEvent({});\n\tawait publishEvent(SyncAllCustomizedShopSectionsCacheProcessEvent);\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.3.145",
3
+ "version": "1.3.146",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",