initial workspace contribution

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-08-19 09:36:12 +02:00
parent 5ce8370a63
commit dec3adefeb
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
14 changed files with 1380 additions and 8 deletions

View File

@ -265,3 +265,13 @@ new aws.route53.Record("targetDomain", {
evaluateTargetHealth: true,
}],
})
new aws.route53.Record("databaseRecord", {
name: "db.hc.engineering",
zoneId: zoneId,
type: "CNAME",
ttl: 300,
records: [
"xored.com"
]
})

View File

@ -57,6 +57,7 @@ specifiers:
'@rush-temp/view-resources': file:./projects/view-resources.tgz
'@rush-temp/workbench': file:./projects/workbench.tgz
'@rush-temp/workbench-resources': file:./projects/workbench-resources.tgz
'@rush-temp/workspace': file:./projects/workspace.tgz
'@rushstack/heft': ^0.35.0
'@rushstack/heft-jest-plugin': ~0.1.15
'@tiptap/core': ~2.0.0-beta.93
@ -88,6 +89,7 @@ specifiers:
file-loader: ^6.2.0
intl-messageformat: ^9.7.1
mini-css-extract-plugin: ^2.2.0
mongodb: ^4.1.0
node-html-parser: ^4.1.3
postcss: ^8.3.4
postcss-load-config: ^3.1.0
@ -165,6 +167,7 @@ dependencies:
'@rush-temp/view-resources': file:projects/view-resources.tgz_c38cf1a7a413db8918b0b4754c21e4c5
'@rush-temp/workbench': file:projects/workbench.tgz_6c259fadfeb3a4b20890aefe87070b8b
'@rush-temp/workbench-resources': file:projects/workbench-resources.tgz_c38cf1a7a413db8918b0b4754c21e4c5
'@rush-temp/workspace': file:projects/workspace.tgz_6c259fadfeb3a4b20890aefe87070b8b
'@rushstack/heft': 0.35.0
'@rushstack/heft-jest-plugin': 0.1.15_@rushstack+heft@0.35.0
'@tiptap/core': 2.0.0-beta.93
@ -196,6 +199,7 @@ dependencies:
file-loader: 6.2.0_webpack@5.48.0
intl-messageformat: 9.8.1
mini-css-extract-plugin: 2.2.0_webpack@5.48.0
mongodb: 4.1.0
node-html-parser: 4.1.3
postcss: 8.3.6
postcss-load-config: 3.1.0
@ -7921,10 +7925,40 @@ packages:
webpack: 5.48.0_webpack-cli@4.7.2
dev: false
/ts-node/10.2.0_dea0625f6d31b223e93dc3dc354b8b43:
/ts-node/10.2.0_typescript@4.3.5:
resolution: {integrity: sha512-FstYHtQz6isj8rBtYMN4bZdnXN1vq4HCbqn9vdNQcInRqtB86PePJQIxE6es0PhxKWhj2PHuwbG40H+bxkZPmg==}
engines: {node: '>=12.0.0'}
hasBin: true
peerDependencies:
'@swc/core': '>=1.2.50'
'@swc/wasm': '>=1.2.50'
'@types/node': '*'
typescript: '>=2.7'
peerDependenciesMeta:
'@swc/core':
optional: true
'@swc/wasm':
optional: true
dependencies:
'@cspotcode/source-map-support': 0.6.1
'@tsconfig/node10': 1.0.8
'@tsconfig/node12': 1.0.9
'@tsconfig/node14': 1.0.1
'@tsconfig/node16': 1.0.2
acorn: 8.4.1
acorn-walk: 8.1.1
arg: 4.1.3
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 4.3.5
yn: 3.1.1
dev: false
/ts-node/10.2.1_dea0625f6d31b223e93dc3dc354b8b43:
resolution: {integrity: sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==}
engines: {node: '>=12.0.0'}
hasBin: true
peerDependencies:
'@swc/core': '>=1.2.50'
'@swc/wasm': '>=1.2.50'
@ -7952,8 +7986,8 @@ packages:
yn: 3.1.1
dev: false
/ts-node/10.2.0_typescript@4.3.5:
resolution: {integrity: sha512-FstYHtQz6isj8rBtYMN4bZdnXN1vq4HCbqn9vdNQcInRqtB86PePJQIxE6es0PhxKWhj2PHuwbG40H+bxkZPmg==}
/ts-node/10.2.1_typescript@4.3.5:
resolution: {integrity: sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==}
engines: {node: '>=12.0.0'}
hasBin: true
peerDependencies:
@ -9011,7 +9045,7 @@ packages:
eslint-plugin-import: 2.23.4_eslint@7.32.0
eslint-plugin-node: 11.1.0_eslint@7.32.0
eslint-plugin-promise: 4.3.1
ts-node: 10.2.0_dea0625f6d31b223e93dc3dc354b8b43
ts-node: 10.2.1_dea0625f6d31b223e93dc3dc354b8b43
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
@ -9232,7 +9266,7 @@ packages:
dev: false
file:projects/mongo.tgz_6c259fadfeb3a4b20890aefe87070b8b:
resolution: {integrity: sha512-Md5isVURIKezm/PnDMtKsG8cpMRLnyb5ZC8zCBOGpzpI2q504y1di6tCoc2HTcN9eozPLbVJGB1DN8ZNYJ/8Hw==, tarball: file:projects/mongo.tgz}
resolution: {integrity: sha512-dJ6IHM1JlZuVfPvsg4HN79OwBcDn+F0MLrXPSCe96a/ZfQfe3yw4rCnqZBLQT7+Mqc8UmGQW8aR/YuiGNa9auQ==, tarball: file:projects/mongo.tgz}
id: file:projects/mongo.tgz
name: '@rush-temp/mongo'
version: 0.0.0
@ -9666,7 +9700,7 @@ packages:
eslint-plugin-promise: 4.3.1
express: 4.17.1
express-fileupload: 1.2.1
ts-node: 10.2.0_dea0625f6d31b223e93dc3dc354b8b43
ts-node: 10.2.1_dea0625f6d31b223e93dc3dc354b8b43
uuid: 8.3.2
transitivePeerDependencies:
- '@swc/core'
@ -9763,3 +9797,26 @@ packages:
- supports-color
- typescript
dev: false
file:projects/workspace.tgz_6c259fadfeb3a4b20890aefe87070b8b:
resolution: {integrity: sha512-pWnn59hoagFEU+9zoCfk37thS081NkywXU6pDVWPcrjkHS6HBnWUmyE90XlcJn3zzWgwK7l8tWA37SGQdaPZWw==, tarball: file:projects/workspace.tgz}
id: file:projects/workspace.tgz
name: '@rush-temp/workspace'
version: 0.0.0
dependencies:
'@types/heft-jest': 1.0.2
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
eslint: 7.32.0
eslint-plugin-import: 2.23.4_eslint@7.32.0
eslint-plugin-node: 11.1.0_eslint@7.32.0
eslint-plugin-promise: 4.3.1
mongodb: 4.1.0
ts-node: 10.2.1_typescript@4.3.5
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
- '@types/node'
- '@typescript-eslint/parser'
- supports-color
- typescript
dev: false

View File

@ -4,3 +4,5 @@ ACCOUNTS_URL=/account
UPLOAD_URL=/upload
LOGIN_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InJvc2FtdW5kQGhjLmVuZ2luZWVyaW5nIiwid29ya3NwYWNlIjoid3MxIn0.crxqT7QUkpZiTmmxouB40LpMwK2CfTf76XqPFWIMyic
LOGIN_ENDPOINT=ws://localhost:3333
X=ZfVAdSSnw9myvd70

View File

@ -721,5 +721,10 @@
"projectFolder": "server/mongo",
"shouldPublish": true
},
{
"packageName": "@anticrm/workspace",
"projectFolder": "server/workspace",
"shouldPublish": true
},
]
}

View File

@ -21,6 +21,6 @@
"@anticrm/core": "~0.6.10",
"@anticrm/platform": "~0.6.5",
"@anticrm/server-core": "~0.6.0",
"mongodb": "~4.1.0"
"mongodb": "^4.1.0"
}
}

View File

@ -96,7 +96,7 @@ export async function createStorage (url: string, dbName: string): Promise<Serve
const hierarchy = new Hierarchy()
const triggers = new Triggers(new TxFactory(core.account.System))
const txes = await db.collection(DOMAIN_TX).find<Tx>({}).toArray()
const txes = await db.collection(DOMAIN_TX).find<Tx>({ objectSpace: core.space.Model }).toArray()
for (const tx of txes) {
hierarchy.tx(tx)
await triggers.tx(tx)

View File

@ -0,0 +1,6 @@
module.exports = {
extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'],
parserOptions: {
project: './tsconfig.json'
}
}

View File

@ -0,0 +1,4 @@
*
!/lib/**
!CHANGELOG.md
/lib/**/__tests__/

View File

@ -0,0 +1,18 @@
// The "rig.json" file directs tools to look for their config files in an external package.
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
{
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
/**
* (Required) The name of the rig package to inherit from.
* It should be an NPM package name with the "-rig" suffix.
*/
"rigPackageName": "@anticrm/platform-rig"
/**
* (Optional) Selects a config profile from the rig package. The name must consist of
* lowercase alphanumeric words separated by hyphens, for example "sample-profile".
* If omitted, then the "default" profile will be used."
*/
// "rigProfile": "your-profile-name"
}

View File

@ -0,0 +1,26 @@
{
"name": "@anticrm/workspace",
"version": "0.6.0",
"main": "lib/index.js",
"author": "Anticrm Platform Contributors",
"license": "EPL-2.0",
"scripts": {
"create": "ts-node src/__create.ts",
"build": "heft build",
"lint:fix": "eslint --fix src"
},
"devDependencies": {
"@anticrm/platform-rig":"~0.6.0",
"@types/heft-jest":"^1.0.2",
"@typescript-eslint/eslint-plugin":"4",
"eslint-plugin-import":"2",
"eslint-plugin-promise":"4",
"eslint-plugin-node":"11",
"eslint":"^7.32.0",
"ts-node":"^10.2.1"
},
"dependencies": {
"@anticrm/core": "~0.6.10",
"mongodb": "^4.1.0"
}
}

View File

@ -0,0 +1,36 @@
//
// 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 { createModel } from '.'
const url = process.env.MONGO_URL
if (url === undefined) {
console.error('please provide mongodb url.')
process.exit(1)
}
const db = process.argv[2]
if (db === undefined) {
console.error('Please specify the database.')
process.exit(1)
}
console.log('creating model...')
createModel(url, db).then(rows => {
console.log(`done, ${rows} rows inserted.`)
}).catch(error => { console.error(error) })
// mongodb+srv://dbUser:ZfVAdSSnw9myvd70@cluster0.fyeho.mongodb.net/?retryWrites=true&w=majority

View File

@ -0,0 +1,35 @@
//
// 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 { MongoClient, Document } from 'mongodb'
import { DOMAIN_TX } from '@anticrm/core'
import * as txJson from './model.tx.json'
/**
* @public
*/
export async function createModel (url: string, dbName: string): Promise<number> {
const client = new MongoClient(url)
try {
await client.connect()
const db = client.db(dbName)
const result = await db.collection(DOMAIN_TX).insertMany(txJson as Document[])
return result.insertedCount
} finally {
client.close()
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
{
"extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib"
}
}