unnbound-events 1.0.19 → 1.0.21

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.
@@ -1,5 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.shouldIgnorePath = void 0;
4
4
  exports.safeJsonParse = safeJsonParse;
5
5
  exports.normalizeIp = normalizeIp;
@@ -10,15 +10,15 @@ exports.normalizeIp = normalizeIp;
10
10
  * @returns boolean indicating if the path should be ignored
11
11
  */
12
12
  const shouldIgnorePath = (path, patterns) => {
13
- return patterns.some((pattern) => {
14
- // Convert glob pattern to regex
15
- const regexPattern = pattern
16
- .replace(/\./g, '\\.') // Escape dots
17
- .replace(/\*/g, '.*') // Convert * to .*
18
- .replace(/\?/g, '.'); // Convert ? to .
19
- const regex = new RegExp(`^${regexPattern}$`);
20
- return regex.test(path);
21
- });
13
+ return patterns.some((pattern) => {
14
+ // Convert glob pattern to regex
15
+ const regexPattern = pattern
16
+ .replace(/\./g, '\\.') // Escape dots
17
+ .replace(/\*/g, '.*') // Convert * to .*
18
+ .replace(/\?/g, '.'); // Convert ? to .
19
+ const regex = new RegExp(`^${regexPattern}$`);
20
+ return regex.test(path);
21
+ });
22
22
  };
23
23
  exports.shouldIgnorePath = shouldIgnorePath;
24
24
  /**
@@ -27,15 +27,14 @@ exports.shouldIgnorePath = shouldIgnorePath;
27
27
  * @returns Parsed JSON object or the original data.
28
28
  */
29
29
  function safeJsonParse(data) {
30
- if (typeof data === 'string') {
31
- try {
32
- return JSON.parse(data);
33
- }
34
- catch {
35
- return data;
36
- }
30
+ if (typeof data === 'string') {
31
+ try {
32
+ return JSON.parse(data);
33
+ } catch {
34
+ return data;
37
35
  }
38
- return data;
36
+ }
37
+ return data;
39
38
  }
40
39
  /**
41
40
  * Normalizes IP addresses by removing IPv6 mapping prefix for IPv4 addresses.
@@ -43,11 +42,10 @@ function safeJsonParse(data) {
43
42
  * @returns Normalized IP address string.
44
43
  */
45
44
  function normalizeIp(ip) {
46
- if (!ip)
47
- return ip;
48
- // Remove IPv4-mapped IPv6 prefix (::ffff:) to get clean IPv4 address
49
- if (ip.startsWith('::ffff:')) {
50
- return ip.substring(7);
51
- }
52
- return ip;
45
+ if (!ip) return ip;
46
+ // Remove IPv4-mapped IPv6 prefix (::ffff:) to get clean IPv4 address
47
+ if (ip.startsWith('::ffff:')) {
48
+ return ip.substring(7);
49
+ }
50
+ return ip;
53
51
  }
package/package.json CHANGED
@@ -1,25 +1,9 @@
1
1
  {
2
2
  "name": "unnbound-events",
3
3
  "description": "Unified events SDK to handle HTTP routes and SQS messages with a single routing API.",
4
- "version": "1.0.19",
4
+ "version": "1.0.21",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
- "scripts": {
8
- "build": "tsc",
9
- "test": "jest",
10
- "test:coverage": "jest --coverage",
11
- "test:watch": "jest --watch",
12
- "typecheck": "tsc -noEmit",
13
- "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
14
- "lint:fix": "pnpm lint --fix",
15
- "format": "prettier --write .",
16
- "format:check": "prettier --check .",
17
- "prepublishOnly": "pnpm build",
18
- "start:example:express": "npx --yes tsx --watch examples/express.ts",
19
- "start:example:sqs": "npx --yes tsx --watch examples/sqs.ts",
20
- "start:example:http-and-sqs": "npx --yes tsx --watch examples/http-and-sqs.ts",
21
- "version:bump": "npm version patch"
22
- },
23
7
  "author": "Unnbound Team",
24
8
  "license": "MIT",
25
9
  "repository": {
@@ -31,10 +15,11 @@
31
15
  "url": "https://github.com/unnbounddev/unnbound-sdks/issues"
32
16
  },
33
17
  "dependencies": {
34
- "express": "^4.0.0 || ^5.0.0",
35
- "@aws-sdk/client-sqs": "^3.0.0",
36
18
  "@aws-sdk/client-s3": "^3.0.0",
37
- "unnbound-logger-sdk": "^3.0.22"
19
+ "@aws-sdk/client-sqs": "^3.0.0",
20
+ "axios": "^1.12.2",
21
+ "express": "^4.0.0 || ^5.0.0",
22
+ "unnbound-logger-sdk": "3.0.23"
38
23
  },
39
24
  "peerDependencies": {
40
25
  "express": "^4.0.0 || ^5.0.0"
@@ -57,5 +42,20 @@
57
42
  "engines": {
58
43
  "node": ">=22"
59
44
  },
60
- "sideEffects": false
61
- }
45
+ "sideEffects": false,
46
+ "scripts": {
47
+ "build": "tsc",
48
+ "test": "jest",
49
+ "test:coverage": "jest --coverage",
50
+ "test:watch": "jest --watch",
51
+ "typecheck": "tsc -noEmit",
52
+ "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
53
+ "lint:fix": "pnpm lint --fix",
54
+ "format": "prettier --write .",
55
+ "format:check": "prettier --check .",
56
+ "start:example:express": "npx --yes tsx --watch examples/express.ts",
57
+ "start:example:sqs": "npx --yes tsx --watch examples/sqs.ts",
58
+ "start:example:http-and-sqs": "npx --yes tsx --watch examples/http-and-sqs.ts",
59
+ "version:bump": "npm version patch"
60
+ }
61
+ }