sqs-consumer 9.0.0 → 9.1.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/CHANGELOG.md +7 -12
- package/dist/consumer.js +2 -1
- package/dist/errors.js +2 -1
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
- package/src/consumer.ts +1 -0
- package/src/errors.ts +2 -1
- package/src/types.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
## [9.
|
|
1
|
+
## [9.1.0](https://github.com/bbc/sqs-consumer/compare/v9.0.0...v9.1.0) (2024-03-12)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
* replacing the isRunning method with status (#459)
|
|
6
|
+
* feat: Add useQueueUrlAsEndpoint to ConsumerOptions ([#472](https://github.com/bbc/sqs-consumer/issues/472)) ([075bd54](https://github.com/bbc/sqs-consumer/commit/075bd54a0aa574f4589d7d8f2c6c82d6adbdf1a1))
|
|
8
7
|
|
|
9
|
-
### Features
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* handle CredentialsProviderError from AWS SDK JS v3 ([#474](https://github.com/bbc/sqs-consumer/issues/474)) ([9a14d66](https://github.com/bbc/sqs-consumer/commit/9a14d661c36e7bbca0dfc1ce467253991103279f))
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
### Chores
|
|
16
15
|
|
|
17
|
-
*
|
|
18
|
-
* **deps:** upgrading dependencies - March 24 ([#468](https://github.com/bbc/sqs-consumer/issues/468)) ([2d342cd](https://github.com/bbc/sqs-consumer/commit/2d342cd63365bb42c095e2d4f56a7e2433f43f25))
|
|
19
|
-
* handle breaking changes ([2924ca2](https://github.com/bbc/sqs-consumer/commit/2924ca24e9fda687bf47a5daf45d17618561dae1))
|
|
20
|
-
* **release:** v9.0.0 ([bc5593c](https://github.com/bbc/sqs-consumer/commit/bc5593c4f9940e30c05e6463a1e7339bf14f1e50))
|
|
21
|
-
* upgrading @semantic-release/npm ([bed4dc6](https://github.com/bbc/sqs-consumer/commit/bed4dc63e42344325de0be398952c2b99994e631))
|
|
16
|
+
* version bump to 9.1.0 ([c031e1e](https://github.com/bbc/sqs-consumer/commit/c031e1e12bfa43f35f2cae8221694b0ac31a8712))
|
package/dist/consumer.js
CHANGED
|
@@ -12,7 +12,7 @@ const logger_1 = require("./logger");
|
|
|
12
12
|
*/
|
|
13
13
|
class Consumer extends emitter_1.TypedEventEmitter {
|
|
14
14
|
constructor(options) {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
16
16
|
super();
|
|
17
17
|
this.pollingTimeoutId = undefined;
|
|
18
18
|
this.stopped = true;
|
|
@@ -41,6 +41,7 @@ class Consumer extends emitter_1.TypedEventEmitter {
|
|
|
41
41
|
this.sqs =
|
|
42
42
|
options.sqs ||
|
|
43
43
|
new client_sqs_1.SQSClient({
|
|
44
|
+
useQueueUrlAsEndpoint: (_g = options.useQueueUrlAsEndpoint) !== null && _g !== void 0 ? _g : true,
|
|
44
45
|
region: options.region || process.env.AWS_REGION || 'eu-west-1'
|
|
45
46
|
});
|
|
46
47
|
(0, bind_1.autoBind)(this);
|
package/dist/errors.js
CHANGED
|
@@ -32,7 +32,8 @@ function isConnectionError(err) {
|
|
|
32
32
|
return (err.statusCode === 403 ||
|
|
33
33
|
err.code === 'CredentialsError' ||
|
|
34
34
|
err.code === 'UnknownEndpoint' ||
|
|
35
|
-
err.code === 'AWS.SimpleQueueService.NonExistentQueue'
|
|
35
|
+
err.code === 'AWS.SimpleQueueService.NonExistentQueue' ||
|
|
36
|
+
err.code === 'CredentialsProviderError');
|
|
36
37
|
}
|
|
37
38
|
return false;
|
|
38
39
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -75,6 +75,11 @@ export interface ConsumerOptions {
|
|
|
75
75
|
* @defaultValue process.env.AWS_REGION || `eu-west-1`
|
|
76
76
|
*/
|
|
77
77
|
region?: string;
|
|
78
|
+
/**
|
|
79
|
+
* If false uses the QueueUrl hostname as the endpoint.
|
|
80
|
+
* @defaultValue `true`
|
|
81
|
+
*/
|
|
82
|
+
useQueueUrlAsEndpoint?: boolean;
|
|
78
83
|
/**
|
|
79
84
|
* Time in ms to wait for `handleMessage` to process a message before timing out.
|
|
80
85
|
*
|
package/package.json
CHANGED
package/src/consumer.ts
CHANGED
package/src/errors.ts
CHANGED
|
@@ -46,7 +46,8 @@ function isConnectionError(err: Error): boolean {
|
|
|
46
46
|
err.statusCode === 403 ||
|
|
47
47
|
err.code === 'CredentialsError' ||
|
|
48
48
|
err.code === 'UnknownEndpoint' ||
|
|
49
|
-
err.code === 'AWS.SimpleQueueService.NonExistentQueue'
|
|
49
|
+
err.code === 'AWS.SimpleQueueService.NonExistentQueue' ||
|
|
50
|
+
err.code === 'CredentialsProviderError'
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
53
|
return false;
|
package/src/types.ts
CHANGED
|
@@ -76,6 +76,11 @@ export interface ConsumerOptions {
|
|
|
76
76
|
* @defaultValue process.env.AWS_REGION || `eu-west-1`
|
|
77
77
|
*/
|
|
78
78
|
region?: string;
|
|
79
|
+
/**
|
|
80
|
+
* If false uses the QueueUrl hostname as the endpoint.
|
|
81
|
+
* @defaultValue `true`
|
|
82
|
+
*/
|
|
83
|
+
useQueueUrlAsEndpoint?: boolean;
|
|
79
84
|
/**
|
|
80
85
|
* Time in ms to wait for `handleMessage` to process a message before timing out.
|
|
81
86
|
*
|