@fgiova/sqs-consumer 2.1.1 → 2.1.3

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/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![NPM version](https://img.shields.io/npm/v/@fgiova/sqs-consumer.svg?style=flat)](https://www.npmjs.com/package/@fgiova/sqs-consumer)
4
4
  ![CI workflow](https://github.com/fgiova/sqs-consumer/actions/workflows/node.js.yml/badge.svg)
5
5
  [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
6
+ [![Linted with Biome](https://img.shields.io/badge/Linted_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev)
6
7
  [![Maintainability](https://qlty.sh/gh/fgiova/projects/sqs-consumer/maintainability.svg)](https://qlty.sh/gh/fgiova/projects/sqs-consumer)
7
8
  [![Code Coverage](https://qlty.sh/gh/fgiova/projects/sqs-consumer/coverage.svg)](https://qlty.sh/gh/fgiova/projects/sqs-consumer)
8
9
 
@@ -1,3 +1,5 @@
1
+ /** biome-ignore-all lint/complexity/noBannedTypes: Function required as generic */
2
+ import type { Message } from "@fgiova/mini-sqs-client";
1
3
  import type { Logger } from "./logger";
2
4
  export type HookName = "onPoll" | "onMessage" | "onHandlerSuccess" | "onHandlerTimeout" | "onHandlerError" | "onSuccess" | "onError" | "onSQSError";
3
5
  export declare class Hooks {
@@ -6,7 +8,7 @@ export declare class Hooks {
6
8
  private readonly logger;
7
9
  constructor(logger?: Logger);
8
10
  addHook(hook: HookName, fn: Function): void;
9
- runHook(hook: HookName, ...args: any[]): Promise<any>;
11
+ runHook(hook: HookName, ...args: any[]): Promise<boolean | void | Message | Message[]>;
10
12
  private runHookWithVoidReturn;
11
13
  private runHookWithMessageReturn;
12
14
  private runHookWithBooleanReturn;
@@ -1,3 +1,5 @@
1
+ /** biome-ignore-all lint/complexity/noBannedTypes: Function required as generic */
2
+ import type { Message } from "@fgiova/mini-sqs-client";
1
3
  import type { Logger } from "./logger.mjs";
2
4
  export type HookName = "onPoll" | "onMessage" | "onHandlerSuccess" | "onHandlerTimeout" | "onHandlerError" | "onSuccess" | "onError" | "onSQSError";
3
5
  export declare class Hooks {
@@ -6,7 +8,7 @@ export declare class Hooks {
6
8
  private readonly logger;
7
9
  constructor(logger?: Logger);
8
10
  addHook(hook: HookName, fn: Function): void;
9
- runHook(hook: HookName, ...args: any[]): Promise<any>;
11
+ runHook(hook: HookName, ...args: any[]): Promise<boolean | void | Message | Message[]>;
10
12
  private runHookWithVoidReturn;
11
13
  private runHookWithMessageReturn;
12
14
  private runHookWithBooleanReturn;
package/package.json CHANGED
@@ -1,81 +1,81 @@
1
1
  {
2
- "name": "@fgiova/sqs-consumer",
3
- "version": "2.1.1",
4
- "main": "./dist/index.js",
5
- "types": "./dist/index.d.ts",
6
- "exports": {
7
- ".": {
8
- "import": {
9
- "types": "./dist/esm/index.d.mts",
10
- "default": "./dist/esm/index.mjs"
11
- },
12
- "require": {
13
- "types": "./dist/cjs/index.d.ts",
14
- "default": "./dist/cjs/index.js"
15
- }
16
- }
17
- },
18
- "files": [
19
- "dist"
20
- ],
21
- "scripts": {
22
- "clean": "rimraf dist",
23
- "preBuild": "npm run clean",
24
- "build": "esmBuilder",
25
- "lint": "biome ci ./src ./test",
26
- "fix": "biome check --write ./src ./test",
27
- "test": "tap",
28
- "test:debug": "tap --only --timeout=0",
29
- "test:coverage": "tap --coverage-report=lcovonly --coverage-report=text",
30
- "test:local": "TEST_LOCAL=true tap"
31
- },
32
- "repository": {
33
- "type": "git",
34
- "url": "git+https://github.com/fgiova/sqs-consumer.git"
35
- },
36
- "author": "Francesco Giovannini <fgiova@fgiova.com>",
37
- "license": "MIT",
38
- "keywords": [
39
- "aws",
40
- "sqs",
41
- "sqs-consumer"
42
- ],
43
- "publishConfig": {
44
- "access": "public"
45
- },
46
- "engines": {
47
- "node": ">=20.0.0"
48
- },
49
- "tap": {
50
- "show-full-coverage": true,
51
- "before": "./test/scripts/executors/before.js",
52
- "after": "./test/scripts/executors/teardown.js",
53
- "exclude": [
54
- "test/helpers/**/*",
55
- "test/scripts/**/*"
56
- ]
57
- },
58
- "dependencies": {
59
- "@fgiova/mini-sqs-client": "^3.2.0",
60
- "@watchable/unpromise": "^1.0.2",
61
- "p-map": "^7.0.3"
62
- },
63
- "peerDependencies": {
64
- "@fgiova/aws-signature": "^3.1.0"
65
- },
66
- "devDependencies": {
67
- "@aws-sdk/client-sqs": "^3.758.0",
68
- "@biomejs/biome": "2.2.2",
69
- "@fgiova/cjs-esm-ts-builder": "^1.2.0",
70
- "@semantic-release/changelog": "^6.0.3",
71
- "@semantic-release/git": "^10.0.1",
72
- "@tsconfig/node20": "^20.1.4",
73
- "@types/node": "^20.17.23",
74
- "conventional-changelog-conventionalcommits": "^8.0.0",
75
- "semantic-release": "^24.2.3",
76
- "tap": "^21.1.0",
77
- "testcontainers": "^11.5.1",
78
- "ts-node": "^10.9.2",
79
- "typescript": "^5.8.2"
80
- }
2
+ "name": "@fgiova/sqs-consumer",
3
+ "version": "2.1.3",
4
+ "main": "./dist/cjs/index.js",
5
+ "types": "./dist/cjs/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "import": {
9
+ "types": "./dist/esm/index.d.mts",
10
+ "default": "./dist/esm/index.mjs"
11
+ },
12
+ "require": {
13
+ "types": "./dist/cjs/index.d.ts",
14
+ "default": "./dist/cjs/index.js"
15
+ }
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "clean": "rimraf dist",
23
+ "preBuild": "npm run clean",
24
+ "build": "esmBuilder",
25
+ "lint": "biome ci ./src ./test",
26
+ "fix": "biome check --write ./src ./test",
27
+ "test": "tap",
28
+ "test:debug": "tap --only --timeout=0",
29
+ "test:coverage": "tap --coverage-report=lcovonly --coverage-report=text",
30
+ "test:local": "TEST_LOCAL=true tap"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/fgiova/sqs-consumer.git"
35
+ },
36
+ "author": "Francesco Giovannini <fgiova@fgiova.com>",
37
+ "license": "MIT",
38
+ "keywords": [
39
+ "aws",
40
+ "sqs",
41
+ "sqs-consumer"
42
+ ],
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "engines": {
47
+ "node": ">=20.0.0"
48
+ },
49
+ "tap": {
50
+ "show-full-coverage": true,
51
+ "before": "./test/scripts/executors/before.js",
52
+ "after": "./test/scripts/executors/teardown.js",
53
+ "exclude": [
54
+ "test/helpers/**/*",
55
+ "test/scripts/**/*"
56
+ ]
57
+ },
58
+ "dependencies": {
59
+ "@fgiova/mini-sqs-client": "^3.2.2",
60
+ "@watchable/unpromise": "^1.0.2",
61
+ "p-map": "^7.0.3"
62
+ },
63
+ "peerDependencies": {
64
+ "@fgiova/aws-signature": "^3.1.2"
65
+ },
66
+ "devDependencies": {
67
+ "@aws-sdk/client-sqs": "^3.758.0",
68
+ "@biomejs/biome": "2.2.2",
69
+ "@fgiova/cjs-esm-ts-builder": "^1.2.0",
70
+ "@semantic-release/changelog": "^6.0.3",
71
+ "@semantic-release/git": "^10.0.1",
72
+ "@tsconfig/node20": "^20.1.4",
73
+ "@types/node": "^20.17.23",
74
+ "conventional-changelog-conventionalcommits": "^8.0.0",
75
+ "semantic-release": "^24.2.3",
76
+ "tap": "^21.1.0",
77
+ "testcontainers": "^11.5.1",
78
+ "ts-node": "^10.9.2",
79
+ "typescript": "^5.8.2"
80
+ }
81
81
  }