@polyester/sdk 0.36.0-devnet-20261118123359 → 0.36.0-devnet-20261118184607

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 (339) hide show
  1. package/CHANGELOG.md +60 -8
  2. package/dist/catalogs/index.d.ts +2 -2
  3. package/dist/catalogs/snapshot-validation.js +10 -1
  4. package/dist/catalogs/snapshot-validation.js.map +1 -1
  5. package/dist/catalogs/zipper-catalog.d.ts +2 -0
  6. package/dist/catalogs/zipper-catalog.d.ts.map +1 -1
  7. package/dist/catalogs/zipper-catalog.js.map +1 -1
  8. package/dist/catalogs/zipper-supply.d.ts +2 -0
  9. package/dist/catalogs/zipper-supply.d.ts.map +1 -1
  10. package/dist/catalogs/zipper-supply.js +7 -5
  11. package/dist/catalogs/zipper-supply.js.map +1 -1
  12. package/dist/client.d.ts +2 -0
  13. package/dist/client.d.ts.map +1 -1
  14. package/dist/client.js +2 -0
  15. package/dist/client.js.map +1 -1
  16. package/dist/gen/ai/v1/assistant_pb.d.ts +679 -13
  17. package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
  18. package/dist/gen/ai/v1/assistant_pb.js +355 -97
  19. package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
  20. package/dist/gen/alerts/v1/price_alerts_pb.d.ts +33 -4
  21. package/dist/gen/alerts/v1/price_alerts_pb.d.ts.map +1 -1
  22. package/dist/gen/alerts/v1/price_alerts_pb.js +23 -2
  23. package/dist/gen/alerts/v1/price_alerts_pb.js.map +1 -1
  24. package/dist/gen/auth/v1/activity_pb.d.ts +148 -0
  25. package/dist/gen/auth/v1/activity_pb.d.ts.map +1 -0
  26. package/dist/gen/auth/v1/activity_pb.js +40 -0
  27. package/dist/gen/auth/v1/activity_pb.js.map +1 -0
  28. package/dist/gen/auth/v1/api_keys_pb.d.ts +10 -4
  29. package/dist/gen/auth/v1/api_keys_pb.d.ts.map +1 -1
  30. package/dist/gen/auth/v1/api_keys_pb.js +3 -1
  31. package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
  32. package/dist/gen/auth/v1/auth_pb.d.ts +61 -5
  33. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  34. package/dist/gen/auth/v1/auth_pb.js +23 -6
  35. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  36. package/dist/gen/auth/v1/mfa_pb.d.ts +140 -2
  37. package/dist/gen/auth/v1/mfa_pb.d.ts.map +1 -1
  38. package/dist/gen/auth/v1/mfa_pb.js +80 -8
  39. package/dist/gen/auth/v1/mfa_pb.js.map +1 -1
  40. package/dist/gen/auth/v1/policies_pb.d.ts +18 -3
  41. package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
  42. package/dist/gen/auth/v1/policies_pb.js +18 -3
  43. package/dist/gen/auth/v1/policies_pb.js.map +1 -1
  44. package/dist/gen/auth/v1/social_verification_pb.d.ts +36 -15
  45. package/dist/gen/auth/v1/social_verification_pb.d.ts.map +1 -1
  46. package/dist/gen/auth/v1/social_verification_pb.js +1 -1
  47. package/dist/gen/auth/v1/social_verification_pb.js.map +1 -1
  48. package/dist/gen/auth/v1/subaccounts_pb.d.ts +15 -1
  49. package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
  50. package/dist/gen/auth/v1/subaccounts_pb.js +1 -1
  51. package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
  52. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +6 -2
  53. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -1
  54. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -1
  55. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +104 -6
  56. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
  57. package/dist/gen/chain/withdraw/v1/withdraw_pb.js +49 -3
  58. package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
  59. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts +76 -3
  60. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts.map +1 -1
  61. package/dist/gen/chain/zipper/v1/zipper_pb.js +46 -2
  62. package/dist/gen/chain/zipper/v1/zipper_pb.js.map +1 -1
  63. package/dist/gen/index.d.ts +3 -1
  64. package/dist/gen/index.js +4 -2
  65. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +21 -139
  66. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts.map +1 -1
  67. package/dist/gen/ledger/read/v1/ledger_read_pb.js +16 -17
  68. package/dist/gen/ledger/read/v1/ledger_read_pb.js.map +1 -1
  69. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts +236 -20
  70. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts.map +1 -1
  71. package/dist/gen/ledger/read/v1/statement_export_pb.js +44 -10
  72. package/dist/gen/ledger/read/v1/statement_export_pb.js.map +1 -1
  73. package/dist/gen/ledger/v1/catalog_pb.d.ts +9 -1
  74. package/dist/gen/ledger/v1/catalog_pb.d.ts.map +1 -1
  75. package/dist/gen/ledger/v1/catalog_pb.js +9 -1
  76. package/dist/gen/ledger/v1/catalog_pb.js.map +1 -1
  77. package/dist/gen/marketdata/v1/asset_info_pb.d.ts +158 -7
  78. package/dist/gen/marketdata/v1/asset_info_pb.d.ts.map +1 -1
  79. package/dist/gen/marketdata/v1/asset_info_pb.js +56 -6
  80. package/dist/gen/marketdata/v1/asset_info_pb.js.map +1 -1
  81. package/dist/gen/notifications/v1/notifications_pb.d.ts +45 -6
  82. package/dist/gen/notifications/v1/notifications_pb.d.ts.map +1 -1
  83. package/dist/gen/notifications/v1/notifications_pb.js +23 -5
  84. package/dist/gen/notifications/v1/notifications_pb.js.map +1 -1
  85. package/dist/gen/orders/v1/orders_pb.d.ts +105 -29
  86. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  87. package/dist/gen/orders/v1/orders_pb.js +14 -2
  88. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  89. package/dist/gen/orders/v1/orders_read_pb.d.ts +50 -20
  90. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  91. package/dist/gen/orders/v1/orders_read_pb.js +1 -1
  92. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  93. package/dist/gen/polyester/api/options_pb.d.ts +11 -2
  94. package/dist/gen/polyester/api/options_pb.d.ts.map +1 -1
  95. package/dist/gen/polyester/api/options_pb.js +13 -3
  96. package/dist/gen/polyester/api/options_pb.js.map +1 -1
  97. package/dist/gen/privatews/v1/private_ws_pb.d.ts +13 -3
  98. package/dist/gen/privatews/v1/private_ws_pb.d.ts.map +1 -1
  99. package/dist/gen/privatews/v1/private_ws_pb.js.map +1 -1
  100. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +126 -10
  101. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
  102. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +14 -6
  103. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
  104. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.d.ts +665 -0
  105. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.d.ts.map +1 -0
  106. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.js +216 -0
  107. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.js.map +1 -0
  108. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +166 -52
  109. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
  110. package/dist/gen/swap/quickswap/v1/quickswap_pb.js +50 -12
  111. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
  112. package/dist/gen/system/v1/system_pb.d.ts +49 -2
  113. package/dist/gen/system/v1/system_pb.d.ts.map +1 -1
  114. package/dist/gen/system/v1/system_pb.js +18 -6
  115. package/dist/gen/system/v1/system_pb.js.map +1 -1
  116. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +150 -71
  117. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts.map +1 -1
  118. package/dist/gen/transfer/v1/internal_transfer_pb.js +56 -34
  119. package/dist/gen/transfer/v1/internal_transfer_pb.js.map +1 -1
  120. package/dist/gen/triggers/v1/triggers_pb.d.ts +117 -16
  121. package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
  122. package/dist/gen/triggers/v1/triggers_pb.js +45 -2
  123. package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
  124. package/dist/index.d.ts +13 -9
  125. package/dist/realtime/ready-gated-subscription.js +1 -1
  126. package/dist/realtime/snapshot-then-stream.js +2 -0
  127. package/dist/realtime/snapshot-then-stream.js.map +1 -1
  128. package/dist/services/account-activity/account-activity.d.ts +22 -0
  129. package/dist/services/account-activity/account-activity.d.ts.map +1 -0
  130. package/dist/services/account-activity/account-activity.js +32 -0
  131. package/dist/services/account-activity/account-activity.js.map +1 -0
  132. package/dist/services/account-activity/account-activity.schemas.d.ts +78 -0
  133. package/dist/services/account-activity/account-activity.schemas.d.ts.map +1 -0
  134. package/dist/services/account-activity/account-activity.schemas.js +44 -0
  135. package/dist/services/account-activity/account-activity.schemas.js.map +1 -0
  136. package/dist/services/account-activity/account-activity.types.d.ts +2 -0
  137. package/dist/services/account-activity/service.d.ts +8 -0
  138. package/dist/services/account-activity/service.d.ts.map +1 -0
  139. package/dist/services/account-activity/service.js +9 -0
  140. package/dist/services/account-activity/service.js.map +1 -0
  141. package/dist/services/address-book/address-book.schemas.d.ts +2 -2
  142. package/dist/services/address-book/address-book.schemas.js +2 -2
  143. package/dist/services/api-keys/api-keys.schemas.js +2 -2
  144. package/dist/services/assistant/assistant-events.schemas.d.ts +25 -25
  145. package/dist/services/assistant/assistant.codecs.d.ts +7 -2
  146. package/dist/services/assistant/assistant.codecs.d.ts.map +1 -1
  147. package/dist/services/assistant/assistant.codecs.js +18 -2
  148. package/dist/services/assistant/assistant.codecs.js.map +1 -1
  149. package/dist/services/assistant/assistant.d.ts +29 -2
  150. package/dist/services/assistant/assistant.d.ts.map +1 -1
  151. package/dist/services/assistant/assistant.js +44 -2
  152. package/dist/services/assistant/assistant.js.map +1 -1
  153. package/dist/services/assistant/assistant.schemas.d.ts +111 -6
  154. package/dist/services/assistant/assistant.schemas.d.ts.map +1 -1
  155. package/dist/services/assistant/assistant.schemas.js +74 -6
  156. package/dist/services/assistant/assistant.schemas.js.map +1 -1
  157. package/dist/services/assistant/assistant.types.d.ts +3 -3
  158. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts +3 -1
  159. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts.map +1 -1
  160. package/dist/services/auto-withdraw/auto-withdraw.codecs.js.map +1 -1
  161. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +21 -19
  162. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts.map +1 -1
  163. package/dist/services/auto-withdraw/auto-withdraw.schemas.js +1 -0
  164. package/dist/services/auto-withdraw/auto-withdraw.schemas.js.map +1 -1
  165. package/dist/services/balances/balances.d.ts +1 -13
  166. package/dist/services/balances/balances.d.ts.map +1 -1
  167. package/dist/services/balances/balances.js +1 -45
  168. package/dist/services/balances/balances.js.map +1 -1
  169. package/dist/services/balances/balances.schemas.d.ts +1 -67
  170. package/dist/services/balances/balances.schemas.d.ts.map +1 -1
  171. package/dist/services/balances/balances.schemas.js +1 -22
  172. package/dist/services/balances/balances.schemas.js.map +1 -1
  173. package/dist/services/balances/balances.types.d.ts +2 -2
  174. package/dist/services/candles/candles.schemas.d.ts +10 -10
  175. package/dist/services/changelog/changelog.schemas.d.ts +38 -38
  176. package/dist/services/claims/claims.schemas.d.ts +2 -2
  177. package/dist/services/dust-conversion/dust-conversion.schemas.d.ts +2 -2
  178. package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
  179. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts +11 -6
  180. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts.map +1 -1
  181. package/dist/services/internal-transfers/internal-transfers.codecs.js +6 -6
  182. package/dist/services/internal-transfers/internal-transfers.codecs.js.map +1 -1
  183. package/dist/services/internal-transfers/internal-transfers.d.ts +17 -10
  184. package/dist/services/internal-transfers/internal-transfers.d.ts.map +1 -1
  185. package/dist/services/internal-transfers/internal-transfers.js +21 -10
  186. package/dist/services/internal-transfers/internal-transfers.js.map +1 -1
  187. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +43 -31
  188. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts.map +1 -1
  189. package/dist/services/internal-transfers/internal-transfers.schemas.js +23 -12
  190. package/dist/services/internal-transfers/internal-transfers.schemas.js.map +1 -1
  191. package/dist/services/internal-transfers/internal-transfers.types.d.ts +2 -2
  192. package/dist/services/lifecycle/lifecycle.js +1 -1
  193. package/dist/services/lifecycle/lifecycle.js.map +1 -1
  194. package/dist/services/lifecycle/lifecycle.schemas.d.ts +55 -55
  195. package/dist/services/market-data/market-data.codecs.d.ts +8 -0
  196. package/dist/services/market-data/market-data.codecs.d.ts.map +1 -0
  197. package/dist/services/market-data/market-data.codecs.js +7 -1
  198. package/dist/services/market-data/market-data.codecs.js.map +1 -1
  199. package/dist/services/market-data/market-data.d.ts +3 -2
  200. package/dist/services/market-data/market-data.d.ts.map +1 -1
  201. package/dist/services/market-data/market-data.js +3 -2
  202. package/dist/services/market-data/market-data.js.map +1 -1
  203. package/dist/services/market-data/market-data.schemas.d.ts +332 -4
  204. package/dist/services/market-data/market-data.schemas.d.ts.map +1 -1
  205. package/dist/services/market-data/market-data.schemas.js +56 -8
  206. package/dist/services/market-data/market-data.schemas.js.map +1 -1
  207. package/dist/services/market-data/market-data.types.d.ts +3 -2
  208. package/dist/services/notifications/notifications.codecs.d.ts +1 -1
  209. package/dist/services/notifications/notifications.codecs.d.ts.map +1 -1
  210. package/dist/services/notifications/notifications.codecs.js +2 -1
  211. package/dist/services/notifications/notifications.codecs.js.map +1 -1
  212. package/dist/services/notifications/notifications.d.ts +4 -2
  213. package/dist/services/notifications/notifications.d.ts.map +1 -1
  214. package/dist/services/notifications/notifications.js +4 -2
  215. package/dist/services/notifications/notifications.js.map +1 -1
  216. package/dist/services/notifications/notifications.schemas.d.ts +50 -6
  217. package/dist/services/notifications/notifications.schemas.d.ts.map +1 -1
  218. package/dist/services/notifications/notifications.schemas.js +5 -0
  219. package/dist/services/notifications/notifications.schemas.js.map +1 -1
  220. package/dist/services/orderbook/orderbook.js +1 -1
  221. package/dist/services/orders/order-enums.codecs.d.ts +2 -0
  222. package/dist/services/orders/order-errors.schemas.d.ts +49 -4
  223. package/dist/services/orders/order-errors.schemas.d.ts.map +1 -1
  224. package/dist/services/orders/order-errors.schemas.js +13 -3
  225. package/dist/services/orders/order-errors.schemas.js.map +1 -1
  226. package/dist/services/orders/orders-batch.schemas.d.ts +290 -50
  227. package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
  228. package/dist/services/orders/orders-input.schemas.d.ts +55 -8
  229. package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
  230. package/dist/services/orders/orders-input.schemas.js +1 -1
  231. package/dist/services/orders/orders-output.schemas.d.ts +10 -10
  232. package/dist/services/orders/orders.d.ts.map +1 -1
  233. package/dist/services/orders/orders.js +47 -43
  234. package/dist/services/orders/orders.js.map +1 -1
  235. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
  236. package/dist/services/policies/api-key-policies/api-key-policies.schemas.js +1 -1
  237. package/dist/services/policies/shared.codecs.js +12 -6
  238. package/dist/services/policies/shared.codecs.js.map +1 -1
  239. package/dist/services/policies/shared.d.ts +1 -1
  240. package/dist/services/policies/shared.js +1 -1
  241. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +9 -9
  242. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js +3 -3
  243. package/dist/services/price-alerts/price-alerts.d.ts +5 -2
  244. package/dist/services/price-alerts/price-alerts.d.ts.map +1 -1
  245. package/dist/services/price-alerts/price-alerts.js +5 -2
  246. package/dist/services/price-alerts/price-alerts.js.map +1 -1
  247. package/dist/services/price-alerts/price-alerts.schemas.js +1 -1
  248. package/dist/services/social-verification/social-verification.schemas.d.ts +9 -0
  249. package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
  250. package/dist/services/social-verification/social-verification.schemas.js +9 -2
  251. package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
  252. package/dist/services/statement-exports/statement-exports.codecs.d.ts +3 -2
  253. package/dist/services/statement-exports/statement-exports.codecs.d.ts.map +1 -1
  254. package/dist/services/statement-exports/statement-exports.codecs.js +2 -1
  255. package/dist/services/statement-exports/statement-exports.codecs.js.map +1 -1
  256. package/dist/services/statement-exports/statement-exports.d.ts +25 -10
  257. package/dist/services/statement-exports/statement-exports.d.ts.map +1 -1
  258. package/dist/services/statement-exports/statement-exports.js +33 -10
  259. package/dist/services/statement-exports/statement-exports.js.map +1 -1
  260. package/dist/services/statement-exports/statement-exports.schemas.d.ts +37 -9
  261. package/dist/services/statement-exports/statement-exports.schemas.d.ts.map +1 -1
  262. package/dist/services/statement-exports/statement-exports.schemas.js +24 -5
  263. package/dist/services/statement-exports/statement-exports.schemas.js.map +1 -1
  264. package/dist/services/statement-exports/statement-exports.types.d.ts +2 -2
  265. package/dist/services/subaccounts/subaccounts.codecs.js +112 -38
  266. package/dist/services/subaccounts/subaccounts.codecs.js.map +1 -1
  267. package/dist/services/subaccounts/subaccounts.js +1 -1
  268. package/dist/services/subaccounts/subaccounts.schemas.d.ts +22 -15
  269. package/dist/services/subaccounts/subaccounts.schemas.d.ts.map +1 -1
  270. package/dist/services/subaccounts/subaccounts.schemas.js +10 -3
  271. package/dist/services/subaccounts/subaccounts.schemas.js.map +1 -1
  272. package/dist/services/system/system.d.ts +12 -1
  273. package/dist/services/system/system.d.ts.map +1 -1
  274. package/dist/services/system/system.js +5 -0
  275. package/dist/services/system/system.js.map +1 -1
  276. package/dist/services/system/system.schemas.d.ts +13 -13
  277. package/dist/services/system/system.types.d.ts +2 -2
  278. package/dist/services/trades/trades.d.ts.map +1 -1
  279. package/dist/services/trades/trades.js +12 -4
  280. package/dist/services/trades/trades.js.map +1 -1
  281. package/dist/services/trades/trades.schemas.d.ts +1 -1
  282. package/dist/services/trading-withdraws/trading-withdraws.codecs.d.ts +8 -0
  283. package/dist/services/trading-withdraws/trading-withdraws.codecs.d.ts.map +1 -0
  284. package/dist/services/trading-withdraws/trading-withdraws.codecs.js +7 -1
  285. package/dist/services/trading-withdraws/trading-withdraws.codecs.js.map +1 -1
  286. package/dist/services/trading-withdraws/trading-withdraws.d.ts +2 -1
  287. package/dist/services/trading-withdraws/trading-withdraws.d.ts.map +1 -1
  288. package/dist/services/trading-withdraws/trading-withdraws.js +2 -1
  289. package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
  290. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts +15 -0
  291. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts.map +1 -1
  292. package/dist/services/trading-withdraws/trading-withdraws.schemas.js +16 -2
  293. package/dist/services/trading-withdraws/trading-withdraws.schemas.js.map +1 -1
  294. package/dist/services/trading-withdraws/trading-withdraws.types.d.ts +2 -1
  295. package/dist/services/transfers/transfers.schemas.d.ts +4 -4
  296. package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
  297. package/dist/services/triggers/triggers-output.schemas.d.ts +153 -35
  298. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  299. package/dist/services/triggers/triggers-output.schemas.js +13 -3
  300. package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
  301. package/dist/services/triggers/triggers.codecs.d.ts +10 -0
  302. package/dist/services/triggers/triggers.codecs.d.ts.map +1 -0
  303. package/dist/services/triggers/triggers.codecs.js +7 -1
  304. package/dist/services/triggers/triggers.codecs.js.map +1 -1
  305. package/dist/services/triggers/triggers.d.ts +2 -2
  306. package/dist/services/triggers/triggers.d.ts.map +1 -1
  307. package/dist/services/triggers/triggers.js +16 -12
  308. package/dist/services/triggers/triggers.js.map +1 -1
  309. package/dist/services/zipper/zipper.d.ts.map +1 -1
  310. package/dist/services/zipper/zipper.js +13 -7
  311. package/dist/services/zipper/zipper.js.map +1 -1
  312. package/dist/services/zipper/zipper.schemas.d.ts +7 -2
  313. package/dist/services/zipper/zipper.schemas.d.ts.map +1 -1
  314. package/dist/services/zipper/zipper.schemas.js +29 -9
  315. package/dist/services/zipper/zipper.schemas.js.map +1 -1
  316. package/dist/services/zipper/zipper.types.d.ts +2 -2
  317. package/dist/shared/catalog-config.d.ts +16 -2
  318. package/dist/shared/catalog-config.d.ts.map +1 -1
  319. package/dist/shared/catalog-config.js.map +1 -1
  320. package/dist/shared/connect-error-mapping.d.ts.map +1 -1
  321. package/dist/shared/connect-error-mapping.js +7 -2
  322. package/dist/shared/connect-error-mapping.js.map +1 -1
  323. package/dist/shared/decimal-surface.d.ts +6 -0
  324. package/dist/shared/decimal-surface.d.ts.map +1 -1
  325. package/dist/shared/decimal-surface.js +65 -1
  326. package/dist/shared/decimal-surface.js.map +1 -1
  327. package/dist/shared/error-detail.d.ts +10 -0
  328. package/dist/shared/error-detail.d.ts.map +1 -1
  329. package/dist/shared/error-detail.js.map +1 -1
  330. package/dist/shared/error-details/auth.js +6 -0
  331. package/dist/shared/error-details/auth.js.map +1 -1
  332. package/dist/shared/ledger-codes.d.ts +3 -1
  333. package/dist/shared/ledger-codes.d.ts.map +1 -1
  334. package/dist/shared/ledger-codes.js +6 -3
  335. package/dist/shared/ledger-codes.js.map +1 -1
  336. package/dist/wired-services.d.ts.map +1 -1
  337. package/dist/wired-services.js +3 -1
  338. package/dist/wired-services.js.map +1 -1
  339. package/package.json +1 -1
@@ -33,7 +33,8 @@ function transformVerification(v) {
33
33
  lastError: v.lastError,
34
34
  errorCode: enumLabel(SocialVerificationErrorCodeCodec.protoToOutput, v.errorCode),
35
35
  updatedAt: v.updatedAt,
36
- retryAfter: v.retryAfter
36
+ retryAfter: v.retryAfter,
37
+ changeAvailableAt: v.changeAvailableAt
37
38
  };
38
39
  }
39
40
  v.object({
@@ -62,7 +63,13 @@ v.object({
62
63
  * When a new verification may succeed, after this one failed with
63
64
  * `social_account_cooldown` or `social_change_limit_reached`; absent otherwise.
64
65
  */
65
- retryAfter: v.optional(TimestampSchema)
66
+ retryAfter: v.optional(TimestampSchema),
67
+ /**
68
+ * X and Discord only: when the linked account may be changed or unlinked again, while the
69
+ * once-per-30-days limit applies; absent when a change or unlink is allowed now. A first
70
+ * link and re-verifying the linked X handle are not changes.
71
+ */
72
+ changeAvailableAt: v.optional(TimestampSchema)
66
73
  });
67
74
  const StartVerificationInputSchema = v.pipe(v.variant("provider", [
68
75
  v.strictObject({
@@ -1 +1 @@
1
- {"version":3,"file":"social-verification.schemas.js","names":[],"sources":["../../../src/services/social-verification/social-verification.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { TimestampSchema } from \"../../shared/schemas.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport * as Proto from \"../../gen/auth/v1/social_verification_pb.js\";\nimport {\n SOCIAL_PROVIDER_VALUES,\n SOCIAL_VERIFICATION_ERROR_CODE_VALUES,\n SOCIAL_VERIFICATION_METHOD_VALUES,\n SOCIAL_VERIFICATION_STATUS_VALUES,\n SocialProviderCodec,\n SocialVerificationErrorCodeCodec,\n SocialVerificationMethodCodec,\n SocialVerificationStatusCodec,\n} from \"./social-verification.codecs.js\";\n\nexport {\n SOCIAL_PROVIDER_VALUES,\n SOCIAL_VERIFICATION_ERROR_CODE_VALUES,\n SOCIAL_VERIFICATION_METHOD_VALUES,\n SOCIAL_VERIFICATION_STATUS_VALUES,\n} from \"./social-verification.codecs.js\";\n\nexport const SocialProviderSchema = v.picklist(SOCIAL_PROVIDER_VALUES);\nexport type SocialProvider = v.InferInput<typeof SocialProviderSchema>;\n\nexport const SocialVerificationMethodSchema = v.picklist(SOCIAL_VERIFICATION_METHOD_VALUES);\nexport type SocialVerificationMethod = v.InferInput<typeof SocialVerificationMethodSchema>;\n\nexport const SocialVerificationErrorCodeSchema = v.picklist(SOCIAL_VERIFICATION_ERROR_CODE_VALUES);\nexport type SocialVerificationErrorCode = v.InferOutput<typeof SocialVerificationErrorCodeSchema>;\n\nexport const SocialVerificationStatusSchema = v.picklist(SOCIAL_VERIFICATION_STATUS_VALUES);\nexport type SocialVerificationStatus = v.InferOutput<typeof SocialVerificationStatusSchema>;\n\nfunction normalizeHandle(input: string): string {\n return (input ?? \"\").trim().replace(/^@+/, \"\");\n}\n\nconst TWITTER_HANDLE_PATTERN = /^[A-Za-z0-9_]{1,15}$/;\n\n/**\n * Normalizes a social verification response into the SDK verification shape.\n */\nexport function transformVerification(\n v: Proto.SocialVerification | undefined,\n): SocialVerification | undefined {\n if (!v) return undefined;\n return {\n id: v.id,\n provider: enumLabel(SocialProviderCodec.protoToOutput, v.provider),\n method: enumLabel(SocialVerificationMethodCodec.protoToOutput, v.method),\n handle: v.handle,\n providerUserId: v.providerUserId,\n displayName: v.displayName,\n challengeCode: v.challengeCode,\n status: enumLabel(SocialVerificationStatusCodec.protoToOutput, v.status),\n requestedAt: v.requestedAt,\n expiresAt: v.expiresAt,\n verifiedAt: v.verifiedAt,\n attempts: v.attempts,\n lastError: v.lastError,\n errorCode: enumLabel(SocialVerificationErrorCodeCodec.protoToOutput, v.errorCode),\n updatedAt: v.updatedAt,\n retryAfter: v.retryAfter,\n };\n}\n\nexport const SocialVerificationSchema = v.object({\n id: v.bigint(),\n provider: SocialProviderSchema,\n method: SocialVerificationMethodSchema,\n handle: v.string(),\n /**\n * Provider-side user ID of the linked account, empty while none is linked. A restarted\n * X or Discord verification keeps the current link, and this value, until it succeeds.\n * For Telegram in `awaiting_confirmation`, the\n * decimal user ID of the account that sent the code: pass it to `confirm` as is.\n */\n providerUserId: v.string(),\n /** Telegram only: the account's name once the code is submitted; empty otherwise. */\n displayName: v.string(),\n challengeCode: v.string(),\n status: SocialVerificationStatusSchema,\n requestedAt: v.optional(TimestampSchema),\n expiresAt: v.optional(TimestampSchema),\n verifiedAt: v.optional(TimestampSchema),\n attempts: v.number(),\n lastError: v.string(),\n updatedAt: v.optional(TimestampSchema),\n /**\n * When a new verification may succeed, after this one failed with\n * `social_account_cooldown` or `social_change_limit_reached`; absent otherwise.\n */\n retryAfter: v.optional(TimestampSchema),\n});\n\ntype SocialVerificationBase = v.InferOutput<typeof SocialVerificationSchema>;\nexport type SocialVerification = Omit<SocialVerificationBase, \"provider\" | \"method\" | \"status\"> & {\n provider: DecodedEnum<SocialProvider>;\n method: DecodedEnum<SocialVerificationMethod>;\n status: DecodedEnum<SocialVerificationStatus>;\n /**\n * Machine-readable failure for the current state; branch on this, not `lastError`.\n * `\"unspecified\"` when no typed failure applies or the code is newer than this SDK.\n * `\"social_account_already_linked\"` is non-retryable for this account: send the\n * user to the account already linked to that identity instead of restarting.\n */\n errorCode: DecodedEnum<SocialVerificationErrorCode>;\n};\n\nexport const StartVerificationInputSchema = v.pipe(\n v.variant(\"provider\", [\n v.strictObject({\n provider: v.literal(\"twitter\"),\n handle: v.pipe(\n v.string(),\n v.transform(normalizeHandle),\n v.minLength(1),\n v.regex(\n TWITTER_HANDLE_PATTERN,\n \"Twitter handle must be 1-15 letters, digits, or underscores\",\n ),\n ),\n method: v.optional(v.literal(\"profile\")),\n }),\n v.strictObject({\n provider: v.literal(\"discord\"),\n method: v.optional(v.picklist([\"channel\", \"dm\"])),\n }),\n v.strictObject({\n provider: v.literal(\"telegram\"),\n method: v.optional(v.literal(\"dm\")),\n }),\n ]),\n v.transform(({ provider, method, ...input }) => ({\n ...input,\n provider: SocialProviderCodec.inputToProto[provider],\n // METHOD_UNSPECIFIED lets the API choose Twitter's profile or Discord's channel default.\n method:\n method === undefined\n ? Proto.SocialVerificationMethod.METHOD_UNSPECIFIED\n : SocialVerificationMethodCodec.inputToProto[method],\n })),\n);\n\nexport type StartVerificationInput = v.InferInput<typeof StartVerificationInputSchema>;\n\nexport const ProviderInputSchema = v.pipe(\n SocialProviderSchema,\n v.transform((v) => SocialProviderCodec.inputToProto[v]),\n);\n\nexport const SocialProviderInputSchema = v.strictObject({\n provider: ProviderInputSchema,\n});\n\nexport type SocialProviderInput = v.InferInput<typeof SocialProviderInputSchema>;\n\nexport const StartVerificationResponseSchema = v.pipe(\n v.object({\n challengeCode: v.string(),\n expiresAt: v.optional(TimestampSchema),\n verification: v.optional(v.custom<Proto.SocialVerification>(() => true)),\n /** Telegram: the `https://t.me/...` link that sends the code to the bot; empty otherwise. */\n actionUrl: v.optional(v.string(), \"\"),\n }),\n v.transform((res) => ({\n challengeCode: res.challengeCode,\n expiresAt: res.expiresAt,\n actionUrl: res.actionUrl,\n verification: transformVerification(res.verification),\n })),\n);\n\nexport type StartVerificationResponse = v.InferOutput<typeof StartVerificationResponseSchema>;\n\nexport const VerificationReadyResponseSchema = v.pipe(\n v.object({\n verification: v.optional(v.custom<Proto.SocialVerification>(() => true)),\n }),\n v.transform((res) => ({\n verification: transformVerification(res.verification),\n })),\n);\n\nexport type VerificationReadyResponse = v.InferOutput<typeof VerificationReadyResponseSchema>;\n\nexport const GetVerificationResponseSchema = v.pipe(\n v.object({\n verification: v.optional(v.custom<Proto.SocialVerification>(() => true)),\n }),\n v.transform((res) => ({\n verification: transformVerification(res.verification),\n })),\n);\n\nexport type GetVerificationResponse = v.InferOutput<typeof GetVerificationResponseSchema>;\n\n/** Only Telegram links through confirmation. */\nconst TelegramProviderInputSchema = v.pipe(\n v.literal(\"telegram\"),\n v.transform(() => Proto.SocialProvider.TELEGRAM),\n);\n\nexport const ConfirmVerificationInputSchema = v.strictObject({\n provider: TelegramProviderInputSchema,\n /** The verification's `providerUserId` in `awaiting_confirmation`: a decimal 64-bit ID. */\n providerUserId: v.pipe(\n v.string(),\n v.regex(/^[1-9]\\d{0,19}$/u, \"providerUserId must be a decimal Telegram user ID\"),\n ),\n});\n\nexport type ConfirmVerificationInput = v.InferInput<typeof ConfirmVerificationInputSchema>;\n\nexport const UnlinkSocialAccountInputSchema = v.strictObject({\n provider: ProviderInputSchema,\n});\n\nexport type UnlinkSocialAccountInput = v.InferInput<typeof UnlinkSocialAccountInputSchema>;\n"],"mappings":"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"}
1
+ {"version":3,"file":"social-verification.schemas.js","names":[],"sources":["../../../src/services/social-verification/social-verification.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { TimestampSchema } from \"../../shared/schemas.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport * as Proto from \"../../gen/auth/v1/social_verification_pb.js\";\nimport {\n SOCIAL_PROVIDER_VALUES,\n SOCIAL_VERIFICATION_ERROR_CODE_VALUES,\n SOCIAL_VERIFICATION_METHOD_VALUES,\n SOCIAL_VERIFICATION_STATUS_VALUES,\n SocialProviderCodec,\n SocialVerificationErrorCodeCodec,\n SocialVerificationMethodCodec,\n SocialVerificationStatusCodec,\n} from \"./social-verification.codecs.js\";\n\nexport {\n SOCIAL_PROVIDER_VALUES,\n SOCIAL_VERIFICATION_ERROR_CODE_VALUES,\n SOCIAL_VERIFICATION_METHOD_VALUES,\n SOCIAL_VERIFICATION_STATUS_VALUES,\n} from \"./social-verification.codecs.js\";\n\nexport const SocialProviderSchema = v.picklist(SOCIAL_PROVIDER_VALUES);\nexport type SocialProvider = v.InferInput<typeof SocialProviderSchema>;\n\nexport const SocialVerificationMethodSchema = v.picklist(SOCIAL_VERIFICATION_METHOD_VALUES);\nexport type SocialVerificationMethod = v.InferInput<typeof SocialVerificationMethodSchema>;\n\nexport const SocialVerificationErrorCodeSchema = v.picklist(SOCIAL_VERIFICATION_ERROR_CODE_VALUES);\nexport type SocialVerificationErrorCode = v.InferOutput<typeof SocialVerificationErrorCodeSchema>;\n\nexport const SocialVerificationStatusSchema = v.picklist(SOCIAL_VERIFICATION_STATUS_VALUES);\nexport type SocialVerificationStatus = v.InferOutput<typeof SocialVerificationStatusSchema>;\n\nfunction normalizeHandle(input: string): string {\n return (input ?? \"\").trim().replace(/^@+/, \"\");\n}\n\nconst TWITTER_HANDLE_PATTERN = /^[A-Za-z0-9_]{1,15}$/;\n\n/**\n * Normalizes a social verification response into the SDK verification shape.\n */\nexport function transformVerification(\n v: Proto.SocialVerification | undefined,\n): SocialVerification | undefined {\n if (!v) return undefined;\n return {\n id: v.id,\n provider: enumLabel(SocialProviderCodec.protoToOutput, v.provider),\n method: enumLabel(SocialVerificationMethodCodec.protoToOutput, v.method),\n handle: v.handle,\n providerUserId: v.providerUserId,\n displayName: v.displayName,\n challengeCode: v.challengeCode,\n status: enumLabel(SocialVerificationStatusCodec.protoToOutput, v.status),\n requestedAt: v.requestedAt,\n expiresAt: v.expiresAt,\n verifiedAt: v.verifiedAt,\n attempts: v.attempts,\n lastError: v.lastError,\n errorCode: enumLabel(SocialVerificationErrorCodeCodec.protoToOutput, v.errorCode),\n updatedAt: v.updatedAt,\n retryAfter: v.retryAfter,\n changeAvailableAt: v.changeAvailableAt,\n };\n}\n\nexport const SocialVerificationSchema = v.object({\n id: v.bigint(),\n provider: SocialProviderSchema,\n method: SocialVerificationMethodSchema,\n handle: v.string(),\n /**\n * Provider-side user ID of the linked account, empty while none is linked. A restarted\n * X or Discord verification keeps the current link, and this value, until it succeeds.\n * For Telegram in `awaiting_confirmation`, the\n * decimal user ID of the account that sent the code: pass it to `confirm` as is.\n */\n providerUserId: v.string(),\n /** Telegram only: the account's name once the code is submitted; empty otherwise. */\n displayName: v.string(),\n challengeCode: v.string(),\n status: SocialVerificationStatusSchema,\n requestedAt: v.optional(TimestampSchema),\n expiresAt: v.optional(TimestampSchema),\n verifiedAt: v.optional(TimestampSchema),\n attempts: v.number(),\n lastError: v.string(),\n updatedAt: v.optional(TimestampSchema),\n /**\n * When a new verification may succeed, after this one failed with\n * `social_account_cooldown` or `social_change_limit_reached`; absent otherwise.\n */\n retryAfter: v.optional(TimestampSchema),\n /**\n * X and Discord only: when the linked account may be changed or unlinked again, while the\n * once-per-30-days limit applies; absent when a change or unlink is allowed now. A first\n * link and re-verifying the linked X handle are not changes.\n */\n changeAvailableAt: v.optional(TimestampSchema),\n});\n\ntype SocialVerificationBase = v.InferOutput<typeof SocialVerificationSchema>;\nexport type SocialVerification = Omit<SocialVerificationBase, \"provider\" | \"method\" | \"status\"> & {\n provider: DecodedEnum<SocialProvider>;\n method: DecodedEnum<SocialVerificationMethod>;\n status: DecodedEnum<SocialVerificationStatus>;\n /**\n * Machine-readable failure for the current state; branch on this, not `lastError`.\n * `\"unspecified\"` when no typed failure applies or the code is newer than this SDK.\n * `\"social_account_already_linked\"` is non-retryable for this account: send the\n * user to the account already linked to that identity instead of restarting.\n */\n errorCode: DecodedEnum<SocialVerificationErrorCode>;\n};\n\nexport const StartVerificationInputSchema = v.pipe(\n v.variant(\"provider\", [\n v.strictObject({\n provider: v.literal(\"twitter\"),\n handle: v.pipe(\n v.string(),\n v.transform(normalizeHandle),\n v.minLength(1),\n v.regex(\n TWITTER_HANDLE_PATTERN,\n \"Twitter handle must be 1-15 letters, digits, or underscores\",\n ),\n ),\n method: v.optional(v.literal(\"profile\")),\n }),\n v.strictObject({\n provider: v.literal(\"discord\"),\n method: v.optional(v.picklist([\"channel\", \"dm\"])),\n }),\n v.strictObject({\n provider: v.literal(\"telegram\"),\n method: v.optional(v.literal(\"dm\")),\n }),\n ]),\n v.transform(({ provider, method, ...input }) => ({\n ...input,\n provider: SocialProviderCodec.inputToProto[provider],\n // METHOD_UNSPECIFIED lets the API choose Twitter's profile or Discord's channel default.\n method:\n method === undefined\n ? Proto.SocialVerificationMethod.METHOD_UNSPECIFIED\n : SocialVerificationMethodCodec.inputToProto[method],\n })),\n);\n\nexport type StartVerificationInput = v.InferInput<typeof StartVerificationInputSchema>;\n\nexport const ProviderInputSchema = v.pipe(\n SocialProviderSchema,\n v.transform((v) => SocialProviderCodec.inputToProto[v]),\n);\n\nexport const SocialProviderInputSchema = v.strictObject({\n provider: ProviderInputSchema,\n});\n\nexport type SocialProviderInput = v.InferInput<typeof SocialProviderInputSchema>;\n\nexport const StartVerificationResponseSchema = v.pipe(\n v.object({\n challengeCode: v.string(),\n expiresAt: v.optional(TimestampSchema),\n verification: v.optional(v.custom<Proto.SocialVerification>(() => true)),\n /** Telegram: the `https://t.me/...` link that sends the code to the bot; empty otherwise. */\n actionUrl: v.optional(v.string(), \"\"),\n }),\n v.transform((res) => ({\n challengeCode: res.challengeCode,\n expiresAt: res.expiresAt,\n actionUrl: res.actionUrl,\n verification: transformVerification(res.verification),\n })),\n);\n\nexport type StartVerificationResponse = v.InferOutput<typeof StartVerificationResponseSchema>;\n\nexport const VerificationReadyResponseSchema = v.pipe(\n v.object({\n verification: v.optional(v.custom<Proto.SocialVerification>(() => true)),\n }),\n v.transform((res) => ({\n verification: transformVerification(res.verification),\n })),\n);\n\nexport type VerificationReadyResponse = v.InferOutput<typeof VerificationReadyResponseSchema>;\n\nexport const GetVerificationResponseSchema = v.pipe(\n v.object({\n verification: v.optional(v.custom<Proto.SocialVerification>(() => true)),\n }),\n v.transform((res) => ({\n verification: transformVerification(res.verification),\n })),\n);\n\nexport type GetVerificationResponse = v.InferOutput<typeof GetVerificationResponseSchema>;\n\n/** Only Telegram links through confirmation. */\nconst TelegramProviderInputSchema = v.pipe(\n v.literal(\"telegram\"),\n v.transform(() => Proto.SocialProvider.TELEGRAM),\n);\n\nexport const ConfirmVerificationInputSchema = v.strictObject({\n provider: TelegramProviderInputSchema,\n /** The verification's `providerUserId` in `awaiting_confirmation`: a decimal 64-bit ID. */\n providerUserId: v.pipe(\n v.string(),\n v.regex(/^[1-9]\\d{0,19}$/u, \"providerUserId must be a decimal Telegram user ID\"),\n ),\n});\n\nexport type ConfirmVerificationInput = v.InferInput<typeof ConfirmVerificationInputSchema>;\n\nexport const UnlinkSocialAccountInputSchema = v.strictObject({\n provider: ProviderInputSchema,\n});\n\nexport type UnlinkSocialAccountInput = v.InferInput<typeof UnlinkSocialAccountInputSchema>;\n"],"mappings":"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"}
@@ -1,9 +1,10 @@
1
1
  //#region src/services/statement-exports/statement-exports.codecs.d.ts
2
- declare const STATEMENT_EXPORT_STATUS_VALUES: readonly ["queued", "processing", "ready", "failed", "expired"];
2
+ declare const STATEMENT_EXPORT_STATUS_VALUES: readonly ["queued", "processing", "ready", "failed", "expired", "canceled"];
3
3
  /**
4
4
  * `queued` waits for the account history to cover the period and for the account's other
5
5
  * export to finish, `processing` is writing the file, `ready` can be downloaded until
6
- * `expiresAt`, `failed` has no file (see `failureReason`), and `expired` had its file deleted.
6
+ * `expiresAt`, `failed` has no file (see `failureReason`), `expired` had its file deleted, and
7
+ * `canceled` was stopped with `statementExports.cancel` before it finished and has no file.
7
8
  */
8
9
  type StatementExportStatus = (typeof STATEMENT_EXPORT_STATUS_VALUES)[number];
9
10
  declare const STATEMENT_EXPORT_FAILURE_REASON_VALUES: readonly ["too_large", "unavailable"];
@@ -1 +1 @@
1
- {"version":3,"file":"statement-exports.codecs.d.ts","names":[],"sources":["../../../src/services/statement-exports/statement-exports.codecs.ts"],"mappings":";cAGa;;;;;;KAYD,gCAAgC;cAE/B;;;;;KAKD,uCAAuC"}
1
+ {"version":3,"file":"statement-exports.codecs.d.ts","names":[],"sources":["../../../src/services/statement-exports/statement-exports.codecs.ts"],"mappings":";cAGa;;;;;;;KAcD,gCAAgC;cAE/B;;;;;KAKD,uCAAuC"}
@@ -6,7 +6,8 @@ const StatementExportStatusCodec = { protoToOutput: {
6
6
  [2]: "processing",
7
7
  [3]: "ready",
8
8
  [4]: "failed",
9
- [5]: "expired"
9
+ [5]: "expired",
10
+ [6]: "canceled"
10
11
  } };
11
12
  const StatementExportFailureReasonCodec = { protoToOutput: {
12
13
  [0]: "unspecified",
@@ -1 +1 @@
1
- {"version":3,"file":"statement-exports.codecs.js","names":[],"sources":["../../../src/services/statement-exports/statement-exports.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/ledger/read/v1/statement_export_pb.js\";\nimport type { ProtoToOutput } from \"../../utils/types.js\";\n\nexport const STATEMENT_EXPORT_STATUS_VALUES = [\n \"queued\",\n \"processing\",\n \"ready\",\n \"failed\",\n \"expired\",\n] as const;\n/**\n * `queued` waits for the account history to cover the period and for the account's other\n * export to finish, `processing` is writing the file, `ready` can be downloaded until\n * `expiresAt`, `failed` has no file (see `failureReason`), and `expired` had its file deleted.\n */\nexport type StatementExportStatus = (typeof STATEMENT_EXPORT_STATUS_VALUES)[number];\n\nexport const STATEMENT_EXPORT_FAILURE_REASON_VALUES = [\"too_large\", \"unavailable\"] as const;\n/**\n * `too_large`: the period holds more than 4,000,000 ledger movements; split it into shorter\n * exports. `unavailable`: the file could not be produced in time; create a new export.\n */\nexport type StatementExportFailureReason = (typeof STATEMENT_EXPORT_FAILURE_REASON_VALUES)[number];\n\nexport const StatementExportStatusCodec = {\n protoToOutput: {\n [Proto.StatementExportStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.StatementExportStatus.QUEUED]: \"queued\",\n [Proto.StatementExportStatus.PROCESSING]: \"processing\",\n [Proto.StatementExportStatus.READY]: \"ready\",\n [Proto.StatementExportStatus.FAILED]: \"failed\",\n [Proto.StatementExportStatus.EXPIRED]: \"expired\",\n } satisfies ProtoToOutput<Proto.StatementExportStatus, StatementExportStatus>,\n} as const;\n\nexport const StatementExportFailureReasonCodec = {\n protoToOutput: {\n [Proto.StatementExportFailureReason.UNSPECIFIED]: \"unspecified\",\n [Proto.StatementExportFailureReason.TOO_LARGE]: \"too_large\",\n [Proto.StatementExportFailureReason.UNAVAILABLE]: \"unavailable\",\n } satisfies ProtoToOutput<Proto.StatementExportFailureReason, StatementExportFailureReason>,\n} as const;\n"],"mappings":";;AAwBA,MAAa,6BAA6B,EACtC,eAAe;EACgC,IAAA;EACL,IAAA;EACI,IAAA;EACL,IAAA;EACC,IAAA;EACC,IAAA;AAC3C,EACJ;AAEA,MAAa,oCAAoC,EAC7C,eAAe;EACuC,IAAA;EACF,IAAA;EACE,IAAA;AACtD,EACJ"}
1
+ {"version":3,"file":"statement-exports.codecs.js","names":[],"sources":["../../../src/services/statement-exports/statement-exports.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/ledger/read/v1/statement_export_pb.js\";\nimport type { ProtoToOutput } from \"../../utils/types.js\";\n\nexport const STATEMENT_EXPORT_STATUS_VALUES = [\n \"queued\",\n \"processing\",\n \"ready\",\n \"failed\",\n \"expired\",\n \"canceled\",\n] as const;\n/**\n * `queued` waits for the account history to cover the period and for the account's other\n * export to finish, `processing` is writing the file, `ready` can be downloaded until\n * `expiresAt`, `failed` has no file (see `failureReason`), `expired` had its file deleted, and\n * `canceled` was stopped with `statementExports.cancel` before it finished and has no file.\n */\nexport type StatementExportStatus = (typeof STATEMENT_EXPORT_STATUS_VALUES)[number];\n\nexport const STATEMENT_EXPORT_FAILURE_REASON_VALUES = [\"too_large\", \"unavailable\"] as const;\n/**\n * `too_large`: the period holds more than 4,000,000 ledger movements; split it into shorter\n * exports. `unavailable`: the file could not be produced in time; create a new export.\n */\nexport type StatementExportFailureReason = (typeof STATEMENT_EXPORT_FAILURE_REASON_VALUES)[number];\n\nexport const StatementExportStatusCodec = {\n protoToOutput: {\n [Proto.StatementExportStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.StatementExportStatus.QUEUED]: \"queued\",\n [Proto.StatementExportStatus.PROCESSING]: \"processing\",\n [Proto.StatementExportStatus.READY]: \"ready\",\n [Proto.StatementExportStatus.FAILED]: \"failed\",\n [Proto.StatementExportStatus.EXPIRED]: \"expired\",\n [Proto.StatementExportStatus.CANCELED]: \"canceled\",\n } satisfies ProtoToOutput<Proto.StatementExportStatus, StatementExportStatus>,\n} as const;\n\nexport const StatementExportFailureReasonCodec = {\n protoToOutput: {\n [Proto.StatementExportFailureReason.UNSPECIFIED]: \"unspecified\",\n [Proto.StatementExportFailureReason.TOO_LARGE]: \"too_large\",\n [Proto.StatementExportFailureReason.UNAVAILABLE]: \"unavailable\",\n } satisfies ProtoToOutput<Proto.StatementExportFailureReason, StatementExportFailureReason>,\n} as const;\n"],"mappings":";;AA0BA,MAAa,6BAA6B,EACtC,eAAe;EACgC,IAAA;EACL,IAAA;EACI,IAAA;EACL,IAAA;EACC,IAAA;EACC,IAAA;EACC,IAAA;AAC5C,EACJ;AAEA,MAAa,oCAAoC,EAC7C,eAAe;EACuC,IAAA;EACF,IAAA;EACE,IAAA;AACtD,EACJ"}
@@ -1,17 +1,17 @@
1
1
  import { AuthApiTransports } from "../../shared/transports.js";
2
2
  import { PolyesterRequestOptions } from "../../shared/request-options.js";
3
3
  import { SubaccountResolver } from "../subaccount-resolver.js";
4
- import { CreateStatementExportInput, GetStatementExportInput, ListStatementExportsInput, ListStatementExportsResult, StatementExport } from "./statement-exports.schemas.js";
4
+ import { CancelStatementExportInput, CreateStatementExportInput, GetStatementExportDownloadUrlInput, GetStatementExportInput, ListStatementExportsInput, ListStatementExportsResult, StatementExport, StatementExportDownloadUrl } from "./statement-exports.schemas.js";
5
5
  //#region src/services/statement-exports/statement-exports.d.ts
6
6
  /**
7
- * Produces whole-period account statements in the background, one CSV file each: the same
8
- * rows, account, asset and period choices as `balances.exportStatement`, concatenated. API keys
9
- * need `read-statements`. A root account has at most 5 exports queued or processing, each
10
- * account produces one at a time, and a ready file can be downloaded for 7 days.
7
+ * Produces whole-period account statements in the background, one RFC 4180 CSV file each: one
8
+ * account, optionally one asset, for a period of at most 366 days. API keys need
9
+ * `read-statements`. A root account has at most 5 exports queued or processing, each account
10
+ * produces one at a time, and a ready file can be downloaded for 7 days.
11
11
  *
12
- * The file itself is REST only: an authenticated `GET /v1/statements/exports/{exportId}/file`
13
- * returns `text/csv` and supports `Range`; `?redirect=true` answers a 307 to a URL valid for 60
14
- * seconds. An expired export's file answers 410.
12
+ * Download a ready file in a browser from `getDownloadUrl`. Servers and CLIs can instead send
13
+ * an authenticated `GET /v1/statements/exports/{exportId}/file`, which returns `text/csv` and
14
+ * supports `Range`; an expired export's file answers 410.
15
15
  */
16
16
  declare class StatementExportsService {
17
17
  #private;
@@ -24,9 +24,24 @@ declare class StatementExportsService {
24
24
  * with the same request.
25
25
  */
26
26
  create(input: CreateStatementExportInput, options?: PolyesterRequestOptions): Promise<StatementExport>;
27
- /** Returns one export; poll it until `status` is `ready`, `failed` or `expired`. */
27
+ /** Returns one export; poll it until `status` is `ready`, `failed`, `expired` or `canceled`. */
28
28
  get(input: GetStatementExportInput, options?: PolyesterRequestOptions): Promise<StatementExport>;
29
- /** Lists the resolved account's exports, newest first. */
29
+ /**
30
+ * Returns a link valid for 60 seconds that downloads a ready export's file without
31
+ * credentials, for a browser to save; each call returns a new link. Never log `url`. Throws
32
+ * `PreconditionFailedError` before the file is ready (`STATEMENT_EXPORT_NOT_READY`) and for
33
+ * a `failed`, `canceled` or `expired` export, or one with less than 5 seconds left
34
+ * (`STATEMENT_EXPORT_FAILED`, `STATEMENT_EXPORT_CANCELED`, `STATEMENT_EXPORT_EXPIRED`).
35
+ */
36
+ getDownloadUrl(input: GetStatementExportDownloadUrlInput, options?: PolyesterRequestOptions): Promise<StatementExportDownloadUrl>;
37
+ /**
38
+ * Cancels a queued or processing export and returns it `canceled`: it frees its place under
39
+ * the root account's 5, the account's next queued export can start, and any partial file is
40
+ * deleted. Canceling a `canceled` export returns it as it is; a finished one throws
41
+ * `PreconditionFailedError` (`STATEMENT_EXPORT_NOT_CANCELABLE`).
42
+ */
43
+ cancel(input: CancelStatementExportInput, options?: PolyesterRequestOptions): Promise<StatementExport>;
44
+ /** Lists the resolved account's exports, newest first, with the root's in-progress count. */
30
45
  list(input?: ListStatementExportsInput, options?: PolyesterRequestOptions): Promise<ListStatementExportsResult>;
31
46
  }
32
47
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"statement-exports.d.ts","names":[],"sources":["../../../src/services/statement-exports/statement-exports.ts"],"mappings":";;;;;;;;;;;;;;;cAgCa;;EAIG,YAAA,YAAY,mBAAmB,WAAW;;;;;;;;EAYhD,OACF,OAAO,4BACP,UAAU,0BACX,QAAQ;;EAaL,IACF,OAAO,yBACP,UAAU,0BACX,QAAQ;;EAUL,KACF,QAAO,2BACP,UAAU,0BACX,QAAQ"}
1
+ {"version":3,"file":"statement-exports.d.ts","names":[],"sources":["../../../src/services/statement-exports/statement-exports.ts"],"mappings":";;;;;;;;;;;;;;;cAoCa;;EAIG,YAAA,YAAY,mBAAmB,WAAW;;;;;;;;EAYhD,OACF,OAAO,4BACP,UAAU,0BACX,QAAQ;;EAaL,IACF,OAAO,yBACP,UAAU,0BACX,QAAQ;;;;;;;;EAgBL,eACF,OAAO,oCACP,UAAU,0BACX,QAAQ;;;;;;;EAeL,OACF,OAAO,4BACP,UAAU,0BACX,QAAQ;;EAUL,KACF,QAAO,2BACP,UAAU,0BACX,QAAQ"}
@@ -2,18 +2,18 @@ import { parse } from "../../shared/validation.js";
2
2
  import { toConnectCallOptions } from "../../shared/request-options.js";
3
3
  import { resolveAccountScopedInput } from "../subaccount-resolver.js";
4
4
  import { StatementExportService } from "../../gen/ledger/read/v1/statement_export_pb.js";
5
- import { CreateStatementExportInputSchema, GetStatementExportInputSchema, ListStatementExportsInputSchema, ListStatementExportsResultSchema, StatementExportSchema } from "./statement-exports.schemas.js";
5
+ import { CreateStatementExportInputSchema, GetStatementExportInputSchema, ListStatementExportsInputSchema, ListStatementExportsResultSchema, StatementExportDownloadUrlSchema, StatementExportSchema } from "./statement-exports.schemas.js";
6
6
  import { createClient } from "@connectrpc/connect";
7
7
  //#region src/services/statement-exports/statement-exports.ts
8
8
  /**
9
- * Produces whole-period account statements in the background, one CSV file each: the same
10
- * rows, account, asset and period choices as `balances.exportStatement`, concatenated. API keys
11
- * need `read-statements`. A root account has at most 5 exports queued or processing, each
12
- * account produces one at a time, and a ready file can be downloaded for 7 days.
9
+ * Produces whole-period account statements in the background, one RFC 4180 CSV file each: one
10
+ * account, optionally one asset, for a period of at most 366 days. API keys need
11
+ * `read-statements`. A root account has at most 5 exports queued or processing, each account
12
+ * produces one at a time, and a ready file can be downloaded for 7 days.
13
13
  *
14
- * The file itself is REST only: an authenticated `GET /v1/statements/exports/{exportId}/file`
15
- * returns `text/csv` and supports `Range`; `?redirect=true` answers a 307 to a URL valid for 60
16
- * seconds. An expired export's file answers 410.
14
+ * Download a ready file in a browser from `getDownloadUrl`. Servers and CLIs can instead send
15
+ * an authenticated `GET /v1/statements/exports/{exportId}/file`, which returns `text/csv` and
16
+ * supports `Range`; an expired export's file answers 410.
17
17
  */
18
18
  var StatementExportsService = class {
19
19
  #client;
@@ -34,13 +34,36 @@ var StatementExportsService = class {
34
34
  const response = await this.#client.createStatementExport(request, toConnectCallOptions(options));
35
35
  return parse(StatementExportSchema, response.export);
36
36
  }
37
- /** Returns one export; poll it until `status` is `ready`, `failed` or `expired`. */
37
+ /** Returns one export; poll it until `status` is `ready`, `failed`, `expired` or `canceled`. */
38
38
  async get(input, options) {
39
39
  const request = parse(GetStatementExportInputSchema, input);
40
40
  const response = await this.#client.getStatementExport(request, toConnectCallOptions(options));
41
41
  return parse(StatementExportSchema, response.export);
42
42
  }
43
- /** Lists the resolved account's exports, newest first. */
43
+ /**
44
+ * Returns a link valid for 60 seconds that downloads a ready export's file without
45
+ * credentials, for a browser to save; each call returns a new link. Never log `url`. Throws
46
+ * `PreconditionFailedError` before the file is ready (`STATEMENT_EXPORT_NOT_READY`) and for
47
+ * a `failed`, `canceled` or `expired` export, or one with less than 5 seconds left
48
+ * (`STATEMENT_EXPORT_FAILED`, `STATEMENT_EXPORT_CANCELED`, `STATEMENT_EXPORT_EXPIRED`).
49
+ */
50
+ async getDownloadUrl(input, options) {
51
+ const request = parse(GetStatementExportInputSchema, input);
52
+ const response = await this.#client.getStatementExportDownloadUrl(request, toConnectCallOptions(options));
53
+ return parse(StatementExportDownloadUrlSchema, response);
54
+ }
55
+ /**
56
+ * Cancels a queued or processing export and returns it `canceled`: it frees its place under
57
+ * the root account's 5, the account's next queued export can start, and any partial file is
58
+ * deleted. Canceling a `canceled` export returns it as it is; a finished one throws
59
+ * `PreconditionFailedError` (`STATEMENT_EXPORT_NOT_CANCELABLE`).
60
+ */
61
+ async cancel(input, options) {
62
+ const request = parse(GetStatementExportInputSchema, input);
63
+ const response = await this.#client.cancelStatementExport(request, toConnectCallOptions(options));
64
+ return parse(StatementExportSchema, response.export);
65
+ }
66
+ /** Lists the resolved account's exports, newest first, with the root's in-progress count. */
44
67
  async list(input = {}, options) {
45
68
  const request = parse(ListStatementExportsInputSchema, resolveAccountScopedInput(input, this.#resolver));
46
69
  const response = await this.#client.listStatementExports(request, toConnectCallOptions(options));
@@ -1 +1 @@
1
- {"version":3,"file":"statement-exports.js","names":["#client","Proto.StatementExportService","#resolver"],"sources":["../../../src/services/statement-exports/statement-exports.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/ledger/read/v1/statement_export_pb.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n CreateStatementExportInputSchema,\n GetStatementExportInputSchema,\n ListStatementExportsInputSchema,\n ListStatementExportsResultSchema,\n StatementExportSchema,\n type CreateStatementExportInput,\n type GetStatementExportInput,\n type ListStatementExportsInput,\n type ListStatementExportsResult,\n type StatementExport,\n} from \"./statement-exports.schemas.js\";\n\n/**\n * Produces whole-period account statements in the background, one CSV file each: the same\n * rows, account, asset and period choices as `balances.exportStatement`, concatenated. API keys\n * need `read-statements`. A root account has at most 5 exports queued or processing, each\n * account produces one at a time, and a ready file can be downloaded for 7 days.\n *\n * The file itself is REST only: an authenticated `GET /v1/statements/exports/{exportId}/file`\n * returns `text/csv` and supports `Range`; `?redirect=true` answers a 307 to a URL valid for 60\n * seconds. An expired export's file answers 410.\n */\nexport class StatementExportsService {\n #client: Client<typeof Proto.StatementExportService>;\n #resolver?: SubaccountResolver;\n\n constructor(transports: AuthApiTransports, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.StatementExportService, transports.authApi);\n this.#resolver = resolver;\n }\n\n /**\n * Creates an export of the resolved account's statement, or returns the existing one for the\n * same `idempotencyKey`. Throws `PreconditionFailedError` when the key was used with other\n * fields (`IDEMPOTENCY_KEY_REUSED`) or the root account already has 5 exports queued or\n * processing (`STATEMENT_EXPORT_LIMIT_REACHED`). A `ServiceUnavailableError` can be retried\n * with the same request.\n */\n async create(\n input: CreateStatementExportInput,\n options?: PolyesterRequestOptions,\n ): Promise<StatementExport> {\n const request = parse(\n CreateStatementExportInputSchema,\n resolveAccountScopedInput(input, this.#resolver),\n );\n const response = await this.#client.createStatementExport(\n request,\n toConnectCallOptions(options),\n );\n return parse(StatementExportSchema, response.export);\n }\n\n /** Returns one export; poll it until `status` is `ready`, `failed` or `expired`. */\n async get(\n input: GetStatementExportInput,\n options?: PolyesterRequestOptions,\n ): Promise<StatementExport> {\n const request = parse(GetStatementExportInputSchema, input);\n const response = await this.#client.getStatementExport(\n request,\n toConnectCallOptions(options),\n );\n return parse(StatementExportSchema, response.export);\n }\n\n /** Lists the resolved account's exports, newest first. */\n async list(\n input: ListStatementExportsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListStatementExportsResult> {\n const request = parse(\n ListStatementExportsInputSchema,\n resolveAccountScopedInput(input, this.#resolver),\n );\n const response = await this.#client.listStatementExports(\n request,\n toConnectCallOptions(options),\n );\n return parse(ListStatementExportsResultSchema, response);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,IAAa,0BAAb,MAAqC;CACjC;CACA;CAEA,YAAY,YAA+B,UAA+B;EACtE,KAAKA,UAAU,aAAaC,wBAA8B,WAAW,OAAO;EAC5E,KAAKC,YAAY;CACrB;;;;;;;;CASA,MAAM,OACF,OACA,SACwB;EACxB,MAAM,UAAU,MACZ,kCACA,0BAA0B,OAAO,KAAKA,SAAS,CACnD;EACA,MAAM,WAAW,MAAM,KAAKF,QAAQ,sBAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,uBAAuB,SAAS,MAAM;CACvD;;CAGA,MAAM,IACF,OACA,SACwB;EACxB,MAAM,UAAU,MAAM,+BAA+B,KAAK;EAC1D,MAAM,WAAW,MAAM,KAAKA,QAAQ,mBAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,uBAAuB,SAAS,MAAM;CACvD;;CAGA,MAAM,KACF,QAAmC,CAAC,GACpC,SACmC;EACnC,MAAM,UAAU,MACZ,iCACA,0BAA0B,OAAO,KAAKE,SAAS,CACnD;EACA,MAAM,WAAW,MAAM,KAAKF,QAAQ,qBAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,kCAAkC,QAAQ;CAC3D;AACJ"}
1
+ {"version":3,"file":"statement-exports.js","names":["#client","Proto.StatementExportService","#resolver"],"sources":["../../../src/services/statement-exports/statement-exports.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/ledger/read/v1/statement_export_pb.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n CreateStatementExportInputSchema,\n GetStatementExportInputSchema,\n ListStatementExportsInputSchema,\n ListStatementExportsResultSchema,\n StatementExportDownloadUrlSchema,\n StatementExportSchema,\n type CancelStatementExportInput,\n type CreateStatementExportInput,\n type GetStatementExportDownloadUrlInput,\n type GetStatementExportInput,\n type ListStatementExportsInput,\n type ListStatementExportsResult,\n type StatementExport,\n type StatementExportDownloadUrl,\n} from \"./statement-exports.schemas.js\";\n\n/**\n * Produces whole-period account statements in the background, one RFC 4180 CSV file each: one\n * account, optionally one asset, for a period of at most 366 days. API keys need\n * `read-statements`. A root account has at most 5 exports queued or processing, each account\n * produces one at a time, and a ready file can be downloaded for 7 days.\n *\n * Download a ready file in a browser from `getDownloadUrl`. Servers and CLIs can instead send\n * an authenticated `GET /v1/statements/exports/{exportId}/file`, which returns `text/csv` and\n * supports `Range`; an expired export's file answers 410.\n */\nexport class StatementExportsService {\n #client: Client<typeof Proto.StatementExportService>;\n #resolver?: SubaccountResolver;\n\n constructor(transports: AuthApiTransports, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.StatementExportService, transports.authApi);\n this.#resolver = resolver;\n }\n\n /**\n * Creates an export of the resolved account's statement, or returns the existing one for the\n * same `idempotencyKey`. Throws `PreconditionFailedError` when the key was used with other\n * fields (`IDEMPOTENCY_KEY_REUSED`) or the root account already has 5 exports queued or\n * processing (`STATEMENT_EXPORT_LIMIT_REACHED`). A `ServiceUnavailableError` can be retried\n * with the same request.\n */\n async create(\n input: CreateStatementExportInput,\n options?: PolyesterRequestOptions,\n ): Promise<StatementExport> {\n const request = parse(\n CreateStatementExportInputSchema,\n resolveAccountScopedInput(input, this.#resolver),\n );\n const response = await this.#client.createStatementExport(\n request,\n toConnectCallOptions(options),\n );\n return parse(StatementExportSchema, response.export);\n }\n\n /** Returns one export; poll it until `status` is `ready`, `failed`, `expired` or `canceled`. */\n async get(\n input: GetStatementExportInput,\n options?: PolyesterRequestOptions,\n ): Promise<StatementExport> {\n const request = parse(GetStatementExportInputSchema, input);\n const response = await this.#client.getStatementExport(\n request,\n toConnectCallOptions(options),\n );\n return parse(StatementExportSchema, response.export);\n }\n\n /**\n * Returns a link valid for 60 seconds that downloads a ready export's file without\n * credentials, for a browser to save; each call returns a new link. Never log `url`. Throws\n * `PreconditionFailedError` before the file is ready (`STATEMENT_EXPORT_NOT_READY`) and for\n * a `failed`, `canceled` or `expired` export, or one with less than 5 seconds left\n * (`STATEMENT_EXPORT_FAILED`, `STATEMENT_EXPORT_CANCELED`, `STATEMENT_EXPORT_EXPIRED`).\n */\n async getDownloadUrl(\n input: GetStatementExportDownloadUrlInput,\n options?: PolyesterRequestOptions,\n ): Promise<StatementExportDownloadUrl> {\n const request = parse(GetStatementExportInputSchema, input);\n const response = await this.#client.getStatementExportDownloadUrl(\n request,\n toConnectCallOptions(options),\n );\n return parse(StatementExportDownloadUrlSchema, response);\n }\n\n /**\n * Cancels a queued or processing export and returns it `canceled`: it frees its place under\n * the root account's 5, the account's next queued export can start, and any partial file is\n * deleted. Canceling a `canceled` export returns it as it is; a finished one throws\n * `PreconditionFailedError` (`STATEMENT_EXPORT_NOT_CANCELABLE`).\n */\n async cancel(\n input: CancelStatementExportInput,\n options?: PolyesterRequestOptions,\n ): Promise<StatementExport> {\n const request = parse(GetStatementExportInputSchema, input);\n const response = await this.#client.cancelStatementExport(\n request,\n toConnectCallOptions(options),\n );\n return parse(StatementExportSchema, response.export);\n }\n\n /** Lists the resolved account's exports, newest first, with the root's in-progress count. */\n async list(\n input: ListStatementExportsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListStatementExportsResult> {\n const request = parse(\n ListStatementExportsInputSchema,\n resolveAccountScopedInput(input, this.#resolver),\n );\n const response = await this.#client.listStatementExports(\n request,\n toConnectCallOptions(options),\n );\n return parse(ListStatementExportsResultSchema, response);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,IAAa,0BAAb,MAAqC;CACjC;CACA;CAEA,YAAY,YAA+B,UAA+B;EACtE,KAAKA,UAAU,aAAaC,wBAA8B,WAAW,OAAO;EAC5E,KAAKC,YAAY;CACrB;;;;;;;;CASA,MAAM,OACF,OACA,SACwB;EACxB,MAAM,UAAU,MACZ,kCACA,0BAA0B,OAAO,KAAKA,SAAS,CACnD;EACA,MAAM,WAAW,MAAM,KAAKF,QAAQ,sBAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,uBAAuB,SAAS,MAAM;CACvD;;CAGA,MAAM,IACF,OACA,SACwB;EACxB,MAAM,UAAU,MAAM,+BAA+B,KAAK;EAC1D,MAAM,WAAW,MAAM,KAAKA,QAAQ,mBAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,uBAAuB,SAAS,MAAM;CACvD;;;;;;;;CASA,MAAM,eACF,OACA,SACmC;EACnC,MAAM,UAAU,MAAM,+BAA+B,KAAK;EAC1D,MAAM,WAAW,MAAM,KAAKA,QAAQ,8BAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,kCAAkC,QAAQ;CAC3D;;;;;;;CAQA,MAAM,OACF,OACA,SACwB;EACxB,MAAM,UAAU,MAAM,+BAA+B,KAAK;EAC1D,MAAM,WAAW,MAAM,KAAKA,QAAQ,sBAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,uBAAuB,SAAS,MAAM;CACvD;;CAGA,MAAM,KACF,QAAmC,CAAC,GACpC,SACmC;EACnC,MAAM,UAAU,MACZ,iCACA,0BAA0B,OAAO,KAAKE,SAAS,CACnD;EACA,MAAM,WAAW,MAAM,KAAKF,QAAQ,qBAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,kCAAkC,QAAQ;CAC3D;AACJ"}
@@ -4,8 +4,9 @@ declare const CreateStatementExportInputSchema: v.SchemaWithPipe<readonly [v.Str
4
4
  /** Period start, inclusive, in epoch milliseconds (UTC); after the epoch and not in the future. */
5
5
  readonly startTime: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, "startTime must be after 1970-01-01T00:00:00Z.">]>;
6
6
  /**
7
- * Period end, exclusive, in epoch milliseconds (UTC), by 2262-04-11T23:47:16Z. A period
8
- * still open when the export is created ends then; see `completeThrough`.
7
+ * Period end, exclusive, in epoch milliseconds (UTC), by 2262-04-11T23:47:16Z and at most
8
+ * 366 days after `startTime`. A period still open when the export is created ends then;
9
+ * see `completeThrough`.
9
10
  */
10
11
  readonly endTime: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MaxValueAction<number, number, "endTime must be by 2262-04-11T23:47:16Z.">]>;
11
12
  /** Ledger asset ID to cover only that asset; omit or `0` for every asset. */
@@ -47,6 +48,8 @@ declare const GetStatementExportInputSchema: v.StrictObjectSchema<{
47
48
  readonly exportId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>;
48
49
  }, undefined>;
49
50
  type GetStatementExportInput = v.InferInput<typeof GetStatementExportInputSchema>;
51
+ type CancelStatementExportInput = GetStatementExportInput;
52
+ type GetStatementExportDownloadUrlInput = GetStatementExportInput;
50
53
  declare const ListStatementExportsInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
51
54
  /** Page size, at most 100; 0 or omitted uses the server default of 20. */
52
55
  readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100, undefined>]>, 0>;
@@ -87,7 +90,7 @@ declare const StatementExportSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
87
90
  }, number>]>;
88
91
  readonly assetId: v.NumberSchema<undefined>;
89
92
  readonly idempotencyKey: v.StringSchema<undefined>;
90
- readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "ready" | "processing" | "queued" | "failed" | "expired">]>;
93
+ readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "processing" | "queued" | "ready" | "expired" | "canceled">]>;
91
94
  readonly completeThrough: v.SchemaWithPipe<readonly [v.ObjectSchema<{
92
95
  readonly seconds: v.BigintSchema<undefined>;
93
96
  readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
@@ -126,7 +129,7 @@ declare const StatementExportSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
126
129
  endTime: number;
127
130
  assetId: number;
128
131
  idempotencyKey: string;
129
- status: "unspecified" | "ready" | "processing" | "queued" | "failed" | "expired";
132
+ status: "unspecified" | "failed" | "processing" | "queued" | "ready" | "expired" | "canceled";
130
133
  completeThrough: number;
131
134
  movements: string;
132
135
  bytes: string;
@@ -145,7 +148,7 @@ declare const StatementExportSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
145
148
  /** Ledger asset ID the statement is limited to; 0 for every asset. */
146
149
  assetId: number;
147
150
  idempotencyKey: string;
148
- status: "unspecified" | "ready" | "processing" | "queued" | "failed" | "expired";
151
+ status: "unspecified" | "failed" | "processing" | "queued" | "ready" | "expired" | "canceled";
149
152
  /**
150
153
  * End of what the file covers, exclusive: the earlier of `endTime` and when the export
151
154
  * was created. Every movement recorded before both is in the file.
@@ -184,7 +187,7 @@ declare const ListStatementExportsResultSchema: v.ObjectSchema<{
184
187
  }, number>]>;
185
188
  readonly assetId: v.NumberSchema<undefined>;
186
189
  readonly idempotencyKey: v.StringSchema<undefined>;
187
- readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "ready" | "processing" | "queued" | "failed" | "expired">]>;
190
+ readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "processing" | "queued" | "ready" | "expired" | "canceled">]>;
188
191
  readonly completeThrough: v.SchemaWithPipe<readonly [v.ObjectSchema<{
189
192
  readonly seconds: v.BigintSchema<undefined>;
190
193
  readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
@@ -223,7 +226,7 @@ declare const ListStatementExportsResultSchema: v.ObjectSchema<{
223
226
  endTime: number;
224
227
  assetId: number;
225
228
  idempotencyKey: string;
226
- status: "unspecified" | "ready" | "processing" | "queued" | "failed" | "expired";
229
+ status: "unspecified" | "failed" | "processing" | "queued" | "ready" | "expired" | "canceled";
227
230
  completeThrough: number;
228
231
  movements: string;
229
232
  bytes: string;
@@ -242,7 +245,7 @@ declare const ListStatementExportsResultSchema: v.ObjectSchema<{
242
245
  /** Ledger asset ID the statement is limited to; 0 for every asset. */
243
246
  assetId: number;
244
247
  idempotencyKey: string;
245
- status: "unspecified" | "ready" | "processing" | "queued" | "failed" | "expired";
248
+ status: "unspecified" | "failed" | "processing" | "queued" | "ready" | "expired" | "canceled";
246
249
  /**
247
250
  * End of what the file covers, exclusive: the earlier of `endTime` and when the export
248
251
  * was created. Every movement recorded before both is in the file.
@@ -261,9 +264,34 @@ declare const ListStatementExportsResultSchema: v.ObjectSchema<{
261
264
  failureReason: "unspecified" | "unavailable" | "too_large";
262
265
  }>]>, undefined>;
263
266
  readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
267
+ /**
268
+ * Exports queued or processing across the whole root account, subaccounts included,
269
+ * whichever account the list selects.
270
+ */
271
+ readonly inProgressExports: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
272
+ /** Most exports the root account may have queued or processing; `create` refuses at it. */
273
+ readonly maxInProgressExports: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
264
274
  }, undefined>;
265
275
  /** One page of exports, newest first; an empty `nextPageToken` means no more. */
266
276
  type ListStatementExportsResult = v.InferOutput<typeof ListStatementExportsResultSchema>;
277
+ declare const StatementExportDownloadUrlSchema: v.ObjectSchema<{
278
+ /**
279
+ * Link to the file that needs no credentials, for a browser to save. Anyone who holds it can
280
+ * download the file until `expiresAt`: do not share, store or log it.
281
+ */
282
+ readonly url: v.StringSchema<undefined>;
283
+ /** When the link stops working, epoch ms: 60 seconds after signing or when the file expires. */
284
+ readonly expiresAt: v.SchemaWithPipe<readonly [v.ObjectSchema<{
285
+ readonly seconds: v.BigintSchema<undefined>;
286
+ readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
287
+ }, undefined>, v.TransformAction<{
288
+ seconds: bigint;
289
+ nanos: number;
290
+ }, number>]>;
291
+ /** Name the download saves the file as, `statement-<exportId>.csv`. */
292
+ readonly filename: v.StringSchema<undefined>;
293
+ }, undefined>;
294
+ type StatementExportDownloadUrl = v.InferOutput<typeof StatementExportDownloadUrlSchema>;
267
295
  //#endregion
268
- export { CreateStatementExportInput, CreateStatementExportInputSchema, GetStatementExportInput, GetStatementExportInputSchema, ListStatementExportsInput, ListStatementExportsInputSchema, ListStatementExportsResult, ListStatementExportsResultSchema, StatementExport, StatementExportSchema };
296
+ export { CancelStatementExportInput, CreateStatementExportInput, CreateStatementExportInputSchema, GetStatementExportDownloadUrlInput, GetStatementExportInput, GetStatementExportInputSchema, ListStatementExportsInput, ListStatementExportsInputSchema, ListStatementExportsResult, ListStatementExportsResultSchema, StatementExport, StatementExportDownloadUrl, StatementExportDownloadUrlSchema, StatementExportSchema };
269
297
  //# sourceMappingURL=statement-exports.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"statement-exports.schemas.d.ts","names":[],"sources":["../../../src/services/statement-exports/statement-exports.schemas.ts"],"mappings":";;cAgCa,kCAAgC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCjC,6BAA6B,EAAE,kBAAkB;cAEhD,+BAA6B,EAAA;;;KAI9B,0BAA0B,EAAE,kBAAkB;cAE7C,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;KAchC,4BAA4B,EAAE,kBAAkB;;cAG/C,uBAAqB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgDtB,kBAAkB,EAAE,mBAAmB;cAEtC,kCAAgC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMjC,6BAA6B,EAAE,mBAAmB"}
1
+ {"version":3,"file":"statement-exports.schemas.d.ts","names":[],"sources":["../../../src/services/statement-exports/statement-exports.schemas.ts"],"mappings":";;cAgCa,kCAAgC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCjC,6BAA6B,EAAE,kBAAkB;cAEhD,+BAA6B,EAAA;;;KAI9B,0BAA0B,EAAE,kBAAkB;KAC9C,6BAA6B;KAC7B,qCAAqC;cAEpC,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;KAchC,4BAA4B,EAAE,kBAAkB;;cAG/C,uBAAqB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgDtB,kBAAkB,EAAE,mBAAmB;cAEtC,kCAAgC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAajC,6BAA6B,EAAE,mBAAmB;cAEjD,kCAAgC,EAAA;;;;;;;;;;;;;;;;;KAYjC,6BAA6B,EAAE,mBAAmB"}
@@ -1,8 +1,8 @@
1
1
  import { PROTOBUF_UINT32_MAX } from "../../shared/wire-bounds.js";
2
2
  import { BigIntStringSchema, OptionalPublicIdSchema, OptionalTimestampMsSchema, PublicIdSchema, TimestampMsSchema, idInputSchema } from "../../shared/schemas.js";
3
3
  import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
4
- import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
5
4
  import { msToTimestamp } from "../../utils/timestamp.js";
5
+ import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
6
6
  import { StatementExportFailureReasonCodec, StatementExportStatusCodec } from "./statement-exports.codecs.js";
7
7
  import * as v from "valibot";
8
8
  //#region src/services/statement-exports/statement-exports.schemas.ts
@@ -14,8 +14,9 @@ const CreateStatementExportInputSchema = v.pipe(v.strictObject({
14
14
  /** Period start, inclusive, in epoch milliseconds (UTC); after the epoch and not in the future. */
15
15
  startTime: v.pipe(v.number(), v.integer(), v.minValue(1, "startTime must be after 1970-01-01T00:00:00Z.")),
16
16
  /**
17
- * Period end, exclusive, in epoch milliseconds (UTC), by 2262-04-11T23:47:16Z. A period
18
- * still open when the export is created ends then; see `completeThrough`.
17
+ * Period end, exclusive, in epoch milliseconds (UTC), by 2262-04-11T23:47:16Z and at most
18
+ * 366 days after `startTime`. A period still open when the export is created ends then;
19
+ * see `completeThrough`.
19
20
  */
20
21
  endTime: v.pipe(v.number(), v.integer(), v.maxValue(LATEST_END_TIME_MS, "endTime must be by 2262-04-11T23:47:16Z.")),
21
22
  /** Ledger asset ID to cover only that asset; omit or `0` for every asset. */
@@ -90,9 +91,27 @@ const StatementExportSchema = v.pipe(v.object({
90
91
  })));
91
92
  const ListStatementExportsResultSchema = v.object({
92
93
  exports: v.array(StatementExportSchema),
93
- nextPageToken: v.optional(v.string(), "")
94
+ nextPageToken: v.optional(v.string(), ""),
95
+ /**
96
+ * Exports queued or processing across the whole root account, subaccounts included,
97
+ * whichever account the list selects.
98
+ */
99
+ inProgressExports: v.optional(v.number(), 0),
100
+ /** Most exports the root account may have queued or processing; `create` refuses at it. */
101
+ maxInProgressExports: v.optional(v.number(), 0)
102
+ });
103
+ const StatementExportDownloadUrlSchema = v.object({
104
+ /**
105
+ * Link to the file that needs no credentials, for a browser to save. Anyone who holds it can
106
+ * download the file until `expiresAt`: do not share, store or log it.
107
+ */
108
+ url: v.string(),
109
+ /** When the link stops working, epoch ms: 60 seconds after signing or when the file expires. */
110
+ expiresAt: TimestampMsSchema,
111
+ /** Name the download saves the file as, `statement-<exportId>.csv`. */
112
+ filename: v.string()
94
113
  });
95
114
  //#endregion
96
- export { CreateStatementExportInputSchema, GetStatementExportInputSchema, ListStatementExportsInputSchema, ListStatementExportsResultSchema, StatementExportSchema };
115
+ export { CreateStatementExportInputSchema, GetStatementExportInputSchema, ListStatementExportsInputSchema, ListStatementExportsResultSchema, StatementExportDownloadUrlSchema, StatementExportSchema };
97
116
 
98
117
  //# sourceMappingURL=statement-exports.schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"statement-exports.schemas.js","names":[],"sources":["../../../src/services/statement-exports/statement-exports.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n BigIntStringSchema,\n OptionalPublicIdSchema,\n OptionalTimestampMsSchema,\n PublicIdSchema,\n TimestampMsSchema,\n idInputSchema,\n} from \"../../shared/schemas.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport { msToTimestamp } from \"../../utils/timestamp.js\";\nimport {\n StatementExportFailureReasonCodec,\n StatementExportStatusCodec,\n} from \"./statement-exports.codecs.js\";\n\n/** Latest period end the server accepts: 2262-04-11T23:47:16Z, the int64-nanosecond limit. */\nconst LATEST_END_TIME_MS = Date.UTC(2262, 3, 11, 23, 47, 16);\n\nconst IdempotencyKeySchema = v.pipe(\n v.string(),\n v.regex(\n /^[A-Za-z0-9._:-]{1,64}$/u,\n \"idempotencyKey must be 1 to 64 letters, digits, '.', '_', ':' or '-'.\",\n ),\n);\n\nexport const CreateStatementExportInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** Period start, inclusive, in epoch milliseconds (UTC); after the epoch and not in the future. */\n startTime: v.pipe(\n v.number(),\n v.integer(),\n v.minValue(1, \"startTime must be after 1970-01-01T00:00:00Z.\"),\n ),\n /**\n * Period end, exclusive, in epoch milliseconds (UTC), by 2262-04-11T23:47:16Z. A period\n * still open when the export is created ends then; see `completeThrough`.\n */\n endTime: v.pipe(\n v.number(),\n v.integer(),\n v.maxValue(LATEST_END_TIME_MS, \"endTime must be by 2262-04-11T23:47:16Z.\"),\n ),\n /** Ledger asset ID to cover only that asset; omit or `0` for every asset. */\n assetId: v.optional(\n v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(PROTOBUF_UINT32_MAX)),\n 0,\n ),\n /**\n * 1 to 64 letters, digits, `.`, `_`, `:` or `-`, unique per root account. Repeating the\n * request with the same key returns the same export; the same key with other fields\n * throws `PreconditionFailedError` (`IDEMPOTENCY_KEY_REUSED`).\n */\n idempotencyKey: IdempotencyKeySchema,\n }),\n v.check(({ startTime, endTime }) => endTime > startTime, \"endTime must be after startTime.\"),\n v.transform(({ account, startTime, endTime, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n startTime: msToTimestamp(startTime),\n endTime: msToTimestamp(endTime),\n })),\n);\n\nexport type CreateStatementExportInput = v.InferInput<typeof CreateStatementExportInputSchema>;\n\nexport const GetStatementExportInputSchema = v.strictObject({\n exportId: idInputSchema(\"exportId\"),\n});\n\nexport type GetStatementExportInput = v.InferInput<typeof GetStatementExportInputSchema>;\n\nexport const ListStatementExportsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** Page size, at most 100; 0 or omitted uses the server default of 20. */\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100)), 0),\n /** Previous `nextPageToken`; reuse only with the same account. */\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ListStatementExportsInput = v.InferInput<typeof ListStatementExportsInputSchema>;\n\n/** A whole-period statement file being produced, ready, failed or expired. Times are epoch ms. */\nexport const StatementExportSchema = v.pipe(\n v.object({\n exportId: PublicIdSchema,\n subaccountId: OptionalPublicIdSchema,\n startTime: TimestampMsSchema,\n endTime: TimestampMsSchema,\n assetId: v.number(),\n idempotencyKey: v.string(),\n status: enumLabelSchema(StatementExportStatusCodec.protoToOutput),\n completeThrough: TimestampMsSchema,\n movements: BigIntStringSchema,\n bytes: BigIntStringSchema,\n createdAt: TimestampMsSchema,\n readyAt: OptionalTimestampMsSchema,\n expiresAt: OptionalTimestampMsSchema,\n failureReason: enumLabelSchema(StatementExportFailureReasonCodec.protoToOutput),\n }),\n v.transform((statement) => ({\n exportId: statement.exportId,\n /** Public subaccount ID the statement covers; null for the root account. */\n subaccountId: statement.subaccountId ?? null,\n /** Period start, inclusive. */\n startTime: statement.startTime,\n /** Requested period end, exclusive. */\n endTime: statement.endTime,\n /** Ledger asset ID the statement is limited to; 0 for every asset. */\n assetId: statement.assetId,\n idempotencyKey: statement.idempotencyKey,\n status: statement.status,\n /**\n * End of what the file covers, exclusive: the earlier of `endTime` and when the export\n * was created. Every movement recorded before both is in the file.\n */\n completeThrough: statement.completeThrough,\n /** Ledger movements written so far, as a uint64 decimal string; the total once ready. */\n movements: statement.movements,\n /** Bytes written so far, as a uint64 decimal string; the file size once ready. */\n bytes: statement.bytes,\n createdAt: statement.createdAt,\n /** When the file became ready; null before. */\n readyAt: statement.readyAt ?? null,\n /** When a ready file expires, 7 days after `readyAt`; null before ready. */\n expiresAt: statement.expiresAt ?? null,\n /** Why the export failed; `unspecified` unless `status` is `failed`. */\n failureReason: statement.failureReason,\n })),\n);\n\nexport type StatementExport = v.InferOutput<typeof StatementExportSchema>;\n\nexport const ListStatementExportsResultSchema = v.object({\n exports: v.array(StatementExportSchema),\n nextPageToken: v.optional(v.string(), \"\"),\n});\n\n/** One page of exports, newest first; an empty `nextPageToken` means no more. */\nexport type ListStatementExportsResult = v.InferOutput<typeof ListStatementExportsResultSchema>;\n"],"mappings":";;;;;;;;;AAsBA,MAAM,qBAAqB,KAAK,IAAI,MAAM,GAAG,IAAI,IAAI,IAAI,EAAE;AAE3D,MAAM,uBAAuB,EAAE,KAC3B,EAAE,OAAO,GACT,EAAE,MACE,4BACA,uEACJ,CACJ;AAEA,MAAa,mCAAmC,EAAE,KAC9C,EAAE,aAAa;CACX,GAAG;;CAEH,WAAW,EAAE,KACT,EAAE,OAAO,GACT,EAAE,QAAQ,GACV,EAAE,SAAS,GAAG,+CAA+C,CACjE;;;;;CAKA,SAAS,EAAE,KACP,EAAE,OAAO,GACT,EAAE,QAAQ,GACV,EAAE,SAAS,oBAAoB,0CAA0C,CAC7E;;CAEA,SAAS,EAAE,SACP,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,mBAAmB,CAAC,GAC9E,CACJ;;;;;;CAMA,gBAAgB;AACpB,CAAC,GACD,EAAE,OAAO,EAAE,WAAW,cAAc,UAAU,WAAW,kCAAkC,GAC3F,EAAE,WAAW,EAAE,SAAS,WAAW,SAAS,GAAG,aAAa;CACxD,GAAG;CACH,cAAc,2BAA2B,OAAO;CAChD,WAAW,cAAc,SAAS;CAClC,SAAS,cAAc,OAAO;AAClC,EAAE,CACN;AAIA,MAAa,gCAAgC,EAAE,aAAa,EACxD,UAAU,cAAc,UAAU,EACtC,CAAC;AAID,MAAa,kCAAkC,EAAE,KAC7C,EAAE,aAAa;CACX,GAAG;;CAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,GAAG,CAAC;;CAEpF,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;AAC1D,CAAC,GACD,EAAE,WAAW,EAAE,SAAS,GAAG,aAAa;CACpC,GAAG;CACH,cAAc,2BAA2B,OAAO;AACpD,EAAE,CACN;;AAKA,MAAa,wBAAwB,EAAE,KACnC,EAAE,OAAO;CACL,UAAU;CACV,cAAc;CACd,WAAW;CACX,SAAS;CACT,SAAS,EAAE,OAAO;CAClB,gBAAgB,EAAE,OAAO;CACzB,QAAQ,gBAAgB,2BAA2B,aAAa;CAChE,iBAAiB;CACjB,WAAW;CACX,OAAO;CACP,WAAW;CACX,SAAS;CACT,WAAW;CACX,eAAe,gBAAgB,kCAAkC,aAAa;AAClF,CAAC,GACD,EAAE,WAAW,eAAe;CACxB,UAAU,UAAU;;CAEpB,cAAc,UAAU,gBAAgB;;CAExC,WAAW,UAAU;;CAErB,SAAS,UAAU;;CAEnB,SAAS,UAAU;CACnB,gBAAgB,UAAU;CAC1B,QAAQ,UAAU;;;;;CAKlB,iBAAiB,UAAU;;CAE3B,WAAW,UAAU;;CAErB,OAAO,UAAU;CACjB,WAAW,UAAU;;CAErB,SAAS,UAAU,WAAW;;CAE9B,WAAW,UAAU,aAAa;;CAElC,eAAe,UAAU;AAC7B,EAAE,CACN;AAIA,MAAa,mCAAmC,EAAE,OAAO;CACrD,SAAS,EAAE,MAAM,qBAAqB;CACtC,eAAe,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;AAC5C,CAAC"}
1
+ {"version":3,"file":"statement-exports.schemas.js","names":[],"sources":["../../../src/services/statement-exports/statement-exports.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n BigIntStringSchema,\n OptionalPublicIdSchema,\n OptionalTimestampMsSchema,\n PublicIdSchema,\n TimestampMsSchema,\n idInputSchema,\n} from \"../../shared/schemas.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport { msToTimestamp } from \"../../utils/timestamp.js\";\nimport {\n StatementExportFailureReasonCodec,\n StatementExportStatusCodec,\n} from \"./statement-exports.codecs.js\";\n\n/** Latest period end the server accepts: 2262-04-11T23:47:16Z, the int64-nanosecond limit. */\nconst LATEST_END_TIME_MS = Date.UTC(2262, 3, 11, 23, 47, 16);\n\nconst IdempotencyKeySchema = v.pipe(\n v.string(),\n v.regex(\n /^[A-Za-z0-9._:-]{1,64}$/u,\n \"idempotencyKey must be 1 to 64 letters, digits, '.', '_', ':' or '-'.\",\n ),\n);\n\nexport const CreateStatementExportInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** Period start, inclusive, in epoch milliseconds (UTC); after the epoch and not in the future. */\n startTime: v.pipe(\n v.number(),\n v.integer(),\n v.minValue(1, \"startTime must be after 1970-01-01T00:00:00Z.\"),\n ),\n /**\n * Period end, exclusive, in epoch milliseconds (UTC), by 2262-04-11T23:47:16Z and at most\n * 366 days after `startTime`. A period still open when the export is created ends then;\n * see `completeThrough`.\n */\n endTime: v.pipe(\n v.number(),\n v.integer(),\n v.maxValue(LATEST_END_TIME_MS, \"endTime must be by 2262-04-11T23:47:16Z.\"),\n ),\n /** Ledger asset ID to cover only that asset; omit or `0` for every asset. */\n assetId: v.optional(\n v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(PROTOBUF_UINT32_MAX)),\n 0,\n ),\n /**\n * 1 to 64 letters, digits, `.`, `_`, `:` or `-`, unique per root account. Repeating the\n * request with the same key returns the same export; the same key with other fields\n * throws `PreconditionFailedError` (`IDEMPOTENCY_KEY_REUSED`).\n */\n idempotencyKey: IdempotencyKeySchema,\n }),\n v.check(({ startTime, endTime }) => endTime > startTime, \"endTime must be after startTime.\"),\n v.transform(({ account, startTime, endTime, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n startTime: msToTimestamp(startTime),\n endTime: msToTimestamp(endTime),\n })),\n);\n\nexport type CreateStatementExportInput = v.InferInput<typeof CreateStatementExportInputSchema>;\n\nexport const GetStatementExportInputSchema = v.strictObject({\n exportId: idInputSchema(\"exportId\"),\n});\n\nexport type GetStatementExportInput = v.InferInput<typeof GetStatementExportInputSchema>;\nexport type CancelStatementExportInput = GetStatementExportInput;\nexport type GetStatementExportDownloadUrlInput = GetStatementExportInput;\n\nexport const ListStatementExportsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** Page size, at most 100; 0 or omitted uses the server default of 20. */\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100)), 0),\n /** Previous `nextPageToken`; reuse only with the same account. */\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ListStatementExportsInput = v.InferInput<typeof ListStatementExportsInputSchema>;\n\n/** A whole-period statement file being produced, ready, failed or expired. Times are epoch ms. */\nexport const StatementExportSchema = v.pipe(\n v.object({\n exportId: PublicIdSchema,\n subaccountId: OptionalPublicIdSchema,\n startTime: TimestampMsSchema,\n endTime: TimestampMsSchema,\n assetId: v.number(),\n idempotencyKey: v.string(),\n status: enumLabelSchema(StatementExportStatusCodec.protoToOutput),\n completeThrough: TimestampMsSchema,\n movements: BigIntStringSchema,\n bytes: BigIntStringSchema,\n createdAt: TimestampMsSchema,\n readyAt: OptionalTimestampMsSchema,\n expiresAt: OptionalTimestampMsSchema,\n failureReason: enumLabelSchema(StatementExportFailureReasonCodec.protoToOutput),\n }),\n v.transform((statement) => ({\n exportId: statement.exportId,\n /** Public subaccount ID the statement covers; null for the root account. */\n subaccountId: statement.subaccountId ?? null,\n /** Period start, inclusive. */\n startTime: statement.startTime,\n /** Requested period end, exclusive. */\n endTime: statement.endTime,\n /** Ledger asset ID the statement is limited to; 0 for every asset. */\n assetId: statement.assetId,\n idempotencyKey: statement.idempotencyKey,\n status: statement.status,\n /**\n * End of what the file covers, exclusive: the earlier of `endTime` and when the export\n * was created. Every movement recorded before both is in the file.\n */\n completeThrough: statement.completeThrough,\n /** Ledger movements written so far, as a uint64 decimal string; the total once ready. */\n movements: statement.movements,\n /** Bytes written so far, as a uint64 decimal string; the file size once ready. */\n bytes: statement.bytes,\n createdAt: statement.createdAt,\n /** When the file became ready; null before. */\n readyAt: statement.readyAt ?? null,\n /** When a ready file expires, 7 days after `readyAt`; null before ready. */\n expiresAt: statement.expiresAt ?? null,\n /** Why the export failed; `unspecified` unless `status` is `failed`. */\n failureReason: statement.failureReason,\n })),\n);\n\nexport type StatementExport = v.InferOutput<typeof StatementExportSchema>;\n\nexport const ListStatementExportsResultSchema = v.object({\n exports: v.array(StatementExportSchema),\n nextPageToken: v.optional(v.string(), \"\"),\n /**\n * Exports queued or processing across the whole root account, subaccounts included,\n * whichever account the list selects.\n */\n inProgressExports: v.optional(v.number(), 0),\n /** Most exports the root account may have queued or processing; `create` refuses at it. */\n maxInProgressExports: v.optional(v.number(), 0),\n});\n\n/** One page of exports, newest first; an empty `nextPageToken` means no more. */\nexport type ListStatementExportsResult = v.InferOutput<typeof ListStatementExportsResultSchema>;\n\nexport const StatementExportDownloadUrlSchema = v.object({\n /**\n * Link to the file that needs no credentials, for a browser to save. Anyone who holds it can\n * download the file until `expiresAt`: do not share, store or log it.\n */\n url: v.string(),\n /** When the link stops working, epoch ms: 60 seconds after signing or when the file expires. */\n expiresAt: TimestampMsSchema,\n /** Name the download saves the file as, `statement-<exportId>.csv`. */\n filename: v.string(),\n});\n\nexport type StatementExportDownloadUrl = v.InferOutput<typeof StatementExportDownloadUrlSchema>;\n"],"mappings":";;;;;;;;;AAsBA,MAAM,qBAAqB,KAAK,IAAI,MAAM,GAAG,IAAI,IAAI,IAAI,EAAE;AAE3D,MAAM,uBAAuB,EAAE,KAC3B,EAAE,OAAO,GACT,EAAE,MACE,4BACA,uEACJ,CACJ;AAEA,MAAa,mCAAmC,EAAE,KAC9C,EAAE,aAAa;CACX,GAAG;;CAEH,WAAW,EAAE,KACT,EAAE,OAAO,GACT,EAAE,QAAQ,GACV,EAAE,SAAS,GAAG,+CAA+C,CACjE;;;;;;CAMA,SAAS,EAAE,KACP,EAAE,OAAO,GACT,EAAE,QAAQ,GACV,EAAE,SAAS,oBAAoB,0CAA0C,CAC7E;;CAEA,SAAS,EAAE,SACP,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,mBAAmB,CAAC,GAC9E,CACJ;;;;;;CAMA,gBAAgB;AACpB,CAAC,GACD,EAAE,OAAO,EAAE,WAAW,cAAc,UAAU,WAAW,kCAAkC,GAC3F,EAAE,WAAW,EAAE,SAAS,WAAW,SAAS,GAAG,aAAa;CACxD,GAAG;CACH,cAAc,2BAA2B,OAAO;CAChD,WAAW,cAAc,SAAS;CAClC,SAAS,cAAc,OAAO;AAClC,EAAE,CACN;AAIA,MAAa,gCAAgC,EAAE,aAAa,EACxD,UAAU,cAAc,UAAU,EACtC,CAAC;AAMD,MAAa,kCAAkC,EAAE,KAC7C,EAAE,aAAa;CACX,GAAG;;CAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,GAAG,CAAC;;CAEpF,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;AAC1D,CAAC,GACD,EAAE,WAAW,EAAE,SAAS,GAAG,aAAa;CACpC,GAAG;CACH,cAAc,2BAA2B,OAAO;AACpD,EAAE,CACN;;AAKA,MAAa,wBAAwB,EAAE,KACnC,EAAE,OAAO;CACL,UAAU;CACV,cAAc;CACd,WAAW;CACX,SAAS;CACT,SAAS,EAAE,OAAO;CAClB,gBAAgB,EAAE,OAAO;CACzB,QAAQ,gBAAgB,2BAA2B,aAAa;CAChE,iBAAiB;CACjB,WAAW;CACX,OAAO;CACP,WAAW;CACX,SAAS;CACT,WAAW;CACX,eAAe,gBAAgB,kCAAkC,aAAa;AAClF,CAAC,GACD,EAAE,WAAW,eAAe;CACxB,UAAU,UAAU;;CAEpB,cAAc,UAAU,gBAAgB;;CAExC,WAAW,UAAU;;CAErB,SAAS,UAAU;;CAEnB,SAAS,UAAU;CACnB,gBAAgB,UAAU;CAC1B,QAAQ,UAAU;;;;;CAKlB,iBAAiB,UAAU;;CAE3B,WAAW,UAAU;;CAErB,OAAO,UAAU;CACjB,WAAW,UAAU;;CAErB,SAAS,UAAU,WAAW;;CAE9B,WAAW,UAAU,aAAa;;CAElC,eAAe,UAAU;AAC7B,EAAE,CACN;AAIA,MAAa,mCAAmC,EAAE,OAAO;CACrD,SAAS,EAAE,MAAM,qBAAqB;CACtC,eAAe,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;;;;;CAKxC,mBAAmB,EAAE,SAAS,EAAE,OAAO,GAAG,CAAC;;CAE3C,sBAAsB,EAAE,SAAS,EAAE,OAAO,GAAG,CAAC;AAClD,CAAC;AAKD,MAAa,mCAAmC,EAAE,OAAO;;;;;CAKrD,KAAK,EAAE,OAAO;;CAEd,WAAW;;CAEX,UAAU,EAAE,OAAO;AACvB,CAAC"}
@@ -1,3 +1,3 @@
1
- import { CreateStatementExportInput, GetStatementExportInput, ListStatementExportsInput, ListStatementExportsResult, StatementExport } from "./statement-exports.schemas.js";
1
+ import { CancelStatementExportInput, CreateStatementExportInput, GetStatementExportDownloadUrlInput, GetStatementExportInput, ListStatementExportsInput, ListStatementExportsResult, StatementExport, StatementExportDownloadUrl } from "./statement-exports.schemas.js";
2
2
  import { StatementExportFailureReason, StatementExportStatus } from "./statement-exports.codecs.js";
3
- export type { CreateStatementExportInput, GetStatementExportInput, ListStatementExportsInput, ListStatementExportsResult, StatementExport, StatementExportFailureReason, StatementExportStatus };
3
+ export type { CancelStatementExportInput, CreateStatementExportInput, GetStatementExportDownloadUrlInput, GetStatementExportInput, ListStatementExportsInput, ListStatementExportsResult, StatementExport, StatementExportDownloadUrl, StatementExportFailureReason, StatementExportStatus };