@link-assistant/web-capture 1.11.2 → 2.0.0
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/.changeset/config.json +1 -1
- package/.dockerignore +6 -0
- package/.jscpd.json +4 -5
- package/CHANGELOG.md +12 -0
- package/Dockerfile +13 -11
- package/README.md +23 -4
- package/bin/web-capture.js +3 -2
- package/examples/js/capture_cache.js +12 -0
- package/examples/js/playwright_example.js +1 -1
- package/examples/python/capture_client.py +20 -0
- package/examples/python/html_download.py +2 -14
- package/examples/python/image_download.py +3 -7
- package/examples/python/markdown_download.py +2 -14
- package/examples/python/playwright_example.py +6 -6
- package/jest.config.mjs +1 -4
- package/package.json +54 -39
- package/src/archive.js +1 -1
- package/src/binary-download.js +14 -0
- package/src/cache.js +313 -0
- package/src/docx.js +1 -1
- package/src/fetch.js +1 -1
- package/src/figures.js +2 -12
- package/src/gdocs-model-wait.js +2 -4
- package/src/gdocs.js +1 -1
- package/src/index.js +7 -0
- package/src/lib.js +2 -2
- package/src/localize-images.js +2 -12
- package/src/search.js +1 -1
- package/src/shared-dialog.js +1 -1
- package/src/transport.js +2 -2
- package/tests/ci/dependency-freshness.test.js +74 -0
- package/tests/ci/detect-code-changes.test.js +36 -23
- package/tests/ci/docker-install.test.js +31 -0
- package/tests/ci/workflow-policy.test.js +18 -2
- package/tests/e2e/process.test.js +2 -1
- package/tests/helpers/nock.js +10 -0
- package/tests/helpers/screenshot.js +10 -0
- package/tests/helpers/search-fixture.cjs +1 -1
- package/tests/helpers/temporary-directory.js +12 -0
- package/tests/integration/api-endpoints.test.js +1 -1
- package/tests/integration/browser-engines.test.js +4 -52
- package/tests/integration/browser-packaged-path.test.js +45 -0
- package/tests/integration/deepwiki-rendered-page.mock.test.js +1 -1
- package/tests/integration/formalai-contract.test.js +1 -1
- package/tests/integration/github-readme.test.js +2 -6
- package/tests/integration/google-drive-image.test.js +1 -1
- package/tests/integration/search-endpoint.test.js +1 -1
- package/tests/integration/wikipedia-download.test.js +3 -11
- package/tests/mock/index.test.js +1 -1
- package/tests/unit/browser-launch-options.test.js +42 -0
- package/tests/unit/cache.test.js +182 -0
- package/tests/unit/fetch-html.test.js +1 -1
- package/tests/unit/gdocs-export-headers.test.js +1 -1
- package/tests/unit/gdocs.test.js +1 -1
- package/tests/unit/github.test.js +1 -1
- package/tests/unit/publish-verification.test.js +13 -16
- package/tests/unit/stream.test.js +8 -10
- package/tests/xpaste/xpaste-screenshot-markdown.mock.test.js +1 -1
- package/tests/xpaste/xpaste.e2e.test.js +1 -1
- package/tests/xpaste/xpaste.mock.test.js +1 -1
- package/babel.config.cjs +0 -13
|
@@ -17,10 +17,7 @@ describe('streamHandler', () => {
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
try {
|
|
20
|
-
const res = await
|
|
21
|
-
.get('/stream')
|
|
22
|
-
.query({ url })
|
|
23
|
-
.expect(200);
|
|
20
|
+
const res = await streamFrom(url);
|
|
24
21
|
|
|
25
22
|
expect(upstreamHeaders['accept-encoding']).toBe('identity');
|
|
26
23
|
expect(res.headers['content-type']).toBe('text/html; charset=utf-8');
|
|
@@ -39,15 +36,12 @@ describe('streamHandler', () => {
|
|
|
39
36
|
res.writeHead(200, {
|
|
40
37
|
'Content-Type': 'text/html; charset=utf-8',
|
|
41
38
|
});
|
|
42
|
-
|
|
43
|
-
res.socket.end();
|
|
39
|
+
// Wait until the body reaches the socket before deliberately truncating it.
|
|
40
|
+
res.write(body, () => res.socket.end());
|
|
44
41
|
});
|
|
45
42
|
|
|
46
43
|
try {
|
|
47
|
-
const res = await
|
|
48
|
-
.get('/stream')
|
|
49
|
-
.query({ url })
|
|
50
|
-
.expect(200);
|
|
44
|
+
const res = await streamFrom(url);
|
|
51
45
|
|
|
52
46
|
expect(res.text).toContain('Example Domain');
|
|
53
47
|
} finally {
|
|
@@ -83,3 +77,7 @@ async function closeServer(server) {
|
|
|
83
77
|
});
|
|
84
78
|
});
|
|
85
79
|
}
|
|
80
|
+
|
|
81
|
+
function streamFrom(url) {
|
|
82
|
+
return request(testApp()).get('/stream').query({ url }).expect(200);
|
|
83
|
+
}
|