@andrewcaires/api 5.3.6 → 5.4.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/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * @andrewcaires/api v5.3.6
2
+ * @andrewcaires/api v5.4.0
3
3
  * Simple api for small applications using express, jsonwebtoken, sequelize and websocket
4
4
  * (c) 2026 Andrew Caires
5
5
  * @license: MIT
6
6
  */
7
7
  import { Context, Application as Application$1, ExpressOptions, ResponseError } from '@andrewcaires/express';
8
8
  import { ModelFindOptions, ModelUpdateOptions, Model as Model$1, Sequelize } from '@andrewcaires/sequelize';
9
- import { TypeObjectString, TypeAnyObject, TypeAnyFunction, TypeAnyConstructor, EventEmitter, TypeObject, ValidationBase, ValidationShape } from '@andrewcaires/utils.js';
9
+ import { TypeAnyObject, TypeObjectString, TypeAnyFunction, TypeAnyConstructor, EventEmitter, TypeObject, ValidationBase, ValidationShape } from '@andrewcaires/utils.js';
10
10
  import { WebSocketServer } from 'ws';
11
11
  import { Model, CreateOptions, Attributes, FindOptions, IncludeOptions, FindAttributeOptions, ModelStatic } from 'sequelize';
12
12
  import { Env as Env$1 } from '@andrewcaires/node';
@@ -86,12 +86,6 @@ declare module "express-serve-static-core" {
86
86
  }
87
87
  }
88
88
 
89
- declare module "express-serve-static-core" {
90
- interface Request {
91
- profile?: TypeObjectString;
92
- }
93
- }
94
-
95
89
  declare module "express-serve-static-core" {
96
90
  interface Request {
97
91
  tenants?: Array<{
@@ -620,6 +614,7 @@ declare class GroupsPermissionsController extends ModelController<PermissionMode
620
614
  protected set(ctx: Context, group_id: string, permissions: Array<string>): Promise<void>;
621
615
  private addPermissions;
622
616
  private checkGroup;
617
+ private checkPermissions;
623
618
  }
624
619
 
625
620
  declare class HealthController {
@@ -646,6 +641,7 @@ declare class McpController extends BaseController {
646
641
  private jsonParseErrorResponse;
647
642
  private respond;
648
643
  private setResponseHeaders;
644
+ private getAllowedOrigin;
649
645
  }
650
646
 
651
647
  declare class PermissionsController extends CrudController<PermissionModel> {
@@ -863,6 +859,7 @@ interface McpHttpHandlerOptions {
863
859
  serverName?: string;
864
860
  serverVersion?: string;
865
861
  allowedHeaders?: Array<string>;
862
+ allowedOrigins?: Array<string>;
866
863
  }
867
864
  declare const MCP_HTTP_ALLOWED_METHODS: readonly ["POST", "DELETE", "OPTIONS"];
868
865
  declare const MCP_HTTP_ALLOW: string;
@@ -880,11 +877,12 @@ declare class McpHttpHandler {
880
877
  private readonly serverName;
881
878
  private readonly serverVersion;
882
879
  private readonly allowedHeaders;
880
+ private readonly allowedOrigins;
883
881
  constructor(options: McpHttpHandlerOptions);
884
882
  post(ctx: Context): Promise<McpHttpResponse>;
885
883
  delete(ctx: Context): McpHttpResponse;
886
- get(): McpHttpResponse;
887
- options(): McpHttpResponse;
884
+ get(ctx?: Context): McpHttpResponse;
885
+ options(ctx?: Context): McpHttpResponse;
888
886
  private initialize;
889
887
  private initialized;
890
888
  private callTool;
@@ -903,6 +901,7 @@ declare class McpHttpHandler {
903
901
  private getHeaderFromRecord;
904
902
  private normalizeHeaderValue;
905
903
  private normalizeAllowedHeaders;
904
+ private getAllowedOrigin;
906
905
  private getAuthContext;
907
906
  }
908
907
 
@@ -1002,6 +1001,7 @@ declare class UsersGroupsController extends ModelController<GroupModel> {
1002
1001
  protected del(ctx: Context, user_id: string, groups: Array<string>): Promise<void>;
1003
1002
  protected set(ctx: Context, user_id: string, groups: Array<string>): Promise<void>;
1004
1003
  private addGroups;
1004
+ private checkGroups;
1005
1005
  private checkUser;
1006
1006
  }
1007
1007
 
@@ -1023,6 +1023,7 @@ declare class UsersTenantsController extends ModelController<TenantModel> {
1023
1023
  protected del(ctx: Context, user_id: string, tenants: Array<string>): Promise<void>;
1024
1024
  protected set(ctx: Context, user_id: string, tenants: Array<string>): Promise<void>;
1025
1025
  private addTenants;
1026
+ private checkTenants;
1026
1027
  private checkUser;
1027
1028
  }
1028
1029