From 280899d66e994c0f2210f41c4fa42050734e44d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:56:49 +0000 Subject: [PATCH 1/2] Bump @permanentorg/sdk from 0.7.0 to 0.8.0 Bumps [@permanentorg/sdk](https://github.com/PermanentOrg/permanent-sdk) from 0.7.0 to 0.8.0. - [Release notes](https://github.com/PermanentOrg/permanent-sdk/releases) - [Changelog](https://github.com/PermanentOrg/permanent-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/PermanentOrg/permanent-sdk/compare/v0.7.0...v0.8.0) --- updated-dependencies: - dependency-name: "@permanentorg/sdk" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 30a92df8..f88df1d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "AGPL-3.0", "dependencies": { "@fusionauth/typescript-client": "^1.53.0", - "@permanentorg/sdk": "0.7.0", + "@permanentorg/sdk": "0.8.0", "@sentry/node": "^8.33.1", "dotenv": "^16.4.5", "logform": "^2.6.1", @@ -3279,8 +3279,9 @@ } }, "node_modules/@permanentorg/sdk": { - "version": "0.7.0", - "license": "MIT", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@permanentorg/sdk/-/sdk-0.8.0.tgz", + "integrity": "sha512-GCVmBWyo7uZ51unTYeuU1HNwOayKtoMr1G5gx8cREEjFrFV2RE8UA/JbHmtUg7iCUpYT5qKqcxDbf85uaTkR6g==", "dependencies": { "ajv": "^8.11.0", "form-data": "^4.0.0", diff --git a/package.json b/package.json index 2d425f5f..0cbd30bc 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ }, "dependencies": { "@fusionauth/typescript-client": "^1.53.0", - "@permanentorg/sdk": "0.7.0", + "@permanentorg/sdk": "0.8.0", "@sentry/node": "^8.33.1", "dotenv": "^16.4.5", "logform": "^2.6.1", From 219f7e982a66e5387be28115df985bb39e9a431f Mon Sep 17 00:00:00 2001 From: Liam Lloyd Date: Tue, 3 Sep 2024 12:27:10 -0700 Subject: [PATCH 2/2] Update calls to permanent-sdk functions 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. --- src/classes/PermanentFileSystem.ts | 50 ++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/src/classes/PermanentFileSystem.ts b/src/classes/PermanentFileSystem.ts index 4df8708f..b672cfa2 100644 --- a/src/classes/PermanentFileSystem.ts +++ b/src/classes/PermanentFileSystem.ts @@ -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); @@ -221,7 +223,9 @@ export class PermanentFileSystem { await deleteFolder( await this.getClientConfiguration(), - folder.id, + { + folderId: folder.id, + }, ); } @@ -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); @@ -278,7 +286,9 @@ export class PermanentFileSystem { await deleteArchiveRecord( await this.getClientConfiguration(), - archiveRecord.id, + { + archiveRecordId: archiveRecord.id, + }, ); } @@ -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; @@ -442,7 +454,9 @@ export class PermanentFileSystem { } const archiveFolders = await getArchiveFolders( await this.getClientConfiguration(), - archiveId, + { + archiveId, + }, ); this.archiveFoldersCache.set(archiveId, archiveFolders); return archiveFolders; @@ -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;