pinata 2.2.1 → 2.3.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/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +43 -49
package/dist/index.mjs
CHANGED
|
@@ -2551,6 +2551,9 @@ var createSignedUploadURL = async (config, options, network) => {
|
|
|
2551
2551
|
if (network) {
|
|
2552
2552
|
payload.network = network;
|
|
2553
2553
|
}
|
|
2554
|
+
if (options.streamable) {
|
|
2555
|
+
payload.streamable = options.streamable;
|
|
2556
|
+
}
|
|
2554
2557
|
if (options.maxFileSize) {
|
|
2555
2558
|
payload.max_file_size = options.maxFileSize;
|
|
2556
2559
|
}
|
|
@@ -2665,6 +2668,9 @@ var uploadFile = async (config, file, network, options) => {
|
|
|
2665
2668
|
if (options?.metadata?.keyvalues) {
|
|
2666
2669
|
metadata + `,keyvalues ${btoa(JSON.stringify(options.metadata.keyvalues))}`;
|
|
2667
2670
|
}
|
|
2671
|
+
if (options?.streamable) {
|
|
2672
|
+
metadata + `,keyvalues ${btoa("true")}`;
|
|
2673
|
+
}
|
|
2668
2674
|
let updatedEndpoint = `${endpoint}/files`;
|
|
2669
2675
|
if (options?.url) {
|
|
2670
2676
|
updatedEndpoint = options.url;
|
|
@@ -2792,6 +2798,9 @@ var uploadFile = async (config, file, network, options) => {
|
|
|
2792
2798
|
if (options?.metadata?.keyvalues) {
|
|
2793
2799
|
data.append("keyvalues", JSON.stringify(options.metadata.keyvalues));
|
|
2794
2800
|
}
|
|
2801
|
+
if (options?.streamable) {
|
|
2802
|
+
data.append("streamable", "true");
|
|
2803
|
+
}
|
|
2795
2804
|
if (options?.url) {
|
|
2796
2805
|
try {
|
|
2797
2806
|
const request = await fetch(options.url, {
|
|
@@ -4172,7 +4181,7 @@ var FilterQueue = class {
|
|
|
4172
4181
|
async *[Symbol.asyncIterator]() {
|
|
4173
4182
|
while (true) {
|
|
4174
4183
|
const items = await this.fetchPage();
|
|
4175
|
-
for (const item of items.
|
|
4184
|
+
for (const item of items.jobs) {
|
|
4176
4185
|
yield item;
|
|
4177
4186
|
}
|
|
4178
4187
|
if (!this.currentPageToken) {
|
|
@@ -4315,6 +4324,10 @@ var UploadBuilder = class {
|
|
|
4315
4324
|
this.groupId = groupId;
|
|
4316
4325
|
return this;
|
|
4317
4326
|
}
|
|
4327
|
+
streamable() {
|
|
4328
|
+
this.isStreamable = true;
|
|
4329
|
+
return this;
|
|
4330
|
+
}
|
|
4318
4331
|
peerAddress(peerAddresses) {
|
|
4319
4332
|
this.peerAddresses = peerAddresses;
|
|
4320
4333
|
return this;
|
|
@@ -4336,6 +4349,9 @@ var UploadBuilder = class {
|
|
|
4336
4349
|
if (this.uploadUrl) {
|
|
4337
4350
|
options.url = this.uploadUrl;
|
|
4338
4351
|
}
|
|
4352
|
+
if (this.isStreamable) {
|
|
4353
|
+
options.streamable = this.isStreamable;
|
|
4354
|
+
}
|
|
4339
4355
|
if (this.peerAddresses) {
|
|
4340
4356
|
options.peerAddresses = this.peerAddresses;
|
|
4341
4357
|
}
|