@webtypen/webframez-core 0.3.62 → 0.3.63

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.
@@ -219,9 +219,6 @@ class NotificationsOutputChannelsJob extends BaseQueueJob_1.BaseQueueJob {
219
219
  target: notification.target,
220
220
  target_id: notification.target_id,
221
221
  });
222
- if (targetContext === null || targetContext === void 0 ? void 0 : targetContext.targetModel) {
223
- NotificationService_1.NotificationService.attachTargetModel(notification, targetContext.targetModel);
224
- }
225
222
  if (targetContext) {
226
223
  const loadedNotification = yield NotificationService_1.NotificationService.getNotificationForTarget(notification._id, targetContext);
227
224
  if (!loadedNotification) {
@@ -229,6 +226,9 @@ class NotificationsOutputChannelsJob extends BaseQueueJob_1.BaseQueueJob {
229
226
  }
230
227
  notification = loadedNotification;
231
228
  }
229
+ if (targetContext === null || targetContext === void 0 ? void 0 : targetContext.targetModel) {
230
+ NotificationService_1.NotificationService.attachTargetModel(notification, targetContext.targetModel);
231
+ }
232
232
  effectivePreference = targetContext
233
233
  ? yield NotificationService_1.NotificationService.getEffectiveTargetPreference(notType.key, targetContext)
234
234
  : { enabled: false, output_channels: [], owner_exists: false };
@@ -134,6 +134,12 @@ declare class RouterFacade {
134
134
  };
135
135
  } | undefined>;
136
136
  handleMiddleware(route: RouteObject, request: Request, response: Response): Promise<void>;
137
+ /**
138
+ * Runs registered kernel middleware outside a regular route definition.
139
+ * Package-provided multiplexing endpoints can use this while preserving
140
+ * the router's existing next/reject behavior.
141
+ */
142
+ runMiddleware(middlewareKeys: string[], request: Request, response: Response): Promise<void>;
137
143
  mapRequest(req: null | IncomingMessage, options?: any): Promise<Request>;
138
144
  parseRequestBody(req: IncomingMessage): Promise<unknown>;
139
145
  handleReturn(request: Request, response: Response, body: any): {
@@ -676,6 +676,20 @@ class RouterFacade {
676
676
  }
677
677
  });
678
678
  }
679
+ /**
680
+ * Runs registered kernel middleware outside a regular route definition.
681
+ * Package-provided multiplexing endpoints can use this while preserving
682
+ * the router's existing next/reject behavior.
683
+ */
684
+ runMiddleware(middlewareKeys, request, response) {
685
+ return __awaiter(this, void 0, void 0, function* () {
686
+ const middleware = Array.from(new Set((middlewareKeys || []).filter((key) => typeof key === "string" && key.trim() !== "")));
687
+ yield this.handleMiddleware({
688
+ path: request.pathname || request.url || "",
689
+ options: { middleware },
690
+ }, request, response);
691
+ });
692
+ }
679
693
  mapRequest(req, options) {
680
694
  return __awaiter(this, void 0, void 0, function* () {
681
695
  const request = new Request_1.Request();
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from "./BuildApplication";
15
15
  export * from "./LambdaApplication";
16
16
  export * from "./WebApplication";
17
17
  export * from "./Router/Route";
18
+ export * from "./Router/Router";
18
19
  export * from "./Router/Request";
19
20
  export * from "./Router/Response";
20
21
  export * from "./Database/BaseDBDriver";
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ __exportStar(require("./BuildApplication"), exports);
31
31
  __exportStar(require("./LambdaApplication"), exports);
32
32
  __exportStar(require("./WebApplication"), exports);
33
33
  __exportStar(require("./Router/Route"), exports);
34
+ __exportStar(require("./Router/Router"), exports);
34
35
  __exportStar(require("./Router/Request"), exports);
35
36
  __exportStar(require("./Router/Response"), exports);
36
37
  __exportStar(require("./Database/BaseDBDriver"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.3.62",
3
+ "version": "0.3.63",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",