@finbheara/archive-client 0.30.0 → 0.32.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/cli.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  latestCheck2,
22
22
  within,
23
23
  staleWarning2
24
- } from "./chunks/index-db578n4y.js";
24
+ } from "./chunks/index-dy6yvpgk.js";
25
25
  import"./chunks/index-hghdy980.js";
26
26
 
27
27
  var USAGE_HEADER = "usage: idq <verb> [--cache <dir>] [--repo <owner/name>] [--json] [--live]";
@@ -171,7 +171,8 @@ var VERBS = [
171
171
  usage: [
172
172
  " series [--release <spec>] <name|host code|feis id>",
173
173
  " the series a name, a host code (fweb:ABC) or any feis id",
174
- " names: its years, hosts, codes and next instance"
174
+ " names: its years, hosts, codes and next instance. A",
175
+ " majors roster code (SNO) is its majors event, never a name"
175
176
  ]
176
177
  },
177
178
  {
package/dist/index.js CHANGED
@@ -6,6 +6,14 @@ import {
6
6
  unzstdTo2,
7
7
  NAME_LEVELS2,
8
8
  nameLevel2,
9
+ TabFinder2,
10
+ PanelFinder2,
11
+ FeisPanelFinder2,
12
+ columnsOf2,
13
+ FEATURES2,
14
+ capabilityOf2,
15
+ needsRelease2,
16
+ rosterOf2,
9
17
  NO_CALENDAR2,
10
18
  NO_UPCOMING2,
11
19
  FeisFinder2,
@@ -25,9 +33,6 @@ import {
25
33
  syllabusSourceOf2,
26
34
  canonicalOf2,
27
35
  CompResolver2,
28
- TabFinder2,
29
- PanelFinder2,
30
- FeisPanelFinder2,
31
36
  StaffFinder2,
32
37
  TeamFinder2,
33
38
  EventFinder2,
@@ -46,10 +51,6 @@ import {
46
51
  httpsRemote2,
47
52
  fallbackRemote2,
48
53
  setRemote2,
49
- columnsOf2,
50
- FEATURES2,
51
- capabilityOf2,
52
- needsRelease2,
53
54
  FIELD_STATES2,
54
55
  DEPARTURE_REASONS2,
55
56
  UpcomingFinder2,
@@ -75,7 +76,7 @@ import {
75
76
  readLatestCheck2,
76
77
  latestCheck2,
77
78
  staleWarning2
78
- } from "./chunks/index-db578n4y.js";
79
+ } from "./chunks/index-dy6yvpgk.js";
79
80
  import {
80
81
  cacheRoot2,
81
82
  repoOf2
@@ -167,6 +168,7 @@ export {
167
168
  renderArchiveTag2 as renderArchiveTag,
168
169
  repoOf2 as repoOf,
169
170
  resolveTag2 as resolveTag,
171
+ rosterOf2 as rosterOf,
170
172
  setRemote2 as setRemote,
171
173
  sha256File2 as sha256File,
172
174
  staleWarning2 as staleWarning,
@@ -19,6 +19,11 @@ export interface ReleaseManifest {
19
19
  bytes?: number;
20
20
  sha256?: string;
21
21
  }>;
22
+ roster?: {
23
+ code: string;
24
+ tier: string;
25
+ name: string;
26
+ }[];
22
27
  [k: string]: unknown;
23
28
  }
24
29
  export declare const DATABASES: readonly ["results", "majors"];
@@ -2,6 +2,7 @@ import { type AgeRelation } from "@finbheara/domain/age";
2
2
  import { type Population, type PopulationRelation } from "@finbheara/domain/title";
3
3
  import type { IndexBuilder } from "./indexes.js";
4
4
  import type { Release } from "./release.js";
5
+ import { type RosterEvent } from "./roster.js";
5
6
  export type CompDance = "reel" | "light-jig" | "single-jig" | "slip-jig" | "treble-jig" | "hornpipe" | "treble-reel" | "traditional-set" | "set-dance";
6
7
  export type CompKind = "championship" | "grade" | "unrated";
7
8
  export type CompSource = "syllabus" | "prior-year" | "title";
@@ -39,8 +40,10 @@ export interface FeisPlace {
39
40
  brand_id: string | null;
40
41
  year: number | null;
41
42
  held: boolean;
42
- via: "id" | "series" | "code-stem" | "name" | null;
43
+ via: "id" | "series" | "code-stem" | "name" | "majors" | null;
43
44
  series?: string[];
45
+ major?: RosterEvent;
46
+ why?: string;
44
47
  }
45
48
  export interface TitleCheck {
46
49
  title: string;
@@ -129,6 +132,7 @@ export declare class CompResolver {
129
132
  private readonly rel;
130
133
  constructor(rel: Release);
131
134
  place(feis: string, year?: number): Promise<FeisPlace>;
135
+ private ofMajor;
132
136
  private ofSeries;
133
137
  private compYears;
134
138
  private years;
@@ -193,6 +193,7 @@ export interface DancerBulkRecord {
193
193
  birth_source: string;
194
194
  birth_conflict: boolean;
195
195
  genders: string[];
196
+ names_printed?: string[];
196
197
  }
197
198
  export interface DancerYear {
198
199
  dancer_id: number;
@@ -1,5 +1,6 @@
1
1
  import type { IndexBuilder } from "./indexes.js";
2
2
  import type { Release } from "./release.js";
3
+ import { type RosterEvent } from "./roster.js";
3
4
  import type { UpcomingHost } from "./upcoming.js";
4
5
  export interface Feis {
5
6
  feis_id: string;
@@ -65,7 +66,8 @@ export interface SeriesAnswer {
65
66
  tag: string;
66
67
  asked: string;
67
68
  arm: "unique" | "ambiguous" | "none";
68
- via: "id" | "code-stem" | "name" | null;
69
+ via: "id" | "code-stem" | "name" | "majors" | null;
70
+ major?: RosterEvent;
69
71
  series_id: string | null;
70
72
  name: string | null;
71
73
  host: string | null;
@@ -6,6 +6,7 @@ export { ADVANCEMENT_DANCES, type DancerGrades, type DancerLevelAnswer, type Dan
6
6
  export { type Comp, type CompAnswer, type CompDance, type CompKind, type CompQuery, CompResolver, type CompSource, type FeisPlace, type SyllabusAnswer, type SyllabusForAnswer, type SyllabusSource, type TitleCheck, canonicalOf, syllabusSourceOf, } from "./comps.js";
7
7
  export { type ClientOptions, cacheRoot, repoOf } from "./config.js";
8
8
  export { type Feis, type FeisAnswer, FeisFinder, type FeisQuery, NO_CALENDAR, NO_UPCOMING, type Series, type SeriesAnswer, type SeriesInstance, type SeriesNext, } from "./feises.js";
9
+ export { type Roster, type RosterEvent, rosterOf } from "./roster.js";
9
10
  export { type IndexBuilder, type IndexFile, buildIndex, defaultBuilders, ensureIndex, indexKey, indexPath, isCurrent, listIndexes, } from "./indexes.js";
10
11
  export { type CutVersion, LOCAL_DIR, type LocalBuild, type PickedBuild, buildTag, incomplete, localRoot, newerThan, openBuild, pickBuild, releaseVersion, sweepBuilds, } from "./local.js";
11
12
  export { type CachedRelease, DEFAULT_KEEP, type ReleaseList, ReleaseManager, type RemovalPlan, type UseResult, releases, } from "./manager.js";
@@ -21,7 +22,7 @@ export { type SchoolAnswer, type SchoolCandidate, type SchoolQuery, SchoolResolv
21
22
  export { LINEAGE_FILE, type SchoolLineAnswer, type SchoolLinksAnswer, linksOfLineage, releaseSchoolGraph, } from "./school-links.js";
22
23
  export type { LineCandidate, LinkPath, LinkPolicy, LinkQuery, LinkStep, PathFlags, SchoolLink, StepFlags, StepPolicy, } from "@finbheara/domain/school-graph";
23
24
  export { type Capability, FEATURES, type Feature, type SchemaProbe, capabilityOf, columnsOf, needsRelease, } from "./schema.js";
24
- export { type EntryRow, type StreamQuery, type StreamRow, type StreamScope, entryRank, } from "./stream.js";
25
+ export { type EntryRow, type StreamCompetition, type StreamQuery, type StreamRow, type StreamScope, entryRank, } from "./stream.js";
25
26
  export { type FeisPanelSeat, FeisPanelFinder, PanelFinder, type PanelSeat, type RegisterRow, type TabAnswer, TabFinder, type TabQuery, type TabRow, type TabStreamQuery, } from "./tabs.js";
26
27
  export { EventFinder, type EventYear, type EventYearQuery, type ResultRoster, type RosterMember, type RosterTeam, TeamFinder, type TeamResult, } from "./teams.js";
27
28
  export { type EntrantCandidate, FIELD_STATES, type FieldComp, DEPARTURE_REASONS, type DepartureReason, type FieldState, type HeldOut, type UpcomingDeparture, type UpcomingDepartureAnswer, type UpcomingDepartureQuery, type UpcomingEntrant, type UpcomingEntrantAnswer, type UpcomingEntrantQuery, type UpcomingFeis, type UpcomingFeisAnswer, type UpcomingFeisQuery, type UpcomingFeisState, type UpcomingField, type UpcomingFieldAnswer, type UpcomingFieldQuery, UpcomingFinder, type UpcomingHost, } from "./upcoming.js";
@@ -0,0 +1,16 @@
1
+ import type { Release } from "./release.js";
2
+ export interface RosterEvent {
3
+ code: string;
4
+ tier: string | null;
5
+ name: string | null;
6
+ }
7
+ export interface Roster {
8
+ source: "manifest" | "rows";
9
+ events: RosterEvent[];
10
+ event(code: string): RosterEvent | undefined;
11
+ }
12
+ export declare const majorsSeriesId: (code: string) => string;
13
+ export declare const eventYearOf: (brand: string, instance: string | null) => number | null;
14
+ export declare function manifestRoster(manifest: Record<string, unknown>): Roster | null;
15
+ export declare function rosterOf(rel: Release): Promise<Roster>;
16
+ export declare const describeEvent: (e: RosterEvent) => string;
@@ -11,7 +11,15 @@ export interface StreamQuery {
11
11
  school_id?: string;
12
12
  primary?: boolean;
13
13
  }
14
- export interface StreamRow {
14
+ export interface StreamCompetition {
15
+ competition_line: number;
16
+ dance_printed: string | null;
17
+ dance: string | null;
18
+ recalled_only: boolean;
19
+ comp_flags: number;
20
+ competitors_basis: string | null;
21
+ }
22
+ export interface StreamRow extends Partial<StreamCompetition> {
15
23
  address: string;
16
24
  competition: string;
17
25
  event: string;
@@ -60,8 +68,11 @@ export interface EntryRow extends StreamRow {
60
68
  recall_place: number | null;
61
69
  }
62
70
  export declare function entryRank(section: string): number;
71
+ export interface StreamShape {
72
+ competition?: boolean;
73
+ }
63
74
  export declare const scopeDb: (s: StreamScope) => "majors" | "results";
64
- export declare function streamSql(q: StreamQuery): {
75
+ export declare function streamSql(q: StreamQuery, shape?: StreamShape): {
65
76
  sql: string;
66
77
  args: (string | number)[];
67
78
  };
@@ -69,5 +80,5 @@ export declare function feisDates(db: Database): Map<string, {
69
80
  lo: string | null;
70
81
  hi: string | null;
71
82
  }>;
72
- export declare function streamRows(db: Database, q: StreamQuery): AsyncGenerator<StreamRow>;
73
- export declare function entryRows(db: Database, q: StreamQuery): AsyncGenerator<EntryRow>;
83
+ export declare function streamRows(db: Database, q: StreamQuery, shape?: StreamShape): AsyncGenerator<StreamRow>;
84
+ export declare function entryRows(db: Database, q: StreamQuery, shape?: StreamShape): AsyncGenerator<EntryRow>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finbheara/archive-client",
3
- "version": "0.30.0",
3
+ "version": "0.32.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",