Merge branch 'develop' into feature/large-files-and-names

This commit is contained in:
nico.benaz 2025-05-24 14:13:01 +02:00 committed by GitHub
commit 5f0b5ec4ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 6 deletions

View File

@ -148,6 +148,11 @@ export const encryptAndPublishSymmetricKeyGroupChat = async ({
service: 'DOCUMENT_PRIVATE',
identifier: `symmetric-qchat-group-${groupId}`,
uploadType: 'base64',
file: encryptedData,
service: 'DOCUMENT_PRIVATE',
identifier: `symmetric-qchat-group-${groupId}`,
uploadType: 'file',
isBase64: true,
withFee: true,
});
return {
@ -215,6 +220,9 @@ export const encryptAndPublishSymmetricKeyGroupChatForAdmins = async ({
service: 'DOCUMENT_PRIVATE',
identifier: `admins-symmetric-qchat-group-${groupId}`,
uploadType: 'base64',
file: encryptedData,
uploadType: 'file',
isBase64: true,
withFee: true,
});
return {
@ -249,9 +257,11 @@ export const publishGroupEncryptedResource = async ({
const data = await publishData({
registeredName,
data: encryptedData,
uploadType: 'base64',
file: encryptedData,
service: 'DOCUMENT',
identifier,
uploadType: 'base64',
isBase64: true,
withFee: true,
});
return data;
@ -284,6 +294,9 @@ export const publishOnQDN = async ({
}) => {
if (data && service) {
const registeredName = name || (await getNameInfo());
}) => {
if (data && service) {
const registeredName = await getNameInfo();
if (!registeredName)
throw new Error(
i18n.t('core:message.generic.name_publish', {
@ -294,9 +307,11 @@ export const publishOnQDN = async ({
const res = await publishData({
registeredName,
data,
file: data,
service,
identifier,
uploadType,
isBase64: true,
withFee: true,
title,
description,

View File

@ -83,25 +83,29 @@ async function getKeyPair() {
}
export const publishData = async ({
category,
data,
description,
feeAmount,
filename,
identifier,
isBase64,
registeredName,
file,
service,
identifier,
uploadType,
withFee,
title,
description,
category,
tag1,
tag2,
tag3,
tag4,
tag5,
title,
uploadType,
withFee,
}: any) => {
console.log('data', data);
feeAmount,
}: any) => {
const validateName = async (receiverName: string) => {
return await reusableGet(`/names/${receiverName}`);
};
@ -228,6 +232,7 @@ export const publishData = async ({
let transactionBytes = await uploadData(registeredName, data, fee);
console.log('transactionBytes length', transactionBytes?.length);
if (!transactionBytes || transactionBytes.error) {
throw new Error(transactionBytes?.message || 'Error when uploading');
} else if (transactionBytes.includes('Error 500 Internal Server Error')) {