27 lines
791 B
TypeScript
27 lines
791 B
TypeScript
import type { RequestContext } from './context.js';
|
|
import type { Ulid } from './ids.js';
|
|
|
|
export interface IdentityPort {
|
|
resolve(bearerToken: string | undefined, correlationId: Ulid): Promise<RequestContext>;
|
|
}
|
|
|
|
export interface AuthorizationPort {
|
|
require(context: RequestContext, permission: string): Promise<void>;
|
|
}
|
|
|
|
export interface SettingsPort {
|
|
get(tenantId: Ulid, key: string): Promise<unknown>;
|
|
}
|
|
|
|
export interface FileStoragePort {
|
|
createUpload(
|
|
tenantId: Ulid,
|
|
objectKey: string,
|
|
contentType: string,
|
|
): Promise<{ uploadUrl: string }>;
|
|
createDownload(tenantId: Ulid, objectKey: string): Promise<{ downloadUrl: string }>;
|
|
}
|
|
|
|
export interface NotificationPort {
|
|
send(tenantId: Ulid, template: string, payload: Record<string, unknown>): Promise<void>;
|
|
}
|