fix(mail): align queue, outbound hostname, and DKIM selector behavior across the mail server APIs
This commit is contained in:
13
ts/mail/interfaces.storage.ts
Normal file
13
ts/mail/interfaces.storage.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export interface IStorageManagerLike {
|
||||
get?(key: string): Promise<string | null>;
|
||||
set?(key: string, value: string): Promise<void>;
|
||||
list?(prefix: string): Promise<string[]>;
|
||||
delete?(key: string): Promise<void>;
|
||||
}
|
||||
|
||||
export function hasStorageManagerMethods<T extends keyof IStorageManagerLike>(
|
||||
storageManager: IStorageManagerLike | undefined,
|
||||
methods: T[],
|
||||
): storageManager is IStorageManagerLike & Required<Pick<IStorageManagerLike, T>> {
|
||||
return !!storageManager && methods.every((method) => typeof storageManager[method] === 'function');
|
||||
}
|
||||
Reference in New Issue
Block a user