From a651279a23b5305b7b9ae57f6f8d336dc29c859f Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Sun, 9 Feb 2020 22:23:43 +0000 Subject: [PATCH 1/2] feat: metadata for ipfs.get Pack file `mtime` and `mode` if set Depends on: * [ ] https://github.com/ipfs/js-ipfs/pull/2758 * [ ] https://github.com/ipfs/js-ipfs-http-client/pull/1235 --- package.json | 2 +- src/http/api/resources/files-regular.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dc94d3f58b..adf4935aa2 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "ipfs-bitswap": "^0.27.0", "ipfs-block": "~0.8.1", "ipfs-block-service": "~0.16.0", - "ipfs-http-client": "^42.0.0", + "ipfs-http-client": "github:ipfs/js-ipfs-http-client#feat/meta-for-get", "ipfs-http-response": "^0.5.0", "ipfs-mfs": "^1.0.0", "ipfs-multipart": "^0.3.0", diff --git a/src/http/api/resources/files-regular.js b/src/http/api/resources/files-regular.js index 5d4e728e5f..809ee18cff 100644 --- a/src/http/api/resources/files-regular.js +++ b/src/http/api/resources/files-regular.js @@ -95,7 +95,9 @@ exports.get = { async function * (source) { for await (const file of source) { const header = { - name: file.path + name: file.path, + mtime: file.mtime ? new Date(file.mtime.secs * 1000) : null, + mode: file.mode } if (file.content) { From 9eaf0b33de40a8d81b193fd06c51ffffbf18ac87 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Sun, 9 Feb 2020 22:53:58 +0000 Subject: [PATCH 2/2] chore: update interface-ipfs-core dep --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index adf4935aa2..aaa2a26fde 100644 --- a/package.json +++ b/package.json @@ -184,7 +184,7 @@ "form-data": "^3.0.0", "go-ipfs-dep": "^0.4.23", "hat": "0.0.3", - "interface-ipfs-core": "^0.131.7", + "interface-ipfs-core": "github:ipfs/interface-js-ipfs-core#test/meta-for-get", "ipfs-interop": "github:ipfs/interop#refactor/async-await", "ipfsd-ctl": "github:ipfs/js-ipfsd-ctl#remove-option-normalisation", "ncp": "^2.0.0",