From 8d71844902a3f6dc33845b18f5dad8d80d251f9d Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Mon, 12 Nov 2018 12:36:31 +0100 Subject: [PATCH] fix doc generation --- src/examples/SignAgreement.ts | 40 +++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/examples/SignAgreement.ts b/src/examples/SignAgreement.ts index 7e1da3b..87e2043 100644 --- a/src/examples/SignAgreement.ts +++ b/src/examples/SignAgreement.ts @@ -1,5 +1,5 @@ -import MetaData from "../../test/testdata/MetaData" import DDO from "../ddo/DDO" +import MetaData from "../ddo/MetaData" import IdGenerator from "../ocean/IdGenerator" import {Account, Logger, Ocean} from "../squid" @@ -18,7 +18,43 @@ import {Account, Logger, Ocean} from "../squid" const publisher: Account = (await ocean.getAccounts())[0] const consumer: Account = (await ocean.getAccounts())[1] - const ddo: DDO = await ocean.registerAsset(MetaData, publisher) + const metaData = { + base: { + name: "Office Humidity", + type: "dataset", + description: "Weather information of UK including temperature and humidity", + size: "3.1gb", + dateCreated: "2012-02-01T10:55:11+00:00", + author: "Met Office", + license: "CC-BY", + copyrightHolder: "Met Office", + encoding: "UTF-8", + compression: "zip", + contentType: "text/csv", + // tslint:disable-next-line + workExample: "stationId,latitude,longitude,datetime,temperature,humidity423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", + contentUrls: [ + "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", + "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", + ], + links: [ + { + sample1: "http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/", + }, + { + sample2: "http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/", + }, + { + fieldsDescription: "http://data.ceda.ac.uk/badc/ukcp09/", + }, + ], + inLanguage: "en", + tags: "weather, uk, 2011, temperature, humidity", + price: 10, + }, + } + + const ddo: DDO = await ocean.registerAsset(metaData as MetaData, publisher) Logger.log("did", ddo.id) const serviceAgreementId: string = IdGenerator.generateId()