// // 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 { AttachedDoc, Class, Data, Doc, DocumentUpdate, Mixin, MixinUpdate, PropertyType, Ref, Space, Tx, TxBulkWrite, TxCollectionCUD, TxCreateDoc, TxCUD, TxMixin, TxPutBag, TxRemoveDoc, TxUpdateDoc } from '@anticrm/core' import { DOMAIN_TX } from '@anticrm/core' import { Model } from '@anticrm/model' import core from './component' import { TDoc } from './core' // T R A N S A C T I O N S @Model(core.class.Tx, core.class.Doc, DOMAIN_TX) export class TTx extends TDoc implements Tx { objectSpace!: Ref } @Model(core.class.TxCUD, core.class.Tx) export class TTxCUD extends TTx implements TxCUD { objectId!: Ref objectClass!: Ref> } @Model(core.class.TxCreateDoc, core.class.TxCUD) export class TTxCreateDoc extends TTxCUD implements TxCreateDoc { attributes!: Data } @Model(core.class.TxCollectionCUD, core.class.TxCUD) export class TTxCollectionCUD extends TTxCUD implements TxCollectionCUD { collection!: string tx!: TxCUD

} @Model(core.class.TxPutBag, core.class.TxCUD) export class TTxPutBag extends TTxCUD implements TxPutBag { bag!: string key!: string value!: T } @Model(core.class.TxMixin, core.class.TxCUD) export class TTxMixin extends TTxCUD implements TxMixin { mixin!: Ref> attributes!: MixinUpdate } @Model(core.class.TxUpdateDoc, core.class.TxCUD) export class TTxUpdateDoc extends TTxCUD implements TxUpdateDoc { operations!: DocumentUpdate } @Model(core.class.TxRemoveDoc, core.class.TxCUD) export class TTxRemoveDoc extends TTxCUD implements TxRemoveDoc { } @Model(core.class.TxBulkWrite, core.class.Tx) export class TTxBulkWrite extends TTx implements TxBulkWrite { txes!: TxCUD[] }