@cloudant/couchbackup 2.9.13 → 2.9.14-SNAPSHOT.147
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/report-task.txt +2 -2
- package/.scannerwork/scanner-report/analysis-warnings.pb +2 -2
- package/.scannerwork/scanner-report/analysis.log +1 -1
- package/.scannerwork/scanner-report/changesets-10.pb +2 -0
- package/.scannerwork/scanner-report/changesets-13.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-49.pb +1 -0
- package/.scannerwork/scanner-report/changesets-50.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-7.pb +1 -0
- package/.scannerwork/scanner-report/changesets-8.pb +1 -0
- package/.scannerwork/scanner-report/changesets-9.pb +1 -0
- package/.scannerwork/scanner-report/component-1.pb +2 -1
- package/.scannerwork/scanner-report/component-10.pb +2 -0
- package/.scannerwork/scanner-report/component-11.pb +1 -1
- package/.scannerwork/scanner-report/component-12.pb +1 -1
- package/.scannerwork/scanner-report/component-13.pb +1 -0
- package/.scannerwork/scanner-report/component-14.pb +1 -1
- package/.scannerwork/scanner-report/component-15.pb +1 -1
- package/.scannerwork/scanner-report/component-16.pb +1 -1
- package/.scannerwork/scanner-report/component-17.pb +1 -1
- package/.scannerwork/scanner-report/component-18.pb +1 -1
- package/.scannerwork/scanner-report/component-19.pb +1 -1
- package/.scannerwork/scanner-report/component-20.pb +1 -1
- package/.scannerwork/scanner-report/component-21.pb +1 -1
- package/.scannerwork/scanner-report/component-23.pb +1 -1
- 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-3.pb +1 -0
- package/.scannerwork/scanner-report/component-41.pb +1 -1
- package/.scannerwork/scanner-report/component-46.pb +1 -1
- package/.scannerwork/scanner-report/component-47.pb +1 -1
- package/.scannerwork/scanner-report/component-49.pb +1 -0
- package/.scannerwork/scanner-report/component-5.pb +1 -1
- package/.scannerwork/scanner-report/component-50.pb +1 -1
- package/.scannerwork/scanner-report/component-51.pb +1 -1
- package/.scannerwork/scanner-report/component-52.pb +1 -1
- package/.scannerwork/scanner-report/component-53.pb +1 -1
- package/.scannerwork/scanner-report/component-54.pb +1 -1
- package/.scannerwork/scanner-report/component-55.pb +1 -1
- package/.scannerwork/scanner-report/component-56.pb +1 -1
- package/.scannerwork/scanner-report/component-57.pb +1 -1
- package/.scannerwork/scanner-report/component-58.pb +1 -1
- package/.scannerwork/scanner-report/component-59.pb +1 -1
- package/.scannerwork/scanner-report/component-6.pb +1 -0
- package/.scannerwork/scanner-report/component-60.pb +1 -1
- package/.scannerwork/scanner-report/component-61.pb +1 -1
- package/.scannerwork/scanner-report/component-62.pb +1 -1
- package/.scannerwork/scanner-report/component-63.pb +1 -1
- package/.scannerwork/scanner-report/component-64.pb +1 -1
- package/.scannerwork/scanner-report/component-65.pb +1 -0
- package/.scannerwork/scanner-report/component-7.pb +1 -0
- package/.scannerwork/scanner-report/component-8.pb +1 -1
- package/.scannerwork/scanner-report/component-9.pb +1 -0
- package/.scannerwork/scanner-report/coverages-10.pb +0 -0
- package/.scannerwork/scanner-report/coverages-11.pb +0 -0
- package/.scannerwork/scanner-report/coverages-12.pb +0 -0
- package/.scannerwork/scanner-report/coverages-14.pb +0 -0
- package/.scannerwork/scanner-report/coverages-15.pb +0 -0
- package/.scannerwork/scanner-report/coverages-16.pb +0 -0
- package/.scannerwork/scanner-report/coverages-17.pb +0 -0
- package/.scannerwork/scanner-report/coverages-18.pb +0 -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-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-46.pb +0 -0
- package/.scannerwork/scanner-report/coverages-47.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-55.pb +0 -0
- package/.scannerwork/scanner-report/coverages-56.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-59.pb +0 -0
- package/.scannerwork/scanner-report/coverages-60.pb +0 -0
- package/.scannerwork/scanner-report/coverages-61.pb +0 -0
- package/.scannerwork/scanner-report/coverages-62.pb +0 -0
- package/.scannerwork/scanner-report/coverages-63.pb +0 -0
- package/.scannerwork/scanner-report/coverages-64.pb +0 -0
- package/.scannerwork/scanner-report/coverages-65.pb +0 -0
- package/.scannerwork/scanner-report/coverages-8.pb +0 -0
- package/.scannerwork/scanner-report/coverages-9.pb +0 -0
- package/.scannerwork/scanner-report/duplications-11.pb +0 -2
- package/.scannerwork/scanner-report/duplications-12.pb +0 -2
- package/.scannerwork/scanner-report/duplications-14.pb +3 -0
- package/.scannerwork/scanner-report/duplications-16.pb +2 -0
- package/.scannerwork/scanner-report/duplications-20.pb +3 -0
- package/.scannerwork/scanner-report/duplications-23.pb +0 -3
- package/.scannerwork/scanner-report/duplications-26.pb +3 -0
- package/.scannerwork/scanner-report/duplications-46.pb +2 -0
- package/.scannerwork/scanner-report/duplications-47.pb +2 -0
- package/.scannerwork/scanner-report/duplications-56.pb +2 -0
- package/.scannerwork/scanner-report/duplications-58.pb +2 -0
- package/.scannerwork/scanner-report/duplications-60.pb +0 -2
- package/.scannerwork/scanner-report/duplications-61.pb +0 -2
- package/.scannerwork/scanner-report/duplications-8.pb +0 -0
- package/.scannerwork/scanner-report/duplications-9.pb +0 -0
- package/.scannerwork/scanner-report/measures-10.pb +0 -0
- package/.scannerwork/scanner-report/measures-11.pb +0 -0
- package/.scannerwork/scanner-report/measures-12.pb +0 -0
- package/.scannerwork/scanner-report/measures-14.pb +0 -0
- package/.scannerwork/scanner-report/measures-15.pb +0 -0
- package/.scannerwork/scanner-report/measures-16.pb +0 -0
- package/.scannerwork/scanner-report/measures-17.pb +0 -0
- package/.scannerwork/scanner-report/measures-18.pb +0 -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 +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-3.pb +0 -0
- package/.scannerwork/scanner-report/measures-41.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-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-56.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-60.pb +0 -0
- package/.scannerwork/scanner-report/measures-61.pb +0 -0
- package/.scannerwork/scanner-report/measures-62.pb +0 -0
- package/.scannerwork/scanner-report/measures-63.pb +0 -0
- package/.scannerwork/scanner-report/measures-64.pb +0 -0
- package/.scannerwork/scanner-report/measures-65.pb +0 -0
- package/.scannerwork/scanner-report/measures-8.pb +0 -0
- package/.scannerwork/scanner-report/measures-9.pb +0 -0
- package/.scannerwork/scanner-report/metadata.pb +0 -0
- package/.scannerwork/scanner-report/source-10.txt +68 -0
- package/.scannerwork/scanner-report/source-11.txt +125 -153
- package/.scannerwork/scanner-report/source-12.txt +348 -172
- package/.scannerwork/scanner-report/source-14.txt +97 -46
- package/.scannerwork/scanner-report/source-15.txt +71 -79
- package/.scannerwork/scanner-report/source-16.txt +268 -11
- package/.scannerwork/scanner-report/source-17.txt +13 -40
- package/.scannerwork/scanner-report/source-18.txt +128 -40
- package/.scannerwork/scanner-report/source-19.txt +14 -15
- package/.scannerwork/scanner-report/source-20.txt +98 -592
- package/.scannerwork/scanner-report/source-21.txt +6 -96
- package/.scannerwork/scanner-report/source-23.txt +14 -224
- package/.scannerwork/scanner-report/source-24.txt +625 -0
- package/.scannerwork/scanner-report/source-25.txt +100 -0
- package/.scannerwork/scanner-report/source-26.txt +244 -0
- package/.scannerwork/scanner-report/source-27.txt +63 -0
- package/.scannerwork/scanner-report/source-3.txt +509 -0
- package/.scannerwork/scanner-report/source-41.txt +167 -29
- package/.scannerwork/scanner-report/source-46.txt +153 -125
- package/.scannerwork/scanner-report/source-47.txt +176 -42
- package/.scannerwork/scanner-report/source-49.txt +80 -0
- package/.scannerwork/scanner-report/source-5.txt +89 -393
- package/.scannerwork/scanner-report/source-50.txt +281 -509
- package/.scannerwork/scanner-report/source-51.txt +140 -17
- package/.scannerwork/scanner-report/source-52.txt +114 -16
- package/.scannerwork/scanner-report/source-53.txt +93 -153
- package/.scannerwork/scanner-report/source-54.txt +14 -29
- package/.scannerwork/scanner-report/source-55.txt +93 -111
- package/.scannerwork/scanner-report/source-56.txt +50 -256
- package/.scannerwork/scanner-report/source-57.txt +25 -97
- package/.scannerwork/scanner-report/source-58.txt +69 -81
- package/.scannerwork/scanner-report/source-59.txt +83 -59
- package/.scannerwork/scanner-report/source-60.txt +151 -48
- package/.scannerwork/scanner-report/source-61.txt +35 -73
- package/.scannerwork/scanner-report/source-62.txt +21 -34
- package/.scannerwork/scanner-report/source-63.txt +37 -92
- package/.scannerwork/scanner-report/source-64.txt +57 -144
- package/.scannerwork/scanner-report/source-65.txt +418 -0
- package/.scannerwork/scanner-report/source-8.txt +68 -167
- package/.scannerwork/scanner-report/{source-40.txt → source-9.txt} +15 -13
- package/.scannerwork/scanner-report/symbols-10.pb +45 -0
- package/.scannerwork/scanner-report/symbols-11.pb +85 -153
- package/.scannerwork/scanner-report/symbols-12.pb +494 -180
- package/.scannerwork/scanner-report/symbols-14.pb +76 -44
- package/.scannerwork/scanner-report/symbols-15.pb +58 -67
- package/.scannerwork/scanner-report/symbols-16.pb +486 -14
- package/.scannerwork/scanner-report/symbols-17.pb +11 -43
- package/.scannerwork/scanner-report/symbols-18.pb +110 -34
- package/.scannerwork/scanner-report/symbols-19.pb +17 -11
- package/.scannerwork/scanner-report/symbols-20.pb +94 -1251
- package/.scannerwork/scanner-report/symbols-21.pb +9 -77
- package/.scannerwork/scanner-report/symbols-23.pb +10 -394
- package/.scannerwork/scanner-report/symbols-24.pb +1254 -0
- package/.scannerwork/scanner-report/symbols-25.pb +69 -0
- package/.scannerwork/scanner-report/symbols-26.pb +394 -0
- package/.scannerwork/scanner-report/symbols-27.pb +43 -0
- package/.scannerwork/scanner-report/symbols-46.pb +153 -85
- package/.scannerwork/scanner-report/symbols-47.pb +180 -19
- package/.scannerwork/scanner-report/symbols-49.pb +46 -0
- package/.scannerwork/scanner-report/symbols-5.pb +28 -610
- package/.scannerwork/scanner-report/symbols-50.pb +354 -0
- package/.scannerwork/scanner-report/symbols-51.pb +126 -18
- package/.scannerwork/scanner-report/symbols-52.pb +33 -14
- package/.scannerwork/scanner-report/symbols-53.pb +30 -144
- package/.scannerwork/scanner-report/symbols-54.pb +13 -19
- package/.scannerwork/scanner-report/symbols-55.pb +59 -33
- package/.scannerwork/scanner-report/symbols-56.pb +42 -354
- package/.scannerwork/scanner-report/symbols-57.pb +20 -30
- package/.scannerwork/scanner-report/symbols-58.pb +42 -40
- package/.scannerwork/scanner-report/symbols-59.pb +41 -45
- package/.scannerwork/scanner-report/symbols-60.pb +143 -41
- package/.scannerwork/scanner-report/symbols-61.pb +13 -42
- package/.scannerwork/scanner-report/symbols-62.pb +15 -12
- package/.scannerwork/scanner-report/symbols-63.pb +18 -58
- package/.scannerwork/scanner-report/symbols-64.pb +30 -126
- package/.scannerwork/scanner-report/symbols-65.pb +610 -0
- package/.scannerwork/scanner-report/symbols-8.pb +36 -0
- package/.scannerwork/scanner-report/symbols-9.pb +14 -0
- package/.scannerwork/scanner-report/syntax-highlightings-10.pb +110 -0
- package/.scannerwork/scanner-report/syntax-highlightings-11.pb +150 -173
- package/.scannerwork/scanner-report/syntax-highlightings-12.pb +572 -167
- package/.scannerwork/scanner-report/syntax-highlightings-14.pb +121 -73
- package/.scannerwork/scanner-report/syntax-highlightings-15.pb +68 -63
- package/.scannerwork/scanner-report/syntax-highlightings-16.pb +626 -21
- package/.scannerwork/scanner-report/syntax-highlightings-17.pb +22 -45
- package/.scannerwork/scanner-report/syntax-highlightings-18.pb +185 -57
- package/.scannerwork/scanner-report/syntax-highlightings-19.pb +27 -23
- package/.scannerwork/scanner-report/syntax-highlightings-20.pb +147 -852
- package/.scannerwork/scanner-report/syntax-highlightings-21.pb +13 -123
- package/.scannerwork/scanner-report/syntax-highlightings-23.pb +14 -293
- package/.scannerwork/scanner-report/syntax-highlightings-24.pb +887 -0
- package/.scannerwork/scanner-report/syntax-highlightings-25.pb +105 -0
- package/.scannerwork/scanner-report/syntax-highlightings-26.pb +329 -0
- package/.scannerwork/scanner-report/syntax-highlightings-27.pb +82 -0
- package/.scannerwork/scanner-report/syntax-highlightings-3.pb +3747 -0
- package/.scannerwork/scanner-report/syntax-highlightings-41.pb +932 -31
- package/.scannerwork/scanner-report/syntax-highlightings-46.pb +173 -150
- package/.scannerwork/scanner-report/syntax-highlightings-47.pb +201 -58
- package/.scannerwork/scanner-report/syntax-highlightings-49.pb +95 -0
- package/.scannerwork/scanner-report/syntax-highlightings-5.pb +109 -619
- package/.scannerwork/scanner-report/syntax-highlightings-50.pb +199 -3661
- package/.scannerwork/scanner-report/syntax-highlightings-51.pb +180 -17
- package/.scannerwork/scanner-report/syntax-highlightings-52.pb +99 -15
- package/.scannerwork/scanner-report/syntax-highlightings-53.pb +78 -208
- package/.scannerwork/scanner-report/syntax-highlightings-54.pb +16 -35
- package/.scannerwork/scanner-report/syntax-highlightings-55.pb +89 -85
- package/.scannerwork/scanner-report/syntax-highlightings-56.pb +39 -246
- package/.scannerwork/scanner-report/syntax-highlightings-57.pb +31 -80
- package/.scannerwork/scanner-report/syntax-highlightings-58.pb +55 -81
- package/.scannerwork/scanner-report/syntax-highlightings-59.pb +81 -60
- package/.scannerwork/scanner-report/syntax-highlightings-60.pb +204 -39
- package/.scannerwork/scanner-report/syntax-highlightings-61.pb +21 -57
- package/.scannerwork/scanner-report/syntax-highlightings-62.pb +19 -23
- package/.scannerwork/scanner-report/syntax-highlightings-63.pb +57 -108
- package/.scannerwork/scanner-report/syntax-highlightings-64.pb +80 -190
- package/.scannerwork/scanner-report/syntax-highlightings-65.pb +648 -0
- package/.scannerwork/scanner-report/syntax-highlightings-8.pb +84 -938
- package/.scannerwork/scanner-report/syntax-highlightings-9.pb +54 -0
- package/package.json +2 -2
- package/test-18-results.xml +155 -155
- package/test-iam-18-results.xml +50 -50
- package/.scannerwork/scanner-report/changesets-2.pb +0 -1
- package/.scannerwork/scanner-report/changesets-35.pb +0 -1
- package/.scannerwork/scanner-report/changesets-36.pb +0 -1
- package/.scannerwork/scanner-report/changesets-37.pb +0 -1
- package/.scannerwork/scanner-report/changesets-38.pb +0 -1
- package/.scannerwork/scanner-report/changesets-39.pb +0 -1
- package/.scannerwork/scanner-report/changesets-40.pb +0 -1
- package/.scannerwork/scanner-report/changesets-41.pb +0 -1
- package/.scannerwork/scanner-report/changesets-42.pb +0 -1
- package/.scannerwork/scanner-report/changesets-43.pb +0 -1
- package/.scannerwork/scanner-report/changesets-44.pb +0 -1
- package/.scannerwork/scanner-report/changesets-45.pb +0 -1
- package/.scannerwork/scanner-report/changesets-48.pb +0 -1
- package/.scannerwork/scanner-report/component-2.pb +0 -1
- package/.scannerwork/scanner-report/component-35.pb +0 -1
- package/.scannerwork/scanner-report/component-36.pb +0 -1
- package/.scannerwork/scanner-report/component-37.pb +0 -1
- package/.scannerwork/scanner-report/component-38.pb +0 -1
- package/.scannerwork/scanner-report/component-39.pb +0 -1
- package/.scannerwork/scanner-report/component-40.pb +0 -1
- package/.scannerwork/scanner-report/component-42.pb +0 -1
- package/.scannerwork/scanner-report/component-43.pb +0 -1
- package/.scannerwork/scanner-report/component-44.pb +0 -1
- package/.scannerwork/scanner-report/component-45.pb +0 -1
- package/.scannerwork/scanner-report/component-48.pb +0 -1
- package/.scannerwork/scanner-report/coverages-2.pb +0 -0
- package/.scannerwork/scanner-report/coverages-35.pb +0 -0
- package/.scannerwork/scanner-report/coverages-38.pb +0 -0
- package/.scannerwork/scanner-report/coverages-40.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-48.pb +0 -0
- package/.scannerwork/scanner-report/duplications-21.pb +0 -3
- package/.scannerwork/scanner-report/duplications-42.pb +0 -3
- package/.scannerwork/scanner-report/duplications-45.pb +0 -2
- package/.scannerwork/scanner-report/measures-2.pb +0 -0
- package/.scannerwork/scanner-report/measures-35.pb +0 -0
- package/.scannerwork/scanner-report/measures-38.pb +0 -0
- package/.scannerwork/scanner-report/measures-40.pb +0 -0
- package/.scannerwork/scanner-report/measures-42.pb +0 -0
- package/.scannerwork/scanner-report/measures-43.pb +0 -0
- package/.scannerwork/scanner-report/measures-44.pb +0 -0
- package/.scannerwork/scanner-report/measures-45.pb +0 -15
- package/.scannerwork/scanner-report/measures-48.pb +0 -0
- package/.scannerwork/scanner-report/source-2.txt +0 -114
- package/.scannerwork/scanner-report/source-35.txt +0 -366
- package/.scannerwork/scanner-report/source-38.txt +0 -35
- package/.scannerwork/scanner-report/source-42.txt +0 -131
- package/.scannerwork/scanner-report/source-43.txt +0 -92
- package/.scannerwork/scanner-report/source-44.txt +0 -156
- package/.scannerwork/scanner-report/source-45.txt +0 -293
- package/.scannerwork/scanner-report/source-48.txt +0 -77
- package/.scannerwork/scanner-report/symbols-2.pb +0 -28
- package/.scannerwork/scanner-report/symbols-35.pb +0 -494
- package/.scannerwork/scanner-report/symbols-38.pb +0 -17
- package/.scannerwork/scanner-report/symbols-40.pb +0 -10
- package/.scannerwork/scanner-report/symbols-41.pb +0 -9
- package/.scannerwork/scanner-report/symbols-42.pb +0 -97
- package/.scannerwork/scanner-report/symbols-43.pb +0 -60
- package/.scannerwork/scanner-report/symbols-44.pb +0 -112
- package/.scannerwork/scanner-report/symbols-45.pb +0 -486
- package/.scannerwork/scanner-report/symbols-48.pb +0 -30
- package/.scannerwork/scanner-report/syntax-highlightings-2.pb +0 -138
- package/.scannerwork/scanner-report/syntax-highlightings-35.pb +0 -630
- package/.scannerwork/scanner-report/syntax-highlightings-38.pb +0 -63
- package/.scannerwork/scanner-report/syntax-highlightings-40.pb +0 -50
- package/.scannerwork/scanner-report/syntax-highlightings-42.pb +0 -182
- package/.scannerwork/scanner-report/syntax-highlightings-43.pb +0 -110
- package/.scannerwork/scanner-report/syntax-highlightings-44.pb +0 -223
- package/.scannerwork/scanner-report/syntax-highlightings-45.pb +0 -659
- package/.scannerwork/scanner-report/syntax-highlightings-48.pb +0 -103
- /package/.scannerwork/scanner-report/{coverages-36.pb → coverages-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-39.pb → coverages-6.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-37.pb → coverages-7.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-2.pb → duplications-10.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-35.pb → duplications-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-36.pb → duplications-24.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-38.pb → duplications-25.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-39.pb → duplications-27.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-40.pb → duplications-49.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-43.pb → duplications-50.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-44.pb → duplications-6.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-48.pb → duplications-65.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-37.pb → duplications-7.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-35.pb → issues-12.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-36.pb → issues-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-23.pb → issues-26.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-39.pb → issues-6.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-36.pb → measures-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-39.pb → measures-6.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-37.pb → measures-7.pb} +0 -0
- /package/.scannerwork/scanner-report/{source-36.txt → source-13.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-39.txt → source-6.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-37.txt → source-7.txt} +0 -0
- /package/.scannerwork/scanner-report/{symbols-36.pb → symbols-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-39.pb → symbols-6.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-37.pb → symbols-7.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-36.pb → syntax-highlightings-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-39.pb → syntax-highlightings-6.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-37.pb → syntax-highlightings-7.pb} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
1
|
+
// Copyright © 2017, 2021 IBM Corp. All rights reserved.
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -13,63 +13,166 @@
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const pkg = require('../package.json');
|
|
17
17
|
const stream = require('stream');
|
|
18
|
-
const
|
|
18
|
+
const { CloudantV1, CouchdbSessionAuthenticator } = require('@ibm-cloud/cloudant');
|
|
19
|
+
const { IamAuthenticator, NoAuthAuthenticator } = require('ibm-cloud-sdk-core');
|
|
20
|
+
const retryPlugin = require('retry-axios');
|
|
19
21
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
change._transform = function(line, encoding, done) {
|
|
23
|
-
if (line && line[0] === ':') {
|
|
24
|
-
const obj = {
|
|
25
|
-
command: null,
|
|
26
|
-
batch: null,
|
|
27
|
-
docs: []
|
|
28
|
-
};
|
|
22
|
+
const userAgent = 'couchbackup-cloudant/' + pkg.version + ' (Node.js ' +
|
|
23
|
+
process.version + ')';
|
|
29
24
|
|
|
30
|
-
|
|
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
|
+
}
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
34
|
+
_write(chunk, encoding, callback) {
|
|
35
|
+
this.data.push(chunk);
|
|
36
|
+
callback();
|
|
37
|
+
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
39
|
+
stringBody() {
|
|
40
|
+
return Buffer.concat(this.data).toString();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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;
|
|
49
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 }];
|
|
50
89
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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);
|
|
54
98
|
};
|
|
55
99
|
|
|
56
|
-
module.exports =
|
|
57
|
-
|
|
58
|
-
|
|
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);
|
|
59
169
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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);
|
|
64
175
|
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
});
|
|
176
|
+
return { service: service, db: dbName, url: actUrl.toString() };
|
|
177
|
+
}
|
|
75
178
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
1
|
+
// Copyright © 2017, 2018 IBM Corp. All rights reserved.
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -13,80 +13,42 @@
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
'use strict';
|
|
15
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
16
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @
|
|
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.
|
|
17
|
+
* Utility methods for the command line interface.
|
|
18
|
+
* @module cliutils
|
|
19
|
+
* @see module:cliutils
|
|
65
20
|
*/
|
|
66
|
-
module.exports = function(log, callback) {
|
|
67
|
-
// our sense of state
|
|
68
|
-
const state = {
|
|
69
21
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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 + '/';
|
|
81
39
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
+
}
|
|
92
54
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2017
|
|
1
|
+
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -13,42 +13,29 @@
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* @module cliutils
|
|
19
|
-
* @see module:cliutils
|
|
20
|
-
*/
|
|
16
|
+
// stolen from http://strongloop.com/strongblog/practical-examples-of-the-new-node-js-streams-api/
|
|
17
|
+
const stream = require('stream');
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
module.exports = function(onChange) {
|
|
20
|
+
const change = new stream.Transform({ objectMode: true });
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
change._transform = function(line, encoding, done) {
|
|
23
|
+
let obj = null;
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
databaseUrl: function databaseUrl(root, databaseName) {
|
|
37
|
-
if (!root.endsWith('/')) {
|
|
38
|
-
root = root + '/';
|
|
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) {
|
|
39
35
|
}
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
onChange(obj);
|
|
37
|
+
done();
|
|
38
|
+
};
|
|
42
39
|
|
|
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
|
-
}
|
|
40
|
+
return change;
|
|
54
41
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Copyright © 2017, 2021 IBM Corp. All rights reserved.
|
|
2
3
|
//
|
|
3
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -13,99 +14,43 @@
|
|
|
13
14
|
// limitations under the License.
|
|
14
15
|
'use strict';
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const debug = require('debug')
|
|
17
|
+
const error = require('../includes/error.js');
|
|
18
|
+
const cliutils = require('../includes/cliutils.js');
|
|
19
|
+
const couchbackup = require('../app.js');
|
|
20
|
+
const parser = require('../includes/parser.js');
|
|
21
|
+
const debug = require('debug');
|
|
22
|
+
const restoreDebug = debug('couchbackup:restore');
|
|
23
|
+
const restoreBatchDebug = debug('couchbackup:restore:batch');
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
* Write log file for all changes from a database, ready for downloading
|
|
24
|
-
* in batches.
|
|
25
|
-
*
|
|
26
|
-
* @param {string} dbUrl - URL of database
|
|
27
|
-
* @param {string} log - path to log file to use
|
|
28
|
-
* @param {number} bufferSize - the number of changes per batch/log line
|
|
29
|
-
* @param {function(err)} callback - a callback to run on completion
|
|
30
|
-
*/
|
|
31
|
-
module.exports = function(db, log, bufferSize, ee, callback) {
|
|
32
|
-
// list of document ids to process
|
|
33
|
-
const buffer = [];
|
|
34
|
-
let batch = 0;
|
|
35
|
-
let lastSeq = null;
|
|
36
|
-
const logStream = fs.createWriteStream(log);
|
|
37
|
-
let pending = 0;
|
|
38
|
-
// The number of changes to fetch per request
|
|
39
|
-
const limit = 100000;
|
|
25
|
+
restoreDebug.enabled = true;
|
|
40
26
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
27
|
+
const program = parser.parseRestoreArgs();
|
|
28
|
+
const databaseUrl = cliutils.databaseUrl(program.url, program.db);
|
|
29
|
+
const opts = {
|
|
30
|
+
bufferSize: program.bufferSize,
|
|
31
|
+
parallelism: program.parallelism,
|
|
32
|
+
requestTimeout: program.requestTimeout,
|
|
33
|
+
iamApiKey: program.iamApiKey,
|
|
34
|
+
iamTokenUrl: program.iamTokenUrl
|
|
35
|
+
};
|
|
51
36
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} else if (c.changes) {
|
|
58
|
-
const obj = { id: c.id };
|
|
59
|
-
buffer.push(obj);
|
|
60
|
-
processBuffer(false);
|
|
61
|
-
} else if (c.last_seq) {
|
|
62
|
-
lastSeq = c.last_seq;
|
|
63
|
-
pending = c.pending;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
37
|
+
// log configuration to console
|
|
38
|
+
console.error('='.repeat(80));
|
|
39
|
+
console.error('Performing restore on ' + databaseUrl.replace(/\/\/.+@/g, '//****:****@') + ' using configuration:');
|
|
40
|
+
console.error(JSON.stringify(opts, null, 2).replace(/"iamApiKey": "[^"]+"/, '"iamApiKey": "****"'));
|
|
41
|
+
console.error('='.repeat(80));
|
|
67
42
|
|
|
68
|
-
|
|
69
|
-
debug('making changes request since ' + since);
|
|
70
|
-
return db.service.postChangesAsStream({ db: db.db, since: since, limit: limit, seqInterval: limit })
|
|
71
|
-
.then(response => {
|
|
72
|
-
response.result.pipe(liner())
|
|
73
|
-
.on('error', function(err) {
|
|
74
|
-
logStream.end();
|
|
75
|
-
callback(err);
|
|
76
|
-
})
|
|
77
|
-
.pipe(change(onChange))
|
|
78
|
-
.on('error', function(err) {
|
|
79
|
-
logStream.end();
|
|
80
|
-
callback(err);
|
|
81
|
-
})
|
|
82
|
-
.on('finish', function() {
|
|
83
|
-
processBuffer(true);
|
|
84
|
-
if (!lastSeq) {
|
|
85
|
-
logStream.end();
|
|
86
|
-
debug('changes request terminated before last_seq was sent');
|
|
87
|
-
callback(new error.BackupError('SpoolChangesError', 'Changes request terminated before last_seq was sent'));
|
|
88
|
-
} else {
|
|
89
|
-
debug(`changes request completed with last_seq: ${lastSeq} and ${pending} changes pending.`);
|
|
90
|
-
if (pending > 0) {
|
|
91
|
-
// Return the next promise
|
|
92
|
-
return getChanges(lastSeq);
|
|
93
|
-
} else {
|
|
94
|
-
debug('finished streaming database changes');
|
|
95
|
-
logStream.end(':changes_complete ' + lastSeq + '\n', 'utf8', callback);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
})
|
|
100
|
-
.catch(err => {
|
|
101
|
-
logStream.end();
|
|
102
|
-
if (err.status && err.status >= 400) {
|
|
103
|
-
callback(error.convertResponseError(err));
|
|
104
|
-
} else if (err.name !== 'SpoolChangesError') {
|
|
105
|
-
callback(new error.BackupError('SpoolChangesError', `Failed changes request - ${err.message}`));
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
43
|
+
restoreBatchDebug.enabled = !program.quiet;
|
|
109
44
|
|
|
110
|
-
|
|
111
|
-
|
|
45
|
+
return couchbackup.restore(
|
|
46
|
+
process.stdin, // restore from stdin
|
|
47
|
+
databaseUrl,
|
|
48
|
+
opts,
|
|
49
|
+
error.terminationCallback
|
|
50
|
+
).on('restored', function(obj) {
|
|
51
|
+
restoreBatchDebug('restored', obj.total);
|
|
52
|
+
}).on('error', function(e) {
|
|
53
|
+
restoreDebug('ERROR', e);
|
|
54
|
+
}).on('finished', function(obj) {
|
|
55
|
+
restoreDebug('finished', obj);
|
|
56
|
+
});
|