@finbheara/archive-client 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,7 +20,7 @@ type declarations (`.d.ts`), so a TypeScript project needs Bun's types (`"types"
20
20
  `bunx idq <verb>`.
21
21
 
22
22
  The version is 0.x while the API settles: a minor bump may break, so pin a minor
23
- (`"@finbheara/archive-client": "0.6.x"`).
23
+ (`"@finbheara/archive-client": "0.7.x"`).
24
24
 
25
25
  ## Configuration
26
26
 
@@ -85,6 +85,7 @@ c.features; // [{ feature: "dancers", state: "full" | "missing", missing: [...
85
85
  | `staff` | `staff.teacher`, `staff.adjudicator` | 260 |
86
86
  | `majors.order` | `majors.competitions` | 260 |
87
87
  | `feises`, `comps` | `feises.find`, `feises.series`, `comps.*`, `registrations.resolve` | 265 |
88
+ | `comps.dance` | the `dance` a comp of `comps.*` carries: null, never refused, without it | 270 |
88
89
  | `results.stream`, `majors.stream` | `results.stream`, `results.entries` | 255 |
89
90
  | `feises.dates` | `feises.dates` | 245 |
90
91
  | `dancers.records` | `dancers.records` | 215 |
@@ -388,6 +389,8 @@ c.level; // "OC" (FF, BG, AB, NV, PW, PC, OC), c.feis_level 700
388
389
  c.age; // "U10", c.population "mixed", c.canonical "710OC", c.title, c.competition
389
390
  c.age_source; // "printed" | "title" | "code" | "merged" | null, c.age_printed "U10" as printed
390
391
  c.second; // true for a second chance or a supplementary comp beside the main one
392
+ c.dance; // "reel", "light-jig", "single-jig", "slip-jig", "treble-jig", "hornpipe",
393
+ // "treble-reel", "traditional-set", "set-dance", or null where the release names none
391
394
  c.from; // { feis_ids: ["fweb:ABC25"], year: 2025 } where an earlier year answered
392
395
  c.check; // "unchecked", or what the caller's `title` says about the earlier comp
393
396
  c.syllabus_source; // "results": what the syllabus the answer read is read from
@@ -430,6 +433,10 @@ QuickFeis numbers its own and-over championships (`15 & over` prelim `616PC`, `1
430
433
  `719OC`). An and-over code is then the same string as an `Under N + 1` one, and `age` (`O18`)
431
434
  tells them apart. An adult band, a range and a grade render none.
432
435
 
436
+ `dance` is the release's own `competitions.dance`, read there off the platform's dance field, its
437
+ level field and the title, in that order: one dance or none, never a word read here. A release
438
+ older than the column answers null for every comp, and `rel.capability("comps.dance")` says which.
439
+
433
440
  `age` is the release's reading, and `age_source` says where it was read. A `merged` comp (a
434
441
  platform's comps merged into one, `710OCM` with no `710OC` beside it) prints one member's band,
435
442
  so its `age` is the union of its members' (`U12` for `710OCM - U10 Open Champion` where the next
@@ -871,7 +871,7 @@ CREATE TABLE comp(
871
871
  code TEXT NOT NULL, code_fold TEXT NOT NULL, title TEXT, age TEXT, gender TEXT,
872
872
  feis_level INTEGER, round TEXT, platform TEXT NOT NULL, captures INTEGER NOT NULL,
873
873
  file TEXT NOT NULL, line INTEGER NOT NULL, age_source TEXT, age_printed TEXT,
874
- gender_source TEXT, level_printed TEXT, dance_printed TEXT
874
+ gender_source TEXT, level_printed TEXT, dance_printed TEXT, dance TEXT
875
875
  );
876
876
  `;
877
877
  var INDEXES = [
@@ -883,12 +883,13 @@ var OPTIONAL = [
883
883
  "age_printed",
884
884
  "gender_source",
885
885
  "level_printed",
886
- "dance_printed"
886
+ "dance_printed",
887
+ "dance"
887
888
  ];
888
889
  var fold = (code) => code.trim().toLowerCase();
889
890
  var compsIndex = {
890
891
  name: "comps",
891
- version: "2",
892
+ version: "3",
892
893
  inputs: ["results"],
893
894
  says: "every competition by its feis and its own code, with its series and year",
894
895
  build(rel, out) {
@@ -901,12 +902,12 @@ var compsIndex = {
901
902
  const captures = new Map;
902
903
  for (const r of src.query("SELECT competition, count(*) AS n FROM competitions GROUP BY competition").all())
903
904
  captures.set(r.competition, r.n);
904
- const put = out.prepare("INSERT OR IGNORE INTO comp VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
905
+ const put = out.prepare("INSERT OR IGNORE INTO comp VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
905
906
  const has = new Set(src.query("PRAGMA table_info(competitions)").all().map((r) => r.name));
906
907
  const opt = (col) => has.has(col) ? col : `NULL AS ${col}`;
907
908
  for (const c of src.query(`SELECT competition, event, year, comp_no, title, age, gender, feis_level, round, source, file, line, ${OPTIONAL.map(opt).join(", ")} FROM competitions WHERE comp_no IS NOT NULL AND trim(comp_no) != '' ORDER BY file, line`).iterate()) {
908
909
  const f = brand.get(c.event);
909
- put.run(c.competition, c.event, f?.brand ?? null, c.year ?? f?.year ?? null, c.comp_no.trim(), fold(c.comp_no), c.title, c.age, c.gender, c.feis_level, c.round, c.source, captures.get(c.competition) ?? 1, c.file, c.line, c.age_source, c.age_printed, c.gender_source, c.level_printed, c.dance_printed);
910
+ put.run(c.competition, c.event, f?.brand ?? null, c.year ?? f?.year ?? null, c.comp_no.trim(), fold(c.comp_no), c.title, c.age, c.gender, c.feis_level, c.round, c.source, captures.get(c.competition) ?? 1, c.file, c.line, c.age_source, c.age_printed, c.gender_source, c.level_printed, c.dance_printed, c.dance);
910
911
  }
911
912
  for (const s of INDEXES)
912
913
  out.run(s);
@@ -933,6 +934,7 @@ function compOf(r, codes = []) {
933
934
  age_printed: r.age_printed ?? null,
934
935
  population: pop === "" ? null : pop,
935
936
  second,
937
+ dance: r.dance ?? null,
936
938
  round,
937
939
  canonical: canonicalOf2(lv, r.age),
938
940
  platform: r.platform,
@@ -2509,6 +2511,12 @@ var FEATURES2 = [
2509
2511
  since: 265,
2510
2512
  calls: "comps.resolve, comps.syllabus, comps.syllabusFor, registrations.resolve (the comps index)"
2511
2513
  },
2514
+ {
2515
+ feature: "comps.dance",
2516
+ needs: ["results:competitions.dance"],
2517
+ since: 270,
2518
+ calls: "the `dance` a comp of comps.resolve, comps.syllabus and comps.syllabusFor carries: null, never refused, on a release without it"
2519
+ },
2512
2520
  {
2513
2521
  feature: "results.stream",
2514
2522
  needs: [
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  nameOrderOf,
5
5
  openRelease2,
6
6
  releases2
7
- } from "./chunks/index-gy5xye67.js";
7
+ } from "./chunks/index-4ph8n4ga.js";
8
8
  import"./chunks/index-hne1wadw.js";
9
9
  import"./chunks/index-hghdy980.js";
10
10
 
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  openCached2,
46
46
  ReleaseManager2,
47
47
  releases2
48
- } from "./chunks/index-gy5xye67.js";
48
+ } from "./chunks/index-4ph8n4ga.js";
49
49
  import {
50
50
  cacheRoot2,
51
51
  repoOf2
@@ -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
+ export type CompDance = "reel" | "light-jig" | "single-jig" | "slip-jig" | "treble-jig" | "hornpipe" | "treble-reel" | "traditional-set" | "set-dance";
5
6
  export type CompKind = "championship" | "grade" | "unrated";
6
7
  export type CompSource = "syllabus" | "prior-year" | "title";
7
8
  export type SyllabusSource = "syllabus-document" | "results";
@@ -19,6 +20,7 @@ export interface Comp {
19
20
  age_printed: string | null;
20
21
  population: Population | null;
21
22
  second: boolean;
23
+ dance: CompDance | null;
22
24
  round: string | null;
23
25
  canonical: string | null;
24
26
  platform: string;
@@ -115,6 +117,7 @@ interface CompRow {
115
117
  gender_source?: string | null;
116
118
  level_printed?: string | null;
117
119
  dance_printed?: string | null;
120
+ dance?: string | null;
118
121
  }
119
122
  export declare function compOf(r: CompRow, codes?: readonly string[]): Comp;
120
123
  export declare function canonicalOf(level: number | null, age: string | null): string | null;
@@ -2,7 +2,7 @@ export { type AssetPlan, DATABASES, type DatabaseName, type LandedFile, type Rec
2
2
  export { sha256File, unzstdTo } from "./bytes.js";
3
3
  export { type AgeAsked, type AgeEvidence, type DancerAnswer, type DancerBulkRecord, type DancerCandidate, type DancerQuery, type DancerRecord, DancerResolver, type DancerSchool, type DancerSearchQuery, type DancerYear, type ExcludedCandidate, FEIS_LOCAL_ID_FLOOR, type PopulationEvidence, type SchoolEvidence, readPopulation, } from "./dancers.js";
4
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";
5
+ 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, } from "./comps.js";
6
6
  export { type ClientOptions, cacheRoot, repoOf } from "./config.js";
7
7
  export { type Feis, type FeisAnswer, FeisFinder, type FeisQuery, NO_CALENDAR, type Series, type SeriesAnswer, type SeriesInstance, type SeriesNext, } from "./feises.js";
8
8
  export { type IndexBuilder, type IndexFile, buildIndex, defaultBuilders, ensureIndex, indexKey, indexPath, isCurrent, listIndexes, } from "./indexes.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finbheara/archive-client",
3
- "version": "0.6.0",
3
+ "version": "0.7.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",
@@ -44,8 +44,8 @@
44
44
  "prepublishOnly": "bun scripts/build.ts && bun ../../tools/checks/archive-client-tarball.ts"
45
45
  },
46
46
  "dependencies": {
47
- "@finbheara/domain": "0.49.0",
48
- "@finbheara/names": "0.22.0",
47
+ "@finbheara/domain": "0.50.0",
48
+ "@finbheara/names": "0.23.0",
49
49
  "hyparquet": "1.31.2"
50
50
  },
51
51
  "devDependencies": {