|
| 1 | +--- |
| 2 | +"@objectstack/spec": major |
| 3 | +--- |
| 4 | + |
| 5 | +feat(spec)!: `@objectstack/spec/system` no longer exports the orphan notification-template vocabulary — `EmailTemplate(Schema)`, `SMSTemplate(Schema)`, `PushNotification(Schema)`, `InAppNotification(Schema)` (#4616) |
| 6 | + |
| 7 | +These four schemas existed **only** as the member shapes of the |
| 8 | +`NotificationConfigSchema.template` union, and #4610 (#4535 C3) deleted that |
| 9 | +union. Since then they have been reachable from no parent schema and from no |
| 10 | +metadata-type root: nothing in framework, cloud or objectui parsed a document |
| 11 | +against them, so they declared delivery capability the runtime never read |
| 12 | +(ADR-0049 enforce-or-remove, resolved by REMOVE in the v17 breaking window). |
| 13 | + |
| 14 | +Migration — one line each, and in every case the replacement already exists: |
| 15 | + |
| 16 | +- FROM `import { EmailTemplateSchema, type EmailTemplate } from '@objectstack/spec/system'` → |
| 17 | + TO `import { EmailTemplateDefinitionSchema, type EmailTemplateDefinition } from '@objectstack/spec/system'`. |
| 18 | + **Shape change** — this is a different, richer contract, not a rename: |
| 19 | + `EmailTemplateDefinitionSchema` is keyed `name` + `locale` (not `id`), splits |
| 20 | + the body into `bodyHtml` / `bodyText` (not `body` + `bodyType`), and adds |
| 21 | + `label` / `category` / `active` / `fromOverride` / `replyTo`. It is also a |
| 22 | + `strictObject`, so the old keys are rejected loudly rather than stripped. |
| 23 | + This is the schema the `email_template` metadata kind has resolved to since |
| 24 | + spec **7.1.0**, which demoted `EmailTemplateSchema` when it fixed that Prime |
| 25 | + Directive #8 double-declaration and kept it "only as an inline sub-shape |
| 26 | + inside `Notification`" — #4610 removed that holder, and #4616 finishes the |
| 27 | + job. If your code registers a client-side or publish-time validator for |
| 28 | + `email_template`, it must point at `EmailTemplateDefinitionSchema`; |
| 29 | + `BUILTIN_METADATA_TYPE_SCHEMAS` (`kernel/metadata-type-schemas.ts`) is the |
| 30 | + authority. |
| 31 | +- FROM `import { SMSTemplateSchema, type SMSTemplate } from '@objectstack/spec/system'` → |
| 32 | + TO: no spec replacement, and none is needed. SMS templates are |
| 33 | + `sys_notification_template` rows resolved by `(topic, 'sms', locale)` |
| 34 | + (`service-messaging/src/sms-channel.ts`) and rendered by |
| 35 | + `template-renderer.ts`; the provider-side template is Aliyun's pre-registered |
| 36 | + `TemplateCode` in `service-sms` — a vendor API shape, never a spec constant. |
| 37 | +- FROM `import { PushNotificationSchema, type PushNotification } from '@objectstack/spec/system'` |
| 38 | + and FROM `import { InAppNotificationSchema, type InAppNotification } from '@objectstack/spec/system'` → |
| 39 | + TO: no replacement. Neither channel has a delivery implementation (#3197): |
| 40 | + the dispatcher dead-letters any message addressed to them, so these payload |
| 41 | + shapes advertised a capability nothing delivers. The live delivery ingress is |
| 42 | + `NotificationService.emit` (`INotificationService`, |
| 43 | + `@objectstack/spec/contracts`); the in-app bell reads `./api`'s |
| 44 | + `Notification(Schema)` inbox row; the presentation vocabulary is |
| 45 | + `@objectstack/spec/ui` (`NotificationTypeSchema`, `NotificationSeveritySchema`, |
| 46 | + `NotificationPositionSchema`, `NotificationActionSchema` — all unchanged). |
| 47 | + |
| 48 | +Unchanged and explicitly NOT part of this removal: |
| 49 | +`@objectstack/spec/system`'s `NotificationChannel(Schema)` (live — re-exported |
| 50 | +by `@objectstack/spec/contracts`, consumed by `service-messaging`), |
| 51 | +`EmailTemplateDefinition*`, and every `@objectstack/spec/ui` notification |
| 52 | +export. |
| 53 | + |
| 54 | +No ADR-0087 D2 conversion accompanies this change, deliberately: a conversion |
| 55 | +rewrites authored or stored sources, and these defs were reachable from no |
| 56 | +metadata-type root, so `os migrate meta` would have nothing to match. The |
| 57 | +removal is a TypeScript export-surface break only — same disposition as #4610 |
| 58 | +in this very module. `json-schema.manifest.json` loses 4 keys and |
| 59 | +`authorable-surface.json` loses their 22 lines; both deletions are adjudicated |
| 60 | +by `gen:schema`'s #4650 route-3 check ("def no longer emitted by this build"). |
0 commit comments