wao 0.10.8 → 0.11.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/cjs/bao.js CHANGED
@@ -214,25 +214,26 @@ var AO = /*#__PURE__*/function (_MAO) {
214
214
  "Memory-Limit": "1-gb",
215
215
  "Compute-Limit": "9000000000000"
216
216
  });
217
+ console.log(tags, t);
217
218
  signer = (0, _aoconnect.createDataItemSigner)(jwk);
218
- _context5.next = 13;
219
+ _context5.next = 14;
219
220
  return this.ar.dataitem({
220
221
  tags: t,
221
222
  data: data,
222
223
  signer: signer
223
224
  });
224
- case 13:
225
+ case 14:
225
226
  _yield$this$ar$datait = _context5.sent;
226
227
  id = _yield$this$ar$datait.id;
227
228
  owner = _yield$this$ar$datait.owner;
228
229
  item = _yield$this$ar$datait.item;
229
- _context5.next = 19;
230
+ _context5.next = 20;
230
231
  return this.ar.postItems(item, jwk);
231
- case 19:
232
+ case 20:
232
233
  return _context5.abrupt("return", {
233
234
  id: id
234
235
  });
235
- case 20:
236
+ case 21:
236
237
  case "end":
237
238
  return _context5.stop();
238
239
  }
Binary file
package/cjs/weavedrive.js CHANGED
@@ -359,17 +359,17 @@ var WeaveDrive = exports["default"] = /*#__PURE__*/_createClass(function WeaveDr
359
359
  case 21:
360
360
  data = _context6.sent;
361
361
  // Extract the Range header to determine the start and end of the requested chunk
362
- start = 0;
363
- end = data.length; // Create a ReadableStream for the requested chunk
362
+ start = stream.position;
363
+ end = to; // Create a ReadableStream for the requested chunk
364
364
  chunk = data.subarray(start, end);
365
365
  response = new Response(new ReadableStream({
366
366
  start: function start(controller) {
367
- controller.enqueue(chunk); // Push the chunk to the stream
368
- controller.close(); // Close the stream when done
367
+ controller.enqueue(chunk);
368
+ controller.close();
369
369
  }
370
370
  }), {
371
371
  headers: {
372
- "Content-Length": chunk.length.toString()
372
+ "content-length": chunk.length.toString()
373
373
  }
374
374
  });
375
375
  reader = response.body.getReader();
package/esm/bao.js CHANGED
@@ -111,6 +111,7 @@ class AO extends MAO {
111
111
  "Memory-Limit": "1-gb",
112
112
  "Compute-Limit": "9000000000000",
113
113
  })
114
+ console.log(tags, t)
114
115
  const signer = createDataItemSigner(jwk)
115
116
  const { id, owner, item } = await this.ar.dataitem({
116
117
  tags: t,
Binary file
package/esm/weavedrive.js CHANGED
@@ -182,6 +182,7 @@ export default class WeaveDrive {
182
182
  return 0
183
183
  }
184
184
  },
185
+
185
186
  async read(fd, raw_dst_ptr, raw_length) {
186
187
  // Note: The length and dst_ptr are 53 bit integers in JS, so this _should_ be ok into a large memspace.
187
188
  var to_read = Number(raw_length)
@@ -225,20 +226,20 @@ export default class WeaveDrive {
225
226
  // fetch(`/${stream.node.name}`)
226
227
  const data = await ar.data(stream.node.name, null, log)
227
228
  // Extract the Range header to determine the start and end of the requested chunk
228
- const start = 0
229
- const end = data.length
229
+ const start = stream.position
230
+ const end = to
230
231
 
231
232
  // Create a ReadableStream for the requested chunk
232
233
  const chunk = data.subarray(start, end)
233
234
  const response = new Response(
234
235
  new ReadableStream({
235
236
  start(controller) {
236
- controller.enqueue(chunk) // Push the chunk to the stream
237
- controller.close() // Close the stream when done
237
+ controller.enqueue(chunk)
238
+ controller.close()
238
239
  },
239
240
  }),
240
241
  {
241
- headers: { "Content-Length": chunk.length.toString() },
242
+ headers: { "content-length": chunk.length.toString() },
242
243
  },
243
244
  )
244
245
  const reader = response.body.getReader()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wao",
3
- "version": "0.10.8",
3
+ "version": "0.11.0",
4
4
  "bin": {
5
5
  "wao": "./cjs/cli.js",
6
6
  "wao-esm": "./esm/cli.js"