@cat-factory/contracts 0.267.0 → 0.268.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/errors.d.ts CHANGED
@@ -29,7 +29,7 @@ export type ApiErrorCode = (typeof API_ERROR_CODES)[number];
29
29
  * type for `ConflictError`, and the SPA keys an exhaustive `Record<ConflictReason, …>` of
30
30
  * localized titles off it — adding a value without a title trips the frontend typecheck.
31
31
  */
32
- export declare const CONFLICT_REASONS: readonly ['providers_unconfigured', 'preset_unsatisfiable', 'dependencies_unmet', 'task_limit_reached', 'tester_infra_unsupported', 'binary_storage_unconfigured', 'agent_backend_unconfigured', 'run_not_retryable', 'no_pr_to_merge', 'dry_run_not_mergeable', 'submission_not_allowed', 'github_not_connected', 'bootstrap_not_retryable', 'bootstrap_reference_missing', 'document_already_linked', 'provision_type_unhandled', 'visual_pipeline_no_frontend', 'model_policy_blocked', 'model_policy_unsupported', 'deployer_required_before_tester', 'deployer_service_provisioning_incomplete', 'deployer_connection_test_failed', 'env_test_not_a_frame', 'env_test_infraless', 'env_test_not_provisionable', 'env_test_no_vcs', 'env_test_connection_failed', 'review_debt_warn', 'review_debt_blocked', 'prompt_revision_conflict', 'pipeline_schedule_attached', 'pipeline_schedule_requires_recurring', 'pipeline_schedule_intake_unconfigured', 'foundational_service_exists', 'binary_output_service_invalid', 'binary_output_generator_invalid', 'foundational_service_not_inherited', 'ticket_already_linked', 'input_gate_not_parked', 'input_gate_parked'];
32
+ export declare const CONFLICT_REASONS: readonly ['providers_unconfigured', 'preset_unsatisfiable', 'dependencies_unmet', 'task_limit_reached', 'webhook_limit_reached', 'tester_infra_unsupported', 'binary_storage_unconfigured', 'agent_backend_unconfigured', 'run_not_retryable', 'no_pr_to_merge', 'dry_run_not_mergeable', 'submission_not_allowed', 'github_not_connected', 'bootstrap_not_retryable', 'bootstrap_reference_missing', 'document_already_linked', 'provision_type_unhandled', 'visual_pipeline_no_frontend', 'model_policy_blocked', 'model_policy_unsupported', 'deployer_required_before_tester', 'deployer_service_provisioning_incomplete', 'deployer_connection_test_failed', 'env_test_not_a_frame', 'env_test_infraless', 'env_test_not_provisionable', 'env_test_no_vcs', 'env_test_connection_failed', 'review_debt_warn', 'review_debt_blocked', 'prompt_revision_conflict', 'pipeline_schedule_attached', 'pipeline_schedule_requires_recurring', 'pipeline_schedule_intake_unconfigured', 'foundational_service_exists', 'binary_output_service_invalid', 'binary_output_generator_invalid', 'foundational_service_not_inherited', 'ticket_already_linked', 'input_gate_not_parked', 'input_gate_parked'];
33
33
  export type ConflictReason = (typeof CONFLICT_REASONS)[number];
34
34
  /**
35
35
  * Machine-readable reasons behind a 503 (`error.details.reason` on an `UnavailableError`), for
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,YAC7B,WAAW,EACX,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,cAAc,EACd,cAAc,CACN,CAAA;AAEV,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjE;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,iJAA+C,CAAA;AAE3E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,YAC3B,wBAAwB,EAKxB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,EAKhB,uBAAuB,EAOvB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,EACzB,6BAA6B,EAK7B,yBAAyB,EAGzB,0BAA0B,EAG1B,6BAA6B,EAG7B,sBAAsB,EAGtB,0BAA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
48
  'task_limit_reached',
49
+ // The workspace already has as many outbound notification webhooks as it may register
50
+ // (`MAX_NOTIFICATION_WEBHOOKS_PER_WORKSPACE`), so registering ANOTHER one is refused; editing or
51
+ // removing an existing endpoint still works, which is the remedy. `details.limit` carries the
52
+ // cap. Kept apart from `task_limit_reached` because nothing here clears on its own: waiting does
53
+ // not help, an operator has to remove a receiver they no longer want.
54
+ 'webhook_limit_reached',
49
55
  'tester_infra_unsupported',
50
56
  'binary_storage_unconfigured',
51
57
  'agent_backend_unconfigured',
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,WAAW;IACX,YAAY;IACZ,UAAU;IACV,qBAAqB;IACrB,WAAW;IACX,aAAa;IACb,cAAc;IACd,cAAc;CACN,CAAA;AAIV;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAG,kBAAkB,EAAE,UAAU,CAAU,CAAA;AAI3E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,wBAAwB;IACxB,8FAA8F;IAC9F,4FAA4F;IAC5F,+FAA+F;IAC/F,8EAA8E;IAC9E,sBAAsB;IACtB,oBAAoB;IACpB,oBAAoB;IACpB,0BAA0B;IAC1B,6BAA6B;IAC7B,4BAA4B;IAC5B,mBAAmB;IACnB,gBAAgB;IAChB,6FAA6F;IAC7F,uFAAuF;IACvF,4FAA4F;IAC5F,0BAA0B;IAC1B,uBAAuB;IACvB,6FAA6F;IAC7F,4EAA4E;IAC5E,6FAA6F;IAC7F,8FAA8F;IAC9F,+FAA+F;IAC/F,oCAAoC;IACpC,wBAAwB;IACxB,sBAAsB;IACtB,yBAAyB;IACzB,6BAA6B;IAC7B,2FAA2F;IAC3F,2FAA2F;IAC3F,4FAA4F;IAC5F,0FAA0F;IAC1F,y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AA+F;IAC/F,4EAA4E;IAC5E,EAAE;IACF,2FAA2F;IAC3F,iGAAiG;IACjG,4FAA4F;IAC5F,sEAAsE;IACtE,mBAAmB;CACX,CAAA;AAIV;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,+BAA+B;IAC/B,mCAAmC;CAC3B,CAAA;AAIV;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,qBAAqB,EAAE,yBAAyB,CAAU,CAAA"}
@@ -1,4 +1,27 @@
1
1
  import * as v from 'valibot';
2
+ /**
3
+ * The id of the endpoint the SINGULAR routes address. Registering through
4
+ * `PUT /api/v1/notification-webhook` writes this id, and it appears in the collection like any
5
+ * other entry, so the two surfaces describe one store rather than two.
6
+ */
7
+ export declare const DEFAULT_NOTIFICATION_WEBHOOK_ID = "default";
8
+ /**
9
+ * How many endpoints one workspace may register. Every delivery fans out to every subscribed
10
+ * endpoint on a run's terminal path, so the set has to be bounded by something other than an
11
+ * operator's patience; ten is well above the "one receiver per integration" the collection exists
12
+ * to serve. Exceeding it is a 409 with `reason: 'webhook_limit_reached'`.
13
+ */
14
+ export declare const MAX_NOTIFICATION_WEBHOOKS_PER_WORKSPACE = 10;
15
+ /**
16
+ * A webhook's id: CALLER-CHOSEN, not server-minted, which is what makes enrolment idempotent for
17
+ * the consumer that needs it most. A gatekeeper Worker booting cold can `PUT` its own well-known
18
+ * id and be enrolled whether or not it has ever run before, with no id table of its own and no
19
+ * create-or-discover dance against a surface it may be racing another instance on.
20
+ *
21
+ * Constrained to a lowercase slug because it is a path segment on both management surfaces and an
22
+ * operator reads it in a log line beside the endpoint's URL.
23
+ */
24
+ export declare const notificationWebhookIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "A webhook id must be 1-63 characters of lowercase letters, digits, `-` or `_`, starting with a letter or digit">]>;
2
25
  /**
3
26
  * The RUN-LIFECYCLE events the same endpoint can subscribe to: the ordinary lifecycle of work an
4
27
  * integration queued, none of which raises a notification. A task whose pipeline carries a
@@ -28,6 +51,13 @@ export declare const platformAlertEventSchema: v.PicklistSchema<["platform_healt
28
51
  export type PlatformAlertEventName = v.InferOutput<typeof platformAlertEventSchema>;
29
52
  /** A workspace's registered notification webhook, as exposed to clients (never the secret). */
30
53
  export declare const notificationWebhookSchema: v.ObjectSchema<{
54
+ /**
55
+ * Which endpoint this is, within the workspace. `default` is the one the singular
56
+ * `/api/v1/notification-webhook` routes address.
57
+ */
58
+ readonly id: v.StringSchema<undefined>;
59
+ /** An operator-facing label. Defaults to the id when a registration supplies none. */
60
+ readonly name: v.StringSchema<undefined>;
31
61
  /** The HTTPS endpoint deliveries are POSTed to. */
32
62
  readonly url: v.StringSchema<undefined>;
33
63
  /**
@@ -74,6 +104,8 @@ export type NotificationWebhook = v.InferOutput<typeof notificationWebhookSchema
74
104
  export declare const putNotificationWebhookSchema: v.ObjectSchema<{
75
105
  /** Omit ⇒ keep the registered endpoint (required only when registering the first one). */
76
106
  readonly url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.UrlAction<string, undefined>, v.StartsWithAction<string, "https://", "The webhook endpoint must be an https:// URL">, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
107
+ /** Omit ⇒ keep the stored label (the endpoint's id, for a registration that named none). */
108
+ readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>, undefined>;
77
109
  /** Omit ⇒ deliver the default parking types. */
78
110
  readonly types: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>, undefined>;
79
111
  /** Omit ⇒ keep the current run-event subscription (none, for an endpoint that never set one). */
@@ -86,8 +118,13 @@ export declare const putNotificationWebhookSchema: v.ObjectSchema<{
86
118
  }, undefined>;
87
119
  export type PutNotificationWebhookInput = v.InferOutput<typeof putNotificationWebhookSchema>;
88
120
  /**
89
- * What `GET /api/v1/notification-webhook` answers: the registered endpoint, or `null` when the
90
- * workspace has none. Both the session surface and the public one project the SAME
121
+ * What `GET /api/v1/notification-webhook` and `GET /api/v1/notification-webhooks/:webhookId`
122
+ * answer: the addressed endpoint, or `null` when none is registered under that id. A 404 would be
123
+ * the conventional answer for the second one and is deliberately not used: "am I already wired
124
+ * up?" is the call an integration makes at startup, and it should read one response shape rather
125
+ * than branch on a status this surface also uses for a mistyped path.
126
+ *
127
+ * Both the session surface and the public one project the SAME
91
128
  * {@link notificationWebhookSchema}, because the projection is already the client-facing shape
92
129
  * with the secret reduced to a boolean, and a second near-identical DTO would be one more thing
93
130
  * to keep in step for no caller-visible gain.
@@ -102,6 +139,13 @@ export type PutNotificationWebhookInput = v.InferOutput<typeof putNotificationWe
102
139
  export declare const publicNotificationWebhookSchema: v.ObjectSchema<{
103
140
  /** The registered endpoint, or `null` when the workspace has none. */
104
141
  readonly webhook: v.NullableSchema<v.ObjectSchema<{
142
+ /**
143
+ * Which endpoint this is, within the workspace. `default` is the one the singular
144
+ * `/api/v1/notification-webhook` routes address.
145
+ */
146
+ readonly id: v.StringSchema<undefined>;
147
+ /** An operator-facing label. Defaults to the id when a registration supplies none. */
148
+ readonly name: v.StringSchema<undefined>;
105
149
  /** The HTTPS endpoint deliveries are POSTed to. */
106
150
  readonly url: v.StringSchema<undefined>;
107
151
  /**
@@ -129,6 +173,52 @@ export declare const publicNotificationWebhookSchema: v.ObjectSchema<{
129
173
  }, undefined>, undefined>;
130
174
  }, undefined>;
131
175
  export type PublicNotificationWebhook = v.InferOutput<typeof publicNotificationWebhookSchema>;
176
+ /**
177
+ * What `GET /api/v1/notification-webhooks` answers: every endpoint the workspace has registered,
178
+ * ordered by id so two reads of an unchanged workspace agree.
179
+ *
180
+ * Deliberately NOT paginated, unlike every other public list. Paging exists to bound a set the
181
+ * platform cannot bound itself, and this one is bounded at
182
+ * {@link MAX_NOTIFICATION_WEBHOOKS_PER_WORKSPACE} by the write path: a cursor here would hand
183
+ * every client a loop to write for a set that fits in one response by construction, and would
184
+ * quietly become the reason nobody noticed the cap had been raised.
185
+ */
186
+ export declare const publicNotificationWebhookListSchema: v.ObjectSchema<{
187
+ readonly webhooks: v.ArraySchema<v.ObjectSchema<{
188
+ /**
189
+ * Which endpoint this is, within the workspace. `default` is the one the singular
190
+ * `/api/v1/notification-webhook` routes address.
191
+ */
192
+ readonly id: v.StringSchema<undefined>;
193
+ /** An operator-facing label. Defaults to the id when a registration supplies none. */
194
+ readonly name: v.StringSchema<undefined>;
195
+ /** The HTTPS endpoint deliveries are POSTed to. */
196
+ readonly url: v.StringSchema<undefined>;
197
+ /**
198
+ * Which notification types are delivered. EMPTY means "the parking types" — the defaults a
199
+ * headless overseer cares about — rather than "everything", so registering an endpoint can't
200
+ * accidentally fire-hose every card at an integration that only wanted to hear about parks.
201
+ */
202
+ readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
203
+ /**
204
+ * Which run-lifecycle events are delivered. EMPTY means NONE — the opposite of `types` above,
205
+ * deliberately: an endpoint registered before this existed must not start receiving a new event
206
+ * family it never asked for, so subscribing is explicit.
207
+ */
208
+ readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
209
+ /**
210
+ * Which platform-health transitions are delivered. EMPTY means NONE, like {@link runEvents}:
211
+ * subscribing a receiver to alerts about the deployment itself is always an explicit choice.
212
+ */
213
+ readonly alertEvents: v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>;
214
+ /** Whether deliveries are currently attempted. Registering an endpoint enables it. */
215
+ readonly enabled: v.BooleanSchema<undefined>;
216
+ /** Whether a signing secret is set (the secret itself is never returned). */
217
+ readonly hasSecret: v.BooleanSchema<undefined>;
218
+ readonly updatedAt: v.NumberSchema<undefined>;
219
+ }, undefined>, undefined>;
220
+ }, undefined>;
221
+ export type PublicNotificationWebhookList = v.InferOutput<typeof publicNotificationWebhookListSchema>;
132
222
  /**
133
223
  * The JSON body of one webhook delivery. Deliberately a thin envelope over the SAME
134
224
  * `notificationSchema` the in-app inbox and the public `GET /api/v1/notifications` already expose
@@ -1 +1 @@
1
- {"version":3,"file":"notification-webhooks.d.ts","sourceRoot":"","sources":["../src/notification-webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAoB5B;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,6EAA6D,CAAA;AACjG,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEjF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,qFAGnC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEnF,+FAA+F;AAC/F,eAAO,MAAM,yBAAyB;IACpC,mDAAmD;;IAEnD;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH,sFAAsF;;IAEtF,6EAA6E;;;aAG7E,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEjF;;;;;;;;;;;;;;;;GAgBG;AACH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AkG;;;;;;QAMhG,8FAA8F;;;;;QAK9F,sFAAsF;;;QAGtF;;;WAGG;;QAEH,oCAAoC;;;;;;;aAStC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mCAAmC;IAC9C,oEAAoE;;IAEpE,6FAA6F;;IAE7F,8EAA8E;;IAE9E;;;;;OAKG;;aAEH,CAAA;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,WAAW,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,kCAAkC;;IAE7C,kGAAkG;;;;;QAKhG;;;WAGG;;QAEH;;;;WAIG;;QAEH;;;WAGG;;YArEL,oEAAoE;;YAEpE,6FAA6F;;YAE7F,8EAA8E;;YAE9E;;;;;eAKG;;;QA4DD;;;;WAIG;;QAEH;;;;;WAKG;;;;;;;QAEH;;;;WAIG;;;aAGL,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAEnG;;;;;;;;;GASG;AACH,eAAO,MAAM,kCAAkC,kKAS6B,CAAA"}
@@ -2,8 +2,8 @@ import * as v from 'valibot';
2
2
  import { notificationSchema, notificationTypeSchema } from './notifications.js';
3
3
  import { platformFailingRunSchema } from './observability.js';
4
4
  // ---------------------------------------------------------------------------
5
- // Notification-webhook wire contracts. A workspace can register ONE outbound HTTPS endpoint that
6
- // receives its notifications as they are raised — the delivery channel a HEADLESS integration
5
+ // Notification-webhook wire contracts. A workspace registers outbound HTTPS endpoints that
6
+ // receive its notifications as they are raised — the delivery channel a HEADLESS integration
7
7
  // needs, since it has no in-app inbox to watch and no browser to hold a WebSocket open.
8
8
  //
9
9
  // This is a `NotificationChannel` like the in-app and Slack channels, composed into the same
@@ -15,7 +15,39 @@ import { platformFailingRunSchema } from './observability.js';
15
15
  // The endpoint's `secret` is write-only on the wire: it is stored encrypted and never read back,
16
16
  // exactly like the other outbound credentials. Deliveries are signed with it so a receiver can
17
17
  // verify the payload really came from this deployment.
18
+ //
19
+ // A workspace may register SEVERAL named endpoints, each with its own secret and its own filters,
20
+ // addressed by a caller-chosen {@link notificationWebhookIdSchema}. The original singular routes
21
+ // (`/api/v1/notification-webhook`) are a projection onto the one id
22
+ // {@link DEFAULT_NOTIFICATION_WEBHOOK_ID}, so a consumer written before the collection existed
23
+ // keeps addressing exactly the endpoint it always did.
18
24
  // ---------------------------------------------------------------------------
25
+ /**
26
+ * The id of the endpoint the SINGULAR routes address. Registering through
27
+ * `PUT /api/v1/notification-webhook` writes this id, and it appears in the collection like any
28
+ * other entry, so the two surfaces describe one store rather than two.
29
+ */
30
+ export const DEFAULT_NOTIFICATION_WEBHOOK_ID = 'default';
31
+ /**
32
+ * How many endpoints one workspace may register. Every delivery fans out to every subscribed
33
+ * endpoint on a run's terminal path, so the set has to be bounded by something other than an
34
+ * operator's patience; ten is well above the "one receiver per integration" the collection exists
35
+ * to serve. Exceeding it is a 409 with `reason: 'webhook_limit_reached'`.
36
+ */
37
+ export const MAX_NOTIFICATION_WEBHOOKS_PER_WORKSPACE = 10;
38
+ /**
39
+ * A webhook's id: CALLER-CHOSEN, not server-minted, which is what makes enrolment idempotent for
40
+ * the consumer that needs it most. A gatekeeper Worker booting cold can `PUT` its own well-known
41
+ * id and be enrolled whether or not it has ever run before, with no id table of its own and no
42
+ * create-or-discover dance against a surface it may be racing another instance on.
43
+ *
44
+ * Constrained to a lowercase slug because it is a path segment on both management surfaces and an
45
+ * operator reads it in a log line beside the endpoint's URL.
46
+ */
47
+ export const notificationWebhookIdSchema = v.pipe(v.string(),
48
+ // Deliberately NOT trimmed, unlike the body strings beside it. Trimming would admit `" ci "` and
49
+ // then store `ci`, so the id a caller PUT and the id it must address afterwards would differ.
50
+ v.regex(/^[a-z0-9][a-z0-9_-]{0,62}$/u, 'A webhook id must be 1-63 characters of lowercase letters, digits, `-` or `_`, starting with a letter or digit'));
19
51
  /**
20
52
  * The RUN-LIFECYCLE events the same endpoint can subscribe to: the ordinary lifecycle of work an
21
53
  * integration queued, none of which raises a notification. A task whose pipeline carries a
@@ -46,6 +78,13 @@ export const platformAlertEventSchema = v.picklist([
46
78
  ]);
47
79
  /** A workspace's registered notification webhook, as exposed to clients (never the secret). */
48
80
  export const notificationWebhookSchema = v.object({
81
+ /**
82
+ * Which endpoint this is, within the workspace. `default` is the one the singular
83
+ * `/api/v1/notification-webhook` routes address.
84
+ */
85
+ id: v.string(),
86
+ /** An operator-facing label. Defaults to the id when a registration supplies none. */
87
+ name: v.string(),
49
88
  /** The HTTPS endpoint deliveries are POSTed to. */
50
89
  url: v.string(),
51
90
  /**
@@ -91,6 +130,8 @@ export const notificationWebhookSchema = v.object({
91
130
  export const putNotificationWebhookSchema = v.object({
92
131
  /** Omit ⇒ keep the registered endpoint (required only when registering the first one). */
93
132
  url: v.optional(v.pipe(v.string(), v.trim(), v.url(), v.startsWith('https://', 'The webhook endpoint must be an https:// URL'), v.maxLength(2000))),
133
+ /** Omit ⇒ keep the stored label (the endpoint's id, for a registration that named none). */
134
+ name: v.optional(v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(100))),
94
135
  /** Omit ⇒ deliver the default parking types. */
95
136
  types: v.optional(v.array(notificationTypeSchema)),
96
137
  /** Omit ⇒ keep the current run-event subscription (none, for an endpoint that never set one). */
@@ -102,8 +143,13 @@ export const putNotificationWebhookSchema = v.object({
102
143
  secret: v.optional(v.pipe(v.string(), v.trim(), v.minLength(16), v.maxLength(200))),
103
144
  });
104
145
  /**
105
- * What `GET /api/v1/notification-webhook` answers: the registered endpoint, or `null` when the
106
- * workspace has none. Both the session surface and the public one project the SAME
146
+ * What `GET /api/v1/notification-webhook` and `GET /api/v1/notification-webhooks/:webhookId`
147
+ * answer: the addressed endpoint, or `null` when none is registered under that id. A 404 would be
148
+ * the conventional answer for the second one and is deliberately not used: "am I already wired
149
+ * up?" is the call an integration makes at startup, and it should read one response shape rather
150
+ * than branch on a status this surface also uses for a mistyped path.
151
+ *
152
+ * Both the session surface and the public one project the SAME
107
153
  * {@link notificationWebhookSchema}, because the projection is already the client-facing shape
108
154
  * with the secret reduced to a boolean, and a second near-identical DTO would be one more thing
109
155
  * to keep in step for no caller-visible gain.
@@ -119,6 +165,19 @@ export const publicNotificationWebhookSchema = v.object({
119
165
  /** The registered endpoint, or `null` when the workspace has none. */
120
166
  webhook: v.nullable(notificationWebhookSchema),
121
167
  });
168
+ /**
169
+ * What `GET /api/v1/notification-webhooks` answers: every endpoint the workspace has registered,
170
+ * ordered by id so two reads of an unchanged workspace agree.
171
+ *
172
+ * Deliberately NOT paginated, unlike every other public list. Paging exists to bound a set the
173
+ * platform cannot bound itself, and this one is bounded at
174
+ * {@link MAX_NOTIFICATION_WEBHOOKS_PER_WORKSPACE} by the write path: a cursor here would hand
175
+ * every client a loop to write for a set that fits in one response by construction, and would
176
+ * quietly become the reason nobody noticed the cap had been raised.
177
+ */
178
+ export const publicNotificationWebhookListSchema = v.object({
179
+ webhooks: v.array(notificationWebhookSchema),
180
+ });
122
181
  /**
123
182
  * The JSON body of one webhook delivery. Deliberately a thin envelope over the SAME
124
183
  * `notificationSchema` the in-app inbox and the public `GET /api/v1/notifications` already expose
@@ -1 +1 @@
1
- {"version":3,"file":"notification-webhooks.js","sourceRoot":"","sources":["../src/notification-webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,8EAA8E;AAC9E,iGAAiG;AACjG,8FAA8F;AAC9F,wFAAwF;AACxF,EAAE;AACF,6FAA6F;AAC7F,6FAA6F;AAC7F,6FAA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EAAE;IAClB,6FAA6F;IAC7F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,8EAA8E;IAC9E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB;;;;;OAKG;IACH,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC7B,CAAC,CAAA;AAKF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,kGAAkG;IAClG,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,wBAAwB;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd;;;WAGG;QACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB;;;;WAIG;QACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB;;;WAGG;QACH,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,mCAAmC,CAAC;QACxD;;;;WAIG;QACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB;;;;;WAKG;QACH,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;QAC9C;;;;WAIG;QACH,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACpC,CAAC;CACH,CAAC,CAAA;AAGF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,oBAAoB;IACpB,gBAAgB;IAChB,mBAAmB;IACnB,uBAAuB;IACvB,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,aAAa;CAC6D,CAAA"}
1
+ {"version":3,"file":"notification-webhooks.js","sourceRoot":"","sources":["../src/notification-webhooks.ts"],"names":[],"mappings":"A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IAC7F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,8EAA8E;IAC9E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB;;;;;OAKG;IACH,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC7B,CAAC,CAAA;AAKF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,kGAAkG;IAClG,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,wBAAwB;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd;;;WAGG;QACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB;;;;WAIG;QACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB;;;WAGG;QACH,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,mCAAmC,CAAC;QACxD;;;;WAIG;QACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB;;;;;WAKG;QACH,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;QAC9C;;;;WAIG;QACH,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACpC,CAAC;CACH,CAAC,CAAA;AAGF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,oBAAoB;IACpB,gBAAgB;IAChB,mBAAmB;IACnB,uBAAuB;IACvB,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,aAAa;CAC6D,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { ContractNoBody } from '@toad-contracts/valibot';
2
2
  import * as v from 'valibot';
3
- /** The workspace's registered webhook, or null when none is set. Never returns the secret. */
3
+ /** The workspace's default webhook, or null when none is set. Never returns the secret. */
4
4
  export declare const getNotificationWebhookContract: {
5
5
  readonly method: "get";
6
6
  readonly pathResolver: () => string;
@@ -28,6 +28,8 @@ export declare const getNotificationWebhookContract: {
28
28
  }, undefined>;
29
29
  }, undefined>;
30
30
  readonly 200: v.NullableSchema<v.ObjectSchema<{
31
+ readonly id: v.StringSchema<undefined>;
32
+ readonly name: v.StringSchema<undefined>;
31
33
  readonly url: v.StringSchema<undefined>;
32
34
  readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
33
35
  readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
@@ -44,6 +46,7 @@ export declare const putNotificationWebhookContract: {
44
46
  readonly pathResolver: () => string;
45
47
  readonly requestBodySchema: v.ObjectSchema<{
46
48
  readonly url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.UrlAction<string, undefined>, v.StartsWithAction<string, "https://", "The webhook endpoint must be an https:// URL">, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
49
+ readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>, undefined>;
47
50
  readonly types: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>, undefined>;
48
51
  readonly runEvents: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>, undefined>;
49
52
  readonly alertEvents: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>, undefined>;
@@ -74,6 +77,8 @@ export declare const putNotificationWebhookContract: {
74
77
  }, undefined>;
75
78
  }, undefined>;
76
79
  readonly 200: v.ObjectSchema<{
80
+ readonly id: v.StringSchema<undefined>;
81
+ readonly name: v.StringSchema<undefined>;
77
82
  readonly url: v.StringSchema<undefined>;
78
83
  readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
79
84
  readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
@@ -114,6 +119,184 @@ export declare const deleteNotificationWebhookContract: {
114
119
  readonly 204: typeof ContractNoBody;
115
120
  };
116
121
  };
122
+ /** Every endpoint the workspace has registered, ordered by id. Never returns a secret. */
123
+ export declare const listNotificationWebhooksContract: {
124
+ readonly method: "get";
125
+ readonly pathResolver: () => string;
126
+ readonly responsesByStatusCode: {
127
+ readonly '4xx': v.ObjectSchema<{
128
+ readonly error: v.ObjectSchema<{
129
+ readonly code: v.StringSchema<undefined>;
130
+ readonly message: v.StringSchema<undefined>;
131
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
132
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
133
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
134
+ readonly message: v.StringSchema<undefined>;
135
+ }, undefined>, undefined>, undefined>;
136
+ }, undefined>;
137
+ }, undefined>;
138
+ readonly '5xx': v.ObjectSchema<{
139
+ readonly error: v.ObjectSchema<{
140
+ readonly code: v.StringSchema<undefined>;
141
+ readonly message: v.StringSchema<undefined>;
142
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
143
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
144
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
145
+ readonly message: v.StringSchema<undefined>;
146
+ }, undefined>, undefined>, undefined>;
147
+ }, undefined>;
148
+ }, undefined>;
149
+ readonly 200: v.ObjectSchema<{
150
+ readonly webhooks: v.ArraySchema<v.ObjectSchema<{
151
+ readonly id: v.StringSchema<undefined>;
152
+ readonly name: v.StringSchema<undefined>;
153
+ readonly url: v.StringSchema<undefined>;
154
+ readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
155
+ readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
156
+ readonly alertEvents: v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>;
157
+ readonly enabled: v.BooleanSchema<undefined>;
158
+ readonly hasSecret: v.BooleanSchema<undefined>;
159
+ readonly updatedAt: v.NumberSchema<undefined>;
160
+ }, undefined>, undefined>;
161
+ }, undefined>;
162
+ };
163
+ };
164
+ /** One named endpoint, or null when nothing is registered under that id. */
165
+ export declare const getNamedNotificationWebhookContract: {
166
+ readonly method: "get";
167
+ readonly pathResolver: (p: {
168
+ webhookId: string;
169
+ }) => string;
170
+ readonly requestPathParamsSchema: v.ObjectSchema<{
171
+ webhookId: v.StringSchema<undefined>;
172
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
173
+ readonly responsesByStatusCode: {
174
+ readonly '4xx': v.ObjectSchema<{
175
+ readonly error: v.ObjectSchema<{
176
+ readonly code: v.StringSchema<undefined>;
177
+ readonly message: v.StringSchema<undefined>;
178
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
179
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
180
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
181
+ readonly message: v.StringSchema<undefined>;
182
+ }, undefined>, undefined>, undefined>;
183
+ }, undefined>;
184
+ }, undefined>;
185
+ readonly '5xx': v.ObjectSchema<{
186
+ readonly error: v.ObjectSchema<{
187
+ readonly code: v.StringSchema<undefined>;
188
+ readonly message: v.StringSchema<undefined>;
189
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
190
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
191
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
192
+ readonly message: v.StringSchema<undefined>;
193
+ }, undefined>, undefined>, undefined>;
194
+ }, undefined>;
195
+ }, undefined>;
196
+ readonly 200: v.ObjectSchema<{
197
+ readonly webhook: v.NullableSchema<v.ObjectSchema<{
198
+ readonly id: v.StringSchema<undefined>;
199
+ readonly name: v.StringSchema<undefined>;
200
+ readonly url: v.StringSchema<undefined>;
201
+ readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
202
+ readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
203
+ readonly alertEvents: v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>;
204
+ readonly enabled: v.BooleanSchema<undefined>;
205
+ readonly hasSecret: v.BooleanSchema<undefined>;
206
+ readonly updatedAt: v.NumberSchema<undefined>;
207
+ }, undefined>, undefined>;
208
+ }, undefined>;
209
+ };
210
+ };
211
+ /** Register or update one named endpoint. Keep-on-omit in every field, like the singular route. */
212
+ export declare const putNamedNotificationWebhookContract: {
213
+ readonly method: "put";
214
+ readonly pathResolver: (p: {
215
+ webhookId: string;
216
+ }) => string;
217
+ readonly requestPathParamsSchema: v.ObjectSchema<{
218
+ webhookId: v.StringSchema<undefined>;
219
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
220
+ readonly requestBodySchema: v.ObjectSchema<{
221
+ readonly url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.UrlAction<string, undefined>, v.StartsWithAction<string, "https://", "The webhook endpoint must be an https:// URL">, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
222
+ readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>, undefined>;
223
+ readonly types: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>, undefined>;
224
+ readonly runEvents: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>, undefined>;
225
+ readonly alertEvents: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>, undefined>;
226
+ readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
227
+ readonly secret: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 16, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
228
+ }, undefined>;
229
+ readonly responsesByStatusCode: {
230
+ readonly '4xx': v.ObjectSchema<{
231
+ readonly error: v.ObjectSchema<{
232
+ readonly code: v.StringSchema<undefined>;
233
+ readonly message: v.StringSchema<undefined>;
234
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
235
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
236
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
237
+ readonly message: v.StringSchema<undefined>;
238
+ }, undefined>, undefined>, undefined>;
239
+ }, undefined>;
240
+ }, undefined>;
241
+ readonly '5xx': v.ObjectSchema<{
242
+ readonly error: v.ObjectSchema<{
243
+ readonly code: v.StringSchema<undefined>;
244
+ readonly message: v.StringSchema<undefined>;
245
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
246
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
247
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
248
+ readonly message: v.StringSchema<undefined>;
249
+ }, undefined>, undefined>, undefined>;
250
+ }, undefined>;
251
+ }, undefined>;
252
+ readonly 200: v.ObjectSchema<{
253
+ readonly id: v.StringSchema<undefined>;
254
+ readonly name: v.StringSchema<undefined>;
255
+ readonly url: v.StringSchema<undefined>;
256
+ readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
257
+ readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
258
+ readonly alertEvents: v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>;
259
+ readonly enabled: v.BooleanSchema<undefined>;
260
+ readonly hasSecret: v.BooleanSchema<undefined>;
261
+ readonly updatedAt: v.NumberSchema<undefined>;
262
+ }, undefined>;
263
+ };
264
+ };
265
+ /** Remove one named endpoint (its deliveries stop; its siblings are untouched). Idempotent. */
266
+ export declare const deleteNamedNotificationWebhookContract: {
267
+ readonly method: "delete";
268
+ readonly pathResolver: (p: {
269
+ webhookId: string;
270
+ }) => string;
271
+ readonly requestPathParamsSchema: v.ObjectSchema<{
272
+ webhookId: v.StringSchema<undefined>;
273
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
274
+ readonly responsesByStatusCode: {
275
+ readonly '4xx': v.ObjectSchema<{
276
+ readonly error: v.ObjectSchema<{
277
+ readonly code: v.StringSchema<undefined>;
278
+ readonly message: v.StringSchema<undefined>;
279
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
280
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
281
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
282
+ readonly message: v.StringSchema<undefined>;
283
+ }, undefined>, undefined>, undefined>;
284
+ }, undefined>;
285
+ }, undefined>;
286
+ readonly '5xx': v.ObjectSchema<{
287
+ readonly error: v.ObjectSchema<{
288
+ readonly code: v.StringSchema<undefined>;
289
+ readonly message: v.StringSchema<undefined>;
290
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
291
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
292
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
293
+ readonly message: v.StringSchema<undefined>;
294
+ }, undefined>, undefined>, undefined>;
295
+ }, undefined>;
296
+ }, undefined>;
297
+ readonly 204: typeof ContractNoBody;
298
+ };
299
+ };
117
300
  /**
118
301
  * Read the workspace's registered endpoint. `{ webhook: null }` when none is registered: a real
119
302
  * answer rather than a 404, so a caller's startup self-check ("am I already wired up?") reads one
@@ -147,6 +330,8 @@ export declare const getPublicNotificationWebhookContract: {
147
330
  }, undefined>;
148
331
  readonly 200: v.ObjectSchema<{
149
332
  readonly webhook: v.NullableSchema<v.ObjectSchema<{
333
+ readonly id: v.StringSchema<undefined>;
334
+ readonly name: v.StringSchema<undefined>;
150
335
  readonly url: v.StringSchema<undefined>;
151
336
  readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
152
337
  readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
@@ -174,6 +359,7 @@ export declare const putPublicNotificationWebhookContract: {
174
359
  readonly pathResolver: () => string;
175
360
  readonly requestBodySchema: v.ObjectSchema<{
176
361
  readonly url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.UrlAction<string, undefined>, v.StartsWithAction<string, "https://", "The webhook endpoint must be an https:// URL">, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
362
+ readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>, undefined>;
177
363
  readonly types: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>, undefined>;
178
364
  readonly runEvents: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>, undefined>;
179
365
  readonly alertEvents: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>, undefined>;
@@ -204,6 +390,8 @@ export declare const putPublicNotificationWebhookContract: {
204
390
  }, undefined>;
205
391
  }, undefined>;
206
392
  readonly 200: v.ObjectSchema<{
393
+ readonly id: v.StringSchema<undefined>;
394
+ readonly name: v.StringSchema<undefined>;
207
395
  readonly url: v.StringSchema<undefined>;
208
396
  readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
209
397
  readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
@@ -248,4 +436,205 @@ export declare const deletePublicNotificationWebhookContract: {
248
436
  } & {
249
437
  readonly minScope: "admin";
250
438
  };
439
+ /**
440
+ * Every endpoint the workspace has registered. Bounded by the write path
441
+ * (`MAX_NOTIFICATION_WEBHOOKS_PER_WORKSPACE`) rather than by a cursor: see the schema.
442
+ */
443
+ export declare const listPublicNotificationWebhooksContract: {
444
+ readonly method: "get";
445
+ readonly pathResolver: () => string;
446
+ readonly responsesByStatusCode: {
447
+ readonly '4xx': v.ObjectSchema<{
448
+ readonly error: v.ObjectSchema<{
449
+ readonly code: v.StringSchema<undefined>;
450
+ readonly message: v.StringSchema<undefined>;
451
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
452
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
453
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
454
+ readonly message: v.StringSchema<undefined>;
455
+ }, undefined>, undefined>, undefined>;
456
+ }, undefined>;
457
+ }, undefined>;
458
+ readonly '5xx': v.ObjectSchema<{
459
+ readonly error: v.ObjectSchema<{
460
+ readonly code: v.StringSchema<undefined>;
461
+ readonly message: v.StringSchema<undefined>;
462
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
463
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
464
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
465
+ readonly message: v.StringSchema<undefined>;
466
+ }, undefined>, undefined>, undefined>;
467
+ }, undefined>;
468
+ }, undefined>;
469
+ readonly 200: v.ObjectSchema<{
470
+ readonly webhooks: v.ArraySchema<v.ObjectSchema<{
471
+ readonly id: v.StringSchema<undefined>;
472
+ readonly name: v.StringSchema<undefined>;
473
+ readonly url: v.StringSchema<undefined>;
474
+ readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
475
+ readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
476
+ readonly alertEvents: v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>;
477
+ readonly enabled: v.BooleanSchema<undefined>;
478
+ readonly hasSecret: v.BooleanSchema<undefined>;
479
+ readonly updatedAt: v.NumberSchema<undefined>;
480
+ }, undefined>, undefined>;
481
+ }, undefined>;
482
+ };
483
+ } & {
484
+ readonly minScope: "admin";
485
+ };
486
+ /**
487
+ * Read one named endpoint. `{ webhook: null }` when nothing is registered under that id, for the
488
+ * same reason the singular read answers that way: this is a startup self-check, and an id a caller
489
+ * chose for itself is not a resource it can mistype into somebody else's.
490
+ */
491
+ export declare const getPublicNamedNotificationWebhookContract: {
492
+ readonly method: "get";
493
+ readonly requestPathParamsSchema: v.ObjectSchema<{
494
+ webhookId: v.StringSchema<undefined>;
495
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
496
+ readonly pathResolver: ({ webhookId }: {
497
+ webhookId: string;
498
+ }) => string;
499
+ readonly responsesByStatusCode: {
500
+ readonly '4xx': v.ObjectSchema<{
501
+ readonly error: v.ObjectSchema<{
502
+ readonly code: v.StringSchema<undefined>;
503
+ readonly message: v.StringSchema<undefined>;
504
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
505
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
506
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
507
+ readonly message: v.StringSchema<undefined>;
508
+ }, undefined>, undefined>, undefined>;
509
+ }, undefined>;
510
+ }, undefined>;
511
+ readonly '5xx': v.ObjectSchema<{
512
+ readonly error: v.ObjectSchema<{
513
+ readonly code: v.StringSchema<undefined>;
514
+ readonly message: v.StringSchema<undefined>;
515
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
516
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
517
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
518
+ readonly message: v.StringSchema<undefined>;
519
+ }, undefined>, undefined>, undefined>;
520
+ }, undefined>;
521
+ }, undefined>;
522
+ readonly 200: v.ObjectSchema<{
523
+ readonly webhook: v.NullableSchema<v.ObjectSchema<{
524
+ readonly id: v.StringSchema<undefined>;
525
+ readonly name: v.StringSchema<undefined>;
526
+ readonly url: v.StringSchema<undefined>;
527
+ readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
528
+ readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
529
+ readonly alertEvents: v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>;
530
+ readonly enabled: v.BooleanSchema<undefined>;
531
+ readonly hasSecret: v.BooleanSchema<undefined>;
532
+ readonly updatedAt: v.NumberSchema<undefined>;
533
+ }, undefined>, undefined>;
534
+ }, undefined>;
535
+ };
536
+ } & {
537
+ readonly minScope: "admin";
538
+ };
539
+ /**
540
+ * Register or update one named endpoint under a CALLER-CHOSEN id, with the same keep-on-omit rule
541
+ * and the same write-only secret as the singular route. Creating a new id past the per-workspace
542
+ * cap is refused with `reason: 'webhook_limit_reached'`; an id that is not a lowercase slug with
543
+ * `reason: 'invalid_webhook_id'`.
544
+ */
545
+ export declare const putPublicNamedNotificationWebhookContract: {
546
+ readonly method: "put";
547
+ readonly requestPathParamsSchema: v.ObjectSchema<{
548
+ webhookId: v.StringSchema<undefined>;
549
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
550
+ readonly pathResolver: ({ webhookId }: {
551
+ webhookId: string;
552
+ }) => string;
553
+ readonly requestBodySchema: v.ObjectSchema<{
554
+ readonly url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.UrlAction<string, undefined>, v.StartsWithAction<string, "https://", "The webhook endpoint must be an https:// URL">, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
555
+ readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>, undefined>;
556
+ readonly types: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>, undefined>;
557
+ readonly runEvents: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>, undefined>;
558
+ readonly alertEvents: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>, undefined>;
559
+ readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
560
+ readonly secret: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 16, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
561
+ }, undefined>;
562
+ readonly responsesByStatusCode: {
563
+ readonly '4xx': v.ObjectSchema<{
564
+ readonly error: v.ObjectSchema<{
565
+ readonly code: v.StringSchema<undefined>;
566
+ readonly message: v.StringSchema<undefined>;
567
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
568
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
569
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
570
+ readonly message: v.StringSchema<undefined>;
571
+ }, undefined>, undefined>, undefined>;
572
+ }, undefined>;
573
+ }, undefined>;
574
+ readonly '5xx': v.ObjectSchema<{
575
+ readonly error: v.ObjectSchema<{
576
+ readonly code: v.StringSchema<undefined>;
577
+ readonly message: v.StringSchema<undefined>;
578
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
579
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
580
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
581
+ readonly message: v.StringSchema<undefined>;
582
+ }, undefined>, undefined>, undefined>;
583
+ }, undefined>;
584
+ }, undefined>;
585
+ readonly 200: v.ObjectSchema<{
586
+ readonly id: v.StringSchema<undefined>;
587
+ readonly name: v.StringSchema<undefined>;
588
+ readonly url: v.StringSchema<undefined>;
589
+ readonly types: v.ArraySchema<v.PicklistSchema<["merge_review", "pipeline_complete", "ci_failed", "test_failed", "requirement_review", "clarity_review", "release_regression", "decision_required", "human_test_ready", "visual_confirmation_ready", "human_review", "followup_pending", "fork_decision_pending", "judge_review", "pr_review_ready", "initiative", "platform_health", "infra_unreachable", "budget_paused", "budget_threshold", "key_drift", "merge_tag_request"], undefined>, undefined>;
590
+ readonly runEvents: v.ArraySchema<v.PicklistSchema<["run.started", "run.completed", "run.failed"], undefined>, undefined>;
591
+ readonly alertEvents: v.ArraySchema<v.PicklistSchema<["platform_health.firing", "platform_health.resolved"], undefined>, undefined>;
592
+ readonly enabled: v.BooleanSchema<undefined>;
593
+ readonly hasSecret: v.BooleanSchema<undefined>;
594
+ readonly updatedAt: v.NumberSchema<undefined>;
595
+ }, undefined>;
596
+ };
597
+ } & {
598
+ readonly minScope: "admin";
599
+ };
600
+ /**
601
+ * Remove one named endpoint. Idempotent, and scoped to the id alone: a caller tearing its own
602
+ * receiver down can never take a sibling integration's registration with it.
603
+ */
604
+ export declare const deletePublicNamedNotificationWebhookContract: {
605
+ readonly method: "delete";
606
+ readonly requestPathParamsSchema: v.ObjectSchema<{
607
+ webhookId: v.StringSchema<undefined>;
608
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
609
+ readonly pathResolver: ({ webhookId }: {
610
+ webhookId: string;
611
+ }) => string;
612
+ readonly responsesByStatusCode: {
613
+ readonly '4xx': v.ObjectSchema<{
614
+ readonly error: v.ObjectSchema<{
615
+ readonly code: v.StringSchema<undefined>;
616
+ readonly message: v.StringSchema<undefined>;
617
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
618
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
619
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
620
+ readonly message: v.StringSchema<undefined>;
621
+ }, undefined>, undefined>, undefined>;
622
+ }, undefined>;
623
+ }, undefined>;
624
+ readonly '5xx': v.ObjectSchema<{
625
+ readonly error: v.ObjectSchema<{
626
+ readonly code: v.StringSchema<undefined>;
627
+ readonly message: v.StringSchema<undefined>;
628
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
629
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
630
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
631
+ readonly message: v.StringSchema<undefined>;
632
+ }, undefined>, undefined>, undefined>;
633
+ }, undefined>;
634
+ }, undefined>;
635
+ readonly 204: typeof ContractNoBody;
636
+ };
637
+ } & {
638
+ readonly minScope: "admin";
639
+ };
251
640
  //# sourceMappingURL=notification-webhooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-webhooks.d.ts","sourceRoot":"","sources":["../../src/routes/notification-webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA0B5B,8FAA8F;AAC9F,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOzC,CAAA;AAEF,yFAAyF;AACzF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKzC,CAAA;AAEF,wDAAwD;AACxD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI5C,CAAA;AAIF;;;;GAIG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhD,CAAA;AA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IG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhD,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQhD,CAAA;AAED,gGAAgG;AAChG,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOnD,CAAA;AAWD;;;GAGG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOlD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQrD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASrD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQxD,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { ContractNoBody, defineApiContract } from '@toad-contracts/valibot';
2
2
  import * as v from 'valibot';
3
- import { notificationWebhookSchema, publicNotificationWebhookSchema, putNotificationWebhookSchema, } from '../notification-webhooks.js';
4
- import { errorResponses, withMinScope } from './_shared.js';
5
- // Management routes for a workspace's OUTBOUND notification webhook, on TWO surfaces:
3
+ import { notificationWebhookSchema, publicNotificationWebhookListSchema, publicNotificationWebhookSchema, putNotificationWebhookSchema, } from '../notification-webhooks.js';
4
+ import { errorResponses, singleStringParam, withMinScope } from './_shared.js';
5
+ // Management routes for a workspace's OUTBOUND notification webhooks, on TWO surfaces:
6
6
  //
7
7
  // 1. Session-authed, mounted under `/workspaces/:workspaceId` (so paths are relative), like the
8
8
  // tracker/Slack settings. These are writes to an integration's configuration, so they sit
@@ -10,16 +10,22 @@ import { errorResponses, withMinScope } from './_shared.js';
10
10
  // 2. `/api/v1/notification-webhook`, on absolute paths, authenticated in-controller by an
11
11
  // `admin`-scope public-API key. Same three verbs against the same service.
12
12
  //
13
- // The endpoint they configure is consumed by `WebhookNotificationChannel` and the run-lifecycle /
14
- // platform-alert sinks beside it, not by these routes.
13
+ // The endpoints they configure are consumed by `WebhookNotificationChannel` and the run-lifecycle
14
+ // / platform-alert sinks beside it, not by these routes.
15
15
  //
16
16
  // The second surface exists because the FIRST one made the push channel unreachable to exactly
17
17
  // the caller it was built for. A deployment whose operator is headless has no browser session, so
18
18
  // the receiver that run-lifecycle push exists to feed could only be registered by a human clicking
19
19
  // through an app the feature deliberately does not need. Both surfaces are thin delegates over
20
- // `NotificationWebhookService` (same URL guard, same write-only secret, same
21
- // one-row-per-workspace rule), so neither can admit an endpoint the other would reject.
22
- /** The workspace's registered webhook, or null when none is set. Never returns the secret. */
20
+ // `NotificationWebhookService` (same URL guard, same write-only secret, same per-endpoint rules),
21
+ // so neither can admit an endpoint the other would reject.
22
+ //
23
+ // Each surface comes in two shapes. The SINGULAR routes (`…/notification-webhook`) address the one
24
+ // id `default`; the COLLECTION (`…/notification-webhooks[/:webhookId]`) addresses any of them. The
25
+ // singular pair is not a legacy alias kept alive out of politeness: it is the whole surface a
26
+ // deployment with one receiver ever needs, and collapsing it into the collection would have made
27
+ // every existing consumer move for a capability it does not use.
28
+ /** The workspace's default webhook, or null when none is set. Never returns the secret. */
23
29
  export const getNotificationWebhookContract = defineApiContract({
24
30
  method: 'get',
25
31
  pathResolver: () => '/notification-webhook',
@@ -41,6 +47,38 @@ export const deleteNotificationWebhookContract = defineApiContract({
41
47
  pathResolver: () => '/notification-webhook',
42
48
  responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
43
49
  });
50
+ // ---- the session surface's COLLECTION (every named endpoint) ----
51
+ /** Every endpoint the workspace has registered, ordered by id. Never returns a secret. */
52
+ export const listNotificationWebhooksContract = defineApiContract({
53
+ method: 'get',
54
+ pathResolver: () => '/notification-webhooks',
55
+ responsesByStatusCode: {
56
+ 200: publicNotificationWebhookListSchema,
57
+ ...errorResponses,
58
+ },
59
+ });
60
+ /** One named endpoint, or null when nothing is registered under that id. */
61
+ export const getNamedNotificationWebhookContract = defineApiContract({
62
+ method: 'get',
63
+ pathResolver: (p) => `/notification-webhooks/${p.webhookId}`,
64
+ requestPathParamsSchema: singleStringParam('webhookId'),
65
+ responsesByStatusCode: { 200: publicNotificationWebhookSchema, ...errorResponses },
66
+ });
67
+ /** Register or update one named endpoint. Keep-on-omit in every field, like the singular route. */
68
+ export const putNamedNotificationWebhookContract = defineApiContract({
69
+ method: 'put',
70
+ pathResolver: (p) => `/notification-webhooks/${p.webhookId}`,
71
+ requestPathParamsSchema: singleStringParam('webhookId'),
72
+ requestBodySchema: putNotificationWebhookSchema,
73
+ responsesByStatusCode: { 200: notificationWebhookSchema, ...errorResponses },
74
+ });
75
+ /** Remove one named endpoint (its deliveries stop; its siblings are untouched). Idempotent. */
76
+ export const deleteNamedNotificationWebhookContract = defineApiContract({
77
+ method: 'delete',
78
+ pathResolver: (p) => `/notification-webhooks/${p.webhookId}`,
79
+ requestPathParamsSchema: singleStringParam('webhookId'),
80
+ responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
81
+ });
44
82
  // ---- the external `/api/v1` surface (absolute paths, key-authenticated) ----
45
83
  /**
46
84
  * Read the workspace's registered endpoint. `{ webhook: null }` when none is registered: a real
@@ -73,4 +111,55 @@ export const deletePublicNotificationWebhookContract = withMinScope('admin', def
73
111
  pathResolver: () => '/api/v1/notification-webhook',
74
112
  responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
75
113
  }));
114
+ // ---- the public COLLECTION: several named endpoints per workspace ----
115
+ //
116
+ // The singular resource above is ONE endpoint per workspace, which made a second integration's
117
+ // enrolment a hostile act: registering it stole the slot from whatever was already there, and the
118
+ // only way to notice was that the previous receiver went quiet. The collection is the additive fix
119
+ // — the singular routes keep working and now project onto the `default` id — and it is what lets a
120
+ // credential-holding front-end (a Cloudflare OS gatekeeper) enroll its own receiver, with its own
121
+ // signing secret and its own event filters, beside a deployment's existing CI hook.
122
+ /**
123
+ * Every endpoint the workspace has registered. Bounded by the write path
124
+ * (`MAX_NOTIFICATION_WEBHOOKS_PER_WORKSPACE`) rather than by a cursor: see the schema.
125
+ */
126
+ export const listPublicNotificationWebhooksContract = withMinScope('admin', defineApiContract({
127
+ method: 'get',
128
+ pathResolver: () => '/api/v1/notification-webhooks',
129
+ responsesByStatusCode: { 200: publicNotificationWebhookListSchema, ...errorResponses },
130
+ }));
131
+ /**
132
+ * Read one named endpoint. `{ webhook: null }` when nothing is registered under that id, for the
133
+ * same reason the singular read answers that way: this is a startup self-check, and an id a caller
134
+ * chose for itself is not a resource it can mistype into somebody else's.
135
+ */
136
+ export const getPublicNamedNotificationWebhookContract = withMinScope('admin', defineApiContract({
137
+ method: 'get',
138
+ requestPathParamsSchema: singleStringParam('webhookId'),
139
+ pathResolver: ({ webhookId }) => `/api/v1/notification-webhooks/${webhookId}`,
140
+ responsesByStatusCode: { 200: publicNotificationWebhookSchema, ...errorResponses },
141
+ }));
142
+ /**
143
+ * Register or update one named endpoint under a CALLER-CHOSEN id, with the same keep-on-omit rule
144
+ * and the same write-only secret as the singular route. Creating a new id past the per-workspace
145
+ * cap is refused with `reason: 'webhook_limit_reached'`; an id that is not a lowercase slug with
146
+ * `reason: 'invalid_webhook_id'`.
147
+ */
148
+ export const putPublicNamedNotificationWebhookContract = withMinScope('admin', defineApiContract({
149
+ method: 'put',
150
+ requestPathParamsSchema: singleStringParam('webhookId'),
151
+ pathResolver: ({ webhookId }) => `/api/v1/notification-webhooks/${webhookId}`,
152
+ requestBodySchema: putNotificationWebhookSchema,
153
+ responsesByStatusCode: { 200: notificationWebhookSchema, ...errorResponses },
154
+ }));
155
+ /**
156
+ * Remove one named endpoint. Idempotent, and scoped to the id alone: a caller tearing its own
157
+ * receiver down can never take a sibling integration's registration with it.
158
+ */
159
+ export const deletePublicNamedNotificationWebhookContract = withMinScope('admin', defineApiContract({
160
+ method: 'delete',
161
+ requestPathParamsSchema: singleStringParam('webhookId'),
162
+ pathResolver: ({ webhookId }) => `/api/v1/notification-webhooks/${webhookId}`,
163
+ responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
164
+ }));
76
165
  //# sourceMappingURL=notification-webhooks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-webhooks.js","sourceRoot":"","sources":["../../src/routes/notification-webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3D,sFAAsF;AACtF,EAAE;AACF,iGAAiG;AACjG,8FAA8F;AAC9F,+FAA+F;AAC/F,2FAA2F;AAC3F,+EAA+E;AAC/E,EAAE;AACF,kGAAkG;AAClG,uDAAuD;AACvD,EAAE;AACF,+FAA+F;AAC/F,kGAAkG;AAClG,mGAAmG;AACnG,+FAA+F;AAC/F,6EAA6E;AAC7E,wFAAwF;AAExF,8FAA8F;AAC9F,MAAM,CAAC,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC9D,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,uBAAuB;IAC3C,qBAAqB,EAAE;QACrB,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC1C,GAAG,cAAc;KAClB;CACF,CAAC,CAAA;AAEF,yFAAyF;AACzF,MAAM,CAAC,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC9D,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,u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cAAc,EAAE;CACvF,CAAC,CACH,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,YAAY,CACnE,OAAO,EACP,iBAAiB,CAAC;IAChB,MAAM,EAAE,KAAK;IACb,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAAC;IACvD,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,iCAAiC,SAAS,EAAE;IAC7E,qBAAqB,EAAE,EAAE,GAAG,EAAE,+BAA+B,EAAE,GAAG,cAAc,EAAE;CACnF,CAAC,CACH,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,YAAY,CACnE,OAAO,EACP,iBAAiB,CAAC;IAChB,MAAM,EAAE,KAAK;IACb,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAAC;IACvD,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,iCAAiC,SAAS,EAAE;IAC7E,iBAAiB,EAAE,4BAA4B;IAC/C,qBAAqB,EAAE,EAAE,GAAG,EAAE,yBAAyB,EAAE,GAAG,cAAc,EAAE;CAC7E,CAAC,CACH,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,4CAA4C,GAAG,YAAY,CACtE,OAAO,EACP,iBAAiB,CAAC;IAChB,MAAM,EAAE,QAAQ;IAChB,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAAC;IACvD,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,iCAAiC,SAAS,EAAE;IAC7E,qBAAqB,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;CAClE,CAAC,CACH,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/contracts",
3
- "version": "0.267.0",
3
+ "version": "0.268.0",
4
4
  "description": "Valibot wire contract shared between the Agent Architecture Board frontend and backend.",
5
5
  "repository": {
6
6
  "type": "git",