58 lines
1.6 KiB
TypeScript
58 lines
1.6 KiB
TypeScript
import type { ModuleIntegrations } from "@KTXC/types/moduleTypes";
|
|
import type { ProviderMetadata } from "@KTXM/MailManager/types/provider";
|
|
import type { ServiceInterface } from "@KTXM/MailManager/types/service";
|
|
import { JmapServiceObject } from './models/JmapServiceObject'
|
|
|
|
const integrations: ModuleIntegrations = {
|
|
mail_account_config_panels: [
|
|
{
|
|
id: 'jmap',
|
|
label: 'JMAP',
|
|
icon: 'mdi-api',
|
|
caption: 'Modern JSON-based mail protocol',
|
|
component: () => import('@/components/JmapConfigPanel.vue'),
|
|
priority: 10,
|
|
}
|
|
],
|
|
mail_account_auth_panels: [
|
|
{
|
|
id: 'jmap',
|
|
component: () => import('@/components/JmapAuthPanel.vue'),
|
|
}
|
|
],
|
|
mail_service_factory: [
|
|
{
|
|
id: 'jmap',
|
|
factory: (data: ServiceInterface) => new JmapServiceObject().fromJson(data)
|
|
}
|
|
],
|
|
mail_provider_metadata: [
|
|
{
|
|
id: 'jmap',
|
|
label: 'JMAP',
|
|
description: 'Modern JSON-based mail API protocol',
|
|
icon: 'mdi-api',
|
|
auth: {
|
|
methods: ['BA', 'OA', 'TA'],
|
|
default: 'BA',
|
|
allowMethodSelection: true,
|
|
oauth: {
|
|
// OAuth config will be provider-specific
|
|
// Some JMAP providers use OAuth (e.g., Fastmail)
|
|
authorizeUrl: '', // Configured per-instance
|
|
tokenUrl: '',
|
|
scopes: ['mail'],
|
|
flowType: 'authorization_code'
|
|
}
|
|
},
|
|
supportsDiscovery: true,
|
|
meta: {
|
|
protocol: 'JMAP',
|
|
wellKnownPath: '/.well-known/jmap'
|
|
}
|
|
} as ProviderMetadata
|
|
]
|
|
};
|
|
|
|
export default integrations;
|