@ardrive/turbo-sdk 1.2.0-alpha.1 → 1.2.0
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 +17 -2
- package/bundles/web.bundle.min.js +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# @ardriveapp/turbo-sdk 🚀
|
2
2
|
|
3
|
+
[](https://codecov.io/gh/ardriveapp/turbo-sdk)
|
4
|
+
|
3
5
|
Welcome to the `@ardrive/turbo-sdk`! This SDK provides functionality for interacting with the Turbo Upload and Payment Services and is available for both NodeJS and Web environments.
|
4
6
|
|
5
7
|
## Table of Contents
|
@@ -353,7 +355,7 @@ Types are exported from `./lib/types/[node/web]/index.d.ts` and should be automa
|
|
353
355
|
}
|
354
356
|
```
|
355
357
|
|
356
|
-
- `uploadFile({ fileStreamFactory, fileSizeFactory, signal })` - Signs and uploads a raw file. The provided `fileStreamFactory` should produce a NEW file data stream each time is it invoked. The `fileSizeFactory` is a function that returns the size of the file. The `signal` is an optional [AbortSignal] that can be used to cancel the upload or timeout the request.
|
358
|
+
- `uploadFile({ fileStreamFactory, fileSizeFactory, signal, dataItemOpts })` - Signs and uploads a raw file. The provided `fileStreamFactory` should produce a NEW file data stream each time is it invoked. The `fileSizeFactory` is a function that returns the size of the file. The `signal` is an optional [AbortSignal] that can be used to cancel the upload or timeout the request. `dataItemOpts` is an optional object that can be used to configure tags, target, and anchor for the data item upload.
|
357
359
|
|
358
360
|
```typescript
|
359
361
|
const filePath = path.join(__dirname, './my-unsigned-file.txt');
|
@@ -361,7 +363,20 @@ Types are exported from `./lib/types/[node/web]/index.d.ts` and should be automa
|
|
361
363
|
const uploadResult = await turbo.uploadFile({
|
362
364
|
fileStreamFactory: () => fs.createReadStream(filePath),
|
363
365
|
fileSizeFactory: () => fileSize,
|
364
|
-
|
366
|
+
dataItemOpts: {
|
367
|
+
// optional
|
368
|
+
tags: [
|
369
|
+
{
|
370
|
+
name: 'Content-Type',
|
371
|
+
value: 'text/plain',
|
372
|
+
},
|
373
|
+
{
|
374
|
+
name: 'My-Custom-Tag',
|
375
|
+
value: 'my-custom-value',
|
376
|
+
},
|
377
|
+
],
|
378
|
+
// no timeout or AbortSignal provided
|
379
|
+
},
|
365
380
|
});
|
366
381
|
```
|
367
382
|
|
@@ -124471,7 +124471,7 @@ var import_winston = __toESM(require_winston(), 1);
|
|
124471
124471
|
init_dirname();
|
124472
124472
|
init_buffer2();
|
124473
124473
|
init_process2();
|
124474
|
-
var version3 = "1.
|
124474
|
+
var version3 = "1.2.0-alpha.1";
|
124475
124475
|
|
124476
124476
|
// src/common/logger.ts
|
124477
124477
|
var TurboWinstonLogger = class {
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/version.js
CHANGED
package/lib/types/version.d.ts
CHANGED
@@ -14,5 +14,5 @@
|
|
14
14
|
* You should have received a copy of the GNU Affero General Public License
|
15
15
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
16
|
*/
|
17
|
-
export declare const version = "1.
|
17
|
+
export declare const version = "1.2.0-alpha.1";
|
18
18
|
//# sourceMappingURL=version.d.ts.map
|