squiss-ts 5.2.2 → 5.3.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/dist/Squiss.js CHANGED
@@ -145,7 +145,7 @@ class Squiss extends events_1.EventEmitter {
145
145
  }
146
146
  /* istanbul ignore if */
147
147
  if (!newUrl) {
148
- throw new Error(`Failed to get configured SQQ endpoint`);
148
+ throw new Error('Failed to get configured SQQ endpoint');
149
149
  }
150
150
  const parsedQueueUrl = new url_1.URL(this._queueUrl);
151
151
  newUrl.pathname = parsedQueueUrl.pathname;
@@ -336,7 +336,10 @@ class Squiss extends events_1.EventEmitter {
336
336
  this._opts.receiveBatchSize = Math.min(this._opts.receiveBatchSize, this._opts.maxInFlight > 0 ? this._opts.maxInFlight : 10, 10);
337
337
  this._opts.minReceiveBatchSize = Math.min(this._opts.minReceiveBatchSize, this._opts.receiveBatchSize);
338
338
  }
339
- _deleteMessages(batch) {
339
+ async _deleteMessages(batch) {
340
+ if (batch.length === 0) {
341
+ return;
342
+ }
340
343
  return this.getQueueUrl().then((queueUrl) => {
341
344
  return this.sqs.deleteMessageBatch({
342
345
  QueueUrl: queueUrl,
@@ -490,7 +493,7 @@ class Squiss extends events_1.EventEmitter {
490
493
  getMessagePromise = (0, gzipUtils_1.compressMessage)(messageStr);
491
494
  params.MessageAttributes = params.MessageAttributes || {};
492
495
  params.MessageAttributes[gzipUtils_1.GZIP_MARKER] = {
493
- StringValue: `1`,
496
+ StringValue: '1',
494
497
  DataType: 'Number',
495
498
  };
496
499
  }
@@ -97,7 +97,9 @@ class TimeoutExtender {
97
97
  })
98
98
  .catch((err) => {
99
99
  if (err.name === 'ReceiptHandleIsInvalid' || err.name === 'MessageNotInflight' ||
100
- err.message.match(/Message does not exist or is not available/)) {
100
+ err.message.match(/message does not exist or is not available/i) ||
101
+ err.message.match(/the receipt handle has expired/i) ||
102
+ err.message.match(/not a valid receipt handle/i)) {
101
103
  this._deleteNode(node);
102
104
  node.message.emit('autoExtendFail', err);
103
105
  this._squiss.emit('autoExtendFail', { message: node.message, error: err });
package/dist/Types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Message } from './Message';
3
- import { SQSClientConfig, BatchResultErrorEntry, SQS, SQSServiceException, MessageAttributeValue } from '@aws-sdk/client-sqs';
3
+ import { SQSClientConfig, BatchResultErrorEntry, SQS, SQSServiceException, MessageAttributeValue, QueueAttributeName } from '@aws-sdk/client-sqs';
4
4
  import { S3, S3ClientConfig } from '@aws-sdk/client-s3';
5
5
  import { IS3Upload } from './s3Utils';
6
6
  import { StrictEventEmitter } from './EventEmitterTypesHelper';
@@ -37,7 +37,7 @@ export type BodyFormat = 'json' | 'plain' | undefined;
37
37
  export interface ISquissOptions {
38
38
  receiveBatchSize?: number;
39
39
  receiveAttributes?: string[];
40
- receiveSqsAttributes?: string[];
40
+ receiveSqsAttributes?: QueueAttributeName[];
41
41
  minReceiveBatchSize?: number;
42
42
  receiveWaitTimeSecs?: number;
43
43
  deleteBatchSize?: number;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { SQS } from '@aws-sdk/client-sqs';
2
- export { SQS };
1
+ import { SQS, QueueAttributeName } from '@aws-sdk/client-sqs';
2
+ export { SQS, QueueAttributeName };
3
3
  import { S3 } from '@aws-sdk/client-s3';
4
4
  export { S3 };
5
5
  export { Squiss } from './Squiss';
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Message = exports.Squiss = exports.S3 = exports.SQS = void 0;
3
+ exports.Message = exports.Squiss = exports.S3 = exports.QueueAttributeName = exports.SQS = void 0;
4
4
  /* istanbul ignore file */
5
5
  const client_sqs_1 = require("@aws-sdk/client-sqs");
6
6
  Object.defineProperty(exports, "SQS", { enumerable: true, get: function () { return client_sqs_1.SQS; } });
7
+ Object.defineProperty(exports, "QueueAttributeName", { enumerable: true, get: function () { return client_sqs_1.QueueAttributeName; } });
7
8
  const client_s3_1 = require("@aws-sdk/client-s3");
8
9
  Object.defineProperty(exports, "S3", { enumerable: true, get: function () { return client_s3_1.S3; } });
9
10
  var Squiss_1 = require("./Squiss");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squiss-ts",
3
- "version": "5.2.2",
3
+ "version": "5.3.0",
4
4
  "description": "High-volume SQS poller",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "compile": "tsc",
14
14
  "test": "yarn lint && yarn mocha",
15
15
  "cover": "yarn clean && yarn nyc yarn mocha",
16
- "lint": "tslint -c tslint.json \"src/**/*.ts\" \"test/**/*.ts\"",
16
+ "lint": "eslint -c .eslintrc.js --ext .ts \"src/**/*.ts\"",
17
17
  "benchmark": "tsc --extendedDiagnostics --incremental false",
18
18
  "e2e:start": "docker compose -f e2e/docker-compose.yml up &",
19
19
  "e2e:stop": "docker compose -f e2e/docker-compose.yml down &"
@@ -48,34 +48,40 @@
48
48
  },
49
49
  "homepage": "https://github.com/PruvoNet/squiss-ts#readme",
50
50
  "dependencies": {
51
- "@aws-sdk/client-s3": "^3.385.0",
52
- "@aws-sdk/client-sqs": "^3.385.0",
53
- "@aws-sdk/types": "^3.378.0",
51
+ "@aws-sdk/client-s3": "^3.456.0",
52
+ "@aws-sdk/client-sqs": "^3.454.0",
53
+ "@aws-sdk/types": "^3.451.0",
54
54
  "linked-list": "2.1.0",
55
55
  "ts-type-guards": "^0.7.0",
56
- "uuid": "^9.0.0"
56
+ "uuid": "^9.0.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@istanbuljs/nyc-config-typescript": "1.0.2",
60
- "@types/chai": "^4.3.5",
61
- "@types/chai-as-promised": "^7.1.5",
62
- "@types/mocha": "^10.0.1",
60
+ "@types/chai": "^4.3.11",
61
+ "@types/chai-as-promised": "^7.1.8",
62
+ "@types/mocha": "^10.0.6",
63
63
  "@types/node": "^16.18.39",
64
- "@types/proxyquire": "^1.3.28",
65
- "@types/uuid": "^9.0.2",
66
- "chai": "^4.3.7",
64
+ "@types/proxyquire": "^1.3.31",
65
+ "@types/uuid": "^9.0.7",
66
+ "@typescript-eslint/eslint-plugin": "^6.12.0",
67
+ "@typescript-eslint/parser": "^6.12.0",
68
+ "chai": "^4.3.10",
67
69
  "chai-as-promised": "^7.1.1",
68
70
  "delay": "5.0.0",
69
71
  "dirty-chai": "^2.0.1",
72
+ "eslint": "^8.54.0",
73
+ "eslint-config-prettier": "^9.0.0",
74
+ "eslint-plugin-import": "^2.29.0",
75
+ "eslint-plugin-jsdoc": "^46.9.0",
76
+ "eslint-plugin-prefer-arrow": "^1.2.3",
70
77
  "mocha": "^10.2.0",
71
78
  "nyc": "^15.1.0",
72
79
  "proxyquire": "^2.1.3",
73
- "sinon": "^15.2.0",
80
+ "sinon": "^17.0.1",
74
81
  "sinon-chai": "^3.7.0",
75
82
  "source-map-support": "^0.5.21",
76
83
  "ts-node": "^10.9.1",
77
- "tslint": "^6.1.3",
78
- "typescript": "^5.1.6"
84
+ "typescript": "^5.3.2"
79
85
  },
80
86
  "nyc": {
81
87
  "extends": "@istanbuljs/nyc-config-typescript",
@@ -84,7 +90,8 @@
84
90
  "exclude": [
85
91
  "src/test/**",
86
92
  "e2e**",
87
- "build**"
93
+ "build**",
94
+ ".eslintrc.js"
88
95
  ],
89
96
  "reporter": [
90
97
  "html",