@asturiu/v0-sdk 0.0.0-stage → 1.0.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.
Files changed (239) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +5 -0
  4. package/README.md +82 -2
  5. package/contract/assertion-vectors.json +90 -0
  6. package/contract/schemas/branding.schema.json +46 -0
  7. package/contract/schemas/definitions.schema.json +376 -0
  8. package/contract/schemas/portal.schema.json +56 -0
  9. package/contract/tenant-api-routes.json +165 -0
  10. package/dist/branding.d.ts +131 -0
  11. package/dist/branding.d.ts.map +1 -0
  12. package/dist/branding.js +206 -0
  13. package/dist/branding.js.map +1 -0
  14. package/dist/changesets.d.ts +58 -0
  15. package/dist/changesets.d.ts.map +1 -0
  16. package/dist/changesets.js +18 -0
  17. package/dist/changesets.js.map +1 -0
  18. package/dist/cli/bin.d.ts +3 -0
  19. package/dist/cli/bin.d.ts.map +1 -0
  20. package/dist/cli/bin.js +12 -0
  21. package/dist/cli/bin.js.map +1 -0
  22. package/dist/cli/changesets.d.ts +14 -0
  23. package/dist/cli/changesets.d.ts.map +1 -0
  24. package/dist/cli/changesets.js +252 -0
  25. package/dist/cli/changesets.js.map +1 -0
  26. package/dist/cli/cli.d.ts +37 -0
  27. package/dist/cli/cli.d.ts.map +1 -0
  28. package/dist/cli/cli.js +415 -0
  29. package/dist/cli/cli.js.map +1 -0
  30. package/dist/cli/context.d.ts +147 -0
  31. package/dist/cli/context.d.ts.map +1 -0
  32. package/dist/cli/context.js +258 -0
  33. package/dist/cli/context.js.map +1 -0
  34. package/dist/cli/engine.d.ts +59 -0
  35. package/dist/cli/engine.d.ts.map +1 -0
  36. package/dist/cli/engine.js +85 -0
  37. package/dist/cli/engine.js.map +1 -0
  38. package/dist/cli/feedback.d.ts +40 -0
  39. package/dist/cli/feedback.d.ts.map +1 -0
  40. package/dist/cli/feedback.js +420 -0
  41. package/dist/cli/feedback.js.map +1 -0
  42. package/dist/cli/files.d.ts +83 -0
  43. package/dist/cli/files.d.ts.map +1 -0
  44. package/dist/cli/files.js +389 -0
  45. package/dist/cli/files.js.map +1 -0
  46. package/dist/cli/index.d.ts +8 -0
  47. package/dist/cli/index.d.ts.map +1 -0
  48. package/dist/cli/index.js +8 -0
  49. package/dist/cli/index.js.map +1 -0
  50. package/dist/cli/overview.d.ts +6 -0
  51. package/dist/cli/overview.d.ts.map +1 -0
  52. package/dist/cli/overview.js +379 -0
  53. package/dist/cli/overview.js.map +1 -0
  54. package/dist/cli/parts.d.ts +5 -0
  55. package/dist/cli/parts.d.ts.map +1 -0
  56. package/dist/cli/parts.js +414 -0
  57. package/dist/cli/parts.js.map +1 -0
  58. package/dist/cli/sources.d.ts +37 -0
  59. package/dist/cli/sources.d.ts.map +1 -0
  60. package/dist/cli/sources.js +91 -0
  61. package/dist/cli/sources.js.map +1 -0
  62. package/dist/cli/terminal.d.ts +135 -0
  63. package/dist/cli/terminal.d.ts.map +1 -0
  64. package/dist/cli/terminal.js +353 -0
  65. package/dist/cli/terminal.js.map +1 -0
  66. package/dist/cli/ui-page.d.ts +8 -0
  67. package/dist/cli/ui-page.d.ts.map +1 -0
  68. package/dist/cli/ui-page.js +216 -0
  69. package/dist/cli/ui-page.js.map +1 -0
  70. package/dist/cli/ui.d.ts +54 -0
  71. package/dist/cli/ui.d.ts.map +1 -0
  72. package/dist/cli/ui.js +251 -0
  73. package/dist/cli/ui.js.map +1 -0
  74. package/dist/client.d.ts +88 -0
  75. package/dist/client.d.ts.map +1 -0
  76. package/dist/client.js +165 -0
  77. package/dist/client.js.map +1 -0
  78. package/dist/contacts.d.ts +43 -0
  79. package/dist/contacts.d.ts.map +1 -0
  80. package/dist/contacts.js +46 -0
  81. package/dist/contacts.js.map +1 -0
  82. package/dist/definition-set.d.ts +731 -0
  83. package/dist/definition-set.d.ts.map +1 -0
  84. package/dist/definition-set.js +659 -0
  85. package/dist/definition-set.js.map +1 -0
  86. package/dist/definitions.d.ts +42 -0
  87. package/dist/definitions.d.ts.map +1 -0
  88. package/dist/definitions.js +154 -0
  89. package/dist/definitions.js.map +1 -0
  90. package/dist/enrolment.d.ts +9 -0
  91. package/dist/enrolment.d.ts.map +1 -0
  92. package/dist/enrolment.js +8 -0
  93. package/dist/enrolment.js.map +1 -0
  94. package/dist/fill.d.ts +73 -0
  95. package/dist/fill.d.ts.map +1 -0
  96. package/dist/fill.js +46 -0
  97. package/dist/fill.js.map +1 -0
  98. package/dist/index.d.ts +39 -0
  99. package/dist/index.d.ts.map +1 -0
  100. package/dist/index.js +39 -0
  101. package/dist/index.js.map +1 -0
  102. package/dist/notifications.d.ts +33 -0
  103. package/dist/notifications.d.ts.map +1 -0
  104. package/dist/notifications.js +36 -0
  105. package/dist/notifications.js.map +1 -0
  106. package/dist/oidc.d.ts +122 -0
  107. package/dist/oidc.d.ts.map +1 -0
  108. package/dist/oidc.js +150 -0
  109. package/dist/oidc.js.map +1 -0
  110. package/dist/overlay.d.ts +109 -0
  111. package/dist/overlay.d.ts.map +1 -0
  112. package/dist/overlay.js +58 -0
  113. package/dist/overlay.js.map +1 -0
  114. package/dist/passes.d.ts +95 -0
  115. package/dist/passes.d.ts.map +1 -0
  116. package/dist/passes.js +140 -0
  117. package/dist/passes.js.map +1 -0
  118. package/dist/portal-options.d.ts +65 -0
  119. package/dist/portal-options.d.ts.map +1 -0
  120. package/dist/portal-options.js +120 -0
  121. package/dist/portal-options.js.map +1 -0
  122. package/dist/reads.d.ts +41 -0
  123. package/dist/reads.d.ts.map +1 -0
  124. package/dist/reads.js +44 -0
  125. package/dist/reads.js.map +1 -0
  126. package/dist/recovery-words.d.ts +8 -0
  127. package/dist/recovery-words.d.ts.map +1 -0
  128. package/dist/recovery-words.js +136 -0
  129. package/dist/recovery-words.js.map +1 -0
  130. package/dist/recovery.d.ts +198 -0
  131. package/dist/recovery.d.ts.map +1 -0
  132. package/dist/recovery.js +112 -0
  133. package/dist/recovery.js.map +1 -0
  134. package/dist/reveal.d.ts +35 -0
  135. package/dist/reveal.d.ts.map +1 -0
  136. package/dist/reveal.js +66 -0
  137. package/dist/reveal.js.map +1 -0
  138. package/dist/seal.d.ts +15 -0
  139. package/dist/seal.d.ts.map +1 -0
  140. package/dist/seal.js +0 -0
  141. package/dist/seal.js.map +1 -0
  142. package/dist/session.d.ts +66 -0
  143. package/dist/session.d.ts.map +1 -0
  144. package/dist/session.js +61 -0
  145. package/dist/session.js.map +1 -0
  146. package/dist/signing-in-mark.d.ts +14 -0
  147. package/dist/signing-in-mark.d.ts.map +1 -0
  148. package/dist/signing-in-mark.js +24 -0
  149. package/dist/signing-in-mark.js.map +1 -0
  150. package/dist/signing-in.d.ts +22 -0
  151. package/dist/signing-in.d.ts.map +1 -0
  152. package/dist/signing-in.js +203 -0
  153. package/dist/signing-in.js.map +1 -0
  154. package/dist/tags.d.ts +96 -0
  155. package/dist/tags.d.ts.map +1 -0
  156. package/dist/tags.js +88 -0
  157. package/dist/tags.js.map +1 -0
  158. package/dist/tenant-subscription.d.ts +47 -0
  159. package/dist/tenant-subscription.d.ts.map +1 -0
  160. package/dist/tenant-subscription.js +7 -0
  161. package/dist/tenant-subscription.js.map +1 -0
  162. package/dist/testing/index.d.ts +125 -0
  163. package/dist/testing/index.d.ts.map +1 -0
  164. package/dist/testing/index.js +320 -0
  165. package/dist/testing/index.js.map +1 -0
  166. package/dist/theme.d.ts +237 -0
  167. package/dist/theme.d.ts.map +1 -0
  168. package/dist/theme.js +504 -0
  169. package/dist/theme.js.map +1 -0
  170. package/dist/tickets.d.ts +152 -0
  171. package/dist/tickets.d.ts.map +1 -0
  172. package/dist/tickets.js +65 -0
  173. package/dist/tickets.js.map +1 -0
  174. package/dist/tiers.d.ts +168 -0
  175. package/dist/tiers.d.ts.map +1 -0
  176. package/dist/tiers.js +341 -0
  177. package/dist/tiers.js.map +1 -0
  178. package/dist/types.d.ts +885 -0
  179. package/dist/types.d.ts.map +1 -0
  180. package/dist/types.js +12 -0
  181. package/dist/types.js.map +1 -0
  182. package/dist/urlid.d.ts +50 -0
  183. package/dist/urlid.d.ts.map +1 -0
  184. package/dist/urlid.js +78 -0
  185. package/dist/urlid.js.map +1 -0
  186. package/dist/version.d.ts +15 -0
  187. package/dist/version.d.ts.map +1 -0
  188. package/dist/version.js +15 -0
  189. package/dist/version.js.map +1 -0
  190. package/make/asturiu.mk +43 -0
  191. package/package.json +63 -4
  192. package/src/branding.ts +221 -0
  193. package/src/changesets.ts +61 -0
  194. package/src/cli/bin.ts +12 -0
  195. package/src/cli/changesets.ts +233 -0
  196. package/src/cli/cli.ts +425 -0
  197. package/src/cli/context.ts +299 -0
  198. package/src/cli/engine.ts +112 -0
  199. package/src/cli/feedback.ts +406 -0
  200. package/src/cli/files.ts +371 -0
  201. package/src/cli/index.ts +7 -0
  202. package/src/cli/overview.ts +343 -0
  203. package/src/cli/parts.ts +371 -0
  204. package/src/cli/sources.ts +111 -0
  205. package/src/cli/terminal.ts +384 -0
  206. package/src/cli/ui-page.ts +215 -0
  207. package/src/cli/ui.ts +266 -0
  208. package/src/client.ts +202 -0
  209. package/src/contacts.ts +61 -0
  210. package/src/definition-set.ts +965 -0
  211. package/src/definitions.ts +156 -0
  212. package/src/enrolment.ts +10 -0
  213. package/src/fill.ts +83 -0
  214. package/src/index.ts +38 -0
  215. package/src/notifications.ts +55 -0
  216. package/src/oidc.ts +199 -0
  217. package/src/overlay.ts +137 -0
  218. package/src/passes.ts +168 -0
  219. package/src/portal-options.ts +125 -0
  220. package/src/reads.ts +71 -0
  221. package/src/recovery-words.ts +137 -0
  222. package/src/recovery.ts +269 -0
  223. package/src/reveal.ts +72 -0
  224. package/src/seal.ts +0 -0
  225. package/src/session.ts +93 -0
  226. package/src/signing-in-mark.ts +23 -0
  227. package/src/signing-in.ts +213 -0
  228. package/src/tags.ts +146 -0
  229. package/src/tenant-subscription.ts +44 -0
  230. package/src/testing/index.ts +337 -0
  231. package/src/theme.ts +628 -0
  232. package/src/tickets.ts +195 -0
  233. package/src/tiers.ts +397 -0
  234. package/src/types.ts +847 -0
  235. package/src/urlid.ts +77 -0
  236. package/src/version.ts +15 -0
  237. package/templates/asturiu/branding.json +4 -0
  238. package/templates/asturiu/definitions.json +23 -0
  239. package/templates/asturiu/portal.json +16 -0
@@ -0,0 +1,885 @@
1
+ /**
2
+ * The `/v0` surface as a Frontend sees it (components/05-interface-api.md
3
+ * §API, §Representation): the ARID is the only identifier that crosses the
4
+ * boundary. These types mirror what the Interface API serialises; they hold
5
+ * no Engine internals and pull in no Engine dependency.
6
+ */
7
+ import type { RevealLevel } from "./reveal.js";
8
+ import type { ContactOrigin, ContactState, DisclosableField } from "./contacts.js";
9
+ import type { PortalOptions } from "./portal-options.js";
10
+ import type { PassGate, PassKind, PassPresentation, PassState } from "./passes.js";
11
+ import type { PortalThemeSpec } from "./theme.js";
12
+ import type { EnrolmentState } from "./enrolment.js";
13
+ import type { FieldRef, FillMode, LocatorRule } from "./fill.js";
14
+ /** What an Entry is (ADR-014). The Engine's Definition schema checks the same list; a test there fails when they differ. */
15
+ export declare const ENTRY_KINDS: readonly ["file", "folder"];
16
+ export type EntryKind = (typeof ENTRY_KINDS)[number];
17
+ /** What a Field's value is. The Engine's Definition schema checks the same list; a test there fails when they differ. */
18
+ export declare const FIELD_VALUE_TYPES: readonly ["text", "password", "number", "boolean", "date", "datetime", "email", "phone", "url", "json", "attachment"];
19
+ export type FieldValueType = (typeof FIELD_VALUE_TYPES)[number];
20
+ export type Capability = "read" | "reveal" | "update" | "delete" | "share" | "transfer";
21
+ export declare const CAPABILITIES: readonly Capability[];
22
+ export type ResourceStatus = "active" | "deleted" | "transit" | "superseded" | string;
23
+ export interface Page<T> {
24
+ items: T[];
25
+ next_cursor: string | null;
26
+ }
27
+ /** RFC 9457 body every error carries (`application/problem+json`). */
28
+ export interface Problem {
29
+ type: string;
30
+ title: string;
31
+ status: number;
32
+ detail?: string;
33
+ instance?: string;
34
+ [key: string]: unknown;
35
+ }
36
+ export interface ResourceBase {
37
+ arid: string;
38
+ type: string;
39
+ version: number;
40
+ status: ResourceStatus;
41
+ created_at: string;
42
+ updated_at: string;
43
+ }
44
+ export interface DefinitionRef {
45
+ arid: string;
46
+ version: number;
47
+ }
48
+ export interface SessionCreated {
49
+ session: string;
50
+ expires_at: string;
51
+ customer: {
52
+ arid: string;
53
+ enrolled: boolean;
54
+ };
55
+ tenant: {
56
+ arid: string;
57
+ slug: string;
58
+ name: string;
59
+ };
60
+ }
61
+ export interface SessionCurrent {
62
+ session: string;
63
+ customer: string;
64
+ tenant: {
65
+ arid: string;
66
+ slug: string;
67
+ };
68
+ vault: string;
69
+ principal: string;
70
+ principals: string[];
71
+ created_at: string;
72
+ oidc_expires_at: string;
73
+ capabilities: {
74
+ owner_of_vault: boolean;
75
+ };
76
+ /** Step-ups recorded on this session (ADR-018): when each proven factor lapses. */
77
+ step_up?: {
78
+ password_until?: string;
79
+ mfa_until?: string;
80
+ };
81
+ }
82
+ export interface PlatformStatus {
83
+ status: "active" | "paused";
84
+ reason?: string;
85
+ since?: string;
86
+ }
87
+ /** `GET /v0/status/:arid`: a Tenant's state, its status message and whether it takes new Customers, with the platform's. No session. */
88
+ export interface TenantStatusView {
89
+ arid: string;
90
+ state: "active" | "paused" | "frozen";
91
+ message: string;
92
+ message_since?: string;
93
+ /** `closed`: a first sign-in is refused with `403 enrolment-closed` (ADR-044); hide sign-up. Absent from an Interface API older than 2026-10-13: open. */
94
+ enrolment?: EnrolmentState;
95
+ platform: PlatformStatus & {
96
+ message: string;
97
+ message_since?: string;
98
+ };
99
+ }
100
+ /**
101
+ * `GET /v0/customer`: the Customer of this Tenant. The profile fields
102
+ * (`display_name`, `name`, `phone`, `email`, `email_verified`) belong to the
103
+ * person behind it and read the same on every Tenant (ADR-016); a Tenant
104
+ * never sees or addresses that grouping — it only ever holds the Customer.
105
+ */
106
+ export interface Customer {
107
+ arid: string;
108
+ version: number;
109
+ tenant: string;
110
+ /** The person's platform-wide handle (ADR-024): what a Contact sees of them before anything is disclosed. */
111
+ handle?: string;
112
+ display_name?: string;
113
+ email?: string;
114
+ email_verified?: boolean;
115
+ phone?: string;
116
+ name?: string;
117
+ created_at: string;
118
+ updated_at: string;
119
+ principal: string;
120
+ redeemed_principals: string[];
121
+ vault: string;
122
+ }
123
+ export interface CustomerHeartbeat {
124
+ /** The tier in force (ADR-061). */
125
+ tier: string;
126
+ account_status: "active" | "suspended" | "deleted" | string;
127
+ sync: {
128
+ status: string;
129
+ };
130
+ updated_at: string;
131
+ updated_by: string;
132
+ }
133
+ export interface Vault extends ResourceBase {
134
+ name: string;
135
+ owner: string;
136
+ wallets: number;
137
+ tier: string;
138
+ }
139
+ export interface VaultTreeNode {
140
+ arid: string;
141
+ type: string;
142
+ name?: string;
143
+ children: VaultTreeNode[];
144
+ }
145
+ export interface VaultTree {
146
+ customer: string;
147
+ root: string;
148
+ generated_at: string;
149
+ tree: VaultTreeNode;
150
+ }
151
+ export interface WalletDefinitionSummary {
152
+ arid: string;
153
+ version: number;
154
+ name: string;
155
+ label?: string;
156
+ description?: string;
157
+ accepts: DefinitionRef[];
158
+ nestable: boolean;
159
+ immutable: boolean;
160
+ metering: "storage" | "events";
161
+ /** Whether the Customer's subscription level may create from it (Tenant scoping); never for a withdrawn one. */
162
+ available: boolean;
163
+ /** The Tenant took it out of its Definition set (ADR-029): existing Wallets keep it, nothing new is created from it. */
164
+ withdrawn?: boolean;
165
+ }
166
+ export interface WalletDefinitionDetail extends Omit<WalletDefinitionSummary, "available"> {
167
+ event_retention_days?: number;
168
+ default_policy?: Record<string, unknown>;
169
+ entries: {
170
+ arid: string;
171
+ version: number;
172
+ name?: string;
173
+ label?: string;
174
+ kind?: EntryKind;
175
+ }[];
176
+ }
177
+ export interface EntryDefinitionField {
178
+ definition: DefinitionRef;
179
+ required: boolean;
180
+ order?: number;
181
+ name?: string;
182
+ label?: string;
183
+ value_type?: FieldValueType;
184
+ secret?: boolean;
185
+ /** The reveal level in effect for a secret Field (ADR-018); absent on a plain Field. */
186
+ reveal?: RevealLevel;
187
+ searchable?: boolean;
188
+ /** A Customer may neither rename nor hide this field (ADR-028). */
189
+ locked?: boolean;
190
+ /** Written into an existing Entry without a value when it moves to this version (ADR-029). */
191
+ fill_in?: unknown;
192
+ /** The modes a Field of this field may use here: the FieldDefinition's, narrowed by this Entry type (ADR-046). Absent: all three. */
193
+ filled_by?: FillMode[];
194
+ /** The resource types an internal reference may point at (ADR-046). Absent: any. */
195
+ targets?: string[];
196
+ /** The Definitions a target must be of, by ARID (ADR-046). Absent: any. */
197
+ target_definitions?: string[];
198
+ /** The Tenant's rule for external locators (ADR-046). */
199
+ locator?: LocatorRule;
200
+ }
201
+ export interface EntryDefinitionDetail {
202
+ arid: string;
203
+ version: number;
204
+ name: string;
205
+ label?: string;
206
+ description?: string;
207
+ /** `file` or `folder` (ADR-014). Absent on Definitions written before kinds existed; treat as `file`. */
208
+ kind?: EntryKind;
209
+ fields: EntryDefinitionField[];
210
+ nestable: boolean;
211
+ /** Folders only: the entry types a folder of this type may hold; absent = everything the Wallet accepts. */
212
+ contains?: DefinitionRef[];
213
+ /** Whether a Wallet overlay may rename, arrange or extend this type (ADR-028): `false` only when the Tenant customises nothing or excludes this type. */
214
+ customizable: boolean;
215
+ /** The value types a custom field on this type may have; absent = every type. */
216
+ value_types?: FieldValueType[];
217
+ /** The lowest reveal level a secret custom field on this type may have; absent = `click`. */
218
+ secret_reveal_min?: RevealLevel;
219
+ /** The modes a custom field on this type may allow (ADR-046); absent = all three. */
220
+ custom_filled_by?: FillMode[];
221
+ withdrawn?: boolean;
222
+ }
223
+ export interface FieldDefinitionDetail {
224
+ arid: string;
225
+ version: number;
226
+ name: string;
227
+ label?: string;
228
+ description?: string;
229
+ value_type: FieldValueType;
230
+ validation?: {
231
+ pattern?: string;
232
+ min?: number;
233
+ max?: number;
234
+ min_length?: number;
235
+ max_length?: number;
236
+ enum?: (string | number | boolean)[];
237
+ };
238
+ secret: boolean;
239
+ reveal?: RevealLevel;
240
+ searchable: boolean;
241
+ required: boolean;
242
+ immutable: boolean;
243
+ locked?: boolean;
244
+ /** ADR-046: the modes a Field of this definition may use (absent: all three), what an internal reference may point at, the locator rule. */
245
+ filled_by?: FillMode[];
246
+ targets?: string[];
247
+ target_definitions?: string[];
248
+ locator?: LocatorRule;
249
+ withdrawn?: boolean;
250
+ }
251
+ /**
252
+ * The version a resource is pinned to, and the latest (ADR-029). A resource is
253
+ * `behind` until it moves: its owner's catch-up moves it when it already fits,
254
+ * otherwise its next write must bring it to the latest version.
255
+ */
256
+ export interface DefinitionPin extends DefinitionRef {
257
+ latest_version: number;
258
+ /** The type's key and display label, from its latest version: enough to show the type without reading its Definition. Absent only for a type the Tenant no longer has. */
259
+ name?: string;
260
+ label?: string;
261
+ }
262
+ /** Why a behind Entry does not yet fit the latest version, per Field the caller can read. */
263
+ export interface DefinitionIssue {
264
+ /** The FieldDefinition ARID. */
265
+ field: string;
266
+ problem: "missing" | "invalid" | "does_not_convert";
267
+ message: string;
268
+ }
269
+ export interface Wallet extends ResourceBase {
270
+ name: string;
271
+ description?: string;
272
+ definition: DefinitionPin;
273
+ behind: boolean;
274
+ parent: string | null;
275
+ nested_wallets: number;
276
+ entries: number;
277
+ portfolios: string[];
278
+ }
279
+ export interface Field extends ResourceBase {
280
+ /** The Tenant's FieldDefinition; `null` for a custom field (ADR-028). */
281
+ definition: DefinitionRef | null;
282
+ /** Set on a custom field: its key in the Wallet's overlay. */
283
+ custom: {
284
+ id: string;
285
+ } | null;
286
+ /** The Tenant's field name, or the `x_` id of a custom field. */
287
+ name: string;
288
+ /** The name to show: the overlay's rename or custom label, else the Tenant's label. */
289
+ label: string;
290
+ /** Position among the Entry's fields, after the overlay's layout. */
291
+ order: number;
292
+ /** The Wallet's overlay hides this field. Presentation only: the field is still returned and still shared. */
293
+ hidden: boolean;
294
+ value_type: FieldValueType;
295
+ secret: boolean;
296
+ searchable: boolean;
297
+ immutable: boolean;
298
+ entry: string;
299
+ /** The level in effect (ADR-018): the Tenant's for its fields, the overlay's for a custom one; `null` for a plain Field. */
300
+ reveal: RevealLevel | null;
301
+ /**
302
+ * Where the value comes from (ADR-046): `value` — the Field's own; `internal` — `ref` names an ARID, and `value` is
303
+ * a Field target's value when the reader may read it; `external` — `ref` holds a locator and `value` is `null`.
304
+ */
305
+ filled_by: FillMode;
306
+ /** The reference, for the two reference modes. */
307
+ ref?: FieldRef;
308
+ /** `null` while withheld; present after an explicit, audited reveal (or inline at level `visible`). */
309
+ value: unknown;
310
+ value_withheld: boolean;
311
+ /** The Entry's current version no longer declares this field (ADR-029): readable, shareable, deletable, never writable. */
312
+ retired: boolean;
313
+ }
314
+ /** A self-hosted captcha to answer before a `captcha`-level reveal (ADR-018). */
315
+ export interface Captcha {
316
+ id: string;
317
+ /** A `data:image/svg+xml` URI. */
318
+ image: string;
319
+ expires_in: number;
320
+ }
321
+ /** What `POST /v0/sessions/current/step-up` answers: when each proven factor lapses. */
322
+ export interface StepUpResult {
323
+ password_until?: string;
324
+ mfa_until?: string;
325
+ amr: string[];
326
+ }
327
+ /** One step of an Entry's location inside its Wallet: an ancestor folder (or nestable file) from the root down. */
328
+ export interface EntryPathNode {
329
+ arid: string;
330
+ kind: EntryKind;
331
+ label: string | null;
332
+ }
333
+ export interface Entry extends ResourceBase {
334
+ definition: DefinitionPin;
335
+ /** Pinned to an older version than the latest (ADR-029). */
336
+ behind: boolean;
337
+ /** What keeps a behind Entry from the latest version; empty when it fits and only waits for its owner's catch-up. */
338
+ issues: DefinitionIssue[];
339
+ wallet: string;
340
+ /** The folder (or nestable file) the Entry sits in; `null` at the Wallet root. */
341
+ parent_entry: string | null;
342
+ /** `file` or `folder` (ADR-014). */
343
+ kind: EntryKind;
344
+ /** Ancestors inside the Wallet, root first; empty at the root. The trail a UI renders as breadcrumbs. */
345
+ path: EntryPathNode[];
346
+ label?: string;
347
+ fields: Field[];
348
+ attachments: string[];
349
+ /** Direct child Entries by kind. */
350
+ children: {
351
+ folders: number;
352
+ files: number;
353
+ };
354
+ /** `children.folders + children.files`. */
355
+ nested_entries: number;
356
+ /** `true` when Fields, Attachments or nested Entries were left out for the caller (ADR-027); always `false` for the owner. */
357
+ partial: boolean;
358
+ }
359
+ /** One node of a Wallet's folder tree (`GET /v0/wallets/{arid}/folders`): folders only, with the files each holds. */
360
+ export interface FolderNode {
361
+ arid: string;
362
+ label: string | null;
363
+ definition: DefinitionRef;
364
+ files: number;
365
+ children: FolderNode[];
366
+ }
367
+ export interface WalletFolders {
368
+ wallet: string;
369
+ /** Files directly at the Wallet root. */
370
+ files: number;
371
+ folders: FolderNode[];
372
+ }
373
+ export interface Attachment extends ResourceBase {
374
+ filename: string;
375
+ content_type: string;
376
+ size: number;
377
+ bound_to: string;
378
+ }
379
+ /** One item of `GET /v0/trash`: something the vault's owner deleted and can still restore (ADR-036). */
380
+ export interface TrashItem {
381
+ arid: string;
382
+ type: "wlt" | "ent" | "fld" | "att";
383
+ /** The Wallet's name, the Entry's label, the Attachment's file name, the Field's name; null when the item has none. */
384
+ name: string | null;
385
+ /** Where it goes back to: a Wallet, an Entry, a Field or the vault. */
386
+ parent: string;
387
+ deleted_at: string;
388
+ restorable_until: string;
389
+ /** The Principal that deleted it. */
390
+ deleted_by: string | null;
391
+ restorable: boolean;
392
+ /** Why it cannot go back yet: its parent is deleted (restore that first), gone, or blocked / in a Transfer. */
393
+ reason?: "parent_deleted" | "parent_gone" | "parent_locked";
394
+ }
395
+ /** The answer of `POST /v0/trash/{arid}/restore`. */
396
+ export interface TrashRestoreResult {
397
+ arid: string;
398
+ type: TrashItem["type"];
399
+ parent: string;
400
+ /** Nodes brought back: the item and everything its deletion took under it. */
401
+ resources_restored: number;
402
+ /** Search entries written again for its Fields. */
403
+ reindexed: number;
404
+ /** Always false: Grants stay revoked; share again. */
405
+ grants_restored: false;
406
+ }
407
+ export interface Portfolio extends ResourceBase {
408
+ name: string;
409
+ order?: number;
410
+ description?: string;
411
+ wallets: string[];
412
+ }
413
+ /**
414
+ * A Principal as the caller may see it (ADR-024). The caller's own Principal
415
+ * and the external ones it registered come in full. Any other Customer's
416
+ * Principal carries only `arid`, `kind`, plus the `handle` and the profile
417
+ * fields that Customer disclosed through an active Contact — nothing says
418
+ * whether an e-mail has an account. A `bearer` Principal is the one a link
419
+ * for anyone opens as (ADR-040): no contact channel, never a Customer.
420
+ */
421
+ export interface Principal {
422
+ arid: string;
423
+ version: number;
424
+ status: ResourceStatus;
425
+ kind: "customer" | "external" | "bearer";
426
+ display_name?: string;
427
+ contact: {
428
+ email?: string;
429
+ phone?: string;
430
+ };
431
+ /** Another Customer's handle, when the two are active Contacts. */
432
+ handle?: string;
433
+ created_at: string;
434
+ }
435
+ /**
436
+ * One side of a Contact (`GET /v0/contacts`, ADR-024). `state` is derived from
437
+ * both sides; `disclosed` is what the other person lets this one see, `handle`
438
+ * is there whenever the Contact is `active`; `my_disclose` is what this side
439
+ * lets the other see.
440
+ */
441
+ export interface Contact extends ResourceBase {
442
+ principal: string;
443
+ /** The holder's own label, else the counterpart's handle, else `null`. */
444
+ label: string | null;
445
+ note?: string;
446
+ state: ContactState;
447
+ origin: ContactOrigin;
448
+ handle?: string;
449
+ disclosed: {
450
+ display_name?: string;
451
+ name?: string;
452
+ email?: string;
453
+ phone?: string;
454
+ };
455
+ my_disclose: DisclosableField[];
456
+ /**
457
+ * `customer`: another Customer's own Principal. `external`: a Principal for an address, registered by someone.
458
+ * Every response carries it since Tenant changeset 018; optional so objects built by hand still typecheck.
459
+ */
460
+ principal_kind?: "customer" | "external";
461
+ /**
462
+ * For an external Principal the caller registered: the name and channel it typed, as `GET /v0/principals/{arid}`
463
+ * returns them to the caller. `null` for anyone else's Principal, which shows only what it `disclosed`.
464
+ * Every response carries it since Tenant changeset 018.
465
+ */
466
+ registered?: {
467
+ display_name?: string;
468
+ email?: string;
469
+ phone?: string;
470
+ } | null;
471
+ }
472
+ /**
473
+ * A direct message as this side sees it (`GET /v0/messages`, ADR-024,
474
+ * ADR-025): its own sent copy, a message delivered into its vault, or one
475
+ * still in its mailbox (`read_at: null`). Opening a mailbox message accepts
476
+ * it into the vault; the sender is never told (no read receipts).
477
+ */
478
+ export interface Message extends ResourceBase {
479
+ /** This side's Contact for the other party; `null` once that Contact is gone. */
480
+ contact: string | null;
481
+ box: "inbox" | "sent";
482
+ /** `null` in a listing while the message is still in the mailbox: `GET /v0/messages/:arid` opens it. */
483
+ body: string | null;
484
+ in_reply_to: string | null;
485
+ sent_at: string;
486
+ read_at: string | null;
487
+ }
488
+ export interface Group extends ResourceBase {
489
+ name: string;
490
+ description?: string;
491
+ owner: boolean;
492
+ members: string[];
493
+ }
494
+ export interface GrantCondition {
495
+ trigger?: string;
496
+ not_before?: string;
497
+ not_after?: string;
498
+ }
499
+ export interface Grant extends ResourceBase {
500
+ principal: string;
501
+ resource: string;
502
+ resource_type: string;
503
+ capabilities: Capability[];
504
+ effect: "allow" | "deny";
505
+ /** `false`: the Grant covers its own node only (ADR-027). */
506
+ inherit: boolean;
507
+ condition: GrantCondition | null;
508
+ /** The end date inherited from the same principal's Grants above this node, and the Grant it comes from (ADR-027). */
509
+ inherited: {
510
+ not_after: string;
511
+ from: string;
512
+ } | null;
513
+ /** The earlier of `condition.not_after` and `inherited.not_after`. */
514
+ effective_not_after: string | null;
515
+ state: "pending" | "active" | "expired" | "revoked" | string;
516
+ issued_by: string;
517
+ issued_at: string;
518
+ history: {
519
+ at: string;
520
+ by: string;
521
+ change: string;
522
+ }[];
523
+ /** The caller's Contact for the issuer, when one exists (ADR-024) — "shared by <label>" without a second lookup. */
524
+ issuer_contact?: string | null;
525
+ }
526
+ /** `POST /v0/grants` with `{ grants: [...] }` (ADR-027): the Grants in request order and one notification per recipient. */
527
+ export interface GrantBatchResult {
528
+ items: Grant[];
529
+ notifications: {
530
+ principal: string;
531
+ notification: string;
532
+ merged: boolean;
533
+ }[];
534
+ }
535
+ /**
536
+ * A guest pass as its sharer sees it (`/v0/passes`, ADR-040): one in the
537
+ * caller's own vault. `state` is derived: `ended` once an e-mail pass's
538
+ * Principal signed in, `expired` past `not_after`, `exhausted` when `opens`
539
+ * reached `max_opens`.
540
+ */
541
+ export interface Pass {
542
+ arid: string;
543
+ version: number;
544
+ kind: PassKind;
545
+ /** The caller made this pass (ADR-047). */
546
+ role: "sharer";
547
+ /** The Principal it opens as; Grants to it decide what a guest sees. */
548
+ principal: string;
549
+ label: string;
550
+ message: string | null;
551
+ not_after: string | null;
552
+ max_opens: number | null;
553
+ max_sessions: number | null;
554
+ gate: PassGate;
555
+ state: PassState;
556
+ opens: number;
557
+ last_opened_at: string | null;
558
+ /** Guest sessions open right now. */
559
+ live_sessions: number;
560
+ /** An e-mail pass: the address its code goes to (the sharer's own Principal record). */
561
+ address?: string;
562
+ created_at: string;
563
+ updated_at: string;
564
+ }
565
+ /** `POST /v0/passes`: the pass, its Grants, and — once, for a link for anyone — the token and the link. */
566
+ export interface PassCreated extends Pass {
567
+ token?: string;
568
+ url?: string;
569
+ grants: Grant[];
570
+ notifications?: {
571
+ principal: string;
572
+ notification: string;
573
+ merged: boolean;
574
+ }[];
575
+ }
576
+ /** `GET /v0/passes/{arid}`: the pass with the Grants to its Principal that the sharer manages. */
577
+ export interface PassDetail extends Pass {
578
+ grants: Grant[];
579
+ }
580
+ /**
581
+ * Someone else's pass that reaches the caller's items (ADR-047): another
582
+ * Customer holding `share` made it, and Grants to its Principal sit in the
583
+ * caller's vault. The facts only — never the sharer's label, the message to
584
+ * its guests or an e-mail pass's address (ADR-024).
585
+ */
586
+ export interface PassOnYourItems {
587
+ arid: string;
588
+ version: number;
589
+ kind: PassKind;
590
+ /** The caller owns items the pass reaches. */
591
+ role: "owner";
592
+ /** The Principal it opens as: the `principal` of its Grants in your vault. */
593
+ principal: string;
594
+ /** Who made it: the Principal that issued its Grants on your items. */
595
+ issued_by: string;
596
+ /** Your Contact for that person, when one exists (ADR-024). */
597
+ issuer_contact: string | null;
598
+ not_after: string | null;
599
+ max_opens: number | null;
600
+ max_sessions: number | null;
601
+ gate: PassGate;
602
+ state: PassState;
603
+ opens: number;
604
+ last_opened_at: string | null;
605
+ live_sessions: number;
606
+ /** Grants to its Principal in your vault that are not revoked. */
607
+ grant_count: number;
608
+ created_at: string;
609
+ updated_at: string;
610
+ }
611
+ /** `GET /v0/passes/{arid}` for an owner: the facts and the Grants in your vault to its Principal. */
612
+ export interface PassOnYourItemsDetail extends PassOnYourItems {
613
+ grants: Grant[];
614
+ }
615
+ /** One item of `GET /v0/passes`: tell them apart by `role`. */
616
+ export type PassListItem = Pass | PassOnYourItems;
617
+ /** `POST /v0/passes/open`: a guest session (send it as `X-Asturiu-Session`, to `/v0/guest` only). */
618
+ export interface GuestOpened {
619
+ session: string;
620
+ kind: "guest";
621
+ expires_at: string;
622
+ idle_timeout_seconds: number;
623
+ }
624
+ /** `POST /v0/passes/handover`: the one-time code and where the portal sends the browser with it. */
625
+ export interface PassHandover {
626
+ handover: string;
627
+ url: string;
628
+ }
629
+ /** One thing a pass shows: the node a Grant to its Principal names. */
630
+ export interface GuestSharedItem {
631
+ arid: string;
632
+ type: string;
633
+ capabilities: Capability[];
634
+ /** `false`: this node only (ADR-027). */
635
+ inherit: boolean;
636
+ /** A Wallet's name or an Entry's label, when the guest may read it. */
637
+ name: string | null;
638
+ }
639
+ /** `GET /v0/guest`: what the pass shows and for how long. Nothing about the sharer beyond their message. */
640
+ export interface GuestOverview {
641
+ message: string | null;
642
+ kind: PassKind;
643
+ expires_at: string;
644
+ items: GuestSharedItem[];
645
+ }
646
+ export type TriggerCondition = {
647
+ kind: "schedule";
648
+ at?: string;
649
+ every_seconds?: number;
650
+ } | {
651
+ kind: "inactivity";
652
+ period_seconds: number;
653
+ } | {
654
+ kind: "signal";
655
+ };
656
+ export type TriggerActionInput = {
657
+ kind: "activate_grant";
658
+ grant: string;
659
+ } | {
660
+ kind: "activate_grants";
661
+ principal: string;
662
+ within: string;
663
+ } | {
664
+ kind: "notify";
665
+ principal: string;
666
+ message?: string;
667
+ } | {
668
+ kind: "mark_entry";
669
+ resource: string;
670
+ mark?: Record<string, unknown>;
671
+ } | {
672
+ kind: "start_transfer";
673
+ resource: string;
674
+ principal: string;
675
+ };
676
+ export interface Trigger extends ResourceBase {
677
+ name?: string;
678
+ condition: TriggerCondition;
679
+ actions: (TriggerActionInput & Record<string, unknown>)[];
680
+ state: "armed" | "fired" | "disarmed" | string;
681
+ due_at: string | null;
682
+ last_signal_at: string | null;
683
+ /** Only on creation of a `signal` Trigger; never returned again. */
684
+ signal_token?: string;
685
+ }
686
+ export interface Event {
687
+ arid: string;
688
+ subject_type: "customer" | "resource" | "tenant" | string;
689
+ subject: string;
690
+ type: string;
691
+ actor: string;
692
+ at?: string;
693
+ created_at?: string;
694
+ detail?: Record<string, unknown>;
695
+ [key: string]: unknown;
696
+ }
697
+ export interface Notification extends ResourceBase {
698
+ title: string;
699
+ kind: string;
700
+ detail: Record<string, unknown>;
701
+ channel?: string;
702
+ state: "pending" | "delivered" | "acknowledged" | "failed" | string;
703
+ attempts: number;
704
+ }
705
+ export interface Transfer extends ResourceBase {
706
+ resource: string;
707
+ resource_type?: string;
708
+ principal: string;
709
+ state: "offered" | "accepted" | "declined" | "withdrawn" | "completed" | string;
710
+ offered_by?: string;
711
+ offered_at?: string;
712
+ /** What the sender keeps after completion (ADR-019); `null` when nothing. */
713
+ retain?: {
714
+ capabilities: string[];
715
+ not_after: string | null;
716
+ grants: string[];
717
+ } | null;
718
+ /** Grants other Principals hold on the subtree: carried to the recipient or revoked at completion. */
719
+ existing_grants?: "keep" | "revoke";
720
+ /** Set once completed: what happened to the Grants on the subtree. */
721
+ outcome?: {
722
+ retained: string[];
723
+ carried: number;
724
+ revoked: number;
725
+ } | null;
726
+ /** The recipient's Contact for the sender, when one exists (ADR-024). */
727
+ from_contact?: string | null;
728
+ [key: string]: unknown;
729
+ }
730
+ /** What a field search looks for (ADR-046, decision 10): a value (the default), a locator or an ARID. */
731
+ export type SearchMatch = "value" | "locator" | "arid";
732
+ export interface SearchResult {
733
+ index_type: string;
734
+ match?: SearchMatch;
735
+ items: ({
736
+ type: "prn";
737
+ } & Principal)[] | {
738
+ type: "fld";
739
+ arid: string;
740
+ entry: string;
741
+ name: string;
742
+ }[];
743
+ }
744
+ export interface Health {
745
+ status: "ready" | "degraded";
746
+ component: string;
747
+ dependencies: Record<string, string>;
748
+ }
749
+ /** `GET /v0/portal/presentation?host=` (ADR-020): which Tenant a portal host serves, and how to show and sign in to it. No session. */
750
+ export interface PortalPresentation {
751
+ tenant: {
752
+ arid: string;
753
+ slug: string;
754
+ name: string;
755
+ };
756
+ state: "active" | "paused" | "frozen";
757
+ message: string;
758
+ /** Public branding only: `logo_url`, `logo_dark_url`, `favicon_url`, `primary_color`, `product_url`, `app_url`, `portal_url`, `billing_url`, `support_url`, `support_email`. Images are inline base64 only (ADR-038); one stored as a URL is left out. */
759
+ branding: Record<string, string>;
760
+ /** The Tenant's portal theme (ADR-033), as validated when it was written, with inline images only (ADR-038); `{}` when it has none. Read it through `resolvePortalTheme`. Absent from an Interface API older than 2026-10-07. */
761
+ theme?: PortalThemeSpec;
762
+ /**
763
+ * `backend` is `shared`, `isolated`, `source` or `direct` (ADR-021). Authentik backends carry `authentik_slug`; `direct` carries its `issuer`.
764
+ * `client_ids` lists every OIDC client of the Tenant's Application (the main one first); the portal's relay refuses any other on this host (ADR-032).
765
+ */
766
+ sign_in: {
767
+ backend: "shared" | "isolated" | "source" | "direct";
768
+ client_id: string | null;
769
+ client_ids: string[];
770
+ authentik_slug: string | null;
771
+ issuer: string | null;
772
+ };
773
+ /** Where the person manages the sign-in they may share with other services (ADR-022). */
774
+ security: {
775
+ mode: "neutral" | "brokered";
776
+ };
777
+ /** Who runs payments (ADR-067): the Tenant (`billing_url`), or the Engine on the Tenant's own account (`/v0/plans`, `/v0/customer/subscriptions`). */
778
+ billing: {
779
+ collection: "tenant" | "connected";
780
+ billing_url: string | null;
781
+ };
782
+ /** The day this Tenant closes, while its notice runs (ADR-064 §7). */
783
+ closing_at: string | null;
784
+ /**
785
+ * Portal options (ADR-037): the switches (`account_link`, `open_app`, `back_link`, `language_menu`, `appearance`) and where each page lives (`pages.<page>`: `portal`, `redirect` with a `url`, or `off`), defaults filled.
786
+ * Read it through `resolvePortalOptions`: an Interface API older than 2026-10-07 sends only `account_link`, or nothing.
787
+ */
788
+ portal?: Partial<PortalOptions>;
789
+ /** Guest passes (ADR-040): whether e-mail passes are on, where they open, and the Tenant app's pass page. Absent from an Interface API older than 2026-10-12: off. */
790
+ passes?: PassPresentation;
791
+ /** Whether the Tenant takes new Customers (ADR-044): `closed` hides sign-up and joining. Absent from an Interface API older than 2026-10-13: open. */
792
+ enrolment?: EnrolmentState;
793
+ }
794
+ /** One of the Customer's (or, on `/v0/me`, the User's) sessions, by opaque handle. */
795
+ export interface SessionListItem {
796
+ handle: string;
797
+ current: boolean;
798
+ label: string;
799
+ created_at: string;
800
+ last_seen_at: string;
801
+ expires_at: string;
802
+ /** `/v0/me/sessions` only: which product the session is on, or `null` for the platform sign-in page. */
803
+ product?: string | null;
804
+ }
805
+ /** `DELETE /v0/customer` with the confirmation token. */
806
+ export interface CustomerDeleted {
807
+ arid: string;
808
+ status: "deleted";
809
+ resources_deleted: number;
810
+ grants_revoked: number;
811
+ sessions_dropped: number;
812
+ user_deleted: boolean;
813
+ /** What happened to the sign-in (ADR-020): deactivated with the last Customer, or removed from this product only. */
814
+ account: "deactivated" | "left_tenant" | "none";
815
+ account_remove_after: string | null;
816
+ retention_days: number;
817
+ }
818
+ /** An enrolled second factor, by opaque handle. */
819
+ export interface SignInFactor {
820
+ handle: string;
821
+ kind: string;
822
+ name: string;
823
+ created_at: string | null;
824
+ last_used_at: string | null;
825
+ }
826
+ /**
827
+ * `GET /v0/customer/sign-in` (ADR-022, `brokered` mode): the sign-in this
828
+ * Customer uses. `shared` says whether it also opens other services — never
829
+ * which ones or how many.
830
+ */
831
+ export interface CustomerSignIn {
832
+ backend: "shared" | "isolated" | "source" | "direct";
833
+ shared: boolean;
834
+ username: string | null;
835
+ email: string | null;
836
+ factors: SignInFactor[];
837
+ /** Where to change the password (the Tenant's own flow); null when the Tenant's issuer owns it. */
838
+ password_change_url: string | null;
839
+ /** A policy this sign-in must keep because some service using it requires it; fixed text, no names. */
840
+ policy: {
841
+ require_2fa: boolean;
842
+ };
843
+ }
844
+ /** `GET /v0/me` (ADR-022): the person's own profile on the platform sign-in page. No ARIDs. */
845
+ export interface MeProfile {
846
+ handle?: string;
847
+ display_name?: string;
848
+ name?: string;
849
+ email?: string;
850
+ email_verified?: boolean;
851
+ phone?: string;
852
+ username: string | null;
853
+ }
854
+ /** `GET /v0/me/products`: where this sign-in is used. Only here, only to the person. */
855
+ export interface MeProduct {
856
+ name: string;
857
+ portal_url: string | null;
858
+ app_url: string | null;
859
+ /** Inline base64 only (ADR-038); null when the Tenant has none or still stores a URL. */
860
+ logo_url: string | null;
861
+ status: "active" | "suspended";
862
+ }
863
+ export interface MeSecurity {
864
+ username: string | null;
865
+ email: string | null;
866
+ factors: SignInFactor[];
867
+ password_change_url: string | null;
868
+ policy: {
869
+ require_2fa: boolean;
870
+ };
871
+ }
872
+ /** `GET /v0/attention` (ADR-029): what catch-up could not move to the latest version, for the vault's owner. */
873
+ export interface AttentionItem {
874
+ arid: string;
875
+ type: "ent" | "wlt";
876
+ wallet: string | null;
877
+ definition: DefinitionPin;
878
+ issues: number;
879
+ }
880
+ export interface Attention {
881
+ /** The Definition revision the vault was last caught up to. */
882
+ revision: number;
883
+ items: AttentionItem[];
884
+ }
885
+ //# sourceMappingURL=types.d.ts.map