@finbheara/archive-client 0.42.0 → 0.43.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
+ | `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 |
98
99
  | `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 |
99
100
  | `majors.tabs` | `majors.tabulated` | 215 |
100
101
  | `teams` | `teams.results`, `teams.rosters`, `teams.resultRosters` | 260 |
@@ -668,10 +669,14 @@ the place the address's recall row carries.
668
669
  ```ts
669
670
  await rel.dancers.records(); // every dancer: display, appearances, birth_lo, birth_hi,
670
671
  // birth_source, birth_conflict, genders, scope,
671
- // names_printed (dancers.records.names)
672
+ // names_printed (dancers.records.names),
673
+ // birth_consistency, birth_consistency_rows
674
+ // (dancers.records.birth_consistency)
672
675
  await rel.dancers.records({ ids: [1001] });
673
676
  await rel.dancers.years({ ids: [1001], year: 2025 }); // region, region_source, nationals, geohash
674
- // printed_regions (dancers.years.printed)
677
+ // printed_regions (dancers.years.printed),
678
+ // birth_consistency, birth_consistency_rows
679
+ // (dancers.years.birth_consistency)
675
680
  await rel.feises.dates(); // every feis id with its first and last day
676
681
  await rel.majors.tabulated({ min_true_round: 3 }); // the majors addresses marked to round 3 or later
677
682
  ```
@@ -608,6 +608,21 @@ var FEATURES2 = [
608
608
  since: 245,
609
609
  calls: "dancers.years"
610
610
  },
611
+ {
612
+ feature: "dancers.records.birth_consistency",
613
+ needs: ["results:dancers.birth_consistency", "results:dancers.birth_consistency_rows"],
614
+ since: 345,
615
+ calls: "the `birth_consistency` and `birth_consistency_rows` a record of dancers.records carries (the percent of its readable rows that fit its birth window, and how many were readable): absent, never refused, on a release without them"
616
+ },
617
+ {
618
+ feature: "dancers.years.birth_consistency",
619
+ needs: [
620
+ "results:dancer_years.birth_consistency",
621
+ "results:dancer_years.birth_consistency_rows"
622
+ ],
623
+ since: 345,
624
+ calls: "the `birth_consistency` and `birth_consistency_rows` a dancer-year of dancers.years carries: absent, never refused, on a release without them"
625
+ },
611
626
  {
612
627
  feature: "dancers.years.printed",
613
628
  needs: ["results:dancer_years.printed_regions"],
@@ -2286,7 +2301,8 @@ class DancerResolver2 {
2286
2301
  await this.rel.require("dancers.records");
2287
2302
  const db = this.rel.db("results");
2288
2303
  const names = (await this.rel.capability("dancers.records.names")).state === "full";
2289
- const sql = `SELECT dancer_id, display, appearances, birth_lo, birth_hi, birth_source, birth_conflict, genders${names ? ", names_printed" : ""} FROM dancers`;
2304
+ const fit = (await this.rel.capability("dancers.records.birth_consistency")).state === "full";
2305
+ const sql = `SELECT dancer_id, display, appearances, birth_lo, birth_hi, birth_source, birth_conflict, genders${names ? ", names_printed" : ""}${fit ? ", birth_consistency, birth_consistency_rows" : ""} FROM dancers`;
2290
2306
  const rows = q.ids === undefined ? db.query(`${sql} ORDER BY dancer_id`).all() : idChunks(q.ids).flatMap((c) => db.query(`${sql} WHERE dancer_id IN (${c.map(() => "?").join(",")})`).all(...c));
2291
2307
  rows.sort((a, b) => a.dancer_id - b.dancer_id);
2292
2308
  return {
@@ -2305,7 +2321,8 @@ class DancerResolver2 {
2305
2321
  await this.rel.require("dancers.years");
2306
2322
  const db = this.rel.db("results");
2307
2323
  const printed = (await this.rel.capability("dancers.years.printed")).state === "full";
2308
- const sql = `SELECT dancer_id, year, region, region_source, nationals, nationals_source, geohash${printed ? ", printed_regions" : ""} FROM dancer_years`;
2324
+ const fit = (await this.rel.capability("dancers.years.birth_consistency")).state === "full";
2325
+ const sql = `SELECT dancer_id, year, region, region_source, nationals, nationals_source, geohash${printed ? ", printed_regions" : ""}${fit ? ", birth_consistency, birth_consistency_rows" : ""} FROM dancer_years`;
2309
2326
  const yearSql = q.year === undefined ? "" : " AND year = ?";
2310
2327
  const yearArgs = q.year === undefined ? [] : [q.year];
2311
2328
  const rows = q.ids === undefined ? db.query(`${sql} WHERE 1${yearSql} ORDER BY dancer_id, year`).all(...yearArgs) : idChunks(q.ids).flatMap((c) => db.query(`${sql} WHERE dancer_id IN (${c.map(() => "?").join(",")})${yearSql}`).all(...c, ...yearArgs));
package/dist/cli.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  staleWarning2,
24
24
  progressMode2,
25
25
  progressRenderer2
26
- } from "./chunks/index-0xdcttqf.js";
26
+ } from "./chunks/index-1nam25zf.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-0xdcttqf.js";
88
+ } from "./chunks/index-1nam25zf.js";
89
89
  import {
90
90
  cacheRoot2,
91
91
  repoOf2
@@ -193,6 +193,8 @@ export interface DancerBulkRecord {
193
193
  birth_hi: number | null;
194
194
  birth_source: string;
195
195
  birth_conflict: boolean;
196
+ birth_consistency?: number | null;
197
+ birth_consistency_rows?: number;
196
198
  genders: string[];
197
199
  names_printed?: string[];
198
200
  }
@@ -205,6 +207,8 @@ export interface DancerYear {
205
207
  nationals_source: string | null;
206
208
  geohash: string | null;
207
209
  printed_regions?: string[];
210
+ birth_consistency?: number | null;
211
+ birth_consistency_rows?: number;
208
212
  }
209
213
  export declare class DancerResolver {
210
214
  private readonly rel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finbheara/archive-client",
3
- "version": "0.42.0",
3
+ "version": "0.43.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",