@antelopejs/interface-dms 0.17.3 → 0.17.4-next.1135.gc1cba20

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 (69) hide show
  1. package/README.md +9 -9
  2. package/dist/auth/index.d.ts +42 -0
  3. package/dist/auth/index.js +40 -0
  4. package/dist/auth/index.js.map +1 -1
  5. package/dist/base/data-types/default/identifiers.d.ts +62 -0
  6. package/dist/base/data-types/default/identifiers.js +183 -0
  7. package/dist/base/data-types/default/identifiers.js.map +1 -0
  8. package/dist/base/data-types/default/options.d.ts +30 -0
  9. package/dist/base/data-types/default-types.d.ts +10 -0
  10. package/dist/base/data-types/default-types.js +5 -0
  11. package/dist/base/data-types/default-types.js.map +1 -1
  12. package/dist/base/data-types/internal/legal-identifiers.d.ts +36 -0
  13. package/dist/base/data-types/internal/legal-identifiers.js +191 -0
  14. package/dist/base/data-types/internal/legal-identifiers.js.map +1 -0
  15. package/dist/base/form-schema.d.ts +32 -0
  16. package/dist/base/form-schema.js +9 -0
  17. package/dist/base/form-schema.js.map +1 -1
  18. package/dist/base/internal/column-badges.d.ts +3 -2
  19. package/dist/base/internal/column-badges.js +4 -3
  20. package/dist/base/internal/column-badges.js.map +1 -1
  21. package/dist/base/layouts.d.ts +1 -1
  22. package/dist/base/layouts.js.map +1 -1
  23. package/dist/base/table-view/internal/group-order.d.ts +26 -0
  24. package/dist/base/table-view/internal/group-order.js +50 -0
  25. package/dist/base/table-view/internal/group-order.js.map +1 -0
  26. package/dist/base/table-view/internal/grouped-pinned.d.ts +6 -0
  27. package/dist/base/table-view/internal/grouped-pinned.js +19 -0
  28. package/dist/base/table-view/internal/grouped-pinned.js.map +1 -0
  29. package/dist/base/table-view/internal/option-contract.d.ts +3 -3
  30. package/dist/base/table-view/internal/option-displays.d.ts +30 -0
  31. package/dist/base/table-view/internal/option-expandable.d.ts +12 -0
  32. package/dist/base/table-view/internal/validation.d.ts +22 -4
  33. package/dist/base/table-view/internal/validation.js +29 -8
  34. package/dist/base/table-view/internal/validation.js.map +1 -1
  35. package/dist/base/table-view/options.d.ts +1 -0
  36. package/dist/base/table-view/schema.d.ts +2 -0
  37. package/dist/base/table-view/schema.js +8 -0
  38. package/dist/base/table-view/schema.js.map +1 -1
  39. package/dist/base/table-view.d.ts +1 -1
  40. package/dist/base/table-view.js.map +1 -1
  41. package/dist/component-options/data-type.js +3 -3
  42. package/dist/component-options/data-type.js.map +1 -1
  43. package/dist/component-options/internal/data-type-registry.d.ts +14 -0
  44. package/dist/component-options/internal/data-type-registry.js +19 -0
  45. package/dist/component-options/internal/data-type-registry.js.map +1 -0
  46. package/dist/component-options/page-layout.d.ts +29 -1
  47. package/dist/component-options/page-layout.js +8 -2
  48. package/dist/component-options/page-layout.js.map +1 -1
  49. package/dist/db/tables/tenants.table.d.ts +7 -1
  50. package/dist/db/tables/tenants.table.js +11 -7
  51. package/dist/db/tables/tenants.table.js.map +1 -1
  52. package/dist/page/internal/layout-filter.js +1 -1
  53. package/dist/page/internal/layout-filter.js.map +1 -1
  54. package/dist/period-request.d.ts +66 -0
  55. package/dist/period-request.js +149 -0
  56. package/dist/period-request.js.map +1 -0
  57. package/dist/request-tenant.d.ts +2 -1
  58. package/dist/request-tenant.js +2 -1
  59. package/dist/request-tenant.js.map +1 -1
  60. package/docs/1.core/12.frontend-modules-and-request-helpers.md +21 -1
  61. package/docs/1.core/5.tenancy.md +1 -1
  62. package/docs/2.auth/1.introduction.md +1 -1
  63. package/docs/2.auth/2.authentication.md +68 -0
  64. package/docs/3.base/11.page-layouts.md +18 -1
  65. package/docs/3.base/16.identifier-types.md +27 -0
  66. package/docs/3.base/4.tables.md +3 -3
  67. package/docs/3.base/8.data-types.md +7 -0
  68. package/docs/5.html-render/2.built-in-emails.md +2 -0
  69. package/package.json +7 -7
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Period = void 0;
4
+ exports.readPeriodRequest = readPeriodRequest;
5
+ const interface_api_1 = require("@antelopejs/interface-api");
6
+ const decorators_1 = require("@antelopejs/interface-core/decorators");
7
+ const period_selector_1 = require("./base/period-selector");
8
+ const type_check_1 = require("./utils/internal/type-check");
9
+ const HTTP_BAD_REQUEST = 400;
10
+ const TIME_ZONE_COOKIE = "dms-time-zone";
11
+ const COOKIE_SEPARATOR = ";";
12
+ const COOKIE_ASSIGNMENT = "=";
13
+ /** An instant as `Date.toISOString` writes it, or with an explicit offset. */
14
+ const ISO_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})$/;
15
+ function refuse(sentence) {
16
+ throw new interface_api_1.HTTPResult(HTTP_BAD_REQUEST, sentence);
17
+ }
18
+ function isOneOf(values, value) {
19
+ return values.some((entry) => entry === value);
20
+ }
21
+ function readInstant(query, key) {
22
+ const text = query.get(key);
23
+ if (text === null)
24
+ return undefined;
25
+ const time = ISO_INSTANT.test(text) ? Date.parse(text) : Number.NaN;
26
+ if (Number.isNaN(time)) {
27
+ refuse(`The period's "${key}" must be an ISO instant such as 2026-10-01T00:00:00.000Z, not "${text}".`);
28
+ }
29
+ return new Date(time);
30
+ }
31
+ function readWindow(query, fromKey, toKey) {
32
+ const from = readInstant(query, fromKey);
33
+ const to = readInstant(query, toKey);
34
+ if (!from && !to)
35
+ return undefined;
36
+ if (!from || !to) {
37
+ refuse(`The period sends "${from ? fromKey : toKey}" without "${from ? toKey : fromKey}": a window needs both.`);
38
+ }
39
+ if (from.getTime() > to.getTime()) {
40
+ refuse(`The period's "${fromKey}" falls after its "${toKey}".`);
41
+ }
42
+ return { from, to };
43
+ }
44
+ function readPreset(query) {
45
+ const text = query.get("preset");
46
+ if (text === null)
47
+ return undefined;
48
+ if (!isOneOf(period_selector_1.PERIOD_PRESETS, text)) {
49
+ refuse(`The period names the preset "${text}", which is none of ${period_selector_1.PERIOD_PRESETS.join(", ")}.`);
50
+ }
51
+ return text;
52
+ }
53
+ function readComparison(query, compare) {
54
+ const text = query.get("comparison");
55
+ if (text !== null && !isOneOf(period_selector_1.PERIOD_COMPARISONS, text)) {
56
+ refuse(`The period names the comparison "${text}", which is none of ${period_selector_1.PERIOD_COMPARISONS.join(", ")}.`);
57
+ }
58
+ if (!compare)
59
+ return "none";
60
+ if (text === "none") {
61
+ refuse(`The period compares with nothing but sends "compareFrom" and "compareTo".`);
62
+ }
63
+ return text ?? "custom";
64
+ }
65
+ function checkPresetBounds(preset, range) {
66
+ if (preset === "all" && range) {
67
+ refuse(`The period "all" has no bounds, but it sends "from" and "to".`);
68
+ }
69
+ if (preset && preset !== "all" && !range) {
70
+ refuse(`The period "${preset}" sends no "from" and "to": the selector sends the window it resolved.`);
71
+ }
72
+ }
73
+ function isKnownTimeZone(timeZone) {
74
+ try {
75
+ new Intl.DateTimeFormat("en", { timeZone });
76
+ return true;
77
+ }
78
+ catch {
79
+ return false;
80
+ }
81
+ }
82
+ /** The cookie's text: the dashboard writes it URI-encoded JSON (`%22Europe%2FBrussels%22`). */
83
+ function decodedCookie(value) {
84
+ try {
85
+ const text = decodeURIComponent(value);
86
+ if (!text.startsWith('"'))
87
+ return text;
88
+ const parsed = JSON.parse(text);
89
+ return (0, type_check_1.isString)(parsed) ? parsed : undefined;
90
+ }
91
+ catch {
92
+ return undefined;
93
+ }
94
+ }
95
+ function readTimeZone(cookie) {
96
+ if (!cookie)
97
+ return undefined;
98
+ for (const pair of cookie.split(COOKIE_SEPARATOR)) {
99
+ const at = pair.indexOf(COOKIE_ASSIGNMENT);
100
+ if (at === -1 || pair.slice(0, at).trim() !== TIME_ZONE_COOKIE)
101
+ continue;
102
+ const zone = decodedCookie(pair.slice(at + 1).trim());
103
+ return zone && isKnownTimeZone(zone) ? zone : undefined;
104
+ }
105
+ return undefined;
106
+ }
107
+ /**
108
+ * The period a `PeriodSelector` sent with the request: the query parameters
109
+ * `from`, `to`, `compareFrom`, `compareTo`, `preset` and `comparison` its
110
+ * blocks add to their `fetchUrl`, and the browser's time zone. A request
111
+ * with none of them reads as `all` with no comparison.
112
+ *
113
+ * @param context The request context (`@Context()` in a controller)
114
+ * @returns The period, its windows as `Date`s
115
+ * @throws HTTPResult 400, with a sentence naming the fault, when a bound is
116
+ * not an ISO instant, a window lacks a bound or ends before it starts, a
117
+ * preset or a comparison is unknown, or the parameters contradict each
118
+ * other (`all` with bounds, a preset without them, `none` with a window)
119
+ */
120
+ function readPeriodRequest(context) {
121
+ const query = context.url.searchParams;
122
+ const range = readWindow(query, "from", "to");
123
+ const compare = readWindow(query, "compareFrom", "compareTo");
124
+ const preset = readPreset(query);
125
+ checkPresetBounds(preset, range);
126
+ const comparison = readComparison(query, compare);
127
+ const timeZone = readTimeZone(context.rawRequest.headers.cookie);
128
+ return {
129
+ ...(preset && { preset }),
130
+ ...(range && { range }),
131
+ ...(compare && { compare }),
132
+ comparison,
133
+ ...(timeZone && { timeZone }),
134
+ };
135
+ }
136
+ /**
137
+ * Parameter decorator handing a route the {@link PeriodRequest} its
138
+ * `PeriodSelector` sent, through {@link readPeriodRequest}: a malformed
139
+ * period answers 400 before the route runs.
140
+ *
141
+ * ```ts
142
+ * @Get("kpi/revenue")
143
+ * revenue(@Period() period: PeriodRequest) { ... }
144
+ * ```
145
+ */
146
+ exports.Period = (0, decorators_1.MakeParameterAndPropertyDecorator)((target, key, index) => {
147
+ (0, interface_api_1.SetParameterProvider)(target, key, index, readPeriodRequest);
148
+ });
149
+ //# sourceMappingURL=period-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"period-request.js","sourceRoot":"","sources":["../src/period-request.ts"],"names":[],"mappings":";;;;AAAA,6DAImC;AACnC,sEAA0F;AAC1F,4DAKgC;AAChC,4DAAuD;AA2CvD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,gBAAgB,GAAG,eAAe,CAAC;AACzC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,iBAAiB,GAAG,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AE,GAAG,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AAC9D,CAAC,CACF,CAAC"}
@@ -2,7 +2,8 @@ import type { RequestContext } from "@antelopejs/interface-api";
2
2
  /**
3
3
  * The tenant of the request's verified credential: the one bound by the DMS
4
4
  * auth decorators (`AuthUser`, `AuthUserWithPermission`, `IfAuthUser` with a
5
- * valid token…), the tenant guards or `authenticateRequestPrincipal`.
5
+ * valid token…), the tenant guards, `authenticateRequestPrincipal` or
6
+ * `bindVerifiedRequestIdentity`.
6
7
  * Without a verified credential, `DEFAULT_TENANT_ID`: a token is never read
7
8
  * for its tenant before its signature, user and session are checked.
8
9
  *
@@ -9,7 +9,8 @@ const type_check_1 = require("./utils/internal/type-check");
9
9
  /**
10
10
  * The tenant of the request's verified credential: the one bound by the DMS
11
11
  * auth decorators (`AuthUser`, `AuthUserWithPermission`, `IfAuthUser` with a
12
- * valid token…), the tenant guards or `authenticateRequestPrincipal`.
12
+ * valid token…), the tenant guards, `authenticateRequestPrincipal` or
13
+ * `bindVerifiedRequestIdentity`.
13
14
  * Without a verified credential, `DEFAULT_TENANT_ID`: a token is never read
14
15
  * for its tenant before its signature, user and session are checked.
15
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"request-tenant.js","sourceRoot":"","sources":["../src/request-tenant.ts"],"names":[],"mappings":";;;;AACA,iCAAkC;AAClC,mFAGgD;AAChD,2CAAgD;AAChD,4DAAwD;AAExD;;;;;;;;;;;;;GAaG;AACH,4BAAmC,GAAmB;IACpD,OAAO,IAAA,wDAA+B,EAAC,GAAG,CAAC,IAAI,6BAAiB,CAAC;AACnE,CAAC;AAED,KAAK,UAAU,WAAW,CACxB,KAAa;IAEb,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,eAAQ,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QAC5B,MAAM,IAAI,GAAG,MAAM,eAAQ,CAAC,o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ACnB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACI,KAAK,iCACV,GAAmB;IAEnB,OAAO,CAAC,MAAM,IAAA,6CAAoB,EAAC,GAAG,EAAE,WAAW,CAAC,CAAC,IAAI,6BAAiB,CAAC;AAC7E,CAAC"}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: "Frontend modules and request helpers"
3
- description: "Register the frontend a module ships, sign upload fields, build public links, read the client address, and save native files from a write route."
3
+ description: "Register the frontend a module ships, sign upload fields, build public links, read the client address and the period of a request, and save native files from a write route."
4
4
  mode: reference
5
5
  ---
6
6
 
@@ -136,6 +136,26 @@ export class CollectController extends Controller("/api/collect") {
136
136
 
137
137
  It returns an empty string when the request carries no address. `ResolveClientIp(source)` applies the same resolution to values a module already holds, such as a request it queued for later. Its `ClientAddressSource` has `socketAddress` and `forwardedFor`, both `string | undefined`, and optional `headers`, where the `auth.clientIpHeader` header is read.
138
138
 
139
+ ## Period of a request
140
+
141
+ `@Period()` from `@antelopejs/interface-dms/period-request` hands a route the period a `PeriodSelector` sent with a widget's request: the `from`, `to`, `compareFrom`, `compareTo`, `preset` and `comparison` query parameters a widget bound by `periodScope` adds to its `fetchUrl`. `readPeriodRequest(context)` reads the same from a `RequestContext`.
142
+
143
+ ```typescript
144
+ import { Controller, Get } from "@antelopejs/interface-api";
145
+ import { Period, type PeriodRequest } from "@antelopejs/interface-dms/period-request";
146
+
147
+ export class DashboardController extends Controller("/api/dashboard") {
148
+ @Get("orders")
149
+ orders(@Period() period: PeriodRequest): { from?: string; compared: boolean } {
150
+ return { from: period.range?.from.toISOString(), compared: period.compare !== undefined };
151
+ }
152
+ }
153
+ ```
154
+
155
+ `PeriodRequest` has `preset?: PeriodPreset`, `range?: PeriodWindow` (absent for `all`), `compare?: PeriodWindow` (absent with no comparison, and for `all`), `comparison: PeriodComparison` (`none` exactly when `compare` is absent) and `timeZone?: string`, the browser's zone from the `dms-time-zone` cookie. A `PeriodWindow` is `{ from: Date; to: Date }`, both included. The windows are the instants the selector resolved in the browser's time zone, so the route needs no preset logic of its own.
156
+
157
+ A malformed period throws `HTTPResult` 400 with a sentence naming the fault: a bound that is not an ISO instant, a window missing a bound or ending before it starts, an unknown preset or comparison, `all` with bounds, another preset without them, or `none` with a comparison window. A request with no period parameters reads as `all` with no comparison.
158
+
139
159
  ## `SaveComponentFiles`
140
160
 
141
161
  `SaveComponentFiles<T>(request: AttachmentSaveRequest, save: (promoted: Record<string, unknown>) => Promise<AttachmentSaveResult<T>>): Promise<T>` comes from `@antelopejs/interface-dms/attachments`. Call it from a write route, after authorization, to validate where native files came from, promote staging keys, and persist once through `save`. The [file storage guide](/docs/components/file-storage) covers the form and upload flow and storage authorization.
@@ -126,7 +126,7 @@ Table `roles` in `dms-tenant`. It holds the roles of the tenant.
126
126
 
127
127
  ## Resolve the request's tenant
128
128
 
129
- `getRequestTenantId(ctx)` returns the tenant of the request's verified credential. The DMS binds that credential in the auth decorators (`AuthUser`, `AuthRawUser`, `IfAuthUser` with a valid token, `AuthOwnerOnly`, `AuthUserWithPermission`, and the auth a `PageController` installs), in the tenant guards (`AuthTenantMember`, `AuthTenantOwner` and `authenticateTenantRequest`), and in `authenticateRequestUser`. Without a verified credential, such as an anonymous request or an invalid or forged token, it returns `DEFAULT_TENANT_ID`. The DMS never reads a token's tenant before it checks the token's signature, user and session. When the request's authentication failed, or its `Authorization` header changed after authentication, `getRequestTenantId` throws `HTTPResult(401)`.
129
+ `getRequestTenantId(ctx)` returns the tenant of the request's verified credential. The DMS binds that credential in the auth decorators (`AuthUser`, `AuthRawUser`, `IfAuthUser` with a valid token, `AuthOwnerOnly`, `AuthUserWithPermission`, and the auth a `PageController` installs), in the tenant guards (`AuthTenantMember`, `AuthTenantOwner` and `authenticateTenantRequest`), and in `authenticateRequestUser`. A guard that verifies a credential without a user binds it with [`bindVerifiedRequestIdentity`](/docs/interfaces/auth/authentication#bind-a-credential-that-has-no-user). Without a verified credential, such as an anonymous request or an invalid or forged token, it returns `DEFAULT_TENANT_ID`. The DMS never reads a token's tenant before it checks the token's signature, user and session. When the request's authentication failed, or its `Authorization` header changed after authentication, `getRequestTenantId` throws `HTTPResult(401)`.
130
130
 
131
131
  ```typescript
132
132
  import {
@@ -14,7 +14,7 @@ The domain is published under three subpaths:
14
14
 
15
15
  | Subpath | Contents |
16
16
  | ------- | -------- |
17
- | `@antelopejs/interface-dms/auth` | The authentication decorators, `authenticateRequestUser`, the token generators and validators, `createSession`, `sanitizeUser`, the external-identity functions, `announceRegistration`, the account mail functions, and the `RequestPrincipal` and `RequestAuthenticator` types. |
17
+ | `@antelopejs/interface-dms/auth` | The authentication decorators, `authenticateRequestUser`, the token generators and validators, `createSession`, `sanitizeUser`, the external-identity functions, `announceRegistration`, the account mail functions, `bindVerifiedRequestIdentity`, and the `RequestPrincipal`, `RequestAuthenticator` and `VerifiedRequestIdentity` types. |
18
18
  | `@antelopejs/interface-dms/auth/db` | The `User`, `Session` and `UserExternalIdentity` tables, their models, the table-name constants, `normalizeEmail`, `isCurrentRefreshToken` and `buildExternalIdentityId`. |
19
19
  | `@antelopejs/interface-dms/auth/password` | The password policy: `PASSWORD_MIN_LENGTH`, `PASSWORD_PATTERN` and `isPasswordCompliant`. These are plain values and a pure function, usable without the DMS loaded. |
20
20
 
@@ -230,6 +230,74 @@ interface RequestAuthenticator {
230
230
 
231
231
  A token that no authenticator recognizes falls back to the DMS JWT. A token that two authenticators recognize is refused with `401`. A principal is identity and tenant established together. It is not an authorization.
232
232
 
233
+ ## Bind a credential that has no user
234
+
235
+ A `RequestAuthenticator` answers a `User`. A machine token, a deploy key, or a token issued to a development environment has none. A guard that accepts such a credential verifies the credential itself, then calls `bindVerifiedRequestIdentity`. [`getRequestTenantId`](/docs/interfaces/core/tenancy#resolve-the-requests-tenant) then returns the tenant of that credential.
236
+
237
+ ```typescript fragment
238
+ interface VerifiedRequestIdentity {
239
+ id: string;
240
+ tenantId: string;
241
+ }
242
+
243
+ bindVerifiedRequestIdentity(ctx: RequestContext, identity: VerifiedRequestIdentity): void
244
+ ```
245
+
246
+ | Field | Contract |
247
+ | ----- | -------- |
248
+ | `id` | The caller the credential stands for, in a form that no `User._id` takes, such as `environment:<id>`. The DMS compares it with the identity the request already carries and reads nothing else from it. |
249
+ | `tenantId` | The tenant the credential was issued for. Read it from the stored record of the credential, never from the request. |
250
+
251
+ Call it only after the credential in the `Authorization` header passed every check that makes it valid: its secret or signature, its expiry, and its revocation. The DMS trusts both fields as given.
252
+
253
+ The call grants nothing. It checks no membership, no permission, and no tenant access gate. The guard that calls it keeps those checks. For a credential that stands for a `User`, pass a `RequestAuthenticator` to `authenticateTenantRequest` instead. That function reloads the user and checks the membership.
254
+
255
+ ```typescript
256
+ import {
257
+ HTTPResult,
258
+ type RequestContext,
259
+ SetParameterProvider,
260
+ } from "@antelopejs/interface-api";
261
+ import { MakeParameterAndPropertyDecorator } from "@antelopejs/interface-core/decorators";
262
+ import { bindVerifiedRequestIdentity } from "@antelopejs/interface-dms/auth";
263
+
264
+ const UNAUTHORIZED = 401;
265
+ const BEARER = /^Bearer\s+(\S+)$/i;
266
+
267
+ interface DeployKey {
268
+ id: string;
269
+ tenantId: string;
270
+ }
271
+
272
+ /** Your own check of the secret, the expiry and the revocation. */
273
+ declare function verifyDeployKey(token: string): Promise<DeployKey | undefined>;
274
+
275
+ export const AuthDeployKey = MakeParameterAndPropertyDecorator(
276
+ (target, key, index) => {
277
+ SetParameterProvider(target, key, index, async (ctx: RequestContext) => {
278
+ const token = ctx.rawRequest.headers.authorization?.match(BEARER)?.[1];
279
+ const deployKey = token ? await verifyDeployKey(token) : undefined;
280
+ if (!deployKey) throw new HTTPResult(UNAUTHORIZED, "Unauthorized");
281
+ // both fields come from the verified key, not from the request
282
+ bindVerifiedRequestIdentity(ctx, {
283
+ id: `deploy-key:${deployKey.id}`,
284
+ tenantId: deployKey.tenantId,
285
+ });
286
+ return deployKey;
287
+ });
288
+ },
289
+ );
290
+ ```
291
+
292
+ The call throws `HTTPResult(401)` in these cases:
293
+
294
+ - The identity has no `id` or no `tenantId`.
295
+ - The request already carries another identity or another tenant.
296
+ - The authentication of the request failed, or a provider already read the request as anonymous.
297
+ - The `Authorization` header changed after the request was bound.
298
+
299
+ A provider resolved alongside the guard, such as `TenantScopedModel`, does not wait for this call. Read the tenant in the handler with `getRequestTenantId`.
300
+
233
301
  ## Decorator reference
234
302
 
235
303
  | Decorator | Injects | Email validation | On failure |
@@ -52,7 +52,23 @@ The generated `new` and `edit` pages of a table view use it, unless their page's
52
52
 
53
53
  `SettingsLayout(options?)` returns the `ComponentInfo` for `dms-settings-layout`: the dashboard frame with the settings navigation next to the page, in the column width every settings page shares. Its options are `DefaultLayoutOptions` without `fullWidth`. `settingsCategory` declares it as its `layout`, so the pages under the settings root get it without naming it ([Settings pages](/docs/building/settings-pages)).
54
54
 
55
- `EmptyLayout()` takes no options and returns the `ComponentInfo` for `dms-empty-layout`, with an empty options object. Use it for pages that draw their own chrome, such as sign-in and onboarding screens.
55
+ `EmptyLayout(options?)` returns the `ComponentInfo` for `dms-empty-layout`: a page without the dashboard frame, under the app logo and a light or dark theme toggle, above the footer. The sign-in and onboarding screens use it. Without options, its options object is empty.
56
+
57
+ | Option | Type | Description |
58
+ | --- | --- | --- |
59
+ | `hideBrand` | `boolean` | Leave out the logo and the theme toggle beside it, so the page starts at the top of the window. Defaults to `false`. |
60
+ | `hideFooter` | `boolean` | Leave out the footer: the copyright, the footer links and the language switcher. Defaults to `false`. |
61
+ | `fillHeight` | `boolean` | Let the page fill the height of the window, as `DefaultLayout`'s fills the panel. See [Pages that fill the panel](#pages-that-fill-the-panel). Defaults to `false`. |
62
+
63
+ Together they frame a full-screen page, such as a kiosk, a counter terminal or a wall screen, where the page is all the window shows:
64
+
65
+ ```typescript
66
+ import { EmptyLayout } from "@antelopejs/interface-dms/base/layouts";
67
+
68
+ EmptyLayout({ hideBrand: true, hideFooter: true, fillHeight: true })
69
+ ```
70
+
71
+ The theme toggle goes with the logo: without the header it would float over the top right corner of the page. The page follows the theme the user last chose.
56
72
 
57
73
  Because they return a plain `ComponentInfo` rather than a `ComponentBuilder`, the page layouts have no `.child()`, `.meta()` or `.watch()`.
58
74
 
@@ -269,4 +285,5 @@ Do not size the tool from the viewport, with `h-[calc(100vh-…)]` or an offset
269
285
 
270
286
  - **Minimum height.** The page area, header included, never gets shorter than 30rem: on a shorter panel it stops shrinking and the panel scrolls again. The floor sits on the page area rather than on the tool, because a `min-h-*` set inside the page overflows the column, and the panel then scrolls past its own bottom padding. A tool that needs more room than what is left to it at that floor, such as one that shares its component with a card of figures, can still set its own `min-h-*`, at that cost.
271
287
  - **Every width.** The page fills the panel on a phone too: the panel is the part of the dashboard that scrolls at every width. A page whose panes stack on a narrow screen (`grid-cols-1 lg:grid-cols-[…]`) decides how they share the height there, or lets its own root scroll below that breakpoint (`max-lg:overflow-y-auto`).
288
+ - **Without the dashboard frame.** `EmptyLayout({ fillHeight: true })` lays the page out the same way in the height of the window, under the logo and above the footer unless `hideBrand` and `hideFooter` leave them out.
272
289
  - **Several components.** Only the last one fills. Put the tool last, under whatever summarizes it, or keep both in one component that lays them out itself.
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: "Identifier data types"
3
+ description: The default data types that read and check an IBAN, a BIC, a VAT number and a company number.
4
+ mode: reference
5
+ ---
6
+
7
+ These are the [default data types](/docs/interfaces/base/data-types#the-default-types) that hold a legal or banking identifier. Each one takes its options object as its only constructor argument, and compares with `contains`, `is`, `is_not`, `not_contains`, `is_empty` and `is_not_empty`. A filter value is read like a typed value: `contains:BE68 5390` finds the stored `"BE68539007547034"`, and `is:0123.456.749` the stored company number `"0123456749"`, compared as text.
8
+
9
+ | Class | Id | Options interface | Fields |
10
+ | --- | --- | --- | --- |
11
+ | `IbanType` | `iban` | `IbanTypeOptions` | `placeholder?`, `fallback?` |
12
+ | `BicType` | `bic` | `BicTypeOptions` | `placeholder?`, `fallback?` |
13
+ | `VatNumberType` | `vat_number` | `VatNumberTypeOptions` | `placeholder?`, `defaultCountry?`, `fallback?` |
14
+ | `CompanyNumberType` | `company_number` | `CompanyNumberTypeOptions` | `country: CompanyNumberCountry` (`"BE"` \| `"FR"`), `placeholder?`, `fallback?` |
15
+
16
+ ## What each type accepts
17
+
18
+ `IbanType`, `BicType`, `VatNumberType` and `CompanyNumberType` read what a person types: spaces, dots, dashes and slashes are dropped and letters put in upper case. The schema transforms a valid value to that canonical form, so it is stored in that form. It refuses any other value with the issue message `$dms.field_errors.invalid_iban`, `invalid_bic`, `invalid_vat_number` or `invalid_company_number`. Their input, `FormComponents.InputIdentifier`, checks the same rules in the browser, and the dashboard shows an IBAN in groups of four and a company number as its country prints it. Its options, `FormComponents.InputIdentifierOptions`, depend on `identifier`: `"company_number"` requires `country`, only `"vat_number"` takes `defaultCountry`, and `"iban"` and `"bic"` take neither.
19
+
20
+ - `IbanType` checks the two check digits (ISO 13616, modulo 97) and stores `"BE68539007547034"`. It does not check each country's IBAN length: a cut-short or mistyped number already fails the check digits.
21
+ - `BicType` checks the shape of ISO 9362: a four-character party prefix, a two-letter country, a two-character location and an optional three-character branch.
22
+ - `VatNumberType` stores the number as VIES writes it (`"BE0123456749"`). The number after the country code must have that country's shape, for the 27 EU countries (Greece as `EL`, and a typed `GR` is read as `EL`), Northern Ireland (`XI`) and Great Britain (`GB`). Belgium, Germany, France (a numeric key), Italy and Luxembourg also check the check digits. A number typed without its country code is read in `defaultCountry`, and is refused when no `defaultCountry` is set. The type does not ask VIES whether the number is registered.
23
+ - `CompanyNumberType` requires `country` and throws when it is built with a country it does not read. `"BE"` reads an enterprise number of ten digits (`"0123456749"`, the last two being 97 minus the first eight modulo 97); a nine-digit number from before 2005 gets its leading zero. `"FR"` reads a SIREN of nine digits checked with the Luhn algorithm. A number typed with its country code in front (`"BE 0123.456.749"`) reads the same.
24
+
25
+ ## Next steps
26
+
27
+ - [Data types](/docs/interfaces/base/data-types): The `DataType` contract, the registry and the other default types.
@@ -247,7 +247,7 @@ Typing `TableViewOptions` by `InstanceType<T>` is what makes row-action rules fi
247
247
  | `pagination` | `TableViewPaginationMode` | `"pages"` (default): a pager; `"loadMore"`: a "Load more" button; `"infinite"`: the next page loads as the footer scrolls into view. The last two ask for every page loaded so far, from the first row, so a refresh re-reads them. |
248
248
  | `footer` | `TableViewFooterOptions` | `{ countLabel?, hint?, summary?, legend? }`: the footer's row count (`$` key pluralized on `{ count }`) and hint; `summary` figures (`TableViewFooterSummary`: `label`, `field?`, `op: "sum" \| "count"`, `where?` row rule, `format?` `TableViewSummaryFormat`) computed by the `Summary` route over every listed row; `legend`, a `SelectType` column. Serialized as `TableViewFooterSerialized`: each summary gets an `id`, its `where` stays server-side (`TableViewMeta.footerSummary(id)`). A sum without `field`, an unknown column or a legend that is no select column throws. |
249
249
  | `emptyStates` | `TableViewEmptyStates` | `{ firstRun?, filtered?, error? }`, each a `TableViewEmptyState` (`title`, `description?`, `icon?`, `actions?: BlockLinkAction[]`, `component?`) the empty body of the grid and the `cards` display shows instead of the built-in words, its texts (keys and literals alike) receiving `{ search }`. A `component` receives `state`, `search`, `refresh()`, and `clearSearch()` / `clearFilters()` while there is a search or a filter chip to clear. |
250
- | `expandable` | `TableViewExpandableOptions` | Expandable rows, a union: `{ fields, fieldsLabel? }` (column keys or `{ key, label? }`, each rendered by its column's data type) **or** `{ component }` (receives `TableViewExpandedRowProps`: `row`, `rowId`, `columns`, `labelKey`, `actions`, `open` and `refresh`, and draws the whole band), plus `defaultExpanded` (`"none"` \| `"first"` \| `"all"`), `single` and `lazyLoad` (read the row from `get` when it opens). Fields must name declared columns; both or neither throws. Serialized as `TableViewExpandableSerialized`. |
250
+ | `expandable` | `TableViewExpandableOptions` | Expandable rows, a union: `{ fields, fieldsLabel? }` (column keys or `{ key, label?, fullWidth?, hideEmpty? }`, each rendered by its column's data type) **or** `{ component }` (receives `TableViewExpandedRowProps`: `row`, `rowId`, `columns`, `labelKey`, `actions`, `open` and `refresh`, and draws the whole band), plus `defaultExpanded` (`"none"` \| `"first"` \| `"all"`), `single` and `lazyLoad` (read the row from `get` when it opens). Fields must name declared columns; both or neither throws. Serialized as `TableViewExpandableSerialized`. |
251
251
  | `rowIdKey` | `string` | Field holding the row id. Defaults to `DEFAULT_ROW_ID_FIELD`. |
252
252
  | `labelKey` | `string` | Field naming a row: it follows the drawer or modal title ("Edit task · Write the docs") and ends the breadcrumb of the edit and details pages (set on their forms as `labelKey`). |
253
253
  | `rowActions` | `TableViewRowActionOptions<T>` | Built-in and custom row actions. |
@@ -259,7 +259,7 @@ Typing `TableViewOptions` by `InstanceType<T>` is what makes row-action rules fi
259
259
  | `archivedCountLabel` | `string` | How the footer counts the archived rows: an i18n key with `$` receiving `{ count }` and pluralized on it, or a text with `{count}`. Defaults to "Archived: {count}", which agrees with no noun. |
260
260
  | `defaultFilters` | `Array<{ accessorKey: string; value?: string; mode: string }>` | Filters applied when the table opens. |
261
261
  | `defaultSort` | `{ field: string; desc?: boolean }` | Sort applied when the viewer has no stored preference, and the one a cleared sort goes back to. |
262
- | `pinnedRows` | `RowActionRule<T>` | Rows listed first whatever the sort, in the sort's order among themselves: within the list the route answers (a source without `paginate` answers every row, so its pinned rows open the first page; a paging route's open their page). The `grouped` display pins nothing; registration throws beside `reorder`. |
262
+ | `pinnedRows` | `RowActionRule<T>` | Rows listed first whatever the sort, in the sort's order among themselves: within the list the route answers (a source without `paginate` answers every row, so its pinned rows open the first page; a paging route's open their page). The `grouped` display pins only with `grouped.pinned`; registration throws beside `reorder`. |
263
263
  | `queryParamFilters` | `QueryParamFilters` | Maps URL query parameters onto hidden filters. |
264
264
  | `routeParamFilters` | `RouteParamFilters` | Maps DMS route parameters onto hidden filters. |
265
265
  | `strictRuleValidation` | `boolean` | Reject the whole request when any row fails rule validation, instead of processing only the eligible rows. |
@@ -269,7 +269,7 @@ Typing `TableViewOptions` by `InstanceType<T>` is what makes row-action rules fi
269
269
  | `liveHold` | `TableViewLiveHoldOptions` | On a page declared with `live`, keeps the rows while the page is paused, and shows a "N new · Show" pill over the rows, which moves nothing, counting the rows its tab, search and filters match now beyond those it holds (asked of its count route), not the events; Show reads them once without leaving the pause. `whileOnScreen` is required: `true` also holds the rows in Direct while they are on screen or scrolled past (a new row at the top would push them down), `false` lets them follow the feed. `whileRowOpen?`, `whileScrolled?`, `whileSearching?` and `whileSorted?` (all default `false`) also hold the table alone, the page staying live, while a row is open in a row action's side panel or drawer, its first row is scrolled out of view, the user's search narrows the rows or they are sorted otherwise than by `defaultSort`; the strip then names the reason ("Table on hold · search active"). `missedLabel` words the strip's count, given `{count}` ("12 new requests"); while the page is paused the strip adds the page's `setMissedDetail` breakdown. A `TableView.fromSource` route receives `liveHeldAt` (ISO 8601) on every request made while held. Also offered by `TableView.fromSource`. |
270
270
  | `reorder` | `TableViewReorderOptions` | `{ field }`: rows ordered by hand with a drag handle, on the grid and on the `cards` display. `field` must be a `@Sortable()`, writable `NumberType` column, and the edit action on: registration throws otherwise. The rows are listed sorted on it, and a move saves only the rows whose value changed. |
271
271
  | `kanban` | `KanbanOptions` | Enable the kanban display. |
272
- | `grouped` | `GroupedOptions` | `{ groupByField, by?: "value" \| "day" \| "week", collapsible?, count? }`: offer the `grouped` display, the grid's columns under a header row per group. `groupByField` must be a `@Sortable()` column, a `DateType` one to group by day or week. |
272
+ | `grouped` | `GroupedOptions` | `{ groupByField, by?: "value" \| "day" \| "week", order?, collapsible?, count? }`: offer the [`grouped` display](/docs/components/tables/grouped-display): a header row per group, in `order`. `groupByField` must be a `@Sortable()` column, a `DateType` one to group by day or week. |
273
273
  | `views` | `TableViewViewsOptions` | `{ items: TableViewView[], layout?: "tabs" \| "strip" \| "menu", defaultView?, userViews? }`. A `TableViewView` is a `TableViewViewState` (`filters`, `search`, `sort`, `columns: { visible?, hidden?, order? }`, `display`, `density`) with `id`, `label`, `icon`, `tone`, `dot`, `count`, `permission` (an action of the table by name, or an `Action`) and `permissionId` (an absolute permission id, which wins); a view the caller fails it for is left out when the layout is served. Filter values may hold `{{user.id}}`, `{{now}}` and `{{now±Nd}}`, resolved by the server. Serialized as `TableViewViewsSerialized` (no `permission` nor `permissionId`). |
274
274
  | `card` | `TableViewCardOptions` | The card the `kanban` and `cards` displays draw: `fields` it shows, or a `component` drawing it whole; `minWidth` (a CSS length, `"230px"` by default) is the narrowest a card of the `cards` grid gets. |
275
275
  | `displays` | `TableViewDisplayOption[]` | The displays offered, in order: a built-in id (`"table"`, `"cards"`) without a component, or a module display named `<module>:<id>`; registration throws otherwise. Left out, the built-in `table` alone; listed, exactly these, so the grid is kept by listing `{ id: "table" }`. |
@@ -253,6 +253,10 @@ The ordering modes and `is_between` send a date value to the value proxy as epoc
253
253
  | `EmailType` | `email` | `contains`, `is`, `is_not`, `not_contains`, `is_empty`, `is_not_empty` | email |
254
254
  | `UrlType` | `url` | `is`, `is_not`, `is_empty`, `is_not_empty` | text |
255
255
  | `PhoneType` | `phone` | `contains`, `is`, `is_not`, `not_contains`, `is_empty`, `is_not_empty` | phone |
256
+ | `IbanType` | `iban` | `contains`, `is`, `is_not`, `not_contains`, `is_empty`, `is_not_empty` | identifier |
257
+ | `BicType` | `bic` | as `IbanType` | identifier |
258
+ | `VatNumberType` | `vat_number` | as `IbanType` | identifier |
259
+ | `CompanyNumberType` | `company_number` | as `IbanType` | identifier |
256
260
  | `ColorType` | `color` | `is`, `is_not`, `is_empty`, `is_not_empty` | colour |
257
261
  | `PasswordType` | `password` | none | password |
258
262
  | `RichTextType` | `rich_text` | none | rich text |
@@ -278,6 +282,8 @@ The ordering modes and `is_between` send a date value to the value proxy as epoc
278
282
  | `PhoneTypeOptions` | `placeholder?`, `requiredPrefix?`, `defaultCountry?`, `fallback?` |
279
283
  | `StringTimeTypeOptions` | `placeholder?`, `min?`, `max?`, `fallback?` |
280
284
 
285
+ The options and the rules of `IbanType`, `BicType`, `VatNumberType` and `CompanyNumberType` are in [Identifier data types](/docs/interfaces/base/identifier-types).
286
+
281
287
  Notes on the ones whose behaviour is not obvious from the options:
282
288
 
283
289
  - `StringType` renders a textarea instead of a single-line input when `textarea` is set, and passes `rows` to it.
@@ -370,4 +376,5 @@ Both types enable the table view's native file handling: authorized saves promot
370
376
 
371
377
  ## Next steps
372
378
 
379
+ - [Identifier data types](/docs/interfaces/base/identifier-types): IBAN, BIC, VAT number and company number.
373
380
  - [Helpers](/docs/interfaces/base/helpers): Search, export jobs, file references and the archive-mode defaults.
@@ -22,6 +22,8 @@ An account created through an invitation link starts validated, so it receives n
22
22
 
23
23
  Each email, subject included, is written in the recipient's language, English or French. See [Language](#language).
24
24
 
25
+ Each email leaves with two alternatives: the rendered HTML and a plain-text reading of it. In the plain text, each block of the HTML is a paragraph and a link's address follows its label, so a mail client that shows no HTML still shows the code or the link. A template that replaces a built-in one gets its plain text the same way.
26
+
25
27
  These names are taken. Give your own emails other names. To change what a built-in email looks like, see [Replacing a built-in email](#replacing-a-built-in-email).
26
28
 
27
29
  ## Props
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/interface-dms",
3
- "version": "0.17.3",
3
+ "version": "0.17.4-next.1135.gc1cba20",
4
4
  "description": "Public AntelopeJS interfaces of the DMS: pages, components, permissions, tenancy, auth, notifications and HTML rendering.",
5
5
  "keywords": [
6
6
  "antelopejs",
@@ -38,19 +38,19 @@
38
38
  "@antelopejs/interface-api-util": ">=0.3.3 <0.4.0",
39
39
  "@antelopejs/interface-core": ">=0.5.2 <0.6.0",
40
40
  "@antelopejs/interface-data-api": ">=0.8.2 <0.9.0",
41
- "@antelopejs/interface-database": ">=0.4.3 <0.5.0",
41
+ "@antelopejs/interface-database": ">=0.4.5 <0.5.0",
42
42
  "@antelopejs/interface-database-decorators": ">=0.5.4 <0.6.0",
43
- "@antelopejs/interface-file-storage": ">=0.1.4 <0.2.0"
43
+ "@antelopejs/interface-file-storage": ">=0.1.10 <0.2.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@antelopejs/interface-api": ">=0.3.5 <0.4.0",
47
47
  "@antelopejs/interface-api-util": ">=0.3.3 <0.4.0",
48
48
  "@antelopejs/interface-core": ">=0.5.2 <0.6.0",
49
49
  "@antelopejs/interface-data-api": ">=0.8.2 <0.9.0",
50
- "@antelopejs/interface-database": ">=0.4.3 <0.5.0",
50
+ "@antelopejs/interface-database": ">=0.4.5 <0.5.0",
51
51
  "@antelopejs/interface-database-decorators": ">=0.5.4 <0.6.0",
52
- "@antelopejs/interface-file-storage": ">=0.1.4 <0.2.0",
53
- "@antelopejs/tooling-configs": ">=0.10.12 <0.11.0",
52
+ "@antelopejs/interface-file-storage": ">=0.1.10 <0.2.0",
53
+ "@antelopejs/tooling-configs": ">=0.10.15 <0.11.0",
54
54
  "@types/node": "^24.0.0",
55
55
  "@types/randomstring": "^1.3.0",
56
56
  "knip": "^6.34.0",
@@ -131,7 +131,7 @@
131
131
  "provenance": true,
132
132
  "registry": "https://registry.npmjs.org/"
133
133
  },
134
- "gitHead": "1281247e635665c26f0fa4e63025518dbafe396d",
134
+ "gitHead": "c1cba2046f2a02401eae2144007b213d28a6420d",
135
135
  "scripts": {
136
136
  "build": "rimraf dist && antelopejs-tsc",
137
137
  "typecheck": "antelopejs-tsc --noEmit",