| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- import { ID } from '@vendure/common/lib/shared-types';
- import { CustomFields } from '@vendure/core';
- import { EntityDataMapper } from './entity-data-mapper/entity-data-mapper.interface';
- import { SearchIndexingStrategy } from './search-index/search-indexing.strategy';
- /**
- * @description
- * Configuration options for the {@link DashboardPlugin}.
- *
- * @docsCategory core plugins/DashboardPlugin
- */
- export interface DashboardPluginOptions {
- /**
- * @description
- * The route to the Dashboard UI.
- *
- * @default 'dashboard'
- */
- route: string;
- /**
- * @description
- * The path to the dashboard UI app dist directory. By default, the built-in dashboard UI
- * will be served. This can be overridden with a custom build of the dashboard.
- */
- appDir: string;
- /**
- * @description
- * Configuration of the global search feature in the dashboard UI
- */
- globalSearch?: {
- indexingStrategy?: SearchIndexingStrategy;
- entityDataMappers?: Map<keyof CustomFields | string, EntityDataMapper>;
- };
- }
- export type MetricSummary = {
- interval: MetricInterval;
- type: MetricType;
- title: string;
- entries: MetricSummaryEntry[];
- };
- export enum MetricType {
- OrderCount = 'OrderCount',
- OrderTotal = 'OrderTotal',
- AverageOrderValue = 'AverageOrderValue',
- }
- export enum MetricInterval {
- Daily = 'Daily',
- }
- export type MetricSummaryEntry = {
- label: string;
- value: number;
- };
- export interface MetricSummaryInput {
- interval: MetricInterval;
- types: MetricType[];
- refresh?: boolean;
- }
- export enum SearchIndexItemType {
- Entity = 'entity',
- Plugin = 'plugin',
- Docs = 'docs',
- Article = 'article',
- }
- export interface SearchIndexItem {
- id?: string;
- title: string;
- type: SearchIndexItemType;
- subtitle?: string;
- description?: string;
- thumbnailUrl?: string;
- metadata?: Record<string, any>;
- lastModified?: Date | string;
- }
- /**
- * @description The index items for custom and built-in Vendure entities
- */
- export interface EntitySearchIndexItem extends SearchIndexItem {
- entityId: ID;
- entityName: string;
- }
- /**
- * @description The index items for external urls like blog articles, docs or plugins.
- */
- export interface ExternalUrlSearchIndexItem extends SearchIndexItem {
- externalId: string;
- url: string;
- }
|