Skip to content

Commit

Permalink
Update calls to permanent-sdk functions
Browse files Browse the repository at this point in the history
In v0.8.0 of permanent-sdk, the functions offered by the SDK started
using parameters objects, rather than direct parameters, for their
inputs. This commit updates calls to those functions to pass parameters
in the format that now expect.
  • Loading branch information
Liam Lloyd committed Oct 7, 2024
1 parent 280899d commit 219f7e9
Showing 1 changed file with 33 additions and 17 deletions.
50 changes: 33 additions & 17 deletions src/classes/PermanentFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ export class PermanentFileSystem {
const newFolder = await createFolder(
await this.getClientConfiguration(),
{
name: childName,
folder: {
name: childName,
},
parentFolder,
},
parentFolder,
);
parentFolder.folders.push(newFolder);
await this.updateFolderInCache(parentPath, parentFolder);
Expand Down Expand Up @@ -221,7 +223,9 @@ export class PermanentFileSystem {

await deleteFolder(
await this.getClientConfiguration(),
folder.id,
{
folderId: folder.id,
},
);
}

Expand All @@ -243,17 +247,21 @@ export class PermanentFileSystem {
};
const s3Url = await uploadFile(
await this.getClientConfiguration(),
dataStream,
fileFragment,
archiveRecordFragment,
parentFolder,
{
fileData: dataStream,
file: fileFragment,
item: archiveRecordFragment,
parentFolder,
},
);
const newArchiveRecord = await createArchiveRecord(
await this.getClientConfiguration(),
s3Url,
fileFragment,
archiveRecordFragment,
parentFolder,
{
s3Url,
file: fileFragment,
item: archiveRecordFragment,
parentFolder,
},
);
parentFolder.archiveRecords.push(newArchiveRecord);
this.archiveRecordCache.set(requestedPath, newArchiveRecord);
Expand All @@ -278,7 +286,9 @@ export class PermanentFileSystem {

await deleteArchiveRecord(
await this.getClientConfiguration(),
archiveRecord.id,
{
archiveRecordId: archiveRecord.id,
},
);
}

Expand Down Expand Up @@ -362,8 +372,10 @@ export class PermanentFileSystem {
);
const populatedArchiveRecord = await getArchiveRecord(
await this.getClientConfiguration(),
archiveRecord.id,
archiveId,
{
archiveRecordId: archiveRecord.id,
archiveId,
},
);
this.archiveRecordCache.set(requestedPath, populatedArchiveRecord);
return populatedArchiveRecord;
Expand Down Expand Up @@ -442,7 +454,9 @@ export class PermanentFileSystem {
}
const archiveFolders = await getArchiveFolders(
await this.getClientConfiguration(),
archiveId,
{
archiveId,
},
);
this.archiveFoldersCache.set(archiveId, archiveFolders);
return archiveFolders;
Expand Down Expand Up @@ -531,8 +545,10 @@ export class PermanentFileSystem {
);
const populatedTargetFolder = await getFolder(
await this.getClientConfiguration(),
targetFolder.id,
archiveId,
{
folderId: targetFolder.id,
archiveId,
},
);
this.folderCache.set(requestedPath, populatedTargetFolder);
return populatedTargetFolder;
Expand Down

0 comments on commit 219f7e9

Please sign in to comment.