@cloudant/couchbackup 2.9.16 → 2.9.17-SNAPSHOT.186
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-cache2.pb +0 -0
- package/.scannerwork/scanner-report/analysis-warnings.pb +2 -2
- package/.scannerwork/scanner-report/changesets-3.pb +1 -0
- package/.scannerwork/scanner-report/changesets-38.pb +1 -0
- package/.scannerwork/scanner-report/changesets-53.pb +1 -0
- package/.scannerwork/scanner-report/changesets-57.pb +1 -0
- package/.scannerwork/scanner-report/changesets-58.pb +1 -0
- package/.scannerwork/scanner-report/changesets-68.pb +1 -0
- package/.scannerwork/scanner-report/component-1.pb +2 -2
- package/.scannerwork/scanner-report/component-10.pb +1 -1
- package/.scannerwork/scanner-report/component-11.pb +1 -1
- package/.scannerwork/scanner-report/component-12.pb +1 -1
- package/.scannerwork/scanner-report/component-13.pb +1 -1
- package/.scannerwork/scanner-report/component-14.pb +1 -1
- package/.scannerwork/scanner-report/component-15.pb +1 -1
- package/.scannerwork/scanner-report/component-16.pb +1 -1
- package/.scannerwork/scanner-report/component-17.pb +1 -1
- package/.scannerwork/scanner-report/component-18.pb +1 -1
- package/.scannerwork/scanner-report/component-19.pb +1 -1
- package/.scannerwork/scanner-report/component-2.pb +1 -1
- package/.scannerwork/scanner-report/component-20.pb +1 -1
- package/.scannerwork/scanner-report/component-21.pb +1 -1
- package/.scannerwork/scanner-report/component-22.pb +1 -1
- package/.scannerwork/scanner-report/component-3.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 -1
- package/.scannerwork/scanner-report/component-40.pb +1 -1
- package/.scannerwork/scanner-report/component-41.pb +1 -1
- package/.scannerwork/scanner-report/component-42.pb +1 -1
- package/.scannerwork/scanner-report/component-43.pb +1 -1
- package/.scannerwork/scanner-report/component-44.pb +1 -1
- package/.scannerwork/scanner-report/component-45.pb +1 -1
- package/.scannerwork/scanner-report/component-46.pb +1 -1
- package/.scannerwork/scanner-report/component-47.pb +1 -1
- package/.scannerwork/scanner-report/component-48.pb +1 -1
- package/.scannerwork/scanner-report/component-49.pb +1 -1
- package/.scannerwork/scanner-report/component-5.pb +1 -1
- package/.scannerwork/scanner-report/component-50.pb +1 -1
- package/.scannerwork/scanner-report/component-51.pb +1 -1
- package/.scannerwork/scanner-report/component-52.pb +1 -1
- package/.scannerwork/scanner-report/component-53.pb +1 -0
- package/.scannerwork/scanner-report/component-54.pb +1 -1
- package/.scannerwork/scanner-report/component-56.pb +1 -0
- package/.scannerwork/scanner-report/component-57.pb +1 -0
- package/.scannerwork/scanner-report/component-58.pb +1 -0
- package/.scannerwork/scanner-report/component-6.pb +1 -1
- package/.scannerwork/scanner-report/component-62.pb +1 -0
- package/.scannerwork/scanner-report/component-67.pb +1 -0
- package/.scannerwork/scanner-report/component-68.pb +1 -1
- package/.scannerwork/scanner-report/component-7.pb +1 -1
- package/.scannerwork/scanner-report/component-8.pb +1 -1
- package/.scannerwork/scanner-report/component-9.pb +1 -1
- package/.scannerwork/scanner-report/coverages-10.pb +0 -0
- package/.scannerwork/scanner-report/coverages-11.pb +0 -0
- package/.scannerwork/scanner-report/coverages-12.pb +0 -0
- package/.scannerwork/scanner-report/coverages-13.pb +0 -0
- package/.scannerwork/scanner-report/coverages-14.pb +0 -0
- package/.scannerwork/scanner-report/coverages-15.pb +0 -0
- package/.scannerwork/scanner-report/coverages-16.pb +0 -0
- package/.scannerwork/scanner-report/coverages-17.pb +0 -0
- package/.scannerwork/scanner-report/coverages-18.pb +0 -0
- package/.scannerwork/scanner-report/coverages-2.pb +0 -0
- package/.scannerwork/scanner-report/coverages-20.pb +0 -0
- package/.scannerwork/scanner-report/coverages-21.pb +0 -0
- package/.scannerwork/scanner-report/coverages-22.pb +0 -0
- package/.scannerwork/scanner-report/coverages-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-39.pb +0 -0
- package/.scannerwork/scanner-report/coverages-40.pb +0 -0
- package/.scannerwork/scanner-report/coverages-41.pb +0 -0
- package/.scannerwork/scanner-report/coverages-42.pb +0 -0
- package/.scannerwork/scanner-report/coverages-43.pb +0 -0
- package/.scannerwork/scanner-report/coverages-44.pb +0 -0
- package/.scannerwork/scanner-report/coverages-45.pb +0 -0
- package/.scannerwork/scanner-report/coverages-46.pb +0 -0
- package/.scannerwork/scanner-report/coverages-47.pb +0 -0
- package/.scannerwork/scanner-report/coverages-48.pb +0 -0
- package/.scannerwork/scanner-report/coverages-49.pb +0 -0
- package/.scannerwork/scanner-report/coverages-5.pb +0 -0
- package/.scannerwork/scanner-report/coverages-50.pb +0 -0
- package/.scannerwork/scanner-report/coverages-51.pb +0 -0
- package/.scannerwork/scanner-report/coverages-52.pb +0 -0
- package/.scannerwork/scanner-report/coverages-53.pb +0 -0
- package/.scannerwork/scanner-report/coverages-54.pb +0 -0
- package/.scannerwork/scanner-report/coverages-6.pb +0 -0
- package/.scannerwork/scanner-report/coverages-68.pb +0 -0
- package/.scannerwork/scanner-report/coverages-7.pb +0 -0
- package/.scannerwork/scanner-report/coverages-8.pb +0 -0
- package/.scannerwork/scanner-report/coverages-9.pb +0 -0
- package/.scannerwork/scanner-report/duplications-12.pb +0 -3
- package/.scannerwork/scanner-report/duplications-15.pb +2 -0
- package/.scannerwork/scanner-report/duplications-34.pb +2 -0
- package/.scannerwork/scanner-report/duplications-45.pb +2 -0
- package/.scannerwork/scanner-report/duplications-46.pb +3 -0
- package/.scannerwork/scanner-report/duplications-50.pb +0 -2
- package/.scannerwork/scanner-report/duplications-51.pb +0 -2
- package/.scannerwork/scanner-report/duplications-57.pb +2 -0
- package/.scannerwork/scanner-report/duplications-58.pb +2 -0
- package/.scannerwork/scanner-report/duplications-68.pb +0 -0
- package/.scannerwork/scanner-report/duplications-9.pb +2 -2
- package/.scannerwork/scanner-report/measures-10.pb +0 -0
- package/.scannerwork/scanner-report/measures-11.pb +0 -0
- package/.scannerwork/scanner-report/measures-12.pb +0 -0
- package/.scannerwork/scanner-report/measures-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-19.pb +0 -0
- package/.scannerwork/scanner-report/measures-2.pb +0 -0
- package/.scannerwork/scanner-report/measures-20.pb +0 -0
- package/.scannerwork/scanner-report/measures-21.pb +0 -0
- package/.scannerwork/scanner-report/measures-22.pb +0 -0
- package/.scannerwork/scanner-report/measures-3.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-40.pb +0 -0
- package/.scannerwork/scanner-report/measures-41.pb +0 -0
- package/.scannerwork/scanner-report/measures-42.pb +0 -0
- package/.scannerwork/scanner-report/measures-43.pb +0 -0
- package/.scannerwork/scanner-report/measures-44.pb +0 -0
- package/.scannerwork/scanner-report/measures-45.pb +0 -0
- package/.scannerwork/scanner-report/measures-46.pb +0 -0
- package/.scannerwork/scanner-report/measures-47.pb +0 -0
- package/.scannerwork/scanner-report/measures-48.pb +0 -0
- package/.scannerwork/scanner-report/measures-49.pb +0 -0
- package/.scannerwork/scanner-report/measures-5.pb +0 -0
- package/.scannerwork/scanner-report/measures-50.pb +0 -0
- package/.scannerwork/scanner-report/measures-51.pb +0 -0
- package/.scannerwork/scanner-report/measures-52.pb +0 -0
- package/.scannerwork/scanner-report/measures-53.pb +15 -0
- package/.scannerwork/scanner-report/measures-54.pb +0 -0
- package/.scannerwork/scanner-report/measures-6.pb +0 -0
- package/.scannerwork/scanner-report/measures-62.pb +0 -0
- package/.scannerwork/scanner-report/measures-67.pb +0 -0
- package/.scannerwork/scanner-report/measures-68.pb +0 -0
- package/.scannerwork/scanner-report/measures-7.pb +0 -0
- package/.scannerwork/scanner-report/measures-8.pb +0 -0
- package/.scannerwork/scanner-report/measures-9.pb +0 -0
- package/.scannerwork/scanner-report/metadata.pb +0 -0
- package/.scannerwork/scanner-report/source-10.txt +150 -23
- package/.scannerwork/scanner-report/source-11.txt +30 -16
- package/.scannerwork/scanner-report/source-12.txt +99 -199
- package/.scannerwork/scanner-report/source-13.txt +60 -81
- package/.scannerwork/scanner-report/source-14.txt +164 -116
- package/.scannerwork/scanner-report/source-15.txt +53 -427
- package/.scannerwork/scanner-report/source-16.txt +22 -274
- package/.scannerwork/scanner-report/source-17.txt +87 -69
- package/.scannerwork/scanner-report/source-18.txt +255 -80
- package/.scannerwork/scanner-report/source-19.txt +102 -134
- package/.scannerwork/scanner-report/source-2.txt +43 -397
- package/.scannerwork/scanner-report/source-20.txt +39 -42
- package/.scannerwork/scanner-report/source-21.txt +47 -22
- package/.scannerwork/scanner-report/source-22.txt +429 -21
- package/.scannerwork/scanner-report/source-3.txt +81 -424
- package/.scannerwork/scanner-report/source-34.txt +168 -18
- package/.scannerwork/scanner-report/source-35.txt +170 -21
- package/.scannerwork/scanner-report/source-36.txt +314 -136
- package/.scannerwork/scanner-report/source-37.txt +9 -55
- package/.scannerwork/scanner-report/source-38.txt +40 -424
- package/.scannerwork/scanner-report/source-39.txt +120 -115
- package/.scannerwork/scanner-report/source-40.txt +82 -93
- package/.scannerwork/scanner-report/source-41.txt +279 -32
- package/.scannerwork/scanner-report/source-42.txt +27 -65
- package/.scannerwork/scanner-report/source-43.txt +21 -43
- package/.scannerwork/scanner-report/source-44.txt +85 -157
- package/.scannerwork/scanner-report/source-45.txt +167 -102
- package/.scannerwork/scanner-report/source-46.txt +194 -22
- package/.scannerwork/scanner-report/source-47.txt +23 -99
- package/.scannerwork/scanner-report/source-48.txt +25 -148
- package/.scannerwork/scanner-report/source-49.txt +97 -248
- package/.scannerwork/scanner-report/source-5.txt +16 -14
- package/.scannerwork/scanner-report/source-50.txt +50 -67
- package/.scannerwork/scanner-report/source-51.txt +15 -58
- package/.scannerwork/scanner-report/source-52.txt +87 -17
- package/.scannerwork/scanner-report/source-53.txt +151 -0
- package/.scannerwork/scanner-report/source-54.txt +396 -28
- package/.scannerwork/scanner-report/{source-55.txt → source-56.txt} +151 -151
- package/.scannerwork/scanner-report/source-6.txt +97 -315
- package/.scannerwork/scanner-report/source-62.txt +424 -0
- package/.scannerwork/scanner-report/source-67.txt +424 -0
- package/.scannerwork/scanner-report/source-68.txt +46 -102
- package/.scannerwork/scanner-report/source-7.txt +113 -175
- package/.scannerwork/scanner-report/source-8.txt +41 -44
- package/.scannerwork/scanner-report/source-9.txt +66 -157
- package/.scannerwork/scanner-report/symbols-10.pb +126 -9
- package/.scannerwork/scanner-report/symbols-11.pb +20 -9
- package/.scannerwork/scanner-report/symbols-12.pb +46 -264
- package/.scannerwork/scanner-report/symbols-13.pb +45 -57
- package/.scannerwork/scanner-report/symbols-14.pb +144 -86
- package/.scannerwork/scanner-report/symbols-15.pb +41 -789
- package/.scannerwork/scanner-report/symbols-16.pb +17 -427
- package/.scannerwork/scanner-report/symbols-17.pb +30 -69
- package/.scannerwork/scanner-report/symbols-18.pb +354 -59
- package/.scannerwork/scanner-report/symbols-2.pb +21 -604
- package/.scannerwork/scanner-report/symbols-20.pb +23 -32
- package/.scannerwork/scanner-report/symbols-21.pb +33 -23
- package/.scannerwork/scanner-report/symbols-22.pb +790 -31
- package/.scannerwork/scanner-report/symbols-34.pb +227 -13
- package/.scannerwork/scanner-report/symbols-35.pb +209 -19
- package/.scannerwork/scanner-report/symbols-36.pb +353 -93
- package/.scannerwork/scanner-report/symbols-37.pb +7 -38
- package/.scannerwork/scanner-report/symbols-38.pb +23 -0
- package/.scannerwork/scanner-report/symbols-39.pb +71 -33
- package/.scannerwork/scanner-report/symbols-40.pb +68 -58
- package/.scannerwork/scanner-report/symbols-41.pb +427 -19
- package/.scannerwork/scanner-report/symbols-42.pb +19 -46
- package/.scannerwork/scanner-report/symbols-43.pb +9 -19
- package/.scannerwork/scanner-report/symbols-44.pb +59 -144
- package/.scannerwork/scanner-report/symbols-45.pb +203 -30
- package/.scannerwork/scanner-report/symbols-46.pb +264 -18
- package/.scannerwork/scanner-report/symbols-47.pb +13 -46
- package/.scannerwork/scanner-report/symbols-48.pb +31 -126
- package/.scannerwork/scanner-report/symbols-49.pb +85 -353
- package/.scannerwork/scanner-report/symbols-5.pb +14 -8
- package/.scannerwork/scanner-report/symbols-50.pb +38 -43
- package/.scannerwork/scanner-report/symbols-51.pb +9 -42
- package/.scannerwork/scanner-report/symbols-52.pb +57 -13
- package/.scannerwork/scanner-report/symbols-53.pb +93 -0
- package/.scannerwork/scanner-report/symbols-54.pb +603 -6
- package/.scannerwork/scanner-report/symbols-6.pb +59 -353
- package/.scannerwork/scanner-report/symbols-68.pb +7 -0
- package/.scannerwork/scanner-report/symbols-7.pb +32 -208
- package/.scannerwork/scanner-report/symbols-8.pb +18 -23
- package/.scannerwork/scanner-report/symbols-9.pb +44 -203
- package/.scannerwork/scanner-report/syntax-highlightings-10.pb +179 -27
- package/.scannerwork/scanner-report/syntax-highlightings-11.pb +34 -24
- package/.scannerwork/scanner-report/syntax-highlightings-12.pb +90 -261
- package/.scannerwork/scanner-report/syntax-highlightings-13.pb +61 -120
- package/.scannerwork/scanner-report/syntax-highlightings-14.pb +208 -90
- package/.scannerwork/scanner-report/syntax-highlightings-15.pb +47 -593
- package/.scannerwork/scanner-report/syntax-highlightings-16.pb +23 -691
- package/.scannerwork/scanner-report/syntax-highlightings-17.pb +82 -76
- package/.scannerwork/scanner-report/syntax-highlightings-18.pb +244 -137
- package/.scannerwork/scanner-report/syntax-highlightings-19.pb +689 -178
- package/.scannerwork/scanner-report/syntax-highlightings-2.pb +58 -617
- package/.scannerwork/scanner-report/syntax-highlightings-20.pb +59 -72
- package/.scannerwork/scanner-report/syntax-highlightings-21.pb +73 -19
- package/.scannerwork/scanner-report/syntax-highlightings-22.pb +590 -32
- package/.scannerwork/scanner-report/syntax-highlightings-3.pb +90 -3331
- package/.scannerwork/scanner-report/syntax-highlightings-34.pb +333 -27
- package/.scannerwork/scanner-report/syntax-highlightings-35.pb +249 -25
- package/.scannerwork/scanner-report/syntax-highlightings-36.pb +550 -167
- package/.scannerwork/scanner-report/syntax-highlightings-37.pb +14 -66
- package/.scannerwork/scanner-report/syntax-highlightings-38.pb +45 -3328
- package/.scannerwork/scanner-report/syntax-highlightings-39.pb +141 -89
- package/.scannerwork/scanner-report/syntax-highlightings-40.pb +68 -94
- package/.scannerwork/scanner-report/syntax-highlightings-41.pb +691 -35
- package/.scannerwork/scanner-report/syntax-highlightings-42.pb +32 -61
- package/.scannerwork/scanner-report/syntax-highlightings-43.pb +31 -29
- package/.scannerwork/scanner-report/syntax-highlightings-44.pb +140 -205
- package/.scannerwork/scanner-report/syntax-highlightings-45.pb +243 -76
- package/.scannerwork/scanner-report/syntax-highlightings-46.pb +268 -23
- package/.scannerwork/scanner-report/syntax-highlightings-47.pb +30 -94
- package/.scannerwork/scanner-report/syntax-highlightings-48.pb +33 -177
- package/.scannerwork/scanner-report/syntax-highlightings-49.pb +90 -250
- package/.scannerwork/scanner-report/syntax-highlightings-5.pb +15 -19
- package/.scannerwork/scanner-report/syntax-highlightings-50.pb +65 -57
- package/.scannerwork/scanner-report/syntax-highlightings-51.pb +22 -49
- package/.scannerwork/scanner-report/syntax-highlightings-52.pb +124 -15
- package/.scannerwork/scanner-report/syntax-highlightings-53.pb +237 -0
- package/.scannerwork/scanner-report/syntax-highlightings-54.pb +612 -33
- package/.scannerwork/scanner-report/{syntax-highlightings-55.pb → syntax-highlightings-56.pb} +89 -90
- package/.scannerwork/scanner-report/syntax-highlightings-6.pb +97 -584
- package/.scannerwork/scanner-report/syntax-highlightings-62.pb +3340 -0
- package/.scannerwork/scanner-report/syntax-highlightings-67.pb +3341 -0
- package/.scannerwork/scanner-report/syntax-highlightings-68.pb +43 -672
- package/.scannerwork/scanner-report/syntax-highlightings-7.pb +88 -249
- package/.scannerwork/scanner-report/syntax-highlightings-8.pb +29 -67
- package/.scannerwork/scanner-report/syntax-highlightings-9.pb +57 -244
- package/.secrets.baseline +2 -2
- package/package.json +1 -1
- package/test-18-results.xml +158 -158
- package/test-20-results.xml +152 -152
- package/test-21-results.xml +153 -153
- package/test-iam-20-results.xml +50 -50
- package/.scannerwork/scanner-report/changesets-19.pb +0 -1
- package/.scannerwork/scanner-report/changesets-4.pb +0 -1
- package/.scannerwork/scanner-report/changesets-60.pb +0 -1
- package/.scannerwork/scanner-report/changesets-61.pb +0 -1
- package/.scannerwork/scanner-report/changesets-64.pb +0 -1
- package/.scannerwork/scanner-report/changesets-66.pb +0 -1
- package/.scannerwork/scanner-report/component-4.pb +0 -1
- package/.scannerwork/scanner-report/component-55.pb +0 -1
- package/.scannerwork/scanner-report/component-60.pb +0 -1
- package/.scannerwork/scanner-report/component-61.pb +0 -1
- package/.scannerwork/scanner-report/component-64.pb +0 -1
- package/.scannerwork/scanner-report/component-66.pb +0 -1
- package/.scannerwork/scanner-report/coverages-19.pb +0 -0
- package/.scannerwork/scanner-report/coverages-4.pb +0 -0
- package/.scannerwork/scanner-report/coverages-60.pb +0 -0
- package/.scannerwork/scanner-report/duplications-4.pb +0 -2
- package/.scannerwork/scanner-report/duplications-64.pb +0 -2
- package/.scannerwork/scanner-report/duplications-66.pb +0 -2
- package/.scannerwork/scanner-report/measures-4.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/source-4.txt +0 -187
- package/.scannerwork/scanner-report/source-60.txt +0 -60
- package/.scannerwork/scanner-report/source-61.txt +0 -81
- package/.scannerwork/scanner-report/symbols-19.pb +0 -71
- package/.scannerwork/scanner-report/symbols-4.pb +0 -227
- package/.scannerwork/scanner-report/symbols-60.pb +0 -21
- package/.scannerwork/scanner-report/syntax-highlightings-4.pb +0 -368
- package/.scannerwork/scanner-report/syntax-highlightings-60.pb +0 -82
- package/.scannerwork/scanner-report/syntax-highlightings-61.pb +0 -100
- /package/.scannerwork/scanner-report/{coverages-61.pb → coverages-3.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-64.pb → coverages-57.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-66.pb → coverages-58.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-19.pb → duplications-3.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-37.pb → duplications-38.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-60.pb → duplications-5.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-61.pb → duplications-53.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-6.pb → issues-36.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-35.pb → issues-42.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-12.pb → issues-46.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-14.pb → issues-49.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-55.pb → measures-56.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-64.pb → measures-57.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-66.pb → measures-58.pb} +0 -0
- /package/.scannerwork/scanner-report/{source-64.txt → source-57.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-66.txt → source-58.txt} +0 -0
- /package/.scannerwork/scanner-report/{symbols-61.pb → symbols-3.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-64.pb → symbols-57.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-66.pb → symbols-58.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-64.pb → syntax-highlightings-57.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-66.pb → syntax-highlightings-58.pb} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2017 IBM Corp. All rights reserved.
|
|
1
|
+
// Copyright © 2017, 2023 IBM Corp. All rights reserved.
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,31 +11,203 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
/* global describe it beforeEach */
|
|
14
16
|
'use strict';
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
+
const assert = require('assert');
|
|
19
|
+
const nock = require('nock');
|
|
20
|
+
const request = require('../includes/request.js');
|
|
21
|
+
const error = require('../includes/error.js');
|
|
22
|
+
|
|
23
|
+
const url = 'http://localhost:7777/testdb';
|
|
24
|
+
const db = request.client(url, { parallelism: 1 });
|
|
25
|
+
const timeoutDb = request.client(url, { parallelism: 1, requestTimeout: 500 });
|
|
26
|
+
const longTestTimeout = 3000;
|
|
27
|
+
|
|
28
|
+
beforeEach('Clean nock', function() {
|
|
29
|
+
nock.cleanAll();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('#unit Check request headers', function() {
|
|
33
|
+
it('should have a couchbackup user-agent', async function() {
|
|
34
|
+
const couch = nock(url)
|
|
35
|
+
.matchHeader('user-agent', /couchbackup-cloudant\/\d+\.\d+\.\d+(?:-SNAPSHOT)? \(Node.js v\d+\.\d+\.\d+\)/)
|
|
36
|
+
.head('/good')
|
|
37
|
+
.reply(200);
|
|
38
|
+
|
|
39
|
+
return db.service.headDocument({ db: db.db, docId: 'good' }).then(() => {
|
|
40
|
+
assert.ok(couch.isDone());
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe('#unit Check request response error callback', function() {
|
|
46
|
+
it('should not callback with error for 200 response', async function() {
|
|
47
|
+
const couch = nock(url)
|
|
48
|
+
.get('/good')
|
|
49
|
+
.reply(200, { ok: true });
|
|
50
|
+
|
|
51
|
+
return db.service.getDocument({ db: db.db, docId: 'good' }).then(response => {
|
|
52
|
+
assert.ok(response.result);
|
|
53
|
+
assert.ok(couch.isDone());
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should callback with error after 3 500 responses', async function() {
|
|
58
|
+
const couch = nock(url)
|
|
59
|
+
.get('/bad')
|
|
60
|
+
.times(3)
|
|
61
|
+
.reply(500, function(uri, requestBody) {
|
|
62
|
+
this.req.response.statusMessage = 'Internal Server Error';
|
|
63
|
+
return { error: 'foo', reason: 'bar' };
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
return assert.rejects(
|
|
67
|
+
db.service.getDocument({ db: db.db, docId: 'bad' }),
|
|
68
|
+
(err) => {
|
|
69
|
+
err = error.convertResponseError(err);
|
|
70
|
+
assert.strictEqual(err.name, 'HTTPFatalError');
|
|
71
|
+
assert.strictEqual(err.message, `500 Internal Server Error: get ${url}/bad - Error: foo, Reason: bar`);
|
|
72
|
+
assert.ok(couch.isDone());
|
|
73
|
+
return true;
|
|
74
|
+
});
|
|
75
|
+
}).timeout(longTestTimeout);
|
|
76
|
+
|
|
77
|
+
it('should callback with error after 3 POST 503 responses', async function() {
|
|
78
|
+
const couch = nock(url)
|
|
79
|
+
.post('/_bulk_get')
|
|
80
|
+
.query(true)
|
|
81
|
+
.times(3)
|
|
82
|
+
.reply(503, function(uri, requestBody) {
|
|
83
|
+
this.req.response.statusMessage = 'Service Unavailable';
|
|
84
|
+
return { error: 'service_unavailable', reason: 'Service unavailable' };
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return assert.rejects(
|
|
88
|
+
db.service.postBulkGet({ db: db.db, revs: true, docs: [] }),
|
|
89
|
+
(err) => {
|
|
90
|
+
err = error.convertResponseError(err);
|
|
91
|
+
assert.strictEqual(err.name, 'HTTPFatalError');
|
|
92
|
+
assert.strictEqual(err.message, `503 Service Unavailable: post ${url}/_bulk_get - Error: service_unavailable, Reason: Service unavailable`);
|
|
93
|
+
assert.ok(couch.isDone());
|
|
94
|
+
return true;
|
|
95
|
+
});
|
|
96
|
+
}).timeout(longTestTimeout);
|
|
97
|
+
|
|
98
|
+
it('should callback with error after 3 429 responses', async function() {
|
|
99
|
+
const couch = nock(url)
|
|
100
|
+
.get('/bad')
|
|
101
|
+
.times(3)
|
|
102
|
+
.reply(429, function(uri, requestBody) {
|
|
103
|
+
this.req.response.statusMessage = 'Too Many Requests';
|
|
104
|
+
return { error: 'foo', reason: 'bar' };
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
return assert.rejects(
|
|
108
|
+
db.service.getDocument({ db: db.db, docId: 'bad' }),
|
|
109
|
+
(err) => {
|
|
110
|
+
err = error.convertResponseError(err);
|
|
111
|
+
assert.strictEqual(err.name, 'HTTPFatalError');
|
|
112
|
+
assert.strictEqual(err.message, `429 Too Many Requests: get ${url}/bad - Error: foo, Reason: bar`);
|
|
113
|
+
assert.ok(couch.isDone());
|
|
114
|
+
return true;
|
|
115
|
+
});
|
|
116
|
+
}).timeout(longTestTimeout);
|
|
117
|
+
|
|
118
|
+
it('should callback with fatal error for 404 response', async function() {
|
|
119
|
+
const couch = nock(url)
|
|
120
|
+
.get('/bad')
|
|
121
|
+
.reply(404, function(uri, requestBody) {
|
|
122
|
+
this.req.response.statusMessage = 'Not Found';
|
|
123
|
+
return { error: 'foo', reason: 'bar' };
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
return assert.rejects(
|
|
127
|
+
db.service.getDocument({ db: db.db, docId: 'bad' }),
|
|
128
|
+
(err) => {
|
|
129
|
+
err = error.convertResponseError(err);
|
|
130
|
+
assert.strictEqual(err.name, 'HTTPFatalError');
|
|
131
|
+
assert.strictEqual(err.message, `404 Not Found: get ${url}/bad - Error: foo, Reason: bar`);
|
|
132
|
+
assert.ok(couch.isDone());
|
|
133
|
+
return true;
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('should callback with same error for no status code error response', async function() {
|
|
138
|
+
const couch = nock(url)
|
|
139
|
+
.get('/bad')
|
|
140
|
+
.times(3)
|
|
141
|
+
.replyWithError('testing badness');
|
|
18
142
|
|
|
19
|
-
|
|
20
|
-
|
|
143
|
+
return assert.rejects(
|
|
144
|
+
db.service.getDocument({ db: db.db, docId: 'bad' }),
|
|
145
|
+
(err) => {
|
|
146
|
+
const err2 = error.convertResponseError(err);
|
|
147
|
+
assert.strictEqual(err, err2);
|
|
148
|
+
assert.ok(couch.isDone());
|
|
149
|
+
return true;
|
|
150
|
+
});
|
|
151
|
+
}).timeout(longTestTimeout);
|
|
21
152
|
|
|
22
|
-
|
|
23
|
-
|
|
153
|
+
it('should retry request if HTTP request gets timed out', async function() {
|
|
154
|
+
const couch = nock(url)
|
|
155
|
+
.post('/_bulk_get')
|
|
156
|
+
.query(true)
|
|
157
|
+
.delay(1000)
|
|
158
|
+
.reply(200, { results: { docs: [{ id: '1', ok: { _id: '1' } }] } })
|
|
159
|
+
.post('/_bulk_get')
|
|
160
|
+
.query(true)
|
|
161
|
+
.reply(200, { results: { docs: [{ id: '1', ok: { _id: '1' } }, { id: '2', ok: { _id: '2' } }] } });
|
|
24
162
|
|
|
25
|
-
|
|
26
|
-
|
|
163
|
+
return timeoutDb.service.postBulkGet({ db: db.db, revs: true, docs: [] }).then((response) => {
|
|
164
|
+
assert.ok(response);
|
|
165
|
+
assert.ok(response.result);
|
|
166
|
+
assert.ok(response.result.results);
|
|
167
|
+
assert.ok(response.result.results.docs);
|
|
168
|
+
assert.strictEqual(response.result.results.docs.length, 2);
|
|
169
|
+
assert.ok(couch.isDone());
|
|
170
|
+
});
|
|
171
|
+
});
|
|
27
172
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
done();
|
|
38
|
-
};
|
|
173
|
+
it('should callback with error code ESOCKETTIMEDOUT if 3 HTTP requests gets timed out', async function() {
|
|
174
|
+
// Increase the timeout for this test to allow for the delays
|
|
175
|
+
this.timeout(3000);
|
|
176
|
+
const couch = nock(url)
|
|
177
|
+
.post('/_bulk_get')
|
|
178
|
+
.query(true)
|
|
179
|
+
.delay(1000)
|
|
180
|
+
.times(3)
|
|
181
|
+
.reply(200, { ok: true });
|
|
39
182
|
|
|
40
|
-
|
|
41
|
-
}
|
|
183
|
+
return assert.rejects(
|
|
184
|
+
timeoutDb.service.postBulkGet({ db: db.db, revs: true, docs: [] }),
|
|
185
|
+
(err) => {
|
|
186
|
+
err = error.convertResponseError(err);
|
|
187
|
+
// Note axios returns ECONNABORTED rather than ESOCKETTIMEDOUT
|
|
188
|
+
// See https://github.com/axios/axios/issues/2710 via https://github.com/axios/axios/issues/1543`
|
|
189
|
+
assert.strictEqual(err.statusText, 'ECONNABORTED');
|
|
190
|
+
assert.strictEqual(err.message, `timeout of 500ms exceeded: post ${url}/_bulk_get ECONNABORTED`);
|
|
191
|
+
assert.ok(couch.isDone());
|
|
192
|
+
return true;
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
describe('#unit Check credentials', async function() {
|
|
196
|
+
it('should properly decode username and password', async function() {
|
|
197
|
+
const username = 'user%123';
|
|
198
|
+
const password = 'colon:at@321';
|
|
199
|
+
const url = `http://${encodeURIComponent(username)}:${encodeURIComponent(password)}@localhost:7777/testdb`;
|
|
200
|
+
const sessionUrl = 'http://localhost:7777';
|
|
201
|
+
const couch = nock(sessionUrl)
|
|
202
|
+
.post('/_session', { username: username, password: password })
|
|
203
|
+
.reply(200, { ok: true }, { 'Set-Cookie': 'AuthSession=ABC123DEF4356;' })
|
|
204
|
+
.get('/')
|
|
205
|
+
.reply(200);
|
|
206
|
+
const db = request.client(url, { parallelism: 1 });
|
|
207
|
+
return db.service.getServerInformation().then(response => {
|
|
208
|
+
assert.ok(response);
|
|
209
|
+
assert.ok(couch.isDone());
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2017,
|
|
1
|
+
// Copyright © 2017, 2023 IBM Corp. All rights reserved.
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,103 +11,27 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
'use strict';
|
|
15
|
-
|
|
16
|
-
// fatal errors
|
|
17
|
-
const codes = {
|
|
18
|
-
Error: 1,
|
|
19
|
-
InvalidOption: 2,
|
|
20
|
-
DatabaseNotFound: 10,
|
|
21
|
-
Unauthorized: 11,
|
|
22
|
-
Forbidden: 12,
|
|
23
|
-
DatabaseNotEmpty: 13,
|
|
24
|
-
NoLogFileName: 20,
|
|
25
|
-
LogDoesNotExist: 21,
|
|
26
|
-
IncompleteChangesInLogFile: 22,
|
|
27
|
-
SpoolChangesError: 30,
|
|
28
|
-
HTTPFatalError: 40,
|
|
29
|
-
BulkGetError: 50
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
class BackupError extends Error {
|
|
33
|
-
constructor(name, message) {
|
|
34
|
-
super(message);
|
|
35
|
-
this.name = name;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
class HTTPError extends BackupError {
|
|
40
|
-
constructor(responseError, name) {
|
|
41
|
-
// Special case some names for more useful error messages
|
|
42
|
-
switch (responseError.status) {
|
|
43
|
-
case 401:
|
|
44
|
-
name = 'Unauthorized';
|
|
45
|
-
break;
|
|
46
|
-
case 403:
|
|
47
|
-
name = 'Forbidden';
|
|
48
|
-
break;
|
|
49
|
-
default:
|
|
50
|
-
name = name || 'HTTPFatalError';
|
|
51
|
-
}
|
|
52
|
-
super(name, responseError.message);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
14
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// 4XX (except 429) -> Fatal
|
|
59
|
-
// 429 & >=500 -> Transient
|
|
60
|
-
function checkResponse(err) {
|
|
61
|
-
if (err) {
|
|
62
|
-
// Construct an HTTPError if there is request information on the error
|
|
63
|
-
// Codes < 400 are considered OK
|
|
64
|
-
if (err.status >= 400) {
|
|
65
|
-
return new HTTPError(err);
|
|
66
|
-
} else {
|
|
67
|
-
// Send it back again if there was no status code, e.g. a cxn error
|
|
68
|
-
return augmentMessage(err);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function convertResponseError(responseError, errorFactory) {
|
|
74
|
-
if (!errorFactory) {
|
|
75
|
-
errorFactory = checkResponse;
|
|
76
|
-
}
|
|
77
|
-
return errorFactory(responseError);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function augmentMessage(err) {
|
|
81
|
-
// For errors that don't have a status code, we are likely looking at a cxn
|
|
82
|
-
// error.
|
|
83
|
-
// Try to augment the message with more detail (core puts the code in statusText)
|
|
84
|
-
if (err && err.statusText) {
|
|
85
|
-
err.message = `${err.message} ${err.statusText}`;
|
|
86
|
-
}
|
|
87
|
-
if (err && err.description) {
|
|
88
|
-
err.message = `${err.message} ${err.description}`;
|
|
89
|
-
}
|
|
90
|
-
return err;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function wrapPossibleInvalidUrlError(err) {
|
|
94
|
-
if (err.code === 'ERR_INVALID_URL') {
|
|
95
|
-
// Wrap ERR_INVALID_URL in our own InvalidOption
|
|
96
|
-
return new BackupError('InvalidOption', err.message);
|
|
97
|
-
}
|
|
98
|
-
return err;
|
|
99
|
-
}
|
|
15
|
+
/* global describe it */
|
|
16
|
+
'use strict';
|
|
100
17
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
18
|
+
const u = require('./citestutils.js');
|
|
19
|
+
|
|
20
|
+
describe('Event tests', function() {
|
|
21
|
+
it('should get a finished event when using stdout', async function() {
|
|
22
|
+
u.setTimeout(this, 40);
|
|
23
|
+
// Use the API so we can get events, pass eventEmitter so we get the emitter back
|
|
24
|
+
const params = { useApi: true, useStdOut: true };
|
|
25
|
+
// All API backups now set an event listener for finished and it is part of the backup
|
|
26
|
+
// promise, so if the backup passes the finished event fired.
|
|
27
|
+
return u.testBackup(params, 'animaldb', process.stdout);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should get a finished event when using file output', async function() {
|
|
31
|
+
u.setTimeout(this, 40);
|
|
32
|
+
// Use the API so we can get events, pass eventEmitter so we get the emitter back
|
|
33
|
+
const params = { useApi: true };
|
|
34
|
+
const actualBackup = `./${this.fileName}`;
|
|
35
|
+
return u.testBackupToFile(params, 'animaldb', actualBackup);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2017,
|
|
1
|
+
// Copyright © 2017, 2023 IBM Corp. All rights reserved.
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,154 +11,31 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
'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
14
|
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
}
|
|
15
|
+
/* global describe it */
|
|
16
|
+
'use strict';
|
|
37
17
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
18
|
+
const assert = require('assert');
|
|
19
|
+
const logfilegetbatches = require('../includes/logfilegetbatches.js');
|
|
20
|
+
|
|
21
|
+
describe('#unit Fetching batches from a log file', function() {
|
|
22
|
+
it('should fetch multiple batches correctly', async function() {
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
logfilegetbatches('./test/fixtures/test.log', [1, 4], function(err, data) {
|
|
25
|
+
try {
|
|
26
|
+
assert.ok(!err);
|
|
27
|
+
assert.ok(data);
|
|
28
|
+
assert.strictEqual(typeof data, 'object');
|
|
29
|
+
assert.strictEqual(Object.keys(data).length, 2);
|
|
30
|
+
assert.deepStrictEqual(data['1'].docs, [{ id: '6' }, { id: '7' }, { id: '8' }, { id: '9' }, { id: '10' }]);
|
|
31
|
+
assert.strictEqual(data['1'].batch, 1);
|
|
32
|
+
assert.deepStrictEqual(data['4'].docs, [{ id: '21' }, { id: '22' }]);
|
|
33
|
+
assert.strictEqual(data['4'].batch, 4);
|
|
34
|
+
resolve();
|
|
35
|
+
} catch (err) {
|
|
36
|
+
reject(err);
|
|
46
37
|
}
|
|
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
38
|
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
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
|
-
};
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
});
|