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