@storyteller-platform/epub 0.4.1 → 0.4.2

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
@@ -326,7 +326,7 @@ Defined in:
326
326
  > **\[dispose\]**(): `void`
327
327
 
328
328
  Defined in:
329
- [epub/index.ts:2531](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2531)
329
+ [epub/index.ts:2537](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2537)
330
330
 
331
331
  ##### Returns
332
332
 
@@ -337,7 +337,7 @@ Defined in:
337
337
  > **addCollection**(`collection`, `index?`): `Promise`\<`void`\>
338
338
 
339
339
  Defined in:
340
- [epub/index.ts:1558](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1558)
340
+ [epub/index.ts:1564](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1564)
341
341
 
342
342
  Add a collection to the EPUB metadata.
343
343
 
@@ -360,7 +360,7 @@ collections. Otherwise, it will be added to the end of the list.
360
360
  > **addContributor**(`contributor`, `index?`): `Promise`\<`void`\>
361
361
 
362
362
  Defined in:
363
- [epub/index.ts:1900](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1900)
363
+ [epub/index.ts:1906](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1906)
364
364
 
365
365
  Add a contributor to the EPUB metadata.
366
366
 
@@ -390,7 +390,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
390
390
  > **addCreator**(`creator`, `index?`, `type?`): `Promise`\<`void`\>
391
391
 
392
392
  Defined in:
393
- [epub/index.ts:1745](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1745)
393
+ [epub/index.ts:1751](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1751)
394
394
 
395
395
  Add a creator to the EPUB metadata.
396
396
 
@@ -420,7 +420,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
420
420
  > **addManifestItem**(`item`, `contents`, `encoding`): `Promise`\<`void`\>
421
421
 
422
422
  Defined in:
423
- [epub/index.ts:2227](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2227)
423
+ [epub/index.ts:2233](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2233)
424
424
 
425
425
  Create a new manifest item and write its contents to a new entry.
426
426
 
@@ -449,7 +449,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
449
449
  > **addManifestItem**(`item`, `contents`, `encoding`): `Promise`\<`void`\>
450
450
 
451
451
  Defined in:
452
- [epub/index.ts:2232](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2232)
452
+ [epub/index.ts:2238](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2238)
453
453
 
454
454
  Create a new manifest item and write its contents to a new entry.
455
455
 
@@ -478,7 +478,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
478
478
  > **addManifestItem**(`item`, `contents`): `Promise`\<`void`\>
479
479
 
480
480
  Defined in:
481
- [epub/index.ts:2237](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2237)
481
+ [epub/index.ts:2243](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2243)
482
482
 
483
483
  Create a new manifest item and write its contents to a new entry.
484
484
 
@@ -506,7 +506,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
506
506
  > **addMetadata**(`entry`): `Promise`\<`void`\>
507
507
 
508
508
  Defined in:
509
- [epub/index.ts:2349](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2349)
509
+ [epub/index.ts:2355](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2355)
510
510
 
511
511
  Add a new metadata entry to the Epub.
512
512
 
@@ -533,7 +533,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
533
533
  > **addSpineItem**(`manifestId`, `index?`): `Promise`\<`void`\>
534
534
 
535
535
  Defined in:
536
- [epub/index.ts:1954](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1954)
536
+ [epub/index.ts:1960](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1960)
537
537
 
538
538
  Add an item to the spine of the EPUB.
539
539
 
@@ -563,7 +563,7 @@ https://www.w3.org/TR/epub-33/#sec-spine-elem
563
563
  > **addSubject**(`subject`): `Promise`\<`void`\>
564
564
 
565
565
  Defined in:
566
- [epub/index.ts:1087](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1087)
566
+ [epub/index.ts:1093](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1093)
567
567
 
568
568
  Add a subject to the EPUB metadata.
569
569
 
@@ -588,7 +588,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
588
588
  > [`XmlElement`](#xmlelement)\<`"?xml"`\>)[]\>
589
589
 
590
590
  Defined in:
591
- [epub/index.ts:2055](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2055)
591
+ [epub/index.ts:2061](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2061)
592
592
 
593
593
  Create a new XHTML document with the given body and head.
594
594
 
@@ -610,7 +610,7 @@ Create a new XHTML document with the given body and head.
610
610
  > **discardAndClose**(): `void`
611
611
 
612
612
  Defined in:
613
- [epub/index.ts:2458](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2458)
613
+ [epub/index.ts:2464](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2464)
614
614
 
615
615
  ##### Returns
616
616
 
@@ -621,7 +621,7 @@ Defined in:
621
621
  > **findAllMetadataItems**(`predicate`): `Promise`\<`object`[]\>
622
622
 
623
623
  Defined in:
624
- [epub/index.ts:810](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L810)
624
+ [epub/index.ts:816](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L816)
625
625
 
626
626
  Returns the item in the metadata element's children array that matches the
627
627
  provided predicate.
@@ -661,7 +661,7 @@ provided predicate.
661
661
  > \}\>
662
662
 
663
663
  Defined in:
664
- [epub/index.ts:801](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L801)
664
+ [epub/index.ts:807](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L807)
665
665
 
666
666
  Returns the item in the metadata element's children array that matches the
667
667
  provided predicate.
@@ -700,7 +700,7 @@ provided predicate.
700
700
  > **getCollections**(): `Promise`\<[`Collection`](#collection)[]\>
701
701
 
702
702
  Defined in:
703
- [epub/index.ts:1518](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1518)
703
+ [epub/index.ts:1524](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1524)
704
704
 
705
705
  Retrieve the list of collections.
706
706
 
@@ -713,7 +713,7 @@ Retrieve the list of collections.
713
713
  > **getContributors**(): `Promise`\<[`DcCreator`](#dccreator)[]\>
714
714
 
715
715
  Defined in:
716
- [epub/index.ts:1732](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1732)
716
+ [epub/index.ts:1738](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1738)
717
717
 
718
718
  Retrieve the list of contributors.
719
719
 
@@ -732,7 +732,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccontributor
732
732
  > **getCoverImage**(): `Promise`\<`null` \| `Uint8Array`\<`ArrayBufferLike`\>\>
733
733
 
734
734
  Defined in:
735
- [epub/index.ts:990](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L990)
735
+ [epub/index.ts:996](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L996)
736
736
 
737
737
  Retrieve the cover image data as a byte array.
738
738
 
@@ -753,7 +753,7 @@ https://www.w3.org/TR/epub-33/#sec-cover-image
753
753
  > [`ManifestItem`](#manifestitem)\>
754
754
 
755
755
  Defined in:
756
- [epub/index.ts:971](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L971)
756
+ [epub/index.ts:977](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L977)
757
757
 
758
758
  Retrieve the cover image manifest item.
759
759
 
@@ -773,7 +773,7 @@ https://www.w3.org/TR/epub-33/#sec-cover-image
773
773
  > **getCreators**(`type`): `Promise`\<[`DcCreator`](#dccreator)[]\>
774
774
 
775
775
  Defined in:
776
- [epub/index.ts:1671](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1671)
776
+ [epub/index.ts:1677](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1677)
777
777
 
778
778
  Retrieve the list of creators.
779
779
 
@@ -796,7 +796,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
796
796
  > **getDescription**(): `Promise`\<`null` \| `string`\>
797
797
 
798
798
  Defined in:
799
- [epub/index.ts:1369](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1369)
799
+ [epub/index.ts:1375](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1375)
800
800
 
801
801
  Retrieve the Epub's description as specified in its package document metadata.
802
802
 
@@ -812,7 +812,7 @@ as a string. Descriptions may include HTML markup.
812
812
  > **getIdentifier**(): `Promise`\<`null` \| `string`\>
813
813
 
814
814
  Defined in:
815
- [epub/index.ts:905](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L905)
815
+ [epub/index.ts:911](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L911)
816
816
 
817
817
  Retrieve the identifier from the dc:identifier element in the EPUB metadata.
818
818
 
@@ -831,7 +831,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
831
831
  > **getLanguage**(): `Promise`\<`null` \| `Locale`\>
832
832
 
833
833
  Defined in:
834
- [epub/index.ts:1206](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1206)
834
+ [epub/index.ts:1212](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1212)
835
835
 
836
836
  Retrieve the Epub's language as specified in its package document metadata.
837
837
 
@@ -852,7 +852,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dclanguage
852
852
  > [`ManifestItem`](#manifestitem)\>\>
853
853
 
854
854
  Defined in:
855
- [epub/index.ts:726](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L726)
855
+ [epub/index.ts:732](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L732)
856
856
 
857
857
  Retrieve the manifest for the Epub.
858
858
 
@@ -872,7 +872,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
872
872
  > **getMetadata**(): `Promise`\<[`EpubMetadata`](#epubmetadata)\>
873
873
 
874
874
  Defined in:
875
- [epub/index.ts:877](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L877)
875
+ [epub/index.ts:883](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L883)
876
876
 
877
877
  Retrieve the metadata entries for the Epub.
878
878
 
@@ -896,7 +896,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
896
896
  > `string`\>\>
897
897
 
898
898
  Defined in:
899
- [epub/index.ts:1386](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1386)
899
+ [epub/index.ts:1392](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1392)
900
900
 
901
901
  Return the set of custom vocabulary prefixes set on this publication's root
902
902
  package element.
@@ -916,7 +916,7 @@ https://www.w3.org/TR/epub-33/#sec-prefix-attr
916
916
  > **getPublicationDate**(): `Promise`\<`null` \| `Date`\>
917
917
 
918
918
  Defined in:
919
- [epub/index.ts:1027](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1027)
919
+ [epub/index.ts:1033](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1033)
920
920
 
921
921
  Retrieve the publication date from the dc:date element in the EPUB metadata as a
922
922
  Date object.
@@ -936,7 +936,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcdate
936
936
  > **getSpineItems**(): `Promise`\<[`ManifestItem`](#manifestitem)[]\>
937
937
 
938
938
  Defined in:
939
- [epub/index.ts:1935](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1935)
939
+ [epub/index.ts:1941](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1941)
940
940
 
941
941
  Retrieve the manifest items that make up the Epub's spine.
942
942
 
@@ -956,7 +956,7 @@ https://www.w3.org/TR/epub-33/#sec-spine-elem
956
956
  > **getSubjects**(): `Promise`\<(`string` \| [`DcSubject`](#dcsubject))[]\>
957
957
 
958
958
  Defined in:
959
- [epub/index.ts:1161](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1161)
959
+ [epub/index.ts:1167](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1167)
960
960
 
961
961
  Retrieve the list of subjects for this EPUB.
962
962
 
@@ -977,7 +977,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
977
977
  > **getSubtitle**(): `Promise`\<`null` \| `string`\>
978
978
 
979
979
  Defined in:
980
- [epub/index.ts:1276](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1276)
980
+ [epub/index.ts:1282](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1282)
981
981
 
982
982
  Retrieve the subtitle of the Epub, if it exists.
983
983
 
@@ -994,7 +994,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
994
994
  > **getTitle**(`expanded`): `Promise`\<`null` \| `string`\>
995
995
 
996
996
  Defined in:
997
- [epub/index.ts:1252](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1252)
997
+ [epub/index.ts:1258](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1258)
998
998
 
999
999
  Retrieve the title of the Epub.
1000
1000
 
@@ -1017,7 +1017,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
1017
1017
  > **getTitles**(): `Promise`\<`object`[]\>
1018
1018
 
1019
1019
  Defined in:
1020
- [epub/index.ts:1288](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1288)
1020
+ [epub/index.ts:1294](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1294)
1021
1021
 
1022
1022
  Retrieve all title entries of the Epub.
1023
1023
 
@@ -1034,7 +1034,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
1034
1034
  > **getType**(): `Promise`\<`null` \| [`MetadataEntry`](#metadataentry)\>
1035
1035
 
1036
1036
  Defined in:
1037
- [epub/index.ts:1074](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1074)
1037
+ [epub/index.ts:1080](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1080)
1038
1038
 
1039
1039
  Retrieve the publication type from the dc:type element in the EPUB metadata.
1040
1040
 
@@ -1055,7 +1055,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctype
1055
1055
  > **readItemContents**(`id`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
1056
1056
 
1057
1057
  Defined in:
1058
- [epub/index.ts:2027](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2027)
1058
+ [epub/index.ts:2033](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2033)
1059
1059
 
1060
1060
  Retrieve the contents of a manifest item, given its id.
1061
1061
 
@@ -1078,7 +1078,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
1078
1078
  > **readItemContents**(`id`, `encoding`): `Promise`\<`string`\>
1079
1079
 
1080
1080
  Defined in:
1081
- [epub/index.ts:2028](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2028)
1081
+ [epub/index.ts:2034](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2034)
1082
1082
 
1083
1083
  Retrieve the contents of a manifest item, given its id.
1084
1084
 
@@ -1104,7 +1104,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
1104
1104
  > **readXhtmlItemContents**(`id`, `as?`): `Promise`\<[`ParsedXml`](#parsedxml)\>
1105
1105
 
1106
1106
  Defined in:
1107
- [epub/index.ts:2088](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2088)
1107
+ [epub/index.ts:2094](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2094)
1108
1108
 
1109
1109
  Retrieves the contents of an XHTML item, given its manifest id.
1110
1110
 
@@ -1128,7 +1128,7 @@ https://www.w3.org/TR/epub-33/#sec-xhtml
1128
1128
  > **readXhtmlItemContents**(`id`, `as`): `Promise`\<`string`\>
1129
1129
 
1130
1130
  Defined in:
1131
- [epub/index.ts:2089](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2089)
1131
+ [epub/index.ts:2095](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2095)
1132
1132
 
1133
1133
  Retrieves the contents of an XHTML item, given its manifest id.
1134
1134
 
@@ -1152,7 +1152,7 @@ https://www.w3.org/TR/epub-33/#sec-xhtml
1152
1152
  > **removeCollection**(`index`): `Promise`\<`void`\>
1153
1153
 
1154
1154
  Defined in:
1155
- [epub/index.ts:1627](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1627)
1155
+ [epub/index.ts:1633](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1633)
1156
1156
 
1157
1157
  Remove a collection from the EPUB metadata.
1158
1158
 
@@ -1174,7 +1174,7 @@ returned by `epub.getCollections()`.
1174
1174
  > **removeContributor**(`index`): `Promise`\<`void`\>
1175
1175
 
1176
1176
  Defined in:
1177
- [epub/index.ts:1884](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1884)
1177
+ [epub/index.ts:1890](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1890)
1178
1178
 
1179
1179
  Remove a contributor from the EPUB metadata.
1180
1180
 
@@ -1202,7 +1202,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
1202
1202
  > **removeCreator**(`index`, `type`): `Promise`\<`void`\>
1203
1203
 
1204
1204
  Defined in:
1205
- [epub/index.ts:1832](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1832)
1205
+ [epub/index.ts:1838](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1838)
1206
1206
 
1207
1207
  Remove a creator from the EPUB metadata.
1208
1208
 
@@ -1229,7 +1229,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
1229
1229
  > **removeManifestItem**(`id`): `Promise`\<`void`\>
1230
1230
 
1231
1231
  Defined in:
1232
- [epub/index.ts:2184](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2184)
1232
+ [epub/index.ts:2190](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2190)
1233
1233
 
1234
1234
  ##### Parameters
1235
1235
 
@@ -1246,7 +1246,7 @@ Defined in:
1246
1246
  > **removeMetadata**(`predicate`): `Promise`\<`void`\>
1247
1247
 
1248
1248
  Defined in:
1249
- [epub/index.ts:2433](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2433)
1249
+ [epub/index.ts:2439](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2439)
1250
1250
 
1251
1251
  Remove one or more metadata entries.
1252
1252
 
@@ -1272,7 +1272,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
1272
1272
  > **removeSpineItem**(`index`): `Promise`\<`void`\>
1273
1273
 
1274
1274
  Defined in:
1275
- [epub/index.ts:1990](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1990)
1275
+ [epub/index.ts:1996](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1996)
1276
1276
 
1277
1277
  Remove the spine item at the specified index.
1278
1278
 
@@ -1295,7 +1295,7 @@ https://www.w3.org/TR/epub-33/#sec-spine-elem
1295
1295
  > **removeSubject**(`index`): `Promise`\<`void`\>
1296
1296
 
1297
1297
  Defined in:
1298
- [epub/index.ts:1124](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1124)
1298
+ [epub/index.ts:1130](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1130)
1299
1299
 
1300
1300
  Remove a subject from the EPUB metadata.
1301
1301
 
@@ -1321,7 +1321,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
1321
1321
  > **replaceMetadata**(`predicate`, `entry`): `Promise`\<`void`\>
1322
1322
 
1323
1323
  Defined in:
1324
- [epub/index.ts:2388](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2388)
1324
+ [epub/index.ts:2394](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2394)
1325
1325
 
1326
1326
  Replace a metadata entry with a new one.
1327
1327
 
@@ -1348,7 +1348,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
1348
1348
  > **saveAndClose**(): `Promise`\<`void`\>
1349
1349
 
1350
1350
  Defined in:
1351
- [epub/index.ts:2474](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2474)
1351
+ [epub/index.ts:2480](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2480)
1352
1352
 
1353
1353
  Write the current contents of the Epub to a new EPUB archive on disk.
1354
1354
 
@@ -1364,7 +1364,7 @@ updated to the current UTC timestamp.
1364
1364
  > **setCoverImage**(`href`, `data`): `Promise`\<`void`\>
1365
1365
 
1366
1366
  Defined in:
1367
- [epub/index.ts:1004](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1004)
1367
+ [epub/index.ts:1010](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1010)
1368
1368
 
1369
1369
  Set the cover image for the EPUB.
1370
1370
 
@@ -1387,7 +1387,7 @@ then writes the provided image data to the provided href within the publication.
1387
1387
  > **setDescription**(`description`): `Promise`\<`void`\>
1388
1388
 
1389
1389
  Defined in:
1390
- [epub/index.ts:1353](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1353)
1390
+ [epub/index.ts:1359](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1359)
1391
1391
 
1392
1392
  Update the Epub's description metadata entry.
1393
1393
 
@@ -1410,7 +1410,7 @@ encoded as HTML entities.
1410
1410
  > **setIdentifier**(`identifier`): `Promise`\<`void`\>
1411
1411
 
1412
1412
  Defined in:
1413
- [epub/index.ts:919](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L919)
1413
+ [epub/index.ts:925](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L925)
1414
1414
 
1415
1415
  Set the dc:identifier metadata element with the provided string.
1416
1416
 
@@ -1436,7 +1436,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
1436
1436
  > **setLanguage**(`locale`): `Promise`\<`void`\>
1437
1437
 
1438
1438
  Defined in:
1439
- [epub/index.ts:1235](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1235)
1439
+ [epub/index.ts:1241](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1241)
1440
1440
 
1441
1441
  Update the Epub's language metadata entry.
1442
1442
 
@@ -1462,7 +1462,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dclanguage
1462
1462
  > **setPackageVocabularyPrefix**(`prefix`, `uri`): `Promise`\<`void`\>
1463
1463
 
1464
1464
  Defined in:
1465
- [epub/index.ts:1404](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1404)
1465
+ [epub/index.ts:1410](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1410)
1466
1466
 
1467
1467
  Set a custom vocabulary prefix on the root package element.
1468
1468
 
@@ -1486,7 +1486,7 @@ https://www.w3.org/TR/epub-33/#sec-prefix-attr
1486
1486
  > **setPublicationDate**(`date`): `Promise`\<`void`\>
1487
1487
 
1488
1488
  Defined in:
1489
- [epub/index.ts:1042](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1042)
1489
+ [epub/index.ts:1048](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1048)
1490
1490
 
1491
1491
  Set the dc:date metadata element with the provided date.
1492
1492
 
@@ -1512,7 +1512,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcdate
1512
1512
  > **setTitle**(`title`): `Promise`\<`void`\>
1513
1513
 
1514
1514
  Defined in:
1515
- [epub/index.ts:1428](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1428)
1515
+ [epub/index.ts:1434](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1434)
1516
1516
 
1517
1517
  Set the title of the Epub.
1518
1518
 
@@ -1540,7 +1540,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
1540
1540
  > **setTitles**(`entries`): `Promise`\<`void`\>
1541
1541
 
1542
1542
  Defined in:
1543
- [epub/index.ts:1456](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1456)
1543
+ [epub/index.ts:1462](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1462)
1544
1544
 
1545
1545
  ##### Parameters
1546
1546
 
@@ -1557,7 +1557,7 @@ Defined in:
1557
1557
  > **setType**(`type`): `Promise`\<`void`\>
1558
1558
 
1559
1559
  Defined in:
1560
- [epub/index.ts:1058](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1058)
1560
+ [epub/index.ts:1064](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1064)
1561
1561
 
1562
1562
  Set the dc:type metadata element.
1563
1563
 
@@ -1583,7 +1583,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctype
1583
1583
  > **updateManifestItem**(`id`, `newItem`): `Promise`\<`void`\>
1584
1584
 
1585
1585
  Defined in:
1586
- [epub/index.ts:2300](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2300)
1586
+ [epub/index.ts:2306](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2306)
1587
1587
 
1588
1588
  Update the manifest entry for an existing item.
1589
1589
 
@@ -1612,7 +1612,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
1612
1612
  > **writeItemContents**(`id`, `contents`): `Promise`\<`void`\>
1613
1613
 
1614
1614
  Defined in:
1615
- [epub/index.ts:2136](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2136)
1615
+ [epub/index.ts:2142](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2142)
1616
1616
 
1617
1617
  Write new contents for an existing manifest item, specified by its id.
1618
1618
 
@@ -1639,7 +1639,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
1639
1639
  > **writeItemContents**(`id`, `contents`, `encoding`): `Promise`\<`void`\>
1640
1640
 
1641
1641
  Defined in:
1642
- [epub/index.ts:2137](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2137)
1642
+ [epub/index.ts:2143](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2143)
1643
1643
 
1644
1644
  Write new contents for an existing manifest item, specified by its id.
1645
1645
 
@@ -1667,7 +1667,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
1667
1667
  > **writeXhtmlItemContents**(`id`, `contents`): `Promise`\<`void`\>
1668
1668
 
1669
1669
  Defined in:
1670
- [epub/index.ts:2176](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2176)
1670
+ [epub/index.ts:2182](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2182)
1671
1671
 
1672
1672
  Write new contents for an existing XHTML item, specified by its id.
1673
1673
 
package/dist/index.cjs CHANGED
@@ -376,13 +376,19 @@ ${JSON.stringify(element, null, 2)}`
376
376
  if (entry.fileName.endsWith("/")) {
377
377
  zipfile.readEntry();
378
378
  } else {
379
+ const writePath = (0, import_path.join)(extractPath, entry.fileName);
379
380
  const readStream = await openReadStream(entry);
380
- readStream.on("end", function() {
381
+ await (0, import_promises.mkdir)((0, import_path.dirname)(writePath), { recursive: true });
382
+ await new Promise((resolvePipe) => {
383
+ const writePath2 = (0, import_path.join)(extractPath, entry.fileName);
384
+ const writeStream = (0, import_node_fs.createWriteStream)(writePath2);
385
+ writeStream.on("finish", () => {
386
+ resolvePipe();
387
+ });
388
+ readStream.pipe(writeStream);
389
+ }).finally(() => {
381
390
  zipfile.readEntry();
382
391
  });
383
- const writePath = (0, import_path.join)(extractPath, entry.fileName);
384
- await (0, import_promises.mkdir)((0, import_path.dirname)(writePath), { recursive: true });
385
- readStream.pipe((0, import_node_fs.createWriteStream)(writePath));
386
392
  }
387
393
  });
388
394
  await promise;
package/dist/index.js CHANGED
@@ -343,13 +343,19 @@ ${JSON.stringify(element, null, 2)}`
343
343
  if (entry.fileName.endsWith("/")) {
344
344
  zipfile.readEntry();
345
345
  } else {
346
+ const writePath = join(extractPath, entry.fileName);
346
347
  const readStream = await openReadStream(entry);
347
- readStream.on("end", function() {
348
+ await mkdir(dirname(writePath), { recursive: true });
349
+ await new Promise((resolvePipe) => {
350
+ const writePath2 = join(extractPath, entry.fileName);
351
+ const writeStream = createWriteStream(writePath2);
352
+ writeStream.on("finish", () => {
353
+ resolvePipe();
354
+ });
355
+ readStream.pipe(writeStream);
356
+ }).finally(() => {
348
357
  zipfile.readEntry();
349
358
  });
350
- const writePath = join(extractPath, entry.fileName);
351
- await mkdir(dirname(writePath), { recursive: true });
352
- readStream.pipe(createWriteStream(writePath));
353
359
  }
354
360
  });
355
361
  await promise;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyteller-platform/epub",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",