react-cheminfo 0.133.0 → 0.134.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/lib/host/core/index.d.ts +2 -0
- package/lib/host/core/index.d.ts.map +1 -1
- package/lib/host/core/index.js +1 -0
- package/lib/host/core/index.js.map +1 -1
- package/lib/host/core/kinds.d.ts +6 -1
- package/lib/host/core/kinds.d.ts.map +1 -1
- package/lib/host/core/kinds.js +4 -1
- package/lib/host/core/kinds.js.map +1 -1
- package/lib/host/core/recordKinds.d.ts +165 -0
- package/lib/host/core/recordKinds.d.ts.map +1 -0
- package/lib/host/core/recordKinds.js +68 -0
- package/lib/host/core/recordKinds.js.map +1 -0
- package/package.json +1 -1
- package/src/host/core/index.ts +7 -0
- package/src/host/core/kinds.ts +7 -2
- package/src/host/core/recordKinds.ts +144 -0
package/README.md
CHANGED
|
@@ -1238,6 +1238,22 @@ travels as a list of ions, and comes back as the peak each was found at:
|
|
|
1238
1238
|
- **What comes back replaces what was sent before**, so an ion no longer found
|
|
1239
1239
|
is simply absent.
|
|
1240
1240
|
|
|
1241
|
+
### A record before it is published
|
|
1242
|
+
|
|
1243
|
+
A dataset about to be published on Zenodo travels as `data.zenodo.record`,
|
|
1244
|
+
`{ metadata, files }`: the metadata as Zenodo stores it — `title`, and
|
|
1245
|
+
optionally `description` (HTML), `publication_date`, `creators`, `keywords`,
|
|
1246
|
+
`version` and `license` — and every file as it would be uploaded,
|
|
1247
|
+
`{ key, size, content }`. zenodo-submit.cheminfo.org hands one to
|
|
1248
|
+
fair.cheminfo.org's `/preview` with `openTool`, so a record is seen as it will
|
|
1249
|
+
be published before it is uploaded.
|
|
1250
|
+
|
|
1251
|
+
- **A file's `content` is a `Blob`**, which a port hands over by reference: a
|
|
1252
|
+
record of several gigabytes crosses at once, and the tool reads a file only
|
|
1253
|
+
when it needs it.
|
|
1254
|
+
- **The schema takes any `content`**, since JSON Schema cannot name a `Blob`:
|
|
1255
|
+
the tool checks `instanceof Blob` itself, and refuses the record otherwise.
|
|
1256
|
+
|
|
1241
1257
|
An input with `many: true` takes every item of its kinds, and one with
|
|
1242
1258
|
`optional: true` may go without; the request is refused only when no input got
|
|
1243
1259
|
anything. `load` may return a promise, and requests are served in order.
|
package/lib/host/core/index.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export type { PeptideValue } from './peptideKinds.ts';
|
|
|
36
36
|
export { PEPTIDE_KINDS, PEPTIDE_SCHEMA } from './peptideKinds.ts';
|
|
37
37
|
export type { RxnValue } from './reactionKinds.ts';
|
|
38
38
|
export { REACTION_KINDS, RXN_SCHEMA } from './reactionKinds.ts';
|
|
39
|
+
export type { ZenodoCreatorValue, ZenodoFileValue, ZenodoMetadataValue, ZenodoRecordValue, } from './recordKinds.ts';
|
|
40
|
+
export { ZENODO_RECORD_SCHEMA } from './recordKinds.ts';
|
|
39
41
|
export type { NameValue, SvgImageValue, TableCell, TableValue, } from './resultKinds.ts';
|
|
40
42
|
export { NAME_SCHEMA, SVG_IMAGE_SCHEMA, TABLE_SCHEMA } from './resultKinds.ts';
|
|
41
43
|
export type { InputSelection, LoadedInput } from './selectInputs.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACV,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAChE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sB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OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/E,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
package/lib/host/core/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { RAMAN_JDX_SCHEMA, RAMAN_PEAKS_SCHEMA } from "./ramanKinds.js";
|
|
|
18
18
|
export { UV_JDX_SCHEMA, UV_PEAKS_SCHEMA } from "./uvKinds.js";
|
|
19
19
|
export { PEPTIDE_KINDS, PEPTIDE_SCHEMA } from "./peptideKinds.js";
|
|
20
20
|
export { REACTION_KINDS, RXN_SCHEMA } from "./reactionKinds.js";
|
|
21
|
+
export { ZENODO_RECORD_SCHEMA } from "./recordKinds.js";
|
|
21
22
|
export { NAME_SCHEMA, SVG_IMAGE_SCHEMA, TABLE_SCHEMA } from "./resultKinds.js";
|
|
22
23
|
export { selectInputs } from "./selectInputs.js";
|
|
23
24
|
export { MAX_CITED_WORKS, readCitedWorks, readToolHelp, } from "./toolCredits.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/host/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAS/C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAQzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAU9D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQ/C,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,cAAc,CAAC;AAwBtB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,E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,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
package/lib/host/core/kinds.d.ts
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* ones of `./uvKinds.ts` and the mass
|
|
10
10
|
* spectrometry ones of `./msKinds.ts`, the reaction of `./reactionKinds.ts`,
|
|
11
11
|
* the peptide of `./peptideKinds.ts`, the set of spectra of
|
|
12
|
-
* `./datasetKinds.ts`,
|
|
12
|
+
* `./datasetKinds.ts`, the record about to be published on Zenodo of
|
|
13
|
+
* `./recordKinds.ts`, and
|
|
13
14
|
* the kinds a tool hands back, of `./resultKinds.ts`. A name with children is a category whose
|
|
14
15
|
* schema every child satisfies, so `chem.molfile` reads `chem.molfile.2d` and
|
|
15
16
|
* `chem.molfile.3d.h.energy` alike; the fields a tool does not read are
|
|
@@ -23,6 +24,7 @@ import type { PeptideValue } from './peptideKinds.ts';
|
|
|
23
24
|
import type { HostItem } from './protocol.ts';
|
|
24
25
|
import type { RamanJdxValue, RamanPeaksValue } from './ramanKinds.ts';
|
|
25
26
|
import type { RxnValue } from './reactionKinds.ts';
|
|
27
|
+
import type { ZenodoRecordValue } from './recordKinds.ts';
|
|
26
28
|
import type { NameValue, SvgImageValue, TableValue } from './resultKinds.ts';
|
|
27
29
|
import type { UvJdxValue, UvPeaksValue } from './uvKinds.ts';
|
|
28
30
|
/** A molfile, V2000 or V3000. */
|
|
@@ -93,6 +95,9 @@ export type CheckedValue = {
|
|
|
93
95
|
} | {
|
|
94
96
|
kind: 'data.spectra';
|
|
95
97
|
value: SpectraDatasetValue;
|
|
98
|
+
} | {
|
|
99
|
+
kind: 'data.zenodo.record';
|
|
100
|
+
value: ZenodoRecordValue;
|
|
96
101
|
};
|
|
97
102
|
export { kindAccepts } from './kindAccepts.ts';
|
|
98
103
|
/** The name of a kind there is a schema for: one a tool reads, or one it hands back. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../../src/host/core/kinds.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../../src/host/core/kinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAK7D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAMhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE7E,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG7D,iCAAiC;AACjC,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oDAAoD;AACpD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,gBAAgB;AAChB,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oEAAoE;AACpE,MAA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ptide of `./peptideKinds.ts`, the set of spectra of
|
|
12
|
-
* `./datasetKinds.ts`,
|
|
12
|
+
* `./datasetKinds.ts`, the record about to be published on Zenodo of
|
|
13
|
+
* `./recordKinds.ts`, and
|
|
13
14
|
* the kinds a tool hands back, of `./resultKinds.ts`. A name with children is a category whose
|
|
14
15
|
* schema every child satisfies, so `chem.molfile` reads `chem.molfile.2d` and
|
|
15
16
|
* `chem.molfile.3d.h.energy` alike; the fields a tool does not read are
|
|
@@ -24,6 +25,7 @@ import { MS_ASSIGNMENTS_SCHEMA, MS_IONS_SCHEMA, MS_JDX_SCHEMA, } from "./msKinds
|
|
|
24
25
|
import { PEPTIDE_SCHEMA } from "./peptideKinds.js";
|
|
25
26
|
import { RAMAN_JDX_SCHEMA, RAMAN_PEAKS_SCHEMA } from "./ramanKinds.js";
|
|
26
27
|
import { RXN_SCHEMA } from "./reactionKinds.js";
|
|
28
|
+
import { ZENODO_RECORD_SCHEMA } from "./recordKinds.js";
|
|
27
29
|
import { NAME_SCHEMA, SVG_IMAGE_SCHEMA, TABLE_SCHEMA } from "./resultKinds.js";
|
|
28
30
|
import { UV_JDX_SCHEMA, UV_PEAKS_SCHEMA } from "./uvKinds.js";
|
|
29
31
|
export { kindAccepts } from "./kindAccepts.js";
|
|
@@ -128,5 +130,6 @@ const VALIDATORS = {
|
|
|
128
130
|
'chem.name': ajv.compile(NAME_SCHEMA),
|
|
129
131
|
'data.table': ajv.compile(TABLE_SCHEMA),
|
|
130
132
|
'data.spectra': ajv.compile(SPECTRA_DATASET_SCHEMA),
|
|
133
|
+
'data.zenodo.record': ajv.compile(ZENODO_RECORD_SCHEMA),
|
|
131
134
|
};
|
|
132
135
|
//# sourceMappingURL=kinds.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.js","sourceRoot":"","sources":["../../../src/host/core/kinds.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kinds.js","sourceRoot":"","sources":["../../../src/host/core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kBAAkB,CAAC;IACvE,gBAAgB,EAAE,GAAG,CAAC,OAAO,CAAa,aAAa,CAAC;IACxD,kBAAkB,EAAE,GAAG,CAAC,OAAO,CAAe,eAAe,CAAC;IAC9D,gBAAgB,EAAE,GAAG,CAAC,OAAO,CAAa,aAAa,CAAC;IACxD,iBAAiB,EAAE,GAAG,CAAC,OAAO,CAAc,cAAc,CAAC;IAC3D,wBAAwB,EAAE,GAAG,CAAC,OAAO,CACnC,qBAAqB,CACtB;IACD,WAAW,EAAE,GAAG,CAAC,OAAO,CAAgB,gBAAgB,CAAC;IACzD,WAAW,EAAE,GAAG,CAAC,OAAO,CAAY,WAAW,CAAC;IAChD,YAAY,EAAE,GAAG,CAAC,OAAO,CAAa,YAAY,CAAC;IACnD,cAAc,EAAE,GAAG,CAAC,OAAO,CAAsB,sBAAsB,CAAC;IACxE,oBAAoB,EAAE,GAAG,CAAC,OAAO,CAAoB,oBAAoB,CAAC;CAC3E,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data.zenodo.record`: a dataset about to be published on Zenodo — its
|
|
3
|
+
* metadata and its files — handed to a site that shows it before it is, as
|
|
4
|
+
* zenodo-submit.cheminfo.org hands one to fair.cheminfo.org.
|
|
5
|
+
*
|
|
6
|
+
* The files travel as `Blob`s: a window or a port hands a `Blob` over by
|
|
7
|
+
* reference, so a record of several gigabytes crosses without a copy, and the
|
|
8
|
+
* receiving site reads a file only when it needs it. The schema accepts any
|
|
9
|
+
* `content`, since JSON Schema cannot name a `Blob`: the receiving site checks
|
|
10
|
+
* `instanceof Blob` itself.
|
|
11
|
+
*/
|
|
12
|
+
/** One creator of a record, as Zenodo lists them. */
|
|
13
|
+
export interface ZenodoCreatorValue {
|
|
14
|
+
/** `Family, Given`, or an organisation's name. */
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* Where they work.
|
|
18
|
+
* @default undefined
|
|
19
|
+
*/
|
|
20
|
+
affiliation?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Their ORCID iD, e.g. `0000-0002-1825-0097`.
|
|
23
|
+
* @default undefined
|
|
24
|
+
*/
|
|
25
|
+
orcid?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The publication date of a record, `YYYY-MM-DD`, under the name Zenodo gives
|
|
29
|
+
* it, which is not camelCase.
|
|
30
|
+
* @default undefined
|
|
31
|
+
*/
|
|
32
|
+
type ZenodoPublicationDate = Partial<Record<'publication_date', string>>;
|
|
33
|
+
/** The metadata of a record, as Zenodo stores it, known before it is published. */
|
|
34
|
+
export interface ZenodoMetadataValue extends ZenodoPublicationDate {
|
|
35
|
+
/** The title. */
|
|
36
|
+
title: string;
|
|
37
|
+
/**
|
|
38
|
+
* The description, in HTML as Zenodo stores it.
|
|
39
|
+
* @default undefined
|
|
40
|
+
*/
|
|
41
|
+
description?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The creators, in the order they are cited.
|
|
44
|
+
* @default undefined
|
|
45
|
+
*/
|
|
46
|
+
creators?: ZenodoCreatorValue[];
|
|
47
|
+
/**
|
|
48
|
+
* The keywords.
|
|
49
|
+
* @default undefined
|
|
50
|
+
*/
|
|
51
|
+
keywords?: string[];
|
|
52
|
+
/**
|
|
53
|
+
* The version the depositor gives the record.
|
|
54
|
+
* @default undefined
|
|
55
|
+
*/
|
|
56
|
+
version?: string;
|
|
57
|
+
/**
|
|
58
|
+
* The licence, by its Zenodo id, e.g. `cc-by-4.0`.
|
|
59
|
+
* @default undefined
|
|
60
|
+
*/
|
|
61
|
+
license?: {
|
|
62
|
+
id: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** One file of a record, exactly as it would be uploaded. */
|
|
66
|
+
export interface ZenodoFileValue {
|
|
67
|
+
/** Its name in the record, e.g. `toc.json`. */
|
|
68
|
+
key: string;
|
|
69
|
+
/** Its size, in bytes. */
|
|
70
|
+
size: number;
|
|
71
|
+
/** Its content. */
|
|
72
|
+
content: Blob;
|
|
73
|
+
}
|
|
74
|
+
/** `data.zenodo.record`: a record not yet published, with its files. */
|
|
75
|
+
export interface ZenodoRecordValue {
|
|
76
|
+
/** Zenodo-style metadata of the record, as known before it is published. */
|
|
77
|
+
metadata: ZenodoMetadataValue;
|
|
78
|
+
/** The files of the record, exactly as they would be uploaded. */
|
|
79
|
+
files: ZenodoFileValue[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The schema of `data.zenodo.record`. Written as a plain schema rather than
|
|
83
|
+
* `JSONSchemaType`, which cannot express a `Blob` and would demand `nullable`
|
|
84
|
+
* on every optional field.
|
|
85
|
+
*/
|
|
86
|
+
export declare const ZENODO_RECORD_SCHEMA: {
|
|
87
|
+
readonly type: "object";
|
|
88
|
+
readonly properties: {
|
|
89
|
+
readonly metadata: {
|
|
90
|
+
readonly type: "object";
|
|
91
|
+
readonly properties: {
|
|
92
|
+
readonly title: {
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
};
|
|
95
|
+
readonly description: {
|
|
96
|
+
readonly type: "string";
|
|
97
|
+
};
|
|
98
|
+
readonly publication_date: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
};
|
|
101
|
+
readonly creators: {
|
|
102
|
+
readonly type: "array";
|
|
103
|
+
readonly items: {
|
|
104
|
+
readonly type: "object";
|
|
105
|
+
readonly properties: {
|
|
106
|
+
readonly name: {
|
|
107
|
+
readonly type: "string";
|
|
108
|
+
};
|
|
109
|
+
readonly affiliation: {
|
|
110
|
+
readonly type: "string";
|
|
111
|
+
};
|
|
112
|
+
readonly orcid: {
|
|
113
|
+
readonly type: "string";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
readonly required: readonly ["name"];
|
|
117
|
+
readonly additionalProperties: false;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
readonly keywords: {
|
|
121
|
+
readonly type: "array";
|
|
122
|
+
readonly items: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
readonly version: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
};
|
|
129
|
+
readonly license: {
|
|
130
|
+
readonly type: "object";
|
|
131
|
+
readonly properties: {
|
|
132
|
+
readonly id: {
|
|
133
|
+
readonly type: "string";
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
readonly required: readonly ["id"];
|
|
137
|
+
readonly additionalProperties: false;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
readonly required: readonly ["title"];
|
|
141
|
+
readonly additionalProperties: false;
|
|
142
|
+
};
|
|
143
|
+
readonly files: {
|
|
144
|
+
readonly type: "array";
|
|
145
|
+
readonly items: {
|
|
146
|
+
readonly type: "object";
|
|
147
|
+
readonly properties: {
|
|
148
|
+
readonly key: {
|
|
149
|
+
readonly type: "string";
|
|
150
|
+
};
|
|
151
|
+
readonly size: {
|
|
152
|
+
readonly type: "number";
|
|
153
|
+
};
|
|
154
|
+
readonly content: {};
|
|
155
|
+
};
|
|
156
|
+
readonly required: readonly ["key", "size", "content"];
|
|
157
|
+
readonly additionalProperties: false;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
readonly required: readonly ["metadata", "files"];
|
|
162
|
+
readonly additionalProperties: false;
|
|
163
|
+
};
|
|
164
|
+
export {};
|
|
165
|
+
//# sourceMappingURL=recordKinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordKinds.d.ts","sourceRoot":"","sources":["../../../src/host/core/recordKinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,qDAAqD;AACrD,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,KAAK,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC;AAEzE,mFAAmF;AACnF,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAChE,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1B;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,OAAO,EAAE,IAAI,CAAC;CACf;AAED,wEAAwE;AACxE,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,kEAAkE;IAClE,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B;AAgDD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQvB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data.zenodo.record`: a dataset about to be published on Zenodo — its
|
|
3
|
+
* metadata and its files — handed to a site that shows it before it is, as
|
|
4
|
+
* zenodo-submit.cheminfo.org hands one to fair.cheminfo.org.
|
|
5
|
+
*
|
|
6
|
+
* The files travel as `Blob`s: a window or a port hands a `Blob` over by
|
|
7
|
+
* reference, so a record of several gigabytes crosses without a copy, and the
|
|
8
|
+
* receiving site reads a file only when it needs it. The schema accepts any
|
|
9
|
+
* `content`, since JSON Schema cannot name a `Blob`: the receiving site checks
|
|
10
|
+
* `instanceof Blob` itself.
|
|
11
|
+
*/
|
|
12
|
+
// Zenodo's own name for the field, which is not camelCase.
|
|
13
|
+
const PUBLICATION_DATE = 'publication_date';
|
|
14
|
+
const CREATOR_SCHEMA = {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
name: { type: 'string' },
|
|
18
|
+
affiliation: { type: 'string' },
|
|
19
|
+
orcid: { type: 'string' },
|
|
20
|
+
},
|
|
21
|
+
required: ['name'],
|
|
22
|
+
additionalProperties: false,
|
|
23
|
+
};
|
|
24
|
+
const METADATA_SCHEMA = {
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
title: { type: 'string' },
|
|
28
|
+
description: { type: 'string' },
|
|
29
|
+
[PUBLICATION_DATE]: { type: 'string' },
|
|
30
|
+
creators: { type: 'array', items: CREATOR_SCHEMA },
|
|
31
|
+
keywords: { type: 'array', items: { type: 'string' } },
|
|
32
|
+
version: { type: 'string' },
|
|
33
|
+
license: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: { id: { type: 'string' } },
|
|
36
|
+
required: ['id'],
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: ['title'],
|
|
41
|
+
additionalProperties: false,
|
|
42
|
+
};
|
|
43
|
+
const FILE_SCHEMA = {
|
|
44
|
+
type: 'object',
|
|
45
|
+
properties: {
|
|
46
|
+
key: { type: 'string' },
|
|
47
|
+
size: { type: 'number' },
|
|
48
|
+
// Any value: a schema cannot name a `Blob`, which the reader checks.
|
|
49
|
+
content: {},
|
|
50
|
+
},
|
|
51
|
+
required: ['key', 'size', 'content'],
|
|
52
|
+
additionalProperties: false,
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The schema of `data.zenodo.record`. Written as a plain schema rather than
|
|
56
|
+
* `JSONSchemaType`, which cannot express a `Blob` and would demand `nullable`
|
|
57
|
+
* on every optional field.
|
|
58
|
+
*/
|
|
59
|
+
export const ZENODO_RECORD_SCHEMA = {
|
|
60
|
+
type: 'object',
|
|
61
|
+
properties: {
|
|
62
|
+
metadata: METADATA_SCHEMA,
|
|
63
|
+
files: { type: 'array', items: FILE_SCHEMA },
|
|
64
|
+
},
|
|
65
|
+
required: ['metadata', 'files'],
|
|
66
|
+
additionalProperties: false,
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=recordKinds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordKinds.js","sourceRoot":"","sources":["../../../src/host/core/recordKinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA0EH,2DAA2D;AAC3D,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC1B;IACD,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC/B,CAAC,gBAAgB,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtC,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE;QAClD,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QACtD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACtC,QAAQ,EAAE,CAAC,IAAI,CAAC;YAChB,oBAAoB,EAAE,KAAK;SAC5B;KACF;IACD,QAAQ,EAAE,CAAC,OAAO,CAAC;IACnB,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACvB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,qEAAqE;QACrE,OAAO,EAAE,EAAE;KACZ;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC;IACpC,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE;KAC7C;IACD,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,oBAAoB,EAAE,KAAK;CACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cheminfo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.134.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React components, hooks and framework-free helpers shared by the cheminfo sites: site chrome, citations, sharing, routing, pedagogy, charts, and the structure, orbital and 3D molecule viewers",
|
|
6
6
|
"author": "Luc Patiny",
|
package/src/host/core/index.ts
CHANGED
|
@@ -110,6 +110,13 @@ export type { PeptideValue } from './peptideKinds.ts';
|
|
|
110
110
|
export { PEPTIDE_KINDS, PEPTIDE_SCHEMA } from './peptideKinds.ts';
|
|
111
111
|
export type { RxnValue } from './reactionKinds.ts';
|
|
112
112
|
export { REACTION_KINDS, RXN_SCHEMA } from './reactionKinds.ts';
|
|
113
|
+
export type {
|
|
114
|
+
ZenodoCreatorValue,
|
|
115
|
+
ZenodoFileValue,
|
|
116
|
+
ZenodoMetadataValue,
|
|
117
|
+
ZenodoRecordValue,
|
|
118
|
+
} from './recordKinds.ts';
|
|
119
|
+
export { ZENODO_RECORD_SCHEMA } from './recordKinds.ts';
|
|
113
120
|
export type {
|
|
114
121
|
NameValue,
|
|
115
122
|
SvgImageValue,
|
package/src/host/core/kinds.ts
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* ones of `./uvKinds.ts` and the mass
|
|
10
10
|
* spectrometry ones of `./msKinds.ts`, the reaction of `./reactionKinds.ts`,
|
|
11
11
|
* the peptide of `./peptideKinds.ts`, the set of spectra of
|
|
12
|
-
* `./datasetKinds.ts`,
|
|
12
|
+
* `./datasetKinds.ts`, the record about to be published on Zenodo of
|
|
13
|
+
* `./recordKinds.ts`, and
|
|
13
14
|
* the kinds a tool hands back, of `./resultKinds.ts`. A name with children is a category whose
|
|
14
15
|
* schema every child satisfies, so `chem.molfile` reads `chem.molfile.2d` and
|
|
15
16
|
* `chem.molfile.3d.h.energy` alike; the fields a tool does not read are
|
|
@@ -41,6 +42,8 @@ import type { RamanJdxValue, RamanPeaksValue } from './ramanKinds.ts';
|
|
|
41
42
|
import { RAMAN_JDX_SCHEMA, RAMAN_PEAKS_SCHEMA } from './ramanKinds.ts';
|
|
42
43
|
import type { RxnValue } from './reactionKinds.ts';
|
|
43
44
|
import { RXN_SCHEMA } from './reactionKinds.ts';
|
|
45
|
+
import type { ZenodoRecordValue } from './recordKinds.ts';
|
|
46
|
+
import { ZENODO_RECORD_SCHEMA } from './recordKinds.ts';
|
|
44
47
|
import type { NameValue, SvgImageValue, TableValue } from './resultKinds.ts';
|
|
45
48
|
import { NAME_SCHEMA, SVG_IMAGE_SCHEMA, TABLE_SCHEMA } from './resultKinds.ts';
|
|
46
49
|
import type { UvJdxValue, UvPeaksValue } from './uvKinds.ts';
|
|
@@ -81,7 +84,8 @@ export type CheckedValue =
|
|
|
81
84
|
| { kind: 'image.svg'; value: SvgImageValue }
|
|
82
85
|
| { kind: 'chem.name'; value: NameValue }
|
|
83
86
|
| { kind: 'data.table'; value: TableValue }
|
|
84
|
-
| { kind: 'data.spectra'; value: SpectraDatasetValue }
|
|
87
|
+
| { kind: 'data.spectra'; value: SpectraDatasetValue }
|
|
88
|
+
| { kind: 'data.zenodo.record'; value: ZenodoRecordValue };
|
|
85
89
|
|
|
86
90
|
export { kindAccepts } from './kindAccepts.ts';
|
|
87
91
|
|
|
@@ -213,4 +217,5 @@ const VALIDATORS: { [K in KnownKind]: ValidateFunction<ValueOf<K>> } = {
|
|
|
213
217
|
'chem.name': ajv.compile<NameValue>(NAME_SCHEMA),
|
|
214
218
|
'data.table': ajv.compile<TableValue>(TABLE_SCHEMA),
|
|
215
219
|
'data.spectra': ajv.compile<SpectraDatasetValue>(SPECTRA_DATASET_SCHEMA),
|
|
220
|
+
'data.zenodo.record': ajv.compile<ZenodoRecordValue>(ZENODO_RECORD_SCHEMA),
|
|
216
221
|
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data.zenodo.record`: a dataset about to be published on Zenodo — its
|
|
3
|
+
* metadata and its files — handed to a site that shows it before it is, as
|
|
4
|
+
* zenodo-submit.cheminfo.org hands one to fair.cheminfo.org.
|
|
5
|
+
*
|
|
6
|
+
* The files travel as `Blob`s: a window or a port hands a `Blob` over by
|
|
7
|
+
* reference, so a record of several gigabytes crosses without a copy, and the
|
|
8
|
+
* receiving site reads a file only when it needs it. The schema accepts any
|
|
9
|
+
* `content`, since JSON Schema cannot name a `Blob`: the receiving site checks
|
|
10
|
+
* `instanceof Blob` itself.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** One creator of a record, as Zenodo lists them. */
|
|
14
|
+
export interface ZenodoCreatorValue {
|
|
15
|
+
/** `Family, Given`, or an organisation's name. */
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Where they work.
|
|
19
|
+
* @default undefined
|
|
20
|
+
*/
|
|
21
|
+
affiliation?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Their ORCID iD, e.g. `0000-0002-1825-0097`.
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
orcid?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The publication date of a record, `YYYY-MM-DD`, under the name Zenodo gives
|
|
31
|
+
* it, which is not camelCase.
|
|
32
|
+
* @default undefined
|
|
33
|
+
*/
|
|
34
|
+
type ZenodoPublicationDate = Partial<Record<'publication_date', string>>;
|
|
35
|
+
|
|
36
|
+
/** The metadata of a record, as Zenodo stores it, known before it is published. */
|
|
37
|
+
export interface ZenodoMetadataValue extends ZenodoPublicationDate {
|
|
38
|
+
/** The title. */
|
|
39
|
+
title: string;
|
|
40
|
+
/**
|
|
41
|
+
* The description, in HTML as Zenodo stores it.
|
|
42
|
+
* @default undefined
|
|
43
|
+
*/
|
|
44
|
+
description?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The creators, in the order they are cited.
|
|
47
|
+
* @default undefined
|
|
48
|
+
*/
|
|
49
|
+
creators?: ZenodoCreatorValue[];
|
|
50
|
+
/**
|
|
51
|
+
* The keywords.
|
|
52
|
+
* @default undefined
|
|
53
|
+
*/
|
|
54
|
+
keywords?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* The version the depositor gives the record.
|
|
57
|
+
* @default undefined
|
|
58
|
+
*/
|
|
59
|
+
version?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The licence, by its Zenodo id, e.g. `cc-by-4.0`.
|
|
62
|
+
* @default undefined
|
|
63
|
+
*/
|
|
64
|
+
license?: { id: string };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** One file of a record, exactly as it would be uploaded. */
|
|
68
|
+
export interface ZenodoFileValue {
|
|
69
|
+
/** Its name in the record, e.g. `toc.json`. */
|
|
70
|
+
key: string;
|
|
71
|
+
/** Its size, in bytes. */
|
|
72
|
+
size: number;
|
|
73
|
+
/** Its content. */
|
|
74
|
+
content: Blob;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** `data.zenodo.record`: a record not yet published, with its files. */
|
|
78
|
+
export interface ZenodoRecordValue {
|
|
79
|
+
/** Zenodo-style metadata of the record, as known before it is published. */
|
|
80
|
+
metadata: ZenodoMetadataValue;
|
|
81
|
+
/** The files of the record, exactly as they would be uploaded. */
|
|
82
|
+
files: ZenodoFileValue[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Zenodo's own name for the field, which is not camelCase.
|
|
86
|
+
const PUBLICATION_DATE = 'publication_date';
|
|
87
|
+
|
|
88
|
+
const CREATOR_SCHEMA = {
|
|
89
|
+
type: 'object',
|
|
90
|
+
properties: {
|
|
91
|
+
name: { type: 'string' },
|
|
92
|
+
affiliation: { type: 'string' },
|
|
93
|
+
orcid: { type: 'string' },
|
|
94
|
+
},
|
|
95
|
+
required: ['name'],
|
|
96
|
+
additionalProperties: false,
|
|
97
|
+
} as const;
|
|
98
|
+
|
|
99
|
+
const METADATA_SCHEMA = {
|
|
100
|
+
type: 'object',
|
|
101
|
+
properties: {
|
|
102
|
+
title: { type: 'string' },
|
|
103
|
+
description: { type: 'string' },
|
|
104
|
+
[PUBLICATION_DATE]: { type: 'string' },
|
|
105
|
+
creators: { type: 'array', items: CREATOR_SCHEMA },
|
|
106
|
+
keywords: { type: 'array', items: { type: 'string' } },
|
|
107
|
+
version: { type: 'string' },
|
|
108
|
+
license: {
|
|
109
|
+
type: 'object',
|
|
110
|
+
properties: { id: { type: 'string' } },
|
|
111
|
+
required: ['id'],
|
|
112
|
+
additionalProperties: false,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
required: ['title'],
|
|
116
|
+
additionalProperties: false,
|
|
117
|
+
} as const;
|
|
118
|
+
|
|
119
|
+
const FILE_SCHEMA = {
|
|
120
|
+
type: 'object',
|
|
121
|
+
properties: {
|
|
122
|
+
key: { type: 'string' },
|
|
123
|
+
size: { type: 'number' },
|
|
124
|
+
// Any value: a schema cannot name a `Blob`, which the reader checks.
|
|
125
|
+
content: {},
|
|
126
|
+
},
|
|
127
|
+
required: ['key', 'size', 'content'],
|
|
128
|
+
additionalProperties: false,
|
|
129
|
+
} as const;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The schema of `data.zenodo.record`. Written as a plain schema rather than
|
|
133
|
+
* `JSONSchemaType`, which cannot express a `Blob` and would demand `nullable`
|
|
134
|
+
* on every optional field.
|
|
135
|
+
*/
|
|
136
|
+
export const ZENODO_RECORD_SCHEMA = {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: {
|
|
139
|
+
metadata: METADATA_SCHEMA,
|
|
140
|
+
files: { type: 'array', items: FILE_SCHEMA },
|
|
141
|
+
},
|
|
142
|
+
required: ['metadata', 'files'],
|
|
143
|
+
additionalProperties: false,
|
|
144
|
+
} as const;
|