nextrans-logger 0.3.1 → 0.3.2

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.
Files changed (3) hide show
  1. package/bun.lock +521 -111
  2. package/dist/cloudwatch.js +11 -2
  3. package/package.json +3 -3
@@ -3,11 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Cloudwatch = void 0;
4
4
  const client_cloudwatch_logs_1 = require("@aws-sdk/client-cloudwatch-logs");
5
5
  const crypto_1 = require("crypto");
6
+ const ensureGetRandomValues = () => {
7
+ const globalCrypto = (globalThis.crypto ??= {});
8
+ if (typeof globalCrypto.getRandomValues !== 'function') {
9
+ globalCrypto.getRandomValues = (typedArray) => {
10
+ (0, crypto_1.randomFillSync)(typedArray);
11
+ return typedArray;
12
+ };
13
+ }
14
+ };
6
15
  class Cloudwatch {
7
16
  client;
8
17
  sequenceToken;
9
18
  DEFAULT_LOG_CONFIG;
10
19
  constructor(options) {
20
+ ensureGetRandomValues();
11
21
  this.client = new client_cloudwatch_logs_1.CloudWatchLogsClient({
12
22
  region: options.region,
13
23
  credentials: {
@@ -42,11 +52,10 @@ class Cloudwatch {
42
52
  message: this._formatMessage(message),
43
53
  },
44
54
  ],
45
- sequenceToken: this.sequenceToken ?? (0, crypto_1.randomUUID)(),
55
+ sequenceToken: this.sequenceToken,
46
56
  });
47
57
  const response = await this.client.send(command, {
48
58
  requestTimeout: 50,
49
- abortSignal: AbortSignal.timeout(30000),
50
59
  });
51
60
  this.sequenceToken = response.nextSequenceToken;
52
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextrans-logger",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Logging for nextrans app service",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",
@@ -12,11 +12,11 @@
12
12
  "author": "nextrans-team",
13
13
  "license": "ISC",
14
14
  "peerDependencies": {
15
- "@aws-sdk/client-cloudwatch-logs": "^3.1055.0",
15
+ "@aws-sdk/client-cloudwatch-logs": "3.721.0",
16
16
  "chalk": "^4.1.2"
17
17
  },
18
18
  "devDependencies": {
19
- "@aws-sdk/client-cloudwatch-logs": "^3.1058.0",
19
+ "@aws-sdk/client-cloudwatch-logs": "3.721.0",
20
20
  "chalk": "^4.1.2",
21
21
  "@types/jest": "^29.5.14",
22
22
  "@types/node": "^25.9.1",