docs(events,rust): MODULE_API 1.14.0's multiple param; permission rewards built (PLAN_REDESIGNS §12.10)
- website/MODULE_API.md: 1.14.0 in §1.1 and the changelog — `multiple: true` with `max` on a string/int action param, the JSON-array value, a bare value as a list of one, refused on a duration, a template input and a list example; the catalog serves both keys; the editor's multi-select; Module-uo unaffected. §2.4's registerEventActions line names it. - website/EVENTS.md §F: the param that holds several values and its control. - modules/rust/PLAN_REDESIGNS.md §12.10: built in website#213 and Module-Rust#42, with the eight points settled in code, overrulable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -1107,6 +1107,16 @@ is a JSON editor with better fonts.
|
||||
shows under the field while that row is the chosen value — advice such as *"9 of 41 linked players
|
||||
have used this kit up"*. It is never a rule; the save path does not read it.
|
||||
|
||||
**A param may hold several values** (MODULE_API 1.14.0; Rust PLAN_REDESIGNS §12.3, D344):
|
||||
`multiple: true`, with an optional `max` (1 to 100, 20 when left out), on a `string` or `int` param
|
||||
that is not a duration and not a template's input. The step stores a JSON array — a bare value is a
|
||||
list of one, duplicates are dropped in order, `required` means at least one — and `perform()` and
|
||||
`cost()` receive the array. The editor's control is a **multi-select**: the chosen values as chips
|
||||
above a grouped checklist with a filter box, over the source's own rows and in the source's order;
|
||||
the typeahead adding a chip per pick for a `searchable` source; a tag box, a value per Enter, with
|
||||
no source or one that cannot answer. The first user is Rust's permission rewards, one step giving
|
||||
several permissions.
|
||||
|
||||
### Integration Kit
|
||||
|
||||
A fifth chapter, obeying the kit's own rule — teach and link out, re-specify nothing. The four things
|
||||
|
||||
@@ -26,13 +26,41 @@ here extends the contract first, in this file, before the module is written agai
|
||||
Core exports a single integer-major semver string from `server/src/modules/version.js`:
|
||||
|
||||
```js
|
||||
const MODULE_API_VERSION = '1.13.0'
|
||||
const MODULE_API_VERSION = '1.14.0'
|
||||
```
|
||||
|
||||
The client half carries the same number (`client/src/modules/version.js`) and a test asserts the two
|
||||
agree. Duplicated rather than fetched because the value has to be on `window.__rg` before the first
|
||||
module chunk evaluates, which is earlier than any network round trip could answer.
|
||||
|
||||
**1.14.0 — a param that holds several values** (`website/EVENTS.md` §F; Rust
|
||||
`modules/rust/PLAN_REDESIGNS.md` §12.3, D344). One optional flag and no removal, so minor.
|
||||
|
||||
- **`multiple: true` on an action param**, with an optional **`max`** (1 to 100; 20 when left out).
|
||||
Only on a `string` or `int` param. Registration refuses it on any other type, on a param that is a
|
||||
`duration`, on a template's inputs, and with a list as the `example`: the example stays one value,
|
||||
because it is the placeholder of the box one value is typed into. A `max` without `multiple` is
|
||||
refused too.
|
||||
- **The value is a JSON array.** Each item is checked as the type's literal; an empty item is
|
||||
refused; duplicates are dropped and the first kept, so the order the author picked in is the order
|
||||
stored; more than `max` is refused with the number. **A bare value is read as a list of one**, so a
|
||||
spec written by hand or over the API does not trip on it. `required` means at least one; an
|
||||
optional list left empty is left out of the step's params.
|
||||
- **`perform()` and `cost()` receive the array.** The budget switchboard prices an action's examples
|
||||
to find its dimensions, and prices a multiple param's example as a list of one.
|
||||
- **The catalog serves `multiple` and `max`** beside the rest of the param (`GET
|
||||
/admin/events/catalog`). A param that does not say `multiple` is served without either key, as it
|
||||
was declared.
|
||||
- **The editor draws a multi-select.** Chips for the chosen values above a grouped checklist with a
|
||||
filter box when the param has a source that answered; the typeahead when the source is
|
||||
`searchable`, each pick a chip; a tag box, a value per Enter, with no source or one that failed.
|
||||
Ticking past `max` is refused in words. A new step holds the example as a list of one. The run
|
||||
console shows a list as its values joined by commas.
|
||||
|
||||
**Module-uo is unaffected.** It declares `^1.10.0` and no multiple param; its actions come out of
|
||||
the registry without the keys and its steps are checked, stored and drawn as before. The frozen-
|
||||
manifest proof was run against this core (website PR body).
|
||||
|
||||
**1.13.0 — the event step editor** (`website/EVENTS.md` §F, §I; Rust `modules/rust/PLAN_REDESIGNS.md`
|
||||
§2, D192). Four additions and no removal, so minor. Each is optional, and each is a declaration the
|
||||
editor, core's own page, renders.
|
||||
@@ -419,6 +447,10 @@ branches lacks — so it is the only place `permits` is true between two values
|
||||
between `admin` and `owner`, `members` or `subscribers`. `permits`, `meet` and `meetAll` are otherwise
|
||||
unchanged, and so is every rule about composition narrowing rather than widening.
|
||||
|
||||
**1.14.0 — a param's `multiple`** (`website/EVENTS.md` §F; Rust PLAN_REDESIGNS §12.3, D344). An
|
||||
action param may hold a list of `string` or `int` values, at most `max`; one optional flag, so minor;
|
||||
see §1.1. Module-uo's `^1.10.0` still resolves.
|
||||
|
||||
**1.13.0 — the event step editor** (`website/EVENTS.md` §F, §I; Rust PLAN_REDESIGNS §2).
|
||||
`registerEventTemplates`, a param's `duration`, a lease's `example` and an option's `note`; four
|
||||
optional additions, so minor; see §1.1. Module-uo's `^1.10.0` still resolves.
|
||||
@@ -838,7 +870,7 @@ api.registerSlashCommands([{ name, description, options, access, handler }]) //
|
||||
api.registerEventTriggers([{ id, label, kind, subjectKey, audience, ceiling, version, variables }]) // 1.7.0
|
||||
api.registerAudiences([{ id, label, params, ceiling, resolve }]) // 1.7.0
|
||||
api.registerEngagementSeeds({ templates, ruleGroups }) // 1.9.0
|
||||
api.registerEventActions([{ id, label, risk, reversible, cost, params, perform, revert, reconcile, progress }]) // 1.10.0; progress 1.12.0; a param's duration 1.13.0
|
||||
api.registerEventActions([{ id, label, risk, reversible, cost, params, perform, revert, reconcile, progress }]) // 1.10.0; progress 1.12.0; a param's duration 1.13.0; a param's multiple + max 1.14.0
|
||||
api.registerEventBudgets([{ id, label, unit }]) // 1.10.0
|
||||
api.registerEventLeases([{ id, label, type, min, max, values, example, target, maxDurationMs, read, apply, restore, inForce }]) // 1.10.0; example 1.13.0
|
||||
api.registerEventOptionSources([{ id, label, searchable, resolve }]) // 1.10.0; a row's note 1.13.0
|
||||
|
||||
Reference in New Issue
Block a user