@lucaapp/service-utils 5.19.0 → 5.20.1

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.
@@ -0,0 +1,16 @@
1
+ export type ConversationMessage = {
2
+ uuid: string;
3
+ conversationId: string;
4
+ from: string;
5
+ channel: string;
6
+ type: string;
7
+ originalMessage: string | null;
8
+ translatedMessage: string | null;
9
+ providerId: string | null;
10
+ meta: Record<string, unknown> | null;
11
+ twilioInboundMedia: unknown;
12
+ createdAt: Date;
13
+ stayReservationId: string | null;
14
+ locationId: string | null;
15
+ locationGroupId: string | null;
16
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,7 @@ import type { Consumer } from './events/consumer';
3
3
  import type { Operator } from './events/operator';
4
4
  import type { LocationGroupEmployees } from './events/locationGroupEmployees';
5
5
  import type { WsEvent } from './events/wsEvent';
6
+ import type { ConversationMessage } from './events/conversationMessage';
6
7
  import { Service } from '../serviceIdentity';
7
8
  import { LocationGroup } from './events/locationGroup';
8
9
  import { Location } from './events/location';
@@ -36,7 +37,8 @@ declare enum KafkaTopic {
36
37
  WS_EVENT_backend = "wsevent_backend",
37
38
  WS_EVENT_backend_pay = "wsevent_backend-pay",
38
39
  WS_EVENT_backend_pos = "wsevent_backend-pos",
39
- TOKENIZATION_JOB_ITEM = "tokenization_job_item"
40
+ TOKENIZATION_JOB_ITEM = "tokenization_job_item",
41
+ CONVERSATION_MESSAGE = "conversation_message"
40
42
  }
41
43
  type MessageFormats = {
42
44
  [KafkaTopic.PAYMENTS]: Payment | PaymentEvent;
@@ -59,6 +61,7 @@ type MessageFormats = {
59
61
  [KafkaTopic.WS_EVENT_backend_pay]: WsEvent;
60
62
  [KafkaTopic.WS_EVENT_backend_pos]: WsEvent;
61
63
  [KafkaTopic.TOKENIZATION_JOB_ITEM]: TokenizationJobItem;
64
+ [KafkaTopic.CONVERSATION_MESSAGE]: ConversationMessage;
62
65
  };
63
66
  declare const MessageIssuer: {
64
67
  payments: Service;
@@ -81,6 +84,7 @@ declare const MessageIssuer: {
81
84
  "wsevent_backend-pay": Service;
82
85
  "wsevent_backend-pos": Service;
83
86
  tokenization_job_item: Service;
87
+ conversation_message: Service;
84
88
  };
85
89
  declare const MessageSignatureIssuers: Partial<Record<KafkaTopic, Service[]>>;
86
90
  export { KafkaTopic, MessageIssuer, MessageSignatureIssuers };
@@ -24,6 +24,7 @@ var KafkaTopic;
24
24
  KafkaTopic["WS_EVENT_backend_pay"] = "wsevent_backend-pay";
25
25
  KafkaTopic["WS_EVENT_backend_pos"] = "wsevent_backend-pos";
26
26
  KafkaTopic["TOKENIZATION_JOB_ITEM"] = "tokenization_job_item";
27
+ KafkaTopic["CONVERSATION_MESSAGE"] = "conversation_message";
27
28
  })(KafkaTopic || (exports.KafkaTopic = KafkaTopic = {}));
28
29
  const MessageIssuer = {
29
30
  [KafkaTopic.PAYMENTS]: serviceIdentity_1.Service.BACKEND_PAY,
@@ -46,6 +47,7 @@ const MessageIssuer = {
46
47
  [KafkaTopic.WS_EVENT_backend_pay]: serviceIdentity_1.Service.BACKEND_PAY,
47
48
  [KafkaTopic.WS_EVENT_backend_pos]: serviceIdentity_1.Service.BACKEND_POS,
48
49
  [KafkaTopic.TOKENIZATION_JOB_ITEM]: serviceIdentity_1.Service.BACKEND_PAY,
50
+ [KafkaTopic.CONVERSATION_MESSAGE]: serviceIdentity_1.Service.BACKEND_PAY,
49
51
  };
50
52
  exports.MessageIssuer = MessageIssuer;
51
53
  const MessageSignatureIssuers = {
@@ -1,3 +1,4 @@
1
1
  export { KafkaClient } from './kafkaClient';
2
2
  export { KafkaTopic } from './events';
3
+ export type { ConversationMessage } from './events/conversationMessage';
3
4
  export type { KafkaEvent, GenericKafkaEvent, EventPayloadHandler, GenericEventPayloadHandler, KafkaConfiguration, CustomTopicConfig, CustomTopicPoisonContext, CustomTopicPoisonHandler, } from './types';
@@ -40,6 +40,7 @@ const util_1 = require("util");
40
40
  const serviceIdentity_1 = require("../serviceIdentity");
41
41
  const defaultPoisonHandler_1 = require("./defaultPoisonHandler");
42
42
  const events_1 = require("./events");
43
+ const requestTracer_1 = require("../requestTracer");
43
44
  const utils_1 = require("../../utils/utils");
44
45
  const topicLifecycle_1 = require("./topicLifecycle");
45
46
  const metrics_1 = require("./metrics");
@@ -256,6 +257,7 @@ class KafkaClient {
256
257
  signature,
257
258
  signatureIssuer: this.serviceIdentity.identityName,
258
259
  sourceEnvironment: this.environment.valueOf(),
260
+ ...(0, requestTracer_1.getRequestIdHeader)(),
259
261
  },
260
262
  },
261
263
  ],
@@ -311,6 +313,7 @@ class KafkaClient {
311
313
  headers: {
312
314
  signature,
313
315
  sourceEnvironment: this.environment.valueOf(),
316
+ ...(0, requestTracer_1.getRequestIdHeader)(),
314
317
  },
315
318
  },
316
319
  ],
@@ -471,6 +474,7 @@ class KafkaClient {
471
474
  kafkaConfig.password && {
472
475
  ssl: {
473
476
  rejectUnauthorized: false,
477
+ servername: '',
474
478
  },
475
479
  sasl: {
476
480
  mechanism: 'plain',
@@ -7,6 +7,7 @@ declare enum Service {
7
7
  BACKEND_PYTHON = "backend-python",
8
8
  BACKEND_LINK = "backend-link",
9
9
  BACKEND_AT_AUDIT = "backend-at-audit",
10
+ INBOX = "inbox",
10
11
  MASTRA = "mastra",
11
12
  HUB = "hub",
12
13
  DISCOVERY_SERVER = "discovery-server"
@@ -11,6 +11,7 @@ var Service;
11
11
  Service["BACKEND_PYTHON"] = "backend-python";
12
12
  Service["BACKEND_LINK"] = "backend-link";
13
13
  Service["BACKEND_AT_AUDIT"] = "backend-at-audit";
14
+ Service["INBOX"] = "inbox";
14
15
  Service["MASTRA"] = "mastra";
15
16
  Service["HUB"] = "hub";
16
17
  Service["DISCOVERY_SERVER"] = "discovery-server";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "5.19.0",
3
+ "version": "5.20.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [