@remotion/renderer 4.0.0-webhook.26 → 4.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/LICENSE.md +8 -8
- package/README.md +9 -0
- package/client.d.ts +1 -0
- package/client.js +1 -0
- package/dist/assets/calculate-asset-positions.d.ts +0 -0
- package/dist/assets/calculate-asset-positions.js +1 -0
- package/dist/assets/calculate-atempo.d.ts +0 -0
- package/dist/assets/calculate-atempo.js +0 -0
- package/dist/assets/convert-assets-to-file-urls.d.ts +0 -0
- package/dist/assets/convert-assets-to-file-urls.js +0 -0
- package/dist/assets/download-and-map-assets-to-file.d.ts +6 -4
- package/dist/assets/download-and-map-assets-to-file.js +49 -19
- package/dist/assets/download-file.d.ts +8 -5
- package/dist/assets/download-file.js +71 -8
- package/dist/assets/download-map.d.ts +8 -29
- package/dist/assets/download-map.js +15 -16
- package/dist/assets/ffmpeg-volume-expression.d.ts +4 -3
- package/dist/assets/ffmpeg-volume-expression.js +5 -3
- package/dist/assets/flatten-volume-array.d.ts +0 -0
- package/dist/assets/flatten-volume-array.js +0 -0
- package/dist/assets/get-audio-channels.d.ts +2 -2
- package/dist/assets/get-audio-channels.js +14 -12
- package/dist/assets/read-file.d.ts +1 -1
- package/dist/assets/read-file.js +5 -7
- package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts +0 -0
- package/dist/assets/round-volume-to-avoid-stack-overflow.js +0 -0
- package/dist/assets/sanitize-filename.d.ts +0 -0
- package/dist/assets/sanitize-filename.js +0 -0
- package/dist/assets/sanitize-filepath.d.ts +0 -0
- package/dist/assets/sanitize-filepath.js +2 -2
- package/dist/assets/truncate-utf8-bytes.d.ts +0 -0
- package/dist/assets/truncate-utf8-bytes.js +0 -0
- package/dist/assets/types.d.ts +5 -4
- package/dist/assets/types.js +0 -0
- package/dist/audio-codec.d.ts +28 -0
- package/dist/audio-codec.js +83 -0
- package/dist/browser/Browser.d.ts +19 -16
- package/dist/browser/Browser.js +72 -75
- package/dist/browser/BrowserConnector.d.ts +0 -0
- package/dist/browser/BrowserConnector.js +0 -0
- package/dist/browser/BrowserFetcher.d.ts +16 -64
- package/dist/browser/BrowserFetcher.js +147 -235
- package/dist/browser/BrowserPage.d.ts +32 -6
- package/dist/browser/BrowserPage.js +90 -26
- package/dist/browser/BrowserRunner.d.ts +1 -1
- package/dist/browser/BrowserRunner.js +32 -22
- package/dist/browser/Connection.d.ts +9 -3
- package/dist/browser/Connection.js +12 -4
- package/dist/browser/ConsoleMessage.d.ts +9 -2
- package/dist/browser/ConsoleMessage.js +2 -1
- package/dist/browser/DOMWorld.d.ts +5 -4
- package/dist/browser/DOMWorld.js +16 -9
- package/dist/browser/Errors.d.ts +0 -0
- package/dist/browser/Errors.js +0 -0
- package/dist/browser/EvalTypes.d.ts +7 -7
- package/dist/browser/EvalTypes.js +0 -0
- package/dist/browser/EventEmitter.d.ts +0 -0
- package/dist/browser/EventEmitter.js +0 -0
- package/dist/browser/ExecutionContext.d.ts +0 -0
- package/dist/browser/ExecutionContext.js +4 -4
- package/dist/browser/FrameManager.d.ts +0 -2
- package/dist/browser/FrameManager.js +15 -19
- package/dist/browser/HTTPRequest.d.ts +0 -0
- package/dist/browser/HTTPRequest.js +0 -0
- package/dist/browser/HTTPResponse.d.ts +0 -0
- package/dist/browser/HTTPResponse.js +0 -0
- package/dist/browser/JSHandle.d.ts +0 -0
- package/dist/browser/JSHandle.js +14 -14
- package/dist/browser/LaunchOptions.d.ts +4 -2
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +9 -3
- package/dist/browser/Launcher.js +17 -29
- package/dist/browser/LifecycleWatcher.d.ts +1 -1
- package/dist/browser/LifecycleWatcher.js +0 -0
- package/dist/browser/NetworkEventManager.d.ts +4 -4
- package/dist/browser/NetworkEventManager.js +0 -0
- package/dist/browser/NetworkManager.d.ts +4 -1
- package/dist/browser/NetworkManager.js +0 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +0 -0
- package/dist/browser/NodeWebSocketTransport.js +21 -21
- package/dist/browser/Product.d.ts +1 -1
- package/dist/browser/Product.js +0 -0
- package/dist/browser/PuppeteerNode.d.ts +2 -5
- package/dist/browser/PuppeteerNode.js +2 -11
- package/dist/browser/PuppeteerViewport.d.ts +0 -0
- package/dist/browser/PuppeteerViewport.js +0 -0
- package/dist/browser/ScreenshotOptions.d.ts +0 -14
- package/dist/browser/ScreenshotOptions.js +0 -1
- package/dist/browser/Target.d.ts +5 -3
- package/dist/browser/Target.js +10 -2
- package/dist/browser/TaskQueue.d.ts +0 -0
- package/dist/browser/TaskQueue.js +0 -0
- package/dist/browser/TimeoutSettings.d.ts +0 -0
- package/dist/browser/TimeoutSettings.js +0 -0
- package/dist/browser/assert.d.ts +0 -0
- package/dist/browser/assert.js +0 -0
- package/dist/browser/create-browser-fetcher.d.ts +0 -0
- package/dist/browser/create-browser-fetcher.js +34 -48
- package/dist/browser/devtools-commands.d.ts +5 -1
- package/dist/browser/devtools-commands.js +0 -0
- package/dist/browser/devtools-types.d.ts +151 -10
- package/dist/browser/devtools-types.js +0 -0
- package/dist/browser/get-download-destination.d.ts +0 -0
- package/dist/browser/get-download-destination.js +8 -8
- package/dist/browser/is-target-closed-err.d.ts +1 -0
- package/dist/browser/is-target-closed-err.js +9 -0
- package/dist/browser/mitt/index.d.ts +6 -6
- package/dist/browser/mitt/index.js +0 -0
- package/dist/browser/node.d.ts +0 -0
- package/dist/browser/node.js +0 -0
- package/dist/browser/revisions.d.ts +1 -1
- package/dist/browser/revisions.js +0 -0
- package/dist/browser/should-log-message.d.ts +24 -0
- package/dist/browser/should-log-message.js +80 -0
- package/dist/browser/util.d.ts +2 -2
- package/dist/browser/util.js +0 -0
- package/dist/browser-executable.d.ts +1 -1
- package/dist/browser-executable.js +0 -0
- package/dist/browser-log.d.ts +1 -1
- package/dist/browser-log.js +0 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +0 -0
- package/dist/calculate-ffmpeg-filters.d.ts +2 -1
- package/dist/calculate-ffmpeg-filters.js +1 -0
- package/dist/call-ffmpeg.d.ts +14 -0
- package/dist/call-ffmpeg.js +42 -0
- package/dist/can-use-parallel-encoding.d.ts +0 -0
- package/dist/can-use-parallel-encoding.js +0 -0
- package/dist/chalk/index.d.ts +55 -0
- package/dist/chalk/index.js +130 -0
- package/dist/chalk/is-color-supported.d.ts +1 -0
- package/dist/chalk/is-color-supported.js +45 -0
- package/dist/check-apple-silicon.d.ts +1 -1
- package/dist/check-apple-silicon.js +8 -47
- package/dist/chunk.d.ts +0 -0
- package/dist/chunk.js +0 -0
- package/dist/client.d.ts +204 -0
- package/dist/client.js +49 -0
- package/dist/codec-supports-media.d.ts +3 -2
- package/dist/codec-supports-media.js +20 -5
- package/dist/codec.d.ts +2 -2
- package/dist/codec.js +0 -0
- package/dist/combine-videos.d.ts +6 -2
- package/dist/combine-videos.js +17 -17
- package/dist/compositor/compose.d.ts +26 -0
- package/dist/compositor/compose.js +87 -0
- package/dist/compositor/compositor.d.ts +12 -0
- package/dist/compositor/compositor.js +219 -0
- package/dist/compositor/get-executable-path.d.ts +1 -0
- package/dist/compositor/get-executable-path.js +57 -0
- package/dist/compositor/make-nonce.d.ts +1 -0
- package/dist/compositor/make-nonce.js +8 -0
- package/dist/compositor/payloads.d.ts +68 -0
- package/dist/{ffmpeg-executable.js → compositor/payloads.js} +0 -0
- package/dist/compress-assets.d.ts +0 -0
- package/dist/compress-assets.js +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.js +0 -0
- package/dist/convert-to-positive-frame-index.d.ts +0 -0
- package/dist/convert-to-positive-frame-index.js +0 -0
- package/dist/create-ffmpeg-complex-filter.d.ts +5 -1
- package/dist/create-ffmpeg-complex-filter.js +6 -4
- package/dist/create-ffmpeg-merge-filter.d.ts +5 -1
- package/dist/create-ffmpeg-merge-filter.js +20 -13
- package/dist/create-silent-audio.d.ts +1 -3
- package/dist/create-silent-audio.js +3 -6
- package/dist/crf.d.ts +6 -2
- package/dist/crf.js +41 -8
- package/dist/cycle-browser-tabs.d.ts +3 -5
- package/dist/cycle-browser-tabs.js +7 -7
- package/dist/delay-render-embedded-stack.d.ts +0 -0
- package/dist/delay-render-embedded-stack.js +0 -0
- package/dist/delete-directory.d.ts +1 -1
- package/dist/delete-directory.js +43 -17
- package/dist/does-have-m2-bug.d.ts +3 -0
- package/dist/does-have-m2-bug.js +12 -0
- package/dist/ensure-frames-in-order.d.ts +0 -0
- package/dist/ensure-frames-in-order.js +0 -0
- package/dist/ensure-output-directory.d.ts +0 -0
- package/dist/ensure-output-directory.js +5 -5
- package/dist/error-handling/handle-javascript-exception.d.ts +0 -0
- package/dist/error-handling/handle-javascript-exception.js +10 -0
- package/dist/error-handling/symbolicate-error.d.ts +0 -0
- package/dist/error-handling/symbolicate-error.js +6 -3
- package/dist/error-handling/symbolicateable-error.d.ts +0 -0
- package/dist/error-handling/symbolicateable-error.js +0 -0
- package/dist/ffmpeg-filter-file.d.ts +6 -1
- package/dist/ffmpeg-filter-file.js +40 -8
- package/dist/ffmpeg-override.d.ts +1 -1
- package/dist/ffmpeg-override.js +0 -0
- package/dist/file-extensions.d.ts +14 -0
- package/dist/file-extensions.js +76 -0
- package/dist/find-closest-package-json.d.ts +2 -0
- package/dist/find-closest-package-json.js +31 -0
- package/dist/format-logs.d.ts +3 -0
- package/dist/format-logs.js +201 -0
- package/dist/frame-range.d.ts +1 -1
- package/dist/frame-range.js +0 -0
- package/dist/get-browser-instance.d.ts +9 -3
- package/dist/get-browser-instance.js +10 -5
- package/dist/get-codec-name.d.ts +0 -0
- package/dist/get-codec-name.js +0 -0
- package/dist/get-compositions.d.ts +28 -14
- package/dist/get-compositions.js +74 -40
- package/dist/get-concurrency.d.ts +1 -1
- package/dist/get-concurrency.js +11 -4
- package/dist/get-duration-from-frame-range.d.ts +0 -0
- package/dist/get-duration-from-frame-range.js +0 -0
- package/dist/get-extension-from-codec.d.ts +5 -1
- package/dist/get-extension-from-codec.js +56 -32
- package/dist/get-extension-of-filename.d.ts +0 -0
- package/dist/get-extension-of-filename.js +5 -1
- package/dist/get-frame-padded-index.d.ts +3 -2
- package/dist/get-frame-padded-index.js +3 -2
- package/dist/get-frame-to-render.d.ts +0 -0
- package/dist/get-frame-to-render.js +1 -1
- package/dist/get-local-browser-executable.d.ts +0 -0
- package/dist/get-local-browser-executable.js +7 -15
- package/dist/get-port.d.ts +4 -1
- package/dist/get-port.js +8 -8
- package/dist/get-prores-profile-name.d.ts +0 -0
- package/dist/get-prores-profile-name.js +0 -0
- package/dist/get-video-threads-flag.d.ts +0 -0
- package/dist/get-video-threads-flag.js +3 -3
- package/dist/guess-extension-for-media.d.ts +3 -1
- package/dist/guess-extension-for-media.js +4 -7
- package/dist/image-format.d.ts +12 -6
- package/dist/image-format.js +19 -13
- package/dist/index.d.ts +369 -49
- package/dist/index.js +67 -46
- package/dist/is-audio-codec.d.ts +0 -0
- package/dist/is-audio-codec.js +0 -0
- package/dist/is-serve-url.d.ts +0 -0
- package/dist/is-serve-url.js +0 -0
- package/dist/jpeg-quality.d.ts +2 -0
- package/dist/jpeg-quality.js +22 -0
- package/dist/locks.d.ts +7 -0
- package/dist/locks.js +44 -0
- package/dist/log-level.d.ts +1 -1
- package/dist/log-level.js +0 -0
- package/dist/logger.d.ts +23 -0
- package/dist/logger.js +63 -0
- package/dist/make-cancel-signal.d.ts +13 -2
- package/dist/make-cancel-signal.js +24 -1
- package/dist/merge-audio-track.d.ts +4 -4
- package/dist/merge-audio-track.js +38 -33
- package/dist/mime-db.d.ts +0 -0
- package/dist/mime-db.js +0 -0
- package/dist/mime-types.d.ts +0 -0
- package/dist/mime-types.js +3 -3
- package/dist/normalize-serve-url.d.ts +0 -0
- package/dist/normalize-serve-url.js +0 -0
- package/dist/offthread-video-server.d.ts +48 -11
- package/dist/offthread-video-server.js +112 -58
- package/dist/open-browser.d.ts +22 -6
- package/dist/open-browser.js +40 -17
- package/dist/options/audio-bitrate.d.ts +2 -0
- package/dist/options/audio-bitrate.js +11 -0
- package/dist/options/crf.d.ts +2 -0
- package/dist/options/crf.js +11 -0
- package/dist/options/enforce-audio.d.ts +2 -0
- package/dist/options/enforce-audio.js +11 -0
- package/dist/options/jpeg-quality.d.ts +2 -0
- package/dist/options/jpeg-quality.js +11 -0
- package/dist/options/mute.d.ts +2 -0
- package/dist/options/mute.js +11 -0
- package/dist/options/option.d.ts +8 -0
- package/dist/options/option.js +2 -0
- package/dist/options/scale.d.ts +2 -0
- package/dist/options/scale.js +11 -0
- package/dist/options/video-bitrate.d.ts +2 -0
- package/dist/options/video-bitrate.js +11 -0
- package/dist/options/video-codec.d.ts +2 -0
- package/dist/options/video-codec.js +11 -0
- package/dist/overwrite.d.ts +0 -0
- package/dist/overwrite.js +0 -0
- package/dist/p-limit.d.ts +0 -0
- package/dist/p-limit.js +0 -0
- package/dist/parse-browser-error-stack.d.ts +1 -1
- package/dist/parse-browser-error-stack.js +0 -0
- package/dist/parse-ffmpeg-progress.d.ts +0 -0
- package/dist/parse-ffmpeg-progress.js +0 -0
- package/dist/perf.d.ts +2 -2
- package/dist/perf.js +11 -7
- package/dist/pixel-format.d.ts +2 -2
- package/dist/pixel-format.js +3 -0
- package/dist/pool.d.ts +0 -0
- package/dist/pool.js +0 -0
- package/dist/prepare-server.d.ts +26 -10
- package/dist/prepare-server.js +71 -18
- package/dist/preprocess-audio-track.d.ts +7 -5
- package/dist/preprocess-audio-track.js +7 -8
- package/dist/prespawn-ffmpeg.d.ts +22 -11
- package/dist/prespawn-ffmpeg.js +41 -31
- package/dist/prestitcher-memory-usage.d.ts +0 -4
- package/dist/prestitcher-memory-usage.js +4 -5
- package/dist/prores-profile.d.ts +6 -4
- package/dist/prores-profile.js +8 -8
- package/dist/provide-screenshot.d.ts +8 -4
- package/dist/provide-screenshot.js +5 -2
- package/dist/puppeteer-evaluate.d.ts +4 -1
- package/dist/puppeteer-evaluate.js +23 -15
- package/dist/puppeteer-screenshot.d.ts +12 -2
- package/dist/puppeteer-screenshot.js +18 -45
- package/dist/redirect-status-codes.d.ts +1 -0
- package/dist/redirect-status-codes.js +6 -0
- package/dist/render-frames.d.ts +59 -35
- package/dist/render-frames.js +256 -147
- package/dist/render-media.d.ts +82 -28
- package/dist/render-media.js +322 -195
- package/dist/render-still.d.ts +52 -19
- package/dist/render-still.js +132 -74
- package/dist/replace-browser.d.ts +7 -0
- package/dist/replace-browser.js +47 -0
- package/dist/resolve-asset-src.d.ts +0 -0
- package/dist/resolve-asset-src.js +2 -2
- package/dist/sample-rate.d.ts +0 -0
- package/dist/sample-rate.js +0 -0
- package/dist/screenshot-dom-element.d.ts +8 -4
- package/dist/screenshot-dom-element.js +15 -4
- package/dist/screenshot-task.d.ts +11 -2
- package/dist/screenshot-task.js +45 -13
- package/dist/seek-to-frame.d.ts +3 -1
- package/dist/seek-to-frame.js +53 -7
- package/dist/select-composition.d.ts +46 -0
- package/dist/select-composition.js +157 -0
- package/dist/serve-handler/index.d.ts +1 -1
- package/dist/serve-handler/index.js +21 -19
- package/dist/serve-handler/is-path-inside.d.ts +0 -0
- package/dist/serve-handler/is-path-inside.js +3 -3
- package/dist/serve-handler/range-parser.d.ts +0 -0
- package/dist/serve-handler/range-parser.js +0 -0
- package/dist/serve-static.d.ts +9 -6
- package/dist/serve-static.js +85 -59
- package/dist/set-props-and-env.d.ts +5 -3
- package/dist/set-props-and-env.js +20 -12
- package/dist/stitch-frames-to-video.d.ts +40 -16
- package/dist/stitch-frames-to-video.js +200 -121
- package/dist/stringify-ffmpeg-filter.d.ts +10 -2
- package/dist/stringify-ffmpeg-filter.js +37 -34
- package/dist/symbolicate-stacktrace.d.ts +16 -3
- package/dist/symbolicate-stacktrace.js +49 -24
- package/dist/take-frame-and-compose.d.ts +22 -0
- package/dist/take-frame-and-compose.js +103 -0
- package/dist/tmp-dir.d.ts +0 -0
- package/dist/tmp-dir.js +7 -8
- package/dist/truthy.d.ts +1 -1
- package/dist/truthy.js +0 -0
- package/dist/types.d.ts +2 -2
- package/dist/types.js +0 -0
- package/dist/validate-concurrency.d.ts +2 -0
- package/dist/validate-concurrency.js +21 -10
- package/dist/validate-even-dimensions-with-codec.d.ts +0 -0
- package/dist/validate-even-dimensions-with-codec.js +0 -0
- package/dist/validate-every-nth-frame.d.ts +2 -1
- package/dist/validate-every-nth-frame.js +8 -1
- package/dist/validate-ffmpeg-override.d.ts +0 -0
- package/dist/validate-ffmpeg-override.js +0 -0
- package/dist/validate-number-of-gif-loops.d.ts +2 -0
- package/dist/validate-number-of-gif-loops.js +24 -0
- package/dist/validate-opengl-renderer.d.ts +1 -1
- package/dist/validate-opengl-renderer.js +0 -0
- package/dist/validate-output-filename.d.ts +7 -2
- package/dist/validate-output-filename.js +20 -51
- package/dist/validate-puppeteer-timeout.d.ts +0 -0
- package/dist/validate-puppeteer-timeout.js +1 -0
- package/dist/validate-scale.d.ts +0 -0
- package/dist/validate-scale.js +0 -0
- package/dist/validate-videobitrate.d.ts +1 -0
- package/dist/validate-videobitrate.js +20 -0
- package/dist/wait-for-symbolication-error-to-be-done.d.ts +0 -0
- package/dist/wait-for-symbolication-error-to-be-done.js +5 -31
- package/dist/ws/ws-types.d.ts +0 -0
- package/dist/ws/ws-types.js +2 -1
- package/install-toolchain.mjs +36 -0
- package/package.json +70 -60
- package/types/ws/index.d.ts +5 -5
- package/.prettierrc.js +0 -14
- package/dist/assets/dl-browser.d.ts +0 -1
- package/dist/assets/dl-browser.js +0 -38
- package/dist/assets/get-video-stream-duration.d.ts +0 -4
- package/dist/assets/get-video-stream-duration.js +0 -59
- package/dist/calculate-sar-dar-pixels.d.ts +0 -9
- package/dist/calculate-sar-dar-pixels.js +0 -19
- package/dist/convert-to-pcm.d.ts +0 -6
- package/dist/convert-to-pcm.js +0 -20
- package/dist/ensure-presentation-timestamp.d.ts +0 -2
- package/dist/ensure-presentation-timestamp.js +0 -69
- package/dist/extract-frame-from-video.d.ts +0 -16
- package/dist/extract-frame-from-video.js +0 -277
- package/dist/ffmpeg-executable.d.ts +0 -1
- package/dist/ffmpeg-flags.d.ts +0 -12
- package/dist/ffmpeg-flags.js +0 -45
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -1
- package/dist/frame-to-ffmpeg-timestamp.js +0 -8
- package/dist/get-audio-codec-name.d.ts +0 -2
- package/dist/get-audio-codec-name.js +0 -28
- package/dist/get-video-info.d.ts +0 -3
- package/dist/get-video-info.js +0 -49
- package/dist/is-beyond-last-frame.d.ts +0 -3
- package/dist/is-beyond-last-frame.js +0 -12
- package/dist/last-frame-from-video-cache.d.ts +0 -17
- package/dist/last-frame-from-video-cache.js +0 -55
- package/dist/legacy-webpack-config.d.ts +0 -9
- package/dist/legacy-webpack-config.js +0 -13
- package/dist/quality.d.ts +0 -1
- package/dist/quality.js +0 -21
- package/dist/validate-ffmpeg.d.ts +0 -2
- package/dist/validate-ffmpeg.js +0 -72
- package/dist/validate-frame.d.ts +0 -1
- package/dist/validate-frame.js +0 -24
- package/tsconfig.json +0 -10
- package/vitest.config.ts +0 -8
|
@@ -16,62 +16,48 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.downloadBrowser = void 0;
|
|
19
|
-
const
|
|
19
|
+
const BrowserFetcher_1 = require("./BrowserFetcher");
|
|
20
20
|
const revisions_1 = require("./revisions");
|
|
21
21
|
const supportedProducts = {
|
|
22
22
|
chrome: 'Chromium',
|
|
23
23
|
firefox: 'Firefox Nightly',
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
path: null,
|
|
29
|
-
platform: null,
|
|
30
|
-
});
|
|
31
|
-
const revision = await getRevision();
|
|
32
|
-
await fetchBinary(revision);
|
|
33
|
-
function getRevision() {
|
|
34
|
-
if (product === 'chrome') {
|
|
35
|
-
return revisions_1.PUPPETEER_REVISIONS.chromium;
|
|
36
|
-
}
|
|
37
|
-
throw new Error(`Unsupported product ${product}`);
|
|
25
|
+
function getRevision(product) {
|
|
26
|
+
if (product === 'chrome') {
|
|
27
|
+
return revisions_1.PUPPETEER_REVISIONS.chromium;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
function onProgress(downloadedBytes, totalBytes) {
|
|
62
|
-
console.log('Downloading', supportedProducts[product], toMegabytes(downloadedBytes) + '/' + toMegabytes(totalBytes));
|
|
63
|
-
}
|
|
64
|
-
return browserFetcher
|
|
65
|
-
.download(revisionInfo.revision, onProgress)
|
|
66
|
-
.then(() => {
|
|
67
|
-
return browserFetcher.localRevisions();
|
|
29
|
+
throw new Error(`Unsupported product ${product}`);
|
|
30
|
+
}
|
|
31
|
+
async function downloadBrowser(product) {
|
|
32
|
+
const revision = getRevision(product);
|
|
33
|
+
const revisionInfo = (0, BrowserFetcher_1.getRevisionInfo)(revision, product);
|
|
34
|
+
try {
|
|
35
|
+
await (0, BrowserFetcher_1.download)({
|
|
36
|
+
revision: revisionInfo.revision,
|
|
37
|
+
progressCallback: (downloadedBytes, totalBytes) => {
|
|
38
|
+
console.log('Downloading', supportedProducts[product], toMegabytes(downloadedBytes) + '/' + toMegabytes(totalBytes));
|
|
39
|
+
},
|
|
40
|
+
product,
|
|
41
|
+
platform: (0, BrowserFetcher_1.getPlatform)(product),
|
|
42
|
+
downloadHost: (0, BrowserFetcher_1.getDownloadHost)(product),
|
|
43
|
+
downloadsFolder: (0, BrowserFetcher_1.getDownloadsFolder)(product),
|
|
44
|
+
});
|
|
45
|
+
const _localRevisions = await (0, BrowserFetcher_1.localRevisions)((0, BrowserFetcher_1.getDownloadsFolder)(product), product, (0, BrowserFetcher_1.getPlatform)(product));
|
|
46
|
+
console.log(`${supportedProducts[product]} (${revisionInfo.revision}) downloaded to ${revisionInfo.folderPath}`);
|
|
47
|
+
await Promise.all(_localRevisions
|
|
48
|
+
.filter((__revision) => {
|
|
49
|
+
return __revision !== revisionInfo.revision;
|
|
68
50
|
})
|
|
69
|
-
.
|
|
70
|
-
.
|
|
51
|
+
.map((__revision) => {
|
|
52
|
+
return (0, BrowserFetcher_1.removeBrowser)(__revision, (0, BrowserFetcher_1.getFolderPath)(revision, (0, BrowserFetcher_1.getDownloadsFolder)(product), (0, BrowserFetcher_1.getPlatform)(product)));
|
|
53
|
+
}));
|
|
71
54
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return `${Math.round(mb * 10) / 10} Mb`;
|
|
55
|
+
catch (err) {
|
|
56
|
+
throw new Error(`Failed to set up ${supportedProducts[product]} r${revision}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`);
|
|
75
57
|
}
|
|
76
58
|
}
|
|
77
59
|
exports.downloadBrowser = downloadBrowser;
|
|
60
|
+
function toMegabytes(bytes) {
|
|
61
|
+
const mb = bytes / 1024 / 1024;
|
|
62
|
+
return `${Math.round(mb * 10) / 10} Mb`;
|
|
63
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActivateTargetRequest, AddScriptToEvaluateOnNewDocumentRequest, AddScriptToEvaluateOnNewDocumentResponse, CallFunctionOnRequest, CallFunctionOnResponse, CaptureScreenshotRequest, CaptureScreenshotResponse, CloseTargetRequest, CloseTargetResponse, CreateIsolatedWorldRequest, CreateIsolatedWorldResponse, DetachFromTargetRequest, DevtoolsRemoteObject, EnableRequest, ExceptionDetails, GetFrameTreeResponse, NavigateRequest, NavigateResponse, ReleaseObjectRequest, SetAutoAttachRequest, SetDefaultBackgroundColorOverrideRequest, SetDeviceMetricsOverrideRequest, SetLifecycleEventsEnabledRequest } from './devtools-types';
|
|
1
|
+
import type { ActivateTargetRequest, AddScriptToEvaluateOnNewDocumentRequest, AddScriptToEvaluateOnNewDocumentResponse, CallFunctionOnRequest, CallFunctionOnResponse, CaptureScreenshotRequest, CaptureScreenshotResponse, CloseTargetRequest, CloseTargetResponse, CreateIsolatedWorldRequest, CreateIsolatedWorldResponse, DetachFromTargetRequest, DevtoolsRemoteObject, EnableRequest, ExceptionDetails, GetFrameTreeResponse, NavigateRequest, NavigateResponse, PrintPDFRequest, PrintPDFResponse, ReleaseObjectRequest, SetAutoAttachRequest, SetDefaultBackgroundColorOverrideRequest, SetDeviceMetricsOverrideRequest, SetLifecycleEventsEnabledRequest } from './devtools-types';
|
|
2
2
|
export interface Commands {
|
|
3
3
|
/**
|
|
4
4
|
* Does nothing.
|
|
@@ -216,6 +216,10 @@ export interface Commands {
|
|
|
216
216
|
paramsType: [CaptureScreenshotRequest?];
|
|
217
217
|
returnType: CaptureScreenshotResponse;
|
|
218
218
|
};
|
|
219
|
+
'Page.printToPDF': {
|
|
220
|
+
paramsType: [PrintPDFRequest];
|
|
221
|
+
returnType: PrintPDFResponse;
|
|
222
|
+
};
|
|
219
223
|
'Target.activateTarget': {
|
|
220
224
|
paramsType: [ActivateTargetRequest];
|
|
221
225
|
returnType: void;
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type RemoteObjectId = string;
|
|
2
2
|
interface WebDriverValue {
|
|
3
3
|
/**
|
|
4
4
|
* (WebDriverValueType enum)
|
|
@@ -7,7 +7,7 @@ interface WebDriverValue {
|
|
|
7
7
|
value?: any;
|
|
8
8
|
objectId?: string;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
type UnserializableValue = string;
|
|
11
11
|
export interface DevtoolsRemoteObject {
|
|
12
12
|
/**
|
|
13
13
|
* Object type. (RemoteObjectType enum)
|
|
@@ -44,8 +44,67 @@ export interface DevtoolsRemoteObject {
|
|
|
44
44
|
* Unique object identifier (for non-primitive values).
|
|
45
45
|
*/
|
|
46
46
|
objectId?: RemoteObjectId;
|
|
47
|
+
preview?: ObjectPreview;
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
+
export interface ObjectPreview {
|
|
50
|
+
/**
|
|
51
|
+
* Object type. (ObjectPreviewType enum)
|
|
52
|
+
*/
|
|
53
|
+
type: 'object' | 'function' | 'undefined' | 'string' | 'number' | 'boolean' | 'symbol' | 'bigint';
|
|
54
|
+
/**
|
|
55
|
+
* Object subtype hint. Specified for `object` type values only. (ObjectPreviewSubtype enum)
|
|
56
|
+
*/
|
|
57
|
+
subtype?: 'array' | 'null' | 'node' | 'regexp' | 'date' | 'map' | 'set' | 'weakmap' | 'weakset' | 'iterator' | 'generator' | 'error' | 'proxy' | 'promise' | 'typedarray' | 'arraybuffer' | 'dataview' | 'webassemblymemory' | 'wasmvalue';
|
|
58
|
+
/**
|
|
59
|
+
* String representation of the object.
|
|
60
|
+
*/
|
|
61
|
+
description?: string;
|
|
62
|
+
/**
|
|
63
|
+
* True iff some of the properties or entries of the original object did not fit.
|
|
64
|
+
*/
|
|
65
|
+
overflow: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* List of the properties.
|
|
68
|
+
*/
|
|
69
|
+
properties: PropertyPreview[];
|
|
70
|
+
/**
|
|
71
|
+
* List of the entries. Specified for `map` and `set` subtype values only.
|
|
72
|
+
*/
|
|
73
|
+
entries?: EntryPreview[];
|
|
74
|
+
}
|
|
75
|
+
export interface EntryPreview {
|
|
76
|
+
/**
|
|
77
|
+
* Preview of the key. Specified for map-like collection entries.
|
|
78
|
+
*/
|
|
79
|
+
key?: ObjectPreview;
|
|
80
|
+
/**
|
|
81
|
+
* Preview of the value.
|
|
82
|
+
*/
|
|
83
|
+
value: ObjectPreview;
|
|
84
|
+
}
|
|
85
|
+
export interface PropertyPreview {
|
|
86
|
+
/**
|
|
87
|
+
* Property name.
|
|
88
|
+
*/
|
|
89
|
+
name: string;
|
|
90
|
+
/**
|
|
91
|
+
* Object type. Accessor means that the property itself is an accessor property. (PropertyPreviewType enum)
|
|
92
|
+
*/
|
|
93
|
+
type: 'object' | 'function' | 'undefined' | 'string' | 'number' | 'boolean' | 'symbol' | 'accessor' | 'bigint';
|
|
94
|
+
/**
|
|
95
|
+
* User-friendly property value string.
|
|
96
|
+
*/
|
|
97
|
+
value?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Nested value preview.
|
|
100
|
+
*/
|
|
101
|
+
valuePreview?: ObjectPreview;
|
|
102
|
+
/**
|
|
103
|
+
* Object subtype hint. Specified for `object` type values only. (PropertyPreviewSubtype enum)
|
|
104
|
+
*/
|
|
105
|
+
subtype?: 'array' | 'null' | 'node' | 'regexp' | 'date' | 'map' | 'set' | 'weakmap' | 'weakset' | 'iterator' | 'generator' | 'error' | 'proxy' | 'promise' | 'typedarray' | 'arraybuffer' | 'dataview' | 'webassemblymemory' | 'wasmvalue';
|
|
106
|
+
}
|
|
107
|
+
type TargetID = string;
|
|
49
108
|
export interface TargetInfo {
|
|
50
109
|
targetId: TargetID;
|
|
51
110
|
type: string;
|
|
@@ -264,7 +323,7 @@ export interface CallFunctionOnResponse {
|
|
|
264
323
|
*/
|
|
265
324
|
exceptionDetails?: ExceptionDetails;
|
|
266
325
|
}
|
|
267
|
-
|
|
326
|
+
type ExecutionContextId = number;
|
|
268
327
|
export interface EvaluateResponse {
|
|
269
328
|
/**
|
|
270
329
|
* Evaluation result.
|
|
@@ -291,8 +350,8 @@ export interface FrameTree {
|
|
|
291
350
|
*/
|
|
292
351
|
childFrames?: FrameTree[];
|
|
293
352
|
}
|
|
294
|
-
|
|
295
|
-
|
|
353
|
+
type FrameId = string;
|
|
354
|
+
type LoaderId = string;
|
|
296
355
|
export interface Frame {
|
|
297
356
|
/**
|
|
298
357
|
* Frame unique identifier.
|
|
@@ -419,7 +478,7 @@ export interface AttachedToTargetEvent {
|
|
|
419
478
|
targetInfo: TargetInfo;
|
|
420
479
|
waitingForDebugger: boolean;
|
|
421
480
|
}
|
|
422
|
-
|
|
481
|
+
type SessionID = string;
|
|
423
482
|
export interface DetachedFromTargetEvent {
|
|
424
483
|
/**
|
|
425
484
|
* Detached session identifier.
|
|
@@ -462,7 +521,7 @@ export interface AddScriptToEvaluateOnNewDocumentResponse {
|
|
|
462
521
|
*/
|
|
463
522
|
identifier: ScriptIdentifier;
|
|
464
523
|
}
|
|
465
|
-
|
|
524
|
+
type ScriptIdentifier = string;
|
|
466
525
|
export interface CreateIsolatedWorldRequest {
|
|
467
526
|
/**
|
|
468
527
|
* Id of the frame in which the isolated world should be created.
|
|
@@ -526,6 +585,10 @@ export interface CaptureScreenshotRequest {
|
|
|
526
585
|
* Capture the screenshot beyond the viewport. Defaults to false.
|
|
527
586
|
*/
|
|
528
587
|
captureBeyondViewport?: boolean;
|
|
588
|
+
/**
|
|
589
|
+
* Optimize image encoding for speed, not for resulting size (defaults to false) EXPERIMENTAL
|
|
590
|
+
*/
|
|
591
|
+
optimizeForSpeed?: boolean;
|
|
529
592
|
}
|
|
530
593
|
export interface CaptureScreenshotResponse {
|
|
531
594
|
/**
|
|
@@ -533,6 +596,84 @@ export interface CaptureScreenshotResponse {
|
|
|
533
596
|
*/
|
|
534
597
|
data: string;
|
|
535
598
|
}
|
|
599
|
+
export interface PrintPDFRequest {
|
|
600
|
+
/**
|
|
601
|
+
* Paper orientation. Defaults to false.
|
|
602
|
+
*/
|
|
603
|
+
landscape?: boolean;
|
|
604
|
+
/**
|
|
605
|
+
* Display header and footer. Defaults to false.
|
|
606
|
+
*/
|
|
607
|
+
displayHeaderFooter?: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Print background graphics. Defaults to false.
|
|
610
|
+
*/
|
|
611
|
+
printBackground?: boolean;
|
|
612
|
+
/**
|
|
613
|
+
* Scale of the webpage rendering. Defaults to 1.
|
|
614
|
+
*/
|
|
615
|
+
scale?: number;
|
|
616
|
+
/**
|
|
617
|
+
* Paper width in inches. Defaults to 8.5 inches.
|
|
618
|
+
*/
|
|
619
|
+
paperWidth?: number;
|
|
620
|
+
/**
|
|
621
|
+
* Paper height in inches. Defaults to 11 inches.
|
|
622
|
+
*/
|
|
623
|
+
paperHeight?: number;
|
|
624
|
+
/**
|
|
625
|
+
* Top margin in inches. Defaults to 1cm (~0.4 inches).
|
|
626
|
+
*/
|
|
627
|
+
marginTop?: number;
|
|
628
|
+
/**
|
|
629
|
+
* Bottom margin in inches. Defaults to 1cm (~0.4 inches).
|
|
630
|
+
*/
|
|
631
|
+
marginBottom?: number;
|
|
632
|
+
/**
|
|
633
|
+
* Left margin in inches. Defaults to 1cm (~0.4 inches).
|
|
634
|
+
*/
|
|
635
|
+
marginLeft?: number;
|
|
636
|
+
/**
|
|
637
|
+
* Right margin in inches. Defaults to 1cm (~0.4 inches).
|
|
638
|
+
*/
|
|
639
|
+
marginRight?: number;
|
|
640
|
+
/**
|
|
641
|
+
* Paper ranges to print, one based, e.g., '1-5, 8, 11-13'.
|
|
642
|
+
* Pages are printed in the document order, not in the order specified,
|
|
643
|
+
* and no more than once. Defaults to empty string,
|
|
644
|
+
* which implies the entire document is printed.
|
|
645
|
+
* The page numbers are quietly capped to actual page count of the document,
|
|
646
|
+
* and ranges beyond the end of the document are ignored.
|
|
647
|
+
* If this results in no pages to print, an error is reported.
|
|
648
|
+
* It is an error to specify a range with start greater than end.
|
|
649
|
+
*/
|
|
650
|
+
pageRanges?: string;
|
|
651
|
+
/**
|
|
652
|
+
* HTML template for the print header.
|
|
653
|
+
* Should be valid HTML markup with following classes used to inject printing values into them:
|
|
654
|
+
* date: formatted print date
|
|
655
|
+
* title: document title
|
|
656
|
+
* url: document location
|
|
657
|
+
* pageNumber: current page number
|
|
658
|
+
* totalPages: total pages in the document
|
|
659
|
+
* For example, <span class=title></span> would generate span containing the title.
|
|
660
|
+
*/
|
|
661
|
+
headerTemplate?: string;
|
|
662
|
+
/**
|
|
663
|
+
* HTML template for the print footer. Should use the same format as the headerTemplate.
|
|
664
|
+
*/
|
|
665
|
+
footerTemplate?: string;
|
|
666
|
+
/**
|
|
667
|
+
* Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
|
|
668
|
+
*/
|
|
669
|
+
preferCSSPageSize?: boolean;
|
|
670
|
+
}
|
|
671
|
+
export interface PrintPDFResponse {
|
|
672
|
+
/**
|
|
673
|
+
* Base64-encoded pdf data. Empty if |returnAsStream| is specified. (Encoded as a base64 string when passed over JSON)
|
|
674
|
+
*/
|
|
675
|
+
data: string;
|
|
676
|
+
}
|
|
536
677
|
export interface RequestWillBeSentEvent {
|
|
537
678
|
/**
|
|
538
679
|
* Request identifier.
|
|
@@ -613,8 +754,8 @@ interface Initiator {
|
|
|
613
754
|
*/
|
|
614
755
|
requestId?: RequestId;
|
|
615
756
|
}
|
|
616
|
-
|
|
617
|
-
|
|
757
|
+
type ResourceType = 'Document' | 'Stylesheet' | 'Image' | 'Media' | 'Font' | 'Script' | 'TextTrack' | 'XHR' | 'Fetch' | 'EventSource' | 'WebSocket' | 'Manifest' | 'SignedExchange' | 'Ping' | 'CSPViolationReport' | 'Preflight' | 'Other';
|
|
758
|
+
type RequestId = string;
|
|
618
759
|
export interface ActivateTargetRequest {
|
|
619
760
|
targetId: TargetID;
|
|
620
761
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -4,20 +4,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getDownloadsCacheDir = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const getDownloadsCacheDir = () => {
|
|
10
10
|
const cwd = process.cwd();
|
|
11
11
|
let dir = cwd;
|
|
12
12
|
for (;;) {
|
|
13
13
|
try {
|
|
14
|
-
if (
|
|
14
|
+
if (node_fs_1.default.statSync(node_path_1.default.join(dir, 'package.json')).isFile()) {
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
17
17
|
// eslint-disable-next-line no-empty
|
|
18
18
|
}
|
|
19
19
|
catch (e) { }
|
|
20
|
-
const parent =
|
|
20
|
+
const parent = node_path_1.default.dirname(dir);
|
|
21
21
|
if (dir === parent) {
|
|
22
22
|
dir = undefined;
|
|
23
23
|
break;
|
|
@@ -25,14 +25,14 @@ const getDownloadsCacheDir = () => {
|
|
|
25
25
|
dir = parent;
|
|
26
26
|
}
|
|
27
27
|
if (!dir) {
|
|
28
|
-
return
|
|
28
|
+
return node_path_1.default.resolve(cwd, '.remotion');
|
|
29
29
|
}
|
|
30
30
|
if (process.versions.pnp === '1') {
|
|
31
|
-
return
|
|
31
|
+
return node_path_1.default.resolve(dir, '.pnp/.remotion');
|
|
32
32
|
}
|
|
33
33
|
if (process.versions.pnp === '3') {
|
|
34
|
-
return
|
|
34
|
+
return node_path_1.default.resolve(dir, '.yarn/.remotion');
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return node_path_1.default.resolve(dir, 'node_modules/.remotion');
|
|
37
37
|
};
|
|
38
38
|
exports.getDownloadsCacheDir = getDownloadsCacheDir;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isTargetClosedErr: (error: Error | undefined) => boolean | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTargetClosedErr = void 0;
|
|
4
|
+
const isTargetClosedErr = (error) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
return (((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('Target closed')) ||
|
|
7
|
+
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.includes('Session closed')));
|
|
8
|
+
};
|
|
9
|
+
exports.isTargetClosedErr = isTargetClosedErr;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export type EventType = string | symbol;
|
|
2
|
+
export type Handler<T = any> = (event?: T) => void;
|
|
3
|
+
type WildcardHandler = (type: EventType, event?: any) => void;
|
|
4
|
+
type EventHandlerList = Array<Handler>;
|
|
5
|
+
type WildCardEventHandlerList = Array<WildcardHandler>;
|
|
6
|
+
type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>;
|
|
7
7
|
export interface Emitter {
|
|
8
8
|
all: EventHandlerMap;
|
|
9
9
|
on<T = any>(type: EventType, handler: Handler<T>): void;
|
|
File without changes
|
package/dist/browser/node.d.ts
CHANGED
|
File without changes
|
package/dist/browser/node.js
CHANGED
|
File without changes
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
type Revisions = Readonly<{
|
|
17
17
|
readonly chromium: string;
|
|
18
18
|
}>;
|
|
19
19
|
export declare const PUPPETEER_REVISIONS: Revisions;
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const shouldLogBrowserMessage: (message: string) => boolean;
|
|
2
|
+
type ParsedBrowserLogMessage = {
|
|
3
|
+
day: number;
|
|
4
|
+
month: number;
|
|
5
|
+
hour: number;
|
|
6
|
+
minute: number;
|
|
7
|
+
seconds: number;
|
|
8
|
+
microseconds: number;
|
|
9
|
+
level: string;
|
|
10
|
+
location: string;
|
|
11
|
+
lineNumber: number;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const parseBrowserLogMessage: (input: string) => ParsedBrowserLogMessage | null;
|
|
15
|
+
export declare const formatChromeMessage: (input: string) => {
|
|
16
|
+
output: string;
|
|
17
|
+
tag: string;
|
|
18
|
+
} | null;
|
|
19
|
+
type ChromeLogLocation = {
|
|
20
|
+
location: string;
|
|
21
|
+
lineNumber: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const parseChromeLogLocation: (message: string) => ChromeLogLocation | null;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseChromeLogLocation = exports.formatChromeMessage = exports.parseBrowserLogMessage = exports.shouldLogBrowserMessage = void 0;
|
|
4
|
+
const shouldLogBrowserMessage = (message) => {
|
|
5
|
+
// Not relevant for the user
|
|
6
|
+
if (message.startsWith('DevTools listening on')) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
// In Ubuntu GitHub Action
|
|
10
|
+
if (message.includes('Falling back to ALSA for audio output')) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
// In Ubuntu GitHub Action
|
|
14
|
+
if (message.includes('Floss manager not present, cannot set Floss enable/disable')) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
// Noisy but harmless warning
|
|
18
|
+
if (message.includes('Failed to send GpuControl.CreateCommandBuffer')) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
};
|
|
23
|
+
exports.shouldLogBrowserMessage = shouldLogBrowserMessage;
|
|
24
|
+
const parseBrowserLogMessage = (input) => {
|
|
25
|
+
const format = /^\[([0-9]{4})\/([0-9]{6})\.([0-9]{6}):([A-Z]+):(.*)\(([0-9]+)\)\](.*)/;
|
|
26
|
+
const match = input.match(format);
|
|
27
|
+
if (!match) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const date = match[1];
|
|
31
|
+
const day = parseInt(date.slice(0, 2), 10);
|
|
32
|
+
const month = parseInt(date.slice(2, 4), 10);
|
|
33
|
+
const time = match[2];
|
|
34
|
+
const hour = parseInt(time.slice(0, 2), 10);
|
|
35
|
+
const minute = parseInt(time.slice(2, 4), 10);
|
|
36
|
+
const seconds = parseInt(time.slice(4, 6), 10);
|
|
37
|
+
const microseconds = parseInt(match[3], 10);
|
|
38
|
+
const level = match[4];
|
|
39
|
+
const location = match[5];
|
|
40
|
+
const lineNumber = parseInt(match[6], 10);
|
|
41
|
+
const message = match[7].trim();
|
|
42
|
+
return {
|
|
43
|
+
day,
|
|
44
|
+
month,
|
|
45
|
+
hour,
|
|
46
|
+
minute,
|
|
47
|
+
seconds,
|
|
48
|
+
microseconds,
|
|
49
|
+
level,
|
|
50
|
+
location,
|
|
51
|
+
lineNumber,
|
|
52
|
+
message,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
exports.parseBrowserLogMessage = parseBrowserLogMessage;
|
|
56
|
+
const formatChromeMessage = (input) => {
|
|
57
|
+
const parsed = (0, exports.parseBrowserLogMessage)(input);
|
|
58
|
+
if (!parsed) {
|
|
59
|
+
return { output: input, tag: 'chrome' };
|
|
60
|
+
}
|
|
61
|
+
const { location, lineNumber, message } = parsed;
|
|
62
|
+
// Don't print console.log's, these are handled through the WebSocket
|
|
63
|
+
if (location === 'CONSOLE') {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return { output: `${location}:${lineNumber}: ${message}`, tag: 'chrome' };
|
|
67
|
+
};
|
|
68
|
+
exports.formatChromeMessage = formatChromeMessage;
|
|
69
|
+
const parseChromeLogLocation = (message) => {
|
|
70
|
+
const regex = /(.*), source: (.*) \(([0-9]+)\)/;
|
|
71
|
+
const match = message.match(regex);
|
|
72
|
+
if (!match) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
lineNumber: parseInt(match[3], 10),
|
|
77
|
+
location: match[2],
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
exports.parseChromeLogLocation = parseChromeLogLocation;
|
package/dist/browser/util.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
/// <reference types="node" />
|
|
17
|
-
import type {
|
|
17
|
+
import type { HeadlessBrowser } from './Browser';
|
|
18
18
|
import type { CDPSession } from './Connection';
|
|
19
19
|
import type { DevtoolsRemoteObject, ExceptionDetails } from './devtools-types';
|
|
20
20
|
import type { CommonEventEmitter } from './EventEmitter';
|
|
@@ -37,7 +37,7 @@ export declare function evaluationString(fun: Function | string, ...args: unknow
|
|
|
37
37
|
export declare function pageBindingDeliverResultString(name: string, seq: number, result: unknown): string;
|
|
38
38
|
export declare function pageBindingDeliverErrorString(name: string, seq: number, message: string, stack?: string): string;
|
|
39
39
|
export declare function pageBindingDeliverErrorValueString(name: string, seq: number, value: unknown): string;
|
|
40
|
-
export declare function waitWithTimeout<T>(promise: Promise<T>, taskName: string, timeout: number, browser:
|
|
40
|
+
export declare function waitWithTimeout<T>(promise: Promise<T>, taskName: string, timeout: number, browser: HeadlessBrowser): Promise<T>;
|
|
41
41
|
interface ErrorLike extends Error {
|
|
42
42
|
name: string;
|
|
43
43
|
message: string;
|
package/dist/browser/util.js
CHANGED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type BrowserExecutable = string | null;
|
|
File without changes
|
package/dist/browser-log.d.ts
CHANGED
package/dist/browser-log.js
CHANGED
|
File without changes
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Browser = 'chrome' | 'firefox';
|
|
2
2
|
export declare const DEFAULT_BROWSER: Browser;
|
package/dist/browser.js
CHANGED
|
File without changes
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { MediaAsset } from './assets/types';
|
|
2
|
+
import type { FilterWithoutPaddingApplied } from './stringify-ffmpeg-filter';
|
|
2
3
|
export declare const calculateFfmpegFilter: ({ asset, fps, durationInFrames, channels, assetDuration, }: {
|
|
3
4
|
asset: MediaAsset;
|
|
4
5
|
fps: number;
|
|
5
6
|
durationInFrames: number;
|
|
6
7
|
channels: number;
|
|
7
8
|
assetDuration: number | null;
|
|
8
|
-
}) =>
|
|
9
|
+
}) => FilterWithoutPaddingApplied | null;
|
|
@@ -19,6 +19,7 @@ const calculateFfmpegFilter = ({ asset, fps, durationInFrames, channels, assetDu
|
|
|
19
19
|
playbackRate: asset.playbackRate,
|
|
20
20
|
durationInFrames,
|
|
21
21
|
assetDuration,
|
|
22
|
+
allowAmplificationDuringRender: asset.allowAmplificationDuringRender,
|
|
22
23
|
});
|
|
23
24
|
};
|
|
24
25
|
exports.calculateFfmpegFilter = calculateFfmpegFilter;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import execa from 'execa';
|
|
2
|
+
export declare const dynamicLibraryPathOptions: () => {
|
|
3
|
+
env: {
|
|
4
|
+
DYLD_LIBRARY_PATH: string;
|
|
5
|
+
RUST_BACKTRACE: string;
|
|
6
|
+
} | {
|
|
7
|
+
PATH: string;
|
|
8
|
+
RUST_BACKTRACE: string;
|
|
9
|
+
} | {
|
|
10
|
+
LD_LIBRARY_PATH: string;
|
|
11
|
+
RUST_BACKTRACE: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const callFf: (bin: 'ffmpeg' | 'ffprobe', args: (string | null)[], options?: execa.Options<string>) => execa.ExecaChildProcess<string>;
|