Skip to content

Commit a857e8a

Browse files
committed
Add publish blob and upload blob with form data
Signed-off-by: Anastasia Lalamentik <[email protected]>
1 parent 446606a commit a857e8a

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

lib/firefly.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,29 @@ export default class FireFly extends HttpBase {
208208
return response.data;
209209
}
210210

211+
async uploadDataBlobWithFormData(
212+
formData: FormData
213+
): Promise<FireFlyDataResponse> {
214+
const response = await this.wrapError(
215+
this.http.post<FireFlyDataResponse>('/data', formData, {
216+
headers: {
217+
...formData.getHeaders(),
218+
'Content-Length': formData.getLengthSync(),
219+
},
220+
}),
221+
);
222+
return response.data;
223+
}
224+
225+
async publishDataBlobToSharedStorage(
226+
dataid: string
227+
): Promise<FireFlyDataResponse> {
228+
const response = await this.wrapError(
229+
this.http.post<FireFlyDataResponse>(`/data/${dataid}/blob/publish`, {dataid}),
230+
);
231+
return response.data;
232+
}
233+
211234
getBatches(
212235
filter?: FireFlyBatchFilter,
213236
options?: FireFlyGetOptions,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyperledger/firefly-sdk",
3-
"version": "1.1.7",
3+
"version": "1.1.8",
44
"description": "Client SDK for Hyperledger FireFly",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)