open-agreements 0.3.0 → 0.4.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.
Files changed (429) hide show
  1. package/content/templates/closing-checklist/template.docx +0 -0
  2. package/dist/core/checklist/docx-import.d.ts +50 -0
  3. package/dist/core/checklist/docx-import.d.ts.map +1 -0
  4. package/dist/core/checklist/docx-import.js +613 -0
  5. package/dist/core/checklist/docx-import.js.map +1 -0
  6. package/dist/core/checklist/docx-table-helpers.d.ts +33 -0
  7. package/dist/core/checklist/docx-table-helpers.d.ts.map +1 -0
  8. package/dist/core/checklist/docx-table-helpers.js +154 -0
  9. package/dist/core/checklist/docx-table-helpers.js.map +1 -0
  10. package/dist/core/checklist/format-checklist-docx.d.ts.map +1 -1
  11. package/dist/core/checklist/format-checklist-docx.js +37 -88
  12. package/dist/core/checklist/format-checklist-docx.js.map +1 -1
  13. package/dist/core/checklist/index.d.ts +15 -12
  14. package/dist/core/checklist/index.d.ts.map +1 -1
  15. package/dist/core/checklist/index.js +48 -30
  16. package/dist/core/checklist/index.js.map +1 -1
  17. package/dist/core/checklist/status-labels.d.ts +6 -0
  18. package/dist/core/checklist/status-labels.d.ts.map +1 -1
  19. package/dist/core/checklist/status-labels.js +8 -0
  20. package/dist/core/checklist/status-labels.js.map +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts +218 -0
  26. package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts.map +1 -0
  27. package/node_modules/@usejunior/docx-core/dist/atomizer.js +869 -0
  28. package/node_modules/@usejunior/docx-core/dist/atomizer.js.map +1 -0
  29. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.d.ts +96 -0
  30. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.d.ts.map +1 -0
  31. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.js +347 -0
  32. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.js.map +1 -0
  33. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.d.ts +2 -0
  34. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.d.ts.map +1 -0
  35. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.js +188 -0
  36. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.js.map +1 -0
  37. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.d.ts +41 -0
  38. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.d.ts.map +1 -0
  39. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.js +85 -0
  40. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.js.map +1 -0
  41. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts +64 -0
  42. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts.map +1 -0
  43. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js +985 -0
  44. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js.map +1 -0
  45. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.d.ts +111 -0
  46. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.d.ts.map +1 -0
  47. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.js +469 -0
  48. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.js.map +1 -0
  49. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts +277 -0
  50. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts.map +1 -0
  51. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js +2279 -0
  52. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js.map +1 -0
  53. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.d.ts +59 -0
  54. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.d.ts.map +1 -0
  55. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.js +209 -0
  56. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.js.map +1 -0
  57. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts +69 -0
  58. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts.map +1 -0
  59. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js +910 -0
  60. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js.map +1 -0
  61. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.d.ts +26 -0
  62. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.d.ts.map +1 -0
  63. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.js +153 -0
  64. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.js.map +1 -0
  65. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.d.ts +63 -0
  66. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.d.ts.map +1 -0
  67. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.js +254 -0
  68. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.js.map +1 -0
  69. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts +64 -0
  70. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts.map +1 -0
  71. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js +616 -0
  72. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js.map +1 -0
  73. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.d.ts +65 -0
  74. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.d.ts.map +1 -0
  75. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.js +95 -0
  76. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.js.map +1 -0
  77. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.d.ts +51 -0
  78. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.d.ts.map +1 -0
  79. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.js +83 -0
  80. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.js.map +1 -0
  81. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts +40 -0
  82. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts.map +1 -0
  83. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js +135 -0
  84. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js.map +1 -0
  85. package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts +28 -0
  86. package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts.map +1 -0
  87. package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js +110 -0
  88. package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js.map +1 -0
  89. package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts +3 -0
  90. package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts.map +1 -0
  91. package/node_modules/@usejunior/docx-core/dist/cli/index.js +21 -0
  92. package/node_modules/@usejunior/docx-core/dist/cli/index.js.map +1 -0
  93. package/node_modules/@usejunior/docx-core/dist/core-types.d.ts +296 -0
  94. package/node_modules/@usejunior/docx-core/dist/core-types.d.ts.map +1 -0
  95. package/node_modules/@usejunior/docx-core/dist/core-types.js +122 -0
  96. package/node_modules/@usejunior/docx-core/dist/core-types.js.map +1 -0
  97. package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts +144 -0
  98. package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts.map +1 -0
  99. package/node_modules/@usejunior/docx-core/dist/footnotes.js +291 -0
  100. package/node_modules/@usejunior/docx-core/dist/footnotes.js.map +1 -0
  101. package/node_modules/@usejunior/docx-core/dist/format-detection.d.ts +120 -0
  102. package/node_modules/@usejunior/docx-core/dist/format-detection.d.ts.map +1 -0
  103. package/node_modules/@usejunior/docx-core/dist/format-detection.js +338 -0
  104. package/node_modules/@usejunior/docx-core/dist/format-detection.js.map +1 -0
  105. package/node_modules/@usejunior/docx-core/dist/index.d.ts +177 -0
  106. package/node_modules/@usejunior/docx-core/dist/index.d.ts.map +1 -0
  107. package/node_modules/@usejunior/docx-core/dist/index.js +55 -0
  108. package/node_modules/@usejunior/docx-core/dist/index.js.map +1 -0
  109. package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.d.ts +6 -0
  110. package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.d.ts.map +1 -0
  111. package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.js +30 -0
  112. package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.js.map +1 -0
  113. package/node_modules/@usejunior/docx-core/dist/move-detection.d.ts +211 -0
  114. package/node_modules/@usejunior/docx-core/dist/move-detection.d.ts.map +1 -0
  115. package/node_modules/@usejunior/docx-core/dist/move-detection.js +391 -0
  116. package/node_modules/@usejunior/docx-core/dist/move-detection.js.map +1 -0
  117. package/node_modules/@usejunior/docx-core/dist/numbering.d.ts +136 -0
  118. package/node_modules/@usejunior/docx-core/dist/numbering.d.ts.map +1 -0
  119. package/node_modules/@usejunior/docx-core/dist/numbering.js +446 -0
  120. package/node_modules/@usejunior/docx-core/dist/numbering.js.map +1 -0
  121. package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts +30 -0
  122. package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts.map +1 -0
  123. package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js +241 -0
  124. package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js.map +1 -0
  125. package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.d.ts +12 -0
  126. package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.d.ts.map +1 -0
  127. package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.js +248 -0
  128. package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.js.map +1 -0
  129. package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts +88 -0
  130. package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts.map +1 -0
  131. package/node_modules/@usejunior/docx-core/dist/primitives/comments.js +703 -0
  132. package/node_modules/@usejunior/docx-core/dist/primitives/comments.js.map +1 -0
  133. package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts +186 -0
  134. package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts.map +1 -0
  135. package/node_modules/@usejunior/docx-core/dist/primitives/document.js +555 -0
  136. package/node_modules/@usejunior/docx-core/dist/primitives/document.js.map +1 -0
  137. package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts +97 -0
  138. package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts.map +1 -0
  139. package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js +749 -0
  140. package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js.map +1 -0
  141. package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts +94 -0
  142. package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts.map +1 -0
  143. package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js +219 -0
  144. package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js.map +1 -0
  145. package/node_modules/@usejunior/docx-core/dist/primitives/errors.d.ts +7 -0
  146. package/node_modules/@usejunior/docx-core/dist/primitives/errors.d.ts.map +1 -0
  147. package/node_modules/@usejunior/docx-core/dist/primitives/errors.js +10 -0
  148. package/node_modules/@usejunior/docx-core/dist/primitives/errors.js.map +1 -0
  149. package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.d.ts +50 -0
  150. package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.d.ts.map +1 -0
  151. package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.js +340 -0
  152. package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.js.map +1 -0
  153. package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts +37 -0
  154. package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts.map +1 -0
  155. package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js +552 -0
  156. package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js.map +1 -0
  157. package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts +43 -0
  158. package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts.map +1 -0
  159. package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js +291 -0
  160. package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js.map +1 -0
  161. package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts +27 -0
  162. package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts.map +1 -0
  163. package/node_modules/@usejunior/docx-core/dist/primitives/index.js +27 -0
  164. package/node_modules/@usejunior/docx-core/dist/primitives/index.js.map +1 -0
  165. package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts +53 -0
  166. package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts.map +1 -0
  167. package/node_modules/@usejunior/docx-core/dist/primitives/layout.js +178 -0
  168. package/node_modules/@usejunior/docx-core/dist/primitives/layout.js.map +1 -0
  169. package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.d.ts +19 -0
  170. package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.d.ts.map +1 -0
  171. package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.js +57 -0
  172. package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.js.map +1 -0
  173. package/node_modules/@usejunior/docx-core/dist/primitives/matching.d.ts +31 -0
  174. package/node_modules/@usejunior/docx-core/dist/primitives/matching.d.ts.map +1 -0
  175. package/node_modules/@usejunior/docx-core/dist/primitives/matching.js +223 -0
  176. package/node_modules/@usejunior/docx-core/dist/primitives/matching.js.map +1 -0
  177. package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts +23 -0
  178. package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts.map +1 -0
  179. package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js +243 -0
  180. package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js.map +1 -0
  181. package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts +91 -0
  182. package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts.map +1 -0
  183. package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js +108 -0
  184. package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js.map +1 -0
  185. package/node_modules/@usejunior/docx-core/dist/primitives/numbering.d.ts +27 -0
  186. package/node_modules/@usejunior/docx-core/dist/primitives/numbering.d.ts.map +1 -0
  187. package/node_modules/@usejunior/docx-core/dist/primitives/numbering.js +182 -0
  188. package/node_modules/@usejunior/docx-core/dist/primitives/numbering.js.map +1 -0
  189. package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.d.ts +18 -0
  190. package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.d.ts.map +1 -0
  191. package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.js +190 -0
  192. package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.js.map +1 -0
  193. package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts +27 -0
  194. package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts.map +1 -0
  195. package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js +371 -0
  196. package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js.map +1 -0
  197. package/node_modules/@usejunior/docx-core/dist/primitives/relationships.d.ts +7 -0
  198. package/node_modules/@usejunior/docx-core/dist/primitives/relationships.d.ts.map +1 -0
  199. package/node_modules/@usejunior/docx-core/dist/primitives/relationships.js +24 -0
  200. package/node_modules/@usejunior/docx-core/dist/primitives/relationships.js.map +1 -0
  201. package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts +17 -0
  202. package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts.map +1 -0
  203. package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js +58 -0
  204. package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js.map +1 -0
  205. package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.d.ts +19 -0
  206. package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.d.ts.map +1 -0
  207. package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.js +94 -0
  208. package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.js.map +1 -0
  209. package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts +36 -0
  210. package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts.map +1 -0
  211. package/node_modules/@usejunior/docx-core/dist/primitives/styles.js +205 -0
  212. package/node_modules/@usejunior/docx-core/dist/primitives/styles.js.map +1 -0
  213. package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts +54 -0
  214. package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts.map +1 -0
  215. package/node_modules/@usejunior/docx-core/dist/primitives/tables.js +205 -0
  216. package/node_modules/@usejunior/docx-core/dist/primitives/tables.js.map +1 -0
  217. package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts +30 -0
  218. package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts.map +1 -0
  219. package/node_modules/@usejunior/docx-core/dist/primitives/text.js +461 -0
  220. package/node_modules/@usejunior/docx-core/dist/primitives/text.js.map +1 -0
  221. package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.d.ts +24 -0
  222. package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.d.ts.map +1 -0
  223. package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.js +147 -0
  224. package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.js.map +1 -0
  225. package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts +5 -0
  226. package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts.map +1 -0
  227. package/node_modules/@usejunior/docx-core/dist/primitives/xml.js +19 -0
  228. package/node_modules/@usejunior/docx-core/dist/primitives/xml.js.map +1 -0
  229. package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts +25 -0
  230. package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts.map +1 -0
  231. package/node_modules/@usejunior/docx-core/dist/primitives/zip.js +78 -0
  232. package/node_modules/@usejunior/docx-core/dist/primitives/zip.js.map +1 -0
  233. package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.d.ts +94 -0
  234. package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.d.ts.map +1 -0
  235. package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.js +169 -0
  236. package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.js.map +1 -0
  237. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts +149 -0
  238. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts.map +1 -0
  239. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js +224 -0
  240. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js.map +1 -0
  241. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.d.ts +136 -0
  242. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.d.ts.map +1 -0
  243. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.js +7 -0
  244. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.js.map +1 -0
  245. package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.d.ts +31 -0
  246. package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.d.ts.map +1 -0
  247. package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.js +110 -0
  248. package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.js.map +1 -0
  249. package/node_modules/@usejunior/docx-core/package.json +26 -0
  250. package/node_modules/core-util-is/LICENSE +19 -0
  251. package/node_modules/core-util-is/README.md +3 -0
  252. package/node_modules/core-util-is/lib/util.js +107 -0
  253. package/node_modules/core-util-is/package.json +38 -0
  254. package/node_modules/diff-match-patch/LICENSE +202 -0
  255. package/node_modules/diff-match-patch/README.md +94 -0
  256. package/node_modules/diff-match-patch/index.js +2218 -0
  257. package/node_modules/diff-match-patch/package.json +22 -0
  258. package/node_modules/immediate/LICENSE.txt +20 -0
  259. package/node_modules/immediate/README.md +93 -0
  260. package/node_modules/immediate/dist/immediate.js +75 -0
  261. package/node_modules/immediate/dist/immediate.min.js +1 -0
  262. package/node_modules/immediate/lib/browser.js +69 -0
  263. package/node_modules/immediate/lib/index.js +73 -0
  264. package/node_modules/immediate/package.json +42 -0
  265. package/node_modules/inherits/LICENSE +16 -0
  266. package/node_modules/inherits/README.md +42 -0
  267. package/node_modules/inherits/inherits.js +9 -0
  268. package/node_modules/inherits/inherits_browser.js +27 -0
  269. package/node_modules/inherits/package.json +29 -0
  270. package/node_modules/isarray/.npmignore +1 -0
  271. package/node_modules/isarray/.travis.yml +4 -0
  272. package/node_modules/isarray/Makefile +6 -0
  273. package/node_modules/isarray/README.md +60 -0
  274. package/node_modules/isarray/component.json +19 -0
  275. package/node_modules/isarray/index.js +5 -0
  276. package/node_modules/isarray/package.json +45 -0
  277. package/node_modules/isarray/test.js +20 -0
  278. package/node_modules/jszip/.codeclimate.yml +16 -0
  279. package/node_modules/jszip/.editorconfig +8 -0
  280. package/node_modules/jszip/.eslintrc.js +43 -0
  281. package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
  282. package/node_modules/jszip/.jekyll-metadata +0 -0
  283. package/node_modules/jszip/.travis.yml +17 -0
  284. package/node_modules/jszip/CHANGES.md +204 -0
  285. package/node_modules/jszip/LICENSE.markdown +651 -0
  286. package/node_modules/jszip/README.markdown +33 -0
  287. package/node_modules/jszip/deps.js +37 -0
  288. package/node_modules/jszip/dist/jszip.js +11577 -0
  289. package/node_modules/jszip/dist/jszip.min.js +13 -0
  290. package/node_modules/jszip/graph.svg +601 -0
  291. package/node_modules/jszip/index.d.ts +330 -0
  292. package/node_modules/jszip/lib/base64.js +106 -0
  293. package/node_modules/jszip/lib/compressedObject.js +74 -0
  294. package/node_modules/jszip/lib/compressions.js +14 -0
  295. package/node_modules/jszip/lib/crc32.js +77 -0
  296. package/node_modules/jszip/lib/defaults.js +11 -0
  297. package/node_modules/jszip/lib/external.js +18 -0
  298. package/node_modules/jszip/lib/flate.js +85 -0
  299. package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
  300. package/node_modules/jszip/lib/generate/index.js +57 -0
  301. package/node_modules/jszip/lib/index.js +55 -0
  302. package/node_modules/jszip/lib/license_header.js +11 -0
  303. package/node_modules/jszip/lib/load.js +88 -0
  304. package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
  305. package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
  306. package/node_modules/jszip/lib/nodejsUtils.js +57 -0
  307. package/node_modules/jszip/lib/object.js +384 -0
  308. package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
  309. package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
  310. package/node_modules/jszip/lib/reader/DataReader.js +116 -0
  311. package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
  312. package/node_modules/jszip/lib/reader/StringReader.js +38 -0
  313. package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
  314. package/node_modules/jszip/lib/reader/readerFor.js +28 -0
  315. package/node_modules/jszip/lib/signature.js +7 -0
  316. package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
  317. package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
  318. package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
  319. package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
  320. package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
  321. package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
  322. package/node_modules/jszip/lib/support.js +38 -0
  323. package/node_modules/jszip/lib/utf8.js +275 -0
  324. package/node_modules/jszip/lib/utils.js +501 -0
  325. package/node_modules/jszip/lib/zipEntries.js +261 -0
  326. package/node_modules/jszip/lib/zipEntry.js +293 -0
  327. package/node_modules/jszip/lib/zipObject.js +133 -0
  328. package/node_modules/jszip/package.json +67 -0
  329. package/node_modules/jszip/sponsors.md +21 -0
  330. package/node_modules/jszip/tsconfig.json +101 -0
  331. package/node_modules/jszip/vendor/FileSaver.js +247 -0
  332. package/node_modules/lie/README.md +62 -0
  333. package/node_modules/lie/dist/lie.js +350 -0
  334. package/node_modules/lie/dist/lie.min.js +1 -0
  335. package/node_modules/lie/dist/lie.polyfill.js +358 -0
  336. package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
  337. package/node_modules/lie/lib/browser.js +273 -0
  338. package/node_modules/lie/lib/index.js +298 -0
  339. package/node_modules/lie/license.md +7 -0
  340. package/node_modules/lie/lie.d.ts +244 -0
  341. package/node_modules/lie/package.json +69 -0
  342. package/node_modules/lie/polyfill.js +4 -0
  343. package/node_modules/pako/LICENSE +21 -0
  344. package/node_modules/pako/README.md +191 -0
  345. package/node_modules/pako/dist/pako.js +6818 -0
  346. package/node_modules/pako/dist/pako.min.js +1 -0
  347. package/node_modules/pako/dist/pako_deflate.js +3997 -0
  348. package/node_modules/pako/dist/pako_deflate.min.js +1 -0
  349. package/node_modules/pako/dist/pako_inflate.js +3300 -0
  350. package/node_modules/pako/dist/pako_inflate.min.js +1 -0
  351. package/node_modules/pako/index.js +14 -0
  352. package/node_modules/pako/lib/deflate.js +400 -0
  353. package/node_modules/pako/lib/inflate.js +423 -0
  354. package/node_modules/pako/lib/utils/common.js +105 -0
  355. package/node_modules/pako/lib/utils/strings.js +187 -0
  356. package/node_modules/pako/lib/zlib/README +59 -0
  357. package/node_modules/pako/lib/zlib/adler32.js +51 -0
  358. package/node_modules/pako/lib/zlib/constants.js +68 -0
  359. package/node_modules/pako/lib/zlib/crc32.js +59 -0
  360. package/node_modules/pako/lib/zlib/deflate.js +1874 -0
  361. package/node_modules/pako/lib/zlib/gzheader.js +58 -0
  362. package/node_modules/pako/lib/zlib/inffast.js +345 -0
  363. package/node_modules/pako/lib/zlib/inflate.js +1556 -0
  364. package/node_modules/pako/lib/zlib/inftrees.js +343 -0
  365. package/node_modules/pako/lib/zlib/messages.js +32 -0
  366. package/node_modules/pako/lib/zlib/trees.js +1222 -0
  367. package/node_modules/pako/lib/zlib/zstream.js +47 -0
  368. package/node_modules/pako/package.json +44 -0
  369. package/node_modules/process-nextick-args/index.js +45 -0
  370. package/node_modules/process-nextick-args/license.md +19 -0
  371. package/node_modules/process-nextick-args/package.json +25 -0
  372. package/node_modules/process-nextick-args/readme.md +18 -0
  373. package/node_modules/readable-stream/.travis.yml +34 -0
  374. package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  375. package/node_modules/readable-stream/GOVERNANCE.md +136 -0
  376. package/node_modules/readable-stream/LICENSE +47 -0
  377. package/node_modules/readable-stream/README.md +58 -0
  378. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
  379. package/node_modules/readable-stream/duplex-browser.js +1 -0
  380. package/node_modules/readable-stream/duplex.js +1 -0
  381. package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
  382. package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
  383. package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
  384. package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
  385. package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
  386. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
  387. package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
  388. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  389. package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  390. package/node_modules/readable-stream/package.json +52 -0
  391. package/node_modules/readable-stream/passthrough.js +1 -0
  392. package/node_modules/readable-stream/readable-browser.js +7 -0
  393. package/node_modules/readable-stream/readable.js +19 -0
  394. package/node_modules/readable-stream/transform.js +1 -0
  395. package/node_modules/readable-stream/writable-browser.js +1 -0
  396. package/node_modules/readable-stream/writable.js +8 -0
  397. package/node_modules/safe-buffer/LICENSE +21 -0
  398. package/node_modules/safe-buffer/README.md +584 -0
  399. package/node_modules/safe-buffer/index.d.ts +187 -0
  400. package/node_modules/safe-buffer/index.js +62 -0
  401. package/node_modules/safe-buffer/package.json +37 -0
  402. package/node_modules/setimmediate/LICENSE.txt +20 -0
  403. package/node_modules/setimmediate/package.json +30 -0
  404. package/node_modules/setimmediate/setImmediate.js +186 -0
  405. package/node_modules/string_decoder/.travis.yml +50 -0
  406. package/node_modules/string_decoder/LICENSE +48 -0
  407. package/node_modules/string_decoder/README.md +47 -0
  408. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  409. package/node_modules/string_decoder/package.json +31 -0
  410. package/node_modules/util-deprecate/History.md +16 -0
  411. package/node_modules/util-deprecate/LICENSE +24 -0
  412. package/node_modules/util-deprecate/README.md +53 -0
  413. package/node_modules/util-deprecate/browser.js +67 -0
  414. package/node_modules/util-deprecate/node.js +6 -0
  415. package/node_modules/util-deprecate/package.json +27 -0
  416. package/package.json +9 -4
  417. package/packages/docx-core/node_modules/@xmldom/xmldom/CHANGELOG.md +468 -0
  418. package/packages/docx-core/node_modules/@xmldom/xmldom/LICENSE +8 -0
  419. package/packages/docx-core/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
  420. package/packages/docx-core/node_modules/@xmldom/xmldom/index.d.ts +43 -0
  421. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
  422. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/conventions.js +203 -0
  423. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
  424. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/dom.js +1879 -0
  425. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
  426. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/index.js +4 -0
  427. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/sax.js +662 -0
  428. package/packages/docx-core/node_modules/@xmldom/xmldom/package.json +71 -0
  429. package/packages/docx-core/node_modules/@xmldom/xmldom/readme.md +356 -0
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ var GenericWorker = require("./GenericWorker");
4
+ var utils = require("../utils");
5
+
6
+ /**
7
+ * A worker which convert chunks to a specified type.
8
+ * @constructor
9
+ * @param {String} destType the destination type.
10
+ */
11
+ function ConvertWorker(destType) {
12
+ GenericWorker.call(this, "ConvertWorker to " + destType);
13
+ this.destType = destType;
14
+ }
15
+ utils.inherits(ConvertWorker, GenericWorker);
16
+
17
+ /**
18
+ * @see GenericWorker.processChunk
19
+ */
20
+ ConvertWorker.prototype.processChunk = function (chunk) {
21
+ this.push({
22
+ data : utils.transformTo(this.destType, chunk.data),
23
+ meta : chunk.meta
24
+ });
25
+ };
26
+ module.exports = ConvertWorker;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ var GenericWorker = require("./GenericWorker");
4
+ var crc32 = require("../crc32");
5
+ var utils = require("../utils");
6
+
7
+ /**
8
+ * A worker which calculate the crc32 of the data flowing through.
9
+ * @constructor
10
+ */
11
+ function Crc32Probe() {
12
+ GenericWorker.call(this, "Crc32Probe");
13
+ this.withStreamInfo("crc32", 0);
14
+ }
15
+ utils.inherits(Crc32Probe, GenericWorker);
16
+
17
+ /**
18
+ * @see GenericWorker.processChunk
19
+ */
20
+ Crc32Probe.prototype.processChunk = function (chunk) {
21
+ this.streamInfo.crc32 = crc32(chunk.data, this.streamInfo.crc32 || 0);
22
+ this.push(chunk);
23
+ };
24
+ module.exports = Crc32Probe;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var GenericWorker = require("./GenericWorker");
5
+
6
+ /**
7
+ * A worker which calculate the total length of the data flowing through.
8
+ * @constructor
9
+ * @param {String} propName the name used to expose the length
10
+ */
11
+ function DataLengthProbe(propName) {
12
+ GenericWorker.call(this, "DataLengthProbe for " + propName);
13
+ this.propName = propName;
14
+ this.withStreamInfo(propName, 0);
15
+ }
16
+ utils.inherits(DataLengthProbe, GenericWorker);
17
+
18
+ /**
19
+ * @see GenericWorker.processChunk
20
+ */
21
+ DataLengthProbe.prototype.processChunk = function (chunk) {
22
+ if(chunk) {
23
+ var length = this.streamInfo[this.propName] || 0;
24
+ this.streamInfo[this.propName] = length + chunk.data.length;
25
+ }
26
+ GenericWorker.prototype.processChunk.call(this, chunk);
27
+ };
28
+ module.exports = DataLengthProbe;
29
+
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var GenericWorker = require("./GenericWorker");
5
+
6
+ // the size of the generated chunks
7
+ // TODO expose this as a public variable
8
+ var DEFAULT_BLOCK_SIZE = 16 * 1024;
9
+
10
+ /**
11
+ * A worker that reads a content and emits chunks.
12
+ * @constructor
13
+ * @param {Promise} dataP the promise of the data to split
14
+ */
15
+ function DataWorker(dataP) {
16
+ GenericWorker.call(this, "DataWorker");
17
+ var self = this;
18
+ this.dataIsReady = false;
19
+ this.index = 0;
20
+ this.max = 0;
21
+ this.data = null;
22
+ this.type = "";
23
+
24
+ this._tickScheduled = false;
25
+
26
+ dataP.then(function (data) {
27
+ self.dataIsReady = true;
28
+ self.data = data;
29
+ self.max = data && data.length || 0;
30
+ self.type = utils.getTypeOf(data);
31
+ if(!self.isPaused) {
32
+ self._tickAndRepeat();
33
+ }
34
+ }, function (e) {
35
+ self.error(e);
36
+ });
37
+ }
38
+
39
+ utils.inherits(DataWorker, GenericWorker);
40
+
41
+ /**
42
+ * @see GenericWorker.cleanUp
43
+ */
44
+ DataWorker.prototype.cleanUp = function () {
45
+ GenericWorker.prototype.cleanUp.call(this);
46
+ this.data = null;
47
+ };
48
+
49
+ /**
50
+ * @see GenericWorker.resume
51
+ */
52
+ DataWorker.prototype.resume = function () {
53
+ if(!GenericWorker.prototype.resume.call(this)) {
54
+ return false;
55
+ }
56
+
57
+ if (!this._tickScheduled && this.dataIsReady) {
58
+ this._tickScheduled = true;
59
+ utils.delay(this._tickAndRepeat, [], this);
60
+ }
61
+ return true;
62
+ };
63
+
64
+ /**
65
+ * Trigger a tick a schedule an other call to this function.
66
+ */
67
+ DataWorker.prototype._tickAndRepeat = function() {
68
+ this._tickScheduled = false;
69
+ if(this.isPaused || this.isFinished) {
70
+ return;
71
+ }
72
+ this._tick();
73
+ if(!this.isFinished) {
74
+ utils.delay(this._tickAndRepeat, [], this);
75
+ this._tickScheduled = true;
76
+ }
77
+ };
78
+
79
+ /**
80
+ * Read and push a chunk.
81
+ */
82
+ DataWorker.prototype._tick = function() {
83
+
84
+ if(this.isPaused || this.isFinished) {
85
+ return false;
86
+ }
87
+
88
+ var size = DEFAULT_BLOCK_SIZE;
89
+ var data = null, nextIndex = Math.min(this.max, this.index + size);
90
+ if (this.index >= this.max) {
91
+ // EOF
92
+ return this.end();
93
+ } else {
94
+ switch(this.type) {
95
+ case "string":
96
+ data = this.data.substring(this.index, nextIndex);
97
+ break;
98
+ case "uint8array":
99
+ data = this.data.subarray(this.index, nextIndex);
100
+ break;
101
+ case "array":
102
+ case "nodebuffer":
103
+ data = this.data.slice(this.index, nextIndex);
104
+ break;
105
+ }
106
+ this.index = nextIndex;
107
+ return this.push({
108
+ data : data,
109
+ meta : {
110
+ percent : this.max ? this.index / this.max * 100 : 0
111
+ }
112
+ });
113
+ }
114
+ };
115
+
116
+ module.exports = DataWorker;
@@ -0,0 +1,263 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * A worker that does nothing but passing chunks to the next one. This is like
5
+ * a nodejs stream but with some differences. On the good side :
6
+ * - it works on IE 6-9 without any issue / polyfill
7
+ * - it weights less than the full dependencies bundled with browserify
8
+ * - it forwards errors (no need to declare an error handler EVERYWHERE)
9
+ *
10
+ * A chunk is an object with 2 attributes : `meta` and `data`. The former is an
11
+ * object containing anything (`percent` for example), see each worker for more
12
+ * details. The latter is the real data (String, Uint8Array, etc).
13
+ *
14
+ * @constructor
15
+ * @param {String} name the name of the stream (mainly used for debugging purposes)
16
+ */
17
+ function GenericWorker(name) {
18
+ // the name of the worker
19
+ this.name = name || "default";
20
+ // an object containing metadata about the workers chain
21
+ this.streamInfo = {};
22
+ // an error which happened when the worker was paused
23
+ this.generatedError = null;
24
+ // an object containing metadata to be merged by this worker into the general metadata
25
+ this.extraStreamInfo = {};
26
+ // true if the stream is paused (and should not do anything), false otherwise
27
+ this.isPaused = true;
28
+ // true if the stream is finished (and should not do anything), false otherwise
29
+ this.isFinished = false;
30
+ // true if the stream is locked to prevent further structure updates (pipe), false otherwise
31
+ this.isLocked = false;
32
+ // the event listeners
33
+ this._listeners = {
34
+ "data":[],
35
+ "end":[],
36
+ "error":[]
37
+ };
38
+ // the previous worker, if any
39
+ this.previous = null;
40
+ }
41
+
42
+ GenericWorker.prototype = {
43
+ /**
44
+ * Push a chunk to the next workers.
45
+ * @param {Object} chunk the chunk to push
46
+ */
47
+ push : function (chunk) {
48
+ this.emit("data", chunk);
49
+ },
50
+ /**
51
+ * End the stream.
52
+ * @return {Boolean} true if this call ended the worker, false otherwise.
53
+ */
54
+ end : function () {
55
+ if (this.isFinished) {
56
+ return false;
57
+ }
58
+
59
+ this.flush();
60
+ try {
61
+ this.emit("end");
62
+ this.cleanUp();
63
+ this.isFinished = true;
64
+ } catch (e) {
65
+ this.emit("error", e);
66
+ }
67
+ return true;
68
+ },
69
+ /**
70
+ * End the stream with an error.
71
+ * @param {Error} e the error which caused the premature end.
72
+ * @return {Boolean} true if this call ended the worker with an error, false otherwise.
73
+ */
74
+ error : function (e) {
75
+ if (this.isFinished) {
76
+ return false;
77
+ }
78
+
79
+ if(this.isPaused) {
80
+ this.generatedError = e;
81
+ } else {
82
+ this.isFinished = true;
83
+
84
+ this.emit("error", e);
85
+
86
+ // in the workers chain exploded in the middle of the chain,
87
+ // the error event will go downward but we also need to notify
88
+ // workers upward that there has been an error.
89
+ if(this.previous) {
90
+ this.previous.error(e);
91
+ }
92
+
93
+ this.cleanUp();
94
+ }
95
+ return true;
96
+ },
97
+ /**
98
+ * Add a callback on an event.
99
+ * @param {String} name the name of the event (data, end, error)
100
+ * @param {Function} listener the function to call when the event is triggered
101
+ * @return {GenericWorker} the current object for chainability
102
+ */
103
+ on : function (name, listener) {
104
+ this._listeners[name].push(listener);
105
+ return this;
106
+ },
107
+ /**
108
+ * Clean any references when a worker is ending.
109
+ */
110
+ cleanUp : function () {
111
+ this.streamInfo = this.generatedError = this.extraStreamInfo = null;
112
+ this._listeners = [];
113
+ },
114
+ /**
115
+ * Trigger an event. This will call registered callback with the provided arg.
116
+ * @param {String} name the name of the event (data, end, error)
117
+ * @param {Object} arg the argument to call the callback with.
118
+ */
119
+ emit : function (name, arg) {
120
+ if (this._listeners[name]) {
121
+ for(var i = 0; i < this._listeners[name].length; i++) {
122
+ this._listeners[name][i].call(this, arg);
123
+ }
124
+ }
125
+ },
126
+ /**
127
+ * Chain a worker with an other.
128
+ * @param {Worker} next the worker receiving events from the current one.
129
+ * @return {worker} the next worker for chainability
130
+ */
131
+ pipe : function (next) {
132
+ return next.registerPrevious(this);
133
+ },
134
+ /**
135
+ * Same as `pipe` in the other direction.
136
+ * Using an API with `pipe(next)` is very easy.
137
+ * Implementing the API with the point of view of the next one registering
138
+ * a source is easier, see the ZipFileWorker.
139
+ * @param {Worker} previous the previous worker, sending events to this one
140
+ * @return {Worker} the current worker for chainability
141
+ */
142
+ registerPrevious : function (previous) {
143
+ if (this.isLocked) {
144
+ throw new Error("The stream '" + this + "' has already been used.");
145
+ }
146
+
147
+ // sharing the streamInfo...
148
+ this.streamInfo = previous.streamInfo;
149
+ // ... and adding our own bits
150
+ this.mergeStreamInfo();
151
+ this.previous = previous;
152
+ var self = this;
153
+ previous.on("data", function (chunk) {
154
+ self.processChunk(chunk);
155
+ });
156
+ previous.on("end", function () {
157
+ self.end();
158
+ });
159
+ previous.on("error", function (e) {
160
+ self.error(e);
161
+ });
162
+ return this;
163
+ },
164
+ /**
165
+ * Pause the stream so it doesn't send events anymore.
166
+ * @return {Boolean} true if this call paused the worker, false otherwise.
167
+ */
168
+ pause : function () {
169
+ if(this.isPaused || this.isFinished) {
170
+ return false;
171
+ }
172
+ this.isPaused = true;
173
+
174
+ if(this.previous) {
175
+ this.previous.pause();
176
+ }
177
+ return true;
178
+ },
179
+ /**
180
+ * Resume a paused stream.
181
+ * @return {Boolean} true if this call resumed the worker, false otherwise.
182
+ */
183
+ resume : function () {
184
+ if(!this.isPaused || this.isFinished) {
185
+ return false;
186
+ }
187
+ this.isPaused = false;
188
+
189
+ // if true, the worker tried to resume but failed
190
+ var withError = false;
191
+ if(this.generatedError) {
192
+ this.error(this.generatedError);
193
+ withError = true;
194
+ }
195
+ if(this.previous) {
196
+ this.previous.resume();
197
+ }
198
+
199
+ return !withError;
200
+ },
201
+ /**
202
+ * Flush any remaining bytes as the stream is ending.
203
+ */
204
+ flush : function () {},
205
+ /**
206
+ * Process a chunk. This is usually the method overridden.
207
+ * @param {Object} chunk the chunk to process.
208
+ */
209
+ processChunk : function(chunk) {
210
+ this.push(chunk);
211
+ },
212
+ /**
213
+ * Add a key/value to be added in the workers chain streamInfo once activated.
214
+ * @param {String} key the key to use
215
+ * @param {Object} value the associated value
216
+ * @return {Worker} the current worker for chainability
217
+ */
218
+ withStreamInfo : function (key, value) {
219
+ this.extraStreamInfo[key] = value;
220
+ this.mergeStreamInfo();
221
+ return this;
222
+ },
223
+ /**
224
+ * Merge this worker's streamInfo into the chain's streamInfo.
225
+ */
226
+ mergeStreamInfo : function () {
227
+ for(var key in this.extraStreamInfo) {
228
+ if (!Object.prototype.hasOwnProperty.call(this.extraStreamInfo, key)) {
229
+ continue;
230
+ }
231
+ this.streamInfo[key] = this.extraStreamInfo[key];
232
+ }
233
+ },
234
+
235
+ /**
236
+ * Lock the stream to prevent further updates on the workers chain.
237
+ * After calling this method, all calls to pipe will fail.
238
+ */
239
+ lock: function () {
240
+ if (this.isLocked) {
241
+ throw new Error("The stream '" + this + "' has already been used.");
242
+ }
243
+ this.isLocked = true;
244
+ if (this.previous) {
245
+ this.previous.lock();
246
+ }
247
+ },
248
+
249
+ /**
250
+ *
251
+ * Pretty print the workers chain.
252
+ */
253
+ toString : function () {
254
+ var me = "Worker " + this.name;
255
+ if (this.previous) {
256
+ return this.previous + " -> " + me;
257
+ } else {
258
+ return me;
259
+ }
260
+ }
261
+ };
262
+
263
+ module.exports = GenericWorker;
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var ConvertWorker = require("./ConvertWorker");
5
+ var GenericWorker = require("./GenericWorker");
6
+ var base64 = require("../base64");
7
+ var support = require("../support");
8
+ var external = require("../external");
9
+
10
+ var NodejsStreamOutputAdapter = null;
11
+ if (support.nodestream) {
12
+ try {
13
+ NodejsStreamOutputAdapter = require("../nodejs/NodejsStreamOutputAdapter");
14
+ } catch(e) {
15
+ // ignore
16
+ }
17
+ }
18
+
19
+ /**
20
+ * Apply the final transformation of the data. If the user wants a Blob for
21
+ * example, it's easier to work with an U8intArray and finally do the
22
+ * ArrayBuffer/Blob conversion.
23
+ * @param {String} type the name of the final type
24
+ * @param {String|Uint8Array|Buffer} content the content to transform
25
+ * @param {String} mimeType the mime type of the content, if applicable.
26
+ * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the content in the right format.
27
+ */
28
+ function transformZipOutput(type, content, mimeType) {
29
+ switch(type) {
30
+ case "blob" :
31
+ return utils.newBlob(utils.transformTo("arraybuffer", content), mimeType);
32
+ case "base64" :
33
+ return base64.encode(content);
34
+ default :
35
+ return utils.transformTo(type, content);
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Concatenate an array of data of the given type.
41
+ * @param {String} type the type of the data in the given array.
42
+ * @param {Array} dataArray the array containing the data chunks to concatenate
43
+ * @return {String|Uint8Array|Buffer} the concatenated data
44
+ * @throws Error if the asked type is unsupported
45
+ */
46
+ function concat (type, dataArray) {
47
+ var i, index = 0, res = null, totalLength = 0;
48
+ for(i = 0; i < dataArray.length; i++) {
49
+ totalLength += dataArray[i].length;
50
+ }
51
+ switch(type) {
52
+ case "string":
53
+ return dataArray.join("");
54
+ case "array":
55
+ return Array.prototype.concat.apply([], dataArray);
56
+ case "uint8array":
57
+ res = new Uint8Array(totalLength);
58
+ for(i = 0; i < dataArray.length; i++) {
59
+ res.set(dataArray[i], index);
60
+ index += dataArray[i].length;
61
+ }
62
+ return res;
63
+ case "nodebuffer":
64
+ return Buffer.concat(dataArray);
65
+ default:
66
+ throw new Error("concat : unsupported type '" + type + "'");
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Listen a StreamHelper, accumulate its content and concatenate it into a
72
+ * complete block.
73
+ * @param {StreamHelper} helper the helper to use.
74
+ * @param {Function} updateCallback a callback called on each update. Called
75
+ * with one arg :
76
+ * - the metadata linked to the update received.
77
+ * @return Promise the promise for the accumulation.
78
+ */
79
+ function accumulate(helper, updateCallback) {
80
+ return new external.Promise(function (resolve, reject){
81
+ var dataArray = [];
82
+ var chunkType = helper._internalType,
83
+ resultType = helper._outputType,
84
+ mimeType = helper._mimeType;
85
+ helper
86
+ .on("data", function (data, meta) {
87
+ dataArray.push(data);
88
+ if(updateCallback) {
89
+ updateCallback(meta);
90
+ }
91
+ })
92
+ .on("error", function(err) {
93
+ dataArray = [];
94
+ reject(err);
95
+ })
96
+ .on("end", function (){
97
+ try {
98
+ var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType);
99
+ resolve(result);
100
+ } catch (e) {
101
+ reject(e);
102
+ }
103
+ dataArray = [];
104
+ })
105
+ .resume();
106
+ });
107
+ }
108
+
109
+ /**
110
+ * An helper to easily use workers outside of JSZip.
111
+ * @constructor
112
+ * @param {Worker} worker the worker to wrap
113
+ * @param {String} outputType the type of data expected by the use
114
+ * @param {String} mimeType the mime type of the content, if applicable.
115
+ */
116
+ function StreamHelper(worker, outputType, mimeType) {
117
+ var internalType = outputType;
118
+ switch(outputType) {
119
+ case "blob":
120
+ case "arraybuffer":
121
+ internalType = "uint8array";
122
+ break;
123
+ case "base64":
124
+ internalType = "string";
125
+ break;
126
+ }
127
+
128
+ try {
129
+ // the type used internally
130
+ this._internalType = internalType;
131
+ // the type used to output results
132
+ this._outputType = outputType;
133
+ // the mime type
134
+ this._mimeType = mimeType;
135
+ utils.checkSupport(internalType);
136
+ this._worker = worker.pipe(new ConvertWorker(internalType));
137
+ // the last workers can be rewired without issues but we need to
138
+ // prevent any updates on previous workers.
139
+ worker.lock();
140
+ } catch(e) {
141
+ this._worker = new GenericWorker("error");
142
+ this._worker.error(e);
143
+ }
144
+ }
145
+
146
+ StreamHelper.prototype = {
147
+ /**
148
+ * Listen a StreamHelper, accumulate its content and concatenate it into a
149
+ * complete block.
150
+ * @param {Function} updateCb the update callback.
151
+ * @return Promise the promise for the accumulation.
152
+ */
153
+ accumulate : function (updateCb) {
154
+ return accumulate(this, updateCb);
155
+ },
156
+ /**
157
+ * Add a listener on an event triggered on a stream.
158
+ * @param {String} evt the name of the event
159
+ * @param {Function} fn the listener
160
+ * @return {StreamHelper} the current helper.
161
+ */
162
+ on : function (evt, fn) {
163
+ var self = this;
164
+
165
+ if(evt === "data") {
166
+ this._worker.on(evt, function (chunk) {
167
+ fn.call(self, chunk.data, chunk.meta);
168
+ });
169
+ } else {
170
+ this._worker.on(evt, function () {
171
+ utils.delay(fn, arguments, self);
172
+ });
173
+ }
174
+ return this;
175
+ },
176
+ /**
177
+ * Resume the flow of chunks.
178
+ * @return {StreamHelper} the current helper.
179
+ */
180
+ resume : function () {
181
+ utils.delay(this._worker.resume, [], this._worker);
182
+ return this;
183
+ },
184
+ /**
185
+ * Pause the flow of chunks.
186
+ * @return {StreamHelper} the current helper.
187
+ */
188
+ pause : function () {
189
+ this._worker.pause();
190
+ return this;
191
+ },
192
+ /**
193
+ * Return a nodejs stream for this helper.
194
+ * @param {Function} updateCb the update callback.
195
+ * @return {NodejsStreamOutputAdapter} the nodejs stream.
196
+ */
197
+ toNodejsStream : function (updateCb) {
198
+ utils.checkSupport("nodestream");
199
+ if (this._outputType !== "nodebuffer") {
200
+ // an object stream containing blob/arraybuffer/uint8array/string
201
+ // is strange and I don't know if it would be useful.
202
+ // I you find this comment and have a good usecase, please open a
203
+ // bug report !
204
+ throw new Error(this._outputType + " is not supported by this method");
205
+ }
206
+
207
+ return new NodejsStreamOutputAdapter(this, {
208
+ objectMode : this._outputType !== "nodebuffer"
209
+ }, updateCb);
210
+ }
211
+ };
212
+
213
+
214
+ module.exports = StreamHelper;