@polyester/sdk 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +63 -17
  3. package/dist/_virtual/_rolldown/runtime.js +15 -1
  4. package/dist/account-signer/types.d.ts.map +1 -1
  5. package/dist/account-signer/types.js +6 -3
  6. package/dist/account-signer/types.js.map +1 -1
  7. package/dist/browser-client.d.ts +4 -2
  8. package/dist/browser-client.d.ts.map +1 -1
  9. package/dist/browser-client.js +3 -4
  10. package/dist/browser-client.js.map +1 -1
  11. package/dist/catalogs/client-catalog.d.ts.map +1 -1
  12. package/dist/catalogs/client-catalog.js +11 -4
  13. package/dist/catalogs/client-catalog.js.map +1 -1
  14. package/dist/catalogs/index.js +1 -1
  15. package/dist/catalogs/readers.d.ts.map +1 -1
  16. package/dist/catalogs/readers.js +3 -1
  17. package/dist/catalogs/readers.js.map +1 -1
  18. package/dist/catalogs/snapshot-validation.js +132 -0
  19. package/dist/catalogs/snapshot-validation.js.map +1 -0
  20. package/dist/catalogs/snapshot.d.ts.map +1 -1
  21. package/dist/catalogs/snapshot.js +16 -7
  22. package/dist/catalogs/snapshot.js.map +1 -1
  23. package/dist/catalogs/zipper-supply.d.ts.map +1 -1
  24. package/dist/catalogs/zipper-supply.js +10 -7
  25. package/dist/catalogs/zipper-supply.js.map +1 -1
  26. package/dist/core-client.d.ts +24 -17
  27. package/dist/core-client.d.ts.map +1 -1
  28. package/dist/core-client.js +21 -3
  29. package/dist/core-client.js.map +1 -1
  30. package/dist/environment.d.ts.map +1 -1
  31. package/dist/environment.js +32 -1
  32. package/dist/environment.js.map +1 -1
  33. package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts +7 -0
  34. package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts.map +1 -1
  35. package/dist/gen/marketoverview/v1/marketoverview_pb.js +1 -1
  36. package/dist/gen/marketoverview/v1/marketoverview_pb.js.map +1 -1
  37. package/dist/index.js +3 -3
  38. package/dist/realtime/client.js +13 -2
  39. package/dist/realtime/client.js.map +1 -1
  40. package/dist/realtime/snapshot-then-stream.js +1 -1
  41. package/dist/realtime/snapshot-then-stream.js.map +1 -1
  42. package/dist/realtime/types.d.ts +2 -0
  43. package/dist/realtime/types.d.ts.map +1 -1
  44. package/dist/server-client.d.ts +17 -8
  45. package/dist/server-client.d.ts.map +1 -1
  46. package/dist/server-client.js +8 -11
  47. package/dist/server-client.js.map +1 -1
  48. package/dist/services/accounts/accounts.js +3 -3
  49. package/dist/services/accounts/accounts.js.map +1 -1
  50. package/dist/services/accounts/accounts.schemas.d.ts +13 -13
  51. package/dist/services/accounts/accounts.schemas.d.ts.map +1 -1
  52. package/dist/services/accounts/accounts.schemas.js +11 -11
  53. package/dist/services/accounts/accounts.schemas.js.map +1 -1
  54. package/dist/services/address-book/address-book.js +28 -28
  55. package/dist/services/address-book/address-book.js.map +1 -1
  56. package/dist/services/address-book/address-book.schemas.d.ts +751 -751
  57. package/dist/services/address-book/address-book.schemas.d.ts.map +1 -1
  58. package/dist/services/address-book/address-book.schemas.js +160 -160
  59. package/dist/services/address-book/address-book.schemas.js.map +1 -1
  60. package/dist/services/api-keys/api-keys.d.ts +6 -6
  61. package/dist/services/api-keys/api-keys.d.ts.map +1 -1
  62. package/dist/services/api-keys/api-keys.js +12 -12
  63. package/dist/services/api-keys/api-keys.js.map +1 -1
  64. package/dist/services/api-keys/api-keys.schemas.d.ts +62 -62
  65. package/dist/services/api-keys/api-keys.schemas.d.ts.map +1 -1
  66. package/dist/services/api-keys/api-keys.schemas.js +34 -34
  67. package/dist/services/api-keys/api-keys.schemas.js.map +1 -1
  68. package/dist/services/auth/auth.d.ts +46 -40
  69. package/dist/services/auth/auth.d.ts.map +1 -1
  70. package/dist/services/auth/auth.js +28 -25
  71. package/dist/services/auth/auth.js.map +1 -1
  72. package/dist/services/auth/profile/profile.d.ts +2 -2
  73. package/dist/services/auth/profile/profile.d.ts.map +1 -1
  74. package/dist/services/auth/profile/profile.js +7 -7
  75. package/dist/services/auth/profile/profile.js.map +1 -1
  76. package/dist/services/auth/profile/profile.schemas.d.ts +41 -41
  77. package/dist/services/auth/profile/profile.schemas.d.ts.map +1 -1
  78. package/dist/services/auth/profile/profile.schemas.js +27 -27
  79. package/dist/services/auth/profile/profile.schemas.js.map +1 -1
  80. package/dist/services/auth/session.d.ts +1 -1
  81. package/dist/services/auth/session.d.ts.map +1 -1
  82. package/dist/services/auth/session.js +6 -2
  83. package/dist/services/auth/session.js.map +1 -1
  84. package/dist/services/auth/session.schemas.js +17 -17
  85. package/dist/services/auth/session.schemas.js.map +1 -1
  86. package/dist/services/auth/session.types.d.ts +3 -2
  87. package/dist/services/auth/session.types.d.ts.map +1 -1
  88. package/dist/services/balances/balances.d.ts +1 -1
  89. package/dist/services/balances/balances.js +9 -9
  90. package/dist/services/balances/balances.js.map +1 -1
  91. package/dist/services/balances/balances.schemas.d.ts +95 -95
  92. package/dist/services/balances/balances.schemas.d.ts.map +1 -1
  93. package/dist/services/balances/balances.schemas.js +61 -61
  94. package/dist/services/balances/balances.schemas.js.map +1 -1
  95. package/dist/services/candles/candles.js +12 -12
  96. package/dist/services/candles/candles.js.map +1 -1
  97. package/dist/services/candles/candles.schemas.d.ts +64 -64
  98. package/dist/services/candles/candles.schemas.d.ts.map +1 -1
  99. package/dist/services/candles/candles.schemas.js +47 -48
  100. package/dist/services/candles/candles.schemas.js.map +1 -1
  101. package/dist/services/chain-analytics/chain-analytics.js +7 -7
  102. package/dist/services/chain-analytics/chain-analytics.js.map +1 -1
  103. package/dist/services/chain-analytics/chain-analytics.schemas.d.ts +68 -68
  104. package/dist/services/chain-analytics/chain-analytics.schemas.d.ts.map +1 -1
  105. package/dist/services/chain-analytics/chain-analytics.schemas.js +29 -29
  106. package/dist/services/chain-analytics/chain-analytics.schemas.js.map +1 -1
  107. package/dist/services/deposit/deposit.js +5 -5
  108. package/dist/services/deposit/deposit.js.map +1 -1
  109. package/dist/services/deposit/deposit.schemas.d.ts +17 -17
  110. package/dist/services/deposit/deposit.schemas.d.ts.map +1 -1
  111. package/dist/services/deposit/deposit.schemas.js +11 -11
  112. package/dist/services/deposit/deposit.schemas.js.map +1 -1
  113. package/dist/services/guard-signer/guard-signer.js +13 -13
  114. package/dist/services/guard-signer/guard-signer.js.map +1 -1
  115. package/dist/services/guard-signer/guard-signer.schemas.d.ts +75 -75
  116. package/dist/services/guard-signer/guard-signer.schemas.d.ts.map +1 -1
  117. package/dist/services/guard-signer/guard-signer.schemas.js +42 -42
  118. package/dist/services/guard-signer/guard-signer.schemas.js.map +1 -1
  119. package/dist/services/heatmap/heatmap.js +9 -9
  120. package/dist/services/heatmap/heatmap.js.map +1 -1
  121. package/dist/services/heatmap/heatmap.schemas.d.ts +141 -141
  122. package/dist/services/heatmap/heatmap.schemas.d.ts.map +1 -1
  123. package/dist/services/heatmap/heatmap.schemas.js +47 -47
  124. package/dist/services/heatmap/heatmap.schemas.js.map +1 -1
  125. package/dist/services/internal-transfers/internal-transfers.js +3 -3
  126. package/dist/services/internal-transfers/internal-transfers.js.map +1 -1
  127. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +53 -53
  128. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts.map +1 -1
  129. package/dist/services/internal-transfers/internal-transfers.schemas.js +27 -27
  130. package/dist/services/internal-transfers/internal-transfers.schemas.js.map +1 -1
  131. package/dist/services/lifecycle/lifecycle.js +10 -10
  132. package/dist/services/lifecycle/lifecycle.js.map +1 -1
  133. package/dist/services/lifecycle/lifecycle.schemas.d.ts +614 -614
  134. package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
  135. package/dist/services/lifecycle/lifecycle.schemas.js +146 -146
  136. package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
  137. package/dist/services/market-data/market-data.js +6 -6
  138. package/dist/services/market-data/market-data.js.map +1 -1
  139. package/dist/services/market-data/market-data.schemas.d.ts +20 -20
  140. package/dist/services/market-data/market-data.schemas.d.ts.map +1 -1
  141. package/dist/services/market-data/market-data.schemas.js +51 -55
  142. package/dist/services/market-data/market-data.schemas.js.map +1 -1
  143. package/dist/services/market-overview/market-overview.d.ts +1 -1
  144. package/dist/services/market-overview/market-overview.js +5 -5
  145. package/dist/services/market-overview/market-overview.js.map +1 -1
  146. package/dist/services/market-overview/market-overview.schemas.d.ts +39 -36
  147. package/dist/services/market-overview/market-overview.schemas.d.ts.map +1 -1
  148. package/dist/services/market-overview/market-overview.schemas.js +34 -32
  149. package/dist/services/market-overview/market-overview.schemas.js.map +1 -1
  150. package/dist/services/mfa/mfa.js +27 -27
  151. package/dist/services/mfa/mfa.js.map +1 -1
  152. package/dist/services/mfa/mfa.schemas.d.ts +206 -206
  153. package/dist/services/mfa/mfa.schemas.d.ts.map +1 -1
  154. package/dist/services/mfa/mfa.schemas.js +83 -83
  155. package/dist/services/mfa/mfa.schemas.js.map +1 -1
  156. package/dist/services/orderbook/orderbook.d.ts +2 -2
  157. package/dist/services/orderbook/orderbook.d.ts.map +1 -1
  158. package/dist/services/orderbook/orderbook.js +5 -5
  159. package/dist/services/orderbook/orderbook.js.map +1 -1
  160. package/dist/services/orderbook/orderbook.schemas.d.ts +23 -23
  161. package/dist/services/orderbook/orderbook.schemas.d.ts.map +1 -1
  162. package/dist/services/orderbook/orderbook.schemas.js +15 -15
  163. package/dist/services/orderbook/orderbook.schemas.js.map +1 -1
  164. package/dist/services/orders/order-errors.schemas.d.ts +18 -18
  165. package/dist/services/orders/order-errors.schemas.d.ts.map +1 -1
  166. package/dist/services/orders/order-errors.schemas.js +8 -8
  167. package/dist/services/orders/order-errors.schemas.js.map +1 -1
  168. package/dist/services/orders/orders-batch.schemas.d.ts +492 -492
  169. package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
  170. package/dist/services/orders/orders-batch.schemas.js +118 -118
  171. package/dist/services/orders/orders-batch.schemas.js.map +1 -1
  172. package/dist/services/orders/orders-identifiers.schemas.js +5 -5
  173. package/dist/services/orders/orders-identifiers.schemas.js.map +1 -1
  174. package/dist/services/orders/orders-input.schemas.d.ts +657 -648
  175. package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
  176. package/dist/services/orders/orders-input.schemas.js +100 -96
  177. package/dist/services/orders/orders-input.schemas.js.map +1 -1
  178. package/dist/services/orders/orders-modify.schemas.d.ts +370 -351
  179. package/dist/services/orders/orders-modify.schemas.d.ts.map +1 -1
  180. package/dist/services/orders/orders-modify.schemas.js +48 -44
  181. package/dist/services/orders/orders-modify.schemas.js.map +1 -1
  182. package/dist/services/orders/orders-output.schemas.d.ts +179 -179
  183. package/dist/services/orders/orders-output.schemas.d.ts.map +1 -1
  184. package/dist/services/orders/orders-output.schemas.js +49 -49
  185. package/dist/services/orders/orders-output.schemas.js.map +1 -1
  186. package/dist/services/orders/orders-risk.schemas.d.ts +226 -226
  187. package/dist/services/orders/orders-risk.schemas.d.ts.map +1 -1
  188. package/dist/services/orders/orders-risk.schemas.js +69 -69
  189. package/dist/services/orders/orders-risk.schemas.js.map +1 -1
  190. package/dist/services/orders/orders.d.ts +8 -8
  191. package/dist/services/orders/orders.d.ts.map +1 -1
  192. package/dist/services/orders/orders.js +44 -32
  193. package/dist/services/orders/orders.js.map +1 -1
  194. package/dist/services/policies/api-key-policies/api-key-policies.d.ts +6 -6
  195. package/dist/services/policies/api-key-policies/api-key-policies.d.ts.map +1 -1
  196. package/dist/services/policies/api-key-policies/api-key-policies.js +11 -11
  197. package/dist/services/policies/api-key-policies/api-key-policies.js.map +1 -1
  198. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +105 -105
  199. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts.map +1 -1
  200. package/dist/services/policies/api-key-policies/api-key-policies.schemas.js +49 -49
  201. package/dist/services/policies/api-key-policies/api-key-policies.schemas.js.map +1 -1
  202. package/dist/services/policies/shared.d.ts +5 -5
  203. package/dist/services/policies/shared.d.ts.map +1 -1
  204. package/dist/services/policies/shared.js +10 -10
  205. package/dist/services/policies/shared.js.map +1 -1
  206. package/dist/services/policies/subaccount-policies/subaccount-policies.d.ts +6 -6
  207. package/dist/services/policies/subaccount-policies/subaccount-policies.d.ts.map +1 -1
  208. package/dist/services/policies/subaccount-policies/subaccount-policies.js +13 -13
  209. package/dist/services/policies/subaccount-policies/subaccount-policies.js.map +1 -1
  210. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +124 -124
  211. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts.map +1 -1
  212. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js +75 -75
  213. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js.map +1 -1
  214. package/dist/services/shared.js +11 -11
  215. package/dist/services/shared.js.map +1 -1
  216. package/dist/services/social-verification/social-verification.d.ts +3 -3
  217. package/dist/services/social-verification/social-verification.d.ts.map +1 -1
  218. package/dist/services/social-verification/social-verification.js +7 -7
  219. package/dist/services/social-verification/social-verification.js.map +1 -1
  220. package/dist/services/social-verification/social-verification.schemas.d.ts +54 -54
  221. package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
  222. package/dist/services/social-verification/social-verification.schemas.js +28 -28
  223. package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
  224. package/dist/services/subaccount-resolver.js +5 -3
  225. package/dist/services/subaccount-resolver.js.map +1 -1
  226. package/dist/services/subaccounts/subaccounts.d.ts +15 -15
  227. package/dist/services/subaccounts/subaccounts.d.ts.map +1 -1
  228. package/dist/services/subaccounts/subaccounts.js +35 -35
  229. package/dist/services/subaccounts/subaccounts.js.map +1 -1
  230. package/dist/services/subaccounts/subaccounts.schemas.d.ts +137 -137
  231. package/dist/services/subaccounts/subaccounts.schemas.d.ts.map +1 -1
  232. package/dist/services/subaccounts/subaccounts.schemas.js +72 -72
  233. package/dist/services/subaccounts/subaccounts.schemas.js.map +1 -1
  234. package/dist/services/trades/trades.d.ts +2 -2
  235. package/dist/services/trades/trades.d.ts.map +1 -1
  236. package/dist/services/trades/trades.js +5 -5
  237. package/dist/services/trades/trades.js.map +1 -1
  238. package/dist/services/trades/trades.schemas.d.ts +31 -31
  239. package/dist/services/trades/trades.schemas.d.ts.map +1 -1
  240. package/dist/services/trades/trades.schemas.js +24 -24
  241. package/dist/services/trades/trades.schemas.js.map +1 -1
  242. package/dist/services/trading-withdraws/trading-withdraws.js +8 -8
  243. package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
  244. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts +45 -45
  245. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts.map +1 -1
  246. package/dist/services/trading-withdraws/trading-withdraws.schemas.js +36 -36
  247. package/dist/services/trading-withdraws/trading-withdraws.schemas.js.map +1 -1
  248. package/dist/services/transfers/transfers.d.ts +1 -1
  249. package/dist/services/transfers/transfers.d.ts.map +1 -1
  250. package/dist/services/transfers/transfers.js +5 -5
  251. package/dist/services/transfers/transfers.js.map +1 -1
  252. package/dist/services/transfers/transfers.schemas.d.ts +42 -42
  253. package/dist/services/transfers/transfers.schemas.d.ts.map +1 -1
  254. package/dist/services/transfers/transfers.schemas.js +30 -30
  255. package/dist/services/transfers/transfers.schemas.js.map +1 -1
  256. package/dist/services/triggers/trigger-child-order.schemas.js +23 -23
  257. package/dist/services/triggers/trigger-child-order.schemas.js.map +1 -1
  258. package/dist/services/triggers/trigger-input.schemas.d.ts +226 -226
  259. package/dist/services/triggers/trigger-input.schemas.d.ts.map +1 -1
  260. package/dist/services/triggers/trigger-input.schemas.js +53 -53
  261. package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
  262. package/dist/services/triggers/triggers-output.schemas.d.ts +218 -218
  263. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  264. package/dist/services/triggers/triggers-output.schemas.js +152 -152
  265. package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
  266. package/dist/services/triggers/triggers.js +21 -21
  267. package/dist/services/triggers/triggers.js.map +1 -1
  268. package/dist/services/whiteboard/whiteboard.js +15 -15
  269. package/dist/services/whiteboard/whiteboard.js.map +1 -1
  270. package/dist/services/whiteboard/whiteboard.schemas.d.ts +379 -379
  271. package/dist/services/whiteboard/whiteboard.schemas.d.ts.map +1 -1
  272. package/dist/services/whiteboard/whiteboard.schemas.js +71 -71
  273. package/dist/services/whiteboard/whiteboard.schemas.js.map +1 -1
  274. package/dist/services/zipper/zipper.js +3 -3
  275. package/dist/services/zipper/zipper.js.map +1 -1
  276. package/dist/services/zipper/zipper.schemas.d.ts +1 -1
  277. package/dist/services/zipper/zipper.schemas.js +54 -54
  278. package/dist/services/zipper/zipper.schemas.js.map +1 -1
  279. package/dist/shared/account-scope.d.ts +6 -6
  280. package/dist/shared/account-scope.d.ts.map +1 -1
  281. package/dist/shared/account-scope.js +3 -3
  282. package/dist/shared/account-scope.js.map +1 -1
  283. package/dist/shared/connect-error-mapping.d.ts +1 -1
  284. package/dist/shared/connect-error-mapping.js +29 -3
  285. package/dist/shared/connect-error-mapping.js.map +1 -1
  286. package/dist/shared/rate-limit.schemas.d.ts +12 -12
  287. package/dist/shared/rate-limit.schemas.d.ts.map +1 -1
  288. package/dist/shared/rate-limit.schemas.js +7 -7
  289. package/dist/shared/rate-limit.schemas.js.map +1 -1
  290. package/dist/shared/schemas.js +26 -26
  291. package/dist/shared/schemas.js.map +1 -1
  292. package/dist/shared/transports.js +7 -12
  293. package/dist/shared/transports.js.map +1 -1
  294. package/dist/shared/types.d.ts +12 -0
  295. package/dist/shared/types.d.ts.map +1 -1
  296. package/dist/shared/validation.d.ts +14 -0
  297. package/dist/shared/validation.d.ts.map +1 -0
  298. package/dist/shared/validation.js +24 -0
  299. package/dist/shared/validation.js.map +1 -0
  300. package/dist/utils/connect-order-errors.js +2 -2
  301. package/dist/utils/connect-order-errors.js.map +1 -1
  302. package/dist/utils/cookies.d.ts +8 -3
  303. package/dist/utils/cookies.d.ts.map +1 -1
  304. package/dist/utils/cookies.js +7 -1
  305. package/dist/utils/cookies.js.map +1 -1
  306. package/dist/utils/event-emitter.d.ts +1 -1
  307. package/dist/utils/event-emitter.d.ts.map +1 -1
  308. package/dist/utils/event-emitter.js +4 -2
  309. package/dist/utils/event-emitter.js.map +1 -1
  310. package/dist/utils/evm.js +2 -2
  311. package/dist/utils/evm.js.map +1 -1
  312. package/dist/utils/jwt.d.ts +2 -2
  313. package/dist/utils/jwt.d.ts.map +1 -1
  314. package/dist/utils/jwt.js +2 -2
  315. package/dist/utils/jwt.js.map +1 -1
  316. package/package.json +1 -1
@@ -1,65 +1,65 @@
1
+ import { validation_d_exports } from "../../shared/validation.js";
1
2
  import { SocialProvider as SocialProvider$1, SocialVerification as SocialVerification$1, SocialVerificationMethod as SocialVerificationMethod$1 } from "../../gen/auth/v1/social_verification_pb.js";
2
3
  import { DecodedEnum } from "../../utils/types.js";
3
4
  import "./social-verification.codecs.js";
4
- import * as v from "valibot";
5
5
  //#region src/services/social-verification/social-verification.schemas.d.ts
6
- declare const SocialProviderSchema: v.PicklistSchema<readonly ["twitter", "discord"], undefined>;
7
- type SocialProvider = v.InferInput<typeof SocialProviderSchema>;
8
- declare const SocialVerificationMethodSchema: v.PicklistSchema<readonly ["profile", "channel", "dm"], undefined>;
9
- type SocialVerificationMethod = v.InferInput<typeof SocialVerificationMethodSchema>;
10
- declare const SocialVerificationStatusSchema: v.PicklistSchema<readonly ["pending_user_action", "queued", "in_progress", "verified", "failed", "expired", "cancelled"], undefined>;
11
- type SocialVerificationStatus = v.InferOutput<typeof SocialVerificationStatusSchema>;
12
- declare const SocialVerificationSchema: v.ObjectSchema<{
13
- readonly id: v.BigintSchema<undefined>;
14
- readonly provider: v.PicklistSchema<readonly ["twitter", "discord"], undefined>;
15
- readonly method: v.PicklistSchema<readonly ["profile", "channel", "dm"], undefined>;
16
- readonly handle: v.StringSchema<undefined>;
17
- readonly providerUserId: v.StringSchema<undefined>;
18
- readonly challengeCode: v.StringSchema<undefined>;
19
- readonly status: v.PicklistSchema<readonly ["pending_user_action", "queued", "in_progress", "verified", "failed", "expired", "cancelled"], undefined>;
20
- readonly requestedAt: v.OptionalSchema<v.ObjectSchema<{
21
- readonly seconds: v.BigintSchema<undefined>;
22
- readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
6
+ declare const SocialProviderSchema: validation_d_exports.PicklistSchema<readonly ["twitter", "discord"], undefined>;
7
+ type SocialProvider = validation_d_exports.InferInput<typeof SocialProviderSchema>;
8
+ declare const SocialVerificationMethodSchema: validation_d_exports.PicklistSchema<readonly ["profile", "channel", "dm"], undefined>;
9
+ type SocialVerificationMethod = validation_d_exports.InferInput<typeof SocialVerificationMethodSchema>;
10
+ declare const SocialVerificationStatusSchema: validation_d_exports.PicklistSchema<readonly ["pending_user_action", "queued", "in_progress", "verified", "failed", "expired", "cancelled"], undefined>;
11
+ type SocialVerificationStatus = validation_d_exports.InferOutput<typeof SocialVerificationStatusSchema>;
12
+ declare const SocialVerificationSchema: validation_d_exports.ObjectSchema<{
13
+ readonly id: validation_d_exports.BigintSchema<undefined>;
14
+ readonly provider: validation_d_exports.PicklistSchema<readonly ["twitter", "discord"], undefined>;
15
+ readonly method: validation_d_exports.PicklistSchema<readonly ["profile", "channel", "dm"], undefined>;
16
+ readonly handle: validation_d_exports.StringSchema<undefined>;
17
+ readonly providerUserId: validation_d_exports.StringSchema<undefined>;
18
+ readonly challengeCode: validation_d_exports.StringSchema<undefined>;
19
+ readonly status: validation_d_exports.PicklistSchema<readonly ["pending_user_action", "queued", "in_progress", "verified", "failed", "expired", "cancelled"], undefined>;
20
+ readonly requestedAt: validation_d_exports.OptionalSchema<validation_d_exports.ObjectSchema<{
21
+ readonly seconds: validation_d_exports.BigintSchema<undefined>;
22
+ readonly nanos: validation_d_exports.OptionalSchema<validation_d_exports.NumberSchema<undefined>, 0>;
23
23
  }, undefined>, undefined>;
24
- readonly expiresAt: v.OptionalSchema<v.ObjectSchema<{
25
- readonly seconds: v.BigintSchema<undefined>;
26
- readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
24
+ readonly expiresAt: validation_d_exports.OptionalSchema<validation_d_exports.ObjectSchema<{
25
+ readonly seconds: validation_d_exports.BigintSchema<undefined>;
26
+ readonly nanos: validation_d_exports.OptionalSchema<validation_d_exports.NumberSchema<undefined>, 0>;
27
27
  }, undefined>, undefined>;
28
- readonly verifiedAt: v.OptionalSchema<v.ObjectSchema<{
29
- readonly seconds: v.BigintSchema<undefined>;
30
- readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
28
+ readonly verifiedAt: validation_d_exports.OptionalSchema<validation_d_exports.ObjectSchema<{
29
+ readonly seconds: validation_d_exports.BigintSchema<undefined>;
30
+ readonly nanos: validation_d_exports.OptionalSchema<validation_d_exports.NumberSchema<undefined>, 0>;
31
31
  }, undefined>, undefined>;
32
- readonly attempts: v.NumberSchema<undefined>;
33
- readonly lastError: v.StringSchema<undefined>;
34
- readonly updatedAt: v.OptionalSchema<v.ObjectSchema<{
35
- readonly seconds: v.BigintSchema<undefined>;
36
- readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
32
+ readonly attempts: validation_d_exports.NumberSchema<undefined>;
33
+ readonly lastError: validation_d_exports.StringSchema<undefined>;
34
+ readonly updatedAt: validation_d_exports.OptionalSchema<validation_d_exports.ObjectSchema<{
35
+ readonly seconds: validation_d_exports.BigintSchema<undefined>;
36
+ readonly nanos: validation_d_exports.OptionalSchema<validation_d_exports.NumberSchema<undefined>, 0>;
37
37
  }, undefined>, undefined>;
38
38
  }, undefined>;
39
- type SocialVerificationBase = v.InferOutput<typeof SocialVerificationSchema>;
39
+ type SocialVerificationBase = validation_d_exports.InferOutput<typeof SocialVerificationSchema>;
40
40
  type SocialVerification = Omit<SocialVerificationBase, "provider" | "method" | "status"> & {
41
41
  provider: DecodedEnum<SocialProvider>;
42
42
  method: DecodedEnum<SocialVerificationMethod>;
43
43
  status: DecodedEnum<SocialVerificationStatus>;
44
44
  };
45
- declare const StartVerificationInputSchema: v.StrictObjectSchema<{
46
- readonly provider: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["twitter", "discord"], undefined>, v.TransformAction<"twitter" | "discord", SocialProvider$1.TWITTER | SocialProvider$1.DISCORD>]>;
47
- readonly handle: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
48
- readonly method: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["profile", "channel", "dm"], undefined>, "profile">, v.TransformAction<"profile" | "channel" | "dm", SocialVerificationMethod$1.METHOD_PROFILE | SocialVerificationMethod$1.METHOD_CHANNEL | SocialVerificationMethod$1.METHOD_DM>]>;
45
+ declare const StartVerificationInputSchema: validation_d_exports.StrictObjectSchema<{
46
+ readonly provider: validation_d_exports.SchemaWithPipe<readonly [validation_d_exports.PicklistSchema<readonly ["twitter", "discord"], undefined>, validation_d_exports.TransformAction<"twitter" | "discord", SocialProvider$1.TWITTER | SocialProvider$1.DISCORD>]>;
47
+ readonly handle: validation_d_exports.SchemaWithPipe<readonly [validation_d_exports.StringSchema<undefined>, validation_d_exports.TransformAction<string, string>, validation_d_exports.MinLengthAction<string, 1, undefined>, validation_d_exports.MaxLengthAction<string, 64, undefined>]>;
48
+ readonly method: validation_d_exports.SchemaWithPipe<readonly [validation_d_exports.OptionalSchema<validation_d_exports.PicklistSchema<readonly ["profile", "channel", "dm"], undefined>, "profile">, validation_d_exports.TransformAction<"profile" | "channel" | "dm", SocialVerificationMethod$1.METHOD_PROFILE | SocialVerificationMethod$1.METHOD_CHANNEL | SocialVerificationMethod$1.METHOD_DM>]>;
49
49
  }, undefined>;
50
- type StartVerificationInput = v.InferInput<typeof StartVerificationInputSchema>;
51
- declare const SocialProviderInputSchema: v.StrictObjectSchema<{
52
- readonly provider: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["twitter", "discord"], undefined>, v.TransformAction<"twitter" | "discord", SocialProvider$1.TWITTER | SocialProvider$1.DISCORD>]>;
50
+ type StartVerificationInput = validation_d_exports.InferInput<typeof StartVerificationInputSchema>;
51
+ declare const SocialProviderInputSchema: validation_d_exports.StrictObjectSchema<{
52
+ readonly provider: validation_d_exports.SchemaWithPipe<readonly [validation_d_exports.PicklistSchema<readonly ["twitter", "discord"], undefined>, validation_d_exports.TransformAction<"twitter" | "discord", SocialProvider$1.TWITTER | SocialProvider$1.DISCORD>]>;
53
53
  }, undefined>;
54
- type SocialProviderInput = v.InferInput<typeof SocialProviderInputSchema>;
55
- declare const StartVerificationResponseSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
56
- readonly challengeCode: v.StringSchema<undefined>;
57
- readonly expiresAt: v.OptionalSchema<v.ObjectSchema<{
58
- readonly seconds: v.BigintSchema<undefined>;
59
- readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
54
+ type SocialProviderInput = validation_d_exports.InferInput<typeof SocialProviderInputSchema>;
55
+ declare const StartVerificationResponseSchema: validation_d_exports.SchemaWithPipe<readonly [validation_d_exports.ObjectSchema<{
56
+ readonly challengeCode: validation_d_exports.StringSchema<undefined>;
57
+ readonly expiresAt: validation_d_exports.OptionalSchema<validation_d_exports.ObjectSchema<{
58
+ readonly seconds: validation_d_exports.BigintSchema<undefined>;
59
+ readonly nanos: validation_d_exports.OptionalSchema<validation_d_exports.NumberSchema<undefined>, 0>;
60
60
  }, undefined>, undefined>;
61
- readonly verification: v.OptionalSchema<v.CustomSchema<SocialVerification$1, undefined>, undefined>;
62
- }, undefined>, v.TransformAction<{
61
+ readonly verification: validation_d_exports.OptionalSchema<validation_d_exports.CustomSchema<SocialVerification$1, undefined>, undefined>;
62
+ }, undefined>, validation_d_exports.TransformAction<{
63
63
  challengeCode: string;
64
64
  expiresAt?: {
65
65
  seconds: bigint;
@@ -74,23 +74,23 @@ declare const StartVerificationResponseSchema: v.SchemaWithPipe<readonly [v.Obje
74
74
  } | undefined;
75
75
  verification: SocialVerification | undefined;
76
76
  }>]>;
77
- type StartVerificationResponse = v.InferOutput<typeof StartVerificationResponseSchema>;
78
- declare const VerificationReadyResponseSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
79
- readonly verification: v.OptionalSchema<v.CustomSchema<SocialVerification$1, undefined>, undefined>;
80
- }, undefined>, v.TransformAction<{
77
+ type StartVerificationResponse = validation_d_exports.InferOutput<typeof StartVerificationResponseSchema>;
78
+ declare const VerificationReadyResponseSchema: validation_d_exports.SchemaWithPipe<readonly [validation_d_exports.ObjectSchema<{
79
+ readonly verification: validation_d_exports.OptionalSchema<validation_d_exports.CustomSchema<SocialVerification$1, undefined>, undefined>;
80
+ }, undefined>, validation_d_exports.TransformAction<{
81
81
  verification?: SocialVerification$1 | undefined;
82
82
  }, {
83
83
  verification: SocialVerification | undefined;
84
84
  }>]>;
85
- type VerificationReadyResponse = v.InferOutput<typeof VerificationReadyResponseSchema>;
86
- declare const GetVerificationResponseSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
87
- readonly verification: v.OptionalSchema<v.CustomSchema<SocialVerification$1, undefined>, undefined>;
88
- }, undefined>, v.TransformAction<{
85
+ type VerificationReadyResponse = validation_d_exports.InferOutput<typeof VerificationReadyResponseSchema>;
86
+ declare const GetVerificationResponseSchema: validation_d_exports.SchemaWithPipe<readonly [validation_d_exports.ObjectSchema<{
87
+ readonly verification: validation_d_exports.OptionalSchema<validation_d_exports.CustomSchema<SocialVerification$1, undefined>, undefined>;
88
+ }, undefined>, validation_d_exports.TransformAction<{
89
89
  verification?: SocialVerification$1 | undefined;
90
90
  }, {
91
91
  verification: SocialVerification | undefined;
92
92
  }>]>;
93
- type GetVerificationResponse = v.InferOutput<typeof GetVerificationResponseSchema>;
93
+ type GetVerificationResponse = validation_d_exports.InferOutput<typeof GetVerificationResponseSchema>;
94
94
  //#endregion
95
95
  export { GetVerificationResponse, GetVerificationResponseSchema, SocialProvider, SocialProviderInput, SocialProviderInputSchema, SocialProviderSchema, SocialVerification, SocialVerificationMethod, SocialVerificationMethodSchema, SocialVerificationSchema, SocialVerificationStatus, SocialVerificationStatusSchema, StartVerificationInput, StartVerificationInputSchema, StartVerificationResponse, StartVerificationResponseSchema, VerificationReadyResponse, VerificationReadyResponseSchema };
96
96
  //# sourceMappingURL=social-verification.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"social-verification.schemas.d.ts","names":[],"sources":["../../../src/services/social-verification/social-verification.schemas.ts"],"mappings":";;;;;cAoBa,sBAAoB,EAAA;KACrB,iBAAiB,EAAE,kBAAkB;cAEpC,gCAA8B,EAAA;KAC/B,2BAA2B,EAAE,kBAAkB;cAE9C,gCAA8B,EAAA;KAC/B,2BAA2B,EAAE,mBAAmB;cA6C/C,0BAAwB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgBhC,yBAAyB,EAAE,mBAAmB;KACvC,qBAAqB,KAAK;EAClC,UAAU,YAAY;EACtB,QAAQ,YAAY;EACpB,QAAQ,YAAY;;cAGX,8BAA4B,EAAA;;;;;KAY7B,yBAAyB,EAAE,kBAAkB;cAO5C,2BAAyB,EAAA;;;KAI1B,sBAAsB,EAAE,kBAAkB;cAEzC,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;KAahC,4BAA4B,EAAE,mBAAmB;cAEhD,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;KAShC,4BAA4B,EAAE,mBAAmB;cAEhD,+BAA6B,EAAA,yBAAA,EAAA;;;;;;;KAS9B,0BAA0B,EAAE,mBAAmB"}
1
+ {"version":3,"file":"social-verification.schemas.d.ts","names":[],"sources":["../../../src/services/social-verification/social-verification.schemas.ts"],"mappings":";;;;;cAoBa,sBAAoB,qBAAA;KACrB,iBAAiB,qBAAE,kBAAkB;cAEpC,gCAA8B,qBAAA;KAC/B,2BAA2B,qBAAE,kBAAkB;cAE9C,gCAA8B,qBAAA;KAC/B,2BAA2B,qBAAE,mBAAmB;cA6C/C,0BAAwB,qBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgBhC,yBAAyB,qBAAE,mBAAmB;KACvC,qBAAqB,KAAK;EAClC,UAAU,YAAY;EACtB,QAAQ,YAAY;EACpB,QAAQ,YAAY;;cAGX,8BAA4B,qBAAA;;;;;KAY7B,yBAAyB,qBAAE,kBAAkB;cAO5C,2BAAyB,qBAAA;;;KAI1B,sBAAsB,qBAAE,kBAAkB;cAEzC,iCAA+B,qBAAA,yBAAA,qBAAA;;;;;;;;;;;;;;;;;;;;;;KAahC,4BAA4B,qBAAE,mBAAmB;cAEhD,iCAA+B,qBAAA,yBAAA,qBAAA;;;;;;;KAShC,4BAA4B,qBAAE,mBAAmB;cAEhD,+BAA6B,qBAAA,yBAAA,qBAAA;;;;;;;KAS9B,0BAA0B,qBAAE,mBAAmB"}
@@ -1,11 +1,11 @@
1
+ import { validation_exports } from "../../shared/validation.js";
1
2
  import { requiredEnumLabel } from "../../shared/proto-enum-codec.js";
2
3
  import { TimestampSchema } from "../../shared/schemas.js";
3
4
  import { SOCIAL_PROVIDER_VALUES, SOCIAL_VERIFICATION_METHOD_VALUES, SOCIAL_VERIFICATION_STATUS_VALUES, SocialProviderCodec, SocialVerificationMethodCodec, SocialVerificationStatusCodec } from "./social-verification.codecs.js";
4
- import * as v from "valibot";
5
5
  //#region src/services/social-verification/social-verification.schemas.ts
6
- const SocialProviderSchema = v.picklist(SOCIAL_PROVIDER_VALUES);
7
- const SocialVerificationMethodSchema = v.picklist(SOCIAL_VERIFICATION_METHOD_VALUES);
8
- const SocialVerificationStatusSchema = v.picklist(SOCIAL_VERIFICATION_STATUS_VALUES);
6
+ const SocialProviderSchema = validation_exports.picklist(SOCIAL_PROVIDER_VALUES);
7
+ const SocialVerificationMethodSchema = validation_exports.picklist(SOCIAL_VERIFICATION_METHOD_VALUES);
8
+ const SocialVerificationStatusSchema = validation_exports.picklist(SOCIAL_VERIFICATION_STATUS_VALUES);
9
9
  function normalizeHandle(input) {
10
10
  return (input ?? "").trim().replace(/^@+/, "");
11
11
  }
@@ -30,39 +30,39 @@ function transformVerification(v) {
30
30
  updatedAt: v.updatedAt
31
31
  };
32
32
  }
33
- v.object({
34
- id: v.bigint(),
33
+ validation_exports.object({
34
+ id: validation_exports.bigint(),
35
35
  provider: SocialProviderSchema,
36
36
  method: SocialVerificationMethodSchema,
37
- handle: v.string(),
38
- providerUserId: v.string(),
39
- challengeCode: v.string(),
37
+ handle: validation_exports.string(),
38
+ providerUserId: validation_exports.string(),
39
+ challengeCode: validation_exports.string(),
40
40
  status: SocialVerificationStatusSchema,
41
- requestedAt: v.optional(TimestampSchema),
42
- expiresAt: v.optional(TimestampSchema),
43
- verifiedAt: v.optional(TimestampSchema),
44
- attempts: v.number(),
45
- lastError: v.string(),
46
- updatedAt: v.optional(TimestampSchema)
41
+ requestedAt: validation_exports.optional(TimestampSchema),
42
+ expiresAt: validation_exports.optional(TimestampSchema),
43
+ verifiedAt: validation_exports.optional(TimestampSchema),
44
+ attempts: validation_exports.number(),
45
+ lastError: validation_exports.string(),
46
+ updatedAt: validation_exports.optional(TimestampSchema)
47
47
  });
48
- const StartVerificationInputSchema = v.strictObject({
49
- provider: v.pipe(SocialProviderSchema, v.transform((v) => SocialProviderCodec.inputToProto[v])),
50
- handle: v.pipe(v.string(), v.transform(normalizeHandle), v.minLength(1), v.maxLength(64)),
51
- method: v.pipe(v.optional(SocialVerificationMethodSchema, "profile"), v.transform((v) => SocialVerificationMethodCodec.inputToProto[v ?? "profile"]))
48
+ const StartVerificationInputSchema = validation_exports.strictObject({
49
+ provider: validation_exports.pipe(SocialProviderSchema, validation_exports.transform((v) => SocialProviderCodec.inputToProto[v])),
50
+ handle: validation_exports.pipe(validation_exports.string(), validation_exports.transform(normalizeHandle), validation_exports.minLength(1), validation_exports.maxLength(64)),
51
+ method: validation_exports.pipe(validation_exports.optional(SocialVerificationMethodSchema, "profile"), validation_exports.transform((v) => SocialVerificationMethodCodec.inputToProto[v ?? "profile"]))
52
52
  });
53
- const ProviderInputSchema = v.pipe(SocialProviderSchema, v.transform((v) => SocialProviderCodec.inputToProto[v]));
54
- const SocialProviderInputSchema = v.strictObject({ provider: ProviderInputSchema });
55
- const StartVerificationResponseSchema = v.pipe(v.object({
56
- challengeCode: v.string(),
57
- expiresAt: v.optional(TimestampSchema),
58
- verification: v.optional(v.custom(() => true))
59
- }), v.transform((res) => ({
53
+ const ProviderInputSchema = validation_exports.pipe(SocialProviderSchema, validation_exports.transform((v) => SocialProviderCodec.inputToProto[v]));
54
+ const SocialProviderInputSchema = validation_exports.strictObject({ provider: ProviderInputSchema });
55
+ const StartVerificationResponseSchema = validation_exports.pipe(validation_exports.object({
56
+ challengeCode: validation_exports.string(),
57
+ expiresAt: validation_exports.optional(TimestampSchema),
58
+ verification: validation_exports.optional(validation_exports.custom(() => true))
59
+ }), validation_exports.transform((res) => ({
60
60
  challengeCode: res.challengeCode,
61
61
  expiresAt: res.expiresAt,
62
62
  verification: transformVerification(res.verification)
63
63
  })));
64
- const VerificationReadyResponseSchema = v.pipe(v.object({ verification: v.optional(v.custom(() => true)) }), v.transform((res) => ({ verification: transformVerification(res.verification) })));
65
- const GetVerificationResponseSchema = v.pipe(v.object({ verification: v.optional(v.custom(() => true)) }), v.transform((res) => ({ verification: transformVerification(res.verification) })));
64
+ const VerificationReadyResponseSchema = validation_exports.pipe(validation_exports.object({ verification: validation_exports.optional(validation_exports.custom(() => true)) }), validation_exports.transform((res) => ({ verification: transformVerification(res.verification) })));
65
+ const GetVerificationResponseSchema = validation_exports.pipe(validation_exports.object({ verification: validation_exports.optional(validation_exports.custom(() => true)) }), validation_exports.transform((res) => ({ verification: transformVerification(res.verification) })));
66
66
  //#endregion
67
67
  export { GetVerificationResponseSchema, ProviderInputSchema, SocialProviderInputSchema, SocialProviderSchema, SocialVerificationMethodSchema, SocialVerificationStatusSchema, StartVerificationInputSchema, StartVerificationResponseSchema, VerificationReadyResponseSchema, transformVerification };
68
68
 
@@ -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 { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport type * as Proto from \"../../gen/auth/v1/social_verification_pb.js\";\nimport {\n SOCIAL_PROVIDER_VALUES,\n SOCIAL_VERIFICATION_METHOD_VALUES,\n SOCIAL_VERIFICATION_STATUS_VALUES,\n SocialProviderCodec,\n SocialVerificationMethodCodec,\n SocialVerificationStatusCodec,\n} from \"./social-verification.codecs.js\";\n\nexport {\n SOCIAL_PROVIDER_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 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\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: requiredEnumLabel(\n SocialProviderCodec.protoToOutput,\n v.provider,\n \"SocialVerificationSchema\",\n \"provider\",\n ),\n method: requiredEnumLabel(\n SocialVerificationMethodCodec.protoToOutput,\n v.method,\n \"SocialVerificationSchema\",\n \"method\",\n ),\n handle: v.handle,\n providerUserId: v.providerUserId,\n challengeCode: v.challengeCode,\n status: requiredEnumLabel(\n SocialVerificationStatusCodec.protoToOutput,\n v.status,\n \"SocialVerificationSchema\",\n \"status\",\n ),\n requestedAt: v.requestedAt,\n expiresAt: v.expiresAt,\n verifiedAt: v.verifiedAt,\n attempts: v.attempts,\n lastError: v.lastError,\n updatedAt: v.updatedAt,\n };\n}\n\nexport const SocialVerificationSchema = v.object({\n id: v.bigint(),\n provider: SocialProviderSchema,\n method: SocialVerificationMethodSchema,\n handle: v.string(),\n providerUserId: 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\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\nexport const StartVerificationInputSchema = v.strictObject({\n provider: v.pipe(\n SocialProviderSchema,\n v.transform((v) => SocialProviderCodec.inputToProto[v]),\n ),\n handle: v.pipe(v.string(), v.transform(normalizeHandle), v.minLength(1), v.maxLength(64)),\n method: v.pipe(\n v.optional(SocialVerificationMethodSchema, \"profile\"),\n v.transform((v) => SocialVerificationMethodCodec.inputToProto[v ?? \"profile\"]),\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 }),\n v.transform((res) => ({\n challengeCode: res.challengeCode,\n expiresAt: res.expiresAt,\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"],"mappings":";;;;;AAoBA,MAAa,uBAAuB,EAAE,SAAS,sBAAsB;AAGrE,MAAa,iCAAiC,EAAE,SAAS,iCAAiC;AAG1F,MAAa,iCAAiC,EAAE,SAAS,iCAAiC;AAG1F,SAAS,gBAAgB,OAAuB;CAC5C,QAAQ,SAAS,GAAA,CAAI,KAAK,CAAC,CAAC,QAAQ,OAAO,EAAE;AACjD;;;;AAKA,SAAgB,sBACZ,GAC8B;CAC9B,IAAI,CAAC,GAAG,OAAO,KAAA;CACf,OAAO;EACH,IAAI,EAAE;EACN,UAAU,kBACN,oBAAoB,eACpB,EAAE,UACF,4BACA,UACJ;EACA,QAAQ,kBACJ,8BAA8B,eAC9B,EAAE,QACF,4BACA,QACJ;EACA,QAAQ,EAAE;EACV,gBAAgB,EAAE;EAClB,eAAe,EAAE;EACjB,QAAQ,kBACJ,8BAA8B,eAC9B,EAAE,QACF,4BACA,QACJ;EACA,aAAa,EAAE;EACf,WAAW,EAAE;EACb,YAAY,EAAE;EACd,UAAU,EAAE;EACZ,WAAW,EAAE;EACb,WAAW,EAAE;CACjB;AACJ;AAEwC,EAAE,OAAO;CAC7C,IAAI,EAAE,OAAO;CACb,UAAU;CACV,QAAQ;CACR,QAAQ,EAAE,OAAO;CACjB,gBAAgB,EAAE,OAAO;CACzB,eAAe,EAAE,OAAO;CACxB,QAAQ;CACR,aAAa,EAAE,SAAS,eAAe;CACvC,WAAW,EAAE,SAAS,eAAe;CACrC,YAAY,EAAE,SAAS,eAAe;CACtC,UAAU,EAAE,OAAO;CACnB,WAAW,EAAE,OAAO;CACpB,WAAW,EAAE,SAAS,eAAe;AACzC,CAAC;AASD,MAAa,+BAA+B,EAAE,aAAa;CACvD,UAAU,EAAE,KACR,sBACA,EAAE,WAAW,MAAM,oBAAoB,aAAa,EAAE,CAC1D;CACA,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,UAAU,eAAe,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC;CACxF,QAAQ,EAAE,KACN,EAAE,SAAS,gCAAgC,SAAS,GACpD,EAAE,WAAW,MAAM,8BAA8B,aAAa,KAAK,UAAU,CACjF;AACJ,CAAC;AAID,MAAa,sBAAsB,EAAE,KACjC,sBACA,EAAE,WAAW,MAAM,oBAAoB,aAAa,EAAE,CAC1D;AAEA,MAAa,4BAA4B,EAAE,aAAa,EACpD,UAAU,oBACd,CAAC;AAID,MAAa,kCAAkC,EAAE,KAC7C,EAAE,OAAO;CACL,eAAe,EAAE,OAAO;CACxB,WAAW,EAAE,SAAS,eAAe;CACrC,cAAc,EAAE,SAAS,EAAE,aAAuC,IAAI,CAAC;AAC3E,CAAC,GACD,EAAE,WAAW,SAAS;CAClB,eAAe,IAAI;CACnB,WAAW,IAAI;CACf,cAAc,sBAAsB,IAAI,YAAY;AACxD,EAAE,CACN;AAIA,MAAa,kCAAkC,EAAE,KAC7C,EAAE,OAAO,EACL,cAAc,EAAE,SAAS,EAAE,aAAuC,IAAI,CAAC,EAC3E,CAAC,GACD,EAAE,WAAW,SAAS,EAClB,cAAc,sBAAsB,IAAI,YAAY,EACxD,EAAE,CACN;AAIA,MAAa,gCAAgC,EAAE,KAC3C,EAAE,OAAO,EACL,cAAc,EAAE,SAAS,EAAE,aAAuC,IAAI,CAAC,EAC3E,CAAC,GACD,EAAE,WAAW,SAAS,EAClB,cAAc,sBAAsB,IAAI,YAAY,EACxD,EAAE,CACN"}
1
+ {"version":3,"file":"social-verification.schemas.js","names":["v"],"sources":["../../../src/services/social-verification/social-verification.schemas.ts"],"sourcesContent":["import * as v from \"../../shared/validation.js\";\nimport { TimestampSchema } from \"../../shared/schemas.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport type * as Proto from \"../../gen/auth/v1/social_verification_pb.js\";\nimport {\n SOCIAL_PROVIDER_VALUES,\n SOCIAL_VERIFICATION_METHOD_VALUES,\n SOCIAL_VERIFICATION_STATUS_VALUES,\n SocialProviderCodec,\n SocialVerificationMethodCodec,\n SocialVerificationStatusCodec,\n} from \"./social-verification.codecs.js\";\n\nexport {\n SOCIAL_PROVIDER_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 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\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: requiredEnumLabel(\n SocialProviderCodec.protoToOutput,\n v.provider,\n \"SocialVerificationSchema\",\n \"provider\",\n ),\n method: requiredEnumLabel(\n SocialVerificationMethodCodec.protoToOutput,\n v.method,\n \"SocialVerificationSchema\",\n \"method\",\n ),\n handle: v.handle,\n providerUserId: v.providerUserId,\n challengeCode: v.challengeCode,\n status: requiredEnumLabel(\n SocialVerificationStatusCodec.protoToOutput,\n v.status,\n \"SocialVerificationSchema\",\n \"status\",\n ),\n requestedAt: v.requestedAt,\n expiresAt: v.expiresAt,\n verifiedAt: v.verifiedAt,\n attempts: v.attempts,\n lastError: v.lastError,\n updatedAt: v.updatedAt,\n };\n}\n\nexport const SocialVerificationSchema = v.object({\n id: v.bigint(),\n provider: SocialProviderSchema,\n method: SocialVerificationMethodSchema,\n handle: v.string(),\n providerUserId: 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\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\nexport const StartVerificationInputSchema = v.strictObject({\n provider: v.pipe(\n SocialProviderSchema,\n v.transform((v) => SocialProviderCodec.inputToProto[v]),\n ),\n handle: v.pipe(v.string(), v.transform(normalizeHandle), v.minLength(1), v.maxLength(64)),\n method: v.pipe(\n v.optional(SocialVerificationMethodSchema, \"profile\"),\n v.transform((v) => SocialVerificationMethodCodec.inputToProto[v ?? \"profile\"]),\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 }),\n v.transform((res) => ({\n challengeCode: res.challengeCode,\n expiresAt: res.expiresAt,\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"],"mappings":";;;;;AAoBA,MAAa,uBAAuBA,mBAAE,SAAS,sBAAsB;AAGrE,MAAa,iCAAiCA,mBAAE,SAAS,iCAAiC;AAG1F,MAAa,iCAAiCA,mBAAE,SAAS,iCAAiC;AAG1F,SAAS,gBAAgB,OAAuB;CAC5C,QAAQ,SAAS,GAAA,CAAI,KAAK,CAAC,CAAC,QAAQ,OAAO,EAAE;AACjD;;;;AAKA,SAAgB,sBACZ,GAC8B;CAC9B,IAAI,CAAC,GAAG,OAAO,KAAA;CACf,OAAO;EACH,IAAI,EAAE;EACN,UAAU,kBACN,oBAAoB,eACpB,EAAE,UACF,4BACA,UACJ;EACA,QAAQ,kBACJ,8BAA8B,eAC9B,EAAE,QACF,4BACA,QACJ;EACA,QAAQ,EAAE;EACV,gBAAgB,EAAE;EAClB,eAAe,EAAE;EACjB,QAAQ,kBACJ,8BAA8B,eAC9B,EAAE,QACF,4BACA,QACJ;EACA,aAAa,EAAE;EACf,WAAW,EAAE;EACb,YAAY,EAAE;EACd,UAAU,EAAE;EACZ,WAAW,EAAE;EACb,WAAW,EAAE;CACjB;AACJ;AAEwCA,mBAAE,OAAO;CAC7C,IAAIA,mBAAE,OAAO;CACb,UAAU;CACV,QAAQ;CACR,QAAQA,mBAAE,OAAO;CACjB,gBAAgBA,mBAAE,OAAO;CACzB,eAAeA,mBAAE,OAAO;CACxB,QAAQ;CACR,aAAaA,mBAAE,SAAS,eAAe;CACvC,WAAWA,mBAAE,SAAS,eAAe;CACrC,YAAYA,mBAAE,SAAS,eAAe;CACtC,UAAUA,mBAAE,OAAO;CACnB,WAAWA,mBAAE,OAAO;CACpB,WAAWA,mBAAE,SAAS,eAAe;AACzC,CAAC;AASD,MAAa,+BAA+BA,mBAAE,aAAa;CACvD,UAAUA,mBAAE,KACR,sBACAA,mBAAE,WAAW,MAAM,oBAAoB,aAAa,EAAE,CAC1D;CACA,QAAQA,mBAAE,KAAKA,mBAAE,OAAO,GAAGA,mBAAE,UAAU,eAAe,GAAGA,mBAAE,UAAU,CAAC,GAAGA,mBAAE,UAAU,EAAE,CAAC;CACxF,QAAQA,mBAAE,KACNA,mBAAE,SAAS,gCAAgC,SAAS,GACpDA,mBAAE,WAAW,MAAM,8BAA8B,aAAa,KAAK,UAAU,CACjF;AACJ,CAAC;AAID,MAAa,sBAAsBA,mBAAE,KACjC,sBACAA,mBAAE,WAAW,MAAM,oBAAoB,aAAa,EAAE,CAC1D;AAEA,MAAa,4BAA4BA,mBAAE,aAAa,EACpD,UAAU,oBACd,CAAC;AAID,MAAa,kCAAkCA,mBAAE,KAC7CA,mBAAE,OAAO;CACL,eAAeA,mBAAE,OAAO;CACxB,WAAWA,mBAAE,SAAS,eAAe;CACrC,cAAcA,mBAAE,SAASA,mBAAE,aAAuC,IAAI,CAAC;AAC3E,CAAC,GACDA,mBAAE,WAAW,SAAS;CAClB,eAAe,IAAI;CACnB,WAAW,IAAI;CACf,cAAc,sBAAsB,IAAI,YAAY;AACxD,EAAE,CACN;AAIA,MAAa,kCAAkCA,mBAAE,KAC7CA,mBAAE,OAAO,EACL,cAAcA,mBAAE,SAASA,mBAAE,aAAuC,IAAI,CAAC,EAC3E,CAAC,GACDA,mBAAE,WAAW,SAAS,EAClB,cAAc,sBAAsB,IAAI,YAAY,EACxD,EAAE,CACN;AAIA,MAAa,gCAAgCA,mBAAE,KAC3CA,mBAAE,OAAO,EACL,cAAcA,mBAAE,SAASA,mBAAE,aAAuC,IAAI,CAAC,EAC3E,CAAC,GACDA,mBAAE,WAAW,SAAS,EAClB,cAAc,sBAAsB,IAAI,YAAY,EACxD,EAAE,CACN"}
@@ -21,10 +21,12 @@ function assertNoLegacySubaccountId(input) {
21
21
  * Resolves account-scoped input using the configured resolver when needed.
22
22
  */
23
23
  function resolveAccountScopedInput(input, resolver) {
24
- assertNoLegacySubaccountId(input);
24
+ if (input === null) throw new ValidationError("Account-scoped input must be an object when provided.");
25
+ const normalizedInput = input ?? {};
26
+ assertNoLegacySubaccountId(normalizedInput);
25
27
  return {
26
- ...input,
27
- account: resolveAccountScope(input.account, resolver)
28
+ ...normalizedInput,
29
+ account: resolveAccountScope(normalizedInput.account, resolver)
28
30
  };
29
31
  }
30
32
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"subaccount-resolver.js","names":[],"sources":["../../src/services/subaccount-resolver.ts"],"sourcesContent":["import type { AccountScope, AccountScopedInput } from \"../shared/account-scope.js\";\nimport { ValidationError } from \"../shared/errors.js\";\n\n/**\n * Provides the default subaccount ID based on auth state.\n * When the active account is a subaccount (not main), this returns that ID.\n */\nexport interface SubaccountResolver {\n getDefaultSubaccountId(): string | null;\n getActiveAccountId?(): string | null;\n getMainAccountId?(): string | null;\n}\n\n/**\n * Resolves the account scope for a service call.\n *\n * Priority:\n * 1. Explicit `\"main\"` -> returns main-account scope\n * 2. Explicit `{ subaccountId }` -> returns that subaccount\n * 3. Explicit `\"active\"` or omitted -> checks resolver for active subaccount\n */\nexport function resolveAccountScope(\n explicit: AccountScope | undefined,\n resolver?: SubaccountResolver,\n): AccountScope | undefined {\n if (explicit === \"main\") return \"main\";\n if (explicit !== undefined && explicit !== \"active\") return explicit;\n\n const defaultId = resolver?.getDefaultSubaccountId();\n return defaultId ? { subaccountId: defaultId } : undefined;\n}\n\nfunction assertNoLegacySubaccountId(input: object): void {\n if (Object.prototype.hasOwnProperty.call(input, \"subaccountId\")) {\n throw new ValidationError(\n 'Use `account: \"main\"` or `account: { subaccountId }` instead of `subaccountId`.',\n );\n }\n}\n\n/**\n * Resolves account-scoped input using the configured resolver when needed.\n */\nexport function resolveAccountScopedInput<TInput extends object>(\n input: TInput & AccountScopedInput,\n resolver?: SubaccountResolver,\n): TInput & AccountScopedInput {\n assertNoLegacySubaccountId(input);\n return {\n ...input,\n account: resolveAccountScope(input.account, resolver),\n };\n}\n"],"mappings":";;;;;;;;;;AAqBA,SAAgB,oBACZ,UACA,UACwB;CACxB,IAAI,aAAa,QAAQ,OAAO;CAChC,IAAI,aAAa,KAAA,KAAa,aAAa,UAAU,OAAO;CAE5D,MAAM,YAAY,UAAU,uBAAuB;CACnD,OAAO,YAAY,EAAE,cAAc,UAAU,IAAI,KAAA;AACrD;AAEA,SAAS,2BAA2B,OAAqB;CACrD,IAAI,OAAO,UAAU,eAAe,KAAK,OAAO,cAAc,GAC1D,MAAM,IAAI,gBACN,mFACJ;AAER;;;;AAKA,SAAgB,0BACZ,OACA,UAC2B;CAC3B,2BAA2B,KAAK;CAChC,OAAO;EACH,GAAG;EACH,SAAS,oBAAoB,MAAM,SAAS,QAAQ;CACxD;AACJ"}
1
+ {"version":3,"file":"subaccount-resolver.js","names":[],"sources":["../../src/services/subaccount-resolver.ts"],"sourcesContent":["import type { AccountScope, AccountScopedInput } from \"../shared/account-scope.js\";\nimport { ValidationError } from \"../shared/errors.js\";\n\n/**\n * Provides the default subaccount ID based on auth state.\n * When the active account is a subaccount (not main), this returns that ID.\n */\nexport interface SubaccountResolver {\n getDefaultSubaccountId(): string | null;\n getActiveAccountId?(): string | null;\n getMainAccountId?(): string | null;\n}\n\n/**\n * Resolves the account scope for a service call.\n *\n * Priority:\n * 1. Explicit `\"main\"` -> returns main-account scope\n * 2. Explicit `{ subaccountId }` -> returns that subaccount\n * 3. Explicit `\"active\"` or omitted -> checks resolver for active subaccount\n */\nexport function resolveAccountScope(\n explicit: AccountScope | undefined,\n resolver?: SubaccountResolver,\n): AccountScope | undefined {\n if (explicit === \"main\") return \"main\";\n if (explicit !== undefined && explicit !== \"active\") return explicit;\n\n const defaultId = resolver?.getDefaultSubaccountId();\n return defaultId ? { subaccountId: defaultId } : undefined;\n}\n\nfunction assertNoLegacySubaccountId(input: object): void {\n if (Object.prototype.hasOwnProperty.call(input, \"subaccountId\")) {\n throw new ValidationError(\n 'Use `account: \"main\"` or `account: { subaccountId }` instead of `subaccountId`.',\n );\n }\n}\n\n/**\n * Resolves account-scoped input using the configured resolver when needed.\n */\nexport function resolveAccountScopedInput<TInput extends object>(\n input: TInput & AccountScopedInput,\n resolver?: SubaccountResolver,\n): TInput & AccountScopedInput {\n if (input === null) {\n throw new ValidationError(\"Account-scoped input must be an object when provided.\");\n }\n const normalizedInput = input ?? {};\n assertNoLegacySubaccountId(normalizedInput);\n return {\n ...normalizedInput,\n account: resolveAccountScope(normalizedInput.account, resolver),\n };\n}\n"],"mappings":";;;;;;;;;;AAqBA,SAAgB,oBACZ,UACA,UACwB;CACxB,IAAI,aAAa,QAAQ,OAAO;CAChC,IAAI,aAAa,KAAA,KAAa,aAAa,UAAU,OAAO;CAE5D,MAAM,YAAY,UAAU,uBAAuB;CACnD,OAAO,YAAY,EAAE,cAAc,UAAU,IAAI,KAAA;AACrD;AAEA,SAAS,2BAA2B,OAAqB;CACrD,IAAI,OAAO,UAAU,eAAe,KAAK,OAAO,cAAc,GAC1D,MAAM,IAAI,gBACN,mFACJ;AAER;;;;AAKA,SAAgB,0BACZ,OACA,UAC2B;CAC3B,IAAI,UAAU,MACV,MAAM,IAAI,gBAAgB,uDAAuD;CAErF,MAAM,kBAAkB,SAAS,CAAC;CAClC,2BAA2B,eAAe;CAC1C,OAAO;EACH,GAAG;EACH,SAAS,oBAAoB,gBAAgB,SAAS,QAAQ;CAClE;AACJ"}
@@ -1,3 +1,4 @@
1
+ import { validation_d_exports } from "../../shared/validation.js";
1
2
  import { PolyesterMutationOptions, PolyesterRequestOptions } from "../../shared/request-options.js";
2
3
  import { SubaccountResolver } from "../subaccount-resolver.js";
3
4
  import { PolyesterRealtime } from "../../realtime/types.js";
@@ -10,7 +11,6 @@ import { SubaccountPoliciesService } from "../policies/subaccount-policies/subac
10
11
  import "../policies/subaccount-policies/index.js";
11
12
  import { CreateSubaccountInputSchema, CreateSubaccountResult, DeleteSubaccountInputSchema, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInputSchema, Subaccount, SubaccountActivityInputSchema, SubaccountEvent, SubaccountIdInputSchema, SubaccountInvite, SubaccountMember, SubaccountMutationResult, SubaccountSchema, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInputSchema } from "./subaccounts.schemas.js";
12
13
  import { Transport } from "@connectrpc/connect";
13
- import * as v from "valibot";
14
14
  //#region src/services/subaccounts/subaccounts.d.ts
15
15
  interface SubscribeSubaccountsInput extends BaseSubscribeInput<Subaccount> {
16
16
  accountId: string;
@@ -30,12 +30,12 @@ declare class SubaccountsService {
30
30
  */
31
31
  list(options?: PolyesterRequestOptions): Promise<{
32
32
  totalCreated: number;
33
- subaccounts: v.InferOutput<typeof SubaccountSchema>[];
33
+ subaccounts: validation_d_exports.InferOutput<typeof SubaccountSchema>[];
34
34
  }>;
35
35
  /**
36
36
  * Fetches an aggregated subaccount dashboard view with subaccount details, policy, API keys, balances, members, and outgoing invites; throws if the subaccount is missing.
37
37
  */
38
- get(input: v.InferInput<typeof SubaccountIdInputSchema>, options?: PolyesterRequestOptions): Promise<Subaccount & {
38
+ get(input: validation_d_exports.InferInput<typeof SubaccountIdInputSchema>, options?: PolyesterRequestOptions): Promise<Subaccount & {
39
39
  apiKeys: ApiKey[];
40
40
  policy: SubaccountPolicy;
41
41
  members: SubaccountMember[];
@@ -44,47 +44,47 @@ declare class SubaccountsService {
44
44
  /**
45
45
  * Creates a new subaccount under the caller's root account using a smart-account address, nonce, and signature proof.
46
46
  */
47
- create(input: v.InferInput<typeof CreateSubaccountInputSchema>, options?: PolyesterMutationOptions): Promise<CreateSubaccountResult>;
47
+ create(input: validation_d_exports.InferInput<typeof CreateSubaccountInputSchema>, options?: PolyesterMutationOptions): Promise<CreateSubaccountResult>;
48
48
  /**
49
49
  * Updates mutable subaccount display/status fields such as label and active/disabled/deleted status.
50
50
  */
51
- update(input: v.InferInput<typeof UpdateSubaccountInputSchema>, options?: PolyesterMutationOptions): Promise<Subaccount>;
51
+ update(input: validation_d_exports.InferInput<typeof UpdateSubaccountInputSchema>, options?: PolyesterMutationOptions): Promise<Subaccount>;
52
52
  /**
53
53
  * Creates or refreshes a pending invitation granting a role on a subaccount to another root account.
54
54
  */
55
- inviteMember(input: v.InferInput<typeof InviteSubaccountMemberInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountInvite>;
55
+ inviteMember(input: validation_d_exports.InferInput<typeof InviteSubaccountMemberInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountInvite>;
56
56
  /**
57
57
  * Removes delegated access for a subaccount member by grantee account ID.
58
58
  */
59
- removeMember(input: v.InferInput<typeof RemoveSubaccountMemberInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountMutationResult>;
59
+ removeMember(input: validation_d_exports.InferInput<typeof RemoveSubaccountMemberInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountMutationResult>;
60
60
  /**
61
61
  * Changes an existing delegated member's role without sending a new invitation.
62
62
  */
63
- updateMemberRole(input: v.InferInput<typeof UpdateSubaccountMemberRoleInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountMutationResult>;
63
+ updateMemberRole(input: validation_d_exports.InferInput<typeof UpdateSubaccountMemberRoleInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountMutationResult>;
64
64
  /**
65
65
  * Enables or disables the owner-controlled MFA requirement for delegated interactive member actions on a subaccount.
66
66
  */
67
- setMemberMfaRequirement(input: v.InferInput<typeof SetSubaccountMemberMfaRequirementInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountMutationResult>;
67
+ setMemberMfaRequirement(input: validation_d_exports.InferInput<typeof SetSubaccountMemberMfaRequirementInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountMutationResult>;
68
68
  /**
69
69
  * Returns incoming, outgoing, or all subaccount invitations for the caller, newest first.
70
70
  */
71
- listInvites(input: v.InferInput<typeof ListSubaccountInvitesInputSchema>, options?: PolyesterRequestOptions): Promise<SubaccountInvite[]>;
71
+ listInvites(input: validation_d_exports.InferInput<typeof ListSubaccountInvitesInputSchema>, options?: PolyesterRequestOptions): Promise<SubaccountInvite[]>;
72
72
  /**
73
73
  * Returns the owner and delegated members for a subaccount, including role and MFA enrollment status.
74
74
  */
75
- listMembers(input: v.InferInput<typeof SubaccountIdInputSchema>, options?: PolyesterRequestOptions): Promise<SubaccountMember[]>;
75
+ listMembers(input: validation_d_exports.InferInput<typeof SubaccountIdInputSchema>, options?: PolyesterRequestOptions): Promise<SubaccountMember[]>;
76
76
  /**
77
77
  * Accepts or rejects an incoming invite, or cancels an outgoing invite, returning the updated invitation.
78
78
  */
79
- respondInvite(input: v.InferInput<typeof RespondSubaccountInviteInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountInvite>;
79
+ respondInvite(input: validation_d_exports.InferInput<typeof RespondSubaccountInviteInputSchema>, options?: PolyesterMutationOptions): Promise<SubaccountInvite>;
80
80
  /**
81
81
  * Soft-deletes a subaccount by updating its status to deleted.
82
82
  */
83
- delete(input: v.InferInput<typeof DeleteSubaccountInputSchema>, options?: PolyesterMutationOptions): Promise<Subaccount>;
83
+ delete(input: validation_d_exports.InferInput<typeof DeleteSubaccountInputSchema>, options?: PolyesterMutationOptions): Promise<Subaccount>;
84
84
  /**
85
- * Returns paginated audit/activity events for a subaccount, newest first, with a limit capped at 200 and opaque cursor pagination.
85
+ * Returns paginated audit/activity events for a subaccount, newest first, with a non-negative integer limit from 0 through 200 and opaque cursor pagination.
86
86
  */
87
- listEvents(input: v.InferInput<typeof SubaccountActivityInputSchema>, options?: PolyesterRequestOptions): Promise<{
87
+ listEvents(input: validation_d_exports.InferInput<typeof SubaccountActivityInputSchema>, options?: PolyesterRequestOptions): Promise<{
88
88
  events: SubaccountEvent[];
89
89
  nextPageToken: string;
90
90
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"subaccounts.d.ts","names":[],"sources":["../../../src/services/subaccounts/subaccounts.ts"],"mappings":";;;;;;;;;;;;;;UA8CU,kCAAkC,mBAAmB;EAC3D;;UAGM,8BAA8B,mBAAmB;EACvD;;;;;cAMS;;WACA,UAAU;EAMP,YAAA,WAAW,WAAW,UAAU,mBAAmB,WAAW;;;;EAUpE,KAAK,UAAU,0BAA0B;IAC3C;IACA,aAAa,EAAE,mBAAmB;;;;;EAYhC,IACF,OAAO,EAAE,kBAAkB,0BAC3B,UAAU,0BACX,QACC;IACI,SAAS;IACT,QAAQ;IACR,SAAS;IACT,SAAS;;;;;EAmCX,OACF,OAAO,EAAE,kBAAkB,8BAC3B,UAAU,2BACX,QAAQ;;;;EAYL,OACF,OAAO,EAAE,kBAAkB,8BAC3B,UAAU,2BACX,QAAQ;;;;EAaL,aACF,OAAO,EAAE,kBAAkB,oCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,aACF,OAAO,EAAE,kBAAkB,oCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,iBACF,OAAO,EAAE,kBAAkB,wCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,wBACF,OAAO,EAAE,kBAAkB,+CAC3B,UAAU,2BACX,QAAQ;;;;EAYL,YACF,OAAO,EAAE,kBAAkB,mCAC3B,UAAU,0BACX,QAAQ;;;;EAYL,YACF,OAAO,EAAE,kBAAkB,0BAC3B,UAAU,0BACX,QAAQ;;;;EAYL,cACF,OAAO,EAAE,kBAAkB,qCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,OACF,OAAO,EAAE,kBAAkB,8BAC3B,UAAU,2BACX,QAAQ;;;;EAkBL,WACF,OAAO,EAAE,kBAAkB,gCAC3B,UAAU,0BACX;IAAU,QAAQ;IAAmB;;;;;EAexC,UAAU,OAAO;;;;EAmBjB,iBAAiB,OAAO"}
1
+ {"version":3,"file":"subaccounts.d.ts","names":[],"sources":["../../../src/services/subaccounts/subaccounts.ts"],"mappings":";;;;;;;;;;;;;;UA8CU,kCAAkC,mBAAmB;EAC3D;;UAGM,8BAA8B,mBAAmB;EACvD;;;;;cAMS;;WACA,UAAU;EAMP,YAAA,WAAW,WAAW,UAAU,mBAAmB,WAAW;;;;EAUpE,KAAK,UAAU,0BAA0B;IAC3C;IACA,aAAa,qBAAE,mBAAmB;;;;;EAYhC,IACF,OAAO,qBAAE,kBAAkB,0BAC3B,UAAU,0BACX,QACC;IACI,SAAS;IACT,QAAQ;IACR,SAAS;IACT,SAAS;;;;;EAmCX,OACF,OAAO,qBAAE,kBAAkB,8BAC3B,UAAU,2BACX,QAAQ;;;;EAYL,OACF,OAAO,qBAAE,kBAAkB,8BAC3B,UAAU,2BACX,QAAQ;;;;EAaL,aACF,OAAO,qBAAE,kBAAkB,oCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,aACF,OAAO,qBAAE,kBAAkB,oCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,iBACF,OAAO,qBAAE,kBAAkB,wCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,wBACF,OAAO,qBAAE,kBAAkB,+CAC3B,UAAU,2BACX,QAAQ;;;;EAYL,YACF,OAAO,qBAAE,kBAAkB,mCAC3B,UAAU,0BACX,QAAQ;;;;EAYL,YACF,OAAO,qBAAE,kBAAkB,0BAC3B,UAAU,0BACX,QAAQ;;;;EAYL,cACF,OAAO,qBAAE,kBAAkB,qCAC3B,UAAU,2BACX,QAAQ;;;;EAYL,OACF,OAAO,qBAAE,kBAAkB,8BAC3B,UAAU,2BACX,QAAQ;;;;EAkBL,WACF,OAAO,qBAAE,kBAAkB,gCAC3B,UAAU,0BACX;IAAU,QAAQ;IAAmB;;;;;EAexC,UAAU,OAAO;;;;EAmBjB,iBAAiB,OAAO"}
@@ -1,3 +1,4 @@
1
+ import { parse, validation_exports } from "../../shared/validation.js";
1
2
  import { formatId } from "../../utils/base58-id.js";
2
3
  import { toConnectCallOptions } from "../../shared/request-options.js";
3
4
  import { ApiKeySchema } from "../../gen/auth/v1/api_keys_pb.js";
@@ -7,7 +8,6 @@ import { DEFAULT_SUBACCOUNT_POLICY, SubaccountPolicySchema } from "../policies/s
7
8
  import { SubaccountPoliciesService } from "../policies/subaccount-policies/subaccount-policies.js";
8
9
  import { CreateSubaccountInputSchema, CreateSubaccountResultSchema, DeleteSubaccountInputSchema, InviteSubaccountMemberInputSchema, ListSubaccountInvitesInputSchema, RemoveSubaccountMemberInputSchema, RespondSubaccountInviteInputSchema, SetSubaccountMemberMfaRequirementInputSchema, SubaccountActivityEventSchema, SubaccountActivityInputSchema, SubaccountIdInputSchema, SubaccountInviteSchema, SubaccountMemberSchema, SubaccountMutationResultSchema, SubaccountSchema as SubaccountSchema$1, UpdateSubaccountInputSchema, UpdateSubaccountMemberRoleInputSchema } from "./subaccounts.schemas.js";
9
10
  import { createClient } from "@connectrpc/connect";
10
- import * as v from "valibot";
11
11
  //#region src/services/subaccounts/subaccounts.ts
12
12
  /**
13
13
  * Creates, manages, shares, audits, and subscribes to subaccounts visible to the authenticated caller.
@@ -30,14 +30,14 @@ var SubaccountsService = class {
30
30
  const res = await this.#client.listSubaccounts({}, toConnectCallOptions(options));
31
31
  return {
32
32
  totalCreated: res.totalCreated,
33
- subaccounts: v.parse(v.array(SubaccountSchema$1), res.subaccounts)
33
+ subaccounts: parse(validation_exports.array(SubaccountSchema$1), res.subaccounts)
34
34
  };
35
35
  }
36
36
  /**
37
37
  * Fetches an aggregated subaccount dashboard view with subaccount details, policy, API keys, balances, members, and outgoing invites; throws if the subaccount is missing.
38
38
  */
39
39
  async get(input, options) {
40
- const validatedInput = v.parse(SubaccountIdInputSchema, input);
40
+ const validatedInput = parse(SubaccountIdInputSchema, input);
41
41
  const subaccountId = formatId(validatedInput.subaccountId);
42
42
  const res = await this.#viewClient.getSubaccount({
43
43
  subaccountId: validatedInput.subaccountId,
@@ -50,91 +50,91 @@ var SubaccountsService = class {
50
50
  }, toConnectCallOptions(options));
51
51
  if (!res.subaccount) throw new Error(`Subaccount not found: ${subaccountId}`);
52
52
  return {
53
- ...v.parse(SubaccountSchema$1, res.subaccount),
54
- policy: res.policy ? v.parse(SubaccountPolicySchema, res.policy) : DEFAULT_SUBACCOUNT_POLICY,
55
- apiKeys: v.parse(v.optional(v.array(ApiKeySchema$1), []), res.apiKeys),
56
- members: v.parse(v.optional(v.array(SubaccountMemberSchema), []), res.members),
57
- invites: v.parse(v.optional(v.array(SubaccountInviteSchema), []), res.invites).filter((invite) => invite.subaccountId === subaccountId)
53
+ ...parse(SubaccountSchema$1, res.subaccount),
54
+ policy: res.policy ? parse(SubaccountPolicySchema, res.policy) : DEFAULT_SUBACCOUNT_POLICY,
55
+ apiKeys: parse(validation_exports.optional(validation_exports.array(ApiKeySchema$1), []), res.apiKeys),
56
+ members: parse(validation_exports.optional(validation_exports.array(SubaccountMemberSchema), []), res.members),
57
+ invites: parse(validation_exports.optional(validation_exports.array(SubaccountInviteSchema), []), res.invites).filter((invite) => invite.subaccountId === subaccountId)
58
58
  };
59
59
  }
60
60
  /**
61
61
  * Creates a new subaccount under the caller's root account using a smart-account address, nonce, and signature proof.
62
62
  */
63
63
  async create(input, options) {
64
- const validatedInput = v.parse(CreateSubaccountInputSchema, input);
64
+ const validatedInput = parse(CreateSubaccountInputSchema, input);
65
65
  const res = await this.#client.createSubaccount(validatedInput, toConnectCallOptions(options));
66
- return v.parse(CreateSubaccountResultSchema, res);
66
+ return parse(CreateSubaccountResultSchema, res);
67
67
  }
68
68
  /**
69
69
  * Updates mutable subaccount display/status fields such as label and active/disabled/deleted status.
70
70
  */
71
71
  async update(input, options) {
72
- const validatedInput = v.parse(UpdateSubaccountInputSchema, input);
72
+ const validatedInput = parse(UpdateSubaccountInputSchema, input);
73
73
  const res = await this.#client.updateSubaccount(validatedInput, toConnectCallOptions(options));
74
74
  if (!res.subaccount) throw new Error("Failed to update subaccount");
75
- return v.parse(SubaccountSchema$1, res.subaccount);
75
+ return parse(SubaccountSchema$1, res.subaccount);
76
76
  }
77
77
  /**
78
78
  * Creates or refreshes a pending invitation granting a role on a subaccount to another root account.
79
79
  */
80
80
  async inviteMember(input, options) {
81
- const validatedInput = v.parse(InviteSubaccountMemberInputSchema, input);
81
+ const validatedInput = parse(InviteSubaccountMemberInputSchema, input);
82
82
  const res = await this.#client.inviteSubaccountMember(validatedInput, toConnectCallOptions(options));
83
- return v.parse(SubaccountInviteSchema, res.invite);
83
+ return parse(SubaccountInviteSchema, res.invite);
84
84
  }
85
85
  /**
86
86
  * Removes delegated access for a subaccount member by grantee account ID.
87
87
  */
88
88
  async removeMember(input, options) {
89
- const validatedInput = v.parse(RemoveSubaccountMemberInputSchema, input);
89
+ const validatedInput = parse(RemoveSubaccountMemberInputSchema, input);
90
90
  const res = await this.#client.removeSubaccountMember(validatedInput, toConnectCallOptions(options));
91
- return v.parse(SubaccountMutationResultSchema, res);
91
+ return parse(SubaccountMutationResultSchema, res);
92
92
  }
93
93
  /**
94
94
  * Changes an existing delegated member's role without sending a new invitation.
95
95
  */
96
96
  async updateMemberRole(input, options) {
97
- const validatedInput = v.parse(UpdateSubaccountMemberRoleInputSchema, input);
97
+ const validatedInput = parse(UpdateSubaccountMemberRoleInputSchema, input);
98
98
  const res = await this.#client.updateSubaccountMemberRole(validatedInput, toConnectCallOptions(options));
99
- return v.parse(SubaccountMutationResultSchema, res);
99
+ return parse(SubaccountMutationResultSchema, res);
100
100
  }
101
101
  /**
102
102
  * Enables or disables the owner-controlled MFA requirement for delegated interactive member actions on a subaccount.
103
103
  */
104
104
  async setMemberMfaRequirement(input, options) {
105
- const validatedInput = v.parse(SetSubaccountMemberMfaRequirementInputSchema, input);
105
+ const validatedInput = parse(SetSubaccountMemberMfaRequirementInputSchema, input);
106
106
  const res = await this.#client.setSubaccountMemberMFARequirement(validatedInput, toConnectCallOptions(options));
107
- return v.parse(SubaccountMutationResultSchema, res);
107
+ return parse(SubaccountMutationResultSchema, res);
108
108
  }
109
109
  /**
110
110
  * Returns incoming, outgoing, or all subaccount invitations for the caller, newest first.
111
111
  */
112
112
  async listInvites(input, options) {
113
- const validatedInput = v.parse(ListSubaccountInvitesInputSchema, input);
113
+ const validatedInput = parse(ListSubaccountInvitesInputSchema, input);
114
114
  const res = await this.#client.listSubaccountInvites(validatedInput, toConnectCallOptions(options));
115
- return v.parse(v.array(SubaccountInviteSchema), res.invites);
115
+ return parse(validation_exports.array(SubaccountInviteSchema), res.invites);
116
116
  }
117
117
  /**
118
118
  * Returns the owner and delegated members for a subaccount, including role and MFA enrollment status.
119
119
  */
120
120
  async listMembers(input, options) {
121
- const validatedInput = v.parse(SubaccountIdInputSchema, input);
121
+ const validatedInput = parse(SubaccountIdInputSchema, input);
122
122
  const res = await this.#client.listSubaccountMembers(validatedInput, toConnectCallOptions(options));
123
- return v.parse(v.array(SubaccountMemberSchema), res.members);
123
+ return parse(validation_exports.array(SubaccountMemberSchema), res.members);
124
124
  }
125
125
  /**
126
126
  * Accepts or rejects an incoming invite, or cancels an outgoing invite, returning the updated invitation.
127
127
  */
128
128
  async respondInvite(input, options) {
129
- const validatedInput = v.parse(RespondSubaccountInviteInputSchema, input);
129
+ const validatedInput = parse(RespondSubaccountInviteInputSchema, input);
130
130
  const res = await this.#client.respondSubaccountInvite(validatedInput, toConnectCallOptions(options));
131
- return v.parse(SubaccountInviteSchema, res.invite);
131
+ return parse(SubaccountInviteSchema, res.invite);
132
132
  }
133
133
  /**
134
134
  * Soft-deletes a subaccount by updating its status to deleted.
135
135
  */
136
136
  async delete(input, options) {
137
- const validatedInput = v.parse(DeleteSubaccountInputSchema, input);
137
+ const validatedInput = parse(DeleteSubaccountInputSchema, input);
138
138
  const res = await this.#client.updateSubaccount({
139
139
  subaccountId: validatedInput.subaccountId,
140
140
  subaccount: { status: "deleted" },
@@ -142,16 +142,16 @@ var SubaccountsService = class {
142
142
  expectedRevision: validatedInput.expectedRevision
143
143
  }, toConnectCallOptions(options));
144
144
  if (!res.subaccount) throw new Error("Failed to delete subaccount");
145
- return v.parse(SubaccountSchema$1, res.subaccount);
145
+ return parse(SubaccountSchema$1, res.subaccount);
146
146
  }
147
147
  /**
148
- * Returns paginated audit/activity events for a subaccount, newest first, with a limit capped at 200 and opaque cursor pagination.
148
+ * Returns paginated audit/activity events for a subaccount, newest first, with a non-negative integer limit from 0 through 200 and opaque cursor pagination.
149
149
  */
150
150
  async listEvents(input, options) {
151
- const validatedInput = v.parse(SubaccountActivityInputSchema, input);
151
+ const validatedInput = parse(SubaccountActivityInputSchema, input);
152
152
  const res = await this.#viewClient.listSubaccountActivity(validatedInput, toConnectCallOptions(options));
153
153
  return {
154
- events: v.parse(v.optional(v.array(SubaccountActivityEventSchema), []), res.events),
154
+ events: parse(validation_exports.optional(validation_exports.array(SubaccountActivityEventSchema), []), res.events),
155
155
  nextPageToken: res.nextPageToken
156
156
  };
157
157
  }
@@ -164,12 +164,12 @@ var SubaccountsService = class {
164
164
  channel,
165
165
  schema: SubaccountSchema,
166
166
  onPublication: (data) => {
167
- const subaccount = v.parse(SubaccountSchema$1, data);
167
+ const subaccount = parse(SubaccountSchema$1, data);
168
168
  input.onEvent(subaccount);
169
169
  },
170
170
  onConnected: () => input.onOpen?.(),
171
171
  onDisconnected: () => input.onClose?.(),
172
- onError: (ctx) => input.onError?.(ctx)
172
+ onError: input.onError
173
173
  });
174
174
  }
175
175
  /**
@@ -181,12 +181,12 @@ var SubaccountsService = class {
181
181
  channel,
182
182
  schema: ApiKeySchema,
183
183
  onPublication: (data) => {
184
- const apiKey = v.parse(ApiKeySchema$1, data);
184
+ const apiKey = parse(ApiKeySchema$1, data);
185
185
  input.onEvent(apiKey);
186
186
  },
187
187
  onConnected: () => input.onOpen?.(),
188
188
  onDisconnected: () => input.onClose?.(),
189
- onError: (ctx) => input.onError?.(ctx)
189
+ onError: input.onError
190
190
  });
191
191
  }
192
192
  };