@finbheara/archive-client 0.45.0 → 0.47.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
@@ -95,6 +95,7 @@ c.features; // [{ feature: "dancers", state: "full" | "missing", missing: [...
95
95
  | `dancers.years` | `dancers.years` | 245 |
96
96
  | `results.stream.competitors_printed`, `majors.stream.competitors_printed` | the `competitors_printed` a streamed row carries (the competed count the page printed); absent, never refused, without it | 345 |
97
97
  | `results.attach_basis`, `majors.attach_basis` | the `attach_basis` a row of `results.query`, `majors.results`, `results.stream` and `results.entries` carries (how its `dancer_id` was answered, or why not); absent, never refused, without it | 345 |
98
+ | `results.major`, `majors.major` | the `major` a row of `results.stream` and `results.entries` carries (1 where its competition is a main event of a T1-T3 event, exactly the rows `majors.sqlite` holds); absent without it, and the stream filter `major` is refused by name without it | 345 |
98
99
  | `dancers.records.birth_consistency`, `dancers.years.birth_consistency` | the `birth_consistency` (0-100, floored: the percent of the dancer's, or the dancer-year's, readable rows that fit the birth window) and its denominator `birth_consistency_rows` a record of `dancers.records` and a dancer-year of `dancers.years` carry; absent, never refused, without it | 345 |
99
100
  | `dancers.records.birth_deadband`, `dancers.years.birth_deadband` | the `birth_deadband_rows` a record of `dancers.records` and a dancer-year of `dancers.years` carry (the readable rows a one-year dance-up alone keeps off the birth window, outside `birth_consistency` and its denominator); absent, never refused, without it | 345 |
100
101
  | `dancers.years.printed` | the `printed_regions` a dancer-year of `dancers.years` carries (every region the year printed, where `region` picks one); absent, never refused, without it | 341 |
@@ -643,7 +644,7 @@ THE COMPETITION FIELDS, where the release carries them (`rel.capability("results
643
644
  | `dance` | the competition's one dance as the release reads it (`reel`), null where it reads none |
644
645
  | `recalled_only` | true where the page printed the recalled dancers only |
645
646
  | `comp_flags` | what the page printed about itself, int-packed, one bit a flag (bit 10: recalled only). The release's `DATA-DICTIONARY.md` carries the register of every bit, and a published bit never moves |
646
- | `competitors_basis` | what `competitors` stands on: `printed` (the page printed a competed count), `counted` (the page printed the whole field, its cards counted), `entered` or `registered` (only the top was printed: the page's entered or registered count), `estimated` (a majors sheet with no count that does not show its whole field: the recall rule over a recall-only sheet (twice the recalled, plus or minus 1, or the recalled where fewer than 10), else the dancers it printed, a FLOOR; never a count, so leave it out where a real count is needed), null where there is no number |
647
+ | `competitors_basis` | what `competitors` stands on: `printed` (the page printed a competed count), `counted` (the page printed the whole field, its cards counted), `net-entered` (FeisWeb: the entered count less the withdrawn one, who danced), `awards` (FeisWeb: the fewest dancers its `Awards To Top N Finishers ( p% )` line is a share of, who danced), `entered` or `registered` (only the top was printed: the page's entered or registered count, a REGISTRATION figure holding the no-shows), `estimated` (a majors sheet with no count that does not show its whole field: the recall rule over a recall-only sheet (twice the recalled, plus or minus 1, or the recalled where fewer than 10), else the dancers it printed, a FLOOR; never a count, so leave it out where a real count is needed), null where there is no number |
647
648
 
648
649
  A release without them streams every row with the six fields ABSENT, never null.
649
650
 
@@ -651,6 +652,8 @@ A release without them streams every row with the six fields ABSENT, never null.
651
652
 
652
653
  `attach_basis` (feature `results.attach_basis`, `majors.attach_basis` for scope `majors` and `rel.majors.results`) says how a row's `dancer_id` was answered, or why it was not, in one integer: `attach_basis & 63` is the feis attach's outcome for the row's address (`0` on a majors row, `1` a platform row it carded no card for, else attached how or the gate that refused it), `attach_basis & ~63` the bits of where the id came from (none where `dancer_id` is null). `unpackAttachBasis(n)` decodes it, `{ outcome: "birth-window", via: ["feis-local"] }`, off the register `ATTACH_OUTCOMES` and `ATTACH_VIA` the package exports, and the release's `DATA-DICTIONARY.md` says what each value means. `rel.results.query` and `rel.majors.results` rows carry it too. A release without it returns the field ABSENT.
653
654
 
655
+ `major` (feature `results.major`, `majors.major` for scope `majors`) is 1 where the row's competition is a MAJOR'S MAIN EVENT: a solo championship (open or adult) or an either/or traditional set at a T1-T3 event, the competition a dancer came to the major for. A grade, a preliminary competition (a prelim-only one, or a prelim re-ranking of the open's field), a special, a traditional set co-entered with the championship, a mini championship beside its age group's full one and every feis row are 0. `majors.sqlite` holds exactly the 1s, so a reader of the full `results` set filters `rel.results.stream({ scope: "all", major: true })` to read what the majors stream reads. `tier` stays the event's. A release without the column returns the field absent and refuses the `major` filter by name (`needsRelease`).
656
+
654
657
  THE COMPETITION'S KEY is `competition` (`<event-year>.<comp>` at a major, `<platform>:<host>.<comp>`
655
658
  at a feis), which holds across releases. Inside one release `(file, competition_line)` is exact: a
656
659
  competition captured twice (two files of one platform) carries one `competition` in both and two
@@ -558,6 +558,18 @@ var FEATURES2 = [
558
558
  since: 345,
559
559
  calls: "the `attach_basis` a row of results.query, results.stream and results.entries carries (how its dancer_id was answered, or why not): absent, never refused, on a release without it"
560
560
  },
561
+ {
562
+ feature: "results.major",
563
+ needs: ["results:results.major", "results:competitions.major"],
564
+ since: 345,
565
+ calls: "the `major` a row of results.stream and results.entries carries (1 where its competition is a main event of a T1-T3 event, the rows majors.sqlite holds): absent on a release without it; the stream filter `major` is refused on a release without it"
566
+ },
567
+ {
568
+ feature: "majors.major",
569
+ needs: ["majors:results.major", "majors:competitions.major"],
570
+ since: 345,
571
+ calls: "the same on a row of results.stream and results.entries (scope majors)"
572
+ },
561
573
  {
562
574
  feature: "majors.attach_basis",
563
575
  needs: ["majors:results.attach_basis"],
@@ -1501,8 +1513,10 @@ function streamSql(q, shape = {}) {
1501
1513
  }
1502
1514
  if (q.primary === true)
1503
1515
  where.push("(r.primary_source IS NULL OR r.primary_source = '')");
1516
+ if (q.major !== undefined)
1517
+ where.push(q.major ? "r.major = 1" : "r.major = 0");
1504
1518
  return {
1505
- sql: `SELECT ${COLUMNS}${shape.competition === true ? COMPETITION_COLUMNS : ""}${shape.competitorsPrinted === true ? ", c.competitors_printed AS competitors_printed" : ""}${shape.attachBasis === true ? ", r.attach_basis AS attach_basis" : ""} FROM results r JOIN competitions c ON c.file = r.file AND c.line = r.competition_line${where.length === 0 ? "" : ` WHERE ${where.join(" AND ")}`} ORDER BY r.file, r.line`,
1519
+ sql: `SELECT ${COLUMNS}${shape.competition === true ? COMPETITION_COLUMNS : ""}${shape.competitorsPrinted === true ? ", c.competitors_printed AS competitors_printed" : ""}${shape.attachBasis === true ? ", r.attach_basis AS attach_basis" : ""}${shape.major === true ? ", r.major AS major" : ""} FROM results r JOIN competitions c ON c.file = r.file AND c.line = r.competition_line${where.length === 0 ? "" : ` WHERE ${where.join(" AND ")}`} ORDER BY r.file, r.line`,
1506
1520
  args
1507
1521
  };
1508
1522
  }
@@ -1647,7 +1661,13 @@ class ResultFinder2 {
1647
1661
  const competition = (await this.rel.capability(`${db}.stream.competition`)).state === "full";
1648
1662
  const competitorsPrinted = (await this.rel.capability(`${db}.stream.competitors_printed`)).state === "full";
1649
1663
  const attachBasis = (await this.rel.capability(`${db}.attach_basis`)).state === "full";
1650
- return { db: this.rel.db(db), shape: { competition, competitorsPrinted, attachBasis } };
1664
+ if (q.major !== undefined)
1665
+ await this.rel.require(`${db}.major`);
1666
+ const major = (await this.rel.capability(`${db}.major`)).state === "full";
1667
+ return {
1668
+ db: this.rel.db(db),
1669
+ shape: { competition, competitorsPrinted, attachBasis, major }
1670
+ };
1651
1671
  }
1652
1672
  async* stream(q) {
1653
1673
  const { db, shape } = await this.streamDb(q);
package/dist/cli.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  staleWarning2,
24
24
  progressMode2,
25
25
  progressRenderer2
26
- } from "./chunks/index-kfc7hz90.js";
26
+ } from "./chunks/index-f9hvd661.js";
27
27
  import"./chunks/index-hghdy980.js";
28
28
 
29
29
  var USAGE_HEADER = "usage: idq <verb> [--cache <dir>] [--repo <owner/name>] [--json] [--live] [--progress tty|plain|none]";
package/dist/index.js CHANGED
@@ -85,7 +85,7 @@ import {
85
85
  PROGRESS_MODES2,
86
86
  progressMode2,
87
87
  progressRenderer2
88
- } from "./chunks/index-kfc7hz90.js";
88
+ } from "./chunks/index-f9hvd661.js";
89
89
  import {
90
90
  cacheRoot2,
91
91
  repoOf2
@@ -10,6 +10,7 @@ export interface StreamQuery {
10
10
  dancer_id?: number[];
11
11
  school_id?: string;
12
12
  primary?: boolean;
13
+ major?: boolean;
13
14
  }
14
15
  export interface StreamCompetition {
15
16
  competition_line: number;
@@ -58,6 +59,7 @@ export interface StreamRow extends Partial<StreamCompetition> {
58
59
  dancer_id: number | null;
59
60
  dancer_scope: "per-release" | "stable" | null;
60
61
  attach_basis?: number;
62
+ major?: 0 | 1;
61
63
  yob: number | null;
62
64
  yob_printed: string | null;
63
65
  points_printed: string | null;
@@ -74,6 +76,7 @@ export interface StreamShape {
74
76
  competition?: boolean;
75
77
  competitorsPrinted?: boolean;
76
78
  attachBasis?: boolean;
79
+ major?: boolean;
77
80
  }
78
81
  export declare const scopeDb: (s: StreamScope) => "majors" | "results";
79
82
  export declare function streamSql(q: StreamQuery, shape?: StreamShape): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finbheara/archive-client",
3
- "version": "0.45.0",
3
+ "version": "0.47.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,7 +44,7 @@
44
44
  "prepublishOnly": "bun scripts/build.ts && bun ../../tools/checks/archive-client-tarball.ts"
45
45
  },
46
46
  "dependencies": {
47
- "@finbheara/domain": "0.58.0",
47
+ "@finbheara/domain": "0.59.0",
48
48
  "@finbheara/names": "0.30.0",
49
49
  "hyparquet": "1.31.2"
50
50
  },