Skip to content

Commit

Permalink
Merge pull request #401 from PermanentOrg/deprecate_content_type_on_a…
Browse files Browse the repository at this point in the history
…rchive_record_creation

Deprecated the contentType parameter of createArchiveRecord requests
  • Loading branch information
liam-lloyd authored Oct 15, 2024
2 parents 2c3f508 + 9f1040c commit c06c6e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ ArchiveRecord {
```
CreateArchiveRecordParams {
s3Url: string;
file: Pick<File, 'contentType' | 'size'>;
file: Pick<Partial<File>, 'contentType'> & Pick<File, 'size'>;
item: Pick<ArchiveRecord, 'displayName' | 'fileSystemCompatibleName'>;
parentFolder: Pick<Folder, 'id'>;
}
Expand All @@ -165,6 +165,9 @@ s3Url will generally be the value returned by `uploadFile`. Run
`createArchiveRecord` to store information about uploaded files in the
Permanent database.

file.contentType is deprecated. The field is still accepted for backwards compatibility, but it is not used.
The content type is determined by the file extension of the uploaded file.

```
createArchiveRecord(
clientConfiguration: ClientConfiguration,
Expand Down
2 changes: 1 addition & 1 deletion src/api/createRecordVo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface CreateRecordVoRequest {
displayName: string;
parentFolderId: number;
uploadFileName: string;
fileType: string;
fileType?: string;
size: number;
}

Expand Down
2 changes: 1 addition & 1 deletion src/sdk/createArchiveRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {

export interface CreateArchiveRecordParams {
s3Url: string;
file: Pick<File, 'contentType' | 'size'>;
file: Pick<Partial<File>, 'contentType'> & Pick<File, 'size'>;
item: Pick<ArchiveRecord, 'displayName' | 'fileSystemCompatibleName'>;
parentFolder: Pick<Folder, 'id'>;
}
Expand Down

0 comments on commit c06c6e8

Please sign in to comment.