2021-08-03 16:55:52 +00:00
|
|
|
//
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
import type { Plugin, StatusCode } from '@anticrm/platform'
|
|
|
|
import { plugin } from '@anticrm/platform'
|
2021-12-01 20:25:28 +00:00
|
|
|
import type { Account, AnyAttribute, AttachedDoc, Class, Doc, DocWithState, Interface, Obj, PropertyType, Ref, Space, SpaceWithStates, State, Timestamp, Type } from './classes'
|
|
|
|
import type { Tx, TxBulkWrite, TxCollectionCUD, TxCreateDoc, TxCUD, TxMixin, TxPutBag, TxRemoveDoc, TxUpdateDoc } from './tx'
|
2021-08-03 16:55:52 +00:00
|
|
|
|
2021-08-04 20:24:30 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-03 16:55:52 +00:00
|
|
|
export const coreId = 'core' as Plugin
|
|
|
|
|
|
|
|
export default plugin(coreId, {
|
|
|
|
class: {
|
|
|
|
Obj: '' as Ref<Class<Obj>>,
|
|
|
|
Doc: '' as Ref<Class<Doc>>,
|
2021-11-16 18:34:20 +00:00
|
|
|
AttachedDoc: '' as Ref<Class<AttachedDoc>>,
|
2021-08-03 16:55:52 +00:00
|
|
|
Class: '' as Ref<Class<Class<Obj>>>,
|
2021-12-01 20:25:28 +00:00
|
|
|
Interface: '' as Ref<Class<Interface<Doc>>>,
|
2021-08-03 16:55:52 +00:00
|
|
|
Attribute: '' as Ref<Class<AnyAttribute>>,
|
|
|
|
Tx: '' as Ref<Class<Tx>>,
|
2021-10-07 20:01:17 +00:00
|
|
|
TxBulkWrite: '' as Ref<Class<TxBulkWrite>>,
|
2021-08-07 05:39:49 +00:00
|
|
|
TxCUD: '' as Ref<Class<TxCUD<Doc>>>,
|
2021-08-03 16:55:52 +00:00
|
|
|
TxCreateDoc: '' as Ref<Class<TxCreateDoc<Doc>>>,
|
2021-11-16 18:34:20 +00:00
|
|
|
TxCollectionCUD: '' as Ref<Class<TxCollectionCUD<Doc, AttachedDoc>>>,
|
2021-08-03 16:55:52 +00:00
|
|
|
TxMixin: '' as Ref<Class<TxMixin<Doc, Doc>>>,
|
|
|
|
TxUpdateDoc: '' as Ref<Class<TxUpdateDoc<Doc>>>,
|
|
|
|
TxRemoveDoc: '' as Ref<Class<TxRemoveDoc<Doc>>>,
|
2021-09-15 10:53:11 +00:00
|
|
|
TxPutBag: '' as Ref<Class<TxPutBag<PropertyType>>>,
|
2021-08-03 16:55:52 +00:00
|
|
|
Space: '' as Ref<Class<Space>>,
|
2021-09-22 08:41:03 +00:00
|
|
|
SpaceWithStates: '' as Ref<Class<SpaceWithStates>>,
|
2021-09-05 12:03:33 +00:00
|
|
|
Account: '' as Ref<Class<Account>>,
|
2021-09-14 12:29:43 +00:00
|
|
|
State: '' as Ref<Class<State>>,
|
2021-09-15 17:03:34 +00:00
|
|
|
TypeString: '' as Ref<Class<Type<string>>>,
|
2021-10-05 14:34:52 +00:00
|
|
|
TypeBoolean: '' as Ref<Class<Type<boolean>>>,
|
|
|
|
TypeTimestamp: '' as Ref<Class<Type<Timestamp>>>,
|
2021-09-15 17:03:34 +00:00
|
|
|
Bag: '' as Ref<Class<Type<Record<string, PropertyType>>>>
|
2021-08-03 16:55:52 +00:00
|
|
|
},
|
2021-12-01 20:25:28 +00:00
|
|
|
interface: {
|
|
|
|
DocWithState: '' as Ref<Interface<DocWithState>>
|
|
|
|
},
|
2021-08-03 16:55:52 +00:00
|
|
|
space: {
|
|
|
|
Tx: '' as Ref<Space>,
|
|
|
|
Model: '' as Ref<Space>
|
|
|
|
},
|
|
|
|
account: {
|
|
|
|
System: '' as Ref<Account>
|
|
|
|
},
|
|
|
|
status: {
|
|
|
|
ObjectNotFound: '' as StatusCode<{ _id: Ref<Doc> }>,
|
|
|
|
ItemNotFound: '' as StatusCode<{ _id: Ref<Doc>, _localId: string }>
|
|
|
|
}
|
|
|
|
})
|