express-file-cluster 0.1.6 → 0.2.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.
@@ -1,4 +1,4 @@
1
- import { T as TaskDefinition, a as TaskOptions } from '../types-CkpRAA3y.cjs';
1
+ import { T as TaskDefinition, a as TaskOptions } from '../types-Dj9-sLOK.cjs';
2
2
  import 'express';
3
3
 
4
4
  declare const taskRegistry: Map<string, TaskDefinition<unknown>>;
@@ -1,4 +1,4 @@
1
- import { T as TaskDefinition, a as TaskOptions } from '../types-CkpRAA3y.js';
1
+ import { T as TaskDefinition, a as TaskOptions } from '../types-Dj9-sLOK.js';
2
2
  import 'express';
3
3
 
4
4
  declare const taskRegistry: Map<string, TaskDefinition<unknown>>;
@@ -1,36 +1,10 @@
1
- // src/tasks/index.ts
2
- var taskRegistry = /* @__PURE__ */ new Map();
3
- var defineTask = (handlerOrOptions, maybeHandler) => {
4
- let options = {};
5
- let handler;
6
- if (typeof handlerOrOptions === "function") {
7
- handler = handlerOrOptions;
8
- } else {
9
- options = handlerOrOptions;
10
- if (!maybeHandler) throw new Error("[EFC] defineTask: handler function is required");
11
- handler = maybeHandler;
12
- }
13
- return {
14
- handler,
15
- options,
16
- name: ""
17
- };
18
- };
19
- var _impl = null;
20
- function setEnqueueImpl(impl) {
21
- _impl = impl;
22
- }
23
- async function enqueue(name, payload) {
24
- if (!_impl) {
25
- throw new Error(
26
- `[EFC] Task queue not initialised. Set tasks.backend in ignite() config.`
27
- );
28
- }
29
- return _impl(name, payload);
30
- }
31
- function registerTask(name, def) {
32
- taskRegistry.set(name, { ...def, name });
33
- }
1
+ import {
2
+ defineTask,
3
+ enqueue,
4
+ registerTask,
5
+ setEnqueueImpl,
6
+ taskRegistry
7
+ } from "../chunk-Z5YNIVQG.js";
34
8
  export {
35
9
  defineTask,
36
10
  enqueue,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tasks/index.ts"],"sourcesContent":["import type { TaskDefinition, TaskOptions } from '../types.js';\n\nexport const taskRegistry = new Map<string, TaskDefinition>();\n\ntype HandlerFn<T> = (payload: T) => Promise<void>;\ntype DefineTaskOverload = {\n <T>(handler: HandlerFn<T>): TaskDefinition<T>;\n <T>(options: TaskOptions, handler: HandlerFn<T>): TaskDefinition<T>;\n};\n\nexport const defineTask: DefineTaskOverload = <T>(\n handlerOrOptions: HandlerFn<T> | TaskOptions,\n maybeHandler?: HandlerFn<T>,\n): TaskDefinition<T> => {\n let options: TaskOptions = {};\n let handler: HandlerFn<T>;\n\n if (typeof handlerOrOptions === 'function') {\n handler = handlerOrOptions;\n } else {\n options = handlerOrOptions;\n if (!maybeHandler) throw new Error('[EFC] defineTask: handler function is required');\n handler = maybeHandler;\n }\n\n return {\n handler: handler as (payload: unknown) => Promise<void>,\n options,\n name: '',\n };\n};\n\ntype EnqueueImpl = (name: string, payload: unknown) => Promise<void>;\nlet _impl: EnqueueImpl | null = null;\n\nexport function setEnqueueImpl(impl: EnqueueImpl): void {\n _impl = impl;\n}\n\nexport async function enqueue<T>(name: string, payload: T): Promise<void> {\n if (!_impl) {\n throw new Error(\n `[EFC] Task queue not initialised. Set tasks.backend in ignite() config.`,\n );\n }\n return _impl(name, payload as unknown);\n}\n\nexport function registerTask(name: string, def: TaskDefinition): void {\n taskRegistry.set(name, { ...def, name });\n}\n"],"mappings":";AAEO,IAAM,eAAe,oBAAI,IAA4B;AAQrD,IAAM,aAAiC,CAC5C,kBACA,iBACsB;AACtB,MAAI,UAAuB,CAAC;AAC5B,MAAI;AAEJ,MAAI,OAAO,qBAAqB,YAAY;AAC1C,cAAU;AAAA,EACZ,OAAO;AACL,cAAU;AACV,QAAI,CAAC,aAAc,OAAM,IAAI,MAAM,gDAAgD;AACnF,cAAU;AAAA,EACZ;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAGA,IAAI,QAA4B;AAEzB,SAAS,eAAe,MAAyB;AACtD,UAAQ;AACV;AAEA,eAAsB,QAAW,MAAc,SAA2B;AACxE,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO,MAAM,MAAM,OAAkB;AACvC;AAEO,SAAS,aAAa,MAAc,KAA2B;AACpE,eAAa,IAAI,MAAM,EAAE,GAAG,KAAK,KAAK,CAAC;AACzC;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -57,7 +57,7 @@ interface FieldDefinition {
57
57
  default?: unknown;
58
58
  }
59
59
  type ModelSchema = Record<string, FieldDefinition>;
60
- interface ModelCRUD<T extends Record<string, unknown>> {
60
+ interface ModelCRUD<T extends Record<string, any>> {
61
61
  find(filter?: Partial<T>): Promise<T[]>;
62
62
  findById(id: string): Promise<(T & {
63
63
  id: string;
@@ -57,7 +57,7 @@ interface FieldDefinition {
57
57
  default?: unknown;
58
58
  }
59
59
  type ModelSchema = Record<string, FieldDefinition>;
60
- interface ModelCRUD<T extends Record<string, unknown>> {
60
+ interface ModelCRUD<T extends Record<string, any>> {
61
61
  find(filter?: Partial<T>): Promise<T[]>;
62
62
  findById(id: string): Promise<(T & {
63
63
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-file-cluster",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "Enterprise-grade, zero-boilerplate backend framework with file-based routing and multi-core clustering",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -36,20 +36,18 @@
36
36
  "typecheck": "tsc --noEmit"
37
37
  },
38
38
  "dependencies": {
39
- "chalk": "^5.3.0",
40
39
  "chokidar": "^4.0.0",
41
40
  "commander": "^12.0.0",
42
41
  "cookie-parser": "^1.4.6",
43
42
  "cors": "^2.8.6",
44
- "dotenv": "^17.4.2",
45
43
  "express": "^4.19.0",
46
- "jsonwebtoken": "^9.0.0"
44
+ "jose": "^6.2.3",
45
+ "picocolors": "^1.1.1"
47
46
  },
48
47
  "devDependencies": {
49
48
  "@types/cookie-parser": "^1.4.7",
50
49
  "@types/cors": "^2.8.19",
51
50
  "@types/express": "^4.17.21",
52
- "@types/jsonwebtoken": "^9.0.6",
53
51
  "@types/node": "^22.0.0",
54
52
  "@types/supertest": "^7.2.0",
55
53
  "bullmq": "^5.79.1",