@v3finance/core-sdk 0.4.0 → 0.5.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 (164) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/README.md +18 -14
  3. package/dist/cjs/client.d.ts +27 -34
  4. package/dist/cjs/client.d.ts.map +1 -1
  5. package/dist/cjs/client.js +69 -0
  6. package/dist/cjs/client.js.map +1 -1
  7. package/dist/cjs/core/gated.d.ts +12 -10
  8. package/dist/cjs/core/gated.d.ts.map +1 -1
  9. package/dist/cjs/core/gated.js +12 -10
  10. package/dist/cjs/core/gated.js.map +1 -1
  11. package/dist/cjs/core/http.d.ts +18 -0
  12. package/dist/cjs/core/http.d.ts.map +1 -1
  13. package/dist/cjs/core/http.js +11 -1
  14. package/dist/cjs/core/http.js.map +1 -1
  15. package/dist/cjs/core/pagination.d.ts +11 -9
  16. package/dist/cjs/core/pagination.d.ts.map +1 -1
  17. package/dist/cjs/core/pagination.js +11 -9
  18. package/dist/cjs/core/pagination.js.map +1 -1
  19. package/dist/cjs/generated/operations.d.ts +210 -2
  20. package/dist/cjs/generated/operations.d.ts.map +1 -1
  21. package/dist/cjs/generated/operations.js +212 -4
  22. package/dist/cjs/generated/operations.js.map +1 -1
  23. package/dist/cjs/generated/types.d.ts +935 -93
  24. package/dist/cjs/generated/types.d.ts.map +1 -1
  25. package/dist/cjs/index.d.ts +6 -6
  26. package/dist/cjs/index.d.ts.map +1 -1
  27. package/dist/cjs/index.js.map +1 -1
  28. package/dist/cjs/resources/addresses.d.ts +91 -4
  29. package/dist/cjs/resources/addresses.d.ts.map +1 -1
  30. package/dist/cjs/resources/addresses.js +55 -3
  31. package/dist/cjs/resources/addresses.js.map +1 -1
  32. package/dist/cjs/resources/admin.d.ts +32 -1
  33. package/dist/cjs/resources/admin.d.ts.map +1 -1
  34. package/dist/cjs/resources/admin.js +45 -0
  35. package/dist/cjs/resources/admin.js.map +1 -1
  36. package/dist/cjs/resources/approvals.d.ts +30 -2
  37. package/dist/cjs/resources/approvals.d.ts.map +1 -1
  38. package/dist/cjs/resources/approvals.js.map +1 -1
  39. package/dist/cjs/resources/balances.d.ts +14 -7
  40. package/dist/cjs/resources/balances.d.ts.map +1 -1
  41. package/dist/cjs/resources/balances.js +10 -4
  42. package/dist/cjs/resources/balances.js.map +1 -1
  43. package/dist/cjs/resources/categories.d.ts +20 -6
  44. package/dist/cjs/resources/categories.d.ts.map +1 -1
  45. package/dist/cjs/resources/categories.js +19 -7
  46. package/dist/cjs/resources/categories.js.map +1 -1
  47. package/dist/cjs/resources/counterparties.d.ts +52 -6
  48. package/dist/cjs/resources/counterparties.d.ts.map +1 -1
  49. package/dist/cjs/resources/counterparties.js +24 -0
  50. package/dist/cjs/resources/counterparties.js.map +1 -1
  51. package/dist/cjs/resources/history.d.ts +227 -26
  52. package/dist/cjs/resources/history.d.ts.map +1 -1
  53. package/dist/cjs/resources/history.js +46 -0
  54. package/dist/cjs/resources/history.js.map +1 -1
  55. package/dist/cjs/resources/me.d.ts +17 -1
  56. package/dist/cjs/resources/me.d.ts.map +1 -1
  57. package/dist/cjs/resources/me.js +19 -0
  58. package/dist/cjs/resources/me.js.map +1 -1
  59. package/dist/cjs/resources/members.d.ts +21 -1
  60. package/dist/cjs/resources/members.d.ts.map +1 -1
  61. package/dist/cjs/resources/members.js +15 -0
  62. package/dist/cjs/resources/members.js.map +1 -1
  63. package/dist/cjs/resources/operations.d.ts +179 -4
  64. package/dist/cjs/resources/operations.d.ts.map +1 -1
  65. package/dist/cjs/resources/operations.js +192 -2
  66. package/dist/cjs/resources/operations.js.map +1 -1
  67. package/dist/cjs/resources/registries.d.ts +19 -2
  68. package/dist/cjs/resources/registries.d.ts.map +1 -1
  69. package/dist/cjs/resources/registries.js +16 -0
  70. package/dist/cjs/resources/registries.js.map +1 -1
  71. package/dist/cjs/version.d.ts +1 -1
  72. package/dist/cjs/version.js +1 -1
  73. package/dist/esm/client.d.ts +27 -34
  74. package/dist/esm/client.d.ts.map +1 -1
  75. package/dist/esm/client.js +69 -0
  76. package/dist/esm/client.js.map +1 -1
  77. package/dist/esm/core/gated.d.ts +12 -10
  78. package/dist/esm/core/gated.d.ts.map +1 -1
  79. package/dist/esm/core/gated.js +12 -10
  80. package/dist/esm/core/gated.js.map +1 -1
  81. package/dist/esm/core/http.d.ts +18 -0
  82. package/dist/esm/core/http.d.ts.map +1 -1
  83. package/dist/esm/core/http.js +11 -1
  84. package/dist/esm/core/http.js.map +1 -1
  85. package/dist/esm/core/pagination.d.ts +11 -9
  86. package/dist/esm/core/pagination.d.ts.map +1 -1
  87. package/dist/esm/core/pagination.js +11 -9
  88. package/dist/esm/core/pagination.js.map +1 -1
  89. package/dist/esm/generated/operations.d.ts +210 -2
  90. package/dist/esm/generated/operations.d.ts.map +1 -1
  91. package/dist/esm/generated/operations.js +212 -4
  92. package/dist/esm/generated/operations.js.map +1 -1
  93. package/dist/esm/generated/types.d.ts +935 -93
  94. package/dist/esm/generated/types.d.ts.map +1 -1
  95. package/dist/esm/index.d.ts +6 -6
  96. package/dist/esm/index.d.ts.map +1 -1
  97. package/dist/esm/index.js.map +1 -1
  98. package/dist/esm/resources/addresses.d.ts +91 -4
  99. package/dist/esm/resources/addresses.d.ts.map +1 -1
  100. package/dist/esm/resources/addresses.js +55 -3
  101. package/dist/esm/resources/addresses.js.map +1 -1
  102. package/dist/esm/resources/admin.d.ts +32 -1
  103. package/dist/esm/resources/admin.d.ts.map +1 -1
  104. package/dist/esm/resources/admin.js +45 -0
  105. package/dist/esm/resources/admin.js.map +1 -1
  106. package/dist/esm/resources/approvals.d.ts +30 -2
  107. package/dist/esm/resources/approvals.d.ts.map +1 -1
  108. package/dist/esm/resources/approvals.js.map +1 -1
  109. package/dist/esm/resources/balances.d.ts +14 -7
  110. package/dist/esm/resources/balances.d.ts.map +1 -1
  111. package/dist/esm/resources/balances.js +10 -4
  112. package/dist/esm/resources/balances.js.map +1 -1
  113. package/dist/esm/resources/categories.d.ts +20 -6
  114. package/dist/esm/resources/categories.d.ts.map +1 -1
  115. package/dist/esm/resources/categories.js +19 -7
  116. package/dist/esm/resources/categories.js.map +1 -1
  117. package/dist/esm/resources/counterparties.d.ts +52 -6
  118. package/dist/esm/resources/counterparties.d.ts.map +1 -1
  119. package/dist/esm/resources/counterparties.js +24 -0
  120. package/dist/esm/resources/counterparties.js.map +1 -1
  121. package/dist/esm/resources/history.d.ts +227 -26
  122. package/dist/esm/resources/history.d.ts.map +1 -1
  123. package/dist/esm/resources/history.js +46 -0
  124. package/dist/esm/resources/history.js.map +1 -1
  125. package/dist/esm/resources/me.d.ts +17 -1
  126. package/dist/esm/resources/me.d.ts.map +1 -1
  127. package/dist/esm/resources/me.js +19 -0
  128. package/dist/esm/resources/me.js.map +1 -1
  129. package/dist/esm/resources/members.d.ts +21 -1
  130. package/dist/esm/resources/members.d.ts.map +1 -1
  131. package/dist/esm/resources/members.js +15 -0
  132. package/dist/esm/resources/members.js.map +1 -1
  133. package/dist/esm/resources/operations.d.ts +179 -4
  134. package/dist/esm/resources/operations.d.ts.map +1 -1
  135. package/dist/esm/resources/operations.js +192 -2
  136. package/dist/esm/resources/operations.js.map +1 -1
  137. package/dist/esm/resources/registries.d.ts +19 -2
  138. package/dist/esm/resources/registries.d.ts.map +1 -1
  139. package/dist/esm/resources/registries.js +16 -0
  140. package/dist/esm/resources/registries.js.map +1 -1
  141. package/dist/esm/version.d.ts +1 -1
  142. package/dist/esm/version.js +1 -1
  143. package/docs/concepts.md +13 -11
  144. package/docs/errors.md +73 -5
  145. package/package.json +1 -1
  146. package/src/client.ts +40 -0
  147. package/src/core/gated.ts +12 -10
  148. package/src/core/http.ts +30 -1
  149. package/src/core/pagination.ts +11 -9
  150. package/src/generated/operations.ts +212 -4
  151. package/src/generated/types.ts +979 -95
  152. package/src/index.ts +15 -1
  153. package/src/resources/addresses.ts +102 -4
  154. package/src/resources/admin.ts +59 -0
  155. package/src/resources/approvals.ts +30 -2
  156. package/src/resources/balances.ts +14 -7
  157. package/src/resources/categories.ts +19 -5
  158. package/src/resources/counterparties.ts +59 -5
  159. package/src/resources/history.ts +238 -27
  160. package/src/resources/me.ts +22 -0
  161. package/src/resources/members.ts +30 -0
  162. package/src/resources/operations.ts +264 -5
  163. package/src/resources/registries.ts +26 -3
  164. package/src/version.ts +1 -1
@@ -80,10 +80,14 @@ export class CategoriesResource {
80
80
  * Changes applied values. Append-only underneath: every change writes a new
81
81
  * version rather than overwriting, so history survives.
82
82
  *
83
- * There is NO optimistic lock on the direct path: two people editing the
84
- * same assignment will overwrite each other, last write winning, and the
85
- * earlier value survives only in the version history. Staleness is checked
86
- * on the approval path, against a version the server took itself.
83
+ * Send `baseVersion` — the assignment's `version` the editor started from.
84
+ * If it has changed since, the answer is 409 `ASSIGNMENT_STALE` (the
85
+ * current one in `details.currentVersion`) and nothing is written, neither
86
+ * the values nor a request: re-read, merge and resubmit. Two writes from
87
+ * the same version are told apart by the database itself, and the second
88
+ * gets the same 409. WITHOUT `baseVersion` a direct write silently
89
+ * overwrites a colleague's edit, last write winning — the field is optional
90
+ * only for compatibility.
87
91
  *
88
92
  * Returns `Gated` for the same reason as `assign`.
89
93
  */
@@ -91,9 +95,17 @@ export class CategoriesResource {
91
95
  const res = await this.#http.requestRaw('PATCH', `${this.#assignments(type, operationId)}/${seg(assignmentId)}`, { body: input });
92
96
  return toGated(res.status, res.data);
93
97
  }
94
- /** Soft: the assignment goes to `removed` and its history survives. */
95
- removeAssignment(type, operationId, assignmentId) {
96
- return this.#http.request('DELETE', `${this.#assignments(type, operationId)}/${seg(assignmentId)}`);
98
+ /**
99
+ * Soft: the assignment goes to `removed` and its history survives.
100
+ *
101
+ * `baseVersion` locks like `updateAssignment`'s: changed since that version
102
+ * — 409 `ASSIGNMENT_STALE`, nothing removed. Without it the removal is
103
+ * still conditional on the version this request read, so an edit or a
104
+ * removal that got in first produces the same 409 instead of being
105
+ * overwritten.
106
+ */
107
+ removeAssignment(type, operationId, assignmentId, options = {}) {
108
+ return this.#http.request('DELETE', `${this.#assignments(type, operationId)}/${seg(assignmentId)}`, { query: { ...options } });
97
109
  }
98
110
  /** Every version of an assignment — the audit trail of who changed what. */
99
111
  versions(type, operationId, assignmentId) {
@@ -1 +1 @@
1
- {"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../src/resources/categories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAmCtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,kBAAkB;IACpB,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,UAAU;QACZ,OAAO,kBAAkB,IAAI,CAAC,MAAM,uBAAuB,CAAA;IAC7D,CAAC;IAED,YAAY,CAAC,IAAmB,EAAE,WAAmB;QACnD,OAAO,kBAAkB,IAAI,CAAC,MAAM,eAAe,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,aAAa,CAAA;IAC/F,CAAC;IAED,0DAA0D;IAC1D,IAAI,CACF,MAAM,GAKF,EAAE;QAEN,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAA0B,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;YACzE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC;IAED,GAAG,CAAC,UAAkB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAoB,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IAC9F,CAAC;IAED;;;;;;;OAOG;IACH,SA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Client } from '../core/http.js';
2
2
  import { type Gated } from '../core/gated.js';
3
3
  import type { PageParams } from '../core/pagination.js';
4
- import type { ApprovalRequestCreated, Counterparty, CounterpartyGroup, AddCounterpartyAddressBody, CounterpartiesPage, CounterpartyAddressCreated, CounterpartyCreated, CounterpartyDetail, CounterpartyGroupDetail, CounterpartyGroupsPage, CreateCounterpartyBody, CreateCounterpartyGroupBody, PatchCounterpartyBody, PatchCounterpartyGroupBody } from '../generated/types.js';
5
- export interface ListCounterpartiesParams extends PageParams {
4
+ import type { ApprovalRequestCreated, Counterparty, CounterpartyGroup, AddCounterpartyAddressBody, CounterpartiesPage, CounterpartiesSummary, CounterpartyAddressCreated, CounterpartyCreated, CounterpartyDetail, CounterpartyGroupDetail, CounterpartyGroupsPage, CreateCounterpartyBody, CreateCounterpartyGroupBody, PatchCounterpartyBody, PatchCounterpartyGroupBody } from '../generated/types.js';
5
+ /**
6
+ * The filters `list()` and `summary()` share. A multi-value filter takes a
7
+ * string or an array, sent as one comma-separated value (OR), at most 50
8
+ * values — more is 400 `TOO_MANY_VALUES`.
9
+ */
10
+ export interface CounterpartyFilters {
11
+ /** A substring of the name. */
6
12
  search?: string | undefined;
7
13
  kind?: string | undefined;
8
- /** Exact on-chain address — the only way to find a counterparty by it. */
14
+ /**
15
+ * An on-chain address — the only way to find a counterparty by it. An EVM
16
+ * address compares case-insensitively (its case is only the EIP-55
17
+ * checksum), any other network exactly.
18
+ */
9
19
  address?: string | undefined;
20
+ /** With `address`: look for it on this network only (`Network.slug`). */
21
+ network?: string | undefined;
10
22
  groupId?: string | undefined;
11
23
  /**
12
- * `true` returns ONLY archived entries, `false` only active ones. Leaving
13
- * it out returns both — there is no way to ask for "active plus archived"
14
- * explicitly, because that is already the default.
24
+ * Counterparty tags, matched after normalisation: case (Cyrillic included),
25
+ * `ё` = `е` and extra spaces do not matter.
26
+ */
27
+ tag?: string | readonly string[] | undefined;
28
+ /**
29
+ * `true` returns ONLY archived entries. Anything else — `false`, or leaving
30
+ * it out — returns only active ones: there is no way to ask for both at
31
+ * once. (Earlier versions of this note said the default returned both; the
32
+ * handler filters to active ones.)
15
33
  */
16
34
  archived?: boolean | undefined;
17
35
  }
36
+ export interface ListCounterpartiesParams extends CounterpartyFilters, PageParams {
37
+ }
38
+ /** What `summary()` can count by. */
39
+ export type CounterpartyFacet = keyof CounterpartiesSummary['facets'];
40
+ export interface CounterpartiesSummaryParams extends CounterpartyFilters {
41
+ /** Which counters to compute. Only those asked for come back. */
42
+ facets?: CounterpartyFacet | readonly CounterpartyFacet[] | undefined;
43
+ }
18
44
  /**
19
45
  * The counterparty directory.
20
46
  *
@@ -35,7 +61,27 @@ export interface ListCounterpartiesParams extends PageParams {
35
61
  export declare class CounterpartiesResource {
36
62
  #private;
37
63
  constructor(http: HttpClient, vaultCode: string);
64
+ /**
65
+ * One page of the directory. `operationsCount` is how many operations with
66
+ * the counterparty YOU see — the set `history.list({ includeShared: true,
67
+ * counterpartyId })` walks; `_count` is in your scope too, and an
68
+ * administrator's covers the whole vault. `groupIds` are its non-archived
69
+ * groups.
70
+ */
38
71
  list(params?: ListCounterpartiesParams): Promise<CounterpartiesPage>;
72
+ /**
73
+ * How many counterparties match, and counters per value of the requested
74
+ * `facets` (`tag`, `kind`, `groupId`) under the same filters as `list()`.
75
+ *
76
+ * A facet is counted with every filter except its own dimension; `count`
77
+ * applies all of them. Only values met appear (no zeros), the top 50 per
78
+ * dimension, the rest in `otherCount`; `value: null` is "no value" (no
79
+ * kind, in no group, no tags). Tags are grouped by normalised spelling and
80
+ * shown in the most frequent one; `groupId` counts non-archived groups and
81
+ * carries the group's name as `label`. An unknown facet is 400
82
+ * `INVALID_FILTER_VALUE`.
83
+ */
84
+ summary(params?: CounterpartiesSummaryParams): Promise<CounterpartiesSummary>;
39
85
  get(counterpartyId: string): Promise<CounterpartyDetail>;
40
86
  create(input: CreateCounterpartyBody): Promise<Gated<CounterpartyCreated, ApprovalRequestCreated>>;
41
87
  update(counterpartyId: string, input: PatchCounterpartyBody): Promise<Gated<Counterparty, ApprovalRequestCreated>>;
@@ -1 +1 @@
1
- {"version":3,"file":"counterparties.d.ts","sourceRoot":"","sources":["../../../src/resources/counterparties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC/B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,sBAAsB;;IAIjC,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED,IAAI,CAAC,MAAM,GAAE,wBAA6B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAEvE;IAED,GAAG,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAEvD;IAEK,MAAM,CACV,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,sB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iBAAiB,EAAE,sBAAsB,CAAC,CAAC,CAK3D;IAED;;;;OAIG;IACG,SAAS,CACb,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,KAAK,CAAC;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,EAAE,sBAAsB,CAAC,CAAC,CAKzD;IAED;;;OAGG;IACG,YAAY,CAChB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,sBAAsB,CAAC,CAAC,CAM9D;CACF"}
1
+ {"version":3,"file":"counterparties.d.ts","sourceRoot":"","sources":["../../../src/resources/counterparties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAE9B;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;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E,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,sBAAsB,CAAC,CAAC,CAM9D;CACF"}
@@ -24,9 +24,33 @@ export class CounterpartiesResource {
24
24
  this.#http = http;
25
25
  this.#base = `/api/v1/vaults/${seg(vaultCode)}/counterparties`;
26
26
  }
27
+ /**
28
+ * One page of the directory. `operationsCount` is how many operations with
29
+ * the counterparty YOU see — the set `history.list({ includeShared: true,
30
+ * counterpartyId })` walks; `_count` is in your scope too, and an
31
+ * administrator's covers the whole vault. `groupIds` are its non-archived
32
+ * groups.
33
+ */
27
34
  list(params = {}) {
28
35
  return this.#http.request('GET', this.#base, { query: { ...params } });
29
36
  }
37
+ /**
38
+ * How many counterparties match, and counters per value of the requested
39
+ * `facets` (`tag`, `kind`, `groupId`) under the same filters as `list()`.
40
+ *
41
+ * A facet is counted with every filter except its own dimension; `count`
42
+ * applies all of them. Only values met appear (no zeros), the top 50 per
43
+ * dimension, the rest in `otherCount`; `value: null` is "no value" (no
44
+ * kind, in no group, no tags). Tags are grouped by normalised spelling and
45
+ * shown in the most frequent one; `groupId` counts non-archived groups and
46
+ * carries the group's name as `label`. An unknown facet is 400
47
+ * `INVALID_FILTER_VALUE`.
48
+ */
49
+ summary(params = {}) {
50
+ return this.#http.request('GET', `${this.#base}/summary`, {
51
+ query: { ...params },
52
+ });
53
+ }
30
54
  get(counterpartyId) {
31
55
  return this.#http.request('GET', `${this.#base}/${seg(counterpartyId)}`);
32
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"counterparties.js","sourceRoot":"","sources":["../../../src/resources/counterparties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAiCtD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,sBAAsB;IACxB,KAAK,CAAY;IACjB,KAAK,CAAQ;IAEtB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IA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KAAK,CAAC,SAAS,CACb,OAAe,EACf,cAAsB;QAEtB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAU,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE;YAChG,IAAI,EAAE,EAAE,cAAc,EAAE;SACzB,CAAC,CAAA;QACF,OAAO,OAAO,CAA0C,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAC/E,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,YAAY,CAChB,OAAe,EACf,cAAsB;QAEtB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CACrC,QAAQ,EACR,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,GAAG,CAAC,cAAc,CAAC,EAAE,CAC/D,CAAA;QACD,OAAO,OAAO,CAA+C,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IACpF,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import { type HttpClient } from '../core/http.js';
2
- import type { Page, PageParams } from '../core/pagination.js';
3
- import type { HistoryItem } from '../generated/types.js';
2
+ import type { PageParams } from '../core/pagination.js';
3
+ import type { HistoryResponse, HistorySummary } from '../generated/types.js';
4
4
  /**
5
5
  * One feed of operations: incoming and outgoing together.
6
6
  *
@@ -13,47 +13,248 @@ import type { HistoryItem } from '../generated/types.js';
13
13
  *
14
14
  * One value short of `TransactionStatus`, which is the right set for reading
15
15
  * a transfer: `submitted` is missing here. It is a legacy status — still the
16
- * column default in the schema, so old rows carry it — and the endpoint's
17
- * enum does not accept it, so filtering by it is a 400 rather than an empty
18
- * page. Hence a separate type: taking the reader's union would have the
19
- * package suggest a value its own filter rejects.
16
+ * column default in the schema, so old rows carry it, and `HistoryOutItem`
17
+ * can report it — but the filter does not accept it, so filtering by it is a
18
+ * 400 `INVALID_FILTER_VALUE` rather than an empty page. Hence a separate
19
+ * type: taking the reader's union would have the package suggest a value its
20
+ * own filter rejects.
20
21
  */
21
22
  export type HistoryStatusFilter = 'awaiting_approval' | 'pending' | 'confirmed' | 'failed' | 'rejected' | 'cancelled';
22
- export interface HistoryParams extends PageParams {
23
- direction?: 'in' | 'out' | undefined;
23
+ /**
24
+ * AML levels the feed can be filtered by. `unchecked` selects the operations
25
+ * nobody checked (`amlLevel: null`) — which is NOT "clean", so it has to be
26
+ * asked for by name.
27
+ */
28
+ export type HistoryAmlLevelFilter = 'critical' | 'high' | 'medium' | 'low' | 'minimal' | 'unchecked';
29
+ export type OperationRelationType = 'refund' | 'reversal' | 'correction' | 'replacement';
30
+ /** One value, or several — sent as one comma-separated value. */
31
+ type OneOrMany<T> = T | readonly T[];
32
+ /**
33
+ * The filters `list()` and `summary()` share.
34
+ *
35
+ * A multi-value filter takes a string or an array; an array goes out as one
36
+ * comma-separated value — OR within the filter, AND between filters, at most
37
+ * 50 values (more is 400 `TOO_MANY_VALUES`). An unknown value of an
38
+ * enumeration (`direction`, `status`, `flowType`, `amlLevel`,
39
+ * `relationType`…) is 400 `INVALID_FILTER_VALUE`, with `details.param`,
40
+ * `details.invalid` and `details.allowed`.
41
+ *
42
+ * `<name>Not` means "none of": an operation that has NO value there is kept,
43
+ * because "not X" includes "none". No filter widens the scope — a folder you
44
+ * cannot see, an address you cannot reach or an initiator outside your scope
45
+ * yields nothing rather than someone else's operations.
46
+ */
47
+ export interface HistoryFilters {
48
+ /** `in` — deposits, `out` — transfers. Both is the same as neither. */
49
+ direction?: OneOrMany<'in' | 'out'> | undefined;
24
50
  /**
25
51
  * Outgoing only, whichever value you pass: a status belongs to a transfer,
26
52
  * so setting this EXCLUDES the incoming side of the feed even without
27
- * `direction: 'out'`. The same goes for `awaitingMyApproval` and
28
- * `decisionPolicyId`.
53
+ * `direction: 'out'`. The same goes for `awaitingMyApproval`,
54
+ * `decisionPolicyId` and `initiatorId`.
55
+ */
56
+ status?: OneOrMany<HistoryStatusFilter> | undefined;
57
+ /**
58
+ * None of these statuses. A deposit counts as `confirmed` here, as its row
59
+ * shows it: `statusNot: 'failed'` keeps deposits, `statusNot: 'confirmed'`
60
+ * drops them.
61
+ */
62
+ statusNot?: OneOrMany<HistoryStatusFilter> | undefined;
63
+ /**
64
+ * Only what awaits MY signature. For the approvals screen. Implies
65
+ * `direction: 'out'` and `status: 'awaiting_approval'` — a `status` passed
66
+ * alongside is ignored; the other filters, `statusNot` included, still
67
+ * apply.
29
68
  */
30
- status?: HistoryStatusFilter | undefined;
31
- /** Only what awaits MY signature. For the approvals screen. */
32
69
  awaitingMyApproval?: boolean | undefined;
33
- asset?: string | undefined;
34
- tokenId?: string | undefined;
35
- network?: string | undefined;
36
- addressId?: string | undefined;
37
- folderId?: string | undefined;
38
- counterpartyId?: string | undefined;
39
- counterpartyGroupId?: string | undefined;
40
- counterpartyAddressId?: string | undefined;
70
+ /** Token code. */
71
+ asset?: OneOrMany<string> | undefined;
72
+ assetNot?: OneOrMany<string> | undefined;
73
+ /** Token id from the registry. With `asset` — the intersection. */
74
+ tokenId?: OneOrMany<string> | undefined;
75
+ tokenIdNot?: OneOrMany<string> | undefined;
76
+ /** `Network.slug`. */
77
+ network?: OneOrMany<string> | undefined;
78
+ networkNot?: OneOrMany<string> | undefined;
79
+ /** Our address: the sender of a transfer, the recipient of a deposit. */
80
+ addressId?: OneOrMany<string> | undefined;
81
+ addressIdNot?: OneOrMany<string> | undefined;
82
+ /**
83
+ * Operations on the addresses of a folder, as it is now. Any folder you can
84
+ * see; it narrows, never widens — without `includeShared` a shared folder
85
+ * narrows only your own operations.
86
+ */
87
+ folderId?: OneOrMany<string> | undefined;
88
+ folderIdNot?: OneOrMany<string> | undefined;
89
+ counterpartyId?: OneOrMany<string> | undefined;
90
+ counterpartyIdNot?: OneOrMany<string> | undefined;
91
+ /** By the group's current members. */
92
+ counterpartyGroupId?: OneOrMany<string> | undefined;
93
+ counterpartyGroupIdNot?: OneOrMany<string> | undefined;
94
+ /** The on-chain address of the other side. EVM addresses compare case-insensitively. */
95
+ counterpartyAddressId?: OneOrMany<string> | undefined;
41
96
  /** `internal` — the other side is an address of this vault; `external` — it is not. */
42
- flowType?: 'internal' | 'external' | undefined;
43
- category?: string | undefined;
97
+ flowType?: OneOrMany<'internal' | 'external'> | undefined;
98
+ /** The `category` of the older metadata (the system category `general`). */
99
+ category?: OneOrMany<string> | undefined;
100
+ categoryNot?: OneOrMany<string> | undefined;
101
+ /** Exact match, ONE value: a comma is part of the text here, not a separator. */
44
102
  paymentPurpose?: string | undefined;
45
- decisionPolicyId?: string | undefined;
46
- txHash?: string | undefined;
103
+ decisionPolicyId?: OneOrMany<string> | undefined;
104
+ decisionPolicyIdNot?: OneOrMany<string> | undefined;
105
+ /** Who started the transfer (member ids). Deposits drop out — they have no initiator. */
106
+ initiatorId?: OneOrMany<string> | undefined;
107
+ initiatorIdNot?: OneOrMany<string> | undefined;
108
+ /** The recipient's risk on a transfer, the sender's on a deposit. */
109
+ amlLevel?: OneOrMany<HistoryAmlLevelFilter> | undefined;
110
+ /** `unchecked` here drops the unchecked ones; without it they stay. */
111
+ amlLevelNot?: OneOrMany<HistoryAmlLevelFilter> | undefined;
112
+ /** A deposit always has a hash. */
113
+ hasTxHash?: boolean | undefined;
114
+ /** Whether the transfer has a fee recorded. A deposit has none: `true` drops it, `false` keeps it. */
115
+ hasFee?: boolean | undefined;
116
+ hasCounterparty?: boolean | undefined;
117
+ /**
118
+ * What `from`/`to` apply to. With `confirmedAt` and a period, a transfer that
119
+ * was never confirmed does not match; a deposit's `confirmedAt` is its
120
+ * `createdAt`. The ORDER of the feed is not affected — that is `sort`.
121
+ */
122
+ dateBasis?: 'createdAt' | 'confirmedAt' | undefined;
123
+ /** Tags of the older metadata, matched after normalisation (case, `ё` = `е`, spaces). */
124
+ tag?: OneOrMany<string> | undefined;
125
+ tagNot?: OneOrMany<string> | undefined;
126
+ /**
127
+ * Has an active assignment of a vault category, by key. Only assignments
128
+ * VISIBLE to you count — as on the operation's card; the same holds for the
129
+ * other category filters, and a hidden sensitive value never matches.
130
+ */
131
+ categoryKey?: OneOrMany<string> | undefined;
132
+ categoryKeyNot?: OneOrMany<string> | undefined;
133
+ /** `false` — no visible assignment at all ("unlabelled"). */
134
+ hasCategory?: boolean | undefined;
135
+ /**
136
+ * A field's value — the grammar of the reports' `categoryField`:
137
+ * `key:v1|v2,key2:v3` (`,` is AND, `|` is OR), every condition on ONE
138
+ * assignment; with `categoryKey`, within those categories only. Values in
139
+ * canonical form (`84.10` for 84.1 at scale 2).
140
+ */
141
+ categoryField?: string | undefined;
142
+ /**
143
+ * A range over a field: `key:from..to[,…]`, both ends inclusive, either may
144
+ * be omitted (`amount:100..`). Numbers compare as decimals; dates are ISO in
145
+ * UTC, and an END date without a time covers that WHOLE day — unlike the
146
+ * feed's own `to`. Same one assignment as `categoryField`.
147
+ */
148
+ categoryFieldRange?: string | undefined;
149
+ /**
150
+ * The assignment has no value in these fields (keys). A hidden sensitive
151
+ * field counts as FILLED, whatever it holds — otherwise the filter would
152
+ * reveal whether it is empty.
153
+ */
154
+ categoryFieldEmpty?: OneOrMany<string> | undefined;
155
+ /** Has a relation (refund, reversal, correction, replacement) in either role. */
156
+ hasRelations?: boolean | undefined;
157
+ /** A relation of this type, in either role. */
158
+ relationType?: OneOrMany<OperationRelationType> | undefined;
159
+ /**
160
+ * Amount at least (inclusive) — a decimal string IN THE OPERATION'S OWN
161
+ * TOKEN: `'100'` is 100 USDT on a USDT operation and 100 TRX on a TRX one.
162
+ * Compared exactly. An operation whose token is outside the registry never
163
+ * matches. Add `asset` or `tokenId` to compare one asset.
164
+ */
165
+ minimumAmount?: string | undefined;
166
+ maximumAmount?: string | undefined;
167
+ /**
168
+ * USD valuation at least (inclusive), a decimal string — the row's
169
+ * `usdValue`. An operation without a valuation NEVER matches; how many there
170
+ * are is `usd.unpricedCount` of `summary()`.
171
+ */
172
+ minimumUsd?: string | undefined;
173
+ maximumUsd?: string | undefined;
174
+ /** `false` — no USD valuation: no rate at the time, or a token outside the registry. */
175
+ hasUsd?: boolean | undefined;
47
176
  /** Include operations on addresses shared with you. Off by default. */
48
177
  includeShared?: boolean | undefined;
49
- /** ISO date, inclusive. */
178
+ /** Exact on-chain hash, one value. */
179
+ txHash?: string | undefined;
180
+ /**
181
+ * BOTH INCLUSIVE, by `dateBasis`: ISO moment or `YYYY-MM-DD` (midnight UTC).
182
+ * Reports treat `to` as exclusive, so the same pair selects different sets
183
+ * there and here — exactly on the operations at `to`. To take a whole day
184
+ * here, pass its last moment or the next midnight.
185
+ */
50
186
  from?: string | undefined;
51
187
  to?: string | undefined;
188
+ /**
189
+ * Administrators — of the platform or of THIS vault — see the whole vault;
190
+ * this narrows it to one person. Anyone else may name only themselves (403).
191
+ */
52
192
  userId?: string | undefined;
53
193
  }
194
+ export interface HistoryParams extends HistoryFilters, PageParams {
195
+ /**
196
+ * Order of the feed; `createdAt` by default. `confirmedAt` — only confirmed
197
+ * operations. `amount` — by the raw amount, and ONLY with exactly one asset
198
+ * in `asset`/`tokenId` (amounts of different tokens do not compare), else
199
+ * 400 `SORT_REQUIRES_SINGLE_ASSET`; "largest in any asset" is `usd`. `usd` —
200
+ * by the USD valuation, valued operations only. Equal keys go by id.
201
+ */
202
+ sort?: 'createdAt' | 'confirmedAt' | 'amount' | 'usd' | undefined;
203
+ /** `desc` by default. */
204
+ order?: 'desc' | 'asc' | undefined;
205
+ }
206
+ /** What `summary()` can count by. */
207
+ export type HistoryFacet = keyof HistorySummary['facets'];
208
+ export interface HistorySummaryParams extends HistoryFilters {
209
+ /** Which counters to compute. Only those asked for come back. */
210
+ facets?: OneOrMany<HistoryFacet> | undefined;
211
+ }
54
212
  export declare class HistoryResource {
55
213
  #private;
56
214
  constructor(http: HttpClient, vaultCode: string);
57
- list(params?: HistoryParams): Promise<Page<HistoryItem>>;
215
+ /**
216
+ * One page of the feed. A member sees their own transfers and the deposits
217
+ * to their addresses; `includeShared` adds the operations of addresses
218
+ * opened to them, `awaitingMyApproval` the transfers waiting for their vote.
219
+ * An administrator of the platform or of THIS vault sees the whole vault —
220
+ * seeing is not acting: what a vault administrator may send, sign or label
221
+ * is still decided by their own rights as a member.
222
+ *
223
+ * A cursor remembers `sort` and `order`: one issued for another order is
224
+ * 400 `INVALID_CURSOR` (older cursors are `createdAt desc`).
225
+ *
226
+ * Two flags can come back, and neither means the end of the feed:
227
+ *
228
+ * • `scanTruncated` — some filters are decided over rows already read,
229
+ * and the page did not fill within 50 000 of them. What was found is
230
+ * returned and `nextCursor` continues from where the scan stopped:
231
+ * keep paging;
232
+ * • `sortIncomplete` — with `sort: 'amount' | 'usd'`, some operations
233
+ * have no sort key yet and this request could not compute them all
234
+ * (200 rows per table per request); those operations are not in the
235
+ * order yet. Repeat the request.
236
+ */
237
+ list(params?: HistoryParams): Promise<HistoryResponse>;
238
+ /**
239
+ * Totals for the same scope and filters as `list()`: how many operations,
240
+ * amounts per asset, the USD total and counters per value of the requested
241
+ * `facets`. `count` is the length of the feed paged to its end, the amounts
242
+ * the sum of its rows.
243
+ *
244
+ * `byAsset` is per asset AND per direction, in raw units (a BigInt string)
245
+ * and as a decimal — there is no cross-asset "turnover", and the sums
246
+ * include unsuccessful transfers unless a filter drops them
247
+ * (`statusNot: ['failed', 'rejected', 'cancelled']`). Different assets add
248
+ * up only in `usd`, valued as the rows' `usdValue`; operations without a
249
+ * valuation are counted in `usd.unpricedCount` and are in no USD total.
250
+ *
251
+ * A facet is counted with every filter EXCEPT its own dimension.
252
+ *
253
+ * More than 25 000 operations after filtering is 422
254
+ * `HISTORY_SUMMARY_TOO_BROAD` with `details.limit` — narrow the period or
255
+ * the filters; a cut-off total would look like a complete one.
256
+ */
257
+ summary(params?: HistorySummaryParams): Promise<HistorySummary>;
58
258
  }
259
+ export {};
59
260
  //# sourceMappingURL=history.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/resources/history.ts"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B;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,UAAU;IAC/D;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAA;IACjE,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;CACnC;AAED,qCAAqC;AACrC,MAAM,MAAM,YAAY,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;AAEzD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,iEAAiE;IACjE,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAA;CAC7C;AAED,qBAAa,eAAe;;IAI1B,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,CAAC,MAAM,GAAE,aAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAEzD;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,MAAM,GAAE,oBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC,CAIlE;CACF"}
@@ -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;AA+DtD,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,IAAI,CAAC,MAAM,GAAkB,EAAE;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAoB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAA;IAC3F,CAAC;CACF"}
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 { AllowedSegmentsResponse, MeVaultResponse, PatchProfileBody, PushToken, RegisterPushTokenBody, UserProfile } from '../generated/types.js';
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,SA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