@storyshelf/core 0.7.0 → 0.8.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/dist/adapter/capture-queue.d.mts +0 -2
- package/dist/adapter/capture-runner.d.mts +9 -4
- package/dist/adapter/capture-runner.mjs +6 -2
- package/dist/adapter/database.d.mts +63 -3
- package/dist/adapter/database.mjs +4 -3
- package/dist/adapter/database.mjs.map +1 -1
- package/dist/adapter/design.d.mts +0 -2
- package/dist/adapter/design.mjs +1 -2
- package/dist/adapter/email-sender.d.mts +0 -2
- package/dist/adapter/metadata.d.mts +0 -2
- package/dist/adapter/oauth.d.mts +0 -2
- package/dist/adapter/setup.d.mts +0 -2
- package/dist/adapter/setup.mjs +1 -2
- package/dist/adapter/storage.d.mts +1 -3
- package/dist/adapter/webhook-events.d.mts +0 -2
- package/dist/adapter/webhook-events.mjs +12 -13
- package/dist/adapter/webhook-events.mjs.map +1 -1
- package/dist/adapters/capture-target-offers.d.mts +0 -2
- package/dist/adapters/capture-target-offers.mjs +1 -2
- package/dist/adapters/capture-target.d.mts +0 -2
- package/dist/adapters/capture-target.mjs +1 -2
- package/dist/adapters/notifier/build-comment.d.mts +0 -2
- package/dist/adapters/notifier/build-comment.mjs +1 -2
- package/dist/adapters/notifier/build-state.d.mts +0 -2
- package/dist/adapters/notifier/build-state.mjs +1 -2
- package/dist/adapters/notifier/events.d.mts +0 -2
- package/dist/adapters/notifier/events.mjs +1 -2
- package/dist/adapters/notifier/format.d.mts +0 -2
- package/dist/adapters/notifier/format.mjs +1 -2
- package/dist/adapters/notifier/provider.d.mts +0 -2
- package/dist/adapters/notifier/provider.mjs +1 -2
- package/dist/adapters/notifier/state.d.mts +0 -2
- package/dist/adapters/notifier/state.mjs +1 -2
- package/dist/adapters/notifier/types.d.mts +0 -2
- package/dist/adapters/remote-browser.d.mts +112 -31
- package/dist/adapters/remote-browser.mjs +132 -34
- package/dist/adapters/remote-browser.mjs.map +1 -1
- package/dist/adapters/remote-lease-attempt.mjs +39 -0
- package/dist/adapters/remote-lease-attempt.mjs.map +1 -0
- package/dist/adapters/remote-lease-error.d.mts +25 -0
- package/dist/adapters/remote-lease-error.mjs +54 -0
- package/dist/adapters/remote-lease-error.mjs.map +1 -0
- package/dist/adapters/remote-lease-held.d.mts +15 -0
- package/dist/adapters/remote-lease-held.mjs +86 -0
- package/dist/adapters/remote-lease-held.mjs.map +1 -0
- package/dist/adapters/remote-lease-shutdown.d.mts +12 -0
- package/dist/adapters/remote-lease-shutdown.mjs +32 -0
- package/dist/adapters/remote-lease-shutdown.mjs.map +1 -0
- package/dist/adapters/remote-lease.d.mts +39 -0
- package/dist/adapters/remote-lease.mjs +175 -0
- package/dist/adapters/remote-lease.mjs.map +1 -0
- package/dist/adapters/remote-limiter.mjs +121 -0
- package/dist/adapters/remote-limiter.mjs.map +1 -0
- package/dist/adapters/remote-pool.d.mts +56 -0
- package/dist/adapters/remote-pool.mjs +195 -0
- package/dist/adapters/remote-pool.mjs.map +1 -0
- package/dist/adapters/render-runs.d.mts +0 -2
- package/dist/adapters/render-runs.mjs +1 -2
- package/dist/adapters/setup-runner.d.mts +0 -2
- package/dist/adapters/setup-runner.mjs +1 -2
- package/dist/adapters/sources.d.mts +0 -2
- package/dist/adapters/sources.mjs +1 -2
- package/dist/adapters/validate.d.mts +0 -2
- package/dist/adapters/validate.mjs +2 -2
- package/dist/adapters/validate.mjs.map +1 -1
- package/dist/ai.d.mts +0 -2
- package/dist/ai.mjs +1 -2
- package/dist/auth.d.mts +0 -2
- package/dist/auth.mjs +1 -2
- package/dist/brand-packs.d.mts +0 -2
- package/dist/brand-packs.mjs +0 -1
- package/dist/capture/a11y/axe-source.d.mts +0 -2
- package/dist/capture/a11y/axe-source.mjs +1 -2
- package/dist/capture/a11y/in-page.d.mts +1 -3
- package/dist/capture/a11y/in-page.mjs +3 -4
- package/dist/capture/a11y/in-page.mjs.map +1 -1
- package/dist/capture/a11y/map.d.mts +0 -2
- package/dist/capture/a11y/map.mjs +1 -2
- package/dist/capture/a11y/options.d.mts +0 -2
- package/dist/capture/a11y/options.mjs +1 -2
- package/dist/capture/adapter.d.mts +5 -2
- package/dist/capture/adapter.mjs +1 -2
- package/dist/capture/adapter.mjs.map +1 -1
- package/dist/capture/affected.d.mts +0 -2
- package/dist/capture/affected.mjs +1 -2
- package/dist/capture/attempt-logger.mjs +1 -2
- package/dist/capture/browsers.d.mts +0 -2
- package/dist/capture/browsers.mjs +1 -2
- package/dist/capture/build-state/deliver.d.mts +0 -2
- package/dist/capture/build-state/deliver.mjs +1 -2
- package/dist/capture/build-state/notify-job.d.mts +0 -2
- package/dist/capture/build-state/notify-job.mjs +1 -2
- package/dist/capture/build-state/publisher.d.mts +0 -2
- package/dist/capture/build-state/publisher.mjs +1 -2
- package/dist/capture/build-state/resume.d.mts +0 -2
- package/dist/capture/build-state/resume.mjs +1 -2
- package/dist/capture/build-state/types.d.mts +1 -3
- package/dist/capture/catalog/catalogue.d.mts +0 -2
- package/dist/capture/catalog/catalogue.mjs +1 -2
- package/dist/capture/catalog/components.d.mts +0 -2
- package/dist/capture/catalog/components.mjs +1 -2
- package/dist/capture/catalog/history.d.mts +0 -2
- package/dist/capture/catalog/history.mjs +1 -2
- package/dist/capture/catalog/hook.d.mts +0 -2
- package/dist/capture/catalog/hook.mjs +1 -2
- package/dist/capture/catalog/index.d.mts +2 -2
- package/dist/capture/catalog/load.d.mts +0 -2
- package/dist/capture/catalog/load.mjs +1 -2
- package/dist/capture/catalog/parse.d.mts +0 -2
- package/dist/capture/catalog/parse.mjs +1 -2
- package/dist/capture/catalog/read.d.mts +6 -3
- package/dist/capture/catalog/read.mjs +14 -8
- package/dist/capture/catalog/read.mjs.map +1 -1
- package/dist/capture/catalog/types.d.mts +0 -2
- package/dist/capture/comparison-reference.d.mts +27 -0
- package/dist/capture/comparison-reference.mjs +75 -0
- package/dist/capture/comparison-reference.mjs.map +1 -0
- package/dist/capture/consumer/capture-handler.d.mts +1 -3
- package/dist/capture/consumer/capture-handler.mjs +1 -2
- package/dist/capture/consumer/idle.d.mts +0 -2
- package/dist/capture/consumer/idle.mjs +1 -2
- package/dist/capture/consumer/index.d.mts +0 -2
- package/dist/capture/consumer/index.mjs +1 -2
- package/dist/capture/consumer/loop.mjs +1 -2
- package/dist/capture/consumer/metrics.d.mts +0 -2
- package/dist/capture/consumer/metrics.mjs +1 -2
- package/dist/capture/consumer/retry.d.mts +0 -2
- package/dist/capture/consumer/retry.mjs +1 -2
- package/dist/capture/consumer/run-job.mjs +1 -2
- package/dist/capture/consumer/startup.mjs +1 -2
- package/dist/capture/consumer/types.d.mts +0 -2
- package/dist/capture/crash-failure.d.mts +0 -2
- package/dist/capture/crash-failure.mjs +1 -2
- package/dist/capture/db-queue/cadence.d.mts +0 -2
- package/dist/capture/db-queue/cadence.mjs +1 -2
- package/dist/capture/db-queue/claim.d.mts +0 -2
- package/dist/capture/db-queue/claim.mjs +20 -4
- package/dist/capture/db-queue/claim.mjs.map +1 -1
- package/dist/capture/db-queue/clock.mjs +1 -2
- package/dist/capture/db-queue/codec.mjs +1 -2
- package/dist/capture/db-queue/index.d.mts +0 -2
- package/dist/capture/db-queue/index.mjs +3 -3
- package/dist/capture/db-queue/index.mjs.map +1 -1
- package/dist/capture/db-queue/keeper.d.mts +0 -2
- package/dist/capture/db-queue/keeper.mjs +1 -2
- package/dist/capture/db-queue/lease.mjs +1 -2
- package/dist/capture/db-queue/lifecycle.mjs +1 -2
- package/dist/capture/db-queue/operations.mjs +1 -2
- package/dist/capture/db-queue/poll-loop.d.mts +0 -2
- package/dist/capture/db-queue/poll-loop.mjs +1 -2
- package/dist/capture/db-queue/poll.d.mts +0 -2
- package/dist/capture/db-queue/poll.mjs +1 -2
- package/dist/capture/db-queue/timers.d.mts +0 -2
- package/dist/capture/db-queue/timers.mjs +1 -2
- package/dist/capture/db-queue/types.d.mts +0 -2
- package/dist/capture/db-queue/types.mjs +1 -2
- package/dist/capture/db-queue/types.mjs.map +1 -1
- package/dist/capture/db-queue/wake.mjs +1 -2
- package/dist/capture/design.mjs +1 -2
- package/dist/capture/diff-record.mjs +1 -2
- package/dist/capture/dispatch.d.mts +1 -3
- package/dist/capture/dispatch.mjs +17 -5
- package/dist/capture/dispatch.mjs.map +1 -1
- package/dist/capture/enrich.mjs +1 -2
- package/dist/capture/failure-sets.mjs +1 -2
- package/dist/capture/fingerprint.d.mts +0 -2
- package/dist/capture/fingerprint.mjs +1 -2
- package/dist/capture/forked/channel.d.mts +0 -2
- package/dist/capture/forked/child.d.mts +0 -2
- package/dist/capture/forked/child.mjs +1 -2
- package/dist/capture/forked/crash-tracker.mjs +1 -2
- package/dist/capture/forked/decision.d.mts +0 -2
- package/dist/capture/forked/decision.mjs +1 -2
- package/dist/capture/forked/exit.mjs +1 -2
- package/dist/capture/forked/fork.d.mts +0 -2
- package/dist/capture/forked/fork.mjs +1 -2
- package/dist/capture/forked/forked-capture.d.mts +0 -2
- package/dist/capture/forked/forked-capture.mjs +1 -2
- package/dist/capture/forked/lease-book.mjs +1 -2
- package/dist/capture/forked/protocol.d.mts +0 -2
- package/dist/capture/forked/protocol.mjs +1 -2
- package/dist/capture/forked/runs.mjs +1 -2
- package/dist/capture/guards.mjs +1 -2
- package/dist/capture/ignore-regions.d.mts +36 -0
- package/dist/capture/ignore-regions.mjs +65 -0
- package/dist/capture/ignore-regions.mjs.map +1 -0
- package/dist/capture/isolate.mjs +1 -2
- package/dist/capture/job-lease.d.mts +0 -2
- package/dist/capture/job-lease.mjs +1 -2
- package/dist/capture/matrix.mjs +4 -4
- package/dist/capture/matrix.mjs.map +1 -1
- package/dist/capture/modes.d.mts +0 -2
- package/dist/capture/modes.mjs +2 -3
- package/dist/capture/modes.mjs.map +1 -1
- package/dist/capture/orchestrator.d.mts +0 -2
- package/dist/capture/orchestrator.mjs +2 -3
- package/dist/capture/pipeline.d.mts +0 -2
- package/dist/capture/pipeline.mjs +37 -6
- package/dist/capture/pipeline.mjs.map +1 -1
- package/dist/capture/progress.d.mts +0 -2
- package/dist/capture/progress.mjs +1 -2
- package/dist/capture/publish/accept.d.mts +0 -2
- package/dist/capture/publish/accept.mjs +1 -2
- package/dist/capture/publish/complete.d.mts +1 -3
- package/dist/capture/publish/complete.mjs +1 -2
- package/dist/capture/publish/extract.d.mts +0 -2
- package/dist/capture/publish/extract.mjs +6 -5
- package/dist/capture/publish/extract.mjs.map +1 -1
- package/dist/capture/publish/handler.d.mts +1 -3
- package/dist/capture/publish/handler.mjs +1 -2
- package/dist/capture/publish/index.d.mts +2 -1
- package/dist/capture/publish/invalid-zip.d.mts +8 -0
- package/dist/capture/publish/invalid-zip.mjs +11 -0
- package/dist/capture/publish/invalid-zip.mjs.map +1 -0
- package/dist/capture/publish/limits.d.mts +0 -2
- package/dist/capture/publish/limits.mjs +1 -2
- package/dist/capture/publish/published.d.mts +0 -2
- package/dist/capture/publish/published.mjs +1 -2
- package/dist/capture/publish/run.d.mts +1 -3
- package/dist/capture/publish/run.mjs +1 -2
- package/dist/capture/rediff.d.mts +1 -3
- package/dist/capture/rediff.mjs +19 -6
- package/dist/capture/rediff.mjs.map +1 -1
- package/dist/capture/render.mjs +1 -2
- package/dist/capture/render.mjs.map +1 -1
- package/dist/capture/scratch.d.mts +0 -2
- package/dist/capture/scratch.mjs +2 -4
- package/dist/capture/scratch.mjs.map +1 -1
- package/dist/capture/shard-plan.mjs +1 -2
- package/dist/capture/shards/context.mjs +3 -3
- package/dist/capture/shards/context.mjs.map +1 -1
- package/dist/capture/shards/execute.mjs +4 -3
- package/dist/capture/shards/execute.mjs.map +1 -1
- package/dist/capture/shards/fan-out.mjs +1 -2
- package/dist/capture/shards/history.mjs +1 -2
- package/dist/capture/shards/reduce.mjs +1 -2
- package/dist/capture/sizing.d.mts +0 -2
- package/dist/capture/sizing.mjs +1 -2
- package/dist/capture/skip-checks.mjs +1 -2
- package/dist/capture/statics.d.mts +0 -2
- package/dist/capture/statics.mjs +2 -4
- package/dist/capture/statics.mjs.map +1 -1
- package/dist/capture/storybook-urls.d.mts +0 -2
- package/dist/capture/storybook-urls.mjs +3 -3
- package/dist/capture/storybook-urls.mjs.map +1 -1
- package/dist/capture/storybook.d.mts +0 -2
- package/dist/capture/storybook.mjs +8 -4
- package/dist/capture/storybook.mjs.map +1 -1
- package/dist/capture/target.mjs +1 -2
- package/dist/capture/targets.d.mts +0 -2
- package/dist/capture/targets.mjs +1 -2
- package/dist/capture/tests.d.mts +0 -2
- package/dist/capture/tests.mjs +13 -3
- package/dist/capture/tests.mjs.map +1 -1
- package/dist/capture/token-chunks.mjs +24 -7
- package/dist/capture/token-chunks.mjs.map +1 -1
- package/dist/capture.d.mts +5 -2
- package/dist/capture.mjs +5 -2
- package/dist/config.d.mts +16 -3
- package/dist/config.mjs +6 -3
- package/dist/config.mjs.map +1 -1
- package/dist/diff.d.mts +0 -2
- package/dist/diff.mjs +1 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/insights/budget.d.mts +0 -2
- package/dist/insights/budget.mjs +1 -2
- package/dist/insights/envelope.d.mts +0 -2
- package/dist/insights/envelope.mjs +1 -2
- package/dist/insights/evidence-health.d.mts +0 -2
- package/dist/insights/evidence-health.mjs +1 -2
- package/dist/insights/evidence.d.mts +0 -2
- package/dist/insights/evidence.mjs +1 -2
- package/dist/insights/hash.d.mts +0 -2
- package/dist/insights/hash.mjs +1 -2
- package/dist/insights/limits.d.mts +0 -2
- package/dist/insights/limits.mjs +1 -2
- package/dist/insights/prompts/v1.d.mts +0 -2
- package/dist/insights/prompts/v1.mjs +1 -2
- package/dist/insights/redact.d.mts +0 -2
- package/dist/insights/redact.mjs +1 -2
- package/dist/insights/text.mjs +1 -2
- package/dist/logger.d.mts +0 -2
- package/dist/logger.mjs +1 -2
- package/dist/models/ai-budget-alert.d.mts +0 -2
- package/dist/models/ai-budget-alert.mjs +1 -2
- package/dist/models/ai-usage.d.mts +0 -2
- package/dist/models/ai-usage.mjs +1 -2
- package/dist/models/baseline-approval.d.mts +18 -0
- package/dist/models/baseline-approval.mjs +41 -0
- package/dist/models/baseline-approval.mjs.map +1 -0
- package/dist/models/baseline-archive.d.mts +0 -2
- package/dist/models/baseline-archive.mjs +1 -2
- package/dist/models/baseline-atomic.mjs +66 -0
- package/dist/models/baseline-atomic.mjs.map +1 -0
- package/dist/models/baseline-conflict.d.mts +6 -0
- package/dist/models/baseline-conflict.mjs +9 -0
- package/dist/models/baseline-conflict.mjs.map +1 -0
- package/dist/models/baseline-export.d.mts +0 -2
- package/dist/models/baseline-export.mjs +1 -2
- package/dist/models/baseline-import.mjs +1 -2
- package/dist/models/baseline-origin.d.mts +16 -0
- package/dist/models/baseline-origin.mjs +35 -0
- package/dist/models/baseline-origin.mjs.map +1 -0
- package/dist/models/baseline-status.d.mts +0 -2
- package/dist/models/baseline-status.mjs +1 -2
- package/dist/models/baseline-transfer.d.mts +1 -2
- package/dist/models/baseline-transfer.mjs +30 -2
- package/dist/models/baseline-transfer.mjs.map +1 -1
- package/dist/models/baseline.d.mts +5 -2
- package/dist/models/baseline.mjs +91 -12
- package/dist/models/baseline.mjs.map +1 -1
- package/dist/models/build-component.d.mts +0 -2
- package/dist/models/build-component.mjs +1 -2
- package/dist/models/build-review-status.d.mts +0 -2
- package/dist/models/build-review-status.mjs +1 -2
- package/dist/models/build-review.d.mts +0 -2
- package/dist/models/build-review.mjs +1 -2
- package/dist/models/build.d.mts +1 -3
- package/dist/models/build.mjs +14 -15
- package/dist/models/build.mjs.map +1 -1
- package/dist/models/capture-attempt.d.mts +0 -2
- package/dist/models/capture-attempt.mjs +1 -2
- package/dist/models/capture-job.d.mts +0 -2
- package/dist/models/capture-job.mjs +1 -2
- package/dist/models/capture-log.d.mts +0 -2
- package/dist/models/capture-log.mjs +1 -2
- package/dist/models/capture-shard.d.mts +0 -2
- package/dist/models/capture-shard.mjs +1 -2
- package/dist/models/changeset.d.mts +0 -2
- package/dist/models/changeset.mjs +1 -2
- package/dist/models/columns.mjs +1 -2
- package/dist/models/comment.d.mts +0 -2
- package/dist/models/comment.mjs +1 -2
- package/dist/models/component.d.mts +0 -2
- package/dist/models/component.mjs +1 -2
- package/dist/models/connections.d.mts +0 -2
- package/dist/models/connections.mjs +1 -2
- package/dist/models/content-ref.d.mts +0 -2
- package/dist/models/content-ref.mjs +1 -2
- package/dist/models/credentials.d.mts +0 -2
- package/dist/models/credentials.mjs +1 -2
- package/dist/models/design-credentials.d.mts +0 -2
- package/dist/models/design-credentials.mjs +1 -2
- package/dist/models/design-health.d.mts +0 -2
- package/dist/models/design-health.mjs +1 -2
- package/dist/models/design-nodes.d.mts +2 -4
- package/dist/models/design-nodes.mjs +1 -2
- package/dist/models/design-renders.mjs +1 -2
- package/dist/models/design-resolve.d.mts +0 -2
- package/dist/models/design-resolve.mjs +1 -2
- package/dist/models/design.d.mts +0 -2
- package/dist/models/design.mjs +1 -2
- package/dist/models/inherited-ratio.d.mts +0 -2
- package/dist/models/inherited-ratio.mjs +1 -2
- package/dist/models/insight.d.mts +0 -2
- package/dist/models/insight.mjs +1 -2
- package/dist/models/label.d.mts +0 -2
- package/dist/models/label.mjs +1 -2
- package/dist/models/member.d.mts +0 -2
- package/dist/models/member.mjs +1 -2
- package/dist/models/notification-channel.d.mts +0 -2
- package/dist/models/notification-channel.mjs +1 -2
- package/dist/models/notification-subscription.d.mts +0 -2
- package/dist/models/notification-subscription.mjs +1 -2
- package/dist/models/project-group-mapping.d.mts +0 -2
- package/dist/models/project-group-mapping.mjs +1 -2
- package/dist/models/project.d.mts +0 -2
- package/dist/models/project.mjs +1 -2
- package/dist/models/public-origin.d.mts +0 -2
- package/dist/models/public-origin.mjs +1 -2
- package/dist/models/review-switch-off.d.mts +0 -2
- package/dist/models/review-switch-off.mjs +1 -2
- package/dist/models/site-settings.d.mts +0 -2
- package/dist/models/site-settings.mjs +1 -2
- package/dist/models/snapshot.d.mts +3 -2
- package/dist/models/snapshot.mjs +4 -2
- package/dist/models/snapshot.mjs.map +1 -1
- package/dist/models/token.d.mts +0 -2
- package/dist/models/token.mjs +1 -2
- package/dist/models/usage.d.mts +0 -2
- package/dist/models/usage.mjs +1 -2
- package/dist/models/user.d.mts +0 -2
- package/dist/models/user.mjs +1 -2
- package/dist/models/webhook.d.mts +0 -2
- package/dist/models/webhook.mjs +1 -2
- package/dist/models.d.mts +5 -2
- package/dist/models.mjs +5 -2
- package/dist/options.d.mts +0 -2
- package/dist/options.mjs +2 -4
- package/dist/options.mjs.map +1 -1
- package/dist/paths.d.mts +3 -3
- package/dist/paths.mjs +7 -3
- package/dist/paths.mjs.map +1 -1
- package/dist/retention/ai.d.mts +1 -3
- package/dist/retention/ai.mjs +0 -1
- package/dist/retention/pending.mjs +1 -2
- package/dist/retention/published-gzip-sweep.mjs +28 -0
- package/dist/retention/published-gzip-sweep.mjs.map +1 -0
- package/dist/retention/screenshot-sweep.d.mts +0 -2
- package/dist/retention/screenshot-sweep.mjs +1 -2
- package/dist/retention.d.mts +0 -2
- package/dist/retention.mjs +5 -2
- package/dist/retention.mjs.map +1 -1
- package/dist/schema/baseline.d.mts +2 -2
- package/dist/schema/build-component.d.mts +0 -2
- package/dist/schema/build-review.d.mts +0 -2
- package/dist/schema/build.d.mts +0 -2
- package/dist/schema/capture-attempt.d.mts +0 -2
- package/dist/schema/capture-job.d.mts +0 -2
- package/dist/schema/capture-shard.d.mts +0 -2
- package/dist/schema/comment.d.mts +0 -2
- package/dist/schema/connection.d.mts +0 -2
- package/dist/schema/content-ref.d.mts +0 -2
- package/dist/schema/design.d.mts +0 -2
- package/dist/schema/insight.d.mts +0 -2
- package/dist/schema/label.d.mts +0 -2
- package/dist/schema/member.d.mts +0 -2
- package/dist/schema/notification.d.mts +0 -2
- package/dist/schema/project-group-mapping.d.mts +0 -2
- package/dist/schema/project.d.mts +0 -2
- package/dist/schema/site-setting.d.mts +0 -2
- package/dist/schema/snapshot.d.mts +5 -2
- package/dist/schema/token.d.mts +0 -2
- package/dist/schema/usage.d.mts +0 -2
- package/dist/schema/user.d.mts +0 -2
- package/dist/schema/webhook.d.mts +0 -2
- package/dist/schema.d.mts +4 -6
- package/dist/serverless.d.mts +0 -2
- package/dist/serverless.mjs +1 -2
- package/dist/test-helpers/build-reference-contract.d.mts +14 -0
- package/dist/test-helpers/build-reference-contract.mjs +66 -0
- package/dist/test-helpers/build-reference-contract.mjs.map +1 -0
- package/dist/test-helpers/create-project.d.mts +0 -2
- package/dist/test-helpers/create-project.mjs +1 -2
- package/dist/test-helpers/database-contract.d.mts +0 -2
- package/dist/test-helpers/database-contract.mjs +37 -2
- package/dist/test-helpers/database-contract.mjs.map +1 -1
- package/dist/test-helpers/deferred.d.mts +0 -2
- package/dist/test-helpers/deferred.mjs +1 -2
- package/dist/test-helpers/design-contract.d.mts +0 -2
- package/dist/test-helpers/design-contract.mjs +1 -2
- package/dist/test-helpers/fake-adapters.d.mts +0 -2
- package/dist/test-helpers/fake-adapters.mjs +1 -2
- package/dist/test-helpers/fake-database.d.mts +0 -2
- package/dist/test-helpers/fake-database.mjs +7 -2
- package/dist/test-helpers/fake-database.mjs.map +1 -1
- package/dist/test-helpers/fake-design.d.mts +0 -2
- package/dist/test-helpers/fake-design.mjs +1 -2
- package/dist/test-helpers/fake-notifier.d.mts +0 -2
- package/dist/test-helpers/fake-notifier.mjs +1 -2
- package/dist/test-helpers/fake-storage.d.mts +0 -2
- package/dist/test-helpers/fake-storage.mjs +1 -2
- package/dist/test-helpers/fake-tables.mjs +5 -2
- package/dist/test-helpers/fake-tables.mjs.map +1 -1
- package/dist/test-helpers/manual-clock.d.mts +0 -2
- package/dist/test-helpers/manual-clock.mjs +1 -2
- package/dist/test-helpers/notifier-contract.d.mts +0 -2
- package/dist/test-helpers/notifier-contract.mjs +1 -2
- package/dist/test-helpers/queue-contract.d.mts +0 -2
- package/dist/test-helpers/queue-contract.mjs +1 -2
- package/dist/test-helpers/queue-multi-instance.d.mts +0 -2
- package/dist/test-helpers/queue-multi-instance.mjs +1 -2
- package/dist/test-helpers/runner-contract.d.mts +0 -2
- package/dist/test-helpers/runner-contract.mjs +1 -2
- package/dist/test-helpers/sql-chunks.mjs +2 -2
- package/dist/test-helpers/sql-chunks.mjs.map +1 -1
- package/dist/test-helpers/storage-contract.d.mts +0 -2
- package/dist/test-helpers/storage-contract.mjs +1 -2
- package/dist/test-helpers.d.mts +2 -1
- package/dist/test-helpers.mjs +2 -1
- package/dist/tracing.mjs +36 -6
- package/dist/tracing.mjs.map +1 -1
- package/dist/types.d.mts +0 -2
- package/dist/types.mjs +1 -2
- package/dist/urls.d.mts +0 -2
- package/dist/urls.mjs +1 -2
- package/dist/utils/adaptive-concurrency.d.mts +0 -2
- package/dist/utils/adaptive-concurrency.mjs +1 -2
- package/dist/utils/connect-retry.d.mts +2 -2
- package/dist/utils/connect-retry.mjs +2 -3
- package/dist/utils/connect-retry.mjs.map +1 -1
- package/dist/utils/encrypt.d.mts +0 -2
- package/dist/utils/encrypt.mjs +1 -2
- package/dist/utils/environment.d.mts +0 -2
- package/dist/utils/environment.mjs +1 -2
- package/dist/utils/hash.d.mts +0 -2
- package/dist/utils/hash.mjs +1 -2
- package/dist/utils/http.d.mts +13 -3
- package/dist/utils/http.mjs +79 -17
- package/dist/utils/http.mjs.map +1 -1
- package/dist/utils/map-adaptive.d.mts +0 -2
- package/dist/utils/map-adaptive.mjs +1 -2
- package/dist/utils/map-limit.d.mts +0 -2
- package/dist/utils/map-limit.mjs +1 -2
- package/dist/utils/mime.d.mts +0 -2
- package/dist/utils/mime.mjs +1 -2
- package/dist/utils/page-limiter.d.mts +0 -2
- package/dist/utils/page-limiter.mjs +1 -2
- package/dist/utils/path-security.d.mts +0 -2
- package/dist/utils/path-security.mjs +2 -4
- package/dist/utils/path-security.mjs.map +1 -1
- package/dist/utils/public-origin.d.mts +0 -2
- package/dist/utils/public-origin.mjs +1 -2
- package/dist/utils/redact.d.mts +0 -2
- package/dist/utils/redact.mjs +1 -2
- package/dist/utils/remote-environment.d.mts +40 -3
- package/dist/utils/remote-environment.mjs +52 -3
- package/dist/utils/remote-environment.mjs.map +1 -1
- package/dist/utils/resources.d.mts +0 -2
- package/dist/utils/resources.mjs +1 -2
- package/dist/utils/screenshot-store.d.mts +0 -2
- package/dist/utils/screenshot-store.mjs +1 -2
- package/dist/utils/session-gate.d.mts +7 -6
- package/dist/utils/session-gate.mjs +28 -12
- package/dist/utils/session-gate.mjs.map +1 -1
- package/dist/utils/storybook-token.d.mts +11 -3
- package/dist/utils/storybook-token.mjs +10 -9
- package/dist/utils/storybook-token.mjs.map +1 -1
- package/dist/utils/storybook-url.d.mts +0 -2
- package/dist/utils/storybook-url.mjs +1 -2
- package/dist/utils/timing.d.mts +0 -2
- package/dist/utils/timing.mjs +1 -2
- package/dist/utils/ulid.d.mts +0 -2
- package/dist/utils/ulid.mjs +1 -2
- package/dist/utils/zip-read.mjs +1 -2
- package/dist/utils/zip-write.d.mts +0 -2
- package/dist/utils/zip-write.mjs +1 -2
- package/dist/utils.d.mts +5 -5
- package/dist/utils.mjs +5 -5
- package/package.json +6 -6
|
@@ -4,7 +4,7 @@ import.meta.url;
|
|
|
4
4
|
import { sanitizeErrorText } from "../../utils/redact.mjs";
|
|
5
5
|
import { NotificationChannelModel } from "../../models/notification-channel.mjs";
|
|
6
6
|
import { loadBuild, stateTargets, writeTo } from "./deliver.mjs";
|
|
7
|
-
|
|
7
|
+
// src/capture/build-state/publisher.ts
|
|
8
8
|
/**
|
|
9
9
|
* The one entry point for "this build changed, show it" (ADR 0014, decisions 5 and 7). Every build
|
|
10
10
|
* transition and the end of publishing call `request`; it hands each git channel of the project a
|
|
@@ -101,7 +101,6 @@ async function deliverInline(deps, loaded, where) {
|
|
|
101
101
|
}, "failed to record outcome");
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
//#endregion
|
|
105
104
|
export { PAUSED_MESSAGE, createBuildStatePublisher };
|
|
106
105
|
|
|
107
106
|
//# sourceMappingURL=publisher.mjs.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { BuildStateDeps, BuildStatePublisher } from "./types.mjs";
|
|
4
|
-
//#region src/capture/build-state/resume.d.ts
|
|
5
4
|
/** Ask `publisher` for the state of every open recent build; resolves to how many were asked. Never rejects. */
|
|
6
5
|
declare function requestOpenBuildStates(deps: Pick<BuildStateDeps, "db" | "logger">, publisher: BuildStatePublisher): Promise<number>;
|
|
7
|
-
//#endregion
|
|
8
6
|
export { requestOpenBuildStates };
|
|
9
7
|
//# sourceMappingURL=resume.d.mts.map
|
|
@@ -4,7 +4,7 @@ import.meta.url;
|
|
|
4
4
|
import { BuildModel } from "../../models/build.mjs";
|
|
5
5
|
import { ProjectModel } from "../../models/project.mjs";
|
|
6
6
|
import { LOCAL_SHA_PREFIX } from "@storyshelf/affected";
|
|
7
|
-
|
|
7
|
+
// src/capture/build-state/resume.ts
|
|
8
8
|
/**
|
|
9
9
|
* Re-requesting the state of builds still open. Requests made while no public origin was resolved
|
|
10
10
|
* were dropped (ADR 0014, decision 11), so once one is, the builds that can still change are asked
|
|
@@ -41,7 +41,6 @@ async function openBuildIds(deps, projectId) {
|
|
|
41
41
|
function hasGitCommit(gitSha) {
|
|
42
42
|
return gitSha.length > 0 && !gitSha.startsWith(LOCAL_SHA_PREFIX);
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { requestOpenBuildStates };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=resume.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { DatabaseAdapter } from "../../adapter/database.mjs";
|
|
4
3
|
import { Logger } from "../../logger.mjs";
|
|
4
|
+
import { DatabaseAdapter } from "../../adapter/database.mjs";
|
|
5
5
|
import { NotificationChannel } from "../../adapters/notifier/types.mjs";
|
|
6
6
|
import { NotifierProvider, StateNotifierProvider } from "../../adapters/notifier/provider.mjs";
|
|
7
7
|
import { StorageAdapter } from "../../adapter/storage.mjs";
|
|
@@ -9,7 +9,6 @@ import { ShelfConfig } from "../../config.mjs";
|
|
|
9
9
|
import { BuildStateFlags } from "../../adapters/notifier/build-state.mjs";
|
|
10
10
|
import { SecretInput } from "../../utils/encrypt.mjs";
|
|
11
11
|
import { Project } from "../../schema/project.mjs";
|
|
12
|
-
//#region src/capture/build-state/types.d.ts
|
|
13
12
|
/** What delivering a build's state needs. */
|
|
14
13
|
interface BuildStateDeps {
|
|
15
14
|
db: DatabaseAdapter;
|
|
@@ -44,6 +43,5 @@ type SkipReason = "no-build" | "no-channel" | "disabled" | "no-provider" | "no-o
|
|
|
44
43
|
interface BuildStatePublisher {
|
|
45
44
|
request(buildId: string): Promise<void>;
|
|
46
45
|
}
|
|
47
|
-
//#endregion
|
|
48
46
|
export { BuildStateDeps, BuildStatePublisher, SkipReason, StateTarget };
|
|
49
47
|
//# sourceMappingURL=types.d.mts.map
|
|
@@ -3,7 +3,6 @@ import __tsdown_shims_url from 'node:url';
|
|
|
3
3
|
import { DatabaseAdapter } from "../../adapter/database.mjs";
|
|
4
4
|
import { StorageAdapter } from "../../adapter/storage.mjs";
|
|
5
5
|
import { Catalog } from "./types.mjs";
|
|
6
|
-
//#region src/capture/catalog/catalogue.d.ts
|
|
7
6
|
/** What cataloguing reads and writes. */
|
|
8
7
|
interface CatalogDeps {
|
|
9
8
|
db: DatabaseAdapter;
|
|
@@ -17,6 +16,5 @@ interface CatalogDeps {
|
|
|
17
16
|
declare function catalogueBuild(deps: CatalogDeps, projectId: string, buildId: string): Promise<Catalog | null>;
|
|
18
17
|
/** A build's persisted catalog, or null when it has none (or an unreadable one). */
|
|
19
18
|
declare function readCatalog(storage: StorageAdapter, projectId: string, buildId: string): Promise<Catalog | null>;
|
|
20
|
-
//#endregion
|
|
21
19
|
export { CatalogDeps, catalogueBuild, readCatalog };
|
|
22
20
|
//# sourceMappingURL=catalogue.d.mts.map
|
|
@@ -6,7 +6,7 @@ import { BuildComponentModel } from "../../models/build-component.mjs";
|
|
|
6
6
|
import { groupComponents, toBuildComponent } from "./components.mjs";
|
|
7
7
|
import { parseStorybookIndexText } from "./parse.mjs";
|
|
8
8
|
import { readPublishedFile } from "./read.mjs";
|
|
9
|
-
|
|
9
|
+
// src/capture/catalog/catalogue.ts
|
|
10
10
|
/** Index files a Storybook may publish, newest format first. */
|
|
11
11
|
const INDEX_FILES = ["index.json", "stories.json"];
|
|
12
12
|
/**
|
|
@@ -47,7 +47,6 @@ async function readIndexEntries(storage, projectId, buildId) {
|
|
|
47
47
|
}
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
-
//#endregion
|
|
51
50
|
export { catalogueBuild, readCatalog };
|
|
52
51
|
|
|
53
52
|
//# sourceMappingURL=catalogue.mjs.map
|
|
@@ -2,7 +2,6 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { CatalogComponent, CatalogEntry } from "./types.mjs";
|
|
4
4
|
import { BuildComponentInput } from "../../models/build-component.mjs";
|
|
5
|
-
//#region src/capture/catalog/components.d.ts
|
|
6
5
|
/** Group entries by story file (entries without one by title), ordered by title then file. */
|
|
7
6
|
declare function groupComponents(entries: readonly CatalogEntry[]): CatalogComponent[];
|
|
8
7
|
/** What `build_components` stores of a component. */
|
|
@@ -18,6 +17,5 @@ interface EntryChanges {
|
|
|
18
17
|
}
|
|
19
18
|
/** Entries added, removed and renamed from `before` to `after` (matched by entry id). */
|
|
20
19
|
declare function diffEntries(before: readonly CatalogEntry[], after: readonly CatalogEntry[]): EntryChanges;
|
|
21
|
-
//#endregion
|
|
22
20
|
export { EntryChanges, diffEntries, groupComponents, hashEntries, toBuildComponent };
|
|
23
21
|
//# sourceMappingURL=components.d.mts.map
|
|
@@ -2,7 +2,7 @@ import "node:path";
|
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
|
-
|
|
5
|
+
// src/capture/catalog/components.ts
|
|
6
6
|
/** Catalog entries grouped into components, hashed, and compared between builds. */
|
|
7
7
|
/** Group entries by story file (entries without one by title), ordered by title then file. */
|
|
8
8
|
function groupComponents(entries) {
|
|
@@ -49,7 +49,6 @@ function diffEntries(before, after) {
|
|
|
49
49
|
renamed
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
//#endregion
|
|
53
52
|
export { diffEntries, groupComponents, hashEntries, toBuildComponent };
|
|
54
53
|
|
|
55
54
|
//# sourceMappingURL=components.mjs.map
|
|
@@ -3,7 +3,6 @@ import __tsdown_shims_url from 'node:url';
|
|
|
3
3
|
import { Build } from "../../schema/build.mjs";
|
|
4
4
|
import { BuildComponent } from "../../schema/build-component.mjs";
|
|
5
5
|
import { ComponentPresence } from "../../models/component.mjs";
|
|
6
|
-
//#region src/capture/catalog/history.d.ts
|
|
7
6
|
/** How a build's version of a component compares with the build before it on the same branch. */
|
|
8
7
|
type ComponentChange = "new" | "changed" | "unchanged";
|
|
9
8
|
/** One build's row of a component's history. */
|
|
@@ -25,6 +24,5 @@ declare function componentBuildHistory(rows: readonly BuildComponent[], builds:
|
|
|
25
24
|
* component rows, or null when it has no catalog (the answer is then unknown, never "deleted").
|
|
26
25
|
*/
|
|
27
26
|
declare function catalogPresence(history: readonly ComponentBuildRow[], importPath: string, latest: readonly BuildComponent[] | null): ComponentPresence;
|
|
28
|
-
//#endregion
|
|
29
27
|
export { ComponentBuildRow, ComponentChange, catalogPresence, componentBuildHistory };
|
|
30
28
|
//# sourceMappingURL=history.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
-
|
|
4
|
+
// src/capture/catalog/history.ts
|
|
5
5
|
/**
|
|
6
6
|
* Component history, newest build first. `rows` are the component's `build_components` rows;
|
|
7
7
|
* a row whose build is missing is skipped. The build before is the next older one on the same
|
|
@@ -45,7 +45,6 @@ function catalogPresence(history, importPath, latest) {
|
|
|
45
45
|
lastSeen: newest.build
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
//#endregion
|
|
49
48
|
export { catalogPresence, componentBuildHistory };
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=history.mjs.map
|
|
@@ -2,13 +2,11 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { AfterPublishHook } from "../publish/complete.mjs";
|
|
4
4
|
import { CatalogLoader } from "./load.mjs";
|
|
5
|
-
//#region src/capture/catalog/hook.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Catalogue every build that published successfully, whatever its verdict and with `testing` on or
|
|
8
7
|
* off. A failed publish writes nothing. A build with no readable index is logged and left for the
|
|
9
8
|
* lazy loader, which tries again on first view.
|
|
10
9
|
*/
|
|
11
10
|
declare function createCatalogHook(loader: CatalogLoader): AfterPublishHook;
|
|
12
|
-
//#endregion
|
|
13
11
|
export { createCatalogHook };
|
|
14
12
|
//# sourceMappingURL=hook.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
-
|
|
4
|
+
// src/capture/catalog/hook.ts
|
|
5
5
|
/**
|
|
6
6
|
* Catalogue every build that published successfully, whatever its verdict and with `testing` on or
|
|
7
7
|
* off. A failed publish writes nothing. A build with no readable index is logged and left for the
|
|
@@ -13,7 +13,6 @@ function createCatalogHook(loader) {
|
|
|
13
13
|
if (!await loader.refresh(project.id, build.id)) logger.warn("published build has no readable Storybook index; no catalog written");
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { createCatalogHook };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=hook.mjs.map
|
|
@@ -6,6 +6,6 @@ import { CatalogLoader, CatalogLoaderOptions, DEFAULT_CATALOG_CACHE_SIZE, create
|
|
|
6
6
|
import { createCatalogHook } from "./hook.mjs";
|
|
7
7
|
import { EntryChanges, diffEntries, groupComponents, hashEntries, toBuildComponent } from "./components.mjs";
|
|
8
8
|
import { parseStorybookIndex, parseStorybookIndexText } from "./parse.mjs";
|
|
9
|
-
import { readPublishedFile } from "./read.mjs";
|
|
9
|
+
import { readPublishedFile, readPublishedFileInfo } from "./read.mjs";
|
|
10
10
|
import { ComponentBuildRow, ComponentChange, catalogPresence, componentBuildHistory } from "./history.mjs";
|
|
11
|
-
export { type Catalog, type CatalogComponent, type CatalogDeps, type CatalogEntry, type CatalogLoader, type CatalogLoaderOptions, type ComponentBuildRow, type ComponentChange, DEFAULT_CATALOG_CACHE_SIZE, type EntryChanges, catalogPresence, catalogueBuild, componentBuildHistory, createCatalogHook, createCatalogLoader, diffEntries, groupComponents, hashEntries, parseStorybookIndex, parseStorybookIndexText, readCatalog, readPublishedFile, toBuildComponent };
|
|
11
|
+
export { type Catalog, type CatalogComponent, type CatalogDeps, type CatalogEntry, type CatalogLoader, type CatalogLoaderOptions, type ComponentBuildRow, type ComponentChange, DEFAULT_CATALOG_CACHE_SIZE, type EntryChanges, catalogPresence, catalogueBuild, componentBuildHistory, createCatalogHook, createCatalogLoader, diffEntries, groupComponents, hashEntries, parseStorybookIndex, parseStorybookIndexText, readCatalog, readPublishedFile, readPublishedFileInfo, toBuildComponent };
|
|
@@ -3,7 +3,6 @@ import __tsdown_shims_url from 'node:url';
|
|
|
3
3
|
import { Logger } from "../../logger.mjs";
|
|
4
4
|
import { Catalog } from "./types.mjs";
|
|
5
5
|
import { CatalogDeps } from "./catalogue.mjs";
|
|
6
|
-
//#region src/capture/catalog/load.d.ts
|
|
7
6
|
/** Reads catalogs; one per app, so the cache is shared by every request. */
|
|
8
7
|
interface CatalogLoader {
|
|
9
8
|
/** The build's catalog, or null when it has no catalog and no readable index. */
|
|
@@ -21,6 +20,5 @@ interface CatalogLoaderOptions extends CatalogDeps {
|
|
|
21
20
|
}
|
|
22
21
|
/** A loader over `options.db` and `options.storage`. */
|
|
23
22
|
declare function createCatalogLoader(options: CatalogLoaderOptions): CatalogLoader;
|
|
24
|
-
//#endregion
|
|
25
23
|
export { CatalogLoader, CatalogLoaderOptions, DEFAULT_CATALOG_CACHE_SIZE, createCatalogLoader };
|
|
26
24
|
//# sourceMappingURL=load.d.mts.map
|
|
@@ -2,7 +2,7 @@ import "node:path";
|
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { catalogueBuild, readCatalog } from "./catalogue.mjs";
|
|
5
|
-
|
|
5
|
+
// src/capture/catalog/load.ts
|
|
6
6
|
/** Catalogs kept in memory by default. */
|
|
7
7
|
const DEFAULT_CATALOG_CACHE_SIZE = 32;
|
|
8
8
|
/** A loader over `options.db` and `options.storage`. */
|
|
@@ -43,7 +43,6 @@ function createCatalogLoader(options) {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
//#endregion
|
|
47
46
|
export { DEFAULT_CATALOG_CACHE_SIZE, createCatalogLoader };
|
|
48
47
|
|
|
49
48
|
//# sourceMappingURL=load.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { CatalogEntry } from "./types.mjs";
|
|
4
|
-
//#region src/capture/catalog/parse.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Entries of a parsed index document, or null when it is not an index. Test entries (Storybook 10
|
|
7
6
|
* `subtype: "test"`) are left out, as capture leaves them out; entries without an id or title are
|
|
@@ -10,6 +9,5 @@ import { CatalogEntry } from "./types.mjs";
|
|
|
10
9
|
declare function parseStorybookIndex(document: unknown): CatalogEntry[] | null;
|
|
11
10
|
/** Parse the text of an index file; null when it is not JSON or not an index. */
|
|
12
11
|
declare function parseStorybookIndexText(text: string): CatalogEntry[] | null;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { parseStorybookIndex, parseStorybookIndexText };
|
|
15
13
|
//# sourceMappingURL=parse.d.mts.map
|
|
@@ -2,7 +2,7 @@ import "node:path";
|
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { normalizeImportPath } from "../../models/design-resolve.mjs";
|
|
5
|
-
|
|
5
|
+
// src/capture/catalog/parse.ts
|
|
6
6
|
/** Storybook index to catalog entries: `index.json` (v4/v5), `stories.json` (v3 and older). */
|
|
7
7
|
/**
|
|
8
8
|
* Entries of a parsed index document, or null when it is not an index. Test entries (Storybook 10
|
|
@@ -50,7 +50,6 @@ function toEntry(raw) {
|
|
|
50
50
|
tags: Array.isArray(tags) ? tags.filter((tag) => typeof tag === "string") : []
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
53
|
export { parseStorybookIndex, parseStorybookIndexText };
|
|
55
54
|
|
|
56
55
|
//# sourceMappingURL=parse.mjs.map
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { StorageAdapter } from "../../adapter/storage.mjs";
|
|
4
|
-
//#region src/capture/catalog/read.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* A file of a build's published Storybook by its path inside the build, or null when it is gone.
|
|
7
6
|
* Content-addressed builds answer through their manifest; older ones from the per-build copy.
|
|
8
7
|
*/
|
|
9
8
|
declare function readPublishedFile(storage: StorageAdapter, projectId: string, buildId: string, rel: string): Promise<Buffer | null>;
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/** Published bytes and, for content-addressed files, their manifest identity. */
|
|
10
|
+
declare function readPublishedFileInfo(storage: StorageAdapter, projectId: string, buildId: string, rel: string): Promise<{
|
|
11
|
+
bytes: Buffer;
|
|
12
|
+
contentHash?: string;
|
|
13
|
+
} | null>;
|
|
14
|
+
export { readPublishedFile, readPublishedFileInfo };
|
|
12
15
|
//# sourceMappingURL=read.d.mts.map
|
|
@@ -1,33 +1,39 @@
|
|
|
1
|
-
import "node:path";
|
|
1
|
+
import { posix } from "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { storybookDir } from "../../paths.mjs";
|
|
5
|
-
|
|
6
|
-
//#region src/capture/catalog/read.ts
|
|
5
|
+
// src/capture/catalog/read.ts
|
|
7
6
|
/** Reading a published build's files from storage. */
|
|
8
7
|
/**
|
|
9
8
|
* A file of a build's published Storybook by its path inside the build, or null when it is gone.
|
|
10
9
|
* Content-addressed builds answer through their manifest; older ones from the per-build copy.
|
|
11
10
|
*/
|
|
12
11
|
async function readPublishedFile(storage, projectId, buildId, rel) {
|
|
12
|
+
return (await readPublishedFileInfo(storage, projectId, buildId, rel))?.bytes ?? null;
|
|
13
|
+
}
|
|
14
|
+
/** Published bytes and, for content-addressed files, their manifest identity. */
|
|
15
|
+
async function readPublishedFileInfo(storage, projectId, buildId, rel) {
|
|
13
16
|
const dir = storybookDir(projectId, buildId);
|
|
14
17
|
const viaManifest = await readViaManifest(storage, dir, rel);
|
|
15
18
|
if (viaManifest) return viaManifest;
|
|
16
19
|
const legacy = posix.join(dir, rel);
|
|
17
|
-
return await storage.exists(legacy) ? await storage.read(legacy) : null;
|
|
20
|
+
return await storage.exists(legacy) ? { bytes: await storage.read(legacy) } : null;
|
|
18
21
|
}
|
|
19
22
|
async function readViaManifest(storage, dir, rel) {
|
|
20
23
|
try {
|
|
21
24
|
const manifestPath = posix.join(dir, "manifest.json");
|
|
22
25
|
if (!await storage.exists(manifestPath)) return null;
|
|
23
26
|
const hash = JSON.parse((await storage.read(manifestPath)).toString("utf8"))[rel];
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
if (!hash) return null;
|
|
28
|
+
const path = `content/${hash}`;
|
|
29
|
+
return await storage.exists(path) ? {
|
|
30
|
+
bytes: await storage.read(path),
|
|
31
|
+
contentHash: hash
|
|
32
|
+
} : null;
|
|
26
33
|
} catch {
|
|
27
34
|
return null;
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
|
-
|
|
31
|
-
export { readPublishedFile };
|
|
37
|
+
export { readPublishedFile, readPublishedFileInfo };
|
|
32
38
|
|
|
33
39
|
//# sourceMappingURL=read.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.mjs","names":[],"sources":["../../../src/capture/catalog/read.ts"],"sourcesContent":["/** Reading a published build's files from storage. */\nimport { posix } from \"node:path\";\nimport type { StorageAdapter } from \"../../adapters/storage.ts\";\nimport { storybookDir } from \"../../utils/paths.ts\";\n\n/**\n * A file of a build's published Storybook by its path inside the build, or null when it is gone.\n * Content-addressed builds answer through their manifest; older ones from the per-build copy.\n */\nexport async function readPublishedFile(\n storage: StorageAdapter,\n projectId: string,\n buildId: string,\n rel: string,\n): Promise<Buffer | null> {\n const dir = storybookDir(projectId, buildId);\n const viaManifest = await readViaManifest(storage, dir, rel);\n if (viaManifest) {\n return viaManifest;\n }\n const legacy = posix.join(dir, rel);\n return (await storage.exists(legacy)) ? await storage.read(legacy) : null;\n}\n\nasync function readViaManifest(\n storage: StorageAdapter,\n dir: string,\n rel: string,\n): Promise<Buffer | null> {\n try {\n const manifestPath = posix.join(dir, \"manifest.json\");\n if (!(await storage.exists(manifestPath))) {\n return null;\n }\n const manifest = JSON.parse((await storage.read(manifestPath)).toString(\"utf8\")) as Record<\n string,\n string\n >;\n const hash = manifest[rel];\n const path =
|
|
1
|
+
{"version":3,"file":"read.mjs","names":[],"sources":["../../../src/capture/catalog/read.ts"],"sourcesContent":["/** Reading a published build's files from storage. */\nimport { posix } from \"node:path\";\nimport type { StorageAdapter } from \"../../adapters/storage.ts\";\nimport { storybookDir } from \"../../utils/paths.ts\";\n\n/**\n * A file of a build's published Storybook by its path inside the build, or null when it is gone.\n * Content-addressed builds answer through their manifest; older ones from the per-build copy.\n */\nexport async function readPublishedFile(\n storage: StorageAdapter,\n projectId: string,\n buildId: string,\n rel: string,\n): Promise<Buffer | null> {\n return (await readPublishedFileInfo(storage, projectId, buildId, rel))?.bytes ?? null;\n}\n\n/** Published bytes and, for content-addressed files, their manifest identity. */\nexport async function readPublishedFileInfo(\n storage: StorageAdapter,\n projectId: string,\n buildId: string,\n rel: string,\n): Promise<{ bytes: Buffer; contentHash?: string } | null> {\n const dir = storybookDir(projectId, buildId);\n const viaManifest = await readViaManifest(storage, dir, rel);\n if (viaManifest) {\n return viaManifest;\n }\n const legacy = posix.join(dir, rel);\n return (await storage.exists(legacy)) ? { bytes: await storage.read(legacy) } : null;\n}\n\nasync function readViaManifest(\n storage: StorageAdapter,\n dir: string,\n rel: string,\n): Promise<{ bytes: Buffer; contentHash: string } | null> {\n try {\n const manifestPath = posix.join(dir, \"manifest.json\");\n if (!(await storage.exists(manifestPath))) {\n return null;\n }\n const manifest = JSON.parse((await storage.read(manifestPath)).toString(\"utf8\")) as Record<\n string,\n string\n >;\n const hash = manifest[rel];\n if (!hash) return null;\n const path = `content/${hash}`;\n return (await storage.exists(path))\n ? { bytes: await storage.read(path), contentHash: hash }\n : null;\n } catch {\n // an unreadable manifest falls back to the per-build copy\n return null;\n }\n}\n"],"mappings":";;;;;;;;;;AASA,eAAsB,kBACpB,SACA,WACA,SACA,KACwB;CACxB,QAAQ,MAAM,sBAAsB,SAAS,WAAW,SAAS,GAAG,EAAA,EAAI,SAAS;AACnF;;AAGA,eAAsB,sBACpB,SACA,WACA,SACA,KACyD;CACzD,MAAM,MAAM,aAAa,WAAW,OAAO;CAC3C,MAAM,cAAc,MAAM,gBAAgB,SAAS,KAAK,GAAG;CAC3D,IAAI,aACF,OAAO;CAET,MAAM,SAAS,MAAM,KAAK,KAAK,GAAG;CAClC,OAAQ,MAAM,QAAQ,OAAO,MAAM,IAAK,EAAE,OAAO,MAAM,QAAQ,KAAK,MAAM,EAAE,IAAI;AAClF;AAEA,eAAe,gBACb,SACA,KACA,KACwD;CACxD,IAAI;EACF,MAAM,eAAe,MAAM,KAAK,KAAK,eAAe;EACpD,IAAI,CAAE,MAAM,QAAQ,OAAO,YAAY,GACrC,OAAO;EAMT,MAAM,OAJW,KAAK,OAAO,MAAM,QAAQ,KAAK,YAAY,EAAA,CAAG,SAAS,MAAM,CAI1D,CAAC,CAAC;EACtB,IAAI,CAAC,MAAM,OAAO;EAClB,MAAM,OAAO,WAAW;EACxB,OAAQ,MAAM,QAAQ,OAAO,IAAI,IAC7B;GAAE,OAAO,MAAM,QAAQ,KAAK,IAAI;GAAG,aAAa;EAAK,IACrD;CACN,QAAQ;EAEN,OAAO;CACT;AACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
//#region src/capture/catalog/types.d.ts
|
|
4
3
|
/** Shapes of the persisted catalog (ADR 0006, decision 9). */
|
|
5
4
|
/** One Storybook index entry, kept compact: story and docs entries, never test entries. */
|
|
6
5
|
interface CatalogEntry {
|
|
@@ -28,6 +27,5 @@ interface CatalogComponent {
|
|
|
28
27
|
hash: string;
|
|
29
28
|
entries: CatalogEntry[];
|
|
30
29
|
}
|
|
31
|
-
//#endregion
|
|
32
30
|
export { Catalog, CatalogComponent, CatalogEntry };
|
|
33
31
|
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import "../adapter/database.mjs";
|
|
4
|
+
import "../adapter/storage.mjs";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
declare const referenceSchema: z.ZodObject<{
|
|
7
|
+
version: z.ZodLiteral<1>;
|
|
8
|
+
baselineId: z.ZodString;
|
|
9
|
+
baselineVersion: z.ZodString;
|
|
10
|
+
branch: z.ZodString;
|
|
11
|
+
defaultBranch: z.ZodBoolean;
|
|
12
|
+
sourceBuildId: z.ZodNullable<z.ZodString>;
|
|
13
|
+
sourceSnapshotId: z.ZodNullable<z.ZodString>;
|
|
14
|
+
imageSha256: z.ZodString;
|
|
15
|
+
baselineFingerprint: z.ZodNullable<z.ZodString>;
|
|
16
|
+
captureFingerprint: z.ZodNullable<z.ZodString>;
|
|
17
|
+
mode: z.ZodNullable<z.ZodString>;
|
|
18
|
+
target: z.ZodString;
|
|
19
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
20
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
type ComparisonReference = z.infer<typeof referenceSchema>;
|
|
23
|
+
declare function parseComparisonReference(raw: string | null | undefined): ComparisonReference | null;
|
|
24
|
+
/** Reject paths outside the consuming build's dedicated comparison directory. */
|
|
25
|
+
declare function isComparisonImagePath(path: string, projectId: string, buildId: string): boolean;
|
|
26
|
+
export { ComparisonReference, isComparisonImagePath, parseComparisonReference };
|
|
27
|
+
//# sourceMappingURL=comparison-reference.d.mts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import "../adapters/capture-target.mjs";
|
|
5
|
+
import { ulid } from "../utils/ulid.mjs";
|
|
6
|
+
import { SnapshotModel } from "../models/snapshot.mjs";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
9
|
+
// src/capture/comparison-reference.ts
|
|
10
|
+
/** Freeze a baseline image under the consuming build so it survives baseline movement. */
|
|
11
|
+
const referenceSchema = z.object({
|
|
12
|
+
version: z.literal(1),
|
|
13
|
+
baselineId: z.string(),
|
|
14
|
+
baselineVersion: z.string(),
|
|
15
|
+
branch: z.string(),
|
|
16
|
+
defaultBranch: z.boolean(),
|
|
17
|
+
sourceBuildId: z.string().nullable(),
|
|
18
|
+
sourceSnapshotId: z.string().nullable(),
|
|
19
|
+
imageSha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
20
|
+
baselineFingerprint: z.string().nullable(),
|
|
21
|
+
captureFingerprint: z.string().nullable(),
|
|
22
|
+
mode: z.string().nullable(),
|
|
23
|
+
target: z.string(),
|
|
24
|
+
width: z.number().int().positive().nullable(),
|
|
25
|
+
height: z.number().int().positive().nullable()
|
|
26
|
+
});
|
|
27
|
+
async function freezeComparison(storage, projectId, buildId, baseline, settings) {
|
|
28
|
+
const image = await storage.read(baseline.screenshotPath);
|
|
29
|
+
const comparisonImagePath = `${projectId}/builds/${buildId}/comparisons/${ulid()}.png`;
|
|
30
|
+
const reference = {
|
|
31
|
+
version: 1,
|
|
32
|
+
baselineId: baseline.id,
|
|
33
|
+
baselineVersion: baseline.updatedAt,
|
|
34
|
+
branch: baseline.branch,
|
|
35
|
+
defaultBranch: baseline.branch === settings.defaultBranch,
|
|
36
|
+
sourceBuildId: baseline.sourceBuildId ?? null,
|
|
37
|
+
sourceSnapshotId: settings.sourceSnapshotId,
|
|
38
|
+
imageSha256: createHash("sha256").update(image).digest("hex"),
|
|
39
|
+
baselineFingerprint: baseline.fingerprint ?? null,
|
|
40
|
+
captureFingerprint: settings.captureFingerprint ?? null,
|
|
41
|
+
mode: settings.mode,
|
|
42
|
+
target: settings.target,
|
|
43
|
+
width: settings.width,
|
|
44
|
+
height: settings.height
|
|
45
|
+
};
|
|
46
|
+
await storage.write(comparisonImagePath, image);
|
|
47
|
+
return {
|
|
48
|
+
comparisonImagePath,
|
|
49
|
+
comparisonMetadata: JSON.stringify(reference)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function parseComparisonReference(raw) {
|
|
53
|
+
if (!raw) return null;
|
|
54
|
+
try {
|
|
55
|
+
const parsed = referenceSchema.safeParse(JSON.parse(raw));
|
|
56
|
+
return parsed.success ? parsed.data : null;
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** Reject paths outside the consuming build's dedicated comparison directory. */
|
|
62
|
+
function isComparisonImagePath(path, projectId, buildId) {
|
|
63
|
+
const prefix = `${projectId}/builds/${buildId}/comparisons/`;
|
|
64
|
+
return path.startsWith(prefix) && /^[0-9A-HJKMNP-TV-Z]{26}\.png$/u.test(path.slice(prefix.length));
|
|
65
|
+
}
|
|
66
|
+
/** Identify a rendering snapshot only when its stored identity and image are provable. */
|
|
67
|
+
async function sourceSnapshotId(db, baseline) {
|
|
68
|
+
if (!baseline.sourceBuildId || !baseline.snapshotId) return null;
|
|
69
|
+
const snapshot = await new SnapshotModel(db).get(baseline.snapshotId);
|
|
70
|
+
if (!snapshot || snapshot.inherited || snapshot.buildId !== baseline.sourceBuildId || snapshot.projectId !== baseline.projectId || snapshot.storyId !== baseline.storyId || snapshot.viewportName !== baseline.viewportName || (snapshot.browser ?? "chromium") !== (baseline.browser ?? "chromium") || snapshot.screenshotPath !== baseline.screenshotPath) return null;
|
|
71
|
+
return snapshot.id;
|
|
72
|
+
}
|
|
73
|
+
export { freezeComparison, isComparisonImagePath, parseComparisonReference, sourceSnapshotId };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=comparison-reference.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comparison-reference.mjs","names":[],"sources":["../../src/capture/comparison-reference.ts"],"sourcesContent":["/** Freeze a baseline image under the consuming build so it survives baseline movement. */\nimport { createHash } from \"node:crypto\";\nimport { z } from \"zod\";\nimport { DEFAULT_BROWSER } from \"../adapters/capture-runner.ts\";\nimport type { DatabaseAdapter } from \"../adapters/database.ts\";\nimport type { StorageAdapter } from \"../adapters/storage.ts\";\nimport { SnapshotModel } from \"../models/snapshot.ts\";\nimport type { Baseline } from \"../schema/baseline.ts\";\nimport { ulid } from \"../utils/ulid.ts\";\n\nconst referenceSchema = z.object({\n version: z.literal(1),\n baselineId: z.string(),\n baselineVersion: z.string(),\n branch: z.string(),\n defaultBranch: z.boolean(),\n sourceBuildId: z.string().nullable(),\n sourceSnapshotId: z.string().nullable(),\n imageSha256: z.string().regex(/^[a-f0-9]{64}$/u),\n baselineFingerprint: z.string().nullable(),\n captureFingerprint: z.string().nullable(),\n mode: z.string().nullable(),\n target: z.string(),\n width: z.number().int().positive().nullable(),\n height: z.number().int().positive().nullable(),\n});\nexport type ComparisonReference = z.infer<typeof referenceSchema>;\nexport interface ComparisonSettings {\n defaultBranch: string;\n mode: string | null;\n target: string;\n width: number | null;\n height: number | null;\n captureFingerprint: string | null;\n sourceSnapshotId: string | null;\n}\n\nexport async function freezeComparison(\n storage: StorageAdapter,\n projectId: string,\n buildId: string,\n baseline: Baseline,\n settings: ComparisonSettings,\n): Promise<{ comparisonImagePath: string; comparisonMetadata: string }> {\n const image = await storage.read(baseline.screenshotPath);\n const comparisonImagePath = `${projectId}/builds/${buildId}/comparisons/${ulid()}.png`;\n const reference: ComparisonReference = {\n version: 1,\n baselineId: baseline.id,\n baselineVersion: baseline.updatedAt,\n branch: baseline.branch,\n defaultBranch: baseline.branch === settings.defaultBranch,\n sourceBuildId: baseline.sourceBuildId ?? null,\n sourceSnapshotId: settings.sourceSnapshotId,\n imageSha256: createHash(\"sha256\").update(image).digest(\"hex\"),\n baselineFingerprint: baseline.fingerprint ?? null,\n captureFingerprint: settings.captureFingerprint ?? null,\n mode: settings.mode,\n target: settings.target,\n width: settings.width,\n height: settings.height,\n };\n await storage.write(comparisonImagePath, image);\n return { comparisonImagePath, comparisonMetadata: JSON.stringify(reference) };\n}\n\nexport function parseComparisonReference(\n raw: string | null | undefined,\n): ComparisonReference | null {\n if (!raw) return null;\n try {\n const parsed = referenceSchema.safeParse(JSON.parse(raw));\n return parsed.success ? parsed.data : null;\n } catch {\n return null;\n }\n}\n\n/** Reject paths outside the consuming build's dedicated comparison directory. */\nexport function isComparisonImagePath(path: string, projectId: string, buildId: string): boolean {\n const prefix = `${projectId}/builds/${buildId}/comparisons/`;\n return (\n path.startsWith(prefix) && /^[0-9A-HJKMNP-TV-Z]{26}\\.png$/u.test(path.slice(prefix.length))\n );\n}\n\n/** Identify a rendering snapshot only when its stored identity and image are provable. */\nexport async function sourceSnapshotId(\n db: DatabaseAdapter,\n baseline: Baseline,\n): Promise<string | null> {\n if (!baseline.sourceBuildId || !baseline.snapshotId) return null;\n const snapshot = await new SnapshotModel(db).get(baseline.snapshotId);\n if (\n !snapshot ||\n snapshot.inherited ||\n snapshot.buildId !== baseline.sourceBuildId ||\n snapshot.projectId !== baseline.projectId ||\n snapshot.storyId !== baseline.storyId ||\n snapshot.viewportName !== baseline.viewportName ||\n (snapshot.browser ?? DEFAULT_BROWSER) !== (baseline.browser ?? DEFAULT_BROWSER) ||\n snapshot.screenshotPath !== baseline.screenshotPath\n )\n return null;\n return snapshot.id;\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAM,kBAAkB,EAAE,OAAO;CAC/B,SAAS,EAAE,QAAQ,CAAC;CACpB,YAAY,EAAE,OAAO;CACrB,iBAAiB,EAAE,OAAO;CAC1B,QAAQ,EAAE,OAAO;CACjB,eAAe,EAAE,QAAQ;CACzB,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS;CACnC,kBAAkB,EAAE,OAAO,CAAC,CAAC,SAAS;CACtC,aAAa,EAAE,OAAO,CAAC,CAAC,MAAM,iBAAiB;CAC/C,qBAAqB,EAAE,OAAO,CAAC,CAAC,SAAS;CACzC,oBAAoB,EAAE,OAAO,CAAC,CAAC,SAAS;CACxC,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,QAAQ,EAAE,OAAO;CACjB,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC5C,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AAC/C,CAAC;AAYD,eAAsB,iBACpB,SACA,WACA,SACA,UACA,UACsE;CACtE,MAAM,QAAQ,MAAM,QAAQ,KAAK,SAAS,cAAc;CACxD,MAAM,sBAAsB,GAAG,UAAU,UAAU,QAAQ,eAAe,KAAK,EAAE;CACjF,MAAM,YAAiC;EACrC,SAAS;EACT,YAAY,SAAS;EACrB,iBAAiB,SAAS;EAC1B,QAAQ,SAAS;EACjB,eAAe,SAAS,WAAW,SAAS;EAC5C,eAAe,SAAS,iBAAiB;EACzC,kBAAkB,SAAS;EAC3B,aAAa,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,KAAK;EAC5D,qBAAqB,SAAS,eAAe;EAC7C,oBAAoB,SAAS,sBAAsB;EACnD,MAAM,SAAS;EACf,QAAQ,SAAS;EACjB,OAAO,SAAS;EAChB,QAAQ,SAAS;CACnB;CACA,MAAM,QAAQ,MAAM,qBAAqB,KAAK;CAC9C,OAAO;EAAE;EAAqB,oBAAoB,KAAK,UAAU,SAAS;CAAE;AAC9E;AAEA,SAAgB,yBACd,KAC4B;CAC5B,IAAI,CAAC,KAAK,OAAO;CACjB,IAAI;EACF,MAAM,SAAS,gBAAgB,UAAU,KAAK,MAAM,GAAG,CAAC;EACxD,OAAO,OAAO,UAAU,OAAO,OAAO;CACxC,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAgB,sBAAsB,MAAc,WAAmB,SAA0B;CAC/F,MAAM,SAAS,GAAG,UAAU,UAAU,QAAQ;CAC9C,OACE,KAAK,WAAW,MAAM,KAAK,iCAAiC,KAAK,KAAK,MAAM,OAAO,MAAM,CAAC;AAE9F;;AAGA,eAAsB,iBACpB,IACA,UACwB;CACxB,IAAI,CAAC,SAAS,iBAAiB,CAAC,SAAS,YAAY,OAAO;CAC5D,MAAM,WAAW,MAAM,IAAI,cAAc,EAAE,CAAC,CAAC,IAAI,SAAS,UAAU;CACpE,IACE,CAAC,YACD,SAAS,aACT,SAAS,YAAY,SAAS,iBAC9B,SAAS,cAAc,SAAS,aAChC,SAAS,YAAY,SAAS,WAC9B,SAAS,iBAAiB,SAAS,iBAClC,SAAS,WAAA,iBAAiC,SAAS,WAAA,eACpD,SAAS,mBAAmB,SAAS,gBAErC,OAAO;CACT,OAAO,SAAS;AAClB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { Logger } from "../../logger.mjs";
|
|
3
4
|
import { CaptureRunner } from "../../adapter/capture-runner.mjs";
|
|
4
5
|
import { DatabaseAdapter } from "../../adapter/database.mjs";
|
|
5
|
-
import { Logger } from "../../logger.mjs";
|
|
6
6
|
import { DesignProvider } from "../../adapter/design.mjs";
|
|
7
7
|
import { NotifierProvider } from "../../adapters/notifier/provider.mjs";
|
|
8
8
|
import { StorageAdapter } from "../../adapter/storage.mjs";
|
|
@@ -12,7 +12,6 @@ import { CaptureJobOptions, ShardJob } from "../orchestrator.mjs";
|
|
|
12
12
|
import { BuildStatePublisher } from "../build-state/types.mjs";
|
|
13
13
|
import { DispatchDeps } from "../dispatch.mjs";
|
|
14
14
|
import { KindHandler } from "./types.mjs";
|
|
15
|
-
//#region src/capture/consumer/capture-handler.d.ts
|
|
16
15
|
/** What the capture handler needs: the same adapters the server's own capture setup uses. */
|
|
17
16
|
interface CaptureHandlerOptions {
|
|
18
17
|
/** Database adapter; its own `tables` are used (never a dialect's defaults). */
|
|
@@ -53,6 +52,5 @@ interface CaptureHandlerOptions {
|
|
|
53
52
|
declare function createCaptureHandler(options: CaptureHandlerOptions): KindHandler;
|
|
54
53
|
/** The dispatch dependencies the handler runs captures with; the host reuses them to write failures the pipeline never got to. */
|
|
55
54
|
declare function captureDispatchDeps(options: CaptureHandlerOptions, maxRetries: number): DispatchDeps;
|
|
56
|
-
//#endregion
|
|
57
55
|
export { CaptureHandlerOptions, captureDispatchDeps, createCaptureHandler };
|
|
58
56
|
//# sourceMappingURL=capture-handler.d.mts.map
|
|
@@ -6,7 +6,7 @@ import { retriesOf } from "./retry.mjs";
|
|
|
6
6
|
import { createBuildStatePublisher } from "../build-state/publisher.mjs";
|
|
7
7
|
import { createPublicOriginResolver } from "../../models/public-origin.mjs";
|
|
8
8
|
import { createDispatchJob } from "../dispatch.mjs";
|
|
9
|
-
|
|
9
|
+
// src/capture/consumer/capture-handler.ts
|
|
10
10
|
/** Whether a polled capture job carries the minimum shape to execute. */
|
|
11
11
|
function isValidCaptureJob(job) {
|
|
12
12
|
return typeof job.buildId === "string" && job.buildId.length > 0;
|
|
@@ -112,7 +112,6 @@ function originOf(options) {
|
|
|
112
112
|
});
|
|
113
113
|
return async () => await resolver.url();
|
|
114
114
|
}
|
|
115
|
-
//#endregion
|
|
116
115
|
export { captureDispatchDeps, createCaptureHandler, originOf };
|
|
117
116
|
|
|
118
117
|
//# sourceMappingURL=capture-handler.mjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
//#region src/capture/consumer/idle.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Idle backoff for queues whose `poll()` returns immediately when empty (GCP Pub/Sub synchronous
|
|
6
5
|
* pull, Azure Storage Queues). Queues that long-poll (SQS, Redis, Service Bus, the IPC queue) block
|
|
@@ -12,6 +11,5 @@ declare const MIN_BLOCKING_POLL_MS = 1000;
|
|
|
12
11
|
declare function idleDelayMs(emptyStreak: number): number;
|
|
13
12
|
/** Whether an empty poll came back too fast to have blocked on the queue. */
|
|
14
13
|
declare function isFastEmptyPoll(elapsedMs: number): boolean;
|
|
15
|
-
//#endregion
|
|
16
14
|
export { MIN_BLOCKING_POLL_MS, idleDelayMs, isFastEmptyPoll };
|
|
17
15
|
//# sourceMappingURL=idle.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
-
|
|
4
|
+
// src/capture/consumer/idle.ts
|
|
5
5
|
/**
|
|
6
6
|
* Idle backoff for queues whose `poll()` returns immediately when empty (GCP Pub/Sub synchronous
|
|
7
7
|
* pull, Azure Storage Queues). Queues that long-poll (SQS, Redis, Service Bus, the IPC queue) block
|
|
@@ -19,7 +19,6 @@ function idleDelayMs(emptyStreak) {
|
|
|
19
19
|
function isFastEmptyPoll(elapsedMs) {
|
|
20
20
|
return elapsedMs < MIN_BLOCKING_POLL_MS;
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { MIN_BLOCKING_POLL_MS, idleDelayMs, isFastEmptyPoll };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=idle.mjs.map
|
|
@@ -5,9 +5,7 @@ import { ConsumerMetrics, DEFAULT_SAMPLE_MS, JobFinishedEvent, JobOutcome, Queue
|
|
|
5
5
|
import { DEFAULT_BACKOFF_MS, DEFAULT_MAX_RETRIES, DEFAULT_WAIT_TIME_SECONDS, MAX_BACKOFF_MS, RetryConfig, backoffDelayMs, isFinalAttempt } from "./retry.mjs";
|
|
6
6
|
import { CaptureConsumer, CaptureConsumerOptions, ConsumerConfig, ConsumerJob, JobHandlers, JobRunContext, KindHandler } from "./types.mjs";
|
|
7
7
|
import { MIN_BLOCKING_POLL_MS, idleDelayMs, isFastEmptyPoll } from "./idle.mjs";
|
|
8
|
-
//#region src/capture/consumer/index.d.ts
|
|
9
8
|
/** Create a consumer of `options.queue`; nothing runs until `start()`. */
|
|
10
9
|
declare function createCaptureConsumer(options: CaptureConsumerOptions): CaptureConsumer;
|
|
11
|
-
//#endregion
|
|
12
10
|
export { type CaptureConsumer, type CaptureConsumerOptions, type CaptureHandlerOptions, type ConsumerConfig, type ConsumerJob, type ConsumerMetrics, DEFAULT_BACKOFF_MS, DEFAULT_MAX_RETRIES, DEFAULT_SAMPLE_MS, DEFAULT_WAIT_TIME_SECONDS, type JobFinishedEvent, type JobHandlers, type JobOutcome, type JobRunContext, type KindHandler, MAX_BACKOFF_MS, MIN_BLOCKING_POLL_MS, type QueueSample, type RetryConfig, backoffDelayMs, captureDispatchDeps, createCaptureConsumer, createCaptureHandler, idleDelayMs, isFastEmptyPoll, isFinalAttempt, sampleQueue };
|
|
13
11
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -12,7 +12,7 @@ import { startSlotLoop } from "./loop.mjs";
|
|
|
12
12
|
import { DEFAULT_SAMPLE_MS, sampleQueue, startQueueSampling } from "./metrics.mjs";
|
|
13
13
|
import { runJob } from "./run-job.mjs";
|
|
14
14
|
import { applyImageSettings, ensureImageEngine, sweepScratch } from "./startup.mjs";
|
|
15
|
-
|
|
15
|
+
// src/capture/consumer/index.ts
|
|
16
16
|
/** Create a consumer of `options.queue`; nothing runs until `start()`. */
|
|
17
17
|
function createCaptureConsumer(options) {
|
|
18
18
|
applyImageSettings(options.images, options.compare);
|
|
@@ -133,7 +133,6 @@ function registry(options, logger) {
|
|
|
133
133
|
for (const [kind, handler] of Object.entries(all)) if (handler !== void 0) map.set(kind, typeof handler === "function" ? { run: handler } : handler);
|
|
134
134
|
return map;
|
|
135
135
|
}
|
|
136
|
-
//#endregion
|
|
137
136
|
export { DEFAULT_BACKOFF_MS, DEFAULT_MAX_RETRIES, DEFAULT_SAMPLE_MS, DEFAULT_WAIT_TIME_SECONDS, MAX_BACKOFF_MS, MIN_BLOCKING_POLL_MS, backoffDelayMs, captureDispatchDeps, createCaptureConsumer, createCaptureHandler, idleDelayMs, isFastEmptyPoll, isFinalAttempt, sampleQueue };
|
|
138
137
|
|
|
139
138
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -3,7 +3,7 @@ import "node:url";
|
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { REAL_TIMERS } from "../db-queue/timers.mjs";
|
|
5
5
|
import { idleDelayMs, isFastEmptyPoll } from "./idle.mjs";
|
|
6
|
-
|
|
6
|
+
// src/capture/consumer/loop.ts
|
|
7
7
|
/** Pause after a failed poll. */
|
|
8
8
|
const POLL_ERROR_DELAY_MS = 1e3;
|
|
9
9
|
/** Start consuming `queue` with `slots` concurrent jobs. */
|
|
@@ -104,7 +104,6 @@ async function sleep(state, timers, ms) {
|
|
|
104
104
|
await promise;
|
|
105
105
|
if (handle !== null) clock.clearTimeout(handle);
|
|
106
106
|
}
|
|
107
|
-
//#endregion
|
|
108
107
|
export { POLL_ERROR_DELAY_MS, startSlotLoop };
|
|
109
108
|
|
|
110
109
|
//# sourceMappingURL=loop.mjs.map
|