From b9b63dabe9e03e0640563dca3a3d9191f08d8005 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 13:24:36 +0100 Subject: [PATCH] DDO updates, contentLength as string --- src/ddo/MetaData.ts | 24 +++++++++--------------- test/ddo/DDO.test.ts | 4 ++-- test/testdata/ddo.json | 6 ++---- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/ddo/MetaData.ts b/src/ddo/MetaData.ts index 57af3b7..6a40258 100644 --- a/src/ddo/MetaData.ts +++ b/src/ddo/MetaData.ts @@ -84,7 +84,14 @@ export interface File { * File index. * @type {number} */ - index?: number + index: number + + /** + * File format, if applicable. + * @type {string} + * @example "text/csv" + */ + contentType: string /** * File checksum. @@ -102,7 +109,7 @@ export interface File { * File content length. * @type {[type]} */ - contentLength?: number + contentLength?: string /** * Resource ID (depending on the source). @@ -123,13 +130,6 @@ export interface File { * @example "zip" */ compression?: string - - /** - * File format, if applicable. - * @type {string} - * @example "text/csv" - */ - contentType?: string } /** @@ -197,12 +197,6 @@ export interface MetaDataMain { */ files: File[] - /** - * SHA3 hash of concatenated values: [list of all file checksums] + name + author + license + did - * @type {string} - */ - checksum?: string - encryptedService?: any workflow?: Workflow diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index 5b8ae3f..f4a0b31 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -101,14 +101,14 @@ describe('DDO', () => { { index: 0, checksum: 'efb2c764274b745f5fc37f97c6b0e761', - contentLength: 4535431, + contentLength: '4535431', contentType: 'application/json', resourceId: 'access-log2018-02-13-15-17-29-18386C502CAEA932' }, { index: 1, checksum: '085340abffh21495345af97c6b0e761', - contentLength: 12324, + contentLength: '12324', contentType: 'application/json' }, { diff --git a/test/testdata/ddo.json b/test/testdata/ddo.json index 2e75886..e8b6a2e 100644 --- a/test/testdata/ddo.json +++ b/test/testdata/ddo.json @@ -166,7 +166,7 @@ "index": 0, "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", "checksum": "085340abffh21495345af97c6b0e761", - "contentLength": 12324 + "contentLength": "12324" }, { "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp2.zip" @@ -182,9 +182,7 @@ "description": "Weather information of UK including temperature and humidity", "copyrightHolder": "Met Office", "workExample": "423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", - "contentUrls": [ - "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip" - ], + "contentUrls": ["https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip"], "links": [ { "name": "Sample of Asset Data",