@v3finance/core-sdk 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +185 -0
- package/README.md +18 -14
- package/dist/cjs/client.d.ts +30 -34
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +71 -0
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/core/gated.d.ts +12 -10
- package/dist/cjs/core/gated.d.ts.map +1 -1
- package/dist/cjs/core/gated.js +12 -10
- package/dist/cjs/core/gated.js.map +1 -1
- package/dist/cjs/core/http.d.ts +18 -0
- package/dist/cjs/core/http.d.ts.map +1 -1
- package/dist/cjs/core/http.js +11 -1
- package/dist/cjs/core/http.js.map +1 -1
- package/dist/cjs/core/pagination.d.ts +11 -9
- package/dist/cjs/core/pagination.d.ts.map +1 -1
- package/dist/cjs/core/pagination.js +11 -9
- package/dist/cjs/core/pagination.js.map +1 -1
- package/dist/cjs/generated/operations.d.ts +250 -2
- package/dist/cjs/generated/operations.d.ts.map +1 -1
- package/dist/cjs/generated/operations.js +252 -4
- package/dist/cjs/generated/operations.js.map +1 -1
- package/dist/cjs/generated/types.d.ts +1137 -113
- package/dist/cjs/generated/types.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +7 -6
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/resources/addresses.d.ts +91 -4
- package/dist/cjs/resources/addresses.d.ts.map +1 -1
- package/dist/cjs/resources/addresses.js +55 -3
- package/dist/cjs/resources/addresses.js.map +1 -1
- package/dist/cjs/resources/admin.d.ts +32 -1
- package/dist/cjs/resources/admin.d.ts.map +1 -1
- package/dist/cjs/resources/admin.js +45 -0
- package/dist/cjs/resources/admin.js.map +1 -1
- package/dist/cjs/resources/aml.d.ts +56 -0
- package/dist/cjs/resources/aml.d.ts.map +1 -0
- package/dist/cjs/resources/aml.js +71 -0
- package/dist/cjs/resources/aml.js.map +1 -0
- package/dist/cjs/resources/approvals.d.ts +30 -2
- package/dist/cjs/resources/approvals.d.ts.map +1 -1
- package/dist/cjs/resources/approvals.js.map +1 -1
- package/dist/cjs/resources/balances.d.ts +14 -7
- package/dist/cjs/resources/balances.d.ts.map +1 -1
- package/dist/cjs/resources/balances.js +10 -4
- package/dist/cjs/resources/balances.js.map +1 -1
- package/dist/cjs/resources/categories.d.ts +20 -6
- package/dist/cjs/resources/categories.d.ts.map +1 -1
- package/dist/cjs/resources/categories.js +19 -7
- package/dist/cjs/resources/categories.js.map +1 -1
- package/dist/cjs/resources/counterparties.d.ts +52 -6
- package/dist/cjs/resources/counterparties.d.ts.map +1 -1
- package/dist/cjs/resources/counterparties.js +24 -0
- package/dist/cjs/resources/counterparties.js.map +1 -1
- package/dist/cjs/resources/history.d.ts +227 -26
- package/dist/cjs/resources/history.d.ts.map +1 -1
- package/dist/cjs/resources/history.js +46 -0
- package/dist/cjs/resources/history.js.map +1 -1
- package/dist/cjs/resources/me.d.ts +17 -1
- package/dist/cjs/resources/me.d.ts.map +1 -1
- package/dist/cjs/resources/me.js +19 -0
- package/dist/cjs/resources/me.js.map +1 -1
- package/dist/cjs/resources/members.d.ts +21 -1
- package/dist/cjs/resources/members.d.ts.map +1 -1
- package/dist/cjs/resources/members.js +15 -0
- package/dist/cjs/resources/members.js.map +1 -1
- package/dist/cjs/resources/operations.d.ts +179 -4
- package/dist/cjs/resources/operations.d.ts.map +1 -1
- package/dist/cjs/resources/operations.js +192 -2
- package/dist/cjs/resources/operations.js.map +1 -1
- package/dist/cjs/resources/registries.d.ts +28 -2
- package/dist/cjs/resources/registries.d.ts.map +1 -1
- package/dist/cjs/resources/registries.js +27 -0
- package/dist/cjs/resources/registries.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client.d.ts +30 -34
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +71 -0
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/core/gated.d.ts +12 -10
- package/dist/esm/core/gated.d.ts.map +1 -1
- package/dist/esm/core/gated.js +12 -10
- package/dist/esm/core/gated.js.map +1 -1
- package/dist/esm/core/http.d.ts +18 -0
- package/dist/esm/core/http.d.ts.map +1 -1
- package/dist/esm/core/http.js +11 -1
- package/dist/esm/core/http.js.map +1 -1
- package/dist/esm/core/pagination.d.ts +11 -9
- package/dist/esm/core/pagination.d.ts.map +1 -1
- package/dist/esm/core/pagination.js +11 -9
- package/dist/esm/core/pagination.js.map +1 -1
- package/dist/esm/generated/operations.d.ts +250 -2
- package/dist/esm/generated/operations.d.ts.map +1 -1
- package/dist/esm/generated/operations.js +252 -4
- package/dist/esm/generated/operations.js.map +1 -1
- package/dist/esm/generated/types.d.ts +1137 -113
- package/dist/esm/generated/types.d.ts.map +1 -1
- package/dist/esm/index.d.ts +7 -6
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/resources/addresses.d.ts +91 -4
- package/dist/esm/resources/addresses.d.ts.map +1 -1
- package/dist/esm/resources/addresses.js +55 -3
- package/dist/esm/resources/addresses.js.map +1 -1
- package/dist/esm/resources/admin.d.ts +32 -1
- package/dist/esm/resources/admin.d.ts.map +1 -1
- package/dist/esm/resources/admin.js +45 -0
- package/dist/esm/resources/admin.js.map +1 -1
- package/dist/esm/resources/aml.d.ts +56 -0
- package/dist/esm/resources/aml.d.ts.map +1 -0
- package/dist/esm/resources/aml.js +67 -0
- package/dist/esm/resources/aml.js.map +1 -0
- package/dist/esm/resources/approvals.d.ts +30 -2
- package/dist/esm/resources/approvals.d.ts.map +1 -1
- package/dist/esm/resources/approvals.js.map +1 -1
- package/dist/esm/resources/balances.d.ts +14 -7
- package/dist/esm/resources/balances.d.ts.map +1 -1
- package/dist/esm/resources/balances.js +10 -4
- package/dist/esm/resources/balances.js.map +1 -1
- package/dist/esm/resources/categories.d.ts +20 -6
- package/dist/esm/resources/categories.d.ts.map +1 -1
- package/dist/esm/resources/categories.js +19 -7
- package/dist/esm/resources/categories.js.map +1 -1
- package/dist/esm/resources/counterparties.d.ts +52 -6
- package/dist/esm/resources/counterparties.d.ts.map +1 -1
- package/dist/esm/resources/counterparties.js +24 -0
- package/dist/esm/resources/counterparties.js.map +1 -1
- package/dist/esm/resources/history.d.ts +227 -26
- package/dist/esm/resources/history.d.ts.map +1 -1
- package/dist/esm/resources/history.js +46 -0
- package/dist/esm/resources/history.js.map +1 -1
- package/dist/esm/resources/me.d.ts +17 -1
- package/dist/esm/resources/me.d.ts.map +1 -1
- package/dist/esm/resources/me.js +19 -0
- package/dist/esm/resources/me.js.map +1 -1
- package/dist/esm/resources/members.d.ts +21 -1
- package/dist/esm/resources/members.d.ts.map +1 -1
- package/dist/esm/resources/members.js +15 -0
- package/dist/esm/resources/members.js.map +1 -1
- package/dist/esm/resources/operations.d.ts +179 -4
- package/dist/esm/resources/operations.d.ts.map +1 -1
- package/dist/esm/resources/operations.js +192 -2
- package/dist/esm/resources/operations.js.map +1 -1
- package/dist/esm/resources/registries.d.ts +28 -2
- package/dist/esm/resources/registries.d.ts.map +1 -1
- package/dist/esm/resources/registries.js +27 -0
- package/dist/esm/resources/registries.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/concepts.md +13 -11
- package/docs/errors.md +76 -5
- package/package.json +1 -1
- package/src/client.ts +44 -0
- package/src/core/gated.ts +12 -10
- package/src/core/http.ts +30 -1
- package/src/core/pagination.ts +11 -9
- package/src/generated/operations.ts +252 -4
- package/src/generated/types.ts +1173 -95
- package/src/index.ts +16 -1
- package/src/resources/addresses.ts +102 -4
- package/src/resources/admin.ts +59 -0
- package/src/resources/aml.ts +76 -0
- package/src/resources/approvals.ts +30 -2
- package/src/resources/balances.ts +14 -7
- package/src/resources/categories.ts +19 -5
- package/src/resources/counterparties.ts +59 -5
- package/src/resources/history.ts +238 -27
- package/src/resources/me.ts +22 -0
- package/src/resources/members.ts +30 -0
- package/src/resources/operations.ts +264 -5
- package/src/resources/registries.ts +39 -3
- package/src/version.ts +1 -1
|
@@ -6,8 +6,54 @@ export class HistoryResource {
|
|
|
6
6
|
this.#http = http;
|
|
7
7
|
this.#base = `/api/v1/vaults/${seg(vaultCode)}/history`;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* One page of the feed. A member sees their own transfers and the deposits
|
|
11
|
+
* to their addresses; `includeShared` adds the operations of addresses
|
|
12
|
+
* opened to them, `awaitingMyApproval` the transfers waiting for their vote.
|
|
13
|
+
* An administrator of the platform or of THIS vault sees the whole vault —
|
|
14
|
+
* seeing is not acting: what a vault administrator may send, sign or label
|
|
15
|
+
* is still decided by their own rights as a member.
|
|
16
|
+
*
|
|
17
|
+
* A cursor remembers `sort` and `order`: one issued for another order is
|
|
18
|
+
* 400 `INVALID_CURSOR` (older cursors are `createdAt desc`).
|
|
19
|
+
*
|
|
20
|
+
* Two flags can come back, and neither means the end of the feed:
|
|
21
|
+
*
|
|
22
|
+
* • `scanTruncated` — some filters are decided over rows already read,
|
|
23
|
+
* and the page did not fill within 50 000 of them. What was found is
|
|
24
|
+
* returned and `nextCursor` continues from where the scan stopped:
|
|
25
|
+
* keep paging;
|
|
26
|
+
* • `sortIncomplete` — with `sort: 'amount' | 'usd'`, some operations
|
|
27
|
+
* have no sort key yet and this request could not compute them all
|
|
28
|
+
* (200 rows per table per request); those operations are not in the
|
|
29
|
+
* order yet. Repeat the request.
|
|
30
|
+
*/
|
|
9
31
|
list(params = {}) {
|
|
10
32
|
return this.#http.request('GET', this.#base, { query: { ...params } });
|
|
11
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Totals for the same scope and filters as `list()`: how many operations,
|
|
36
|
+
* amounts per asset, the USD total and counters per value of the requested
|
|
37
|
+
* `facets`. `count` is the length of the feed paged to its end, the amounts
|
|
38
|
+
* the sum of its rows.
|
|
39
|
+
*
|
|
40
|
+
* `byAsset` is per asset AND per direction, in raw units (a BigInt string)
|
|
41
|
+
* and as a decimal — there is no cross-asset "turnover", and the sums
|
|
42
|
+
* include unsuccessful transfers unless a filter drops them
|
|
43
|
+
* (`statusNot: ['failed', 'rejected', 'cancelled']`). Different assets add
|
|
44
|
+
* up only in `usd`, valued as the rows' `usdValue`; operations without a
|
|
45
|
+
* valuation are counted in `usd.unpricedCount` and are in no USD total.
|
|
46
|
+
*
|
|
47
|
+
* A facet is counted with every filter EXCEPT its own dimension.
|
|
48
|
+
*
|
|
49
|
+
* More than 25 000 operations after filtering is 422
|
|
50
|
+
* `HISTORY_SUMMARY_TOO_BROAD` with `details.limit` — narrow the period or
|
|
51
|
+
* the filters; a cut-off total would look like a complete one.
|
|
52
|
+
*/
|
|
53
|
+
summary(params = {}) {
|
|
54
|
+
return this.#http.request('GET', `${this.#base}/summary`, {
|
|
55
|
+
query: { ...params },
|
|
56
|
+
});
|
|
57
|
+
}
|
|
12
58
|
}
|
|
13
59
|
//# sourceMappingURL=history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/resources/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/resources/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AAmOtD,MAAM,OAAO,eAAe;IACjB,KAAK,CAAY;IACjB,KAAK,CAAQ;IAEtB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,kBAAkB,GAAG,CAAC,SAAS,CAAC,UAAU,CAAA;IACzD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,CAAC,MAAM,GAAkB,EAAE;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAkB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAA;IACzF,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,MAAM,GAAyB,EAAE;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAiB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,UAAU,EAAE;YACxE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { HttpClient } from '../core/http.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PageParams } from '../core/pagination.js';
|
|
3
|
+
import type { AllowedSegmentsResponse, MeVaultResponse, MySessionList, PatchProfileBody, PushToken, RegisterPushTokenBody, UserProfile } from '../generated/types.js';
|
|
3
4
|
/** The caller's own profile, devices and permissions. Not scoped to a vault. */
|
|
4
5
|
export declare class MeResource {
|
|
5
6
|
#private;
|
|
@@ -51,6 +52,21 @@ export declare class MeResource {
|
|
|
51
52
|
vaultId: string;
|
|
52
53
|
action: string;
|
|
53
54
|
}): Promise<AllowedSegmentsResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Where I am signed in: my live sessions — the phone, the web version, the
|
|
57
|
+
* Mac app, a browser — newest first, with `current` on the one making this
|
|
58
|
+
* request.
|
|
59
|
+
*
|
|
60
|
+
* Open to ANY session, a web or Mac one included, because it carries
|
|
61
|
+
* nothing worth stealing: no tokens, no IP addresses, no raw user agent.
|
|
62
|
+
* Read-only — ending another session is better-auth's own
|
|
63
|
+
* `/api/auth/revoke-session` and its neighbours, which a web or Mac
|
|
64
|
+
* session is refused; signing out of this session is always possible.
|
|
65
|
+
* Expired sessions are not listed, and neither are web or Mac ones older
|
|
66
|
+
* than 30 days from sign-in — their real ceiling, which is what
|
|
67
|
+
* `expiresAt` says for them.
|
|
68
|
+
*/
|
|
69
|
+
sessions(params?: PageParams): Promise<MySessionList>;
|
|
54
70
|
registerPushToken(input: RegisterPushTokenBody): Promise<PushToken>;
|
|
55
71
|
/** `deleted: false` simply means the token was not registered — not a failure. */
|
|
56
72
|
removePushToken(token: string): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/resources/me.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACrB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAE9B,gFAAgF;AAChF,qBAAa,UAAU;;IAGrB,YAAY,IAAI,EAAE,UAAU,EAE3B;IAED,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAE9B;IAED;;;;;;;OAOG;IACH,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAE3D;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAInD;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,IAAI,OAAO,CAAC,eAAe,CAAC,CAEhC;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAI7F;IAED,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC,CAElE;IAED,kFAAkF;IAClF,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAK5D;CACF"}
|
|
1
|
+
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/resources/me.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACrB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAE9B,gFAAgF;AAChF,qBAAa,UAAU;;IAGrB,YAAY,IAAI,EAAE,UAAU,EAE3B;IAED,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAE9B;IAED;;;;;;;OAOG;IACH,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAE3D;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAInD;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,IAAI,OAAO,CAAC,eAAe,CAAC,CAEhC;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAI7F;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CAIxD;IAED,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC,CAElE;IAED,kFAAkF;IAClF,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAK5D;CACF"}
|
package/dist/esm/resources/me.js
CHANGED
|
@@ -60,6 +60,25 @@ export class MeResource {
|
|
|
60
60
|
query: { ...params },
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Where I am signed in: my live sessions — the phone, the web version, the
|
|
65
|
+
* Mac app, a browser — newest first, with `current` on the one making this
|
|
66
|
+
* request.
|
|
67
|
+
*
|
|
68
|
+
* Open to ANY session, a web or Mac one included, because it carries
|
|
69
|
+
* nothing worth stealing: no tokens, no IP addresses, no raw user agent.
|
|
70
|
+
* Read-only — ending another session is better-auth's own
|
|
71
|
+
* `/api/auth/revoke-session` and its neighbours, which a web or Mac
|
|
72
|
+
* session is refused; signing out of this session is always possible.
|
|
73
|
+
* Expired sessions are not listed, and neither are web or Mac ones older
|
|
74
|
+
* than 30 days from sign-in — their real ceiling, which is what
|
|
75
|
+
* `expiresAt` says for them.
|
|
76
|
+
*/
|
|
77
|
+
sessions(params = {}) {
|
|
78
|
+
return this.#http.request('GET', '/api/v1/me/sessions', {
|
|
79
|
+
query: { ...params },
|
|
80
|
+
});
|
|
81
|
+
}
|
|
63
82
|
registerPushToken(input) {
|
|
64
83
|
return this.#http.request('POST', '/api/v1/me/push-tokens', { body: input });
|
|
65
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"me.js","sourceRoot":"","sources":["../../../src/resources/me.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"me.js","sourceRoot":"","sources":["../../../src/resources/me.ts"],"names":[],"mappings":"AAYA,gFAAgF;AAChF,MAAM,OAAO,UAAU;IACZ,KAAK,CAAY;IAE1B,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IACnB,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAc,KAAK,EAAE,oBAAoB,CAAC,CAAA;IACrE,CAAC;IAED;;;;;;;OAOG;IACH,aAAa,CAAC,KAAuB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAA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type { MemberCard, MemberDetail, MembersPage, UserGroup, UserGroupDetail, UserGroupMembers } from '../generated/types.js';
|
|
3
|
+
import type { ActionType, MemberCard, MemberDetail, MembersPage, PolicyDirectoryPage, UserGroup, UserGroupDetail, UserGroupMembers } from '../generated/types.js';
|
|
4
|
+
export interface PolicyDirectoryParams extends PageParams {
|
|
5
|
+
actionType?: ActionType | undefined;
|
|
6
|
+
effect?: 'allow' | 'block' | undefined;
|
|
7
|
+
enabled?: boolean | undefined;
|
|
8
|
+
/** Only the policies of groups I belong to. Without it — every group's. */
|
|
9
|
+
mine?: boolean | undefined;
|
|
10
|
+
}
|
|
4
11
|
/**
|
|
5
12
|
* People in the vault, and the groups they belong to.
|
|
6
13
|
*
|
|
@@ -48,6 +55,19 @@ export declare class MembersResource {
|
|
|
48
55
|
* policies stays administrator-only.
|
|
49
56
|
*/
|
|
50
57
|
group(groupId: string): Promise<UserGroupDetail>;
|
|
58
|
+
/**
|
|
59
|
+
* Every policy of the vault by name — code, name, look, `actionType`,
|
|
60
|
+
* `effect`, `enabled` and the group it hangs on — for a "decided by" label
|
|
61
|
+
* and the feed's `decisionPolicyId` filter. Open to any member, and it
|
|
62
|
+
* lists the policies of ALL groups, not only yours: rule names are not
|
|
63
|
+
* personal data and each group's detail already shows them.
|
|
64
|
+
*
|
|
65
|
+
* No rules, conditions, limits, thresholds or signers here — those stay
|
|
66
|
+
* with the administrator endpoints (`admin.policies`). The fields are the
|
|
67
|
+
* ones `group()` shows in `policies[]`, gathered into one list. Keyset
|
|
68
|
+
* paging, newest first.
|
|
69
|
+
*/
|
|
70
|
+
policyDirectory(params?: PolicyDirectoryParams): Promise<PolicyDirectoryPage>;
|
|
51
71
|
groupMembers(groupId: string): Promise<UserGroupMembers>;
|
|
52
72
|
}
|
|
53
73
|
//# sourceMappingURL=members.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":"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.#http.request('GET', `/api/v1/vaults/${this.#vault}/user-groups/${seg(groupId)}`);
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Every policy of the vault by name — code, name, look, `actionType`,
|
|
61
|
+
* `effect`, `enabled` and the group it hangs on — for a "decided by" label
|
|
62
|
+
* and the feed's `decisionPolicyId` filter. Open to any member, and it
|
|
63
|
+
* lists the policies of ALL groups, not only yours: rule names are not
|
|
64
|
+
* personal data and each group's detail already shows them.
|
|
65
|
+
*
|
|
66
|
+
* No rules, conditions, limits, thresholds or signers here — those stay
|
|
67
|
+
* with the administrator endpoints (`admin.policies`). The fields are the
|
|
68
|
+
* ones `group()` shows in `policies[]`, gathered into one list. Keyset
|
|
69
|
+
* paging, newest first.
|
|
70
|
+
*/
|
|
71
|
+
policyDirectory(params = {}) {
|
|
72
|
+
return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/policy-directory`, { query: { ...params } });
|
|
73
|
+
}
|
|
59
74
|
groupMembers(groupId) {
|
|
60
75
|
return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/user-groups/${seg(groupId)}/members`);
|
|
61
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"members.js","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"members.js","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AAqBtD;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IACjB,KAAK,CAAY;IACjB,MAAM,CAAQ;IAEvB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IAC9B,CAAC;IAED,IAAI,CAAC,MAAM,GA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OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,KAAK,EACL,kBAAkB,IAAI,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,CAAC,UAAU,CACpE,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { type HttpClient } from '../core/http.js';
|
|
1
|
+
import { type HttpClient, type RawBody } from '../core/http.js';
|
|
2
|
+
import { type Gated } from '../core/gated.js';
|
|
2
3
|
import type { PageParams } from '../core/pagination.js';
|
|
3
|
-
import type { ApprovalRelations, CreateOperationRelationBody, IncomingTransactionDetail, OperationMetadata, OperationRelation, OperationRelationsPage, OperationType, PatchOperationMetadataBody } from '../generated/types.js';
|
|
4
|
+
import type { ApprovalRelations, ApprovalRequestCreated, CreateOperationRelationBody, IncomingTransactionDetail, OperationAttachment, OperationAttachmentDeleted, OperationAttachmentsList, OperationCounterparty, OperationMetadata, OperationRelation, OperationRelationsPage, OperationType, PatchOperationMetadataBody } from '../generated/types.js';
|
|
5
|
+
import type { OperationRelationType } from './history.js';
|
|
4
6
|
/**
|
|
5
7
|
* Operation kind in a path. Exactly two values exist.
|
|
6
8
|
*
|
|
@@ -13,7 +15,7 @@ import type { ApprovalRelations, CreateOperationRelationBody, IncomingTransactio
|
|
|
13
15
|
*/
|
|
14
16
|
export type OperationKind = OperationType;
|
|
15
17
|
export interface ListRelationsParams extends PageParams {
|
|
16
|
-
relationType?:
|
|
18
|
+
relationType?: OperationRelationType | undefined;
|
|
17
19
|
sourceOperationId?: string | undefined;
|
|
18
20
|
targetOperationId?: string | undefined;
|
|
19
21
|
/** Links that carry a partial amount in this token. */
|
|
@@ -26,6 +28,20 @@ export interface ListRelationsParams extends PageParams {
|
|
|
26
28
|
from?: string | undefined;
|
|
27
29
|
to?: string | undefined;
|
|
28
30
|
}
|
|
31
|
+
/** A file to attach, sent as the raw request body. */
|
|
32
|
+
export type AttachmentFile = Exclude<RawBody, FormData>;
|
|
33
|
+
export interface UploadAttachmentOptions {
|
|
34
|
+
/**
|
|
35
|
+
* The file's name, for a raw body. Taken from a `File` when omitted; an
|
|
36
|
+
* `ArrayBuffer` or `Uint8Array` has none, and a raw upload without a name is
|
|
37
|
+
* 400 `ATTACHMENT_FILENAME_REQUIRED`. Not used with a `FormData`: there the
|
|
38
|
+
* name is the form's `filename` field, or the file part's own name.
|
|
39
|
+
*/
|
|
40
|
+
filename?: string | undefined;
|
|
41
|
+
signal?: AbortSignal | undefined;
|
|
42
|
+
/** An upload can be large; the client's default timeout applies otherwise. */
|
|
43
|
+
timeoutMs?: number | undefined;
|
|
44
|
+
}
|
|
29
45
|
/**
|
|
30
46
|
* Everything hanging off a single operation: free-form metadata, links to
|
|
31
47
|
* other operations, and how its status changed over time.
|
|
@@ -43,7 +59,24 @@ export declare class OperationsResource {
|
|
|
43
59
|
* DEFAULT state, not an edge case. Check before reading fields.
|
|
44
60
|
*/
|
|
45
61
|
metadata(kind: OperationKind, operationId: string): Promise<OperationMetadata | null>;
|
|
46
|
-
|
|
62
|
+
/**
|
|
63
|
+
* A sent field replaces its value, `null` clears it, an absent one stays.
|
|
64
|
+
*
|
|
65
|
+
* Returns `Gated`. The metadata is a facade over the assignment of the
|
|
66
|
+
* system category `general`, and is written the way `categories` writes:
|
|
67
|
+
* a version per change, an optimistic lock, and the category's approval.
|
|
68
|
+
* By default `general` has none and the answer is `applied` (200), as it
|
|
69
|
+
* always was. If an administrator set its `approvalScope`, nothing is
|
|
70
|
+
* written: a request is created (`category_assign` / `category_edit`) and
|
|
71
|
+
* the answer is `pending` (202) with its card. An edit of ANOTHER field
|
|
72
|
+
* made concurrently is not lost — the patch is laid over the fresh version
|
|
73
|
+
* up to three times before 409 `ASSIGNMENT_STALE`.
|
|
74
|
+
*
|
|
75
|
+
* Writing takes the labelling right of `general`: by default `transfer` on
|
|
76
|
+
* the operation's address. Seeing the operation is not enough — a signer or
|
|
77
|
+
* an initiator without that right gets 404.
|
|
78
|
+
*/
|
|
79
|
+
setMetadata(kind: OperationKind, operationId: string, input: PatchOperationMetadataBody): Promise<Gated<OperationMetadata, ApprovalRequestCreated>>;
|
|
47
80
|
/** Other operations linked to this one. A plain array, not a page. */
|
|
48
81
|
relations(kind: OperationKind, operationId: string): Promise<OperationRelation[]>;
|
|
49
82
|
/**
|
|
@@ -76,7 +109,149 @@ export declare class OperationsResource {
|
|
|
76
109
|
* `sourceOperationId` alone will miss half of its links.
|
|
77
110
|
*/
|
|
78
111
|
listRelations(params?: ListRelationsParams): Promise<OperationRelationsPage>;
|
|
112
|
+
/**
|
|
113
|
+
* Links two operations. DIRECTION: `source` is the DERIVED operation (the
|
|
114
|
+
* refund, reversal, correction or replacement itself), `target` the
|
|
115
|
+
* ORIGINAL it refers to — a deposit refunded by a transfer is source =
|
|
116
|
+
* transfer, target = deposit. Both must be in this vault, with `transfer`
|
|
117
|
+
* on the addresses of BOTH; otherwise 404 `OPERATION_NOT_FOUND`, as if
|
|
118
|
+
* missing.
|
|
119
|
+
*
|
|
120
|
+
* Idempotent, and not wrapped in `Gated`: a relation is unique by (type,
|
|
121
|
+
* source, target), and repeating the same body answers 200 with the
|
|
122
|
+
* existing relation where a new one answers 201 — both mean "this relation
|
|
123
|
+
* now exists, exactly as asked". The same triple with another amount, token
|
|
124
|
+
* or comment is 409 `OPERATION_RELATION_EXISTS`, the existing id in
|
|
125
|
+
* `details.relationId`. To change a relation, delete it and create it
|
|
126
|
+
* again.
|
|
127
|
+
*
|
|
128
|
+
* `relatedAmountRaw` only together with `tokenId`: a token of at least one
|
|
129
|
+
* of the two operations, an amount above zero and no larger than either
|
|
130
|
+
* side's amount in that token — otherwise 422 `OPERATION_RELATION_INVALID`,
|
|
131
|
+
* the field in `details.field`.
|
|
132
|
+
*/
|
|
79
133
|
createRelation(input: CreateOperationRelationBody): Promise<OperationRelation>;
|
|
134
|
+
/**
|
|
135
|
+
* Removes a relation — physically: a relation has no version history, so
|
|
136
|
+
* reports read the current state and report snapshots stay as they were.
|
|
137
|
+
*
|
|
138
|
+
* Its creator or an administrator. The creator needs what creating took —
|
|
139
|
+
* `transfer` on the addresses of BOTH operations, now; otherwise 403
|
|
140
|
+
* `OPERATION_RELATION_FORBIDDEN`. Someone else's relation is 403
|
|
141
|
+
* `NOT_RELATION_CREATOR`. A relation neither side of which you can see,
|
|
142
|
+
* like one already removed, is 404 `OPERATION_RELATION_NOT_FOUND`.
|
|
143
|
+
*/
|
|
144
|
+
deleteRelation(relationId: string): Promise<{
|
|
145
|
+
deleted: true;
|
|
146
|
+
}>;
|
|
147
|
+
/**
|
|
148
|
+
* Picks the counterparty of a transfer or a deposit by hand, correcting a
|
|
149
|
+
* wrong or missing automatic match: `counterpartySource` becomes `manual`.
|
|
150
|
+
* `null` is a choice too — "this operation has no counterparty".
|
|
151
|
+
*
|
|
152
|
+
* The choice is written where the automatic match is, so the feed, the
|
|
153
|
+
* cards, the counterparty's counters and reports see it at once. Neither
|
|
154
|
+
* the automatic match nor the retro-match on adding an address overwrites
|
|
155
|
+
* it; `resetCounterparty()` hands the operation back to them. Repeating the
|
|
156
|
+
* same value writes nothing and answers the current state.
|
|
157
|
+
*
|
|
158
|
+
* Only a counterparty of this vault that is not archived: 404
|
|
159
|
+
* `COUNTERPARTY_NOT_FOUND` (someone else's and a missing one alike), 409
|
|
160
|
+
* `COUNTERPARTY_ARCHIVED`. A transfer awaiting signatures is 409
|
|
161
|
+
* `OPERATION_AWAITING_APPROVAL` — its signers see the counterparty matched
|
|
162
|
+
* by the recipient's address, and a manual choice then would let them sign
|
|
163
|
+
* a stranger's address under a trusted name. The policy decision never
|
|
164
|
+
* depends on this choice; it was taken by address at creation.
|
|
165
|
+
*
|
|
166
|
+
* Takes the right to write the operation's metadata: `transfer` on its
|
|
167
|
+
* address. Seeing it is not enough — anyone else gets 404
|
|
168
|
+
* `OPERATION_NOT_FOUND`.
|
|
169
|
+
*/
|
|
170
|
+
setCounterparty(kind: OperationKind, operationId: string, counterpartyId: string | null): Promise<OperationCounterparty>;
|
|
171
|
+
/**
|
|
172
|
+
* Drops the manual choice and matches the operation again AT ONCE — by the
|
|
173
|
+
* other side's address (the recipient of a transfer, the sender of a
|
|
174
|
+
* deposit) against the directory as it is NOW, by the rule used at
|
|
175
|
+
* creation (an archived counterparty does not match). The result can
|
|
176
|
+
* differ from what was there before the manual choice if the directory has
|
|
177
|
+
* changed since.
|
|
178
|
+
*
|
|
179
|
+
* On an operation that is already automatic nothing is written and the
|
|
180
|
+
* current state comes back, so a repeat is safe. Afterwards
|
|
181
|
+
* `counterpartySource` is `auto` and `counterpartySetById`/`At` say who
|
|
182
|
+
* reset it and when. Same rights and the same 409
|
|
183
|
+
* `OPERATION_AWAITING_APPROVAL` as `setCounterparty()`.
|
|
184
|
+
*/
|
|
185
|
+
resetCounterparty(kind: OperationKind, operationId: string): Promise<OperationCounterparty>;
|
|
186
|
+
/**
|
|
187
|
+
* Files attached to an operation (invoices, acts, screenshots) — metadata,
|
|
188
|
+
* in upload order; the bytes are fetched with `downloadAttachment()`. At
|
|
189
|
+
* most 20 per operation, so there is no cursor. Removed ones are not
|
|
190
|
+
* listed.
|
|
191
|
+
*
|
|
192
|
+
* Seen by whoever sees the operation: for a transfer an administrator, its
|
|
193
|
+
* initiator, a signer from the request's snapshot, or `view` on the sending
|
|
194
|
+
* address; for a deposit `view` on the receiving address. Anyone else gets
|
|
195
|
+
* 404 `OPERATION_NOT_FOUND`. A server without attachment storage answers
|
|
196
|
+
* 501 `ATTACHMENTS_DISABLED` on every attachment call — hide the feature
|
|
197
|
+
* then.
|
|
198
|
+
*/
|
|
199
|
+
attachments(kind: OperationKind, operationId: string): Promise<OperationAttachmentsList>;
|
|
200
|
+
/**
|
|
201
|
+
* Attaches a file. Two forms, chosen by what you pass:
|
|
202
|
+
*
|
|
203
|
+
* • a `Blob`/`File`, an `ArrayBuffer` or a `Uint8Array` goes as the raw
|
|
204
|
+
* body (`application/octet-stream`, the name in `?filename=`), streamed
|
|
205
|
+
* to storage, up to 10 MB. `fetch` sets `Content-Length` itself, which
|
|
206
|
+
* the API requires (411 `ATTACHMENT_LENGTH_REQUIRED` without it);
|
|
207
|
+
* • a `FormData` goes as `multipart/form-data` exactly as built: the file
|
|
208
|
+
* in the field `file`, the name in the field `filename` or the part's
|
|
209
|
+
* own. Parsed in memory, so up to 5 MB. This is the form React Native
|
|
210
|
+
* sends a file from a `uri` with.
|
|
211
|
+
*
|
|
212
|
+
* The type is decided by the BYTES, never by a header: PDF, PNG, JPEG and
|
|
213
|
+
* WebP only — anything else (SVG and HTML included) is 415
|
|
214
|
+
* `ATTACHMENT_TYPE_NOT_ALLOWED`. The name is cleaned and its extension made
|
|
215
|
+
* to match the type; read the stored one from the answer. Over the size
|
|
216
|
+
* limit is 413 `ATTACHMENT_TOO_LARGE`; over 20 files on the operation, 409
|
|
217
|
+
* `ATTACHMENT_LIMIT_REACHED`; over the vault's quota (1 GB of live files by
|
|
218
|
+
* default), 409 `ATTACHMENT_QUOTA_EXCEEDED` with `details.quotaBytes` and
|
|
219
|
+
* `details.usedBytes`.
|
|
220
|
+
*
|
|
221
|
+
* Uploading takes `transfer` on the operation's address, as labelling does;
|
|
222
|
+
* a signer, an initiator whose grant was revoked and a view-only grant get
|
|
223
|
+
* 404. From a browser, a page of a site the API does not trust is refused
|
|
224
|
+
* with 403 `CROSS_SITE_REQUEST_REFUSED`, as every changing request is.
|
|
225
|
+
*/
|
|
226
|
+
uploadAttachment(kind: OperationKind, operationId: string, file: AttachmentFile | FormData, options?: UploadAttachmentOptions): Promise<OperationAttachment>;
|
|
227
|
+
/**
|
|
228
|
+
* The file itself, as the untouched `Response`: read it with `.blob()` or
|
|
229
|
+
* `.arrayBuffer()`. `Content-Type` is the type detected at upload, and
|
|
230
|
+
* `Content-Disposition: attachment` carries the cleaned name. The same
|
|
231
|
+
* path is the attachment's `downloadPath`, relative to the API base.
|
|
232
|
+
*
|
|
233
|
+
* Who may read it is checked on every request, so a revoked access closes a
|
|
234
|
+
* cached copy too: the API answers with `ETag` = the file's SHA-256 and
|
|
235
|
+
* `Cache-Control: private, max-age=0, must-revalidate`. Do not send
|
|
236
|
+
* `If-None-Match` yourself — a 304 has no body and the transport reports it
|
|
237
|
+
* as an error; the browser's own revalidation is transparent. A file
|
|
238
|
+
* missing from storage is 502 `ATTACHMENT_STORAGE_UNAVAILABLE`.
|
|
239
|
+
*/
|
|
240
|
+
downloadAttachment(kind: OperationKind, operationId: string, attachmentId: string, options?: {
|
|
241
|
+
signal?: AbortSignal | undefined;
|
|
242
|
+
}): Promise<Response>;
|
|
243
|
+
/**
|
|
244
|
+
* Removes an attachment: its uploader, while they still hold `transfer` on
|
|
245
|
+
* the operation's address, or an administrator — anyone else who sees the
|
|
246
|
+
* operation gets 403 `ATTACHMENT_DELETE_FORBIDDEN`. Soft: the file leaves
|
|
247
|
+
* the list and is no longer served, its bytes are erased, and the record
|
|
248
|
+
* stays as an audit trail. Repeating it answers the same.
|
|
249
|
+
*
|
|
250
|
+
* 502 `ATTACHMENT_STORAGE_UNAVAILABLE` with `details.deleted: true` means
|
|
251
|
+
* the attachment is already hidden but storage kept the bytes; repeat the
|
|
252
|
+
* call to clean them up.
|
|
253
|
+
*/
|
|
254
|
+
deleteAttachment(kind: OperationKind, operationId: string, attachmentId: string): Promise<OperationAttachmentDeleted>;
|
|
80
255
|
/**
|
|
81
256
|
* An incoming payment in detail.
|
|
82
257
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/resources/operations.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,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{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