@cloudant/couchbackup 2.9.9-SNAPSHOT.97 → 2.9.9-SNAPSHOT.98
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/changesets-10.pb +2 -0
- package/.scannerwork/scanner-report/changesets-11.pb +1 -0
- package/.scannerwork/scanner-report/changesets-14.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-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-14.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-26.pb +1 -1
- package/.scannerwork/scanner-report/component-27.pb +1 -1
- package/.scannerwork/scanner-report/component-28.pb +1 -1
- package/.scannerwork/scanner-report/component-29.pb +1 -1
- package/.scannerwork/scanner-report/component-31.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-4.pb +1 -1
- package/.scannerwork/scanner-report/component-49.pb +1 -1
- 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 -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-6.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-10.pb +0 -0
- package/.scannerwork/scanner-report/coverages-11.pb +0 -0
- package/.scannerwork/scanner-report/coverages-14.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-22.pb +0 -0
- package/.scannerwork/scanner-report/coverages-23.pb +0 -0
- package/.scannerwork/scanner-report/coverages-24.pb +0 -0
- package/.scannerwork/scanner-report/coverages-25.pb +0 -0
- package/.scannerwork/scanner-report/coverages-26.pb +0 -0
- package/.scannerwork/scanner-report/coverages-27.pb +0 -0
- package/.scannerwork/scanner-report/coverages-28.pb +0 -0
- package/.scannerwork/scanner-report/coverages-29.pb +0 -0
- package/.scannerwork/scanner-report/coverages-31.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-49.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-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-66.pb +0 -0
- package/.scannerwork/scanner-report/coverages-67.pb +0 -0
- package/.scannerwork/scanner-report/coverages-68.pb +0 -0
- package/.scannerwork/scanner-report/coverages-69.pb +0 -0
- package/.scannerwork/scanner-report/duplications-17.pb +2 -0
- package/.scannerwork/scanner-report/duplications-19.pb +0 -3
- package/.scannerwork/scanner-report/duplications-21.pb +0 -2
- package/.scannerwork/scanner-report/duplications-22.pb +0 -3
- package/.scannerwork/scanner-report/duplications-26.pb +2 -0
- package/.scannerwork/scanner-report/duplications-31.pb +2 -0
- package/.scannerwork/scanner-report/duplications-34.pb +2 -0
- package/.scannerwork/scanner-report/duplications-36.pb +0 -2
- package/.scannerwork/scanner-report/duplications-50.pb +3 -0
- package/.scannerwork/scanner-report/duplications-62.pb +3 -0
- package/.scannerwork/scanner-report/duplications-64.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/duplications-67.pb +2 -0
- package/.scannerwork/scanner-report/duplications-69.pb +2 -0
- package/.scannerwork/scanner-report/measures-10.pb +0 -0
- package/.scannerwork/scanner-report/measures-11.pb +0 -0
- package/.scannerwork/scanner-report/measures-14.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-22.pb +0 -0
- package/.scannerwork/scanner-report/measures-23.pb +0 -0
- package/.scannerwork/scanner-report/measures-24.pb +0 -0
- package/.scannerwork/scanner-report/measures-25.pb +0 -0
- package/.scannerwork/scanner-report/measures-26.pb +0 -0
- package/.scannerwork/scanner-report/measures-27.pb +0 -0
- package/.scannerwork/scanner-report/measures-28.pb +0 -0
- package/.scannerwork/scanner-report/measures-29.pb +0 -0
- package/.scannerwork/scanner-report/measures-31.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-4.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-6.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-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 +77 -0
- package/.scannerwork/scanner-report/source-11.txt +56 -0
- package/.scannerwork/scanner-report/{source-38.txt → source-12.txt} +50 -50
- package/.scannerwork/scanner-report/source-14.txt +114 -0
- package/.scannerwork/scanner-report/source-19.txt +36 -113
- package/.scannerwork/scanner-report/{source-40.txt → source-2.txt} +153 -153
- package/.scannerwork/scanner-report/source-20.txt +115 -21
- package/.scannerwork/scanner-report/source-21.txt +25 -272
- package/.scannerwork/scanner-report/source-22.txt +84 -99
- package/.scannerwork/scanner-report/source-23.txt +88 -69
- package/.scannerwork/scanner-report/source-24.txt +17 -601
- package/.scannerwork/scanner-report/source-25.txt +65 -14
- package/.scannerwork/scanner-report/source-26.txt +73 -44
- package/.scannerwork/scanner-report/source-27.txt +150 -22
- package/.scannerwork/scanner-report/source-28.txt +247 -108
- package/.scannerwork/scanner-report/source-29.txt +17 -352
- package/.scannerwork/scanner-report/source-31.txt +157 -82
- package/.scannerwork/scanner-report/source-34.txt +166 -44
- package/.scannerwork/scanner-report/source-36.txt +387 -194
- package/.scannerwork/scanner-report/source-37.txt +121 -93
- package/.scannerwork/scanner-report/source-4.txt +509 -34
- package/.scannerwork/scanner-report/source-49.txt +21 -115
- package/.scannerwork/scanner-report/source-5.txt +509 -244
- package/.scannerwork/scanner-report/source-50.txt +209 -246
- package/.scannerwork/scanner-report/source-51.txt +352 -66
- package/.scannerwork/scanner-report/source-52.txt +48 -91
- package/.scannerwork/scanner-report/source-53.txt +19 -29
- package/.scannerwork/scanner-report/source-54.txt +31 -148
- package/.scannerwork/scanner-report/source-55.txt +68 -509
- package/.scannerwork/scanner-report/{source-30.txt → source-56.txt} +7 -14
- package/.scannerwork/scanner-report/source-57.txt +80 -57
- package/.scannerwork/scanner-report/source-58.txt +20 -40
- package/.scannerwork/scanner-report/source-59.txt +156 -509
- package/.scannerwork/scanner-report/source-6.txt +509 -68
- package/.scannerwork/scanner-report/source-61.txt +34 -509
- package/.scannerwork/scanner-report/source-62.txt +119 -0
- package/.scannerwork/scanner-report/source-63.txt +63 -0
- package/.scannerwork/scanner-report/source-64.txt +131 -0
- package/.scannerwork/scanner-report/source-65.txt +122 -165
- package/.scannerwork/scanner-report/source-66.txt +583 -133
- package/.scannerwork/scanner-report/source-67.txt +225 -0
- package/.scannerwork/scanner-report/source-68.txt +92 -0
- package/.scannerwork/scanner-report/source-69.txt +237 -362
- package/.scannerwork/scanner-report/symbols-10.pb +30 -0
- package/.scannerwork/scanner-report/symbols-11.pb +19 -0
- package/.scannerwork/scanner-report/symbols-14.pb +28 -0
- package/.scannerwork/scanner-report/symbols-19.pb +15 -97
- package/.scannerwork/scanner-report/symbols-20.pb +33 -17
- package/.scannerwork/scanner-report/symbols-21.pb +19 -485
- package/.scannerwork/scanner-report/symbols-22.pb +41 -76
- package/.scannerwork/scanner-report/symbols-23.pb +59 -60
- package/.scannerwork/scanner-report/symbols-24.pb +17 -1253
- package/.scannerwork/scanner-report/symbols-25.pb +46 -9
- package/.scannerwork/scanner-report/symbols-26.pb +43 -42
- package/.scannerwork/scanner-report/symbols-27.pb +126 -11
- package/.scannerwork/scanner-report/symbols-28.pb +348 -110
- package/.scannerwork/scanner-report/symbols-29.pb +14 -494
- package/.scannerwork/scanner-report/symbols-31.pb +152 -68
- package/.scannerwork/scanner-report/symbols-34.pb +180 -36
- package/.scannerwork/scanner-report/symbols-36.pb +551 -359
- package/.scannerwork/scanner-report/symbols-37.pb +116 -28
- package/.scannerwork/scanner-report/symbols-49.pb +17 -33
- package/.scannerwork/scanner-report/symbols-50.pb +342 -302
- package/.scannerwork/scanner-report/symbols-51.pb +494 -46
- package/.scannerwork/scanner-report/symbols-52.pb +44 -58
- package/.scannerwork/scanner-report/symbols-53.pb +14 -20
- package/.scannerwork/scanner-report/symbols-54.pb +26 -125
- package/.scannerwork/scanner-report/symbols-55.pb +36 -0
- package/.scannerwork/scanner-report/symbols-56.pb +9 -0
- package/.scannerwork/scanner-report/symbols-57.pb +68 -29
- package/.scannerwork/scanner-report/symbols-58.pb +11 -19
- package/.scannerwork/scanner-report/symbols-62.pb +77 -0
- package/.scannerwork/scanner-report/symbols-63.pb +43 -0
- package/.scannerwork/scanner-report/symbols-64.pb +97 -0
- package/.scannerwork/scanner-report/symbols-65.pb +85 -180
- package/.scannerwork/scanner-report/symbols-66.pb +1244 -143
- package/.scannerwork/scanner-report/symbols-67.pb +418 -0
- package/.scannerwork/scanner-report/symbols-68.pb +60 -0
- package/.scannerwork/scanner-report/symbols-69.pb +430 -554
- package/.scannerwork/scanner-report/syntax-highlightings-10.pb +103 -0
- package/.scannerwork/scanner-report/syntax-highlightings-11.pb +82 -0
- package/.scannerwork/scanner-report/{syntax-highlightings-38.pb → syntax-highlightings-12.pb} +22 -22
- package/.scannerwork/scanner-report/syntax-highlightings-14.pb +138 -0
- package/.scannerwork/scanner-report/syntax-highlightings-19.pb +25 -153
- package/.scannerwork/scanner-report/{syntax-highlightings-40.pb → syntax-highlightings-2.pb} +99 -98
- package/.scannerwork/scanner-report/syntax-highlightings-20.pb +95 -29
- package/.scannerwork/scanner-report/syntax-highlightings-21.pb +34 -629
- package/.scannerwork/scanner-report/syntax-highlightings-22.pb +86 -128
- package/.scannerwork/scanner-report/syntax-highlightings-23.pb +92 -69
- package/.scannerwork/scanner-report/syntax-highlightings-24.pb +21 -858
- package/.scannerwork/scanner-report/syntax-highlightings-25.pb +63 -16
- package/.scannerwork/scanner-report/syntax-highlightings-26.pb +56 -48
- package/.scannerwork/scanner-report/syntax-highlightings-27.pb +180 -26
- package/.scannerwork/scanner-report/syntax-highlightings-28.pb +250 -99
- package/.scannerwork/scanner-report/syntax-highlightings-29.pb +15 -600
- package/.scannerwork/scanner-report/syntax-highlightings-31.pb +175 -66
- package/.scannerwork/scanner-report/syntax-highlightings-34.pb +194 -64
- package/.scannerwork/scanner-report/syntax-highlightings-36.pb +523 -206
- package/.scannerwork/scanner-report/syntax-highlightings-37.pb +99 -103
- package/.scannerwork/scanner-report/syntax-highlightings-4.pb +3730 -32
- package/.scannerwork/scanner-report/syntax-highlightings-49.pb +29 -95
- package/.scannerwork/scanner-report/syntax-highlightings-5.pb +3640 -222
- package/.scannerwork/scanner-report/syntax-highlightings-50.pb +217 -173
- package/.scannerwork/scanner-report/syntax-highlightings-51.pb +595 -60
- package/.scannerwork/scanner-report/syntax-highlightings-52.pb +73 -96
- package/.scannerwork/scanner-report/syntax-highlightings-53.pb +24 -34
- package/.scannerwork/scanner-report/syntax-highlightings-54.pb +33 -178
- package/.scannerwork/scanner-report/syntax-highlightings-55.pb +84 -3736
- package/.scannerwork/scanner-report/syntax-highlightings-56.pb +48 -0
- package/.scannerwork/scanner-report/syntax-highlightings-57.pb +75 -73
- package/.scannerwork/scanner-report/syntax-highlightings-58.pb +39 -62
- package/.scannerwork/scanner-report/syntax-highlightings-59.pb +201 -3727
- package/.scannerwork/scanner-report/syntax-highlightings-6.pb +3736 -99
- package/.scannerwork/scanner-report/syntax-highlightings-61.pb +32 -3729
- package/.scannerwork/scanner-report/syntax-highlightings-62.pb +158 -0
- package/.scannerwork/scanner-report/syntax-highlightings-63.pb +82 -0
- package/.scannerwork/scanner-report/syntax-highlightings-64.pb +182 -0
- package/.scannerwork/scanner-report/syntax-highlightings-65.pb +146 -180
- package/.scannerwork/scanner-report/syntax-highlightings-66.pb +815 -142
- package/.scannerwork/scanner-report/syntax-highlightings-67.pb +331 -0
- package/.scannerwork/scanner-report/syntax-highlightings-68.pb +110 -0
- package/.scannerwork/scanner-report/syntax-highlightings-69.pb +414 -403
- package/package.json +2 -2
- package/test-14-results.xml +158 -158
- package/test-16-results.xml +139 -139
- package/test-18-results.xml +142 -142
- package/test-19-results.xml +155 -155
- package/test-iam-18-results.xml +50 -50
- package/.scannerwork/scanner-report/changesets-30.pb +0 -1
- package/.scannerwork/scanner-report/changesets-32.pb +0 -1
- package/.scannerwork/scanner-report/changesets-33.pb +0 -1
- package/.scannerwork/scanner-report/changesets-35.pb +0 -1
- package/.scannerwork/scanner-report/changesets-4.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-5.pb +0 -1
- package/.scannerwork/scanner-report/changesets-6.pb +0 -1
- package/.scannerwork/scanner-report/changesets-7.pb +0 -1
- package/.scannerwork/scanner-report/component-30.pb +0 -1
- package/.scannerwork/scanner-report/component-32.pb +0 -1
- package/.scannerwork/scanner-report/component-33.pb +0 -1
- package/.scannerwork/scanner-report/component-35.pb +0 -1
- package/.scannerwork/scanner-report/component-38.pb +0 -1
- package/.scannerwork/scanner-report/component-40.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-7.pb +0 -1
- package/.scannerwork/scanner-report/coverages-30.pb +0 -0
- package/.scannerwork/scanner-report/coverages-35.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-46.pb +0 -0
- package/.scannerwork/scanner-report/coverages-47.pb +0 -0
- package/.scannerwork/scanner-report/coverages-5.pb +0 -0
- package/.scannerwork/scanner-report/coverages-6.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-5.pb +0 -3
- package/.scannerwork/scanner-report/duplications-7.pb +0 -0
- package/.scannerwork/scanner-report/measures-30.pb +0 -0
- package/.scannerwork/scanner-report/measures-33.pb +0 -0
- package/.scannerwork/scanner-report/measures-35.pb +0 -0
- package/.scannerwork/scanner-report/measures-41.pb +0 -0
- package/.scannerwork/scanner-report/measures-42.pb +0 -15
- 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-7.pb +0 -0
- package/.scannerwork/scanner-report/source-33.txt +0 -156
- package/.scannerwork/scanner-report/source-35.txt +0 -147
- package/.scannerwork/scanner-report/source-41.txt +0 -31
- package/.scannerwork/scanner-report/source-42.txt +0 -104
- 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-7.txt +0 -47
- package/.scannerwork/scanner-report/symbols-30.pb +0 -14
- package/.scannerwork/scanner-report/symbols-35.pb +0 -85
- package/.scannerwork/scanner-report/symbols-41.pb +0 -14
- package/.scannerwork/scanner-report/symbols-42.pb +0 -42
- 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-5.pb +0 -394
- package/.scannerwork/scanner-report/symbols-6.pb +0 -45
- package/.scannerwork/scanner-report/symbols-7.pb +0 -27
- package/.scannerwork/scanner-report/syntax-highlightings-30.pb +0 -54
- package/.scannerwork/scanner-report/syntax-highlightings-33.pb +0 -223
- package/.scannerwork/scanner-report/syntax-highlightings-35.pb +0 -191
- package/.scannerwork/scanner-report/syntax-highlightings-41.pb +0 -45
- package/.scannerwork/scanner-report/syntax-highlightings-42.pb +0 -116
- 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-7.pb +0 -68
- /package/.scannerwork/scanner-report/{coverages-48.pb → coverages-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-45.pb → coverages-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-44.pb → coverages-18.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-33.pb → coverages-59.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-32.pb → coverages-60.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-4.pb → coverages-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-30.pb → duplications-10.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-33.pb → duplications-11.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-35.pb → duplications-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-4.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-25.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-44.pb → duplications-55.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-46.pb → duplications-59.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-32.pb → duplications-60.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-47.pb → duplications-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-48.pb → duplications-63.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-6.pb → duplications-68.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-28.pb → issues-37.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-5.pb → issues-50.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-29.pb → issues-51.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-7.pb → issues-54.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-38.pb → measures-12.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-48.pb → measures-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-45.pb → measures-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-44.pb → measures-18.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-40.pb → measures-2.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-32.pb → measures-60.pb} +0 -0
- /package/.scannerwork/scanner-report/{source-48.txt → source-16.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-45.txt → source-17.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-44.txt → source-18.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-32.txt → source-60.txt} +0 -0
- /package/.scannerwork/scanner-report/{symbols-48.pb → symbols-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-45.pb → symbols-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-44.pb → symbols-18.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-33.pb → symbols-59.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-32.pb → symbols-60.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-4.pb → symbols-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-48.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-44.pb → syntax-highlightings-18.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-32.pb → syntax-highlightings-60.pb} +0 -0
|
@@ -11,408 +11,283 @@
|
|
|
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 */
|
|
14
16
|
'use strict';
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
* CouchBackup module.
|
|
18
|
-
* @module couchbackup
|
|
19
|
-
* @see module:couchbackup
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
const backupFull = require('./includes/backup.js');
|
|
23
|
-
const defaults = require('./includes/config.js').apiDefaults;
|
|
24
|
-
const error = require('./includes/error.js');
|
|
25
|
-
const request = require('./includes/request.js');
|
|
26
|
-
const restoreInternal = require('./includes/restore.js');
|
|
27
|
-
const backupShallow = require('./includes/shallowbackup.js');
|
|
28
|
-
const debug = require('debug')('couchbackup:app');
|
|
29
|
-
const events = require('events');
|
|
18
|
+
const assert = require('assert');
|
|
30
19
|
const fs = require('fs');
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*/
|
|
38
|
-
function isSafePositiveInteger(x) {
|
|
39
|
-
// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
|
|
40
|
-
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
41
|
-
// Is it a number?
|
|
42
|
-
return Object.prototype.toString.call(x) === '[object Number]' &&
|
|
43
|
-
// Is it an integer?
|
|
44
|
-
x % 1 === 0 &&
|
|
45
|
-
// Is it positive?
|
|
46
|
-
x > 0 &&
|
|
47
|
-
// Is it less than the maximum safe integer?
|
|
48
|
-
x <= MAX_SAFE_INTEGER;
|
|
49
|
-
}
|
|
20
|
+
const u = require('./citestutils.js');
|
|
21
|
+
const mockServerPort = +process.env.COUCHBACKUP_MOCK_SERVER_PORT || 7777;
|
|
22
|
+
const url = `http://localhost:${mockServerPort}`;
|
|
23
|
+
const nock = require('nock');
|
|
24
|
+
const httpProxy = require('http-proxy');
|
|
25
|
+
const Readable = require('stream').Readable;
|
|
50
26
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (typeof url !== 'string') {
|
|
60
|
-
cb(new error.BackupError('InvalidOption', 'Invalid URL, must be type string'), null);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (opts && typeof opts.bufferSize !== 'undefined' && !isSafePositiveInteger(opts.bufferSize)) {
|
|
64
|
-
cb(new error.BackupError('InvalidOption', 'Invalid buffer size option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]'), null);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (opts && typeof opts.iamApiKey !== 'undefined' && typeof opts.iamApiKey !== 'string') {
|
|
68
|
-
cb(new error.BackupError('InvalidOption', 'Invalid iamApiKey option, must be type string'), null);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (opts && typeof opts.log !== 'undefined' && typeof opts.log !== 'string') {
|
|
72
|
-
cb(new error.BackupError('InvalidOption', 'Invalid log option, must be type string'), null);
|
|
73
|
-
return;
|
|
27
|
+
// Create an infinite stream to read.
|
|
28
|
+
// It just keeps sending a backup line, useful for testing cases of
|
|
29
|
+
// termination while a stream has content remaining (the animaldb backup
|
|
30
|
+
// is too small for that).
|
|
31
|
+
class InfiniteBackupStream extends Readable {
|
|
32
|
+
constructor(opt) {
|
|
33
|
+
super(opt);
|
|
34
|
+
this.contents = Buffer.from('[{"_id":"giraffe","_rev":"3-7665c3e66315ff40616cceef62886bd8","min_weight":830,"min_length":5,"max_weight":1600,"max_length":6,"wiki_page":"http://en.wikipedia.org/wiki/Giraffe","class":"mammal","diet":"herbivore","_revisions":{"start":3,"ids":["7665c3e66315ff40616cceef62886bd8","aaaf10d5a68cdf22d95a5482a0e95549","967a00dff5e02add41819138abb3284d"]}}]\n', 'utf8');
|
|
74
35
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (opts && typeof opts.parallelism !== 'undefined' && !isSafePositiveInteger(opts.parallelism)) {
|
|
84
|
-
cb(new error.BackupError('InvalidOption', 'Invalid parallelism option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]'), null);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (opts && typeof opts.requestTimeout !== 'undefined' && !isSafePositiveInteger(opts.requestTimeout)) {
|
|
88
|
-
cb(new error.BackupError('InvalidOption', 'Invalid request timeout option, must be a positive integer in the range (0, MAX_SAFE_INTEGER]'), null);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (opts && typeof opts.resume !== 'undefined' && typeof opts.resume !== 'boolean') {
|
|
92
|
-
cb(new error.BackupError('InvalidOption', 'Invalid resume option, must be type boolean'), null);
|
|
93
|
-
return;
|
|
36
|
+
|
|
37
|
+
_read() {
|
|
38
|
+
let proceed;
|
|
39
|
+
do {
|
|
40
|
+
proceed = this.push(this.contents);
|
|
41
|
+
} while (proceed);
|
|
94
42
|
}
|
|
43
|
+
}
|
|
95
44
|
|
|
96
|
-
|
|
45
|
+
function assertNock(done) {
|
|
97
46
|
try {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (urlObject.protocol !== 'https:' && urlObject.protocol !== 'http:') {
|
|
101
|
-
cb(new error.BackupError('InvalidOption', 'Invalid URL protocol.'));
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (!urlObject.host) {
|
|
105
|
-
cb(new error.BackupError('InvalidOption', 'Invalid URL host.'));
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (!urlObject.pathname || urlObject.pathname === '/') {
|
|
109
|
-
cb(new error.BackupError('InvalidOption', 'Invalid URL, missing path element (no database).'));
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (opts && opts.iamApiKey && (urlObject.username || urlObject.password)) {
|
|
113
|
-
cb(new error.BackupError('InvalidOption', 'URL user information must not be supplied when using IAM API key.'));
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
47
|
+
assert.ok(nock.isDone());
|
|
48
|
+
done();
|
|
116
49
|
} catch (err) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Perform validation of invalid options for shallow mode and WARN
|
|
122
|
-
// We don't error for backwards compatibility with scripts that may have been
|
|
123
|
-
// written passing complete sets of options through
|
|
124
|
-
if (opts && opts.mode === 'shallow') {
|
|
125
|
-
if (opts.log || opts.resume) {
|
|
126
|
-
console.warn('WARNING: the options "log" and "resume" are invalid when using shallow mode.');
|
|
127
|
-
}
|
|
128
|
-
if (opts.parallelism) {
|
|
129
|
-
console.warn('WARNING: the option "parallelism" has no effect when using shallow mode.');
|
|
130
|
-
}
|
|
50
|
+
console.error('pending mocks: %j', nock.pendingMocks());
|
|
51
|
+
done(err);
|
|
131
52
|
}
|
|
132
|
-
|
|
133
|
-
if (opts && opts.resume) {
|
|
134
|
-
if (!opts.log) {
|
|
135
|
-
// This is the second place we check for the presence of the log option in conjunction with resume
|
|
136
|
-
// It has to be here for the API case
|
|
137
|
-
cb(new error.BackupError('NoLogFileName', 'To resume a backup, a log file must be specified'), null);
|
|
138
|
-
return;
|
|
139
|
-
} else if (!fs.existsSync(opts.log)) {
|
|
140
|
-
cb(new error.BackupError('LogDoesNotExist', 'To resume a backup, the log file must exist'), null);
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return true;
|
|
145
53
|
}
|
|
146
54
|
|
|
147
|
-
function
|
|
148
|
-
|
|
149
|
-
if (!indicator.errored) {
|
|
150
|
-
if (event === 'error') indicator.errored = true;
|
|
151
|
-
f(...args);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}
|
|
55
|
+
function backupHttpError(opts, errorName, errorCode, done) {
|
|
56
|
+
const p = u.p(opts, { expectedBackupError: { name: errorName, code: errorCode } });
|
|
155
57
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
58
|
+
// Create a file and attempt a backup to it
|
|
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
|
+
});
|
|
166
68
|
});
|
|
167
69
|
}
|
|
168
70
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
*/
|
|
175
|
-
function proceedIfRestoreDbValid(db, callback) {
|
|
176
|
-
db.service.getDatabaseInformation({ db: db.db }).then(response => {
|
|
177
|
-
const { doc_count: docCount, doc_del_count: deletedDocCount } = response.result;
|
|
178
|
-
// The system databases can have a validation ddoc(s) injected in them on creation.
|
|
179
|
-
// This sets the doc count off, so we just complitely exclude the system databases from this check.
|
|
180
|
-
// The assumption here is that users restoring system databases know what they are doing.
|
|
181
|
-
if (!db.db.startsWith('_') && (docCount !== 0 || deletedDocCount !== 0)) {
|
|
182
|
-
const notEmptyDBErr = new Error(`Target database ${db.url}${db.db} is not empty.`);
|
|
183
|
-
notEmptyDBErr.name = 'DatabaseNotEmpty';
|
|
184
|
-
callback(notEmptyDBErr);
|
|
71
|
+
function restoreHttpError(opts, errorName, errorCode, done) {
|
|
72
|
+
const q = u.p(opts, { expectedRestoreError: { name: errorName, code: errorCode } });
|
|
73
|
+
u.testRestoreFromFile(q, './test/fixtures/animaldb_expected.json', 'fakenockdb', function(err) {
|
|
74
|
+
if (err) {
|
|
75
|
+
done(err);
|
|
185
76
|
} else {
|
|
186
|
-
|
|
77
|
+
assertNock(done);
|
|
187
78
|
}
|
|
188
|
-
}).catch(err => {
|
|
189
|
-
err = error.convertResponseError(err, err => parseIfDbValidResponseError(db, err));
|
|
190
|
-
callback(err);
|
|
191
79
|
});
|
|
192
80
|
}
|
|
193
81
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
@param {object} err - HTTP response error
|
|
199
|
-
*/
|
|
200
|
-
function parseIfDbValidResponseError(db, err) {
|
|
201
|
-
if (err && err.status === 404) {
|
|
202
|
-
// Override the error type and message for the DB not found case
|
|
203
|
-
const msg = `Database ${db.url}` +
|
|
204
|
-
`${db.db} does not exist. ` +
|
|
205
|
-
'Check the URL and database name have been specified correctly.';
|
|
206
|
-
const noDBErr = new Error(msg);
|
|
207
|
-
noDBErr.name = 'DatabaseNotFound';
|
|
208
|
-
return noDBErr;
|
|
209
|
-
}
|
|
210
|
-
// Delegate to the default error factory if it wasn't a 404
|
|
211
|
-
return error.convertResponseError(err);
|
|
212
|
-
}
|
|
82
|
+
[{ useApi: true }, { useApi: false }].forEach(function(params) {
|
|
83
|
+
describe(u.scenario('#unit Fatal errors', params), function() {
|
|
84
|
+
let processEnvCopy;
|
|
85
|
+
let proxy;
|
|
213
86
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
* @param {number} [opts.bufferSize=500] - Number of documents per batch request.
|
|
224
|
-
* @param {number} [opts.requestTimeout=120000] - Milliseconds to wait before retrying a HTTP request.
|
|
225
|
-
* @param {string} [opts.iamApiKey] - IAM API key to use to access Cloudant database.
|
|
226
|
-
* @param {string} [opts.log] - Log file name. Default uses a temporary file.
|
|
227
|
-
* @param {boolean} [opts.resume] - Whether to resume from existing log.
|
|
228
|
-
* @param {string} [opts.mode=full] - Use `full` or `shallow` mode.
|
|
229
|
-
* @param {backupRestoreCallback} callback - Called on completion.
|
|
230
|
-
*/
|
|
231
|
-
backup: function(srcUrl, targetStream, opts, callback) {
|
|
232
|
-
const listenerErrorIndicator = { errored: false };
|
|
233
|
-
if (typeof callback === 'undefined' && typeof opts === 'function') {
|
|
234
|
-
callback = opts;
|
|
235
|
-
opts = {};
|
|
236
|
-
}
|
|
237
|
-
if (!validateArgs(srcUrl, opts, callback)) {
|
|
238
|
-
// bad args, bail
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
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
|
+
}
|
|
241
96
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
addEventListener(listenerErrorIndicator, targetStream, 'error', function(err) {
|
|
245
|
-
debug('Error ' + JSON.stringify(err));
|
|
246
|
-
if (callback) callback(err);
|
|
97
|
+
// setup environment variables
|
|
98
|
+
process.env.COUCH_URL = (params.useApi) ? url : `http://localhost:${mockServerPort + 1000}`;
|
|
247
99
|
});
|
|
248
100
|
|
|
249
|
-
|
|
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
|
+
});
|
|
250
109
|
|
|
251
|
-
|
|
110
|
+
beforeEach('Reset nocks', function() {
|
|
111
|
+
nock.cleanAll();
|
|
112
|
+
});
|
|
252
113
|
|
|
253
|
-
|
|
254
|
-
|
|
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
|
+
});
|
|
255
120
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
callback(err);
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
let backup = null;
|
|
267
|
-
if (opts.mode === 'shallow') {
|
|
268
|
-
backup = backupShallow;
|
|
269
|
-
} else { // full mode
|
|
270
|
-
backup = backupFull;
|
|
271
|
-
}
|
|
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
|
+
});
|
|
272
128
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
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
|
+
});
|
|
279
134
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
ee.emit('changes', batch);
|
|
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);
|
|
285
139
|
});
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
//
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
const continueWriting = targetStream.write(JSON.stringify(obj.data) + '\n',
|
|
299
|
-
'utf8',
|
|
300
|
-
writeFlushed);
|
|
301
|
-
if (!continueWriting) {
|
|
302
|
-
// The buffer was full, pause the queue to stop the writes until we
|
|
303
|
-
// get a drain event
|
|
304
|
-
if (q && !q.paused) {
|
|
305
|
-
q.pause();
|
|
306
|
-
targetStream.once('drain', function() {
|
|
307
|
-
q.resume();
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
}
|
|
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);
|
|
311
152
|
});
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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);
|
|
316
158
|
});
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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);
|
|
333
199
|
});
|
|
334
200
|
});
|
|
335
|
-
return ee;
|
|
336
|
-
},
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Restore a backup from a stream.
|
|
340
|
-
*
|
|
341
|
-
* @param {stream.Readable} srcStream - Stream containing backed up data.
|
|
342
|
-
* @param {string} targetUrl - Target database.
|
|
343
|
-
* @param {object} opts - Restore options.
|
|
344
|
-
* @param {number} opts.parallelism - Number of parallel HTTP requests to use. Default 5.
|
|
345
|
-
* @param {number} opts.bufferSize - Number of documents per batch request. Default 500.
|
|
346
|
-
* @param {number} opts.requestTimeout - Milliseconds to wait before retrying a HTTP request. Default 120000.
|
|
347
|
-
* @param {string} opts.iamApiKey - IAM API key to use to access Cloudant database.
|
|
348
|
-
* @param {backupRestoreCallback} callback - Called on completion.
|
|
349
|
-
*/
|
|
350
|
-
restore: function(srcStream, targetUrl, opts, callback) {
|
|
351
|
-
const listenerErrorIndicator = { errored: false };
|
|
352
|
-
if (typeof callback === 'undefined' && typeof opts === 'function') {
|
|
353
|
-
callback = opts;
|
|
354
|
-
opts = {};
|
|
355
|
-
}
|
|
356
|
-
validateArgs(targetUrl, opts, callback);
|
|
357
|
-
opts = Object.assign({}, defaults(), opts);
|
|
358
201
|
|
|
359
|
-
|
|
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
|
+
});
|
|
360
208
|
|
|
361
|
-
|
|
362
|
-
|
|
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
|
+
});
|
|
363
216
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
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
|
+
});
|
|
376
244
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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) {
|
|
383
254
|
if (err) {
|
|
384
|
-
|
|
385
|
-
|
|
255
|
+
done(err);
|
|
256
|
+
} else {
|
|
257
|
+
assertNock(done);
|
|
386
258
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
callback(null, obj);
|
|
404
|
-
});
|
|
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);
|
|
405
275
|
}
|
|
406
|
-
}
|
|
407
|
-
);
|
|
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
|
+
});
|
|
408
291
|
});
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Backup/restore callback
|
|
415
|
-
* @callback backupRestoreCallback
|
|
416
|
-
* @param {Error} err - Error object if operation failed.
|
|
417
|
-
* @param {object} data - summary data for backup/restore
|
|
418
|
-
*/
|
|
292
|
+
});
|
|
293
|
+
});
|