@cloudant/couchbackup 2.9.8-SNAPSHOT.94 → 2.9.8
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-36.pb +1 -0
- package/.scannerwork/scanner-report/changesets-37.pb +1 -0
- package/.scannerwork/scanner-report/changesets-41.pb +1 -0
- package/.scannerwork/scanner-report/changesets-42.pb +1 -0
- package/.scannerwork/scanner-report/changesets-43.pb +1 -0
- package/.scannerwork/scanner-report/changesets-44.pb +1 -0
- package/.scannerwork/scanner-report/changesets-45.pb +1 -0
- package/.scannerwork/scanner-report/changesets-46.pb +1 -0
- package/.scannerwork/scanner-report/changesets-47.pb +1 -0
- package/.scannerwork/scanner-report/changesets-48.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/component-1.pb +1 -1
- package/.scannerwork/scanner-report/component-19.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-23.pb +1 -1
- package/.scannerwork/scanner-report/component-24.pb +1 -1
- package/.scannerwork/scanner-report/component-25.pb +1 -1
- package/.scannerwork/scanner-report/component-26.pb +1 -1
- package/.scannerwork/scanner-report/component-27.pb +1 -1
- package/.scannerwork/scanner-report/component-28.pb +1 -1
- package/.scannerwork/scanner-report/component-29.pb +1 -1
- package/.scannerwork/scanner-report/component-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-4.pb +1 -1
- package/.scannerwork/scanner-report/component-40.pb +1 -1
- package/.scannerwork/scanner-report/component-41.pb +1 -0
- package/.scannerwork/scanner-report/component-42.pb +1 -0
- package/.scannerwork/scanner-report/component-43.pb +1 -0
- package/.scannerwork/scanner-report/component-44.pb +1 -0
- package/.scannerwork/scanner-report/component-45.pb +1 -0
- package/.scannerwork/scanner-report/component-46.pb +1 -0
- package/.scannerwork/scanner-report/component-47.pb +1 -0
- package/.scannerwork/scanner-report/component-48.pb +1 -0
- 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 -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-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-61.pb +1 -1
- package/.scannerwork/scanner-report/component-65.pb +1 -1
- package/.scannerwork/scanner-report/component-66.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/coverages-19.pb +0 -0
- package/.scannerwork/scanner-report/coverages-20.pb +0 -0
- package/.scannerwork/scanner-report/coverages-21.pb +0 -0
- package/.scannerwork/scanner-report/coverages-22.pb +0 -0
- package/.scannerwork/scanner-report/coverages-23.pb +0 -0
- package/.scannerwork/scanner-report/coverages-24.pb +0 -0
- package/.scannerwork/scanner-report/coverages-25.pb +0 -0
- package/.scannerwork/scanner-report/coverages-26.pb +0 -0
- package/.scannerwork/scanner-report/coverages-27.pb +0 -0
- package/.scannerwork/scanner-report/coverages-28.pb +0 -0
- package/.scannerwork/scanner-report/coverages-29.pb +0 -0
- package/.scannerwork/scanner-report/coverages-30.pb +0 -0
- package/.scannerwork/scanner-report/coverages-31.pb +0 -0
- package/.scannerwork/scanner-report/coverages-32.pb +0 -0
- package/.scannerwork/scanner-report/coverages-33.pb +0 -0
- package/.scannerwork/scanner-report/coverages-34.pb +0 -0
- package/.scannerwork/scanner-report/coverages-35.pb +0 -0
- package/.scannerwork/scanner-report/coverages-36.pb +0 -0
- package/.scannerwork/scanner-report/coverages-37.pb +0 -0
- package/.scannerwork/scanner-report/coverages-4.pb +0 -0
- package/.scannerwork/scanner-report/coverages-41.pb +0 -0
- package/.scannerwork/scanner-report/coverages-46.pb +0 -0
- package/.scannerwork/scanner-report/coverages-47.pb +0 -0
- package/.scannerwork/scanner-report/coverages-49.pb +0 -0
- package/.scannerwork/scanner-report/coverages-5.pb +0 -0
- package/.scannerwork/scanner-report/coverages-50.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-57.pb +0 -0
- package/.scannerwork/scanner-report/coverages-58.pb +0 -0
- package/.scannerwork/scanner-report/coverages-6.pb +0 -0
- package/.scannerwork/scanner-report/coverages-65.pb +0 -0
- package/.scannerwork/scanner-report/coverages-66.pb +0 -0
- package/.scannerwork/scanner-report/coverages-69.pb +0 -0
- package/.scannerwork/scanner-report/coverages-7.pb +0 -0
- package/.scannerwork/scanner-report/duplications-19.pb +3 -0
- package/.scannerwork/scanner-report/duplications-21.pb +2 -0
- package/.scannerwork/scanner-report/duplications-22.pb +3 -0
- package/.scannerwork/scanner-report/duplications-32.pb +2 -3
- package/.scannerwork/scanner-report/duplications-34.pb +0 -2
- package/.scannerwork/scanner-report/duplications-36.pb +2 -0
- package/.scannerwork/scanner-report/duplications-43.pb +2 -0
- package/.scannerwork/scanner-report/duplications-45.pb +2 -0
- package/.scannerwork/scanner-report/duplications-49.pb +0 -2
- package/.scannerwork/scanner-report/duplications-5.pb +3 -3
- package/.scannerwork/scanner-report/duplications-50.pb +0 -2
- package/.scannerwork/scanner-report/duplications-6.pb +0 -2
- package/.scannerwork/scanner-report/duplications-65.pb +2 -0
- package/.scannerwork/scanner-report/duplications-66.pb +2 -0
- package/.scannerwork/scanner-report/duplications-7.pb +0 -0
- package/.scannerwork/scanner-report/issues-28.pb +3 -0
- package/.scannerwork/scanner-report/issues-29.pb +4 -1
- package/.scannerwork/scanner-report/measures-19.pb +0 -0
- package/.scannerwork/scanner-report/measures-20.pb +0 -0
- package/.scannerwork/scanner-report/measures-21.pb +0 -0
- package/.scannerwork/scanner-report/measures-22.pb +0 -0
- package/.scannerwork/scanner-report/measures-23.pb +0 -0
- package/.scannerwork/scanner-report/measures-24.pb +0 -0
- package/.scannerwork/scanner-report/measures-25.pb +0 -0
- package/.scannerwork/scanner-report/measures-26.pb +0 -0
- package/.scannerwork/scanner-report/measures-27.pb +0 -0
- package/.scannerwork/scanner-report/measures-28.pb +0 -0
- package/.scannerwork/scanner-report/measures-29.pb +0 -0
- package/.scannerwork/scanner-report/measures-30.pb +0 -0
- package/.scannerwork/scanner-report/measures-31.pb +0 -0
- package/.scannerwork/scanner-report/measures-32.pb +0 -0
- package/.scannerwork/scanner-report/measures-33.pb +0 -0
- package/.scannerwork/scanner-report/measures-34.pb +0 -0
- package/.scannerwork/scanner-report/measures-35.pb +0 -0
- package/.scannerwork/scanner-report/measures-36.pb +0 -0
- package/.scannerwork/scanner-report/measures-37.pb +0 -0
- package/.scannerwork/scanner-report/measures-4.pb +0 -0
- package/.scannerwork/scanner-report/measures-41.pb +0 -0
- package/.scannerwork/scanner-report/measures-44.pb +16 -0
- package/.scannerwork/scanner-report/measures-46.pb +0 -0
- package/.scannerwork/scanner-report/measures-47.pb +0 -0
- package/.scannerwork/scanner-report/measures-49.pb +0 -0
- package/.scannerwork/scanner-report/measures-5.pb +0 -0
- package/.scannerwork/scanner-report/measures-50.pb +0 -0
- package/.scannerwork/scanner-report/measures-51.pb +0 -0
- package/.scannerwork/scanner-report/measures-52.pb +0 -0
- package/.scannerwork/scanner-report/measures-53.pb +0 -0
- package/.scannerwork/scanner-report/measures-54.pb +0 -0
- package/.scannerwork/scanner-report/measures-55.pb +0 -0
- package/.scannerwork/scanner-report/measures-57.pb +0 -0
- package/.scannerwork/scanner-report/measures-58.pb +0 -0
- package/.scannerwork/scanner-report/measures-59.pb +0 -0
- package/.scannerwork/scanner-report/measures-6.pb +0 -0
- package/.scannerwork/scanner-report/measures-61.pb +0 -0
- package/.scannerwork/scanner-report/measures-65.pb +0 -0
- package/.scannerwork/scanner-report/measures-66.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/metadata.pb +0 -0
- package/.scannerwork/scanner-report/source-19.txt +106 -11
- package/.scannerwork/scanner-report/source-20.txt +16 -73
- package/.scannerwork/scanner-report/source-21.txt +269 -23
- package/.scannerwork/scanner-report/source-22.txt +86 -123
- package/.scannerwork/scanner-report/source-23.txt +73 -15
- package/.scannerwork/scanner-report/source-24.txt +603 -14
- package/.scannerwork/scanner-report/source-25.txt +11 -127
- package/.scannerwork/scanner-report/source-26.txt +36 -41
- package/.scannerwork/scanner-report/source-27.txt +15 -14
- package/.scannerwork/scanner-report/source-28.txt +127 -85
- package/.scannerwork/scanner-report/source-29.txt +325 -101
- package/.scannerwork/scanner-report/source-30.txt +17 -49
- package/.scannerwork/scanner-report/source-31.txt +60 -585
- package/.scannerwork/scanner-report/source-32.txt +114 -88
- package/.scannerwork/scanner-report/source-33.txt +136 -9
- package/.scannerwork/scanner-report/source-34.txt +43 -200
- package/.scannerwork/scanner-report/source-35.txt +125 -92
- package/.scannerwork/scanner-report/source-36.txt +225 -0
- package/.scannerwork/scanner-report/source-37.txt +114 -509
- package/.scannerwork/scanner-report/source-38.txt +50 -50
- package/.scannerwork/scanner-report/source-4.txt +14 -346
- package/.scannerwork/scanner-report/source-40.txt +165 -165
- package/.scannerwork/scanner-report/source-41.txt +31 -0
- package/.scannerwork/scanner-report/source-44.txt +178 -0
- package/.scannerwork/scanner-report/source-46.txt +54 -0
- package/.scannerwork/scanner-report/source-47.txt +41 -0
- package/.scannerwork/scanner-report/source-49.txt +108 -154
- package/.scannerwork/scanner-report/source-5.txt +215 -102
- package/.scannerwork/scanner-report/source-50.txt +234 -143
- package/.scannerwork/scanner-report/source-51.txt +80 -509
- package/.scannerwork/scanner-report/source-52.txt +111 -0
- package/.scannerwork/scanner-report/source-53.txt +20 -138
- package/.scannerwork/scanner-report/source-54.txt +138 -20
- package/.scannerwork/scanner-report/source-55.txt +509 -178
- package/.scannerwork/scanner-report/source-57.txt +58 -22
- package/.scannerwork/scanner-report/source-58.txt +38 -36
- package/.scannerwork/scanner-report/source-59.txt +509 -111
- package/.scannerwork/scanner-report/source-6.txt +41 -266
- package/.scannerwork/scanner-report/source-61.txt +509 -80
- package/.scannerwork/scanner-report/source-65.txt +173 -14
- package/.scannerwork/scanner-report/source-66.txt +133 -239
- package/.scannerwork/scanner-report/source-69.txt +401 -39
- package/.scannerwork/scanner-report/source-7.txt +47 -0
- package/.scannerwork/scanner-report/symbols-19.pb +95 -9
- package/.scannerwork/scanner-report/symbols-20.pb +17 -60
- package/.scannerwork/scanner-report/symbols-21.pb +486 -27
- package/.scannerwork/scanner-report/symbols-22.pb +75 -110
- package/.scannerwork/scanner-report/symbols-23.pb +60 -10
- package/.scannerwork/scanner-report/symbols-24.pb +1253 -13
- package/.scannerwork/scanner-report/symbols-25.pb +9 -102
- package/.scannerwork/scanner-report/symbols-26.pb +42 -35
- package/.scannerwork/scanner-report/symbols-27.pb +11 -17
- package/.scannerwork/scanner-report/symbols-28.pb +115 -68
- package/.scannerwork/scanner-report/symbols-29.pb +494 -116
- package/.scannerwork/scanner-report/symbols-30.pb +14 -45
- package/.scannerwork/scanner-report/symbols-31.pb +68 -1253
- package/.scannerwork/scanner-report/symbols-32.pb +102 -77
- package/.scannerwork/scanner-report/symbols-33.pb +112 -9
- package/.scannerwork/scanner-report/symbols-34.pb +35 -417
- package/.scannerwork/scanner-report/symbols-35.pb +85 -28
- package/.scannerwork/scanner-report/symbols-36.pb +418 -0
- package/.scannerwork/scanner-report/symbols-37.pb +28 -0
- package/.scannerwork/scanner-report/symbols-4.pb +10 -494
- package/.scannerwork/scanner-report/symbols-41.pb +14 -0
- package/.scannerwork/scanner-report/symbols-46.pb +15 -0
- package/.scannerwork/scanner-report/symbols-47.pb +18 -0
- package/.scannerwork/scanner-report/symbols-49.pb +33 -153
- package/.scannerwork/scanner-report/symbols-5.pb +394 -97
- package/.scannerwork/scanner-report/symbols-50.pb +352 -178
- package/.scannerwork/scanner-report/symbols-53.pb +20 -126
- package/.scannerwork/scanner-report/symbols-54.pb +126 -20
- package/.scannerwork/scanner-report/symbols-57.pb +29 -17
- package/.scannerwork/scanner-report/symbols-58.pb +18 -14
- package/.scannerwork/scanner-report/symbols-6.pb +44 -485
- package/.scannerwork/scanner-report/symbols-65.pb +180 -14
- package/.scannerwork/scanner-report/symbols-66.pb +146 -347
- package/.scannerwork/scanner-report/symbols-69.pb +610 -19
- package/.scannerwork/scanner-report/symbols-7.pb +27 -0
- package/.scannerwork/scanner-report/syntax-highlightings-19.pb +142 -19
- package/.scannerwork/scanner-report/syntax-highlightings-20.pb +27 -74
- package/.scannerwork/scanner-report/syntax-highlightings-21.pb +619 -28
- package/.scannerwork/scanner-report/syntax-highlightings-22.pb +118 -183
- package/.scannerwork/scanner-report/syntax-highlightings-23.pb +74 -14
- package/.scannerwork/scanner-report/syntax-highlightings-24.pb +854 -21
- package/.scannerwork/scanner-report/syntax-highlightings-25.pb +15 -194
- package/.scannerwork/scanner-report/syntax-highlightings-26.pb +43 -56
- package/.scannerwork/scanner-report/syntax-highlightings-27.pb +23 -27
- package/.scannerwork/scanner-report/syntax-highlightings-28.pb +100 -71
- package/.scannerwork/scanner-report/syntax-highlightings-29.pb +587 -91
- package/.scannerwork/scanner-report/syntax-highlightings-30.pb +21 -77
- package/.scannerwork/scanner-report/syntax-highlightings-31.pb +64 -846
- package/.scannerwork/scanner-report/syntax-highlightings-32.pb +187 -118
- package/.scannerwork/scanner-report/syntax-highlightings-33.pb +189 -14
- package/.scannerwork/scanner-report/syntax-highlightings-34.pb +58 -294
- package/.scannerwork/scanner-report/syntax-highlightings-35.pb +156 -103
- package/.scannerwork/scanner-report/syntax-highlightings-36.pb +331 -0
- package/.scannerwork/scanner-report/syntax-highlightings-37.pb +127 -3737
- package/.scannerwork/scanner-report/syntax-highlightings-38.pb +21 -22
- package/.scannerwork/scanner-report/syntax-highlightings-4.pb +14 -594
- package/.scannerwork/scanner-report/syntax-highlightings-40.pb +100 -98
- package/.scannerwork/scanner-report/syntax-highlightings-41.pb +45 -0
- package/.scannerwork/scanner-report/syntax-highlightings-44.pb +243 -0
- package/.scannerwork/scanner-report/syntax-highlightings-46.pb +54 -0
- package/.scannerwork/scanner-report/syntax-highlightings-47.pb +50 -0
- package/.scannerwork/scanner-report/syntax-highlightings-49.pb +98 -183
- package/.scannerwork/scanner-report/syntax-highlightings-5.pb +294 -147
- package/.scannerwork/scanner-report/syntax-highlightings-50.pb +224 -164
- package/.scannerwork/scanner-report/syntax-highlightings-51.pb +84 -3738
- package/.scannerwork/scanner-report/syntax-highlightings-52.pb +133 -0
- package/.scannerwork/scanner-report/syntax-highlightings-53.pb +29 -178
- package/.scannerwork/scanner-report/syntax-highlightings-54.pb +178 -29
- package/.scannerwork/scanner-report/syntax-highlightings-55.pb +3712 -209
- package/.scannerwork/scanner-report/syntax-highlightings-57.pb +84 -31
- package/.scannerwork/scanner-report/syntax-highlightings-58.pb +63 -35
- package/.scannerwork/scanner-report/syntax-highlightings-59.pb +3736 -122
- package/.scannerwork/scanner-report/syntax-highlightings-6.pb +66 -615
- package/.scannerwork/scanner-report/syntax-highlightings-61.pb +3737 -84
- package/.scannerwork/scanner-report/syntax-highlightings-65.pb +195 -15
- package/.scannerwork/scanner-report/syntax-highlightings-66.pb +155 -226
- package/.scannerwork/scanner-report/syntax-highlightings-69.pb +624 -58
- package/.scannerwork/scanner-report/syntax-highlightings-7.pb +68 -0
- package/CHANGES.md +3 -0
- package/package.json +1 -1
- package/test-14-results.xml +165 -165
- package/test-16-results.xml +153 -153
- package/test-18-results.xml +146 -146
- package/test-19-results.xml +153 -153
- package/test-iam-18-results.xml +50 -50
- package/.scannerwork/scanner-report/changesets-18.pb +0 -1
- package/.scannerwork/scanner-report/changesets-2.pb +0 -1
- package/.scannerwork/scanner-report/changesets-3.pb +0 -1
- package/.scannerwork/scanner-report/changesets-55.pb +0 -1
- package/.scannerwork/scanner-report/changesets-56.pb +0 -1
- package/.scannerwork/scanner-report/changesets-59.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-62.pb +0 -1
- package/.scannerwork/scanner-report/changesets-63.pb +0 -1
- package/.scannerwork/scanner-report/changesets-64.pb +0 -1
- package/.scannerwork/scanner-report/changesets-68.pb +0 -1
- package/.scannerwork/scanner-report/changesets-70.pb +0 -1
- package/.scannerwork/scanner-report/component-18.pb +0 -1
- package/.scannerwork/scanner-report/component-2.pb +0 -1
- package/.scannerwork/scanner-report/component-3.pb +0 -1
- package/.scannerwork/scanner-report/component-56.pb +0 -1
- package/.scannerwork/scanner-report/component-60.pb +0 -1
- package/.scannerwork/scanner-report/component-62.pb +0 -1
- package/.scannerwork/scanner-report/component-63.pb +0 -1
- package/.scannerwork/scanner-report/component-64.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/component-70.pb +0 -1
- package/.scannerwork/scanner-report/coverages-18.pb +0 -0
- package/.scannerwork/scanner-report/coverages-2.pb +0 -0
- package/.scannerwork/scanner-report/coverages-3.pb +0 -0
- package/.scannerwork/scanner-report/coverages-56.pb +0 -0
- package/.scannerwork/scanner-report/coverages-68.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-3.pb +0 -3
- package/.scannerwork/scanner-report/duplications-60.pb +0 -2
- package/.scannerwork/scanner-report/duplications-62.pb +0 -2
- package/.scannerwork/scanner-report/issues-4.pb +0 -6
- package/.scannerwork/scanner-report/measures-18.pb +0 -0
- package/.scannerwork/scanner-report/measures-2.pb +0 -0
- package/.scannerwork/scanner-report/measures-3.pb +0 -0
- package/.scannerwork/scanner-report/measures-56.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-70.pb +0 -0
- package/.scannerwork/scanner-report/source-18.txt +0 -63
- package/.scannerwork/scanner-report/source-2.txt +0 -147
- package/.scannerwork/scanner-report/source-3.txt +0 -244
- package/.scannerwork/scanner-report/source-56.txt +0 -129
- package/.scannerwork/scanner-report/source-67.txt +0 -509
- package/.scannerwork/scanner-report/source-68.txt +0 -77
- package/.scannerwork/scanner-report/source-70.txt +0 -418
- package/.scannerwork/scanner-report/symbols-18.pb +0 -43
- package/.scannerwork/scanner-report/symbols-2.pb +0 -85
- package/.scannerwork/scanner-report/symbols-3.pb +0 -394
- package/.scannerwork/scanner-report/symbols-56.pb +0 -33
- package/.scannerwork/scanner-report/symbols-68.pb +0 -30
- package/.scannerwork/scanner-report/symbols-70.pb +0 -610
- package/.scannerwork/scanner-report/syntax-highlightings-18.pb +0 -82
- package/.scannerwork/scanner-report/syntax-highlightings-2.pb +0 -191
- package/.scannerwork/scanner-report/syntax-highlightings-3.pb +0 -329
- package/.scannerwork/scanner-report/syntax-highlightings-56.pb +0 -129
- package/.scannerwork/scanner-report/syntax-highlightings-67.pb +0 -3747
- package/.scannerwork/scanner-report/syntax-highlightings-68.pb +0 -103
- package/.scannerwork/scanner-report/syntax-highlightings-70.pb +0 -648
- /package/.scannerwork/scanner-report/{coverages-63.pb → coverages-42.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-60.pb → coverages-43.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-55.pb → coverages-44.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-62.pb → coverages-45.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-64.pb → coverages-48.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-61.pb → coverages-51.pb} +0 -0
- /package/.scannerwork/scanner-report/{coverages-59.pb → coverages-52.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-18.pb → duplications-33.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-2.pb → duplications-37.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-55.pb → duplications-41.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-56.pb → duplications-42.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-59.pb → duplications-44.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-61.pb → duplications-46.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-63.pb → duplications-47.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-64.pb → duplications-48.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-68.pb → duplications-51.pb} +0 -0
- /package/.scannerwork/scanner-report/{duplications-70.pb → duplications-52.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-3.pb → issues-5.pb} +0 -0
- /package/.scannerwork/scanner-report/{issues-21.pb → issues-7.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-63.pb → measures-42.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-60.pb → measures-43.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-62.pb → measures-45.pb} +0 -0
- /package/.scannerwork/scanner-report/{measures-64.pb → measures-48.pb} +0 -0
- /package/.scannerwork/scanner-report/{source-63.txt → source-42.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-60.txt → source-43.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-62.txt → source-45.txt} +0 -0
- /package/.scannerwork/scanner-report/{source-64.txt → source-48.txt} +0 -0
- /package/.scannerwork/scanner-report/{symbols-63.pb → symbols-42.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-60.pb → symbols-43.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-55.pb → symbols-44.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-62.pb → symbols-45.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-64.pb → symbols-48.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-61.pb → symbols-51.pb} +0 -0
- /package/.scannerwork/scanner-report/{symbols-59.pb → symbols-52.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-63.pb → syntax-highlightings-42.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-60.pb → syntax-highlightings-43.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-62.pb → syntax-highlightings-45.pb} +0 -0
- /package/.scannerwork/scanner-report/{syntax-highlightings-64.pb → syntax-highlightings-48.pb} +0 -0
|
@@ -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,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,54 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* Utility methods for the command line interface.
|
|
18
|
+
* @module cliutils
|
|
19
|
+
* @see module:cliutils
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const url = require('url');
|
|
23
|
+
|
|
24
|
+
module.exports = {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Combine a base URL and a database name, ensuring at least single slash
|
|
28
|
+
* between root and database name. This allows users to have Couch behind
|
|
29
|
+
* proxies that mount Couch's / endpoint at some other mount point.
|
|
30
|
+
* @param {string} root - root URL
|
|
31
|
+
* @param {string} databaseName - database name
|
|
32
|
+
* @return concatenated URL.
|
|
33
|
+
*
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
databaseUrl: function databaseUrl(root, databaseName) {
|
|
37
|
+
if (!root.endsWith('/')) {
|
|
38
|
+
root = root + '/';
|
|
39
|
+
}
|
|
40
|
+
return new url.URL(encodeURIComponent(databaseName), root).toString();
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Generate CLI argument usage text.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} description - argument description.
|
|
47
|
+
* @param {string} defaultValue - default argument value.
|
|
48
|
+
*
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
getUsage: function getUsage(description, defaultValue) {
|
|
52
|
+
return `${description} ${defaultValue !== undefined ? ` (default: ${defaultValue})` : ''}`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2017,
|
|
1
|
+
// Copyright © 2017, 2021 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,165 +11,119 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
// Small script which backs up a Cloudant or CouchDB database to an S3
|
|
16
|
-
// bucket via a stream rather than on-disk file.
|
|
17
|
-
//
|
|
18
|
-
// The script generates the backup object name by combining together the path
|
|
19
|
-
// part of the database URL and the current time.
|
|
20
|
-
|
|
21
14
|
'use strict';
|
|
22
15
|
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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;
|
|
67
71
|
}
|
|
68
|
-
const s3 = new AWS.S3(awsOpts);
|
|
69
|
-
|
|
70
|
-
debug(`Creating a new backup of ${s(sourceUrl)} at ${backupBucket}/${backupKey}...`);
|
|
71
|
-
bucketAccessible(s3, backupBucket)
|
|
72
|
-
.then(() => {
|
|
73
|
-
return backupToS3(sourceUrl, s3, backupBucket, backupKey, shallow);
|
|
74
|
-
})
|
|
75
|
-
.then(() => {
|
|
76
|
-
debug('done.');
|
|
77
|
-
})
|
|
78
|
-
.catch((reason) => {
|
|
79
|
-
debug(`Error: ${reason}`);
|
|
80
|
-
process.exit(1);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
72
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return new Promise(function(resolve, reject) {
|
|
94
|
-
const params = {
|
|
95
|
-
Bucket: bucketName
|
|
96
|
-
};
|
|
97
|
-
s3.headBucket(params, function(err, data) {
|
|
98
|
-
if (err) {
|
|
99
|
-
reject(new VError(err, 'S3 bucket not accessible'));
|
|
100
|
-
} else {
|
|
101
|
-
resolve();
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
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
|
+
}
|
|
106
82
|
|
|
107
|
-
|
|
108
|
-
* Backup directly from Cloudant to an object store object via a stream.
|
|
109
|
-
*
|
|
110
|
-
* @param {any} sourceUrl URL of database
|
|
111
|
-
* @param {any} s3Client Object store client
|
|
112
|
-
* @param {any} s3Bucket Backup destination bucket
|
|
113
|
-
* @param {any} s3Key Backup destination key name (shouldn't exist)
|
|
114
|
-
* @param {any} shallow Whether to use the couchbackup `shallow` mode
|
|
115
|
-
* @returns Promise
|
|
116
|
-
*/
|
|
117
|
-
function backupToS3(sourceUrl, s3Client, s3Bucket, s3Key, shallow) {
|
|
118
|
-
return new Promise((resolve, reject) => {
|
|
119
|
-
debug(`Setting up S3 upload to ${s3Bucket}/${s3Key}`);
|
|
120
|
-
|
|
121
|
-
// A pass through stream that has couchbackup's output
|
|
122
|
-
// written to it and it then read by the S3 upload client.
|
|
123
|
-
// It has a 64MB highwater mark to allow for fairly
|
|
124
|
-
// uneven network connectivity.
|
|
125
|
-
const streamToUpload = new stream.PassThrough({ highWaterMark: 67108864 });
|
|
126
|
-
|
|
127
|
-
// Set up S3 upload.
|
|
128
|
-
const params = {
|
|
129
|
-
Bucket: s3Bucket,
|
|
130
|
-
Key: s3Key,
|
|
131
|
-
Body: streamToUpload
|
|
132
|
-
};
|
|
133
|
-
s3Client.upload(params, function(err, data) {
|
|
134
|
-
debug('Object store upload done');
|
|
135
|
-
if (err) {
|
|
136
|
-
debug(err);
|
|
137
|
-
reject(new VError(err, 'Object store upload failed'));
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
debug('Object store upload succeeded');
|
|
141
|
-
debug(data);
|
|
142
|
-
resolve();
|
|
143
|
-
}).httpUploadProgress = (progress) => {
|
|
144
|
-
debug(`Object store upload progress: ${progress}`);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
debug(`Starting streaming data from ${s(sourceUrl)}`);
|
|
148
|
-
couchbackup.backup(
|
|
149
|
-
sourceUrl,
|
|
150
|
-
streamToUpload,
|
|
151
|
-
(err, obj) => {
|
|
152
|
-
if (err) {
|
|
153
|
-
debug(err);
|
|
154
|
-
reject(new VError(err, 'CouchBackup failed with an error'));
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
debug(`Download from ${s(sourceUrl)} complete.`);
|
|
158
|
-
streamToUpload.end(); // must call end() to complete upload.
|
|
159
|
-
// resolve() is called by the upload
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
});
|
|
83
|
+
return opts;
|
|
163
84
|
}
|
|
164
85
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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;
|
|
173
124
|
}
|
|
174
125
|
|
|
175
|
-
|
|
126
|
+
module.exports = {
|
|
127
|
+
parseBackupArgs: parseBackupArgs,
|
|
128
|
+
parseRestoreArgs: parseRestoreArgs
|
|
129
|
+
};
|