@nuwah/vertical-sdk 0.0.0-stage → 0.2.0-rc.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.
Files changed (239) hide show
  1. package/LICENSE +17 -0
  2. package/README.md +229 -2
  3. package/bin/nuwah-contract-check-rules.d.mts +41 -0
  4. package/bin/nuwah-contract-check-rules.mjs +333 -0
  5. package/bin/nuwah-contract-check.mjs +64 -0
  6. package/dist/accounting.d.ts +1417 -0
  7. package/dist/accounting.js +274 -0
  8. package/dist/active-org.d.ts +13 -0
  9. package/dist/active-org.js +59 -0
  10. package/dist/actors.d.ts +448 -0
  11. package/dist/actors.js +143 -0
  12. package/dist/ai.d.ts +359 -0
  13. package/dist/ai.js +229 -0
  14. package/dist/analytics.d.ts +37 -0
  15. package/dist/analytics.js +8 -0
  16. package/dist/atlas.d.ts +291 -0
  17. package/dist/atlas.js +78 -0
  18. package/dist/audit.d.ts +193 -0
  19. package/dist/audit.js +26 -0
  20. package/dist/authentication.d.ts +119 -0
  21. package/dist/authentication.js +83 -0
  22. package/dist/awards.d.ts +38 -0
  23. package/dist/awards.js +10 -0
  24. package/dist/blueprint/document.d.ts +178 -0
  25. package/dist/blueprint/document.js +17 -0
  26. package/dist/blueprint/index.d.ts +3 -0
  27. package/dist/blueprint/index.js +5 -0
  28. package/dist/blueprint/manifest.d.ts +105 -0
  29. package/dist/blueprint/manifest.js +11 -0
  30. package/dist/blueprint/validate.d.ts +14 -0
  31. package/dist/blueprint/validate.js +416 -0
  32. package/dist/bookings-directory.d.ts +118 -0
  33. package/dist/bookings-directory.js +289 -0
  34. package/dist/bookings-extra.d.ts +1448 -0
  35. package/dist/bookings-extra.js +582 -0
  36. package/dist/bookings.d.ts +1365 -0
  37. package/dist/bookings.js +305 -0
  38. package/dist/builder-code.d.ts +164 -0
  39. package/dist/builder-code.js +12 -0
  40. package/dist/builder-core-gaps.d.ts +83 -0
  41. package/dist/builder-core-gaps.js +8 -0
  42. package/dist/builder-repos.d.ts +73 -0
  43. package/dist/builder-repos.js +37 -0
  44. package/dist/builder.d.ts +730 -0
  45. package/dist/builder.js +105 -0
  46. package/dist/campaigns.d.ts +105 -0
  47. package/dist/campaigns.js +25 -0
  48. package/dist/catalogs.d.ts +188 -0
  49. package/dist/catalogs.js +36 -0
  50. package/dist/commerce-ai.d.ts +182 -0
  51. package/dist/commerce-ai.js +27 -0
  52. package/dist/connections.d.ts +278 -0
  53. package/dist/connections.js +96 -0
  54. package/dist/content-control.d.ts +121 -0
  55. package/dist/content-control.js +23 -0
  56. package/dist/contributions.d.ts +560 -0
  57. package/dist/contributions.js +140 -0
  58. package/dist/conversation-assist.d.ts +154 -0
  59. package/dist/conversation-assist.js +51 -0
  60. package/dist/conversation-info.d.ts +219 -0
  61. package/dist/conversation-info.js +43 -0
  62. package/dist/crm.d.ts +533 -0
  63. package/dist/crm.js +142 -0
  64. package/dist/dashboards.d.ts +119 -0
  65. package/dist/dashboards.js +22 -0
  66. package/dist/delegations.d.ts +161 -0
  67. package/dist/delegations.js +39 -0
  68. package/dist/docs.d.ts +289 -0
  69. package/dist/docs.js +49 -0
  70. package/dist/documents.d.ts +317 -0
  71. package/dist/documents.js +84 -0
  72. package/dist/drafts.d.ts +132 -0
  73. package/dist/drafts.js +56 -0
  74. package/dist/engagements.d.ts +133 -0
  75. package/dist/engagements.js +15 -0
  76. package/dist/event-stream.d.ts +54 -0
  77. package/dist/event-stream.js +228 -0
  78. package/dist/exchanges.d.ts +447 -0
  79. package/dist/exchanges.js +145 -0
  80. package/dist/exports.d.ts +113 -0
  81. package/dist/exports.js +81 -0
  82. package/dist/feeds.d.ts +228 -0
  83. package/dist/feeds.js +52 -0
  84. package/dist/files.d.ts +56 -0
  85. package/dist/files.js +55 -0
  86. package/dist/finance-insights.d.ts +41 -0
  87. package/dist/finance-insights.js +61 -0
  88. package/dist/fixed-assets.d.ts +155 -0
  89. package/dist/fixed-assets.js +28 -0
  90. package/dist/fulfilment-jobs.d.ts +405 -0
  91. package/dist/fulfilment-jobs.js +76 -0
  92. package/dist/fulfilment.d.ts +205 -0
  93. package/dist/fulfilment.js +39 -0
  94. package/dist/hr.d.ts +350 -0
  95. package/dist/hr.js +94 -0
  96. package/dist/http.d.ts +124 -0
  97. package/dist/http.js +392 -0
  98. package/dist/inbox.d.ts +206 -0
  99. package/dist/inbox.js +36 -0
  100. package/dist/index.d.ts +384 -0
  101. package/dist/index.js +294 -0
  102. package/dist/insights.d.ts +176 -0
  103. package/dist/insights.js +52 -0
  104. package/dist/inventory.d.ts +797 -0
  105. package/dist/inventory.js +120 -0
  106. package/dist/list-query.d.ts +211 -0
  107. package/dist/list-query.js +158 -0
  108. package/dist/listings.d.ts +381 -0
  109. package/dist/listings.js +173 -0
  110. package/dist/location-sharing.d.ts +83 -0
  111. package/dist/location-sharing.js +20 -0
  112. package/dist/marketplace.d.ts +268 -0
  113. package/dist/marketplace.js +59 -0
  114. package/dist/matching.d.ts +103 -0
  115. package/dist/matching.js +22 -0
  116. package/dist/media.d.ts +221 -0
  117. package/dist/media.js +239 -0
  118. package/dist/metrics.d.ts +125 -0
  119. package/dist/metrics.js +45 -0
  120. package/dist/moderation.d.ts +240 -0
  121. package/dist/moderation.js +40 -0
  122. package/dist/money.d.ts +41 -0
  123. package/dist/money.js +79 -0
  124. package/dist/my-data.d.ts +266 -0
  125. package/dist/my-data.js +32 -0
  126. package/dist/names.d.ts +14 -0
  127. package/dist/names.js +17 -0
  128. package/dist/occasions.d.ts +256 -0
  129. package/dist/occasions.js +40 -0
  130. package/dist/onboarding.d.ts +88 -0
  131. package/dist/onboarding.js +38 -0
  132. package/dist/pagination.d.ts +204 -0
  133. package/dist/pagination.js +141 -0
  134. package/dist/party-baseline-attributes.d.ts +245 -0
  135. package/dist/party-baseline-attributes.js +36 -0
  136. package/dist/party.d.ts +401 -0
  137. package/dist/party.js +56 -0
  138. package/dist/patient.d.ts +161 -0
  139. package/dist/patient.js +45 -0
  140. package/dist/payroll.d.ts +378 -0
  141. package/dist/payroll.js +60 -0
  142. package/dist/person-addresses.d.ts +88 -0
  143. package/dist/person-addresses.js +18 -0
  144. package/dist/person-cart.d.ts +250 -0
  145. package/dist/person-cart.js +63 -0
  146. package/dist/person-chat-assist.d.ts +47 -0
  147. package/dist/person-chat-assist.js +13 -0
  148. package/dist/person-data-webhooks.d.ts +72 -0
  149. package/dist/person-data-webhooks.js +86 -0
  150. package/dist/person-data.d.ts +212 -0
  151. package/dist/person-data.js +162 -0
  152. package/dist/person-locations.d.ts +54 -0
  153. package/dist/person-locations.js +6 -0
  154. package/dist/person-messaging.d.ts +405 -0
  155. package/dist/person-messaging.js +112 -0
  156. package/dist/person-notifications.d.ts +319 -0
  157. package/dist/person-notifications.js +164 -0
  158. package/dist/personalisation.d.ts +21 -0
  159. package/dist/personalisation.js +8 -0
  160. package/dist/platform.d.ts +63 -0
  161. package/dist/platform.js +45 -0
  162. package/dist/portfolio.d.ts +163 -0
  163. package/dist/portfolio.js +28 -0
  164. package/dist/pos.d.ts +743 -0
  165. package/dist/pos.js +129 -0
  166. package/dist/procurement.d.ts +664 -0
  167. package/dist/procurement.js +157 -0
  168. package/dist/promotions.d.ts +169 -0
  169. package/dist/promotions.js +39 -0
  170. package/dist/publications.d.ts +583 -0
  171. package/dist/publications.js +164 -0
  172. package/dist/ranking.d.ts +43 -0
  173. package/dist/ranking.js +34 -0
  174. package/dist/ratings.d.ts +293 -0
  175. package/dist/ratings.js +109 -0
  176. package/dist/reactions.d.ts +123 -0
  177. package/dist/reactions.js +41 -0
  178. package/dist/recipient-orders.d.ts +294 -0
  179. package/dist/recipient-orders.js +73 -0
  180. package/dist/relationships.d.ts +18 -0
  181. package/dist/relationships.js +8 -0
  182. package/dist/reporting.d.ts +107 -0
  183. package/dist/reporting.js +56 -0
  184. package/dist/sales.d.ts +270 -0
  185. package/dist/sales.js +66 -0
  186. package/dist/shares.d.ts +105 -0
  187. package/dist/shares.js +27 -0
  188. package/dist/shop.d.ts +993 -0
  189. package/dist/shop.js +215 -0
  190. package/dist/shopping-assistant.d.ts +65 -0
  191. package/dist/shopping-assistant.js +14 -0
  192. package/dist/spaces.d.ts +422 -0
  193. package/dist/spaces.js +118 -0
  194. package/dist/stored-value.d.ts +754 -0
  195. package/dist/stored-value.js +177 -0
  196. package/dist/types.d.ts +83 -0
  197. package/dist/types.js +2 -0
  198. package/dist/vault.d.ts +290 -0
  199. package/dist/vault.js +55 -0
  200. package/dist/vertical-runtime.d.ts +17 -0
  201. package/dist/vertical-runtime.js +8 -0
  202. package/dist/vite/build-manifest-plugin.d.ts +42 -0
  203. package/dist/vite/build-manifest-plugin.js +42 -0
  204. package/dist/vite/first-paint-plugin.d.ts +26 -0
  205. package/dist/vite/first-paint-plugin.js +57 -0
  206. package/dist/wishlists.d.ts +591 -0
  207. package/dist/wishlists.js +188 -0
  208. package/dist/workbench.d.ts +114 -0
  209. package/dist/workbench.js +22 -0
  210. package/dist/workspace.d.ts +190 -0
  211. package/dist/workspace.js +41 -0
  212. package/package.json +52 -4
  213. package/templates/extension-image.Dockerfile +38 -0
  214. package/templates/nuwah-vertical.yml +102 -0
  215. package/templates/vertical-app/.env.example +34 -0
  216. package/templates/vertical-app/README.md +108 -0
  217. package/templates/vertical-app/github/workflows/ci.yml +51 -0
  218. package/templates/vertical-app/gitignore +5 -0
  219. package/templates/vertical-app/index.html +12 -0
  220. package/templates/vertical-app/package.json +28 -0
  221. package/templates/vertical-app/src/App.tsx +64 -0
  222. package/templates/vertical-app/src/blueprint/blueprint.ts +45 -0
  223. package/templates/vertical-app/src/blueprint/screens.ts +15 -0
  224. package/templates/vertical-app/src/env.d.ts +18 -0
  225. package/templates/vertical-app/src/index.css +139 -0
  226. package/templates/vertical-app/src/lib/i18n.ts +5 -0
  227. package/templates/vertical-app/src/lib/iam.ts +19 -0
  228. package/templates/vertical-app/src/lib/operations.ts +93 -0
  229. package/templates/vertical-app/src/lib/router.ts +24 -0
  230. package/templates/vertical-app/src/lib/sdk.ts +21 -0
  231. package/templates/vertical-app/src/lib/theme.ts +18 -0
  232. package/templates/vertical-app/src/lib/words.ts +39 -0
  233. package/templates/vertical-app/src/main.tsx +25 -0
  234. package/templates/vertical-app/src/pages/AppScreens.tsx +71 -0
  235. package/templates/vertical-app/src/pages/AuthCallback.tsx +44 -0
  236. package/templates/vertical-app/src/pages/Home.tsx +36 -0
  237. package/templates/vertical-app/tsconfig.json +24 -0
  238. package/templates/vertical-app/vite.config.ts +23 -0
  239. package/templates/vertical-ci.yml +192 -0
@@ -0,0 +1,754 @@
1
+ import type { Http } from './http.js';
2
+ import { type BilingualText, type PartyReference, type PartyReferenceString, type PersonDomainCallOptions, type PersonDomainCursorPage, type PersonDomainEnvelope } from './actors.js';
3
+ import { type DateRangeValue, type DecimalRangeValue, type ListPage, type ListQueryState } from './list-query.js';
4
+ /**
5
+ * What a holder may ask of a statement (the server's `stored_value.statement` declaration).
6
+ * Typed narrowly so a misspelt filter fails to compile; the server refuses unknown keys anyway.
7
+ */
8
+ export interface StoredValueStatementQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
9
+ sort?: 'posted_at' | '-posted_at' | null;
10
+ filter?: {
11
+ operation?: StoredValueOperation[] | null;
12
+ flow?: Array<'in' | 'out'> | null;
13
+ posted_at?: DateRangeValue | null;
14
+ amount?: DecimalRangeValue | null;
15
+ /** One party, `kind:uuid` — the other side of the movement. */
16
+ counterparty?: PartyReferenceString | null;
17
+ };
18
+ }
19
+ /** The holder's reservations (`stored_value.holds`). `open: true` is the legacy `filter[status]=held`. */
20
+ export interface StoredValueHoldsQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
21
+ sort?: '-created_at' | 'expires_at' | null;
22
+ filter?: {
23
+ status?: StoredValueHoldStatus[] | null;
24
+ /** A unit key. */
25
+ unit?: string | null;
26
+ created_at?: DateRangeValue | null;
27
+ };
28
+ /** Legacy: open holds only. Prefer `filter.status: ['held']`. */
29
+ open?: boolean;
30
+ }
31
+ /** The holder's cash-outs (`stored_value.payouts`). */
32
+ export interface StoredValuePayoutsQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
33
+ sort?: '-requested_at' | 'requested_at' | '-amount' | null;
34
+ filter?: {
35
+ status?: StoredValuePayoutStatus[] | null;
36
+ unit?: string | null;
37
+ requested_at?: DateRangeValue | null;
38
+ amount?: DecimalRangeValue | null;
39
+ };
40
+ }
41
+ /** The organisation's approval queue (`stored_value.organisation.payouts`): oldest first by default. */
42
+ export interface StoredValueOrganisationPayoutsQuery extends StoredValuePayoutsQuery {
43
+ /** Legacy single status; prefer `filter.status`. */
44
+ status?: StoredValuePayoutStatus;
45
+ }
46
+ export type StoredValueMessagedTransferStatus = 'scheduled' | 'delivered' | 'cancelled' | 'failed';
47
+ export type StoredValueCreditRequestStatus = 'pending' | 'accepted' | 'declined' | 'cancelled' | 'expired';
48
+ /**
49
+ * The viewer's side of a messaged transfer — one vocabulary for the record's `role` AND the list's
50
+ * `filter[role]`, exactly as the server declares it (`StoredValueLists::messagedTransfers`). The
51
+ * filter once said `sent`/`received` and every request was refused 422 (e2e FINDINGS F-03).
52
+ */
53
+ export type StoredValueMessagedTransferRole = 'sender' | 'recipient';
54
+ export declare const STORED_VALUE_MESSAGED_TRANSFER_ROLES: readonly StoredValueMessagedTransferRole[];
55
+ /** Value sent with a message, optionally revealed later. The recipient never sees `scheduled` rows. */
56
+ export interface StoredValueMessagedTransfer {
57
+ id: string;
58
+ unit_key: string;
59
+ currency_code: string;
60
+ decimals: number;
61
+ amount: StoredValueAmount;
62
+ role: StoredValueMessagedTransferRole;
63
+ sender: PartyReference;
64
+ recipient: PartyReference;
65
+ status: StoredValueMessagedTransferStatus;
66
+ reveal_at: string | null;
67
+ delivered_at: string | null;
68
+ opened_at: string | null;
69
+ /** True for the recipient until they open it; the message is then withheld (`null`). */
70
+ sealed: boolean;
71
+ message: string | null;
72
+ thanks: {
73
+ message: string;
74
+ thanked_at: string;
75
+ } | null;
76
+ attributes: Record<string, unknown>;
77
+ entry_id: string | null;
78
+ failure_reason: string | null;
79
+ created_at: string;
80
+ }
81
+ export interface SendMessagedTransferRequest {
82
+ unit_key: string;
83
+ amount: StoredValueAmount;
84
+ recipient: {
85
+ handle: string;
86
+ } | {
87
+ actor: PartyReferenceString;
88
+ };
89
+ /** At most 500 characters. */
90
+ message?: string | null;
91
+ /** ISO 8601 WITH an offset, in the future, at most 365 days ahead. Absent: delivered now. */
92
+ reveal_at?: string | null;
93
+ /** Vertical presentation (a card design key…); core never reads it. */
94
+ attributes?: Record<string, unknown>;
95
+ }
96
+ export interface StoredValueMessagedTransfersQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
97
+ sort?: '-created_at' | 'created_at' | null;
98
+ filter?: {
99
+ role?: StoredValueMessagedTransferRole[] | null;
100
+ status?: StoredValueMessagedTransferStatus[] | null;
101
+ created_at?: DateRangeValue | null;
102
+ };
103
+ }
104
+ /** One party asking another for credit. */
105
+ export interface StoredValueCreditRequest {
106
+ id: string;
107
+ unit_key: string;
108
+ currency_code: string;
109
+ decimals: number;
110
+ amount: StoredValueAmount;
111
+ role: 'requester' | 'payer';
112
+ requester: PartyReference;
113
+ payer: PartyReference;
114
+ message: string | null;
115
+ status: StoredValueCreditRequestStatus;
116
+ expires_at: string;
117
+ decided_at: string | null;
118
+ entry_id: string | null;
119
+ created_at: string;
120
+ }
121
+ export interface CreateCreditRequestRequest {
122
+ unit_key: string;
123
+ amount: StoredValueAmount;
124
+ payer: {
125
+ handle: string;
126
+ } | {
127
+ actor: PartyReferenceString;
128
+ };
129
+ /** At most 280 characters. */
130
+ message?: string | null;
131
+ /** 1–30; the server defaults to 14. */
132
+ expires_in_days?: number | null;
133
+ }
134
+ export interface StoredValueCreditRequestsQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
135
+ sort?: '-created_at' | 'created_at' | null;
136
+ filter?: {
137
+ role?: Array<'incoming' | 'outgoing'> | null;
138
+ status?: StoredValueCreditRequestStatus[] | null;
139
+ created_at?: DateRangeValue | null;
140
+ };
141
+ }
142
+ /** The receipt of one movement, as the viewer's own line saw it. */
143
+ export interface StoredValueReceipt {
144
+ entry_id: string;
145
+ sequence: number;
146
+ operation: StoredValueOperation;
147
+ operation_label: BilingualText;
148
+ unit_key: string;
149
+ unit_label: BilingualText;
150
+ currency_code: string;
151
+ decimals: number;
152
+ /** SIGNED, the viewer's own line. */
153
+ amount: StoredValueAmount;
154
+ balance_after: StoredValueAmount;
155
+ counterparty: PartyReference | null;
156
+ reference: StoredValueReference | null;
157
+ reverses_entry_id: string | null;
158
+ messaged_transfer: {
159
+ id: string;
160
+ message: string | null;
161
+ sender: PartyReference;
162
+ } | null;
163
+ posted_at: string;
164
+ }
165
+ /** A unit row of the organisation's units list. */
166
+ export interface StoredValueOrganisationUnit extends Omit<StoredValueUnit, 'status'> {
167
+ status: StoredValueUnitStatus | 'retired';
168
+ outstanding: StoredValueAmount;
169
+ holders_with_balance: number;
170
+ retires_at: string | null;
171
+ created_at: string;
172
+ }
173
+ export interface StoredValueOrganisationUnitsQuery extends Omit<ListQueryState, 'sort' | 'filter'> {
174
+ sort?: 'unit_key' | '-created_at' | '-outstanding' | null;
175
+ filter?: {
176
+ status?: Array<StoredValueUnitStatus | 'retired'> | null;
177
+ };
178
+ }
179
+ export interface StoredValueUnitLifecycleRequest {
180
+ action: 'suspend' | 'resume' | 'retire';
181
+ /** Retire only; ISO with offset. Absent: now. */
182
+ retires_at?: string | null;
183
+ /** Words for the holders' notice. */
184
+ notice?: BilingualText | null;
185
+ }
186
+ /** One journal entry of the organisation's units. */
187
+ export interface StoredValueJournalEntry {
188
+ id: string;
189
+ sequence: number;
190
+ unit_key: string;
191
+ operation: StoredValueOperation;
192
+ amount: StoredValueAmount;
193
+ currency_code: string;
194
+ initiator: PartyReference;
195
+ parties: Array<{
196
+ account_type: string;
197
+ party: PartyReference | null;
198
+ amount: StoredValueAmount;
199
+ }>;
200
+ reference: StoredValueReference | null;
201
+ reverses_entry_id: string | null;
202
+ created_at: string;
203
+ }
204
+ export interface StoredValueJournalQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
205
+ sort?: '-posted_at' | 'posted_at' | null;
206
+ filter?: {
207
+ unit?: string | null;
208
+ operation?: StoredValueOperation[] | null;
209
+ posted_at?: DateRangeValue | null;
210
+ amount?: DecimalRangeValue | null;
211
+ counterparty?: PartyReferenceString | null;
212
+ };
213
+ }
214
+ export interface StoredValueNetworksQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
215
+ sort?: 'network_key' | '-created_at' | null;
216
+ filter?: {
217
+ role?: Array<'operator' | 'member'> | null;
218
+ status?: Array<'active' | 'closed'> | null;
219
+ settlement_mode?: Array<'none' | 'periodic_net' | 'immediate'> | null;
220
+ };
221
+ }
222
+ export interface StoredValueNetworkMembersQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
223
+ sort?: '-requested_at' | 'requested_at' | null;
224
+ filter?: {
225
+ status?: Array<'pending' | 'active' | 'suspended' | 'left' | 'declined'> | null;
226
+ requested_at?: DateRangeValue | null;
227
+ };
228
+ }
229
+ export interface StoredValueSettlementBatchesQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
230
+ sort?: '-created_at' | 'period_end' | null;
231
+ filter?: {
232
+ status?: Array<'open' | 'finalised' | 'paid'> | null;
233
+ network?: string | null;
234
+ period_end?: DateRangeValue | null;
235
+ };
236
+ /** Legacy single status; prefer `filter.status`. */
237
+ status?: string;
238
+ }
239
+ /** Live liability per unit — what the issuer owes now. */
240
+ export interface StoredValueLiabilityRow {
241
+ unit_key: string;
242
+ unit_label: BilingualText;
243
+ currency_code: string;
244
+ decimals: number;
245
+ status: string;
246
+ outstanding: StoredValueAmount;
247
+ held: StoredValueAmount;
248
+ cashing_out: StoredValueAmount;
249
+ holders_with_balance: number;
250
+ }
251
+ export interface StoredValueLiability {
252
+ data: StoredValueLiabilityRow[];
253
+ meta: {
254
+ measured_at: string;
255
+ };
256
+ }
257
+ export type StoredValueActivityGranularity = 'day' | 'month';
258
+ /** One rollup bucket (UTC days or months), refreshed asynchronously. */
259
+ export interface StoredValueActivityRow {
260
+ unit_key: string;
261
+ /** `YYYY-MM-DD` — the first day of the bucket. */
262
+ period_start: string;
263
+ issued: StoredValueAmount;
264
+ redeemed: StoredValueAmount;
265
+ transferred: StoredValueAmount;
266
+ expired: StoredValueAmount;
267
+ forfeited: StoredValueAmount;
268
+ reversed: StoredValueAmount;
269
+ breakage: StoredValueAmount;
270
+ entry_count: number;
271
+ }
272
+ export interface StoredValueActivity {
273
+ data: StoredValueActivityRow[];
274
+ meta: {
275
+ refreshed_at: string | null;
276
+ time_zone: string;
277
+ granularity: StoredValueActivityGranularity;
278
+ };
279
+ }
280
+ export interface StoredValueActivityQuery {
281
+ granularity?: StoredValueActivityGranularity;
282
+ /** `YYYY-MM-DD`. */
283
+ from?: string;
284
+ to?: string;
285
+ unit?: string;
286
+ }
287
+ export type StoredValueIssueBatchStatus = 'validated' | 'queued' | 'running' | 'completed';
288
+ export type StoredValueIssueBatchRowOutcome = 'valid' | 'invalid' | 'issued' | 'failed' | 'skipped';
289
+ export interface StoredValueIssueBatch {
290
+ id: string;
291
+ unit_key: string;
292
+ currency_code: string;
293
+ status: StoredValueIssueBatchStatus;
294
+ row_count: number;
295
+ valid_count: number;
296
+ invalid_count: number;
297
+ issued_count: number;
298
+ failed_count: number;
299
+ skipped_count: number;
300
+ total_amount: StoredValueAmount;
301
+ issued_amount: StoredValueAmount;
302
+ created_at: string;
303
+ submitted_at: string | null;
304
+ completed_at: string | null;
305
+ }
306
+ export interface StoredValueIssueBatchRowError {
307
+ field: string;
308
+ reason: string;
309
+ message: BilingualText;
310
+ }
311
+ export interface StoredValueIssueBatchRow {
312
+ row_number: number;
313
+ holder: PartyReference | null;
314
+ amount: StoredValueAmount | null;
315
+ row_key: string | null;
316
+ outcome: StoredValueIssueBatchRowOutcome;
317
+ errors: StoredValueIssueBatchRowError[];
318
+ entry_id: string | null;
319
+ }
320
+ /** A batch from CSV text, or from a file (sent as multipart). */
321
+ export type CreateIssueBatchRequest = {
322
+ unit_key: string;
323
+ csv: string;
324
+ } | {
325
+ unit_key: string;
326
+ file: Blob;
327
+ };
328
+ export interface StoredValueIssueBatchesQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
329
+ sort?: '-created_at' | null;
330
+ filter?: {
331
+ status?: StoredValueIssueBatchStatus[] | null;
332
+ };
333
+ }
334
+ export interface StoredValueIssueBatchRowsQuery extends Omit<ListQueryState, 'sort' | 'filter' | 'search'> {
335
+ sort?: 'row_number' | null;
336
+ filter?: {
337
+ outcome?: StoredValueIssueBatchRowOutcome[] | null;
338
+ };
339
+ }
340
+ /** A decimal string at scale 4 (`"12.5000"`). Never a number. */
341
+ export type StoredValueAmount = string;
342
+ /** What a ledger movement was. Products word these themselves (injected labels). */
343
+ export type StoredValueOperation = 'issue' | 'transfer' | 'redeem' | 'hold' | 'hold_capture' | 'hold_release' | 'payout_request' | 'payout_settle' | 'payout_fail' | 'expiry' | 'forfeiture' | 'settlement' | 'reversal';
344
+ export type StoredValueHoldStatus = 'held' | 'captured' | 'released';
345
+ export type StoredValuePayoutStatus = 'requested' | 'approved' | 'paid' | 'failed' | 'rejected';
346
+ export type StoredValueUnitStatus = 'active' | 'suspended';
347
+ /** `{type, id}` a write may carry to name what it was for (an order, a return). */
348
+ export interface StoredValueReference {
349
+ type: string;
350
+ id: string;
351
+ }
352
+ /** One balance as its holder sees it. `balance` is spendable now; `held` sits in open holds. */
353
+ export interface StoredValueBalance {
354
+ unit_key: string;
355
+ label: BilingualText;
356
+ issuer: PartyReference;
357
+ currency_code: string;
358
+ /** The unit's own precision (0–4); amounts still arrive at scale 4. */
359
+ decimals: number;
360
+ balance: StoredValueAmount;
361
+ held: StoredValueAmount;
362
+ last_activity_at: string | null;
363
+ }
364
+ /** One statement line. `amount` is SIGNED: positive came in, negative went out. */
365
+ export interface StoredValueStatementLine {
366
+ id: string;
367
+ entry_id: string;
368
+ sequence: number;
369
+ operation: StoredValueOperation;
370
+ amount: StoredValueAmount;
371
+ balance_after: StoredValueAmount;
372
+ reference: StoredValueReference | null;
373
+ created_at: string;
374
+ /** The other side of the movement, when there is one the holder may know. Absent on older servers. */
375
+ counterparty?: PartyReference | null;
376
+ }
377
+ /** A posted movement. `replayed` = this answers a repeated key; nothing moved again. */
378
+ export interface StoredValueEntry {
379
+ id: string;
380
+ sequence: number;
381
+ unit_key: string;
382
+ operation: StoredValueOperation;
383
+ amount: StoredValueAmount;
384
+ currency_code: string;
385
+ initiator: PartyReference;
386
+ reference: StoredValueReference | null;
387
+ reverses_entry_id: string | null;
388
+ created_at: string;
389
+ replayed: boolean;
390
+ }
391
+ /** A reservation of value, optionally for one named business, optionally until a time. */
392
+ export interface StoredValueHold {
393
+ id: string;
394
+ unit_key: string;
395
+ currency_code: string;
396
+ holder: PartyReference;
397
+ designated_beneficiary: PartyReference | null;
398
+ captured_by: PartyReference | null;
399
+ amount: StoredValueAmount;
400
+ captured_amount: StoredValueAmount | null;
401
+ status: StoredValueHoldStatus;
402
+ release_reason: string | null;
403
+ expires_at: string | null;
404
+ reference: StoredValueReference | null;
405
+ created_at: string;
406
+ resolved_at: string | null;
407
+ replayed: boolean;
408
+ }
409
+ /** A cash-out. The destination is never returned — only a hint of its last characters. */
410
+ export interface StoredValuePayout {
411
+ id: string;
412
+ unit_key: string;
413
+ holder: PartyReference;
414
+ gross_amount: StoredValueAmount;
415
+ fee_amount: StoredValueAmount;
416
+ net_amount: StoredValueAmount;
417
+ currency_code: string;
418
+ status: StoredValuePayoutStatus;
419
+ rail: string | null;
420
+ rail_reference: string | null;
421
+ destination_hint: string | null;
422
+ failure_reason: string | null;
423
+ requested_at: string;
424
+ decided_at: string | null;
425
+ settled_at: string | null;
426
+ replayed: boolean;
427
+ }
428
+ /** A unit's declared rules. Amounts and the fee percentage are scale-4 strings. */
429
+ export interface StoredValueUnitRules {
430
+ transfer_mode: string;
431
+ expiry_mode: string;
432
+ expiry_inactivity_days: number | null;
433
+ fee_mode: 'none' | 'payout_percentage' | (string & {});
434
+ fee_percentage: string | null;
435
+ overdraft_mode: string;
436
+ overdraft_limit: StoredValueAmount | null;
437
+ payout_approval: string;
438
+ payout_minimum: StoredValueAmount | null;
439
+ payout_automatic_threshold: StoredValueAmount | null;
440
+ erasure_with_balance: string;
441
+ holder_disclosure?: 'holders_only' | 'public' | (string & {});
442
+ }
443
+ export interface StoredValueUnit {
444
+ key: string;
445
+ label: BilingualText;
446
+ issuer: PartyReference;
447
+ currency_code: string;
448
+ decimals: number;
449
+ status: StoredValueUnitStatus;
450
+ rules: StoredValueUnitRules;
451
+ attributes: Record<string, unknown>;
452
+ }
453
+ /**
454
+ * A unit as its HOLDER sees it — `GET /api/person/stored-value/units/{unitKey}`. The terms that
455
+ * bind the holder only: no automatic-approval threshold, overdraft, erasure rule or attributes
456
+ * (those are the issuer's, on {@link StoredValueUnit}).
457
+ */
458
+ export interface StoredValueHolderUnit {
459
+ key: string;
460
+ label: BilingualText;
461
+ issuer: PartyReference;
462
+ currency_code: string;
463
+ decimals: number;
464
+ status: StoredValueUnitStatus;
465
+ transfer_mode: 'none' | 'between_parties' | (string & {});
466
+ expiry: {
467
+ mode: 'none' | 'after_inactivity' | (string & {});
468
+ inactivity_days: number | null;
469
+ };
470
+ payout: {
471
+ /** False when the issuer offers no cash-out at all. */
472
+ available: boolean;
473
+ approval: 'disabled' | 'manual' | 'automatic_below_threshold' | (string & {});
474
+ /** Scale-4 string; below it a request is refused (422). `"0.0000"` = no minimum. */
475
+ minimum: StoredValueAmount;
476
+ fee: {
477
+ mode: 'none' | 'payout_percentage' | (string & {});
478
+ /** Scale-4 percentage string, or null when there is no fee. */
479
+ percentage: string | null;
480
+ };
481
+ person_method?: StoredValuePersonCashOut;
482
+ };
483
+ }
484
+ /** `stored_value.person_cash_out` — see {@link StoredValueHolderUnit.payout}. */
485
+ export type StoredValuePersonCashOut = 'off' | 'to_bank_account' | 'at_partner_business' | (string & {});
486
+ /** True when a person may ask to cash this unit out now (both the issuer's rule and the platform's method allow it). */
487
+ export declare function storedValueCashOutOffered(unit: Pick<StoredValueHolderUnit, 'payout'>): boolean;
488
+ /**
489
+ * A party where a unit can be spent now — one row of `GET …/units/{unitKey}/acceptors`.
490
+ * `profile` is the directory's summary for this viewer (null for an organisation, which the
491
+ * actor directory does not describe — render it from `party`). Businesses the viewer may not see
492
+ * are absent. `accepted_until` is set when acceptance is ending (a notice period is running).
493
+ */
494
+ export interface StoredValueAcceptor {
495
+ party: PartyReference;
496
+ profile: Record<string, unknown> | null;
497
+ is_issuer: boolean;
498
+ network_keys: string[];
499
+ accepted_until: string | null;
500
+ }
501
+ /**
502
+ * A network, membership, unit link or settlement batch row: the stored columns, times as ATOM
503
+ * strings, parties as `{kind, id}`. Typed loosely on purpose — the columns are administrative.
504
+ */
505
+ export type StoredValueNetworkRecord = Record<string, unknown> & {
506
+ id?: string;
507
+ key?: string;
508
+ label?: BilingualText;
509
+ status?: string;
510
+ };
511
+ export interface TransferStoredValueRequest {
512
+ unit_key: string;
513
+ amount: StoredValueAmount;
514
+ /** A person by handle, or a business profile by reference. Exactly one. */
515
+ recipient: {
516
+ handle: string;
517
+ } | {
518
+ actor: PartyReferenceString;
519
+ };
520
+ reference?: StoredValueReference | null;
521
+ }
522
+ export interface PlaceStoredValueHoldRequest {
523
+ unit_key: string;
524
+ amount: StoredValueAmount;
525
+ /** ISO time in the future; absent = no expiry. */
526
+ expires_at?: string | null;
527
+ /** The one business that may take it (`actor:<uuid>` / `organisation:<uuid>`). */
528
+ beneficiary?: PartyReferenceString | null;
529
+ reference?: StoredValueReference | null;
530
+ }
531
+ export interface RequestStoredValuePayoutRequest {
532
+ unit_key: string;
533
+ amount: StoredValueAmount;
534
+ /** Stored encrypted, never returned. 4–128 characters. */
535
+ destination?: string | null;
536
+ }
537
+ export interface DeclareStoredValueUnitRequest {
538
+ key: string;
539
+ currency_code: string;
540
+ decimals: number;
541
+ label: BilingualText;
542
+ rules?: Partial<StoredValueUnitRules>;
543
+ attributes?: Record<string, unknown>;
544
+ }
545
+ export interface IssueStoredValueRequest {
546
+ unit_key: string;
547
+ /** A person (`person:<uuid>`) or a business profile (`actor:<uuid>`) — never an organisation. */
548
+ holder: PartyReferenceString;
549
+ amount: StoredValueAmount;
550
+ reference?: StoredValueReference | null;
551
+ }
552
+ export interface DeclareAcceptanceNetworkRequest {
553
+ key: string;
554
+ label: BilingualText;
555
+ settlement_mode?: string | null;
556
+ settlement_period?: 'daily' | 'weekly' | 'monthly' | null;
557
+ admission?: string | null;
558
+ exit_notice_days?: number;
559
+ attributes?: Record<string, unknown>;
560
+ }
561
+ /** Whether one party accepts one unit now — `GET …/units/{unitKey}/acceptance`. */
562
+ export interface StoredValueAcceptance {
563
+ unit_key: string;
564
+ party: {
565
+ kind: string;
566
+ id: string;
567
+ };
568
+ accepted: boolean;
569
+ }
570
+ /** The regex core validates every amount against. Exported so a form can check before sending. */
571
+ export declare const STORED_VALUE_AMOUNT_PATTERN: RegExp;
572
+ export declare function createStoredValueNamespace(http: Http): {
573
+ units: {
574
+ /**
575
+ * GET /units/{unitKey} — the holder view: label, currency, decimals, transfer and
576
+ * expiry rules, and the cash-out terms (minimum, fee, approval mode). 404 unless the
577
+ * caller holds or held the unit, is its issuer, or the unit is public.
578
+ */
579
+ show: (unitKey: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueHolderUnit>>;
580
+ /** GET /units/{unitKey}/acceptors?cursor=&limit= — where it can be spent now (limit ≤ 100). */
581
+ acceptors: (unitKey: string, query?: {
582
+ cursor?: string | null;
583
+ limit?: number;
584
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainCursorPage<StoredValueAcceptor>>;
585
+ /**
586
+ * GET /units/{unitKey}/acceptance?party=organisation:<uuid> — would `party` take this
587
+ * unit NOW (issuer, or an active network both belong to)? Ask before offering it as a
588
+ * tender. Advice, not a promise: the payment re-checks and may still refuse
589
+ * `not_accepted_here`. 404 `unit_unknown` for a unit the caller may not know.
590
+ */
591
+ acceptance: (unitKey: string, party: PartyReferenceString, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueAcceptance>>;
592
+ };
593
+ /** GET /balances — every unit the holder has, spendable and held. */
594
+ balances: (options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueBalance[]>>;
595
+ /**
596
+ * GET /statements/{unitKey} — a declared list (`stored_value.statement`): newest first by
597
+ * default, by opaque cursor (limit ≤ 100, clamped). Also `sort: 'posted_at'` (oldest first),
598
+ * `filter: { operation: [...], flow: ['in'|'out'], posted_at: { from, to, time_zone },
599
+ * amount: { minimum, maximum } }` and `describe: true` for `meta.list`. A cursor answers
600
+ * only the sort and filters it was issued under ({@link isStaleListCursor}).
601
+ */
602
+ statement: (unitKey: string, query?: StoredValueStatementQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueStatementLine>>;
603
+ /** POST /transfers — only where the unit's transfer rule allows it. */
604
+ transfer: (request: TransferStoredValueRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueEntry>>;
605
+ /**
606
+ * GET /entries/{entryId} — the receipt of one movement as the viewer's own line saw it
607
+ * (counterparty, reference, and the message of a messaged transfer when the viewer may read it).
608
+ */
609
+ receipt: (entryId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueReceipt>>;
610
+ /** Send credit with a message, now or revealed at a chosen time (`stored_value.messaged_transfers`). */
611
+ messagedTransfers: {
612
+ /** POST /messaged-transfers — one key per "Send" press; a retry replays. */
613
+ send: (request: SendMessagedTransferRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueMessagedTransfer>>;
614
+ /** GET /messaged-transfers — sent and received, newest first; filter `role`, `status`, `created_at`. */
615
+ list: (query?: StoredValueMessagedTransfersQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueMessagedTransfer>>;
616
+ show: (id: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueMessagedTransfer>>;
617
+ /** POST /messaged-transfers/{id}/opening — the recipient opens it; the message is revealed. Idempotent. */
618
+ open: (id: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueMessagedTransfer>>;
619
+ /** POST /messaged-transfers/{id}/thanks — once, after opening; at most 280 characters. */
620
+ thank: (id: string, message: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueMessagedTransfer>>;
621
+ /** POST /messaged-transfers/{id}/cancellation — the sender, only while scheduled; the reserved value returns. */
622
+ cancel: (id: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueMessagedTransfer>>;
623
+ };
624
+ /** Ask a party for credit; the payer accepts (money moves) or declines (`stored_value.credit_requests`). */
625
+ creditRequests: {
626
+ create: (request: CreateCreditRequestRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueCreditRequest>>;
627
+ list: (query?: StoredValueCreditRequestsQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueCreditRequest>>;
628
+ show: (id: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueCreditRequest>>;
629
+ /** POST …/acceptance — the payer pays. One key per "Pay" press. */
630
+ accept: (id: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueCreditRequest>>;
631
+ decline: (id: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueCreditRequest>>;
632
+ /** The requester withdraws it. */
633
+ cancel: (id: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueCreditRequest>>;
634
+ };
635
+ holds: {
636
+ /**
637
+ * GET /holds — a declared list (`stored_value.holds`), a cursor page. `{ open: true }`
638
+ * still works and means `filter: { status: ['held'] }`.
639
+ */
640
+ list: (query?: StoredValueHoldsQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueHold>>;
641
+ /** POST /holds — reserve value (for one named business when `beneficiary` is set). */
642
+ place: (request: PlaceStoredValueHoldRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueHold>>;
643
+ /** POST /holds/{id}/release — give a reservation back to the balance. */
644
+ release: (holdId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueHold>>;
645
+ };
646
+ payouts: {
647
+ /** GET /payouts — the holder's cash-outs, newest first (first page of {@link page}). */
648
+ list: (options?: PersonDomainCallOptions) => Promise<ListPage<StoredValuePayout>>;
649
+ /** GET /payouts — the declared list (`stored_value.payouts`): sort, filter, cursor. */
650
+ page: (query?: StoredValuePayoutsQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValuePayout>>;
651
+ /** POST /payouts — ask to cash out. Below the unit's minimum is refused (422). */
652
+ request: (request: RequestStoredValuePayoutRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValuePayout>>;
653
+ };
654
+ /** The organisation plane (`tenant.bind` + `iam.permission:stored_value.*`). */
655
+ organisation: {
656
+ units: {
657
+ /** GET /units — the organisation's units with what is outstanding (`stored_value.organisation.units`). */
658
+ list: (query?: StoredValueOrganisationUnitsQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueOrganisationUnit>>;
659
+ /** POST /units/{unitKey}/lifecycle — suspend, resume or retire; holders with a balance are told. */
660
+ lifecycle: (unitKey: string, request: StoredValueUnitLifecycleRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueOrganisationUnit>>;
661
+ declare: (request: DeclareStoredValueUnitRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueUnit>>;
662
+ show: (unitKey: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueUnit>>;
663
+ update: (unitKey: string, changes: {
664
+ rules?: Partial<StoredValueUnitRules>;
665
+ status?: StoredValueUnitStatus | null;
666
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueUnit>>;
667
+ /** Offer the unit in a network this organisation belongs to. */
668
+ link: (unitKey: string, networkKey: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueNetworkRecord>>;
669
+ /** Withdraw the unit from a network (after the network's notice period). */
670
+ unlink: (unitKey: string, networkKey: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueNetworkRecord>>;
671
+ };
672
+ /** POST /issues — credit a holder. Pass ONE key per intent; a retry replays. */
673
+ issue: (request: IssueStoredValueRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueEntry>>;
674
+ /** POST /entries/{id}/reversal — the correction is a mirroring entry, never an edit. */
675
+ reverseIssue: (entryId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueEntry>>;
676
+ /** GET /entries — the journal of this organisation's units (`stored_value.organisation.entries`). */
677
+ entries: {
678
+ list: (query?: StoredValueJournalQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueJournalEntry>>;
679
+ };
680
+ dashboard: {
681
+ liability: (options?: PersonDomainCallOptions) => Promise<StoredValueLiability>;
682
+ /** GET /dashboard/activity — issued, redeemed and breakage per UTC day or month (async rollup; see `meta.refreshed_at`). */
683
+ activity: (query?: StoredValueActivityQuery, options?: PersonDomainCallOptions) => Promise<StoredValueActivity>;
684
+ };
685
+ /** Bulk issue from CSV: upload → row report → submit (each row issued once, by its own key). */
686
+ issueBatches: {
687
+ /**
688
+ * POST /issue-batches — validates every row at once and answers the batch; nothing is
689
+ * issued until {@link submit}. A `file` is sent as multipart, `csv` text as JSON.
690
+ */
691
+ create: (request: CreateIssueBatchRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueIssueBatch>>;
692
+ list: (query?: StoredValueIssueBatchesQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueIssueBatch>>;
693
+ show: (batchId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueIssueBatch>>;
694
+ /** GET /issue-batches/{id}/rows — the row-level report; filter `outcome`. */
695
+ rows: (batchId: string, query?: StoredValueIssueBatchRowsQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueIssueBatchRow>>;
696
+ /** POST /issue-batches/{id}/submission — 409 `issue_batch_has_invalid_rows` unless `skipInvalid`. */
697
+ submit: (batchId: string, skipInvalid?: boolean, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueIssueBatch>>;
698
+ };
699
+ holds: {
700
+ /** GET /holds — holds made for, or taken by, this organisation (`stored_value.organisation.holds`). */
701
+ list: (query?: Omit<StoredValueHoldsQuery, "open">, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueHold>>;
702
+ /** GET /holds/{id} — only a hold made for, or taken by, this organisation. */
703
+ show: (holdId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueHold>>;
704
+ /**
705
+ * POST /holds/{id}/capture — redeem: take all of the reservation, or `amount` of it
706
+ * (the rest returns to the holder). The holder's consent IS the hold.
707
+ */
708
+ capture: (holdId: string, amount?: StoredValueAmount | null, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueHold>>;
709
+ release: (holdId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueHold>>;
710
+ };
711
+ payouts: {
712
+ /**
713
+ * GET /payouts — the approval queue (`stored_value.organisation.payouts`), OLDEST first
714
+ * by default. The legacy `{ status, limit }` still works.
715
+ */
716
+ list: (query?: StoredValueOrganisationPayoutsQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValuePayout>>;
717
+ decide: (payoutId: string, decision: {
718
+ decision: "approve" | "reject";
719
+ rail?: string | null;
720
+ reason?: string | null;
721
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValuePayout>>;
722
+ confirm: (payoutId: string, outcome: {
723
+ decision: "paid" | "failed";
724
+ rail_reference?: string | null;
725
+ reason?: string | null;
726
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValuePayout>>;
727
+ };
728
+ networks: {
729
+ /** GET /networks — networks this organisation operates or belongs to (`stored_value.organisation.networks`). */
730
+ list: (query?: StoredValueNetworksQuery, options?: PersonDomainCallOptions) => Promise<ListPage<Record<string, unknown> & {
731
+ id?: string;
732
+ key?: string;
733
+ label?: BilingualText;
734
+ status?: string;
735
+ } & {
736
+ role?: "operator" | "member";
737
+ }>>;
738
+ /** GET /networks/{key}/members — operator or member only (`stored_value.organisation.network_members`). */
739
+ members: (networkKey: string, query?: StoredValueNetworkMembersQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueNetworkRecord>>;
740
+ declare: (request: DeclareAcceptanceNetworkRequest, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueNetworkRecord>>;
741
+ show: (networkKey: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueNetworkRecord>>;
742
+ join: (networkKey: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueNetworkRecord>>;
743
+ leave: (networkKey: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueNetworkRecord>>;
744
+ decideMembership: (networkKey: string, membershipId: string, decision: "approve" | "decline" | "suspend" | "reinstate", options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueNetworkRecord>>;
745
+ };
746
+ settlementBatches: {
747
+ /** GET /settlement-batches — declared (`stored_value.organisation.settlement_batches`); legacy `{ status, limit }` still works. */
748
+ list: (query?: StoredValueSettlementBatchesQuery, options?: PersonDomainCallOptions) => Promise<ListPage<StoredValueNetworkRecord>>;
749
+ /** POST /settlement-batches/{id}/payment — the net has moved; record the bank's reference. */
750
+ markPaid: (batchId: string, paymentReference: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<StoredValueNetworkRecord>>;
751
+ };
752
+ };
753
+ };
754
+ export type StoredValueNamespace = ReturnType<typeof createStoredValueNamespace>;