@emartech/me-idempotency 4.0.5 → 4.0.7

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/dist/index.cjs CHANGED
@@ -1,4 +1,3 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
1
  "use strict";
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -19,12 +18,12 @@ var __copyProps = (to, from, except, desc) => {
19
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
19
 
21
20
  // src/index.ts
22
- var src_exports = {};
23
- __export(src_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
24
23
  createRedisIdempotency: () => createRedisIdempotency,
25
24
  defaultIdempotencyKeyGenerator: () => defaultIdempotencyKeyGenerator
26
25
  });
27
- module.exports = __toCommonJS(src_exports);
26
+ module.exports = __toCommonJS(index_exports);
28
27
 
29
28
  // src/create-idempotency-fn.ts
30
29
  var defaultIdempotencyKeyGenerator = (...args) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/create-idempotency-fn.ts"],"sourcesContent":["export { createRedisIdempotency, defaultIdempotencyKeyGenerator } from './create-idempotency-fn'\n","import { RedisClientType } from 'redis'\n\nexport const defaultIdempotencyKeyGenerator = (...args: unknown[]) => {\n const prefix = 'idempotency'\n return [prefix].concat(args.map(arg => `${arg}`)).join(':')\n}\n\nexport const createRedisIdempotency = (client: RedisClientType, ttlInSec: number = 60 * 60 * 6) => {\n return {\n del: async (key: string) => client.del(key),\n set: async (key: string) => {\n const result = await client.set(key, '1', { EX: ttlInSec, NX: true })\n return result === 'OK'\n },\n get: async (key: string) => {\n const result = await client.get(key)\n return result !== null\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,iCAAiC,IAAI,SAAoB;AACpE,QAAM,SAAS;AACf,SAAO,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,SAAO,GAAG,GAAG,EAAE,CAAC,EAAE,KAAK,GAAG;AAC5D;AAEO,IAAM,yBAAyB,CAAC,QAAyB,WAAmB,KAAK,KAAK,MAAM;AACjG,SAAO;AAAA,IACL,KAAK,OAAO,QAAgB,OAAO,IAAI,GAAG;AAAA,IAC1C,KAAK,OAAO,QAAgB;AAC1B,YAAM,SAAS,MAAM,OAAO,IAAI,KAAK,KAAK,EAAE,IAAI,UAAU,IAAI,KAAK,CAAC;AACpE,aAAO,WAAW;AAAA,IACpB;AAAA,IACA,KAAK,OAAO,QAAgB;AAC1B,YAAM,SAAS,MAAM,OAAO,IAAI,GAAG;AACnC,aAAO,WAAW;AAAA,IACpB;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/create-idempotency-fn.ts"],"sourcesContent":["export { createRedisIdempotency, defaultIdempotencyKeyGenerator } from './create-idempotency-fn'\n","import { RedisClientType } from 'redis'\n\nexport const defaultIdempotencyKeyGenerator = (...args: unknown[]) => {\n const prefix = 'idempotency'\n return [prefix].concat(args.map(arg => `${arg}`)).join(':')\n}\n\nexport const createRedisIdempotency = (client: RedisClientType, ttlInSec: number = 60 * 60 * 6) => {\n return {\n del: async (key: string) => client.del(key),\n set: async (key: string) => {\n const result = await client.set(key, '1', { EX: ttlInSec, NX: true })\n return result === 'OK'\n },\n get: async (key: string) => {\n const result = await client.get(key)\n return result !== null\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,iCAAiC,IAAI,SAAoB;AACpE,QAAM,SAAS;AACf,SAAO,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,SAAO,GAAG,GAAG,EAAE,CAAC,EAAE,KAAK,GAAG;AAC5D;AAEO,IAAM,yBAAyB,CAAC,QAAyB,WAAmB,KAAK,KAAK,MAAM;AACjG,SAAO;AAAA,IACL,KAAK,OAAO,QAAgB,OAAO,IAAI,GAAG;AAAA,IAC1C,KAAK,OAAO,QAAgB;AAC1B,YAAM,SAAS,MAAM,OAAO,IAAI,KAAK,KAAK,EAAE,IAAI,UAAU,IAAI,KAAK,CAAC;AACpE,aAAO,WAAW;AAAA,IACpB;AAAA,IACA,KAAK,OAAO,QAAgB;AAC1B,YAAM,SAAS,MAAM,OAAO,IAAI,GAAG;AACnC,aAAO,WAAW;AAAA,IACpB;AAAA,EACF;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emartech/me-idempotency",
3
- "version": "4.0.5",
3
+ "version": "4.0.7",
4
4
  "description": "Idempotency library using Redis as a backend.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": "github:emartech/me-modules",
@@ -22,28 +22,29 @@
22
22
  "build": "tsup",
23
23
  "lint": "eslint src/",
24
24
  "format": "eslint src/ --fix",
25
- "typecheck": "tsc --noEmit",
25
+ "typecheck-code": "tsc --noEmit",
26
+ "typecheck-build": "attw --pack .",
26
27
  "spec": "NODE_ENV=test mocha",
27
- "test": "npm run lint && npm run typecheck && npm run spec",
28
+ "test": "npm run lint && npm run typecheck-code && npm run spec",
28
29
  "prepublishOnly": "npm run build"
29
30
  },
30
31
  "dependencies": {
31
- "redis": "^4.7.0"
32
+ "redis": "^5.10.0"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@types/chai": "^5.0.1",
35
36
  "@types/mocha": "^10.0.7",
36
- "@types/sinon": "^17.0.3",
37
- "chai": "^5.1.2",
37
+ "@types/sinon": "^21.0.0",
38
+ "chai": "^6.2.2",
38
39
  "chai-string": "2.0.0",
39
40
  "chai-subset": "1.6.0",
40
- "dotenv": "^16.4.7",
41
+ "dotenv": "^17.2.3",
41
42
  "mocha": "^11.0.1",
42
- "sinon": "^19.0.2",
43
+ "sinon": "^21.0.1",
43
44
  "sinon-chai": "^4.0.0"
44
45
  },
45
46
  "engines": {
46
47
  "node": ">=20"
47
48
  },
48
- "gitHead": "064d83ef76f3ca61fa946fc995ed7d22bbb42af4"
49
+ "gitHead": "4d869b83fae1629f0051ea87c61269fd7f4e00ad"
49
50
  }