@queuedash/api
Advanced tools
| export {}; | ||
| //# sourceMappingURL=jobs.test.d.ts.map |
| export {}; | ||
| //# sourceMappingURL=queue.test.d.ts.map |
| import Bull from "bull"; | ||
| import BullMQ from "bullmq"; | ||
| import BeeQueue from "bee-queue"; | ||
| export declare const NUM_OF_JOBS = 20; | ||
| export declare const NUM_OF_COMPLETED_JOBS: number; | ||
| export declare const NUM_OF_FAILED_JOBS: number; | ||
| export declare const sleep: (t: number) => Promise<unknown>; | ||
| type QueueType = "bull" | "bullmq" | "bee"; | ||
| export declare const type: QueueType; | ||
| export declare const initRedisInstance: () => Promise<{ | ||
| ctx: { | ||
| queues: { | ||
| queue: Bull.Queue<any>; | ||
| displayName: string; | ||
| type: "bull"; | ||
| }[]; | ||
| }; | ||
| firstQueue: { | ||
| queue: Bull.Queue<any>; | ||
| displayName: string; | ||
| type: "bull"; | ||
| }; | ||
| } | { | ||
| ctx: { | ||
| queues: { | ||
| queue: BullMQ.Queue<any, any, string>; | ||
| displayName: string; | ||
| type: "bullmq"; | ||
| }[]; | ||
| }; | ||
| firstQueue: { | ||
| queue: BullMQ.Queue<any, any, string>; | ||
| displayName: string; | ||
| type: "bullmq"; | ||
| }; | ||
| } | { | ||
| ctx: { | ||
| queues: { | ||
| queue: BeeQueue<any>; | ||
| displayName: string; | ||
| type: "bee"; | ||
| }[]; | ||
| }; | ||
| firstQueue: { | ||
| queue: BeeQueue<any>; | ||
| displayName: string; | ||
| type: "bee"; | ||
| }; | ||
| }>; | ||
| export {}; | ||
| //# sourceMappingURL=test.utils.d.ts.map |
+147
| <p align="center"> | ||
| <a href="https://www.queuedash.com" target="_blank" rel="noopener"> | ||
| <img src="https://res.cloudinary.com/driverseat/image/upload/v1677406730/queuedash/queuedash-social.png" alt="QueueDash"> | ||
| </a> | ||
| </p> | ||
| <p align="center"> | ||
| A stunning, sleek dashboard for Bull, BullMQ, and Bee-Queue. | ||
| <p> | ||
| <p align="center"> | ||
| <a aria-label="NPM version" href="https://www.npmjs.com/package/@queuedash/api"> | ||
| <img alt="" src="https://img.shields.io/npm/v/@queuedash/api.svg?style=for-the-badge&labelColor=000000"> | ||
| </a> | ||
| <a aria-label="License" href="https://github.com/alexbudure/queuedash/blob/main/LICENSE"> | ||
| <img alt="" src="https://img.shields.io/npm/l/@queuedash/api.svg?style=for-the-badge&labelColor=000000&color="> | ||
| </a> | ||
| </p> | ||
| ## Features | ||
| - 😍 Simple, clean, and compact UI | ||
| - 🧙 Add jobs to your queue with ease | ||
| - 🪄 Retry, remove, and more convenient actions for your jobs | ||
| - 📊 Stats for job counts, job durations, and job wait times | ||
| - ✨ Top-level overview page of all queues | ||
| - 🔋 Integrates with Next.js, Express.js, and Fastify | ||
| - ⚡️ Compatible with Bull, BullMQ, and Bee-Queue | ||
| ## Getting Started | ||
| ### Express | ||
| `pnpm install @queuedash/api` | ||
| ```typescript | ||
| import express from "express"; | ||
| import Bull from "bull"; | ||
| import { createQueueDashExpressMiddleware } from "@queuedash/api"; | ||
| const app = express(); | ||
| createQueueDashExpressMiddleware({ | ||
| app, | ||
| baseUrl: "/queuedash", | ||
| ctx: { | ||
| queues: [ | ||
| { | ||
| queue: new Bull("report-queue"), | ||
| displayName: "Reports", | ||
| type: "bull" as const, | ||
| }, | ||
| ], | ||
| }, | ||
| }); | ||
| app.listen(3000, () => { | ||
| console.log("Listening on port 3000"); | ||
| console.log("Visit http://localhost:3000/queuedash"); | ||
| }); | ||
| ``` | ||
| ### Next.js | ||
| `pnpm install @queuedash/api @queuedash/ui` | ||
| ```typescript jsx | ||
| // pages/admin/queuedash/[[...slug]].tsx | ||
| import { QueueDashApp } from "@queuedash/ui"; | ||
| function getBaseUrl() { | ||
| if (process.env.VERCEL_URL) { | ||
| return `https://${process.env.VERCEL_URL}/api/queuedash`; | ||
| } | ||
| return `http://localhost:${process.env.PORT ?? 3000}/api/queuedash`; | ||
| } | ||
| const QueueDashPages = () => { | ||
| return <QueueDashApp apiUrl={getBaseUrl()} basename="/admin/queuedash" />; | ||
| }; | ||
| export default QueueDashPages; | ||
| // pages/api/queuedash/[trpc].ts | ||
| import * as trpcNext from "@trpc/server/adapters/next"; | ||
| import { appRouter } from "@queuedash/api"; | ||
| export default trpcNext.createNextApiHandler({ | ||
| router: appRouter, | ||
| batching: { | ||
| enabled: true, | ||
| }, | ||
| createContext: () => ({ | ||
| queues: [ | ||
| { | ||
| queue: new Bull("report-queue"), | ||
| displayName: "Reports", | ||
| type: "bull" as const, | ||
| }, | ||
| ], | ||
| }), | ||
| }); | ||
| ``` | ||
| See the [./examples](./examples) folder for more. | ||
| --- | ||
| ## API Reference | ||
| ### `createQueueDash<*>Middleware` | ||
| ```typescript | ||
| type QueueDashMiddlewareOptions = { | ||
| app: express.Application | FastifyInstance; // Express or Fastify app | ||
| baseUrl: string; // Base path for the API and UI | ||
| ctx: QueueDashContext; // Context for the UI | ||
| }; | ||
| type QueueDashContext = { | ||
| queues: QueueDashQueue[]; // Array of queues to display | ||
| }; | ||
| type QueueDashQueue = { | ||
| queue: Bull.Queue | BullMQ.Queue | BeeQueue; // Queue instance | ||
| displayName: string; // Display name for the queue | ||
| type: "bull" | "bullmq" | "bee"; // Queue type | ||
| }; | ||
| ``` | ||
| ### `<QueueDashApp />` | ||
| ```typescript jsx | ||
| type QueueDashAppProps = { | ||
| apiUrl: string; // URL to the API endpoint | ||
| basename: string; // Base path for the app | ||
| }; | ||
| ``` | ||
| ## Acknowledgements | ||
| QueueDash was inspired by some great open source projects. Here's a few of them: | ||
| - [bull-board](https://github.com/vcapretz/bull-board) | ||
| - [bull-monitor](https://github.com/s-r-x/bull-monitor) | ||
| - [bull-arena](https://github.com/bee-queue/arena) |
@@ -449,7 +449,2 @@ export type { Context } from "../trpc"; | ||
| paused: boolean; | ||
| client: { | ||
| connectedClients: string; | ||
| blockedClients: string; | ||
| version: string; | ||
| }; | ||
| counts: { | ||
@@ -456,0 +451,0 @@ active: number; |
@@ -132,7 +132,2 @@ export declare const queueRouter: import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{ | ||
| paused: boolean; | ||
| client: { | ||
| connectedClients: string; | ||
| blockedClients: string; | ||
| version: string; | ||
| }; | ||
| counts: { | ||
@@ -139,0 +134,0 @@ active: number; |
+12
-3
| { | ||
| "name": "@queuedash/api", | ||
| "version": "0.6.0", | ||
| "version": "1.0.0", | ||
| "main": "./dist/main.js", | ||
@@ -11,6 +11,11 @@ "module": "./dist/main.mjs", | ||
| "keywords": [ | ||
| "bull" | ||
| "bull", | ||
| "bee-queue", | ||
| "queue", | ||
| "bullmq", | ||
| "dashboard" | ||
| ], | ||
| "dependencies": { | ||
| "@trpc/server": "^10.14.0", | ||
| "redis": "^4.6.5", | ||
| "redis-info": "^3.1.0", | ||
@@ -20,2 +25,3 @@ "zod": "^3.20.6" | ||
| "devDependencies": { | ||
| "@faker-js/faker": "^7.6.0", | ||
| "@rollup/plugin-typescript": "^10.0.1", | ||
@@ -45,5 +51,8 @@ "@types/express": "^4.17.17", | ||
| "dev": "pnpm run build --watch", | ||
| "test": "vitest run", | ||
| "test": "pnpm run test:bull && pnpm run test:bullmq && pnpm run test:bee", | ||
| "test:bull": "QUEUE_TYPE=bull vitest run", | ||
| "test:bullmq": "QUEUE_TYPE=bull vitest run", | ||
| "test:bee": "QUEUE_TYPE=bee vitest run", | ||
| "lint": "eslint ./ --fix" | ||
| } | ||
| } |
| export {}; | ||
| //# sourceMappingURL=queue.test.d.ts.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1434832
115.93%20
17.65%19778
89.25%4
-20%0
-100%148
Infinity%0
-100%4
33.33%20
5.26%101
106.12%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added