@graphprotocol/graph-cli 0.45.2-alpha-20230410191455-0bacda4 → 0.45.2-alpha-20230410222440-0e49b73

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
- ## 0.45.2-alpha-20230410191455-0bacda4
3
+ ## 0.45.2-alpha-20230410222440-0e49b73
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -10,6 +10,8 @@
10
10
  - Updated dependency
11
11
  [`ipfs-http-client@55.0.0` ↗︎](https://www.npmjs.com/package/ipfs-http-client/v/55.0.0) (from
12
12
  `34.0.0`, in `dependencies`)
13
+ - Updated dependency [`jayson@4.0.0` ↗︎](https://www.npmjs.com/package/jayson/v/4.0.0) (from
14
+ `3.7.0`, in `dependencies`)
13
15
 
14
16
  ## 0.45.1
15
17
 
@@ -449,9 +449,15 @@ class Compiler {
449
449
  }
450
450
  async _uploadToIPFS(file) {
451
451
  try {
452
- const hash = await this.ipfs.add(file);
453
- await this.ipfs.pin.add(hash.cid);
454
- return hash.toString();
452
+ const files = this.ipfs.addAll([file]);
453
+ // We get back async iterable
454
+ const filesIterator = files[Symbol.asyncIterator]();
455
+ // We only care about the first item, since that is the file, rest could be directories
456
+ const { value } = await filesIterator.next();
457
+ // we grab the file and pin it
458
+ const uploadedFile = value;
459
+ await this.ipfs.pin.add(uploadedFile.cid);
460
+ return uploadedFile.cid.toString();
455
461
  }
456
462
  catch (e) {
457
463
  throw Error(`Failed to upload file to IPFS: ${e.message}`);
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.45.2-alpha-20230410191455-0bacda4",
2
+ "version": "0.45.2-alpha-20230410222440-0e49b73",
3
3
  "commands": {
4
4
  "add": {
5
5
  "id": "add",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphprotocol/graph-cli",
3
- "version": "0.45.2-alpha-20230410191455-0bacda4",
3
+ "version": "0.45.2-alpha-20230410222440-0e49b73",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {
@@ -33,7 +33,7 @@
33
33
  "graphql": "15.5.0",
34
34
  "immutable": "4.2.1",
35
35
  "ipfs-http-client": "55.0.0",
36
- "jayson": "3.7.0",
36
+ "jayson": "4.0.0",
37
37
  "js-yaml": "3.14.1",
38
38
  "prettier": "1.19.1",
39
39
  "request": "2.88.2",