diff --git a/models/server-core/src/index.ts b/models/server-core/src/index.ts index 0a92306c04..6ef15b74a5 100644 --- a/models/server-core/src/index.ts +++ b/models/server-core/src/index.ts @@ -14,27 +14,19 @@ // limitations under the License. // -import { type Builder, Model, Mixin } from '@hcengineering/model' +import { Mixin, Model, type Builder } from '@hcengineering/model' import { TClass, TDoc } from '@hcengineering/model-core' import type { Resource } from '@hcengineering/platform' -import core, { - type Class, - DOMAIN_MODEL, - type Doc, - type DocumentQuery, - type FindOptions, - type FindResult, - type Hierarchy, - type Ref -} from '@hcengineering/core' +import core, { DOMAIN_MODEL } from '@hcengineering/core' import type { + ClassSearchConfig, ObjectDDParticipant, - Trigger, - TriggerFunc, + ObjectDDParticipantFunc, SearchPresenter, SearchPresenterFunc, - ClassSearchConfig + Trigger, + TriggerFunc } from '@hcengineering/server-core' import serverCore from '@hcengineering/server-core' @@ -47,17 +39,7 @@ export class TTrigger extends TDoc implements Trigger { @Model(serverCore.mixin.ObjectDDParticipant, core.class.Class) export class TObjectDDParticipant extends TClass implements ObjectDDParticipant { - collectDocs!: Resource< - ( - doc: Doc, - hiearachy: Hierarchy, - findAll: ( - clazz: Ref>, - query: DocumentQuery, - options?: FindOptions - ) => Promise> - ) => Promise - > + collectDocs!: Resource } @Mixin(serverCore.mixin.SearchPresenter, core.class.Class) diff --git a/server-plugins/calendar/src/index.ts b/server-plugins/calendar/src/index.ts index cf632b612f..3153f3fc77 100644 --- a/server-plugins/calendar/src/index.ts +++ b/server-plugins/calendar/src/index.ts @@ -14,11 +14,10 @@ // limitations under the License. // -import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@hcengineering/core' import type { Plugin, Resource } from '@hcengineering/platform' import { plugin } from '@hcengineering/platform' +import type { ObjectDDParticipantFunc, TriggerFunc } from '@hcengineering/server-core' import { Presenter } from '@hcengineering/server-notification' -import type { TriggerFunc } from '@hcengineering/server-core' /** * @public @@ -32,17 +31,7 @@ export default plugin(serverCalendarId, { function: { ReminderHTMLPresenter: '' as Resource, ReminderTextPresenter: '' as Resource, - FindReminders: '' as Resource< - ( - doc: Doc, - hiearachy: Hierarchy, - findAll: ( - clazz: Ref>, - query: DocumentQuery, - options?: FindOptions - ) => Promise> - ) => Promise - > + FindReminders: '' as Resource }, trigger: { OnPersonAccountCreate: '' as Resource diff --git a/server-plugins/chunter/src/index.ts b/server-plugins/chunter/src/index.ts index ba3854873a..398c6e1e39 100644 --- a/server-plugins/chunter/src/index.ts +++ b/server-plugins/chunter/src/index.ts @@ -13,11 +13,10 @@ // limitations under the License. // -import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@hcengineering/core' import type { Plugin, Resource } from '@hcengineering/platform' import { plugin } from '@hcengineering/platform' -import { TriggerFunc } from '@hcengineering/server-core' -import { Presenter, TypeMatchFunc, NotificationContentProvider } from '@hcengineering/server-notification' +import { ObjectDDParticipantFunc, TriggerFunc } from '@hcengineering/server-core' +import { NotificationContentProvider, Presenter, TypeMatchFunc } from '@hcengineering/server-notification' /** * @public @@ -34,17 +33,7 @@ export default plugin(serverChunterId, { OnMessageSent: '' as Resource }, function: { - CommentRemove: '' as Resource< - ( - doc: Doc, - hiearachy: Hierarchy, - findAll: ( - clazz: Ref>, - query: DocumentQuery, - options?: FindOptions - ) => Promise> - ) => Promise - >, + CommentRemove: '' as Resource, ChannelHTMLPresenter: '' as Resource, ChannelTextPresenter: '' as Resource, IsDirectMessage: '' as TypeMatchFunc, diff --git a/server-plugins/gmail/src/index.ts b/server-plugins/gmail/src/index.ts index 89007b3d50..8acb3f3ed4 100644 --- a/server-plugins/gmail/src/index.ts +++ b/server-plugins/gmail/src/index.ts @@ -14,11 +14,10 @@ // limitations under the License. // -import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@hcengineering/core' import type { Plugin, Resource } from '@hcengineering/platform' import { plugin } from '@hcengineering/platform' +import { ObjectDDParticipantFunc, TriggerFunc } from '@hcengineering/server-core' import { TypeMatchFunc } from '@hcengineering/server-notification' -import { TriggerFunc } from '@hcengineering/server-core' /** * @public @@ -34,16 +33,6 @@ export default plugin(serverGmailId, { }, function: { IsIncomingMessage: '' as TypeMatchFunc, - FindMessages: '' as Resource< - ( - doc: Doc, - hiearachy: Hierarchy, - findAll: ( - clazz: Ref>, - query: DocumentQuery, - options?: FindOptions - ) => Promise> - ) => Promise - > + FindMessages: '' as Resource } }) diff --git a/server-plugins/tags/src/index.ts b/server-plugins/tags/src/index.ts index 9467a40cdc..f622db0ebb 100644 --- a/server-plugins/tags/src/index.ts +++ b/server-plugins/tags/src/index.ts @@ -13,10 +13,9 @@ // limitations under the License. // -import { Class, Doc, Hierarchy, Ref, FindResult, FindOptions, DocumentQuery } from '@hcengineering/core' import type { Plugin, Resource } from '@hcengineering/platform' import { plugin } from '@hcengineering/platform' -import { TriggerFunc } from '@hcengineering/server-core' +import { ObjectDDParticipantFunc, TriggerFunc } from '@hcengineering/server-core' /** * @public @@ -31,16 +30,6 @@ export default plugin(serverTagsId, { onTagReference: '' as Resource }, function: { - TagElementRemove: '' as Resource< - ( - doc: Doc, - hiearachy: Hierarchy, - findAll: ( - clazz: Ref>, - query: DocumentQuery, - options?: FindOptions - ) => Promise> - ) => Promise - > + TagElementRemove: '' as Resource } }) diff --git a/server-plugins/telegram/src/index.ts b/server-plugins/telegram/src/index.ts index 89fe3265b6..9481f9dde9 100644 --- a/server-plugins/telegram/src/index.ts +++ b/server-plugins/telegram/src/index.ts @@ -14,11 +14,10 @@ // limitations under the License. // -import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@hcengineering/core' import type { Plugin, Resource } from '@hcengineering/platform' import { plugin } from '@hcengineering/platform' +import { ObjectDDParticipantFunc, TriggerFunc } from '@hcengineering/server-core' import { TypeMatchFunc } from '@hcengineering/server-notification' -import { TriggerFunc } from '@hcengineering/server-core' /** * @public @@ -34,16 +33,6 @@ export default plugin(serverTelegramId, { }, function: { IsIncomingMessage: '' as TypeMatchFunc, - FindMessages: '' as Resource< - ( - doc: Doc, - hiearachy: Hierarchy, - findAll: ( - clazz: Ref>, - query: DocumentQuery, - options?: FindOptions - ) => Promise> - ) => Promise - > + FindMessages: '' as Resource } }) diff --git a/server/core/src/types.ts b/server/core/src/types.ts index 0501ed3a4e..89d8e09c78 100644 --- a/server/core/src/types.ts +++ b/server/core/src/types.ts @@ -27,6 +27,9 @@ import { ModelDb, Obj, Ref, + SearchOptions, + SearchQuery, + SearchResult, ServerStorage, Space, Storage, @@ -34,13 +37,10 @@ import { Tx, TxFactory, TxResult, - WorkspaceId, - SearchQuery, - SearchOptions, - SearchResult + WorkspaceId } from '@hcengineering/core' import { MinioService } from '@hcengineering/minio' -import type { Resource, Asset } from '@hcengineering/platform' +import type { Asset, Resource } from '@hcengineering/platform' import { Readable } from 'stream' /** @@ -321,19 +321,19 @@ export interface WithFind { */ export interface ObjectDDParticipant extends Class { // Collect more items to be deleted if parent document is deleted. - collectDocs: Resource< - ( - doc: Doc, - hiearachy: Hierarchy, - findAll: ( - clazz: Ref>, - query: DocumentQuery, - options?: FindOptions - ) => Promise> - ) => Promise - > + collectDocs: Resource } +export type ObjectDDParticipantFunc = ( + doc: Doc, + hiearachy: Hierarchy, + findAll: ( + clazz: Ref>, + query: DocumentQuery, + options?: FindOptions + ) => Promise> +) => Promise + /** * @public */