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 CHANGED
@@ -1,21 +1,16 @@
1
- ## [9.0.0](https://github.com/bbc/sqs-consumer/compare/v8.2.0...v9.0.0) (2024-03-11)
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
- ### ⚠ BREAKING CHANGES
4
+ ### Features
5
5
 
6
- * removing handler_processing debugger in favour of status (#470)
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
- * removing handler_processing debugger in favour of status ([#470](https://github.com/bbc/sqs-consumer/issues/470)) ([b554da6](https://github.com/bbc/sqs-consumer/commit/b554da6e700bc0e69b77032352f250f19dba081b))
12
- * replacing the isRunning method with status ([#459](https://github.com/bbc/sqs-consumer/issues/459)) ([9f07383](https://github.com/bbc/sqs-consumer/commit/9f07383b0244fa0ce05238c45f27238cd3459ebf))
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
- * adding a link to the documentation ([#471](https://github.com/bbc/sqs-consumer/issues/471)) ([bd7fbbb](https://github.com/bbc/sqs-consumer/commit/bd7fbbb78a7e1d10cb7eae1b7d8f595c48b3438e))
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sqs-consumer",
3
- "version": "9.0.0",
3
+ "version": "9.1.0",
4
4
  "description": "Build SQS-based Node applications without the boilerplate",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/consumer.ts CHANGED
@@ -86,6 +86,7 @@ export class Consumer extends TypedEventEmitter {
86
86
  this.sqs =
87
87
  options.sqs ||
88
88
  new SQSClient({
89
+ useQueueUrlAsEndpoint: options.useQueueUrlAsEndpoint ?? true,
89
90
  region: options.region || process.env.AWS_REGION || 'eu-west-1'
90
91
  });
91
92
  autoBind(this);
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
  *