From af0a69db1bae9218b467f54c622d08dc705dac1a Mon Sep 17 00:00:00 2001 From: Andrey Platov Date: Sat, 7 Aug 2021 13:55:24 +0200 Subject: [PATCH] fix `model-core` and some tests Signed-off-by: Andrey Platov --- .../src/__tests__/client.test.ts | 4 +- dev/client-resources/src/model.tx.json | 1018 ----------------- dev/prod/package.json | 2 + dev/prod/src/platform.ts | 4 +- dev/storage/src/__tests__/storage.test.ts | 26 + dev/storage/src/model.tx.json | 138 ++- models/core/src/index.ts | 3 +- rush.json | 2 +- 8 files changed, 111 insertions(+), 1086 deletions(-) delete mode 100644 dev/client-resources/src/model.tx.json create mode 100644 dev/storage/src/__tests__/storage.test.ts diff --git a/dev/client-resources/src/__tests__/client.test.ts b/dev/client-resources/src/__tests__/client.test.ts index 1363c63862..c0e6c20a2d 100644 --- a/dev/client-resources/src/__tests__/client.test.ts +++ b/dev/client-resources/src/__tests__/client.test.ts @@ -20,12 +20,12 @@ describe('client', () => { it('should create connection', async () => { const conn = await connect(() => {}) const txes = await conn.findAll(core.class.Tx, {}) - expect(txes.length).toBe(25) + expect(txes.length).toBe(14) }) it('should create client', async () => { const client = await createClient(connect) const txes = await client.findAll(core.class.Class, {}) - expect(txes.length).toBe(18) + expect(txes.length).toBe(14) }) }) diff --git a/dev/client-resources/src/model.tx.json b/dev/client-resources/src/model.tx.json deleted file mode 100644 index f8f795b450..0000000000 --- a/dev/client-resources/src/model.tx.json +++ /dev/null @@ -1,1018 +0,0 @@ -[ - { - "_id": "610828bdad975a4e5f24b461", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.Obj", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0 - } - }, - { - "_id": "610828bdad975a4e5f24b462", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.Doc", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Obj" - } - }, - { - "_id": "610828bdad975a4e5f24b463", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.Type", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b464", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.TypeString", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Type" - } - }, - { - "_id": "610828bdad975a4e5f24b465", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.Attribute", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b466", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.Account", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "domain": "model", - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b467", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.Space", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "domain": "model", - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b468", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.Tx", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "domain": "tx", - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b469", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.TxUpdateDoc", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Tx" - } - }, - { - "_id": "610828bdad975a4e5f24b46a", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.TxMixin", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Tx" - } - }, - { - "_id": "610828bdad975a4e5f24b46b", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.TxCreateDoc", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Tx" - } - }, - { - "_id": "610828bdad975a4e5f24b46c", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.Class", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "domain": "model", - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b46d", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "core.class.Mixin", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Class" - } - }, - { - "_id": "610828bdad975a4e5f24b46e", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "view.class.Viewlet", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "domain": "model", - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b46f", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "view.class.ViewletDescriptor", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "domain": "model", - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b470", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "view.mixin.AttributePresenter", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Class" - } - }, - { - "_id": "610828bdad975a4e5f24b471", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "view.mixin.AttributeEditor", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669333, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Class" - } - }, - { - "_id": "610828bdad975a4e5f24b472", - "_class": "core.class.TxMixin", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669333, - "objectId": "core.class.TypeString", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "mixin": "view.mixin.AttributeEditor", - "attributes": { - "editor": "view.component.StringEditor" - } - }, - { - "_id": "610828bdad975a4e5f24b473", - "_class": "core.class.TxMixin", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669333, - "objectId": "core.class.TypeString", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "mixin": "view.mixin.AttributePresenter", - "attributes": { - "presenter": "view.component.StringPresenter" - } - }, - { - "_id": "610828bdad975a4e5f24b474", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "view.viewlet.Table", - "objectClass": "view.class.ViewletDescriptor", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "label": "Table", - "icon": "view.icon.Table", - "component": "table.component.TableView" - } - }, - { - "_id": "610828bdad975a4e5f24b475", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "workbench.mixin.SpaceView", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Class" - } - }, - { - "_id": "610828bdad975a4e5f24b476", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "workbench.class.Application", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "domain": "model", - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b477", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "contact.class.Contact", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b478", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "contact.class.Organization", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "contact.class.Contact" - } - }, - { - "_id": "610828bdad975a4e5f24b479", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "contact.class.Person", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "contact.class.Contact", - "label": "Person" - } - }, - { - "_id": "610828bdad975a4e5f24b47a", - "objectId": "610828bdad975a4e5f24b47b", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669178, - "objectSpace": "core.space.Model", - "objectClass": "core.class.Attribute", - "attributes": { - "type": { - "_class": "core.class.TypeString" - }, - "name": "firstName", - "label": "First name", - "attributeOf": "contact.class.Person" - } - }, - { - "_id": "610828bdad975a4e5f24b47c", - "objectId": "610828bdad975a4e5f24b47d", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669178, - "objectSpace": "core.space.Model", - "objectClass": "core.class.Attribute", - "attributes": { - "type": { - "_class": "core.class.TypeString" - }, - "name": "lastName", - "label": "Last name", - "attributeOf": "contact.class.Person" - } - }, - { - "_id": "610828bdad975a4e5f24b47e", - "objectId": "610828bdad975a4e5f24b47f", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669178, - "objectSpace": "core.space.Model", - "objectClass": "core.class.Attribute", - "attributes": { - "type": { - "_class": "core.class.TypeString" - }, - "name": "email", - "label": "Email", - "attributeOf": "contact.class.Person" - } - }, - { - "_id": "610828bdad975a4e5f24b480", - "objectId": "610828bdad975a4e5f24b481", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669178, - "objectSpace": "core.space.Model", - "objectClass": "core.class.Attribute", - "attributes": { - "type": { - "_class": "core.class.TypeString" - }, - "name": "phone", - "label": "Phone", - "attributeOf": "contact.class.Person" - } - }, - { - "_id": "610828bdad975a4e5f24b482", - "objectId": "610828bdad975a4e5f24b483", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669178, - "objectSpace": "core.space.Model", - "objectClass": "core.class.Attribute", - "attributes": { - "type": { - "_class": "core.class.TypeString" - }, - "name": "city", - "label": "City", - "attributeOf": "contact.class.Person" - } - }, - { - "_id": "610828bdad975a4e5f24b484", - "_class": "core.class.TxMixin", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669334, - "objectId": "contact.class.Person", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "mixin": "view.mixin.AttributePresenter", - "attributes": { - "presenter": "contact.component.PersonPresenter" - } - }, - { - "_id": "610828bdad975a4e5f24b485", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "chunter.class.Backlink", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b486", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "chunter.class.Message", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Doc", - "triggers": [ - "chunter-server.trigger.OnMessage" - ] - } - }, - { - "_id": "610828bdad975a4e5f24b487", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "chunter.class.Channel", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Space", - "label": "chunter.string.Channel", - "icon": "chunter.icon.Hashtag" - } - }, - { - "_id": "610828bdad975a4e5f24b488", - "_class": "core.class.TxMixin", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669334, - "objectId": "chunter.class.Channel", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "mixin": "workbench.mixin.SpaceView", - "attributes": { - "view": { - "class": "chunter.class.Message" - } - } - }, - { - "_id": "610828bdad975a4e5f24b489", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "chunter.viewlet.Chat", - "objectClass": "view.class.ViewletDescriptor", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "label": "Chat", - "icon": "view.icon.Table", - "component": "chunter.component.ChannelView" - } - }, - { - "_id": "610828bdad975a4e5f24b48a", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b48b", - "objectClass": "view.class.Viewlet", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "attachTo": "chunter.class.Message", - "descriptor": "chunter.viewlet.Chat", - "open": "X", - "config": {} - } - }, - { - "_id": "610828bdad975a4e5f24b48c", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b48d", - "objectClass": "workbench.class.Application", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "label": "chunter.string.ApplicationLabelChunter", - "icon": "chunter.icon.Chunter", - "navigatorModel": { - "spaces": [ - { - "label": "chunter.string.Channels", - "spaceClass": "chunter.class.Channel", - "addSpaceLabel": "chunter.string.CreateChannel", - "createComponent": "chunter.component.CreateChannel" - } - ] - } - } - }, - { - "_id": "610828bdad975a4e5f24b48e", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b48f", - "objectClass": "chunter.class.Channel", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "name": "general", - "description": "General Channel", - "private": false, - "members": [] - } - }, - { - "_id": "610828bdad975a4e5f24b490", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b491", - "objectClass": "chunter.class.Channel", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "name": "random", - "description": "Random Talks", - "private": false, - "members": [] - } - }, - { - "_id": "610828bdad975a4e5f24b492", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "task.class.Task", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b493", - "objectId": "610828bdad975a4e5f24b494", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669332, - "objectSpace": "core.space.Model", - "objectClass": "core.class.Attribute", - "attributes": { - "type": { - "_class": "core.class.TypeString" - }, - "name": "title", - "label": "Title", - "attributeOf": "task.class.Task" - } - }, - { - "_id": "610828bdad975a4e5f24b495", - "objectId": "610828bdad975a4e5f24b496", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669332, - "objectSpace": "core.space.Model", - "objectClass": "core.class.Attribute", - "attributes": { - "type": { - "_class": "core.class.TypeString" - }, - "name": "description", - "label": "Description", - "attributeOf": "task.class.Task" - } - }, - { - "_id": "610828bdad975a4e5f24b497", - "objectId": "610828bdad975a4e5f24b498", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669332, - "objectSpace": "core.space.Model", - "objectClass": "core.class.Attribute", - "attributes": { - "type": { - "_class": "core.class.TypeString" - }, - "name": "assignee", - "label": "Assignee", - "attributeOf": "task.class.Task" - } - }, - { - "_id": "610828bdad975a4e5f24b499", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "task.class.Project", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Space", - "label": "Project", - "icon": "task.icon.Task" - } - }, - { - "_id": "610828bdad975a4e5f24b49a", - "_class": "core.class.TxMixin", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669334, - "objectId": "task.class.Project", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "mixin": "workbench.mixin.SpaceView", - "attributes": { - "view": { - "class": "task.class.Task", - "createItemDialog": "task.component.CreateTask" - } - } - }, - { - "_id": "610828bdad975a4e5f24b49b", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b49c", - "objectClass": "view.class.Viewlet", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "attachTo": "task.class.Task", - "descriptor": "view.viewlet.Table", - "open": "ZX", - "options": { - "lookup": { - "assignee": "contact.class.Person" - } - }, - "config": [ - "title", - "$lookup.assignee" - ] - } - }, - { - "_id": "610828bdad975a4e5f24b49d", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b49e", - "objectClass": "workbench.class.Application", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "label": "task.string.ApplicationLabelTask", - "icon": "task.icon.Task", - "navigatorModel": { - "spaces": [ - { - "label": "task.string.Projects", - "spaceClass": "task.class.Project", - "addSpaceLabel": "task.string.CreateProject", - "createComponent": "task.component.CreateProject" - } - ] - } - } - }, - { - "_id": "610828bdad975a4e5f24b49f", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b4a0", - "objectClass": "task.class.Project", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "name": "demo", - "description": "Demo Project", - "private": false, - "members": [] - } - }, - { - "_id": "610828bdad975a4e5f24b4a1", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "recruit.class.Applicant", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Doc" - } - }, - { - "_id": "610828bdad975a4e5f24b4a2", - "objectId": "610828bdad975a4e5f24b4a3", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669299, - "objectSpace": "core.space.Model", - "objectClass": "core.class.Attribute", - "attributes": { - "type": { - "_class": "core.class.TypeString" - }, - "name": "candidate", - "label": "Candidate", - "attributeOf": "recruit.class.Applicant" - } - }, - { - "_id": "610828bdad975a4e5f24b4a4", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "recruit.class.Candidate", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "contact.class.Person", - "label": "Candidate" - } - }, - { - "_id": "610828bdad975a4e5f24b4a5", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "recruit.class.Candidates", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Space", - "label": "recruit.string.CandidatePools", - "icon": "recruit.icon.RecruitApplication" - } - }, - { - "_id": "610828bdad975a4e5f24b4a6", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "recruit.class.Vacancy", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "kind": 0, - "extends": "core.class.Space", - "label": "recruit.string.Vacancy", - "icon": "recruit.icon.Vacancy" - } - }, - { - "_id": "610828bdad975a4e5f24b4a7", - "_class": "core.class.TxMixin", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669334, - "objectId": "recruit.class.Vacancy", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "mixin": "workbench.mixin.SpaceView", - "attributes": { - "view": { - "class": "recruit.class.Applicant", - "createItemDialog": "recruit.component.CreateApplication" - } - } - }, - { - "_id": "610828bdad975a4e5f24b4a8", - "_class": "core.class.TxMixin", - "space": "core.space.Tx", - "modifiedBy": "core.account.System", - "modifiedOn": 1627924669334, - "objectId": "recruit.class.Candidates", - "objectClass": "core.class.Class", - "objectSpace": "core.space.Model", - "mixin": "workbench.mixin.SpaceView", - "attributes": { - "view": { - "class": "recruit.class.Candidate", - "createItemDialog": "recruit.component.CreateCandidate" - } - } - }, - { - "_id": "610828bdad975a4e5f24b4a9", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b4aa", - "objectClass": "workbench.class.Application", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "label": "recruit.string.RecruitApplication", - "icon": "recruit.icon.RecruitApplication", - "navigatorModel": { - "spaces": [ - { - "label": "recruit.string.Vacancies", - "spaceClass": "recruit.class.Vacancy", - "addSpaceLabel": "recruit.string.CreateVacancy", - "createComponent": "recruit.component.CreateVacancy" - }, - { - "label": "recruit.string.CandidatePools", - "spaceClass": "recruit.class.Candidates", - "addSpaceLabel": "recruit.string.CreateCandidates", - "createComponent": "recruit.component.CreateCandidates" - } - ] - } - } - }, - { - "_id": "610828bdad975a4e5f24b4ab", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "recruit.space.CandidatesPublic", - "objectClass": "recruit.class.Candidates", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "name": "public", - "description": "Public Candidates", - "private": false, - "members": [] - } - }, - { - "_id": "610828bdad975a4e5f24b4ac", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b4ad", - "objectClass": "view.class.Viewlet", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "attachTo": "recruit.class.Candidate", - "descriptor": "view.viewlet.Table", - "open": "recruit.component.EditCandidate", - "config": [ - "", - "email", - "phone", - "city" - ] - } - }, - { - "_id": "610828bdad975a4e5f24b4ae", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b4af", - "objectClass": "view.class.Viewlet", - "objectSpace": "core.space.Model", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "attachTo": "recruit.class.Applicant", - "descriptor": "view.viewlet.Table", - "open": "recruit.component.EditCandidate", - "options": { - "lookup": { - "candidate": "recruit.class.Candidate" - } - }, - "config": [ - "$lookup.candidate", - "$lookup.candidate.email", - "$lookup.candidate.city" - ] - } - }, - { - "_id": "610828bdad975a4e5f24b4b0", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b4b1", - "objectClass": "recruit.class.Candidate", - "objectSpace": "recruit.space.CandidatesPublic", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "firstName": "Andrey", - "lastName": "P.", - "email": "andrey@hc.engineering", - "phone": "+1 646 667 6832", - "city": "Monte Carlo" - } - }, - { - "_id": "610828bdad975a4e5f24b4b2", - "_class": "core.class.TxCreateDoc", - "space": "core.space.Tx", - "objectId": "610828bdad975a4e5f24b4b3", - "objectClass": "recruit.class.Candidate", - "objectSpace": "recruit.space.CandidatesPublic", - "modifiedOn": 1627924669334, - "modifiedBy": "core.account.System", - "attributes": { - "firstName": "Marina", - "lastName": "M.", - "email": "marina@hc.engineering", - "phone": "+1 646 777 3333", - "city": "Los Angeles" - } - } -] \ No newline at end of file diff --git a/dev/prod/package.json b/dev/prod/package.json index 7cb66752b1..4c920c4c5c 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -44,6 +44,8 @@ "@anticrm/login": "~0.6.0", "@anticrm/login-assets": "~0.6.0", "@anticrm/login-resources": "~0.6.0", + "@anticrm/client": "~0.6.0", + "@anticrm/dev-client-resources": "~0.6.0", "@anticrm/workbench": "~0.6.0", "@anticrm/workbench-resources": "~0.6.0" } diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index caf0d536fa..9c95480d27 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -16,7 +16,7 @@ import { addLocation } from '@anticrm/platform' import { loginId } from '@anticrm/login' -// import { clientId } from '@anticrm/client' +import { clientId } from '@anticrm/client' import { workbenchId } from '@anticrm/workbench' // import { chunterId } from '@anticrm/chunter' // import { recruitId } from '@anticrm/recruit' @@ -39,7 +39,7 @@ export function configurePlatform() { // platform.setMetadata(ui.metadata.DefaultApplication, 'workbench') // if (process.env.CLIENT === 'dev') - // addLocation(clientId, () => import(/* webpackChunkName: "client-dev" */ '@anticrm/plugin-client-dev')) + addLocation(clientId, () => import(/* webpackChunkName: "client-dev" */ '@anticrm/dev-client-resources')) // else // addLocation(core, () => import(/* webpackChunkName: "plugin-core" */ '@anticrm/plugin-core-impl')) diff --git a/dev/storage/src/__tests__/storage.test.ts b/dev/storage/src/__tests__/storage.test.ts new file mode 100644 index 0000000000..305b57d7e7 --- /dev/null +++ b/dev/storage/src/__tests__/storage.test.ts @@ -0,0 +1,26 @@ +// +// Copyright © 2020, 2021 Anticrm Platform Contributors. +// Copyright © 2021 Hardcore Engineering Inc. +// +// 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 core from '@anticrm/core' +import { createStorage } from '../storage' + +describe('client', () => { + it('should create storage', async () => { + const storage = await createStorage() + const txes = await storage.findAll(core.class.Tx, {}) + expect(txes.length).toBe(14) + }) +}) diff --git a/dev/storage/src/model.tx.json b/dev/storage/src/model.tx.json index 9e2a9d2fbf..daefb818bb 100644 --- a/dev/storage/src/model.tx.json +++ b/dev/storage/src/model.tx.json @@ -1,25 +1,25 @@ [ { - "_id": "610e1edc40f76c380b4b6cef", + "_id": "610e735f946b3ebe7af501e1", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Obj", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "kind": 0 } }, { - "_id": "610e1edc40f76c380b4b6cf0", + "_id": "610e735f946b3ebe7af501e2", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Doc", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -27,13 +27,13 @@ } }, { - "_id": "610e1edc40f76c380b4b6cf1", + "_id": "610e735f946b3ebe7af501e3", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Type", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -41,13 +41,13 @@ } }, { - "_id": "610e1edc40f76c380b4b6cf2", + "_id": "610e735f946b3ebe7af501e4", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:TypeString", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -55,13 +55,13 @@ } }, { - "_id": "610e1edc40f76c380b4b6cf3", + "_id": "610e735f946b3ebe7af501e5", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Attribute", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "kind": 0, @@ -69,13 +69,13 @@ } }, { - "_id": "610e1edc40f76c380b4b6cf4", + "_id": "610e735f946b3ebe7af501e6", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Account", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "domain": "model", @@ -84,13 +84,13 @@ } }, { - "_id": "610e1edc40f76c380b4b6cf5", + "_id": "610e735f946b3ebe7af501e7", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Space", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "domain": "model", @@ -99,55 +99,13 @@ } }, { - "_id": "610e1edc40f76c380b4b6cf6", - "_class": "core:class:TxCreateDoc", - "space": "core:space:Tx", - "objectId": "core:class:TxUpdateDoc", - "objectClass": "core:class:Class", - "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, - "modifiedBy": "core:account:System", - "attributes": { - "kind": 0, - "extends": "core:class:TxCUD" - } - }, - { - "_id": "610e1edc40f76c380b4b6cf7", - "_class": "core:class:TxCreateDoc", - "space": "core:space:Tx", - "objectId": "core:class:TxMixin", - "objectClass": "core:class:Class", - "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, - "modifiedBy": "core:account:System", - "attributes": { - "kind": 0, - "extends": "core:class:TxCUD" - } - }, - { - "_id": "610e1edc40f76c380b4b6cf8", - "_class": "core:class:TxCreateDoc", - "space": "core:space:Tx", - "objectId": "core:class:TxCreateDoc", - "objectClass": "core:class:Class", - "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, - "modifiedBy": "core:account:System", - "attributes": { - "kind": 0, - "extends": "core:class:TxCUD" - } - }, - { - "_id": "610e1edc40f76c380b4b6cf9", + "_id": "610e735f946b3ebe7af501e8", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Tx", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "domain": "tx", @@ -156,13 +114,69 @@ } }, { - "_id": "610e1edc40f76c380b4b6cfa", + "_id": "610e735f946b3ebe7af501e9", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "core:class:TxCUD", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628336991083, + "modifiedBy": "core:account:System", + "attributes": { + "kind": 0, + "extends": "core:class:Tx" + } + }, + { + "_id": "610e735f946b3ebe7af501ea", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "core:class:TxUpdateDoc", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628336991083, + "modifiedBy": "core:account:System", + "attributes": { + "kind": 0, + "extends": "core:class:TxCUD" + } + }, + { + "_id": "610e735f946b3ebe7af501eb", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "core:class:TxMixin", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628336991083, + "modifiedBy": "core:account:System", + "attributes": { + "kind": 0, + "extends": "core:class:TxCUD" + } + }, + { + "_id": "610e735f946b3ebe7af501ec", + "_class": "core:class:TxCreateDoc", + "space": "core:space:Tx", + "objectId": "core:class:TxCreateDoc", + "objectClass": "core:class:Class", + "objectSpace": "core:space:Model", + "modifiedOn": 1628336991083, + "modifiedBy": "core:account:System", + "attributes": { + "kind": 0, + "extends": "core:class:TxCUD" + } + }, + { + "_id": "610e735f946b3ebe7af501ed", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Class", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "domain": "model", @@ -171,13 +185,13 @@ } }, { - "_id": "610e1edc40f76c380b4b6cfb", + "_id": "610e735f946b3ebe7af501ee", "_class": "core:class:TxCreateDoc", "space": "core:space:Tx", "objectId": "core:class:Mixin", "objectClass": "core:class:Class", "objectSpace": "core:space:Model", - "modifiedOn": 1628315356280, + "modifiedOn": 1628336991083, "modifiedBy": "core:account:System", "attributes": { "kind": 0, diff --git a/models/core/src/index.ts b/models/core/src/index.ts index e73b0ed80e..eee87b277a 100644 --- a/models/core/src/index.ts +++ b/models/core/src/index.ts @@ -17,7 +17,7 @@ import { Builder } from '@anticrm/model' import core from './component' import { TAttribute, TClass, TDoc, TMixin, TObj, TType, TTypeString } from './core' import { TSpace, TAccount } from './security' -import { TTx, TTxCreateDoc, TTxMixin, TTxUpdateDoc } from './tx' +import { TTx, TTxCreateDoc, TTxMixin, TTxUpdateDoc, TTxCUD } from './tx' export * from './core' export * from './security' @@ -31,6 +31,7 @@ export function createModel (builder: Builder): void { TClass, TMixin, TTx, + TTxCUD, TTxCreateDoc, TTxMixin, TTxUpdateDoc, diff --git a/rush.json b/rush.json index 1113ba2881..aa7a3d59bd 100644 --- a/rush.json +++ b/rush.json @@ -26,7 +26,7 @@ * Specify one of: "pnpmVersion", "npmVersion", or "yarnVersion". See the Rush documentation * for details about these alternatives. */ - "pnpmVersion": "6.11.5", + "pnpmVersion": "6.12.0", // "npmVersion": "4.5.0", // "yarnVersion": "1.9.4",