@finbheara/archive-client 0.23.0 → 0.25.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/dist/index.js CHANGED
@@ -24,6 +24,9 @@ import {
24
24
  syllabusSourceOf2,
25
25
  canonicalOf2,
26
26
  CompResolver2,
27
+ TabFinder2,
28
+ PanelFinder2,
29
+ FeisPanelFinder2,
27
30
  StaffFinder2,
28
31
  TeamFinder2,
29
32
  EventFinder2,
@@ -68,7 +71,7 @@ import {
68
71
  readLatestCheck2,
69
72
  latestCheck2,
70
73
  staleWarning2
71
- } from "./chunks/index-vsk6837c.js";
74
+ } from "./chunks/index-2ms980hc.js";
72
75
  import {
73
76
  cacheRoot2,
74
77
  repoOf2
@@ -93,6 +96,7 @@ export {
93
96
  FEATURES2 as FEATURES,
94
97
  FEIS_LOCAL_ID_FLOOR2 as FEIS_LOCAL_ID_FLOOR,
95
98
  FeisFinder2 as FeisFinder,
99
+ FeisPanelFinder2 as FeisPanelFinder,
96
100
  LATEST_CHECK_BUDGET_MS2 as LATEST_CHECK_BUDGET_MS,
97
101
  LATEST_CHECK_MS2 as LATEST_CHECK_MS,
98
102
  LINEAGE_FILE2 as LINEAGE_FILE,
@@ -100,12 +104,14 @@ export {
100
104
  MajorsFinder2 as MajorsFinder,
101
105
  NAME_LEVELS2 as NAME_LEVELS,
102
106
  NO_CALENDAR2 as NO_CALENDAR,
107
+ PanelFinder2 as PanelFinder,
103
108
  RegistrationResolver2 as RegistrationResolver,
104
109
  Release2 as Release,
105
110
  ReleaseManager2 as ReleaseManager,
106
111
  ResultFinder2 as ResultFinder,
107
112
  SchoolResolver2 as SchoolResolver,
108
113
  StaffFinder2 as StaffFinder,
114
+ TabFinder2 as TabFinder,
109
115
  TeamFinder2 as TeamFinder,
110
116
  buildIndex2 as buildIndex,
111
117
  buildTag2 as buildTag,
@@ -0,0 +1,15 @@
1
+ export interface VerbSpec {
2
+ verb: string;
3
+ value: readonly string[];
4
+ bool: readonly string[];
5
+ usage: readonly string[];
6
+ }
7
+ export declare const USAGE_HEADER = "usage: idq <verb> [--cache <dir>] [--repo <owner/name>] [--json] [--live]";
8
+ export declare const GLOBAL_FLAGS: {
9
+ value: readonly string[];
10
+ bool: readonly string[];
11
+ };
12
+ export declare const VERBS: readonly VerbSpec[];
13
+ export declare const USAGE_FOOTER: readonly string[];
14
+ export declare function renderUsage(): string;
15
+ export declare function valueFlags(): Set<string>;
@@ -3,7 +3,9 @@ import { type FreshnessFloor } from "./freshness.js";
3
3
  import { type LocalBuild } from "./local.js";
4
4
  import type { OpenOptions } from "./release.js";
5
5
  import type { StreamQuery } from "./stream.js";
6
- export declare const USAGE = "usage: idq <verb> [--cache <dir>] [--repo <owner/name>] [--json] [--live]\n\n config repo <owner/name> set the user-local repository the releases come from\n config keep <N> how many of the newest releases a prune keeps (default 2)\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 update [--assets ...] [--keep N] [--no-prune]\n move to the newest published release: fetch it (verified),\n build its indexes, pin it, then prune the cache to the N\n newest releases (default: config keep, else 2), keeping the\n new pin and the one before it\n use <spec> [--assets ...] [--keep N] [--no-prune]\n the same for the release a spec names\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 capabilities [--release <spec>] what the release carries of what the client reads, from\n its own schema: each feature full or missing (its calls\n refuse, naming the first cut that publishes it)\n prune [--keep N] [--dry-run] remove all but the N newest cached releases (default:\n config keep, else 2) 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 [--population girls|boys] [--oireachtas <region>[:<year>]] [--rows]\n the dancers a name reaches, each with its evidence\n (name level, age, school, population, region) and the arm;\n --oireachtas is the regional the roster is for, its region in\n the release's spelling (SRO, MAO), its year the --as-of year\n where none is given; 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 stream [--release <spec>] --scope majors|transcribed|platform|all [--entries] [--event <e,...>]\n [--year <y> | --year <from>..<to>] [--tier <t,...>] [--category <c,...>]\n [--level <feis_level,...>] [--dancer <id,...>] [--school <school_id>] [--primary]\n every row a scope holds, one JSON line each, never the\n whole table in memory; --entries one per address (the row\n it stands for, with its recall order)\n records [--release <spec>] [--dancer <id,...>]\n every dancer's record: display, appearances, birth window,\n populations\n records --years [--release <spec>] [--dancer <id,...>] [--year <y>]\n each dancer's region, nationals and place per year\n feis-dates [--release <spec>] every feis's first and last day\n tabulated [--release <spec>] [--min-round <n>]\n the majors addresses the marks sheets tabulate to round n\n or later (default 3)\n teams [--release <spec>] [--event <e>] [--year <y>] [--rosters | --joins]\n the team result rows of an event-year; with --rosters its\n roster teams and their dancers; with --joins how each roster\n team meets the results\n events [--release <spec>] [--event <e>] [--year <y>]\n each event-year's dates and place\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 (the prior year's only where the platform\n numbers every feis alike; elsewhere the title)\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>] [--population girls|boys]\n [--oireachtas <region>[:<year>]]\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 population?, oireachtas?}, a registration: {name, school?,\n codes[], feis, year?, population?, oireachtas?})\n\n A query on the default spec prints one warning line on stderr when its release is older than\n the newest published one (the remote asked at most once per hour, <cache>/LATEST.json); the\n answer and the exit code are unchanged, and an offline check says nothing.\n\n Where the caller names local builds (a wrapper's option), a query with no --release answers\n from the newest COMPLETE build newer than the pinned release, and says so in one line on\n stderr; --release <spec> names a release, and --live forces the pinned one.\n\n <spec>: pinned (the default) | latest | a cut (42, 42.1) | a tag (archive-YYYY.MM.DD-N)";
6
+ import type { TabStreamQuery } from "./tabs.js";
7
+ export { GLOBAL_FLAGS, USAGE_FOOTER, USAGE_HEADER, VERBS, type VerbSpec, renderUsage, valueFlags, } from "./cli-spec.js";
8
+ export declare const USAGE: string;
7
9
  export interface Parsed {
8
10
  positional: string[];
9
11
  flags: Map<string, string>;
@@ -19,6 +21,7 @@ type Line<T> = {
19
21
  };
20
22
  export declare function jsonLines<T>(text: string, check: (v: T) => string | null): Line<T>[];
21
23
  export declare function streamQueryOf(p: Parsed): StreamQuery;
24
+ export declare function tabStreamQueryOf(p: Parsed): TabStreamQuery;
22
25
  export interface LocalIO {
23
26
  builds: () => readonly LocalBuild[];
24
27
  }
@@ -36,4 +39,3 @@ export declare function main(argv: readonly string[], io?: {
36
39
  freshness?: FreshnessIO | false;
37
40
  local?: LocalIO | false;
38
41
  }): Promise<number>;
39
- export {};
@@ -16,10 +16,12 @@ export { type Remote, type RemoteAsset, fallbackRemote, ghRemote, httpsRemote, s
16
16
  export { type OpenOptions, Release, openCached, openRelease, resolveTag, } from "./release.js";
17
17
  export { type MajorCompetition, type MajorEvent, MajorsFinder, type ResultAnswer, ResultFinder, type ResultQuery, type ResultRow, } from "./results.js";
18
18
  export { type DancerAnswerLike, type DancerQueryLike, type DancerResolverLike, type DancerUnavailable, type RegistrationRow, type ResolvedDancer, RegistrationResolver, type ResolvedRegistration, dancerResolverOf, youngest, } from "./registrations.js";
19
+ export type { LineageEdge, ObservedAssociation, RegistrySchool, SchoolPrint, SchoolRedirect, } from "./school-bulk.js";
19
20
  export { type SchoolAnswer, type SchoolCandidate, type SchoolQuery, SchoolResolver, type SchoolRung, readsSpanishNames, type SpanishNames, } from "./schools.js";
20
21
  export { LINEAGE_FILE, type SchoolLineAnswer, type SchoolLinksAnswer, linksOfLineage, releaseSchoolGraph, } from "./school-links.js";
21
22
  export type { LineCandidate, LinkPath, LinkPolicy, LinkQuery, LinkStep, PathFlags, SchoolLink, StepFlags, StepPolicy, } from "@finbheara/domain/school-graph";
22
23
  export { type Capability, FEATURES, type Feature, type SchemaProbe, capabilityOf, columnsOf, needsRelease, } from "./schema.js";
23
24
  export { type EntryRow, type StreamQuery, type StreamRow, type StreamScope, entryRank, } from "./stream.js";
25
+ export { type FeisPanelSeat, FeisPanelFinder, PanelFinder, type PanelSeat, type RegisterRow, type TabAnswer, TabFinder, type TabQuery, type TabRow, type TabStreamQuery, } from "./tabs.js";
24
26
  export { EventFinder, type EventYear, type EventYearQuery, type ResultRoster, type RosterMember, type RosterTeam, TeamFinder, type TeamResult, } from "./teams.js";
25
27
  export { ARCHIVE_TAG, type ArchiveTag, type ReleaseSpec, compareTagsNewestFirst, cutOf, parseArchiveTag, parseReleaseSpec, pickTag, renderArchiveTag, } from "./tag.js";
@@ -2,6 +2,7 @@ import { type StaffRole } from "@finbheara/domain/noun-index";
2
2
  import { type NameLevel } from "./dancers-names.js";
3
3
  import type { IndexBuilder } from "./indexes.js";
4
4
  import type { Release } from "./release.js";
5
+ import { type RegisterRow } from "./tabs.js";
5
6
  export interface Taught {
6
7
  school_id: string;
7
8
  school: string | null;
@@ -59,6 +60,17 @@ export declare class StaffFinder {
59
60
  constructor(rel: Release);
60
61
  teacher(asked: string): Promise<StaffAnswer>;
61
62
  adjudicator(asked: string): Promise<StaffAnswer>;
63
+ adjudicators(q?: {
64
+ year?: number;
65
+ judge_clrg?: number;
66
+ }): Promise<{
67
+ tag: string;
68
+ asked: {
69
+ year?: number;
70
+ judge_clrg?: number;
71
+ };
72
+ rows: RegisterRow[];
73
+ }>;
62
74
  private find;
63
75
  private person;
64
76
  private taughtWhere;
@@ -11,6 +11,7 @@ import { type Remote } from "./remote.js";
11
11
  import { MajorsFinder, ResultFinder } from "./results.js";
12
12
  import { type Capability } from "./schema.js";
13
13
  import { type SchoolReaderChoice, SchoolResolver } from "./schools.js";
14
+ import { FeisPanelFinder, PanelFinder, TabFinder } from "./tabs.js";
14
15
  import { type ReleaseSpec } from "./tag.js";
15
16
  import { EventFinder, TeamFinder } from "./teams.js";
16
17
  export interface OpenOptions extends ClientOptions {
@@ -44,6 +45,9 @@ export declare class Release {
44
45
  readonly registrations: RegistrationResolver;
45
46
  readonly teams: TeamFinder;
46
47
  readonly events: EventFinder;
48
+ readonly tabs: TabFinder;
49
+ readonly panels: PanelFinder;
50
+ readonly feisPanels: FeisPanelFinder;
47
51
  private readonly opts;
48
52
  private readonly handles;
49
53
  private remoteAssets;
@@ -0,0 +1,80 @@
1
+ import type { Release } from "./release.js";
2
+ export interface RegistrySchool {
3
+ school_id: string;
4
+ display: string;
5
+ regions: string[];
6
+ places: string[];
7
+ }
8
+ export interface SchoolPrint {
9
+ event: string;
10
+ year: number | null;
11
+ print: string;
12
+ school_id: string;
13
+ rows: number;
14
+ }
15
+ export interface SchoolRedirect {
16
+ old_id: string;
17
+ new_id: string;
18
+ kind: string;
19
+ since: number | null;
20
+ }
21
+ export interface LineageEdge {
22
+ id: string;
23
+ direction: string;
24
+ other: string;
25
+ shape: string;
26
+ year: number | null;
27
+ provisional: boolean;
28
+ decision: string | null;
29
+ confidence: number | null;
30
+ }
31
+ export interface ObservedAssociation {
32
+ at: string;
33
+ seq: number;
34
+ date: string | null;
35
+ person: string | null;
36
+ person_printed: string;
37
+ reading: string | null;
38
+ person_type: string | null;
39
+ credentials: string | null;
40
+ caption: string | null;
41
+ school_printed: string | null;
42
+ school_id: string | null;
43
+ association_type: string | null;
44
+ src_type: string | null;
45
+ src: string | null;
46
+ candidate_school_id: string | null;
47
+ candidate_rung: string | null;
48
+ }
49
+ export declare function registrySchools(rel: Release): Promise<{
50
+ tag: string;
51
+ schools: RegistrySchool[];
52
+ }>;
53
+ export declare function schoolPrints(rel: Release, q: {
54
+ event?: string;
55
+ year?: number;
56
+ }): Promise<{
57
+ tag: string;
58
+ asked: {
59
+ event?: string;
60
+ year?: number;
61
+ };
62
+ prints: SchoolPrint[];
63
+ }>;
64
+ export declare function schoolRedirects(rel: Release): Promise<{
65
+ tag: string;
66
+ redirects: SchoolRedirect[];
67
+ }>;
68
+ export declare function schoolLineage(rel: Release): Promise<{
69
+ tag: string;
70
+ edges: LineageEdge[];
71
+ }>;
72
+ export declare function observedAssociations(rel: Release, q: {
73
+ school_id?: string;
74
+ }): Promise<{
75
+ tag: string;
76
+ asked: {
77
+ school_id?: string;
78
+ };
79
+ associations: ObservedAssociation[];
80
+ }>;
@@ -1,6 +1,7 @@
1
1
  import { type SchoolNameParser } from "@finbheara/domain/school";
2
2
  import type { IndexBuilder } from "./indexes.js";
3
3
  import type { Release } from "./release.js";
4
+ import { type LineageEdge, type ObservedAssociation, type RegistrySchool, type SchoolPrint, type SchoolRedirect } from "./school-bulk.js";
4
5
  import { type LinkQuery, type SchoolLineAnswer, type SchoolLinksAnswer } from "./school-links.js";
5
6
  export type SchoolRung = "id" | "redirect" | "print" | "sn3" | "realWords";
6
7
  export interface SchoolCandidate {
@@ -57,5 +58,37 @@ export declare class SchoolResolver {
57
58
  constructor(rel: Release);
58
59
  links(a: string, b: string, q?: LinkQuery): Promise<SchoolLinksAnswer>;
59
60
  line(a: string, q?: LinkQuery): Promise<SchoolLineAnswer>;
61
+ list(): Promise<{
62
+ tag: string;
63
+ schools: RegistrySchool[];
64
+ }>;
65
+ prints(q?: {
66
+ event?: string;
67
+ year?: number;
68
+ }): Promise<{
69
+ tag: string;
70
+ asked: {
71
+ event?: string;
72
+ year?: number;
73
+ };
74
+ prints: SchoolPrint[];
75
+ }>;
76
+ redirects(): Promise<{
77
+ tag: string;
78
+ redirects: SchoolRedirect[];
79
+ }>;
80
+ lineage(): Promise<{
81
+ tag: string;
82
+ edges: LineageEdge[];
83
+ }>;
84
+ associations(q?: {
85
+ school_id?: string;
86
+ }): Promise<{
87
+ tag: string;
88
+ asked: {
89
+ school_id?: string;
90
+ };
91
+ associations: ObservedAssociation[];
92
+ }>;
60
93
  resolve(asked: string, q?: SchoolQuery): Promise<SchoolAnswer>;
61
94
  }
@@ -0,0 +1,132 @@
1
+ import type { Release } from "./release.js";
2
+ export interface TabRow {
3
+ address: string;
4
+ competition: string;
5
+ card: string;
6
+ line: number;
7
+ event: string | null;
8
+ year: number | null;
9
+ tier: string | null;
10
+ round: string;
11
+ true_round: number;
12
+ seat_index: number;
13
+ section: string;
14
+ panel_size: number;
15
+ column_order: string;
16
+ drop_rule: string;
17
+ judge_name: string | null;
18
+ judge_name_printed: string | null;
19
+ judge_clrg: number | null;
20
+ judge_id: number | null;
21
+ judge_unmatched: string | null;
22
+ mark: number | null;
23
+ mark_printed: string | null;
24
+ place: number | null;
25
+ place_printed: string | null;
26
+ tie: number;
27
+ points: number | null;
28
+ points_printed: string | null;
29
+ }
30
+ export interface TabQuery {
31
+ competition?: string;
32
+ address?: string;
33
+ round?: string;
34
+ }
35
+ export interface TabStreamQuery {
36
+ event?: string | string[];
37
+ year?: number | [number, number];
38
+ tier?: string[];
39
+ competition?: string[];
40
+ }
41
+ export interface TabAnswer {
42
+ tag: string;
43
+ asked: TabQuery;
44
+ rows: TabRow[];
45
+ }
46
+ export interface PanelSeat {
47
+ competition: string;
48
+ panel: string;
49
+ round: string;
50
+ seat_index: number;
51
+ address: string | null;
52
+ judge_name_printed: string | null;
53
+ judge_clrg: number | null;
54
+ judge_id: number | null;
55
+ judge_unmatched: string | null;
56
+ }
57
+ export interface FeisPanelSeat {
58
+ address: string;
59
+ platform: string;
60
+ round: string;
61
+ seat_index: number;
62
+ panel_size: number;
63
+ panel_kind: string;
64
+ judge_name_printed: string;
65
+ judge_state_printed: string | null;
66
+ judge_clrg: number | null;
67
+ judge_id: number | null;
68
+ judge_unmatched: string | null;
69
+ judge_basis: string | null;
70
+ }
71
+ export interface RegisterRow {
72
+ judge_clrg: number;
73
+ year: number;
74
+ cat: string;
75
+ name_printed: string;
76
+ country: string;
77
+ country_printed: string;
78
+ country_code: string | null;
79
+ region: string;
80
+ region_printed: string;
81
+ region_code: string | null;
82
+ geohash: string | null;
83
+ src: string;
84
+ }
85
+ export declare const TAB_NEEDS: readonly string[];
86
+ export declare class TabFinder {
87
+ private readonly rel;
88
+ constructor(rel: Release);
89
+ private db;
90
+ private sheets;
91
+ query(q: TabQuery): Promise<TabAnswer>;
92
+ stream(q?: TabStreamQuery): AsyncGenerator<TabRow>;
93
+ }
94
+ export declare class PanelFinder {
95
+ private readonly rel;
96
+ constructor(rel: Release);
97
+ query(q?: {
98
+ competition?: string;
99
+ }): Promise<{
100
+ tag: string;
101
+ asked: {
102
+ competition?: string;
103
+ };
104
+ seats: PanelSeat[];
105
+ }>;
106
+ }
107
+ export declare class FeisPanelFinder {
108
+ private readonly rel;
109
+ constructor(rel: Release);
110
+ query(q?: {
111
+ address?: string;
112
+ platform?: string;
113
+ }): Promise<{
114
+ tag: string;
115
+ asked: {
116
+ address?: string;
117
+ platform?: string;
118
+ };
119
+ seats: FeisPanelSeat[];
120
+ }>;
121
+ }
122
+ export declare function registerRows(rel: Release, q: {
123
+ year?: number;
124
+ judge_clrg?: number;
125
+ }): Promise<{
126
+ tag: string;
127
+ asked: {
128
+ year?: number;
129
+ judge_clrg?: number;
130
+ };
131
+ rows: RegisterRow[];
132
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finbheara/archive-client",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Open a versioned release of an Irish dance results archive: download, verify, decompress and cache it by tag, keep the cache, and resolve feises and schools against it",
5
5
  "keywords": ["irish-dance", "results", "release", "cache", "sqlite"],
6
6
  "license": "MIT",