chore: bunch of improvements
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
+10
-3
@@ -6,7 +6,9 @@ import type { ListFilter, ListSort, SourceSelector } from './common';
|
||||
/**
|
||||
* Collection information
|
||||
*/
|
||||
export interface CollectionInterface {
|
||||
export interface CollectionInterface<T = CollectionPropertiesInterface> {
|
||||
'@type': string;
|
||||
version: number;
|
||||
provider: string;
|
||||
service: string | number;
|
||||
collection: string | number | null;
|
||||
@@ -14,12 +16,15 @@ export interface CollectionInterface {
|
||||
signature?: string | null;
|
||||
created?: string | null;
|
||||
modified?: string | null;
|
||||
properties: CollectionPropertiesInterface;
|
||||
properties: T;
|
||||
}
|
||||
|
||||
export interface CollectionModelInterface extends Omit<CollectionInterface<CollectionPropertiesInterface>, '@type' | 'version' | 'properties'> {
|
||||
properties: CollectionPropertiesModelInterface;
|
||||
}
|
||||
|
||||
export interface CollectionBaseProperties {
|
||||
'@type': string;
|
||||
version: number;
|
||||
}
|
||||
|
||||
export interface CollectionImmutableProperties extends CollectionBaseProperties {
|
||||
@@ -36,6 +41,8 @@ export interface CollectionMutableProperties extends CollectionBaseProperties {
|
||||
|
||||
export interface CollectionPropertiesInterface extends CollectionMutableProperties, CollectionImmutableProperties {}
|
||||
|
||||
export interface CollectionPropertiesModelInterface extends Omit<CollectionPropertiesInterface, '@type'> {}
|
||||
|
||||
/**
|
||||
* Collection list
|
||||
*/
|
||||
|
||||
+32
-22
@@ -9,12 +9,14 @@ import type {
|
||||
ListRange,
|
||||
ListSort,
|
||||
} from './common';
|
||||
import type { MessageInterface } from './message';
|
||||
import type { MessageInterface, MessageModelInterface } from './message';
|
||||
|
||||
/**
|
||||
* Entity definition
|
||||
*/
|
||||
export interface EntityInterface<T = MessageInterface> {
|
||||
'@type': string;
|
||||
version: number;
|
||||
provider: string;
|
||||
service: string;
|
||||
collection: string | number;
|
||||
@@ -25,6 +27,8 @@ export interface EntityInterface<T = MessageInterface> {
|
||||
properties: T;
|
||||
}
|
||||
|
||||
export interface EntityModelInterface extends Omit<EntityInterface<MessageModelInterface>, '@type' | 'version'> {}
|
||||
|
||||
/**
|
||||
* Entity list
|
||||
*/
|
||||
@@ -76,6 +80,26 @@ export interface EntityExtantResponse {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Entity delta
|
||||
*/
|
||||
export interface EntityDeltaRequest {
|
||||
sources: SourceSelector;
|
||||
}
|
||||
|
||||
export interface EntityDeltaResponse {
|
||||
[providerId: string]: false | {
|
||||
[serviceId: string]: false | {
|
||||
[collectionId: string]: false | {
|
||||
signature: string;
|
||||
additions: (string | number)[];
|
||||
modifications: (string | number)[];
|
||||
deletions: (string | number)[];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Entity create
|
||||
*/
|
||||
@@ -105,34 +129,20 @@ export interface EntityUpdateResponse<T = MessageInterface> extends EntityInterf
|
||||
* Entity delete
|
||||
*/
|
||||
export interface EntityDeleteRequest {
|
||||
provider: string;
|
||||
service: string | number;
|
||||
collection: string | number;
|
||||
identifier: string | number;
|
||||
sources: EntityIdentifier[];
|
||||
}
|
||||
|
||||
export interface EntityDeleteResponse {
|
||||
export interface EntityDeleteResultSuccess {
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Entity delta
|
||||
*/
|
||||
export interface EntityDeltaRequest {
|
||||
sources: SourceSelector;
|
||||
export interface EntityDeleteResultFailure {
|
||||
success: boolean;
|
||||
error: string;
|
||||
}
|
||||
|
||||
export interface EntityDeltaResponse {
|
||||
[providerId: string]: false | {
|
||||
[serviceId: string]: false | {
|
||||
[collectionId: string]: false | {
|
||||
signature: string;
|
||||
additions: (string | number)[];
|
||||
modifications: (string | number)[];
|
||||
deletions: (string | number)[];
|
||||
};
|
||||
};
|
||||
};
|
||||
export interface EntityDeleteResponse {
|
||||
[sourceIdentifier: EntityIdentifier]: EntityDeleteResultSuccess | EntityDeleteResultFailure;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+14
-20
@@ -6,25 +6,23 @@
|
||||
// ==================== Provider Panel Contracts ====================
|
||||
|
||||
/**
|
||||
* Props all provider CONFIG panels receive
|
||||
* Config panels handle protocol/location settings only
|
||||
* Props all provider Protocol panels receive
|
||||
* Protocol panels handle protocol/location settings only
|
||||
*/
|
||||
export interface ProviderConfigPanelProps {
|
||||
export interface ProviderProtocolPanelProps {
|
||||
/** Current service value for v-model binding */
|
||||
service?: import('../models').ServiceObject;
|
||||
/** Pre-filled location from discovery (if available) */
|
||||
discoveredLocation?: import('./service').ServiceLocation;
|
||||
/** Current location value for v-model binding */
|
||||
modelValue?: import('./service').ServiceLocation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Events all provider CONFIG panels emit
|
||||
* Config panels emit location configuration and validation state
|
||||
* Events all provider Protocol panels emit
|
||||
* Protocol panels emit service configuration and validation state
|
||||
*/
|
||||
export interface ProviderConfigPanelEmits {
|
||||
/** Emit updated location configuration */
|
||||
'update:modelValue': [value: import('./service').ServiceLocation];
|
||||
/** Emit validation state (true = valid, false = invalid) */
|
||||
'valid': [value: boolean];
|
||||
export interface ProviderProtocolPanelEmits {
|
||||
/** Emit updated service configuration */
|
||||
'update:service': [value: import('../models').ServiceObject];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,6 +30,8 @@ export interface ProviderConfigPanelEmits {
|
||||
* Auth panels handle credentials/authentication only
|
||||
*/
|
||||
export interface ProviderAuthPanelProps {
|
||||
/** Current service value for v-model binding */
|
||||
service?: import('../models').ServiceObject;
|
||||
/** Email address from discovery entry (for pre-filling username) */
|
||||
emailAddress?: string;
|
||||
/** Discovered or configured location (for context/auth decisions) */
|
||||
@@ -40,8 +40,6 @@ export interface ProviderAuthPanelProps {
|
||||
prefilledIdentity?: string;
|
||||
/** Pre-filled secret/password if user entered during discovery */
|
||||
prefilledSecret?: string;
|
||||
/** Current identity value for v-model binding */
|
||||
modelValue?: import('./service').ServiceIdentity;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,10 +47,6 @@ export interface ProviderAuthPanelProps {
|
||||
* Auth panels emit identity configuration, validation state, and errors
|
||||
*/
|
||||
export interface ProviderAuthPanelEmits {
|
||||
/** Emit updated identity configuration */
|
||||
'update:modelValue': [value: import('./service').ServiceIdentity];
|
||||
/** Emit validation state (true = valid, false = invalid) */
|
||||
'valid': [value: boolean];
|
||||
/** Emit authentication errors for user feedback */
|
||||
'error': [error: string];
|
||||
/** Emit updated service configuration */
|
||||
'update:service': [value: import('../models').ServiceObject];
|
||||
}
|
||||
|
||||
+49
-53
@@ -1,68 +1,64 @@
|
||||
/**
|
||||
* Message object interface
|
||||
*/
|
||||
export interface MessageModelInterface extends Omit<{
|
||||
[K in keyof MessageInterface]-?: Exclude<MessageInterface[K], undefined>;
|
||||
}, '@type' | 'version' | 'body'> {
|
||||
body: MessagePartModelInterface | null;
|
||||
attachments: Array<MessagePartModelInterface>;
|
||||
}
|
||||
|
||||
export interface MessageInterface {
|
||||
'@type': string;
|
||||
urid?: string | null;
|
||||
size?: number | null;
|
||||
date?: string | null;
|
||||
receivedDate?: string | null;
|
||||
sentDate?: string | null;
|
||||
subject?: string | null;
|
||||
snippet?: string | null;
|
||||
from?: MessageAddressInterface | null;
|
||||
to?: Array<MessageAddressInterface> | null;
|
||||
cc?: Array<MessageAddressInterface> | null;
|
||||
bcc?: Array<MessageAddressInterface> | null;
|
||||
replyTo?: Array<MessageAddressInterface> | null;
|
||||
flags?: MessageFlagsInterface | null;
|
||||
body?: MessagePartInterface | null;
|
||||
attachments?: Array<MessagePartInterface> | [];
|
||||
}
|
||||
|
||||
export interface MessageAddressInterface {
|
||||
address: string;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
export interface MessageFlagsInterface {
|
||||
read?: boolean;
|
||||
flagged?: boolean;
|
||||
answered?: boolean;
|
||||
draft?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Message Part Interface
|
||||
*/
|
||||
export interface MessagePartModelInterface extends Omit<{
|
||||
[K in keyof MessagePartInterface]-?: Exclude<MessagePartInterface[K], undefined>;
|
||||
}, 'subParts'> {
|
||||
subParts: MessagePartModelInterface[];
|
||||
}
|
||||
|
||||
export interface MessagePartInterface {
|
||||
partId?: string | null;
|
||||
blobId?: string | null;
|
||||
size?: number | null;
|
||||
name?: string | null;
|
||||
type?: string;
|
||||
type?: string | null;
|
||||
charset?: string | null;
|
||||
disposition?: string | null;
|
||||
cid?: string | null;
|
||||
language?: string | null;
|
||||
location?: string | null;
|
||||
content?: string;
|
||||
content?: string | null;
|
||||
subParts?: MessagePartInterface[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Message object interface
|
||||
*/
|
||||
export interface MessageInterface {
|
||||
urid?: string;
|
||||
size?: number;
|
||||
receivedDate?: string;
|
||||
date?: string;
|
||||
subject?: string;
|
||||
snippet?: string;
|
||||
from?: {
|
||||
address: string;
|
||||
label?: string;
|
||||
};
|
||||
to?: Array<{
|
||||
address: string;
|
||||
label?: string;
|
||||
}>;
|
||||
cc?: Array<{
|
||||
address: string;
|
||||
label?: string;
|
||||
}>;
|
||||
bcc?: Array<{
|
||||
address: string;
|
||||
label?: string;
|
||||
}>;
|
||||
replyTo?: Array<{
|
||||
address: string;
|
||||
label?: string;
|
||||
}>;
|
||||
flags?: {
|
||||
read?: boolean;
|
||||
flagged?: boolean;
|
||||
answered?: boolean;
|
||||
draft?: boolean;
|
||||
};
|
||||
body?: MessagePartInterface;
|
||||
attachments?: Array<{
|
||||
partId?: string;
|
||||
blobId?: string;
|
||||
size?: number;
|
||||
name?: string;
|
||||
type?: string;
|
||||
charset?: string | null;
|
||||
disposition?: string;
|
||||
cid?: string | null;
|
||||
language?: string | null;
|
||||
location?: string | null;
|
||||
}>;
|
||||
}
|
||||
@@ -23,11 +23,14 @@ export interface ProviderCapabilitiesInterface {
|
||||
*/
|
||||
export interface ProviderInterface {
|
||||
'@type': string;
|
||||
version: number;
|
||||
identifier: string;
|
||||
label: string;
|
||||
capabilities: ProviderCapabilitiesInterface;
|
||||
}
|
||||
|
||||
export interface ProviderModelInterface extends Omit<ProviderInterface, '@type' | 'version'> {}
|
||||
|
||||
/**
|
||||
* Provider list
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* Service type definitions
|
||||
*/
|
||||
import type { Identity } from '@/models/identity';
|
||||
import type { Location } from '@/models/location';
|
||||
import type {
|
||||
ListFilterComparisonOperator,
|
||||
SourceSelector,
|
||||
@@ -43,6 +45,7 @@ export interface ServiceCapabilitiesInterface {
|
||||
*/
|
||||
export interface ServiceInterface {
|
||||
'@type': string;
|
||||
version: number;
|
||||
provider: string;
|
||||
identifier: string | number | null;
|
||||
label: string | null;
|
||||
@@ -55,6 +58,13 @@ export interface ServiceInterface {
|
||||
auxiliary?: Record<string, any>; // Provider-specific extension data
|
||||
}
|
||||
|
||||
export interface ServiceModelInterface extends Omit<{
|
||||
[K in keyof ServiceInterface]-?: Exclude<ServiceInterface[K], undefined>;
|
||||
}, '@type' | 'version' | 'location' | 'identity'> {
|
||||
location: Location | null;
|
||||
identity: Identity | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Service list
|
||||
*/
|
||||
@@ -137,6 +147,18 @@ export interface ServiceDiscoverResponse {
|
||||
location: ServiceLocation;
|
||||
}
|
||||
|
||||
export interface ProviderDiscoveryStatus {
|
||||
provider: string;
|
||||
status: 'pending' | 'discovering' | 'success' | 'failed';
|
||||
location?: ServiceLocation;
|
||||
metadata?: {
|
||||
host?: string;
|
||||
port?: number;
|
||||
protocol?: string;
|
||||
};
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Service connection test
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user