@cloudant/couchbackup 2.9.8 → 2.9.9-SNAPSHOT.96
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-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-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-8.pb +1 -0
- package/.scannerwork/scanner-report/changesets-9.pb +1 -0
- package/.scannerwork/scanner-report/component-1.pb +2 -1
- package/.scannerwork/scanner-report/component-10.pb +2 -0
- package/.scannerwork/scanner-report/component-11.pb +1 -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-2.pb +1 -0
- package/.scannerwork/scanner-report/component-23.pb +1 -1
- package/.scannerwork/scanner-report/component-24.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-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-32.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-35.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-5.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-69.pb +1 -1
- package/.scannerwork/scanner-report/component-7.pb +1 -1
- package/.scannerwork/scanner-report/component-70.pb +1 -0
- package/.scannerwork/scanner-report/component-8.pb +1 -0
- package/.scannerwork/scanner-report/component-9.pb +1 -0
- package/.scannerwork/scanner-report/coverages-11.pb +0 -0
- package/.scannerwork/scanner-report/coverages-13.pb +0 -0
- package/.scannerwork/scanner-report/coverages-16.pb +0 -0
- package/.scannerwork/scanner-report/coverages-18.pb +0 -0
- package/.scannerwork/scanner-report/coverages-2.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-30.pb +0 -0
- package/.scannerwork/scanner-report/coverages-31.pb +0 -0
- package/.scannerwork/scanner-report/coverages-32.pb +0 -0
- package/.scannerwork/scanner-report/coverages-33.pb +0 -0
- package/.scannerwork/scanner-report/coverages-34.pb +0 -0
- package/.scannerwork/scanner-report/coverages-35.pb +0 -0
- package/.scannerwork/scanner-report/coverages-36.pb +0 -0
- package/.scannerwork/scanner-report/coverages-37.pb +0 -0
- package/.scannerwork/scanner-report/coverages-38.pb +0 -0
- package/.scannerwork/scanner-report/coverages-5.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-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-6.pb +0 -0
- package/.scannerwork/scanner-report/coverages-64.pb +0 -0
- package/.scannerwork/scanner-report/coverages-7.pb +0 -0
- package/.scannerwork/scanner-report/duplications-23.pb +2 -0
- package/.scannerwork/scanner-report/duplications-24.pb +2 -0
- package/.scannerwork/scanner-report/duplications-32.pb +0 -2
- package/.scannerwork/scanner-report/duplications-33.pb +2 -0
- package/.scannerwork/scanner-report/duplications-36.pb +0 -2
- package/.scannerwork/scanner-report/duplications-5.pb +0 -3
- package/.scannerwork/scanner-report/duplications-52.pb +3 -0
- package/.scannerwork/scanner-report/duplications-53.pb +3 -0
- package/.scannerwork/scanner-report/duplications-57.pb +2 -0
- package/.scannerwork/scanner-report/duplications-6.pb +2 -0
- package/.scannerwork/scanner-report/duplications-60.pb +3 -0
- package/.scannerwork/scanner-report/duplications-62.pb +0 -0
- package/.scannerwork/scanner-report/duplications-63.pb +0 -0
- package/.scannerwork/scanner-report/duplications-64.pb +0 -0
- package/.scannerwork/scanner-report/duplications-8.pb +0 -0
- package/.scannerwork/scanner-report/duplications-9.pb +2 -0
- package/.scannerwork/scanner-report/measures-11.pb +0 -0
- package/.scannerwork/scanner-report/measures-13.pb +0 -0
- package/.scannerwork/scanner-report/measures-16.pb +0 -0
- package/.scannerwork/scanner-report/measures-18.pb +0 -0
- package/.scannerwork/scanner-report/measures-2.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-28.pb +0 -0
- package/.scannerwork/scanner-report/measures-29.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-32.pb +0 -0
- package/.scannerwork/scanner-report/measures-33.pb +0 -0
- package/.scannerwork/scanner-report/measures-34.pb +0 -0
- package/.scannerwork/scanner-report/measures-35.pb +0 -0
- package/.scannerwork/scanner-report/measures-36.pb +0 -0
- package/.scannerwork/scanner-report/measures-37.pb +0 -0
- package/.scannerwork/scanner-report/measures-38.pb +0 -0
- package/.scannerwork/scanner-report/measures-39.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-52.pb +0 -0
- package/.scannerwork/scanner-report/measures-53.pb +0 -0
- package/.scannerwork/scanner-report/measures-54.pb +0 -0
- package/.scannerwork/scanner-report/measures-55.pb +0 -0
- package/.scannerwork/scanner-report/measures-57.pb +0 -0
- package/.scannerwork/scanner-report/measures-58.pb +0 -0
- package/.scannerwork/scanner-report/measures-59.pb +0 -0
- package/.scannerwork/scanner-report/measures-6.pb +0 -0
- package/.scannerwork/scanner-report/measures-61.pb +0 -0
- package/.scannerwork/scanner-report/measures-62.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-69.pb +0 -0
- package/.scannerwork/scanner-report/measures-7.pb +0 -0
- package/.scannerwork/scanner-report/measures-70.pb +0 -0
- package/.scannerwork/scanner-report/metadata.pb +0 -0
- package/.scannerwork/scanner-report/source-11.txt +111 -0
- package/.scannerwork/scanner-report/source-13.txt +164 -0
- package/.scannerwork/scanner-report/source-16.txt +80 -0
- package/.scannerwork/scanner-report/source-18.txt +46 -0
- package/.scannerwork/scanner-report/source-2.txt +114 -0
- package/.scannerwork/scanner-report/source-23.txt +162 -64
- package/.scannerwork/scanner-report/source-24.txt +133 -583
- package/.scannerwork/scanner-report/source-28.txt +509 -142
- package/.scannerwork/scanner-report/source-29.txt +509 -366
- package/.scannerwork/scanner-report/source-3.txt +418 -0
- package/.scannerwork/scanner-report/source-30.txt +39 -19
- package/.scannerwork/scanner-report/source-31.txt +57 -80
- package/.scannerwork/scanner-report/source-32.txt +16 -127
- package/.scannerwork/scanner-report/source-33.txt +189 -120
- package/.scannerwork/scanner-report/source-34.txt +596 -39
- package/.scannerwork/scanner-report/source-35.txt +17 -129
- package/.scannerwork/scanner-report/source-36.txt +43 -200
- package/.scannerwork/scanner-report/source-37.txt +15 -93
- package/.scannerwork/scanner-report/source-38.txt +92 -167
- package/.scannerwork/scanner-report/source-39.txt +366 -0
- package/.scannerwork/scanner-report/source-5.txt +89 -229
- package/.scannerwork/scanner-report/source-51.txt +135 -59
- package/.scannerwork/scanner-report/source-52.txt +228 -95
- package/.scannerwork/scanner-report/source-53.txt +104 -31
- package/.scannerwork/scanner-report/source-54.txt +130 -147
- package/.scannerwork/scanner-report/source-55.txt +100 -509
- package/.scannerwork/scanner-report/source-57.txt +120 -52
- package/.scannerwork/scanner-report/source-58.txt +31 -40
- package/.scannerwork/scanner-report/source-59.txt +36 -509
- package/.scannerwork/scanner-report/source-6.txt +71 -47
- package/.scannerwork/scanner-report/source-61.txt +293 -509
- package/.scannerwork/scanner-report/source-62.txt +142 -0
- package/.scannerwork/scanner-report/source-64.txt +68 -0
- package/.scannerwork/scanner-report/source-65.txt +509 -190
- package/.scannerwork/scanner-report/source-69.txt +509 -418
- package/.scannerwork/scanner-report/source-7.txt +38 -31
- package/.scannerwork/scanner-report/source-70.txt +167 -0
- package/.scannerwork/scanner-report/symbols-11.pb +59 -0
- package/.scannerwork/scanner-report/symbols-13.pb +126 -0
- package/.scannerwork/scanner-report/symbols-16.pb +46 -0
- package/.scannerwork/scanner-report/symbols-18.pb +20 -0
- package/.scannerwork/scanner-report/symbols-2.pb +28 -0
- package/.scannerwork/scanner-report/symbols-23.pb +180 -60
- package/.scannerwork/scanner-report/symbols-24.pb +143 -1244
- package/.scannerwork/scanner-report/symbols-30.pb +19 -14
- package/.scannerwork/scanner-report/symbols-31.pb +29 -68
- package/.scannerwork/scanner-report/symbols-32.pb +10 -102
- package/.scannerwork/scanner-report/symbols-33.pb +410 -104
- package/.scannerwork/scanner-report/symbols-34.pb +1251 -33
- package/.scannerwork/scanner-report/symbols-35.pb +17 -85
- package/.scannerwork/scanner-report/symbols-36.pb +35 -417
- package/.scannerwork/scanner-report/symbols-37.pb +11 -28
- package/.scannerwork/scanner-report/symbols-38.pb +60 -0
- package/.scannerwork/scanner-report/symbols-5.pb +41 -393
- package/.scannerwork/scanner-report/symbols-51.pb +110 -44
- package/.scannerwork/scanner-report/symbols-52.pb +393 -58
- package/.scannerwork/scanner-report/symbols-53.pb +76 -19
- package/.scannerwork/scanner-report/symbols-54.pb +80 -121
- package/.scannerwork/scanner-report/symbols-55.pb +69 -0
- package/.scannerwork/scanner-report/symbols-57.pb +102 -30
- package/.scannerwork/scanner-report/symbols-58.pb +27 -19
- package/.scannerwork/scanner-report/symbols-59.pb +14 -0
- package/.scannerwork/scanner-report/symbols-6.pb +43 -44
- package/.scannerwork/scanner-report/symbols-64.pb +45 -0
- package/.scannerwork/scanner-report/symbols-7.pb +15 -27
- package/.scannerwork/scanner-report/syntax-highlightings-11.pb +133 -0
- package/.scannerwork/scanner-report/syntax-highlightings-13.pb +213 -0
- package/.scannerwork/scanner-report/syntax-highlightings-16.pb +95 -0
- package/.scannerwork/scanner-report/syntax-highlightings-18.pb +64 -0
- package/.scannerwork/scanner-report/syntax-highlightings-2.pb +138 -0
- package/.scannerwork/scanner-report/syntax-highlightings-23.pb +186 -71
- package/.scannerwork/scanner-report/syntax-highlightings-24.pb +142 -815
- package/.scannerwork/scanner-report/syntax-highlightings-28.pb +3736 -123
- package/.scannerwork/scanner-report/syntax-highlightings-29.pb +3504 -385
- package/.scannerwork/scanner-report/syntax-highlightings-3.pb +648 -0
- package/.scannerwork/scanner-report/syntax-highlightings-30.pb +63 -35
- package/.scannerwork/scanner-report/syntax-highlightings-31.pb +73 -75
- package/.scannerwork/scanner-report/syntax-highlightings-32.pb +14 -191
- package/.scannerwork/scanner-report/syntax-highlightings-33.pb +270 -162
- package/.scannerwork/scanner-report/syntax-highlightings-34.pb +849 -57
- package/.scannerwork/scanner-report/syntax-highlightings-35.pb +27 -155
- package/.scannerwork/scanner-report/syntax-highlightings-36.pb +58 -294
- package/.scannerwork/scanner-report/syntax-highlightings-37.pb +24 -103
- package/.scannerwork/scanner-report/syntax-highlightings-38.pb +99 -937
- package/.scannerwork/scanner-report/syntax-highlightings-39.pb +630 -0
- package/.scannerwork/scanner-report/syntax-highlightings-5.pb +85 -298
- package/.scannerwork/scanner-report/syntax-highlightings-51.pb +190 -62
- package/.scannerwork/scanner-report/syntax-highlightings-52.pb +292 -96
- package/.scannerwork/scanner-report/syntax-highlightings-53.pb +127 -33
- package/.scannerwork/scanner-report/syntax-highlightings-54.pb +151 -173
- package/.scannerwork/scanner-report/syntax-highlightings-55.pb +94 -3735
- package/.scannerwork/scanner-report/syntax-highlightings-57.pb +200 -76
- package/.scannerwork/scanner-report/syntax-highlightings-58.pb +45 -59
- package/.scannerwork/scanner-report/syntax-highlightings-59.pb +43 -3736
- package/.scannerwork/scanner-report/syntax-highlightings-6.pb +56 -76
- package/.scannerwork/scanner-report/syntax-highlightings-61.pb +398 -3487
- package/.scannerwork/scanner-report/syntax-highlightings-62.pb +134 -0
- package/.scannerwork/scanner-report/syntax-highlightings-64.pb +110 -0
- package/.scannerwork/scanner-report/syntax-highlightings-65.pb +3725 -202
- package/.scannerwork/scanner-report/syntax-highlightings-69.pb +3544 -445
- package/.scannerwork/scanner-report/syntax-highlightings-7.pb +24 -38
- package/.scannerwork/scanner-report/syntax-highlightings-70.pb +949 -0
- package/package.json +1 -1
- package/test-14-results.xml +158 -158
- package/test-16-results.xml +139 -139
- package/test-18-results.xml +155 -155
- package/test-19-results.xml +151 -151
- package/test-iam-18-results.xml +50 -50
- package/.scannerwork/scanner-report/changesets-19.pb +0 -1
- package/.scannerwork/scanner-report/changesets-20.pb +0 -1
- package/.scannerwork/scanner-report/changesets-21.pb +0 -1
- package/.scannerwork/scanner-report/changesets-22.pb +0 -1
- 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-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-49.pb +0 -1
- package/.scannerwork/scanner-report/changesets-50.pb +0 -1
- package/.scannerwork/scanner-report/changesets-65.pb +0 -1
- package/.scannerwork/scanner-report/changesets-66.pb +0 -1
- package/.scannerwork/scanner-report/changesets-69.pb +0 -1
- package/.scannerwork/scanner-report/component-19.pb +0 -1
- package/.scannerwork/scanner-report/component-20.pb +0 -1
- package/.scannerwork/scanner-report/component-21.pb +0 -1
- package/.scannerwork/scanner-report/component-22.pb +0 -1
- package/.scannerwork/scanner-report/component-25.pb +0 -1
- package/.scannerwork/scanner-report/component-26.pb +0 -1
- package/.scannerwork/scanner-report/component-27.pb +0 -1
- package/.scannerwork/scanner-report/component-4.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-49.pb +0 -1
- package/.scannerwork/scanner-report/component-50.pb +0 -1
- package/.scannerwork/scanner-report/component-66.pb +0 -1
- package/.scannerwork/scanner-report/coverages-20.pb +0 -0
- package/.scannerwork/scanner-report/coverages-22.pb +0 -0
- package/.scannerwork/scanner-report/coverages-27.pb +0 -0
- package/.scannerwork/scanner-report/coverages-4.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-65.pb +0 -0
- package/.scannerwork/scanner-report/coverages-66.pb +0 -0
- package/.scannerwork/scanner-report/duplications-19.pb +0 -3
- package/.scannerwork/scanner-report/duplications-22.pb +0 -3
- package/.scannerwork/scanner-report/duplications-43.pb +0 -2
- package/.scannerwork/scanner-report/duplications-45.pb +0 -2
- package/.scannerwork/scanner-report/duplications-65.pb +0 -2
- package/.scannerwork/scanner-report/duplications-66.pb +0 -2
- package/.scannerwork/scanner-report/measures-20.pb +0 -0
- package/.scannerwork/scanner-report/measures-21.pb +0 -15
- package/.scannerwork/scanner-report/measures-22.pb +0 -0
- package/.scannerwork/scanner-report/measures-27.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-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-66.pb +0 -0
- package/.scannerwork/scanner-report/source-20.txt +0 -35
- package/.scannerwork/scanner-report/source-21.txt +0 -293
- package/.scannerwork/scanner-report/source-22.txt +0 -119
- package/.scannerwork/scanner-report/source-27.txt +0 -36
- package/.scannerwork/scanner-report/source-4.txt +0 -34
- package/.scannerwork/scanner-report/source-40.txt +0 -509
- 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-66.txt +0 -175
- package/.scannerwork/scanner-report/symbols-20.pb +0 -17
- package/.scannerwork/scanner-report/symbols-22.pb +0 -77
- package/.scannerwork/scanner-report/symbols-27.pb +0 -11
- package/.scannerwork/scanner-report/symbols-4.pb +0 -10
- 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-65.pb +0 -180
- package/.scannerwork/scanner-report/symbols-66.pb +0 -153
- package/.scannerwork/scanner-report/syntax-highlightings-20.pb +0 -63
- package/.scannerwork/scanner-report/syntax-highlightings-21.pb +0 -659
- package/.scannerwork/scanner-report/syntax-highlightings-22.pb +0 -158
- package/.scannerwork/scanner-report/syntax-highlightings-27.pb +0 -59
- package/.scannerwork/scanner-report/syntax-highlightings-4.pb +0 -50
- package/.scannerwork/scanner-report/syntax-highlightings-40.pb +0 -3749
- 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-66.pb +0 -214
- /package/.scannerwork/scanner-report/{coverages-49.pb → coverages-10.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-44.pb → coverages-12.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-41.pb → coverages-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-47.pb → coverages-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-48.pb → coverages-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-69.pb → coverages-3.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-29.pb → coverages-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-25.pb → coverages-56.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-19.pb → coverages-60.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-21.pb → coverages-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-28.pb → coverages-62.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-26.pb → coverages-63.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-50.pb → coverages-8.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-45.pb → coverages-9.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-20.pb → duplications-10.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-4.pb → duplications-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-41.pb → duplications-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-42.pb → duplications-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-44.pb → duplications-18.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-46.pb → duplications-2.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-47.pb → duplications-3.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-48.pb → duplications-38.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-49.pb → duplications-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-50.pb → duplications-55.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-69.pb → duplications-59.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-21.pb → duplications-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-29.pb → issues-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-5.pb → issues-52.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-7.pb → issues-58.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-28.pb → issues-62.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-49.pb → measures-10.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-44.pb → measures-12.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-41.pb → measures-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-47.pb → measures-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-48.pb → measures-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-25.pb → measures-56.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-19.pb → measures-60.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-26.pb → measures-63.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-50.pb → measures-8.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-45.pb → measures-9.pb} +0 -0
- /package/.scannerwork/scanner-report/{source-49.txt → source-10.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-44.txt → source-12.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-41.txt → source-14.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-47.txt → source-15.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-48.txt → source-17.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-25.txt → source-56.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-19.txt → source-60.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-26.txt → source-63.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-50.txt → source-8.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-45.txt → source-9.txt} +0 -0
- /package/.scannerwork/scanner-report/{symbols-49.pb → symbols-10.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-44.pb → symbols-12.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-41.pb → symbols-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-47.pb → symbols-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-48.pb → symbols-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-69.pb → symbols-3.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-29.pb → symbols-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-25.pb → symbols-56.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-19.pb → symbols-60.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-21.pb → symbols-61.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-28.pb → symbols-62.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-26.pb → symbols-63.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-50.pb → symbols-8.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-45.pb → symbols-9.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-49.pb → syntax-highlightings-10.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-44.pb → syntax-highlightings-12.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-41.pb → syntax-highlightings-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-47.pb → syntax-highlightings-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-48.pb → syntax-highlightings-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-25.pb → syntax-highlightings-56.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-19.pb → syntax-highlightings-60.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-26.pb → syntax-highlightings-63.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-50.pb → syntax-highlightings-8.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-45.pb → syntax-highlightings-9.pb} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Copyright © 2017, 2022 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const liner = require('./liner.js');
|
|
18
|
+
const change = require('./change.js');
|
|
19
|
+
const error = require('./error.js');
|
|
20
|
+
const debug = require('debug')('couchbackup:spoolchanges');
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Write log file for all changes from a database, ready for downloading
|
|
24
|
+
* in batches.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} dbUrl - URL of database
|
|
27
|
+
* @param {string} log - path to log file to use
|
|
28
|
+
* @param {number} bufferSize - the number of changes per batch/log line
|
|
29
|
+
* @param {function(err)} callback - a callback to run on completion
|
|
30
|
+
*/
|
|
31
|
+
module.exports = function(db, log, bufferSize, ee, callback) {
|
|
32
|
+
// list of document ids to process
|
|
33
|
+
const buffer = [];
|
|
34
|
+
let batch = 0;
|
|
35
|
+
let lastSeq = null;
|
|
36
|
+
const logStream = fs.createWriteStream(log);
|
|
37
|
+
let pending = 0;
|
|
38
|
+
// The number of changes to fetch per request
|
|
39
|
+
const limit = 100000;
|
|
40
|
+
|
|
41
|
+
// send documents ids to the queue in batches of bufferSize + the last batch
|
|
42
|
+
const processBuffer = function(lastOne) {
|
|
43
|
+
if (buffer.length >= bufferSize || (lastOne && buffer.length > 0)) {
|
|
44
|
+
debug('writing', buffer.length, 'changes to the backup file');
|
|
45
|
+
const b = { docs: buffer.splice(0, bufferSize), batch: batch };
|
|
46
|
+
logStream.write(':t batch' + batch + ' ' + JSON.stringify(b.docs) + '\n');
|
|
47
|
+
ee.emit('changes', batch);
|
|
48
|
+
batch++;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// called once per received change
|
|
53
|
+
const onChange = function(c) {
|
|
54
|
+
if (c) {
|
|
55
|
+
if (c.error) {
|
|
56
|
+
ee.emit('error', new error.BackupError('InvalidChange', `Received invalid change: ${c}`));
|
|
57
|
+
} else if (c.changes) {
|
|
58
|
+
const obj = { id: c.id };
|
|
59
|
+
buffer.push(obj);
|
|
60
|
+
processBuffer(false);
|
|
61
|
+
} else if (c.last_seq) {
|
|
62
|
+
lastSeq = c.last_seq;
|
|
63
|
+
pending = c.pending;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
function getChanges(since = 0) {
|
|
69
|
+
debug('making changes request since ' + since);
|
|
70
|
+
return db.service.postChangesAsStream({ db: db.db, since: since, limit: limit, seqInterval: limit })
|
|
71
|
+
.then(response => {
|
|
72
|
+
response.result.pipe(liner())
|
|
73
|
+
.on('error', function(err) {
|
|
74
|
+
logStream.end();
|
|
75
|
+
callback(err);
|
|
76
|
+
})
|
|
77
|
+
.pipe(change(onChange))
|
|
78
|
+
.on('error', function(err) {
|
|
79
|
+
logStream.end();
|
|
80
|
+
callback(err);
|
|
81
|
+
})
|
|
82
|
+
.on('finish', function() {
|
|
83
|
+
processBuffer(true);
|
|
84
|
+
if (!lastSeq) {
|
|
85
|
+
logStream.end();
|
|
86
|
+
debug('changes request terminated before last_seq was sent');
|
|
87
|
+
callback(new error.BackupError('SpoolChangesError', 'Changes request terminated before last_seq was sent'));
|
|
88
|
+
} else {
|
|
89
|
+
debug(`changes request completed with last_seq: ${lastSeq} and ${pending} changes pending.`);
|
|
90
|
+
if (pending > 0) {
|
|
91
|
+
// Return the next promise
|
|
92
|
+
return getChanges(lastSeq);
|
|
93
|
+
} else {
|
|
94
|
+
debug('finished streaming database changes');
|
|
95
|
+
logStream.end(':changes_complete ' + lastSeq + '\n', 'utf8', callback);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
})
|
|
100
|
+
.catch(err => {
|
|
101
|
+
logStream.end();
|
|
102
|
+
if (err.status && err.status >= 400) {
|
|
103
|
+
callback(error.convertResponseError(err));
|
|
104
|
+
} else if (err.name !== 'SpoolChangesError') {
|
|
105
|
+
callback(new error.BackupError('SpoolChangesError', `Failed changes request - ${err.message}`));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
getChanges();
|
|
111
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Copyright © 2017, 2021 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const async = require('async');
|
|
17
|
+
const stream = require('stream');
|
|
18
|
+
const error = require('./error.js');
|
|
19
|
+
const debug = require('debug')('couchbackup:writer');
|
|
20
|
+
|
|
21
|
+
module.exports = function(db, bufferSize, parallelism, ee) {
|
|
22
|
+
const writer = new stream.Transform({ objectMode: true });
|
|
23
|
+
let buffer = [];
|
|
24
|
+
let written = 0;
|
|
25
|
+
let linenumber = 0;
|
|
26
|
+
|
|
27
|
+
// this is the queue of chunks that are written to the database
|
|
28
|
+
// the queue's payload will be an array of documents to be written,
|
|
29
|
+
// the size of the array will be bufferSize. The variable parallelism
|
|
30
|
+
// determines how many HTTP requests will occur at any one time.
|
|
31
|
+
const q = async.queue(function(payload, cb) {
|
|
32
|
+
// if we are restoring known revisions, we need to supply new_edits=false
|
|
33
|
+
if (payload.docs && payload.docs[0] && payload.docs[0]._rev) {
|
|
34
|
+
payload.new_edits = false;
|
|
35
|
+
debug('Using new_edits false mode.');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!didError) {
|
|
39
|
+
db.service.postBulkDocs({
|
|
40
|
+
db: db.db,
|
|
41
|
+
bulkDocs: payload
|
|
42
|
+
}).then(response => {
|
|
43
|
+
if (!response.result || (payload.new_edits === false && response.result.length > 0)) {
|
|
44
|
+
throw new Error(`Error writing batch with new_edits:${payload.new_edits !== false}` +
|
|
45
|
+
` and ${response.result ? response.result.length : 'unavailable'} items`);
|
|
46
|
+
}
|
|
47
|
+
written += payload.docs.length;
|
|
48
|
+
writer.emit('restored', { documents: payload.docs.length, total: written });
|
|
49
|
+
cb();
|
|
50
|
+
}).catch(err => {
|
|
51
|
+
err = error.convertResponseError(err);
|
|
52
|
+
debug(`Error writing docs ${err.name} ${err.message}`);
|
|
53
|
+
cb(err, payload);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}, parallelism);
|
|
57
|
+
|
|
58
|
+
let didError = false;
|
|
59
|
+
|
|
60
|
+
// write the contents of the buffer to CouchDB in blocks of bufferSize
|
|
61
|
+
function processBuffer(flush, callback) {
|
|
62
|
+
function taskCallback(err, payload) {
|
|
63
|
+
if (err && !didError) {
|
|
64
|
+
debug(`Queue task failed with error ${err.name}`);
|
|
65
|
+
didError = true;
|
|
66
|
+
q.kill();
|
|
67
|
+
writer.emit('error', err);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (flush || buffer.length >= bufferSize) {
|
|
72
|
+
// work through the buffer to break off bufferSize chunks
|
|
73
|
+
// and feed the chunks to the queue
|
|
74
|
+
do {
|
|
75
|
+
// split the buffer into bufferSize chunks
|
|
76
|
+
const toSend = buffer.splice(0, bufferSize);
|
|
77
|
+
|
|
78
|
+
// and add the chunk to the queue
|
|
79
|
+
debug(`Adding ${toSend.length} to the write queue.`);
|
|
80
|
+
q.push({ docs: toSend }, taskCallback);
|
|
81
|
+
} while (buffer.length >= bufferSize);
|
|
82
|
+
|
|
83
|
+
// send any leftover documents to the queue
|
|
84
|
+
if (flush && buffer.length > 0) {
|
|
85
|
+
debug(`Adding remaining ${buffer.length} to the write queue.`);
|
|
86
|
+
q.push({ docs: buffer }, taskCallback);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// wait until the queue size falls to a reasonable level
|
|
90
|
+
async.until(
|
|
91
|
+
// wait until the queue length drops to twice the paralellism
|
|
92
|
+
// or until empty on the last write
|
|
93
|
+
function(callback) {
|
|
94
|
+
// if we encountered an error, stop this until loop
|
|
95
|
+
if (didError) {
|
|
96
|
+
return callback(null, true);
|
|
97
|
+
}
|
|
98
|
+
if (flush) {
|
|
99
|
+
callback(null, q.idle() && q.length() === 0);
|
|
100
|
+
} else {
|
|
101
|
+
callback(null, q.length() <= parallelism * 2);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
function(cb) {
|
|
105
|
+
setTimeout(cb, 20);
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
function() {
|
|
109
|
+
if (flush && !didError) {
|
|
110
|
+
writer.emit('finished', { total: written });
|
|
111
|
+
}
|
|
112
|
+
// callback when we're happy with the queue size
|
|
113
|
+
callback();
|
|
114
|
+
});
|
|
115
|
+
} else {
|
|
116
|
+
callback();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// take an object
|
|
121
|
+
writer._transform = function(obj, encoding, done) {
|
|
122
|
+
// each obj that arrives here is a line from the backup file
|
|
123
|
+
// it should contain an array of objects. The length of the array
|
|
124
|
+
// depends on the bufferSize at backup time.
|
|
125
|
+
linenumber++;
|
|
126
|
+
if (!didError && obj !== '') {
|
|
127
|
+
// see if it parses as JSON
|
|
128
|
+
try {
|
|
129
|
+
const arr = JSON.parse(obj);
|
|
130
|
+
|
|
131
|
+
// if it's an array with a length
|
|
132
|
+
if (typeof arr === 'object' && arr.length > 0) {
|
|
133
|
+
// push each document into a buffer
|
|
134
|
+
buffer = buffer.concat(arr);
|
|
135
|
+
|
|
136
|
+
// pause the stream
|
|
137
|
+
// it's likely that the speed with which data can be read from disk
|
|
138
|
+
// may exceed the rate it can be written to CouchDB. To prevent
|
|
139
|
+
// the whole file being buffered in memory, we pause the stream here.
|
|
140
|
+
// it is resumed, when processBuffer calls back and we call done()
|
|
141
|
+
this.pause();
|
|
142
|
+
|
|
143
|
+
// break the buffer in to bufferSize chunks to be written to the database
|
|
144
|
+
processBuffer(false, done);
|
|
145
|
+
} else {
|
|
146
|
+
ee.emit('error', new error.BackupError('BackupFileJsonError', `Error on line ${linenumber} of backup file - not an array`));
|
|
147
|
+
done();
|
|
148
|
+
}
|
|
149
|
+
} catch (e) {
|
|
150
|
+
ee.emit('error', new error.BackupError('BackupFileJsonError', `Error on line ${linenumber} of backup file - cannot parse as JSON`));
|
|
151
|
+
// Could be an incomplete write that was subsequently resumed
|
|
152
|
+
done();
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
done();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// called when we need to flush everything
|
|
160
|
+
writer._flush = function(done) {
|
|
161
|
+
processBuffer(true, done);
|
|
162
|
+
};
|
|
163
|
+
return writer;
|
|
164
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Copyright © 2017, 2022 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const async = require('async');
|
|
17
|
+
const error = require('./error.js');
|
|
18
|
+
const events = require('events');
|
|
19
|
+
|
|
20
|
+
module.exports = function(db, options) {
|
|
21
|
+
const ee = new events.EventEmitter();
|
|
22
|
+
const start = new Date().getTime();
|
|
23
|
+
let batch = 0;
|
|
24
|
+
let hasErrored = false;
|
|
25
|
+
let startKey = null;
|
|
26
|
+
let total = 0;
|
|
27
|
+
|
|
28
|
+
async.doUntil(
|
|
29
|
+
function(callback) {
|
|
30
|
+
// Note, include_docs: true is set automatically when using the
|
|
31
|
+
// fetch function.
|
|
32
|
+
const opts = { db: db.db, limit: options.bufferSize, includeDocs: true };
|
|
33
|
+
|
|
34
|
+
// To avoid double fetching a document solely for the purposes of getting
|
|
35
|
+
// the next ID to use as a startKey for the next page we instead use the
|
|
36
|
+
// last ID of the current page and append the lowest unicode sort
|
|
37
|
+
// character.
|
|
38
|
+
if (startKey) opts.startKey = `${startKey}\0`;
|
|
39
|
+
db.service.postAllDocs(opts).then(response => {
|
|
40
|
+
const body = response.result;
|
|
41
|
+
if (!body.rows) {
|
|
42
|
+
ee.emit('error', new error.BackupError(
|
|
43
|
+
'AllDocsError', 'ERROR: Invalid all docs response'));
|
|
44
|
+
callback();
|
|
45
|
+
} else {
|
|
46
|
+
if (body.rows.length < opts.limit) {
|
|
47
|
+
startKey = null; // last batch
|
|
48
|
+
} else {
|
|
49
|
+
startKey = body.rows[opts.limit - 1].id;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const docs = [];
|
|
53
|
+
body.rows.forEach(function(doc) {
|
|
54
|
+
docs.push(doc.doc);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (docs.length > 0) {
|
|
58
|
+
ee.emit('received', {
|
|
59
|
+
batch: batch++,
|
|
60
|
+
data: docs,
|
|
61
|
+
length: docs.length,
|
|
62
|
+
time: (new Date().getTime() - start) / 1000,
|
|
63
|
+
total: total += docs.length
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
callback();
|
|
67
|
+
}
|
|
68
|
+
}).catch(err => {
|
|
69
|
+
err = error.convertResponseError(err);
|
|
70
|
+
ee.emit('error', err);
|
|
71
|
+
hasErrored = true;
|
|
72
|
+
callback();
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
function(callback) { callback(null, hasErrored || startKey == null); },
|
|
76
|
+
function() { ee.emit('finished', { total: total }); }
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
return ee;
|
|
80
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
// stolen from http://strongloop.com/strongblog/practical-examples-of-the-new-node-js-streams-api/
|
|
17
|
+
const stream = require('stream');
|
|
18
|
+
|
|
19
|
+
module.exports = function() {
|
|
20
|
+
const liner = new stream.Transform({ objectMode: true });
|
|
21
|
+
|
|
22
|
+
liner._transform = function(chunk, encoding, done) {
|
|
23
|
+
let data = chunk.toString();
|
|
24
|
+
if (this._lastLineData) {
|
|
25
|
+
data = this._lastLineData + data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const lines = data.split('\n');
|
|
29
|
+
this._lastLineData = lines.splice(lines.length - 1, 1)[0];
|
|
30
|
+
|
|
31
|
+
for (const i in lines) {
|
|
32
|
+
this.push(lines[i]);
|
|
33
|
+
}
|
|
34
|
+
done();
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
liner._flush = function(done) {
|
|
38
|
+
if (this._lastLineData) {
|
|
39
|
+
this.push(this._lastLineData);
|
|
40
|
+
}
|
|
41
|
+
this._lastLineData = null;
|
|
42
|
+
done();
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return liner;
|
|
46
|
+
};
|
|
@@ -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
|
+
});
|