1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/integration/utils/ddo-metadata-generator.js
2020-01-17 15:35:11 +01:00

59 lines
2.2 KiB
JavaScript

"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
exports.__esModule = true;
var metadata = {
main: {
name: undefined,
type: 'dataset',
dateCreated: '2012-10-10T17:00:00Z',
datePublished: '2012-10-10T17:00:00Z',
author: 'Met Office',
license: 'CC-BY',
price: '21' + '0'.repeat(18),
files: [
{
index: 0,
contentType: 'application/json',
url: 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/package.json'
},
{
index: 1,
contentType: 'text/plain',
url: 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/README.md'
}
]
},
additionalInformation: {
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',
links: [
{
name: 'Sample of Asset Data',
type: 'sample',
url: 'https://foo.com/sample.csv'
},
{
name: 'Data Format Definition',
type: 'format',
url: 'https://foo.com/sample.csv'
}
],
inLanguage: 'en',
categories: ['Economy', 'Data Science'],
tags: ['weather', 'uk', '2011', 'temperature', 'humidity']
}
};
exports.generateMetadata = function (name, price) { return (__assign(__assign({}, metadata), { main: __assign(__assign({}, metadata.main), { name: name, price: (price || 21) + '0'.repeat(18) }), additionalInformation: __assign({}, metadata.additionalInformation) })); };
exports.getMetadata = function (price) { return exports.generateMetadata('TestAsset', price); };