2021-08-03 16:55:52 +00:00
|
|
|
//
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
2021-08-04 21:17:53 +00:00
|
|
|
// Copyright © 2021 Hardcore Engineering Inc.
|
2021-08-03 16:55:52 +00:00
|
|
|
//
|
|
|
|
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License. You may
|
|
|
|
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
//
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
2023-04-25 07:34:10 +00:00
|
|
|
import type { Asset, IntlString, Plugin } from '@hcengineering/platform'
|
2021-08-03 16:55:52 +00:00
|
|
|
|
2021-08-04 17:35:29 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export type Ref<T extends Doc> = string & { __ref: T }
|
2021-08-04 17:51:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export type PrimitiveType = number | string | boolean | undefined | Ref<Doc>
|
2021-08-04 17:51:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export type Timestamp = number
|
|
|
|
|
2022-03-18 06:37:49 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export type Markup = string
|
|
|
|
|
2022-11-04 06:07:27 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export type Hyperlink = string
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export interface Obj {
|
|
|
|
_class: Ref<Class<this>>
|
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export interface Doc extends Obj {
|
|
|
|
_id: Ref<this>
|
|
|
|
space: Ref<Space>
|
|
|
|
modifiedOn: Timestamp
|
|
|
|
modifiedBy: Ref<Account>
|
2023-05-19 17:37:22 +00:00
|
|
|
createdBy?: Ref<Account> // Marked as optional since it will be filled by platform.
|
2023-05-27 06:02:11 +00:00
|
|
|
createdOn?: Timestamp // Marked as optional since it will be filled by platform.
|
2021-08-03 16:55:52 +00:00
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export type PropertyType = any
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export interface UXObject extends Obj {
|
2021-10-05 09:18:37 +00:00
|
|
|
label: IntlString
|
2021-08-03 16:55:52 +00:00
|
|
|
icon?: Asset
|
2021-12-27 12:01:52 +00:00
|
|
|
hidden?: boolean
|
2022-08-16 10:19:33 +00:00
|
|
|
readonly?: boolean
|
2021-08-03 16:55:52 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 08:10:32 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface AttachedDoc extends Doc {
|
|
|
|
attachedTo: Ref<Doc>
|
2021-10-23 14:03:37 +00:00
|
|
|
attachedToClass: Ref<Class<Doc>>
|
2021-11-17 08:47:30 +00:00
|
|
|
collection: string
|
2021-09-14 08:10:32 +00:00
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
export interface Type<T extends PropertyType> extends UXObject {}
|
|
|
|
|
2021-08-26 17:59:08 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export enum IndexKind {
|
2023-08-24 14:00:32 +00:00
|
|
|
/**
|
|
|
|
* Attribute with this index annotation should be added to elastic for search
|
|
|
|
* Could be added to string or Ref attribute
|
|
|
|
* TODO: rename properly for better code readability
|
|
|
|
*/
|
2022-02-11 18:12:12 +00:00
|
|
|
FullText,
|
2023-08-24 14:00:32 +00:00
|
|
|
/**
|
|
|
|
* For attribute with this annotation should be created an index in mongo database
|
2023-10-17 08:21:59 +00:00
|
|
|
*
|
|
|
|
* Also mean to include into Elastic search.
|
2023-08-24 14:00:32 +00:00
|
|
|
*/
|
2022-02-11 18:12:12 +00:00
|
|
|
Indexed
|
2021-08-26 17:59:08 +00:00
|
|
|
}
|
|
|
|
|
2022-05-29 04:56:06 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface Enum extends Doc {
|
|
|
|
name: string
|
|
|
|
enumValues: string[]
|
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export interface Attribute<T extends PropertyType> extends Doc, UXObject {
|
|
|
|
attributeOf: Ref<Class<Obj>>
|
|
|
|
name: string
|
|
|
|
type: Type<T>
|
2021-08-26 17:59:08 +00:00
|
|
|
index?: IndexKind
|
2022-05-19 07:14:05 +00:00
|
|
|
shortLabel?: IntlString
|
2022-05-05 14:50:28 +00:00
|
|
|
isCustom?: boolean
|
2023-03-21 16:08:45 +00:00
|
|
|
defaultValue?: any
|
2023-01-31 19:00:22 +00:00
|
|
|
|
|
|
|
// Extra customization properties
|
|
|
|
[key: string]: any
|
2021-08-03 16:55:52 +00:00
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export type AnyAttribute = Attribute<Type<any>>
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export enum ClassifierKind {
|
|
|
|
CLASS,
|
2021-12-01 20:25:28 +00:00
|
|
|
INTERFACE,
|
2021-08-03 16:55:52 +00:00
|
|
|
MIXIN
|
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export interface Classifier extends Doc, UXObject {
|
|
|
|
kind: ClassifierKind
|
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export type Domain = string & { __domain: true }
|
|
|
|
|
2021-12-01 20:25:28 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
export interface Interface<T extends Doc> extends Classifier {
|
|
|
|
extends?: Ref<Interface<Doc>>[]
|
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
export interface Class<T extends Obj> extends Classifier {
|
|
|
|
extends?: Ref<Class<Obj>>
|
2021-12-01 20:25:28 +00:00
|
|
|
implements?: Ref<Interface<Doc>>[]
|
2021-08-03 16:55:52 +00:00
|
|
|
domain?: Domain
|
2023-03-15 14:06:03 +00:00
|
|
|
shortLabel?: string
|
2021-12-20 09:06:31 +00:00
|
|
|
sortingKey?: string
|
2023-07-20 09:41:26 +00:00
|
|
|
filteringKey?: string
|
2021-08-03 16:55:52 +00:00
|
|
|
}
|
|
|
|
|
2022-04-01 05:57:22 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* Define a set of plugin to model document bindings.
|
|
|
|
*/
|
|
|
|
export interface PluginConfiguration extends Doc {
|
2023-04-25 07:34:10 +00:00
|
|
|
pluginId: Plugin
|
2022-04-01 05:57:22 +00:00
|
|
|
transactions: Ref<Doc>[]
|
2023-04-25 07:34:10 +00:00
|
|
|
|
|
|
|
label?: IntlString
|
|
|
|
icon?: Asset
|
|
|
|
description?: IntlString
|
|
|
|
enabled: boolean
|
|
|
|
|
2023-04-28 08:22:25 +00:00
|
|
|
// If specified, will show beta/testing label in UI.
|
|
|
|
beta: boolean
|
2023-04-25 07:34:10 +00:00
|
|
|
|
|
|
|
// If defined, will only remove classes in list.
|
|
|
|
classFilter?: Ref<Class<Obj>>[]
|
2022-04-01 05:57:22 +00:00
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export type Mixin<T extends Doc> = Class<T>
|
|
|
|
|
|
|
|
// D A T A
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export type Data<T extends Doc> = Omit<T, keyof Doc>
|
|
|
|
|
2021-10-30 10:13:55 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export type AttachedData<T extends AttachedDoc> = Omit<T, keyof AttachedDoc>
|
|
|
|
|
2023-03-21 16:08:45 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export type DocData<T extends Doc> = T extends AttachedDoc ? AttachedData<T> : Data<T>
|
|
|
|
|
2021-08-03 16:55:52 +00:00
|
|
|
// T Y P E S
|
|
|
|
|
2022-03-18 06:37:49 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2023-02-03 05:47:25 +00:00
|
|
|
export enum DateRangeMode {
|
|
|
|
DATE = 'date',
|
|
|
|
TIME = 'time',
|
|
|
|
DATETIME = 'datetime'
|
|
|
|
}
|
2022-03-18 06:37:49 +00:00
|
|
|
|
2023-02-03 05:47:25 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2022-03-18 06:37:49 +00:00
|
|
|
export interface TypeDate extends Type<Date> {
|
2023-02-03 05:47:25 +00:00
|
|
|
// If not set date mode default
|
|
|
|
mode: DateRangeMode
|
2022-03-18 06:37:49 +00:00
|
|
|
// If not set to true, will be false
|
2023-02-03 05:47:25 +00:00
|
|
|
withShift: boolean
|
2022-03-18 06:37:49 +00:00
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export interface RefTo<T extends Doc> extends Type<Ref<Class<T>>> {
|
|
|
|
to: Ref<Class<T>>
|
|
|
|
}
|
|
|
|
|
2021-12-06 09:16:04 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface Collection<T extends AttachedDoc> extends Type<number> {
|
|
|
|
of: Ref<Class<T>>
|
2022-02-16 09:02:31 +00:00
|
|
|
itemLabel?: IntlString
|
2021-12-06 09:16:04 +00:00
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export type Arr<T extends PropertyType> = T[]
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export interface ArrOf<T extends PropertyType> extends Type<T[]> {
|
|
|
|
of: Type<T>
|
|
|
|
}
|
|
|
|
|
2022-05-29 04:56:06 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface EnumOf extends Type<string> {
|
|
|
|
of: Ref<Enum>
|
|
|
|
}
|
|
|
|
|
2022-11-04 06:07:27 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface TypeHyperlink extends Type<Hyperlink> {}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export const DOMAIN_MODEL = 'model' as Domain
|
|
|
|
|
2023-01-24 13:42:47 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const DOMAIN_CONFIGURATION = '_configuration' as Domain
|
|
|
|
|
2023-10-03 19:31:07 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const DOMAIN_MIGRATION = '_migrations' as Domain
|
|
|
|
|
2022-04-23 03:45:55 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const DOMAIN_TRANSIENT = 'transient' as Domain
|
|
|
|
|
2022-05-23 15:53:33 +00:00
|
|
|
/**
|
|
|
|
* Special domain to access s3 blob data.
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const DOMAIN_BLOB = 'blob' as Domain
|
|
|
|
|
2022-06-01 12:05:07 +00:00
|
|
|
/**
|
|
|
|
* Special domain to access s3 blob data.
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const DOMAIN_FULLTEXT_BLOB = 'fulltext-blob' as Domain
|
|
|
|
|
2023-01-04 17:58:54 +00:00
|
|
|
/**
|
|
|
|
* Special domain to access s3 blob data.
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const DOMAIN_DOC_INDEX_STATE = 'doc-index-state' as Domain
|
|
|
|
|
2021-09-22 08:41:03 +00:00
|
|
|
// S P A C E
|
2021-08-03 16:55:52 +00:00
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export interface Space extends Doc {
|
|
|
|
name: string
|
|
|
|
description: string
|
|
|
|
private: boolean
|
|
|
|
members: Arr<Ref<Account>>
|
2021-12-21 09:08:22 +00:00
|
|
|
archived: boolean
|
2021-08-03 16:55:52 +00:00
|
|
|
}
|
|
|
|
|
2021-08-04 17:51:42 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-08 08:43:11 +00:00
|
|
|
export interface Account extends Doc {
|
|
|
|
email: string
|
2022-07-01 15:22:58 +00:00
|
|
|
role: AccountRole
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export enum AccountRole {
|
|
|
|
User,
|
|
|
|
Maintainer,
|
|
|
|
Owner
|
2021-08-08 08:43:11 +00:00
|
|
|
}
|
2022-01-24 18:30:13 +00:00
|
|
|
|
2022-04-23 03:45:55 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface UserStatus extends Doc {
|
|
|
|
online: boolean
|
|
|
|
}
|
|
|
|
|
2022-01-24 18:30:13 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface Version extends Doc {
|
|
|
|
major: number
|
|
|
|
minor: number
|
|
|
|
patch: number
|
|
|
|
}
|
2022-05-23 15:53:33 +00:00
|
|
|
|
2023-10-03 19:31:07 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface MigrationState extends Doc {
|
|
|
|
plugin: string
|
|
|
|
state: string
|
|
|
|
}
|
|
|
|
|
2023-04-07 05:18:07 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2023-10-18 09:33:37 +00:00
|
|
|
export function versionToString (version: Version | Data<Version>): string {
|
2023-04-07 05:18:07 +00:00
|
|
|
return `${version?.major}.${version?.minor}.${version?.patch}`
|
|
|
|
}
|
|
|
|
|
2022-05-23 15:53:33 +00:00
|
|
|
/**
|
|
|
|
* Blob data from s3 storage
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface BlobData extends Doc {
|
|
|
|
name: string
|
|
|
|
size: number
|
|
|
|
type: string
|
|
|
|
base64Data: string // base64 encoded data
|
|
|
|
}
|
2022-06-01 12:05:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Blob data from s3 storage
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface FullTextData extends Doc {
|
|
|
|
data: any
|
|
|
|
}
|
2022-09-09 03:44:33 +00:00
|
|
|
|
2023-01-04 17:58:54 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*
|
|
|
|
* Define status for full text indexing
|
|
|
|
*/
|
|
|
|
export interface DocIndexState extends Doc {
|
|
|
|
objectClass: Ref<Class<Doc>>
|
|
|
|
|
|
|
|
attachedTo?: Ref<Doc>
|
|
|
|
attachedToClass?: Ref<Class<Doc>>
|
|
|
|
|
|
|
|
// States for stages
|
2023-01-26 13:53:00 +00:00
|
|
|
stages: Record<string, boolean | string>
|
2023-01-04 17:58:54 +00:00
|
|
|
|
|
|
|
removed: boolean
|
|
|
|
|
|
|
|
// Indexable attributes, including child ones.
|
|
|
|
attributes: Record<string, any>
|
2023-01-24 13:42:47 +00:00
|
|
|
|
|
|
|
// Full Summary
|
|
|
|
fullSummary?: Markup | null
|
|
|
|
shortSummary?: Markup | null
|
2023-01-04 17:58:54 +00:00
|
|
|
}
|
|
|
|
|
2023-01-26 13:53:00 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface IndexStageState extends Doc {
|
|
|
|
stageId: string
|
|
|
|
attributes: Record<string, any>
|
|
|
|
}
|
|
|
|
|
2023-01-04 17:58:54 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*
|
|
|
|
* If defined for class, this class will be enabled for embedding search like openai.
|
|
|
|
*/
|
2023-01-24 13:42:47 +00:00
|
|
|
export interface FullTextSearchContext extends Class<Doc> {
|
2023-01-31 05:48:40 +00:00
|
|
|
fullTextSummary?: boolean
|
|
|
|
forceIndex?: boolean
|
|
|
|
|
2023-03-13 16:50:10 +00:00
|
|
|
// If defined, will propagate changes to child's with defined set of classes
|
2023-04-20 10:11:22 +00:00
|
|
|
propagate?: Ref<Class<Doc>>[]
|
2023-06-01 07:08:57 +00:00
|
|
|
// If defined, will propagate all document from child's based on class
|
|
|
|
propagateClasses?: Ref<Class<Doc>>[]
|
2023-04-20 10:11:22 +00:00
|
|
|
|
|
|
|
// Do we need to propagate child value to parent one. Default(true)
|
|
|
|
parentPropagate?: boolean
|
2023-01-24 13:42:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface ConfigurationElement extends Class<Doc> {
|
|
|
|
// Title will be presented to owner.
|
|
|
|
title: IntlString
|
2023-03-13 16:50:10 +00:00
|
|
|
// Group for grouping.
|
2023-01-24 13:42:47 +00:00
|
|
|
group: IntlString
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*
|
|
|
|
* Define configuration value configuration for workspace.
|
|
|
|
*
|
2023-03-13 16:50:10 +00:00
|
|
|
* Configuration is accessible only for owners of workspace and under hood services.
|
2023-01-24 13:42:47 +00:00
|
|
|
*/
|
|
|
|
export interface Configuration extends Doc {
|
|
|
|
enabled: boolean
|
2023-01-04 17:58:54 +00:00
|
|
|
}
|
|
|
|
|
2022-09-09 03:44:33 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export type RelatedDocument = Pick<Doc, '_id' | '_class'>
|
2023-03-13 16:50:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export enum IndexOrder {
|
|
|
|
Ascending = 1,
|
|
|
|
Descending = -1
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export type FieldIndex<T extends Doc> = {
|
|
|
|
[P in keyof T]?: IndexOrder
|
2023-11-20 10:01:43 +00:00
|
|
|
} & Record<string, IndexOrder>
|
2023-03-13 16:50:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*
|
|
|
|
* Mixin for extra indexing fields.
|
|
|
|
*/
|
|
|
|
export interface IndexingConfiguration<T extends Doc> extends Class<Doc> {
|
|
|
|
// Define a list of extra index definitions.
|
|
|
|
indexes: (FieldIndex<T> | string)[]
|
|
|
|
}
|