@dforge-core/metadata 0.0.49 → 0.0.51
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/CHANGELOG.md +18 -0
- package/dist/dsl/index.js +8 -2
- package/dist/dsl/index.js.map +1 -1
- package/dist/index.d.ts +33 -3
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/data_views.schema.json +54 -1
- package/schemas/deps.schema.json +10 -2
- package/schemas/entity.schema.json +19 -0
- package/schemas/test_scenario.schema.json +144 -0
- package/src/data-views.ts +24 -0
- package/src/deps.ts +10 -0
- package/src/dsl/builtins.ts +8 -2
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ All notable changes to `@dforge-core/metadata` are documented here.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.0.51] — 2026-11-08
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`params.fieldOptions` on a column:** `entity.schema.json` describes the per-record rules `foreColor`, `backColor`
|
|
13
|
+
and `canEdit`, each a formula over the record. `$value` stands for the column itself, so one rule on a column domain
|
|
14
|
+
fits every column using it. Install refuses a rule that does not parse or calls an unknown function.
|
|
15
|
+
|
|
16
|
+
## [0.0.50] — 2026-11-04
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **Print snippets in dependency contracts:** `deps.schema.json` accepts `snippets` — the provider's print snippets the
|
|
21
|
+
consumer's templates include as `{% include '<provider>.<snippet>' %}` — and, like `functions`, a contract listing one
|
|
22
|
+
may leave `entities` empty. `DepsFile` gains `functions` and `snippets`.
|
|
23
|
+
- **Module test scenarios:** `test_scenario.schema.json` describes `tests/*.test.json` (given / do / expect), the v0 subset
|
|
24
|
+
that `dforge-cli module test` runs. See `docs/modules/module-tests.md`.
|
|
25
|
+
|
|
8
26
|
## [0.0.49] — 2026-11-03
|
|
9
27
|
|
|
10
28
|
### Fixed
|
package/dist/dsl/index.js
CHANGED
|
@@ -854,9 +854,9 @@ var BUILTINS = [
|
|
|
854
854
|
},
|
|
855
855
|
{
|
|
856
856
|
name: "sendEmail",
|
|
857
|
-
signature: "sendEmail(to, subjectOrTemplate, dataOrBody?, attachments?)",
|
|
857
|
+
signature: "sendEmail(to, subjectOrTemplate, dataOrBody?, attachments?, options?)",
|
|
858
858
|
returns: "void",
|
|
859
|
-
doc: "Queue an outbound email. Three arguments, and the **second** picks the mode: `sendEmail(to, 'order.shipped', { ref: [code] })` sends a template, `sendEmail(to, 'Your order shipped', '<p>\u2026</p>')` sends raw HTML. A second argument with no spaces that contains `.` or `_` is read as a template code \u2014 so a raw subject like `'Shipped.'` silently becomes one; give a raw subject spaces. The optional **fourth** argument attaches files: a `printPdf()`, `attachText()` or `attachBase64()` result, or an array of them (`[a, b]`; pass a single file as itself, because a one-name `[a]` reads as a field reference in the DSL). A `printPdf()` file can be attached only by the user who generated it (or a workspace admin) and not in a scheduled job; a file built with `attachText()` / `attachBase64()` has no owner and works everywhere, a scheduled job included. At most 5 files and 10 MB in all per email (`Email:MaxAttachments`, `Email:MaxAttachmentBytes`). A file the sender may not attach fails the action."
|
|
859
|
+
doc: "Queue an outbound email. Three arguments, and the **second** picks the mode: `sendEmail(to, 'order.shipped', { ref: [code] })` sends a template, `sendEmail(to, 'Your order shipped', '<p>\u2026</p>')` sends raw HTML. A second argument with no spaces that contains `.` or `_` is read as a template code \u2014 so a raw subject like `'Shipped.'` silently becomes one; give a raw subject spaces. The optional **fourth** argument attaches files: a `printPdf()`, `attachText()` or `attachBase64()` result, or an array of them (`[a, b]`; pass a single file as itself, because a one-name `[a]` reads as a field reference in the DSL). A `printPdf()` file can be attached only by the user who generated it (or a workspace admin) and not in a scheduled job; a file built with `attachText()` / `attachBase64()` has no owner and works everywhere, a scheduled job included. At most 5 files and 10 MB in all per email (`Email:MaxAttachments`, `Email:MaxAttachmentBytes`). A file the sender may not attach fails the action. The optional **fifth** argument sets threading headers so a reply finds this mail: `{ messageId, inReplyTo, references, replyTo }` (ids with angle brackets, `references` an array; pass `null` as the fourth argument when there are no files). Every key is optional; an unknown key, a malformed id (strictly `<word.word@word.word>`) or address, or a line break fails the action by name."
|
|
860
860
|
},
|
|
861
861
|
// External calls
|
|
862
862
|
{
|
|
@@ -865,6 +865,12 @@ var BUILTINS = [
|
|
|
865
865
|
returns: "string",
|
|
866
866
|
doc: "HTTP request to an external API; returns the body as a string. Max 10 calls per script, 120s timeout, 5MB response."
|
|
867
867
|
},
|
|
868
|
+
{
|
|
869
|
+
name: "fetchMail",
|
|
870
|
+
signature: "fetchMail(options)",
|
|
871
|
+
returns: "object",
|
|
872
|
+
doc: "Read new mail from one IMAP folder, read-only: nothing is marked seen, moved or deleted, so the mailbox stays the user's and the cursor you store says what was imported. Options: `host`, `username`, `secret` (the code of a module secret \u2014 the password is never written in a script), `port` (993; 143 with `security: 'starttls'`), `security` (`'ssl'` by default or `'starttls'`), `auth` (`'password'`, the only one for now), `folder` (`'INBOX'`), the cursor `uidValidity` + `afterUid` from the previous result, `since` (a date, for the first call), `limit` (messages). Returns `{ uidValidity, lastUid, more, reset, messages }`: store `uidValidity` and `lastUid` for the next call, call again while `more` is true, and treat `reset: true` as a mailbox renumbered by the server (the cursor was dropped and the folder read again). Each message has `uid`, `messageId`, `inReplyTo`, `references`, `date` (ISO 8601), `from`/`replyTo` (`{ address, name }`), `to`, `cc`, `envelopeTo`, `subject`, `text`, `html` (sanitized; remote images parked in `data-remote-src`), `autoReply`, `attachments` and `droppedAttachments`. Each attachment is a staged file `{ $tempId, fileName, mimeType, size, checksum, contentId, inline }`: pass it as the value of a `file` column in `insert()` / `update()` to keep it (an unused one expires with the temp sweep). Failures throw with the code first: `AUTH_FAILED`, `CONNECT_FAILED`, `TLS_FAILED`, `FOLDER_NOT_FOUND`; a host on a private network needs `Dsl:Limits:AllowedHosts`. Meant for scheduled jobs and async actions: up to 3 calls per run, 25 messages and 40 s per call (`Dsl:Limits:MaxMailFetchesPerExecution` / `MaxMailMessagesPerFetch` / `MailFetchBudgetSeconds`)."
|
|
873
|
+
},
|
|
868
874
|
{
|
|
869
875
|
name: "callService",
|
|
870
876
|
signature: "callService(name, args)",
|