refactor: docs and styling
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -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: ''},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -45,10 +45,7 @@ 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
|
||||||
@@ -65,9 +62,7 @@ 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
|
||||||
@@ -117,13 +112,10 @@ 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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user