@punica/editor 1.42.0 → 1.44.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punica/editor",
3
- "version": "1.42.0",
3
+ "version": "1.44.0",
4
4
  "description": "Punica Editor",
5
5
  "private": false,
6
6
  "type": "module",
@@ -72,6 +72,32 @@ declare module 'punica' {
72
72
  * reviewer instead.
73
73
  */
74
74
  approvers?: readonly string[];
75
+ /**
76
+ * The organisation those approvers hold their roles in
77
+ * (`kernel.PolicyRequest.org`), so a host that asks a reviewer
78
+ * asks the right one. Absent means the file named none.
79
+ */
80
+ org?: string;
81
+ /**
82
+ * How many of them must sign (`kernel.PolicyRequest.signatures`),
83
+ * when more than one. A card then says how many have, and offers
84
+ * a signature rather than a grant.
85
+ */
86
+ signatures?: number;
87
+ /**
88
+ * Who has signed so far, under which name — the record's own
89
+ * list, copied onto the question by `approvePending` when a
90
+ * signature lands and the chain is still short. A person on it
91
+ * cannot sign again.
92
+ */
93
+ signed?: ReadonlyArray<{ by: string; role?: string; atMs: number }>;
94
+ /**
95
+ * The scope the first signature was recorded at. The next ones are
96
+ * recorded at the same scope, whatever the card offered: a grant
97
+ * is one record, and two signatures at two scopes would be two
98
+ * half-signed records.
99
+ */
100
+ signedScope?: ApprovalScope;
75
101
  /**
76
102
  * Set by `referPending`: the question was handed to a reviewer
77
103
  * outside this host, under this name. A run waiting on it holds
@@ -79,6 +79,19 @@ declare module 'punica' {
79
79
  * absent means anyone at this host may decide.
80
80
  */
81
81
  approvers?: readonly string[];
82
+ /**
83
+ * The organisation those approvers hold their roles in, from the
84
+ * file's `org:`. A role then counts only there; absent means a
85
+ * role in any of the person's organisations counts.
86
+ */
87
+ org?: string;
88
+ /**
89
+ * How many of those approvers must sign before the grant stands
90
+ * (the deciding rule's `signatures:`). Absent or `1` is one
91
+ * decision; `2` means two different people, each one an entry
92
+ * names, and a record with fewer is consulted as no grant at all.
93
+ */
94
+ signatures?: number;
82
95
  }
83
96
 
84
97
  /**
@@ -124,6 +137,12 @@ declare module 'punica' {
124
137
  timestampMs: number;
125
138
  /** Optional reason — surfaced in audit. */
126
139
  reason?: string;
140
+ /**
141
+ * Under which of the rule's names this person signed (`owner`,
142
+ * `role:<name>`, `user:<email>`) — a `signatures` chain records it
143
+ * per signer, the way a single grant records `decidedRole`.
144
+ */
145
+ role?: string;
127
146
  }
128
147
 
129
148
  /** Chain-level outcome of `recordChainDecision`. */
@@ -148,6 +167,19 @@ declare module 'punica' {
148
167
  | {
149
168
  type: 'single';
150
169
  approver: ApproverSpec;
170
+ }
171
+ | {
172
+ /**
173
+ * A rule's `signatures: N` (1.44.0): `required` different
174
+ * people, each one of the rule's `approvers` entries, in any
175
+ * order; any deny ends it. The people are not known when the
176
+ * chain opens — a role names a set — so `approverId` is the
177
+ * signer's address and the spec lists the rule's entries, not
178
+ * ids. The policy manager is this shape's caller.
179
+ */
180
+ type: 'signatures';
181
+ required: number;
182
+ approvers: readonly string[];
151
183
  };
152
184
 
153
185
  /** Snapshot of a running chain — read-only from the caller's POV. */
@@ -186,6 +218,17 @@ declare module 'punica' {
186
218
  * record + chain state by this id.
187
219
  */
188
220
  chainRef?: string;
221
+ /**
222
+ * The signatures a `signatures: N` rule collected on this record
223
+ * (1.44.0): how many it needs and who signed, under which name. A
224
+ * record with fewer signatures than `need` is stored — so the next
225
+ * signer finds it and a reader sees who is missing — and is never
226
+ * consulted as a grant. Absent on a single-decision grant.
227
+ */
228
+ signatures?: {
229
+ need: number;
230
+ by: ReadonlyArray<{ by: string; role?: string; atMs: number }>;
231
+ };
189
232
  /**
190
233
  * The arguments this grant covers. See `PolicyRequest.argsBinding`.
191
234
  * Persisted so a grant matches only the arguments it was given
@@ -224,6 +267,10 @@ declare module 'punica' {
224
267
  maxScope?: ApprovalScope;
225
268
  /** The deciding `require` rule's `approvers:`, when it wrote them. */
226
269
  approvers?: readonly string[];
270
+ /** The organisation those approvers hold their roles in (the file's `org:`). */
271
+ org?: string;
272
+ /** How many of them must sign (the rule's `signatures:`), when more than one. */
273
+ signatures?: number;
227
274
  reason?: string;
228
275
  /**
229
276
  * Set when a rule from a policy template decided this. Absent
@@ -541,6 +588,14 @@ declare module 'punica' {
541
588
  * which is what every rule written before this field meant.
542
589
  */
543
590
  approvers?: string[];
591
+ /**
592
+ * How many of those approvers must sign, only with `approvers:` on
593
+ * `effect: 'require'`. `2` is two different people, each one an
594
+ * entry names, in any order; one person cannot sign twice, and a
595
+ * signer needs a name. Absent or `1` is one decision, which is
596
+ * what every rule written before this field meant.
597
+ */
598
+ signatures?: number;
544
599
  /** Shown to the user on a denial and written into the audit record. */
545
600
  reason?: string;
546
601
  }
@@ -557,6 +612,10 @@ declare module 'punica' {
557
612
  scope?: ApprovalScope;
558
613
  /** The rule's `approvers`, when it wrote them (`effect: require` only). */
559
614
  approvers?: string[];
615
+ /** The file's `org:`, when it wrote one — where those approvers hold their roles. */
616
+ org?: string;
617
+ /** The rule's `signatures`, when more than one. */
618
+ signatures?: number;
560
619
  /** Digest of the template's rules — which policy text was in force. */
561
620
  digest?: string;
562
621
  /**
@@ -594,6 +653,12 @@ declare module 'punica' {
594
653
  name: string;
595
654
  description?: string;
596
655
  workspaceId?: string;
656
+ /**
657
+ * The file's `org:` — the organisation the rules' `approvers:`
658
+ * resolve against. Set by the loader on every template of a file
659
+ * that wrote it, and carried onto each rule's ref.
660
+ */
661
+ org?: string;
597
662
  rules: PolicyRule[];
598
663
  /**
599
664
  * Where the template came from. `file` templates are owned by