@protobase/schema 0.120.0 → 0.121.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/buckets/buckets-of.js +2 -1
- package/dist/fields/mail-sender.js +9 -0
- package/dist/fields.d.ts +6 -0
- package/dist/fields.js +8 -1
- package/dist/filter/check-value.js +3 -0
- package/dist/model.d.ts +1 -1
- package/package.json +1 -1
package/dist/fields.d.ts
CHANGED
|
@@ -53,5 +53,11 @@ export declare const f: {
|
|
|
53
53
|
currency: () => Field<string>;
|
|
54
54
|
/** An ISO 3166-1 alpha-2 country code such as `NL`, in a `text` column. */
|
|
55
55
|
country: () => Field<string>;
|
|
56
|
+
/**
|
|
57
|
+
* A From address the person saving may send mail from (`personalMail.senders()`), in a `text` column holding the
|
|
58
|
+
* address, as `personalMail.send({ from })` takes it; empty sends from their default. The form offers their senders
|
|
59
|
+
* as a dropdown, and an address in use cannot be deleted from the account page.
|
|
60
|
+
*/
|
|
61
|
+
mailSender: () => Field<string>;
|
|
56
62
|
};
|
|
57
63
|
//#endregion
|
package/dist/fields.js
CHANGED
|
@@ -8,6 +8,7 @@ import { enumeration } from "./fields/enum.js";
|
|
|
8
8
|
import { file } from "./fields/file.js";
|
|
9
9
|
import { integer } from "./fields/integer.js";
|
|
10
10
|
import { json } from "./fields/json.js";
|
|
11
|
+
import { mailSender } from "./fields/mail-sender.js";
|
|
11
12
|
import { relation } from "./fields/relation.js";
|
|
12
13
|
import { text } from "./fields/text.js";
|
|
13
14
|
import { timestamp } from "./fields/timestamp.js";
|
|
@@ -86,7 +87,13 @@ const f = {
|
|
|
86
87
|
/** An ISO 4217 currency code such as `EUR`, in a `text` column. */
|
|
87
88
|
currency: () => make(currency),
|
|
88
89
|
/** An ISO 3166-1 alpha-2 country code such as `NL`, in a `text` column. */
|
|
89
|
-
country: () => make(country)
|
|
90
|
+
country: () => make(country),
|
|
91
|
+
/**
|
|
92
|
+
* A From address the person saving may send mail from (`personalMail.senders()`), in a `text` column holding the
|
|
93
|
+
* address, as `personalMail.send({ from })` takes it; empty sends from their default. The form offers their senders
|
|
94
|
+
* as a dropdown, and an address in use cannot be deleted from the account page.
|
|
95
|
+
*/
|
|
96
|
+
mailSender: () => make(mailSender)
|
|
90
97
|
};
|
|
91
98
|
//#endregion
|
|
92
99
|
export { f };
|
|
@@ -53,6 +53,9 @@ const checkValue = (field, value) => {
|
|
|
53
53
|
case "country":
|
|
54
54
|
if (value.kind === "string" && /^[A-Z]{2}$/.test(value.value)) return void 0;
|
|
55
55
|
return expected("an ISO 3166-1 country code", "Use two capital letters, for example \"NL\"");
|
|
56
|
+
case "mail_sender":
|
|
57
|
+
if (value.kind === "string") return void 0;
|
|
58
|
+
return expected("a mail address", "Quote the address: \"billing@example.com\"");
|
|
56
59
|
case "relation":
|
|
57
60
|
if (value.kind === "string" || value.kind === "number" && Number.isSafeInteger(value.value)) return void 0;
|
|
58
61
|
return expected("a record key", "Use the related record key: 42 or \"abc\"");
|
package/dist/model.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { ImageVariant } from "./files/file-options.js";
|
|
|
6
6
|
import { BadgeTone } from "./badge-tones.js";
|
|
7
7
|
//#region src/model.d.ts
|
|
8
8
|
/** A field's storage type, as `f.*` declares it; see [Field types](docs/website/src/content/docs/reference/data-config.mdx#field-types). */
|
|
9
|
-
export type FieldType = 'text' | 'integer' | 'bigint' | 'decimal' | 'boolean' | 'date' | 'timestamp' | 'uuid' | 'enum' | 'json' | 'relation' | 'file' | 'currency' | 'country';
|
|
9
|
+
export type FieldType = 'text' | 'integer' | 'bigint' | 'decimal' | 'boolean' | 'date' | 'timestamp' | 'uuid' | 'enum' | 'json' | 'relation' | 'file' | 'currency' | 'country' | 'mail_sender';
|
|
10
10
|
/**
|
|
11
11
|
* A field of a resource as the server and the app see it, built from its `f.*` builder and options; see
|
|
12
12
|
* [Field options](docs/website/src/content/docs/reference/data-config.mdx#field-options).
|