@twin.org/blob-storage-rest-client 0.0.3-next.7 → 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 +57 -43
- 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,20 @@
|
|
|
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)
|
|
4
18
|
|
|
5
19
|
|
|
6
20
|
### Miscellaneous Chores
|
|
@@ -14,7 +28,7 @@
|
|
|
14
28
|
* dependencies
|
|
15
29
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
16
30
|
|
|
17
|
-
## [0.0.3-next.6](https://github.com/
|
|
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)
|
|
18
32
|
|
|
19
33
|
|
|
20
34
|
### Miscellaneous Chores
|
|
@@ -28,7 +42,7 @@
|
|
|
28
42
|
* dependencies
|
|
29
43
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
30
44
|
|
|
31
|
-
## [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)
|
|
32
46
|
|
|
33
47
|
|
|
34
48
|
### Miscellaneous Chores
|
|
@@ -42,12 +56,12 @@
|
|
|
42
56
|
* dependencies
|
|
43
57
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
44
58
|
|
|
45
|
-
## [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)
|
|
46
60
|
|
|
47
61
|
|
|
48
62
|
### Features
|
|
49
63
|
|
|
50
|
-
* 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))
|
|
51
65
|
|
|
52
66
|
|
|
53
67
|
### Dependencies
|
|
@@ -56,7 +70,7 @@
|
|
|
56
70
|
* dependencies
|
|
57
71
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
58
72
|
|
|
59
|
-
## [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)
|
|
60
74
|
|
|
61
75
|
|
|
62
76
|
### Miscellaneous Chores
|
|
@@ -70,7 +84,7 @@
|
|
|
70
84
|
* dependencies
|
|
71
85
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
72
86
|
|
|
73
|
-
## [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)
|
|
74
88
|
|
|
75
89
|
|
|
76
90
|
### Miscellaneous Chores
|
|
@@ -84,19 +98,19 @@
|
|
|
84
98
|
* dependencies
|
|
85
99
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
86
100
|
|
|
87
|
-
## [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)
|
|
88
102
|
|
|
89
103
|
|
|
90
104
|
### Features
|
|
91
105
|
|
|
92
|
-
* add compression support ([67d239b](https://github.com/
|
|
93
|
-
* add context id features ([#30](https://github.com/
|
|
94
|
-
* add validate-locales ([f20fcec](https://github.com/
|
|
95
|
-
* additional encryption options on per item basis ([4b95a65](https://github.com/
|
|
96
|
-
* eslint migration to flat config ([e4239dd](https://github.com/
|
|
97
|
-
* update dependencies ([56f0094](https://github.com/
|
|
98
|
-
* update framework core ([ff339fe](https://github.com/
|
|
99
|
-
* 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))
|
|
100
114
|
|
|
101
115
|
|
|
102
116
|
### Dependencies
|
|
@@ -105,12 +119,12 @@
|
|
|
105
119
|
* dependencies
|
|
106
120
|
* @twin.org/blob-storage-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
107
121
|
|
|
108
|
-
## [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)
|
|
109
123
|
|
|
110
124
|
|
|
111
125
|
### Features
|
|
112
126
|
|
|
113
|
-
* add validate-locales ([f20fcec](https://github.com/
|
|
127
|
+
* add validate-locales ([f20fcec](https://github.com/iotaledger/twin-blob-storage/commit/f20fceced91e39a0c9edb770b2e43ce944c92f3c))
|
|
114
128
|
|
|
115
129
|
|
|
116
130
|
### Dependencies
|
|
@@ -119,7 +133,7 @@
|
|
|
119
133
|
* dependencies
|
|
120
134
|
* @twin.org/blob-storage-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
121
135
|
|
|
122
|
-
## [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)
|
|
123
137
|
|
|
124
138
|
|
|
125
139
|
### Miscellaneous Chores
|
|
@@ -133,12 +147,12 @@
|
|
|
133
147
|
* dependencies
|
|
134
148
|
* @twin.org/blob-storage-models bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
135
149
|
|
|
136
|
-
## [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)
|
|
137
151
|
|
|
138
152
|
|
|
139
153
|
### Features
|
|
140
154
|
|
|
141
|
-
* 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))
|
|
142
156
|
|
|
143
157
|
|
|
144
158
|
### Dependencies
|
|
@@ -147,12 +161,12 @@
|
|
|
147
161
|
* dependencies
|
|
148
162
|
* @twin.org/blob-storage-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
149
163
|
|
|
150
|
-
## [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)
|
|
151
165
|
|
|
152
166
|
|
|
153
167
|
### Features
|
|
154
168
|
|
|
155
|
-
* update framework core ([ff339fe](https://github.com/
|
|
169
|
+
* update framework core ([ff339fe](https://github.com/iotaledger/twin-blob-storage/commit/ff339fe7e3f09ddff429907834bdf43617e9c05e))
|
|
156
170
|
|
|
157
171
|
|
|
158
172
|
### Dependencies
|
|
@@ -161,15 +175,15 @@
|
|
|
161
175
|
* dependencies
|
|
162
176
|
* @twin.org/blob-storage-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
163
177
|
|
|
164
|
-
## [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)
|
|
165
179
|
|
|
166
180
|
|
|
167
181
|
### Features
|
|
168
182
|
|
|
169
|
-
* add compression support ([67d239b](https://github.com/
|
|
170
|
-
* additional encryption options on per item basis ([4b95a65](https://github.com/
|
|
171
|
-
* update dependencies ([56f0094](https://github.com/
|
|
172
|
-
* 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))
|
|
173
187
|
|
|
174
188
|
|
|
175
189
|
### Dependencies
|
|
@@ -183,7 +197,7 @@
|
|
|
183
197
|
|
|
184
198
|
### Features
|
|
185
199
|
|
|
186
|
-
* release to production ([eacfe75](https://github.com/
|
|
200
|
+
* release to production ([eacfe75](https://github.com/iotaledger/twin-blob-storage/commit/eacfe754a0dcd9243d9e13d86422327d0a605164))
|
|
187
201
|
|
|
188
202
|
|
|
189
203
|
### Dependencies
|
|
@@ -192,7 +206,7 @@
|
|
|
192
206
|
* dependencies
|
|
193
207
|
* @twin.org/blob-storage-models bumped from ^0.0.0 to ^0.0.1
|
|
194
208
|
|
|
195
|
-
## [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)
|
|
196
210
|
|
|
197
211
|
|
|
198
212
|
### Miscellaneous Chores
|
|
@@ -206,12 +220,12 @@
|
|
|
206
220
|
* dependencies
|
|
207
221
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.36 to 0.0.1-next.37
|
|
208
222
|
|
|
209
|
-
## [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)
|
|
210
224
|
|
|
211
225
|
|
|
212
226
|
### Features
|
|
213
227
|
|
|
214
|
-
* add compression support ([67d239b](https://github.com/
|
|
228
|
+
* add compression support ([67d239b](https://github.com/iotaledger/twin-blob-storage/commit/67d239bca8321bd90bf4ff93167c564130309730))
|
|
215
229
|
|
|
216
230
|
|
|
217
231
|
### Dependencies
|
|
@@ -220,12 +234,12 @@
|
|
|
220
234
|
* dependencies
|
|
221
235
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.35 to 0.0.1-next.36
|
|
222
236
|
|
|
223
|
-
## [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)
|
|
224
238
|
|
|
225
239
|
|
|
226
240
|
### Features
|
|
227
241
|
|
|
228
|
-
* 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))
|
|
229
243
|
|
|
230
244
|
|
|
231
245
|
### Dependencies
|
|
@@ -234,12 +248,12 @@
|
|
|
234
248
|
* dependencies
|
|
235
249
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.34 to 0.0.1-next.35
|
|
236
250
|
|
|
237
|
-
## [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)
|
|
238
252
|
|
|
239
253
|
|
|
240
254
|
### Features
|
|
241
255
|
|
|
242
|
-
* update dependencies ([56f0094](https://github.com/
|
|
256
|
+
* update dependencies ([56f0094](https://github.com/iotaledger/twin-blob-storage/commit/56f0094b68d8bd22864cd899ac1b61d95540f719))
|
|
243
257
|
|
|
244
258
|
|
|
245
259
|
### Dependencies
|
|
@@ -248,7 +262,7 @@
|
|
|
248
262
|
* dependencies
|
|
249
263
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.33 to 0.0.1-next.34
|
|
250
264
|
|
|
251
|
-
## [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)
|
|
252
266
|
|
|
253
267
|
|
|
254
268
|
### Miscellaneous Chores
|
|
@@ -262,7 +276,7 @@
|
|
|
262
276
|
* dependencies
|
|
263
277
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.32 to 0.0.1-next.33
|
|
264
278
|
|
|
265
|
-
## [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)
|
|
266
280
|
|
|
267
281
|
|
|
268
282
|
### Miscellaneous Chores
|
|
@@ -276,7 +290,7 @@
|
|
|
276
290
|
* dependencies
|
|
277
291
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.31 to 0.0.1-next.32
|
|
278
292
|
|
|
279
|
-
## [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)
|
|
280
294
|
|
|
281
295
|
|
|
282
296
|
### Miscellaneous Chores
|
|
@@ -290,12 +304,12 @@
|
|
|
290
304
|
* dependencies
|
|
291
305
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.30 to 0.0.1-next.31
|
|
292
306
|
|
|
293
|
-
## [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)
|
|
294
308
|
|
|
295
309
|
|
|
296
310
|
### Features
|
|
297
311
|
|
|
298
|
-
* 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))
|
|
299
313
|
|
|
300
314
|
|
|
301
315
|
### Dependencies
|
|
@@ -304,7 +318,7 @@
|
|
|
304
318
|
* dependencies
|
|
305
319
|
* @twin.org/blob-storage-models bumped from 0.0.1-next.29 to 0.0.1-next.30
|
|
306
320
|
|
|
307
|
-
## [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)
|
|
308
322
|
|
|
309
323
|
|
|
310
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
|
}
|