@finbheara/archive-client 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +358 -2
- package/dist/chunks/index-hghdy980.js +75 -0
- package/dist/chunks/index-hne1wadw.js +57 -0
- package/dist/chunks/index-zr8tfjk0.js +2357 -0
- package/dist/cli.js +699 -0
- package/dist/config.js +21 -0
- package/dist/index.js +99 -0
- package/dist/tag.js +19 -0
- package/dist/types/assets.d.ts +40 -0
- package/dist/types/bytes.d.ts +3 -0
- package/dist/types/cli.d.ts +24 -0
- package/dist/types/comps.d.ts +127 -0
- package/dist/types/config.d.ts +16 -0
- package/dist/types/dancers-names.d.ts +5 -0
- package/dist/types/dancers.d.ts +138 -0
- package/dist/types/feises.d.ts +84 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/indexes.d.ts +31 -0
- package/dist/types/manager.d.ts +94 -0
- package/dist/types/people.d.ts +65 -0
- package/dist/types/pin.d.ts +8 -0
- package/dist/types/registrations.d.ts +60 -0
- package/dist/types/release.d.ts +70 -0
- package/dist/types/remote.d.ts +16 -0
- package/dist/types/results.d.ts +82 -0
- package/dist/types/schools.d.ts +42 -0
- package/dist/types/tag.d.ts +24 -0
- package/package.json +52 -5
package/dist/config.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
expandHome2,
|
|
4
|
+
cacheRoot2,
|
|
5
|
+
configPath2,
|
|
6
|
+
readConfig2,
|
|
7
|
+
writeJsonAtomic2,
|
|
8
|
+
writeConfig2,
|
|
9
|
+
repoOf2,
|
|
10
|
+
requireRepo2
|
|
11
|
+
} from "./chunks/index-hne1wadw.js";
|
|
12
|
+
export {
|
|
13
|
+
cacheRoot2 as cacheRoot,
|
|
14
|
+
configPath2 as configPath,
|
|
15
|
+
expandHome2 as expandHome,
|
|
16
|
+
readConfig2 as readConfig,
|
|
17
|
+
repoOf2 as repoOf,
|
|
18
|
+
requireRepo2 as requireRepo,
|
|
19
|
+
writeConfig2 as writeConfig,
|
|
20
|
+
writeJsonAtomic2 as writeJsonAtomic
|
|
21
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
DATABASES2,
|
|
4
|
+
planAsset2,
|
|
5
|
+
sha256File2,
|
|
6
|
+
unzstdTo2,
|
|
7
|
+
NAME_LEVELS2,
|
|
8
|
+
nameLevel2,
|
|
9
|
+
FEIS_LOCAL_ID_FLOOR2,
|
|
10
|
+
ResultFinder2,
|
|
11
|
+
MajorsFinder2,
|
|
12
|
+
DancerResolver2,
|
|
13
|
+
canonicalOf2,
|
|
14
|
+
CompResolver2,
|
|
15
|
+
NO_CALENDAR2,
|
|
16
|
+
FeisFinder2,
|
|
17
|
+
StaffFinder2,
|
|
18
|
+
SchoolResolver2,
|
|
19
|
+
defaultBuilders2,
|
|
20
|
+
indexPath2,
|
|
21
|
+
indexKey2,
|
|
22
|
+
isCurrent2,
|
|
23
|
+
buildIndex2,
|
|
24
|
+
listIndexes2,
|
|
25
|
+
readPin2,
|
|
26
|
+
youngest2,
|
|
27
|
+
dancerResolverOf2,
|
|
28
|
+
RegistrationResolver2,
|
|
29
|
+
ghRemote2,
|
|
30
|
+
httpsRemote2,
|
|
31
|
+
fallbackRemote2,
|
|
32
|
+
setRemote2,
|
|
33
|
+
resolveTag2,
|
|
34
|
+
Release2,
|
|
35
|
+
openRelease2,
|
|
36
|
+
openCached2,
|
|
37
|
+
ReleaseManager2,
|
|
38
|
+
releases2
|
|
39
|
+
} from "./chunks/index-zr8tfjk0.js";
|
|
40
|
+
import {
|
|
41
|
+
cacheRoot2,
|
|
42
|
+
repoOf2
|
|
43
|
+
} from "./chunks/index-hne1wadw.js";
|
|
44
|
+
import {
|
|
45
|
+
ARCHIVE_TAG2,
|
|
46
|
+
parseArchiveTag2,
|
|
47
|
+
renderArchiveTag2,
|
|
48
|
+
cutOf2,
|
|
49
|
+
compareTagsNewestFirst2,
|
|
50
|
+
parseReleaseSpec2,
|
|
51
|
+
pickTag2
|
|
52
|
+
} from "./chunks/index-hghdy980.js";
|
|
53
|
+
export {
|
|
54
|
+
ARCHIVE_TAG2 as ARCHIVE_TAG,
|
|
55
|
+
CompResolver2 as CompResolver,
|
|
56
|
+
DATABASES2 as DATABASES,
|
|
57
|
+
DancerResolver2 as DancerResolver,
|
|
58
|
+
FEIS_LOCAL_ID_FLOOR2 as FEIS_LOCAL_ID_FLOOR,
|
|
59
|
+
FeisFinder2 as FeisFinder,
|
|
60
|
+
MajorsFinder2 as MajorsFinder,
|
|
61
|
+
NAME_LEVELS2 as NAME_LEVELS,
|
|
62
|
+
NO_CALENDAR2 as NO_CALENDAR,
|
|
63
|
+
RegistrationResolver2 as RegistrationResolver,
|
|
64
|
+
Release2 as Release,
|
|
65
|
+
ReleaseManager2 as ReleaseManager,
|
|
66
|
+
ResultFinder2 as ResultFinder,
|
|
67
|
+
SchoolResolver2 as SchoolResolver,
|
|
68
|
+
StaffFinder2 as StaffFinder,
|
|
69
|
+
buildIndex2 as buildIndex,
|
|
70
|
+
cacheRoot2 as cacheRoot,
|
|
71
|
+
canonicalOf2 as canonicalOf,
|
|
72
|
+
compareTagsNewestFirst2 as compareTagsNewestFirst,
|
|
73
|
+
cutOf2 as cutOf,
|
|
74
|
+
dancerResolverOf2 as dancerResolverOf,
|
|
75
|
+
defaultBuilders2 as defaultBuilders,
|
|
76
|
+
fallbackRemote2 as fallbackRemote,
|
|
77
|
+
ghRemote2 as ghRemote,
|
|
78
|
+
httpsRemote2 as httpsRemote,
|
|
79
|
+
indexKey2 as indexKey,
|
|
80
|
+
indexPath2 as indexPath,
|
|
81
|
+
isCurrent2 as isCurrent,
|
|
82
|
+
listIndexes2 as listIndexes,
|
|
83
|
+
nameLevel2 as nameLevel,
|
|
84
|
+
openCached2 as openCached,
|
|
85
|
+
openRelease2 as openRelease,
|
|
86
|
+
parseArchiveTag2 as parseArchiveTag,
|
|
87
|
+
parseReleaseSpec2 as parseReleaseSpec,
|
|
88
|
+
pickTag2 as pickTag,
|
|
89
|
+
planAsset2 as planAsset,
|
|
90
|
+
readPin2 as readPin,
|
|
91
|
+
releases2 as releases,
|
|
92
|
+
renderArchiveTag2 as renderArchiveTag,
|
|
93
|
+
repoOf2 as repoOf,
|
|
94
|
+
resolveTag2 as resolveTag,
|
|
95
|
+
setRemote2 as setRemote,
|
|
96
|
+
sha256File2 as sha256File,
|
|
97
|
+
unzstdTo2 as unzstdTo,
|
|
98
|
+
youngest2 as youngest
|
|
99
|
+
};
|
package/dist/tag.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ARCHIVE_TAG2,
|
|
4
|
+
parseArchiveTag2,
|
|
5
|
+
renderArchiveTag2,
|
|
6
|
+
cutOf2,
|
|
7
|
+
compareTagsNewestFirst2,
|
|
8
|
+
parseReleaseSpec2,
|
|
9
|
+
pickTag2
|
|
10
|
+
} from "./chunks/index-hghdy980.js";
|
|
11
|
+
export {
|
|
12
|
+
ARCHIVE_TAG2 as ARCHIVE_TAG,
|
|
13
|
+
compareTagsNewestFirst2 as compareTagsNewestFirst,
|
|
14
|
+
cutOf2 as cutOf,
|
|
15
|
+
parseArchiveTag2 as parseArchiveTag,
|
|
16
|
+
parseReleaseSpec2 as parseReleaseSpec,
|
|
17
|
+
pickTag2 as pickTag,
|
|
18
|
+
renderArchiveTag2 as renderArchiveTag
|
|
19
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface ReleaseManifest {
|
|
2
|
+
corpusRelease?: string;
|
|
3
|
+
archiveCommit?: string;
|
|
4
|
+
archiveFraction?: number;
|
|
5
|
+
databases?: Record<string, {
|
|
6
|
+
file?: string;
|
|
7
|
+
bytes?: number;
|
|
8
|
+
sha256?: string;
|
|
9
|
+
}>;
|
|
10
|
+
parquet?: {
|
|
11
|
+
files?: Record<string, {
|
|
12
|
+
sha256?: string;
|
|
13
|
+
rows?: number;
|
|
14
|
+
table?: string;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
[k: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export declare const DATABASES: readonly ["results", "majors"];
|
|
20
|
+
export type DatabaseName = (typeof DATABASES)[number];
|
|
21
|
+
export declare const isDatabase: (name: string) => name is DatabaseName;
|
|
22
|
+
export interface AssetPlan {
|
|
23
|
+
asked: string;
|
|
24
|
+
published: string[];
|
|
25
|
+
local: string;
|
|
26
|
+
decompress: boolean;
|
|
27
|
+
contentSha256: string | null;
|
|
28
|
+
}
|
|
29
|
+
export declare function planAsset(name: string, manifest: ReleaseManifest | null): AssetPlan;
|
|
30
|
+
export interface LandedFile {
|
|
31
|
+
from: string;
|
|
32
|
+
sha256: string;
|
|
33
|
+
bytes: number;
|
|
34
|
+
verified: ("host-digest" | "manifest")[];
|
|
35
|
+
}
|
|
36
|
+
export interface Receipt {
|
|
37
|
+
tag: string;
|
|
38
|
+
source: string;
|
|
39
|
+
files: Record<string, LandedFile>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import type { OpenOptions } from "./release.js";
|
|
3
|
+
export declare const USAGE = "usage: idq <verb> [--cache <dir>] [--repo <owner/name>] [--json]\n\n config repo <owner/name> set the user-local repository the releases come from\n list [--remote] the cached releases (size, files, indexes, the pin), and\n with --remote the published tags\n fetch [--release <spec>] [--assets results,majors,<file>...]\n download, verify and cache a release (default: results)\n pin <spec> the user-local pin: what a bare open (spec \"pinned\") opens\n unpin remove the pin (a bare open is then \"latest\")\n current the pin, and whether it is cached\n add <dir> --tag <tag> add a release built locally (its MANIFEST.json and files)\n to the cache under its tag\n index [--release <spec>] [<name>...] [--force]\n build the per-tag indexes (default: every one)\n verify [--release <spec>] re-hash every cached file against its receipt\n prune [--keep N] [--dry-run] remove all but the N newest cached releases (default 1)\n and the pinned one\n rm <tag> [--dry-run] remove one cached release (not the pinned one)\n drop-indexes [<tag>] [--dry-run] remove the index files (of one release, or of every one)\n feis [--release <spec>] [--platform <p>] [--code <c>] [--id <id>] [--name <glob>] [--year <y>]\n the feises a query names\n series [--release <spec>] <name|host code|feis id>\n the series a name, a host code (fweb:ABC) or any feis id\n names: its years, hosts, codes and next instance\n school [--release <spec>] <print|school_id> [--region <code>]\n a school print or id to the published schools\n dancer [--release <spec>] <name> | --surname <s> | --like <glob> | --id <dancer_id>\n [--order surname-first|given-first] [--school <print|id>]\n [--yob <y> | --band <U10> [--year <y>] | --comp <competition>] [--as-of <date>]\n [--rows] the dancers a name reaches, each with its evidence\n (name level, age, school) and the arm; the results of\n the one dancer where one answers (or --rows for each)\n results [--release <spec>] [--dancer <id>] [--feis <id>] [--comp <competition>]\n [--school <print|id>] [--year <y>] [--limit <n>]\n the published result rows, prints and ids\n majors [--release <spec>] [--event <e>] [--year <y>] [--comp <competition>] [--dancer <id>]\n the majors: every event and its years; an event's\n competitions; a competition's, an event's or a dancer's rows\n teacher [--release <spec>] <name|TD number>\n the staff lists' people: where they taught, the register,\n where they sat\n adjudicator [--release <spec>] <name|TD number>\n the register's and the panels' people: the same answer\n comp [--release <spec>] <feis> <code> [--year <y>] [--title <t>]\n a feis's own comp code to the comp it names, through that\n feis's syllabus (or the prior year's)\n syllabus [--release <spec>] <feis> [year]\n one feis-year's comps, in printed order\n syllabus [--release <spec>] --for <series> [year]\n a series' syllabus for a year: that year's where held,\n else the newest, saying which and what it is read from\n resolve comp [<feis> <code>] [--year <y>] [--title <t>]\n resolve dancer [<name>] [--school <s>] [--comp <feis>/<code> | --yob <y> | --band <b> --year <y>]\n [--order <o>] [--as-of <date>]\n resolve registrations\n JSONL out, one answer per line; with no positional the\n questions are JSONL on stdin, one per line (a comp:\n {feis, code, year?, title?}, a dancer: {name, school?, age?},\n a registration: {name, school?, codes[], feis, year?})\n\n <spec>: pinned (the default) | latest | a cut (42, 42.1) | a tag (archive-YYYY.MM.DD-N)";
|
|
4
|
+
export interface Parsed {
|
|
5
|
+
positional: string[];
|
|
6
|
+
flags: Map<string, string>;
|
|
7
|
+
bools: Set<string>;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseArgs(argv: readonly string[]): Parsed;
|
|
10
|
+
type Line<T> = {
|
|
11
|
+
line: number;
|
|
12
|
+
value: T;
|
|
13
|
+
} | {
|
|
14
|
+
line: number;
|
|
15
|
+
error: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function jsonLines<T>(text: string, check: (v: T) => string | null): Line<T>[];
|
|
18
|
+
export declare function main(argv: readonly string[], io?: {
|
|
19
|
+
say?: (s: string) => void;
|
|
20
|
+
log?: (s: string) => void;
|
|
21
|
+
opts?: OpenOptions;
|
|
22
|
+
stdin?: () => Promise<string>;
|
|
23
|
+
}): Promise<number>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type AgeRelation } from "@finbheara/domain/age";
|
|
2
|
+
import { type Population, type PopulationRelation } from "@finbheara/domain/title";
|
|
3
|
+
import type { IndexBuilder } from "./indexes.js";
|
|
4
|
+
import type { Release } from "./release.js";
|
|
5
|
+
export type CompKind = "championship" | "grade" | "unrated";
|
|
6
|
+
export type CompSource = "syllabus" | "prior-year" | "title";
|
|
7
|
+
export type SyllabusSource = "syllabus-document" | "results";
|
|
8
|
+
export interface Comp {
|
|
9
|
+
competition: string;
|
|
10
|
+
feis_id: string;
|
|
11
|
+
year: number | null;
|
|
12
|
+
code: string;
|
|
13
|
+
title: string | null;
|
|
14
|
+
kind: CompKind;
|
|
15
|
+
feis_level: number | null;
|
|
16
|
+
level: string | null;
|
|
17
|
+
age: string | null;
|
|
18
|
+
population: Population | null;
|
|
19
|
+
round: string | null;
|
|
20
|
+
canonical: string | null;
|
|
21
|
+
platform: string;
|
|
22
|
+
captures: number;
|
|
23
|
+
}
|
|
24
|
+
export interface CompQuery {
|
|
25
|
+
feis: string;
|
|
26
|
+
code: string;
|
|
27
|
+
year?: number;
|
|
28
|
+
title?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface FeisPlace {
|
|
31
|
+
asked: string;
|
|
32
|
+
feis_ids: string[];
|
|
33
|
+
brand_id: string | null;
|
|
34
|
+
year: number | null;
|
|
35
|
+
held: boolean;
|
|
36
|
+
via: "id" | "series" | "code-stem" | "name" | null;
|
|
37
|
+
series?: string[];
|
|
38
|
+
}
|
|
39
|
+
export interface TitleCheck {
|
|
40
|
+
title: string;
|
|
41
|
+
agrees: boolean;
|
|
42
|
+
age: AgeRelation;
|
|
43
|
+
population: PopulationRelation;
|
|
44
|
+
}
|
|
45
|
+
export interface CompAnswer {
|
|
46
|
+
tag: string;
|
|
47
|
+
asked: CompQuery;
|
|
48
|
+
arm: "unique" | "ambiguous" | "none";
|
|
49
|
+
source: CompSource | null;
|
|
50
|
+
kind: CompKind | null;
|
|
51
|
+
level: string | null;
|
|
52
|
+
feis_level: number | null;
|
|
53
|
+
age: string | null;
|
|
54
|
+
population: Population | null;
|
|
55
|
+
round: string | null;
|
|
56
|
+
canonical: string | null;
|
|
57
|
+
title: string | null;
|
|
58
|
+
competition: string | null;
|
|
59
|
+
candidates: Comp[];
|
|
60
|
+
feis: FeisPlace;
|
|
61
|
+
from?: {
|
|
62
|
+
feis_ids: string[];
|
|
63
|
+
year: number;
|
|
64
|
+
};
|
|
65
|
+
check?: TitleCheck | "unchecked";
|
|
66
|
+
syllabus_source: SyllabusSource | null;
|
|
67
|
+
why?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface SyllabusForAnswer {
|
|
70
|
+
tag: string;
|
|
71
|
+
asked: {
|
|
72
|
+
series: string;
|
|
73
|
+
year: number | null;
|
|
74
|
+
};
|
|
75
|
+
arm: "unique" | "ambiguous" | "none";
|
|
76
|
+
series_id: string | null;
|
|
77
|
+
feis: FeisPlace;
|
|
78
|
+
year: number | null;
|
|
79
|
+
held: boolean;
|
|
80
|
+
source: SyllabusSource | null;
|
|
81
|
+
feis_ids: string[];
|
|
82
|
+
entries: Comp[];
|
|
83
|
+
years: number[];
|
|
84
|
+
championships: number;
|
|
85
|
+
why?: string;
|
|
86
|
+
note?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface SyllabusAnswer {
|
|
89
|
+
tag: string;
|
|
90
|
+
feis: FeisPlace;
|
|
91
|
+
year: number | null;
|
|
92
|
+
held: boolean;
|
|
93
|
+
entries: Comp[];
|
|
94
|
+
years: number[];
|
|
95
|
+
}
|
|
96
|
+
export declare const compsIndex: IndexBuilder;
|
|
97
|
+
interface CompRow {
|
|
98
|
+
competition: string;
|
|
99
|
+
feis_id: string;
|
|
100
|
+
brand_id: string | null;
|
|
101
|
+
year: number | null;
|
|
102
|
+
code: string;
|
|
103
|
+
title: string | null;
|
|
104
|
+
age: string | null;
|
|
105
|
+
gender: string | null;
|
|
106
|
+
feis_level: number | null;
|
|
107
|
+
round: string | null;
|
|
108
|
+
platform: string;
|
|
109
|
+
captures: number;
|
|
110
|
+
}
|
|
111
|
+
export declare function compOf(r: CompRow): Comp;
|
|
112
|
+
export declare function canonicalOf(level: number | null, age: string | null): string | null;
|
|
113
|
+
export declare class CompResolver {
|
|
114
|
+
private readonly rel;
|
|
115
|
+
constructor(rel: Release);
|
|
116
|
+
place(feis: string, year?: number): Promise<FeisPlace>;
|
|
117
|
+
private ofSeries;
|
|
118
|
+
private years;
|
|
119
|
+
private compsOf;
|
|
120
|
+
private idsOf;
|
|
121
|
+
syllabus(feis: string, year?: number): Promise<SyllabusAnswer>;
|
|
122
|
+
syllabusFor(series: string | {
|
|
123
|
+
series_id: string | null;
|
|
124
|
+
}, year?: number): Promise<SyllabusForAnswer>;
|
|
125
|
+
resolve(q: CompQuery): Promise<CompAnswer>;
|
|
126
|
+
}
|
|
127
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ClientOptions {
|
|
2
|
+
cache?: string;
|
|
3
|
+
repo?: string;
|
|
4
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
5
|
+
}
|
|
6
|
+
export declare function expandHome(p: string): string;
|
|
7
|
+
export declare function cacheRoot(opts?: ClientOptions): string;
|
|
8
|
+
export interface UserConfig {
|
|
9
|
+
repo?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const configPath: (root: string) => string;
|
|
12
|
+
export declare function readConfig(root: string): UserConfig;
|
|
13
|
+
export declare function writeJsonAtomic(path: string, value: unknown): void;
|
|
14
|
+
export declare function writeConfig(root: string, patch: UserConfig): UserConfig;
|
|
15
|
+
export declare function repoOf(opts?: ClientOptions): string | null;
|
|
16
|
+
export declare function requireRepo(opts?: ClientOptions): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type PersonName, type TransitiveLevel } from "@finbheara/names/normalize";
|
|
2
|
+
export type NameLevel = TransitiveLevel | "initial" | "middle" | "surname" | "like";
|
|
3
|
+
export declare const NAME_LEVELS: readonly NameLevel[];
|
|
4
|
+
export declare const finer: (a: NameLevel, b: NameLevel) => NameLevel;
|
|
5
|
+
export declare function nameLevel(q: PersonName, c: PersonName): NameLevel | null;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { type NameLevel } from "./dancers-names.js";
|
|
2
|
+
import type { IndexBuilder } from "./indexes.js";
|
|
3
|
+
import type { Release } from "./release.js";
|
|
4
|
+
import { FEIS_LOCAL_ID_FLOOR } from "./results.js";
|
|
5
|
+
export { FEIS_LOCAL_ID_FLOOR };
|
|
6
|
+
export type NameOrderAsked = "surname-first" | "given-first" | "unknown";
|
|
7
|
+
export type AgeAsked = {
|
|
8
|
+
comp: string;
|
|
9
|
+
year?: number;
|
|
10
|
+
} | {
|
|
11
|
+
yob: number;
|
|
12
|
+
} | {
|
|
13
|
+
band: string;
|
|
14
|
+
year?: number | null;
|
|
15
|
+
};
|
|
16
|
+
export declare function nameOrderOf(s: string | undefined): NameOrderAsked | undefined;
|
|
17
|
+
export interface DancerQuery {
|
|
18
|
+
name: string;
|
|
19
|
+
order?: NameOrderAsked;
|
|
20
|
+
school?: string;
|
|
21
|
+
age?: AgeAsked;
|
|
22
|
+
asOf?: string;
|
|
23
|
+
}
|
|
24
|
+
export type AgeEvidence = "fits" | "overlaps" | "contradicts" | "unknown" | "unasked";
|
|
25
|
+
export type SchoolEvidence = "same" | "moved" | "none" | "unresolved" | "unasked";
|
|
26
|
+
export interface DancerSchool {
|
|
27
|
+
school_id: string | null;
|
|
28
|
+
print: string;
|
|
29
|
+
rows: number;
|
|
30
|
+
year_lo: number | null;
|
|
31
|
+
year_hi: number | null;
|
|
32
|
+
}
|
|
33
|
+
export interface DancerCandidate {
|
|
34
|
+
dancer_id: number;
|
|
35
|
+
display: string;
|
|
36
|
+
scope: "per-release" | "stable";
|
|
37
|
+
kind: string | null;
|
|
38
|
+
score: number;
|
|
39
|
+
evidence: {
|
|
40
|
+
nameLevel: NameLevel;
|
|
41
|
+
age: AgeEvidence;
|
|
42
|
+
school: SchoolEvidence;
|
|
43
|
+
};
|
|
44
|
+
prints: {
|
|
45
|
+
print: string;
|
|
46
|
+
rows: number;
|
|
47
|
+
level: NameLevel;
|
|
48
|
+
}[];
|
|
49
|
+
rows: number;
|
|
50
|
+
year_lo: number | null;
|
|
51
|
+
year_hi: number | null;
|
|
52
|
+
birth: {
|
|
53
|
+
lo: number | null;
|
|
54
|
+
hi: number | null;
|
|
55
|
+
source: string;
|
|
56
|
+
conflict: boolean;
|
|
57
|
+
};
|
|
58
|
+
school: DancerSchool | null;
|
|
59
|
+
}
|
|
60
|
+
export interface ExcludedCandidate {
|
|
61
|
+
candidate: DancerCandidate;
|
|
62
|
+
why: "age";
|
|
63
|
+
}
|
|
64
|
+
export interface DancerAnswer {
|
|
65
|
+
tag: string;
|
|
66
|
+
asked: DancerQuery;
|
|
67
|
+
arm: "unique" | "ambiguous" | "none";
|
|
68
|
+
candidates: DancerCandidate[];
|
|
69
|
+
excluded: ExcludedCandidate[];
|
|
70
|
+
preferred?: {
|
|
71
|
+
dancer_id: number;
|
|
72
|
+
why: string;
|
|
73
|
+
};
|
|
74
|
+
unlinked: {
|
|
75
|
+
print: string;
|
|
76
|
+
rows: number;
|
|
77
|
+
}[];
|
|
78
|
+
age?: {
|
|
79
|
+
read: string | null;
|
|
80
|
+
birth: {
|
|
81
|
+
from: number | null;
|
|
82
|
+
to: number | null;
|
|
83
|
+
} | null;
|
|
84
|
+
note?: string;
|
|
85
|
+
};
|
|
86
|
+
school?: {
|
|
87
|
+
arm: string;
|
|
88
|
+
ids: string[];
|
|
89
|
+
};
|
|
90
|
+
refused?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface DancerSearchQuery extends Omit<DancerQuery, "name"> {
|
|
93
|
+
name?: string;
|
|
94
|
+
surname?: string;
|
|
95
|
+
like?: string;
|
|
96
|
+
limit?: number;
|
|
97
|
+
}
|
|
98
|
+
export interface DancerRecord {
|
|
99
|
+
tag: string;
|
|
100
|
+
dancer_id: number;
|
|
101
|
+
display: string;
|
|
102
|
+
scope: "per-release" | "stable";
|
|
103
|
+
kind: string | null;
|
|
104
|
+
names_printed: string[];
|
|
105
|
+
genders: string;
|
|
106
|
+
appearances: number;
|
|
107
|
+
rows: number;
|
|
108
|
+
year_lo: number | null;
|
|
109
|
+
year_hi: number | null;
|
|
110
|
+
birth: {
|
|
111
|
+
lo: number | null;
|
|
112
|
+
hi: number | null;
|
|
113
|
+
source: string;
|
|
114
|
+
conflict: boolean;
|
|
115
|
+
};
|
|
116
|
+
prints: {
|
|
117
|
+
print: string;
|
|
118
|
+
rows: number;
|
|
119
|
+
year_lo: number | null;
|
|
120
|
+
year_hi: number | null;
|
|
121
|
+
}[];
|
|
122
|
+
schools: DancerSchool[];
|
|
123
|
+
}
|
|
124
|
+
export declare const PACKAGE_KEY_PARTS: readonly string[];
|
|
125
|
+
export declare const dancersIndex: IndexBuilder;
|
|
126
|
+
export declare function yearOf(asOf: string | undefined): number | null;
|
|
127
|
+
export declare class DancerResolver {
|
|
128
|
+
private readonly rel;
|
|
129
|
+
private readonly printIds;
|
|
130
|
+
constructor(rel: Release);
|
|
131
|
+
resolve(q: DancerQuery): Promise<DancerAnswer>;
|
|
132
|
+
search(q: DancerSearchQuery): Promise<DancerAnswer>;
|
|
133
|
+
private capped;
|
|
134
|
+
get(dancerId: number): Promise<DancerRecord | null>;
|
|
135
|
+
private answer;
|
|
136
|
+
private schoolEvidence;
|
|
137
|
+
private readAge;
|
|
138
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { IndexBuilder } from "./indexes.js";
|
|
2
|
+
import type { Release } from "./release.js";
|
|
3
|
+
export interface Feis {
|
|
4
|
+
feis_id: string;
|
|
5
|
+
source: string;
|
|
6
|
+
token: string;
|
|
7
|
+
host_id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
date_lo: string | null;
|
|
10
|
+
date_hi: string | null;
|
|
11
|
+
date_printed: string | null;
|
|
12
|
+
year: number | null;
|
|
13
|
+
location: string | null;
|
|
14
|
+
instance_id: string | null;
|
|
15
|
+
brand_id: string | null;
|
|
16
|
+
regions: string[];
|
|
17
|
+
competitions: number;
|
|
18
|
+
rows: number;
|
|
19
|
+
captures: number;
|
|
20
|
+
}
|
|
21
|
+
export interface FeisQuery {
|
|
22
|
+
platform?: string;
|
|
23
|
+
code?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
year?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface FeisAnswer {
|
|
29
|
+
tag: string;
|
|
30
|
+
feises: Feis[];
|
|
31
|
+
redirected?: {
|
|
32
|
+
from: string;
|
|
33
|
+
to: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export declare function readJsonl<T>(path: string): T[];
|
|
37
|
+
export declare const feisesIndex: IndexBuilder;
|
|
38
|
+
export interface SeriesInstance {
|
|
39
|
+
year: number | null;
|
|
40
|
+
feis_ids: string[];
|
|
41
|
+
date_lo: string | null;
|
|
42
|
+
name: string;
|
|
43
|
+
}
|
|
44
|
+
export interface Series {
|
|
45
|
+
series_id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
host: string;
|
|
48
|
+
hosts: string[];
|
|
49
|
+
codes: string[];
|
|
50
|
+
years: number[];
|
|
51
|
+
instances: SeriesInstance[];
|
|
52
|
+
}
|
|
53
|
+
export interface SeriesNext {
|
|
54
|
+
feis_id: string | null;
|
|
55
|
+
date: string;
|
|
56
|
+
}
|
|
57
|
+
export interface SeriesAnswer {
|
|
58
|
+
tag: string;
|
|
59
|
+
asked: string;
|
|
60
|
+
arm: "unique" | "ambiguous" | "none";
|
|
61
|
+
via: "id" | "code-stem" | "name" | null;
|
|
62
|
+
series_id: string | null;
|
|
63
|
+
name: string | null;
|
|
64
|
+
host: string | null;
|
|
65
|
+
years: number[];
|
|
66
|
+
instances: SeriesInstance[];
|
|
67
|
+
next: SeriesNext | null;
|
|
68
|
+
next_why?: string;
|
|
69
|
+
candidates: Series[];
|
|
70
|
+
redirected?: {
|
|
71
|
+
from: string;
|
|
72
|
+
to: string;
|
|
73
|
+
};
|
|
74
|
+
why?: string;
|
|
75
|
+
}
|
|
76
|
+
export declare const NO_CALENDAR = "the release holds a feis-year once its results are captured and carries no calendar of scheduled feiseanna";
|
|
77
|
+
export declare class FeisFinder {
|
|
78
|
+
private readonly rel;
|
|
79
|
+
constructor(rel: Release);
|
|
80
|
+
find(q: FeisQuery): Promise<FeisAnswer>;
|
|
81
|
+
codeStem(token: string, stem: string): Promise<string[]>;
|
|
82
|
+
seriesOf(brand: string): Promise<Series>;
|
|
83
|
+
series(q: string): Promise<SeriesAnswer>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { type AssetPlan, DATABASES, type DatabaseName, type LandedFile, type Receipt, type ReleaseManifest, planAsset, } from "./assets.js";
|
|
2
|
+
export { sha256File, unzstdTo } from "./bytes.js";
|
|
3
|
+
export { type AgeAsked, type AgeEvidence, type DancerAnswer, type DancerCandidate, type DancerQuery, type DancerRecord, DancerResolver, type DancerSchool, type DancerSearchQuery, type ExcludedCandidate, FEIS_LOCAL_ID_FLOOR, type SchoolEvidence, } from "./dancers.js";
|
|
4
|
+
export { NAME_LEVELS, type NameLevel, nameLevel } from "./dancers-names.js";
|
|
5
|
+
export { type Comp, type CompAnswer, type CompKind, type CompQuery, CompResolver, type CompSource, type FeisPlace, type SyllabusAnswer, type SyllabusForAnswer, type SyllabusSource, type TitleCheck, canonicalOf, } from "./comps.js";
|
|
6
|
+
export { type ClientOptions, cacheRoot, repoOf } from "./config.js";
|
|
7
|
+
export { type Feis, type FeisAnswer, FeisFinder, type FeisQuery, NO_CALENDAR, type Series, type SeriesAnswer, type SeriesInstance, type SeriesNext, } from "./feises.js";
|
|
8
|
+
export { type IndexBuilder, type IndexFile, buildIndex, defaultBuilders, indexKey, indexPath, isCurrent, listIndexes, } from "./indexes.js";
|
|
9
|
+
export { type CachedRelease, type ReleaseList, ReleaseManager, type RemovalPlan, releases, } from "./manager.js";
|
|
10
|
+
export { type Registered, type Sat, type StaffAnswer, StaffFinder, type StaffPerson, type Taught, type TdLink, } from "./people.js";
|
|
11
|
+
export { type Pin, readPin } from "./pin.js";
|
|
12
|
+
export { type Remote, type RemoteAsset, fallbackRemote, ghRemote, httpsRemote, setRemote, } from "./remote.js";
|
|
13
|
+
export { type OpenOptions, Release, openCached, openRelease, resolveTag, } from "./release.js";
|
|
14
|
+
export { type MajorCompetition, type MajorEvent, MajorsFinder, type ResultAnswer, ResultFinder, type ResultQuery, type ResultRow, } from "./results.js";
|
|
15
|
+
export { type DancerAnswerLike, type DancerQueryLike, type DancerResolverLike, type DancerUnavailable, type RegistrationRow, type ResolvedDancer, RegistrationResolver, type ResolvedRegistration, dancerResolverOf, youngest, } from "./registrations.js";
|
|
16
|
+
export { type SchoolAnswer, type SchoolCandidate, type SchoolQuery, SchoolResolver, type SchoolRung, } from "./schools.js";
|
|
17
|
+
export { ARCHIVE_TAG, type ArchiveTag, type ReleaseSpec, compareTagsNewestFirst, cutOf, parseArchiveTag, parseReleaseSpec, pickTag, renderArchiveTag, } from "./tag.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Database } from "bun:sqlite";
|
|
2
|
+
import type { Release } from "./release.js";
|
|
3
|
+
export interface IndexBuilder {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly version: string;
|
|
6
|
+
readonly inputs: readonly string[];
|
|
7
|
+
readonly says: string;
|
|
8
|
+
keyParts?(rel: Release): string[];
|
|
9
|
+
build(rel: Release, out: Database): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function defaultBuilders(): IndexBuilder[];
|
|
12
|
+
export declare const indexDir: (rel: {
|
|
13
|
+
dir: string;
|
|
14
|
+
}) => string;
|
|
15
|
+
export declare const indexPath: (rel: {
|
|
16
|
+
dir: string;
|
|
17
|
+
}, name: string) => string;
|
|
18
|
+
export declare function indexKey(rel: Release, b: IndexBuilder): string;
|
|
19
|
+
export declare function keyOf(path: string): string | null;
|
|
20
|
+
export declare function isCurrent(rel: Release, b: IndexBuilder): boolean;
|
|
21
|
+
export declare function buildIndex(rel: Release, b: IndexBuilder, o: {
|
|
22
|
+
force: boolean;
|
|
23
|
+
log?: (line: string) => void;
|
|
24
|
+
}): string;
|
|
25
|
+
export interface IndexFile {
|
|
26
|
+
name: string;
|
|
27
|
+
path: string;
|
|
28
|
+
bytes: number;
|
|
29
|
+
current: boolean | null;
|
|
30
|
+
}
|
|
31
|
+
export declare function listIndexes(rel: Release): IndexFile[];
|