@prose-reader/archive-reader 1.345.0 → 1.347.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/dist/index.d.ts CHANGED
@@ -13,18 +13,15 @@ export { readingOrderDocumentsAllHaveViewport } from './layout/scanReadingOrderD
13
13
  export type { AppleDisplayOption, AppleMetadata, } from './metadata/apple/parse.ts';
14
14
  export { APPLE_IBOOKS_DISPLAY_OPTIONS_FILENAME, parseAppleDisplayOptionsXml, } from './metadata/apple/parse.ts';
15
15
  export { readArchiveApple } from './metadata/apple/readArchiveApple.ts';
16
- export { appleMetadataHomes } from './metadata/apple/resolve.ts';
17
16
  export { getArchiveHasComicInfo } from './metadata/comicInfo/getArchiveHasComicInfo.ts';
18
17
  export type { ComicInfoManga } from './metadata/comicInfo/manga.ts';
19
18
  export { COMIC_INFO_MANGA_VALUES, isComicInfoManga, } from './metadata/comicInfo/manga.ts';
20
19
  export type { ComicInfo, ComicInfoKnownField, } from './metadata/comicInfo/parse.ts';
21
20
  export { COMIC_INFO_FILENAME, COMIC_INFO_KNOWN_FIELDS, parseComicInfo, } from './metadata/comicInfo/parse.ts';
22
21
  export { readArchiveComicInfo } from './metadata/comicInfo/readArchiveComicInfo.ts';
23
- export { comicInfoMetadataHomes } from './metadata/comicInfo/resolve.ts';
24
22
  export type { KoboMetadata } from './metadata/kobo/parse.ts';
25
23
  export { KOBO_DISPLAY_OPTIONS_FILENAME, parseKoboXml, } from './metadata/kobo/parse.ts';
26
24
  export { readArchiveKobo } from './metadata/kobo/readArchiveKobo.ts';
27
- export { koboMetadataHomes } from './metadata/kobo/resolve.ts';
28
25
  export { getArchiveOpfInfo } from './metadata/opf/getArchiveOpfInfo.ts';
29
26
  export { getSpineItemFilesFromArchive } from './metadata/opf/getSpineItemFilesFromArchive.ts';
30
27
  export { isArchiveEpub } from './metadata/opf/isArchiveEpub.ts';
@@ -32,7 +29,6 @@ export type { OpfContributor, OpfGuideReference, OpfIdentifier, OpfMetadata, Opf
32
29
  export { parseOpf } from './metadata/opf/parse.ts';
33
30
  export type { ArchiveOpfParsed } from './metadata/opf/readArchiveOpf.ts';
34
31
  export { readArchiveOpf } from './metadata/opf/readArchiveOpf.ts';
35
- export { opfMetadataHomes } from './metadata/opf/resolve.ts';
36
32
  export type { ArchiveReadingOrderItem } from './readingOrder/resolveArchiveReadingOrder.ts';
37
33
  export { resolveArchiveReadingOrder } from './readingOrder/resolveArchiveReadingOrder.ts';
38
34
  export type { ResolvedArchiveInput } from './resolve.ts';
@@ -43,7 +39,9 @@ export type { ResolveMetadataSources } from './resolveMetadata.ts';
43
39
  export { resolveMetadata } from './resolveMetadata.ts';
44
40
  export { resolveArchiveToc } from './toc/resolveArchiveToc.ts';
45
41
  export type { ArchiveTocItem } from './toc/types.ts';
46
- export type { KnownMetadataIdentifierScheme, MetadataIdentifier, MetadataIdentifierScheme, ResolvedAppleMetadata, ResolvedCollection, ResolvedComicMetadata, ResolvedConfidence, ResolvedContributor, ResolvedContributorRole, ResolvedCover, ResolvedDate, ResolvedKoboMetadata, ResolvedMetadata, ResolvedMetadataHome, ResolvedMetadataIdentifier, ResolvedProperty, ResolvedPublication, ResolvedPublicationInfo, } from './types/resolvedMetadata.ts';
42
+ export type { Exhaustive } from './types/exhaustive.ts';
43
+ export type { KnownMetadataIdentifierScheme, MetadataIdentifier, MetadataIdentifierScheme, ResolvedAppleMetadata, ResolvedCollection, ResolvedComicInfoMetadata, ResolvedConfidence, ResolvedContributor, ResolvedContributorRole, ResolvedCover, ResolvedDate, ResolvedKoboMetadata, ResolvedMetadata, ResolvedMetadataIdentifier, ResolvedProperty, ResolvedPublication, ResolvedPublicationInfo, ResolvedTitle, ResolvedTitleType, } from './types/resolvedMetadata.ts';
44
+ export { mainTitle } from './utils/mainTitle.ts';
47
45
  export { normalizeGtin } from './utils/normalizeGtin.ts';
48
46
  export { normalizeIsbn } from './utils/normalizeIsbn.ts';
49
47
  export { parseW3cDtfDate } from './utils/parseW3cDtfDate.ts';
@@ -1,6 +1,3 @@
1
1
  import { ResolvedMetadata } from '../../types/resolvedMetadata.ts';
2
2
  import { AppleMetadata } from './parse.ts';
3
- export declare const appleMetadataHomes: {
4
- readonly displayOptions: "apple.options";
5
- };
6
3
  export declare const resolveApple: (input: AppleMetadata) => ResolvedMetadata;
@@ -1,48 +1,3 @@
1
1
  import { ResolvedMetadata } from '../../types/resolvedMetadata.ts';
2
2
  import { ComicInfo } from './parse.ts';
3
- export declare const comicInfoMetadataHomes: {
4
- readonly AgeRating: "comic.ageRating";
5
- readonly AlternateCount: "comic.alternateSeries";
6
- readonly AlternateNumber: "comic.alternateSeries";
7
- readonly AlternateSeries: "comic.alternateSeries";
8
- readonly BlackAndWhite: "comic.blackAndWhite";
9
- readonly Characters: "comic.characters";
10
- readonly Colorist: "contributors";
11
- readonly CommunityRating: "comic.communityRating";
12
- readonly Count: "belongsTo.series";
13
- readonly CoverArtist: "contributors";
14
- readonly Day: "publication.edition.date";
15
- readonly Editor: "contributors";
16
- readonly Format: "comic.format";
17
- readonly Genre: "subjects";
18
- readonly GTIN: "identifiers";
19
- readonly Imprint: "publication.edition.imprint";
20
- readonly Inker: "contributors";
21
- readonly LanguageISO: "languages";
22
- readonly Letterer: "contributors";
23
- readonly Locations: "comic.locations";
24
- readonly MainCharacterOrTeam: "comic.mainCharacterOrTeam";
25
- readonly Manga: "readingDirection";
26
- readonly Month: "publication.edition.date";
27
- readonly Notes: "comic.notes";
28
- readonly Number: "belongsTo.series";
29
- readonly PageCount: "numberOfPages";
30
- readonly Penciller: "contributors";
31
- readonly Publisher: "publication.edition.publisher";
32
- readonly Review: "comic.review";
33
- readonly ScanInformation: "comic.scanInformation";
34
- readonly Series: "belongsTo.series";
35
- readonly SeriesGroup: "belongsTo.collection";
36
- readonly StoryArc: "comic.storyArcs";
37
- readonly StoryArcNumber: "comic.storyArcs";
38
- readonly Summary: "description";
39
- readonly Tags: "subjects";
40
- readonly Teams: "comic.teams";
41
- readonly Title: "title";
42
- readonly Translator: "contributors";
43
- readonly Volume: "comic.volume";
44
- readonly Web: "comic.web";
45
- readonly Writer: "contributors";
46
- readonly Year: "publication.edition.date";
47
- };
48
3
  export declare const resolveComicInfo: (info: ComicInfo) => ResolvedMetadata;
@@ -1,6 +1,3 @@
1
1
  import { ResolvedMetadata } from '../../types/resolvedMetadata.ts';
2
2
  import { KoboMetadata } from './parse.ts';
3
- export declare const koboMetadataHomes: {
4
- readonly renditionLayout: "renditionLayout";
5
- };
6
3
  export declare const resolveKobo: (input: KoboMetadata) => ResolvedMetadata;
@@ -10,6 +10,10 @@ export type OpfIdentifier = {
10
10
  readonly id?: string;
11
11
  readonly unique?: true;
12
12
  };
13
+ export type OpfTitle = {
14
+ readonly value: string;
15
+ readonly id?: string;
16
+ };
13
17
  export type OpfSpineRow = {
14
18
  readonly idref: string;
15
19
  readonly id: string;
@@ -48,7 +52,7 @@ export type OpfMetadata = {
48
52
  readonly spineRows: ReadonlyArray<OpfSpineRow>;
49
53
  readonly spineTocIdref: string | undefined;
50
54
  readonly identifiers: ReadonlyArray<OpfIdentifier>;
51
- readonly title: string | undefined;
55
+ readonly titles: ReadonlyArray<OpfTitle>;
52
56
  readonly creators: ReadonlyArray<string>;
53
57
  readonly contributors: ReadonlyArray<OpfContributor>;
54
58
  readonly publisher: string | undefined;
@@ -1,25 +1,3 @@
1
1
  import { ResolvedMetadata } from '../../types/resolvedMetadata.ts';
2
2
  import { OpfMetadata } from './parse.ts';
3
- export declare const opfMetadataHomes: {
4
- readonly manifestItems: "readingOrder";
5
- readonly spineRows: "readingOrder";
6
- readonly spineTocIdref: "toc";
7
- readonly identifiers: "identifiers";
8
- readonly title: "title";
9
- readonly creators: "contributors";
10
- readonly contributors: "contributors";
11
- readonly publisher: "publication.edition.publisher";
12
- readonly description: "description";
13
- readonly rights: "rights";
14
- readonly languages: "languages";
15
- readonly subjects: "subjects";
16
- readonly date: "publication.edition.date";
17
- readonly coverHref: "cover";
18
- readonly renditionLayoutMeta: "renditionLayout";
19
- readonly renditionFlowMeta: "renditionFlow";
20
- readonly renditionSpreadMeta: "renditionSpread";
21
- readonly pageProgressionDirection: "readingDirection";
22
- readonly guide: "guide";
23
- readonly metas: "properties";
24
- };
25
3
  export declare const resolveOpf: (input: OpfMetadata) => ResolvedMetadata;
@@ -0,0 +1,3 @@
1
+ export type Exhaustive<T> = {
2
+ [K in keyof Required<T>]: T[K];
3
+ };
@@ -7,6 +7,13 @@ export type MetadataIdentifier = {
7
7
  export type ResolvedMetadataIdentifier = MetadataIdentifier & {
8
8
  readonly unique?: true;
9
9
  };
10
+ export type ResolvedTitleType = "main" | "subtitle" | "short" | "collection" | "edition" | "expanded";
11
+ export type ResolvedTitle = {
12
+ readonly value: string;
13
+ readonly type?: ResolvedTitleType | (string & {});
14
+ readonly displaySeq?: number;
15
+ readonly sortAs?: string;
16
+ };
10
17
  export type ResolvedContributorRole = "author" | "translator" | "editor" | "artist" | "illustrator" | "letterer" | "penciler" | "colorist" | "inker" | "narrator" | "contributor" | "coverArtist";
11
18
  export type ResolvedContributor = {
12
19
  readonly name: string;
@@ -14,7 +21,8 @@ export type ResolvedContributor = {
14
21
  readonly sortAs?: string;
15
22
  };
16
23
  export type ResolvedCollection = {
17
- readonly name: string;
24
+ readonly name?: string;
25
+ readonly identifiers?: ReadonlyArray<MetadataIdentifier>;
18
26
  readonly position?: number;
19
27
  readonly total?: number;
20
28
  };
@@ -41,7 +49,7 @@ export type ResolvedProperty = {
41
49
  readonly content?: string;
42
50
  readonly value?: string;
43
51
  };
44
- export type ResolvedComicMetadata = {
52
+ export type ResolvedComicInfoMetadata = {
45
53
  readonly manga?: boolean;
46
54
  readonly blackAndWhite?: boolean;
47
55
  readonly volume?: number;
@@ -76,7 +84,7 @@ export type ResolvedCover = {
76
84
  readonly confidence: ResolvedConfidence;
77
85
  };
78
86
  export type ResolvedMetadata = {
79
- readonly title?: string;
87
+ readonly titles?: ReadonlyArray<ResolvedTitle>;
80
88
  readonly cover?: ResolvedCover;
81
89
  readonly description?: string;
82
90
  readonly publication?: ResolvedPublicationInfo;
@@ -95,8 +103,7 @@ export type ResolvedMetadata = {
95
103
  readonly collection?: ReadonlyArray<ResolvedCollection>;
96
104
  };
97
105
  readonly properties?: ReadonlyArray<ResolvedProperty>;
98
- readonly comic?: ResolvedComicMetadata;
106
+ readonly comicInfo?: ResolvedComicInfoMetadata;
99
107
  readonly apple?: ResolvedAppleMetadata;
100
108
  readonly kobo?: ResolvedKoboMetadata;
101
109
  };
102
- export type ResolvedMetadataHome = Exclude<keyof ResolvedMetadata, "comic" | "apple" | "kobo" | "belongsTo" | "publication"> | `comic.${keyof ResolvedComicMetadata}` | `apple.${keyof ResolvedAppleMetadata}` | `kobo.${keyof ResolvedKoboMetadata}` | `belongsTo.${"series" | "collection"}` | `publication.${keyof ResolvedPublicationInfo}` | `publication.${keyof ResolvedPublicationInfo}.${keyof ResolvedPublication}` | "readingOrder" | "toc" | "guide";
@@ -0,0 +1,2 @@
1
+ import { ResolvedMetadata } from '../types/resolvedMetadata.ts';
2
+ export declare const mainTitle: (metadata: Pick<ResolvedMetadata, "titles"> | undefined) => string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prose-reader/archive-reader",
3
- "version": "1.345.0",
3
+ "version": "1.347.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index/index.cjs",
6
6
  "module": "./dist/index/index.js",
@@ -59,7 +59,7 @@
59
59
  "test:watch": "vitest watch"
60
60
  },
61
61
  "dependencies": {
62
- "@prose-reader/shared": "^1.345.0",
62
+ "@prose-reader/shared": "^1.347.0",
63
63
  "xmldoc": "^2.0.0"
64
64
  },
65
65
  "peerDependencies": {
@@ -100,5 +100,5 @@
100
100
  "node-unrar-js": "^2.0.2",
101
101
  "unzipper": "^0.12.3"
102
102
  },
103
- "gitHead": "f2f6e09d604f1f8e539d01ddd70c6a799c9d82cd"
103
+ "gitHead": "a5e60d258dbed8d4e2a4bed78680c3b9b3455418"
104
104
  }