murlock 3.2.0 → 3.3.0-beta.1

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.
@@ -0,0 +1 @@
1
+ export * from './uuid-generator';
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./async-local-storage.interceptor"), exports);
17
+ __exportStar(require("./uuid-generator"), exports);
18
18
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
@@ -0,0 +1 @@
1
+ export declare function generateUuid(): string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateUuid = void 0;
4
+ function generateUuid() {
5
+ let d = Date.now();
6
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
7
+ const r = (d + Math.random() * 16) % 16 | 0;
8
+ d = Math.floor(d / 16);
9
+ return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);
10
+ });
11
+ }
12
+ exports.generateUuid = generateUuid;
13
+ //# sourceMappingURL=uuid-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid-generator.js","sourceRoot":"","sources":["../../lib/utils/uuid-generator.ts"],"names":[],"mappings":";;;AAAA,SAAgB,YAAY;IAC1B,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACnB,OAAO,sCAAsC,CAAC,OAAO,CACnD,OAAO,EACP,CAAC,CAAS,EAAE,EAAE;QACZ,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC5C,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QACvB,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC,CACF,CAAC;AACJ,CAAC;AAVD,oCAUC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "murlock",
3
- "version": "3.2.0",
3
+ "version": "3.3.0-beta.1",
4
4
  "description": "A distributed locking solution for NestJS, providing a decorator for critical sections with Redis-based synchronization.",
5
5
  "author": "https://github.com/felanios",
6
6
  "homepage": "https://github.com/felanios/murlock#readme",
@@ -10,12 +10,14 @@
10
10
  "scripts": {
11
11
  "copy-lua": "ncp lib/lua dist/lua/",
12
12
  "prepare": "husky install",
13
+ "prebuild": "del-cli ./dist/*",
13
14
  "build": "tsc && npm run copy-lua",
14
15
  "release": "semantic-release"
15
16
  },
16
17
  "dependencies": {
17
18
  "@nestjs/common": ">=10.0.5",
18
19
  "@nestjs/core": ">=10.0.5",
20
+ "del-cli": "^5.1.0",
19
21
  "redis": "^4.6.10",
20
22
  "reflect-metadata": "^0.1.13",
21
23
  "rxjs": "^7.8.1"
@@ -72,5 +74,9 @@
72
74
  "redis",
73
75
  "decorator",
74
76
  "microservices"
77
+ ],
78
+ "files": [
79
+ "dist/**/*",
80
+ "README.md"
75
81
  ]
76
82
  }
@@ -1,29 +0,0 @@
1
- name: Release
2
- on:
3
- push:
4
- branches:
5
- - master
6
- - beta
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - name: Checkout
12
- uses: actions/checkout@v2
13
-
14
- - name: Setup Node.js
15
- uses: actions/setup-node@v2
16
- with:
17
- node-version: 18
18
-
19
- - name: Install dependencies
20
- run: npm ci
21
-
22
- - name: Build
23
- run: npm run build
24
-
25
- - name: Release package
26
- env:
27
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29
- run: npm run release
package/.husky/commit-msg DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- npx --no -- commitlint --edit "$1"
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- extends: ['@commitlint/config-conventional'],
3
- rules: {
4
- 'body-max-line-length': [0],
5
- }
6
- }
@@ -1,8 +0,0 @@
1
- import { NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';
2
- import { Observable } from 'rxjs';
3
- import { AsyncStorageManager } from '../als/als-manager';
4
- export declare class AsyncStorageInterceptor implements NestInterceptor {
5
- private readonly asyncStorageManager;
6
- constructor(asyncStorageManager: AsyncStorageManager<string>);
7
- intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
8
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-local-storage.interceptor.js","sourceRoot":"","sources":["../../lib/interceptors/async-local-storage.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4F;AAC5F,+BAAkC;AAClC,8CAAqC;AACrC,oDAAyD;AAGlD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,mBAAgD;QAAhD,wBAAmB,GAAnB,mBAAmB,CAA6B;IAAI,CAAC;IAElF,SAAS,CAAC,OAAyB,EAAE,IAAiB;QACpD,OAAO,IAAI,iBAAU,CAAC,CAAC,UAAU,EAAE,EAAE;YACnC,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,GAAS,EAAE;gBACpD,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAChB,IAAA,eAAG,EAAC;oBACF,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;oBACvC,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;oBACrC,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE;iBACtC,CAAC,CACH,CAAC,SAAS,EAAE,CAAC;YAChB,CAAC,CAAA,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAhBY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;qCAEuC,iCAAmB;GAD1D,uBAAuB,CAgBnC"}
@@ -1 +0,0 @@
1
- export * from './async-local-storage.interceptor';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/interceptors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD"}
package/tsconfig.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "declaration": true,
5
- "removeComments": true,
6
- "emitDecoratorMetadata": true,
7
- "experimentalDecorators": true,
8
- "target": "es6",
9
- "sourceMap": true,
10
- "outDir": "./dist",
11
- "baseUrl": "./",
12
- "incremental": true
13
- },
14
- "include": [
15
- "lib/**/*.ts"
16
- ],
17
- "exclude": [
18
- "node_modules",
19
- "dist"
20
- ]
21
- }