@protobase/schema 0.68.6 → 0.69.1

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/model.d.ts CHANGED
@@ -1092,6 +1092,11 @@ export type ActionModel = {
1092
1092
  run?: ActionRun;
1093
1093
  /** What the button asks for in a dialog before the action runs: a handler gets the answers as `values`, an update writes them through `set`. */
1094
1094
  inputs?: ActionInputModel[];
1095
+ /**
1096
+ * Whether the handler sends mail from the person's own mailbox (`mailbox: true`): its dialog offers to connect one
1097
+ * instead of running while none is linked.
1098
+ */
1099
+ mailbox?: boolean;
1095
1100
  };
1096
1101
  /**
1097
1102
  * What an input of a named action asks for: a line of `text`, a whole number (`integer`), a number with decimals
@@ -18,6 +18,14 @@ type ActionOptions = {
18
18
  };
19
19
  /** What is wrong with an action's `when`, `otherwise` and `reason`: a fallback needs a condition, and a disabled button says why. */
20
20
  export declare const actionConditionError: (o: Pick<ActionOptions, "when" | "otherwise" | "reason">) => "\"otherwise\" and \"reason\" need a \"when\" condition" | "\"when\" is empty" | "a button disabled by \"when\" needs a \"reason\"" | "\"reason\" shows only with otherwise: 'disable'" | undefined;
21
+ /**
22
+ * `mailbox: true` says the handler sends mail from the person's own mailbox, such as an invoice: its dialog offers to
23
+ * connect one instead of running while none is linked.
24
+ * @inline
25
+ */
26
+ type MailboxOption = {
27
+ mailbox?: boolean;
28
+ };
21
29
  /** @inline */
22
30
  type InputsOption = {
23
31
  inputs?: (i: typeof inputs) => ActionInputModel[];
@@ -27,8 +35,9 @@ export declare const actions: {
27
35
  * An action the app implements: it runs the handler registered under `name`. With `inputs`, such as
28
36
  * `(i) => [i.text('reason', { label: 'Reason' })]`, the button first asks for them in a dialog, and the handler gets the
29
37
  * answers as `values`. With `bulk` and no `inputs`, the list offers it for the selected rows too, and runs the handler on each it applies to.
38
+ * With `mailbox: true`, it sends from the person's own mailbox, and its dialog offers to connect one while none is linked.
30
39
  */
31
- action: (name: string, o: ActionOptions & InputsOption & {
40
+ action: (name: string, o: ActionOptions & InputsOption & MailboxOption & {
32
41
  bulk?: boolean;
33
42
  }) => ActionModel;
34
43
  /**
@@ -39,10 +39,12 @@ const actions = {
39
39
  * An action the app implements: it runs the handler registered under `name`. With `inputs`, such as
40
40
  * `(i) => [i.text('reason', { label: 'Reason' })]`, the button first asks for them in a dialog, and the handler gets the
41
41
  * answers as `values`. With `bulk` and no `inputs`, the list offers it for the selected rows too, and runs the handler on each it applies to.
42
+ * With `mailbox: true`, it sends from the person's own mailbox, and its dialog offers to connect one while none is linked.
42
43
  */
43
44
  action: (name, o) => ({
44
45
  ...named(name, o),
45
- ...builtInputs(name, o.inputs)
46
+ ...builtInputs(name, o.inputs),
47
+ ...o.mailbox && { mailbox: true }
46
48
  }),
47
49
  /**
48
50
  * Sets fields of the record, as one update with its ETag, for example `{ status: 'paid' }`. It is not offered on a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/schema",
3
- "version": "0.68.6",
3
+ "version": "0.69.1",
4
4
  "description": "Resource, field, view and access definitions for Protobase configs.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {