keepset 0.28.0 → 0.28.1
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 +1 -1
- package/dist/{bundled-C52vPmf3.js → bundled-CSQH5LeG.js} +241 -464
- package/dist/{categories-C7q-yLo-.d.ts → categories-DkkYCbGk.d.ts} +45 -90
- package/dist/index.d.ts +2 -8
- package/dist/index.js +2 -2
- package/dist/node/fetch-dataset.d.ts +3 -3
- package/dist/node/fetch-dataset.js +57 -30
- package/dist-cli/keepset.mjs +1 -1
- package/package.json +1 -1
- package/schemas/entry.schema.json +1 -1
- package/schemas/manifest.schema.json +1 -1
|
@@ -414,7 +414,6 @@ declare const EntrySchema: z.ZodObject<{
|
|
|
414
414
|
category: z.ZodEnum<{
|
|
415
415
|
"graph/v1": "graph/v1";
|
|
416
416
|
"or/v1": "or/v1";
|
|
417
|
-
"or-set/v1": "or-set/v1";
|
|
418
417
|
}>;
|
|
419
418
|
sources: z.ZodArray<z.ZodObject<{
|
|
420
419
|
url: z.ZodURL;
|
|
@@ -610,7 +609,7 @@ declare const EntrySchema: z.ZodObject<{
|
|
|
610
609
|
id: string;
|
|
611
610
|
name: string;
|
|
612
611
|
tags: string[];
|
|
613
|
-
category: "graph/v1" | "or/v1"
|
|
612
|
+
category: "graph/v1" | "or/v1";
|
|
614
613
|
sources: {
|
|
615
614
|
url: string;
|
|
616
615
|
retrieved: string;
|
|
@@ -857,7 +856,6 @@ declare const CatalogueIndexSchema: z.ZodObject<{
|
|
|
857
856
|
category: z.ZodEnum<{
|
|
858
857
|
"graph/v1": "graph/v1";
|
|
859
858
|
"or/v1": "or/v1";
|
|
860
|
-
"or-set/v1": "or-set/v1";
|
|
861
859
|
}>;
|
|
862
860
|
sources: z.ZodArray<z.ZodObject<{
|
|
863
861
|
url: z.ZodURL;
|
|
@@ -1053,7 +1051,7 @@ declare const CatalogueIndexSchema: z.ZodObject<{
|
|
|
1053
1051
|
id: string;
|
|
1054
1052
|
name: string;
|
|
1055
1053
|
tags: string[];
|
|
1056
|
-
category: "graph/v1" | "or/v1"
|
|
1054
|
+
category: "graph/v1" | "or/v1";
|
|
1057
1055
|
sources: {
|
|
1058
1056
|
url: string;
|
|
1059
1057
|
retrieved: string;
|
|
@@ -1216,7 +1214,7 @@ declare const CatalogueIndexSchema: z.ZodObject<{
|
|
|
1216
1214
|
id: string;
|
|
1217
1215
|
name: string;
|
|
1218
1216
|
tags: string[];
|
|
1219
|
-
category: "graph/v1" | "or/v1"
|
|
1217
|
+
category: "graph/v1" | "or/v1";
|
|
1220
1218
|
sources: {
|
|
1221
1219
|
url: string;
|
|
1222
1220
|
retrieved: string;
|
|
@@ -1465,84 +1463,29 @@ declare const GraphV1Schema: z.ZodObject<{
|
|
|
1465
1463
|
};
|
|
1466
1464
|
type GraphV1 = z.infer<typeof GraphV1Schema>;
|
|
1467
1465
|
//#endregion
|
|
1468
|
-
//#region src/targets/
|
|
1469
|
-
/**
|
|
1470
|
-
declare const
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
skill: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1484
|
-
territory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1485
|
-
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1486
|
-
opened: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1487
|
-
closed: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1488
|
-
deadline: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
1489
|
-
}, z.core.$loose>>;
|
|
1490
|
-
}, z.core.$strict>;
|
|
1491
|
-
type OrInstance = z.infer<typeof OrInstanceSchema>;
|
|
1466
|
+
//#region src/targets/json-scalar.d.ts
|
|
1467
|
+
/** A JSON scalar: the only values a target's metadata may hold, so `meta` stays a flat record any consumer can tabulate. `z.number()` already rejects NaN and the infinities, which JSON cannot carry. */
|
|
1468
|
+
declare const JsonScalarSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
1469
|
+
type JsonScalar = z.infer<typeof JsonScalarSchema>;
|
|
1470
|
+
//#endregion
|
|
1471
|
+
//#region src/targets/collection.d.ts
|
|
1472
|
+
/** One member of a collection: the id that names it within the set (for a collection read from an archive, the path of the member it came from) beside the fields of the category's own document, which are the instance's `meta`, nodes and so on. */
|
|
1473
|
+
type Instance<Document extends object> = {
|
|
1474
|
+
readonly id: string;
|
|
1475
|
+
} & Document;
|
|
1476
|
+
/** A collection of documents of one category: `{ meta, instances }`, where `meta` is the entry's own metadata and each instance is a document of the category under an id. */
|
|
1477
|
+
interface Collection<Document extends object> {
|
|
1478
|
+
readonly meta: Readonly<Record<string, JsonScalar>>;
|
|
1479
|
+
readonly instances: readonly Instance<Document>[];
|
|
1480
|
+
}
|
|
1492
1481
|
/**
|
|
1493
|
-
* The
|
|
1482
|
+
* The schema of a collection of documents of a category, derived from the category's own document schema, so a category needs nothing of its own to be collected. Beyond each instance being a valid document, the instance ids must be unique in the set; node ids and the like stay unique only within an instance, because every instance numbers its own.
|
|
1483
|
+
* @param document - The category's document schema.
|
|
1484
|
+
* @returns The collection schema, with the attached type guard.
|
|
1494
1485
|
*/
|
|
1495
|
-
declare
|
|
1496
|
-
|
|
1497
|
-
instances: z.ZodArray<z.ZodObject<{
|
|
1498
|
-
id: z.ZodString;
|
|
1499
|
-
meta: z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, unknown>;
|
|
1500
|
-
nodes: z.ZodArray<z.ZodObject<{
|
|
1501
|
-
id: z.ZodString;
|
|
1502
|
-
lat: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1503
|
-
lon: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1504
|
-
x: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1505
|
-
y: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1506
|
-
prize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1507
|
-
prizeProbability: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1508
|
-
duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1509
|
-
travelTime: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1510
|
-
skill: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1511
|
-
territory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1512
|
-
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1513
|
-
opened: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1514
|
-
closed: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1515
|
-
deadline: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
1516
|
-
}, z.core.$loose>>;
|
|
1517
|
-
}, z.core.$strict>>;
|
|
1518
|
-
}, z.core.$strict> & {
|
|
1519
|
-
is: (value: unknown) => value is {
|
|
1520
|
-
meta: Record<string, string | number | boolean | null>;
|
|
1521
|
-
instances: {
|
|
1522
|
-
id: string;
|
|
1523
|
-
meta: Record<string, string | number | boolean | null>;
|
|
1524
|
-
nodes: {
|
|
1525
|
-
[x: string]: unknown;
|
|
1526
|
-
id: string;
|
|
1527
|
-
lat?: number | null | undefined;
|
|
1528
|
-
lon?: number | null | undefined;
|
|
1529
|
-
x?: number | null | undefined;
|
|
1530
|
-
y?: number | null | undefined;
|
|
1531
|
-
prize?: number | null | undefined;
|
|
1532
|
-
prizeProbability?: number | null | undefined;
|
|
1533
|
-
duration?: number | null | undefined;
|
|
1534
|
-
travelTime?: number | null | undefined;
|
|
1535
|
-
skill?: string | null | undefined;
|
|
1536
|
-
territory?: string | null | undefined;
|
|
1537
|
-
status?: string | null | undefined;
|
|
1538
|
-
opened?: string | null | undefined;
|
|
1539
|
-
closed?: string | null | undefined;
|
|
1540
|
-
deadline?: string | number | null | undefined;
|
|
1541
|
-
}[];
|
|
1542
|
-
}[];
|
|
1543
|
-
};
|
|
1486
|
+
declare function collectionOf<Document extends object>(document: z.ZodType<Document>): z.ZodType<Collection<Document>> & {
|
|
1487
|
+
is: (value: unknown) => value is Collection<Document>;
|
|
1544
1488
|
};
|
|
1545
|
-
type OrSetV1 = z.infer<typeof OrSetV1Schema>;
|
|
1546
1489
|
//#endregion
|
|
1547
1490
|
//#region src/targets/or-v1.d.ts
|
|
1548
1491
|
/**
|
|
@@ -1618,27 +1561,25 @@ type OrV1 = z.infer<typeof OrV1Schema>;
|
|
|
1618
1561
|
declare const CategoryIdSchema: z.ZodEnum<{
|
|
1619
1562
|
"graph/v1": "graph/v1";
|
|
1620
1563
|
"or/v1": "or/v1";
|
|
1621
|
-
"or-set/v1": "or-set/v1";
|
|
1622
1564
|
}>;
|
|
1623
1565
|
type CategoryId = z.infer<typeof CategoryIdSchema>;
|
|
1624
1566
|
/** The normalisation target each category resolves to, keyed by category id. */
|
|
1625
1567
|
interface CategoryTargets {
|
|
1626
1568
|
readonly "graph/v1": GraphV1;
|
|
1627
1569
|
readonly "or/v1": OrV1;
|
|
1628
|
-
readonly "or-set/v1": OrSetV1;
|
|
1629
1570
|
}
|
|
1630
1571
|
/** The normalised shape of any category: what `fetchDataset` can resolve to. */
|
|
1631
1572
|
type CategoryTarget = CategoryTargets[CategoryId];
|
|
1632
1573
|
/** The keys of a target whose values are arrays: the collections an entry's `expectedCounts` may name. */
|
|
1633
1574
|
type CountedKey<Target> = { readonly [Key in keyof Target]: Target[Key] extends readonly unknown[] ? Key : never; }[keyof Target] & string;
|
|
1634
|
-
/** What
|
|
1635
|
-
type
|
|
1636
|
-
/** One category: its id, what it holds,
|
|
1575
|
+
/** What a fetch of a collection entry resolves to: the entry's metadata and one instance per archive member, each a document of the entry's category. */
|
|
1576
|
+
type CollectionTarget<Id extends CategoryId = CategoryId> = Id extends CategoryId ? Collection<CategoryTargets[Id]> : never;
|
|
1577
|
+
/** One category: its id, what it holds, the schema of its normalisation target (one document), the schema of a collection of such documents derived from it, and which of the target's arrays an entry may record expected counts for. */
|
|
1637
1578
|
interface CategoryOf<Id extends CategoryId> {
|
|
1638
1579
|
readonly id: Id;
|
|
1639
1580
|
readonly description: string;
|
|
1640
|
-
readonly shape: CategoryShape;
|
|
1641
1581
|
readonly target: z.ZodType<CategoryTargets[Id]>;
|
|
1582
|
+
readonly collection: z.ZodType<Collection<CategoryTargets[Id]>>;
|
|
1642
1583
|
readonly counted: readonly CountedKey<CategoryTargets[Id]>[];
|
|
1643
1584
|
}
|
|
1644
1585
|
/** A category, or with no argument any of them: a union over the ids, so each category keeps its own target and counted keys. */
|
|
@@ -1659,6 +1600,13 @@ declare function getCategory(id: string): Category;
|
|
|
1659
1600
|
*/
|
|
1660
1601
|
declare function getTarget<Id extends CategoryId>(id: Id): z.ZodType<CategoryTargets[Id]>;
|
|
1661
1602
|
declare function getTarget(id: string): z.ZodType<CategoryTarget>;
|
|
1603
|
+
/**
|
|
1604
|
+
* Returns the schema of a collection of documents of a category: `{ meta, instances }`, each instance a document of the category under an id, derived from the category's own target schema.
|
|
1605
|
+
* @param id - Any string, as for `getCategory`.
|
|
1606
|
+
* @returns The collection schema.
|
|
1607
|
+
* @throws UnknownCategoryError when no category has that id.
|
|
1608
|
+
*/
|
|
1609
|
+
declare function getCollectionTarget(id: string): z.ZodType<CollectionTarget>;
|
|
1662
1610
|
/**
|
|
1663
1611
|
* The kind of data a category holds: the part of its id before the version.
|
|
1664
1612
|
* @param id - A category id.
|
|
@@ -1668,11 +1616,18 @@ declare function kindOf(id: CategoryId): string;
|
|
|
1668
1616
|
/** @returns Every registered category, in id order. */
|
|
1669
1617
|
declare function listCategories(): readonly Category[];
|
|
1670
1618
|
/**
|
|
1671
|
-
*
|
|
1619
|
+
* The keys of a resolved target an entry may record expected counts for: a document's own arrays, or for a collection its instances.
|
|
1620
|
+
* @param id - The target's category.
|
|
1621
|
+
* @param collection - Whether the entry's recipe reads a collection.
|
|
1622
|
+
* @returns The countable keys.
|
|
1623
|
+
*/
|
|
1624
|
+
declare function countedKeys(id: CategoryId, collection: boolean): readonly string[];
|
|
1625
|
+
/**
|
|
1626
|
+
* Counts the arrays an entry may record expected counts for, in a resolved target.
|
|
1672
1627
|
* @param id - The target's category.
|
|
1673
|
-
* @param target - A resolved
|
|
1628
|
+
* @param target - A resolved document of that category, or a collection of them.
|
|
1674
1629
|
* @returns The length of each counted array, by key.
|
|
1675
1630
|
*/
|
|
1676
|
-
declare function countTarget(id: CategoryId, target: CategoryTarget): ReadonlyMap<string, number>;
|
|
1631
|
+
declare function countTarget(id: CategoryId, target: CategoryTarget | CollectionTarget): ReadonlyMap<string, number>;
|
|
1677
1632
|
//#endregion
|
|
1678
|
-
export {
|
|
1633
|
+
export { CrosswalkReference as $, Catalogue as A, ManifestSchema as B, JsonScalarSchema as C, GraphNodeSchema as D, GraphNode as E, NamespaceNode as F, ArchiveMember as G, parseManifest as H, createCatalogue as I, Citation as J, ArchiveMemberSchema as K, Lineage as L, CatalogueIndexSchema as M, Dataset as N, GraphV1 as O, DatasetQuery as P, ColumnNameSchema as Q, LineageSchema as R, JsonScalar as S, waybackUrl as St, GraphEdgeSchema as T, AliasSchema as U, SemVerSchema as V, Archive as W, CollectionArchive as X, CitationSchema as Y, CollectionArchiveSchema as Z, OrV1 as _, SnapshotSchema as _t, CategoryTargets as a, IdSchema as at, Instance as b, WaybackTimestampSchema as bt, countTarget as c, Namespace as ct, getCollectionTarget as d, ParserSchema as dt, CrosswalkReferenceSchema as et, getTarget as f, RESERVED_META_KEYS as ft, OrNodeSchema as g, Snapshot as gt, OrNode as h, RelativePathSchema as ht, CategoryTarget as i, HttpUrlSchema as it, CatalogueIndex as j, GraphV1Schema as k, countedKeys as l, NamespaceSchema as lt, listCategories as m, RecipeSchema as mt, CategoryId as n, Entry as nt, CollectionTarget as o, Licence as ot, kindOf as p, Recipe as pt, ArchiveSchema as q, CategoryIdSchema as r, EntrySchema as rt, CountedKey as s, LicenceSchema as st, Category as t, DocumentArchive as tt, getCategory as u, Parser as ut, OrV1Schema as v, Source as vt, GraphEdge as w, collectionOf as x, parseEntry as xt, Collection as y, SourceSchema as yt, Manifest as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as CrosswalkReference, A as Catalogue, B as ManifestSchema, C as JsonScalarSchema, D as GraphNodeSchema, E as GraphNode, F as NamespaceNode, G as ArchiveMember, H as parseManifest, I as createCatalogue, J as Citation, K as ArchiveMemberSchema, L as Lineage, M as CatalogueIndexSchema, N as Dataset, O as GraphV1, P as DatasetQuery, Q as ColumnNameSchema, R as LineageSchema, S as JsonScalar, St as waybackUrl, T as GraphEdgeSchema, U as AliasSchema, V as SemVerSchema, W as Archive, X as CollectionArchive, Y as CitationSchema, Z as CollectionArchiveSchema, _ as OrV1, _t as SnapshotSchema, a as CategoryTargets, at as IdSchema, b as Instance, bt as WaybackTimestampSchema, c as countTarget, ct as Namespace, d as getCollectionTarget, dt as ParserSchema, et as CrosswalkReferenceSchema, f as getTarget, ft as RESERVED_META_KEYS, g as OrNodeSchema, gt as Snapshot, h as OrNode, ht as RelativePathSchema, i as CategoryTarget, it as HttpUrlSchema, j as CatalogueIndex, k as GraphV1Schema, l as countedKeys, lt as NamespaceSchema, m as listCategories, mt as RecipeSchema, n as CategoryId, nt as Entry, o as CollectionTarget, ot as Licence, p as kindOf, pt as Recipe, q as ArchiveSchema, r as CategoryIdSchema, rt as EntrySchema, s as CountedKey, st as LicenceSchema, t as Category, tt as DocumentArchive, u as getCategory, ut as Parser, v as OrV1Schema, vt as Source, w as GraphEdge, x as collectionOf, xt as parseEntry, y as Collection, yt as SourceSchema, z as Manifest } from "./categories-DkkYCbGk.js";
|
|
2
2
|
import { Crosswalk } from "twindex";
|
|
3
|
-
import { z } from "zod";
|
|
4
3
|
//#region src/errors.d.ts
|
|
5
4
|
/** The root of this package's error taxonomy: every error keepset throws is a `KeepsetError`, so callers can catch the family with one check. */
|
|
6
5
|
export declare class KeepsetError extends Error {
|
|
@@ -110,11 +109,6 @@ export declare function namesOf(entry: Addressed, segmentAliases?: SegmentAliase
|
|
|
110
109
|
*/
|
|
111
110
|
export declare function serialise(doc: Entry | Manifest | Crosswalk): string;
|
|
112
111
|
//#endregion
|
|
113
|
-
//#region src/targets/json-scalar.d.ts
|
|
114
|
-
/** A JSON scalar: the only values a target's metadata may hold, so `meta` stays a flat record any consumer can tabulate. `z.number()` already rejects NaN and the infinities, which JSON cannot carry. */
|
|
115
|
-
export declare const JsonScalarSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
116
|
-
type JsonScalar = z.infer<typeof JsonScalarSchema>;
|
|
117
|
-
//#endregion
|
|
118
112
|
//#region src/validate.d.ts
|
|
119
113
|
/**
|
|
120
114
|
* Checks a dataset as the catalogue holds it: the entry against the entry schema, and its crosswalk against twindex's structural validation and the entry's category. A catalogue index is checked the same way when it is built, so a bundled dataset is valid unless the package itself is broken; the check is what a contributor runs on an entry they are writing.
|
|
@@ -123,4 +117,4 @@ type JsonScalar = z.infer<typeof JsonScalarSchema>;
|
|
|
123
117
|
*/
|
|
124
118
|
export declare function validateDataset(dataset: Dataset): SyntaxIssue[];
|
|
125
119
|
//#endregion
|
|
126
|
-
export { AliasSchema, type Archive, type ArchiveMember, ArchiveMemberSchema, ArchiveSchema, type Catalogue, type CatalogueIndex, CatalogueIndexSchema, type Category, type CategoryId, CategoryIdSchema, type
|
|
120
|
+
export { AliasSchema, type Archive, type ArchiveMember, ArchiveMemberSchema, ArchiveSchema, type Catalogue, type CatalogueIndex, CatalogueIndexSchema, type Category, type CategoryId, CategoryIdSchema, type CategoryTarget, type CategoryTargets, type Citation, CitationSchema, type Collection, type CollectionArchive, CollectionArchiveSchema, type CollectionTarget, ColumnNameSchema, type CountedKey, type CrosswalkReference, CrosswalkReferenceSchema, type Dataset, type DatasetQuery, type DocumentArchive, type Entry, type EntryNames, EntrySchema, type GraphEdge, GraphEdgeSchema, type GraphNode, GraphNodeSchema, type GraphV1, GraphV1Schema, HttpUrlSchema, IdSchema, type Instance, type JsonScalar, JsonScalarSchema, type Licence, LicenceSchema, type Lineage, LineageSchema, type Manifest, ManifestSchema, type Namespace, type NamespaceNode, NamespaceSchema, type OrNode, OrNodeSchema, type OrV1, OrV1Schema, type Parser, ParserSchema, RESERVED_META_KEYS, type Recipe, RecipeSchema, type RecipeStep, RelativePathSchema, type SegmentAliases, SemVerSchema, type Snapshot, SnapshotSchema, type Source, SourceSchema, type SyntaxIssue, WaybackTimestampSchema, collectionOf, countTarget, countedKeys, createCatalogue, getCategory, getCollectionTarget, getTarget, kindOf, listCategories, parseEntry, parseManifest, waybackUrl };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as CatalogueSyntaxError, A as parseEntry, B as getCategory, C as ParserSchema, D as SnapshotSchema, E as RelativePathSchema, F as namesOf, G as OrNodeSchema, H as getTarget, J as GraphEdgeSchema, K as OrV1Schema, L as CategoryIdSchema, M as waybackUrl, N as NAME_SEPARATOR, O as SourceSchema, P as groupsOf, Q as ArchiveError, R as countTarget, S as NamespaceSchema, T as RecipeSchema, U as kindOf, V as getCollectionTarget, W as listCategories, X as GraphV1Schema, Y as GraphNodeSchema, Z as JsonScalarSchema, _ as CrosswalkReferenceSchema, a as CatalogueIndexSchema, at as UnknownCategoryError, b as IdSchema, c as ManifestSchema, d as AliasSchema, et as DatasetAmbiguousError, f as ArchiveMemberSchema, g as ColumnNameSchema, h as CollectionArchiveSchema, i as listNamespaces, it as RecipeError, j as toIssues, k as WaybackTimestampSchema, l as SemVerSchema, m as CitationSchema, n as getManifest, nt as KeepsetError, o as createCatalogue, p as ArchiveSchema, q as collectionOf, r as listDatasets, rt as NativeParseError, s as LineageSchema, t as getDataset, tt as DatasetNotFoundError, u as parseManifest, v as EntrySchema, w as RESERVED_META_KEYS, x as LicenceSchema, y as HttpUrlSchema, z as countedKeys } from "./bundled-CSQH5LeG.js";
|
|
2
2
|
import { validateCrosswalk } from "twindex";
|
|
3
3
|
//#region src/serialise.ts
|
|
4
4
|
/**
|
|
@@ -57,4 +57,4 @@ function validateDataset(dataset) {
|
|
|
57
57
|
return issues;
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
|
-
export { AliasSchema, ArchiveError, ArchiveMemberSchema, ArchiveSchema, CatalogueIndexSchema, CatalogueSyntaxError, CategoryIdSchema, CitationSchema, CollectionArchiveSchema, ColumnNameSchema, CrosswalkReferenceSchema, DatasetAmbiguousError, DatasetNotFoundError, EntrySchema, GraphEdgeSchema, GraphNodeSchema, GraphV1Schema, HttpUrlSchema, IdSchema, JsonScalarSchema, KeepsetError, LicenceSchema, LineageSchema, ManifestSchema, NAME_SEPARATOR, NamespaceSchema, NativeParseError,
|
|
60
|
+
export { AliasSchema, ArchiveError, ArchiveMemberSchema, ArchiveSchema, CatalogueIndexSchema, CatalogueSyntaxError, CategoryIdSchema, CitationSchema, CollectionArchiveSchema, ColumnNameSchema, CrosswalkReferenceSchema, DatasetAmbiguousError, DatasetNotFoundError, EntrySchema, GraphEdgeSchema, GraphNodeSchema, GraphV1Schema, HttpUrlSchema, IdSchema, JsonScalarSchema, KeepsetError, LicenceSchema, LineageSchema, ManifestSchema, NAME_SEPARATOR, NamespaceSchema, NativeParseError, OrNodeSchema, OrV1Schema, ParserSchema, RESERVED_META_KEYS, RecipeError, RecipeSchema, RelativePathSchema, SemVerSchema, SnapshotSchema, SourceSchema, UnknownCategoryError, WaybackTimestampSchema, collectionOf, countTarget, countedKeys, createCatalogue, getCategory, getCollectionTarget, getDataset, getManifest, getTarget, groupsOf, kindOf, listCategories, listDatasets, listNamespaces, namesOf, parseEntry, parseManifest, serialise, validateDataset, waybackUrl };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as Dataset, gt as Snapshot, i as CategoryTarget, nt as Entry, o as CollectionTarget, vt as Source } from "../categories-DkkYCbGk.js";
|
|
2
2
|
//#region src/node/fetch-dataset.d.ts
|
|
3
3
|
/** The network port a recipe downloads through: `downloadRaw` by default, which returns the bytes exactly as served, or a stand-in under test. */
|
|
4
4
|
export type FetchPort = (url: string, init: {
|
|
@@ -29,10 +29,10 @@ export interface Provenance {
|
|
|
29
29
|
/** The archive members a collection was read from, in the order they were read. */
|
|
30
30
|
readonly members?: readonly string[];
|
|
31
31
|
}
|
|
32
|
-
/** A fetched dataset: the resolved category target, the provenance of the bytes it came from, and any warnings, such as a count that differs from the one the entry records. */
|
|
32
|
+
/** A fetched dataset: the resolved category target (one document, or for a recipe that selects archive members a collection of them), the provenance of the bytes it came from, and any warnings, such as a count that differs from the one the entry records. */
|
|
33
33
|
export interface FetchedDataset {
|
|
34
34
|
readonly dataset: Dataset;
|
|
35
|
-
readonly data: CategoryTarget;
|
|
35
|
+
readonly data: CategoryTarget | CollectionTarget;
|
|
36
36
|
readonly provenance: Provenance;
|
|
37
37
|
readonly warnings: readonly string[];
|
|
38
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as getTarget, I as getOwn, Q as ArchiveError, R as countTarget, V as getCollectionTarget, it as RecipeError, nt as KeepsetError, rt as NativeParseError, t as getDataset } from "../bundled-CSQH5LeG.js";
|
|
2
2
|
import { RoundTripMismatchError, assertRoundTrip, encode } from "twindex";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
@@ -2858,10 +2858,22 @@ function metaOf(entry) {
|
|
|
2858
2858
|
};
|
|
2859
2859
|
}
|
|
2860
2860
|
/**
|
|
2861
|
-
*
|
|
2861
|
+
* Puts an instance's id beside the fields of its encoded document. A document that is not an object is left as it is, for the collection schema to refuse.
|
|
2862
|
+
* @param document - The crosswalk's output for one member.
|
|
2863
|
+
* @param id - The member's path.
|
|
2864
|
+
* @returns The instance.
|
|
2865
|
+
*/
|
|
2866
|
+
function withId(document, id) {
|
|
2867
|
+
return typeof document === "object" && document !== null && !Array.isArray(document) ? {
|
|
2868
|
+
...document,
|
|
2869
|
+
id
|
|
2870
|
+
} : document;
|
|
2871
|
+
}
|
|
2872
|
+
/**
|
|
2873
|
+
* Runs a recipe's download, extract and parse steps, and builds the native documents the crosswalk receives.
|
|
2862
2874
|
* @param dataset - The dataset.
|
|
2863
2875
|
* @param options - The network port, abort signal and clock.
|
|
2864
|
-
* @returns The native
|
|
2876
|
+
* @returns The native documents and the provenance of their bytes.
|
|
2865
2877
|
*/
|
|
2866
2878
|
async function runToNative(dataset, options) {
|
|
2867
2879
|
const { entry } = dataset;
|
|
@@ -2896,35 +2908,39 @@ async function runToNative(dataset, options) {
|
|
|
2896
2908
|
const { archive } = recipe;
|
|
2897
2909
|
if ("members" in archive) {
|
|
2898
2910
|
const files = await step(entry.id, "extract", () => unpackMembers(bytes, archive));
|
|
2899
|
-
const members = await step(entry.id, "parse", () => files.map((file) => {
|
|
2900
|
-
try {
|
|
2901
|
-
return {
|
|
2902
|
-
id: file.path,
|
|
2903
|
-
meta: {},
|
|
2904
|
-
...parseNative(file.bytes, recipe.parser)
|
|
2905
|
-
};
|
|
2906
|
-
} catch (error) {
|
|
2907
|
-
throw new KeepsetError(`member ${file.path}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
2908
|
-
}
|
|
2909
|
-
}));
|
|
2910
2911
|
return {
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2912
|
+
collection: true,
|
|
2913
|
+
documents: await step(entry.id, "parse", () => files.map((file) => {
|
|
2914
|
+
try {
|
|
2915
|
+
const parsed = parseNative(file.bytes, recipe.parser);
|
|
2916
|
+
return {
|
|
2917
|
+
id: file.path,
|
|
2918
|
+
native: {
|
|
2919
|
+
...parsed,
|
|
2920
|
+
meta: "meta" in parsed ? parsed.meta : {}
|
|
2921
|
+
}
|
|
2922
|
+
};
|
|
2923
|
+
} catch (error) {
|
|
2924
|
+
throw new KeepsetError(`member ${file.path}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
2925
|
+
}
|
|
2926
|
+
})),
|
|
2915
2927
|
provenance: provenanceOf({ members: files.map((file) => file.path) })
|
|
2916
2928
|
};
|
|
2917
2929
|
}
|
|
2918
2930
|
const unpacked = await step(entry.id, "extract", () => unpack(bytes, archive));
|
|
2919
2931
|
const parsed = await step(entry.id, "parse", () => parseNative(unpacked.bytes, recipe.parser));
|
|
2920
2932
|
return {
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
...
|
|
2933
|
+
collection: false,
|
|
2934
|
+
documents: [{
|
|
2935
|
+
id: void 0,
|
|
2936
|
+
native: {
|
|
2937
|
+
...parsed,
|
|
2938
|
+
meta: {
|
|
2939
|
+
..."meta" in parsed ? parsed.meta : {},
|
|
2940
|
+
...metaOf(entry)
|
|
2941
|
+
}
|
|
2926
2942
|
}
|
|
2927
|
-
},
|
|
2943
|
+
}],
|
|
2928
2944
|
provenance: provenanceOf(unpacked.member === void 0 ? {} : { member: unpacked.member })
|
|
2929
2945
|
};
|
|
2930
2946
|
}
|
|
@@ -2937,11 +2953,22 @@ async function runToNative(dataset, options) {
|
|
|
2937
2953
|
*/
|
|
2938
2954
|
async function fetchEntry(dataset, options = {}) {
|
|
2939
2955
|
const { entry, crosswalk } = dataset;
|
|
2940
|
-
const {
|
|
2941
|
-
const encoded = await step(entry.id, "crosswalk", () =>
|
|
2956
|
+
const { collection, documents, provenance } = await runToNative(dataset, options);
|
|
2957
|
+
const encoded = await step(entry.id, "crosswalk", () => documents.map(({ id, native }) => {
|
|
2958
|
+
try {
|
|
2959
|
+
return encode(crosswalk, native);
|
|
2960
|
+
} catch (error) {
|
|
2961
|
+
throw new KeepsetError(`${id === void 0 ? "" : `member ${id}: `}${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
2962
|
+
}
|
|
2963
|
+
}));
|
|
2942
2964
|
const data = await step(entry.id, "validate", () => {
|
|
2943
|
-
const
|
|
2944
|
-
|
|
2965
|
+
const [only] = encoded;
|
|
2966
|
+
const whole = collection ? {
|
|
2967
|
+
meta: metaOf(entry),
|
|
2968
|
+
instances: encoded.map((document, index) => withId(document, documents[index]?.id))
|
|
2969
|
+
} : only;
|
|
2970
|
+
const result = (collection ? getCollectionTarget(entry.category) : getTarget(entry.category)).safeParse(whole);
|
|
2971
|
+
if (!result.success) throw new KeepsetError(`the result is not ${collection ? "a collection of " : ""}${entry.category}: ${result.error.issues.map((issue) => `${issue.path.map(String).join(".") || "(root)"}: ${issue.message}`).join("; ")}`);
|
|
2945
2972
|
return result.data;
|
|
2946
2973
|
});
|
|
2947
2974
|
const counts = countTarget(entry.category, data);
|
|
@@ -2970,9 +2997,9 @@ async function fetchDataset(id, options = {}) {
|
|
|
2970
2997
|
* @throws RecipeError naming the entry and the failing step when the recipe fails before the comparison, or when the crosswalk cannot run.
|
|
2971
2998
|
*/
|
|
2972
2999
|
async function roundTripEntry(dataset, options = {}) {
|
|
2973
|
-
const {
|
|
3000
|
+
const { documents, provenance } = await runToNative(dataset, options);
|
|
2974
3001
|
try {
|
|
2975
|
-
assertRoundTrip(dataset.crosswalk,
|
|
3002
|
+
assertRoundTrip(dataset.crosswalk, documents.map(({ native }) => native));
|
|
2976
3003
|
} catch (error) {
|
|
2977
3004
|
if (error instanceof RoundTripMismatchError) return {
|
|
2978
3005
|
holds: false,
|
package/dist-cli/keepset.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { KeepsetError, NAME_SEPARATOR, countTarget, getDataset, listDatasets, li
|
|
|
4
4
|
import { fetchDataset, roundTripDataset } from "keepset/node";
|
|
5
5
|
import { parseArgs } from "node:util";
|
|
6
6
|
//#region package.json
|
|
7
|
-
var version = "0.28.
|
|
7
|
+
var version = "0.28.1";
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region cli/run.ts
|
|
10
10
|
/**
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$defs":{"Crosswalk":{"$ref":"https://cdn.jsdelivr.net/npm/twindex@0.1.4/schemas/twindex.schema.json"},"Entry":{"additionalProperties":false,"properties":{"aliases":{"items":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*(?:\\/[A-Za-z0-9][A-Za-z0-9._-]*)*$","type":"string"},"minItems":1,"type":"array"},"category":{"enum":["graph/v1","or/v1","or-set/v1"],"type":"string"},"citations":{"items":{"additionalProperties":false,"properties":{"doi":{"pattern":"^10\\.\\d{4,9}\\/\\S+$","type":"string"},"text":{"minLength":1,"type":"string"},"url":{"format":"uri","type":"string"}},"required":["text"],"type":"object"},"type":"array"},"crosswalk":{"anyOf":[{"$ref":"#/$defs/Crosswalk"},{"additionalProperties":false,"properties":{"file":{"type":"string"}},"required":["file"],"type":"object"}]},"description":{"minLength":1,"type":"string"},"domain":{"minLength":1,"type":"string"},"expectedCounts":{"additionalProperties":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"propertyNames":{"pattern":"^[A-Za-z][A-Za-z0-9]*$","type":"string"},"type":"object"},"id":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"licence":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"pattern":"^[A-Za-z0-9][A-Za-z0-9.+-]*$","type":"string"},"kind":{"const":"spdx","type":"string"}},"required":["kind","id"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"custom","type":"string"},"name":{"minLength":1,"type":"string"},"url":{"format":"uri","type":"string"}},"required":["kind","name","url"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"unrecorded","type":"string"}},"required":["kind"],"type":"object"}]},"name":{"minLength":1,"type":"string"},"namespace":{"items":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"minItems":1,"type":"array"},"properties":{"additionalProperties":{"type":["string","number","boolean","null"]},"propertyNames":{"pattern":"^[A-Za-z][A-Za-z0-9]*$","type":"string"},"type":"object"},"recipe":{"oneOf":[{"additionalProperties":false,"properties":{"archive":{"anyOf":[{"additionalProperties":false,"properties":{"kind":{"const":"none","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"gzip","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"enum":["zip","tar","tar.gz"],"type":"string"},"member":{"anyOf":[{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},{"additionalProperties":false,"properties":{"extensions":{"items":{"pattern":"^\\.[A-Za-z0-9][A-Za-z0-9.]*$","type":"string"},"minItems":1,"type":"array"}},"required":["extensions"],"type":"object"},{"additionalProperties":false,"properties":{"pattern":{"minLength":1,"type":"string"}},"required":["pattern"],"type":"object"}]}},"required":["kind","member"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"enum":["zip","tar","tar.gz"],"type":"string"},"members":{"anyOf":[{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},{"additionalProperties":false,"properties":{"extensions":{"items":{"pattern":"^\\.[A-Za-z0-9][A-Za-z0-9.]*$","type":"string"},"minItems":1,"type":"array"}},"required":["extensions"],"type":"object"},{"additionalProperties":false,"properties":{"pattern":{"minLength":1,"type":"string"}},"required":["pattern"],"type":"object"}]}},"required":["kind","members"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"xlsx","type":"string"},"sheet":{"minLength":1,"type":"string"}},"required":["kind","sheet"],"type":"object"}]},"paging":{"oneOf":[{"additionalProperties":false,"properties":{"kind":{"const":"arcgis-query","type":"string"},"orderBy":{"pattern":"^[A-Za-z_][A-Za-z0-9_]*$","type":"string"}},"required":["kind","orderBy"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"socrata-resource","type":"string"},"pageSize":{"maximum":9007199254740991,"minimum":1,"type":"integer"}},"required":["kind","pageSize"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"ckan-datastore","type":"string"},"pageSize":{"maximum":9007199254740991,"minimum":1,"type":"integer"}},"required":["kind","pageSize"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"openfema","type":"string"},"pageSize":{"maximum":9007199254740991,"minimum":1,"type":"integer"}},"required":["kind","pageSize"],"type":"object"}]},"parser":{"oneOf":[{"additionalProperties":false,"properties":{"commentPrefixes":{"items":{"minLength":1,"type":"string"},"type":"array"},"delimiter":{"enum":["detect","whitespace","tab","comma","space"],"type":"string"},"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"edge-list","type":"string"},"skipLines":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"sourceColumn":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"targetColumn":{"maximum":9007199254740991,"minimum":0,"type":"integer"}},"required":["format","encoding","delimiter","skipLines","commentPrefixes","sourceColumn","targetColumn"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"matrix-market","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"gml","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"pajek","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"customer-points","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"solomon","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"top","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"toptw","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"tsplib","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"const":"utf-8","type":"string"},"format":{"const":"verolog-2019","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"const":"utf-8","type":"string"},"format":{"const":"vrp-rep","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"columns":{"items":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"type":"array"},"delimiter":{"enum":["comma","tab","semicolon"],"type":"string"},"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"csv-table","type":"string"},"idColumn":{"anyOf":[{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},{"type":"null"}]},"nullValues":{"items":{"minLength":1,"type":"string"},"type":"array"},"numericColumns":{"items":{"additionalProperties":false,"properties":{"column":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"factor":{"exclusiveMinimum":0,"type":"number"}},"required":["column","factor"],"type":"object"},"type":"array"},"skipLines":{"maximum":9007199254740991,"minimum":0,"type":"integer"}},"required":["format","encoding","delimiter","skipLines","idColumn","numericColumns"],"type":"object"},{"additionalProperties":false,"properties":{"columns":{"items":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"minItems":1,"type":"array"},"dateColumns":{"items":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"type":"array"},"encoding":{"const":"utf-8","type":"string"},"format":{"const":"geojson","type":"string"},"idColumn":{"anyOf":[{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},{"type":"null"}]},"numericColumns":{"items":{"additionalProperties":false,"properties":{"column":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"factor":{"exclusiveMinimum":0,"type":"number"}},"required":["column","factor"],"type":"object"},"type":"array"}},"required":["format","encoding","idColumn","numericColumns","dateColumns","columns"],"type":"object"}]},"source":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"status":{"const":"fetchable","type":"string"}},"required":["status","source","archive","parser"],"type":"object"},{"additionalProperties":false,"properties":{"reason":{"minLength":1,"type":"string"},"status":{"const":"not-fetchable","type":"string"}},"required":["status","reason"],"type":"object"}]},"sources":{"items":{"additionalProperties":false,"properties":{"retrieved":{"format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","type":"string"},"snapshot":{"additionalProperties":false,"properties":{"timestamp":{"pattern":"^\\d{8}(?:\\d{6})?$","type":"string"},"url":{"format":"uri","type":"string"}},"required":["url","timestamp"],"type":"object"},"status":{"enum":["live","dead"],"type":"string"},"url":{"format":"uri","type":"string"}},"required":["url","retrieved","status"],"type":"object"},"minItems":1,"type":"array"},"tags":{"items":{"minLength":1,"type":"string"},"type":"array"}},"required":["id","name","tags","category","sources","licence","citations","recipe","crosswalk","expectedCounts","properties"],"type":"object"}},"$id":"https://cdn.jsdelivr.net/npm/keepset@0.28.0/schemas/entry.schema.json","$ref":"#/$defs/Entry","$schema":"https://json-schema.org/draft/2020-12/schema"}
|
|
1
|
+
{"$defs":{"Crosswalk":{"$ref":"https://cdn.jsdelivr.net/npm/twindex@0.1.4/schemas/twindex.schema.json"},"Entry":{"additionalProperties":false,"properties":{"aliases":{"items":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*(?:\\/[A-Za-z0-9][A-Za-z0-9._-]*)*$","type":"string"},"minItems":1,"type":"array"},"category":{"enum":["graph/v1","or/v1"],"type":"string"},"citations":{"items":{"additionalProperties":false,"properties":{"doi":{"pattern":"^10\\.\\d{4,9}\\/\\S+$","type":"string"},"text":{"minLength":1,"type":"string"},"url":{"format":"uri","type":"string"}},"required":["text"],"type":"object"},"type":"array"},"crosswalk":{"anyOf":[{"$ref":"#/$defs/Crosswalk"},{"additionalProperties":false,"properties":{"file":{"type":"string"}},"required":["file"],"type":"object"}]},"description":{"minLength":1,"type":"string"},"domain":{"minLength":1,"type":"string"},"expectedCounts":{"additionalProperties":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"propertyNames":{"pattern":"^[A-Za-z][A-Za-z0-9]*$","type":"string"},"type":"object"},"id":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"licence":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"pattern":"^[A-Za-z0-9][A-Za-z0-9.+-]*$","type":"string"},"kind":{"const":"spdx","type":"string"}},"required":["kind","id"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"custom","type":"string"},"name":{"minLength":1,"type":"string"},"url":{"format":"uri","type":"string"}},"required":["kind","name","url"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"unrecorded","type":"string"}},"required":["kind"],"type":"object"}]},"name":{"minLength":1,"type":"string"},"namespace":{"items":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"minItems":1,"type":"array"},"properties":{"additionalProperties":{"type":["string","number","boolean","null"]},"propertyNames":{"pattern":"^[A-Za-z][A-Za-z0-9]*$","type":"string"},"type":"object"},"recipe":{"oneOf":[{"additionalProperties":false,"properties":{"archive":{"anyOf":[{"additionalProperties":false,"properties":{"kind":{"const":"none","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"gzip","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"enum":["zip","tar","tar.gz"],"type":"string"},"member":{"anyOf":[{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},{"additionalProperties":false,"properties":{"extensions":{"items":{"pattern":"^\\.[A-Za-z0-9][A-Za-z0-9.]*$","type":"string"},"minItems":1,"type":"array"}},"required":["extensions"],"type":"object"},{"additionalProperties":false,"properties":{"pattern":{"minLength":1,"type":"string"}},"required":["pattern"],"type":"object"}]}},"required":["kind","member"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"enum":["zip","tar","tar.gz"],"type":"string"},"members":{"anyOf":[{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},{"additionalProperties":false,"properties":{"extensions":{"items":{"pattern":"^\\.[A-Za-z0-9][A-Za-z0-9.]*$","type":"string"},"minItems":1,"type":"array"}},"required":["extensions"],"type":"object"},{"additionalProperties":false,"properties":{"pattern":{"minLength":1,"type":"string"}},"required":["pattern"],"type":"object"}]}},"required":["kind","members"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"xlsx","type":"string"},"sheet":{"minLength":1,"type":"string"}},"required":["kind","sheet"],"type":"object"}]},"paging":{"oneOf":[{"additionalProperties":false,"properties":{"kind":{"const":"arcgis-query","type":"string"},"orderBy":{"pattern":"^[A-Za-z_][A-Za-z0-9_]*$","type":"string"}},"required":["kind","orderBy"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"socrata-resource","type":"string"},"pageSize":{"maximum":9007199254740991,"minimum":1,"type":"integer"}},"required":["kind","pageSize"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"ckan-datastore","type":"string"},"pageSize":{"maximum":9007199254740991,"minimum":1,"type":"integer"}},"required":["kind","pageSize"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"openfema","type":"string"},"pageSize":{"maximum":9007199254740991,"minimum":1,"type":"integer"}},"required":["kind","pageSize"],"type":"object"}]},"parser":{"oneOf":[{"additionalProperties":false,"properties":{"commentPrefixes":{"items":{"minLength":1,"type":"string"},"type":"array"},"delimiter":{"enum":["detect","whitespace","tab","comma","space"],"type":"string"},"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"edge-list","type":"string"},"skipLines":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"sourceColumn":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"targetColumn":{"maximum":9007199254740991,"minimum":0,"type":"integer"}},"required":["format","encoding","delimiter","skipLines","commentPrefixes","sourceColumn","targetColumn"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"matrix-market","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"gml","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"pajek","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"customer-points","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"solomon","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"top","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"toptw","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"tsplib","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"const":"utf-8","type":"string"},"format":{"const":"verolog-2019","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"encoding":{"const":"utf-8","type":"string"},"format":{"const":"vrp-rep","type":"string"}},"required":["format","encoding"],"type":"object"},{"additionalProperties":false,"properties":{"columns":{"items":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"type":"array"},"delimiter":{"enum":["comma","tab","semicolon"],"type":"string"},"encoding":{"enum":["utf-8","latin1"],"type":"string"},"format":{"const":"csv-table","type":"string"},"idColumn":{"anyOf":[{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},{"type":"null"}]},"nullValues":{"items":{"minLength":1,"type":"string"},"type":"array"},"numericColumns":{"items":{"additionalProperties":false,"properties":{"column":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"factor":{"exclusiveMinimum":0,"type":"number"}},"required":["column","factor"],"type":"object"},"type":"array"},"skipLines":{"maximum":9007199254740991,"minimum":0,"type":"integer"}},"required":["format","encoding","delimiter","skipLines","idColumn","numericColumns"],"type":"object"},{"additionalProperties":false,"properties":{"columns":{"items":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"minItems":1,"type":"array"},"dateColumns":{"items":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"type":"array"},"encoding":{"const":"utf-8","type":"string"},"format":{"const":"geojson","type":"string"},"idColumn":{"anyOf":[{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},{"type":"null"}]},"numericColumns":{"items":{"additionalProperties":false,"properties":{"column":{"pattern":"^[A-Za-z](?:[A-Za-z0-9_]*[A-Za-z0-9])?$","type":"string"},"factor":{"exclusiveMinimum":0,"type":"number"}},"required":["column","factor"],"type":"object"},"type":"array"}},"required":["format","encoding","idColumn","numericColumns","dateColumns","columns"],"type":"object"}]},"source":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"status":{"const":"fetchable","type":"string"}},"required":["status","source","archive","parser"],"type":"object"},{"additionalProperties":false,"properties":{"reason":{"minLength":1,"type":"string"},"status":{"const":"not-fetchable","type":"string"}},"required":["status","reason"],"type":"object"}]},"sources":{"items":{"additionalProperties":false,"properties":{"retrieved":{"format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","type":"string"},"snapshot":{"additionalProperties":false,"properties":{"timestamp":{"pattern":"^\\d{8}(?:\\d{6})?$","type":"string"},"url":{"format":"uri","type":"string"}},"required":["url","timestamp"],"type":"object"},"status":{"enum":["live","dead"],"type":"string"},"url":{"format":"uri","type":"string"}},"required":["url","retrieved","status"],"type":"object"},"minItems":1,"type":"array"},"tags":{"items":{"minLength":1,"type":"string"},"type":"array"}},"required":["id","name","tags","category","sources","licence","citations","recipe","crosswalk","expectedCounts","properties"],"type":"object"}},"$id":"https://cdn.jsdelivr.net/npm/keepset@0.28.1/schemas/entry.schema.json","$ref":"#/$defs/Entry","$schema":"https://json-schema.org/draft/2020-12/schema"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$defs":{"Manifest":{"additionalProperties":false,"properties":{"description":{"minLength":1,"type":"string"},"id":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"lineage":{"additionalProperties":false,"properties":{"catalogue":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"repository":{"format":"uri","type":"string"},"version":{"pattern":"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$","type":"string"}},"required":["catalogue","version","repository"],"type":"object"},"name":{"minLength":1,"type":"string"},"namespaceAliases":{"additionalProperties":{"items":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"minItems":1,"type":"array"},"propertyNames":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"type":"object"},"repository":{"format":"uri","type":"string"},"version":{"pattern":"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$","type":"string"}},"required":["id","name","description","version","repository"],"type":"object"}},"$id":"https://cdn.jsdelivr.net/npm/keepset@0.28.
|
|
1
|
+
{"$defs":{"Manifest":{"additionalProperties":false,"properties":{"description":{"minLength":1,"type":"string"},"id":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"lineage":{"additionalProperties":false,"properties":{"catalogue":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"repository":{"format":"uri","type":"string"},"version":{"pattern":"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$","type":"string"}},"required":["catalogue","version","repository"],"type":"object"},"name":{"minLength":1,"type":"string"},"namespaceAliases":{"additionalProperties":{"items":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"minItems":1,"type":"array"},"propertyNames":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$","type":"string"},"type":"object"},"repository":{"format":"uri","type":"string"},"version":{"pattern":"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$","type":"string"}},"required":["id","name","description","version","repository"],"type":"object"}},"$id":"https://cdn.jsdelivr.net/npm/keepset@0.28.1/schemas/manifest.schema.json","$ref":"#/$defs/Manifest","$schema":"https://json-schema.org/draft/2020-12/schema"}
|