mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-24 13:22:23 +02:00
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import { Doc, Mixin, Ref } from '@hcengineering/core'
|
|
import type { Plugin, Resource } from '@hcengineering/platform'
|
|
import { plugin } from '@hcengineering/platform'
|
|
import { Method, ProcessFunction } from '@hcengineering/process'
|
|
import { TriggerFunc } from '@hcengineering/server-core'
|
|
import { ExecuteFunc, TransformFunc } from './types'
|
|
|
|
export * from './types'
|
|
|
|
/**
|
|
* @public
|
|
*/
|
|
export const serverProcessId = 'server-process' as Plugin
|
|
|
|
export interface MethodImpl<T extends Doc> extends Method<T> {
|
|
func: Resource<ExecuteFunc>
|
|
}
|
|
|
|
export interface FuncImpl extends ProcessFunction {
|
|
func: Resource<TransformFunc>
|
|
}
|
|
|
|
/**
|
|
* @public
|
|
*/
|
|
export default plugin(serverProcessId, {
|
|
mixin: {
|
|
MethodImpl: '' as Ref<Mixin<MethodImpl<Doc>>>,
|
|
FuncImpl: '' as Ref<Mixin<FuncImpl>>
|
|
},
|
|
func: {
|
|
RunSubProcess: '' as Resource<ExecuteFunc>,
|
|
CreateToDo: '' as Resource<ExecuteFunc>,
|
|
UpdateCard: '' as Resource<ExecuteFunc>
|
|
},
|
|
transform: {
|
|
FirstValue: '' as Resource<TransformFunc>,
|
|
LastValue: '' as Resource<TransformFunc>,
|
|
Random: '' as Resource<TransformFunc>,
|
|
UpperCase: '' as Resource<TransformFunc>,
|
|
LowerCase: '' as Resource<TransformFunc>,
|
|
Trim: '' as Resource<TransformFunc>,
|
|
Add: '' as Resource<TransformFunc>,
|
|
Subtract: '' as Resource<TransformFunc>,
|
|
Offset: '' as Resource<TransformFunc>,
|
|
FirstWorkingDayAfter: '' as Resource<TransformFunc>
|
|
},
|
|
trigger: {
|
|
OnExecutionCreate: '' as Resource<TriggerFunc>,
|
|
OnStateRemove: '' as Resource<TriggerFunc>,
|
|
OnProcessRemove: '' as Resource<TriggerFunc>,
|
|
OnProcessToDoClose: '' as Resource<TriggerFunc>,
|
|
OnProcessToDoRemove: '' as Resource<TriggerFunc>
|
|
}
|
|
})
|