mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
fix model-core
and some tests
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
825ade52f7
commit
af0a69db1b
@ -20,12 +20,12 @@ describe('client', () => {
|
|||||||
it('should create connection', async () => {
|
it('should create connection', async () => {
|
||||||
const conn = await connect(() => {})
|
const conn = await connect(() => {})
|
||||||
const txes = await conn.findAll(core.class.Tx, {})
|
const txes = await conn.findAll(core.class.Tx, {})
|
||||||
expect(txes.length).toBe(25)
|
expect(txes.length).toBe(14)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should create client', async () => {
|
it('should create client', async () => {
|
||||||
const client = await createClient(connect)
|
const client = await createClient(connect)
|
||||||
const txes = await client.findAll(core.class.Class, {})
|
const txes = await client.findAll(core.class.Class, {})
|
||||||
expect(txes.length).toBe(18)
|
expect(txes.length).toBe(14)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -44,6 +44,8 @@
|
|||||||
"@anticrm/login": "~0.6.0",
|
"@anticrm/login": "~0.6.0",
|
||||||
"@anticrm/login-assets": "~0.6.0",
|
"@anticrm/login-assets": "~0.6.0",
|
||||||
"@anticrm/login-resources": "~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": "~0.6.0",
|
||||||
"@anticrm/workbench-resources": "~0.6.0"
|
"@anticrm/workbench-resources": "~0.6.0"
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
import { addLocation } from '@anticrm/platform'
|
import { addLocation } from '@anticrm/platform'
|
||||||
|
|
||||||
import { loginId } from '@anticrm/login'
|
import { loginId } from '@anticrm/login'
|
||||||
// import { clientId } from '@anticrm/client'
|
import { clientId } from '@anticrm/client'
|
||||||
import { workbenchId } from '@anticrm/workbench'
|
import { workbenchId } from '@anticrm/workbench'
|
||||||
// import { chunterId } from '@anticrm/chunter'
|
// import { chunterId } from '@anticrm/chunter'
|
||||||
// import { recruitId } from '@anticrm/recruit'
|
// import { recruitId } from '@anticrm/recruit'
|
||||||
@ -39,7 +39,7 @@ export function configurePlatform() {
|
|||||||
// platform.setMetadata(ui.metadata.DefaultApplication, 'workbench')
|
// platform.setMetadata(ui.metadata.DefaultApplication, 'workbench')
|
||||||
|
|
||||||
// if (process.env.CLIENT === 'dev')
|
// 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
|
// else
|
||||||
// addLocation(core, () => import(/* webpackChunkName: "plugin-core" */ '@anticrm/plugin-core-impl'))
|
// addLocation(core, () => import(/* webpackChunkName: "plugin-core" */ '@anticrm/plugin-core-impl'))
|
||||||
|
|
||||||
|
26
dev/storage/src/__tests__/storage.test.ts
Normal file
26
dev/storage/src/__tests__/storage.test.ts
Normal file
@ -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)
|
||||||
|
})
|
||||||
|
})
|
@ -1,25 +1,25 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"_id": "610e1edc40f76c380b4b6cef",
|
"_id": "610e735f946b3ebe7af501e1",
|
||||||
"_class": "core:class:TxCreateDoc",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:Obj",
|
"objectId": "core:class:Obj",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"kind": 0
|
"kind": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "610e1edc40f76c380b4b6cf0",
|
"_id": "610e735f946b3ebe7af501e2",
|
||||||
"_class": "core:class:TxCreateDoc",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:Doc",
|
"objectId": "core:class:Doc",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"kind": 0,
|
"kind": 0,
|
||||||
@ -27,13 +27,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "610e1edc40f76c380b4b6cf1",
|
"_id": "610e735f946b3ebe7af501e3",
|
||||||
"_class": "core:class:TxCreateDoc",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:Type",
|
"objectId": "core:class:Type",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"kind": 0,
|
"kind": 0,
|
||||||
@ -41,13 +41,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "610e1edc40f76c380b4b6cf2",
|
"_id": "610e735f946b3ebe7af501e4",
|
||||||
"_class": "core:class:TxCreateDoc",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:TypeString",
|
"objectId": "core:class:TypeString",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"kind": 0,
|
"kind": 0,
|
||||||
@ -55,13 +55,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "610e1edc40f76c380b4b6cf3",
|
"_id": "610e735f946b3ebe7af501e5",
|
||||||
"_class": "core:class:TxCreateDoc",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:Attribute",
|
"objectId": "core:class:Attribute",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"kind": 0,
|
"kind": 0,
|
||||||
@ -69,13 +69,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "610e1edc40f76c380b4b6cf4",
|
"_id": "610e735f946b3ebe7af501e6",
|
||||||
"_class": "core:class:TxCreateDoc",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:Account",
|
"objectId": "core:class:Account",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"domain": "model",
|
"domain": "model",
|
||||||
@ -84,13 +84,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "610e1edc40f76c380b4b6cf5",
|
"_id": "610e735f946b3ebe7af501e7",
|
||||||
"_class": "core:class:TxCreateDoc",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:Space",
|
"objectId": "core:class:Space",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"domain": "model",
|
"domain": "model",
|
||||||
@ -99,55 +99,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "610e1edc40f76c380b4b6cf6",
|
"_id": "610e735f946b3ebe7af501e8",
|
||||||
"_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",
|
|
||||||
"_class": "core:class:TxCreateDoc",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:Tx",
|
"objectId": "core:class:Tx",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"domain": "tx",
|
"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",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:Class",
|
"objectId": "core:class:Class",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"domain": "model",
|
"domain": "model",
|
||||||
@ -171,13 +185,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "610e1edc40f76c380b4b6cfb",
|
"_id": "610e735f946b3ebe7af501ee",
|
||||||
"_class": "core:class:TxCreateDoc",
|
"_class": "core:class:TxCreateDoc",
|
||||||
"space": "core:space:Tx",
|
"space": "core:space:Tx",
|
||||||
"objectId": "core:class:Mixin",
|
"objectId": "core:class:Mixin",
|
||||||
"objectClass": "core:class:Class",
|
"objectClass": "core:class:Class",
|
||||||
"objectSpace": "core:space:Model",
|
"objectSpace": "core:space:Model",
|
||||||
"modifiedOn": 1628315356280,
|
"modifiedOn": 1628336991083,
|
||||||
"modifiedBy": "core:account:System",
|
"modifiedBy": "core:account:System",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"kind": 0,
|
"kind": 0,
|
||||||
|
@ -17,7 +17,7 @@ import { Builder } from '@anticrm/model'
|
|||||||
import core from './component'
|
import core from './component'
|
||||||
import { TAttribute, TClass, TDoc, TMixin, TObj, TType, TTypeString } from './core'
|
import { TAttribute, TClass, TDoc, TMixin, TObj, TType, TTypeString } from './core'
|
||||||
import { TSpace, TAccount } from './security'
|
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 './core'
|
||||||
export * from './security'
|
export * from './security'
|
||||||
@ -31,6 +31,7 @@ export function createModel (builder: Builder): void {
|
|||||||
TClass,
|
TClass,
|
||||||
TMixin,
|
TMixin,
|
||||||
TTx,
|
TTx,
|
||||||
|
TTxCUD,
|
||||||
TTxCreateDoc,
|
TTxCreateDoc,
|
||||||
TTxMixin,
|
TTxMixin,
|
||||||
TTxUpdateDoc,
|
TTxUpdateDoc,
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* Specify one of: "pnpmVersion", "npmVersion", or "yarnVersion". See the Rush documentation
|
* Specify one of: "pnpmVersion", "npmVersion", or "yarnVersion". See the Rush documentation
|
||||||
* for details about these alternatives.
|
* for details about these alternatives.
|
||||||
*/
|
*/
|
||||||
"pnpmVersion": "6.11.5",
|
"pnpmVersion": "6.12.0",
|
||||||
|
|
||||||
// "npmVersion": "4.5.0",
|
// "npmVersion": "4.5.0",
|
||||||
// "yarnVersion": "1.9.4",
|
// "yarnVersion": "1.9.4",
|
||||||
|
Loading…
Reference in New Issue
Block a user