@v3finance/core-sdk 0.6.0 → 0.8.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 (47) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/cjs/generated/operations.d.ts +138 -2
  3. package/dist/cjs/generated/operations.d.ts.map +1 -1
  4. package/dist/cjs/generated/operations.js +140 -4
  5. package/dist/cjs/generated/operations.js.map +1 -1
  6. package/dist/cjs/generated/types.d.ts +318 -7
  7. package/dist/cjs/generated/types.d.ts.map +1 -1
  8. package/dist/cjs/resources/aml.d.ts +102 -10
  9. package/dist/cjs/resources/aml.d.ts.map +1 -1
  10. package/dist/cjs/resources/aml.js +140 -9
  11. package/dist/cjs/resources/aml.js.map +1 -1
  12. package/dist/cjs/resources/approvals.d.ts +6 -0
  13. package/dist/cjs/resources/approvals.d.ts.map +1 -1
  14. package/dist/cjs/resources/approvals.js.map +1 -1
  15. package/dist/cjs/resources/members.d.ts +11 -1
  16. package/dist/cjs/resources/members.d.ts.map +1 -1
  17. package/dist/cjs/resources/members.js +12 -0
  18. package/dist/cjs/resources/members.js.map +1 -1
  19. package/dist/cjs/version.d.ts +1 -1
  20. package/dist/cjs/version.js +1 -1
  21. package/dist/esm/generated/operations.d.ts +138 -2
  22. package/dist/esm/generated/operations.d.ts.map +1 -1
  23. package/dist/esm/generated/operations.js +140 -4
  24. package/dist/esm/generated/operations.js.map +1 -1
  25. package/dist/esm/generated/types.d.ts +318 -7
  26. package/dist/esm/generated/types.d.ts.map +1 -1
  27. package/dist/esm/resources/aml.d.ts +102 -10
  28. package/dist/esm/resources/aml.d.ts.map +1 -1
  29. package/dist/esm/resources/aml.js +140 -9
  30. package/dist/esm/resources/aml.js.map +1 -1
  31. package/dist/esm/resources/approvals.d.ts +6 -0
  32. package/dist/esm/resources/approvals.d.ts.map +1 -1
  33. package/dist/esm/resources/approvals.js.map +1 -1
  34. package/dist/esm/resources/members.d.ts +11 -1
  35. package/dist/esm/resources/members.d.ts.map +1 -1
  36. package/dist/esm/resources/members.js +12 -0
  37. package/dist/esm/resources/members.js.map +1 -1
  38. package/dist/esm/version.d.ts +1 -1
  39. package/dist/esm/version.js +1 -1
  40. package/docs/errors.md +16 -0
  41. package/package.json +1 -1
  42. package/src/generated/operations.ts +140 -4
  43. package/src/generated/types.ts +343 -7
  44. package/src/resources/aml.ts +186 -10
  45. package/src/resources/approvals.ts +6 -0
  46. package/src/resources/members.ts +19 -0
  47. package/src/version.ts +1 -1
@@ -1,13 +1,16 @@
1
1
  import { type HttpClient } from '../core/http.js';
2
- import type { AmlCheck, AmlRecheckBody } from '../generated/types.js';
2
+ import { type Gated } from '../core/gated.js';
3
+ import type { AddAmlStopListBody, AmlDepositReview, AmlRule, AmlRuleEvaluateBody, AmlRuleEvaluation, AmlRules, AmlStopList, AmlStopListEntry, CreateAmlRuleBody, PatchAmlRuleBody, AmlCheck, AmlOfficers, AmlRecheckBody, AmlSettings, AmlVisibilityGrant, AmlVisibilityGrants, ApprovalRequestCreated, CreateAmlVisibilityGrantBody, UpdateAmlSettingsBody } from '../generated/types.js';
3
4
  /**
4
5
  * AML checks of a vault, in the typed model (AML v2).
5
6
  *
6
7
  * WHAT YOU GET DEPENDS ON WHO YOU ARE, and `view` on the answer says which:
7
- * `summary` (any member) — level, score, categories; `links` (a vault or
8
- * platform admin) — plus the address's links; `full` (`getCheck` only) —
9
- * plus the provider's own response, typed. The server decides; reading
10
- * `links` from a `summary` answer gets `undefined`, not an error.
8
+ * `summary` — level, score, categories; `links` — plus the address's links;
9
+ * `full` (`getCheck` only) — plus the provider's own response, typed. Admins
10
+ * and AML officers get everything; a member gets the vault's default
11
+ * (`summary` unless changed) widened by their visibility grants. The server
12
+ * decides; reading `links` from a `summary` answer gets `undefined`, not an
13
+ * error.
11
14
  *
12
15
  * `level` is what to branch on. `null` means NOT CHECKED, never "clean" —
13
16
  * draw it as a third, neutral state. `share` and `amountUsd` are `null` for
@@ -37,20 +40,109 @@ export declare class AmlResource {
37
40
  */
38
41
  recheck(input: AmlRecheckBody): Promise<AmlCheck>;
39
42
  /**
40
- * One record, whole (`view: full`). This is how an operation's snapshot is
41
- * opened: pass its `amlCheckId` — what was known at the moment of the
42
- * transfer or deposit. Records never change. `native: null` — the full
43
- * provider response is not in the archive. Admins only.
43
+ * One record. This is how an operation's snapshot is opened: pass its
44
+ * `amlCheckId` — what was known at the moment of the transfer or deposit.
45
+ * Records never change. Any member, in their own `view`; only `full`
46
+ * carries `native` (`null` — the full response is not in the archive).
44
47
  */
45
48
  getCheck(id: string): Promise<AmlCheck>;
46
49
  /**
47
50
  * The provider's response byte for byte, for audit (hundreds of kilobytes
48
51
  * for an active address). Returns the untouched `Response`. 404
49
52
  * `AML_RAW_NOT_FOUND` — not archived for this record; 501
50
- * `AML_ARCHIVE_DISABLED` — no archive on the server. Admins only.
53
+ * `AML_ARCHIVE_DISABLED` — no archive on the server. Only with `full`
54
+ * (admins, officers, a `full` visibility grant) — 403 otherwise.
51
55
  */
52
56
  rawCheck(id: string, options?: {
53
57
  signal?: AbortSignal | undefined;
54
58
  }): Promise<Response>;
59
+ /**
60
+ * The vault's AML officers, and who appointed them when. These are the
61
+ * people an approver `{ kind: 'aml_officers' }` resolves to — at the moment
62
+ * a request is created, not later. Admins and officers only (403 for a
63
+ * member). Appointing is `members.setAmlOfficer()`.
64
+ */
65
+ officers(): Promise<AmlOfficers>;
66
+ /**
67
+ * The vault's AML settings: providers (enabled, default — whose check is
68
+ * recorded on every operation — and how fresh a stored check may be) and
69
+ * what any member sees without a grant. Untouched vault — Scorechain,
70
+ * 24 h, `summary`. Admins and officers only.
71
+ */
72
+ settings(): Promise<AmlSettings>;
73
+ /**
74
+ * Changes the settings; absent fields stay as they are. The RESULTING state
75
+ * is validated: exactly one enabled default provider (400
76
+ * `AML_DEFAULT_PROVIDER_REQUIRED`), `maxAgeSeconds` 0…30 days (0 — every
77
+ * check calls the paid provider). Admins and officers only.
78
+ */
79
+ updateSettings(input: UpdateAmlSettingsBody): Promise<AmlSettings>;
80
+ /** Who sees more than the vault's default. Admins and officers only. */
81
+ visibilityGrants(params?: {
82
+ includeRevoked?: boolean | undefined;
83
+ }): Promise<AmlVisibilityGrants>;
84
+ /**
85
+ * Opens `links` or `full` to a member or a group (its CURRENT members).
86
+ * Idempotent like every grant: the same subject again changes the role or
87
+ * reactivates a revoked grant. You must be able to see the member
88
+ * (`NOT_VISIBLE`); not to yourself (`SELF_SHARE`). Admins and officers only.
89
+ */
90
+ grantVisibility(input: CreateAmlVisibilityGrantBody): Promise<AmlVisibilityGrant>;
91
+ /** Soft and immediate; repeating it is not an error. Admins and officers only. */
92
+ revokeVisibility(grantId: string): Promise<AmlVisibilityGrant>;
93
+ /**
94
+ * Checks one of OUR addresses with the provider — how the provider sees it
95
+ * (blacklisted or not). Not done by default: only with permission.
96
+ *
97
+ * Admins and officers — at once. A member — by their policy on the action
98
+ * `aml_check_internal`: an allowing one checks at once, one that needs
99
+ * approval (typically from `{ kind: 'aml_officers' }`) returns the created
100
+ * request instead, and the check runs once it is approved — its record id
101
+ * is the request's `resolvedResultId`. No policy — 403. No view of the
102
+ * address — 404. Always a fresh, paid provider call. `outcome: 'applied'`
103
+ * carries the check; `'pending'` — the request awaiting approval.
104
+ */
105
+ checkInternal(addressId: string): Promise<Gated<AmlCheck, ApprovalRequestCreated>>;
106
+ /**
107
+ * The vault's AML rules. A rule applies to the WHOLE vault, admins
108
+ * included, after the policies: it only ADDS — a block (`AML_BLOCKED`) or
109
+ * an AML officer's approval. It never allows what policies denied and never
110
+ * drops their approvals. Unknown risk leads to an officer, never to a
111
+ * block or a pass. Admins and officers only.
112
+ */
113
+ rules(): Promise<AmlRules>;
114
+ /**
115
+ * Creates a rule. `scope` — which transfers (transfer selectors plus
116
+ * `destinationPattern`, the derivation path of OUR recipient address);
117
+ * `risk` — on what risk (`null` — always); `subject: 'provenance'` judges
118
+ * where the sender's funds came from instead of the recipient. A condition
119
+ * the provider cannot serve is a 400 `AML_PROVIDER_CAPABILITY`.
120
+ */
121
+ createRule(input: CreateAmlRuleBody): Promise<AmlRule>;
122
+ getRule(ruleId: string): Promise<AmlRule>;
123
+ /** Absent fields stay; the RESULTING rule is validated. Every change is a new `version`. */
124
+ updateRule(ruleId: string, patch: PatchAmlRuleBody): Promise<AmlRule>;
125
+ /**
126
+ * Dry run of the AML rules only (not the caller's policies) for a transfer
127
+ * from `fromAddressId` to `address`. `ruleIds` runs exactly those rules,
128
+ * DISABLED ones included — to see a rule before switching it on. `amount`
129
+ * is a decimal string, as in `transfers.create`.
130
+ */
131
+ evaluateRules(input: AmlRuleEvaluateBody): Promise<AmlRuleEvaluation>;
132
+ /** Addresses the vault considers unacceptable. Acts only through a rule with a `stopList` leaf. */
133
+ stopList(params?: {
134
+ includeRevoked?: boolean | undefined;
135
+ }): Promise<AmlStopList>;
136
+ /** Idempotent: the same address again updates the reason or brings it back. EVM — stored lowercase. */
137
+ addToStopList(input: AddAmlStopListBody): Promise<AmlStopListEntry>;
138
+ /** Soft; repeating it is not an error. */
139
+ removeFromStopList(entryId: string): Promise<AmlStopListEntry>;
140
+ /**
141
+ * An AML officer marks a past deposit as reviewed: it stops being a source
142
+ * of risk for provenance rules (they have no time window). AML officers
143
+ * only, and only from the PHONE — web sessions get 403
144
+ * `WEB_SESSION_CANNOT_SIGN`. One mark per deposit; a repeat returns it.
145
+ */
146
+ markDepositReviewed(depositId: string, comment: string): Promise<AmlDepositReview>;
55
147
  }
56
148
  //# sourceMappingURL=aml.d.ts.map
@@ -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,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAErE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAW;;IAItB,YAAY,IAAI,EAAE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;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,CAEzB;IAED;;;;;;OAMG;IACH,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAErD;IAED,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAExC;IAED,4FAA4F;IAC5F,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAEpE;IAED;;;;;OAKG;IACH,aAAa,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAEpE;IAID,mGAAmG;IACnG,QAAQ,CAAC,MAAM,GAAE;QAAE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAEpF;IAED,uGAAuG;IACvG,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAElE;IAED,0CAA0C;IAC1C,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAE7D;IAED;;;;;OAKG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAIjF;CAEF"}
@@ -2,14 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AmlResource = void 0;
4
4
  const http_js_1 = require("../core/http.js");
5
+ const gated_js_1 = require("../core/gated.js");
5
6
  /**
6
7
  * AML checks of a vault, in the typed model (AML v2).
7
8
  *
8
9
  * WHAT YOU GET DEPENDS ON WHO YOU ARE, and `view` on the answer says which:
9
- * `summary` (any member) — level, score, categories; `links` (a vault or
10
- * platform admin) — plus the address's links; `full` (`getCheck` only) —
11
- * plus the provider's own response, typed. The server decides; reading
12
- * `links` from a `summary` answer gets `undefined`, not an error.
10
+ * `summary` — level, score, categories; `links` — plus the address's links;
11
+ * `full` (`getCheck` only) — plus the provider's own response, typed. Admins
12
+ * and AML officers get everything; a member gets the vault's default
13
+ * (`summary` unless changed) widened by their visibility grants. The server
14
+ * decides; reading `links` from a `summary` answer gets `undefined`, not an
15
+ * error.
13
16
  *
14
17
  * `level` is what to branch on. `null` means NOT CHECKED, never "clean" —
15
18
  * draw it as a third, neutral state. `share` and `amountUsd` are `null` for
@@ -47,10 +50,10 @@ class AmlResource {
47
50
  return this.#http.request('POST', `${this.#base}/checks`, { body: input });
48
51
  }
49
52
  /**
50
- * One record, whole (`view: full`). This is how an operation's snapshot is
51
- * opened: pass its `amlCheckId` — what was known at the moment of the
52
- * transfer or deposit. Records never change. `native: null` — the full
53
- * provider response is not in the archive. Admins only.
53
+ * One record. This is how an operation's snapshot is opened: pass its
54
+ * `amlCheckId` — what was known at the moment of the transfer or deposit.
55
+ * Records never change. Any member, in their own `view`; only `full`
56
+ * carries `native` (`null` — the full response is not in the archive).
54
57
  */
55
58
  getCheck(id) {
56
59
  return this.#http.request('GET', `${this.#base}/checks/${(0, http_js_1.seg)(id)}`);
@@ -59,13 +62,141 @@ class AmlResource {
59
62
  * The provider's response byte for byte, for audit (hundreds of kilobytes
60
63
  * for an active address). Returns the untouched `Response`. 404
61
64
  * `AML_RAW_NOT_FOUND` — not archived for this record; 501
62
- * `AML_ARCHIVE_DISABLED` — no archive on the server. Admins only.
65
+ * `AML_ARCHIVE_DISABLED` — no archive on the server. Only with `full`
66
+ * (admins, officers, a `full` visibility grant) — 403 otherwise.
63
67
  */
64
68
  rawCheck(id, options = {}) {
65
69
  return this.#http.fetchRaw('GET', `${this.#base}/checks/${(0, http_js_1.seg)(id)}/raw`, {
66
70
  signal: options.signal,
67
71
  });
68
72
  }
73
+ /**
74
+ * The vault's AML officers, and who appointed them when. These are the
75
+ * people an approver `{ kind: 'aml_officers' }` resolves to — at the moment
76
+ * a request is created, not later. Admins and officers only (403 for a
77
+ * member). Appointing is `members.setAmlOfficer()`.
78
+ */
79
+ officers() {
80
+ return this.#http.request('GET', `${this.#base}/officers`);
81
+ }
82
+ /**
83
+ * The vault's AML settings: providers (enabled, default — whose check is
84
+ * recorded on every operation — and how fresh a stored check may be) and
85
+ * what any member sees without a grant. Untouched vault — Scorechain,
86
+ * 24 h, `summary`. Admins and officers only.
87
+ */
88
+ settings() {
89
+ return this.#http.request('GET', `${this.#base}/settings`);
90
+ }
91
+ /**
92
+ * Changes the settings; absent fields stay as they are. The RESULTING state
93
+ * is validated: exactly one enabled default provider (400
94
+ * `AML_DEFAULT_PROVIDER_REQUIRED`), `maxAgeSeconds` 0…30 days (0 — every
95
+ * check calls the paid provider). Admins and officers only.
96
+ */
97
+ updateSettings(input) {
98
+ return this.#http.request('PUT', `${this.#base}/settings`, { body: input });
99
+ }
100
+ /** Who sees more than the vault's default. Admins and officers only. */
101
+ visibilityGrants(params = {}) {
102
+ return this.#http.request('GET', `${this.#base}/visibility-grants`, {
103
+ query: { ...params },
104
+ });
105
+ }
106
+ /**
107
+ * Opens `links` or `full` to a member or a group (its CURRENT members).
108
+ * Idempotent like every grant: the same subject again changes the role or
109
+ * reactivates a revoked grant. You must be able to see the member
110
+ * (`NOT_VISIBLE`); not to yourself (`SELF_SHARE`). Admins and officers only.
111
+ */
112
+ grantVisibility(input) {
113
+ return this.#http.request('POST', `${this.#base}/visibility-grants`, {
114
+ body: input,
115
+ });
116
+ }
117
+ /** Soft and immediate; repeating it is not an error. Admins and officers only. */
118
+ revokeVisibility(grantId) {
119
+ return this.#http.request('DELETE', `${this.#base}/visibility-grants/${(0, http_js_1.seg)(grantId)}`);
120
+ }
121
+ /**
122
+ * Checks one of OUR addresses with the provider — how the provider sees it
123
+ * (blacklisted or not). Not done by default: only with permission.
124
+ *
125
+ * Admins and officers — at once. A member — by their policy on the action
126
+ * `aml_check_internal`: an allowing one checks at once, one that needs
127
+ * approval (typically from `{ kind: 'aml_officers' }`) returns the created
128
+ * request instead, and the check runs once it is approved — its record id
129
+ * is the request's `resolvedResultId`. No policy — 403. No view of the
130
+ * address — 404. Always a fresh, paid provider call. `outcome: 'applied'`
131
+ * carries the check; `'pending'` — the request awaiting approval.
132
+ */
133
+ async checkInternal(addressId) {
134
+ const res = await this.#http.requestRaw('POST', `${this.#base}/internal-checks`, {
135
+ body: { addressId },
136
+ });
137
+ return (0, gated_js_1.toGated)(res.status, res.data);
138
+ }
139
+ // ---------- AML rules (A3) ----------
140
+ /**
141
+ * The vault's AML rules. A rule applies to the WHOLE vault, admins
142
+ * included, after the policies: it only ADDS — a block (`AML_BLOCKED`) or
143
+ * an AML officer's approval. It never allows what policies denied and never
144
+ * drops their approvals. Unknown risk leads to an officer, never to a
145
+ * block or a pass. Admins and officers only.
146
+ */
147
+ rules() {
148
+ return this.#http.request('GET', `${this.#base}/rules`);
149
+ }
150
+ /**
151
+ * Creates a rule. `scope` — which transfers (transfer selectors plus
152
+ * `destinationPattern`, the derivation path of OUR recipient address);
153
+ * `risk` — on what risk (`null` — always); `subject: 'provenance'` judges
154
+ * where the sender's funds came from instead of the recipient. A condition
155
+ * the provider cannot serve is a 400 `AML_PROVIDER_CAPABILITY`.
156
+ */
157
+ createRule(input) {
158
+ return this.#http.request('POST', `${this.#base}/rules`, { body: input });
159
+ }
160
+ getRule(ruleId) {
161
+ return this.#http.request('GET', `${this.#base}/rules/${(0, http_js_1.seg)(ruleId)}`);
162
+ }
163
+ /** Absent fields stay; the RESULTING rule is validated. Every change is a new `version`. */
164
+ updateRule(ruleId, patch) {
165
+ return this.#http.request('PATCH', `${this.#base}/rules/${(0, http_js_1.seg)(ruleId)}`, { body: patch });
166
+ }
167
+ /**
168
+ * Dry run of the AML rules only (not the caller's policies) for a transfer
169
+ * from `fromAddressId` to `address`. `ruleIds` runs exactly those rules,
170
+ * DISABLED ones included — to see a rule before switching it on. `amount`
171
+ * is a decimal string, as in `transfers.create`.
172
+ */
173
+ evaluateRules(input) {
174
+ return this.#http.request('POST', `${this.#base}/rules/evaluate`, { body: input });
175
+ }
176
+ // ---------- Stop list (A3) ----------
177
+ /** Addresses the vault considers unacceptable. Acts only through a rule with a `stopList` leaf. */
178
+ stopList(params = {}) {
179
+ return this.#http.request('GET', `${this.#base}/stop-list`, { query: { ...params } });
180
+ }
181
+ /** Idempotent: the same address again updates the reason or brings it back. EVM — stored lowercase. */
182
+ addToStopList(input) {
183
+ return this.#http.request('POST', `${this.#base}/stop-list`, { body: input });
184
+ }
185
+ /** Soft; repeating it is not an error. */
186
+ removeFromStopList(entryId) {
187
+ return this.#http.request('DELETE', `${this.#base}/stop-list/${(0, http_js_1.seg)(entryId)}`);
188
+ }
189
+ /**
190
+ * An AML officer marks a past deposit as reviewed: it stops being a source
191
+ * of risk for provenance rules (they have no time window). AML officers
192
+ * only, and only from the PHONE — web sessions get 403
193
+ * `WEB_SESSION_CANNOT_SIGN`. One mark per deposit; a repeat returns it.
194
+ */
195
+ markDepositReviewed(depositId, comment) {
196
+ return this.#http.request('POST', `${this.#base}/deposits/${(0, http_js_1.seg)(depositId)}/reviewed`, {
197
+ body: { comment },
198
+ });
199
+ }
69
200
  }
70
201
  exports.AmlResource = AmlResource;
71
202
  //# sourceMappingURL=aml.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aml.js","sourceRoot":"","sources":["../../../src/resources/aml.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAGtD;;;;;;;;;;;;;;;;;GAiBG;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,GAA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A0C;IAC1C,kBAAkB,CAAC,OAAe;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAmB,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,cAAc,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAClG,CAAC;IAED;;;;;OAKG;IACH,mBAAmB,CAAC,SAAiB,EAAE,OAAe;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAmB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,aAAa,IAAA,aAAG,EAAC,SAAS,CAAC,WAAW,EAAE;YACvG,IAAI,EAAE,EAAE,OAAO,EAAE;SAClB,CAAC,CAAA;IACJ,CAAC;CAEF"}
@@ -47,6 +47,12 @@ export interface ListApprovalsParams extends PageParams {
47
47
  vote?: 'approve' | 'reject' | 'any' | 'none' | undefined;
48
48
  decisionPolicyId?: string | undefined;
49
49
  targetType?: string | undefined;
50
+ /**
51
+ * The AML officer's queue: pending requests waiting for MY vote that need
52
+ * an AML officer's approval (a policy with an `aml_officers` approver) or
53
+ * are an AML action themselves (`aml_check_internal`).
54
+ */
55
+ forAmlOfficer?: boolean | undefined;
50
56
  /**
51
57
  * `newest` (default) or `oldest` — with `status: 'PENDING'`, the ones
52
58
  * waiting longest. A cursor belongs to its order: one from the other is a
@@ -1 +1 @@
1
- {"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../../src/resources/approvals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACT,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;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,IAAI,IAAA,aAAG,EAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IAC5F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,IAAI,CAAC,SAAiB,EAAE,KAAe;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,MAAM,EACN,GAAG,IAAI,CAAC,KAAK,IAAI,IAAA,aAAG,EAAC,SAAS,CAAC,YAAY,EAC3C,EAAE,IAAI,EAAE,KAAK,EAAE,CAChB,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,SAAiB,EAAE,MAAe;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,MAAM,EACN,GAAG,IAAI,CAAC,KAAK,IAAI,IAAA,aAAG,EAAC,SAAS,CAAC,SAAS,CACzC,CAAA;IACH,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,eAAe,CACnB,KAA0B;QAE1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAU,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,YAAY,EAAE;YAClF,IAAI,EAAE,KAAK;SACZ,CAAC,CAAA;QACF,OAAO,IAAA,kBAAO,EAA2C,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAChF,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import { type HttpClient } from '../core/http.js';
2
2
  import type { PageParams } from '../core/pagination.js';
3
- import type { ActionType, MemberCard, MemberDetail, MembersPage, PolicyDirectoryPage, UserGroup, UserGroupDetail, UserGroupMembers } from '../generated/types.js';
3
+ import type { ActionType, AmlOfficerState, MemberCard, MemberDetail, MembersPage, PolicyDirectoryPage, UserGroup, UserGroupDetail, UserGroupMembers } from '../generated/types.js';
4
4
  export interface PolicyDirectoryParams extends PageParams {
5
5
  actionType?: ActionType | undefined;
6
6
  effect?: 'allow' | 'block' | undefined;
@@ -69,5 +69,15 @@ export declare class MembersResource {
69
69
  */
70
70
  policyDirectory(params?: PolicyDirectoryParams): Promise<PolicyDirectoryPage>;
71
71
  groupMembers(groupId: string): Promise<UserGroupMembers>;
72
+ /**
73
+ * Appoints or removes an AML officer. An officer is a FLAG on a member, not
74
+ * a role: a member or an admin of the vault can also be an officer. Vault
75
+ * or platform administrators only (403 otherwise). Idempotent.
76
+ *
77
+ * 409 `AML_LAST_OFFICER` — the last officer cannot be removed while an
78
+ * enabled policy needs an officer's approval: `details.policies` lists
79
+ * their codes. Change those policies first, or appoint another officer.
80
+ */
81
+ setAmlOfficer(userId: string, isAmlOfficer: boolean): Promise<AmlOfficerState>;
72
82
  }
73
83
  //# sourceMappingURL=members.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACvD,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC3B;AAED;;;;;;;GAOG;AACH,qBAAa,eAAe;;IAI1B,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED,IAAI,CAAC,MAAM,GAAE,UAAU,GAAG;QAAE,MAAM,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IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC3B;AAED;;;;;;;GAOG;AACH,qBAAa,eAAe;;IAI1B,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED,IAAI,CAAC,MAAM,GAAE,UAAU,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAIxE;IAED,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAKzC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAM7C;IAED;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAO,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,SAAS,EAAE,CAAA;KAAE,CAAC,CAMpF;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAK/C;IAED;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,MAAM,GAAE,qBAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAMhF;IAED,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAKvD;IAED;;;;;;;;OAQG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAM7E;CAEF"}
@@ -77,6 +77,18 @@ class MembersResource {
77
77
  groupMembers(groupId) {
78
78
  return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/user-groups/${(0, http_js_1.seg)(groupId)}/members`);
79
79
  }
80
+ /**
81
+ * Appoints or removes an AML officer. An officer is a FLAG on a member, not
82
+ * a role: a member or an admin of the vault can also be an officer. Vault
83
+ * or platform administrators only (403 otherwise). Idempotent.
84
+ *
85
+ * 409 `AML_LAST_OFFICER` — the last officer cannot be removed while an
86
+ * enabled policy needs an officer's approval: `details.policies` lists
87
+ * their codes. Change those policies first, or appoint another officer.
88
+ */
89
+ setAmlOfficer(userId, isAmlOfficer) {
90
+ return this.#http.request('PATCH', `/api/v1/vaults/${this.#vault}/members/${(0, http_js_1.seg)(userId)}`, { body: { isAmlOfficer } });
91
+ }
80
92
  }
81
93
  exports.MembersResource = MembersResource;
82
94
  //# sourceMappingURL=members.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"members.js","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAqBtD;;;;;;;GAOG;AACH;IACW,KAAK,CAAY;IACjB,MAAM,CAAQ;IAEvB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG,IAAA,aAAG,EAAC,SAAS,CAAC,CAAA;IAC9B,CAAC;IAED,IAAI,CAAC,MAAM,GAAqC,EAAE;QAChD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAc,KAAK,EAAE,kBAAkB,IAAI,CAAC,MAAM,UAAU,EAAE;YACrF,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC;IAED,GAAG,CAAC,MAAc;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,KAAK,EACL,kBAAkB,IAAI,CAAC,MAAM,YAAY,IAAA,aAAG,EAAC,MAAM,CAAC,EAAE,CACvD,CAAA;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,QAAgB;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,KAAK,EACL,kBAAkB,IAAI,CAAC,MAAM,kBAAkB,EAC/C,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,CACxB,CAAA;IACH,CA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B,IAAI,CAAC,MAAM,gBAAgB,IAAA,aAAG,EAAC,OAAO,CAAC,UAAU,CACpE,CAAA;IACH,CAAC;IAED;;;;;;;;OAQG;IACH,aAAa,CAAC,MAAc,EAAE,YAAqB;QACjD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,OAAO,EACP,kBAAkB,IAAI,CAAC,MAAM,YAAY,IAAA,aAAG,EAAC,MAAM,CAAC,EAAE,EACtD,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,CAC3B,CAAA;IACH,CAAC;CAEF"}
@@ -1,5 +1,5 @@
1
1
  /** SDK version, sent in the `user-agent` header. */
2
- export declare const SDK_VERSION = "0.6.0";
2
+ export declare const SDK_VERSION = "0.8.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.6.0';
5
+ exports.SDK_VERSION = '0.8.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