deepline 0.3.88 → 0.3.90
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/contracts/install-commands.json +29 -0
- package/dist/bundling-sources/sdk/src/client.ts +652 -39
- package/dist/bundling-sources/sdk/src/config.ts +77 -0
- package/dist/bundling-sources/sdk/src/http.ts +76 -30
- package/dist/bundling-sources/sdk/src/index.ts +10 -0
- package/dist/bundling-sources/sdk/src/monitor-fleet-contract.ts +1 -1
- package/dist/bundling-sources/sdk/src/pagination.ts +25 -0
- package/dist/bundling-sources/sdk/src/play.ts +15 -1
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +3 -3
- package/dist/bundling-sources/sdk/src/release.ts +16 -9
- package/dist/bundling-sources/sdk/src/types.ts +106 -4
- package/dist/bundling-sources/shared_libs/integration-contracts/AGENTS.md +9 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/README.md +3 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/index.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/analytics-install-guides.ts +77 -0
- package/dist/bundling-sources/shared_libs/monitors/analytics-public.ts +10 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/charges.ts +125 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +686 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +54 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/public-pricing.ts +72 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/session.ts +45 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/state.ts +454 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/tamradar.ts +260 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +215 -0
- package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +333 -0
- package/dist/bundling-sources/shared_libs/monitors/cursor-page.ts +42 -0
- package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/framework-managed-payload-fields.ts +71 -0
- package/dist/bundling-sources/shared_libs/monitors/generated/provider-monitor-callback-admission-targets.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +270 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +39 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +82 -0
- package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +59 -0
- package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +471 -0
- package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/package.json +36 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +1125 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +305 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +964 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +56 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +131 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +535 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-legacy-aliases.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-priority-execution.ts +56 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-runtime-read-eligibility.ts +38 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +122 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-status.ts +10 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +112 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-webhook-monitor-runtime.ts +300 -0
- package/dist/bundling-sources/shared_libs/monitors/quickstart-prompts.ts +22 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +245 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-message.ts +38 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-ack-probe.ts +94 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +60 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue.ts +60 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +93 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +332 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +221 -0
- package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +105 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +73 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +81 -0
- package/dist/bundling-sources/shared_libs/monitors/tsconfig.json +10 -0
- package/dist/bundling-sources/shared_libs/observability/build-context.ts +13 -0
- package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +160 -0
- package/dist/bundling-sources/shared_libs/observability/request-context.ts +68 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +654 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +35 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/neon-constants.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +272 -0
- package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +6 -11
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +135 -12
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +66 -1
- package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +77 -0
- package/dist/bundling-sources/shared_libs/play-runtime/bounceban-batching.ts +137 -0
- package/dist/bundling-sources/shared_libs/play-runtime/checkpoint-boundaries.ts +70 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +1159 -166
- package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +1 -32
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +103 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-payload-contract.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +103 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +725 -0
- package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +29 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +29 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +442 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/contracts.ts +66 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/job.ts +145 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/ports.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/postgres-store.ts +170 -0
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +1322 -0
- package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +189 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-source-policy.ts +112 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/perf-trace.ts +127 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/contracts.ts +56 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/index.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/job.ts +41 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/ports.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/postgres-adapter.ts +54 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/contracts.ts +114 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts +108 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/index.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/job.ts +97 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/ports.ts +104 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts +263 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/worker-terminal-projection.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/contracts.ts +29 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +56 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/index.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/job.ts +65 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/ports.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/index.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +142 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +102 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/contracts.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/index.ts +16 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/job.ts +78 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/ports.ts +54 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/postgres-adapter.ts +71 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +5 -8
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +23 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +168 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +90 -13
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +6 -12
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-start-admission.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +0 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +14 -43
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +67 -213
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +201 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +12 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +67 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-release-environment.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +38 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-telemetry.ts +108 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +37 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +88 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-deploy-task.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-run-task.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +193 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-lifecycle.ts +269 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-suffix.ts +73 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +6642 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +897 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-metrics.ts +120 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +76 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +476 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-heavy-request-admission.ts +47 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-progress-registry.ts +147 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/index.ts +27 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/lazy.ts +50 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +98 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-budget-state.ts +260 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1416 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1255 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +942 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +14636 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +888 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +355 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-terminal-transition.ts +46 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runner-push.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +33 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-gateway-health.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +835 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +1218 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +207 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-scheduler-schema.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-capacity.ts +123 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-launch-read-observability.ts +78 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/submit-admission.ts +169 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/terminal-contract.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-queue-metrics.ts +34 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-resource-metrics.ts +249 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/step-progress.ts +296 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +60 -15
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +12 -0
- package/dist/bundling-sources/shared_libs/play-runtime/vercel-protection.ts +14 -1
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +165 -0
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +15 -23
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +169 -0
- package/dist/bundling-sources/shared_libs/play-runtime/zerobounce-batching.ts +122 -0
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +8 -3
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +454 -17
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +19 -4
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +8 -14
- package/dist/bundling-sources/shared_libs/plays/core.ts +11 -6
- package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +16 -11
- package/dist/bundling-sources/shared_libs/plays/docflow.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/email-status.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/play-grep-search.ts +39 -0
- package/dist/bundling-sources/shared_libs/plays/resolve-static-pipeline.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/share/copy.ts +271 -0
- package/dist/bundling-sources/shared_libs/plays/share/metrics.ts +140 -0
- package/dist/bundling-sources/shared_libs/plays/share/public-read-model.ts +86 -0
- package/dist/bundling-sources/shared_libs/plays/share/seo-quality.ts +181 -0
- package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +658 -0
- package/dist/bundling-sources/shared_libs/plays/share/types.ts +197 -0
- package/dist/bundling-sources/shared_libs/plays/slack-hitl-timeout-error.ts +37 -0
- package/dist/bundling-sources/shared_libs/plays/slug.ts +115 -0
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +50 -15
- package/dist/bundling-sources/shared_libs/plays/tool-category-descriptions.ts +2 -2
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +877 -0
- package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +456 -0
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +566 -0
- package/dist/bundling-sources/shared_libs/product-notifications/content.ts +28 -0
- package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +60 -0
- package/dist/bundling-sources/shared_libs/product-notifications/email.ts +246 -0
- package/dist/bundling-sources/shared_libs/product-notifications/evaluation.ts +280 -0
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +433 -0
- package/dist/bundling-sources/shared_libs/product-notifications/legacy-slack.ts +80 -0
- package/dist/bundling-sources/shared_libs/product-notifications/overflow.ts +18 -0
- package/dist/bundling-sources/shared_libs/product-notifications/rolling-limit.ts +24 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +624 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-payload.ts +140 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-transport.ts +75 -0
- package/dist/bundling-sources/shared_libs/product-notifications/workspace.ts +38 -0
- package/dist/bundling-sources/shared_libs/runtime-env.ts +12 -0
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +42 -0
- package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +35 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +50 -0
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +267 -0
- package/dist/bundling-sources/shared_libs/security/slack-sanitize.ts +133 -0
- package/dist/cli/getting-started.d.mts +52 -0
- package/dist/cli/getting-started.d.ts +52 -0
- package/dist/cli/getting-started.js +65 -0
- package/dist/cli/getting-started.mjs +36 -0
- package/dist/cli/index.d.mts +9 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.js +1611 -453
- package/dist/cli/index.mjs +1596 -447
- package/dist/{compiler-manifest-Dbov16F7.d.mts → compiler-manifest-BaJfE-5H.d.mts} +136 -10
- package/dist/{compiler-manifest-Dbov16F7.d.ts → compiler-manifest-BaJfE-5H.d.ts} +136 -10
- package/dist/index.d.mts +910 -155
- package/dist/index.d.ts +910 -155
- package/dist/index.js +550 -64
- package/dist/index.mjs +550 -64
- package/dist/install-integrity.json +193 -4
- package/dist/monitor-fleet-contract.d.mts +138 -0
- package/dist/monitor-fleet-contract.d.ts +138 -0
- package/dist/monitor-fleet-contract.js +404 -0
- package/dist/monitor-fleet-contract.mjs +367 -0
- package/dist/plays/bundle-play-file.d.mts +8 -3
- package/dist/plays/bundle-play-file.d.ts +8 -3
- package/dist/plays/bundle-play-file.mjs +100 -20
- package/dist/release.d.mts +255 -0
- package/dist/release.d.ts +255 -0
- package/dist/release.js +215 -0
- package/dist/release.mjs +188 -0
- package/package.json +23 -4
- /package/dist/bundling-sources/shared_libs/{integrations/bettercontact-execution-policy.ts → integration-contracts/bettercontact/execution-policy.ts} +0 -0
- /package/dist/bundling-sources/shared_libs/{integrations/theirstack-execution-policy.ts → integration-contracts/theirstack/execution-policy.ts} +0 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
EffectiveProductNotificationConfiguration,
|
|
3
|
+
EffectiveProductNotificationDestination,
|
|
4
|
+
EffectiveProductNotificationGroup,
|
|
5
|
+
EffectiveProductNotificationRule,
|
|
6
|
+
ProductNotificationConfigMode,
|
|
7
|
+
ProductNotificationDefaultDestination,
|
|
8
|
+
ProductNotificationDefaultGroup,
|
|
9
|
+
ProductNotificationDefaultRule,
|
|
10
|
+
ProductNotificationGroupDraft,
|
|
11
|
+
} from './configuration';
|
|
12
|
+
import { productNotificationValuesEqual } from './configuration';
|
|
13
|
+
import { normalizeProductNotificationEmailList } from './configuration';
|
|
14
|
+
export {
|
|
15
|
+
createProductNotificationRule,
|
|
16
|
+
type ProductNotificationPlayFailureSettings as PlayFailureOptions,
|
|
17
|
+
} from './catalog';
|
|
18
|
+
export type { ProductNotificationGroupDraft } from './configuration';
|
|
19
|
+
|
|
20
|
+
type WorkspaceOverride = {
|
|
21
|
+
configMode: ProductNotificationConfigMode;
|
|
22
|
+
defaultKey?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type ProductNotificationConfigurationOperation =
|
|
26
|
+
| {
|
|
27
|
+
kind: 'put_group';
|
|
28
|
+
group: ProductNotificationDefaultGroup &
|
|
29
|
+
Required<Pick<ProductNotificationDefaultGroup, 'deliveryTiming'>> &
|
|
30
|
+
WorkspaceOverride;
|
|
31
|
+
}
|
|
32
|
+
| { kind: 'remove_group'; groupKey: string }
|
|
33
|
+
| {
|
|
34
|
+
kind: 'put_rule';
|
|
35
|
+
rule: ProductNotificationDefaultRule &
|
|
36
|
+
Required<
|
|
37
|
+
Pick<
|
|
38
|
+
ProductNotificationDefaultRule,
|
|
39
|
+
'repeatMode' | 'conditionGeneration'
|
|
40
|
+
>
|
|
41
|
+
> &
|
|
42
|
+
WorkspaceOverride;
|
|
43
|
+
}
|
|
44
|
+
| { kind: 'remove_rule'; ruleKey: string }
|
|
45
|
+
| {
|
|
46
|
+
kind: 'put_destination';
|
|
47
|
+
destination: ProductNotificationDefaultDestination & WorkspaceOverride;
|
|
48
|
+
}
|
|
49
|
+
| { kind: 'remove_destination'; destinationKey: string };
|
|
50
|
+
|
|
51
|
+
/** Return the editable view of one effective group. */
|
|
52
|
+
export function getProductNotificationGroupDraft(
|
|
53
|
+
configuration: EffectiveProductNotificationConfiguration,
|
|
54
|
+
groupKey: string,
|
|
55
|
+
): ProductNotificationGroupDraft {
|
|
56
|
+
const group = configuration.groups.find(
|
|
57
|
+
(candidate) => candidate.groupKey === groupKey,
|
|
58
|
+
);
|
|
59
|
+
if (!group) throw new Error(`Unknown notification group ${groupKey}.`);
|
|
60
|
+
return {
|
|
61
|
+
group: { ...group },
|
|
62
|
+
destinations: configuration.destinations
|
|
63
|
+
.filter((destination) => destination.groupKey === groupKey)
|
|
64
|
+
.map((destination) => ({ ...destination })),
|
|
65
|
+
rules: configuration.rules
|
|
66
|
+
.filter((rule) => rule.groupKey === groupKey)
|
|
67
|
+
.map((rule) => ({ ...rule })),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Editing a synthetic default materializes its single sparse override. */
|
|
72
|
+
export function materializeProductNotificationRuleEdit(
|
|
73
|
+
saved: EffectiveProductNotificationConfiguration,
|
|
74
|
+
updated: EffectiveProductNotificationRule,
|
|
75
|
+
): EffectiveProductNotificationRule {
|
|
76
|
+
const inherited =
|
|
77
|
+
updated.configMode === 'default' &&
|
|
78
|
+
!saved.rules.some((rule) => rule.ruleKey === updated.ruleKey);
|
|
79
|
+
return inherited
|
|
80
|
+
? {
|
|
81
|
+
...updated,
|
|
82
|
+
source: 'workspace',
|
|
83
|
+
configMode: 'replace_default',
|
|
84
|
+
defaultKey: updated.ruleKey,
|
|
85
|
+
}
|
|
86
|
+
: updated;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function comparableGroup(group: EffectiveProductNotificationGroup) {
|
|
90
|
+
return {
|
|
91
|
+
name: group.name,
|
|
92
|
+
enabled: group.enabled,
|
|
93
|
+
deliveryTiming: group.deliveryTiming,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function comparableDestination(
|
|
98
|
+
destination: EffectiveProductNotificationDestination,
|
|
99
|
+
) {
|
|
100
|
+
return {
|
|
101
|
+
groupKey: destination.groupKey,
|
|
102
|
+
name: destination.name,
|
|
103
|
+
enabled: destination.enabled,
|
|
104
|
+
settings: destination.settings,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function comparableRule(rule: EffectiveProductNotificationRule) {
|
|
109
|
+
return {
|
|
110
|
+
groupKey: rule.groupKey,
|
|
111
|
+
enabled: rule.enabled,
|
|
112
|
+
notificationType: rule.notificationType,
|
|
113
|
+
eventName: rule.eventName,
|
|
114
|
+
eventFilter: rule.eventFilter,
|
|
115
|
+
trigger: rule.trigger,
|
|
116
|
+
repeatMode: rule.repeatMode,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function modeFor(item: {
|
|
121
|
+
configMode: EffectiveProductNotificationRule['configMode'];
|
|
122
|
+
}) {
|
|
123
|
+
return item.configMode === 'default' ? 'replace_default' : item.configMode;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function canonicalDestinationSettings(
|
|
127
|
+
settings: EffectiveProductNotificationDestination['settings'],
|
|
128
|
+
) {
|
|
129
|
+
if (settings.kind === 'slack') {
|
|
130
|
+
return {
|
|
131
|
+
...settings,
|
|
132
|
+
targetId: settings.targetId.trim(),
|
|
133
|
+
targetName: settings.targetName.trim(),
|
|
134
|
+
oauthConnectionId: settings.oauthConnectionId.trim(),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (settings.kind === 'email_roles') {
|
|
138
|
+
return {
|
|
139
|
+
...settings,
|
|
140
|
+
roles: [...new Set(settings.roles.map((role) => role.trim()))],
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
kind: settings.kind,
|
|
145
|
+
to: normalizeProductNotificationEmailList(settings.to, 'to'),
|
|
146
|
+
cc: settings.cc
|
|
147
|
+
? normalizeProductNotificationEmailList(settings.cc, 'cc')
|
|
148
|
+
: undefined,
|
|
149
|
+
bcc: settings.bcc
|
|
150
|
+
? normalizeProductNotificationEmailList(settings.bcc, 'bcc')
|
|
151
|
+
: undefined,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function canonicalGroupDraft(
|
|
156
|
+
draft: ProductNotificationGroupDraft,
|
|
157
|
+
): ProductNotificationGroupDraft {
|
|
158
|
+
return {
|
|
159
|
+
group: { ...draft.group, name: draft.group.name.trim() },
|
|
160
|
+
destinations: draft.destinations.map((destination) => ({
|
|
161
|
+
...destination,
|
|
162
|
+
name: destination.name.trim(),
|
|
163
|
+
settings: canonicalDestinationSettings(destination.settings),
|
|
164
|
+
})),
|
|
165
|
+
rules: draft.rules.map((rule) => ({
|
|
166
|
+
...rule,
|
|
167
|
+
eventFilter: Object.fromEntries(
|
|
168
|
+
Object.entries(rule.eventFilter).map(([key, value]) => [
|
|
169
|
+
key.trim(),
|
|
170
|
+
typeof value === 'string' ? value.trim() : value,
|
|
171
|
+
]),
|
|
172
|
+
),
|
|
173
|
+
})),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Build the smallest atomic operation list for one edited group. */
|
|
178
|
+
export function buildProductNotificationGroupOperations(
|
|
179
|
+
saved: EffectiveProductNotificationConfiguration,
|
|
180
|
+
draft: ProductNotificationGroupDraft,
|
|
181
|
+
): ProductNotificationConfigurationOperation[] {
|
|
182
|
+
draft = canonicalGroupDraft(draft);
|
|
183
|
+
for (const destination of draft.destinations) {
|
|
184
|
+
if (destination.groupKey !== draft.group.groupKey) {
|
|
185
|
+
throw new Error('Every destination must belong to the saved group.');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
for (const rule of draft.rules) {
|
|
189
|
+
if (rule.groupKey !== draft.group.groupKey) {
|
|
190
|
+
throw new Error('Every rule must belong to the saved group.');
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const operations: ProductNotificationConfigurationOperation[] = [];
|
|
194
|
+
const savedGroup = saved.groups.find(
|
|
195
|
+
(group) => group.groupKey === draft.group.groupKey,
|
|
196
|
+
);
|
|
197
|
+
if (
|
|
198
|
+
!savedGroup ||
|
|
199
|
+
!productNotificationValuesEqual(
|
|
200
|
+
comparableGroup(savedGroup),
|
|
201
|
+
comparableGroup(draft.group),
|
|
202
|
+
)
|
|
203
|
+
) {
|
|
204
|
+
operations.push({
|
|
205
|
+
kind: 'put_group',
|
|
206
|
+
group: {
|
|
207
|
+
groupKey: draft.group.groupKey,
|
|
208
|
+
name: draft.group.name,
|
|
209
|
+
enabled: draft.group.enabled,
|
|
210
|
+
deliveryTiming: draft.group.deliveryTiming,
|
|
211
|
+
configMode: modeFor(draft.group),
|
|
212
|
+
...(draft.group.configMode === 'default'
|
|
213
|
+
? { defaultKey: draft.group.groupKey }
|
|
214
|
+
: draft.group.defaultKey
|
|
215
|
+
? { defaultKey: draft.group.defaultKey }
|
|
216
|
+
: {}),
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const savedDestinations = saved.destinations.filter(
|
|
222
|
+
(destination) => destination.groupKey === draft.group.groupKey,
|
|
223
|
+
);
|
|
224
|
+
for (const destination of savedDestinations) {
|
|
225
|
+
if (
|
|
226
|
+
draft.destinations.some(
|
|
227
|
+
(candidate) => candidate.destinationKey === destination.destinationKey,
|
|
228
|
+
)
|
|
229
|
+
)
|
|
230
|
+
continue;
|
|
231
|
+
if (
|
|
232
|
+
destination.configMode === 'default' ||
|
|
233
|
+
destination.configMode === 'replace_default'
|
|
234
|
+
) {
|
|
235
|
+
operations.push({
|
|
236
|
+
kind: 'put_destination',
|
|
237
|
+
destination: {
|
|
238
|
+
destinationKey: destination.destinationKey,
|
|
239
|
+
groupKey: destination.groupKey,
|
|
240
|
+
name: destination.name,
|
|
241
|
+
enabled: false,
|
|
242
|
+
settings: destination.settings,
|
|
243
|
+
configMode: 'disable_default',
|
|
244
|
+
defaultKey: destination.destinationKey,
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
} else {
|
|
248
|
+
operations.push({
|
|
249
|
+
kind: 'remove_destination',
|
|
250
|
+
destinationKey: destination.destinationKey,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
for (const destination of draft.destinations) {
|
|
255
|
+
const previous = savedDestinations.find(
|
|
256
|
+
(candidate) => candidate.destinationKey === destination.destinationKey,
|
|
257
|
+
);
|
|
258
|
+
if (
|
|
259
|
+
previous &&
|
|
260
|
+
productNotificationValuesEqual(
|
|
261
|
+
comparableDestination(previous),
|
|
262
|
+
comparableDestination(destination),
|
|
263
|
+
)
|
|
264
|
+
)
|
|
265
|
+
continue;
|
|
266
|
+
operations.push({
|
|
267
|
+
kind: 'put_destination',
|
|
268
|
+
destination: {
|
|
269
|
+
destinationKey: destination.destinationKey,
|
|
270
|
+
groupKey: destination.groupKey,
|
|
271
|
+
name: destination.name,
|
|
272
|
+
enabled: destination.enabled,
|
|
273
|
+
settings: destination.settings,
|
|
274
|
+
configMode: modeFor(destination),
|
|
275
|
+
...(destination.configMode === 'default'
|
|
276
|
+
? { defaultKey: destination.destinationKey }
|
|
277
|
+
: destination.defaultKey
|
|
278
|
+
? { defaultKey: destination.defaultKey }
|
|
279
|
+
: {}),
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const savedRules = saved.rules.filter(
|
|
285
|
+
(rule) => rule.groupKey === draft.group.groupKey,
|
|
286
|
+
);
|
|
287
|
+
for (const rule of savedRules) {
|
|
288
|
+
if (draft.rules.some((candidate) => candidate.ruleKey === rule.ruleKey))
|
|
289
|
+
continue;
|
|
290
|
+
if (
|
|
291
|
+
rule.configMode === 'default' ||
|
|
292
|
+
rule.configMode === 'replace_default'
|
|
293
|
+
) {
|
|
294
|
+
operations.push({
|
|
295
|
+
kind: 'put_rule',
|
|
296
|
+
rule: {
|
|
297
|
+
ruleKey: rule.ruleKey,
|
|
298
|
+
groupKey: rule.groupKey,
|
|
299
|
+
enabled: false,
|
|
300
|
+
notificationType: rule.notificationType,
|
|
301
|
+
eventName: rule.eventName,
|
|
302
|
+
eventFilter: rule.eventFilter,
|
|
303
|
+
trigger: rule.trigger,
|
|
304
|
+
repeatMode: rule.repeatMode,
|
|
305
|
+
conditionGeneration: rule.conditionGeneration,
|
|
306
|
+
configMode: 'disable_default',
|
|
307
|
+
defaultKey: rule.ruleKey,
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
} else {
|
|
311
|
+
operations.push({ kind: 'remove_rule', ruleKey: rule.ruleKey });
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
for (const rule of draft.rules) {
|
|
315
|
+
const previous = savedRules.find(
|
|
316
|
+
(candidate) => candidate.ruleKey === rule.ruleKey,
|
|
317
|
+
);
|
|
318
|
+
if (
|
|
319
|
+
previous &&
|
|
320
|
+
productNotificationValuesEqual(
|
|
321
|
+
comparableRule(previous),
|
|
322
|
+
comparableRule(rule),
|
|
323
|
+
)
|
|
324
|
+
)
|
|
325
|
+
continue;
|
|
326
|
+
if (!previous && rule.configMode === 'default') {
|
|
327
|
+
operations.push({ kind: 'remove_rule', ruleKey: rule.ruleKey });
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
operations.push({
|
|
331
|
+
kind: 'put_rule',
|
|
332
|
+
rule: {
|
|
333
|
+
ruleKey: rule.ruleKey,
|
|
334
|
+
groupKey: rule.groupKey,
|
|
335
|
+
enabled: rule.enabled,
|
|
336
|
+
notificationType: rule.notificationType,
|
|
337
|
+
eventName: rule.eventName,
|
|
338
|
+
eventFilter: rule.eventFilter,
|
|
339
|
+
trigger: rule.trigger,
|
|
340
|
+
repeatMode: rule.repeatMode,
|
|
341
|
+
conditionGeneration: rule.conditionGeneration,
|
|
342
|
+
configMode: modeFor(rule),
|
|
343
|
+
...(rule.configMode === 'default'
|
|
344
|
+
? { defaultKey: rule.ruleKey }
|
|
345
|
+
: rule.defaultKey
|
|
346
|
+
? { defaultKey: rule.defaultKey }
|
|
347
|
+
: {}),
|
|
348
|
+
},
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (savedGroup?.configMode === 'default' && operations.length > 0) {
|
|
353
|
+
if (!operations.some((operation) => operation.kind === 'put_group')) {
|
|
354
|
+
operations.unshift({
|
|
355
|
+
kind: 'put_group',
|
|
356
|
+
group: {
|
|
357
|
+
groupKey: draft.group.groupKey,
|
|
358
|
+
name: draft.group.name,
|
|
359
|
+
enabled: draft.group.enabled,
|
|
360
|
+
deliveryTiming: draft.group.deliveryTiming,
|
|
361
|
+
configMode: 'replace_default',
|
|
362
|
+
defaultKey: draft.group.groupKey,
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
for (const destination of draft.destinations) {
|
|
367
|
+
if (
|
|
368
|
+
destination.configMode !== 'default' ||
|
|
369
|
+
operations.some(
|
|
370
|
+
(operation) =>
|
|
371
|
+
(operation.kind === 'put_destination' &&
|
|
372
|
+
operation.destination.destinationKey ===
|
|
373
|
+
destination.destinationKey) ||
|
|
374
|
+
(operation.kind === 'remove_destination' &&
|
|
375
|
+
operation.destinationKey === destination.destinationKey),
|
|
376
|
+
)
|
|
377
|
+
)
|
|
378
|
+
continue;
|
|
379
|
+
operations.push({
|
|
380
|
+
kind: 'put_destination',
|
|
381
|
+
destination: {
|
|
382
|
+
destinationKey: destination.destinationKey,
|
|
383
|
+
groupKey: destination.groupKey,
|
|
384
|
+
name: destination.name,
|
|
385
|
+
enabled: destination.enabled,
|
|
386
|
+
settings: destination.settings,
|
|
387
|
+
configMode: 'replace_default',
|
|
388
|
+
defaultKey: destination.destinationKey,
|
|
389
|
+
},
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
for (const rule of draft.rules) {
|
|
393
|
+
if (
|
|
394
|
+
rule.configMode !== 'default' ||
|
|
395
|
+
operations.some(
|
|
396
|
+
(operation) =>
|
|
397
|
+
(operation.kind === 'put_rule' &&
|
|
398
|
+
operation.rule.ruleKey === rule.ruleKey) ||
|
|
399
|
+
(operation.kind === 'remove_rule' &&
|
|
400
|
+
operation.ruleKey === rule.ruleKey),
|
|
401
|
+
)
|
|
402
|
+
)
|
|
403
|
+
continue;
|
|
404
|
+
operations.push({
|
|
405
|
+
kind: 'put_rule',
|
|
406
|
+
rule: {
|
|
407
|
+
ruleKey: rule.ruleKey,
|
|
408
|
+
groupKey: rule.groupKey,
|
|
409
|
+
enabled: rule.enabled,
|
|
410
|
+
notificationType: rule.notificationType,
|
|
411
|
+
eventName: rule.eventName,
|
|
412
|
+
eventFilter: rule.eventFilter,
|
|
413
|
+
trigger: rule.trigger,
|
|
414
|
+
repeatMode: rule.repeatMode,
|
|
415
|
+
conditionGeneration: rule.conditionGeneration,
|
|
416
|
+
configMode: 'replace_default',
|
|
417
|
+
defaultKey: rule.ruleKey,
|
|
418
|
+
},
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
return operations;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export function productNotificationGroupDraftHasChanges(
|
|
426
|
+
saved: EffectiveProductNotificationConfiguration,
|
|
427
|
+
draft: ProductNotificationGroupDraft,
|
|
428
|
+
) {
|
|
429
|
+
return buildProductNotificationGroupOperations(saved, draft).length > 0;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/** Delete a custom group and its children in dependency order. */
|
|
433
|
+
export function buildProductNotificationGroupDeletionOperations(
|
|
434
|
+
saved: EffectiveProductNotificationConfiguration,
|
|
435
|
+
groupKey: string,
|
|
436
|
+
): ProductNotificationConfigurationOperation[] {
|
|
437
|
+
const group = saved.groups.find(
|
|
438
|
+
(candidate) => candidate.groupKey === groupKey,
|
|
439
|
+
);
|
|
440
|
+
if (!group) return [];
|
|
441
|
+
if (group.configMode !== 'custom') {
|
|
442
|
+
throw new Error('The default notification group cannot be deleted.');
|
|
443
|
+
}
|
|
444
|
+
return [
|
|
445
|
+
...saved.rules
|
|
446
|
+
.filter((rule) => rule.groupKey === groupKey)
|
|
447
|
+
.map((rule) => ({ kind: 'remove_rule' as const, ruleKey: rule.ruleKey })),
|
|
448
|
+
...saved.destinations
|
|
449
|
+
.filter((destination) => destination.groupKey === groupKey)
|
|
450
|
+
.map((destination) => ({
|
|
451
|
+
kind: 'remove_destination' as const,
|
|
452
|
+
destinationKey: destination.destinationKey,
|
|
453
|
+
})),
|
|
454
|
+
{ kind: 'remove_group' as const, groupKey },
|
|
455
|
+
];
|
|
456
|
+
}
|