@unito/integration-sdk 1.0.12 → 1.0.13

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  var integrationApi = require('@unito/integration-api');
4
4
  var cachette = require('cachette');
5
- var uuid = require('uuid');
5
+ var crypto = require('crypto');
6
6
  var express = require('express');
7
7
 
8
8
  function _interopNamespaceDefault(e) {
@@ -23,7 +23,6 @@ function _interopNamespaceDefault(e) {
23
23
  }
24
24
 
25
25
  var integrationApi__namespace = /*#__PURE__*/_interopNamespaceDefault(integrationApi);
26
- var uuid__namespace = /*#__PURE__*/_interopNamespaceDefault(uuid);
27
26
 
28
27
  var LogLevel;
29
28
  (function (LogLevel) {
@@ -214,7 +213,7 @@ class Cache {
214
213
  static create(redisUrl) {
215
214
  const cacheInstance = redisUrl ? new cachette.RedisCache(redisUrl) : new cachette.LocalCache();
216
215
  // Intended: the correlation id will be the same for all logs of Cachette.
217
- const correlationId = uuid__namespace.v4();
216
+ const correlationId = crypto.randomUUID();
218
217
  const logger = new Logger({ correlation_id: correlationId });
219
218
  cacheInstance
220
219
  .on('info', message => {
@@ -354,7 +353,7 @@ function buildHttpError(responseStatus, message) {
354
353
  }
355
354
 
356
355
  const middleware$9 = (req, res, next) => {
357
- res.locals.correlationId = req.header('X-Unito-Correlation-Id') ?? uuid__namespace.v4();
356
+ res.locals.correlationId = req.header('X-Unito-Correlation-Id') ?? crypto.randomUUID();
358
357
  next();
359
358
  };
360
359
 
@@ -1,6 +1,6 @@
1
- import * as uuid from 'uuid';
1
+ import crypto from 'crypto';
2
2
  const middleware = (req, res, next) => {
3
- res.locals.correlationId = req.header('X-Unito-Correlation-Id') ?? uuid.v4();
3
+ res.locals.correlationId = req.header('X-Unito-Correlation-Id') ?? crypto.randomUUID();
4
4
  next();
5
5
  };
6
6
  export default middleware;
@@ -1,5 +1,5 @@
1
1
  import { LocalCache, RedisCache } from 'cachette';
2
- import * as uuid from 'uuid';
2
+ import crypto from 'crypto';
3
3
  import Logger from './logger.js';
4
4
  /**
5
5
  * The Cache class provides caching capabilities that can be used across your integration.
@@ -80,7 +80,7 @@ export class Cache {
80
80
  static create(redisUrl) {
81
81
  const cacheInstance = redisUrl ? new RedisCache(redisUrl) : new LocalCache();
82
82
  // Intended: the correlation id will be the same for all logs of Cachette.
83
- const correlationId = uuid.v4();
83
+ const correlationId = crypto.randomUUID();
84
84
  const logger = new Logger({ correlation_id: correlationId });
85
85
  cacheInstance
86
86
  .on('info', message => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-sdk",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Integration SDK",
5
5
  "type": "module",
6
6
  "types": "dist/src/index.d.ts",
@@ -35,7 +35,6 @@
35
35
  "devDependencies": {
36
36
  "@types/express": "4.x",
37
37
  "@types/node": "20.x",
38
- "@types/uuid": "9.x",
39
38
  "@typescript-eslint/eslint-plugin": "7.x",
40
39
  "@typescript-eslint/parser": "7.x",
41
40
  "eslint": "8.x",
@@ -48,8 +47,7 @@
48
47
  "dependencies": {
49
48
  "@unito/integration-api": "0.x",
50
49
  "cachette": "2.x",
51
- "express": "^5.0.0-beta.3",
52
- "uuid": "9.x"
50
+ "express": "^5.0.0-beta.3"
53
51
  },
54
52
  "keywords": [
55
53
  "typescript",
@@ -1,5 +1,5 @@
1
1
  import { Request, Response, NextFunction } from 'express';
2
- import * as uuid from 'uuid';
2
+ import crypto from 'crypto';
3
3
 
4
4
  declare global {
5
5
  // eslint-disable-next-line @typescript-eslint/no-namespace
@@ -11,7 +11,7 @@ declare global {
11
11
  }
12
12
 
13
13
  const middleware = (req: Request, res: Response, next: NextFunction) => {
14
- res.locals.correlationId = req.header('X-Unito-Correlation-Id') ?? uuid.v4();
14
+ res.locals.correlationId = req.header('X-Unito-Correlation-Id') ?? crypto.randomUUID();
15
15
 
16
16
  next();
17
17
  };
@@ -1,5 +1,5 @@
1
1
  import { LocalCache, CacheInstance, FetchingFunction, CachableValue, RedisCache } from 'cachette';
2
- import * as uuid from 'uuid';
2
+ import crypto from 'crypto';
3
3
  import Logger from './logger.js';
4
4
 
5
5
  /**
@@ -95,7 +95,7 @@ export class Cache {
95
95
  const cacheInstance: CacheInstance = redisUrl ? new RedisCache(redisUrl) : new LocalCache();
96
96
 
97
97
  // Intended: the correlation id will be the same for all logs of Cachette.
98
- const correlationId = uuid.v4();
98
+ const correlationId = crypto.randomUUID();
99
99
 
100
100
  const logger = new Logger({ correlation_id: correlationId });
101
101