mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-09 09:20:54 +00:00
cleanup
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
7e36bb8711
commit
632dddf356
@ -86,6 +86,7 @@ specifiers:
|
|||||||
cross-env: ^7.0.3
|
cross-env: ^7.0.3
|
||||||
css-loader: ^5.2.1
|
css-loader: ^5.2.1
|
||||||
dotenv-webpack: ^7.0.2
|
dotenv-webpack: ^7.0.2
|
||||||
|
esbuild: ^0.12.24
|
||||||
eslint: ^7.32.0
|
eslint: ^7.32.0
|
||||||
eslint-config-standard-with-typescript: ^20.0.0
|
eslint-config-standard-with-typescript: ^20.0.0
|
||||||
eslint-plugin-import: '2'
|
eslint-plugin-import: '2'
|
||||||
@ -96,6 +97,7 @@ specifiers:
|
|||||||
file-loader: ^6.2.0
|
file-loader: ^6.2.0
|
||||||
intl-messageformat: ^9.7.1
|
intl-messageformat: ^9.7.1
|
||||||
mini-css-extract-plugin: ^2.2.0
|
mini-css-extract-plugin: ^2.2.0
|
||||||
|
minio: ^7.0.19
|
||||||
mongodb: ^4.1.0
|
mongodb: ^4.1.0
|
||||||
node-html-parser: ^4.1.3
|
node-html-parser: ^4.1.3
|
||||||
postcss: ^8.3.4
|
postcss: ^8.3.4
|
||||||
@ -202,6 +204,7 @@ dependencies:
|
|||||||
cross-env: 7.0.3
|
cross-env: 7.0.3
|
||||||
css-loader: 5.2.7_webpack@5.48.0
|
css-loader: 5.2.7_webpack@5.48.0
|
||||||
dotenv-webpack: 7.0.3_webpack@5.48.0
|
dotenv-webpack: 7.0.3_webpack@5.48.0
|
||||||
|
esbuild: 0.12.24
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
eslint-config-standard-with-typescript: 20.0.0_2e482f375e273d762fe67cbd5e194b49
|
eslint-config-standard-with-typescript: 20.0.0_2e482f375e273d762fe67cbd5e194b49
|
||||||
eslint-plugin-import: 2.23.4_eslint@7.32.0
|
eslint-plugin-import: 2.23.4_eslint@7.32.0
|
||||||
@ -212,6 +215,7 @@ dependencies:
|
|||||||
file-loader: 6.2.0_webpack@5.48.0
|
file-loader: 6.2.0_webpack@5.48.0
|
||||||
intl-messageformat: 9.8.1
|
intl-messageformat: 9.8.1
|
||||||
mini-css-extract-plugin: 2.2.0_webpack@5.48.0
|
mini-css-extract-plugin: 2.2.0_webpack@5.48.0
|
||||||
|
minio: 7.0.19
|
||||||
mongodb: 4.1.1
|
mongodb: 4.1.1
|
||||||
node-html-parser: 4.1.3
|
node-html-parser: 4.1.3
|
||||||
postcss: 8.3.6
|
postcss: 8.3.6
|
||||||
@ -1508,6 +1512,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A==}
|
resolution: {integrity: sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@types/node/16.7.5:
|
||||||
|
resolution: {integrity: sha512-E7SpxDXoHEpmZ9C1gSqwadhE6zPRtf3g0gJy9Y51DsImnR5TcDs3QEiV/3Q7zOM8LWaZp5Gph71NK6ElVMG1IQ==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@types/normalize-package-data/2.4.1:
|
/@types/normalize-package-data/2.4.1:
|
||||||
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
|
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
|
||||||
dev: false
|
dev: false
|
||||||
@ -8163,6 +8171,37 @@ packages:
|
|||||||
webpack: 5.48.0_webpack-cli@4.7.2
|
webpack: 5.48.0_webpack-cli@4.7.2
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/ts-node/10.2.1_eb14afb1492fcd444e277f1fdb668e87:
|
||||||
|
resolution: {integrity: sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==}
|
||||||
|
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
|
||||||
|
'@types/node': 16.7.5
|
||||||
|
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_f50b86b1778cd2aa4e5405c08bb39559:
|
/ts-node/10.2.1_f50b86b1778cd2aa4e5405c08bb39559:
|
||||||
resolution: {integrity: sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==}
|
resolution: {integrity: sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==}
|
||||||
engines: {node: '>=12.0.0'}
|
engines: {node: '>=12.0.0'}
|
||||||
@ -9797,7 +9836,7 @@ packages:
|
|||||||
version: 0.0.0
|
version: 0.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/heft-jest': 1.0.2
|
'@types/heft-jest': 1.0.2
|
||||||
'@types/node': 16.7.1
|
'@types/node': 16.7.5
|
||||||
'@types/ws': 7.4.7
|
'@types/ws': 7.4.7
|
||||||
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
@ -9817,7 +9856,7 @@ packages:
|
|||||||
version: 0.0.0
|
version: 0.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/heft-jest': 1.0.2
|
'@types/heft-jest': 1.0.2
|
||||||
'@types/node': 16.7.1
|
'@types/node': 16.7.5
|
||||||
'@types/ws': 7.4.7
|
'@types/ws': 7.4.7
|
||||||
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
@ -9837,7 +9876,7 @@ packages:
|
|||||||
version: 0.0.0
|
version: 0.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/heft-jest': 1.0.2
|
'@types/heft-jest': 1.0.2
|
||||||
'@types/node': 16.7.1
|
'@types/node': 16.7.5
|
||||||
'@types/ws': 7.4.7
|
'@types/ws': 7.4.7
|
||||||
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
@ -9862,7 +9901,7 @@ packages:
|
|||||||
version: 0.0.0
|
version: 0.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/heft-jest': 1.0.2
|
'@types/heft-jest': 1.0.2
|
||||||
'@types/node': 16.7.1
|
'@types/node': 16.7.5
|
||||||
'@types/ws': 7.4.7
|
'@types/ws': 7.4.7
|
||||||
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
||||||
esbuild: 0.12.24
|
esbuild: 0.12.24
|
||||||
@ -9870,7 +9909,7 @@ packages:
|
|||||||
eslint-plugin-import: 2.23.4_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-node: 11.1.0_eslint@7.32.0
|
||||||
eslint-plugin-promise: 4.3.1
|
eslint-plugin-promise: 4.3.1
|
||||||
ts-node: 10.2.1_f50b86b1778cd2aa4e5405c08bb39559
|
ts-node: 10.2.1_eb14afb1492fcd444e277f1fdb668e87
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@swc/core'
|
- '@swc/core'
|
||||||
- '@swc/wasm'
|
- '@swc/wasm'
|
||||||
@ -10012,7 +10051,7 @@ packages:
|
|||||||
'@types/express-fileupload': 1.1.7
|
'@types/express-fileupload': 1.1.7
|
||||||
'@types/heft-jest': 1.0.2
|
'@types/heft-jest': 1.0.2
|
||||||
'@types/minio': 7.0.10
|
'@types/minio': 7.0.10
|
||||||
'@types/node': 16.7.1
|
'@types/node': 16.7.5
|
||||||
'@types/uuid': 8.3.1
|
'@types/uuid': 8.3.1
|
||||||
'@types/ws': 7.4.7
|
'@types/ws': 7.4.7
|
||||||
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
||||||
@ -10029,7 +10068,7 @@ packages:
|
|||||||
minio: 7.0.19
|
minio: 7.0.19
|
||||||
mongodb: 4.1.1
|
mongodb: 4.1.1
|
||||||
server-core: 0.1.0
|
server-core: 0.1.0
|
||||||
ts-node: 10.2.1_f50b86b1778cd2aa4e5405c08bb39559
|
ts-node: 10.2.1_eb14afb1492fcd444e277f1fdb668e87
|
||||||
uuid: 8.3.2
|
uuid: 8.3.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@swc/core'
|
- '@swc/core'
|
||||||
@ -10128,14 +10167,14 @@ packages:
|
|||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
file:projects/workspace.tgz_6c259fadfeb3a4b20890aefe87070b8b:
|
file:projects/workspace.tgz_6c259fadfeb3a4b20890aefe87070b8b:
|
||||||
resolution: {integrity: sha512-Du1dJ9lKTjiLDhFbpM6d7IL3XaPksCXlPeaKBG3xz4v2v1odoMjXqMA/fjGnw091khBJi0+QqnsjR7zt2/ROpQ==, tarball: file:projects/workspace.tgz}
|
resolution: {integrity: sha512-xsi1Oqd00ZntGoGAMsxj9vzdN9ff9tEgf//ZmaAH4GqaVT0VF2pzeWwDNlS8cmQR0ECP61Cbu1Jd2Ppyinz8+g==, tarball: file:projects/workspace.tgz}
|
||||||
id: file:projects/workspace.tgz
|
id: file:projects/workspace.tgz
|
||||||
name: '@rush-temp/workspace'
|
name: '@rush-temp/workspace'
|
||||||
version: 0.0.0
|
version: 0.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/heft-jest': 1.0.2
|
'@types/heft-jest': 1.0.2
|
||||||
'@types/minio': 7.0.10
|
'@types/minio': 7.0.10
|
||||||
'@types/node': 16.7.1
|
'@types/node': 16.7.5
|
||||||
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
'@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea
|
||||||
esbuild: 0.12.24
|
esbuild: 0.12.24
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
@ -10145,11 +10184,10 @@ packages:
|
|||||||
jwt-simple: 0.5.6
|
jwt-simple: 0.5.6
|
||||||
minio: 7.0.19
|
minio: 7.0.19
|
||||||
mongodb: 4.1.1
|
mongodb: 4.1.1
|
||||||
ts-node: 10.2.1_typescript@4.3.5
|
ts-node: 10.2.1_eb14afb1492fcd444e277f1fdb668e87
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@swc/core'
|
- '@swc/core'
|
||||||
- '@swc/wasm'
|
- '@swc/wasm'
|
||||||
- '@types/node'
|
|
||||||
- '@typescript-eslint/parser'
|
- '@typescript-eslint/parser'
|
||||||
- supports-color
|
- supports-color
|
||||||
- typescript
|
- typescript
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
ACCOUNTS_URL=https://ftwm71rwag.execute-api.us-west-2.amazonaws.com/stage/
|
ACCOUNTS_URL=https://ftwm71rwag.execute-api.us-west-2.amazonaws.com/stage/
|
||||||
UPLOAD_URL=https://anticrm-upload.herokuapp.com/
|
UPLOAD_URL=https://upload.hc.engineering/
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -18,3 +18,4 @@ import { writeFileSync } from 'fs'
|
|||||||
|
|
||||||
const content = JSON.stringify(builder.getTxes(), undefined, 2)
|
const content = JSON.stringify(builder.getTxes(), undefined, 2)
|
||||||
writeFileSync('../../dev/storage/src/model.tx.json', content)
|
writeFileSync('../../dev/storage/src/model.tx.json', content)
|
||||||
|
writeFileSync('../../server/workspace/src/model.tx.json', content)
|
||||||
|
@ -18,7 +18,7 @@ import { Builder, Model, Prop, UX, TypeString, Index } from '@anticrm/model'
|
|||||||
import type { Ref, Doc, Class, Domain } from '@anticrm/core'
|
import type { Ref, Doc, Class, Domain } from '@anticrm/core'
|
||||||
import { IndexKind } from '@anticrm/core'
|
import { IndexKind } from '@anticrm/core'
|
||||||
import core, { TSpace, TDoc } from '@anticrm/model-core'
|
import core, { TSpace, TDoc } from '@anticrm/model-core'
|
||||||
import type { Backlink, Channel, Message, Comment } from '@anticrm/chunter'
|
import type { Backlink, Channel, Message, Comment, Attachment } from '@anticrm/chunter'
|
||||||
import type { AnyComponent } from '@anticrm/ui'
|
import type { AnyComponent } from '@anticrm/ui'
|
||||||
|
|
||||||
import workbench from '@anticrm/model-workbench'
|
import workbench from '@anticrm/model-workbench'
|
||||||
@ -28,6 +28,7 @@ import chunter from './plugin'
|
|||||||
|
|
||||||
export const DOMAIN_CHUNTER = 'chunter' as Domain
|
export const DOMAIN_CHUNTER = 'chunter' as Domain
|
||||||
export const DOMAIN_COMMENT = 'comment' as Domain
|
export const DOMAIN_COMMENT = 'comment' as Domain
|
||||||
|
export const DOMAIN_ATTACHMENT = 'attachment' as Domain
|
||||||
|
|
||||||
@Model(chunter.class.Channel, core.class.Space)
|
@Model(chunter.class.Channel, core.class.Space)
|
||||||
@UX(chunter.string.Channel, chunter.icon.Hashtag)
|
@UX(chunter.string.Channel, chunter.icon.Hashtag)
|
||||||
@ -52,8 +53,16 @@ export class TBacklink extends TComment implements Backlink {
|
|||||||
backlinkClass!: Ref<Class<Doc>>
|
backlinkClass!: Ref<Class<Doc>>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Model(chunter.class.Attachment, core.class.Doc, DOMAIN_ATTACHMENT)
|
||||||
|
export class TAttachment extends TDoc implements Attachment {
|
||||||
|
attachmentTo!: Ref<Doc>
|
||||||
|
collection!: string
|
||||||
|
name!: string
|
||||||
|
file!: string
|
||||||
|
}
|
||||||
|
|
||||||
export function createModel (builder: Builder): void {
|
export function createModel (builder: Builder): void {
|
||||||
builder.createModel(TChannel, TMessage, TComment, TBacklink)
|
builder.createModel(TChannel, TMessage, TComment, TBacklink, TAttachment)
|
||||||
builder.mixin(chunter.class.Channel, core.class.Class, workbench.mixin.SpaceView, {
|
builder.mixin(chunter.class.Channel, core.class.Class, workbench.mixin.SpaceView, {
|
||||||
view: {
|
view: {
|
||||||
class: chunter.class.Message
|
class: chunter.class.Message
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getMetadata } from '@anticrm/platform'
|
import { getMetadata } from '@anticrm/platform'
|
||||||
import login from '@anticrm/login'
|
import login from '@anticrm/login'
|
||||||
|
import { createQuery } from '@anticrm/presentation'
|
||||||
|
|
||||||
import { EditBox, Button, CircleButton, Grid, Label } from '@anticrm/ui'
|
import { EditBox, Button, CircleButton, Grid, Label } from '@anticrm/ui'
|
||||||
import FileUpload from './icons/FileUpload.svelte'
|
import FileUpload from './icons/FileUpload.svelte'
|
||||||
@ -24,6 +25,12 @@
|
|||||||
import Twitter from './icons/Twitter.svelte'
|
import Twitter from './icons/Twitter.svelte'
|
||||||
import User from './icons/User.svelte'
|
import User from './icons/User.svelte'
|
||||||
|
|
||||||
|
import chunter from '@anticrm/chunter'
|
||||||
|
|
||||||
|
const query = createQuery()
|
||||||
|
|
||||||
|
$: query.query(chunter.class.Attachment, {}, result => { console.log('attachments', result) })
|
||||||
|
|
||||||
let dragover = false
|
let dragover = false
|
||||||
let loading = false
|
let loading = false
|
||||||
|
|
||||||
|
20
server/front/build.sh
Executable file
20
server/front/build.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
rushx bundle
|
||||||
|
rushx docker:build
|
||||||
|
rushx docker:push
|
@ -7,7 +7,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "heft build",
|
"build": "heft build",
|
||||||
"lint:fix": "eslint --fix src",
|
"lint:fix": "eslint --fix src",
|
||||||
"bundle": "esbuild src/index.ts --bundle --minify --platform=node > bundle.js & cp -r ../../dev/prod/dist . & cp -r ../../dev/prod/public/* ./dist/",
|
"bundle": "esbuild src/index.ts --bundle --minify --platform=node > bundle.js & rm -rf ./dist && cp -r ../../dev/prod/dist . && cp -r ../../dev/prod/public/* ./dist/",
|
||||||
"docker:build": "docker build -t anticrm/front .",
|
"docker:build": "docker build -t anticrm/front .",
|
||||||
"docker:push": "docker push anticrm/front"
|
"docker:push": "docker push anticrm/front"
|
||||||
},
|
},
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import fileUpload, { UploadedFile } from 'express-fileupload'
|
import fileUpload, { UploadedFile } from 'express-fileupload'
|
||||||
import cors from 'cors'
|
import cors from 'cors'
|
||||||
import { S3 } from 'aws-sdk'
|
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
import { decode } from 'jwt-simple'
|
import { decode } from 'jwt-simple'
|
||||||
|
|
||||||
@ -31,21 +30,21 @@ import { Client } from 'minio'
|
|||||||
|
|
||||||
// import { createElasticAdapter } from '@anticrm/elastic'
|
// import { createElasticAdapter } from '@anticrm/elastic'
|
||||||
|
|
||||||
const BUCKET = 'anticrm-upload-9e4e89c'
|
// const BUCKET = 'anticrm-upload-9e4e89c'
|
||||||
|
|
||||||
async function awsUpload (file: UploadedFile): Promise<string> {
|
// async function awsUpload (file: UploadedFile): Promise<string> {
|
||||||
const id = uuid()
|
// const id = uuid()
|
||||||
const s3 = new S3()
|
// const s3 = new S3()
|
||||||
const resp = await s3.upload({
|
// const resp = await s3.upload({
|
||||||
Bucket: BUCKET,
|
// Bucket: BUCKET,
|
||||||
Key: id,
|
// Key: id,
|
||||||
Body: file.data,
|
// Body: file.data,
|
||||||
ContentType: file.mimetype,
|
// ContentType: file.mimetype,
|
||||||
ACL: 'public-read'
|
// ACL: 'public-read'
|
||||||
}).promise()
|
// }).promise()
|
||||||
console.log(resp)
|
// console.log(resp)
|
||||||
return id
|
// return id
|
||||||
}
|
// }
|
||||||
|
|
||||||
async function minioUpload (minio: Client, workspace: string, file: UploadedFile): Promise<string> {
|
async function minioUpload (minio: Client, workspace: string, file: UploadedFile): Promise<string> {
|
||||||
const id = uuid()
|
const id = uuid()
|
||||||
|
20
server/workspace/build.sh
Executable file
20
server/workspace/build.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
rushx bundle
|
||||||
|
rushx docker:build
|
||||||
|
rushx docker:push
|
@ -21,14 +21,15 @@
|
|||||||
"eslint-plugin-node":"11",
|
"eslint-plugin-node":"11",
|
||||||
"eslint":"^7.32.0",
|
"eslint":"^7.32.0",
|
||||||
"ts-node":"^10.2.1",
|
"ts-node":"^10.2.1",
|
||||||
"esbuild":"~0.12.24",
|
"esbuild":"^0.12.24",
|
||||||
"@types/minio":"~7.0.10"
|
"@types/minio":"^7.0.10",
|
||||||
|
"@types/node":"^16.7.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anticrm/core": "~0.6.11",
|
"@anticrm/core": "~0.6.11",
|
||||||
"mongodb": "^4.1.0",
|
"mongodb": "^4.1.0",
|
||||||
"@anticrm/contrib": "~0.6.0",
|
"@anticrm/contrib": "~0.6.0",
|
||||||
"jwt-simple": "~0.5.6",
|
"jwt-simple": "^0.5.6",
|
||||||
"minio": "~7.0.19"
|
"minio": "^7.0.19"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,5 +63,5 @@ const minio = new Client({
|
|||||||
|
|
||||||
console.log('creating model...')
|
console.log('creating model...')
|
||||||
createWorkspace(mongoUrl, db, transactorUrl, minio).then(() => {
|
createWorkspace(mongoUrl, db, transactorUrl, minio).then(() => {
|
||||||
console.log(`done.`)
|
console.log('done.')
|
||||||
}).catch(error => { console.error(error) })
|
}).catch(error => { console.error(error) })
|
||||||
|
@ -32,15 +32,15 @@ export async function createWorkspace (mongoUrl: string, dbName: string, clientU
|
|||||||
try {
|
try {
|
||||||
await client.connect()
|
await client.connect()
|
||||||
const db = client.db(dbName)
|
const db = client.db(dbName)
|
||||||
|
|
||||||
console.log('dropping database...')
|
console.log('dropping database...')
|
||||||
await db.dropDatabase()
|
await db.dropDatabase()
|
||||||
|
|
||||||
console.log('creating model...')
|
console.log('creating model...')
|
||||||
const model = txes.filter(tx => tx.objectSpace === core.space.Model)
|
const model = txes.filter(tx => tx.objectSpace === core.space.Model)
|
||||||
const result = await db.collection(DOMAIN_TX).insertMany(model as Document[])
|
const result = await db.collection(DOMAIN_TX).insertMany(model as Document[])
|
||||||
console.log(`${result.insertedCount} model transactions inserted.`)
|
console.log(`${result.insertedCount} model transactions inserted.`)
|
||||||
|
|
||||||
console.log('creating data...')
|
console.log('creating data...')
|
||||||
const data = txes.filter(tx => tx.objectSpace !== core.space.Model)
|
const data = txes.filter(tx => tx.objectSpace !== core.space.Model)
|
||||||
const token = encode({ email: 'anticrm@hc.engineering', workspace: dbName }, 'secret')
|
const token = encode({ email: 'anticrm@hc.engineering', workspace: dbName }, 'secret')
|
||||||
@ -52,7 +52,7 @@ export async function createWorkspace (mongoUrl: string, dbName: string, clientU
|
|||||||
contrib.close()
|
contrib.close()
|
||||||
|
|
||||||
console.log('create minio bucket')
|
console.log('create minio bucket')
|
||||||
await minio.makeBucket(dbName, 'k8s')
|
if (!await minio.bucketExists(dbName)) { await minio.makeBucket(dbName, 'k8s') }
|
||||||
} finally {
|
} finally {
|
||||||
await client.close()
|
await client.close()
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./lib"
|
"outDir": "./lib",
|
||||||
|
"esModuleInterop": true
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user