Skip to content

Commit bc2bb6b

Browse files
committed
docs(spec): state the notify click-through default in the sourceObject / sourceId / actionUrl describes
A notify that writes none of sourceObject, sourceId and actionUrl links to the run's trigger record when the run has one; the spec describes and JSDoc now say so, with the exceptions the executor applies. Claude-Session: https://claude.ai/code/session_01L6bhgTqqeHSwZYJmApbDCa Co-authored-by: Claude <noreply@anthropic.com>
1 parent ab44ec9 commit bc2bb6b

2 files changed

Lines changed: 36 additions & 8 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `notify` node's `sourceObject`, `sourceId` and `actionUrl` descriptions now state the click-through default the runtime already applies
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A `notify` node that writes none of `sourceObject`, `sourceId` and `actionUrl` links to the run's trigger record when the run has one (a record change other than a delete, a time-relative sweep's row, an action started on a record). The `NotifyConfigSchema` descriptions, and the reference page generated from them, said only that the pair takes effect together. They now also say that an explicit pair or an `actionUrl` is kept as written, that a half-written pair is still dropped rather than defaulted, and that a run with no trigger record links nowhere. No key, shape, default or refinement changes.

‎packages/spec/src/automation/io-node-config.zod.ts‎

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,16 @@ function notifyLiteralRefusals(cfg: {
643643
* click-through target is dropped so the inbox never renders a dead link.
644644
* The schema keeps both optional rather than refining, because the executor
645645
* tolerates (drops) the half-specified shape rather than rejecting it.
646+
* - Click-through default: a node that writes none of `sourceObject`,
647+
* `sourceId` and `actionUrl` links to the run's trigger record, when the
648+
* run has one — a record change other than a delete, a time-relative
649+
* sweep's row, an action started on a record. A schedule tick, an inbound
650+
* API post and a manual start with no record have none and link nowhere;
651+
* a delete's record is gone once the write lands, so it is not linked. An
652+
* explicit pair or an explicit `actionUrl` is the author's word and wins,
653+
* and a half-written pair is still dropped, never defaulted. The executor
654+
* owns the default (`defaultClickThroughOf` in service-automation's
655+
* `notify-node.ts`); the schema shape is unchanged by it.
646656
* - The historical aliases (`to`/`subject`/`body`/`url`, nested
647657
* `source: { object, id }`) are NOT part of this contract: the ADR-0087 D2
648658
* conversion `flow-node-notify-config-aliases` rewrote them at load for
@@ -744,26 +754,34 @@ export const NotifyConfigSchema = lazySchema(() => strictObject({
744754
.describe('Severity forwarded to the messaging service'),
745755
/**
746756
* Click-through target object — only effective together with `sourceId`
747-
* (#2675). A literal, read as written (#19939, "notify literals" above).
757+
* (#2675); a half-written pair is dropped, never defaulted. A literal, read
758+
* as written (#19939, "notify literals" above). Left out together with
759+
* `sourceId` and `actionUrl`, the link defaults to the run's trigger record
760+
* (see "click-through default" above).
748761
*/
749762
sourceObject: notifyLiteralStringSchema('sourceObject').optional()
750-
.describe('Object name of the record the notification links to (writes sys_notification.source_object) — a literal, read as written: a single-brace `{token}` is not resolved here and is refused, as is a CEL value envelope; write the value. Only takes effect together with sourceId — a half-specified click-through target is dropped at execute time, so the inbox never renders a dead link.'),
763+
.describe('Object name of the record the notification links to (writes sys_notification.source_object) — a literal, read as written: a single-brace `{token}` is not resolved here and is refused, as is a CEL value envelope; write the value. Only takes effect together with sourceId — a half-specified click-through target is dropped at execute time, not defaulted, so the inbox never renders a dead link. When sourceObject, sourceId and actionUrl are all left out, a run started by a record (a record change other than a delete, a time-relative sweep, an action on a record) links to that record, and a run with no trigger record links nowhere; an explicit pair or an actionUrl is kept as written.'),
751764
/**
752765
* Click-through target record id — only effective together with
753-
* `sourceObject`. A `value` slot (#19939, {@link NotifySourceIdSlotSchema}).
766+
* `sourceObject`; a half-written pair is dropped, never defaulted. A `value`
767+
* slot (#19939, {@link NotifySourceIdSlotSchema}). Left out together with
768+
* `sourceObject` and `actionUrl`, the link defaults to the run's trigger
769+
* record (see "click-through default" above).
754770
*/
755771
sourceId: NotifySourceIdSlotSchema.optional()
756-
.describe('Record id the notification links to (writes sys_notification.source_id) — a string, or a CEL value envelope `{ dialect: \'cel\', source }` evaluated per run to one (`record.id`); a `{…}` template token is refused. Only takes effect together with sourceObject — a half-specified click-through target is dropped at execute time, so the inbox never renders a dead link.'),
772+
.describe('Record id the notification links to (writes sys_notification.source_id) — a string, or a CEL value envelope `{ dialect: \'cel\', source }` evaluated per run to one (`record.id`); a `{…}` template token is refused. Only takes effect together with sourceObject — a half-specified click-through target is dropped at execute time, not defaulted, so the inbox never renders a dead link. When sourceObject, sourceId and actionUrl are all left out, a run started by a record (a record change other than a delete, a time-relative sweep, an action on a record) links to that record, and a run with no trigger record links nowhere; an explicit pair or an actionUrl is kept as written.'),
757773
/** User id that caused the event. A literal, read as written (#19939, "notify literals" above). */
758774
actorId: notifyLiteralStringSchema('actorId').optional()
759775
.describe('User id that caused the event (writes sys_notification.actor_id) — a literal, read as written: a single-brace `{token}` is not resolved here and is refused, as is a CEL value envelope; write the value'),
760776
/**
761-
* Explicit click-through URL; overrides the sourceObject/sourceId link. A
762-
* TEXT slot (#19939): rendered per run with `{{ }}` holes, like `title`; a
763-
* single-brace `{token}` is refused by the `superRefine` below.
777+
* Explicit click-through URL; overrides the sourceObject/sourceId link, and
778+
* written alone keeps the trigger-record default from applying (see
779+
* "click-through default" above). A TEXT slot (#19939): rendered per run with
780+
* `{{ }}` holes, like `title`; a single-brace `{token}` is refused by the
781+
* `superRefine` below.
764782
*/
765783
actionUrl: z.string().optional()
766-
.describe('Explicit click-through URL, rendered per run with `{{ }}` holes like `title` (`/crm_case/{{ record.id }}`); a single-brace `{token}` is refused. Overrides the link synthesized from sourceObject/sourceId.'),
784+
.describe('Explicit click-through URL, rendered per run with `{{ }}` holes like `title` (`/crm_case/{{ record.id }}`); a single-brace `{token}` is refused. Overrides the link synthesized from sourceObject/sourceId, and written alone keeps the notification from linking to the record that started the run.'),
767785
/**
768786
* Extra values merged into the notification payload — literals, read as
769787
* written (#19939, "notify literals" above).

0 commit comments

Comments
 (0)