@airoom/nextmin-node 0.1.4 → 0.1.5

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,7 +1,7 @@
1
- import express from 'express';
2
- import type { Server as HttpServer } from 'http';
3
- import { DatabaseAdapter } from '../database/DatabaseAdapter';
4
- import type { FileStorageAdapter } from '../files/FileStorageAdapter';
1
+ import express from "express";
2
+ import type { Server as HttpServer } from "http";
3
+ import { DatabaseAdapter } from "../database/DatabaseAdapter";
4
+ import type { FileStorageAdapter } from "../files/FileStorageAdapter";
5
5
  export interface APIRouterOptions {
6
6
  dbAdapter: DatabaseAdapter;
7
7
  server?: HttpServer;
@@ -31,35 +31,19 @@ export declare class APIRouter {
31
31
  private rebuildModels;
32
32
  private mountSchemasEndpointOnce;
33
33
  private mountRoutes;
34
+ private mountFindRoutes;
35
+ private createCtx;
34
36
  private getSchema;
35
37
  private getModel;
36
- private setupRoutes;
37
- private mountFindRoutes;
38
- private fileAuthMiddleware;
39
- /** Mount generic file endpoints under this router */
40
- private setupFileRoutes;
41
- /** uploads/YYYY/MM/DD */
42
- private shortFolder;
43
- /** small, URL-safe uid */
44
- private shortUid;
45
- private normalizeAttrType;
46
38
  private optionalAuthMiddleware;
47
39
  private pickAuthFor;
48
40
  private getUserRoleFromReq;
49
41
  private normalizeRoleName;
50
- private setupAuthRoutes;
51
- /**
52
- * Validate required fields.
53
- * - create: field must exist and be non-empty (not null/undefined/'').
54
- * - update: only validate fields that are explicitly present in the payload;
55
- * absence means "unchanged".
56
- */
42
+ private apiKeyMiddleware;
43
+ private authenticateMiddleware;
57
44
  private validateRequiredFields;
58
45
  private handleWriteError;
59
46
  private setupNotFoundMiddleware;
60
47
  private ensureNotFoundLast;
61
- private apiKeyMiddleware;
62
- private validateRoleValue;
63
- private authenticateMiddleware;
64
48
  private checkUniqueFields;
65
49
  }