@remit/search-index-worker 0.0.3 → 0.0.5
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 +1 -1
- package/src/consumer.ts +6 -14
- package/src/services.ts +1 -4
package/package.json
CHANGED
package/src/consumer.ts
CHANGED
|
@@ -2,11 +2,10 @@ import {
|
|
|
2
2
|
DeleteMessageCommand,
|
|
3
3
|
ReceiveMessageCommand,
|
|
4
4
|
type ReceiveMessageCommandOutput,
|
|
5
|
-
SQSClient,
|
|
5
|
+
type SQSClient,
|
|
6
6
|
} from "@aws-sdk/client-sqs";
|
|
7
|
-
import { AwsQueryProtocol } from "@aws-sdk/core/protocols";
|
|
8
7
|
import type { Logger } from "@remit/logger-lambda";
|
|
9
|
-
import {
|
|
8
|
+
import { createQueueProducer } from "@remit/sqs-client/producer";
|
|
10
9
|
import type { SQSRecord } from "aws-lambda";
|
|
11
10
|
import { type IndexOutcome, processBatch } from "./handler.js";
|
|
12
11
|
import { createIndexWorkStats, type IndexWorkStats } from "./index-stats.js";
|
|
@@ -33,18 +32,11 @@ const toSqsRecord = (
|
|
|
33
32
|
awsRegion: "",
|
|
34
33
|
}) satisfies SQSRecord;
|
|
35
34
|
|
|
36
|
-
const createSqsClient = (queueUrl: string): SQSClient =>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...(isLocal
|
|
41
|
-
? {
|
|
42
|
-
protocol: AwsQueryProtocol,
|
|
43
|
-
credentials: { accessKeyId: "local", secretAccessKey: "local" },
|
|
44
|
-
}
|
|
45
|
-
: { credentials: resolveSqsCredentials() }),
|
|
35
|
+
const createSqsClient = (queueUrl: string): SQSClient =>
|
|
36
|
+
createQueueProducer({
|
|
37
|
+
queueUrl,
|
|
38
|
+
localCredentials: { accessKeyId: "local", secretAccessKey: "local" },
|
|
46
39
|
});
|
|
47
|
-
};
|
|
48
40
|
|
|
49
41
|
export interface SqsConsumerConfig {
|
|
50
42
|
/** Search-index queue URL; defaults to `SQS_QUEUE_URL_SEARCH_INDEX`. */
|
package/src/services.ts
CHANGED