@antelopejs/interface-dms 0.14.6 → 0.14.7-next.1002.g39c16f7
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.
- package/dist/auth/db/models/sessions.model.d.ts +10 -1
- package/dist/auth/db/models/sessions.model.js +15 -4
- package/dist/auth/db/models/sessions.model.js.map +1 -1
- package/dist/base/chart-schemas.d.ts +252 -0
- package/dist/base/chart-schemas.js +14 -0
- package/dist/base/chart-schemas.js.map +1 -1
- package/dist/base/data-types/default/relations.d.ts +35 -2
- package/dist/base/data-types/default/relations.js +12 -8
- package/dist/base/data-types/default/relations.js.map +1 -1
- package/dist/base/form-relation-options.d.ts +70 -0
- package/dist/base/form-relation-options.js +3 -0
- package/dist/base/form-relation-options.js.map +1 -0
- package/dist/base/form-schema.d.ts +6 -58
- package/dist/base/form-schema.js.map +1 -1
- package/dist/base/period-selector.d.ts +8 -3
- package/dist/base/period-selector.js.map +1 -1
- package/dist/base/query-response.d.ts +48 -0
- package/dist/base/query-response.js +60 -5
- package/dist/base/query-response.js.map +1 -1
- package/dist/base/table-view/column-display.d.ts +9 -2
- package/dist/base/table-view/column-display.js.map +1 -1
- package/dist/base/table-view/internal/factory-private-actions.js +1 -0
- package/dist/base/table-view/internal/factory-private-actions.js.map +1 -1
- package/dist/base/table-view/internal/guards.d.ts +14 -1
- package/dist/base/table-view/internal/guards.js +26 -3
- package/dist/base/table-view/internal/guards.js.map +1 -1
- package/dist/base/table-view/internal/option-contract.d.ts +4 -1
- package/dist/base/types/guards.d.ts +18 -7
- package/dist/base/types/row-action.d.ts +7 -0
- package/dist/component-options/action-target.d.ts +20 -0
- package/dist/component-options/internal/action-target.d.ts +3 -1
- package/dist/component-options/internal/action-target.js +9 -1
- package/dist/component-options/internal/action-target.js.map +1 -1
- package/dist/component-options/row-action.d.ts +6 -0
- package/dist/invite-extensions/internal/payload-slices.js +6 -2
- package/dist/invite-extensions/internal/payload-slices.js.map +1 -1
- package/dist/notifications/index.d.ts +8 -1
- package/dist/notifications/index.js +12 -0
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/internal.d.ts +5 -1
- package/dist/notifications/internal.js +4 -0
- package/dist/notifications/internal.js.map +1 -1
- package/dist/notifications/sendable.js +10 -4
- package/dist/notifications/sendable.js.map +1 -1
- package/dist/notifications/types.d.ts +32 -6
- package/dist/page/internal/page-record.d.ts +2 -2
- package/dist/page/internal/page-record.js +9 -8
- package/dist/page/internal/page-record.js.map +1 -1
- package/dist/page/types.d.ts +2 -0
- package/docs/1.core/2.pages-and-modules.md +1 -0
- package/docs/2.auth/3.tokens-and-sessions.md +1 -1
- package/docs/3.base/11.page-layouts.md +2 -0
- package/docs/3.base/12.table-row-actions.md +1 -1
- package/docs/3.base/2.types.md +13 -5
- package/docs/3.base/4.tables.md +1 -1
- package/docs/3.base/5.charts-and-widgets.md +2 -2
- package/docs/3.base/8.data-types.md +3 -0
- package/docs/4.notifications/1.introduction.md +1 -0
- package/docs/4.notifications/2.categories-and-subjects.md +4 -3
- package/docs/4.notifications/3.sending.md +3 -2
- package/docs/4.notifications/4.email.md +79 -0
- package/docs/index.md +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../../../../src/base/table-view/internal/guards.ts"],"names":[],"mappings":";;;AAAA,6DAAyE;AACzE,uEAA2E;AAC3E,+DAAyD;AACzD,uEAIwC;AACxC,0EAGmD;AACnD,gEAA6D;AAC7D,6BAAwB;AACxB,kEAAsE;AAGtE,sDAAqD;AACrD,kCAAwC;AACxC,wCAAkD;AAClD,iCAA6C;AAC7C,mEAAgF;AAChF,2CAA+C;AAI/C,gGAAgG;AAChG,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,cAAc,GAAG,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,E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,IAAU;YAEb,MAAM,IAAA,4CAAwB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACjD,MAAM,KAAK,GAAG,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YAClD,IAAI,CAAC,KAAK;gBAAE,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;YACzE,MAAM,WAAW,GAAG,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC/C,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,WAAW,CACzC,IAAI,EACJ,GAAG,EACH,MAAM,EACN,WAAW,EACX,KAAK,CACN,CAAC;YACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CACtC,IAAI,EACJ,GAAG,EACH,MAAM,EACN,WAAW,EACX,GAAG,IAAI,CACR,CAAC;YACF,IAAI,UAAU;gBAAE,MAAM,aAAa,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;YAC1E,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,IAAI,EAAE,SAAS,CAAC,IAAI;QACpB,MAAM,EAAE,SAAS,CAAC,MAAM;KACzB,CAAC;AACJ,CAAC,CAAC;AAtDW,QAAA,uBAAuB,GAAvB,uBAAuB,CAsDlC"}
|
|
@@ -72,7 +72,10 @@ export interface TableViewLiveHoldOptions {
|
|
|
72
72
|
* Defaults to true.
|
|
73
73
|
*/
|
|
74
74
|
whileOnScreen?: boolean;
|
|
75
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* While one of its rows is open in a row action's side panel or drawer.
|
|
77
|
+
* Defaults to false.
|
|
78
|
+
*/
|
|
76
79
|
whileRowOpen?: boolean;
|
|
77
80
|
/** While the user has scrolled its first row out of view. Defaults to false. */
|
|
78
81
|
whileScrolled?: boolean;
|
|
@@ -43,15 +43,22 @@ export interface NewGuardArgs<T extends object = Record<string, unknown>> {
|
|
|
43
43
|
* notification comparing the two belongs here. It runs in the same request,
|
|
44
44
|
* on the same instance; a failure is logged and never fails the request, the
|
|
45
45
|
* write being done.
|
|
46
|
+
*
|
|
47
|
+
* `TWritten` lists what it receives. After a `new` or an `edit`, that is
|
|
48
|
+
* `[written]`: the row as stored once the write is done, loaded as the edit
|
|
49
|
+
* guard's `current` is, so a created row comes with its new id. After a
|
|
50
|
+
* `delete`, `archive` or `restore` it receives nothing: the guard already
|
|
51
|
+
* holds the ids.
|
|
46
52
|
*/
|
|
47
|
-
export type AfterWrite = () => void | Promise<void>;
|
|
53
|
+
export type AfterWrite<TWritten extends unknown[] = []> = (...written: TWritten) => void | Promise<void>;
|
|
48
54
|
/**
|
|
49
55
|
* Throws to refuse the action. A mutating guard (`edit`, `delete`, `archive`,
|
|
50
|
-
* `restore`, `new`) may return an {@link AfterWrite}
|
|
51
|
-
* ignored. It runs with the
|
|
52
|
-
* (`TController`), so a guard written as a
|
|
56
|
+
* `restore`, `new`) may return an {@link AfterWrite}, called with the
|
|
57
|
+
* arguments `TWritten` lists; what `get` returns is ignored. It runs with the
|
|
58
|
+
* data controller instance as `this` (`TController`), so a guard written as a
|
|
59
|
+
* `function` reaches its models.
|
|
53
60
|
*/
|
|
54
|
-
export type GuardFn<TArgs, TController = unknown> = (this: TController, ctx: RequestContext, args: TArgs) => void | AfterWrite | Promise<void | AfterWrite
|
|
61
|
+
export type GuardFn<TArgs, TController = unknown, TWritten extends unknown[] = []> = (this: TController, ctx: RequestContext, args: TArgs) => void | AfterWrite<TWritten> | Promise<void | AfterWrite<TWritten>>;
|
|
55
62
|
/**
|
|
56
63
|
* The guards of a table view. `T` is its data controller instance — the type
|
|
57
64
|
* `TableView()` infers from the controller — so it types both the row a
|
|
@@ -60,9 +67,13 @@ export type GuardFn<TArgs, TController = unknown> = (this: TController, ctx: Req
|
|
|
60
67
|
export interface TableViewGuards<T extends object = Record<string, unknown>> {
|
|
61
68
|
/** Runs after view authorization and loading, before response and presence acquisition. Not used by exports. */
|
|
62
69
|
get?: GuardFn<GetGuardArgs<T>, T>;
|
|
63
|
-
edit?: GuardFn<EditGuardArgs<T>, T
|
|
70
|
+
edit?: GuardFn<EditGuardArgs<T>, T, [written: T & {
|
|
71
|
+
_id: string;
|
|
72
|
+
}]>;
|
|
64
73
|
delete?: GuardFn<DeleteGuardArgs, T>;
|
|
65
74
|
archive?: GuardFn<BulkGuardArgs, T>;
|
|
66
75
|
restore?: GuardFn<BulkGuardArgs, T>;
|
|
67
|
-
new?: GuardFn<NewGuardArgs<T>, T
|
|
76
|
+
new?: GuardFn<NewGuardArgs<T>, T, [written: T & {
|
|
77
|
+
_id: string;
|
|
78
|
+
}]>;
|
|
68
79
|
}
|
|
@@ -66,6 +66,12 @@ export interface CustomRowAction<T extends object = Record<string, unknown>> {
|
|
|
66
66
|
*/
|
|
67
67
|
confirm?: ActionConfirm;
|
|
68
68
|
rule?: RowActionRule<T>;
|
|
69
|
+
/**
|
|
70
|
+
* Why `rule` keeps the action off a row (`$`: i18n key, receiving the row's
|
|
71
|
+
* fields as parameters). With it a table row keeps the action, disabled,
|
|
72
|
+
* and shows this text; without it the row hides the action.
|
|
73
|
+
*/
|
|
74
|
+
disabledReason?: string;
|
|
69
75
|
isVisible?: boolean;
|
|
70
76
|
/**
|
|
71
77
|
* Makes this action the target of a row click, ahead of the built-in
|
|
@@ -121,6 +127,7 @@ export interface CustomRowActionSerialized {
|
|
|
121
127
|
target: ActionTargetSerialized;
|
|
122
128
|
confirm?: ActionConfirmSerialized;
|
|
123
129
|
rule?: RowActionRule;
|
|
130
|
+
disabledReason?: string;
|
|
124
131
|
isVisible?: boolean;
|
|
125
132
|
/**
|
|
126
133
|
* Makes this action the target of a row click, ahead of the built-in
|
|
@@ -197,6 +197,16 @@ export type ActionTarget = ({
|
|
|
197
197
|
* share link, a token).
|
|
198
198
|
*/
|
|
199
199
|
copy?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Page of the dashboard opened once the request succeeded, after the
|
|
202
|
+
* success toast: a path starting with `/` (an absolute URL is refused
|
|
203
|
+
* when the target is serialized). Takes the tokens of `url`, plus
|
|
204
|
+
* `{{response.<field>}}`, a field of the JSON response (a dotted path
|
|
205
|
+
* reads a nested one). A field the response lacks leaves the user on
|
|
206
|
+
* the page, with a console warning.
|
|
207
|
+
* @example "/sales/invoices/{{response._id}}"
|
|
208
|
+
*/
|
|
209
|
+
redirect?: string;
|
|
200
210
|
successMessage: string;
|
|
201
211
|
} | {
|
|
202
212
|
type: "exportJob";
|
|
@@ -285,6 +295,16 @@ export type ActionTargetSerialized = ({
|
|
|
285
295
|
* share link, a token).
|
|
286
296
|
*/
|
|
287
297
|
copy?: string;
|
|
298
|
+
/**
|
|
299
|
+
* Page of the dashboard opened once the request succeeded, after the
|
|
300
|
+
* success toast: a path starting with `/` (an absolute URL is refused
|
|
301
|
+
* when the target is serialized). Takes the tokens of `url`, plus
|
|
302
|
+
* `{{response.<field>}}`, a field of the JSON response (a dotted path
|
|
303
|
+
* reads a nested one). A field the response lacks leaves the user on
|
|
304
|
+
* the page, with a console warning.
|
|
305
|
+
* @example "/sales/invoices/{{response._id}}"
|
|
306
|
+
*/
|
|
307
|
+
redirect?: string;
|
|
288
308
|
successMessage: string;
|
|
289
309
|
} | {
|
|
290
310
|
type: "exportJob";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ActionTarget, ActionTargetSerialized } from "../action-target";
|
|
2
2
|
/**
|
|
3
3
|
* An action target as the options carry it: a component target is serialized,
|
|
4
|
-
* every other kind is plain data already.
|
|
4
|
+
* every other kind is plain data already. Throws on an `api` target whose
|
|
5
|
+
* `redirect` is not a path of the dashboard (one leading `/`, so neither a
|
|
6
|
+
* scheme nor a protocol-relative `//host`).
|
|
5
7
|
*
|
|
6
8
|
* @internal
|
|
7
9
|
*/
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serializeActionTarget = serializeActionTarget;
|
|
4
|
+
const DASHBOARD_PATH = /^\/(?![/\\])/;
|
|
4
5
|
/**
|
|
5
6
|
* An action target as the options carry it: a component target is serialized,
|
|
6
|
-
* every other kind is plain data already.
|
|
7
|
+
* every other kind is plain data already. Throws on an `api` target whose
|
|
8
|
+
* `redirect` is not a path of the dashboard (one leading `/`, so neither a
|
|
9
|
+
* scheme nor a protocol-relative `//host`).
|
|
7
10
|
*
|
|
8
11
|
* @internal
|
|
9
12
|
*/
|
|
@@ -13,6 +16,11 @@ function serializeActionTarget(target) {
|
|
|
13
16
|
target.type === "sidePanel") {
|
|
14
17
|
return { ...target, component: target.component.serializeSync() };
|
|
15
18
|
}
|
|
19
|
+
if (target.type === "api" &&
|
|
20
|
+
target.redirect !== undefined &&
|
|
21
|
+
!DASHBOARD_PATH.test(target.redirect)) {
|
|
22
|
+
throw new Error(`An "api" action target redirects to a path of the dashboard, starting with "/": "${target.redirect}" is not one`);
|
|
23
|
+
}
|
|
16
24
|
return target;
|
|
17
25
|
}
|
|
18
26
|
//# sourceMappingURL=action-target.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-target.js","sourceRoot":"","sources":["../../../src/component-options/internal/action-target.ts"],"names":[],"mappings":";;;AAEA
|
|
1
|
+
{"version":3,"file":"action-target.js","sourceRoot":"","sources":["../../../src/component-options/internal/action-target.ts"],"names":[],"mappings":";;;AAEA,MAAM,cAAc,GAAG,cAAc,CAAC;AAEtC;;;;;;;GAOG;AACH,+BACE,MAAoB;IAEpB,IACE,MAAM,CAAC,IAAI,KAAK,QAAQ;QACxB,MAAM,CAAC,IAAI,KAAK,OAAO;QACvB,MAAM,CAAC,IAAI,KAAK,WAAW,EAC3B,CAAC;QACD,OAAO,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,EAAE,CAAC;IACpE,CAAC;IACD,IACE,MAAM,CAAC,IAAI,KAAK,KAAK;QACrB,MAAM,CAAC,QAAQ,KAAK,SAAS;QAC7B,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EACrC,CAAC;QACD,MAAM,IAAI,KAAK,CACb,oFAAoF,MAAM,CAAC,QAAQ,cAAc,CAClH,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -49,6 +49,12 @@ export interface RowActionConfig<T extends object = Record<string, unknown>> {
|
|
|
49
49
|
isEnabled?: boolean;
|
|
50
50
|
isVisible?: boolean;
|
|
51
51
|
rule?: RowActionRule<T>;
|
|
52
|
+
/**
|
|
53
|
+
* Why `rule` keeps the action off a row (`$`: i18n key, receiving the row's
|
|
54
|
+
* fields as parameters). With it a table row keeps the action, disabled,
|
|
55
|
+
* and shows this text; without it the row hides the action.
|
|
56
|
+
*/
|
|
57
|
+
disabledReason?: string;
|
|
52
58
|
/** Label in place of the built-in one ("Change roles"). `$`: i18n key. */
|
|
53
59
|
label?: string;
|
|
54
60
|
/** Icon in place of the built-in one. */
|
|
@@ -7,7 +7,6 @@ exports.sliceOf = sliceOf;
|
|
|
7
7
|
exports.assertSliceValid = assertSliceValid;
|
|
8
8
|
exports.readPayload = readPayload;
|
|
9
9
|
const interface_api_1 = require("@antelopejs/interface-api");
|
|
10
|
-
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
11
10
|
const field_ids_1 = require("./field-ids");
|
|
12
11
|
const type_check_1 = require("../../utils/internal/type-check");
|
|
13
12
|
const registry_1 = require("./registry");
|
|
@@ -128,7 +127,12 @@ function sliceOf(key, body) {
|
|
|
128
127
|
* @internal
|
|
129
128
|
*/
|
|
130
129
|
function assertSliceValid(info, slice) {
|
|
131
|
-
|
|
130
|
+
try {
|
|
131
|
+
info.schema.parse(slice);
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
throw new interface_api_1.HTTPResult(exports.HTTP_BAD_REQUEST, hasIssues(error) ? describeIssues(info.key, error.issues) : String(error));
|
|
135
|
+
}
|
|
132
136
|
}
|
|
133
137
|
/**
|
|
134
138
|
* Parse the stored submission into the payload `onAccept` is typed for.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload-slices.js","sourceRoot":"","sources":["../../../src/invite-extensions/internal/payload-slices.ts"],"names":[],"mappings":";;;;;;;;AAAA,6DAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"payload-slices.js","sourceRoot":"","sources":["../../../src/invite-extensions/internal/payload-slices.ts"],"names":[],"mappings":";;;;;;;;AAAA,6DAAuD;AACvD,2CAGqB;AAErB,gEAMyC;AACzC,yCAAuD;AAQvD,gBAAgB;AACH,QAAA,gBAAgB,GAAG,GAAG,CAAC;AAYpC,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,CACL,IAAA,qBAAQ,EAAC,KAAK,CAAC;QACf,CAAC,IAAA,mBAAM,EAAC,KAAK,CAAC;QACd,MAAM,IAAI,KAAK;QACf,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,qBAAQ,EAAC,IAAI,CAAC,IAAI,IAAA,qBAAQ,EAAC,IAAI,CAAC,CAAC;QAC5D,SAAS,IAAI,KAAK;QAClB,IAAA,qBAAQ,EAAC,KAAK,CAAC,OAAO,CAAC,CACxB,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,CAAC,IAAA,qBAAQ,EAAC,KAAK,CAAC,IAAI,IAAA,mBAAM,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE,CAAC;QAC9D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,OAAO,KAAK,CAAC,O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AE,CAAC;YACvB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;QAC/B,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,0BACE,IAAyB,EACzB,KAAwB;IAExB,IAAI,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,0BAAU,CAClB,QAAA,gBAAgB,EAChB,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAC1E,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,qBACE,IAAyB,EACzB,QAAoD,EACpD,OAA8B;IAE9B,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAE3C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,IAAA,oCAAyB,EACvB,IAAI,CAAC,GAAG,EACR,yBAAyB,EACzB,MAAM,CAAC,KAAK,CACb,CAAC;QACF,IAAI,OAAO,CAAC,cAAc;YAAE,MAAM,MAAM,CAAC,KAAK,CAAC;QAC/C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -2,10 +2,17 @@ import { NotificationBuilder } from "./builder";
|
|
|
2
2
|
import { internal } from "./internal";
|
|
3
3
|
export { internal };
|
|
4
4
|
export * from "./types";
|
|
5
|
-
import type { NotificationCategoryInfo, NotificationSubjectInfo } from "./types";
|
|
5
|
+
import type { NotificationCategoryInfo, NotificationEmailChannelInfo, NotificationSubjectInfo } from "./types";
|
|
6
6
|
export declare function Notification(): NotificationBuilder;
|
|
7
7
|
export declare function NotificationCategory(id: string, category: Omit<NotificationCategoryInfo, "id">): NotificationCategoryInfo;
|
|
8
8
|
export declare function NotificationSubject(id: string, subject: Omit<NotificationSubjectInfo, "id">): NotificationSubjectInfo;
|
|
9
|
+
/**
|
|
10
|
+
* Registers the e-mail channel: every notification stored in a user's feed is
|
|
11
|
+
* also handed to `deliver` when its subject offers e-mail and the user has it
|
|
12
|
+
* on. One module registers it; a later registration replaces the earlier one.
|
|
13
|
+
* The registration goes away with the module that made it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function NotificationEmailChannel(channel: NotificationEmailChannelInfo): NotificationEmailChannelInfo;
|
|
9
16
|
export declare const SystemCategory: NotificationCategoryInfo;
|
|
10
17
|
export declare const GeneralSubject: NotificationSubjectInfo;
|
|
11
18
|
export declare const SecuritySubject: NotificationSubjectInfo;
|
|
@@ -18,6 +18,7 @@ exports.AutomationSubject = exports.CollaborationSubject = exports.AccountSubjec
|
|
|
18
18
|
exports.Notification = Notification;
|
|
19
19
|
exports.NotificationCategory = NotificationCategory;
|
|
20
20
|
exports.NotificationSubject = NotificationSubject;
|
|
21
|
+
exports.NotificationEmailChannel = NotificationEmailChannel;
|
|
21
22
|
const builder_1 = require("./builder");
|
|
22
23
|
const internal_1 = require("./internal");
|
|
23
24
|
Object.defineProperty(exports, "internal", { enumerable: true, get: function () { return internal_1.internal; } });
|
|
@@ -41,6 +42,17 @@ function NotificationSubject(id, subject) {
|
|
|
41
42
|
internal_1.internal.RegisterNotificationSubject.register(notificationSubject);
|
|
42
43
|
return notificationSubject;
|
|
43
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Registers the e-mail channel: every notification stored in a user's feed is
|
|
47
|
+
* also handed to `deliver` when its subject offers e-mail and the user has it
|
|
48
|
+
* on. One module registers it; a later registration replaces the earlier one.
|
|
49
|
+
* The registration goes away with the module that made it.
|
|
50
|
+
*/
|
|
51
|
+
function NotificationEmailChannel(channel) {
|
|
52
|
+
internal_1.internal.emailChannelIdentity.stamp(channel);
|
|
53
|
+
internal_1.internal.RegisterNotificationEmailChannel.register(channel);
|
|
54
|
+
return channel;
|
|
55
|
+
}
|
|
44
56
|
exports.SystemCategory = NotificationCategory("system", {
|
|
45
57
|
labelKey: "dms.notifications.categories.system",
|
|
46
58
|
descriptionKey: "dms.notifications.categories.system_desc",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,uCAAgD;AAChD,yCAAsC;yFAA7B,mBAAQ;AAGjB,0CAAwB;AAOxB;IACE,OAAO,IAAI,6BAAmB,EAAE,CAAC;AACnC,CAAC;AAED,8BACE,EAAU,EACV,QAA8C;IAE9C,MAAM,oBAAoB,GAA6B;QACrD,EAAE;QACF,GAAG,QAAQ;KACZ,CAAC;IACF,mBAAQ,CAAC,4BAA4B,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACrE,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED,6BACE,EAAU,EACV,OAA4C;IAE5C,MAAM,mBAAmB,GAA4B;QACnD,EAAE;QACF,GAAG,OAAO;KACX,CAAC;IACF,mBAAQ,CAAC,2BAA2B,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACnE,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED;;;;;GAKG;AACH,kCACE,OAAqC;IAErC,mBAAQ,CAAC,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,mBAAQ,CAAC,gCAAgC,CAAC,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opejs/interface-core";
|
|
2
|
-
import type { DeliveryOptions, NotificationCategoryInfo, NotificationData, NotificationSubjectInfo, ReadScope, RoleSendOptions } from "./types";
|
|
2
|
+
import type { DeliveryOptions, NotificationCategoryInfo, NotificationEmailChannelInfo, NotificationData, NotificationSubjectInfo, ReadScope, RoleSendOptions } from "./types";
|
|
3
|
+
import { RegistrationIdentity } from "../page/internal/registry";
|
|
3
4
|
/**
|
|
4
5
|
* @internal
|
|
5
6
|
*/
|
|
6
7
|
export declare namespace internal {
|
|
7
8
|
const RegisterNotificationCategory: RegisteringProxy<(info: NotificationCategoryInfo) => void>;
|
|
8
9
|
const RegisterNotificationSubject: RegisteringProxy<(info: NotificationSubjectInfo) => void>;
|
|
10
|
+
const RegisterNotificationEmailChannel: RegisteringProxy<(info: NotificationEmailChannelInfo) => void>;
|
|
11
|
+
/** Tells the registration a module unloads from the one that replaced it. */
|
|
12
|
+
const emailChannelIdentity: RegistrationIdentity<NotificationEmailChannelInfo>;
|
|
9
13
|
const SendToUser: (userId: string, data: NotificationData, groupId?: string | undefined, idempotencyKey?: string | undefined, delivery?: DeliveryOptions | undefined) => Promise<void>;
|
|
10
14
|
const SendToUsers: (userIds: string[], data: NotificationData, readScope?: ReadScope | undefined, idempotencyKey?: string | undefined, delivery?: DeliveryOptions | undefined) => Promise<void>;
|
|
11
15
|
const SendToRoles: (roleIds: string[], data: NotificationData, options?: RoleSendOptions | undefined) => Promise<void>;
|
|
@@ -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,
|
|
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,
|
|
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,mFAAmF;AACnF,SAAS,QAAQ,CACf,IAAsB,EACtB,OAAoB;IAEpB,OAAO,OAAO,CAAC,QAAQ,KAAK,SAAS;QACnC,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC9C,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,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAC5B,SAAS,EACT,OAAO,CAAC,cAAc,EACtB,UAAU,CAAC,OAAO,CAAC,CACpB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAiB,EAAE,OAAO,GAAgB,EAAE;QACxD,MAAM,mBAAQ,CAAC,WAAW,CACxB,OAAO,EACP,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAC5B,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,cAAc,EACtB,UAAU,CAAC,OAAO,CAAC,CACpB,CAAC;IACJ,CAAC;IAED,kGAAkG;IAClG,KAAK,CAAC,mBAAmB,CACvB,OAAiB,EACjB,cAAsB,EACtB,OAAO,GAAgB,EAAE;QAEzB,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,qFAAqF;IACrF,KAAK,CAAC,OAAO,CACX,OAAiB,EACjB,OAAO,GAAoB,EAAE;QAE7B,MAAM,mBAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAO,GAAgB,EAAE;QACvC,MAAM,mBAAQ,CAAC,SAAS,CACtB,QAAQ,CAAC,IAAI,CAAC,IAAI,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";
|
|
@@ -18,8 +18,8 @@ export declare function readPageRecord(layout: ComponentInfo | undefined, contex
|
|
|
18
18
|
/**
|
|
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
|
-
* when the record was not found,
|
|
22
|
-
* otherwise.
|
|
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.
|
|
23
23
|
*
|
|
24
24
|
* @internal
|
|
25
25
|
*/
|
|
@@ -11,6 +11,7 @@ const targetUrl = (target) => {
|
|
|
11
11
|
const url = target?.url;
|
|
12
12
|
return (0, type_check_1.isString)(url) ? url : undefined;
|
|
13
13
|
};
|
|
14
|
+
const targetRedirect = (target) => target?.type === "api" ? target.redirect : undefined;
|
|
14
15
|
const isRecordNode = (value) => !!value && typeof value === "object";
|
|
15
16
|
function leafAt(record, path) {
|
|
16
17
|
const value = path
|
|
@@ -46,8 +47,7 @@ async function readPageRecord(layout, context) {
|
|
|
46
47
|
function isRecordBound(button) {
|
|
47
48
|
if (button.requiresRecord)
|
|
48
49
|
return true;
|
|
49
|
-
|
|
50
|
-
return !!url && NAMES_RECORD.test(url);
|
|
50
|
+
return [targetUrl(button.target), targetRedirect(button.target)].some((url) => !!url && NAMES_RECORD.test(url));
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* A URL with its `{{record.X}}` tokens filled in, each value percent-encoded
|
|
@@ -63,8 +63,8 @@ function fillRecordTokens(url, record) {
|
|
|
63
63
|
/**
|
|
64
64
|
* A header button as the page's record leaves it: unchanged when the layout
|
|
65
65
|
* reads no record or the button does not act on it, left out (`undefined`)
|
|
66
|
-
* when the record was not found,
|
|
67
|
-
* otherwise.
|
|
66
|
+
* 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.
|
|
68
68
|
*
|
|
69
69
|
* @internal
|
|
70
70
|
*/
|
|
@@ -78,9 +78,10 @@ record) {
|
|
|
78
78
|
const { target } = button;
|
|
79
79
|
if (!target || !("url" in target) || !(0, type_check_1.isString)(target.url))
|
|
80
80
|
return button;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
81
|
+
const filled = { ...target, url: fillRecordTokens(target.url, record) };
|
|
82
|
+
if (filled.type === "api" && filled.redirect !== undefined) {
|
|
83
|
+
filled.redirect = fillRecordTokens(filled.redirect, record);
|
|
84
|
+
}
|
|
85
|
+
return { ...button, target: filled };
|
|
85
86
|
}
|
|
86
87
|
//# sourceMappingURL=page-record.js.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"page-record.js","sourceRoot":"","sources":["../../../src/page/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zE,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,wBACE,MAAgC,EAChC,cAAuB;AACvB,wPAAwP;AACxP,MAAqD;IAErD,IAAI,CAAC,cAAc,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAC7D,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC1B,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"}
|
package/dist/page/types.d.ts
CHANGED
|
@@ -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,
|
|
@@ -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. |
|
|
@@ -316,7 +316,7 @@ import {
|
|
|
316
316
|
| Method | Signature | Description |
|
|
317
317
|
| ------ | --------- | ----------- |
|
|
318
318
|
| `replaceRefreshToken` | `(sessionId: string, refreshToken: string) => Promise<void>` | Makes a token the current one of the session, storing only its hash. Clears the sealed token and the predecessor, so no grace window applies. |
|
|
319
|
-
| `rotateRefreshToken` | `(sessionId: string, presentedToken: string, refreshToken: string, rotatedAt?: Date) => Promise<string \| null>` | Replaces the presented token with a new one in one atomic update, and sets `lastActiveAt`. A client that presents the immediate predecessor within the 15-second grace window gets the current token back. Any other token
|
|
319
|
+
| `rotateRefreshToken` | `(sessionId: string, presentedToken: string, refreshToken: string, rotatedAt?: Date) => Promise<string \| null>` | Replaces the presented token with a new one in one atomic update, and sets `lastActiveAt`. A client that presents the immediate predecessor within the 15-second grace window gets the current token back. Any other token, the predecessor after that window or an older token, is a replay: the session is deleted and the call returns `null`. Pass only a token whose signature you verified and whose claims name `sessionId`. |
|
|
320
320
|
| `deleteInactiveSince` | `(threshold: Date) => Promise<void>` | Deletes the sessions last active before a date. |
|
|
321
321
|
| `getByUserId` | `(userId: string) => Promise<Session[]>` | Every session of a user, read through the `userId` index. |
|
|
322
322
|
| `deleteByUserId` | `(userId: string) => Promise<void>` | Deletes every session of a user. |
|
|
@@ -177,6 +177,8 @@ DefaultLayout({
|
|
|
177
177
|
});
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
+
An `api` button's `redirect` takes the `{{record.X}}` tokens too, filled in the same way, and a button whose `redirect` names one acts on the record. `{{response.<field>}}` is filled by the browser once the call answered: `redirect: "/sites/{{response._id}}?from={{record.address}}"`.
|
|
181
|
+
|
|
180
182
|
The record travels with the layout, so the header is drawn with it, on the server too, and never waits for it. Like an `availability`, it follows the page URL: the header asks for its buttons again when the route parameters or the query change, and once a write refreshed the page (`refreshPageBlocks()`, which a header button calls after a change, and a form once it saved). Its fields only shape the buttons; the route behind each one still checks the record on its own.
|
|
181
183
|
|
|
182
184
|
#### A record deleted under the page
|
|
@@ -78,7 +78,7 @@ A `new` or `edit` `ResourceForm` block over the controller submits to the same r
|
|
|
78
78
|
|
|
79
79
|
`RowActionConfig` (built-in actions) also takes `label`, `icon` and `confirm` (an `ActionConfirm`: a `ConfirmDialog`, or `{ from }`, a URL answering one for the row, on delete, archive and restore, for a single row); `BulkRowActionConfig` (delete, archive, restore) adds `successMessage`. `CustomRowAction` also takes `confirm`, `permission` (`ButtonPermission`: an action of the table by name, or an `Action`), `permissionId` (an absolute permission id, which wins over `permission`), `color`, `variant`, `showLabel`, `bulk` (`true` or `{ allMatching: true }`: offered on the selection bar, see below) and `deepLink` (a drawer, modal or side panel it opens is kept in the URL as `?record=<id>` (by default for a side panel, which `false` opts out of), or `?<tableId>.record=<id>` on a page with several table views). An action the caller fails the permission for is stripped per request like a custom button; it is only hidden, so the route its target calls must check the permission itself.
|
|
80
80
|
|
|
81
|
-
A bulk custom action sends the selected ids as a repeated `ids` query parameter, or `allMatching=true` with the table's filters, search and archive view after "Select all N matching". `resolveBulkRowIds(this, ctx, user)`, called from a route of the table's data controller, or `resolveBulkRowIds({ model, tableView }, ctx, user)` (`BulkRowSource`: the model the calling route is given, and the table's `TableViewMeta`) from any other route, a page's included, answers the ids the action covers: the selected ones, or every matching row read like the list reads them, refusing more than `MAX_BULK_MATCHING_ROWS` (413). Either way the caller needs the table's `list` permission (403 otherwise). `BULK_ALL_MATCHING_KEY` is the query flag. The `api` action target also takes `body` (the confirmation's field values merged in)
|
|
81
|
+
A bulk custom action sends the selected ids as a repeated `ids` query parameter, or `allMatching=true` with the table's filters, search and archive view after "Select all N matching". `resolveBulkRowIds(this, ctx, user)`, called from a route of the table's data controller, or `resolveBulkRowIds({ model, tableView }, ctx, user)` (`BulkRowSource`: the model the calling route is given, and the table's `TableViewMeta`) from any other route, a page's included, answers the ids the action covers: the selected ones, or every matching row read like the list reads them, refusing more than `MAX_BULK_MATCHING_ROWS` (413). Either way the caller needs the table's `list` permission (403 otherwise). `BULK_ALL_MATCHING_KEY` is the query flag. The `api` action target also takes `body` (the confirmation's field values merged in), `copy` (response field copied to the clipboard) and `redirect` (a dashboard path opened on success, taking `{{response.<field>}}` besides the tokens of `url`). `CustomButton` takes `placement` (`"toolbar"`, the default, or `"header"`: drawn in the page header, which the server adds it to); `rowActions.add` takes it too (`AddRowActionConfig`).
|
|
82
82
|
|
|
83
83
|
When several table views share a data controller, each read action of its routes is guarded by the permission ids of every mounted table view, each write action by the writing table view's (`TableViewMeta.actionPermissionIds(action)`; any one suffices). `TableViewMeta.componentBuilders` lists them, `writingComponentBuilders` the ones that write.
|
|
84
84
|
|