@cloudant/couchbackup 2.9.8 → 2.9.9-SNAPSHOT.101
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-11.pb +1 -0
- package/.scannerwork/scanner-report/changesets-12.pb +1 -0
- package/.scannerwork/scanner-report/changesets-13.pb +1 -0
- package/.scannerwork/scanner-report/changesets-14.pb +1 -0
- package/.scannerwork/scanner-report/changesets-15.pb +1 -0
- package/.scannerwork/scanner-report/changesets-16.pb +1 -0
- package/.scannerwork/scanner-report/changesets-17.pb +1 -0
- package/.scannerwork/scanner-report/changesets-18.pb +1 -0
- package/.scannerwork/scanner-report/changesets-2.pb +1 -0
- package/.scannerwork/scanner-report/changesets-3.pb +1 -0
- package/.scannerwork/scanner-report/changesets-38.pb +1 -0
- package/.scannerwork/scanner-report/changesets-39.pb +1 -0
- package/.scannerwork/scanner-report/changesets-40.pb +1 -0
- package/.scannerwork/scanner-report/changesets-55.pb +1 -0
- package/.scannerwork/scanner-report/changesets-56.pb +1 -0
- package/.scannerwork/scanner-report/changesets-59.pb +1 -0
- package/.scannerwork/scanner-report/changesets-60.pb +1 -0
- package/.scannerwork/scanner-report/changesets-61.pb +1 -0
- package/.scannerwork/scanner-report/changesets-62.pb +1 -0
- package/.scannerwork/scanner-report/changesets-63.pb +1 -0
- package/.scannerwork/scanner-report/changesets-64.pb +1 -0
- package/.scannerwork/scanner-report/changesets-67.pb +1 -0
- package/.scannerwork/scanner-report/changesets-68.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 -0
- package/.scannerwork/scanner-report/component-12.pb +1 -0
- package/.scannerwork/scanner-report/component-13.pb +1 -0
- package/.scannerwork/scanner-report/component-14.pb +1 -0
- package/.scannerwork/scanner-report/component-15.pb +1 -0
- package/.scannerwork/scanner-report/component-16.pb +1 -0
- package/.scannerwork/scanner-report/component-17.pb +1 -0
- package/.scannerwork/scanner-report/component-18.pb +1 -0
- package/.scannerwork/scanner-report/component-19.pb +1 -1
- package/.scannerwork/scanner-report/component-2.pb +1 -0
- package/.scannerwork/scanner-report/component-20.pb +1 -1
- package/.scannerwork/scanner-report/component-21.pb +1 -1
- package/.scannerwork/scanner-report/component-22.pb +1 -1
- package/.scannerwork/scanner-report/component-23.pb +1 -1
- package/.scannerwork/scanner-report/component-24.pb +1 -1
- package/.scannerwork/scanner-report/component-25.pb +1 -1
- package/.scannerwork/scanner-report/component-27.pb +1 -1
- package/.scannerwork/scanner-report/component-3.pb +1 -0
- package/.scannerwork/scanner-report/component-30.pb +1 -1
- package/.scannerwork/scanner-report/component-31.pb +1 -1
- package/.scannerwork/scanner-report/component-33.pb +1 -1
- package/.scannerwork/scanner-report/component-34.pb +1 -1
- package/.scannerwork/scanner-report/component-36.pb +1 -1
- package/.scannerwork/scanner-report/component-37.pb +1 -1
- package/.scannerwork/scanner-report/component-38.pb +1 -1
- package/.scannerwork/scanner-report/component-39.pb +1 -0
- package/.scannerwork/scanner-report/component-4.pb +1 -1
- package/.scannerwork/scanner-report/component-40.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 -0
- 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-60.pb +1 -0
- package/.scannerwork/scanner-report/component-61.pb +1 -1
- package/.scannerwork/scanner-report/component-62.pb +1 -0
- package/.scannerwork/scanner-report/component-63.pb +1 -0
- package/.scannerwork/scanner-report/component-64.pb +1 -0
- package/.scannerwork/scanner-report/component-65.pb +1 -1
- package/.scannerwork/scanner-report/component-66.pb +1 -1
- package/.scannerwork/scanner-report/component-67.pb +1 -0
- package/.scannerwork/scanner-report/component-68.pb +1 -0
- package/.scannerwork/scanner-report/component-69.pb +1 -1
- package/.scannerwork/scanner-report/coverages-12.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-2.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-3.pb +0 -0
- package/.scannerwork/scanner-report/coverages-30.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-36.pb +0 -0
- package/.scannerwork/scanner-report/coverages-37.pb +0 -0
- package/.scannerwork/scanner-report/coverages-38.pb +0 -0
- package/.scannerwork/scanner-report/coverages-4.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-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-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-66.pb +0 -0
- package/.scannerwork/scanner-report/duplications-17.pb +2 -0
- package/.scannerwork/scanner-report/duplications-19.pb +1 -2
- package/.scannerwork/scanner-report/duplications-21.pb +0 -2
- package/.scannerwork/scanner-report/duplications-22.pb +0 -3
- package/.scannerwork/scanner-report/duplications-3.pb +2 -0
- package/.scannerwork/scanner-report/duplications-36.pb +0 -2
- package/.scannerwork/scanner-report/duplications-38.pb +3 -0
- package/.scannerwork/scanner-report/duplications-4.pb +2 -0
- package/.scannerwork/scanner-report/duplications-54.pb +2 -0
- package/.scannerwork/scanner-report/duplications-60.pb +2 -0
- package/.scannerwork/scanner-report/duplications-63.pb +3 -0
- package/.scannerwork/scanner-report/duplications-65.pb +0 -2
- package/.scannerwork/scanner-report/duplications-66.pb +0 -2
- package/.scannerwork/scanner-report/measures-10.pb +0 -0
- package/.scannerwork/scanner-report/measures-12.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-2.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-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-27.pb +0 -0
- package/.scannerwork/scanner-report/measures-3.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-33.pb +0 -0
- package/.scannerwork/scanner-report/measures-34.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-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 +15 -0
- package/.scannerwork/scanner-report/measures-61.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-66.pb +0 -0
- package/.scannerwork/scanner-report/measures-67.pb +0 -0
- package/.scannerwork/scanner-report/measures-68.pb +0 -0
- package/.scannerwork/scanner-report/measures-69.pb +0 -0
- package/.scannerwork/scanner-report/metadata.pb +0 -0
- package/.scannerwork/scanner-report/source-10.txt +167 -0
- package/.scannerwork/scanner-report/source-12.txt +164 -0
- package/.scannerwork/scanner-report/source-18.txt +111 -0
- package/.scannerwork/scanner-report/source-19.txt +71 -110
- package/.scannerwork/scanner-report/source-2.txt +114 -0
- package/.scannerwork/scanner-report/source-20.txt +25 -19
- package/.scannerwork/scanner-report/source-21.txt +105 -269
- package/.scannerwork/scanner-report/source-22.txt +57 -96
- package/.scannerwork/scanner-report/source-23.txt +40 -78
- package/.scannerwork/scanner-report/source-24.txt +19 -598
- package/.scannerwork/scanner-report/source-25.txt +509 -29
- package/.scannerwork/scanner-report/source-27.txt +509 -36
- package/.scannerwork/scanner-report/source-3.txt +190 -0
- package/.scannerwork/scanner-report/source-30.txt +399 -17
- package/.scannerwork/scanner-report/source-31.txt +509 -100
- package/.scannerwork/scanner-report/source-33.txt +52 -131
- package/.scannerwork/scanner-report/source-34.txt +36 -48
- package/.scannerwork/scanner-report/source-36.txt +25 -203
- package/.scannerwork/scanner-report/source-37.txt +121 -93
- package/.scannerwork/scanner-report/source-38.txt +119 -167
- package/.scannerwork/scanner-report/source-4.txt +158 -17
- package/.scannerwork/scanner-report/source-40.txt +244 -509
- package/.scannerwork/scanner-report/source-52.txt +599 -85
- package/.scannerwork/scanner-report/source-53.txt +47 -30
- package/.scannerwork/scanner-report/source-54.txt +202 -141
- package/.scannerwork/scanner-report/source-55.txt +68 -509
- package/.scannerwork/scanner-report/source-56.txt +36 -0
- package/.scannerwork/scanner-report/source-57.txt +20 -62
- package/.scannerwork/scanner-report/source-58.txt +140 -40
- package/.scannerwork/scanner-report/source-59.txt +34 -509
- package/.scannerwork/scanner-report/source-60.txt +293 -0
- package/.scannerwork/scanner-report/source-61.txt +366 -509
- package/.scannerwork/scanner-report/source-63.txt +131 -0
- package/.scannerwork/scanner-report/source-64.txt +92 -0
- package/.scannerwork/scanner-report/source-65.txt +80 -170
- package/.scannerwork/scanner-report/source-66.txt +46 -153
- package/.scannerwork/scanner-report/source-67.txt +36 -0
- package/.scannerwork/scanner-report/source-68.txt +29 -0
- package/.scannerwork/scanner-report/source-69.txt +509 -418
- package/.scannerwork/scanner-report/symbols-12.pb +126 -0
- package/.scannerwork/scanner-report/symbols-18.pb +59 -0
- package/.scannerwork/scanner-report/symbols-19.pb +44 -97
- package/.scannerwork/scanner-report/symbols-2.pb +28 -0
- package/.scannerwork/scanner-report/symbols-20.pb +17 -16
- package/.scannerwork/scanner-report/symbols-21.pb +33 -486
- package/.scannerwork/scanner-report/symbols-22.pb +41 -72
- package/.scannerwork/scanner-report/symbols-23.pb +15 -60
- package/.scannerwork/scanner-report/symbols-24.pb +19 -1253
- package/.scannerwork/scanner-report/symbols-3.pb +180 -0
- package/.scannerwork/scanner-report/symbols-30.pb +610 -14
- package/.scannerwork/scanner-report/symbols-33.pb +29 -111
- package/.scannerwork/scanner-report/symbols-34.pb +18 -35
- package/.scannerwork/scanner-report/symbols-36.pb +26 -417
- package/.scannerwork/scanner-report/symbols-37.pb +116 -28
- package/.scannerwork/scanner-report/symbols-38.pb +77 -0
- package/.scannerwork/scanner-report/symbols-4.pb +152 -9
- package/.scannerwork/scanner-report/symbols-52.pb +1251 -56
- package/.scannerwork/scanner-report/symbols-53.pb +42 -19
- package/.scannerwork/scanner-report/symbols-54.pb +417 -125
- package/.scannerwork/scanner-report/symbols-56.pb +14 -0
- package/.scannerwork/scanner-report/symbols-57.pb +16 -29
- package/.scannerwork/scanner-report/symbols-58.pb +111 -18
- package/.scannerwork/scanner-report/symbols-59.pb +10 -0
- package/.scannerwork/scanner-report/symbols-60.pb +486 -0
- package/.scannerwork/scanner-report/symbols-63.pb +97 -0
- package/.scannerwork/scanner-report/symbols-64.pb +60 -0
- package/.scannerwork/scanner-report/symbols-65.pb +69 -180
- package/.scannerwork/scanner-report/symbols-66.pb +35 -152
- package/.scannerwork/scanner-report/syntax-highlightings-10.pb +949 -0
- package/.scannerwork/scanner-report/syntax-highlightings-12.pb +213 -0
- package/.scannerwork/scanner-report/syntax-highlightings-18.pb +133 -0
- package/.scannerwork/scanner-report/syntax-highlightings-19.pb +57 -149
- package/.scannerwork/scanner-report/syntax-highlightings-2.pb +138 -0
- package/.scannerwork/scanner-report/syntax-highlightings-20.pb +20 -33
- package/.scannerwork/scanner-report/syntax-highlightings-21.pb +91 -621
- package/.scannerwork/scanner-report/syntax-highlightings-22.pb +58 -121
- package/.scannerwork/scanner-report/syntax-highlightings-23.pb +22 -78
- package/.scannerwork/scanner-report/syntax-highlightings-24.pb +33 -856
- package/.scannerwork/scanner-report/syntax-highlightings-25.pb +3731 -31
- package/.scannerwork/scanner-report/syntax-highlightings-27.pb +3738 -48
- package/.scannerwork/scanner-report/syntax-highlightings-3.pb +225 -0
- package/.scannerwork/scanner-report/syntax-highlightings-30.pb +619 -25
- package/.scannerwork/scanner-report/syntax-highlightings-31.pb +3737 -94
- package/.scannerwork/scanner-report/syntax-highlightings-33.pb +74 -194
- package/.scannerwork/scanner-report/syntax-highlightings-34.pb +61 -74
- package/.scannerwork/scanner-report/syntax-highlightings-36.pb +28 -291
- package/.scannerwork/scanner-report/syntax-highlightings-37.pb +99 -103
- package/.scannerwork/scanner-report/syntax-highlightings-38.pb +147 -937
- package/.scannerwork/scanner-report/syntax-highlightings-4.pb +185 -21
- package/.scannerwork/scanner-report/syntax-highlightings-40.pb +222 -3642
- package/.scannerwork/scanner-report/syntax-highlightings-52.pb +845 -91
- package/.scannerwork/scanner-report/syntax-highlightings-53.pb +51 -33
- package/.scannerwork/scanner-report/syntax-highlightings-54.pb +286 -168
- package/.scannerwork/scanner-report/syntax-highlightings-55.pb +99 -3735
- package/.scannerwork/scanner-report/syntax-highlightings-56.pb +54 -0
- package/.scannerwork/scanner-report/syntax-highlightings-57.pb +42 -82
- package/.scannerwork/scanner-report/syntax-highlightings-58.pb +196 -55
- package/.scannerwork/scanner-report/syntax-highlightings-59.pb +32 -3729
- package/.scannerwork/scanner-report/syntax-highlightings-60.pb +659 -0
- package/.scannerwork/scanner-report/syntax-highlightings-61.pb +385 -3503
- package/.scannerwork/scanner-report/syntax-highlightings-63.pb +182 -0
- package/.scannerwork/scanner-report/syntax-highlightings-64.pb +110 -0
- package/.scannerwork/scanner-report/syntax-highlightings-65.pb +67 -187
- package/.scannerwork/scanner-report/syntax-highlightings-66.pb +64 -183
- package/.scannerwork/scanner-report/syntax-highlightings-67.pb +59 -0
- package/.scannerwork/scanner-report/syntax-highlightings-68.pb +48 -0
- package/.scannerwork/scanner-report/syntax-highlightings-69.pb +3545 -445
- package/package.json +5 -5
- package/test-14-results.xml +155 -155
- package/test-16-results.xml +147 -147
- package/test-18-results.xml +158 -158
- package/test-19-results.xml +150 -150
- package/test-iam-18-results.xml +50 -50
- package/.scannerwork/scanner-report/changesets-25.pb +0 -1
- package/.scannerwork/scanner-report/changesets-26.pb +0 -1
- package/.scannerwork/scanner-report/changesets-27.pb +0 -1
- package/.scannerwork/scanner-report/changesets-28.pb +0 -1
- package/.scannerwork/scanner-report/changesets-29.pb +0 -1
- package/.scannerwork/scanner-report/changesets-31.pb +0 -1
- package/.scannerwork/scanner-report/changesets-32.pb +0 -1
- package/.scannerwork/scanner-report/changesets-35.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-46.pb +0 -1
- package/.scannerwork/scanner-report/changesets-47.pb +0 -1
- package/.scannerwork/scanner-report/changesets-48.pb +0 -1
- package/.scannerwork/scanner-report/changesets-49.pb +0 -1
- package/.scannerwork/scanner-report/changesets-5.pb +0 -1
- package/.scannerwork/scanner-report/changesets-50.pb +0 -1
- package/.scannerwork/scanner-report/changesets-51.pb +0 -1
- package/.scannerwork/scanner-report/changesets-6.pb +0 -1
- package/.scannerwork/scanner-report/changesets-69.pb +0 -1
- package/.scannerwork/scanner-report/changesets-7.pb +0 -1
- package/.scannerwork/scanner-report/component-26.pb +0 -1
- package/.scannerwork/scanner-report/component-28.pb +0 -1
- package/.scannerwork/scanner-report/component-29.pb +0 -1
- package/.scannerwork/scanner-report/component-32.pb +0 -1
- package/.scannerwork/scanner-report/component-35.pb +0 -1
- package/.scannerwork/scanner-report/component-41.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-46.pb +0 -1
- package/.scannerwork/scanner-report/component-47.pb +0 -1
- package/.scannerwork/scanner-report/component-48.pb +0 -1
- package/.scannerwork/scanner-report/component-49.pb +0 -1
- package/.scannerwork/scanner-report/component-5.pb +0 -1
- package/.scannerwork/scanner-report/component-50.pb +0 -1
- package/.scannerwork/scanner-report/component-51.pb +0 -1
- package/.scannerwork/scanner-report/component-6.pb +0 -1
- package/.scannerwork/scanner-report/component-7.pb +0 -1
- package/.scannerwork/scanner-report/coverages-26.pb +0 -0
- package/.scannerwork/scanner-report/coverages-28.pb +0 -0
- package/.scannerwork/scanner-report/coverages-31.pb +0 -0
- package/.scannerwork/scanner-report/coverages-43.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-51.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-43.pb +0 -2
- package/.scannerwork/scanner-report/duplications-45.pb +0 -2
- package/.scannerwork/scanner-report/duplications-6.pb +0 -0
- package/.scannerwork/scanner-report/duplications-69.pb +0 -0
- package/.scannerwork/scanner-report/duplications-7.pb +0 -0
- package/.scannerwork/scanner-report/measures-26.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-43.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-51.pb +0 -0
- package/.scannerwork/scanner-report/measures-6.pb +0 -0
- package/.scannerwork/scanner-report/measures-7.pb +0 -0
- package/.scannerwork/scanner-report/source-26.txt +0 -63
- package/.scannerwork/scanner-report/source-28.txt +0 -142
- package/.scannerwork/scanner-report/source-29.txt +0 -366
- package/.scannerwork/scanner-report/source-43.txt +0 -92
- package/.scannerwork/scanner-report/source-46.txt +0 -54
- package/.scannerwork/scanner-report/source-47.txt +0 -41
- package/.scannerwork/scanner-report/source-49.txt +0 -129
- package/.scannerwork/scanner-report/source-5.txt +0 -244
- package/.scannerwork/scanner-report/source-51.txt +0 -80
- package/.scannerwork/scanner-report/source-6.txt +0 -68
- package/.scannerwork/scanner-report/source-7.txt +0 -47
- package/.scannerwork/scanner-report/symbols-26.pb +0 -43
- package/.scannerwork/scanner-report/symbols-28.pb +0 -116
- package/.scannerwork/scanner-report/symbols-31.pb +0 -69
- package/.scannerwork/scanner-report/symbols-43.pb +0 -44
- package/.scannerwork/scanner-report/symbols-46.pb +0 -15
- package/.scannerwork/scanner-report/symbols-47.pb +0 -18
- package/.scannerwork/scanner-report/symbols-49.pb +0 -33
- package/.scannerwork/scanner-report/symbols-51.pb +0 -46
- package/.scannerwork/scanner-report/symbols-69.pb +0 -610
- package/.scannerwork/scanner-report/symbols-7.pb +0 -27
- package/.scannerwork/scanner-report/syntax-highlightings-26.pb +0 -82
- package/.scannerwork/scanner-report/syntax-highlightings-28.pb +0 -134
- package/.scannerwork/scanner-report/syntax-highlightings-29.pb +0 -630
- package/.scannerwork/scanner-report/syntax-highlightings-43.pb +0 -90
- package/.scannerwork/scanner-report/syntax-highlightings-46.pb +0 -54
- package/.scannerwork/scanner-report/syntax-highlightings-47.pb +0 -50
- package/.scannerwork/scanner-report/syntax-highlightings-49.pb +0 -129
- package/.scannerwork/scanner-report/syntax-highlightings-5.pb +0 -329
- package/.scannerwork/scanner-report/syntax-highlightings-51.pb +0 -95
- package/.scannerwork/scanner-report/syntax-highlightings-6.pb +0 -110
- package/.scannerwork/scanner-report/syntax-highlightings-7.pb +0 -68
- /package/.scannerwork/scanner-report/{coverages-48.pb → coverages-11.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-42.pb → coverages-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-44.pb → coverages-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-50.pb → coverages-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-41.pb → coverages-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-45.pb → coverages-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-35.pb → coverages-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-5.pb → coverages-40.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-6.pb → coverages-55.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-29.pb → coverages-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-32.pb → coverages-62.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-27.pb → coverages-67.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-25.pb → coverages-68.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-26.pb → duplications-11.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-27.pb → duplications-12.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-28.pb → duplications-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-29.pb → duplications-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-31.pb → duplications-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-35.pb → duplications-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-41.pb → duplications-18.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-42.pb → duplications-2.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-44.pb → duplications-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-5.pb → duplications-40.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-46.pb → duplications-55.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-47.pb → duplications-56.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-48.pb → duplications-59.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-49.pb → duplications-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-32.pb → duplications-62.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-50.pb → duplications-64.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-51.pb → duplications-67.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-7.pb → issues-36.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-28.pb → issues-37.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-5.pb → issues-40.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-29.pb → issues-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-48.pb → measures-11.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-42.pb → measures-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-44.pb → measures-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-50.pb → measures-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-41.pb → measures-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-45.pb → measures-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-35.pb → measures-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-32.pb → measures-62.pb} +0 -0
- /package/.scannerwork/scanner-report/{source-48.txt → source-11.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-42.txt → source-13.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-44.txt → source-14.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-50.txt → source-15.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-41.txt → source-16.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-45.txt → source-17.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-35.txt → source-39.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-32.txt → source-62.txt} +0 -0
- /package/.scannerwork/scanner-report/{symbols-48.pb → symbols-11.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-42.pb → symbols-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-44.pb → symbols-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-50.pb → symbols-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-41.pb → symbols-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-45.pb → symbols-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-35.pb → symbols-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-5.pb → symbols-40.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-6.pb → symbols-55.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-29.pb → symbols-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-32.pb → symbols-62.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-27.pb → symbols-67.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-25.pb → symbols-68.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-48.pb → syntax-highlightings-11.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-42.pb → syntax-highlightings-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-44.pb → syntax-highlightings-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-50.pb → syntax-highlightings-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-41.pb → syntax-highlightings-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-45.pb → syntax-highlightings-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-35.pb → syntax-highlightings-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-32.pb → syntax-highlightings-62.pb} +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
|
|
15
|
+
/* global after before describe */
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
const url = require('url');
|
|
19
|
+
const toxy = require('toxy');
|
|
20
|
+
// Import the common hooks
|
|
21
|
+
require('../test/hooks.js');
|
|
22
|
+
|
|
23
|
+
const tpoisons = toxy.poisons;
|
|
24
|
+
const trules = toxy.rules;
|
|
25
|
+
|
|
26
|
+
function setupProxy(poison) {
|
|
27
|
+
const backendUrl = new url.URL(process.env.COUCH_BACKEND_URL);
|
|
28
|
+
const proxy = toxy({
|
|
29
|
+
auth: `${backendUrl.username}:${backendUrl.password}`,
|
|
30
|
+
changeOrigin: true
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Forward traffic to DB
|
|
34
|
+
proxy.forward(process.env.COUCH_BACKEND_URL);
|
|
35
|
+
|
|
36
|
+
switch (poison) {
|
|
37
|
+
case 'normal':
|
|
38
|
+
// No poisons to add
|
|
39
|
+
break;
|
|
40
|
+
case 'bandwidth-limit':
|
|
41
|
+
// https://github.com/h2non/toxy#bandwidth
|
|
42
|
+
// Note the implementation of bandwidth is simplistic and the threshold
|
|
43
|
+
// delay is applied to every write of the buffer, so use the smallest
|
|
44
|
+
// delay possible and adjust the rate using the bytes size instead.
|
|
45
|
+
proxy
|
|
46
|
+
.poison(tpoisons.bandwidth({ bytes: 512, threshold: 1 })); // 0.5 MB/s
|
|
47
|
+
break;
|
|
48
|
+
case 'latency':
|
|
49
|
+
// https://github.com/h2non/toxy#latency
|
|
50
|
+
proxy
|
|
51
|
+
.poison(tpoisons.latency({ max: 1500, min: 250 }))
|
|
52
|
+
.withRule(trules.probability(60));
|
|
53
|
+
break;
|
|
54
|
+
case 'slow-read':
|
|
55
|
+
// https://github.com/h2non/toxy#slow-read
|
|
56
|
+
// Note this only impacts read of data from requests so only for non-GET
|
|
57
|
+
// In practice this means that it impacts restore much more than backup
|
|
58
|
+
// since although backup POSTs to _bulk_get the content is much smaller
|
|
59
|
+
// than what is POSTed to _bulk_docs for a restore.
|
|
60
|
+
// Similarly to bandwidth-limit use a 1 ms threshold
|
|
61
|
+
proxy
|
|
62
|
+
.poison(tpoisons.slowRead({ chunk: 256, threshold: 1 }))
|
|
63
|
+
// Slow read for 10 % of the time e.g. 10 ms in every 100
|
|
64
|
+
.withRule(trules.timeThreshold({ duration: 10, period: 100 }));
|
|
65
|
+
break;
|
|
66
|
+
case 'rate-limit':
|
|
67
|
+
// https://github.com/h2non/toxy#rate-limit
|
|
68
|
+
// Simulate the Cloudant free plan with 20 lookups ps and 10 writes ps
|
|
69
|
+
proxy.post('/*/_bulk_get')
|
|
70
|
+
.poison(tpoisons.rateLimit({ limit: 20, threshold: 1000 }));
|
|
71
|
+
proxy.post('/*/_bulk_docs')
|
|
72
|
+
.poison(tpoisons.rateLimit({ limit: 10, threshold: 1000 }));
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
throw Error('Unknown toxy poison ' + poison);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Catch remaining traffic
|
|
79
|
+
proxy.all('/*');
|
|
80
|
+
return proxy;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const poisons = [
|
|
84
|
+
'normal',
|
|
85
|
+
'bandwidth-limit',
|
|
86
|
+
'latency',
|
|
87
|
+
'slow-read',
|
|
88
|
+
'rate-limit'
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
poisons.forEach(function(poison) {
|
|
92
|
+
describe('unreliable network tests (using toxy poison ' + poison + ')', function() {
|
|
93
|
+
let proxy;
|
|
94
|
+
|
|
95
|
+
before('start toxy server', function() {
|
|
96
|
+
proxy = setupProxy(poison);
|
|
97
|
+
console.log('Using toxy poison ' + poison);
|
|
98
|
+
|
|
99
|
+
// For these tests COUCH_URL points to the toxy proxy on localhost whereas
|
|
100
|
+
// COUCH_BACKEND_URL is the real CouchDb instance.
|
|
101
|
+
const toxyUrl = new url.URL(process.env.COUCH_URL);
|
|
102
|
+
// Listen on the specified hostname only, so if using localhost we don't
|
|
103
|
+
// need external connections.
|
|
104
|
+
proxy.listen(toxyUrl.port, toxyUrl.hostname);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
after('stop toxy server', function() {
|
|
108
|
+
proxy.close();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
delete require.cache[require.resolve('../test/ci_e2e.js')];
|
|
112
|
+
require('../test/ci_e2e.js');
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -11,25 +11,31 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
/* global describe it */
|
|
16
14
|
'use strict';
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
const
|
|
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
|
+
};
|
|
20
39
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
logfilegetbatches('./test/fixtures/test.log', [1, 4], function(err, data) {
|
|
24
|
-
assert.ok(!err);
|
|
25
|
-
assert.ok(data);
|
|
26
|
-
assert.strictEqual(typeof data, 'object');
|
|
27
|
-
assert.strictEqual(Object.keys(data).length, 2);
|
|
28
|
-
assert.deepStrictEqual(data['1'].docs, [{ id: '6' }, { id: '7' }, { id: '8' }, { id: '9' }, { id: '10' }]);
|
|
29
|
-
assert.strictEqual(data['1'].batch, 1);
|
|
30
|
-
assert.deepStrictEqual(data['4'].docs, [{ id: '21' }, { id: '22' }]);
|
|
31
|
-
assert.strictEqual(data['4'].batch, 4);
|
|
32
|
-
done();
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
});
|
|
40
|
+
return change;
|
|
41
|
+
};
|
|
@@ -11,283 +11,119 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
/* global describe it before after beforeEach */
|
|
16
14
|
'use strict';
|
|
17
15
|
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
const cliutils = require('./cliutils.js');
|
|
17
|
+
const config = require('./config.js');
|
|
18
|
+
const error = require('./error.js');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const pkg = require('../package.json');
|
|
21
|
+
|
|
22
|
+
function parseBackupArgs() {
|
|
23
|
+
const program = require('commander');
|
|
24
|
+
|
|
25
|
+
// Option CLI defaults
|
|
26
|
+
const defaults = config.cliDefaults();
|
|
27
|
+
|
|
28
|
+
// Options set by environment variables
|
|
29
|
+
const envVarOptions = {};
|
|
30
|
+
config.applyEnvironmentVariables(envVarOptions);
|
|
31
|
+
|
|
32
|
+
program
|
|
33
|
+
.version(pkg.version)
|
|
34
|
+
.description('Backup a CouchDB/Cloudant database to a backup text file.')
|
|
35
|
+
.usage('[options...]')
|
|
36
|
+
.option('-b, --buffer-size <n>',
|
|
37
|
+
cliutils.getUsage('number of documents fetched at once', defaults.bufferSize),
|
|
38
|
+
Number)
|
|
39
|
+
.option('-d, --db <db>',
|
|
40
|
+
cliutils.getUsage('name of the database to backup', defaults.db))
|
|
41
|
+
.option('-k, --iam-api-key <API key>',
|
|
42
|
+
cliutils.getUsage('IAM API key to access the Cloudant server'))
|
|
43
|
+
.option('-l, --log <file>',
|
|
44
|
+
cliutils.getUsage('file to store logging information during backup; invalid in "shallow" mode', 'a temporary file'),
|
|
45
|
+
path.normalize)
|
|
46
|
+
.option('-m, --mode <mode>',
|
|
47
|
+
cliutils.getUsage('"shallow" if only a superficial backup is done (ignoring conflicts and revision tokens), else "full" for complete backup', defaults.mode),
|
|
48
|
+
(mode) => { return mode.toLowerCase(); })
|
|
49
|
+
.option('-o, --output <file>',
|
|
50
|
+
cliutils.getUsage('file name to store the backup data', 'stdout'),
|
|
51
|
+
path.normalize)
|
|
52
|
+
.option('-p, --parallelism <n>',
|
|
53
|
+
cliutils.getUsage('number of HTTP requests to perform in parallel when performing a backup; ignored in "shallow" mode', defaults.parallelism),
|
|
54
|
+
Number)
|
|
55
|
+
.option('-q, --quiet',
|
|
56
|
+
cliutils.getUsage('suppress batch messages', defaults.quiet))
|
|
57
|
+
.option('-r, --resume',
|
|
58
|
+
cliutils.getUsage('continue a previous backup from its last known position; invalid in "shallow" mode', defaults.resume))
|
|
59
|
+
.option('-t, --request-timeout <n>',
|
|
60
|
+
cliutils.getUsage('milliseconds to wait for a response to a HTTP request before retrying the request', defaults.requestTimeout),
|
|
61
|
+
Number)
|
|
62
|
+
.option('-u, --url <url>',
|
|
63
|
+
cliutils.getUsage('URL of the CouchDB/Cloudant server', defaults.url))
|
|
64
|
+
.parse(process.argv);
|
|
65
|
+
|
|
66
|
+
// Remove defaults that don't apply when using shallow mode
|
|
67
|
+
if (program.opts().mode === 'shallow' || envVarOptions.mode === 'shallow') {
|
|
68
|
+
delete defaults.parallelism;
|
|
69
|
+
delete defaults.log;
|
|
70
|
+
delete defaults.resume;
|
|
35
71
|
}
|
|
36
72
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
proceed = this.push(this.contents);
|
|
41
|
-
} while (proceed);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
73
|
+
// Apply the options in order so that the CLI overrides env vars and env variables
|
|
74
|
+
// override defaults.
|
|
75
|
+
const opts = Object.assign({}, defaults, envVarOptions, program.opts());
|
|
44
76
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} catch (err) {
|
|
50
|
-
console.error('pending mocks: %j', nock.pendingMocks());
|
|
51
|
-
done(err);
|
|
77
|
+
if (opts.resume && (opts.log === defaults.log)) {
|
|
78
|
+
// If resuming and the log file arg is the newly generated tmp name from defaults then we know that --log wasn't specified.
|
|
79
|
+
// We have to do this check here for the CLI case because of the default.
|
|
80
|
+
error.terminationCallback(new error.BackupError('NoLogFileName', 'To resume a backup, a log file must be specified'));
|
|
52
81
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function backupHttpError(opts, errorName, errorCode, done) {
|
|
56
|
-
const p = u.p(opts, { expectedBackupError: { name: errorName, code: errorCode } });
|
|
57
82
|
|
|
58
|
-
|
|
59
|
-
const output = fs.createWriteStream('/dev/null');
|
|
60
|
-
output.on('open', function() {
|
|
61
|
-
u.testBackup(p, 'fakenockdb', output, function(err) {
|
|
62
|
-
if (err) {
|
|
63
|
-
done(err);
|
|
64
|
-
} else {
|
|
65
|
-
assertNock(done);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
});
|
|
83
|
+
return opts;
|
|
69
84
|
}
|
|
70
85
|
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
function parseRestoreArgs() {
|
|
87
|
+
const program = require('commander');
|
|
88
|
+
|
|
89
|
+
// Option CLI defaults
|
|
90
|
+
const defaults = config.cliDefaults();
|
|
91
|
+
|
|
92
|
+
// Options set by environment variables
|
|
93
|
+
const envVarOptions = {};
|
|
94
|
+
config.applyEnvironmentVariables(envVarOptions);
|
|
95
|
+
|
|
96
|
+
program
|
|
97
|
+
.version(pkg.version)
|
|
98
|
+
.description('Restore a CouchDB/Cloudant database from a backup text file.')
|
|
99
|
+
.usage('[options...]')
|
|
100
|
+
.option('-b, --buffer-size <n>',
|
|
101
|
+
cliutils.getUsage('number of documents restored at once', defaults.bufferSize),
|
|
102
|
+
Number)
|
|
103
|
+
.option('-d, --db <db>',
|
|
104
|
+
cliutils.getUsage('name of the new, existing database to restore to', defaults.db))
|
|
105
|
+
.option('-k, --iam-api-key <API key>',
|
|
106
|
+
cliutils.getUsage('IAM API key to access the Cloudant server'))
|
|
107
|
+
.option('-p, --parallelism <n>',
|
|
108
|
+
cliutils.getUsage('number of HTTP requests to perform in parallel when restoring a backup', defaults.parallelism),
|
|
109
|
+
Number)
|
|
110
|
+
.option('-q, --quiet',
|
|
111
|
+
cliutils.getUsage('suppress batch messages', defaults.quiet))
|
|
112
|
+
.option('-t, --request-timeout <n>',
|
|
113
|
+
cliutils.getUsage('milliseconds to wait for a response to a HTTP request before retrying the request', defaults.requestTimeout),
|
|
114
|
+
Number)
|
|
115
|
+
.option('-u, --url <url>',
|
|
116
|
+
cliutils.getUsage('URL of the CouchDB/Cloudant server', defaults.url))
|
|
117
|
+
.parse(process.argv);
|
|
118
|
+
|
|
119
|
+
// Apply the options in order so that the CLI overrides env vars and env variables
|
|
120
|
+
// override defaults.
|
|
121
|
+
const opts = Object.assign({}, defaults, envVarOptions, program.opts());
|
|
122
|
+
|
|
123
|
+
return opts;
|
|
80
124
|
}
|
|
81
125
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
before('Set process data for test', function() {
|
|
88
|
-
// Copy env and argv so we can reset them after the tests
|
|
89
|
-
processEnvCopy = JSON.parse(JSON.stringify(process.env));
|
|
90
|
-
|
|
91
|
-
// Set up a proxy to point to our nock server because the nock override
|
|
92
|
-
// isn't visible to the spawned CLI process
|
|
93
|
-
if (!params.useApi) {
|
|
94
|
-
proxy = httpProxy.createProxyServer({ target: url }).listen(mockServerPort + 1000, 'localhost');
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// setup environment variables
|
|
98
|
-
process.env.COUCH_URL = (params.useApi) ? url : `http://localhost:${mockServerPort + 1000}`;
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
after('Reset process data', function(done) {
|
|
102
|
-
process.env = processEnvCopy;
|
|
103
|
-
if (!params.useApi) {
|
|
104
|
-
proxy.close(done);
|
|
105
|
-
} else {
|
|
106
|
-
done();
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
beforeEach('Reset nocks', function() {
|
|
111
|
-
nock.cleanAll();
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
describe('for backup', function() {
|
|
115
|
-
it('should terminate when DB does not exist', function(done) {
|
|
116
|
-
// Simulate existence check
|
|
117
|
-
nock(url).head('/fakenockdb').reply(404, { error: 'not_found', reason: 'missing' });
|
|
118
|
-
backupHttpError(params, 'DatabaseNotFound', 10, done);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('should terminate on BulkGetError', function(done) {
|
|
122
|
-
// Simulate existence check
|
|
123
|
-
const n = nock(url).head('/fakenockdb').reply(200);
|
|
124
|
-
// Simulate _bulk_get not available
|
|
125
|
-
n.post('/fakenockdb/_bulk_get').reply(404, { error: 'not_found', reason: 'missing' });
|
|
126
|
-
backupHttpError(params, 'BulkGetError', 50, done);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it('should terminate on Unauthorized existence check', function(done) {
|
|
130
|
-
// Simulate a 401
|
|
131
|
-
nock(url).head('/fakenockdb').reply(401, { error: 'unauthorized', reason: '_reader access is required for this request' });
|
|
132
|
-
backupHttpError(params, 'Unauthorized', 11, done);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it('should terminate on Forbidden no _reader', function(done) {
|
|
136
|
-
// Simulate a 403
|
|
137
|
-
nock(url).head('/fakenockdb').reply(403, { error: 'forbidden', reason: '_reader access is required for this request' });
|
|
138
|
-
backupHttpError(params, 'Forbidden', 12, done);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
it('should terminate on _bulk_get HTTPFatalError', function(done) {
|
|
142
|
-
// Provide a mock complete changes log to allow a resume to skip ahead
|
|
143
|
-
const p = u.p(params, { opts: { resume: true, log: './test/fixtures/test.log' } });
|
|
144
|
-
// Allow the existence and _bulk_get checks to pass
|
|
145
|
-
const n = nock(url).head('/fakenockdb').reply(200);
|
|
146
|
-
n.post('/fakenockdb/_bulk_get').reply(200, '{"results": []}');
|
|
147
|
-
// Simulate a fatal HTTP error when trying to fetch docs
|
|
148
|
-
// Note: 2 outstanding batches, so 2 responses, 1 mock is optional because we can't guarantee timing
|
|
149
|
-
n.post('/fakenockdb/_bulk_get').query(true).reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
150
|
-
n.post('/fakenockdb/_bulk_get').query(true).optionally().reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
151
|
-
backupHttpError(p, 'HTTPFatalError', 40, done);
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
it('should terminate on NoLogFileName', function(done) {
|
|
155
|
-
// Don't supply a log file name with resume
|
|
156
|
-
const p = u.p(params, { opts: { resume: true } });
|
|
157
|
-
backupHttpError(p, 'NoLogFileName', 20, done);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it('should terminate on LogDoesNotExist', function(done) {
|
|
161
|
-
// Use a non-existent log file
|
|
162
|
-
const p = u.p(params, { opts: { resume: true, log: './test/fixtures/doesnotexist.log' } });
|
|
163
|
-
backupHttpError(p, 'LogDoesNotExist', 21, done);
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
it('should terminate on IncompleteChangesInLogFile', function(done) {
|
|
167
|
-
// Use an incomplete changes log file
|
|
168
|
-
const p = u.p(params, { opts: { resume: true, log: './test/fixtures/incomplete_changes.log' } });
|
|
169
|
-
// Allow the existence and _bulk_get checks to pass
|
|
170
|
-
const n = nock(url).head('/fakenockdb').reply(200);
|
|
171
|
-
n.post('/fakenockdb/_bulk_get').reply(200, '{"results": []}');
|
|
172
|
-
// Should fail when it reads the incomplete changes
|
|
173
|
-
backupHttpError(p, 'IncompleteChangesInLogFile', 22, done);
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
it('should terminate on _changes HTTPFatalError', function(done) {
|
|
177
|
-
// Allow the existence and _bulk_get checks to pass
|
|
178
|
-
const n = nock(url).head('/fakenockdb').reply(200);
|
|
179
|
-
n.post('/fakenockdb/_bulk_get').reply(200, '{"results": []}');
|
|
180
|
-
// Simulate a fatal HTTP error when trying to fetch docs (note 2 outstanding batches)
|
|
181
|
-
n.post('/fakenockdb/_changes').query(true).reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
182
|
-
backupHttpError(params, 'HTTPFatalError', 40, done);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
it('should terminate on SpoolChangesError', function(done) {
|
|
186
|
-
// Allow the existence and _bulk_get checks to pass
|
|
187
|
-
const n = nock(url).head('/fakenockdb').reply(200);
|
|
188
|
-
n.post('/fakenockdb/_bulk_get').reply(200, '{"results": []}');
|
|
189
|
-
// Simulate a changes without a last_seq
|
|
190
|
-
n.post('/fakenockdb/_changes').query(true).reply(200,
|
|
191
|
-
{
|
|
192
|
-
results: [{
|
|
193
|
-
seq: '2-g1AAAAEbeJzLYWBgYMlgTmFQSElKzi9KdUhJstTLTS3KLElMT9VLzskvTUnMK9HLSy3JAapkSmRIsv___39WBnMiUy5QgN3MzDIxOdEMWb85dv0gSxThigyN8diS5AAkk-pBFiUyoOkzxKMvjwVIMjQAKaDW_Zh6TQnqPQDRC7I3CwDPDV1k',
|
|
194
|
-
id: 'badger',
|
|
195
|
-
changes: [{ rev: '4-51aa94e4b0ef37271082033bba52b850' }]
|
|
196
|
-
}]
|
|
197
|
-
});
|
|
198
|
-
backupHttpError(params, 'SpoolChangesError', 30, done);
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
describe('for restore', function() {
|
|
203
|
-
it('should terminate on Unauthorized db existence check', function(done) {
|
|
204
|
-
// Simulate a 401
|
|
205
|
-
nock(url).get('/fakenockdb').reply(401, { error: 'unauthorized', reason: '_reader access is required for this request' });
|
|
206
|
-
restoreHttpError(params, 'Unauthorized', 11, done);
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
it('should terminate on Forbidden no _writer', function(done) {
|
|
210
|
-
// Simulate the DB exists (i.e. you can read it)
|
|
211
|
-
const n = nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 0 });
|
|
212
|
-
// Simulate a 403 trying to write
|
|
213
|
-
n.post('/fakenockdb/_bulk_docs').reply(403, { error: 'forbidden', reason: '_writer access is required for this request' });
|
|
214
|
-
restoreHttpError(params, 'Forbidden', 12, done);
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
it('should terminate on RestoreDatabaseNotFound', function(done) {
|
|
218
|
-
// Simulate the DB does not exist
|
|
219
|
-
nock(url).get('/fakenockdb').reply(404, { error: 'not_found', reason: 'Database does not exist.' });
|
|
220
|
-
restoreHttpError(params, 'DatabaseNotFound', 10, done);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
it('should terminate on notEmptyDBErr when database is not empty', function(done) {
|
|
224
|
-
// Simulate the DB that does exist and not empty
|
|
225
|
-
nock(url).get('/fakenockdb').reply(200, { doc_count: 10, doc_del_count: 0 });
|
|
226
|
-
restoreHttpError(params, 'DatabaseNotEmpty', 13, done);
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
it('should terminate on notEmptyDBErr when database is not new', function(done) {
|
|
230
|
-
// Simulate the DB that does exist and not new
|
|
231
|
-
nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 10 });
|
|
232
|
-
restoreHttpError(params, 'DatabaseNotEmpty', 13, done);
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
it('should terminate on _bulk_docs HTTPFatalError', function(done) {
|
|
236
|
-
// Simulate the DB exists
|
|
237
|
-
const n = nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 0 });
|
|
238
|
-
// Use a parallelism of one and mock one response
|
|
239
|
-
const p = u.p(params, { opts: { parallelism: 1 } });
|
|
240
|
-
// Simulate a 400 trying to write
|
|
241
|
-
n.post('/fakenockdb/_bulk_docs').reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
242
|
-
restoreHttpError(p, 'HTTPFatalError', 40, done);
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
it('should terminate on _bulk_docs HTTPFatalError from system database', function(done) {
|
|
246
|
-
// Simulate that target database exists and is _not_ empty.
|
|
247
|
-
// This should pass validator as we exclude system databases from the check.
|
|
248
|
-
const n = nock(url).get('/_replicator').reply(200, { doc_count: 1, doc_del_count: 0 });
|
|
249
|
-
// Simulate a 400 trying to write
|
|
250
|
-
n.post('/_replicator/_bulk_docs').reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
251
|
-
// Use a parallelism of one and mock one response
|
|
252
|
-
const q = u.p(params, { opts: { parallelism: 1 }, expectedRestoreError: { name: 'HTTPFatalError', code: 40 } });
|
|
253
|
-
u.testRestore(q, new InfiniteBackupStream(), '_replicator', function(err) {
|
|
254
|
-
if (err) {
|
|
255
|
-
done(err);
|
|
256
|
-
} else {
|
|
257
|
-
assertNock(done);
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
it('should terminate on _bulk_docs HTTPFatalError large stream', function(done) {
|
|
263
|
-
// Simulate the DB exists
|
|
264
|
-
const n = nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 0 });
|
|
265
|
-
// Simulate a 400 trying to write
|
|
266
|
-
// Provide a body function to handle the stream, but allow any body
|
|
267
|
-
n.post('/fakenockdb/_bulk_docs', function(body) { return true; }).reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
268
|
-
// Use only parallelism 1 so we don't have to mock up loads of responses
|
|
269
|
-
const q = u.p(params, { opts: { parallelism: 1 }, expectedRestoreError: { name: 'HTTPFatalError', code: 40 } });
|
|
270
|
-
u.testRestore(q, new InfiniteBackupStream(), 'fakenockdb', function(err) {
|
|
271
|
-
if (err) {
|
|
272
|
-
done(err);
|
|
273
|
-
} else {
|
|
274
|
-
assertNock(done);
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
it('should terminate on multiple _bulk_docs HTTPFatalError', function(done) {
|
|
280
|
-
// Simulate the DB exists
|
|
281
|
-
const n = nock(url).get('/fakenockdb').reply(200, { doc_count: 0, doc_del_count: 0 });
|
|
282
|
-
// Simulate a 400 trying to write docs, 5 times because of default parallelism
|
|
283
|
-
// Provide a body function to handle the stream, but allow any body
|
|
284
|
-
// Four of the mocks are optional because of parallelism 5 we can't guarantee that the exit will happen
|
|
285
|
-
// after all 5 requests, but we must get at least one of them
|
|
286
|
-
n.post('/fakenockdb/_bulk_docs', function(body) { return true; }).reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
287
|
-
n.post('/fakenockdb/_bulk_docs', function(body) { return true; }).times(4).optionally().reply(400, { error: 'bad_request', reason: 'testing bad response' });
|
|
288
|
-
const q = u.p(params, { opts: { bufferSize: 1 }, expectedRestoreError: { name: 'HTTPFatalError', code: 40 } });
|
|
289
|
-
restoreHttpError(q, 'HTTPFatalError', 40, done);
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
});
|
|
126
|
+
module.exports = {
|
|
127
|
+
parseBackupArgs: parseBackupArgs,
|
|
128
|
+
parseRestoreArgs: parseRestoreArgs
|
|
129
|
+
};
|