@finbheara/archive-client 0.39.0 → 0.40.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
@@ -93,6 +93,7 @@ c.features; // [{ feature: "dancers", state: "full" | "missing", missing: [...
93
93
  | `dancers.records` | `dancers.records` | 215 |
94
94
  | `dancers.records.names` | the `names_printed` a record of `dancers.records` carries; absent, never refused, without it | 215 |
95
95
  | `dancers.years` | `dancers.years` | 245 |
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 |
96
97
  | `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 |
97
98
  | `majors.tabs` | `majors.tabulated` | 215 |
98
99
  | `teams` | `teams.results`, `teams.rosters`, `teams.resultRosters` | 260 |
@@ -597,10 +598,12 @@ THE COMPETITION FIELDS, where the release carries them (`rel.capability("results
597
598
  | `dance` | the competition's one dance as the release reads it (`reel`), null where it reads none |
598
599
  | `recalled_only` | true where the page printed the recalled dancers only |
599
600
  | `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 |
600
- | `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), null where there is no number |
601
+ | `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 |
601
602
 
602
603
  A release without them streams every row with the six fields ABSENT, never null.
603
604
 
605
+ `competitors_printed` (feature `results.stream.competitors_printed`, `majors.stream.competitors_printed` for scope `majors`) is the competed count the page itself printed, null where it printed none. `competitors` stays the best value. A release without it streams the field ABSENT.
606
+
604
607
  THE COMPETITION'S KEY is `competition` (`<event-year>.<comp>` at a major, `<platform>:<host>.<comp>`
605
608
  at a feis), which holds across releases. Inside one release `(file, competition_line)` is exact: a
606
609
  competition captured twice (two files of one platform) carries one `competition` in both and two
@@ -491,6 +491,18 @@ var FEATURES2 = [
491
491
  since: 270,
492
492
  calls: "the same competition fields on a row of results.stream and results.entries (scope majors): absent, never refused, on a release without them"
493
493
  },
494
+ {
495
+ feature: "results.stream.competitors_printed",
496
+ needs: ["results:competitions.competitors_printed"],
497
+ since: 345,
498
+ calls: "the `competitors_printed` a row of results.stream and results.entries carries (the competed count the page printed): absent, never refused, on a release without it"
499
+ },
500
+ {
501
+ feature: "majors.stream.competitors_printed",
502
+ needs: ["majors:competitions.competitors_printed"],
503
+ since: 345,
504
+ calls: "the same on a row of results.stream and results.entries (scope majors)"
505
+ },
494
506
  {
495
507
  feature: "majors.tabs",
496
508
  needs: ["majors:tabs.address", "majors:tabs.true_round"],
@@ -1402,7 +1414,7 @@ function streamSql(q, shape = {}) {
1402
1414
  if (q.primary === true)
1403
1415
  where.push("(r.primary_source IS NULL OR r.primary_source = '')");
1404
1416
  return {
1405
- sql: `SELECT ${COLUMNS}${shape.competition === true ? COMPETITION_COLUMNS : ""} 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`,
1417
+ sql: `SELECT ${COLUMNS}${shape.competition === true ? COMPETITION_COLUMNS : ""}${shape.competitorsPrinted === true ? ", c.competitors_printed AS competitors_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`,
1406
1418
  args
1407
1419
  };
1408
1420
  }
@@ -1544,7 +1556,8 @@ class ResultFinder2 {
1544
1556
  await this.rel.fetch(db);
1545
1557
  await this.rel.require(db === "majors" ? "majors.stream" : "results.stream");
1546
1558
  const competition = (await this.rel.capability(`${db}.stream.competition`)).state === "full";
1547
- return { db: this.rel.db(db), shape: { competition } };
1559
+ const competitorsPrinted = (await this.rel.capability(`${db}.stream.competitors_printed`)).state === "full";
1560
+ return { db: this.rel.db(db), shape: { competition, competitorsPrinted } };
1548
1561
  }
1549
1562
  async* stream(q) {
1550
1563
  const { db, shape } = await this.streamDb(q);
package/dist/cli.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  latestCheck2,
22
22
  within,
23
23
  staleWarning2
24
- } from "./chunks/index-hdr8qvwf.js";
24
+ } from "./chunks/index-bs939h4v.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]";
package/dist/index.js CHANGED
@@ -80,7 +80,7 @@ import {
80
80
  readLatestCheck2,
81
81
  latestCheck2,
82
82
  staleWarning2
83
- } from "./chunks/index-hdr8qvwf.js";
83
+ } from "./chunks/index-bs939h4v.js";
84
84
  import {
85
85
  cacheRoot2,
86
86
  repoOf2
@@ -18,6 +18,7 @@ export interface StreamCompetition {
18
18
  recalled_only: boolean;
19
19
  comp_flags: number;
20
20
  competitors_basis: string | null;
21
+ competitors_printed?: number | null;
21
22
  }
22
23
  export interface StreamRow extends Partial<StreamCompetition> {
23
24
  address: string;
@@ -70,6 +71,7 @@ export interface EntryRow extends StreamRow {
70
71
  export declare function entryRank(section: string): number;
71
72
  export interface StreamShape {
72
73
  competition?: boolean;
74
+ competitorsPrinted?: boolean;
73
75
  }
74
76
  export declare const scopeDb: (s: StreamScope) => "majors" | "results";
75
77
  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.39.0",
3
+ "version": "0.40.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",