@lyxa.ai/core 1.4.248 → 1.4.249

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.
@@ -45,7 +45,12 @@ async function createQueueChannel(eventId) {
45
45
  await wrapper.waitForConnect();
46
46
  return wrapper;
47
47
  }
48
- async function handleMsg(wrapper, msg, handler, label, requeue = true) {
48
+ const MAX_RETRIES = 3;
49
+ function getRetryCount(msg) {
50
+ const headers = msg.properties.headers ?? {};
51
+ return typeof headers['x-retry-count'] === 'number' ? headers['x-retry-count'] : 0;
52
+ }
53
+ async function handleMsg(wrapper, msg, handler, label) {
49
54
  try {
50
55
  const payload = JSON.parse(msg.content.toString());
51
56
  await handler(payload);
@@ -53,10 +58,24 @@ async function handleMsg(wrapper, msg, handler, label, requeue = true) {
53
58
  return true;
54
59
  }
55
60
  catch (err) {
56
- (0, index_1.getLibraries)()
57
- .getLoggerKit()
58
- .error(`Error handling [${label}]`, err, { tag: enum_1.LogTag.INFRA_QUEUE });
59
- wrapper.nack(msg, false, requeue);
61
+ const retryCount = getRetryCount(msg);
62
+ const logger = (0, index_1.getLibraries)().getLoggerKit();
63
+ if (retryCount < MAX_RETRIES) {
64
+ logger.error(`Error handling [${label}], retrying (${retryCount + 1}/${MAX_RETRIES})`, err, {
65
+ tag: enum_1.LogTag.INFRA_QUEUE,
66
+ });
67
+ wrapper.ack(msg);
68
+ await pubChannelWrapper.publish(EXCHANGE_NAME, msg.fields.routingKey, msg.content, {
69
+ ...AMQP_PUBLISH_OPTIONS,
70
+ headers: { ...(msg.properties.headers ?? {}), 'x-retry-count': retryCount + 1 },
71
+ });
72
+ }
73
+ else {
74
+ (0, index_1.getLibraries)()
75
+ .getLoggerKit()
76
+ .error(`Error handling [${label}]`, err, { tag: enum_1.LogTag.INFRA_QUEUE, data: { label, msg } });
77
+ wrapper.ack(msg);
78
+ }
60
79
  return false;
61
80
  }
62
81
  }
@@ -73,7 +92,7 @@ async function subscribeToQueue(queueName, routingKey, onMessage, options = {})
73
92
  },
74
93
  });
75
94
  await wrapper.waitForConnect();
76
- await wrapper.consume(queueName, msg => handleMsg(wrapper, msg, onMessage, queueName, requeue));
95
+ await wrapper.consume(queueName, msg => handleMsg(wrapper, msg, onMessage, queueName));
77
96
  console.log(`Subscribed to queue [${queueName}]`);
78
97
  }
79
98
  async function publish(routingKey, payload) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/event/index.ts"],"names":[],"mappings":";;;;;AAqBA,wDAcC;AAkCD,4CAuBC;AAED,0BAOC;AAED,oCAEC;AAED,4CAYC;AAED,8CAoCC;AAED,0DAKC;AAlKD,mEAA+D;AAC/D,uCAA2C;AAC3C,+CAA8C;AAE9C,sFAA+E;AAG/E,IAAI,UAAkC,CAAC;AACvC,IAAI,iBAAiC,CAAC;AACtC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA0B,CAAC;AAEvD,MAAM,aAAa,GAAG,aAAa,CAAC;AAGpC,MAAM,oBAAoB,GAAG;IAC5B,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,IAAI;CACqC,CAAC;AAEhD,KAAK,UAAU,sBAAsB,CAAC,SAAiB;IAC7D,UAAU,GAAG,iCAAW,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9C,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAClE,UAAU,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC,CAAC;IAEhF,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC;QAC5C,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,KAAK,EAAE,EAAW,EAAE,EAAE;YAC5B,MAAM,EAAE,CAAC,cAAc,CAAC,aAAa,EAAE,OAAO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';\nimport { getLibraries } from '../../index';\nimport { LogTag } from '../../utilities/enum';\n\nimport amqpManager, { Channel, ChannelWrapper } from 'amqp-connection-manager';\nimport { IAmqpConnectionManager } from 'amqp-connection-manager/dist/types/AmqpConnectionManager';\n\nlet connection: IAmqpConnectionManager;\nlet pubChannelWrapper: ChannelWrapper;\nconst pollChannels = new Map<string, ChannelWrapper>();\n\nconst EXCHANGE_NAME = 'lyxa.events';\n\ntype PublishOptions = Parameters<ChannelWrapper['publish']>[3];\nconst AMQP_PUBLISH_OPTIONS = {\n\tcontentType: 'application/json',\n\tpersistent: true,\n} as amqp.Options.Publish as unknown as PublishOptions;\n\nexport async function initRabbitMQConnection(rabbitUrl: string): Promise<void> {\n\tconnection = amqpManager.connect([rabbitUrl]);\n\tconnection.on('connect', () => console.log('RabbitMQ connected'));\n\tconnection.on('disconnect', err => console.error('RabbitMQ disconnected', err));\n\n\tpubChannelWrapper = connection.createChannel({\n\t\tconfirm: true,\n\t\tsetup: async (ch: Channel) => {\n\t\t\tawait ch.assertExchange(EXCHANGE_NAME, 'topic', { durable: true });\n\t\t},\n\t});\n\n\tawait pubChannelWrapper.waitForConnect();\n\tconsole.log(`EventBus initialized with instance ID: ${getInstanceId()}`);\n}\n\nasync function createQueueChannel(eventId: string): Promise<ChannelWrapper> {\n\tconst wrapper = connection.createChannel({\n\t\tsetup: async (ch: Channel) => {\n\t\t\tawait ch.assertQueue(eventId, { durable: true, exclusive: false, autoDelete: false });\n\t\t\tawait ch.bindQueue(eventId, EXCHANGE_NAME, eventId);\n\t\t},\n\t});\n\tawait wrapper.waitForConnect();\n\treturn wrapper;\n}\n\nasync function handleMsg(\n\twrapper: ChannelWrapper,\n\tmsg: amqp.Message,\n\thandler: (payload: any) => void | Promise<void>,\n\tlabel: string,\n\trequeue = true\n): Promise<boolean> {\n\ttry {\n\t\tconst payload = JSON.parse(msg.content.toString());\n\t\tawait handler(payload);\n\t\twrapper.ack(msg);\n\t\treturn true;\n\t} catch (err) {\n\t\tgetLibraries()\n\t\t\t.getLoggerKit()\n\t\t\t.error(`Error handling [${label}]`, err, { tag: LogTag.INFRA_QUEUE });\n\t\twrapper.nack(msg, false, requeue);\n\t\treturn false;\n\t}\n}\n\nexport async function subscribeToQueue(\n\tqueueName: string,\n\troutingKey: string,\n\tonMessage: (payload: unknown) => void | Promise<void>,\n\toptions: { requeue?: boolean; durable?: boolean } = {}\n): Promise<void> {\n\tif (!connection) {\n\t\tconsole.warn(`[RabbitMQ] subscribeToQueue called before connection initialized, skipping [${queueName}]`);\n\t\treturn;\n\t}\n\n\tconst { requeue = true, durable = true } = options;\n\n\tconst wrapper = connection.createChannel({\n\t\tsetup: async (ch: Channel) => {\n\t\t\tawait ch.assertQueue(queueName, { durable });\n\t\t\tawait ch.bindQueue(queueName, EXCHANGE_NAME, routingKey);\n\t\t},\n\t});\n\tawait wrapper.waitForConnect();\n\n\tawait wrapper.consume(queueName, msg => handleMsg(wrapper, msg, onMessage, queueName, requeue));\n\tconsole.log(`Subscribed to queue [${queueName}]`);\n}\n\nexport async function publish(routingKey: string, payload: object): Promise<void> {\n\tawait pubChannelWrapper.publish(\n\t\tEXCHANGE_NAME,\n\t\troutingKey,\n\t\tBuffer.from(JSON.stringify(payload)),\n\t\tAMQP_PUBLISH_OPTIONS\n\t);\n}\n\nexport async function publishEvent<TPayload extends object>(event: BaseEvent<TPayload>): Promise<void> {\n\tawait publish(event.eventId, event.payload);\n}\n\nexport async function subscribeToEvent(\n\teventId: string,\n\tonMessage: (payload: any) => Promise<void>\n): Promise<void> {\n\tif (!connection) {\n\t\tconsole.warn(`[RabbitMQ] subscribe called before connection initialized, skipping [${eventId}]`);\n\t\treturn;\n\t}\n\n\tconst wrapper = await createQueueChannel(eventId);\n\tawait wrapper.consume(eventId, msg => handleMsg(wrapper, msg, onMessage, eventId));\n\tconsole.log(`Subscribed to event [${eventId}]`);\n}\n\nexport async function pollEventMessages(\n\teventId: string,\n\tonMessage: (payloads: any[]) => Promise<void>,\n\tlimit?: number\n): Promise<void> {\n\tif (!connection) {\n\t\tconsole.warn(`[RabbitMQ] poll called before connection initialized, skipping [${eventId}]`);\n\t\treturn;\n\t}\n\n\tif (!pollChannels.has(eventId)) {\n\t\tpollChannels.set(eventId, await createQueueChannel(eventId));\n\t}\n\n\tconst wrapper = pollChannels.get(eventId)!;\n\tconst max = limit ?? Infinity;\n\tconst msgs: amqp.Message[] = [];\n\n\twhile (msgs.length < max) {\n\t\tconst msg = await wrapper.get(eventId, { noAck: false });\n\t\tif (!msg) break;\n\t\tmsgs.push(msg);\n\t}\n\n\tif (msgs.length === 0) return;\n\n\ttry {\n\t\tconst payloads = msgs.map(msg => JSON.parse(msg.content.toString()));\n\t\tawait onMessage(payloads);\n\t\tmsgs.forEach(msg => wrapper.ack(msg));\n\t} catch (err) {\n\t\tawait getLibraries()\n\t\t\t.getLoggerKit()\n\t\t\t.error(`Error handling [${eventId}]`, err, { tag: LogTag.INFRA_QUEUE });\n\t\tmsgs.forEach(msg => wrapper.nack(msg, false, true));\n\t}\n}\n\nexport async function closeRabbitMQConnection(): Promise<void> {\n\tif (pubChannelWrapper) await pubChannelWrapper.close();\n\tawait Promise.all([...pollChannels.values()].map(ch => ch.close()));\n\tif (connection) await connection.close();\n\tconsole.log(`EventBus closed for instance [${getInstanceId()}]`);\n}"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/event/index.ts"],"names":[],"mappings":";;;;;AAqBA,wDAcC;AA0DD,4CAuBC;AAED,0BAOC;AAED,oCAEC;AAED,4CAYC;AAED,8CAoCC;AAED,0DAKC;AA1LD,mEAA+D;AAC/D,uCAA2C;AAC3C,+CAA8C;AAE9C,sFAA+E;AAG/E,IAAI,UAAkC,CAAC;AACvC,IAAI,iBAAiC,CAAC;AACtC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA0B,CAAC;AAEvD,MAAM,aAAa,GAAG,aAAa,CAAC;AAGpC,MAAM,oBAAoB,GAAG;IAC5B,WAAW,EAAE,kBAAk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CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACpE,IAAI,UAAU;QAAE,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAA,8BAAa,GAAE,GAAG,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import amqp from 'amqplib';\nimport { BaseEvent } from './BaseEvent';\nimport { getInstanceId } from '../../utilities/instance.utils';\nimport { getLibraries } from '../../index';\nimport { LogTag } from '../../utilities/enum';\n\nimport amqpManager, { Channel, ChannelWrapper } from 'amqp-connection-manager';\nimport { IAmqpConnectionManager } from 'amqp-connection-manager/dist/types/AmqpConnectionManager';\n\nlet connection: IAmqpConnectionManager;\nlet pubChannelWrapper: ChannelWrapper;\nconst pollChannels = new Map<string, ChannelWrapper>();\n\nconst EXCHANGE_NAME = 'lyxa.events';\n\ntype PublishOptions = Parameters<ChannelWrapper['publish']>[3];\nconst AMQP_PUBLISH_OPTIONS = {\n\tcontentType: 'application/json',\n\tpersistent: true,\n} as amqp.Options.Publish as unknown as PublishOptions;\n\nexport async function initRabbitMQConnection(rabbitUrl: string): Promise<void> {\n\tconnection = amqpManager.connect([rabbitUrl]);\n\tconnection.on('connect', () => console.log('RabbitMQ connected'));\n\tconnection.on('disconnect', err => console.error('RabbitMQ disconnected', err));\n\n\tpubChannelWrapper = connection.createChannel({\n\t\tconfirm: true,\n\t\tsetup: async (ch: Channel) => {\n\t\t\tawait ch.assertExchange(EXCHANGE_NAME, 'topic', { durable: true });\n\t\t},\n\t});\n\n\tawait pubChannelWrapper.waitForConnect();\n\tconsole.log(`EventBus initialized with instance ID: ${getInstanceId()}`);\n}\n\nasync function createQueueChannel(eventId: string): Promise<ChannelWrapper> {\n\tconst wrapper = connection.createChannel({\n\t\tsetup: async (ch: Channel) => {\n\t\t\tawait ch.assertQueue(eventId, { durable: true, exclusive: false, autoDelete: false });\n\t\t\tawait ch.bindQueue(eventId, EXCHANGE_NAME, eventId);\n\t\t},\n\t});\n\tawait wrapper.waitForConnect();\n\treturn wrapper;\n}\n\nconst MAX_RETRIES = 3;\n\nfunction getRetryCount(msg: amqp.Message): number {\n\tconst headers = msg.properties.headers ?? {};\n\treturn typeof headers['x-retry-count'] === 'number' ? headers['x-retry-count'] : 0;\n}\n\nasync function handleMsg(\n\twrapper: ChannelWrapper,\n\tmsg: amqp.Message,\n\thandler: (payload: any) => void | Promise<void>,\n\tlabel: string\n): Promise<boolean> {\n\ttry {\n\t\tconst payload = JSON.parse(msg.content.toString());\n\t\tawait handler(payload);\n\t\twrapper.ack(msg);\n\t\treturn true;\n\t} catch (err) {\n\t\tconst retryCount = getRetryCount(msg);\n\t\tconst logger = getLibraries().getLoggerKit();\n\n\t\tif (retryCount < MAX_RETRIES) {\n\t\t\tlogger.error(`Error handling [${label}], retrying (${retryCount + 1}/${MAX_RETRIES})`, err, {\n\t\t\t\ttag: LogTag.INFRA_QUEUE,\n\t\t\t});\n\n\t\t\t// Ack the current delivery, then republish a copy with the incremented count.\n\t\t\t// Plain nack+requeue redelivers the same message with no way to track attempts,\n\t\t\t// so we manage the counter ourselves via headers.\n\t\t\twrapper.ack(msg);\n\t\t\tawait pubChannelWrapper.publish(EXCHANGE_NAME, msg.fields.routingKey, msg.content, {\n\t\t\t\t...AMQP_PUBLISH_OPTIONS,\n\t\t\t\theaders: { ...(msg.properties.headers ?? {}), 'x-retry-count': retryCount + 1 },\n\t\t\t} as PublishOptions);\n\t\t} else {\n\t\t\tgetLibraries()\n\t\t\t\t.getLoggerKit()\n\t\t\t\t.error(`Error handling [${label}]`, err, { tag: LogTag.INFRA_QUEUE, data: { label, msg} });\n\t\t\twrapper.ack(msg); // remove it from the queue permanently — no DLQ, just gone\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport async function subscribeToQueue(\n\tqueueName: string,\n\troutingKey: string,\n\tonMessage: (payload: unknown) => void | Promise<void>,\n\toptions: { requeue?: boolean; durable?: boolean } = {}\n): Promise<void> {\n\tif (!connection) {\n\t\tconsole.warn(`[RabbitMQ] subscribeToQueue called before connection initialized, skipping [${queueName}]`);\n\t\treturn;\n\t}\n\n\tconst { requeue = true, durable = true } = options;\n\n\tconst wrapper = connection.createChannel({\n\t\tsetup: async (ch: Channel) => {\n\t\t\tawait ch.assertQueue(queueName, { durable });\n\t\t\tawait ch.bindQueue(queueName, EXCHANGE_NAME, routingKey);\n\t\t},\n\t});\n\tawait wrapper.waitForConnect();\n\n\tawait wrapper.consume(queueName, msg => handleMsg(wrapper, msg, onMessage, queueName));\n\tconsole.log(`Subscribed to queue [${queueName}]`);\n}\n\nexport async function publish(routingKey: string, payload: object): Promise<void> {\n\tawait pubChannelWrapper.publish(\n\t\tEXCHANGE_NAME,\n\t\troutingKey,\n\t\tBuffer.from(JSON.stringify(payload)),\n\t\tAMQP_PUBLISH_OPTIONS\n\t);\n}\n\nexport async function publishEvent<TPayload extends object>(event: BaseEvent<TPayload>): Promise<void> {\n\tawait publish(event.eventId, event.payload);\n}\n\nexport async function subscribeToEvent(\n\teventId: string,\n\tonMessage: (payload: any) => Promise<void>\n): Promise<void> {\n\tif (!connection) {\n\t\tconsole.warn(`[RabbitMQ] subscribe called before connection initialized, skipping [${eventId}]`);\n\t\treturn;\n\t}\n\n\tconst wrapper = await createQueueChannel(eventId);\n\tawait wrapper.consume(eventId, msg => handleMsg(wrapper, msg, onMessage, eventId));\n\tconsole.log(`Subscribed to event [${eventId}]`);\n}\n\nexport async function pollEventMessages(\n\teventId: string,\n\tonMessage: (payloads: any[]) => Promise<void>,\n\tlimit?: number\n): Promise<void> {\n\tif (!connection) {\n\t\tconsole.warn(`[RabbitMQ] poll called before connection initialized, skipping [${eventId}]`);\n\t\treturn;\n\t}\n\n\tif (!pollChannels.has(eventId)) {\n\t\tpollChannels.set(eventId, await createQueueChannel(eventId));\n\t}\n\n\tconst wrapper = pollChannels.get(eventId)!;\n\tconst max = limit ?? Infinity;\n\tconst msgs: amqp.Message[] = [];\n\n\twhile (msgs.length < max) {\n\t\tconst msg = await wrapper.get(eventId, { noAck: false });\n\t\tif (!msg) break;\n\t\tmsgs.push(msg);\n\t}\n\n\tif (msgs.length === 0) return;\n\n\ttry {\n\t\tconst payloads = msgs.map(msg => JSON.parse(msg.content.toString()));\n\t\tawait onMessage(payloads);\n\t\tmsgs.forEach(msg => wrapper.ack(msg));\n\t} catch (err) {\n\t\tawait getLibraries()\n\t\t\t.getLoggerKit()\n\t\t\t.error(`Error handling [${eventId}]`, err, { tag: LogTag.INFRA_QUEUE });\n\t\tmsgs.forEach(msg => wrapper.nack(msg, false, true));\n\t}\n}\n\nexport async function closeRabbitMQConnection(): Promise<void> {\n\tif (pubChannelWrapper) await pubChannelWrapper.close();\n\tawait Promise.all([...pollChannels.values()].map(ch => ch.close()));\n\tif (connection) await connection.close();\n\tconsole.log(`EventBus closed for instance [${getInstanceId()}]`);\n}\n"]}
@@ -5,9 +5,9 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
+ req: import("http").IncomingMessage;
8
9
  res: import("http").ServerResponse<import("http").IncomingMessage>;
9
10
  tokenType: TokenType | undefined;
10
- req: import("http").IncomingMessage;
11
11
  requestId: string | undefined;
12
12
  entity: import("../context").EntityContext | undefined;
13
13
  usedRefreshToken: boolean | undefined;
@@ -4,9 +4,9 @@ interface RoleProtectedOptions {
4
4
  allowedRoles: string[];
5
5
  }
6
6
  export declare function createRoleProtectedProcedure(options: RoleProtectedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
7
+ req: import("http").IncomingMessage;
7
8
  res: import("http").ServerResponse<import("http").IncomingMessage>;
8
9
  tokenType: import("../../auth").TokenType | undefined;
9
- req: import("http").IncomingMessage;
10
10
  requestId: string | undefined;
11
11
  entity: import("../context").EntityContext | undefined;
12
12
  usedRefreshToken: boolean | undefined;
@@ -3,9 +3,9 @@ interface PhoneVerifiedOptions {
3
3
  entityTypes: AuthEntityType[];
4
4
  }
5
5
  export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
6
+ req: import("http").IncomingMessage;
6
7
  res: import("http").ServerResponse<import("http").IncomingMessage>;
7
8
  tokenType: import("../../auth").TokenType | undefined;
8
- req: import("http").IncomingMessage;
9
9
  requestId: string | undefined;
10
10
  entity: import("../context").EntityContext | undefined;
11
11
  usedRefreshToken: boolean | undefined;
@@ -5,9 +5,9 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
+ req: import("http").IncomingMessage;
8
9
  res: import("http").ServerResponse<import("http").IncomingMessage>;
9
10
  tokenType: TokenType | undefined;
10
- req: import("http").IncomingMessage;
11
11
  requestId: string | undefined;
12
12
  entity: import("../context").EntityContext | undefined;
13
13
  usedRefreshToken: boolean | undefined;
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.248
25
+ Version: 1.4.249
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.4.248",
3
+ "version": "1.4.249",
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
  }>>;
@@ -735,12 +735,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
735
735
  populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
736
736
  }, "strip", z.ZodTypeAny, {
737
737
  _id: import("mongoose").Types.ObjectId;
738
- select?: Record<string, 0 | 1> | undefined;
739
738
  populate?: any;
739
+ select?: Record<string, 0 | 1> | undefined;
740
740
  }, {
741
741
  _id: string | import("mongoose").Types.ObjectId;
742
- select?: Record<string, 0 | 1> | undefined;
743
742
  populate?: any;
743
+ select?: Record<string, 0 | 1> | undefined;
744
744
  }>;
745
745
  export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
746
746
  export declare const GetProductByIdInputSchema: z.ZodObject<{
@@ -753,12 +753,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
753
753
  _id: import("mongoose").Types.ObjectId;
754
754
  withAttributeHiddenItems: boolean;
755
755
  withAddonsHiddenItems: boolean;
756
- select?: Record<string, 0 | 1> | undefined;
757
756
  populate?: any;
757
+ select?: Record<string, 0 | 1> | undefined;
758
758
  }, {
759
759
  _id: string | import("mongoose").Types.ObjectId;
760
- select?: Record<string, 0 | 1> | undefined;
761
760
  populate?: any;
761
+ select?: Record<string, 0 | 1> | undefined;
762
762
  withAttributeHiddenItems?: boolean | undefined;
763
763
  withAddonsHiddenItems?: boolean | undefined;
764
764
  }>;
@@ -772,15 +772,15 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
772
772
  userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
773
773
  }, "strip", z.ZodTypeAny, {
774
774
  _id: import("mongoose").Types.ObjectId;
775
- select?: Record<string, 0 | 1> | undefined;
776
775
  populate?: any;
776
+ select?: Record<string, 0 | 1> | undefined;
777
777
  groupByCategories?: boolean | undefined;
778
778
  getParentCategory?: boolean | undefined;
779
779
  userOrderCompletionScope?: UserOrderCompletionScope | undefined;
780
780
  }, {
781
781
  _id: string | import("mongoose").Types.ObjectId;
782
- select?: Record<string, 0 | 1> | undefined;
783
782
  populate?: any;
783
+ select?: Record<string, 0 | 1> | undefined;
784
784
  groupByCategories?: boolean | undefined;
785
785
  getParentCategory?: boolean | undefined;
786
786
  userOrderCompletionScope?: UserOrderCompletionScope | undefined;
@@ -790,11 +790,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
790
790
  select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
791
791
  populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
792
792
  }, "strip", z.ZodTypeAny, {
793
- select?: Record<string, 0 | 1> | undefined;
794
793
  populate?: any;
795
- }, {
796
794
  select?: Record<string, 0 | 1> | undefined;
795
+ }, {
797
796
  populate?: any;
797
+ select?: Record<string, 0 | 1> | undefined;
798
798
  }>>;
799
799
  export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
800
800
  export declare const GetOneQuerySchema: z.ZodObject<{
@@ -802,12 +802,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
802
802
  select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
803
803
  populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
804
804
  }, "strip", z.ZodTypeAny, {
805
- select?: Record<string, 0 | 1> | undefined;
806
805
  populate?: any;
806
+ select?: Record<string, 0 | 1> | undefined;
807
807
  query?: Record<string, any> | undefined;
808
808
  }, {
809
- select?: Record<string, 0 | 1> | undefined;
810
809
  populate?: any;
810
+ select?: Record<string, 0 | 1> | undefined;
811
811
  query?: Record<string, any> | undefined;
812
812
  }>;
813
813
  export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.4.248",
3
+ "version": "1.4.249",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",