@antelopejs/interface-dms 0.14.7-next.998.gc2b0d73 → 0.15.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/base/data-types/default/options.d.ts +10 -0
  3. package/dist/base/data-types/default/strings.d.ts +1 -1
  4. package/dist/base/data-types/default/strings.js +17 -4
  5. package/dist/base/data-types/default/strings.js.map +1 -1
  6. package/dist/base/data-types/field-types.d.ts +7 -0
  7. package/dist/base/data-types/field-types.js +1 -0
  8. package/dist/base/data-types/field-types.js.map +1 -1
  9. package/dist/base/data-types/internal/phone-number.d.ts +7 -0
  10. package/dist/base/data-types/internal/phone-number.js +12 -0
  11. package/dist/base/data-types/internal/phone-number.js.map +1 -0
  12. package/dist/base/form-schema.d.ts +4 -1
  13. package/dist/base/form-schema.js.map +1 -1
  14. package/dist/base/table-view/internal/auth.d.ts +9 -2
  15. package/dist/base/table-view/internal/auth.js +12 -6
  16. package/dist/base/table-view/internal/auth.js.map +1 -1
  17. package/dist/base/table-view/internal/factory-private-actions.js +1 -0
  18. package/dist/base/table-view/internal/factory-private-actions.js.map +1 -1
  19. package/dist/base/types/row-action.d.ts +7 -0
  20. package/dist/component-options/form-field.d.ts +5 -2
  21. package/dist/component-options/page-layout.d.ts +5 -2
  22. package/dist/component-options/page-layout.js.map +1 -1
  23. package/dist/component-options/row-action.d.ts +6 -0
  24. package/dist/db/internal/invite-token.d.ts +7 -0
  25. package/dist/db/internal/invite-token.js +14 -0
  26. package/dist/db/internal/invite-token.js.map +1 -0
  27. package/dist/db/internal/inviteResolutions.model.js +2 -1
  28. package/dist/db/internal/inviteResolutions.model.js.map +1 -1
  29. package/dist/db/models/tenantMembers.model.d.ts +0 -1
  30. package/dist/db/models/tenantMembers.model.js +0 -6
  31. package/dist/db/models/tenantMembers.model.js.map +1 -1
  32. package/dist/db/models/user_invites.model.d.ts +3 -3
  33. package/dist/db/models/user_invites.model.js +7 -6
  34. package/dist/db/models/user_invites.model.js.map +1 -1
  35. package/dist/db/tables/inviteResolutions.table.d.ts +3 -2
  36. package/dist/db/tables/inviteResolutions.table.js.map +1 -1
  37. package/dist/db/tables/user_invites.table.d.ts +5 -0
  38. package/dist/db/tables/user_invites.table.js.map +1 -1
  39. package/dist/hooks.d.ts +4 -1
  40. package/dist/hooks.js.map +1 -1
  41. package/dist/internal/invite-handout.d.ts +24 -0
  42. package/dist/internal/invite-handout.js +28 -0
  43. package/dist/internal/invite-handout.js.map +1 -0
  44. package/dist/internal/invite-replacement.js +0 -1
  45. package/dist/internal/invite-replacement.js.map +1 -1
  46. package/dist/invites.d.ts +18 -2
  47. package/dist/invites.js +75 -29
  48. package/dist/invites.js.map +1 -1
  49. package/dist/notifications/index.d.ts +8 -1
  50. package/dist/notifications/index.js +12 -0
  51. package/dist/notifications/index.js.map +1 -1
  52. package/dist/notifications/internal.d.ts +5 -1
  53. package/dist/notifications/internal.js +4 -0
  54. package/dist/notifications/internal.js.map +1 -1
  55. package/dist/notifications/sendable.js +10 -4
  56. package/dist/notifications/sendable.js.map +1 -1
  57. package/dist/notifications/types.d.ts +32 -6
  58. package/dist/page/internal/page-record.d.ts +2 -1
  59. package/dist/page/internal/page-record.js +51 -7
  60. package/dist/page/internal/page-record.js.map +1 -1
  61. package/dist/page/layout-filter.js +2 -6
  62. package/dist/page/layout-filter.js.map +1 -1
  63. package/dist/page/types.d.ts +2 -0
  64. package/dist/utils/internal/type-check.d.ts +7 -0
  65. package/dist/utils/internal/type-check.js +12 -1
  66. package/dist/utils/internal/type-check.js.map +1 -1
  67. package/docs/1.core/2.pages-and-modules.md +1 -0
  68. package/docs/1.core/5.tenancy.md +0 -1
  69. package/docs/1.core/6.invites.md +6 -6
  70. package/docs/1.core/7.hooks.md +1 -2
  71. package/docs/3.base/1.introduction.md +1 -1
  72. package/docs/3.base/11.page-layouts.md +2 -2
  73. package/docs/3.base/12.table-row-actions.md +1 -1
  74. package/docs/3.base/15.table-sources-and-gates.md +1 -1
  75. package/docs/3.base/2.types.md +1 -1
  76. package/docs/3.base/3.forms.md +1 -1
  77. package/docs/3.base/8.data-types.md +2 -2
  78. package/docs/4.notifications/1.introduction.md +1 -0
  79. package/docs/4.notifications/2.categories-and-subjects.md +4 -3
  80. package/docs/4.notifications/3.sending.md +3 -2
  81. package/docs/4.notifications/4.email.md +79 -0
  82. package/docs/index.md +1 -1
  83. package/package.json +2 -2
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.internal = void 0;
4
4
  const interface_core_1 = require("@antelopejs/interface-core");
5
+ const registry_1 = require("../page/internal/registry");
5
6
  /**
6
7
  * @internal
7
8
  */
@@ -9,6 +10,9 @@ var internal;
9
10
  (function (internal) {
10
11
  internal.RegisterNotificationCategory = new interface_core_1.RegisteringProxy();
11
12
  internal.RegisterNotificationSubject = new interface_core_1.RegisteringProxy();
13
+ internal.RegisterNotificationEmailChannel = new interface_core_1.RegisteringProxy();
14
+ /** Tells the registration a module unloads from the one that replaced it. */
15
+ internal.emailChannelIdentity = new registry_1.RegistrationIdentity("notification-email-channel");
12
16
  internal.SendToUser = (0, interface_core_1.InterfaceFunction)();
13
17
  internal.SendToUsers = (0, interface_core_1.InterfaceFunction)();
14
18
  internal.SendToRoles = (0, interface_core_1.InterfaceFunction)();
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/notifications/internal.ts"],"names":[],"mappings":";;;AAAA,+DAGoC;AAUpC;;GAEG;AACH,IAAiB,QAAQ,CAgDxB;AAhDD,WAAiB,QAAQ;IACV,qCAA4B,GAAG,IAAI,iCAAgB,EAE7D,CAAC;IACS,oCAA2B,GAAG,IAAI,iCAAgB,EAE5D,CAAC;IAES,mBAAU,GACrB,IAAA,kCAAiB,GAQd,CAAC;IAEO,oBAAW,GACtB,IAAA,kCAAiB,GAQd,CAAC;IAEO,oBAAW,GACtB,IAAA,kCAAiB,GAMd,CAAC;IAEO,kBAAS,GACpB,IAAA,kCAAiB,GAOd,CAAC;AACR,CAAC,EAhDgB,QAAQ,aAAR,QAAQ,GAAR,QAAQ,QAgDxB"}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/notifications/internal.ts"],"names":[],"mappings":";;;AAAA,+DAGoC;AAUpC,wDAAiE;AAEjE;;GAEG;AACH,IAAiB,QAAQ,CA0DxB;AA1DD,WAAiB,QAAQ;IACV,qCAA4B,GAAG,IAAI,iCAAgB,EAE7D,CAAC;IACS,oCAA2B,GAAG,IAAI,iCAAgB,EAE5D,CAAC;IAES,yCAAgC,GAAG,IAAI,iCAAgB,EAEjE,CAAC;IAEJ,6EAA6E;IAChE,6BAAoB,GAC/B,IAAI,+BAAoB,CACtB,4BAA4B,CAC7B,CAAC;IAES,mBAAU,GACrB,IAAA,kCAAiB,GAQd,CAAC;IAEO,oBAAW,GACtB,IAAA,kCAAiB,GAQd,CAAC;IAEO,oBAAW,GACtB,IAAA,kCAAiB,GAMd,CAAC;IAEO,kBAAS,GACpB,IAAA,kCAAiB,GAOd,CAAC;AACR,CAAC,EA1DgB,QAAQ,aAAR,QAAQ,GAAR,QAAQ,QA0DxB"}
@@ -5,6 +5,12 @@ const internal_1 = require("./internal");
5
5
  function deliveryOf(options) {
6
6
  return { dedupe: options.dedupe };
7
7
  }
8
+ /** The notification as sent: `options.tenantId`, when set, names its workspace. */
9
+ function sentData(data, options) {
10
+ return options.tenantId === undefined
11
+ ? data
12
+ : { ...data, tenantId: options.tenantId };
13
+ }
8
14
  class SendableNotification {
9
15
  data;
10
16
  constructor(data) {
@@ -16,10 +22,10 @@ class SendableNotification {
16
22
  * unless `dedupe: false` (see {@link DeliveryOptions}).
17
23
  */
18
24
  async toUser(userId, options = {}) {
19
- await internal_1.internal.SendToUser(userId, this.data, undefined, options.idempotencyKey, deliveryOf(options));
25
+ await internal_1.internal.SendToUser(userId, sentData(this.data, options), undefined, options.idempotencyKey, deliveryOf(options));
20
26
  }
21
27
  async toUsers(userIds, options = {}) {
22
- await internal_1.internal.SendToUsers(userIds, this.data, options.readScope, options.idempotencyKey, deliveryOf(options));
28
+ await internal_1.internal.SendToUsers(userIds, sentData(this.data, options), options.readScope, options.idempotencyKey, deliveryOf(options));
23
29
  }
24
30
  /** Sends a durable event once per recipient under `idempotencyKey`, including after dismissal. */
25
31
  async toUsersIdempotently(userIds, idempotencyKey, options = {}) {
@@ -27,10 +33,10 @@ class SendableNotification {
27
33
  }
28
34
  /** Sends to the holders of any of `roleIds`, in `options.tenantId` only when set. */
29
35
  async toRoles(roleIds, options = {}) {
30
- await internal_1.internal.SendToRoles(roleIds, this.data, options);
36
+ await internal_1.internal.SendToRoles(roleIds, sentData(this.data, options), options);
31
37
  }
32
38
  async broadcast(options = {}) {
33
- await internal_1.internal.SendToAll(this.data, options.readScope, options.idempotencyKey, deliveryOf(options));
39
+ await internal_1.internal.SendToAll(sentData(this.data, options), options.readScope, options.idempotencyKey, deliveryOf(options));
34
40
  }
35
41
  }
36
42
  exports.SendableNotification = SendableNotification;
@@ -1 +1 @@
1
- {"version":3,"file":"sendable.js","sourceRoot":"","sources":["../../src/notifications/sendable.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAQtC,SAAS,UAAU,CAAC,OAAoB;IACtC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AACpC,CAAC;AAED;IACmB,IAAI,CAAmB;IAExC,YAAY,IAAsB;QAChC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,OAAO,GAAgB,EAAE;QACpD,MAAM,mBAAQ,CAAC,UAAU,CACvB,MAAM,EACN,IAAI,CAAC,IAAI,EACT,SAAS,EACT,OAAO,CAAC,cAAc,EACtB,UAAU,CAAC,OAAO,CAAC,CACpB,CAAC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EAAE,OAAO,CAAC,EAC5B,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,cAAc,EACtB,UAAU,CAAC,OAAO,CAAC,CACpB,CAAC;IACJ,CAAC;CACF"}
@@ -20,6 +20,29 @@ export interface NotificationSubjectInfo {
20
20
  togglePermission?: TogglePermission;
21
21
  /** Translation key of a badge shown next to the subject label (`Developer mode`). */
22
22
  badgeKey?: string;
23
+ /**
24
+ * Whether the subject also reaches its recipients by e-mail, next to the
25
+ * in-app feed. `true` offers it off until the user turns it on;
26
+ * `{ defaultOn: true }` offers it on until the user turns it off. Unset or
27
+ * `false`: in-app only. E-mail is delivered only once a module registers
28
+ * the e-mail channel (`NotificationEmailChannel`).
29
+ */
30
+ email?: boolean | {
31
+ defaultOn?: boolean;
32
+ };
33
+ }
34
+ /**
35
+ * The e-mail channel a mail module registers. The DMS calls `deliver` once
36
+ * per stored in-app notification whose recipient has e-mail on for its
37
+ * subject.
38
+ */
39
+ export interface NotificationEmailChannelInfo {
40
+ /**
41
+ * Hands one notification to the channel, with the id of the in-app
42
+ * notification it follows. A rejection is logged and never fails the
43
+ * in-app delivery. Sends wait for it, so queue slow work.
44
+ */
45
+ deliver(userId: string, data: NotificationData, notificationId: string): Promise<void> | void;
23
46
  }
24
47
  /** How a delivery is stored, whoever receives it. */
25
48
  export interface DeliveryOptions {
@@ -35,17 +58,18 @@ export interface DeliveryOptions {
35
58
  }
36
59
  export interface SendOptions extends DeliveryOptions {
37
60
  readScope?: ReadScope;
61
+ /**
62
+ * The workspace the notification is about. The e-mail channel receives it
63
+ * in `NotificationData.tenantId`. `toRoles` also limits its recipients to
64
+ * this tenant's members holding the roles; without it, the holders are
65
+ * looked up in every tenant.
66
+ */
67
+ tenantId?: string;
38
68
  /** Stable event key, unique across notification producers. Retries preserve delivery and dismissal state. */
39
69
  idempotencyKey?: string;
40
70
  }
41
71
  /** Options of `toRoles`: a send to the holders of roles. */
42
72
  export interface RoleSendOptions extends SendOptions {
43
- /**
44
- * Only the members of this tenant holding the roles. Role ids belong to a
45
- * tenant, so a send about one tenant names it; without it, the holders are
46
- * looked up in every tenant.
47
- */
48
- tenantId?: string;
49
73
  }
50
74
  export interface NotificationData {
51
75
  icon: string;
@@ -56,5 +80,7 @@ export interface NotificationData {
56
80
  params?: Record<string, string | number>;
57
81
  /** Icon well colour; unset notifications use `primary` while unread, neutral once read. */
58
82
  tone?: NotificationTone;
83
+ /** The workspace the notification is about, from `SendOptions.tenantId`. */
84
+ tenantId?: string;
59
85
  }
60
86
  export type RequiredFields = "icon" | "title" | "description" | "subject";
@@ -19,7 +19,8 @@ export declare function readPageRecord(layout: ComponentInfo | undefined, contex
19
19
  * A header button as the page's record leaves it: unchanged when the layout
20
20
  * reads no record or the button does not act on it, left out (`undefined`)
21
21
  * when the record was not found, the `{{record.X}}` of its target's `url`
22
- * (and of an `api` target's `redirect`) filled in otherwise.
22
+ * (and of an `api` target's `redirect`), or of the options of the component a
23
+ * drawer, modal or side panel opens, filled in otherwise.
23
24
  *
24
25
  * @internal
25
26
  */
@@ -7,11 +7,15 @@ const type_check_1 = require("../../utils/internal/type-check");
7
7
  const RECORD_TOKEN = /\{\{\s*record\.([\w.-]+)\s*\}\}/g;
8
8
  const NAMES_RECORD = /\{\{\s*record\./;
9
9
  const PATH_SEPARATOR = ".";
10
+ const URL_OPTION = /(?:url|^to|^href)$/i;
11
+ const ROOT_KEY = "";
10
12
  const targetUrl = (target) => {
11
13
  const url = target?.url;
12
14
  return (0, type_check_1.isString)(url) ? url : undefined;
13
15
  };
14
16
  const targetRedirect = (target) => target?.type === "api" ? target.redirect : undefined;
17
+ const targetComponent = (target) => target && "component" in target ? target.component : undefined;
18
+ const namesRecord = (component) => NAMES_RECORD.test(JSON.stringify(component) ?? "");
15
19
  const isRecordNode = (value) => !!value && typeof value === "object";
16
20
  function leafAt(record, path) {
17
21
  const value = path
@@ -47,24 +51,60 @@ async function readPageRecord(layout, context) {
47
51
  function isRecordBound(button) {
48
52
  if (button.requiresRecord)
49
53
  return true;
54
+ if (namesRecord(targetComponent(button.target)))
55
+ return true;
50
56
  return [targetUrl(button.target), targetRedirect(button.target)].some((url) => !!url && NAMES_RECORD.test(url));
51
57
  }
58
+ const keepRaw = (value) => value;
52
59
  /**
53
- * A URL with its `{{record.X}}` tokens filled in, each value percent-encoded
54
- * (an address is one query value). A token the record has no value for is
55
- * left as written.
60
+ * A text with its `{{record.X}}` tokens filled in, each value written by
61
+ * `encode`: percent-encoded in a URL (an address is one query value). A token
62
+ * the record has no value for is left as written.
56
63
  */
57
- function fillRecordTokens(url, record) {
58
- return url.replace(RECORD_TOKEN, (match, path) => {
64
+ function fillRecordTokens(text, record, encode = encodeURIComponent) {
65
+ return text.replace(RECORD_TOKEN, (match, path) => {
59
66
  const value = leafAt(record, path);
60
- return value === undefined ? match : encodeURIComponent(String(value));
67
+ return value === undefined ? match : encode(String(value));
61
68
  });
62
69
  }
70
+ const isList = (value) => Array.isArray(value);
71
+ /**
72
+ * The options of a component a target opens with the `{{record.X}}` tokens of
73
+ * every string in them filled in, down their lists and object literals:
74
+ * percent-encoded under a key ending in `url`, or named `to` or `href`, raw
75
+ * under any other. Any other value is left as it is.
76
+ */
77
+ function fillRecordOptions(node, key, record) {
78
+ if ((0, type_check_1.isString)(node)) {
79
+ const encode = URL_OPTION.test(key) ? encodeURIComponent : keepRaw;
80
+ return fillRecordTokens(node, record, encode);
81
+ }
82
+ if (isList(node)) {
83
+ return node.map((item) => fillRecordOptions(item, key, record));
84
+ }
85
+ if (!(0, type_check_1.isPlainObject)(node))
86
+ return node;
87
+ return Object.fromEntries(Object.entries(node).map(([name, item]) => [
88
+ name,
89
+ fillRecordOptions(item, name, record),
90
+ ]));
91
+ }
92
+ function fillRecordComponent(component, record) {
93
+ return {
94
+ ...component,
95
+ options: fillRecordOptions(component.options, ROOT_KEY, record),
96
+ children: component.children?.map((child) => ({
97
+ ...child,
98
+ component: fillRecordComponent(child.component, record),
99
+ })),
100
+ };
101
+ }
63
102
  /**
64
103
  * A header button as the page's record leaves it: unchanged when the layout
65
104
  * reads no record or the button does not act on it, left out (`undefined`)
66
105
  * when the record was not found, the `{{record.X}}` of its target's `url`
67
- * (and of an `api` target's `redirect`) filled in otherwise.
106
+ * (and of an `api` target's `redirect`), or of the options of the component a
107
+ * drawer, modal or side panel opens, filled in otherwise.
68
108
  *
69
109
  * @internal
70
110
  */
@@ -76,6 +116,10 @@ record) {
76
116
  if (!record)
77
117
  return undefined;
78
118
  const { target } = button;
119
+ if (target && "component" in target) {
120
+ const component = fillRecordComponent(target.component, record);
121
+ return { ...button, target: { ...target, component } };
122
+ }
79
123
  if (!target || !("url" in target) || !(0, type_check_1.isString)(target.url))
80
124
  return button;
81
125
  const filled = { ...target, url: fillRecordTokens(target.url, record) };
@@ -1 +1 @@
1
- {"version":3,"file":"page-record.js","sourceRoot":"","sources":["../../../src/page/internal/page-record.ts"],"names":[],"mappings":";;;;AAAA,gEAA6D;AAM7D,gEAIyC;AAEzC,MAAM,YAAY,GAAG,kCAAkC,CAAC;AACxD,MAAM,YAAY,GAAG,iBAAiB,CAAC;AACvC,MAAM,cAAc,GAAG,GAAG,CAAC;AAI3B,MAAM,SAAS,GAAG,CAChB,MAAwD,EACpC,EAAE;IACtB,MAAM,GAAG,GAAG,MAAM,EAAE,GAAG,CAAC;IACxB,OAAO,IAAA,qBAAQ,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,MAAkC,EAAE,EAAE,CAC5D,MAAM,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AAEvD,MAAM,YAAY,GAAG,CAAC,KAAc,EAAoC,EAAE,CACxE,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AAEvC,SAAS,MAAM,CACb,MAA6C,EAC7C,IAA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,SAAS,EAAE,MAAM,CAAC,CAAC;QAChE,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;IACzD,CAAC;IACD,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,IAAA,qBAAQ,EAAC,MAAM,CAAC,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IAC1E,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;IACxE,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3D,MAAM,CAAC,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACvC,CAAC"}
@@ -23,15 +23,11 @@ const isGatedWatch = (value) => (0, type_check_1.isObject)(value) &&
23
23
  (!("requirePermission" in value) ||
24
24
  value.requirePermission === undefined ||
25
25
  (0, type_check_1.isString)(value.requirePermission));
26
- const isPlainObject = (value) => !!value &&
27
- typeof value === "object" &&
28
- (Object.getPrototypeOf(value) === Object.prototype ||
29
- Object.getPrototypeOf(value) === null);
30
26
  /** Whether `value` or anything nested in it carries `watchActions`. */
31
27
  function holdsWatchActions(value) {
32
28
  if (Array.isArray(value))
33
29
  return value.some(holdsWatchActions);
34
- return (isPlainObject(value) &&
30
+ return ((0, type_check_1.isPlainObject)(value) &&
35
31
  ("watchActions" in value || Object.values(value).some(holdsWatchActions)));
36
32
  }
37
33
  /**
@@ -55,7 +51,7 @@ value, permissions) {
55
51
  const items = await Promise.all(value.map((item) => filterRequiredPermissionWatches(item, permissions)));
56
52
  return items.every((item, index) => item === value[index]) ? value : items;
57
53
  }
58
- if (!isPlainObject(value))
54
+ if (!(0, type_check_1.isPlainObject)(value))
59
55
  return value;
60
56
  const entries = await Promise.all(Object.entries(value).map(async ([key, item]) => [
61
57
  key,
@@ -1 +1 @@
1
- {"version":3,"file":"layout-filter.js","sourceRoot":"","sources":["../../src/page/layout-filter.ts"],"names":[],"mappings":";;;AAMA,gDAA+C;AAC/C,6DAA0E;AAS1E,KAAK,UAAU,mBAAmB,CAChC,IAA6B,EAC7B,YAAoB,EACpB,WAAwB,EACxB,YAA8B,EAC9B,OAA+B;IAE/B,MAAM,QAAQ,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;IAE7B,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtD,QAAQ,CAAC,QAAQ,GAAG,MAAM,wBAAwB,CAChD,QAAQ,CAAC,QAAQ,EACjB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,OAAO,CACR,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC;IAC5D,IAAI,SAAS,EAAE,gBAAgB,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACpD,QAAQ,CAAC,OAAO,GAAG,MAAM,SAAS,CAAC,gBAAgB,CACjD,WAAW,EACX,QAAQ,CAAC,OAAO,EAChB,YAAY,EACZ,OAAO,CACR,CAAC;IACJ,CAAC;IAED,IAAI,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,QAAQ,CAAC,OAAO,GAAG,MAAM,+BAA+B,CACtD,QAAQ,CAAC,OAAO,EAChB,WAAW,CACZ,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAID,MAAM,MAAM,GAAG,CAAC,KAAc,EAAsB,EAAE,CAAC,KAAK,CAAC,OAAO,CA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AAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACvB,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE,GAAG,KAAK,CAAC;QACpD,OAAO;YACL,EAAE;YACF,SAAS,EAAE,MAAM,mBAAmB,CAClC,SAAS,EACT,GAAG,YAAY,IAAI,EAAE,EAAE,EACvB,WAAW,EACX,YAAY,EACZ,OAAO,CACR;YACD,GAAG,eAAe;SACnB,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC;AAEM,KAAK,2BACV,UAAmD,EACnD,QAAgB,EAChB,WAAwB,EACxB,YAA8B,EAC9B,OAA+B;IAE/B,MAAM,QAAQ,GAA4C,EAAE,CAAC;IAE7D,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACrD,MAAM,YAAY,GAAG,GAAG,QAAQ,IAAI,GAAG,EAAE,CAAC;QAC1C,IAAI,MAAM,IAAA,2BAAa,EAAC,WAAW,EAAE,YAAY,CAAC,EAAE,CAAC;YACnD,QAAQ,CAAC,GAAG,CAAC,GAAG,MAAM,mBAAmB,CACvC,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,OAAO,CACR,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -257,6 +257,8 @@ export interface MenuOptions {
257
257
  * status dot — the badge wins.
258
258
  */
259
259
  badge?: string;
260
+ /** Draws a first-level entry in the sidebar footer, above "Modules". */
261
+ placement?: "footer";
260
262
  /**
261
263
  * Default layout of the entry and of every page and sub-category declared
262
264
  * under it that sets none of its own (`Category("billing", { category,
@@ -38,6 +38,13 @@ export declare const isSymbol: (v: unknown) => v is symbol;
38
38
  export declare const isPrimitive: (value: unknown) => value is PrimitiveValue;
39
39
  /** @internal */
40
40
  export declare const isNull: (value: unknown) => value is null;
41
+ /**
42
+ * Whether `value` is an object literal (its prototype `Object.prototype` or
43
+ * `null`), not an array, a date or a class instance.
44
+ *
45
+ * @internal
46
+ */
47
+ export declare const isPlainObject: (value: unknown) => value is Record<string, unknown>;
41
48
  /** @internal */
42
49
  export declare const isDate: (value: unknown) => value is Date;
43
50
  /** @internal */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isJSON = exports.isDate = exports.isNull = exports.isPrimitive = exports.isSymbol = exports.isBigint = exports.isClass = exports.isFunction = exports.isObject = exports.isUndefined = exports.isBoolean = exports.isNumber = exports.isString = void 0;
3
+ exports.isJSON = exports.isDate = exports.isPlainObject = exports.isNull = exports.isPrimitive = exports.isSymbol = exports.isBigint = exports.isClass = exports.isFunction = exports.isObject = exports.isUndefined = exports.isBoolean = exports.isNumber = exports.isString = void 0;
4
4
  const primitiveTypes = [
5
5
  "string",
6
6
  "number",
@@ -48,6 +48,17 @@ exports.isPrimitive = isPrimitive;
48
48
  /** @internal */
49
49
  const isNull = (value) => value === null;
50
50
  exports.isNull = isNull;
51
+ /**
52
+ * Whether `value` is an object literal (its prototype `Object.prototype` or
53
+ * `null`), not an array, a date or a class instance.
54
+ *
55
+ * @internal
56
+ */
57
+ const isPlainObject = (value) => !!value &&
58
+ typeof value === "object" &&
59
+ (Object.getPrototypeOf(value) === Object.prototype ||
60
+ Object.getPrototypeOf(value) === null);
61
+ exports.isPlainObject = isPlainObject;
51
62
  /** @internal */
52
63
  const isDate = (value) => value instanceof Date && !Number.isNaN(value.getTime());
53
64
  exports.isDate = isDate;
@@ -1 +1 @@
1
- {"version":3,"file":"type-check.js","sourceRoot":"","sources":["../../../src/utils/internal/type-check.ts"],"names":[],"mappings":";;;AAEA,MAAM,cAAc,GAAG;IACrB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,QAAQ;IACR,QAAQ;CACA,CAAC;AA6BX,MAAM,eAAe,GACnB,CAAI,IAAkB,EAA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,KAAc,EAAiB,EAAE,CACtD,KAAK,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AAD7C,QAAA,MAAM,GAAN,MAAM,CACuC;AAE1D,gBAAgB;AAChB,4JAA4J;AACrJ,MAAM,MAAM,GAAG,CAAC,KAAc,EAAW,EAAE;IAChD,IAAI,CAAC,IAAA,QAAA,QAAQ,EAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1C,OAAO,IAAA,QAAA,QAAQ,EAAC,MAAM,CAAC,IAAI,CAAC,IAAA,QAAA,MAAM,EAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,MAAM,GAAN,MAAM,CAUjB"}
@@ -73,6 +73,7 @@ The third argument is the page layout, a `ComponentInfo` from a layout builder s
73
73
  | `variant` | `MenuItemVariant` | Semantic look of the entry. |
74
74
  | `status` | `MenuItemStatus` | Semantic state dot at the end of the entry. |
75
75
  | `badge` | `string` | Short count or label at the end of the entry (`3`, `new`). It takes the place of `status` and of a counted navigation badge. |
76
+ | `placement` | `"footer"` | Draws a first-level entry in the sidebar footer, above "Modules". |
76
77
  | `layout` | `ComponentInfo` | Default layout of the entry and of every page and category under it that sets none. The nearest declaring ancestor wins, and a page's layout argument always overrides it. |
77
78
  | `bypassTenantAccessGate` | `boolean` | Keeps the page reachable while a tenant access gate denies the tenant. The pages of a flagged category inherit it. |
78
79
  | `live` | `PageLiveOptions` | Gives the page a Live and Pause state over the realtime of its blocks. Read on pages only. |
@@ -102,7 +102,6 @@ Table `tenant_members` in `dms-tenant`. It holds one row per member of the tenan
102
102
  | ------ | ------- |
103
103
  | `getByUser(userId)` | `Promise<TenantMember \| undefined>` |
104
104
  | `existsByUser(userId)` | `Promise<boolean>` |
105
- | `listAll()` | `Promise<TenantMember[]>` |
106
105
  | `listOwners()` | `Promise<TenantMember[]>`, the members with `isTenantOwner` set |
107
106
  | `listByUserWithTenantIds(userId)` | `Promise<Array<{ tenantId: string; member: TenantMember }>>` |
108
107
  | `getOldestByUser(userId)` | `Promise<{ tenantId: string; member: TenantMember } \| undefined>`, the row with the earliest `joinedAt` |
@@ -61,7 +61,7 @@ type InviteUserToTenantResult =
61
61
  interface InvitedUserResult {
62
62
  kind: "invited";
63
63
  inviteId: string;
64
- token: string;
64
+ token?: string; // with sendEmail always; otherwise only for the call that created the invite row
65
65
  emailDelivery?: InviteEmailDelivery; // only with sendEmail + awaitEmailDelivery
66
66
  }
67
67
  ```
@@ -120,11 +120,11 @@ const { inviteId, token } = await createUserInviteToken({
120
120
  | `replacementReason` | `"replaced" \| "resent"` | How to report the retirement of an invitation this one displaces. Defaults to `"replaced"`. A resend passes `"resent"`, which reissues the same invitation, so contributors do not undo what it carries. |
121
121
  | `replacesInvite` | `UserInvite` | The exact incarnation to replace, including a retained snapshot during a retry. |
122
122
 
123
- `CreateUserInviteTokenResult` is `{ inviteId: string; token: string }`.
123
+ `CreateUserInviteTokenResult` is `{ inviteId: string; token?: string }`. The row stores only the SHA-256 digest of the token, so the token cannot be read back: only the call that created the row receives it. Keep it to build the link. To get a new link later, call `reissueUserInvite(tenantId, invite, invitedBy?)`: it reissues the invitation under a fresh token, which retires its earlier link, and returns `{ inviteId, token }`. A call that loses to a concurrent reissue reissues the winner in turn, so it always returns a token that works, and fails with HTTP 409 when the invitation was retired meanwhile.
124
124
 
125
125
  An existing invite for the same email in the same tenant is retired through a durable decision. Completion invokes `Hook.INVITE_DELETED` for the old invitation, creates the replacement through `Hook.INVITE_BEING_CREATED` and `Hook.INVITE_CREATED`, and removes the old row. A failed completion can replay hooks with the same delivery identity. See [Durable invite resolution](#durable-invite-resolution) and [Hooks](/docs/interfaces/core/hooks).
126
126
 
127
- When concurrent calls for one email all find no invite, the tenant keeps one. A unique index on `email` and `creationResolutionId` refuses the second row. The call that loses returns the kept invite's `inviteId` and `token` when it asked for the same content, and fails with HTTP 409 when it did not.
127
+ When concurrent calls for one email all find no invite, the tenant keeps one. A unique index on `email` and `creationResolutionId` refuses the second row. The call that loses returns the kept invite's `inviteId`, without a `token`, when it asked for the same content, and fails with HTTP 409 when it did not. With `sendEmail`, `inviteUserToTenant` reissues that invite under a new token before it emails it, since the call that created the row may have failed before sending.
128
128
 
129
129
  `inviteeDisplayName(firstname?, lastname?)` joins the two names into the name the invite email uses, and returns `undefined` when the invite carries neither. `inviteUserToTenant` calls it for you. Call it yourself when you render your own invite screen from a stored row, so a nameless invite falls back the same way the email does.
130
130
 
@@ -155,7 +155,7 @@ Table `user_invites` in the `dms-tenant` schema, so invites are per tenant, like
155
155
  | `lastname` | `string \| null` | Invitee's last name, when the invite carried one. |
156
156
  | `roles_ids` | `string[]` | Related to `Role`, many. Roles to grant on redemption. |
157
157
  | `language` | `string` | Language the invite was issued in. |
158
- | `token` | `string` | The secret handed to the invitee. Indexed across tenant instances. |
158
+ | `token` | `string` | SHA-256 hex digest of the secret handed to the invitee, never the secret itself. Indexed across tenant instances. |
159
159
  | `asTenantOwner` | `boolean` | Grant tenant ownership on redemption. |
160
160
  | `expiresAt` | `Date` | `INVITE_EXPIRY_DAYS` after creation. Indexed across tenant instances. |
161
161
  | `creationResolutionId` | `string`, optional | Set on a replacement. The replacement is actionable only after the resolution that created it completes. |
@@ -171,9 +171,9 @@ The field is `roles_ids`, not `roleIds`. The membership field `roleIds` lives on
171
171
  | Method | Returns |
172
172
  | ------ | ------- |
173
173
  | `getByEmail(email)` | `Promise<UserInvite \| undefined>` |
174
- | `getByToken(token)` | `Promise<UserInvite \| undefined>` |
174
+ | `getByToken(token)` | `Promise<UserInvite \| undefined>`. Takes the token a link carries and looks up its digest. |
175
175
  | `getByTokenWithTenant(token)` | `Promise<{ invite: UserInvite; tenantId: string } \| undefined>` |
176
- | `deleteByToken(token)` | Deletes every row that carries the token. |
176
+ | `deleteByToken(token)` | Deletes every row that carries the token's digest. |
177
177
 
178
178
  `getByEmail` trims and lowercases its argument the same way the stored email is, so the casing a caller passes does not matter.
179
179
 
@@ -112,7 +112,6 @@ interface InviteHookPayload {
112
112
 
113
113
  interface InviteCreatedHookPayload extends InviteHookPayload {
114
114
  inviteId: string;
115
- token: string;
116
115
  }
117
116
 
118
117
  type InviteDeletedReason =
@@ -180,7 +179,7 @@ Read `kind` first and return early for the kinds your policy does not limit. An
180
179
 
181
180
  `UserDeletedHookPayload.tenantIds` lists the workspaces the user was a member of. The user left all of them before the deletion. A module deletes the per-user rows it keeps in them. `reason` is `"self"` today, a user deleting their own account.
182
181
 
183
- `InviteCreatedHookPayload` carries the invite `token`. The token is a signup credential, so keep it inside the handler and do not forward it.
182
+ `InviteCreatedHookPayload` carries no token. An invitation stores only the digest of its token, and a creation replayed after a failure has nothing else to hand out.
184
183
 
185
184
  `TenantProvisioningHookPayload.extras` is opaque. The DMS reads no key of it, validates nothing and stores nothing. See [Enrich a workspace being provisioned](#enrich-a-workspace-being-provisioned).
186
185
 
@@ -166,7 +166,7 @@ export class SettingsPage extends PageController(
166
166
 
167
167
  @Post("/")
168
168
  async write(@JSONBody() body: unknown) {
169
- const result = formSchema(SettingsPage.form).safeParse(body);
169
+ const result = await formSchema(SettingsPage.form).safeParseAsync(body);
170
170
  assert(result.success, 400, "Invalid settings");
171
171
  await this.settingsModel.table.insert({
172
172
  _id: SETTINGS_ROW_ID,
@@ -100,7 +100,7 @@ DefaultLayout({
100
100
 
101
101
  #### Buttons that follow the page URL
102
102
 
103
- A page scoped by its URL, such as `?workspace=web` or a record id in the path, declares its buttons once and lets them follow the URL. A target's URL (`page`, `external`, `download`, `api`, `exportJob`) takes the tokens of a block's `fetchUrl`: `{{params.X}}` is filled with the route parameter `X` of the page, `{{query.X}}` with its query parameter `X`, percent-encoded, again whenever the URL changes. A query pair whose value is a token the page has no value for is left out (`?workspace={{query.workspace}}` on a page without `?workspace=` leads to the target's default), and any other token without a value is left empty. A `download` target's `filename` takes the same tokens, written as they are; while one has no value, the file is saved under the server's name:
103
+ A page scoped by its URL, such as `?workspace=web` or a record id in the path, declares its buttons once and lets them follow the URL. A target's URL (`page`, `external`, `download`, `api`, `exportJob`) takes the tokens of a block's `fetchUrl`: `{{params.X}}` is filled with the route parameter `X` of the page, `{{query.X}}` with its query parameter `X`, percent-encoded, again whenever the URL changes. A query pair whose value is a token the page has no value for is left out (`?workspace={{query.workspace}}` on a page without `?workspace=` leads to the target's default), and any other token without a value is left empty. A `download` target's `filename` takes the same tokens, written as they are; while one has no value, the file is saved under the server's name. The block a `drawer`, `modal` or `sidePanel` target opens receives the page's route parameters as every block of the page does, so its own `fetchUrl: "/api/sites/{{params.id}}"` is filled the same way:
104
104
 
105
105
  ```ts fragment
106
106
  {
@@ -145,7 +145,7 @@ Who sees a button is settled on the server when the layout is served: a button w
145
145
 
146
146
  #### Buttons acting on the page's record
147
147
 
148
- A page about one record (a site, an invoice) reads it with its layout: `record` is a function the server calls each time it serves the layout, with the request's context (the page URL's `params` and `query`, the `user` and the `tenantId`), and answers the record, or `undefined` when there is none to show. A button's target names its fields as `{{record.X}}`, filled in by the server and percent-encoded: a maps link to the site's address, an API call on its own id. A button acting on the record, one whose target names `{{record.X}}` or declaring `requiresRecord: true` (an "Edit" link that only needs `{{params.id}}`), is left out of a page whose record was not found, or whose `record` threw (logged). Every `availability` of the page reads the record as `context.record`, so a button can be disabled on the record's state without reading it again:
148
+ A page about one record (a site, an invoice) reads it with its layout: `record` is a function the server calls each time it serves the layout, with the request's context (the page URL's `params` and `query`, the `user` and the `tenantId`), and answers the record, or `undefined` when there is none to show. A button's target names its fields as `{{record.X}}`, filled in by the server and percent-encoded: a maps link to the site's address, an API call on its own id. A `drawer`, `modal` or `sidePanel` target takes them in the options of its component and of the blocks inside it (`fetchUrl: "/api/sites/{{record._id}}"`, `submitDefaults: { name: "{{record.name}}" }`): a string under a URL option (a key ending in `url`, or named `to` or `href`) has each field percent-encoded, any other string takes it as written. A token names a field holding a string or a number; any other is left as written. A button acting on the record, one whose target names `{{record.X}}` or declaring `requiresRecord: true` (an "Edit" link that only needs `{{params.id}}`), is left out of a page whose record was not found, or whose `record` threw (logged). Every `availability` of the page reads the record as `context.record`, so a button can be disabled on the record's state without reading it again:
149
149
 
150
150
  ```typescript
151
151
  import { BasicDataModel, Field, GetModel, RegisterTable, Table } from "@antelopejs/interface-database-decorators";
@@ -68,7 +68,7 @@ Permissions are applied on top. The table view registers `list` and `select` as
68
68
 
69
69
  Several pages may each mount their own `TableView` over one data controller, and they all share its data routes. A read action (`list`, `select`, `view`, `export`, `viewArchived`) accepts the permission from any table view a page mounts on that controller; a write action (`add`, `edit`, `delete`, `archive`, `restore`) accepts only the writing table view's, so a user granted `add` on a read-only table view cannot create rows. A read-only table view still declares the write actions the controller offers: while no table view writes through the controller, they keep its write routes behind permission ids nobody is granted by default. The inline add button of a relation field pointing at the controller follows the same rule (`addPermissionIds`).
70
70
 
71
- A `new` or `edit` `ResourceForm` block over the controller submits to the same routes, so the native files staged from its fields are accepted on save as well, alongside those of the writing table view. It adds no permission of its own to the union: the routes still require the action's permission from a table view of the controller when one is mounted, exactly as for the block's other fields. The `new` and `edit` forms a page-mode table view mounts on its form sub-pages count the same way: each is a component of its own sub-page, so the files staged from it are accepted on save, under the same table view permissions.
71
+ A `new` or `edit` `ResourceForm` block over the controller submits to the same routes, so the native files staged from its fields are accepted on save as well, alongside those of the writing table view. It adds no permission of its own to the union: the routes still require the action's permission from a mounted table view of the controller, and refuse everyone but a platform owner when none declares it, exactly as for the block's other fields. The `new` and `edit` forms a page-mode table view mounts on its form sub-pages count the same way: each is a component of its own sub-page, so the files staged from it are accepted on save, under the same table view permissions.
72
72
 
73
73
  `TableViewRowActionOptionsSerialized` is the transported shape: rules and flags untyped, `custom` as `CustomRowActionSerialized[]`, plus a `showArchived?: boolean` field the builder fills from the `viewArchived` permission.
74
74
 
@@ -21,7 +21,7 @@ A read-only table view with no data controller (`tableViewFromSource`). `TableVi
21
21
  Data routes are registered against the controller, not against a page, so the opt-out is controller-level and **latched**: once any `TableView()` call on a controller declares it, the controller's routes bypass the gate wherever they are rendered. A later registration of the same controller without the flag cannot re-gate them, and gets a warning saying so. Two consequences worth designing around:
22
22
 
23
23
  - Declaring the flag on a controller opens its routes for every table view built on it, including one mounted on an ordinary page.
24
- - Actions that carry no permission id, such as a plain list on a component that was never mounted, are then served to any member of a denied tenant. That is the escape hatch working as intended, so keep every action of a flagged controller stamped with a permission.
24
+ - An action that carries no permission id, such as a plain list on a component that was never mounted, stays behind the gate, and in an admitted tenant answers 403 to everyone but a platform owner. Keep every action a flagged controller serves stamped with a permission.
25
25
 
26
26
  ## Write to an external connection
27
27
 
@@ -355,7 +355,7 @@ const createdAtBehavior = {
355
355
 
356
356
  ### Field values
357
357
 
358
- `DefaultValue` and `FormFieldValue` are the same recursive union: `string | number | boolean | Date | null` and arrays of themselves. `DefaultValue` types `FormField.defaultValue` and `ColumnOptions.defaultValue`; `FormFieldValue` types a value held by a form field.
358
+ `DefaultValue` is the recursive union `string | number | boolean | Date | null`, arrays of itself, and objects of itself (a row of an `ArrayType` field). `FormFieldValue` holds the same scalars, `Record<string, string>` and arrays of itself. `DefaultValue` types `FormField.defaultValue` and `ColumnOptions.defaultValue`; `FormFieldValue` types a value held by a form field.
359
359
 
360
360
  ### `ComponentOrNoInput`
361
361
 
@@ -294,7 +294,7 @@ The option interfaces live in the same namespace. The ones with more than a plac
294
294
  | `TextareaOptions` | `placeholder?`, `rows?`, `maxLength?`, `showCount?` |
295
295
  | `InputNumberOptions` | `min?`, `max?`, `step?`, `placeholder?`, `suffix?`, `clamp?` (`InputNumber` only: `false` keeps a value outside `min` / `max` as typed and reports it under the field instead of clamping it on blur), `width?: InputWidth` |
296
296
  | `InputTimeOptions` | `min?`, `max?`, `placeholder?` |
297
- | `InputPhoneOptions` | `placeholder?`, `requiredPrefix?` |
297
+ | `InputPhoneOptions` | `placeholder?`, `requiredPrefix?`, `defaultCountry?` |
298
298
  | `InputPasswordOptions` | `placeholder?`, `minLength?`, `confirmPassword?`, `confirmPlaceholder?` |
299
299
  | `SliderOptions` | `min?`, `max?`, `step?` |
300
300
  | `CalendarOptions` | `range?`, `multiple?`, `minDate?`, `maxDate?` |
@@ -275,7 +275,7 @@ The ordering modes and `is_between` send a date value to the value proxy as epoc
275
275
  | `EmailTypeOptions`, `ColorTypeOptions`, `RichTextTypeOptions` | `placeholder?`, `fallback?` |
276
276
  | `UrlTypeOptions` | `placeholder?`, `preview?` (`"avatar"` \| `"image"`: shown read-only, the URL is drawn as the image it points to; the form still edits it as text), `fallback?` |
277
277
  | `PasswordTypeOptions` | `placeholder?`, `minLength?`, `confirmPassword?`, `confirmPlaceholder?`, `fallback?` |
278
- | `PhoneTypeOptions` | `placeholder?`, `requiredPrefix?`, `fallback?` |
278
+ | `PhoneTypeOptions` | `placeholder?`, `requiredPrefix?`, `defaultCountry?`, `fallback?` |
279
279
  | `StringTimeTypeOptions` | `placeholder?`, `min?`, `max?`, `fallback?` |
280
280
 
281
281
  Notes on the ones whose behaviour is not obvious from the options:
@@ -290,7 +290,7 @@ Notes on the ones whose behaviour is not obvious from the options:
290
290
  - `SelectType` validates against the `value`s of its `items`, as an enum or an array of that enum when `multiple` is set.
291
291
  - `PriceType` is a `NumberType` whose options default to `min: 0` and `step: 0.01`.
292
292
  - `PercentageType` is a `NumberType` whose options default to `min: 0`, `max: 1` and `step: 0.01`; the stored value is a fraction while the input works in whole percent.
293
- - `PhoneType` only validates the E.164 pattern when `requiredPrefix` is set; otherwise any string passes.
293
+ - `PhoneType` keeps any string when neither `defaultCountry` nor `requiredPrefix` is set. With `defaultCountry` (an ISO 3166-1 alpha-2 code such as `"BE"`), a value is valid only when it is a possible number of its country. A number without a `+` or `00` prefix is read in `defaultCountry`. The schema transforms the value to E.164 (`"0494 66 94 43"` becomes `"+32494669443"`), so it is stored in that form. `requiredPrefix` applies the same rule but refuses a national number. A refused value carries the issue message `$dms.field_errors.invalid_phone`. The DMS module reads the number, so parse a schema holding such a field with `safeParseAsync`.
294
294
  - `ColorType` validates a six-digit `#RRGGBB` string.
295
295
  - `StringTimeType` validates a **number**: a time of day expressed as a number, bounded by `min` and `max`.
296
296
 
@@ -21,6 +21,7 @@ The [Read notifications](/docs/auth-and-tenancy/authentication#read-notification
21
21
  - **Four dispatch targets.** You send to one user, to a list of users, to every user holding at least one of a set of roles, or to every user.
22
22
  - **Shared or individual read state.** A multi-recipient send can give each recipient their own read state. It can also group the copies, so that one recipient reading the notification marks it read for all of them.
23
23
  - **Preference-aware delivery.** The DMS skips a send without an error for a user who turned the subject off. `togglePermission` marks the subjects that users may not turn off.
24
+ - **E-mail.** A subject can offer e-mail next to the app, and a mail module registers the channel that sends it. See [E-mail](/docs/interfaces/notifications/email).
24
25
 
25
26
  ## Dependencies
26
27
 
@@ -10,7 +10,7 @@ You declare categories and subjects by calling `NotificationCategory()` and `Not
10
10
 
11
11
  Declarations are function calls, not decorators. They run when the module that contains them is imported. Declare them at the top level of a module that is imported during startup, so the taxonomy is complete before the first notification is sent.
12
12
 
13
- The [Notification preferences](/docs/auth-and-tenancy/authentication#notification-preferences) walkthrough shows the System category expanded to its subjects, and describes the locked General subject in prose. Its Email column is marked **Soon**. These switches control in-app delivery, not the transactional authentication emails.
13
+ The [Notification preferences](/docs/auth-and-tenancy/authentication#notification-preferences) walkthrough shows the System category expanded to its subjects, and describes the locked General subject in prose. The Email column holds a switch for each subject that offers e-mail once a module registers the e-mail channel, and is marked **Soon** otherwise (see [E-mail](/docs/interfaces/notifications/email)). These switches control notifications, not the transactional authentication emails.
14
14
 
15
15
  ## Declaring a category
16
16
 
@@ -88,6 +88,7 @@ export const stockSubject = NotificationSubject("stock", {
88
88
  | `descriptionKey` | `string` (optional) | Translation key for a longer description. |
89
89
  | `togglePermission` | [`TogglePermission`](#toggle-permissions) (optional) | Whether users may turn this subject off. The DMS reads it together with the category's value. |
90
90
  | `badgeKey` | `string` (optional) | Translation key of a badge that the settings screen shows next to the subject label, for example `Developer mode`. |
91
+ | `email` | `boolean \| { defaultOn?: boolean }` (optional) | Whether the subject also reaches its recipients by e-mail: `true` (off until the user turns it on) or `{ defaultOn: true }` (on until the user turns it off). In-app only when unset. See [E-mail](/docs/interfaces/notifications/email). |
91
92
 
92
93
  A subject carries the whole category object, not only its id, so `subject.category.id` is always available from a subject you hold. A send uses it to build the preference key from the subject you passed to the builder.
93
94
 
@@ -123,8 +124,8 @@ Every other combination leaves the subject toggleable. The value on a category a
123
124
  A locked subject behaves the same way everywhere:
124
125
 
125
126
  - The settings screen shows its switch disabled, with a hint.
126
- - The preferences route refuses a change that turns it off, with HTTP 403.
127
- - Every dispatch method delivers it whatever preference the user has stored for it.
127
+ - The preferences route refuses a change that turns it off, with HTTP 403, in the app or by e-mail when it offers e-mail.
128
+ - Every dispatch method delivers it whatever preference the user has stored for it, by e-mail too when it offers e-mail.
128
129
 
129
130
  For a notification a user must always receive, declare `togglePermission: "forbidden"` on the subject **and** `togglePermission: "default"` on its category. `SystemCategory` declares `"default"`, which is what makes `GeneralSubject` mandatory.
130
131