@finbheara/archive-client 0.38.0 → 0.39.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
+ | `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 |
96
97
  | `majors.tabs` | `majors.tabulated` | 215 |
97
98
  | `teams` | `teams.results`, `teams.rosters`, `teams.resultRosters` | 260 |
98
99
  | `teams.fields` | the fields `teams.results` (`age`, `gender`, `printed_status`) and `teams.rosters` (`dance`, `school_printed_as_of`, a member's `gender`) carry; absent, never refused, without it | 266 |
@@ -622,6 +623,7 @@ await rel.dancers.records(); // every dancer: display, appeara
622
623
  // names_printed (dancers.records.names)
623
624
  await rel.dancers.records({ ids: [1001] });
624
625
  await rel.dancers.years({ ids: [1001], year: 2025 }); // region, region_source, nationals, geohash
626
+ // printed_regions (dancers.years.printed)
625
627
  await rel.feises.dates(); // every feis id with its first and last day
626
628
  await rel.majors.tabulated({ min_true_round: 3 }); // the majors addresses marked to round 3 or later
627
629
  ```
@@ -535,6 +535,12 @@ var FEATURES2 = [
535
535
  since: 245,
536
536
  calls: "dancers.years"
537
537
  },
538
+ {
539
+ feature: "dancers.years.printed",
540
+ needs: ["results:dancer_years.printed_regions"],
541
+ since: 341,
542
+ calls: "the `printed_regions` a dancer-year of dancers.years carries: absent, never refused, on a release without it"
543
+ },
538
544
  {
539
545
  feature: "teams",
540
546
  needs: [
@@ -2221,12 +2227,16 @@ class DancerResolver2 {
2221
2227
  await this.rel.fetch("results");
2222
2228
  await this.rel.require("dancers.years");
2223
2229
  const db = this.rel.db("results");
2224
- const sql = "SELECT dancer_id, year, region, region_source, nationals, nationals_source, geohash FROM dancer_years";
2230
+ const printed = (await this.rel.capability("dancers.years.printed")).state === "full";
2231
+ const sql = `SELECT dancer_id, year, region, region_source, nationals, nationals_source, geohash${printed ? ", printed_regions" : ""} FROM dancer_years`;
2225
2232
  const yearSql = q.year === undefined ? "" : " AND year = ?";
2226
2233
  const yearArgs = q.year === undefined ? [] : [q.year];
2227
2234
  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));
2228
2235
  rows.sort((a, b) => a.dancer_id - b.dancer_id || a.year - b.year);
2229
- return { tag: this.rel.tag, years: rows };
2236
+ return {
2237
+ tag: this.rel.tag,
2238
+ years: rows.map(({ printed_regions: codes, ...y }) => codes === undefined ? y : { ...y, printed_regions: codes === "" ? [] : codes.split(",") })
2239
+ };
2230
2240
  }
2231
2241
  async resolve(q) {
2232
2242
  const db = await this.rel.indexDb("dancers");
package/dist/cli.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  latestCheck2,
22
22
  within,
23
23
  staleWarning2
24
- } from "./chunks/index-z9zxdmw5.js";
24
+ } from "./chunks/index-hdr8qvwf.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-z9zxdmw5.js";
83
+ } from "./chunks/index-hdr8qvwf.js";
84
84
  import {
85
85
  cacheRoot2,
86
86
  repoOf2
@@ -204,6 +204,7 @@ export interface DancerYear {
204
204
  nationals: string | null;
205
205
  nationals_source: string | null;
206
206
  geohash: string | null;
207
+ printed_regions?: string[];
207
208
  }
208
209
  export declare class DancerResolver {
209
210
  private readonly rel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finbheara/archive-client",
3
- "version": "0.38.0",
3
+ "version": "0.39.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",