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