@twin.org/blob-storage-rest-client 0.0.3-next.6 → 0.0.3-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/docs/changelog.md +70 -42
- package/docs/examples.md +98 -1
- package/docs/reference/classes/BlobStorageRestClient.md +10 -10
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# TWIN Blob Storage
|
|
1
|
+
# TWIN Blob Storage REST Client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package provides client utilities for consuming blob storage service endpoints over HTTP. It helps applications call blob APIs with consistent request construction and response handling.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/docs/changelog.md
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0.3-next.
|
|
3
|
+
## [0.0.3-next.8](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.3-next.7...blob-storage-rest-client-v0.0.3-next.8) (2026-05-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **blob-storage-rest-client:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/blob-storage-models bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.7](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.3-next.6...blob-storage-rest-client-v0.0.3-next.7) (2026-02-25)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Miscellaneous Chores
|
|
21
|
+
|
|
22
|
+
* **blob-storage-rest-client:** Synchronize repo versions
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/blob-storage-models bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
30
|
+
|
|
31
|
+
## [0.0.3-next.6](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.3-next.5...blob-storage-rest-client-v0.0.3-next.6) (2026-02-09)
|
|
4
32
|
|
|
5
33
|
|
|
6
34
|
### Miscellaneous Chores
|
|
@@ -14,7 +42,7 @@
|
|
|
14
42
|
* dependencies
|
|
15
43
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
16
44
|
|
|
17
|
-
## [0.0.3-next.5](https://github.com/
|
|
45
|
+
## [0.0.3-next.5](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.3-next.4...blob-storage-rest-client-v0.0.3-next.5) (2026-01-26)
|
|
18
46
|
|
|
19
47
|
|
|
20
48
|
### Miscellaneous Chores
|
|
@@ -28,12 +56,12 @@
|
|
|
28
56
|
* dependencies
|
|
29
57
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
30
58
|
|
|
31
|
-
## [0.0.3-next.4](https://github.com/
|
|
59
|
+
## [0.0.3-next.4](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.3-next.3...blob-storage-rest-client-v0.0.3-next.4) (2026-01-23)
|
|
32
60
|
|
|
33
61
|
|
|
34
62
|
### Features
|
|
35
63
|
|
|
36
|
-
* replace nextItem property with Link header ([#37](https://github.com/
|
|
64
|
+
* replace nextItem property with Link header ([#37](https://github.com/iotaledger/twin-blob-storage/issues/37)) ([0b68da5](https://github.com/iotaledger/twin-blob-storage/commit/0b68da58549c9e52eb2313ea5a868573840d5ca6))
|
|
37
65
|
|
|
38
66
|
|
|
39
67
|
### Dependencies
|
|
@@ -42,7 +70,7 @@
|
|
|
42
70
|
* dependencies
|
|
43
71
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
44
72
|
|
|
45
|
-
## [0.0.3-next.3](https://github.com/
|
|
73
|
+
## [0.0.3-next.3](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.3-next.2...blob-storage-rest-client-v0.0.3-next.3) (2026-01-21)
|
|
46
74
|
|
|
47
75
|
|
|
48
76
|
### Miscellaneous Chores
|
|
@@ -56,7 +84,7 @@
|
|
|
56
84
|
* dependencies
|
|
57
85
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
58
86
|
|
|
59
|
-
## [0.0.3-next.2](https://github.com/
|
|
87
|
+
## [0.0.3-next.2](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.3-next.1...blob-storage-rest-client-v0.0.3-next.2) (2026-01-14)
|
|
60
88
|
|
|
61
89
|
|
|
62
90
|
### Miscellaneous Chores
|
|
@@ -70,19 +98,19 @@
|
|
|
70
98
|
* dependencies
|
|
71
99
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
72
100
|
|
|
73
|
-
## [0.0.3-next.1](https://github.com/
|
|
101
|
+
## [0.0.3-next.1](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.3-next.0...blob-storage-rest-client-v0.0.3-next.1) (2025-11-11)
|
|
74
102
|
|
|
75
103
|
|
|
76
104
|
### Features
|
|
77
105
|
|
|
78
|
-
* add compression support ([67d239b](https://github.com/
|
|
79
|
-
* add context id features ([#30](https://github.com/
|
|
80
|
-
* add validate-locales ([f20fcec](https://github.com/
|
|
81
|
-
* additional encryption options on per item basis ([4b95a65](https://github.com/
|
|
82
|
-
* eslint migration to flat config ([e4239dd](https://github.com/
|
|
83
|
-
* update dependencies ([56f0094](https://github.com/
|
|
84
|
-
* update framework core ([ff339fe](https://github.com/
|
|
85
|
-
* use shared store mechanism ([#12](https://github.com/
|
|
106
|
+
* add compression support ([67d239b](https://github.com/iotaledger/twin-blob-storage/commit/67d239bca8321bd90bf4ff93167c564130309730))
|
|
107
|
+
* add context id features ([#30](https://github.com/iotaledger/twin-blob-storage/issues/30)) ([fbf1c92](https://github.com/iotaledger/twin-blob-storage/commit/fbf1c9276424c841ef5ef3f4de8469ab3fba7e9c))
|
|
108
|
+
* add validate-locales ([f20fcec](https://github.com/iotaledger/twin-blob-storage/commit/f20fceced91e39a0c9edb770b2e43ce944c92f3c))
|
|
109
|
+
* additional encryption options on per item basis ([4b95a65](https://github.com/iotaledger/twin-blob-storage/commit/4b95a656d19e3b571cea905e36f29b679b13e1e8))
|
|
110
|
+
* eslint migration to flat config ([e4239dd](https://github.com/iotaledger/twin-blob-storage/commit/e4239dd1c721955cff7f0357255d2bba15319972))
|
|
111
|
+
* update dependencies ([56f0094](https://github.com/iotaledger/twin-blob-storage/commit/56f0094b68d8bd22864cd899ac1b61d95540f719))
|
|
112
|
+
* update framework core ([ff339fe](https://github.com/iotaledger/twin-blob-storage/commit/ff339fe7e3f09ddff429907834bdf43617e9c05e))
|
|
113
|
+
* use shared store mechanism ([#12](https://github.com/iotaledger/twin-blob-storage/issues/12)) ([cae8110](https://github.com/iotaledger/twin-blob-storage/commit/cae8110681847a1ac4fcac968b8196694e49c320))
|
|
86
114
|
|
|
87
115
|
|
|
88
116
|
### Dependencies
|
|
@@ -91,12 +119,12 @@
|
|
|
91
119
|
* dependencies
|
|
92
120
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
93
121
|
|
|
94
|
-
## [0.0.2-next.5](https://github.com/
|
|
122
|
+
## [0.0.2-next.5](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.2-next.4...blob-storage-rest-client-v0.0.2-next.5) (2025-10-09)
|
|
95
123
|
|
|
96
124
|
|
|
97
125
|
### Features
|
|
98
126
|
|
|
99
|
-
* add validate-locales ([f20fcec](https://github.com/
|
|
127
|
+
* add validate-locales ([f20fcec](https://github.com/iotaledger/twin-blob-storage/commit/f20fceced91e39a0c9edb770b2e43ce944c92f3c))
|
|
100
128
|
|
|
101
129
|
|
|
102
130
|
### Dependencies
|
|
@@ -105,7 +133,7 @@
|
|
|
105
133
|
* dependencies
|
|
106
134
|
* @twin.org/blob-storage-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
107
135
|
|
|
108
|
-
## [0.0.2-next.4](https://github.com/
|
|
136
|
+
## [0.0.2-next.4](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.2-next.3...blob-storage-rest-client-v0.0.2-next.4) (2025-10-02)
|
|
109
137
|
|
|
110
138
|
|
|
111
139
|
### Miscellaneous Chores
|
|
@@ -119,12 +147,12 @@
|
|
|
119
147
|
* dependencies
|
|
120
148
|
* @twin.org/blob-storage-models bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
121
149
|
|
|
122
|
-
## [0.0.2-next.3](https://github.com/
|
|
150
|
+
## [0.0.2-next.3](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.2-next.2...blob-storage-rest-client-v0.0.2-next.3) (2025-08-29)
|
|
123
151
|
|
|
124
152
|
|
|
125
153
|
### Features
|
|
126
154
|
|
|
127
|
-
* eslint migration to flat config ([e4239dd](https://github.com/
|
|
155
|
+
* eslint migration to flat config ([e4239dd](https://github.com/iotaledger/twin-blob-storage/commit/e4239dd1c721955cff7f0357255d2bba15319972))
|
|
128
156
|
|
|
129
157
|
|
|
130
158
|
### Dependencies
|
|
@@ -133,12 +161,12 @@
|
|
|
133
161
|
* dependencies
|
|
134
162
|
* @twin.org/blob-storage-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
135
163
|
|
|
136
|
-
## [0.0.2-next.2](https://github.com/
|
|
164
|
+
## [0.0.2-next.2](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.2-next.1...blob-storage-rest-client-v0.0.2-next.2) (2025-08-20)
|
|
137
165
|
|
|
138
166
|
|
|
139
167
|
### Features
|
|
140
168
|
|
|
141
|
-
* update framework core ([ff339fe](https://github.com/
|
|
169
|
+
* update framework core ([ff339fe](https://github.com/iotaledger/twin-blob-storage/commit/ff339fe7e3f09ddff429907834bdf43617e9c05e))
|
|
142
170
|
|
|
143
171
|
|
|
144
172
|
### Dependencies
|
|
@@ -147,15 +175,15 @@
|
|
|
147
175
|
* dependencies
|
|
148
176
|
* @twin.org/blob-storage-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
149
177
|
|
|
150
|
-
## [0.0.2-next.1](https://github.com/
|
|
178
|
+
## [0.0.2-next.1](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.2-next.0...blob-storage-rest-client-v0.0.2-next.1) (2025-07-24)
|
|
151
179
|
|
|
152
180
|
|
|
153
181
|
### Features
|
|
154
182
|
|
|
155
|
-
* add compression support ([67d239b](https://github.com/
|
|
156
|
-
* additional encryption options on per item basis ([4b95a65](https://github.com/
|
|
157
|
-
* update dependencies ([56f0094](https://github.com/
|
|
158
|
-
* use shared store mechanism ([#12](https://github.com/
|
|
183
|
+
* add compression support ([67d239b](https://github.com/iotaledger/twin-blob-storage/commit/67d239bca8321bd90bf4ff93167c564130309730))
|
|
184
|
+
* additional encryption options on per item basis ([4b95a65](https://github.com/iotaledger/twin-blob-storage/commit/4b95a656d19e3b571cea905e36f29b679b13e1e8))
|
|
185
|
+
* update dependencies ([56f0094](https://github.com/iotaledger/twin-blob-storage/commit/56f0094b68d8bd22864cd899ac1b61d95540f719))
|
|
186
|
+
* use shared store mechanism ([#12](https://github.com/iotaledger/twin-blob-storage/issues/12)) ([cae8110](https://github.com/iotaledger/twin-blob-storage/commit/cae8110681847a1ac4fcac968b8196694e49c320))
|
|
159
187
|
|
|
160
188
|
|
|
161
189
|
### Dependencies
|
|
@@ -169,7 +197,7 @@
|
|
|
169
197
|
|
|
170
198
|
### Features
|
|
171
199
|
|
|
172
|
-
* release to production ([eacfe75](https://github.com/
|
|
200
|
+
* release to production ([eacfe75](https://github.com/iotaledger/twin-blob-storage/commit/eacfe754a0dcd9243d9e13d86422327d0a605164))
|
|
173
201
|
|
|
174
202
|
|
|
175
203
|
### Dependencies
|
|
@@ -178,7 +206,7 @@
|
|
|
178
206
|
* dependencies
|
|
179
207
|
* @twin.org/blob-storage-models bumped from ^0.0.0 to ^0.0.1
|
|
180
208
|
|
|
181
|
-
## [0.0.1-next.37](https://github.com/
|
|
209
|
+
## [0.0.1-next.37](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.1-next.36...blob-storage-rest-client-v0.0.1-next.37) (2025-06-20)
|
|
182
210
|
|
|
183
211
|
|
|
184
212
|
### Miscellaneous Chores
|
|
@@ -192,12 +220,12 @@
|
|
|
192
220
|
* dependencies
|
|
193
221
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.36 to 0.0.1-next.37
|
|
194
222
|
|
|
195
|
-
## [0.0.1-next.36](https://github.com/
|
|
223
|
+
## [0.0.1-next.36](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.1-next.35...blob-storage-rest-client-v0.0.1-next.36) (2025-06-19)
|
|
196
224
|
|
|
197
225
|
|
|
198
226
|
### Features
|
|
199
227
|
|
|
200
|
-
* add compression support ([67d239b](https://github.com/
|
|
228
|
+
* add compression support ([67d239b](https://github.com/iotaledger/twin-blob-storage/commit/67d239bca8321bd90bf4ff93167c564130309730))
|
|
201
229
|
|
|
202
230
|
|
|
203
231
|
### Dependencies
|
|
@@ -206,12 +234,12 @@
|
|
|
206
234
|
* dependencies
|
|
207
235
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.35 to 0.0.1-next.36
|
|
208
236
|
|
|
209
|
-
## [0.0.1-next.35](https://github.com/
|
|
237
|
+
## [0.0.1-next.35](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.1-next.34...blob-storage-rest-client-v0.0.1-next.35) (2025-06-17)
|
|
210
238
|
|
|
211
239
|
|
|
212
240
|
### Features
|
|
213
241
|
|
|
214
|
-
* additional encryption options on per item basis ([4b95a65](https://github.com/
|
|
242
|
+
* additional encryption options on per item basis ([4b95a65](https://github.com/iotaledger/twin-blob-storage/commit/4b95a656d19e3b571cea905e36f29b679b13e1e8))
|
|
215
243
|
|
|
216
244
|
|
|
217
245
|
### Dependencies
|
|
@@ -220,12 +248,12 @@
|
|
|
220
248
|
* dependencies
|
|
221
249
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.34 to 0.0.1-next.35
|
|
222
250
|
|
|
223
|
-
## [0.0.1-next.34](https://github.com/
|
|
251
|
+
## [0.0.1-next.34](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.1-next.33...blob-storage-rest-client-v0.0.1-next.34) (2025-06-12)
|
|
224
252
|
|
|
225
253
|
|
|
226
254
|
### Features
|
|
227
255
|
|
|
228
|
-
* update dependencies ([56f0094](https://github.com/
|
|
256
|
+
* update dependencies ([56f0094](https://github.com/iotaledger/twin-blob-storage/commit/56f0094b68d8bd22864cd899ac1b61d95540f719))
|
|
229
257
|
|
|
230
258
|
|
|
231
259
|
### Dependencies
|
|
@@ -234,7 +262,7 @@
|
|
|
234
262
|
* dependencies
|
|
235
263
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.33 to 0.0.1-next.34
|
|
236
264
|
|
|
237
|
-
## [0.0.1-next.33](https://github.com/
|
|
265
|
+
## [0.0.1-next.33](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.1-next.32...blob-storage-rest-client-v0.0.1-next.33) (2025-06-03)
|
|
238
266
|
|
|
239
267
|
|
|
240
268
|
### Miscellaneous Chores
|
|
@@ -248,7 +276,7 @@
|
|
|
248
276
|
* dependencies
|
|
249
277
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.32 to 0.0.1-next.33
|
|
250
278
|
|
|
251
|
-
## [0.0.1-next.32](https://github.com/
|
|
279
|
+
## [0.0.1-next.32](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.1-next.31...blob-storage-rest-client-v0.0.1-next.32) (2025-05-28)
|
|
252
280
|
|
|
253
281
|
|
|
254
282
|
### Miscellaneous Chores
|
|
@@ -262,7 +290,7 @@
|
|
|
262
290
|
* dependencies
|
|
263
291
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.31 to 0.0.1-next.32
|
|
264
292
|
|
|
265
|
-
## [0.0.1-next.31](https://github.com/
|
|
293
|
+
## [0.0.1-next.31](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.1-next.30...blob-storage-rest-client-v0.0.1-next.31) (2025-05-08)
|
|
266
294
|
|
|
267
295
|
|
|
268
296
|
### Miscellaneous Chores
|
|
@@ -276,12 +304,12 @@
|
|
|
276
304
|
* dependencies
|
|
277
305
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.30 to 0.0.1-next.31
|
|
278
306
|
|
|
279
|
-
## [0.0.1-next.30](https://github.com/
|
|
307
|
+
## [0.0.1-next.30](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.1-next.29...blob-storage-rest-client-v0.0.1-next.30) (2025-04-17)
|
|
280
308
|
|
|
281
309
|
|
|
282
310
|
### Features
|
|
283
311
|
|
|
284
|
-
* use shared store mechanism ([#12](https://github.com/
|
|
312
|
+
* use shared store mechanism ([#12](https://github.com/iotaledger/twin-blob-storage/issues/12)) ([cae8110](https://github.com/iotaledger/twin-blob-storage/commit/cae8110681847a1ac4fcac968b8196694e49c320))
|
|
285
313
|
|
|
286
314
|
|
|
287
315
|
### Dependencies
|
|
@@ -290,7 +318,7 @@
|
|
|
290
318
|
* dependencies
|
|
291
319
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.29 to 0.0.1-next.30
|
|
292
320
|
|
|
293
|
-
## [0.0.1-next.29](https://github.com/
|
|
321
|
+
## [0.0.1-next.29](https://github.com/iotaledger/twin-blob-storage/compare/blob-storage-rest-client-v0.0.1-next.28...blob-storage-rest-client-v0.0.1-next.29) (2025-03-28)
|
|
294
322
|
|
|
295
323
|
|
|
296
324
|
### Miscellaneous Chores
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,98 @@
|
|
|
1
|
-
#
|
|
1
|
+
# REST Client Examples
|
|
2
|
+
|
|
3
|
+
Use these snippets to create, query, and manage blobs through HTTP endpoints with strongly typed requests and responses.
|
|
4
|
+
|
|
5
|
+
## BlobStorageRestClient
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { BlobStorageRestClient } from '@twin.org/blob-storage-rest-client';
|
|
9
|
+
|
|
10
|
+
const client = new BlobStorageRestClient({
|
|
11
|
+
endpoint: 'https://api.example.com',
|
|
12
|
+
pathPrefix: '/v1'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
console.log(client.className()); // BlobStorageRestClient
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { BlobStorageRestClient } from '@twin.org/blob-storage-rest-client';
|
|
20
|
+
|
|
21
|
+
const client = new BlobStorageRestClient({
|
|
22
|
+
endpoint: 'https://api.example.com',
|
|
23
|
+
pathPrefix: '/v1'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const blobId = await client.create(
|
|
27
|
+
'SGVsbG8gVFdJTiE=',
|
|
28
|
+
'text/plain',
|
|
29
|
+
'txt',
|
|
30
|
+
{
|
|
31
|
+
'@context': 'https://schema.org',
|
|
32
|
+
type: 'DigitalDocument',
|
|
33
|
+
name: 'greeting'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
disableEncryption: false,
|
|
37
|
+
namespace: 'tenant-a'
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
console.log(blobId); // blob:urn:blob:...
|
|
41
|
+
|
|
42
|
+
const blobEntry = await client.get(blobId, { includeContent: true, decompress: true });
|
|
43
|
+
console.log(blobEntry.encodingFormat); // text/plain
|
|
44
|
+
|
|
45
|
+
await client.update(blobId, 'text/plain', 'txt', {
|
|
46
|
+
'@context': 'https://schema.org',
|
|
47
|
+
type: 'DigitalDocument',
|
|
48
|
+
name: 'greeting-v2'
|
|
49
|
+
});
|
|
50
|
+
console.log(blobId); // blob:urn:blob:...
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import {
|
|
55
|
+
type EntityCondition,
|
|
56
|
+
ComparisonOperator,
|
|
57
|
+
LogicalOperator,
|
|
58
|
+
SortDirection
|
|
59
|
+
} from '@twin.org/entity';
|
|
60
|
+
import type { IBlobStorageEntry } from '@twin.org/blob-storage-models';
|
|
61
|
+
import { BlobStorageRestClient } from '@twin.org/blob-storage-rest-client';
|
|
62
|
+
|
|
63
|
+
const client = new BlobStorageRestClient({
|
|
64
|
+
endpoint: 'https://api.example.com',
|
|
65
|
+
pathPrefix: '/v1'
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const conditions: EntityCondition<IBlobStorageEntry> = {
|
|
69
|
+
logicalOperator: LogicalOperator.And,
|
|
70
|
+
conditions: [
|
|
71
|
+
{
|
|
72
|
+
property: 'encodingFormat',
|
|
73
|
+
comparison: ComparisonOperator.Equals,
|
|
74
|
+
value: 'text/plain'
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const queryResult = await client.query(conditions, 'dateCreated', SortDirection.Descending, '', 25);
|
|
80
|
+
console.log(queryResult.entries.itemListElement.length); // 1
|
|
81
|
+
console.log(queryResult.cursor); // eyJwYWdlIjoyfQ==
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { BlobStorageRestClient } from '@twin.org/blob-storage-rest-client';
|
|
86
|
+
|
|
87
|
+
const client = new BlobStorageRestClient({
|
|
88
|
+
endpoint: 'https://api.example.com',
|
|
89
|
+
pathPrefix: '/v1'
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const blobId = 'blob:urn:blob:file:4ef42bb1b8d31f0c';
|
|
93
|
+
const downloadLink = client.createDownloadLink(blobId, true, 'report.txt');
|
|
94
|
+
console.log(downloadLink); // https://api.example.com/v1/blob/blob:urn:blob:file:4ef42bb1b8d31f0c/content?download=true&filename=report.txt
|
|
95
|
+
|
|
96
|
+
await client.remove(blobId);
|
|
97
|
+
console.log(blobId); // blob:urn:blob:file:4ef42bb1b8d31f0c
|
|
98
|
+
```
|
|
@@ -36,7 +36,7 @@ The configuration for the client.
|
|
|
36
36
|
|
|
37
37
|
## Properties
|
|
38
38
|
|
|
39
|
-
### CLASS\_NAME
|
|
39
|
+
### CLASS\_NAME {#class_name}
|
|
40
40
|
|
|
41
41
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ Runtime name for the class.
|
|
|
44
44
|
|
|
45
45
|
## Methods
|
|
46
46
|
|
|
47
|
-
### className()
|
|
47
|
+
### className() {#classname}
|
|
48
48
|
|
|
49
49
|
> **className**(): `string`
|
|
50
50
|
|
|
@@ -62,7 +62,7 @@ The class name of the component.
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
### create()
|
|
65
|
+
### create() {#create}
|
|
66
66
|
|
|
67
67
|
> **create**(`blob`, `encodingFormat?`, `fileExtension?`, `metadata?`, `options?`): `Promise`\<`string`\>
|
|
68
68
|
|
|
@@ -128,7 +128,7 @@ The id of the stored blob in urn format.
|
|
|
128
128
|
|
|
129
129
|
***
|
|
130
130
|
|
|
131
|
-
### get()
|
|
131
|
+
### get() {#get}
|
|
132
132
|
|
|
133
133
|
> **get**(`id`, `options?`): `Promise`\<`IBlobStorageEntry`\>
|
|
134
134
|
|
|
@@ -180,7 +180,7 @@ Not found error if the blob cannot be found.
|
|
|
180
180
|
|
|
181
181
|
***
|
|
182
182
|
|
|
183
|
-
### update()
|
|
183
|
+
### update() {#update}
|
|
184
184
|
|
|
185
185
|
> **update**(`id`, `encodingFormat?`, `fileExtension?`, `metadata?`): `Promise`\<`void`\>
|
|
186
186
|
|
|
@@ -228,7 +228,7 @@ Not found error if the blob cannot be found.
|
|
|
228
228
|
|
|
229
229
|
***
|
|
230
230
|
|
|
231
|
-
### remove()
|
|
231
|
+
### remove() {#remove}
|
|
232
232
|
|
|
233
233
|
> **remove**(`id`): `Promise`\<`void`\>
|
|
234
234
|
|
|
@@ -254,7 +254,7 @@ Nothing.
|
|
|
254
254
|
|
|
255
255
|
***
|
|
256
256
|
|
|
257
|
-
### query()
|
|
257
|
+
### query() {#query}
|
|
258
258
|
|
|
259
259
|
> **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `cursor?`, `limit?`): `Promise`\<\{ `entries`: `IBlobStorageEntryList`; `cursor?`: `string`; \}\>
|
|
260
260
|
|
|
@@ -270,9 +270,9 @@ The conditions to match for the entries.
|
|
|
270
270
|
|
|
271
271
|
##### orderBy?
|
|
272
272
|
|
|
273
|
-
|
|
273
|
+
`"dateCreated"` \| `"dateModified"`
|
|
274
274
|
|
|
275
|
-
|
|
275
|
+
The order for the results, defaults to created.
|
|
276
276
|
|
|
277
277
|
##### orderByDirection?
|
|
278
278
|
|
|
@@ -305,7 +305,7 @@ and a cursor which can be used to request more entities.
|
|
|
305
305
|
|
|
306
306
|
***
|
|
307
307
|
|
|
308
|
-
### createDownloadLink()
|
|
308
|
+
### createDownloadLink() {#createdownloadlink}
|
|
309
309
|
|
|
310
310
|
> **createDownloadLink**(`id`, `download?`, `filename?`): `string`
|
|
311
311
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/blob-storage-rest-client",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.8",
|
|
4
|
+
"description": "Offers client utilities for calling blob service endpoints with consistent request handling.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/blob-storage.git",
|
|
8
8
|
"directory": "packages/blob-storage-rest-client"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/api-core": "next",
|
|
18
18
|
"@twin.org/api-models": "next",
|
|
19
|
-
"@twin.org/blob-storage-models": "0.0.3-next.
|
|
19
|
+
"@twin.org/blob-storage-models": "0.0.3-next.8",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/data-json-ld": "next",
|
|
22
22
|
"@twin.org/entity": "next",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"binary"
|
|
53
53
|
],
|
|
54
54
|
"bugs": {
|
|
55
|
-
"url": "git+https://github.com/
|
|
55
|
+
"url": "git+https://github.com/iotaledger/blob-storage/issues"
|
|
56
56
|
},
|
|
57
57
|
"homepage": "https://twindev.org"
|
|
58
58
|
}
|