refactor: docs and styling

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-06-20 19:01:51 -04:00
parent 3aef72b05c
commit 556ff7d708
7 changed files with 40 additions and 32 deletions
+13 -5
View File
@@ -2,9 +2,17 @@
* Class model for Collection Interface * Class model for Collection Interface
*/ */
import type { CollectionInterface, CollectionModelInterface, CollectionPropertiesInterface, CollectionPropertiesModelInterface } from "@/types/collection"; import type {
CollectionInterface,
CollectionModelInterface,
CollectionPropertiesInterface,
CollectionPropertiesModelInterface
} from "@/types/collection";
import { clonePlain } from './clone-plain'; import { clonePlain } from './clone-plain';
import type { CollectionIdentifier, ServiceIdentifier } from "@/services"; import type {
CollectionIdentifier,
ServiceIdentifier
} from "@/services";
export class CollectionObject implements CollectionModelInterface { export class CollectionObject implements CollectionModelInterface {
@@ -16,9 +24,9 @@ export class CollectionObject implements CollectionModelInterface {
'@type': 'mail:collection', '@type': 'mail:collection',
version: 1, version: 1,
provider: '', provider: '',
service: '', service: '' as ServiceIdentifier,
collection: null, collection: null as CollectionIdentifier | null,
identifier: '', identifier: '' as CollectionIdentifier,
properties: {'@type': 'mail:folder', label: ''}, properties: {'@type': 'mail:folder', label: ''},
}; };
} }
+2 -2
View File
@@ -19,8 +19,8 @@ export class EntityObject implements EntityModelInterface {
version: 1, version: 1,
provider: '', provider: '',
service: '', service: '',
collection: null, collection: '' as CollectionIdentifier,
identifier: null, identifier: '' as EntityIdentifier,
signature: null, signature: null,
created: null, created: null,
modified: null, modified: null,
+11 -19
View File
@@ -44,13 +44,10 @@ export const useEntitiesStore = defineStore('mailEntitiesStore', () => {
/** /**
* Get a specific entity from store, with optional retrieval * Get a specific entity from store, with optional retrieval
* *
* @param provider - provider identifier * @param target - entity identifier
* @param service - service identifier
* @param collection - collection identifier
* @param identifier - entity identifier
* @param retrieve - Retrieve behavior: true = fetch if missing or refresh, false = cache only * @param retrieve - Retrieve behavior: true = fetch if missing or refresh, false = cache only
* *
* @returns Entity object or null * @returns Entity object or null
*/ */
function entity(target: EntityIdentifier, retrieve: boolean = false): EntityObject | null { function entity(target: EntityIdentifier, retrieve: boolean = false): EntityObject | null {
@@ -64,12 +61,10 @@ export const useEntitiesStore = defineStore('mailEntitiesStore', () => {
/** /**
* Get all entities for a specific collection * Get all entities for a specific collection
* *
* @param provider - provider identifier * @param target - collection identifier
* @param service - service identifier
* @param collection - collection identifier
* @param retrieve - Retrieve behavior: true = fetch if missing or refresh, false = cache only * @param retrieve - Retrieve behavior: true = fetch if missing or refresh, false = cache only
* *
* @returns Array of entity objects * @returns Array of entity objects
*/ */
function entitiesForCollection(target: CollectionIdentifier, retrieve: boolean = false): EntityObject[] { function entitiesForCollection(target: CollectionIdentifier, retrieve: boolean = false): EntityObject[] {
@@ -117,14 +112,11 @@ export const useEntitiesStore = defineStore('mailEntitiesStore', () => {
} }
} }
/** /**
* Retrieve specific entities by provider, service, collection, and identifiers * Retrieve specific entities by their identifiers
* *
* @param provider - provider identifier * @param targets - array of entity identifiers to fetch
* @param service - service identifier *
* @param collection - collection identifier
* @param identifiers - array of entity identifiers to fetch
*
* @returns Promise with entity objects keyed by identifier * @returns Promise with entity objects keyed by identifier
*/ */
async function fetch(targets: EntityIdentifier[]): Promise<Record<string, EntityObject>> { async function fetch(targets: EntityIdentifier[]): Promise<Record<string, EntityObject>> {
+6 -1
View File
@@ -1,7 +1,12 @@
/** /**
* Collection type definitions * Collection type definitions
*/ */
import type { CollectionIdentifier, ListFilter, ListSort, ServiceIdentifier } from './common'; import type {
ServiceIdentifier,
CollectionIdentifier,
ListFilter,
ListSort
} from './common';
/** /**
* Collection information * Collection information
+4 -1
View File
@@ -8,7 +8,10 @@ import type {
ListRange, ListRange,
ListSort, ListSort,
} from './common'; } from './common';
import type { MessageInterface, MessageModelInterface } from './message'; import type {
MessageInterface,
MessageModelInterface
} from './message';
/** /**
* Entity definition * Entity definition
+3 -3
View File
@@ -39,14 +39,14 @@ export interface ProviderListRequest {
} }
export interface ProviderListResponse { export interface ProviderListResponse {
[identifier: string]: ProviderInterface; [identifier: ProviderIdentifier]: ProviderInterface;
} }
/** /**
* Provider fetch * Provider fetch
*/ */
export interface ProviderFetchRequest { export interface ProviderFetchRequest {
target: string; target: ProviderIdentifier;
} }
export interface ProviderFetchResponse extends ProviderInterface {} export interface ProviderFetchResponse extends ProviderInterface {}
@@ -59,5 +59,5 @@ export interface ProviderExtantRequest {
} }
export interface ProviderExtantResponse { export interface ProviderExtantResponse {
[identifier: string]: boolean; [identifier: ProviderIdentifier]: boolean;
} }
+1 -1
View File
@@ -5,9 +5,9 @@ import type { ServiceAddressObject } from '@/models/address';
import type { Identity } from '@/models/identity'; import type { Identity } from '@/models/identity';
import type { Location } from '@/models/location'; import type { Location } from '@/models/location';
import type { import type {
ServiceIdentifier,
CollectionIdentifier, CollectionIdentifier,
ListFilterComparisonOperator, ListFilterComparisonOperator,
ServiceIdentifier,
} from './common'; } from './common';
/** /**