@trunkrs/common 1.6.21 → 1.7.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.
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import AWS from 'aws-sdk';
|
|
1
2
|
import { Serializer } from '../../utils/serialization';
|
|
2
3
|
import { QueueClient, KinesisMessageOptions, QueueBatchMessageRequest, QueueMessageRequest } from './QueueClient';
|
|
3
4
|
declare class KinesisClient implements QueueClient {
|
|
5
|
+
private readonly client;
|
|
4
6
|
private readonly streamName;
|
|
5
7
|
private readonly serializer;
|
|
6
8
|
private readonly defaultPartition;
|
|
7
|
-
|
|
8
|
-
constructor(streamName: string, serializer: Serializer, defaultPartition: string);
|
|
9
|
+
constructor(client: AWS.Kinesis, streamName: string, serializer: Serializer, defaultPartition: string);
|
|
9
10
|
sendMessage<TMessage>(request: QueueMessageRequest<TMessage, KinesisMessageOptions>): Promise<void>;
|
|
10
11
|
sendBatchMessage<TMessage>(request: QueueBatchMessageRequest<TMessage, KinesisMessageOptions>): Promise<void>;
|
|
11
12
|
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const aws_xray_sdk_1 = __importDefault(require("aws-xray-sdk"));
|
|
7
|
-
const aws_sdk_1 = __importDefault(require("aws-sdk"));
|
|
8
|
-
const { Kinesis } = aws_xray_sdk_1.default.captureAWS(aws_sdk_1.default);
|
|
9
3
|
class KinesisClient {
|
|
10
|
-
constructor(streamName, serializer, defaultPartition) {
|
|
4
|
+
constructor(client, streamName, serializer, defaultPartition) {
|
|
5
|
+
this.client = client;
|
|
11
6
|
this.streamName = streamName;
|
|
12
7
|
this.serializer = serializer;
|
|
13
8
|
this.defaultPartition = defaultPartition;
|
|
14
|
-
this.client = new Kinesis();
|
|
15
9
|
}
|
|
16
10
|
async sendMessage(request) {
|
|
17
11
|
var _a, _b, _c, _d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KinesisClient.js","sourceRoot":"","sources":["../../../services/queue/KinesisClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KinesisClient.js","sourceRoot":"","sources":["../../../services/queue/KinesisClient.ts"],"names":[],"mappings":";;AAWA,MAAM,aAAa;IACjB,YAImB,MAAmB,EAInB,UAAkB,EAIlB,UAAsB,EAKtB,gBAAwB;QAbxB,WAAM,GAAN,MAAM,CAAa;QAInB,eAAU,GAAV,UAAU,CAAQ;QAIlB,eAAU,GAAV,UAAU,CAAY;QAKtB,qBAAgB,GAAhB,gBAAgB,CAAQ;IACxC,CAAC;IAEG,KAAK,CAAC,WAAW,CACtB,OAA6D;;QAE7D,MAAM,IAAI,CAAC,MAAM;aACd,SAAS,CAAC;YACT,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC;YAC1D,YAAY,EAAE,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,YAAY,mCAAI,IAAI,CAAC,gBAAgB;YACpE,eAAe,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAE,OAAO;YACzC,yBAAyB,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAE,cAAc;SAC3D,CAAC;aACD,OAAO,EAAE,CAAA;IACd,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAC3B,OAAkE;QAElE,MAAM,IAAI,CAAC,MAAM;aACd,UAAU,CAAC;YACV,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;;gBAAC,OAAA,CAAC;oBAC1C,I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