@transai/connector-runner-mqtt 0.27.0 → 0.28.0

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.
@@ -1,2 +1,3 @@
1
1
  import { TopicConfig } from '../types';
2
2
  export declare function findCorrespondingCollection(topic: string, topicsConfig: Array<TopicConfig>): string | undefined;
3
+ export declare function findCorrespondingTopicConfig(topic: string, topicsConfig: Array<TopicConfig>): TopicConfig | undefined;
@@ -1,6 +1,12 @@
1
1
  export interface TopicConfig {
2
2
  topic: string;
3
3
  collection: string;
4
+ /**
5
+ * Payload field names to extract and promote to metric metadata.
6
+ * Fields absent from the payload are silently ignored.
7
+ * Example: ["machineId", "machineName", "lineId"]
8
+ */
9
+ metadataFields?: Array<string>;
4
10
  }
5
11
  export interface MqttConfig {
6
12
  brokerUrl: string;
@@ -21,7 +21,6 @@ export type Result = boolean | {
21
21
  [index: number]: boolean;
22
22
  };
23
23
  export interface SenderSDKInterface {
24
- metrics(metrics: Array<Metric>, metadata?: Metadata & SenderMetadata, context?: Context): Promise<Result>;
25
- metricsLegacy<T = never>(metrics: Array<T>, metadata?: Metadata & SenderMetadata, context?: Context, topic?: string): Promise<Result>;
24
+ metrics<T = never>(metrics: Array<T>, metadata?: Metadata & SenderMetadata, context?: Context, topic?: string): Promise<Result>;
26
25
  documents<T = object>(documents: Array<T>, metadata?: Metadata & SenderMetadata, context?: Context): Promise<Result>;
27
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transai/connector-runner-mqtt",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },