|
| 1 | +--- |
| 2 | +"@objectstack/spec": major |
| 3 | +--- |
| 4 | + |
| 5 | +feat(spec)!: the notification vocabulary has one owner per name — `@objectstack/spec/ui` no longer exports `Notification(Schema)` / `NotificationConfig(Schema)`, and `@objectstack/spec/system` no longer exports `NotificationConfig(Schema)` (#4610) |
| 6 | + |
| 7 | +The names `Notification` / `NotificationSchema` (`./api` vs `./ui`) and |
| 8 | +`NotificationConfig` / `NotificationConfigSchema` (`./system` vs `./ui`) |
| 9 | +each resolved to **two different declarations** depending on the import |
| 10 | +path — the #4411 dual-source trap. Resolution (three-repo, |
| 11 | +import-statement-level consumer scan: framework, cloud, objectui): |
| 12 | + |
| 13 | +- **Removed** `NotificationSchema` / `Notification` from |
| 14 | + `@objectstack/spec/ui`. This was a toast/banner "notification instance" |
| 15 | + shape (`type`/`severity`/`message`/`duration`/`actions`/`position` + ARIA |
| 16 | + props) with **zero importers** in all three repos — objectui's toaster |
| 17 | + never adopted it. The live contract is `./api`'s `Notification(Schema)`: |
| 18 | + the REST inbox row (`id`/`type`/`title`/`body`/`read`/`data`/`actionUrl`/ |
| 19 | + `createdAt`) embedded in `ListNotificationsResponseSchema`, served by |
| 20 | + `/api/v1/notifications`, implemented by `@objectstack/client`, and |
| 21 | + mirrored by `InboxNotification` in `@objectstack/spec/contracts` |
| 22 | + (ADR-0030: the bell reads this shape). |
| 23 | + - FROM `import { NotificationSchema, type Notification } from '@objectstack/spec/ui'` → |
| 24 | + TO `import { NotificationSchema, type Notification } from '@objectstack/spec/api'`. |
| 25 | + **Shape change**: the api row is an inbox record, not a presentation |
| 26 | + config — the ui shape's `severity` / `duration` / `dismissible` / |
| 27 | + `actions` / `position` / ARIA fields do not exist there. For the |
| 28 | + presentation vocabulary keep using the ui enums, which are unchanged: |
| 29 | + `NotificationTypeSchema`, `NotificationSeveritySchema`, |
| 30 | + `NotificationPositionSchema`, `NotificationActionSchema` (+ their |
| 31 | + types) still live in `@objectstack/spec/ui`. |
| 32 | +- **Removed** `NotificationConfigSchema` / `NotificationConfig` from **both** |
| 33 | + `@objectstack/spec/system` and `@objectstack/spec/ui` — the bare name left |
| 34 | + the spec export surface entirely. Both declarations had zero importers in |
| 35 | + all three repos and were wired into no parent schema. The system side (a |
| 36 | + channel + template + recipients + schedule + retryPolicy + tracking |
| 37 | + "unified notification management protocol") predates ADR-0030's accepted |
| 38 | + delivery architecture and advertised capability the runtime does not |
| 39 | + deliver (its channel enum's `push`/`slack`/`teams`/`webhook` dead-letter, |
| 40 | + #3197; nothing reads `schedule`/`retryPolicy`/`tracking`). The ui side (a |
| 41 | + toaster global config: `defaultPosition`/`defaultDuration`/`maxVisible`/ |
| 42 | + `stackDirection`/`pauseOnHover`) was never adopted by objectui. |
| 43 | + - FROM `import { NotificationConfigSchema } from '@objectstack/spec/system'` (or `.../ui`) → |
| 44 | + TO: no direct replacement. The live delivery vocabulary is |
| 45 | + `NotificationService.emit` (`INotificationService`, |
| 46 | + `@objectstack/spec/contracts`), the `notify` flow node |
| 47 | + (`NotifyConfigSchema`, `@objectstack/spec/automation`) and the |
| 48 | + `sys_notification*` platform objects; per-user delivery preferences are |
| 49 | + `NotificationPreferences(Schema)` in `@objectstack/spec/api`. |
| 50 | +- `@objectstack/spec/api`'s `Notification(Schema)` and |
| 51 | + `NotificationPreferences(Schema)` are **unchanged**; `./api` is now the |
| 52 | + sole owner of the bare `Notification(Schema)` names. Imports from `./api` |
| 53 | + need no migration. `@objectstack/spec/system`'s `NotificationChannel(Schema)`, |
| 54 | + `EmailTemplate(Schema)`, `SMSTemplate(Schema)`, `PushNotification(Schema)` |
| 55 | + and `InAppNotification(Schema)` are **unchanged**. |
| 56 | + |
| 57 | +`dual-source-exports.baseline.json` shrinks by exactly these 4 rows (28 → 24, |
| 58 | +#4535 C3). |
0 commit comments