UBERF-7011: Switch to Ref<Blob> (#5661)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-05-27 12:25:57 +05:00
committed by GitHub
parent 27a98e0641
commit 8c6a5f4e9d
158 changed files with 1795 additions and 1049 deletions
+7 -5
View File
@@ -1,5 +1,5 @@
import attachment, { Attachment } from '@hcengineering/attachment'
import contact, { Channel, combineName, Contact, Employee, PersonAccount } from '@hcengineering/contact'
import contact, { AvatarType, Channel, combineName, Contact, Employee, PersonAccount } from '@hcengineering/contact'
import core, {
Account,
AccountRole,
@@ -21,7 +21,8 @@ import core, {
Timestamp,
TxOperations,
TxProcessor,
WithLookup
WithLookup,
type Blob as PlatformBlob
} from '@hcengineering/core'
import gmail, { Message } from '@hcengineering/gmail'
import recruit from '@hcengineering/recruit'
@@ -242,7 +243,7 @@ export async function syncDocument (
body: data
})
if (resp.status === 200) {
const uuid = await resp.text()
const uuid = (await resp.text()) as Ref<PlatformBlob>
ed.file = uuid
ed._id = attachmentId as Ref<Attachment & BitrixSyncDoc>
@@ -812,7 +813,7 @@ async function downloadComments (
attachedToClass: c._class,
bitrixId: `attach-${v.id}`,
collection: 'attachments',
file: '',
file: '' as Ref<PlatformBlob>,
lastModified: Date.now(),
modifiedBy: userList.get(it.AUTHOR_ID) ?? core.account.System,
modifiedOn: new Date(it.CREATED ?? new Date().toString()).getTime(),
@@ -941,7 +942,8 @@ async function synchronizeUsers (
if (accountId === undefined) {
const employeeId = await ops.client.createDoc(contact.class.Person, contact.space.Contacts, {
name: combineName(u.NAME, u.LAST_NAME),
avatar: u.PERSONAL_PHOTO,
avatarType: AvatarType.EXTERNAL,
avatarProps: { url: u.PERSONAL_PHOTO },
city: u.PERSONAL_CITY
})
await ops.client.createMixin(employeeId, contact.class.Person, contact.space.Contacts, contact.mixin.Employee, {
+3 -2
View File
@@ -14,7 +14,8 @@ import core, {
Space,
TxOperations,
WithLookup,
generateId
generateId,
type Blob as PlatformBlob
} from '@hcengineering/core'
import { Message } from '@hcengineering/gmail'
import recruit, { Applicant, Candidate, Vacancy } from '@hcengineering/recruit'
@@ -561,7 +562,7 @@ export async function convert (
const attachDoc: Attachment & BitrixSyncDoc = {
_id: generateId(),
bitrixId: `${blobRef.id}`,
file: '', // Empty since not uploaded yet.
file: '' as Ref<PlatformBlob>, // Empty since not uploaded yet.
name: blobRef.id,
size: -1,
type: 'application/octet-stream',