@alanszp/serverless 10.0.1 → 10.0.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.
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.withContext = void 0;
16
16
  const core_1 = __importDefault(require("@middy/core"));
17
- const cuid_1 = __importDefault(require("cuid"));
17
+ const cuid2_1 = require("@paralleldrive/cuid2");
18
18
  const core_2 = require("@alanszp/core");
19
19
  function withContext(sharedContext, handler, middlewares, baseLogger, audit) {
20
20
  return (event, context) => sharedContext.run(() => __awaiter(this, void 0, void 0, function* () {
@@ -23,9 +23,9 @@ function withContext(sharedContext, handler, middlewares, baseLogger, audit) {
23
23
  }), {
24
24
  logger: baseLogger,
25
25
  audit: audit.withState(),
26
- lifecycleId: (0, cuid_1.default)(),
26
+ lifecycleId: (0, cuid2_1.createId)(),
27
27
  lifecycleChain: (0, core_2.appIdentifier)(),
28
- contextId: (0, cuid_1.default)(),
28
+ contextId: (0, cuid2_1.createId)(),
29
29
  });
30
30
  }
31
31
  exports.withContext = withContext;
@@ -1 +1 @@
1
- {"version":3,"file":"withContext.js","sourceRoot":"","sources":["../../../src/handlers/wrappers/withContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,uDAAmD;AACnD,gDAAwB;AACxB,wCAA8C;AAG9C,SAAgB,WAAW,CACzB,aAA4B,EAC5B,OAA0C,EAC1C,WAA6C,EAC7C,UAAmB,EACnB,KAAY;IAEZ,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CACxB,aAAa,CAAC,GAAG,CACf,GAAS,EAAE;QACT,MAAM,2BAA2B,GAAG,WAAW,CAAC,MAAM,CACpD,CAAC,cAAc,EAAE,aAAa,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EACpE,IAAA,cAAK,EAAC,OAAO,CAAC,CACf,CAAC;QACF,OAAO,2BAA2B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC,CAAA,EACD;QACE,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE;QACxB,WAAW,EAAE,IAAA,cAAI,GAAE;QACnB,cAAc,EAAE,IAAA,oBAAa,GAAE;QAC/B,SAAS,EAAE,IAAA,cAAI,GAAE;KAClB,CACF,CAAC;AACN,CAAC;AAxBD,kCAwBC"}
1
+ {"version":3,"file":"withContext.js","sourceRoot":"","sources":["../../../src/handlers/wrappers/withContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,uDAAmD;AACnD,gDAAgD;AAChD,wCAA8C;AAG9C,SAAgB,WAAW,CACzB,aAA4B,EAC5B,OAA0C,EAC1C,WAA6C,EAC7C,UAAmB,EACnB,KAAY;IAEZ,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CACxB,aAAa,CAAC,GAAG,CACf,GAAS,EAAE;QACT,MAAM,2BAA2B,GAAG,WAAW,CAAC,MAAM,CACpD,CAAC,cAAc,EAAE,aAAa,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EACpE,IAAA,cAAK,EAAC,OAAO,CAAC,CACf,CAAC;QACF,OAAO,2BAA2B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC,CAAA,EACD;QACE,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE;QACxB,WAAW,EAAE,IAAA,gBAAQ,GAAE;QACvB,cAAc,EAAE,IAAA,oBAAa,GAAE;QAC/B,SAAS,EAAE,IAAA,gBAAQ,GAAE;KACtB,CACF,CAAC;AACN,CAAC;AAxBD,kCAwBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alanszp/serverless",
3
- "version": "10.0.1",
3
+ "version": "10.0.3",
4
4
  "description": "Alan's serverless utils and middlewares.",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -24,9 +24,9 @@
24
24
  "@alanszp/split": "*"
25
25
  },
26
26
  "devDependencies": {
27
- "@alanszp/audit": "^10.0.1",
27
+ "@alanszp/audit": "^10.0.2",
28
28
  "@alanszp/logger": "^10.0.1",
29
- "@alanszp/split": "^10.0.1",
29
+ "@alanszp/split": "^10.0.3",
30
30
  "@types/lodash": "^4.14.170",
31
31
  "@types/node": "^20.11.17",
32
32
  "ts-node": "^10.0.0",
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@alanszp/core": "^10.0.1",
38
- "@alanszp/shared-context": "^10.0.1",
38
+ "@alanszp/shared-context": "^10.0.2",
39
39
  "@alanszp/typeorm": "^10.0.1",
40
40
  "@middy/core": "^3.0.3",
41
41
  "@middy/util": "^3.0.3",
42
+ "@paralleldrive/cuid2": "^2.2.2",
42
43
  "@types/aws-lambda": "^8.10.97",
43
- "cuid": "^2.1.8",
44
44
  "lodash": "^4.17.21"
45
45
  },
46
- "gitHead": "43e1ad79adf9f06c314132d67495cee96dd82612"
46
+ "gitHead": "701d6cc7bd3a51a8b297903e7b2fff9c1b830da6"
47
47
  }
@@ -3,7 +3,7 @@ import { Audit } from "@alanszp/audit";
3
3
  import { SharedContext } from "@alanszp/shared-context";
4
4
  import { Context } from "aws-lambda";
5
5
  import middy, { MiddlewareObj } from "@middy/core";
6
- import cuid from "cuid";
6
+ import { createId } from "@paralleldrive/cuid2";
7
7
  import { appIdentifier } from "@alanszp/core";
8
8
  import { Lambda } from "../../types";
9
9
 
@@ -26,9 +26,9 @@ export function withContext<TEvent, TContext extends Context, TResult>(
26
26
  {
27
27
  logger: baseLogger,
28
28
  audit: audit.withState(),
29
- lifecycleId: cuid(),
29
+ lifecycleId: createId(),
30
30
  lifecycleChain: appIdentifier(),
31
- contextId: cuid(),
31
+ contextId: createId(),
32
32
  }
33
33
  );
34
34
  }