@autofleet/zehut 4.3.4 → 4.3.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.
package/lib/index.d.cts CHANGED
@@ -1,308 +1,314 @@
1
- import * as fastify from 'fastify';
2
- import { FastifyPluginCallback } from 'fastify';
3
- import * as express from 'express';
4
- import { Handler, Request } from 'express';
5
- import * as crypto from 'crypto';
6
- import { LoggerInstanceManager } from '@autofleet/logger';
7
- import * as outbreak from '@autofleet/outbreak';
8
- import { newTrace as newTrace$1 } from '@autofleet/outbreak';
9
- export { outbreak };
1
+ import { LoggerInstanceManager } from "@autofleet/logger";
2
+ import * as outbreak from "@autofleet/outbreak";
3
+ import { newTrace as newTrace$1 } from "@autofleet/outbreak";
4
+ import { Handler, NextFunction, Request, Response } from "express";
5
+ import { FastifyPluginCallback } from "fastify";
10
6
 
11
- type AccountType = 'client' | 'user' | 'service' | 'driver';
7
+ //#region rolldown:runtime
8
+ //#endregion
9
+ //#region src/user/ApiUser.d.ts
10
+ type AccountType = "client" | "user" | "service" | "driver";
12
11
  interface EntityPermissions {
13
- [key: string]: string[];
12
+ [key: string]: string[];
14
13
  }
15
14
  declare const CONTEXTS_IDS_HEADER = "x-af-context-ids";
16
15
  interface UserPayload {
17
- businessModels: EntityPermissions;
18
- fleets: EntityPermissions;
19
- demandSources: EntityPermissions;
20
- businessAccounts?: EntityPermissions;
21
- accountType?: AccountType;
22
- contexts?: EntityPermissions;
23
- createdAt?: string;
16
+ businessModels: EntityPermissions;
17
+ fleets: EntityPermissions;
18
+ demandSources: EntityPermissions;
19
+ businessAccounts?: EntityPermissions;
20
+ accountType?: AccountType;
21
+ contexts?: EntityPermissions;
22
+ createdAt?: string;
24
23
  }
25
24
  interface PartialUserPayload {
26
- businessModels?: EntityPermissions;
27
- fleets?: EntityPermissions;
28
- demandSources?: EntityPermissions;
29
- vehicles?: EntityPermissions;
30
- drivers?: EntityPermissions;
31
- businessAccounts?: EntityPermissions;
25
+ businessModels?: EntityPermissions;
26
+ fleets?: EntityPermissions;
27
+ demandSources?: EntityPermissions;
28
+ vehicles?: EntityPermissions;
29
+ drivers?: EntityPermissions;
30
+ businessAccounts?: EntityPermissions;
32
31
  }
33
32
  declare class ApiUser {
34
- id?: string;
35
- accountType?: AccountType;
36
- contextIds?: string[];
37
- private privatePermissions;
38
- private readonly privateElevatedPermissionsHash;
39
- private privatePermissionsLegacy;
40
- private readonly appPermission;
41
- readonly emptyUser: boolean;
42
- constructor(id?: string, accountType?: AccountType, elevatedPermissions?: PartialUserPayload, contextIds?: string[]);
43
- getUserPermissions(): Promise<UserPayload>;
44
- useCustomPermissionLoader(customPermissionLoader: (userId: string) => UserPayload | PromiseLike<UserPayload>): Promise<UserPayload>;
45
- get businessModels(): string[];
46
- get fleets(): string[];
47
- get demandSources(): string[];
48
- private getUserProperty;
49
- get elevatedPermissions(): UserPayload;
50
- get permissions(): UserPayload | undefined;
51
- elevatePermissions(addedPermissions: PartialUserPayload): (() => void) & {
52
- [Symbol.dispose]: () => void;
53
- };
54
- getUserPermissionsLegacy(): Promise<any>;
55
- get permissionsLegacy(): any;
56
- getUserAppPermissions(appId: string, clientSecret: string): Promise<UserPayload | undefined>;
33
+ id?: string | undefined;
34
+ accountType?: AccountType | undefined;
35
+ contextIds?: string[] | undefined;
36
+ private privatePermissions;
37
+ private readonly privateElevatedPermissionsHash;
38
+ private privatePermissionsLegacy;
39
+ private readonly appPermission;
40
+ readonly emptyUser: boolean;
41
+ constructor(id?: string | undefined, accountType?: AccountType | undefined, elevatedPermissions?: PartialUserPayload, contextIds?: string[] | undefined);
42
+ getUserPermissions(): Promise<UserPayload>;
43
+ useCustomPermissionLoader(customPermissionLoader: (userId: string) => UserPayload | PromiseLike<UserPayload>): Promise<UserPayload>;
44
+ get businessModels(): string[];
45
+ get fleets(): string[];
46
+ get demandSources(): string[];
47
+ private getUserProperty;
48
+ get elevatedPermissions(): UserPayload;
49
+ get permissions(): UserPayload | undefined;
50
+ elevatePermissions(addedPermissions: PartialUserPayload): (() => void) & {
51
+ [Symbol.dispose]: () => void;
52
+ };
53
+ getUserPermissionsLegacy(): Promise<unknown>;
54
+ get permissionsLegacy(): any;
55
+ getUserAppPermissions(appId: string, clientSecret: string): Promise<UserPayload | undefined>;
57
56
  }
58
-
57
+ //#endregion
58
+ //#region src/user/common.d.ts
59
59
  type CustomPermissionLoader = (userId: string) => Promise<UserPayload>;
60
60
  interface AuthFromUserIdHeaderOptions {
61
- eagerLoadUserPermissions?: boolean;
62
- eagerLoadUserPermissionsLegacy?: boolean;
63
- customPermissionLoader?: CustomPermissionLoader;
61
+ eagerLoadUserPermissions?: boolean;
62
+ eagerLoadUserPermissionsLegacy?: boolean;
63
+ customPermissionLoader?: CustomPermissionLoader;
64
64
  }
65
-
66
- declare module 'express-serve-static-core' {
67
- interface Request {
68
- user: ApiUser;
69
- }
65
+ //#endregion
66
+ //#region src/user/index.d.ts
67
+ declare module "express-serve-static-core" {
68
+ interface Request {
69
+ user: ApiUser;
70
+ }
70
71
  }
71
- declare const middleware: (options?: AuthFromUserIdHeaderOptions) => Handler;
72
+ type Asyncify<T extends (...a: any[]) => any> = (...a: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
73
+ declare const middleware: (options?: AuthFromUserIdHeaderOptions) => Asyncify<Handler>;
72
74
  declare const middlewareWithDecode: (options?: {
73
- eagerLoadUserPermissions?: boolean;
74
- eagerLoadUserPermissionsLegacy?: boolean;
75
- returnErrorIfNoToken?: boolean;
76
- }) => Handler;
75
+ eagerLoadUserPermissions?: boolean;
76
+ eagerLoadUserPermissionsLegacy?: boolean;
77
+ returnErrorIfNoToken?: boolean;
78
+ }) => Asyncify<Handler>;
77
79
  declare const appMiddleware: (options: {
78
- appId: string;
79
- clientSecret: string;
80
- }) => Handler;
81
- declare const eagerLoadPermissionsMiddleware: Handler;
80
+ appId: string;
81
+ clientSecret: string;
82
+ }) => Asyncify<Handler>;
83
+ declare const eagerLoadPermissionsMiddleware: Asyncify<Handler>;
82
84
  declare const getDecodedBearer: (req: Request) => any;
83
85
  declare const createOrSetRabbitTrace: (trace: ReturnType<typeof newTrace$1> | undefined, userId: string | undefined) => Promise<void>;
84
-
85
- declare module 'fastify' {
86
- interface FastifyRequest {
87
- user?: ApiUser;
88
- }
86
+ //#endregion
87
+ //#region src/user/fastify.d.ts
88
+ declare module "fastify" {
89
+ interface FastifyRequest {
90
+ user?: ApiUser;
91
+ }
89
92
  }
90
93
  declare const authFromUserIdHeaderPlugin: FastifyPluginCallback<AuthFromUserIdHeaderOptions>;
91
-
94
+ //#endregion
95
+ //#region src/check-permission.d.ts
92
96
  declare const getUser: () => ApiUser | undefined;
93
- declare const isUserExist: () => string;
97
+ declare const isUserExist: () => string | undefined;
94
98
  declare const checkFleetPermission: (fleetId: string) => boolean;
95
99
  declare const checkBusinessModelPermission: (businessModelId: string) => boolean;
96
100
  declare const checkDemandSourcePermission: (demandSourceId: string) => boolean;
97
-
101
+ //#endregion
102
+ //#region src/errors.d.ts
98
103
  declare class UnauthorizedAccessError extends Error {
99
- user: ApiUser | null;
100
- constructor(user?: ApiUser | null, message?: string);
104
+ user: ApiUser | null;
105
+ constructor(user?: ApiUser | null, message?: string);
101
106
  }
102
-
107
+ //#endregion
108
+ //#region src/secret-getter.d.ts
103
109
  declare const getRefreshTokenSecret: (token?: string) => string;
104
110
  declare const getTokenSecret: (token?: string) => string;
105
-
111
+ //#endregion
112
+ //#region src/authorization.d.ts
106
113
  declare const AUTHORIZATION_METHODS: {
107
- NONE: string;
108
- BASIC: string;
109
- JWT: string;
114
+ NONE: string;
115
+ BASIC: string;
116
+ JWT: string;
110
117
  };
111
118
  declare const getAuthorizationHeader: (authorizationSettings: {
112
- method: string;
119
+ method: string;
113
120
  } | undefined) => string | undefined;
114
-
121
+ //#endregion
122
+ //#region src/permissions/SDK/consts.d.ts
115
123
  declare const PERMISSIONS_EVALUATION_OPERATORS: {
116
- AND: string;
117
- OR: string;
124
+ AND: string;
125
+ OR: string;
118
126
  };
119
127
  declare const PERMISSION_ERROR_TYPES: {
120
- USER_NOT_FOUND: string;
121
- INSUFFICIENT_PERMISSIONS: string;
122
- VALIDATION_ERROR: string;
123
- API_ERROR: string;
124
- NO_REQUIRED_PERMISSIONS: string;
125
- UNAUTHORIZED: string;
126
- BAD_REQUEST: string;
127
- INTERNAL_ERROR: string;
128
+ USER_NOT_FOUND: string;
129
+ INSUFFICIENT_PERMISSIONS: string;
130
+ VALIDATION_ERROR: string;
131
+ API_ERROR: string;
132
+ NO_REQUIRED_PERMISSIONS: string;
133
+ UNAUTHORIZED: string;
134
+ BAD_REQUEST: string;
135
+ INTERNAL_ERROR: string;
128
136
  };
129
-
137
+ //#endregion
138
+ //#region src/permissions/SDK/errors.d.ts
130
139
  type PermissionErrorType = typeof PERMISSION_ERROR_TYPES[keyof typeof PERMISSION_ERROR_TYPES];
131
-
140
+ //#endregion
141
+ //#region src/permissions/SDK/types.d.ts
132
142
  type Logger = {
133
- debug: (message: string, meta?: unknown) => void;
134
- info: (message: string, meta?: unknown) => void;
135
- warn: (message: string, meta?: unknown) => void;
136
- error: (message: string, meta?: unknown) => void;
143
+ debug: (message: string, meta?: unknown) => void;
144
+ info: (message: string, meta?: unknown) => void;
145
+ warn: (message: string, meta?: unknown) => void;
146
+ error: (message: string, meta?: unknown) => void;
137
147
  };
138
148
  /**
139
- * The operator to use when evaluating permissions
140
- * - AND: All required permissions must be present
141
- * - OR: At least one required permission must be present
142
- */
149
+ * The operator to use when evaluating permissions
150
+ * - AND: All required permissions must be present
151
+ * - OR: At least one required permission must be present
152
+ */
143
153
  type PermissionsEvaluationOperator = typeof PERMISSIONS_EVALUATION_OPERATORS[keyof typeof PERMISSIONS_EVALUATION_OPERATORS];
144
154
  /**
145
- * Options for evaluating permissions
146
- * - requireAll: If true, all contexts must have the required permissions for the user to be considered authorized (default: true)
147
- * - timeout: Optional - timeout in milliseconds for the permissions evaluation (default: 10 seconds)
148
- * - enforce: Optional - If true, the permissions evaluation will throw an error if the user does not have the required permissions (default: false)
149
- * - permissionsEvaluationOperator: Optional - If set, the permissions evaluation will use this operator to evaluate the permissions (default: AND)
150
- */
155
+ * Options for evaluating permissions
156
+ * - requireAll: If true, all contexts must have the required permissions for the user to be considered authorized (default: true)
157
+ * - timeout: Optional - timeout in milliseconds for the permissions evaluation (default: 10 seconds)
158
+ * - enforce: Optional - If true, the permissions evaluation will throw an error if the user does not have the required permissions (default: false)
159
+ * - permissionsEvaluationOperator: Optional - If set, the permissions evaluation will use this operator to evaluate the permissions (default: AND)
160
+ */
151
161
  type EvaluatePermissionsOpts = {
152
- requireAll?: boolean;
153
- timeout?: number;
154
- enforce?: boolean;
155
- permissionsEvaluationOperator?: PermissionsEvaluationOperator;
162
+ requireAll?: boolean;
163
+ timeout?: number;
164
+ enforce?: boolean;
165
+ permissionsEvaluationOperator?: PermissionsEvaluationOperator;
156
166
  };
157
167
  /**
158
- * Parameters for evaluating permissions for a user across multiple contexts
159
- * - requiredPermissions: The required permissions to check against the user
160
- * - contextIds: The context IDs to check the permissions against
161
- * - logger: logger instance for logging
162
- * - options: Options for evaluating permissions {@link EvaluatePermissionsOpts}
163
- * - userId: The user id, if not provided, we will get the user from the current context
164
- */
168
+ * Parameters for evaluating permissions for a user across multiple contexts
169
+ * - requiredPermissions: The required permissions to check against the user
170
+ * - contextIds: The context IDs to check the permissions against
171
+ * - logger: logger instance for logging
172
+ * - options: Options for evaluating permissions {@link EvaluatePermissionsOpts}
173
+ * - userId: The user id, if not provided, we will get the user from the current context
174
+ */
165
175
  type EvaluatePermissionsParams = {
166
- requiredPermissions: string[];
167
- contextIds: string[];
168
- logger: Logger;
169
- options: EvaluatePermissionsOpts;
170
- userId?: string;
176
+ requiredPermissions: string[];
177
+ contextIds: string[];
178
+ logger?: Logger;
179
+ options: EvaluatePermissionsOpts;
180
+ userId?: string;
171
181
  };
172
182
  /**
173
- * The permissions evaluation result for a specific context
174
- * - permissions: The full list of permissions the user has in the context
175
- * - hasRequiredPermissions: Whether the user has the required permissions in the context
183
+ * Parameters for resolving permissions for a user across multiple contexts
184
+ * - user: The user for whom permissions are being resolved
185
+ * - contextIds: The list of context IDs to resolve permissions for
186
+ * - requiredPermissions: The list of permissions to check for each context
187
+ * - options: Options for evaluating permissions {@link EvaluatePermissionsOpts}
188
+ */
189
+
190
+ /**
191
+ * The permissions evaluation result for a specific context
192
+ * - permissions: The full list of permissions the user has in the context
193
+ * - hasRequiredPermissions: Whether the user has the required permissions in the context
176
194
  */
177
195
  type PermissionsEvaluation = {
178
- permissions: string[];
179
- hasRequiredPermissions: boolean;
196
+ permissions: string[];
197
+ hasRequiredPermissions: boolean;
180
198
  };
181
199
  /**
182
- * A mapping of context IDs to their corresponding permissions evaluation results
183
- */
200
+ * A mapping of context IDs to their corresponding permissions evaluation results
201
+ */
184
202
  type PermissionsEvaluationByContextId = Record<string, PermissionsEvaluation>;
185
203
  /**
186
- * A mapping of context IDs to the list of permissions the user has in that context
187
- * - isAuthorized: Whether the user has the required permissions in any of the contexts
188
- * - userId: The ID of the user
189
- * - resolvedPermissions: The detailed permissions evaluation results by context ID
190
- * - requiredPermissions: The list of permissions that were required for the evaluation
191
- * - contextIds: The list of context IDs that were evaluated
192
- * - error: Optional error type if the evaluation failed
193
- * - message: Optional error message if the evaluation failed
194
- */
204
+ * A mapping of context IDs to the list of permissions the user has in that context
205
+ * - isAuthorized: Whether the user has the required permissions in any of the contexts
206
+ * - userId: The ID of the user
207
+ * - resolvedPermissions: The detailed permissions evaluation results by context ID
208
+ * - requiredPermissions: The list of permissions that were required for the evaluation
209
+ * - contextIds: The list of context IDs that were evaluated
210
+ * - error: Optional error type if the evaluation failed
211
+ * - message: Optional error message if the evaluation failed
212
+ */
195
213
  type PermissionCheckResult = {
196
- isAuthorized: boolean;
197
- userId?: string;
198
- resolvedPermissions: PermissionsEvaluationByContextId;
199
- requiredPermissions: string[];
200
- contextIds: string[];
201
- error?: PermissionErrorType;
202
- message?: string;
214
+ isAuthorized: boolean;
215
+ userId?: string;
216
+ resolvedPermissions: PermissionsEvaluationByContextId;
217
+ requiredPermissions: string[];
218
+ contextIds: string[];
219
+ error?: PermissionErrorType;
220
+ message?: string;
203
221
  };
204
-
222
+ /**
223
+ * A mapping of context IDs to the list of the effective permissions the user has in that context
224
+ */
225
+ //#endregion
226
+ //#region src/permissions/SDK/evaluatePermissions.d.ts
227
+ /**
228
+ * Main SDK function to evaluate user permissions
229
+ * Checks both cached and API-resolved permissions to determine access
230
+ * @param params - {@link EvaluatePermissionsParams}
231
+ * @returns {@link PermissionCheckResult} Detailed permission check result with access status and context
232
+ */
233
+ declare const evaluatePermissions: ({
234
+ requiredPermissions,
235
+ contextIds,
236
+ logger,
237
+ userId,
238
+ options: {
239
+ requireAll,
240
+ permissionsEvaluationOperator,
241
+ timeout
242
+ }
243
+ }: EvaluatePermissionsParams) => Promise<PermissionCheckResult>;
244
+ //#endregion
245
+ //#region src/permissions/middleware/requirePermissions.d.ts
205
246
  interface RequirePermissionsOptions extends EvaluatePermissionsOpts {
206
- logger?: LoggerInstanceManager;
247
+ logger?: LoggerInstanceManager;
207
248
  }
208
-
209
- declare const sdk: {
210
- evaluatePermissions: ({ requiredPermissions, contextIds, logger, userId, options: { requireAll, permissionsEvaluationOperator, timeout, }, }: EvaluatePermissionsParams) => Promise<PermissionCheckResult>;
211
- };
212
- declare const middlewares: {
213
- requirePermissions: (requiredPermissions: string[], options?: RequirePermissionsOptions) => (req: express.Request, res: express.Response, next: express.NextFunction) => Promise<void | express.Response<any, Record<string, any>>>;
214
- };
215
- declare const _default$1: {
216
- sdk: {
217
- evaluatePermissions: ({ requiredPermissions, contextIds, logger, userId, options: { requireAll, permissionsEvaluationOperator, timeout, }, }: EvaluatePermissionsParams) => Promise<PermissionCheckResult>;
218
- };
219
- middlewares: {
220
- requirePermissions: (requiredPermissions: string[], options?: RequirePermissionsOptions) => (req: express.Request, res: express.Response, next: express.NextFunction) => Promise<void | express.Response<any, Record<string, any>>>;
221
- };
222
- };
223
-
224
- declare const permissions_middlewares: typeof middlewares;
225
- declare const permissions_sdk: typeof sdk;
226
- declare namespace permissions {
227
- export { _default$1 as default, permissions_middlewares as middlewares, permissions_sdk as sdk };
249
+ /**
250
+ * Express middleware that requires specific permissions for route access
251
+ *
252
+ * @param requiredPermissions - Array of permissions required to access the route
253
+ * @param options - Configuration options for permission checking
254
+ * @returns Express middleware function
255
+ */
256
+ declare const requirePermissions: (requiredPermissions: string[], options?: RequirePermissionsOptions) => (req: Request, res: Response, next: NextFunction) => Promise<void>;
257
+ declare namespace index_d_exports {
258
+ export { _default as default, middlewares, sdk };
228
259
  }
229
-
230
- declare const getCurrentPayload: () => {
231
- type: "httpRequest" | "webSocket" | "rabbit" | "bull";
232
- readonly id: crypto.UUID;
233
- readonly context: Map<string, unknown>;
234
- readonly nonHeaderContext: Map<string, unknown>;
235
- } | Record<string, never>;
260
+ interface SdkExports {
261
+ evaluatePermissions: typeof evaluatePermissions;
262
+ }
263
+ interface MiddlewareExports {
264
+ requirePermissions: typeof requirePermissions;
265
+ }
266
+ interface PermissionsModule {
267
+ sdk: SdkExports;
268
+ middlewares: MiddlewareExports;
269
+ }
270
+ declare const sdk: SdkExports;
271
+ declare const middlewares: MiddlewareExports;
272
+ declare const _default: PermissionsModule;
273
+ //#endregion
274
+ //#region src/index.d.ts
275
+ declare const getCurrentPayload: typeof outbreak.getCurrentContext;
236
276
  type OutbreakOptions = Parameters<typeof outbreak.default>[0];
237
- type LoggerWithContextMiddleware = Partial<Pick<LoggerInstanceManager, 'addContextMiddleware'>>;
238
- declare const enableTracing: ({ outbreakOptions, logger }?: {
239
- outbreakOptions?: OutbreakOptions;
240
- logger?: LoggerWithContextMiddleware;
277
+ type LoggerWithContextMiddleware = Partial<Pick<LoggerInstanceManager, "addContextMiddleware">>;
278
+ declare const enableTracing: ({
279
+ outbreakOptions,
280
+ logger
281
+ }?: {
282
+ outbreakOptions?: OutbreakOptions;
283
+ logger?: LoggerWithContextMiddleware;
241
284
  }) => void;
242
- declare const traceTypes: {
243
- readonly HTTP_REQUEST: "httpRequest";
244
- readonly WEB_SOCKET: "webSocket";
245
- readonly RABBIT: "rabbit";
246
- readonly BULL_MQ: "bull";
247
- };
248
- declare const newTrace: (type: "httpRequest" | "webSocket" | "rabbit" | "bull") => {
249
- type: "httpRequest" | "webSocket" | "rabbit" | "bull";
250
- readonly id: crypto.UUID;
251
- readonly context: Map<string, unknown>;
252
- readonly nonHeaderContext: Map<string, unknown>;
253
- };
254
-
255
- declare const _default: {
256
- traceTypes: {
257
- readonly HTTP_REQUEST: "httpRequest";
258
- readonly WEB_SOCKET: "webSocket";
259
- readonly RABBIT: "rabbit";
260
- readonly BULL_MQ: "bull";
261
- };
262
- newTrace: (type: "httpRequest" | "webSocket" | "rabbit" | "bull") => {
263
- type: "httpRequest" | "webSocket" | "rabbit" | "bull";
264
- readonly id: crypto.UUID;
265
- readonly context: Map<string, unknown>;
266
- readonly nonHeaderContext: Map<string, unknown>;
267
- };
268
- User: typeof ApiUser;
269
- middleware: (options?: AuthFromUserIdHeaderOptions) => express.Handler;
270
- middlewareWithDecode: (options?: {
271
- eagerLoadUserPermissions?: boolean;
272
- eagerLoadUserPermissionsLegacy?: boolean;
273
- returnErrorIfNoToken?: boolean;
274
- }) => express.Handler;
275
- eagerLoadPermissionsMiddleware: express.Handler;
276
- getCurrentPayload: () => {
277
- type: "httpRequest" | "webSocket" | "rabbit" | "bull";
278
- readonly id: crypto.UUID;
279
- readonly context: Map<string, unknown>;
280
- readonly nonHeaderContext: Map<string, unknown>;
281
- } | Record<string, never>;
282
- getDecodedBearer: (req: express.Request) => any;
283
- checkFleetPermission: (fleetId: string) => boolean;
284
- checkBusinessModelPermission: (businessModelId: string) => boolean;
285
- checkDemandSourcePermission: (demandSourceId: string) => boolean;
286
- isUserExist: () => string;
287
- getUser: () => ApiUser | undefined;
288
- UnauthorizedAccessError: typeof UnauthorizedAccessError;
289
- appMiddleware: (options: {
290
- appId: string;
291
- clientSecret: string;
292
- }) => express.Handler;
293
- createOrSetRabbitTrace: (trace: ReturnType<typeof outbreak.newTrace> | undefined, userId: string | undefined) => Promise<void>;
294
- outbreak: typeof outbreak;
295
- AUTHORIZATION_METHODS: {
296
- NONE: string;
297
- BASIC: string;
298
- JWT: string;
299
- };
300
- getAuthorizationHeader: (authorizationSettings: {
301
- method: string;
302
- } | undefined) => string | undefined;
303
- CONTEXTS_IDS_HEADER: string;
304
- authFromUserIdHeaderPlugin: fastify.FastifyPluginCallback<AuthFromUserIdHeaderOptions>;
305
- permissions: typeof permissions;
306
- };
307
-
308
- export { AUTHORIZATION_METHODS, CONTEXTS_IDS_HEADER, UnauthorizedAccessError, ApiUser as User, type UserPayload, appMiddleware, authFromUserIdHeaderPlugin, checkBusinessModelPermission, checkDemandSourcePermission, checkFleetPermission, createOrSetRabbitTrace, _default as default, eagerLoadPermissionsMiddleware, enableTracing, getAuthorizationHeader, getCurrentPayload, getDecodedBearer, getRefreshTokenSecret, getTokenSecret, getUser, isUserExist, middleware, middlewareWithDecode, newTrace, permissions, traceTypes };
285
+ declare const traceTypes: typeof outbreak.traceTypes;
286
+ declare const newTrace: typeof outbreak.newTrace;
287
+ interface Default {
288
+ traceTypes: typeof outbreak.traceTypes;
289
+ newTrace: typeof outbreak.newTrace;
290
+ User: typeof ApiUser;
291
+ middleware: typeof middleware;
292
+ middlewareWithDecode: typeof middlewareWithDecode;
293
+ eagerLoadPermissionsMiddleware: typeof eagerLoadPermissionsMiddleware;
294
+ getCurrentPayload: typeof outbreak.getCurrentContext;
295
+ getDecodedBearer: typeof getDecodedBearer;
296
+ checkFleetPermission: typeof checkFleetPermission;
297
+ checkBusinessModelPermission: typeof checkBusinessModelPermission;
298
+ checkDemandSourcePermission: typeof checkDemandSourcePermission;
299
+ isUserExist: typeof isUserExist;
300
+ getUser: typeof getUser;
301
+ UnauthorizedAccessError: typeof UnauthorizedAccessError;
302
+ appMiddleware: typeof appMiddleware;
303
+ createOrSetRabbitTrace: typeof createOrSetRabbitTrace;
304
+ outbreak: typeof outbreak;
305
+ AUTHORIZATION_METHODS: typeof AUTHORIZATION_METHODS;
306
+ getAuthorizationHeader: typeof getAuthorizationHeader;
307
+ CONTEXTS_IDS_HEADER: typeof CONTEXTS_IDS_HEADER;
308
+ authFromUserIdHeaderPlugin: typeof authFromUserIdHeaderPlugin;
309
+ permissions: typeof index_d_exports;
310
+ }
311
+ declare const zehutDefault: Default;
312
+ //#endregion
313
+ export { AUTHORIZATION_METHODS, CONTEXTS_IDS_HEADER, UnauthorizedAccessError, ApiUser as User, type UserPayload, appMiddleware, authFromUserIdHeaderPlugin, checkBusinessModelPermission, checkDemandSourcePermission, checkFleetPermission, createOrSetRabbitTrace, zehutDefault as default, eagerLoadPermissionsMiddleware, enableTracing, getAuthorizationHeader, getCurrentPayload, getDecodedBearer, getRefreshTokenSecret, getTokenSecret, getUser, isUserExist, middleware, middlewareWithDecode, newTrace, outbreak, index_d_exports as permissions, traceTypes };
314
+ //# sourceMappingURL=index.d.cts.map