@finbheara/archive-client 0.52.0 → 0.53.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
@@ -90,6 +90,7 @@ c.features; // [{ feature: "dancers", state: "full" | "missing", missing: [...
90
90
  | `results.stream`, `majors.stream` | `results.stream`, `results.entries` | 255 |
91
91
  | `results.stream.competition`, `majors.stream.competition` | the competition fields a streamed row carries (`competition_line`, `dance_printed`, `dance`, `recalled_only`, `comp_flags`, `competitors_basis`); absent, never refused, without them | 270 |
92
92
  | `feises.dates` | `feises.dates` | 245 |
93
+ | `feises.name` | the `name` `feises.find` and `feises.series` answer: the release's reading, the label as printed except where it lost a letter (U+FFFD) the feis's own pages print clean; `name_printed` beside it is the label verbatim. Without it `name` is the label, never refused | 350 |
93
94
  | `dancers.records` | `dancers.records` | 215 |
94
95
  | `dancers.records.names` | the `names_printed` a record of `dancers.records` carries; absent, never refused, without it | 215 |
95
96
  | `dancers.years` | `dancers.years` | 245 |
@@ -98,6 +99,7 @@ c.features; // [{ feature: "dancers", state: "full" | "missing", missing: [...
98
99
  | `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 |
99
100
  | `results.relative_place_err`, `majors.relative_place_err` | the `relative_place_err` a row of `results.stream` and `results.entries` carries (how far below `relative_place` the true value may sit, 0 over an exact field); absent, never refused, without it | 350 |
100
101
  | `results.marks_printed`, `majors.marks_printed` | the `marks_printed` a row of `results.stream` and `results.entries` carries (the marks total a row served or printed, iFeis's beside its `points` and a Bucharest transcript row's, one string verbatim); absent, never refused, without it | 350 |
102
+ | `results.status_printed`, `majors.status_printed` | the `status_printed` a row of `results.stream` and `results.entries` carries (a transcribed row's status cell as printed, verbatim, in printed order, `[]` where none); absent, never refused, without it | 350 |
101
103
  | `results.round_points_printed`, `majors.round_points_printed` | the `round_points_printed` a row of `results.stream` and `results.entries` carries (the per-round points a platform served, FeisFWD's, in its slot order, a slot served nothing in null); absent, never refused, without it | 350 |
102
104
  | `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 |
103
105
  | `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 |
@@ -258,8 +260,8 @@ await rel.feises.find({ id: "<feis, series instance or brand id>" }); // a reti
258
260
  await rel.feises.find({ name: "*Spring*", year: 2024 });
259
261
  ```
260
262
 
261
- One answer per feis id: dates, location, series ids, regions, and how many competitions, rows
262
- and captures it has.
263
+ One answer per feis id: its `name` and the label as printed (`name_printed`), dates, location,
264
+ series ids, regions, and how many competitions, rows and captures it has. A name glob reads both.
263
265
 
264
266
  ```ts
265
267
  const s = await rel.feises.series("Ardvarna Spring"); // a name, a host code ("fweb:ABC", "fweb:ABC26"), any feis id
@@ -653,6 +655,12 @@ or summed, and the places follow the points, not the marks. A Bucharest transcri
653
655
  carries its printed mark the same way, one adjudicator's mark and no `points` (`"80"`). Null where
654
656
  the row carries none and on every other source's row.
655
657
 
658
+ THE STATUS CELL AS PRINTED, where the release carries it
659
+ (`rel.capability("results.status_printed")`): `status_printed`, a transcribed row's status cell
660
+ verbatim, in printed order (`["Not Recalled"]`, `["-"]`, `["*"]`, `["WQ"]`). `atts` is the
661
+ reading of the same cell, so a cell it reads as nothing (`-`, `Not Recalled`) is told apart from
662
+ a blank cell here. `[]` where the row prints none, and on every platform row.
663
+
656
664
  THE COMPETITION FIELDS, where the release carries them (`rel.capability("results.stream.competition")`,
657
665
  `"majors.stream.competition"` for scope `majors`), are on every row, null meaning no value:
658
666
 
@@ -606,6 +606,18 @@ var FEATURES2 = [
606
606
  since: 350,
607
607
  calls: "the same on a row of results.stream and results.entries (scope majors)"
608
608
  },
609
+ {
610
+ feature: "results.status_printed",
611
+ needs: ["results:results.status_printed"],
612
+ since: 350,
613
+ calls: "the `status_printed` a row of results.stream and results.entries carries (a transcribed row's status cell as printed, verbatim, in printed order, `[]` where none): absent, never refused, on a release without it"
614
+ },
615
+ {
616
+ feature: "majors.status_printed",
617
+ needs: ["majors:results.status_printed"],
618
+ since: 350,
619
+ calls: "the same on a row of results.stream and results.entries (scope majors)"
620
+ },
609
621
  {
610
622
  feature: "majors.attach_basis",
611
623
  needs: ["majors:results.attach_basis"],
@@ -624,6 +636,12 @@ var FEATURES2 = [
624
636
  since: 245,
625
637
  calls: "feises.dates"
626
638
  },
639
+ {
640
+ feature: "feises.name",
641
+ needs: ["results:feises.name", "results:feises.name_source"],
642
+ since: 350,
643
+ calls: "the `name` feises.find and feises.series answer (the release's reading: the label as printed, except where it lost a letter the feis's own pages print); on a release without it, `name` is the label as printed, never refused"
644
+ },
627
645
  {
628
646
  feature: "dancers.records",
629
647
  needs: [
@@ -1159,7 +1177,7 @@ var describeEvent = (e) => {
1159
1177
  var SCHEMA = `
1160
1178
  CREATE TABLE feis(
1161
1179
  feis_id TEXT PRIMARY KEY, source TEXT NOT NULL, token TEXT NOT NULL, host_id TEXT NOT NULL,
1162
- name TEXT NOT NULL, date_lo TEXT, date_hi TEXT, date_printed TEXT, year INTEGER,
1180
+ name TEXT NOT NULL, name_printed TEXT NOT NULL, date_lo TEXT, date_hi TEXT, date_printed TEXT, year INTEGER,
1163
1181
  location TEXT, instance_id TEXT, brand_id TEXT, regions TEXT NOT NULL,
1164
1182
  competitions INTEGER NOT NULL, rows INTEGER NOT NULL, captures INTEGER NOT NULL
1165
1183
  );
@@ -1179,7 +1197,7 @@ function readJsonl(path) {
1179
1197
  }
1180
1198
  var feisesIndex = {
1181
1199
  name: "feises",
1182
- version: "2",
1200
+ version: "3",
1183
1201
  inputs: ["results", "feis-redirects.jsonl"],
1184
1202
  says: "every feis by id, platform, code, series and name, with its counts and regions",
1185
1203
  build(rel, out) {
@@ -1194,15 +1212,16 @@ var feisesIndex = {
1194
1212
  const rows = new Map;
1195
1213
  for (const r of src.query("SELECT c.event AS event, sum(r.n) AS n FROM (SELECT competition, count(*) AS n FROM results GROUP BY competition) r JOIN (SELECT DISTINCT competition, event FROM competitions) c ON c.competition = r.competition GROUP BY c.event").all())
1196
1214
  rows.set(r.event, r.n);
1197
- const put = out.prepare("INSERT OR IGNORE INTO feis VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
1215
+ const put = out.prepare("INSERT OR IGNORE INTO feis VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
1198
1216
  const captures = new Map;
1199
- const feisRows = src.query("SELECT feis_id, source, host_id, name_printed, date_lo, date_hi, date_printed, year, location_printed, feis_instance_id, feis_brand_id FROM feises ORDER BY file, line").all();
1217
+ const named = columnsOf2(src, "feises").has("name");
1218
+ const feisRows = src.query(`SELECT feis_id, source, host_id, name_printed, ${named ? "name" : "name_printed AS name"}, date_lo, date_hi, date_printed, year, location_printed, feis_instance_id, feis_brand_id FROM feises ORDER BY file, line`).all();
1200
1219
  for (const f of feisRows)
1201
1220
  captures.set(f.feis_id, (captures.get(f.feis_id) ?? 0) + 1);
1202
1221
  for (const f of feisRows) {
1203
1222
  const c = counts.get(f.feis_id);
1204
1223
  const colon = f.feis_id.indexOf(":");
1205
- put.run(f.feis_id, f.source, colon === -1 ? f.source : f.feis_id.slice(0, colon), f.host_id, f.name_printed, f.date_lo, f.date_hi, f.date_printed, f.year, f.location_printed, f.feis_instance_id, f.feis_brand_id, JSON.stringify([...c?.regions ?? []].sort()), c?.comps ?? 0, rows.get(f.feis_id) ?? 0, captures.get(f.feis_id) ?? 0);
1224
+ put.run(f.feis_id, f.source, colon === -1 ? f.source : f.feis_id.slice(0, colon), f.host_id, f.name, f.name_printed, f.date_lo, f.date_hi, f.date_printed, f.year, f.location_printed, f.feis_instance_id, f.feis_brand_id, JSON.stringify([...c?.regions ?? []].sort()), c?.comps ?? 0, rows.get(f.feis_id) ?? 0, captures.get(f.feis_id) ?? 0);
1206
1225
  }
1207
1226
  const red = out.prepare("INSERT OR REPLACE INTO redirect VALUES (?, ?, ?)");
1208
1227
  for (const r of readJsonl(rel.path("feis-redirects.jsonl")))
@@ -1255,8 +1274,8 @@ class FeisFinder2 {
1255
1274
  args.push(id, id, id);
1256
1275
  }
1257
1276
  if (q.name !== undefined) {
1258
- where.push("name LIKE ? ESCAPE '\\'");
1259
- args.push(globToLike(q.name));
1277
+ where.push("(name LIKE ? ESCAPE '\\' OR name_printed LIKE ? ESCAPE '\\')");
1278
+ args.push(globToLike(q.name), globToLike(q.name));
1260
1279
  }
1261
1280
  if (q.year !== undefined) {
1262
1281
  where.push("year = ?");
@@ -1564,7 +1583,7 @@ function streamSql(q, shape = {}) {
1564
1583
  if (q.major !== undefined)
1565
1584
  where.push(q.major ? "r.major = 1" : "r.major = 0");
1566
1585
  return {
1567
- 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" : ""}${shape.relativePlaceErr === true ? ", r.relative_place_err AS relative_place_err" : ""}${shape.roundPoints === true ? ", r.round_points_printed AS round_points_printed" : ""}${shape.marks === true ? ", r.marks_printed AS marks_printed" : ""} 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`,
1586
+ 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" : ""}${shape.relativePlaceErr === true ? ", r.relative_place_err AS relative_place_err" : ""}${shape.roundPoints === true ? ", r.round_points_printed AS round_points_printed" : ""}${shape.marks === true ? ", r.marks_printed AS marks_printed" : ""}${shape.status === true ? ", r.status_printed AS status_printed" : ""} 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`,
1568
1587
  args
1569
1588
  };
1570
1589
  }
@@ -1576,7 +1595,7 @@ function feisDates(db) {
1576
1595
  }
1577
1596
  var text = (v) => v === null || v === "" ? null : v;
1578
1597
  function rowOf(r, dates) {
1579
- const { atts, withdrawn, recalled_only, round_points_printed, ...rest } = r;
1598
+ const { atts, withdrawn, recalled_only, round_points_printed, status_printed, ...rest } = r;
1580
1599
  const d = dates.get(r.event);
1581
1600
  return {
1582
1601
  ...rest,
@@ -1593,6 +1612,7 @@ function rowOf(r, dates) {
1593
1612
  ...round_points_printed === undefined ? {} : {
1594
1613
  round_points_printed: round_points_printed === null ? null : JSON.parse(round_points_printed)
1595
1614
  },
1615
+ ...status_printed === undefined ? {} : { status_printed: JSON.parse(status_printed) },
1596
1616
  withdrawn: text(withdrawn),
1597
1617
  qualifier: text(rest.qualifier),
1598
1618
  primary_source: text(rest.primary_source),
@@ -1718,6 +1738,7 @@ class ResultFinder2 {
1718
1738
  const relativePlaceErr = (await this.rel.capability(`${db}.relative_place_err`)).state === "full";
1719
1739
  const roundPoints = (await this.rel.capability(`${db}.round_points_printed`)).state === "full";
1720
1740
  const marks = (await this.rel.capability(`${db}.marks_printed`)).state === "full";
1741
+ const status = (await this.rel.capability(`${db}.status_printed`)).state === "full";
1721
1742
  return {
1722
1743
  db: this.rel.db(db),
1723
1744
  shape: {
@@ -1727,7 +1748,8 @@ class ResultFinder2 {
1727
1748
  major,
1728
1749
  relativePlaceErr,
1729
1750
  roundPoints,
1730
- marks
1751
+ marks,
1752
+ status
1731
1753
  }
1732
1754
  };
1733
1755
  }
package/dist/cli.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  staleWarning2,
24
24
  progressMode2,
25
25
  progressRenderer2
26
- } from "./chunks/index-csh5d5m4.js";
26
+ } from "./chunks/index-6np7hsst.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-csh5d5m4.js";
88
+ } from "./chunks/index-6np7hsst.js";
89
89
  import {
90
90
  cacheRoot2,
91
91
  repoOf2
@@ -8,6 +8,7 @@ export interface Feis {
8
8
  token: string;
9
9
  host_id: string;
10
10
  name: string;
11
+ name_printed: string;
11
12
  date_lo: string | null;
12
13
  date_hi: string | null;
13
14
  date_printed: string | null;
@@ -66,6 +66,7 @@ export interface StreamRow extends Partial<StreamCompetition> {
66
66
  points_printed: string | null;
67
67
  round_points_printed?: (string | null)[] | null;
68
68
  marks_printed?: string | null;
69
+ status_printed?: string[];
69
70
  platform_dancer_id: string | null;
70
71
  primary_source: string | null;
71
72
  file: string;
@@ -83,6 +84,7 @@ export interface StreamShape {
83
84
  relativePlaceErr?: boolean;
84
85
  roundPoints?: boolean;
85
86
  marks?: boolean;
87
+ status?: boolean;
86
88
  }
87
89
  export declare const scopeDb: (s: StreamScope) => "majors" | "results";
88
90
  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.52.0",
3
+ "version": "0.53.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",