@cloudant/couchbackup 2.9.8-SNAPSHOT.94 → 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/analysis.log +1 -1
- 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-36.pb +1 -0
- package/.scannerwork/scanner-report/changesets-37.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-51.pb +1 -0
- package/.scannerwork/scanner-report/changesets-52.pb +1 -0
- package/.scannerwork/scanner-report/changesets-6.pb +0 -0
- package/.scannerwork/scanner-report/changesets-7.pb +1 -0
- package/.scannerwork/scanner-report/changesets-8.pb +1 -0
- package/.scannerwork/scanner-report/changesets-9.pb +1 -0
- package/.scannerwork/scanner-report/component-1.pb +2 -1
- package/.scannerwork/scanner-report/component-10.pb +2 -0
- package/.scannerwork/scanner-report/component-11.pb +1 -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 -1
- package/.scannerwork/scanner-report/component-2.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-28.pb +1 -1
- package/.scannerwork/scanner-report/component-29.pb +1 -1
- package/.scannerwork/scanner-report/component-3.pb +1 -1
- 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 -0
- 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 -0
- package/.scannerwork/scanner-report/component-53.pb +1 -1
- package/.scannerwork/scanner-report/component-54.pb +1 -1
- package/.scannerwork/scanner-report/component-55.pb +1 -1
- package/.scannerwork/scanner-report/component-56.pb +1 -1
- package/.scannerwork/scanner-report/component-57.pb +1 -1
- package/.scannerwork/scanner-report/component-58.pb +1 -1
- package/.scannerwork/scanner-report/component-59.pb +1 -1
- package/.scannerwork/scanner-report/component-6.pb +1 -1
- package/.scannerwork/scanner-report/component-60.pb +1 -1
- package/.scannerwork/scanner-report/component-61.pb +1 -1
- package/.scannerwork/scanner-report/component-62.pb +1 -1
- package/.scannerwork/scanner-report/component-63.pb +1 -1
- package/.scannerwork/scanner-report/component-64.pb +1 -1
- package/.scannerwork/scanner-report/component-65.pb +1 -1
- package/.scannerwork/scanner-report/component-69.pb +1 -1
- package/.scannerwork/scanner-report/component-7.pb +1 -0
- package/.scannerwork/scanner-report/component-70.pb +1 -1
- package/.scannerwork/scanner-report/component-8.pb +1 -0
- package/.scannerwork/scanner-report/component-9.pb +1 -0
- package/.scannerwork/scanner-report/coverages-10.pb +0 -0
- package/.scannerwork/scanner-report/coverages-11.pb +0 -0
- package/.scannerwork/scanner-report/coverages-12.pb +0 -0
- package/.scannerwork/scanner-report/coverages-13.pb +0 -0
- package/.scannerwork/scanner-report/coverages-15.pb +0 -0
- package/.scannerwork/scanner-report/coverages-16.pb +0 -0
- package/.scannerwork/scanner-report/coverages-17.pb +0 -0
- package/.scannerwork/scanner-report/coverages-18.pb +0 -0
- package/.scannerwork/scanner-report/coverages-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-3.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-5.pb +0 -0
- package/.scannerwork/scanner-report/coverages-52.pb +0 -0
- package/.scannerwork/scanner-report/coverages-53.pb +0 -0
- package/.scannerwork/scanner-report/coverages-54.pb +0 -0
- package/.scannerwork/scanner-report/coverages-55.pb +0 -0
- package/.scannerwork/scanner-report/coverages-56.pb +0 -0
- package/.scannerwork/scanner-report/coverages-57.pb +0 -0
- package/.scannerwork/scanner-report/coverages-58.pb +0 -0
- package/.scannerwork/scanner-report/coverages-59.pb +0 -0
- package/.scannerwork/scanner-report/coverages-6.pb +0 -0
- package/.scannerwork/scanner-report/coverages-60.pb +0 -0
- package/.scannerwork/scanner-report/coverages-61.pb +0 -0
- package/.scannerwork/scanner-report/coverages-62.pb +0 -0
- package/.scannerwork/scanner-report/coverages-63.pb +0 -0
- package/.scannerwork/scanner-report/coverages-64.pb +0 -0
- package/.scannerwork/scanner-report/coverages-7.pb +0 -0
- package/.scannerwork/scanner-report/coverages-9.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-3.pb +0 -3
- package/.scannerwork/scanner-report/duplications-32.pb +0 -3
- package/.scannerwork/scanner-report/duplications-33.pb +2 -0
- package/.scannerwork/scanner-report/duplications-34.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 -2
- package/.scannerwork/scanner-report/duplications-60.pb +2 -1
- package/.scannerwork/scanner-report/duplications-61.pb +2 -0
- package/.scannerwork/scanner-report/duplications-62.pb +0 -2
- package/.scannerwork/scanner-report/duplications-9.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-12.pb +16 -0
- package/.scannerwork/scanner-report/measures-13.pb +0 -0
- package/.scannerwork/scanner-report/measures-14.pb +0 -0
- package/.scannerwork/scanner-report/measures-15.pb +0 -0
- package/.scannerwork/scanner-report/measures-16.pb +0 -0
- package/.scannerwork/scanner-report/measures-17.pb +0 -0
- package/.scannerwork/scanner-report/measures-18.pb +0 -0
- package/.scannerwork/scanner-report/measures-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-37.pb +0 -0
- package/.scannerwork/scanner-report/measures-38.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-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-60.pb +0 -0
- package/.scannerwork/scanner-report/measures-61.pb +0 -0
- package/.scannerwork/scanner-report/measures-62.pb +0 -0
- package/.scannerwork/scanner-report/measures-63.pb +0 -0
- package/.scannerwork/scanner-report/measures-64.pb +0 -0
- package/.scannerwork/scanner-report/measures-65.pb +0 -0
- package/.scannerwork/scanner-report/measures-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/measures-9.pb +0 -0
- package/.scannerwork/scanner-report/metadata.pb +0 -0
- package/.scannerwork/scanner-report/source-10.txt +129 -0
- package/.scannerwork/scanner-report/source-11.txt +111 -0
- package/.scannerwork/scanner-report/source-12.txt +178 -0
- package/.scannerwork/scanner-report/source-13.txt +164 -0
- package/.scannerwork/scanner-report/source-14.txt +31 -0
- package/.scannerwork/scanner-report/source-15.txt +41 -0
- package/.scannerwork/scanner-report/source-16.txt +80 -0
- package/.scannerwork/scanner-report/source-17.txt +118 -0
- package/.scannerwork/scanner-report/source-18.txt +30 -47
- package/.scannerwork/scanner-report/source-2.txt +92 -125
- package/.scannerwork/scanner-report/source-23.txt +173 -17
- package/.scannerwork/scanner-report/source-24.txt +153 -14
- package/.scannerwork/scanner-report/source-28.txt +509 -100
- package/.scannerwork/scanner-report/source-29.txt +509 -142
- package/.scannerwork/scanner-report/source-3.txt +391 -217
- package/.scannerwork/scanner-report/source-30.txt +36 -48
- package/.scannerwork/scanner-report/source-31.txt +57 -605
- package/.scannerwork/scanner-report/source-32.txt +13 -98
- package/.scannerwork/scanner-report/source-33.txt +206 -10
- package/.scannerwork/scanner-report/source-34.txt +584 -184
- package/.scannerwork/scanner-report/source-35.txt +16 -95
- package/.scannerwork/scanner-report/source-37.txt +36 -509
- package/.scannerwork/scanner-report/source-38.txt +92 -167
- package/.scannerwork/scanner-report/source-5.txt +86 -113
- package/.scannerwork/scanner-report/source-51.txt +156 -509
- package/.scannerwork/scanner-report/source-52.txt +244 -0
- package/.scannerwork/scanner-report/source-53.txt +99 -144
- package/.scannerwork/scanner-report/source-54.txt +133 -32
- package/.scannerwork/scanner-report/source-55.txt +74 -152
- package/.scannerwork/scanner-report/source-56.txt +15 -115
- package/.scannerwork/scanner-report/source-57.txt +126 -22
- package/.scannerwork/scanner-report/source-58.txt +31 -38
- package/.scannerwork/scanner-report/source-59.txt +19 -94
- package/.scannerwork/scanner-report/source-6.txt +71 -272
- package/.scannerwork/scanner-report/source-60.txt +110 -71
- package/.scannerwork/scanner-report/source-61.txt +275 -62
- package/.scannerwork/scanner-report/source-62.txt +127 -60
- package/.scannerwork/scanner-report/source-63.txt +48 -89
- package/.scannerwork/scanner-report/source-64.txt +50 -100
- package/.scannerwork/scanner-report/source-65.txt +509 -31
- package/.scannerwork/scanner-report/source-69.txt +509 -56
- package/.scannerwork/scanner-report/source-7.txt +54 -0
- package/.scannerwork/scanner-report/source-70.txt +167 -418
- package/.scannerwork/scanner-report/source-9.txt +75 -0
- package/.scannerwork/scanner-report/symbols-10.pb +33 -0
- package/.scannerwork/scanner-report/symbols-11.pb +59 -0
- package/.scannerwork/scanner-report/symbols-12.pb +144 -0
- package/.scannerwork/scanner-report/symbols-13.pb +126 -0
- package/.scannerwork/scanner-report/symbols-15.pb +18 -0
- package/.scannerwork/scanner-report/symbols-16.pb +46 -0
- package/.scannerwork/scanner-report/symbols-17.pb +30 -0
- package/.scannerwork/scanner-report/symbols-18.pb +19 -42
- package/.scannerwork/scanner-report/symbols-2.pb +28 -85
- package/.scannerwork/scanner-report/symbols-23.pb +180 -10
- package/.scannerwork/scanner-report/symbols-24.pb +153 -14
- package/.scannerwork/scanner-report/symbols-3.pb +545 -329
- package/.scannerwork/scanner-report/symbols-30.pb +18 -44
- package/.scannerwork/scanner-report/symbols-31.pb +29 -1253
- package/.scannerwork/scanner-report/symbols-32.pb +9 -76
- package/.scannerwork/scanner-report/symbols-33.pb +418 -9
- package/.scannerwork/scanner-report/symbols-34.pb +1175 -339
- package/.scannerwork/scanner-report/symbols-35.pb +17 -28
- package/.scannerwork/scanner-report/symbols-5.pb +42 -97
- package/.scannerwork/scanner-report/symbols-52.pb +394 -0
- package/.scannerwork/scanner-report/symbols-53.pb +73 -122
- package/.scannerwork/scanner-report/symbols-54.pb +84 -19
- package/.scannerwork/scanner-report/symbols-55.pb +68 -143
- package/.scannerwork/scanner-report/symbols-56.pb +9 -33
- package/.scannerwork/scanner-report/symbols-57.pb +102 -18
- package/.scannerwork/scanner-report/symbols-58.pb +27 -15
- package/.scannerwork/scanner-report/symbols-59.pb +14 -59
- package/.scannerwork/scanner-report/symbols-6.pb +43 -485
- package/.scannerwork/scanner-report/symbols-60.pb +97 -44
- package/.scannerwork/scanner-report/symbols-61.pb +485 -45
- package/.scannerwork/scanner-report/symbols-62.pb +115 -41
- package/.scannerwork/scanner-report/symbols-63.pb +41 -40
- package/.scannerwork/scanner-report/symbols-64.pb +45 -30
- package/.scannerwork/scanner-report/symbols-7.pb +15 -0
- package/.scannerwork/scanner-report/symbols-9.pb +42 -0
- package/.scannerwork/scanner-report/syntax-highlightings-10.pb +129 -0
- package/.scannerwork/scanner-report/syntax-highlightings-11.pb +133 -0
- package/.scannerwork/scanner-report/syntax-highlightings-12.pb +243 -0
- package/.scannerwork/scanner-report/syntax-highlightings-13.pb +213 -0
- package/.scannerwork/scanner-report/syntax-highlightings-14.pb +45 -0
- package/.scannerwork/scanner-report/syntax-highlightings-15.pb +50 -0
- package/.scannerwork/scanner-report/syntax-highlightings-16.pb +95 -0
- package/.scannerwork/scanner-report/syntax-highlightings-17.pb +113 -0
- package/.scannerwork/scanner-report/syntax-highlightings-18.pb +33 -51
- package/.scannerwork/scanner-report/syntax-highlightings-2.pb +103 -156
- package/.scannerwork/scanner-report/syntax-highlightings-23.pb +196 -21
- package/.scannerwork/scanner-report/syntax-highlightings-24.pb +185 -25
- package/.scannerwork/scanner-report/syntax-highlightings-28.pb +3736 -94
- package/.scannerwork/scanner-report/syntax-highlightings-29.pb +3738 -123
- package/.scannerwork/scanner-report/syntax-highlightings-3.pb +513 -194
- package/.scannerwork/scanner-report/syntax-highlightings-30.pb +57 -85
- package/.scannerwork/scanner-report/syntax-highlightings-31.pb +72 -856
- package/.scannerwork/scanner-report/syntax-highlightings-32.pb +11 -119
- package/.scannerwork/scanner-report/syntax-highlightings-33.pb +297 -14
- package/.scannerwork/scanner-report/syntax-highlightings-34.pb +761 -205
- package/.scannerwork/scanner-report/syntax-highlightings-35.pb +27 -102
- package/.scannerwork/scanner-report/syntax-highlightings-37.pb +48 -3737
- package/.scannerwork/scanner-report/syntax-highlightings-38.pb +99 -938
- package/.scannerwork/scanner-report/syntax-highlightings-5.pb +87 -153
- package/.scannerwork/scanner-report/syntax-highlightings-51.pb +201 -3727
- package/.scannerwork/scanner-report/syntax-highlightings-52.pb +329 -0
- package/.scannerwork/scanner-report/syntax-highlightings-53.pb +121 -176
- package/.scannerwork/scanner-report/syntax-highlightings-54.pb +162 -35
- package/.scannerwork/scanner-report/syntax-highlightings-55.pb +67 -205
- package/.scannerwork/scanner-report/syntax-highlightings-56.pb +16 -97
- package/.scannerwork/scanner-report/syntax-highlightings-57.pb +198 -21
- package/.scannerwork/scanner-report/syntax-highlightings-58.pb +38 -24
- package/.scannerwork/scanner-report/syntax-highlightings-59.pb +22 -101
- package/.scannerwork/scanner-report/syntax-highlightings-6.pb +55 -624
- package/.scannerwork/scanner-report/syntax-highlightings-60.pb +149 -57
- package/.scannerwork/scanner-report/syntax-highlightings-61.pb +625 -61
- package/.scannerwork/scanner-report/syntax-highlightings-62.pb +102 -46
- package/.scannerwork/scanner-report/syntax-highlightings-63.pb +52 -86
- package/.scannerwork/scanner-report/syntax-highlightings-64.pb +80 -83
- package/.scannerwork/scanner-report/syntax-highlightings-65.pb +3737 -34
- package/.scannerwork/scanner-report/syntax-highlightings-69.pb +3720 -55
- package/.scannerwork/scanner-report/syntax-highlightings-7.pb +54 -0
- package/.scannerwork/scanner-report/syntax-highlightings-70.pb +809 -508
- package/.scannerwork/scanner-report/syntax-highlightings-9.pb +78 -0
- package/CHANGES.md +3 -0
- package/package.json +1 -1
- package/test-14-results.xml +149 -149
- package/test-16-results.xml +158 -158
- package/test-18-results.xml +151 -151
- package/test-19-results.xml +166 -166
- 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-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-68.pb +0 -1
- package/.scannerwork/scanner-report/changesets-69.pb +0 -1
- package/.scannerwork/scanner-report/changesets-70.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-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/component-67.pb +0 -1
- package/.scannerwork/scanner-report/component-68.pb +0 -1
- package/.scannerwork/scanner-report/coverages-21.pb +0 -0
- package/.scannerwork/scanner-report/coverages-25.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-49.pb +0 -0
- package/.scannerwork/scanner-report/coverages-50.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/coverages-70.pb +0 -0
- package/.scannerwork/scanner-report/duplications-25.pb +0 -2
- package/.scannerwork/scanner-report/duplications-49.pb +0 -2
- package/.scannerwork/scanner-report/duplications-50.pb +0 -2
- 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-25.pb +0 -0
- package/.scannerwork/scanner-report/measures-27.pb +0 -0
- package/.scannerwork/scanner-report/measures-40.pb +0 -0
- package/.scannerwork/scanner-report/measures-49.pb +0 -0
- package/.scannerwork/scanner-report/measures-50.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/source-19.txt +0 -36
- package/.scannerwork/scanner-report/source-20.txt +0 -92
- package/.scannerwork/scanner-report/source-21.txt +0 -47
- package/.scannerwork/scanner-report/source-22.txt +0 -156
- package/.scannerwork/scanner-report/source-25.txt +0 -145
- package/.scannerwork/scanner-report/source-27.txt +0 -35
- package/.scannerwork/scanner-report/source-40.txt +0 -509
- package/.scannerwork/scanner-report/source-49.txt +0 -175
- package/.scannerwork/scanner-report/source-50.txt +0 -190
- package/.scannerwork/scanner-report/source-67.txt +0 -509
- package/.scannerwork/scanner-report/source-68.txt +0 -77
- package/.scannerwork/scanner-report/symbols-21.pb +0 -27
- package/.scannerwork/scanner-report/symbols-25.pb +0 -102
- package/.scannerwork/scanner-report/symbols-27.pb +0 -17
- package/.scannerwork/scanner-report/symbols-28.pb +0 -69
- package/.scannerwork/scanner-report/symbols-29.pb +0 -116
- package/.scannerwork/scanner-report/symbols-49.pb +0 -153
- package/.scannerwork/scanner-report/symbols-50.pb +0 -180
- package/.scannerwork/scanner-report/symbols-68.pb +0 -30
- package/.scannerwork/scanner-report/symbols-69.pb +0 -19
- package/.scannerwork/scanner-report/symbols-70.pb +0 -610
- package/.scannerwork/scanner-report/syntax-highlightings-19.pb +0 -59
- package/.scannerwork/scanner-report/syntax-highlightings-20.pb +0 -110
- package/.scannerwork/scanner-report/syntax-highlightings-21.pb +0 -68
- package/.scannerwork/scanner-report/syntax-highlightings-22.pb +0 -223
- package/.scannerwork/scanner-report/syntax-highlightings-25.pb +0 -227
- package/.scannerwork/scanner-report/syntax-highlightings-27.pb +0 -63
- package/.scannerwork/scanner-report/syntax-highlightings-40.pb +0 -3747
- package/.scannerwork/scanner-report/syntax-highlightings-49.pb +0 -214
- package/.scannerwork/scanner-report/syntax-highlightings-50.pb +0 -225
- package/.scannerwork/scanner-report/syntax-highlightings-67.pb +0 -3747
- package/.scannerwork/scanner-report/syntax-highlightings-68.pb +0 -103
- /package/.scannerwork/scanner-report/{coverages-65.pb → coverages-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-26.pb → coverages-36.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-19.pb → coverages-37.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-20.pb → coverages-38.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-4.pb → coverages-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-22.pb → coverages-51.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-66.pb → coverages-8.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-19.pb → duplications-10.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-20.pb → duplications-11.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-21.pb → duplications-12.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-22.pb → duplications-13.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-26.pb → duplications-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-27.pb → duplications-15.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-28.pb → duplications-16.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-29.pb → duplications-17.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-4.pb → duplications-36.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-56.pb → duplications-37.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-65.pb → duplications-38.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-66.pb → duplications-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-68.pb → duplications-51.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-69.pb → duplications-7.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-70.pb → duplications-8.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-4.pb → issues-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-3.pb → issues-52.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-21.pb → issues-58.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-29.pb → issues-62.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-26.pb → measures-36.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-4.pb → measures-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-66.pb → measures-8.pb} +0 -0
- /package/.scannerwork/scanner-report/{source-26.txt → source-36.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-4.txt → source-39.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-66.txt → source-8.txt} +0 -0
- /package/.scannerwork/scanner-report/{symbols-65.pb → symbols-14.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-26.pb → symbols-36.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-19.pb → symbols-37.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-20.pb → symbols-38.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-4.pb → symbols-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-22.pb → symbols-51.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-66.pb → symbols-8.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-26.pb → syntax-highlightings-36.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-4.pb → syntax-highlightings-39.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-66.pb → syntax-highlightings-8.pb} +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
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 cliutils = require('./cliutils.js');
|
|
17
|
+
const config = require('./config.js');
|
|
18
|
+
const error = require('./error.js');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const pkg = require('../package.json');
|
|
21
|
+
|
|
22
|
+
function parseBackupArgs() {
|
|
23
|
+
const program = require('commander');
|
|
24
|
+
|
|
25
|
+
// Option CLI defaults
|
|
26
|
+
const defaults = config.cliDefaults();
|
|
27
|
+
|
|
28
|
+
// Options set by environment variables
|
|
29
|
+
const envVarOptions = {};
|
|
30
|
+
config.applyEnvironmentVariables(envVarOptions);
|
|
31
|
+
|
|
32
|
+
program
|
|
33
|
+
.version(pkg.version)
|
|
34
|
+
.description('Backup a CouchDB/Cloudant database to a backup text file.')
|
|
35
|
+
.usage('[options...]')
|
|
36
|
+
.option('-b, --buffer-size <n>',
|
|
37
|
+
cliutils.getUsage('number of documents fetched at once', defaults.bufferSize),
|
|
38
|
+
Number)
|
|
39
|
+
.option('-d, --db <db>',
|
|
40
|
+
cliutils.getUsage('name of the database to backup', defaults.db))
|
|
41
|
+
.option('-k, --iam-api-key <API key>',
|
|
42
|
+
cliutils.getUsage('IAM API key to access the Cloudant server'))
|
|
43
|
+
.option('-l, --log <file>',
|
|
44
|
+
cliutils.getUsage('file to store logging information during backup; invalid in "shallow" mode', 'a temporary file'),
|
|
45
|
+
path.normalize)
|
|
46
|
+
.option('-m, --mode <mode>',
|
|
47
|
+
cliutils.getUsage('"shallow" if only a superficial backup is done (ignoring conflicts and revision tokens), else "full" for complete backup', defaults.mode),
|
|
48
|
+
(mode) => { return mode.toLowerCase(); })
|
|
49
|
+
.option('-o, --output <file>',
|
|
50
|
+
cliutils.getUsage('file name to store the backup data', 'stdout'),
|
|
51
|
+
path.normalize)
|
|
52
|
+
.option('-p, --parallelism <n>',
|
|
53
|
+
cliutils.getUsage('number of HTTP requests to perform in parallel when performing a backup; ignored in "shallow" mode', defaults.parallelism),
|
|
54
|
+
Number)
|
|
55
|
+
.option('-q, --quiet',
|
|
56
|
+
cliutils.getUsage('suppress batch messages', defaults.quiet))
|
|
57
|
+
.option('-r, --resume',
|
|
58
|
+
cliutils.getUsage('continue a previous backup from its last known position; invalid in "shallow" mode', defaults.resume))
|
|
59
|
+
.option('-t, --request-timeout <n>',
|
|
60
|
+
cliutils.getUsage('milliseconds to wait for a response to a HTTP request before retrying the request', defaults.requestTimeout),
|
|
61
|
+
Number)
|
|
62
|
+
.option('-u, --url <url>',
|
|
63
|
+
cliutils.getUsage('URL of the CouchDB/Cloudant server', defaults.url))
|
|
64
|
+
.parse(process.argv);
|
|
65
|
+
|
|
66
|
+
// Remove defaults that don't apply when using shallow mode
|
|
67
|
+
if (program.opts().mode === 'shallow' || envVarOptions.mode === 'shallow') {
|
|
68
|
+
delete defaults.parallelism;
|
|
69
|
+
delete defaults.log;
|
|
70
|
+
delete defaults.resume;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Apply the options in order so that the CLI overrides env vars and env variables
|
|
74
|
+
// override defaults.
|
|
75
|
+
const opts = Object.assign({}, defaults, envVarOptions, program.opts());
|
|
76
|
+
|
|
77
|
+
if (opts.resume && (opts.log === defaults.log)) {
|
|
78
|
+
// If resuming and the log file arg is the newly generated tmp name from defaults then we know that --log wasn't specified.
|
|
79
|
+
// We have to do this check here for the CLI case because of the default.
|
|
80
|
+
error.terminationCallback(new error.BackupError('NoLogFileName', 'To resume a backup, a log file must be specified'));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return opts;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function parseRestoreArgs() {
|
|
87
|
+
const program = require('commander');
|
|
88
|
+
|
|
89
|
+
// Option CLI defaults
|
|
90
|
+
const defaults = config.cliDefaults();
|
|
91
|
+
|
|
92
|
+
// Options set by environment variables
|
|
93
|
+
const envVarOptions = {};
|
|
94
|
+
config.applyEnvironmentVariables(envVarOptions);
|
|
95
|
+
|
|
96
|
+
program
|
|
97
|
+
.version(pkg.version)
|
|
98
|
+
.description('Restore a CouchDB/Cloudant database from a backup text file.')
|
|
99
|
+
.usage('[options...]')
|
|
100
|
+
.option('-b, --buffer-size <n>',
|
|
101
|
+
cliutils.getUsage('number of documents restored at once', defaults.bufferSize),
|
|
102
|
+
Number)
|
|
103
|
+
.option('-d, --db <db>',
|
|
104
|
+
cliutils.getUsage('name of the new, existing database to restore to', defaults.db))
|
|
105
|
+
.option('-k, --iam-api-key <API key>',
|
|
106
|
+
cliutils.getUsage('IAM API key to access the Cloudant server'))
|
|
107
|
+
.option('-p, --parallelism <n>',
|
|
108
|
+
cliutils.getUsage('number of HTTP requests to perform in parallel when restoring a backup', defaults.parallelism),
|
|
109
|
+
Number)
|
|
110
|
+
.option('-q, --quiet',
|
|
111
|
+
cliutils.getUsage('suppress batch messages', defaults.quiet))
|
|
112
|
+
.option('-t, --request-timeout <n>',
|
|
113
|
+
cliutils.getUsage('milliseconds to wait for a response to a HTTP request before retrying the request', defaults.requestTimeout),
|
|
114
|
+
Number)
|
|
115
|
+
.option('-u, --url <url>',
|
|
116
|
+
cliutils.getUsage('URL of the CouchDB/Cloudant server', defaults.url))
|
|
117
|
+
.parse(process.argv);
|
|
118
|
+
|
|
119
|
+
// Apply the options in order so that the CLI overrides env vars and env variables
|
|
120
|
+
// override defaults.
|
|
121
|
+
const opts = Object.assign({}, defaults, envVarOptions, program.opts());
|
|
122
|
+
|
|
123
|
+
return opts;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
module.exports = {
|
|
127
|
+
parseBackupArgs: parseBackupArgs,
|
|
128
|
+
parseRestoreArgs: parseRestoreArgs
|
|
129
|
+
};
|
|
@@ -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,178 @@
|
|
|
1
|
+
// Copyright © 2017, 2021 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const pkg = require('../package.json');
|
|
17
|
+
const stream = require('stream');
|
|
18
|
+
const { CloudantV1, CouchdbSessionAuthenticator } = require('@ibm-cloud/cloudant');
|
|
19
|
+
const { IamAuthenticator, NoAuthAuthenticator } = require('ibm-cloud-sdk-core');
|
|
20
|
+
const retryPlugin = require('retry-axios');
|
|
21
|
+
|
|
22
|
+
const userAgent = 'couchbackup-cloudant/' + pkg.version + ' (Node.js ' +
|
|
23
|
+
process.version + ')';
|
|
24
|
+
|
|
25
|
+
// Class for streaming _changes error responses into
|
|
26
|
+
// In general the response is a small error/reason JSON object
|
|
27
|
+
// so it is OK to have this in memory.
|
|
28
|
+
class ResponseWriteable extends stream.Writable {
|
|
29
|
+
constructor(options) {
|
|
30
|
+
super(options);
|
|
31
|
+
this.data = [];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_write(chunk, encoding, callback) {
|
|
35
|
+
this.data.push(chunk);
|
|
36
|
+
callback();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
stringBody() {
|
|
40
|
+
return Buffer.concat(this.data).toString();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// An interceptor function to help augment error bodies with a little
|
|
45
|
+
// extra information so we can continue to use consistent messaging
|
|
46
|
+
// after the ugprade to @ibm-cloud/cloudant
|
|
47
|
+
const errorHelper = async function(err) {
|
|
48
|
+
let method;
|
|
49
|
+
let requestUrl;
|
|
50
|
+
if (err.response) {
|
|
51
|
+
if (err.response.config.url) {
|
|
52
|
+
requestUrl = err.response.config.url;
|
|
53
|
+
method = err.response.config.method;
|
|
54
|
+
}
|
|
55
|
+
// Override the status text with an improved message
|
|
56
|
+
let errorMsg = `${err.response.status} ${err.response.statusText || ''}: ` +
|
|
57
|
+
`${method} ${requestUrl}`;
|
|
58
|
+
if (err.response.data) {
|
|
59
|
+
// Check if we have a JSON response and try to get the error/reason
|
|
60
|
+
if (err.response.headers['content-type'] === 'application/json') {
|
|
61
|
+
if (!err.response.data.error && err.response.data.pipe) {
|
|
62
|
+
// If we didn't find a JSON object with `error` then we might have a stream response.
|
|
63
|
+
// Detect the stream by the presence of `pipe` and use it to get the body and parse
|
|
64
|
+
// the error information.
|
|
65
|
+
const p = new Promise((resolve, reject) => {
|
|
66
|
+
const errorBody = new ResponseWriteable();
|
|
67
|
+
err.response.data.pipe(errorBody)
|
|
68
|
+
.on('finish', () => { resolve(JSON.parse(errorBody.stringBody())); })
|
|
69
|
+
.on('error', () => { reject(err); });
|
|
70
|
+
});
|
|
71
|
+
// Replace the stream on the response with the parsed object
|
|
72
|
+
err.response.data = await p;
|
|
73
|
+
}
|
|
74
|
+
// Append the error/reason if available
|
|
75
|
+
if (err.response.data.error) {
|
|
76
|
+
// Override the status text with our more complete message
|
|
77
|
+
errorMsg += ` - Error: ${err.response.data.error}`;
|
|
78
|
+
if (err.response.data.reason) {
|
|
79
|
+
errorMsg += `, Reason: ${err.response.data.reason}`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
errorMsg += err.response.data;
|
|
84
|
+
}
|
|
85
|
+
// Set a new message for use by the node-sdk-core
|
|
86
|
+
// We use the errors array because it gets processed
|
|
87
|
+
// ahead of all other service errors.
|
|
88
|
+
err.response.data.errors = [{ message: errorMsg }];
|
|
89
|
+
}
|
|
90
|
+
} else if (err.request) {
|
|
91
|
+
if (!err.message.includes(err.config.url)) {
|
|
92
|
+
// Augment the message with the URL and method
|
|
93
|
+
// but don't do it again if we already have the URL.
|
|
94
|
+
err.message = `${err.message}: ${err.config.method} ${err.config.url}`;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return Promise.reject(err);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
module.exports = {
|
|
101
|
+
client: function(rawUrl, opts) {
|
|
102
|
+
const url = new URL(rawUrl);
|
|
103
|
+
// Split the URL to separate service from database
|
|
104
|
+
// Use origin as the "base" to remove auth elements
|
|
105
|
+
const actUrl = new URL(url.pathname.substring(0, url.pathname.lastIndexOf('/')), url.origin);
|
|
106
|
+
const dbName = url.pathname.substring(url.pathname.lastIndexOf('/') + 1);
|
|
107
|
+
let authenticator;
|
|
108
|
+
// Default to cookieauth unless an IAM key is provided
|
|
109
|
+
if (opts.iamApiKey) {
|
|
110
|
+
const iamAuthOpts = { apikey: opts.iamApiKey };
|
|
111
|
+
if (opts.iamTokenUrl) {
|
|
112
|
+
iamAuthOpts.url = opts.iamTokenUrl;
|
|
113
|
+
}
|
|
114
|
+
authenticator = new IamAuthenticator(iamAuthOpts);
|
|
115
|
+
} else if (url.username) {
|
|
116
|
+
authenticator = new CouchdbSessionAuthenticator({
|
|
117
|
+
username: decodeURIComponent(url.username),
|
|
118
|
+
password: decodeURIComponent(url.password)
|
|
119
|
+
});
|
|
120
|
+
} else {
|
|
121
|
+
authenticator = new NoAuthAuthenticator();
|
|
122
|
+
}
|
|
123
|
+
const serviceOpts = {
|
|
124
|
+
authenticator: authenticator,
|
|
125
|
+
timeout: opts.requestTimeout,
|
|
126
|
+
// Axios performance options
|
|
127
|
+
maxContentLength: -1
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const service = new CloudantV1(serviceOpts);
|
|
131
|
+
// Configure retries
|
|
132
|
+
const maxRetries = 2; // for 3 total attempts
|
|
133
|
+
service.getHttpClient().defaults.raxConfig = {
|
|
134
|
+
// retries for status codes
|
|
135
|
+
retry: maxRetries,
|
|
136
|
+
// retries for non-response e.g. ETIMEDOUT
|
|
137
|
+
noResponseRetries: maxRetries,
|
|
138
|
+
backoffType: 'exponential',
|
|
139
|
+
httpMethodsToRetry: ['GET', 'HEAD', 'POST'],
|
|
140
|
+
statusCodesToRetry: [
|
|
141
|
+
[429, 429],
|
|
142
|
+
[500, 599]
|
|
143
|
+
],
|
|
144
|
+
shouldRetry: err => {
|
|
145
|
+
const cfg = retryPlugin.getConfig(err);
|
|
146
|
+
// cap at max retries regardless of response/non-response type
|
|
147
|
+
if (cfg.currentRetryAttempt >= maxRetries) {
|
|
148
|
+
return false;
|
|
149
|
+
} else {
|
|
150
|
+
return retryPlugin.shouldRetryRequest(err);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
instance: service.getHttpClient()
|
|
154
|
+
};
|
|
155
|
+
retryPlugin.attach(service.getHttpClient());
|
|
156
|
+
|
|
157
|
+
service.setServiceUrl(actUrl.toString());
|
|
158
|
+
if (authenticator instanceof CouchdbSessionAuthenticator) {
|
|
159
|
+
// Awkward workaround for known Couch issue with compression on _session requests
|
|
160
|
+
// It is not feasible to disable compression on all requests with the amount of
|
|
161
|
+
// data this lib needs to move, so override the property in the tokenManager instance.
|
|
162
|
+
authenticator.tokenManager.requestWrapperInstance.compressRequestData = false;
|
|
163
|
+
}
|
|
164
|
+
if (authenticator.tokenManager && authenticator.tokenManager.requestWrapperInstance) {
|
|
165
|
+
authenticator.tokenManager.requestWrapperInstance.axiosInstance.interceptors.response.use(null, errorHelper);
|
|
166
|
+
}
|
|
167
|
+
// Add error interceptors to put URLs in error messages
|
|
168
|
+
service.getHttpClient().interceptors.response.use(null, errorHelper);
|
|
169
|
+
|
|
170
|
+
// Add request interceptor to add user-agent (adding it with custom request headers gets overwritten)
|
|
171
|
+
service.getHttpClient().interceptors.request.use(function(requestConfig) {
|
|
172
|
+
requestConfig.headers['User-Agent'] = userAgent;
|
|
173
|
+
return requestConfig;
|
|
174
|
+
}, null);
|
|
175
|
+
|
|
176
|
+
return { service: service, db: dbName, url: actUrl.toString() };
|
|
177
|
+
}
|
|
178
|
+
};
|
|
@@ -0,0 +1,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,31 @@
|
|
|
1
|
+
// Copyright © 2017, 2018 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
module.exports = function(db, options, readstream, ee, callback) {
|
|
17
|
+
const liner = require('../includes/liner.js')();
|
|
18
|
+
const writer = require('../includes/writer.js')(db, options.bufferSize, options.parallelism, ee);
|
|
19
|
+
|
|
20
|
+
// pipe the input to the output, via transformation functions
|
|
21
|
+
readstream
|
|
22
|
+
.pipe(liner) // transform the input stream into per-line
|
|
23
|
+
.on('error', function(err) {
|
|
24
|
+
// Forward the error to the writer event emitter where we already have
|
|
25
|
+
// listeners on for handling errors
|
|
26
|
+
writer.emit('error', err);
|
|
27
|
+
})
|
|
28
|
+
.pipe(writer); // transform the data
|
|
29
|
+
|
|
30
|
+
callback(null, writer);
|
|
31
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
// stolen from http://strongloop.com/strongblog/practical-examples-of-the-new-node-js-streams-api/
|
|
17
|
+
const stream = require('stream');
|
|
18
|
+
|
|
19
|
+
module.exports = function(onChange) {
|
|
20
|
+
const change = new stream.Transform({ objectMode: true });
|
|
21
|
+
|
|
22
|
+
change._transform = function(line, encoding, done) {
|
|
23
|
+
let obj = null;
|
|
24
|
+
|
|
25
|
+
// one change per line - remove the trailing comma
|
|
26
|
+
line = line.trim().replace(/,$/, '');
|
|
27
|
+
|
|
28
|
+
// extract thee last_seq at the end of the changes feed
|
|
29
|
+
if (line.match(/^"last_seq":/)) {
|
|
30
|
+
line = '{' + line;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
obj = JSON.parse(line);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
}
|
|
36
|
+
onChange(obj);
|
|
37
|
+
done();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return change;
|
|
41
|
+
};
|