Skip to content

Commit 19b28df

Browse files
committed
fix test description, update use case documentation
1 parent 304d2c1 commit 19b28df

File tree

2 files changed

+62
-41
lines changed

2 files changed

+62
-41
lines changed

docs/useCases.md

Lines changed: 61 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3018,14 +3018,18 @@ Submits guestbook answers for a datafile and returns a signed URL.
30183018
import { submitGuestbookForDatafileDownload } from '@iqss/dataverse-client-javascript'
30193019

30203020
submitGuestbookForDatafileDownload
3021-
.execute(10, {
3022-
guestbookResponse: {
3023-
answers: [
3024-
{ id: 123, value: 'Good' },
3025-
{ id: 124, value: ['Multi', 'Line'] }
3026-
]
3027-
}
3028-
})
3021+
.execute(
3022+
10,
3023+
{
3024+
guestbookResponse: {
3025+
answers: [
3026+
{ id: 123, value: 'Good' },
3027+
{ id: 124, value: ['Multi', 'Line'] }
3028+
]
3029+
}
3030+
},
3031+
'original'
3032+
)
30293033
.then((signedUrl: string) => {
30303034
/* ... */
30313035
})
@@ -3043,15 +3047,19 @@ Submits guestbook answers for multiple files and returns a signed URL.
30433047
import { submitGuestbookForDatafilesDownload } from '@iqss/dataverse-client-javascript'
30443048

30453049
submitGuestbookForDatafilesDownload
3046-
.execute([10, 11], {
3047-
guestbookResponse: {
3048-
answers: [
3049-
{ id: 123, value: 'Good' },
3050-
{ id: 124, value: ['Multi', 'Line'] },
3051-
{ id: 125, value: 'Yellow' }
3052-
]
3053-
}
3054-
})
3050+
.execute(
3051+
[10, 11],
3052+
{
3053+
guestbookResponse: {
3054+
answers: [
3055+
{ id: 123, value: 'Good' },
3056+
{ id: 124, value: ['Multi', 'Line'] },
3057+
{ id: 125, value: 'Yellow' }
3058+
]
3059+
}
3060+
},
3061+
'original'
3062+
)
30553063
.then((signedUrl: string) => {
30563064
/* ... */
30573065
})
@@ -3069,15 +3077,19 @@ Submits guestbook answers for dataset download and returns a signed URL.
30693077
import { submitGuestbookForDatasetDownload } from '@iqss/dataverse-client-javascript'
30703078

30713079
submitGuestbookForDatasetDownload
3072-
.execute('doi:10.5072/FK2/XXXXXX', {
3073-
guestbookResponse: {
3074-
answers: [
3075-
{ id: 123, value: 'Good' },
3076-
{ id: 124, value: ['Multi', 'Line'] },
3077-
{ id: 125, value: 'Yellow' }
3078-
]
3079-
}
3080-
})
3080+
.execute(
3081+
'doi:10.5072/FK2/XXXXXX',
3082+
{
3083+
guestbookResponse: {
3084+
answers: [
3085+
{ id: 123, value: 'Good' },
3086+
{ id: 124, value: ['Multi', 'Line'] },
3087+
{ id: 125, value: 'Yellow' }
3088+
]
3089+
}
3090+
},
3091+
'original'
3092+
)
30813093
.then((signedUrl: string) => {
30823094
/* ... */
30833095
})
@@ -3095,19 +3107,24 @@ Submits guestbook answers for a specific dataset version and returns a signed UR
30953107
import { submitGuestbookForDatasetVersionDownload } from '@iqss/dataverse-client-javascript'
30963108

30973109
submitGuestbookForDatasetVersionDownload
3098-
.execute(10, ':latest', {
3099-
guestbookResponse: {
3100-
name: 'Jane Doe',
3101-
email: 'jane@example.org',
3102-
institution: 'Example University',
3103-
position: 'Researcher',
3104-
answers: [
3105-
{ id: 123, value: 'Good' },
3106-
{ id: 124, value: ['Multi', 'Line'] },
3107-
{ id: 125, value: 'Yellow' }
3108-
]
3109-
}
3110-
})
3110+
.execute(
3111+
10,
3112+
':latest',
3113+
{
3114+
guestbookResponse: {
3115+
name: 'Jane Doe',
3116+
email: 'jane@example.org',
3117+
institution: 'Example University',
3118+
position: 'Researcher',
3119+
answers: [
3120+
{ id: 123, value: 'Good' },
3121+
{ id: 124, value: ['Multi', 'Line'] },
3122+
{ id: 125, value: 'Yellow' }
3123+
]
3124+
}
3125+
},
3126+
'original'
3127+
)
31113128
.then((signedUrl: string) => {
31123129
/* ... */
31133130
})
@@ -3119,4 +3136,8 @@ The `datasetId` parameter can be a string, for persistent identifiers, or a numb
31193136

31203137
The `versionId` parameter accepts a numbered version such as `'1.0'` or a non-numbered version such as `':latest'`.
31213138

3122-
The third parameter must match [GuestbookResponseDTO](../src/access/domain/dtos/GuestbookResponseDTO.ts). The resolved value is a signed download URL as a string.
3139+
The `guestbookResponse` parameter must match [GuestbookResponseDTO](../src/access/domain/dtos/GuestbookResponseDTO.ts).
3140+
3141+
The optional `format` parameter is sent as a query parameter on the download endpoint. For example, pass `'original'` to request the original dataset or file format.
3142+
3143+
The resolved value is a signed download URL as a string.

test/integration/access/AccessRepository.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('AccessRepository', () => {
9797
expect(() => new URL(actual)).not.toThrow()
9898
})
9999

100-
test('should preserve format=tab in signed url for dataset download', async () => {
100+
test('should preserve format=original in signed url for dataset download', async () => {
101101
const actual = await sut.submitGuestbookForDatasetDownload(
102102
testDatasetIds.numericId,
103103
guestbookResponse,

0 commit comments

Comments
 (0)