in apps/chat/src/utils/app/data/file-service.ts [78:135]
absolutePath: constructPath(
ApiKeys.Files,
typedResult.bucket,
relativePath,
),
relativePath: relativePath,
folderId: constructPath(
ApiKeys.Files,
typedResult.bucket,
relativePath,
),
contentLength: typedResult.contentLength,
contentType: typedResult.contentType,
serverSynced: true,
},
};
},
),
);
}
private static getListingUrl = ({
path,
resultQuery,
}: {
path?: string;
resultQuery?: string;
}): string => {
const listingUrl = ApiUtils.encodeApiUrl(
constructPath('/api/listing', path || getFileRootId()),
);
return resultQuery ? `${listingUrl}?${resultQuery}` : listingUrl;
};
public static getFileFolders(
parentPath?: string,
): Observable<FileFolderInterface[]> {
const filter = BackendDataNodeType.FOLDER;
const query = new URLSearchParams({
filter,
});
const resultQuery = query.toString();
return ApiUtils.request(
this.getListingUrl({ path: parentPath, resultQuery }),
).pipe(
map((folders: BackendFileFolder[]) => {
return folders
.filter(
(folder) => !!folder.parentPath || folder.name !== CLIENTDATA_PATH,
)
.map((folder): FileFolderInterface => {
const relativePath = folder.parentPath
? ApiUtils.decodeApiUrl(folder.parentPath)
: undefined;
return {