Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
496 changes: 305 additions & 191 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
"electron-updater": "^6.3.4",
"livekit-client": "^2.15.6",
"@hcengineering/server-backup": "^0.7.0",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-types": "^0.7.3",
"ws": "^8.18.2"
},
"productName": "Huly Desktop",
Expand Down
2 changes: 1 addition & 1 deletion dev/doc-import-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@hcengineering/core": "^0.7.3",
"@hcengineering/platform": "^0.7.3",
"@hcengineering/server-core": "^0.7.0",
"@hcengineering/server-storage": "^0.7.0",
"@hcengineering/server-storage": "^0.7.1",
"@hcengineering/server-token": "^0.7.0",
"@hcengineering/server-tool": "^0.7.0",
"@hcengineering/server-client": "^0.7.0",
Expand Down
1 change: 1 addition & 0 deletions dev/prod/public/config-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"PUBLIC_SCHEDULE_URL": "https://schedule.hc.engineering",
"CALDAV_SERVER_URL": "https://caldav.hc.engineering",
"BACKUP_URL": "https://front.hc.engineering/api/backup",
"HULYLAKE_URL": "https://lake.hc.engineering",
"PULSE_URL": "wss://pulse.hc.engineering/ws",
"COMMUNICATION_API_ENABLED": "true",
"FILES_URL": "https://datalake.hc.engineering/blob/:workspace/:blobId/:filename"
Expand Down
6 changes: 3 additions & 3 deletions dev/tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"@hcengineering/server-collaboration-resources": "^0.7.0",
"@hcengineering/server-backup": "^0.7.0",
"@hcengineering/backup-service": "^0.7.0",
"@hcengineering/server-storage": "^0.7.0",
"@hcengineering/server-storage": "^0.7.1",
"@hcengineering/server-calendar": "^0.7.0",
"@hcengineering/server-calendar-resources": "^0.7.0",
"@hcengineering/server-card": "^0.7.0",
Expand Down Expand Up @@ -182,7 +182,7 @@
"@hcengineering/kafka": "^0.7.0",
"@hcengineering/api-client": "^0.7.3",
"@faker-js/faker": "^8.4.1",
"@hcengineering/hulylake-client": "^0.7.3",
"@hcengineering/communication-types": "^0.7.2"
"@hcengineering/hulylake-client": "^0.7.4",
"@hcengineering/communication-types": "^0.7.3"
}
}
14 changes: 9 additions & 5 deletions dev/tool/src/communication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// limitations under the License.

import { type Workspace } from '@hcengineering/account'
import { type HulylakeClient, type JsonPatch } from '@hcengineering/hulylake-client'
import { type HulylakeWorkspaceClient, type JsonPatch } from '@hcengineering/hulylake-client'
import type postgres from 'postgres'
import {
generateUuid,
Expand Down Expand Up @@ -60,7 +60,7 @@ export async function migrateWorkspaceMessages (
ws: Workspace,
card: CardID | undefined,
db: postgres.Sql,
hulylake: HulylakeClient,
hulylake: HulylakeWorkspaceClient,
accountClient: AccountClient,
personUuidBySocialId: Map<PersonId, PersonUuid>
): Promise<void> {
Expand All @@ -72,7 +72,7 @@ async function migrateMessages (
ws: Workspace,
card: CardID | undefined,
db: postgres.Sql,
hulylake: HulylakeClient,
hulylake: HulylakeWorkspaceClient,
accountClient: AccountClient,
personUuidBySocialId: Map<PersonId, PersonUuid>
): Promise<void> {
Expand Down Expand Up @@ -105,7 +105,7 @@ async function migrateMessages (
async function migrateMessagesBatch (
ctx: MeasureContext,
cardId: CardID,
hulylake: HulylakeClient,
hulylake: HulylakeWorkspaceClient,
accountClient: AccountClient,
personUuidBySocialId: Map<PersonId, PersonUuid>,
messages: OldMessage[]
Expand Down Expand Up @@ -161,7 +161,11 @@ async function migrateMessagesBatch (
}
}

async function getGroups (ctx: MeasureContext, hulylake: HulylakeClient, cardId: CardID): Promise<MessagesGroup[]> {
async function getGroups (
ctx: MeasureContext,
hulylake: HulylakeWorkspaceClient,
cardId: CardID
): Promise<MessagesGroup[]> {
const res = await hulylake.getJson<MessagesGroupsDoc>(`${cardId}/messages/groups`, {
maxRetries: 3,
isRetryable: () => true,
Expand Down
2 changes: 1 addition & 1 deletion dev/tool/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import {
type Account as OldAccount,
type Workspace as OldWorkspace
} from '@hcengineering/account-service'
import { getClient as getHulylakeClient } from '@hcengineering/hulylake-client'
import { getWorkspaceClient as getHulylakeClient } from '@hcengineering/hulylake-client'
import {
getDBClient,
createPostgreeDestroyAdapter,
Expand Down
2 changes: 1 addition & 1 deletion models/communication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@hcengineering/card": "^0.7.0",
"@hcengineering/communication": "^0.7.0",
"@hcengineering/communication-resources": "^0.7.0",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-types": "^0.7.3",
"@hcengineering/contact": "^0.7.0",
"@hcengineering/core": "^0.7.3",
"@hcengineering/model": "^0.7.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/presentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
"@hcengineering/client": "^0.7.3",
"@hcengineering/contact": "^0.7.0",
"@hcengineering/collaborator-client": "^0.7.3",
"@hcengineering/communication-client-query": "^0.7.2",
"@hcengineering/communication-sdk-types": "^0.7.2",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-shared": "^0.7.2",
"@hcengineering/communication-client-query": "^0.7.3",
"@hcengineering/communication-sdk-types": "^0.7.3",
"@hcengineering/communication-types": "^0.7.3",
"@hcengineering/communication-shared": "^0.7.3",
"@hcengineering/core": "^0.7.3",
"@hcengineering/diffview": "^0.7.0",
"@hcengineering/notification": "^0.7.0",
Expand All @@ -62,7 +62,7 @@
"@hcengineering/emoji": "^0.7.0",
"@hcengineering/theme": "^0.7.0",
"@hcengineering/retry": "^0.7.3",
"@hcengineering/hulylake-client": "^0.7.3",
"@hcengineering/hulylake-client": "^0.7.4",
"@hcengineering/hulypulse-client": "^0.7.0",
"fast-equals": "^5.2.2",
"png-chunks-extract": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/presentation/src/communication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ import { addNotification, NotificationSeverity, languageStore } from '@hcenginee
import { getMetadata, translate } from '@hcengineering/platform'
import view from '@hcengineering/view'
import { get } from 'svelte/store'
import { getClient as getHulylakeClient } from '@hcengineering/hulylake-client'
import { getWorkspaceClient as getHulylakeClient } from '@hcengineering/hulylake-client'
import { v4 as uuid } from 'uuid'

import { getCurrentWorkspaceUuid } from './file'
Expand Down
2 changes: 1 addition & 1 deletion plugins/activity-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@hcengineering/ui": "^0.7.0",
"@hcengineering/view": "^0.7.0",
"@hcengineering/view-resources": "^0.7.0",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-types": "^0.7.3",
"@hcengineering/emoji": "^0.7.0",
"@hcengineering/emoji-resources": "^0.7.0",
"svelte": "^4.2.20"
Expand Down
2 changes: 1 addition & 1 deletion plugins/card-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"@hcengineering/presence": "^0.7.0",
"@hcengineering/presentation": "^0.7.0",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-types": "^0.7.3",
"@hcengineering/communication-resources": "^0.7.0",
"@hcengineering/core": "^0.7.3",
"@hcengineering/ui": "^0.7.0",
Expand Down
4 changes: 2 additions & 2 deletions plugins/chat-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@hcengineering/card": "^0.7.0",
"@hcengineering/card-resources": "^0.7.0",
"@hcengineering/chat": "^0.7.0",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-types": "^0.7.3",
"@hcengineering/communication": "^0.7.0",
"@hcengineering/contact": "^0.7.0",
"@hcengineering/contact-resources": "^0.7.0",
Expand All @@ -55,7 +55,7 @@
"@hcengineering/workbench": "^0.7.0",
"@hcengineering/workbench-resources": "^0.7.0",
"@hcengineering/communication-resources": "^0.7.0",
"@hcengineering/communication-shared": "^0.7.2",
"@hcengineering/communication-shared": "^0.7.3",
"@hcengineering/rank": "^0.7.3",
"@hcengineering/text": "^0.7.3",
"@hcengineering/text-markdown": "^0.7.3",
Expand Down
4 changes: 2 additions & 2 deletions plugins/client-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"dependencies": {
"@hcengineering/analytics": "^0.7.3",
"@hcengineering/client": "^0.7.3",
"@hcengineering/communication-sdk-types": "^0.7.2",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-sdk-types": "^0.7.3",
"@hcengineering/communication-types": "^0.7.3",
"@hcengineering/core": "^0.7.3",
"@hcengineering/platform": "^0.7.3",
"@hcengineering/rpc": "^0.7.3",
Expand Down
4 changes: 2 additions & 2 deletions plugins/communication-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"@hcengineering/card": "^0.7.0",
"@hcengineering/chat": "^0.7.0",
"@hcengineering/communication": "^0.7.0",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-shared": "^0.7.2",
"@hcengineering/communication-types": "^0.7.3",
"@hcengineering/communication-shared": "^0.7.3",
"@hcengineering/contact": "^0.7.0",
"@hcengineering/contact-resources": "^0.7.0",
"@hcengineering/core": "^0.7.3",
Expand Down
2 changes: 1 addition & 1 deletion plugins/communication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"@hcengineering/platform": "^0.7.3",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-types": "^0.7.3",
"@hcengineering/core": "^0.7.3",
"@hcengineering/contact": "^0.7.0",
"@hcengineering/ui": "^0.7.0",
Expand Down
2 changes: 1 addition & 1 deletion pods/external/services.d/hulylake.service
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hulylake hardcoreeng/service_hulylake:0.1.12
hulylake hardcoreeng/service_hulylake:0.1.13
8 changes: 4 additions & 4 deletions pods/fulltext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@
"@hcengineering/server-collaboration": "^0.7.0",
"@hcengineering/middleware": "^0.7.1",
"@hcengineering/server-client": "^0.7.0",
"@hcengineering/server-storage": "^0.7.0",
"@hcengineering/server-storage": "^0.7.1",
"@hcengineering/postgres": "^0.7.0",
"@hcengineering/mongo": "^0.7.0",
"@hcengineering/kafka": "^0.7.0",
"@hcengineering/communication-server": "^0.7.2",
"@hcengineering/communication-sdk-types": "^0.7.2",
"@hcengineering/hulylake-client": "^0.7.3"
"@hcengineering/communication-server": "^0.7.3",
"@hcengineering/communication-sdk-types": "^0.7.3",
"@hcengineering/hulylake-client": "^0.7.4"
}
}
2 changes: 1 addition & 1 deletion pods/fulltext/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
import { type QueueSourced, type FulltextDBConfiguration } from '@hcengineering/server-indexer'
import { generateToken } from '@hcengineering/server-token'
import { type Event } from '@hcengineering/communication-sdk-types'
import { getClient as getHulylakeClient } from '@hcengineering/hulylake-client'
import { getWorkspaceClient as getHulylakeClient } from '@hcengineering/hulylake-client'

import { WorkspaceIndexer } from './workspace'

Expand Down
4 changes: 2 additions & 2 deletions pods/fulltext/src/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import core, {
WorkspaceEvent,
type WorkspaceIds
} from '@hcengineering/core'
import { type HulylakeClient } from '@hcengineering/hulylake-client'
import { type HulylakeWorkspaceClient } from '@hcengineering/hulylake-client'
import {
ContextNameMiddleware,
DBAdapterInitMiddleware,
Expand Down Expand Up @@ -62,7 +62,7 @@ export class WorkspaceIndexer {
externalStorage: StorageAdapter,
ftadapter: FullTextAdapter,
contentAdapter: ContentTextAdapter,
hulylake: HulylakeClient,
hulylake: HulylakeWorkspaceClient,
endpointProvider: (token: string) => Promise<string | undefined>,
listener?: FulltextListener
): Promise<WorkspaceIndexer> {
Expand Down
6 changes: 3 additions & 3 deletions pods/media/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
"@hcengineering/api-client": "^0.7.3",
"@hcengineering/server-client": "^0.7.0",
"@hcengineering/server-core": "^0.7.0",
"@hcengineering/server-storage": "^0.7.0",
"@hcengineering/server-storage": "^0.7.1",
"@hcengineering/server-token": "^0.7.0",
"@hcengineering/attachment": "^0.7.0",
"@hcengineering/drive": "^0.7.0",
"@hcengineering/communication-types": "^0.7.2",
"@hcengineering/communication-sdk-types": "^0.7.2",
"@hcengineering/communication-types": "^0.7.3",
"@hcengineering/communication-sdk-types": "^0.7.3",
"dotenv": "~16.0.0",
"kafkajs": "^2.2.4"
}
Expand Down
2 changes: 1 addition & 1 deletion pods/preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@hcengineering/analytics-service": "^0.7.3",
"@hcengineering/analytics": "^0.7.3",
"@hcengineering/server-client": "^0.7.0",
"@hcengineering/server-storage": "^0.7.0",
"@hcengineering/server-storage": "^0.7.1",
"@hcengineering/server-token": "^0.7.0",
"sharp": "~0.34.3",
"blurhash": "^2.0.5",
Expand Down
37 changes: 37 additions & 0 deletions pods/preview/src/providers/octet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// Copyright © 2025 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 { type MeasureContext, type WorkspaceUuid } from '@hcengineering/core'

import { type PreviewFile, type PreviewMetadata, type PreviewProvider } from '../types'

export class OctetStreamProvider implements PreviewProvider {
supports (contentType: string): boolean {
return contentType === 'application/octet-stream'
}

async image (ctx: MeasureContext, workspace: WorkspaceUuid, name: string, contentType: string): Promise<PreviewFile> {
throw new Error('Cannot generate image preview for application/octet-stream')
}

async metadata (
ctx: MeasureContext,
workspace: WorkspaceUuid,
name: string,
contentType: string
): Promise<PreviewMetadata> {
return {}
}
}
10 changes: 7 additions & 3 deletions pods/preview/src/providers/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@
// limitations under the License.
//

import { type MeasureContext, type WorkspaceUuid } from '@hcengineering/core'
import { systemAccountUuid, type MeasureContext, type WorkspaceUuid } from '@hcengineering/core'
import { StorageAdapter } from '@hcengineering/server-core'
import { generateToken } from '@hcengineering/server-token'

import { getImageMetadata } from '../metadata'
import { TemporaryDir } from '../tempdir'
import { type PreviewFile, type PreviewMetadata, type PreviewProvider } from '../types'
import { extractThumbnail } from '../utils/ffmpeg'

export class VideoProvider implements PreviewProvider {
private readonly token: string
constructor (
private readonly storage: StorageAdapter,
private readonly tempDir: TemporaryDir
) {}
) {
this.token = generateToken(systemAccountUuid)
}

supports (mimeType: string): boolean {
return mimeType.startsWith('video/')
Expand All @@ -36,7 +40,7 @@ export class VideoProvider implements PreviewProvider {
const url = await this.storage.getUrl(ctx, { uuid: workspace } as any, name)

try {
await extractThumbnail(url, pngFile)
await extractThumbnail(url, pngFile, this.token)
} catch (err: any) {
// remove temporary png file in case of error
this.tempDir.rm(pngFile)
Expand Down
7 changes: 6 additions & 1 deletion pods/preview/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { TemporaryDir } from './tempdir'
import { type PreviewFile, type PreviewMetadata, type PreviewProvider } from './types'
import { transformImage } from './utils/sharp'
import { SingleFlight } from './singleflight'
import { OctetStreamProvider } from './providers/octet'

export interface ThumbnailParams {
fit: 'cover' | 'contain'
Expand Down Expand Up @@ -53,6 +54,7 @@ export function createPreviewService (
new DocProvider(storage, tempDir),
new PdfProvider(storage, tempDir),
new VideoProvider(storage, tempDir),
new OctetStreamProvider(),
new FallbackProvider(imageProvider)
]
return new PreviewServiceImpl(storage, cache, tempDir, providers, concurrency)
Expand Down Expand Up @@ -112,7 +114,10 @@ class PreviewServiceImpl implements PreviewService {
})

const thumbPath = this.tempDir.tmpFile()
const { contentType } = await transformImage(image.filePath, thumbPath, params)
const { contentType } = await ctx.with('transformImage', { format: params.format }, () =>
transformImage(image.filePath, thumbPath, params)
)

return {
filePath: thumbPath,
mimeType: contentType
Expand Down
Loading