nestjs-power-queues 1.0.0
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/README.md +2 -0
- package/dist/index.cjs +78 -0
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +53 -0
- package/package.json +105 -0
package/README.md
ADDED
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
|
|
23
|
+
// src/index.ts
|
|
24
|
+
var index_exports = {};
|
|
25
|
+
__export(index_exports, {
|
|
26
|
+
NestjsPowerQueues: () => NestjsPowerQueues
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
|
|
30
|
+
// src/NestjsPowerQueues.ts
|
|
31
|
+
var import_common = require("@nestjs/common");
|
|
32
|
+
var import_power_queues = require("power-queues");
|
|
33
|
+
var import_nestjs_power_redis = require("nestjs-power-redis");
|
|
34
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
35
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
36
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
37
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
38
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
39
|
+
}
|
|
40
|
+
__name(_ts_decorate, "_ts_decorate");
|
|
41
|
+
function _ts_metadata(k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
}
|
|
44
|
+
__name(_ts_metadata, "_ts_metadata");
|
|
45
|
+
var _NestjsPowerQueues = class _NestjsPowerQueues extends import_power_queues.PowerQueues {
|
|
46
|
+
constructor(redis) {
|
|
47
|
+
super();
|
|
48
|
+
__publicField(this, "redis");
|
|
49
|
+
__publicField(this, "logger", new import_common.Logger("NestjsPowerQueues"));
|
|
50
|
+
__publicField(this, "runOnInit", false);
|
|
51
|
+
__publicField(this, "abort");
|
|
52
|
+
this.redis = redis;
|
|
53
|
+
}
|
|
54
|
+
async onModuleInit() {
|
|
55
|
+
await this.loadScripts(this.runOnInit);
|
|
56
|
+
if (this.runOnInit) {
|
|
57
|
+
await this.runQueue();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async onModuleDestroy() {
|
|
61
|
+
if (this.runOnInit) {
|
|
62
|
+
this.abort.abort();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
__name(_NestjsPowerQueues, "NestjsPowerQueues");
|
|
67
|
+
var NestjsPowerQueues = _NestjsPowerQueues;
|
|
68
|
+
NestjsPowerQueues = _ts_decorate([
|
|
69
|
+
(0, import_common.Injectable)(),
|
|
70
|
+
_ts_metadata("design:type", Function),
|
|
71
|
+
_ts_metadata("design:paramtypes", [
|
|
72
|
+
typeof import_nestjs_power_redis.NestjsPowerRedis === "undefined" ? Object : import_nestjs_power_redis.NestjsPowerRedis
|
|
73
|
+
])
|
|
74
|
+
], NestjsPowerQueues);
|
|
75
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
+
0 && (module.exports = {
|
|
77
|
+
NestjsPowerQueues
|
|
78
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnModuleInit, OnModuleDestroy, Logger } from '@nestjs/common';
|
|
2
|
+
import { PowerQueues } from 'power-queues';
|
|
3
|
+
import { NestjsPowerRedis } from 'nestjs-power-redis';
|
|
4
|
+
|
|
5
|
+
declare class NestjsPowerQueues extends PowerQueues implements OnModuleInit, OnModuleDestroy {
|
|
6
|
+
readonly redis: NestjsPowerRedis;
|
|
7
|
+
readonly logger: Logger;
|
|
8
|
+
readonly runOnInit: boolean;
|
|
9
|
+
abort: any;
|
|
10
|
+
constructor(redis: NestjsPowerRedis);
|
|
11
|
+
onModuleInit(): Promise<void>;
|
|
12
|
+
onModuleDestroy(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { NestjsPowerQueues };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnModuleInit, OnModuleDestroy, Logger } from '@nestjs/common';
|
|
2
|
+
import { PowerQueues } from 'power-queues';
|
|
3
|
+
import { NestjsPowerRedis } from 'nestjs-power-redis';
|
|
4
|
+
|
|
5
|
+
declare class NestjsPowerQueues extends PowerQueues implements OnModuleInit, OnModuleDestroy {
|
|
6
|
+
readonly redis: NestjsPowerRedis;
|
|
7
|
+
readonly logger: Logger;
|
|
8
|
+
readonly runOnInit: boolean;
|
|
9
|
+
abort: any;
|
|
10
|
+
constructor(redis: NestjsPowerRedis);
|
|
11
|
+
onModuleInit(): Promise<void>;
|
|
12
|
+
onModuleDestroy(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { NestjsPowerQueues };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
|
|
6
|
+
// src/NestjsPowerQueues.ts
|
|
7
|
+
import { Injectable, Logger } from "@nestjs/common";
|
|
8
|
+
import { PowerQueues } from "power-queues";
|
|
9
|
+
import { NestjsPowerRedis } from "nestjs-power-redis";
|
|
10
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
11
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
}
|
|
16
|
+
__name(_ts_decorate, "_ts_decorate");
|
|
17
|
+
function _ts_metadata(k, v) {
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
19
|
+
}
|
|
20
|
+
__name(_ts_metadata, "_ts_metadata");
|
|
21
|
+
var _NestjsPowerQueues = class _NestjsPowerQueues extends PowerQueues {
|
|
22
|
+
constructor(redis) {
|
|
23
|
+
super();
|
|
24
|
+
__publicField(this, "redis");
|
|
25
|
+
__publicField(this, "logger", new Logger("NestjsPowerQueues"));
|
|
26
|
+
__publicField(this, "runOnInit", false);
|
|
27
|
+
__publicField(this, "abort");
|
|
28
|
+
this.redis = redis;
|
|
29
|
+
}
|
|
30
|
+
async onModuleInit() {
|
|
31
|
+
await this.loadScripts(this.runOnInit);
|
|
32
|
+
if (this.runOnInit) {
|
|
33
|
+
await this.runQueue();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async onModuleDestroy() {
|
|
37
|
+
if (this.runOnInit) {
|
|
38
|
+
this.abort.abort();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
__name(_NestjsPowerQueues, "NestjsPowerQueues");
|
|
43
|
+
var NestjsPowerQueues = _NestjsPowerQueues;
|
|
44
|
+
NestjsPowerQueues = _ts_decorate([
|
|
45
|
+
Injectable(),
|
|
46
|
+
_ts_metadata("design:type", Function),
|
|
47
|
+
_ts_metadata("design:paramtypes", [
|
|
48
|
+
typeof NestjsPowerRedis === "undefined" ? Object : NestjsPowerRedis
|
|
49
|
+
])
|
|
50
|
+
], NestjsPowerQueues);
|
|
51
|
+
export {
|
|
52
|
+
NestjsPowerQueues
|
|
53
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nestjs-power-queues",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "NestJS wrapper for PowerQueues.",
|
|
5
|
+
"author": "ihor-bielchenko",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+ssh://git@github.com:ihor-bielchenko/nestjs-power-queues.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ihor-bielchenko/nestjs-power-queues/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/ihor-bielchenko/nestjs-power-queues#readme",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "dist/index.cjs",
|
|
17
|
+
"module": "dist/index.js",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"require": "./dist/index.cjs",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
31
|
+
"clean": "rimraf dist docs"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=14"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"redis",
|
|
38
|
+
"redis-client",
|
|
39
|
+
"redis-wrapper",
|
|
40
|
+
"redis-abstraction",
|
|
41
|
+
"redis-utility",
|
|
42
|
+
"redis-helper",
|
|
43
|
+
"redis-queue",
|
|
44
|
+
"redis-list",
|
|
45
|
+
"redis-bulk",
|
|
46
|
+
"redis-scan",
|
|
47
|
+
"redis-mget",
|
|
48
|
+
"redis-ttl",
|
|
49
|
+
"redis-expire",
|
|
50
|
+
"redis-delete",
|
|
51
|
+
"redis-keys",
|
|
52
|
+
"redis-pattern",
|
|
53
|
+
"redis-pipeline",
|
|
54
|
+
"redis-multi",
|
|
55
|
+
"redis-atomic",
|
|
56
|
+
"json-serialization",
|
|
57
|
+
"safe-serialization",
|
|
58
|
+
"key-schema",
|
|
59
|
+
"key-builder",
|
|
60
|
+
"pattern-validation",
|
|
61
|
+
"key-validation",
|
|
62
|
+
"list-iterator",
|
|
63
|
+
"lpop-count",
|
|
64
|
+
"mget-chunked",
|
|
65
|
+
"nodejs",
|
|
66
|
+
"node",
|
|
67
|
+
"typescript",
|
|
68
|
+
"ts",
|
|
69
|
+
"esm",
|
|
70
|
+
"cjs",
|
|
71
|
+
"async",
|
|
72
|
+
"await",
|
|
73
|
+
"queue",
|
|
74
|
+
"cache",
|
|
75
|
+
"key-value",
|
|
76
|
+
"data-store",
|
|
77
|
+
"lightweight",
|
|
78
|
+
"abstraction-layer",
|
|
79
|
+
"typed-client",
|
|
80
|
+
"high-performance",
|
|
81
|
+
"atomic-operations",
|
|
82
|
+
"transactional",
|
|
83
|
+
"chunked-operations",
|
|
84
|
+
"safe-redis",
|
|
85
|
+
"power-redis",
|
|
86
|
+
"nestjs-power-redis",
|
|
87
|
+
"nestjs-power-queues",
|
|
88
|
+
"nestjs",
|
|
89
|
+
"nest"
|
|
90
|
+
],
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"@swc/core": "^1.15.1",
|
|
93
|
+
"@types/node": "^24.8.1",
|
|
94
|
+
"tsup": "^8.5.0",
|
|
95
|
+
"typescript": "^5.9.3"
|
|
96
|
+
},
|
|
97
|
+
"dependencies": {
|
|
98
|
+
"@nestjs-labs/nestjs-ioredis": "^11.0.4",
|
|
99
|
+
"@nestjs/common": "^11.1.8",
|
|
100
|
+
"full-utils": "^2.0.3",
|
|
101
|
+
"nestjs-power-redis": "^1.0.1",
|
|
102
|
+
"power-queues": "^2.0.4",
|
|
103
|
+
"power-redis": "^2.0.4"
|
|
104
|
+
}
|
|
105
|
+
}
|