@cloudant/couchbackup 2.9.8-SNAPSHOT.93 → 2.9.8
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/.scannerwork/.sonar_lock +0 -0
- package/.scannerwork/report-task.txt +7 -0
- package/.scannerwork/scanner-report/activerules.pb +1946 -0
- package/.scannerwork/scanner-report/analysis-warnings.pb +3 -0
- package/.scannerwork/scanner-report/analysis.log +54 -0
- package/.scannerwork/scanner-report/changesets-19.pb +1 -0
- package/.scannerwork/scanner-report/changesets-20.pb +1 -0
- package/.scannerwork/scanner-report/changesets-21.pb +1 -0
- package/.scannerwork/scanner-report/changesets-22.pb +1 -0
- package/.scannerwork/scanner-report/changesets-23.pb +1 -0
- package/.scannerwork/scanner-report/changesets-24.pb +1 -0
- package/.scannerwork/scanner-report/changesets-25.pb +1 -0
- package/.scannerwork/scanner-report/changesets-26.pb +1 -0
- package/.scannerwork/scanner-report/changesets-27.pb +1 -0
- package/.scannerwork/scanner-report/changesets-28.pb +1 -0
- package/.scannerwork/scanner-report/changesets-29.pb +1 -0
- package/.scannerwork/scanner-report/changesets-30.pb +1 -0
- package/.scannerwork/scanner-report/changesets-31.pb +1 -0
- package/.scannerwork/scanner-report/changesets-32.pb +1 -0
- package/.scannerwork/scanner-report/changesets-33.pb +1 -0
- package/.scannerwork/scanner-report/changesets-34.pb +1 -0
- package/.scannerwork/scanner-report/changesets-35.pb +1 -0
- package/.scannerwork/scanner-report/changesets-36.pb +1 -0
- package/.scannerwork/scanner-report/changesets-37.pb +1 -0
- package/.scannerwork/scanner-report/changesets-4.pb +1 -0
- package/.scannerwork/scanner-report/changesets-41.pb +1 -0
- package/.scannerwork/scanner-report/changesets-42.pb +1 -0
- package/.scannerwork/scanner-report/changesets-43.pb +1 -0
- package/.scannerwork/scanner-report/changesets-44.pb +1 -0
- package/.scannerwork/scanner-report/changesets-45.pb +1 -0
- package/.scannerwork/scanner-report/changesets-46.pb +1 -0
- package/.scannerwork/scanner-report/changesets-47.pb +1 -0
- package/.scannerwork/scanner-report/changesets-48.pb +1 -0
- package/.scannerwork/scanner-report/changesets-49.pb +1 -0
- package/.scannerwork/scanner-report/changesets-5.pb +1 -0
- package/.scannerwork/scanner-report/changesets-50.pb +1 -0
- package/.scannerwork/scanner-report/changesets-51.pb +1 -0
- package/.scannerwork/scanner-report/changesets-52.pb +1 -0
- package/.scannerwork/scanner-report/changesets-53.pb +1 -0
- package/.scannerwork/scanner-report/changesets-54.pb +1 -0
- package/.scannerwork/scanner-report/changesets-57.pb +1 -0
- package/.scannerwork/scanner-report/changesets-58.pb +1 -0
- package/.scannerwork/scanner-report/changesets-6.pb +1 -0
- package/.scannerwork/scanner-report/changesets-65.pb +1 -0
- package/.scannerwork/scanner-report/changesets-66.pb +1 -0
- package/.scannerwork/scanner-report/changesets-69.pb +1 -0
- package/.scannerwork/scanner-report/changesets-7.pb +1 -0
- package/.scannerwork/scanner-report/component-1.pb +1 -0
- package/.scannerwork/scanner-report/component-19.pb +1 -0
- package/.scannerwork/scanner-report/component-20.pb +1 -0
- package/.scannerwork/scanner-report/component-21.pb +1 -0
- package/.scannerwork/scanner-report/component-22.pb +1 -0
- package/.scannerwork/scanner-report/component-23.pb +1 -0
- package/.scannerwork/scanner-report/component-24.pb +1 -0
- package/.scannerwork/scanner-report/component-25.pb +1 -0
- package/.scannerwork/scanner-report/component-26.pb +1 -0
- package/.scannerwork/scanner-report/component-27.pb +1 -0
- package/.scannerwork/scanner-report/component-28.pb +1 -0
- package/.scannerwork/scanner-report/component-29.pb +1 -0
- package/.scannerwork/scanner-report/component-30.pb +1 -0
- package/.scannerwork/scanner-report/component-31.pb +1 -0
- package/.scannerwork/scanner-report/component-32.pb +1 -0
- package/.scannerwork/scanner-report/component-33.pb +1 -0
- package/.scannerwork/scanner-report/component-34.pb +1 -0
- package/.scannerwork/scanner-report/component-35.pb +1 -0
- package/.scannerwork/scanner-report/component-36.pb +1 -0
- package/.scannerwork/scanner-report/component-37.pb +1 -0
- package/.scannerwork/scanner-report/component-38.pb +1 -0
- package/.scannerwork/scanner-report/component-4.pb +1 -0
- package/.scannerwork/scanner-report/component-40.pb +1 -0
- package/.scannerwork/scanner-report/component-41.pb +1 -0
- package/.scannerwork/scanner-report/component-42.pb +1 -0
- package/.scannerwork/scanner-report/component-43.pb +1 -0
- package/.scannerwork/scanner-report/component-44.pb +1 -0
- package/.scannerwork/scanner-report/component-45.pb +1 -0
- package/.scannerwork/scanner-report/component-46.pb +1 -0
- package/.scannerwork/scanner-report/component-47.pb +1 -0
- package/.scannerwork/scanner-report/component-48.pb +1 -0
- package/.scannerwork/scanner-report/component-49.pb +1 -0
- package/.scannerwork/scanner-report/component-5.pb +1 -0
- package/.scannerwork/scanner-report/component-50.pb +1 -0
- package/.scannerwork/scanner-report/component-51.pb +1 -0
- package/.scannerwork/scanner-report/component-52.pb +1 -0
- package/.scannerwork/scanner-report/component-53.pb +1 -0
- package/.scannerwork/scanner-report/component-54.pb +1 -0
- package/.scannerwork/scanner-report/component-55.pb +1 -0
- package/.scannerwork/scanner-report/component-57.pb +1 -0
- package/.scannerwork/scanner-report/component-58.pb +1 -0
- package/.scannerwork/scanner-report/component-59.pb +1 -0
- package/.scannerwork/scanner-report/component-6.pb +1 -0
- package/.scannerwork/scanner-report/component-61.pb +1 -0
- package/.scannerwork/scanner-report/component-65.pb +1 -0
- package/.scannerwork/scanner-report/component-66.pb +1 -0
- package/.scannerwork/scanner-report/component-69.pb +1 -0
- package/.scannerwork/scanner-report/component-7.pb +1 -0
- package/.scannerwork/scanner-report/context-props.pb +3 -0
- package/.scannerwork/scanner-report/coverages-19.pb +0 -0
- package/.scannerwork/scanner-report/coverages-20.pb +0 -0
- package/.scannerwork/scanner-report/coverages-21.pb +0 -0
- package/.scannerwork/scanner-report/coverages-22.pb +0 -0
- package/.scannerwork/scanner-report/coverages-23.pb +0 -0
- package/.scannerwork/scanner-report/coverages-24.pb +0 -0
- package/.scannerwork/scanner-report/coverages-25.pb +0 -0
- package/.scannerwork/scanner-report/coverages-26.pb +0 -0
- package/.scannerwork/scanner-report/coverages-27.pb +0 -0
- package/.scannerwork/scanner-report/coverages-28.pb +0 -0
- package/.scannerwork/scanner-report/coverages-29.pb +0 -0
- package/.scannerwork/scanner-report/coverages-30.pb +0 -0
- package/.scannerwork/scanner-report/coverages-31.pb +0 -0
- package/.scannerwork/scanner-report/coverages-32.pb +0 -0
- package/.scannerwork/scanner-report/coverages-33.pb +0 -0
- package/.scannerwork/scanner-report/coverages-34.pb +0 -0
- package/.scannerwork/scanner-report/coverages-35.pb +0 -0
- package/.scannerwork/scanner-report/coverages-36.pb +0 -0
- package/.scannerwork/scanner-report/coverages-37.pb +0 -0
- package/.scannerwork/scanner-report/coverages-4.pb +0 -0
- package/.scannerwork/scanner-report/coverages-41.pb +0 -0
- package/.scannerwork/scanner-report/coverages-42.pb +0 -0
- package/.scannerwork/scanner-report/coverages-43.pb +0 -0
- package/.scannerwork/scanner-report/coverages-44.pb +0 -0
- package/.scannerwork/scanner-report/coverages-45.pb +0 -0
- package/.scannerwork/scanner-report/coverages-46.pb +0 -0
- package/.scannerwork/scanner-report/coverages-47.pb +0 -0
- package/.scannerwork/scanner-report/coverages-48.pb +0 -0
- package/.scannerwork/scanner-report/coverages-49.pb +0 -0
- package/.scannerwork/scanner-report/coverages-5.pb +0 -0
- package/.scannerwork/scanner-report/coverages-50.pb +0 -0
- package/.scannerwork/scanner-report/coverages-51.pb +0 -0
- package/.scannerwork/scanner-report/coverages-52.pb +0 -0
- package/.scannerwork/scanner-report/coverages-53.pb +0 -0
- package/.scannerwork/scanner-report/coverages-54.pb +0 -0
- package/.scannerwork/scanner-report/coverages-57.pb +0 -0
- package/.scannerwork/scanner-report/coverages-58.pb +0 -0
- package/.scannerwork/scanner-report/coverages-6.pb +0 -0
- package/.scannerwork/scanner-report/coverages-65.pb +0 -0
- package/.scannerwork/scanner-report/coverages-66.pb +0 -0
- package/.scannerwork/scanner-report/coverages-69.pb +0 -0
- package/.scannerwork/scanner-report/coverages-7.pb +0 -0
- package/.scannerwork/scanner-report/duplications-19.pb +3 -0
- package/.scannerwork/scanner-report/duplications-20.pb +0 -0
- package/.scannerwork/scanner-report/duplications-21.pb +2 -0
- package/.scannerwork/scanner-report/duplications-22.pb +3 -0
- package/.scannerwork/scanner-report/duplications-23.pb +0 -0
- package/.scannerwork/scanner-report/duplications-24.pb +0 -0
- package/.scannerwork/scanner-report/duplications-26.pb +0 -0
- package/.scannerwork/scanner-report/duplications-27.pb +0 -0
- package/.scannerwork/scanner-report/duplications-28.pb +0 -0
- package/.scannerwork/scanner-report/duplications-29.pb +0 -0
- package/.scannerwork/scanner-report/duplications-30.pb +0 -0
- package/.scannerwork/scanner-report/duplications-31.pb +0 -0
- package/.scannerwork/scanner-report/duplications-32.pb +2 -0
- package/.scannerwork/scanner-report/duplications-33.pb +0 -0
- package/.scannerwork/scanner-report/duplications-34.pb +0 -0
- package/.scannerwork/scanner-report/duplications-35.pb +0 -0
- package/.scannerwork/scanner-report/duplications-36.pb +2 -0
- package/.scannerwork/scanner-report/duplications-37.pb +0 -0
- package/.scannerwork/scanner-report/duplications-4.pb +0 -0
- package/.scannerwork/scanner-report/duplications-41.pb +0 -0
- package/.scannerwork/scanner-report/duplications-42.pb +0 -0
- package/.scannerwork/scanner-report/duplications-43.pb +2 -0
- package/.scannerwork/scanner-report/duplications-44.pb +0 -0
- package/.scannerwork/scanner-report/duplications-45.pb +2 -0
- package/.scannerwork/scanner-report/duplications-46.pb +0 -0
- package/.scannerwork/scanner-report/duplications-47.pb +0 -0
- package/.scannerwork/scanner-report/duplications-48.pb +0 -0
- package/.scannerwork/scanner-report/duplications-49.pb +0 -0
- package/.scannerwork/scanner-report/duplications-5.pb +3 -0
- package/.scannerwork/scanner-report/duplications-50.pb +0 -0
- package/.scannerwork/scanner-report/duplications-51.pb +0 -0
- package/.scannerwork/scanner-report/duplications-52.pb +0 -0
- package/.scannerwork/scanner-report/duplications-53.pb +0 -0
- package/.scannerwork/scanner-report/duplications-54.pb +0 -0
- package/.scannerwork/scanner-report/duplications-57.pb +0 -0
- package/.scannerwork/scanner-report/duplications-58.pb +0 -0
- package/.scannerwork/scanner-report/duplications-6.pb +0 -0
- package/.scannerwork/scanner-report/duplications-65.pb +2 -0
- package/.scannerwork/scanner-report/duplications-66.pb +2 -0
- package/.scannerwork/scanner-report/duplications-69.pb +0 -0
- package/.scannerwork/scanner-report/duplications-7.pb +0 -0
- package/.scannerwork/scanner-report/issues-28.pb +3 -0
- package/.scannerwork/scanner-report/issues-29.pb +6 -0
- package/.scannerwork/scanner-report/issues-5.pb +4 -0
- package/.scannerwork/scanner-report/issues-7.pb +3 -0
- package/.scannerwork/scanner-report/measures-19.pb +0 -0
- package/.scannerwork/scanner-report/measures-20.pb +0 -0
- package/.scannerwork/scanner-report/measures-21.pb +15 -0
- package/.scannerwork/scanner-report/measures-22.pb +0 -0
- package/.scannerwork/scanner-report/measures-23.pb +0 -0
- package/.scannerwork/scanner-report/measures-24.pb +0 -0
- package/.scannerwork/scanner-report/measures-25.pb +0 -0
- package/.scannerwork/scanner-report/measures-26.pb +0 -0
- package/.scannerwork/scanner-report/measures-27.pb +0 -0
- package/.scannerwork/scanner-report/measures-28.pb +0 -0
- package/.scannerwork/scanner-report/measures-29.pb +0 -0
- package/.scannerwork/scanner-report/measures-30.pb +0 -0
- package/.scannerwork/scanner-report/measures-31.pb +0 -0
- package/.scannerwork/scanner-report/measures-32.pb +0 -0
- package/.scannerwork/scanner-report/measures-33.pb +0 -0
- package/.scannerwork/scanner-report/measures-34.pb +0 -0
- package/.scannerwork/scanner-report/measures-35.pb +0 -0
- package/.scannerwork/scanner-report/measures-36.pb +0 -0
- package/.scannerwork/scanner-report/measures-37.pb +0 -0
- package/.scannerwork/scanner-report/measures-38.pb +0 -0
- package/.scannerwork/scanner-report/measures-4.pb +0 -0
- package/.scannerwork/scanner-report/measures-40.pb +0 -0
- package/.scannerwork/scanner-report/measures-41.pb +0 -0
- package/.scannerwork/scanner-report/measures-42.pb +15 -0
- package/.scannerwork/scanner-report/measures-43.pb +0 -0
- package/.scannerwork/scanner-report/measures-44.pb +16 -0
- package/.scannerwork/scanner-report/measures-45.pb +0 -0
- package/.scannerwork/scanner-report/measures-46.pb +0 -0
- package/.scannerwork/scanner-report/measures-47.pb +0 -0
- package/.scannerwork/scanner-report/measures-48.pb +0 -0
- package/.scannerwork/scanner-report/measures-49.pb +0 -0
- package/.scannerwork/scanner-report/measures-5.pb +0 -0
- package/.scannerwork/scanner-report/measures-50.pb +0 -0
- package/.scannerwork/scanner-report/measures-51.pb +0 -0
- package/.scannerwork/scanner-report/measures-52.pb +0 -0
- package/.scannerwork/scanner-report/measures-53.pb +0 -0
- package/.scannerwork/scanner-report/measures-54.pb +0 -0
- package/.scannerwork/scanner-report/measures-55.pb +0 -0
- package/.scannerwork/scanner-report/measures-57.pb +0 -0
- package/.scannerwork/scanner-report/measures-58.pb +0 -0
- package/.scannerwork/scanner-report/measures-59.pb +0 -0
- package/.scannerwork/scanner-report/measures-6.pb +0 -0
- package/.scannerwork/scanner-report/measures-61.pb +0 -0
- package/.scannerwork/scanner-report/measures-65.pb +0 -0
- package/.scannerwork/scanner-report/measures-66.pb +0 -0
- package/.scannerwork/scanner-report/measures-69.pb +0 -0
- package/.scannerwork/scanner-report/measures-7.pb +0 -0
- package/.scannerwork/scanner-report/metadata.pb +0 -0
- package/.scannerwork/scanner-report/source-19.txt +131 -0
- package/.scannerwork/scanner-report/source-20.txt +35 -0
- package/.scannerwork/scanner-report/source-21.txt +293 -0
- package/.scannerwork/scanner-report/source-22.txt +119 -0
- package/.scannerwork/scanner-report/source-23.txt +92 -0
- package/.scannerwork/scanner-report/source-24.txt +625 -0
- package/.scannerwork/scanner-report/source-25.txt +29 -0
- package/.scannerwork/scanner-report/source-26.txt +63 -0
- package/.scannerwork/scanner-report/source-27.txt +36 -0
- package/.scannerwork/scanner-report/source-28.txt +142 -0
- package/.scannerwork/scanner-report/source-29.txt +366 -0
- package/.scannerwork/scanner-report/source-30.txt +36 -0
- package/.scannerwork/scanner-report/source-31.txt +100 -0
- package/.scannerwork/scanner-report/source-32.txt +145 -0
- package/.scannerwork/scanner-report/source-33.txt +156 -0
- package/.scannerwork/scanner-report/source-34.txt +68 -0
- package/.scannerwork/scanner-report/source-35.txt +147 -0
- package/.scannerwork/scanner-report/source-36.txt +225 -0
- package/.scannerwork/scanner-report/source-37.txt +114 -0
- package/.scannerwork/scanner-report/source-38.txt +167 -0
- package/.scannerwork/scanner-report/source-4.txt +34 -0
- package/.scannerwork/scanner-report/source-40.txt +509 -0
- package/.scannerwork/scanner-report/source-41.txt +31 -0
- package/.scannerwork/scanner-report/source-42.txt +104 -0
- package/.scannerwork/scanner-report/source-43.txt +92 -0
- package/.scannerwork/scanner-report/source-44.txt +178 -0
- package/.scannerwork/scanner-report/source-45.txt +75 -0
- package/.scannerwork/scanner-report/source-46.txt +54 -0
- package/.scannerwork/scanner-report/source-47.txt +41 -0
- package/.scannerwork/scanner-report/source-48.txt +118 -0
- package/.scannerwork/scanner-report/source-49.txt +129 -0
- package/.scannerwork/scanner-report/source-5.txt +244 -0
- package/.scannerwork/scanner-report/source-50.txt +281 -0
- package/.scannerwork/scanner-report/source-51.txt +80 -0
- package/.scannerwork/scanner-report/source-52.txt +111 -0
- package/.scannerwork/scanner-report/source-53.txt +46 -0
- package/.scannerwork/scanner-report/source-54.txt +164 -0
- package/.scannerwork/scanner-report/source-55.txt +509 -0
- package/.scannerwork/scanner-report/source-57.txt +77 -0
- package/.scannerwork/scanner-report/source-58.txt +56 -0
- package/.scannerwork/scanner-report/source-59.txt +509 -0
- package/.scannerwork/scanner-report/source-6.txt +68 -0
- package/.scannerwork/scanner-report/source-61.txt +509 -0
- package/.scannerwork/scanner-report/source-65.txt +190 -0
- package/.scannerwork/scanner-report/source-66.txt +175 -0
- package/.scannerwork/scanner-report/source-69.txt +418 -0
- package/.scannerwork/scanner-report/source-7.txt +47 -0
- package/.scannerwork/scanner-report/symbols-19.pb +97 -0
- package/.scannerwork/scanner-report/symbols-20.pb +17 -0
- package/.scannerwork/scanner-report/symbols-21.pb +486 -0
- package/.scannerwork/scanner-report/symbols-22.pb +77 -0
- package/.scannerwork/scanner-report/symbols-23.pb +60 -0
- package/.scannerwork/scanner-report/symbols-24.pb +1254 -0
- package/.scannerwork/scanner-report/symbols-25.pb +9 -0
- package/.scannerwork/scanner-report/symbols-26.pb +43 -0
- package/.scannerwork/scanner-report/symbols-27.pb +11 -0
- package/.scannerwork/scanner-report/symbols-28.pb +116 -0
- package/.scannerwork/scanner-report/symbols-29.pb +494 -0
- package/.scannerwork/scanner-report/symbols-30.pb +14 -0
- package/.scannerwork/scanner-report/symbols-31.pb +69 -0
- package/.scannerwork/scanner-report/symbols-32.pb +102 -0
- package/.scannerwork/scanner-report/symbols-33.pb +112 -0
- package/.scannerwork/scanner-report/symbols-34.pb +36 -0
- package/.scannerwork/scanner-report/symbols-35.pb +85 -0
- package/.scannerwork/scanner-report/symbols-36.pb +418 -0
- package/.scannerwork/scanner-report/symbols-37.pb +28 -0
- package/.scannerwork/scanner-report/symbols-4.pb +10 -0
- package/.scannerwork/scanner-report/symbols-41.pb +14 -0
- package/.scannerwork/scanner-report/symbols-42.pb +42 -0
- package/.scannerwork/scanner-report/symbols-43.pb +44 -0
- package/.scannerwork/scanner-report/symbols-44.pb +144 -0
- package/.scannerwork/scanner-report/symbols-45.pb +42 -0
- package/.scannerwork/scanner-report/symbols-46.pb +15 -0
- package/.scannerwork/scanner-report/symbols-47.pb +18 -0
- package/.scannerwork/scanner-report/symbols-48.pb +30 -0
- package/.scannerwork/scanner-report/symbols-49.pb +33 -0
- package/.scannerwork/scanner-report/symbols-5.pb +394 -0
- package/.scannerwork/scanner-report/symbols-50.pb +354 -0
- package/.scannerwork/scanner-report/symbols-51.pb +46 -0
- package/.scannerwork/scanner-report/symbols-52.pb +59 -0
- package/.scannerwork/scanner-report/symbols-53.pb +20 -0
- package/.scannerwork/scanner-report/symbols-54.pb +126 -0
- package/.scannerwork/scanner-report/symbols-57.pb +30 -0
- package/.scannerwork/scanner-report/symbols-58.pb +19 -0
- package/.scannerwork/scanner-report/symbols-6.pb +45 -0
- package/.scannerwork/scanner-report/symbols-65.pb +180 -0
- package/.scannerwork/scanner-report/symbols-66.pb +153 -0
- package/.scannerwork/scanner-report/symbols-69.pb +610 -0
- package/.scannerwork/scanner-report/symbols-7.pb +27 -0
- package/.scannerwork/scanner-report/syntax-highlightings-19.pb +182 -0
- package/.scannerwork/scanner-report/syntax-highlightings-20.pb +63 -0
- package/.scannerwork/scanner-report/syntax-highlightings-21.pb +659 -0
- package/.scannerwork/scanner-report/syntax-highlightings-22.pb +158 -0
- package/.scannerwork/scanner-report/syntax-highlightings-23.pb +110 -0
- package/.scannerwork/scanner-report/syntax-highlightings-24.pb +887 -0
- package/.scannerwork/scanner-report/syntax-highlightings-25.pb +48 -0
- package/.scannerwork/scanner-report/syntax-highlightings-26.pb +82 -0
- package/.scannerwork/scanner-report/syntax-highlightings-27.pb +59 -0
- package/.scannerwork/scanner-report/syntax-highlightings-28.pb +134 -0
- package/.scannerwork/scanner-report/syntax-highlightings-29.pb +630 -0
- package/.scannerwork/scanner-report/syntax-highlightings-30.pb +54 -0
- package/.scannerwork/scanner-report/syntax-highlightings-31.pb +105 -0
- package/.scannerwork/scanner-report/syntax-highlightings-32.pb +227 -0
- package/.scannerwork/scanner-report/syntax-highlightings-33.pb +223 -0
- package/.scannerwork/scanner-report/syntax-highlightings-34.pb +95 -0
- package/.scannerwork/scanner-report/syntax-highlightings-35.pb +191 -0
- package/.scannerwork/scanner-report/syntax-highlightings-36.pb +331 -0
- package/.scannerwork/scanner-report/syntax-highlightings-37.pb +138 -0
- package/.scannerwork/scanner-report/syntax-highlightings-38.pb +948 -0
- package/.scannerwork/scanner-report/syntax-highlightings-4.pb +50 -0
- package/.scannerwork/scanner-report/syntax-highlightings-40.pb +3749 -0
- package/.scannerwork/scanner-report/syntax-highlightings-41.pb +45 -0
- package/.scannerwork/scanner-report/syntax-highlightings-42.pb +116 -0
- package/.scannerwork/scanner-report/syntax-highlightings-43.pb +90 -0
- package/.scannerwork/scanner-report/syntax-highlightings-44.pb +243 -0
- package/.scannerwork/scanner-report/syntax-highlightings-45.pb +78 -0
- package/.scannerwork/scanner-report/syntax-highlightings-46.pb +54 -0
- package/.scannerwork/scanner-report/syntax-highlightings-47.pb +50 -0
- package/.scannerwork/scanner-report/syntax-highlightings-48.pb +113 -0
- package/.scannerwork/scanner-report/syntax-highlightings-49.pb +129 -0
- package/.scannerwork/scanner-report/syntax-highlightings-5.pb +329 -0
- package/.scannerwork/scanner-report/syntax-highlightings-50.pb +285 -0
- package/.scannerwork/scanner-report/syntax-highlightings-51.pb +95 -0
- package/.scannerwork/scanner-report/syntax-highlightings-52.pb +133 -0
- package/.scannerwork/scanner-report/syntax-highlightings-53.pb +64 -0
- package/.scannerwork/scanner-report/syntax-highlightings-54.pb +213 -0
- package/.scannerwork/scanner-report/syntax-highlightings-55.pb +3746 -0
- package/.scannerwork/scanner-report/syntax-highlightings-57.pb +103 -0
- package/.scannerwork/scanner-report/syntax-highlightings-58.pb +82 -0
- package/.scannerwork/scanner-report/syntax-highlightings-59.pb +3747 -0
- package/.scannerwork/scanner-report/syntax-highlightings-6.pb +110 -0
- package/.scannerwork/scanner-report/syntax-highlightings-61.pb +3748 -0
- package/.scannerwork/scanner-report/syntax-highlightings-65.pb +225 -0
- package/.scannerwork/scanner-report/syntax-highlightings-66.pb +214 -0
- package/.scannerwork/scanner-report/syntax-highlightings-69.pb +648 -0
- package/.scannerwork/scanner-report/syntax-highlightings-7.pb +68 -0
- package/.secrets.baseline +6 -6
- package/CHANGES.md +3 -0
- package/package.json +1 -1
- package/test-14-results.xml +509 -0
- package/test-16-results.xml +509 -0
- package/test-18-results.xml +509 -0
- package/test-19-results.xml +509 -0
- package/test-iam-18-results.xml +167 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Copyright © 2017, 2021 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
// fatal errors
|
|
17
|
+
const codes = {
|
|
18
|
+
Error: 1,
|
|
19
|
+
InvalidOption: 2,
|
|
20
|
+
DatabaseNotFound: 10,
|
|
21
|
+
Unauthorized: 11,
|
|
22
|
+
Forbidden: 12,
|
|
23
|
+
DatabaseNotEmpty: 13,
|
|
24
|
+
NoLogFileName: 20,
|
|
25
|
+
LogDoesNotExist: 21,
|
|
26
|
+
IncompleteChangesInLogFile: 22,
|
|
27
|
+
SpoolChangesError: 30,
|
|
28
|
+
HTTPFatalError: 40,
|
|
29
|
+
BulkGetError: 50
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
class BackupError extends Error {
|
|
33
|
+
constructor(name, message) {
|
|
34
|
+
super(message);
|
|
35
|
+
this.name = name;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
class HTTPError extends BackupError {
|
|
40
|
+
constructor(responseError, name) {
|
|
41
|
+
// Special case some names for more useful error messages
|
|
42
|
+
switch (responseError.status) {
|
|
43
|
+
case 401:
|
|
44
|
+
name = 'Unauthorized';
|
|
45
|
+
break;
|
|
46
|
+
case 403:
|
|
47
|
+
name = 'Forbidden';
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
name = name || 'HTTPFatalError';
|
|
51
|
+
}
|
|
52
|
+
super(name, responseError.message);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Default function to return an error for HTTP status codes
|
|
57
|
+
// < 400 -> OK
|
|
58
|
+
// 4XX (except 429) -> Fatal
|
|
59
|
+
// 429 & >=500 -> Transient
|
|
60
|
+
function checkResponse(err) {
|
|
61
|
+
if (err) {
|
|
62
|
+
// Construct an HTTPError if there is request information on the error
|
|
63
|
+
// Codes < 400 are considered OK
|
|
64
|
+
if (err.status >= 400) {
|
|
65
|
+
return new HTTPError(err);
|
|
66
|
+
} else {
|
|
67
|
+
// Send it back again if there was no status code, e.g. a cxn error
|
|
68
|
+
return augmentMessage(err);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function convertResponseError(responseError, errorFactory) {
|
|
74
|
+
if (!errorFactory) {
|
|
75
|
+
errorFactory = checkResponse;
|
|
76
|
+
}
|
|
77
|
+
return errorFactory(responseError);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function augmentMessage(err) {
|
|
81
|
+
// For errors that don't have a status code, we are likely looking at a cxn
|
|
82
|
+
// error.
|
|
83
|
+
// Try to augment the message with more detail (core puts the code in statusText)
|
|
84
|
+
if (err && err.statusText) {
|
|
85
|
+
err.message = `${err.message} ${err.statusText}`;
|
|
86
|
+
}
|
|
87
|
+
if (err && err.description) {
|
|
88
|
+
err.message = `${err.message} ${err.description}`;
|
|
89
|
+
}
|
|
90
|
+
return err;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
module.exports = {
|
|
94
|
+
BackupError: BackupError,
|
|
95
|
+
HTTPError: HTTPError,
|
|
96
|
+
convertResponseError: convertResponseError,
|
|
97
|
+
terminationCallback: function terminationCallback(err, data) {
|
|
98
|
+
if (err) {
|
|
99
|
+
console.error(`ERROR: ${err.message}`);
|
|
100
|
+
process.exitCode = codes[err.name] || 1;
|
|
101
|
+
process.exit();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const stream = require('stream');
|
|
18
|
+
const liner = require('./liner.js');
|
|
19
|
+
|
|
20
|
+
const onLine = function(onCommand, getDocs) {
|
|
21
|
+
const change = new stream.Transform({ objectMode: true });
|
|
22
|
+
|
|
23
|
+
change._transform = function(line, encoding, done) {
|
|
24
|
+
if (line && line[0] === ':') {
|
|
25
|
+
const obj = {
|
|
26
|
+
command: null,
|
|
27
|
+
batch: null,
|
|
28
|
+
docs: []
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
let matches;
|
|
32
|
+
|
|
33
|
+
// extract command
|
|
34
|
+
matches = line.match(/^:([a-z_]+) ?/);
|
|
35
|
+
if (matches) {
|
|
36
|
+
obj.command = matches[1];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// extract batch
|
|
40
|
+
matches = line.match(/ batch([0-9]+)/);
|
|
41
|
+
if (matches) {
|
|
42
|
+
obj.batch = parseInt(matches[1]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// extract doc ids
|
|
46
|
+
if (getDocs && obj.command === 't') {
|
|
47
|
+
const json = line.replace(/^.* batch[0-9]+ /, '').trim();
|
|
48
|
+
obj.docs = JSON.parse(json);
|
|
49
|
+
}
|
|
50
|
+
onCommand(obj);
|
|
51
|
+
}
|
|
52
|
+
done();
|
|
53
|
+
};
|
|
54
|
+
return change;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Generate a list of remaining batches from a download file.
|
|
59
|
+
*
|
|
60
|
+
* @param {string} log - log file name
|
|
61
|
+
* @param {function} callback - callback with err, {changesComplete: N, batches: N}.
|
|
62
|
+
* changesComplete signifies whether the log file appeared to
|
|
63
|
+
* have completed reading the changes feed (contains :changes_complete).
|
|
64
|
+
* batches are remaining batch IDs for download.
|
|
65
|
+
*/
|
|
66
|
+
module.exports = function(log, callback) {
|
|
67
|
+
// our sense of state
|
|
68
|
+
const state = {
|
|
69
|
+
|
|
70
|
+
};
|
|
71
|
+
let changesComplete = false;
|
|
72
|
+
|
|
73
|
+
// called with each line from the log file
|
|
74
|
+
const onCommand = function(obj) {
|
|
75
|
+
if (obj.command === 't') {
|
|
76
|
+
state[obj.batch] = true;
|
|
77
|
+
} else if (obj.command === 'd') {
|
|
78
|
+
delete state[obj.batch];
|
|
79
|
+
} else if (obj.command === 'changes_complete') {
|
|
80
|
+
changesComplete = true;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// stream through the previous log file
|
|
85
|
+
fs.createReadStream(log)
|
|
86
|
+
.pipe(liner())
|
|
87
|
+
.pipe(onLine(onCommand, false))
|
|
88
|
+
.on('finish', function() {
|
|
89
|
+
const obj = { changesComplete: changesComplete, batches: state };
|
|
90
|
+
callback(null, obj);
|
|
91
|
+
});
|
|
92
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// Copyright © 2017, 2021 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const pkg = require('../package.json');
|
|
17
|
+
const stream = require('stream');
|
|
18
|
+
const { CloudantV1, CouchdbSessionAuthenticator } = require('@ibm-cloud/cloudant');
|
|
19
|
+
const { IamAuthenticator, NoAuthAuthenticator } = require('ibm-cloud-sdk-core');
|
|
20
|
+
const retryPlugin = require('retry-axios');
|
|
21
|
+
|
|
22
|
+
const userAgent = 'couchbackup-cloudant/' + pkg.version + ' (Node.js ' +
|
|
23
|
+
process.version + ')';
|
|
24
|
+
|
|
25
|
+
// Class for streaming _changes error responses into
|
|
26
|
+
// In general the response is a small error/reason JSON object
|
|
27
|
+
// so it is OK to have this in memory.
|
|
28
|
+
class ResponseWriteable extends stream.Writable {
|
|
29
|
+
constructor(options) {
|
|
30
|
+
super(options);
|
|
31
|
+
this.data = [];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_write(chunk, encoding, callback) {
|
|
35
|
+
this.data.push(chunk);
|
|
36
|
+
callback();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
stringBody() {
|
|
40
|
+
return Buffer.concat(this.data).toString();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// An interceptor function to help augment error bodies with a little
|
|
45
|
+
// extra information so we can continue to use consistent messaging
|
|
46
|
+
// after the ugprade to @ibm-cloud/cloudant
|
|
47
|
+
const errorHelper = async function(err) {
|
|
48
|
+
let method;
|
|
49
|
+
let requestUrl;
|
|
50
|
+
if (err.response) {
|
|
51
|
+
if (err.response.config.url) {
|
|
52
|
+
requestUrl = err.response.config.url;
|
|
53
|
+
method = err.response.config.method;
|
|
54
|
+
}
|
|
55
|
+
// Override the status text with an improved message
|
|
56
|
+
let errorMsg = `${err.response.status} ${err.response.statusText || ''}: ` +
|
|
57
|
+
`${method} ${requestUrl}`;
|
|
58
|
+
if (err.response.data) {
|
|
59
|
+
// Check if we have a JSON response and try to get the error/reason
|
|
60
|
+
if (err.response.headers['content-type'] === 'application/json') {
|
|
61
|
+
if (!err.response.data.error && err.response.data.pipe) {
|
|
62
|
+
// If we didn't find a JSON object with `error` then we might have a stream response.
|
|
63
|
+
// Detect the stream by the presence of `pipe` and use it to get the body and parse
|
|
64
|
+
// the error information.
|
|
65
|
+
const p = new Promise((resolve, reject) => {
|
|
66
|
+
const errorBody = new ResponseWriteable();
|
|
67
|
+
err.response.data.pipe(errorBody)
|
|
68
|
+
.on('finish', () => { resolve(JSON.parse(errorBody.stringBody())); })
|
|
69
|
+
.on('error', () => { reject(err); });
|
|
70
|
+
});
|
|
71
|
+
// Replace the stream on the response with the parsed object
|
|
72
|
+
err.response.data = await p;
|
|
73
|
+
}
|
|
74
|
+
// Append the error/reason if available
|
|
75
|
+
if (err.response.data.error) {
|
|
76
|
+
// Override the status text with our more complete message
|
|
77
|
+
errorMsg += ` - Error: ${err.response.data.error}`;
|
|
78
|
+
if (err.response.data.reason) {
|
|
79
|
+
errorMsg += `, Reason: ${err.response.data.reason}`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
errorMsg += err.response.data;
|
|
84
|
+
}
|
|
85
|
+
// Set a new message for use by the node-sdk-core
|
|
86
|
+
// We use the errors array because it gets processed
|
|
87
|
+
// ahead of all other service errors.
|
|
88
|
+
err.response.data.errors = [{ message: errorMsg }];
|
|
89
|
+
}
|
|
90
|
+
} else if (err.request) {
|
|
91
|
+
if (!err.message.includes(err.config.url)) {
|
|
92
|
+
// Augment the message with the URL and method
|
|
93
|
+
// but don't do it again if we already have the URL.
|
|
94
|
+
err.message = `${err.message}: ${err.config.method} ${err.config.url}`;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return Promise.reject(err);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
module.exports = {
|
|
101
|
+
client: function(rawUrl, opts) {
|
|
102
|
+
const url = new URL(rawUrl);
|
|
103
|
+
// Split the URL to separate service from database
|
|
104
|
+
// Use origin as the "base" to remove auth elements
|
|
105
|
+
const actUrl = new URL(url.pathname.substring(0, url.pathname.lastIndexOf('/')), url.origin);
|
|
106
|
+
const dbName = url.pathname.substring(url.pathname.lastIndexOf('/') + 1);
|
|
107
|
+
let authenticator;
|
|
108
|
+
// Default to cookieauth unless an IAM key is provided
|
|
109
|
+
if (opts.iamApiKey) {
|
|
110
|
+
const iamAuthOpts = { apikey: opts.iamApiKey };
|
|
111
|
+
if (opts.iamTokenUrl) {
|
|
112
|
+
iamAuthOpts.url = opts.iamTokenUrl;
|
|
113
|
+
}
|
|
114
|
+
authenticator = new IamAuthenticator(iamAuthOpts);
|
|
115
|
+
} else if (url.username) {
|
|
116
|
+
authenticator = new CouchdbSessionAuthenticator({
|
|
117
|
+
username: decodeURIComponent(url.username),
|
|
118
|
+
password: decodeURIComponent(url.password)
|
|
119
|
+
});
|
|
120
|
+
} else {
|
|
121
|
+
authenticator = new NoAuthAuthenticator();
|
|
122
|
+
}
|
|
123
|
+
const serviceOpts = {
|
|
124
|
+
authenticator: authenticator,
|
|
125
|
+
timeout: opts.requestTimeout,
|
|
126
|
+
// Axios performance options
|
|
127
|
+
maxContentLength: -1
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const service = new CloudantV1(serviceOpts);
|
|
131
|
+
// Configure retries
|
|
132
|
+
const maxRetries = 2; // for 3 total attempts
|
|
133
|
+
service.getHttpClient().defaults.raxConfig = {
|
|
134
|
+
// retries for status codes
|
|
135
|
+
retry: maxRetries,
|
|
136
|
+
// retries for non-response e.g. ETIMEDOUT
|
|
137
|
+
noResponseRetries: maxRetries,
|
|
138
|
+
backoffType: 'exponential',
|
|
139
|
+
httpMethodsToRetry: ['GET', 'HEAD', 'POST'],
|
|
140
|
+
statusCodesToRetry: [
|
|
141
|
+
[429, 429],
|
|
142
|
+
[500, 599]
|
|
143
|
+
],
|
|
144
|
+
shouldRetry: err => {
|
|
145
|
+
const cfg = retryPlugin.getConfig(err);
|
|
146
|
+
// cap at max retries regardless of response/non-response type
|
|
147
|
+
if (cfg.currentRetryAttempt >= maxRetries) {
|
|
148
|
+
return false;
|
|
149
|
+
} else {
|
|
150
|
+
return retryPlugin.shouldRetryRequest(err);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
instance: service.getHttpClient()
|
|
154
|
+
};
|
|
155
|
+
retryPlugin.attach(service.getHttpClient());
|
|
156
|
+
|
|
157
|
+
service.setServiceUrl(actUrl.toString());
|
|
158
|
+
if (authenticator instanceof CouchdbSessionAuthenticator) {
|
|
159
|
+
// Awkward workaround for known Couch issue with compression on _session requests
|
|
160
|
+
// It is not feasible to disable compression on all requests with the amount of
|
|
161
|
+
// data this lib needs to move, so override the property in the tokenManager instance.
|
|
162
|
+
authenticator.tokenManager.requestWrapperInstance.compressRequestData = false;
|
|
163
|
+
}
|
|
164
|
+
if (authenticator.tokenManager && authenticator.tokenManager.requestWrapperInstance) {
|
|
165
|
+
authenticator.tokenManager.requestWrapperInstance.axiosInstance.interceptors.response.use(null, errorHelper);
|
|
166
|
+
}
|
|
167
|
+
// Add error interceptors to put URLs in error messages
|
|
168
|
+
service.getHttpClient().interceptors.response.use(null, errorHelper);
|
|
169
|
+
|
|
170
|
+
// Add request interceptor to add user-agent (adding it with custom request headers gets overwritten)
|
|
171
|
+
service.getHttpClient().interceptors.request.use(function(requestConfig) {
|
|
172
|
+
requestConfig.headers['User-Agent'] = userAgent;
|
|
173
|
+
return requestConfig;
|
|
174
|
+
}, null);
|
|
175
|
+
|
|
176
|
+
return { service: service, db: dbName, url: actUrl.toString() };
|
|
177
|
+
}
|
|
178
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const stream = require('stream');
|
|
18
|
+
const liner = require('./liner.js');
|
|
19
|
+
|
|
20
|
+
const onLine = function(onCommand, batches) {
|
|
21
|
+
const change = new stream.Transform({ objectMode: true });
|
|
22
|
+
change._transform = function(line, encoding, done) {
|
|
23
|
+
if (line && line[0] === ':') {
|
|
24
|
+
const obj = {
|
|
25
|
+
command: null,
|
|
26
|
+
batch: null,
|
|
27
|
+
docs: []
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
let matches;
|
|
31
|
+
|
|
32
|
+
// extract command
|
|
33
|
+
matches = line.match(/^:([a-z_]+) ?/);
|
|
34
|
+
if (matches) {
|
|
35
|
+
obj.command = matches[1];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// extract batch
|
|
39
|
+
matches = line.match(/ batch([0-9]+)/);
|
|
40
|
+
if (matches) {
|
|
41
|
+
obj.batch = parseInt(matches[1]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// if this is one we want
|
|
45
|
+
if (obj.command === 't' && batches.indexOf(obj.batch) > -1) {
|
|
46
|
+
const json = line.replace(/^.* batch[0-9]+ /, '').trim();
|
|
47
|
+
obj.docs = JSON.parse(json);
|
|
48
|
+
onCommand(obj);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
done();
|
|
52
|
+
};
|
|
53
|
+
return change;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
module.exports = function(log, batches, callback) {
|
|
57
|
+
// our sense of state
|
|
58
|
+
const retval = { };
|
|
59
|
+
|
|
60
|
+
// called with each line from the log file
|
|
61
|
+
const onCommand = function(obj) {
|
|
62
|
+
retval[obj.batch] = obj;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// stream through the previous log file
|
|
66
|
+
fs.createReadStream(log)
|
|
67
|
+
.pipe(liner())
|
|
68
|
+
.pipe(onLine(onCommand, batches))
|
|
69
|
+
.on('error', function(err) {
|
|
70
|
+
callback(err);
|
|
71
|
+
})
|
|
72
|
+
.on('finish', function() {
|
|
73
|
+
callback(null, retval);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright © 2017, 2018 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Utility methods for the command line interface.
|
|
18
|
+
* @module cliutils
|
|
19
|
+
* @see module:cliutils
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const url = require('url');
|
|
23
|
+
|
|
24
|
+
module.exports = {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Combine a base URL and a database name, ensuring at least single slash
|
|
28
|
+
* between root and database name. This allows users to have Couch behind
|
|
29
|
+
* proxies that mount Couch's / endpoint at some other mount point.
|
|
30
|
+
* @param {string} root - root URL
|
|
31
|
+
* @param {string} databaseName - database name
|
|
32
|
+
* @return concatenated URL.
|
|
33
|
+
*
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
databaseUrl: function databaseUrl(root, databaseName) {
|
|
37
|
+
if (!root.endsWith('/')) {
|
|
38
|
+
root = root + '/';
|
|
39
|
+
}
|
|
40
|
+
return new url.URL(encodeURIComponent(databaseName), root).toString();
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Generate CLI argument usage text.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} description - argument description.
|
|
47
|
+
* @param {string} defaultValue - default argument value.
|
|
48
|
+
*
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
getUsage: function getUsage(description, defaultValue) {
|
|
52
|
+
return `${description} ${defaultValue !== undefined ? ` (default: ${defaultValue})` : ''}`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
// stolen from http://strongloop.com/strongblog/practical-examples-of-the-new-node-js-streams-api/
|
|
17
|
+
const stream = require('stream');
|
|
18
|
+
|
|
19
|
+
module.exports = function(onChange) {
|
|
20
|
+
const change = new stream.Transform({ objectMode: true });
|
|
21
|
+
|
|
22
|
+
change._transform = function(line, encoding, done) {
|
|
23
|
+
let obj = null;
|
|
24
|
+
|
|
25
|
+
// one change per line - remove the trailing comma
|
|
26
|
+
line = line.trim().replace(/,$/, '');
|
|
27
|
+
|
|
28
|
+
// extract thee last_seq at the end of the changes feed
|
|
29
|
+
if (line.match(/^"last_seq":/)) {
|
|
30
|
+
line = '{' + line;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
obj = JSON.parse(line);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
}
|
|
36
|
+
onChange(obj);
|
|
37
|
+
done();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return change;
|
|
41
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Copyright © 2017, 2021 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const path = require('path');
|
|
17
|
+
const tmp = require('tmp');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
Return API default settings.
|
|
21
|
+
*/
|
|
22
|
+
function apiDefaults() {
|
|
23
|
+
return {
|
|
24
|
+
parallelism: 5,
|
|
25
|
+
bufferSize: 500,
|
|
26
|
+
requestTimeout: 120000,
|
|
27
|
+
log: tmp.tmpNameSync(),
|
|
28
|
+
resume: false,
|
|
29
|
+
mode: 'full'
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
Return CLI default settings.
|
|
35
|
+
*/
|
|
36
|
+
function cliDefaults() {
|
|
37
|
+
const defaults = apiDefaults();
|
|
38
|
+
|
|
39
|
+
// add additional legacy settings
|
|
40
|
+
defaults.db = 'test';
|
|
41
|
+
defaults.url = 'http://localhost:5984';
|
|
42
|
+
|
|
43
|
+
// add CLI only option
|
|
44
|
+
defaults.quiet = false;
|
|
45
|
+
|
|
46
|
+
return defaults;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
Override settings **in-place** with environment variables.
|
|
51
|
+
*/
|
|
52
|
+
function applyEnvironmentVariables(opts) {
|
|
53
|
+
// if we have a custom CouchDB url
|
|
54
|
+
if (typeof process.env.COUCH_URL !== 'undefined') {
|
|
55
|
+
opts.url = process.env.COUCH_URL;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// if we have a specified databases
|
|
59
|
+
if (typeof process.env.COUCH_DATABASE !== 'undefined') {
|
|
60
|
+
opts.db = process.env.COUCH_DATABASE;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// if we have a specified buffer size
|
|
64
|
+
if (typeof process.env.COUCH_BUFFER_SIZE !== 'undefined') {
|
|
65
|
+
opts.bufferSize = parseInt(process.env.COUCH_BUFFER_SIZE);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// if we have a specified parallelism
|
|
69
|
+
if (typeof process.env.COUCH_PARALLELISM !== 'undefined') {
|
|
70
|
+
opts.parallelism = parseInt(process.env.COUCH_PARALLELISM);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// if we have a specified request timeout
|
|
74
|
+
if (typeof process.env.COUCH_REQUEST_TIMEOUT !== 'undefined') {
|
|
75
|
+
opts.requestTimeout = parseInt(process.env.COUCH_REQUEST_TIMEOUT);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// if we have a specified log file
|
|
79
|
+
if (typeof process.env.COUCH_LOG !== 'undefined') {
|
|
80
|
+
opts.log = path.normalize(process.env.COUCH_LOG);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// if we are instructed to resume
|
|
84
|
+
if (typeof process.env.COUCH_RESUME !== 'undefined' && process.env.COUCH_RESUME === 'true') {
|
|
85
|
+
opts.resume = true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// if we are given an output filename
|
|
89
|
+
if (typeof process.env.COUCH_OUTPUT !== 'undefined') {
|
|
90
|
+
opts.output = path.normalize(process.env.COUCH_OUTPUT);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// if we only want a shallow copy
|
|
94
|
+
if (typeof process.env.COUCH_MODE !== 'undefined' && process.env.COUCH_MODE === 'shallow') {
|
|
95
|
+
opts.mode = 'shallow';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// if we are instructed to be quiet
|
|
99
|
+
if (typeof process.env.COUCH_QUIET !== 'undefined' && process.env.COUCH_QUIET === 'true') {
|
|
100
|
+
opts.quiet = true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// if we have a specified API key
|
|
104
|
+
if (typeof process.env.CLOUDANT_IAM_API_KEY !== 'undefined') {
|
|
105
|
+
opts.iamApiKey = process.env.CLOUDANT_IAM_API_KEY;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// if we have a specified IAM token endpoint
|
|
109
|
+
if (typeof process.env.CLOUDANT_IAM_TOKEN_URL !== 'undefined') {
|
|
110
|
+
opts.iamTokenUrl = process.env.CLOUDANT_IAM_TOKEN_URL;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
module.exports = {
|
|
115
|
+
apiDefaults: apiDefaults,
|
|
116
|
+
cliDefaults: cliDefaults,
|
|
117
|
+
applyEnvironmentVariables: applyEnvironmentVariables
|
|
118
|
+
};
|