@v3finance/core-sdk 0.19.0 → 0.20.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 (58) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +6 -3
  3. package/dist/cjs/core/gated.d.ts +11 -2
  4. package/dist/cjs/core/gated.d.ts.map +1 -1
  5. package/dist/cjs/core/gated.js +11 -2
  6. package/dist/cjs/core/gated.js.map +1 -1
  7. package/dist/cjs/core/pagination.d.ts +4 -3
  8. package/dist/cjs/core/pagination.d.ts.map +1 -1
  9. package/dist/cjs/core/pagination.js +4 -3
  10. package/dist/cjs/core/pagination.js.map +1 -1
  11. package/dist/cjs/generated/operations.d.ts +40 -0
  12. package/dist/cjs/generated/operations.d.ts.map +1 -1
  13. package/dist/cjs/generated/operations.js +42 -2
  14. package/dist/cjs/generated/operations.js.map +1 -1
  15. package/dist/cjs/generated/types.d.ts +148 -21
  16. package/dist/cjs/generated/types.d.ts.map +1 -1
  17. package/dist/cjs/index.d.ts +1 -1
  18. package/dist/cjs/index.d.ts.map +1 -1
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/cjs/resources/aml.d.ts +175 -7
  21. package/dist/cjs/resources/aml.d.ts.map +1 -1
  22. package/dist/cjs/resources/aml.js +165 -10
  23. package/dist/cjs/resources/aml.js.map +1 -1
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/core/gated.d.ts +11 -2
  27. package/dist/esm/core/gated.d.ts.map +1 -1
  28. package/dist/esm/core/gated.js +11 -2
  29. package/dist/esm/core/gated.js.map +1 -1
  30. package/dist/esm/core/pagination.d.ts +4 -3
  31. package/dist/esm/core/pagination.d.ts.map +1 -1
  32. package/dist/esm/core/pagination.js +4 -3
  33. package/dist/esm/core/pagination.js.map +1 -1
  34. package/dist/esm/generated/operations.d.ts +40 -0
  35. package/dist/esm/generated/operations.d.ts.map +1 -1
  36. package/dist/esm/generated/operations.js +42 -2
  37. package/dist/esm/generated/operations.js.map +1 -1
  38. package/dist/esm/generated/types.d.ts +148 -21
  39. package/dist/esm/generated/types.d.ts.map +1 -1
  40. package/dist/esm/index.d.ts +1 -1
  41. package/dist/esm/index.d.ts.map +1 -1
  42. package/dist/esm/index.js.map +1 -1
  43. package/dist/esm/resources/aml.d.ts +175 -7
  44. package/dist/esm/resources/aml.d.ts.map +1 -1
  45. package/dist/esm/resources/aml.js +165 -10
  46. package/dist/esm/resources/aml.js.map +1 -1
  47. package/dist/esm/version.d.ts +1 -1
  48. package/dist/esm/version.js +1 -1
  49. package/docs/concepts.md +11 -0
  50. package/docs/errors.md +27 -6
  51. package/package.json +1 -1
  52. package/src/core/gated.ts +11 -2
  53. package/src/core/pagination.ts +4 -3
  54. package/src/generated/operations.ts +42 -2
  55. package/src/generated/types.ts +155 -24
  56. package/src/index.ts +6 -1
  57. package/src/resources/aml.ts +217 -10
  58. package/src/version.ts +1 -1
@@ -47,7 +47,7 @@ export { MembersResource, type PolicyDirectoryParams } from './resources/members
47
47
  export { AmlResource } from './resources/aml.js';
48
48
  export { ExportsResource, isTruncated } from './resources/exports.js';
49
49
  export type { ExportFilters, ExportFormat, ExportKind, ExportLang, ExportOptions, } from './resources/exports.js';
50
- export type { AmlOperationsFilter } from './resources/aml.js';
50
+ export type { AmlDraftKind, AmlDraftStatus, AmlOperationsFilter, ListAmlDraftsParams, } from './resources/aml.js';
51
51
  export { RegistriesResource, type AmlScore } from './resources/registries.js';
52
52
  export { CategoriesResource, type OperationType } from './resources/categories.js';
53
53
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAEzD;;;;;;;;;;GAUG;AACH,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA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AAA;AASjB,2CAA8C;AAArC,mGAAA,UAAU,OAAA;AACnB,qDAAwD;AAA/C,6GAAA,eAAe,OAAA;AACxB,qDAAwD;AAA/C,6GAAA,eAAe,OAAA;AACxB,qDAAoF;AAA3E,6GAAA,eAAe,OAAA;AACxB,6CAAgD;AAAvC,qGAAA,WAAW,OAAA;AACpB,qDAAqE;AAA5D,6GAAA,eAAe,OAAA;AAAE,yGAAA,WAAW,OAAA;AAcrC,2DAA6E;AAApE,mHAAA,kBAAkB,OAAA;AAC3B,2DAAkF;AAAzE,mHAAA,kBAAkB,OAAA;AAC3B;;;;;;;;;;;GAWG;AACH,qDAW+B;AAV7B,6GAAA,eAAe,OAAA;AAWjB,iDAM6B;AAL3B,yGAAA,aAAa,OAAA;AAMf,+CAAkD;AAAzC,uGAAA,YAAY,OAAA;AACrB,2DAMkC;AALhC,mHAAA,kBAAkB,OAAA;AAMpB,yDAIiC;AAH/B,iHAAA,iBAAiB,OAAA;AAInB,uDAUgC;AAT9B,+GAAA,gBAAgB,OAAA;AAUlB,mEAOsC;AANpC,2HAAA,sBAAsB,OAAA;AACtB,+HAAA,0BAA0B,OAAA;AAO5B,0EAA0E;AAC1E,2DAMkC;AALhC,2GAAA,UAAU,OAAA;AACV,iHAAA,gBAAgB,OAAA"}
@@ -1,6 +1,7 @@
1
1
  import { type HttpClient } from '../core/http.js';
2
2
  import { type Gated } from '../core/gated.js';
3
- import type { AddAmlStopListBody, AmlDepositDecisionResult, AmlOperations, AmlProvenance, AmlRuleVersions, AmlDepositReview, AmlRule, AmlRuleEvaluateBody, AmlRuleEvaluation, AmlRules, AmlStopList, AmlStopListEntry, CreateAmlRuleBody, PatchAmlRuleBody, AmlCheck, AmlOfficers, AmlRecheckBody, AmlSettings, AmlVisibilityGrant, AmlVisibilityGrants, ApprovalRequestCreated, CreateAmlVisibilityGrantBody, UpdateAmlSettingsBody } from '../generated/types.js';
3
+ import type { PageParams } from '../core/pagination.js';
4
+ import type { AddAmlStopListBody, AmlDepositDecisionResult, AmlDraft, AmlDraftResult, AmlDraftsPage, AmlOperations, AmlProvenance, AmlRuleVersions, AmlDepositReview, AmlRule, AmlRuleEvaluateBody, AmlRuleEvaluation, AmlRules, AmlStopList, AmlStopListEntry, CreateAmlRuleBody, PatchAmlRuleBody, AmlCheck, AmlOfficers, AmlRecheckBody, AmlSettings, AmlVisibilityGrant, AmlVisibilityGrants, ApprovalRequestCreated, CreateAmlDecisionDraftBody, CreateAmlVisibilityGrantBody, UpdateAmlSettingsBody } from '../generated/types.js';
4
5
  /** Filters of the officer's operations list and of its CSV. */
5
6
  export interface AmlOperationsFilter {
6
7
  from?: string | undefined;
@@ -15,6 +16,35 @@ export interface AmlOperationsFilter {
15
16
  /** The other side is exactly this address. */
16
17
  address?: string | undefined;
17
18
  }
19
+ /**
20
+ * `draft` — waiting to be confirmed from the phone; `sent` — confirmed and in
21
+ * force (the outcome is in `result`); `discarded` — deleted; `stale` — can no
22
+ * longer be applied (`staleReason`); `expired` — 24 hours passed. Nothing was
23
+ * applied for the last three.
24
+ */
25
+ export type AmlDraftStatus = AmlDraft['status'];
26
+ /** `deposit_decision` — a decision on a deposit; the other four — an AML edit that weakens a control. */
27
+ export type AmlDraftKind = AmlDraft['kind'];
28
+ export interface ListAmlDraftsParams extends PageParams {
29
+ /**
30
+ * The status as it is NOW, worked out on reading — a `draft` past its
31
+ * `expiresAt` is `expired`. Because of that a filtered page can be shorter
32
+ * than `limit` and still not be the last: only `nextCursor: null` ends it.
33
+ */
34
+ status?: AmlDraftStatus | undefined;
35
+ kind?: AmlDraftKind | undefined;
36
+ /**
37
+ * Drafts of a decision on this deposit — how to find the draft after a lost
38
+ * answer. With a `kind` other than `deposit_decision` it is 400.
39
+ */
40
+ depositId?: string | undefined;
41
+ /**
42
+ * Drafts of an edit of this target, with `kind`: a rule id
43
+ * (`rule_update`), a stop-list entry id (`stop_list_remove`), `user:<id>` or
44
+ * `group:<id>` (`visibility_grant`), `settings` (`settings_update`).
45
+ */
46
+ targetId?: string | undefined;
47
+ }
18
48
  /**
19
49
  * AML checks of a vault, in the typed model (AML v2).
20
50
  *
@@ -34,6 +64,16 @@ export interface AmlOperationsFilter {
34
64
  * Not to be confused with `registries.amlScore()`: that one keeps the
35
65
  * earlier shape for the transfer form; this one is the model decisions are
36
66
  * made on, with a record id you can come back to.
67
+ *
68
+ * AN OFFICER'S DECISIONS TAKE EFFECT ONLY FROM THE PHONE. A session that may
69
+ * not sign — a web login (the web version, the Mac and Windows apps), or a
70
+ * browser of anyone but a platform administrator — prepares them as DRAFTS:
71
+ * a decision on a deposit with `createDecisionDraft`, and an edit that
72
+ * weakens AML (`updateRule`, `removeFromStopList`, `grantVisibility`,
73
+ * `updateSettings`) comes back as `outcome: 'pending'` with the draft instead
74
+ * of being applied. The author gets a push on their phones and confirms with
75
+ * `sendDraft` from there. A draft is seen and touched only by its author, an
76
+ * administrator included: anyone else's is 404 `AML_DRAFT_NOT_FOUND`.
37
77
  */
38
78
  export declare class AmlResource {
39
79
  #private;
@@ -50,7 +90,13 @@ export declare class AmlResource {
50
90
  }): Promise<AmlCheck>;
51
91
  /**
52
92
  * A fresh check, always calling the provider. Paid per call — only on an
53
- * explicit action of a person. Admins only (403 for a member).
93
+ * explicit action of a person. Admins and AML officers only (403 for a
94
+ * member).
95
+ *
96
+ * At most 60 paid checks an hour per person in a vault, this method and an
97
+ * immediate `checkInternal` together: beyond that 429
98
+ * `AML_CHECK_RATE_LIMITED`, with `details.retryAfterSeconds` (and the
99
+ * `Retry-After` header) — when to try again.
54
100
  */
55
101
  recheck(input: AmlRecheckBody): Promise<AmlCheck>;
56
102
  /**
@@ -89,8 +135,16 @@ export declare class AmlResource {
89
135
  * is validated: exactly one enabled default provider (400
90
136
  * `AML_DEFAULT_PROVIDER_REQUIRED`), `maxAgeSeconds` 0…30 days (0 — every
91
137
  * check calls the paid provider). Admins and officers only.
138
+ *
139
+ * `outcome: 'applied'` carries the settings. `'pending'` — the change
140
+ * weakens AML and came from a session that may not sign (see the class):
141
+ * NOTHING was applied, the answer is the draft to confirm from the phone.
142
+ * Weakening here: widening `memberDefaultView`, another default provider,
143
+ * disabling a provider, a larger `maxAgeSeconds` or 0. The server decides;
144
+ * do not guess in advance. Settings have no version — read them again after
145
+ * saving.
92
146
  */
93
- updateSettings(input: UpdateAmlSettingsBody): Promise<AmlSettings>;
147
+ updateSettings(input: UpdateAmlSettingsBody): Promise<Gated<AmlSettings, AmlDraftResult>>;
94
148
  /** Who sees more than the vault's default. Admins and officers only. */
95
149
  visibilityGrants(params?: {
96
150
  includeRevoked?: boolean | undefined;
@@ -100,8 +154,14 @@ export declare class AmlResource {
100
154
  * Idempotent like every grant: the same subject again changes the role or
101
155
  * reactivates a revoked grant. You must be able to see the member
102
156
  * (`NOT_VISIBLE`); not to yourself (`SELF_SHARE`). Admins and officers only.
157
+ *
158
+ * `outcome: 'applied'` carries the grant — status 201 for a new one, 200 for
159
+ * an existing one updated. `'pending'` — the grant weakens AML (a new or
160
+ * revoked grant, or `links` → `full`) and came from a session that may not
161
+ * sign (see the class): NOTHING was granted, the answer is the draft to
162
+ * confirm from the phone. The same or a narrower role applies at once.
103
163
  */
104
- grantVisibility(input: CreateAmlVisibilityGrantBody): Promise<AmlVisibilityGrant>;
164
+ grantVisibility(input: CreateAmlVisibilityGrantBody): Promise<Gated<AmlVisibilityGrant, AmlDraftResult>>;
105
165
  /** Soft and immediate; repeating it is not an error. Admins and officers only. */
106
166
  revokeVisibility(grantId: string): Promise<AmlVisibilityGrant>;
107
167
  /**
@@ -115,6 +175,9 @@ export declare class AmlResource {
115
175
  * is the request's `resolvedResultId`. No policy — 403. No view of the
116
176
  * address — 404. Always a fresh, paid provider call. `outcome: 'applied'`
117
177
  * carries the check; `'pending'` — the request awaiting approval.
178
+ *
179
+ * An immediate check counts towards the limit of `recheck` (429
180
+ * `AML_CHECK_RATE_LIMITED`); creating the request does not.
118
181
  */
119
182
  checkInternal(addressId: string): Promise<Gated<AmlCheck, ApprovalRequestCreated>>;
120
183
  /**
@@ -139,8 +202,21 @@ export declare class AmlResource {
139
202
  /**
140
203
  * Absent fields stay; the RESULTING rule is validated. Every change is a new
141
204
  * `version`. 409 `AML_RULE_CONFLICT` — someone changed it meanwhile: reload.
205
+ *
206
+ * `outcome: 'applied'` carries the rule. `'pending'` — the change weakens an
207
+ * ENABLED rule and came from a session that may not sign (see the class):
208
+ * NOTHING was saved, the answer is the draft to confirm from the phone, and
209
+ * it is checked against the version the rule had when the draft was made.
210
+ * Weakening: disabling, `block` → `officer`, allowing the initiator to
211
+ * approve, dropping a kind from `appliesTo`, a `scope` not proven at least
212
+ * as wide (removing it is not), a risk condition not proven to fire at
213
+ * least as often, another `subject` or
214
+ * provider, a smaller `provenance.depth`. One weakening field sends the
215
+ * whole change. Name and description, enabling a rule and any change of a
216
+ * disabled one apply at once. The checks above (400, 404, 409
217
+ * `AML_RULE_CONFLICT`) run before the draft is made.
142
218
  */
143
- updateRule(ruleId: string, patch: PatchAmlRuleBody): Promise<AmlRule>;
219
+ updateRule(ruleId: string, patch: PatchAmlRuleBody): Promise<Gated<AmlRule, AmlDraftResult>>;
144
220
  /**
145
221
  * Dry run of the AML rules only (not the caller's policies) for a transfer
146
222
  * from `fromAddressId` to `address`. `ruleIds` runs exactly those rules,
@@ -158,8 +234,15 @@ export declare class AmlResource {
158
234
  }): Promise<AmlStopList>;
159
235
  /** Idempotent: the same address again updates the reason or brings it back. EVM — stored lowercase. */
160
236
  addToStopList(input: AddAmlStopListBody): Promise<AmlStopListEntry>;
161
- /** Soft; repeating it is not an error. */
162
- removeFromStopList(entryId: string): Promise<AmlStopListEntry>;
237
+ /**
238
+ * Soft; repeating it is not an error.
239
+ *
240
+ * `outcome: 'applied'` carries the removed entry. Removing an ACTIVE address
241
+ * always weakens AML, so from a session that may not sign (see the class)
242
+ * it is `'pending'`: the address STAYS on the stop list, and the answer is
243
+ * the draft to confirm from the phone.
244
+ */
245
+ removeFromStopList(entryId: string): Promise<Gated<AmlStopListEntry, AmlDraftResult>>;
163
246
  /**
164
247
  * An AML officer marks a past deposit as reviewed: it stops being a source
165
248
  * of risk for provenance rules (they have no time window). AML officers
@@ -176,6 +259,91 @@ export declare class AmlResource {
176
259
  * rejecting a HELD deposit is a vote: `approvals.vote`.
177
260
  */
178
261
  unblockDeposit(depositId: string, comment: string): Promise<AmlDepositDecisionResult>;
262
+ /**
263
+ * An AML officer's decision on a deposit, made in a session that may not
264
+ * sign — the Mac above all. It is a DRAFT: nothing happens to the deposit
265
+ * until the author confirms it from the phone with `sendDraft`. Allowed in
266
+ * any session. AML officers only — an administrator is not one (403
267
+ * `FORBIDDEN`): it is a decision on risk.
268
+ *
269
+ * `decision`: `release` / `block` — a held deposit (a vote on its request
270
+ * `amlrev_<depositId>`); `unblock` — release a rejected one; `reviewed` —
271
+ * mark a past deposit reviewed. The comment is required for every one.
272
+ *
273
+ * Checked at once by the rules of the direct actions, with their codes: 404
274
+ * `DEPOSIT_NOT_FOUND`; 409 `DEPOSIT_NOT_HELD` (release, block),
275
+ * `DEPOSIT_NOT_BLOCKED` (unblock), `ALREADY_VOTED`, `DEPOSIT_ALREADY_DECIDED`
276
+ * (`details.decidedById` — who did); 403 `NOT_APPROVER`, `AML_OWN_DEPOSIT`.
277
+ * Everything is checked again when the draft is confirmed.
278
+ *
279
+ * One waiting draft per deposit and author. The same decision and comment
280
+ * again answers 200 with that draft and no second push (a new one is 201 and
281
+ * pushes); a different one is 409 `AML_DRAFT_EXISTS` with `details.draftId` —
282
+ * confirm or discard that one first. Both successes mean the same thing — a
283
+ * draft exactly as asked is waiting — so the status is not surfaced. After a
284
+ * lost answer, find it with `drafts({ depositId })`. A draft expires after
285
+ * 24 hours.
286
+ *
287
+ * The push to the author's phones has `data.type: "aml_draft_created"`, with
288
+ * `draftId`, `kind` and `incomingId` (the deposit).
289
+ */
290
+ createDecisionDraft(depositId: string, input: CreateAmlDecisionDraftBody): Promise<AmlDraftResult>;
291
+ /**
292
+ * Your own AML drafts, newest first — decisions on deposits and edits that
293
+ * weaken AML. Nobody else's, an administrator's view included.
294
+ * Keyset-paginated: `{items, nextCursor}`, 20 by default, at most 50.
295
+ *
296
+ * `status` is worked out on reading: a `draft` past `expiresAt` reads as
297
+ * `expired`, one that can no longer be applied (another officer decided,
298
+ * you are no longer an officer, the rule changed…) as `stale` with
299
+ * `staleReason`, and one whose action is already in force as `sent`.
300
+ */
301
+ drafts(params?: ListAmlDraftsParams): Promise<AmlDraftsPage>;
302
+ /**
303
+ * One of your drafts — where a tap on the `aml_draft_created` push leads.
304
+ * Everything to show before confirming is in it: for a decision, the
305
+ * deposit as it was when the draft was made (`deposit`), `decision` and
306
+ * `comment`; for an edit, `target` and `changes` (was → becomes, with
307
+ * `weakens` on what weakens); where it was made (`createdFrom`). Anyone
308
+ * else's, a missing one and one from another vault are all 404
309
+ * `AML_DRAFT_NOT_FOUND`.
310
+ */
311
+ draft(draftId: string): Promise<AmlDraftResult>;
312
+ /**
313
+ * Deletes a draft — softly: `draft` becomes `discarded` and can no longer
314
+ * be confirmed. Allowed in any session. Discarding again is not an error,
315
+ * nor is discarding a draft already stale or expired: 200.
316
+ *
317
+ * A confirmed one is 409 `AML_DRAFT_ALREADY_SENT` (`details.draftId`,
318
+ * `details.result`): it is in force, and discarding does not undo it. The
319
+ * same 409 comes back when the action is in force but the draft is not
320
+ * marked `sent` yet — it is being confirmed from a phone right now, or that
321
+ * broke off — and the mark is written then.
322
+ */
323
+ discardDraft(draftId: string): Promise<AmlDraftResult>;
324
+ /**
325
+ * Confirms a draft: applies it by the SAME path as the direct action — the
326
+ * vote, `unblockDeposit`, `markDepositReviewed`, the rule edit (against the
327
+ * version the draft was made on), the stop-list removal, the grant, the
328
+ * settings. There is no body; everything comes from the draft. Only the
329
+ * author, and only from a session that may sign — the mobile app: a web
330
+ * login, or a browser of anyone but a platform administrator, gets 403
331
+ * `WEB_SESSION_CANNOT_SIGN`.
332
+ *
333
+ * 200 — `{draft}` with `status: 'sent'` and the outcome in `result`. A
334
+ * repeat (a double tap, a second phone, a retry after a broken connection)
335
+ * answers 200 with the same draft and applies nothing a second time, so a
336
+ * timed-out confirmation is retried by calling this again.
337
+ *
338
+ * Everything is checked anew first. Not applied, nothing changed:
339
+ * 409 `AML_DRAFT_STALE` — out of date (`details.staleReason`, and
340
+ * `details.cause` — the code and message the direct action gave);
341
+ * 409 `AML_DRAFT_EXPIRED`; 409 `AML_DRAFT_DISCARDED`. The draft is recorded
342
+ * as such and cannot be confirmed later — make a new one. A temporary
343
+ * refusal of the path itself (409 `DEPOSIT_MONEY_MISSING` — the money is not
344
+ * on hold yet) leaves it a `draft`: retry later.
345
+ */
346
+ sendDraft(draftId: string): Promise<AmlDraftResult>;
179
347
  /**
180
348
  * Transfers and deposits of the WHOLE vault through the AML lens: risk,
181
349
  * categories, holding, the officer's request and decisions. AML officers and
@@ -1 +1 @@
1
- {"version":3,"file":"aml.d.ts","sourceRoot":"","sources":["../../../src/resources/aml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,uBAAuB,CAAA;AAE9B,+DAA+D;AAC/D,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,IAAI,CAAC,EAAE,UAAU,GAA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,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAIpF;IAID;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,cAAc,CAAC,CAMjG;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,GAAE,mBAAwB,GAAG,OAAO,CAAC,aAAa,CAAC,CAE/D;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAE9C;IAED;;;;;;;;;;OAUG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAErD;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAElD;IAID;;;;OAIG;IACH,UAAU,CACR,MAAM,GAAE,mBAAmB,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAO,GAC7F,OAAO,CAAC,aAAa,CAAC,CAExB;IAED;;;OAGG;IACH,aAAa,CAAC,MAAM,GAAE,mBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEjE;IAED,gGAAgG;IAChG,UAAU,CACR,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAO,GACtE,OAAO,CAAC,aAAa,CAAC,CAIxB;CACF"}
@@ -22,6 +22,16 @@ const gated_js_1 = require("../core/gated.js");
22
22
  * Not to be confused with `registries.amlScore()`: that one keeps the
23
23
  * earlier shape for the transfer form; this one is the model decisions are
24
24
  * made on, with a record id you can come back to.
25
+ *
26
+ * AN OFFICER'S DECISIONS TAKE EFFECT ONLY FROM THE PHONE. A session that may
27
+ * not sign — a web login (the web version, the Mac and Windows apps), or a
28
+ * browser of anyone but a platform administrator — prepares them as DRAFTS:
29
+ * a decision on a deposit with `createDecisionDraft`, and an edit that
30
+ * weakens AML (`updateRule`, `removeFromStopList`, `grantVisibility`,
31
+ * `updateSettings`) comes back as `outcome: 'pending'` with the draft instead
32
+ * of being applied. The author gets a push on their phones and confirms with
33
+ * `sendDraft` from there. A draft is seen and touched only by its author, an
34
+ * administrator included: anyone else's is 404 `AML_DRAFT_NOT_FOUND`.
25
35
  */
26
36
  class AmlResource {
27
37
  #http;
@@ -44,7 +54,13 @@ class AmlResource {
44
54
  }
45
55
  /**
46
56
  * A fresh check, always calling the provider. Paid per call — only on an
47
- * explicit action of a person. Admins only (403 for a member).
57
+ * explicit action of a person. Admins and AML officers only (403 for a
58
+ * member).
59
+ *
60
+ * At most 60 paid checks an hour per person in a vault, this method and an
61
+ * immediate `checkInternal` together: beyond that 429
62
+ * `AML_CHECK_RATE_LIMITED`, with `details.retryAfterSeconds` (and the
63
+ * `Retry-After` header) — when to try again.
48
64
  */
49
65
  recheck(input) {
50
66
  return this.#http.request('POST', `${this.#base}/checks`, { body: input });
@@ -93,9 +109,18 @@ class AmlResource {
93
109
  * is validated: exactly one enabled default provider (400
94
110
  * `AML_DEFAULT_PROVIDER_REQUIRED`), `maxAgeSeconds` 0…30 days (0 — every
95
111
  * check calls the paid provider). Admins and officers only.
112
+ *
113
+ * `outcome: 'applied'` carries the settings. `'pending'` — the change
114
+ * weakens AML and came from a session that may not sign (see the class):
115
+ * NOTHING was applied, the answer is the draft to confirm from the phone.
116
+ * Weakening here: widening `memberDefaultView`, another default provider,
117
+ * disabling a provider, a larger `maxAgeSeconds` or 0. The server decides;
118
+ * do not guess in advance. Settings have no version — read them again after
119
+ * saving.
96
120
  */
97
- updateSettings(input) {
98
- return this.#http.request('PUT', `${this.#base}/settings`, { body: input });
121
+ async updateSettings(input) {
122
+ const res = await this.#http.requestRaw('PUT', `${this.#base}/settings`, { body: input });
123
+ return (0, gated_js_1.toGated)(res.status, res.data);
99
124
  }
100
125
  /** Who sees more than the vault's default. Admins and officers only. */
101
126
  visibilityGrants(params = {}) {
@@ -108,11 +133,18 @@ class AmlResource {
108
133
  * Idempotent like every grant: the same subject again changes the role or
109
134
  * reactivates a revoked grant. You must be able to see the member
110
135
  * (`NOT_VISIBLE`); not to yourself (`SELF_SHARE`). Admins and officers only.
136
+ *
137
+ * `outcome: 'applied'` carries the grant — status 201 for a new one, 200 for
138
+ * an existing one updated. `'pending'` — the grant weakens AML (a new or
139
+ * revoked grant, or `links` → `full`) and came from a session that may not
140
+ * sign (see the class): NOTHING was granted, the answer is the draft to
141
+ * confirm from the phone. The same or a narrower role applies at once.
111
142
  */
112
- grantVisibility(input) {
113
- return this.#http.request('POST', `${this.#base}/visibility-grants`, {
143
+ async grantVisibility(input) {
144
+ const res = await this.#http.requestRaw('POST', `${this.#base}/visibility-grants`, {
114
145
  body: input,
115
146
  });
147
+ return (0, gated_js_1.toGated)(res.status, res.data);
116
148
  }
117
149
  /** Soft and immediate; repeating it is not an error. Admins and officers only. */
118
150
  revokeVisibility(grantId) {
@@ -129,6 +161,9 @@ class AmlResource {
129
161
  * is the request's `resolvedResultId`. No policy — 403. No view of the
130
162
  * address — 404. Always a fresh, paid provider call. `outcome: 'applied'`
131
163
  * carries the check; `'pending'` — the request awaiting approval.
164
+ *
165
+ * An immediate check counts towards the limit of `recheck` (429
166
+ * `AML_CHECK_RATE_LIMITED`); creating the request does not.
132
167
  */
133
168
  async checkInternal(addressId) {
134
169
  const res = await this.#http.requestRaw('POST', `${this.#base}/internal-checks`, {
@@ -167,9 +202,25 @@ class AmlResource {
167
202
  /**
168
203
  * Absent fields stay; the RESULTING rule is validated. Every change is a new
169
204
  * `version`. 409 `AML_RULE_CONFLICT` — someone changed it meanwhile: reload.
205
+ *
206
+ * `outcome: 'applied'` carries the rule. `'pending'` — the change weakens an
207
+ * ENABLED rule and came from a session that may not sign (see the class):
208
+ * NOTHING was saved, the answer is the draft to confirm from the phone, and
209
+ * it is checked against the version the rule had when the draft was made.
210
+ * Weakening: disabling, `block` → `officer`, allowing the initiator to
211
+ * approve, dropping a kind from `appliesTo`, a `scope` not proven at least
212
+ * as wide (removing it is not), a risk condition not proven to fire at
213
+ * least as often, another `subject` or
214
+ * provider, a smaller `provenance.depth`. One weakening field sends the
215
+ * whole change. Name and description, enabling a rule and any change of a
216
+ * disabled one apply at once. The checks above (400, 404, 409
217
+ * `AML_RULE_CONFLICT`) run before the draft is made.
170
218
  */
171
- updateRule(ruleId, patch) {
172
- return this.#http.request('PATCH', `${this.#base}/rules/${(0, http_js_1.seg)(ruleId)}`, { body: patch });
219
+ async updateRule(ruleId, patch) {
220
+ const res = await this.#http.requestRaw('PATCH', `${this.#base}/rules/${(0, http_js_1.seg)(ruleId)}`, {
221
+ body: patch,
222
+ });
223
+ return (0, gated_js_1.toGated)(res.status, res.data);
173
224
  }
174
225
  /**
175
226
  * Dry run of the AML rules only (not the caller's policies) for a transfer
@@ -193,9 +244,17 @@ class AmlResource {
193
244
  addToStopList(input) {
194
245
  return this.#http.request('POST', `${this.#base}/stop-list`, { body: input });
195
246
  }
196
- /** Soft; repeating it is not an error. */
197
- removeFromStopList(entryId) {
198
- return this.#http.request('DELETE', `${this.#base}/stop-list/${(0, http_js_1.seg)(entryId)}`);
247
+ /**
248
+ * Soft; repeating it is not an error.
249
+ *
250
+ * `outcome: 'applied'` carries the removed entry. Removing an ACTIVE address
251
+ * always weakens AML, so from a session that may not sign (see the class)
252
+ * it is `'pending'`: the address STAYS on the stop list, and the answer is
253
+ * the draft to confirm from the phone.
254
+ */
255
+ async removeFromStopList(entryId) {
256
+ const res = await this.#http.requestRaw('DELETE', `${this.#base}/stop-list/${(0, http_js_1.seg)(entryId)}`);
257
+ return (0, gated_js_1.toGated)(res.status, res.data);
199
258
  }
200
259
  /**
201
260
  * An AML officer marks a past deposit as reviewed: it stops being a source
@@ -221,6 +280,102 @@ class AmlResource {
221
280
  body: { comment },
222
281
  });
223
282
  }
283
+ // ---------- Officer's drafts: prepare anywhere, confirm from the phone ----------
284
+ /**
285
+ * An AML officer's decision on a deposit, made in a session that may not
286
+ * sign — the Mac above all. It is a DRAFT: nothing happens to the deposit
287
+ * until the author confirms it from the phone with `sendDraft`. Allowed in
288
+ * any session. AML officers only — an administrator is not one (403
289
+ * `FORBIDDEN`): it is a decision on risk.
290
+ *
291
+ * `decision`: `release` / `block` — a held deposit (a vote on its request
292
+ * `amlrev_<depositId>`); `unblock` — release a rejected one; `reviewed` —
293
+ * mark a past deposit reviewed. The comment is required for every one.
294
+ *
295
+ * Checked at once by the rules of the direct actions, with their codes: 404
296
+ * `DEPOSIT_NOT_FOUND`; 409 `DEPOSIT_NOT_HELD` (release, block),
297
+ * `DEPOSIT_NOT_BLOCKED` (unblock), `ALREADY_VOTED`, `DEPOSIT_ALREADY_DECIDED`
298
+ * (`details.decidedById` — who did); 403 `NOT_APPROVER`, `AML_OWN_DEPOSIT`.
299
+ * Everything is checked again when the draft is confirmed.
300
+ *
301
+ * One waiting draft per deposit and author. The same decision and comment
302
+ * again answers 200 with that draft and no second push (a new one is 201 and
303
+ * pushes); a different one is 409 `AML_DRAFT_EXISTS` with `details.draftId` —
304
+ * confirm or discard that one first. Both successes mean the same thing — a
305
+ * draft exactly as asked is waiting — so the status is not surfaced. After a
306
+ * lost answer, find it with `drafts({ depositId })`. A draft expires after
307
+ * 24 hours.
308
+ *
309
+ * The push to the author's phones has `data.type: "aml_draft_created"`, with
310
+ * `draftId`, `kind` and `incomingId` (the deposit).
311
+ */
312
+ createDecisionDraft(depositId, input) {
313
+ return this.#http.request('POST', `${this.#base}/deposits/${(0, http_js_1.seg)(depositId)}/decision-drafts`, { body: input });
314
+ }
315
+ /**
316
+ * Your own AML drafts, newest first — decisions on deposits and edits that
317
+ * weaken AML. Nobody else's, an administrator's view included.
318
+ * Keyset-paginated: `{items, nextCursor}`, 20 by default, at most 50.
319
+ *
320
+ * `status` is worked out on reading: a `draft` past `expiresAt` reads as
321
+ * `expired`, one that can no longer be applied (another officer decided,
322
+ * you are no longer an officer, the rule changed…) as `stale` with
323
+ * `staleReason`, and one whose action is already in force as `sent`.
324
+ */
325
+ drafts(params = {}) {
326
+ return this.#http.request('GET', `${this.#base}/drafts`, { query: { ...params } });
327
+ }
328
+ /**
329
+ * One of your drafts — where a tap on the `aml_draft_created` push leads.
330
+ * Everything to show before confirming is in it: for a decision, the
331
+ * deposit as it was when the draft was made (`deposit`), `decision` and
332
+ * `comment`; for an edit, `target` and `changes` (was → becomes, with
333
+ * `weakens` on what weakens); where it was made (`createdFrom`). Anyone
334
+ * else's, a missing one and one from another vault are all 404
335
+ * `AML_DRAFT_NOT_FOUND`.
336
+ */
337
+ draft(draftId) {
338
+ return this.#http.request('GET', `${this.#base}/drafts/${(0, http_js_1.seg)(draftId)}`);
339
+ }
340
+ /**
341
+ * Deletes a draft — softly: `draft` becomes `discarded` and can no longer
342
+ * be confirmed. Allowed in any session. Discarding again is not an error,
343
+ * nor is discarding a draft already stale or expired: 200.
344
+ *
345
+ * A confirmed one is 409 `AML_DRAFT_ALREADY_SENT` (`details.draftId`,
346
+ * `details.result`): it is in force, and discarding does not undo it. The
347
+ * same 409 comes back when the action is in force but the draft is not
348
+ * marked `sent` yet — it is being confirmed from a phone right now, or that
349
+ * broke off — and the mark is written then.
350
+ */
351
+ discardDraft(draftId) {
352
+ return this.#http.request('DELETE', `${this.#base}/drafts/${(0, http_js_1.seg)(draftId)}`);
353
+ }
354
+ /**
355
+ * Confirms a draft: applies it by the SAME path as the direct action — the
356
+ * vote, `unblockDeposit`, `markDepositReviewed`, the rule edit (against the
357
+ * version the draft was made on), the stop-list removal, the grant, the
358
+ * settings. There is no body; everything comes from the draft. Only the
359
+ * author, and only from a session that may sign — the mobile app: a web
360
+ * login, or a browser of anyone but a platform administrator, gets 403
361
+ * `WEB_SESSION_CANNOT_SIGN`.
362
+ *
363
+ * 200 — `{draft}` with `status: 'sent'` and the outcome in `result`. A
364
+ * repeat (a double tap, a second phone, a retry after a broken connection)
365
+ * answers 200 with the same draft and applies nothing a second time, so a
366
+ * timed-out confirmation is retried by calling this again.
367
+ *
368
+ * Everything is checked anew first. Not applied, nothing changed:
369
+ * 409 `AML_DRAFT_STALE` — out of date (`details.staleReason`, and
370
+ * `details.cause` — the code and message the direct action gave);
371
+ * 409 `AML_DRAFT_EXPIRED`; 409 `AML_DRAFT_DISCARDED`. The draft is recorded
372
+ * as such and cannot be confirmed later — make a new one. A temporary
373
+ * refusal of the path itself (409 `DEPOSIT_MONEY_MISSING` — the money is not
374
+ * on hold yet) leaves it a `draft`: retry later.
375
+ */
376
+ sendDraft(draftId) {
377
+ return this.#http.request('POST', `${this.#base}/drafts/${(0, http_js_1.seg)(draftId)}/send`);
378
+ }
224
379
  // ---------- Officer's view ----------
225
380
  /**
226
381
  * Transfers and deposits of the WHOLE vault through the AML lens: risk,
@@ -1 +1 @@
1
- {"version":3,"file":"aml.js","sourceRoot":"","sources":["../../../src/resources/aml.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AACtD,+CAAsD;AA0CtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IACW,KAAK,CAAY;IACjB,KAAK,CAAQ;IAEtB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,kBAAkB,IAAA,aAAG,EAAC,SAAS,CAAC,MAAM,CAAA;IACrD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CACH,OAAe,EACf,OAAO,GAAsF,EAAE;QAE/F,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAW,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,SAAS,EAAE;YACjE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;YAC9C,MAAM,EA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AEvE,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAgB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,cAAc,IAAA,aAAG,EAAC,SAAS,CAAC,aAAa,EAAE;YACtG,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
1
  /** SDK version, sent in the `user-agent` header. */
2
- export declare const SDK_VERSION = "0.19.0";
2
+ export declare const SDK_VERSION = "0.20.0";
3
3
  /** Default API base URL. */
4
4
  export declare const DEFAULT_BASE_URL = "https://policy-engine-rest.ezig.workers.dev";
5
5
  //# sourceMappingURL=version.d.ts.map
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_BASE_URL = exports.SDK_VERSION = void 0;
4
4
  /** SDK version, sent in the `user-agent` header. */
5
- exports.SDK_VERSION = '0.19.0';
5
+ exports.SDK_VERSION = '0.20.0';
6
6
  /** Default API base URL. */
7
7
  exports.DEFAULT_BASE_URL = 'https://policy-engine-rest.ezig.workers.dev';
8
8
  //# sourceMappingURL=version.js.map
@@ -3,7 +3,12 @@
3
3
  * ways, and only the HTTP status tells them apart:
4
4
  *
5
5
  * 201 — applied immediately (policy allowed it without signatures);
6
- * 202 — queued for approval, funds are reserved, nothing has moved yet;
6
+ * 202 — queued for approval, funds are reserved, nothing has moved yet.
7
+ * On the four AML edits (`aml.updateRule`, `removeFromStopList`,
8
+ * `grantVisibility`, `updateSettings`) it is a different wait: the
9
+ * edit weakens AML and came from a session that may not sign, so it
10
+ * became a draft its author confirms from the phone — nothing was
11
+ * applied, and the body is `{draft}`, not the edited object;
7
12
  * 200 — on a transfer or an address: a replay of the same idempotency
8
13
  * key, nothing happened now and the existing operation came back (no
9
14
  * second broadcast, no second address). Everywhere else: an ordinary
@@ -74,7 +79,11 @@ export declare function toGated<TApplied, TPending>(status: number, data: unknow
74
79
  export declare function isApplied<A, P>(r: Gated<A, P>): r is Extract<Gated<A, P>, {
75
80
  outcome: 'applied' | 'replayed';
76
81
  }>;
77
- /** Narrowing: the operation awaits signatures and funds are reserved. */
82
+ /**
83
+ * Narrowing: the operation was not applied and waits — for signatures, with
84
+ * funds reserved on a money path, or, on an AML edit, for its author to
85
+ * confirm the draft from the phone.
86
+ */
78
87
  export declare function isPending<A, P>(r: Gated<A, P>): r is Extract<Gated<A, P>, {
79
88
  outcome: 'pending';
80
89
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"gated.d.ts","sourceRoot":"","sources":["../../../src/core/gated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AAE7D;;;;;;;;GAQG;AACH,MAAM,MAAM,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,IAC3C;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GACpF;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAA;AAElF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,QAAQ,EACxC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACtC,KAAK,CAAC,QAAQ,EA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