@prose-reader/metadata-fetcher 1.347.0 → 1.349.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.
@@ -8,6 +8,12 @@ export declare const normalizeForComparison: (value: string) => string;
8
8
  * `Spider Man` stay exact.
9
9
  */
10
10
  export declare const textSimilarity: (a: string, b: string) => number;
11
+ /**
12
+ * Every volume, part or book number a title states explicitly, whichever
13
+ * division word introduced it — a catalog states the same fact as a series
14
+ * `position`, where the division word is implicit.
15
+ */
16
+ export declare const titleDivisionNumbers: (value: string) => ReadonlySet<number>;
11
17
  /**
12
18
  * {@link textSimilarity}, with `Dune` matched against `Dune: a novel`.
13
19
  *
@@ -18,5 +24,18 @@ export declare const textSimilarity: (a: string, b: string) => number;
18
24
  * sides state different ones, the title score is `0` however similar the rest.
19
25
  */
20
26
  export declare const titleSimilarity: (a: string, b: string) => number;
27
+ /**
28
+ * The best {@link titleSimilarity} over the forms one candidate title takes —
29
+ * bare, or composed with its subtitle.
30
+ *
31
+ * A contradiction in **any** form still scores `0`: `Irina` agreeing with
32
+ * `Irina: … Vol. 2` is not evidence that the candidate's own `Vol. 1` does.
33
+ * Taking the plain maximum would let the shorter form launder a stated
34
+ * disagreement about which volume this is.
35
+ */
36
+ export declare const bestTitleSimilarity: (query: string, forms: ReadonlyArray<string>) => {
37
+ readonly score: number;
38
+ readonly candidate: string;
39
+ } | undefined;
21
40
  /** {@link textSimilarity} on sorted tokens: `Herbert, Frank` ≡ `Frank Herbert`. */
22
41
  export declare const personNameSimilarity: (a: string, b: string) => number;
@@ -10,8 +10,18 @@ export type GoogleBooksImageLinks = {
10
10
  readonly large?: string;
11
11
  readonly extraLarge?: string;
12
12
  };
13
+ export type GoogleBooksVolumeSeries = {
14
+ readonly seriesId?: string;
15
+ readonly orderNumber?: number;
16
+ };
17
+ /**
18
+ * Only the volume's place in its series is retained. `bookDisplayNumber` and
19
+ * `shortSeriesBookTitle` are display strings by Google's own definition — the
20
+ * sequence is `orderNumber` — and the payload never states the series name,
21
+ * only an id, so a name would have to be invented.
22
+ */
13
23
  export type GoogleBooksSeriesInfo = {
14
- readonly bookDisplayNumber?: string;
24
+ readonly volumeSeries?: ReadonlyArray<GoogleBooksVolumeSeries>;
15
25
  };
16
26
  /**
17
27
  * The subset of a Google Books `volumeInfo` record that has a normalized home.
@@ -11,9 +11,10 @@ export declare const OPEN_LIBRARY_IDENTIFIER_SCHEME = "OpenLibrary";
11
11
  * Normalizes one search hit into the cross-format vocabulary. Two choices
12
12
  * worth stating:
13
13
  *
14
- * - **`title` folds in `subtitle`** (`Dune: Messiah`): the vocabulary has one
15
- * title field, and an OPF `dc:title` normally carries the subtitle too, so
16
- * comparing a bare title against a full one would cost match score.
14
+ * - **`title` and `subtitle` stay separate**, as the catalog states them:
15
+ * `title` is the work's title and the subtitle is a `titles` entry. The
16
+ * matcher composes them when it compares, so nothing is lost by not
17
+ * pre-joining them here.
17
18
  * - **An ISBN identifier is added only for an ISBN lookup**, using the queried
18
19
  * value — the API answered "this work has that ISBN", a fact about the
19
20
  * record. A title-search hit describes a *work*, whose editions each have
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prose-reader/metadata-fetcher",
3
- "version": "1.347.0",
3
+ "version": "1.349.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -29,9 +29,9 @@
29
29
  "test:watch": "vitest watch"
30
30
  },
31
31
  "dependencies": {
32
- "@prose-reader/archive-reader": "^1.347.0",
33
- "@prose-reader/shared": "^1.347.0",
32
+ "@prose-reader/archive-reader": "^1.349.0",
33
+ "@prose-reader/shared": "^1.349.0",
34
34
  "xmldoc": "^2.0.0"
35
35
  },
36
- "gitHead": "a5e60d258dbed8d4e2a4bed78680c3b9b3455418"
36
+ "gitHead": "0383cfd805d43fa941c54639b170b54ab9d4ac43"
37
37
  }