feat(hex): Support for releaseTimestamp field (#5677)

This commit is contained in:
Sergio Zharinov 2020-03-09 21:53:00 +04:00 committed by GitHub
parent 3371b95403
commit b0537c7f0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 92 additions and 9 deletions

View file

@ -1,20 +1,22 @@
{ {
"docs_html_url": null, "docs_html_url": null,
"downloads": { "downloads": {
"all": 7801231, "all": 20861717,
"day": 4550, "day": 5846,
"recent": 1186862, "recent": 3725020,
"week": 107546 "week": 438801
}, },
"html_url": "https://hex.pm/packages/certifi", "html_url": "https://hex.pm/packages/certifi",
"inserted_at": "2015-09-10T13:58:43.376194Z", "inserted_at": "2015-09-10T13:58:43.376194Z",
"meta": { "meta": {
"description": "CA bundle adapted from Mozilla by https://certifi.io", "description": "CA bundle adapted from Mozilla by https://certifi.io",
"licenses": ["BSD"], "licenses": [
"BSD"
],
"links": { "links": {
"Github": "https://github.com/certifi/erlang-certifi" "Github": "https://github.com/certifi/erlang-certifi"
}, },
"maintainers": ["Benoit Chesneau"] "maintainers": []
}, },
"name": "certifi", "name": "certifi",
"owners": [ "owners": [
@ -27,102 +29,127 @@
"releases": [ "releases": [
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2020-03-04T14:54:16.283323Z",
"url": "https://hex.pm/api/packages/certifi/releases/2.5.2",
"version": "2.5.2"
},
{
"has_docs": false,
"inserted_at": "2019-01-24T15:14:25.991190Z",
"url": "https://hex.pm/api/packages/certifi/releases/2.5.1", "url": "https://hex.pm/api/packages/certifi/releases/2.5.1",
"version": "2.5.1" "version": "2.5.1"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2018-08-30T08:21:29.349366Z",
"url": "https://hex.pm/api/packages/certifi/releases/2.4.2", "url": "https://hex.pm/api/packages/certifi/releases/2.4.2",
"version": "2.4.2" "version": "2.4.2"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2018-08-23T08:18:39.658169Z",
"url": "https://hex.pm/api/packages/certifi/releases/2.4.1", "url": "https://hex.pm/api/packages/certifi/releases/2.4.1",
"version": "2.4.1" "version": "2.4.1"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2018-03-01T12:09:47.479620Z",
"url": "https://hex.pm/api/packages/certifi/releases/2.3.1", "url": "https://hex.pm/api/packages/certifi/releases/2.3.1",
"version": "2.3.1" "version": "2.3.1"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2018-02-27T21:20:24.804583Z",
"url": "https://hex.pm/api/packages/certifi/releases/2.3.0", "url": "https://hex.pm/api/packages/certifi/releases/2.3.0",
"version": "2.3.0" "version": "2.3.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2018-02-15T14:40:54.249660Z",
"url": "https://hex.pm/api/packages/certifi/releases/2.2.0", "url": "https://hex.pm/api/packages/certifi/releases/2.2.0",
"version": "2.2.0" "version": "2.2.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2018-02-15T14:24:33.990296Z",
"url": "https://hex.pm/api/packages/certifi/releases/2.1.0", "url": "https://hex.pm/api/packages/certifi/releases/2.1.0",
"version": "2.1.0" "version": "2.1.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2017-07-29T10:26:25.887395Z",
"url": "https://hex.pm/api/packages/certifi/releases/2.0.0", "url": "https://hex.pm/api/packages/certifi/releases/2.0.0",
"version": "2.0.0" "version": "2.0.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2017-05-22T10:05:04.091548Z",
"url": "https://hex.pm/api/packages/certifi/releases/1.2.1", "url": "https://hex.pm/api/packages/certifi/releases/1.2.1",
"version": "1.2.1" "version": "1.2.1"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2017-05-20T17:36:20.704236Z",
"url": "https://hex.pm/api/packages/certifi/releases/1.2.0", "url": "https://hex.pm/api/packages/certifi/releases/1.2.0",
"version": "1.2.0" "version": "1.2.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2017-04-20T03:47:25.151946Z",
"url": "https://hex.pm/api/packages/certifi/releases/1.1.0", "url": "https://hex.pm/api/packages/certifi/releases/1.1.0",
"version": "1.1.0" "version": "1.1.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2017-01-24T11:14:00.415180Z",
"url": "https://hex.pm/api/packages/certifi/releases/1.0.0", "url": "https://hex.pm/api/packages/certifi/releases/1.0.0",
"version": "1.0.0" "version": "1.0.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2016-10-02T23:16:44.504184Z",
"url": "https://hex.pm/api/packages/certifi/releases/0.7.0", "url": "https://hex.pm/api/packages/certifi/releases/0.7.0",
"version": "0.7.0" "version": "0.7.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2016-09-12T10:05:24.327928Z",
"url": "https://hex.pm/api/packages/certifi/releases/0.6.0", "url": "https://hex.pm/api/packages/certifi/releases/0.6.0",
"version": "0.6.0" "version": "0.6.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2016-08-25T14:22:42.043018Z",
"url": "https://hex.pm/api/packages/certifi/releases/0.5.0", "url": "https://hex.pm/api/packages/certifi/releases/0.5.0",
"version": "0.5.0" "version": "0.5.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2016-03-02T20:37:38.856702Z",
"url": "https://hex.pm/api/packages/certifi/releases/0.4.0", "url": "https://hex.pm/api/packages/certifi/releases/0.4.0",
"version": "0.4.0" "version": "0.4.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2015-11-20T14:41:07.485022Z",
"url": "https://hex.pm/api/packages/certifi/releases/0.3.0", "url": "https://hex.pm/api/packages/certifi/releases/0.3.0",
"version": "0.3.0" "version": "0.3.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2015-11-19T11:25:06.024607Z",
"url": "https://hex.pm/api/packages/certifi/releases/0.2.0", "url": "https://hex.pm/api/packages/certifi/releases/0.2.0",
"version": "0.2.0" "version": "0.2.0"
}, },
{ {
"has_docs": false, "has_docs": false,
"inserted_at": "2015-09-10T13:58:55.620634Z",
"url": "https://hex.pm/api/packages/certifi/releases/0.1.1", "url": "https://hex.pm/api/packages/certifi/releases/0.1.1",
"version": "0.1.1" "version": "0.1.1"
} }
], ],
"repository": "hexpm", "repository": "hexpm",
"retirements": {}, "retirements": {},
"updated_at": "2019-01-28T20:35:23.869888Z", "updated_at": "2020-03-04T14:54:16.279054Z",
"url": "https://hex.pm/api/packages/certifi" "url": "https://hex.pm/api/packages/certifi"
} }

View file

@ -5,60 +5,83 @@ Object {
"homepage": "https://hex.pm/packages/certifi", "homepage": "https://hex.pm/packages/certifi",
"releases": Array [ "releases": Array [
Object { Object {
"releaseTimestamp": "2020-03-04T14:54:16.283323Z",
"version": "2.5.2",
},
Object {
"releaseTimestamp": "2019-01-24T15:14:25.991190Z",
"version": "2.5.1", "version": "2.5.1",
}, },
Object { Object {
"releaseTimestamp": "2018-08-30T08:21:29.349366Z",
"version": "2.4.2", "version": "2.4.2",
}, },
Object { Object {
"releaseTimestamp": "2018-08-23T08:18:39.658169Z",
"version": "2.4.1", "version": "2.4.1",
}, },
Object { Object {
"releaseTimestamp": "2018-03-01T12:09:47.479620Z",
"version": "2.3.1", "version": "2.3.1",
}, },
Object { Object {
"releaseTimestamp": "2018-02-27T21:20:24.804583Z",
"version": "2.3.0", "version": "2.3.0",
}, },
Object { Object {
"releaseTimestamp": "2018-02-15T14:40:54.249660Z",
"version": "2.2.0", "version": "2.2.0",
}, },
Object { Object {
"releaseTimestamp": "2018-02-15T14:24:33.990296Z",
"version": "2.1.0", "version": "2.1.0",
}, },
Object { Object {
"releaseTimestamp": "2017-07-29T10:26:25.887395Z",
"version": "2.0.0", "version": "2.0.0",
}, },
Object { Object {
"releaseTimestamp": "2017-05-22T10:05:04.091548Z",
"version": "1.2.1", "version": "1.2.1",
}, },
Object { Object {
"releaseTimestamp": "2017-05-20T17:36:20.704236Z",
"version": "1.2.0", "version": "1.2.0",
}, },
Object { Object {
"releaseTimestamp": "2017-04-20T03:47:25.151946Z",
"version": "1.1.0", "version": "1.1.0",
}, },
Object { Object {
"releaseTimestamp": "2017-01-24T11:14:00.415180Z",
"version": "1.0.0", "version": "1.0.0",
}, },
Object { Object {
"releaseTimestamp": "2016-10-02T23:16:44.504184Z",
"version": "0.7.0", "version": "0.7.0",
}, },
Object { Object {
"releaseTimestamp": "2016-09-12T10:05:24.327928Z",
"version": "0.6.0", "version": "0.6.0",
}, },
Object { Object {
"releaseTimestamp": "2016-08-25T14:22:42.043018Z",
"version": "0.5.0", "version": "0.5.0",
}, },
Object { Object {
"releaseTimestamp": "2016-03-02T20:37:38.856702Z",
"version": "0.4.0", "version": "0.4.0",
}, },
Object { Object {
"releaseTimestamp": "2015-11-20T14:41:07.485022Z",
"version": "0.3.0", "version": "0.3.0",
}, },
Object { Object {
"releaseTimestamp": "2015-11-19T11:25:06.024607Z",
"version": "0.2.0", "version": "0.2.0",
}, },
Object { Object {
"releaseTimestamp": "2015-09-10T13:58:55.620634Z",
"version": "0.1.1", "version": "0.1.1",
}, },
], ],
@ -71,60 +94,83 @@ Object {
"homepage": "https://hex.pm/packages/certifi", "homepage": "https://hex.pm/packages/certifi",
"releases": Array [ "releases": Array [
Object { Object {
"releaseTimestamp": "2020-03-04T14:54:16.283323Z",
"version": "2.5.2",
},
Object {
"releaseTimestamp": "2019-01-24T15:14:25.991190Z",
"version": "2.5.1", "version": "2.5.1",
}, },
Object { Object {
"releaseTimestamp": "2018-08-30T08:21:29.349366Z",
"version": "2.4.2", "version": "2.4.2",
}, },
Object { Object {
"releaseTimestamp": "2018-08-23T08:18:39.658169Z",
"version": "2.4.1", "version": "2.4.1",
}, },
Object { Object {
"releaseTimestamp": "2018-03-01T12:09:47.479620Z",
"version": "2.3.1", "version": "2.3.1",
}, },
Object { Object {
"releaseTimestamp": "2018-02-27T21:20:24.804583Z",
"version": "2.3.0", "version": "2.3.0",
}, },
Object { Object {
"releaseTimestamp": "2018-02-15T14:40:54.249660Z",
"version": "2.2.0", "version": "2.2.0",
}, },
Object { Object {
"releaseTimestamp": "2018-02-15T14:24:33.990296Z",
"version": "2.1.0", "version": "2.1.0",
}, },
Object { Object {
"releaseTimestamp": "2017-07-29T10:26:25.887395Z",
"version": "2.0.0", "version": "2.0.0",
}, },
Object { Object {
"releaseTimestamp": "2017-05-22T10:05:04.091548Z",
"version": "1.2.1", "version": "1.2.1",
}, },
Object { Object {
"releaseTimestamp": "2017-05-20T17:36:20.704236Z",
"version": "1.2.0", "version": "1.2.0",
}, },
Object { Object {
"releaseTimestamp": "2017-04-20T03:47:25.151946Z",
"version": "1.1.0", "version": "1.1.0",
}, },
Object { Object {
"releaseTimestamp": "2017-01-24T11:14:00.415180Z",
"version": "1.0.0", "version": "1.0.0",
}, },
Object { Object {
"releaseTimestamp": "2016-10-02T23:16:44.504184Z",
"version": "0.7.0", "version": "0.7.0",
}, },
Object { Object {
"releaseTimestamp": "2016-09-12T10:05:24.327928Z",
"version": "0.6.0", "version": "0.6.0",
}, },
Object { Object {
"releaseTimestamp": "2016-08-25T14:22:42.043018Z",
"version": "0.5.0", "version": "0.5.0",
}, },
Object { Object {
"releaseTimestamp": "2016-03-02T20:37:38.856702Z",
"version": "0.4.0", "version": "0.4.0",
}, },
Object { Object {
"releaseTimestamp": "2015-11-20T14:41:07.485022Z",
"version": "0.3.0", "version": "0.3.0",
}, },
Object { Object {
"releaseTimestamp": "2015-11-19T11:25:06.024607Z",
"version": "0.2.0", "version": "0.2.0",
}, },
Object { Object {
"releaseTimestamp": "2015-09-10T13:58:55.620634Z",
"version": "0.1.1", "version": "0.1.1",
}, },
], ],

View file

@ -7,7 +7,10 @@ export const id = 'hex';
interface HexRelease { interface HexRelease {
html_url: string; html_url: string;
meta?: { links?: Record<string, string> }; meta?: { links?: Record<string, string> };
releases?: { version: string }[]; releases?: {
version: string;
inserted_at?: string;
}[];
} }
export async function getPkgReleases({ export async function getPkgReleases({
@ -41,7 +44,14 @@ export async function getPkgReleases({
} }
const result: ReleaseResult = { const result: ReleaseResult = {
releases: releases.map(({ version }) => ({ version })), releases: releases.map(({ version, inserted_at }) =>
inserted_at
? {
version,
releaseTimestamp: inserted_at,
}
: { version }
),
}; };
if (homepage) { if (homepage) {