@gorth-io/structure 0.0.0-alpha.10

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 (420) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +83 -0
  3. package/dist/cores/ably/ai-transport/index.cjs +1 -0
  4. package/dist/cores/ably/ai-transport/index.d.cts +1 -0
  5. package/dist/cores/ably/ai-transport/index.d.ts +1 -0
  6. package/dist/cores/ably/ai-transport/index.js +1 -0
  7. package/dist/cores/ably/ai-transport/react/index.cjs +1 -0
  8. package/dist/cores/ably/ai-transport/react/index.d.cts +1 -0
  9. package/dist/cores/ably/ai-transport/react/index.d.ts +1 -0
  10. package/dist/cores/ably/ai-transport/react/index.js +1 -0
  11. package/dist/cores/ably/chat/index.cjs +1 -0
  12. package/dist/cores/ably/chat/index.d.cts +1 -0
  13. package/dist/cores/ably/chat/index.d.ts +1 -0
  14. package/dist/cores/ably/chat/index.js +1 -0
  15. package/dist/cores/ably/chat/react/index.cjs +1 -0
  16. package/dist/cores/ably/chat/react/index.d.cts +1 -0
  17. package/dist/cores/ably/chat/react/index.d.ts +1 -0
  18. package/dist/cores/ably/chat/react/index.js +1 -0
  19. package/dist/cores/ably/index.cjs +1 -0
  20. package/dist/cores/ably/index.d.cts +1 -0
  21. package/dist/cores/ably/index.d.ts +1 -0
  22. package/dist/cores/ably/index.js +1 -0
  23. package/dist/cores/ably/liveobjects/index.cjs +1 -0
  24. package/dist/cores/ably/liveobjects/index.d.cts +1 -0
  25. package/dist/cores/ably/liveobjects/index.d.ts +1 -0
  26. package/dist/cores/ably/liveobjects/index.js +1 -0
  27. package/dist/cores/ably/liveobjects/react/index.cjs +1 -0
  28. package/dist/cores/ably/liveobjects/react/index.d.cts +1 -0
  29. package/dist/cores/ably/liveobjects/react/index.d.ts +1 -0
  30. package/dist/cores/ably/liveobjects/react/index.js +1 -0
  31. package/dist/cores/ably/modular/index.cjs +1 -0
  32. package/dist/cores/ably/modular/index.d.cts +1 -0
  33. package/dist/cores/ably/modular/index.d.ts +1 -0
  34. package/dist/cores/ably/modular/index.js +1 -0
  35. package/dist/cores/ably/push/index.cjs +1 -0
  36. package/dist/cores/ably/push/index.d.cts +2 -0
  37. package/dist/cores/ably/push/index.d.ts +2 -0
  38. package/dist/cores/ably/push/index.js +1 -0
  39. package/dist/cores/ably/react/index.cjs +1 -0
  40. package/dist/cores/ably/react/index.d.cts +1 -0
  41. package/dist/cores/ably/react/index.d.ts +1 -0
  42. package/dist/cores/ably/react/index.js +1 -0
  43. package/dist/cores/ably/spaces/index.cjs +1 -0
  44. package/dist/cores/ably/spaces/index.d.cts +1 -0
  45. package/dist/cores/ably/spaces/index.d.ts +1 -0
  46. package/dist/cores/ably/spaces/index.js +1 -0
  47. package/dist/cores/axios.cjs +1 -0
  48. package/dist/cores/axios.d.cts +3 -0
  49. package/dist/cores/axios.d.ts +3 -0
  50. package/dist/cores/axios.js +1 -0
  51. package/dist/cores/graphql/index.cjs +1 -0
  52. package/dist/cores/graphql/index.d.cts +1 -0
  53. package/dist/cores/graphql/index.d.ts +1 -0
  54. package/dist/cores/graphql/index.js +1 -0
  55. package/dist/cores/graphql/request.cjs +1 -0
  56. package/dist/cores/graphql/request.d.cts +1 -0
  57. package/dist/cores/graphql/request.d.ts +1 -0
  58. package/dist/cores/graphql/request.js +1 -0
  59. package/dist/cores/graphql/tag.cjs +1 -0
  60. package/dist/cores/graphql/tag.d.cts +1 -0
  61. package/dist/cores/graphql/tag.d.ts +1 -0
  62. package/dist/cores/graphql/tag.js +1 -0
  63. package/dist/cores/index.cjs +0 -0
  64. package/dist/cores/index.d.cts +1 -0
  65. package/dist/cores/index.d.ts +1 -0
  66. package/dist/cores/index.js +1 -0
  67. package/dist/cores/jose.cjs +1 -0
  68. package/dist/cores/jose.d.cts +1 -0
  69. package/dist/cores/jose.d.ts +1 -0
  70. package/dist/cores/jose.js +1 -0
  71. package/dist/cores/pg.cjs +1 -0
  72. package/dist/cores/pg.d.cts +3 -0
  73. package/dist/cores/pg.d.ts +3 -0
  74. package/dist/cores/pg.js +2 -0
  75. package/dist/cores/pg.js.map +1 -0
  76. package/dist/cores/postgres.cjs +1 -0
  77. package/dist/cores/postgres.d.cts +2 -0
  78. package/dist/cores/postgres.d.ts +2 -0
  79. package/dist/cores/postgres.js +2 -0
  80. package/dist/cores/postgres.js.map +1 -0
  81. package/dist/cores/supabase/index.cjs +1 -0
  82. package/dist/cores/supabase/index.d.cts +1 -0
  83. package/dist/cores/supabase/index.d.ts +1 -0
  84. package/dist/cores/supabase/index.js +1 -0
  85. package/dist/cores/supabase/postgrest.cjs +1 -0
  86. package/dist/cores/supabase/postgrest.d.cts +1 -0
  87. package/dist/cores/supabase/postgrest.d.ts +1 -0
  88. package/dist/cores/supabase/postgrest.js +1 -0
  89. package/dist/cores/supabase/server.cjs +1 -0
  90. package/dist/cores/supabase/server.d.cts +1 -0
  91. package/dist/cores/supabase/server.d.ts +1 -0
  92. package/dist/cores/supabase/server.js +1 -0
  93. package/dist/cores/supabase/ssr.cjs +1 -0
  94. package/dist/cores/supabase/ssr.d.cts +1 -0
  95. package/dist/cores/supabase/ssr.d.ts +1 -0
  96. package/dist/cores/supabase/ssr.js +1 -0
  97. package/dist/cores/uuid.cjs +1 -0
  98. package/dist/cores/uuid.d.cts +1 -0
  99. package/dist/cores/uuid.d.ts +1 -0
  100. package/dist/cores/uuid.js +1 -0
  101. package/dist/cores/zod.cjs +1 -0
  102. package/dist/cores/zod.d.cts +3 -0
  103. package/dist/cores/zod.d.ts +3 -0
  104. package/dist/cores/zod.js +1 -0
  105. package/dist/formatter-vjbCoK9k.d.ts +12 -0
  106. package/dist/formatter-vjbCoK9k.d.ts.map +1 -0
  107. package/dist/index.cjs +1 -0
  108. package/dist/index.d.cts +6 -0
  109. package/dist/index.d.ts +6 -0
  110. package/dist/index.js +1 -0
  111. package/dist/interface-BFsLlmGy.d.ts +1 -0
  112. package/dist/interface-ii8DV63k.d.cts +283 -0
  113. package/dist/interface-ii8DV63k.d.cts.map +1 -0
  114. package/dist/interface-ii8DV63k.d.ts +283 -0
  115. package/dist/interface-ii8DV63k.d.ts.map +1 -0
  116. package/dist/lib/permission.cjs +0 -0
  117. package/dist/lib/permission.d.cts +1 -0
  118. package/dist/lib/permission.d.ts +1 -0
  119. package/dist/lib/permission.js +1 -0
  120. package/dist/modules/auth/client/index.cjs +1 -0
  121. package/dist/modules/auth/client/index.d.cts +6 -0
  122. package/dist/modules/auth/client/index.d.ts +6 -0
  123. package/dist/modules/auth/client/index.js +1 -0
  124. package/dist/modules/auth/client/retry.cjs +1 -0
  125. package/dist/modules/auth/client/retry.d.cts +11 -0
  126. package/dist/modules/auth/client/retry.d.cts.map +1 -0
  127. package/dist/modules/auth/client/retry.d.ts +11 -0
  128. package/dist/modules/auth/client/retry.d.ts.map +1 -0
  129. package/dist/modules/auth/client/retry.js +2 -0
  130. package/dist/modules/auth/client/retry.js.map +1 -0
  131. package/dist/modules/auth/interface.cjs +1 -0
  132. package/dist/modules/auth/interface.d.cts +8 -0
  133. package/dist/modules/auth/interface.d.cts.map +1 -0
  134. package/dist/modules/auth/interface.d.ts +8 -0
  135. package/dist/modules/auth/interface.d.ts.map +1 -0
  136. package/dist/modules/auth/interface.js +2 -0
  137. package/dist/modules/auth/interface.js.map +1 -0
  138. package/dist/modules/auth/policy.cjs +1 -0
  139. package/dist/modules/auth/policy.d.cts +15 -0
  140. package/dist/modules/auth/policy.d.cts.map +1 -0
  141. package/dist/modules/auth/policy.d.ts +15 -0
  142. package/dist/modules/auth/policy.d.ts.map +1 -0
  143. package/dist/modules/auth/policy.js +2 -0
  144. package/dist/modules/auth/policy.js.map +1 -0
  145. package/dist/modules/auth/server/bearer.cjs +1 -0
  146. package/dist/modules/auth/server/bearer.d.cts +25 -0
  147. package/dist/modules/auth/server/bearer.d.cts.map +1 -0
  148. package/dist/modules/auth/server/bearer.d.ts +25 -0
  149. package/dist/modules/auth/server/bearer.d.ts.map +1 -0
  150. package/dist/modules/auth/server/bearer.js +2 -0
  151. package/dist/modules/auth/server/bearer.js.map +1 -0
  152. package/dist/modules/auth/server/claims.cjs +1 -0
  153. package/dist/modules/auth/server/claims.d.cts +37 -0
  154. package/dist/modules/auth/server/claims.d.cts.map +1 -0
  155. package/dist/modules/auth/server/claims.d.ts +37 -0
  156. package/dist/modules/auth/server/claims.d.ts.map +1 -0
  157. package/dist/modules/auth/server/claims.js +2 -0
  158. package/dist/modules/auth/server/claims.js.map +1 -0
  159. package/dist/modules/auth/server/crypto.cjs +1 -0
  160. package/dist/modules/auth/server/crypto.d.cts +3 -0
  161. package/dist/modules/auth/server/crypto.d.cts.map +1 -0
  162. package/dist/modules/auth/server/crypto.d.ts +3 -0
  163. package/dist/modules/auth/server/crypto.d.ts.map +1 -0
  164. package/dist/modules/auth/server/crypto.js +2 -0
  165. package/dist/modules/auth/server/crypto.js.map +1 -0
  166. package/dist/modules/auth/server/grant-guard.cjs +1 -0
  167. package/dist/modules/auth/server/grant-guard.d.cts +6 -0
  168. package/dist/modules/auth/server/grant-guard.d.cts.map +1 -0
  169. package/dist/modules/auth/server/grant-guard.d.ts +6 -0
  170. package/dist/modules/auth/server/grant-guard.d.ts.map +1 -0
  171. package/dist/modules/auth/server/grant-guard.js +2 -0
  172. package/dist/modules/auth/server/grant-guard.js.map +1 -0
  173. package/dist/modules/auth/server/identity-cache.cjs +1 -0
  174. package/dist/modules/auth/server/identity-cache.d.cts +8 -0
  175. package/dist/modules/auth/server/identity-cache.d.cts.map +1 -0
  176. package/dist/modules/auth/server/identity-cache.d.ts +8 -0
  177. package/dist/modules/auth/server/identity-cache.d.ts.map +1 -0
  178. package/dist/modules/auth/server/identity-cache.js +2 -0
  179. package/dist/modules/auth/server/identity-cache.js.map +1 -0
  180. package/dist/modules/auth/server/identity.cjs +1 -0
  181. package/dist/modules/auth/server/identity.d.cts +5 -0
  182. package/dist/modules/auth/server/identity.d.cts.map +1 -0
  183. package/dist/modules/auth/server/identity.d.ts +5 -0
  184. package/dist/modules/auth/server/identity.d.ts.map +1 -0
  185. package/dist/modules/auth/server/identity.js +2 -0
  186. package/dist/modules/auth/server/identity.js.map +1 -0
  187. package/dist/modules/auth/server/index.cjs +1 -0
  188. package/dist/modules/auth/server/index.d.cts +17 -0
  189. package/dist/modules/auth/server/index.d.ts +17 -0
  190. package/dist/modules/auth/server/index.js +1 -0
  191. package/dist/modules/auth/server/interface.cjs +0 -0
  192. package/dist/modules/auth/server/interface.d.cts +2 -0
  193. package/dist/modules/auth/server/interface.d.ts +3 -0
  194. package/dist/modules/auth/server/interface.js +1 -0
  195. package/dist/modules/auth/server/logout.cjs +1 -0
  196. package/dist/modules/auth/server/logout.d.cts +10 -0
  197. package/dist/modules/auth/server/logout.d.cts.map +1 -0
  198. package/dist/modules/auth/server/logout.d.ts +10 -0
  199. package/dist/modules/auth/server/logout.d.ts.map +1 -0
  200. package/dist/modules/auth/server/logout.js +2 -0
  201. package/dist/modules/auth/server/logout.js.map +1 -0
  202. package/dist/modules/auth/server/machine.cjs +1 -0
  203. package/dist/modules/auth/server/machine.d.cts +28 -0
  204. package/dist/modules/auth/server/machine.d.cts.map +1 -0
  205. package/dist/modules/auth/server/machine.d.ts +28 -0
  206. package/dist/modules/auth/server/machine.d.ts.map +1 -0
  207. package/dist/modules/auth/server/machine.js +2 -0
  208. package/dist/modules/auth/server/machine.js.map +1 -0
  209. package/dist/modules/auth/server/proof.cjs +1 -0
  210. package/dist/modules/auth/server/proof.d.cts +23 -0
  211. package/dist/modules/auth/server/proof.d.cts.map +1 -0
  212. package/dist/modules/auth/server/proof.d.ts +23 -0
  213. package/dist/modules/auth/server/proof.d.ts.map +1 -0
  214. package/dist/modules/auth/server/proof.js +2 -0
  215. package/dist/modules/auth/server/proof.js.map +1 -0
  216. package/dist/modules/auth/server/provider.cjs +1 -0
  217. package/dist/modules/auth/server/provider.d.cts +9 -0
  218. package/dist/modules/auth/server/provider.d.cts.map +1 -0
  219. package/dist/modules/auth/server/provider.d.ts +9 -0
  220. package/dist/modules/auth/server/provider.d.ts.map +1 -0
  221. package/dist/modules/auth/server/provider.js +2 -0
  222. package/dist/modules/auth/server/provider.js.map +1 -0
  223. package/dist/modules/auth/server/resource.cjs +1 -0
  224. package/dist/modules/auth/server/resource.d.cts +10 -0
  225. package/dist/modules/auth/server/resource.d.cts.map +1 -0
  226. package/dist/modules/auth/server/resource.d.ts +10 -0
  227. package/dist/modules/auth/server/resource.d.ts.map +1 -0
  228. package/dist/modules/auth/server/resource.js +2 -0
  229. package/dist/modules/auth/server/resource.js.map +1 -0
  230. package/dist/modules/auth/server/revocation.cjs +1 -0
  231. package/dist/modules/auth/server/revocation.d.cts +4 -0
  232. package/dist/modules/auth/server/revocation.d.cts.map +1 -0
  233. package/dist/modules/auth/server/revocation.d.ts +4 -0
  234. package/dist/modules/auth/server/revocation.d.ts.map +1 -0
  235. package/dist/modules/auth/server/revocation.js +2 -0
  236. package/dist/modules/auth/server/revocation.js.map +1 -0
  237. package/dist/modules/auth/server/user-info.cjs +1 -0
  238. package/dist/modules/auth/server/user-info.d.cts +19 -0
  239. package/dist/modules/auth/server/user-info.d.cts.map +1 -0
  240. package/dist/modules/auth/server/user-info.d.ts +19 -0
  241. package/dist/modules/auth/server/user-info.d.ts.map +1 -0
  242. package/dist/modules/auth/server/user-info.js +2 -0
  243. package/dist/modules/auth/server/user-info.js.map +1 -0
  244. package/dist/modules/common/admin.cjs +1 -0
  245. package/dist/modules/common/admin.d.cts +4 -0
  246. package/dist/modules/common/admin.d.cts.map +1 -0
  247. package/dist/modules/common/admin.d.ts +4 -0
  248. package/dist/modules/common/admin.d.ts.map +1 -0
  249. package/dist/modules/common/admin.js +2 -0
  250. package/dist/modules/common/admin.js.map +1 -0
  251. package/dist/modules/common/client.cjs +1 -0
  252. package/dist/modules/common/client.d.cts +118 -0
  253. package/dist/modules/common/client.d.cts.map +1 -0
  254. package/dist/modules/common/client.d.ts +118 -0
  255. package/dist/modules/common/client.d.ts.map +1 -0
  256. package/dist/modules/common/client.js +2 -0
  257. package/dist/modules/common/client.js.map +1 -0
  258. package/dist/modules/common/index.cjs +1 -0
  259. package/dist/modules/common/index.d.cts +6 -0
  260. package/dist/modules/common/index.d.ts +6 -0
  261. package/dist/modules/common/index.js +1 -0
  262. package/dist/modules/common/realtime.cjs +0 -0
  263. package/dist/modules/common/realtime.d.cts +2 -0
  264. package/dist/modules/common/realtime.d.ts +2 -0
  265. package/dist/modules/common/realtime.js +1 -0
  266. package/dist/modules/common/upload.cjs +1 -0
  267. package/dist/modules/common/upload.d.cts +4 -0
  268. package/dist/modules/common/upload.d.cts.map +1 -0
  269. package/dist/modules/common/upload.d.ts +4 -0
  270. package/dist/modules/common/upload.d.ts.map +1 -0
  271. package/dist/modules/common/upload.js +2 -0
  272. package/dist/modules/common/upload.js.map +1 -0
  273. package/dist/modules/database/index.cjs +1 -0
  274. package/dist/modules/database/index.d.cts +18 -0
  275. package/dist/modules/database/index.d.cts.map +1 -0
  276. package/dist/modules/database/index.d.ts +18 -0
  277. package/dist/modules/database/index.d.ts.map +1 -0
  278. package/dist/modules/database/index.js +2 -0
  279. package/dist/modules/database/index.js.map +1 -0
  280. package/dist/modules/database/postgres.cjs +1 -0
  281. package/dist/modules/database/postgres.d.cts +5 -0
  282. package/dist/modules/database/postgres.d.cts.map +1 -0
  283. package/dist/modules/database/postgres.d.ts +5 -0
  284. package/dist/modules/database/postgres.d.ts.map +1 -0
  285. package/dist/modules/database/postgres.js +2 -0
  286. package/dist/modules/database/postgres.js.map +1 -0
  287. package/dist/modules/desktop/index.cjs +1 -0
  288. package/dist/modules/desktop/index.d.cts +8 -0
  289. package/dist/modules/desktop/index.d.ts +8 -0
  290. package/dist/modules/desktop/index.js +1 -0
  291. package/dist/modules/desktop/interface.cjs +0 -0
  292. package/dist/modules/desktop/interface.d.cts +2 -0
  293. package/dist/modules/desktop/interface.d.ts +2 -0
  294. package/dist/modules/desktop/interface.js +1 -0
  295. package/dist/modules/desktop/proxy.cjs +1 -0
  296. package/dist/modules/desktop/proxy.d.cts +22 -0
  297. package/dist/modules/desktop/proxy.d.cts.map +1 -0
  298. package/dist/modules/desktop/proxy.d.ts +22 -0
  299. package/dist/modules/desktop/proxy.d.ts.map +1 -0
  300. package/dist/modules/desktop/proxy.js +2 -0
  301. package/dist/modules/desktop/proxy.js.map +1 -0
  302. package/dist/modules/desktop/release.cjs +1 -0
  303. package/dist/modules/desktop/release.d.cts +5 -0
  304. package/dist/modules/desktop/release.d.cts.map +1 -0
  305. package/dist/modules/desktop/release.d.ts +5 -0
  306. package/dist/modules/desktop/release.d.ts.map +1 -0
  307. package/dist/modules/desktop/release.js +2 -0
  308. package/dist/modules/desktop/release.js.map +1 -0
  309. package/dist/modules/desktop/rpc.cjs +1 -0
  310. package/dist/modules/desktop/rpc.d.cts +14 -0
  311. package/dist/modules/desktop/rpc.d.cts.map +1 -0
  312. package/dist/modules/desktop/rpc.d.ts +14 -0
  313. package/dist/modules/desktop/rpc.d.ts.map +1 -0
  314. package/dist/modules/desktop/rpc.js +2 -0
  315. package/dist/modules/desktop/rpc.js.map +1 -0
  316. package/dist/modules/desktop/shortcut.cjs +1 -0
  317. package/dist/modules/desktop/shortcut.d.cts +6 -0
  318. package/dist/modules/desktop/shortcut.d.cts.map +1 -0
  319. package/dist/modules/desktop/shortcut.d.ts +6 -0
  320. package/dist/modules/desktop/shortcut.d.ts.map +1 -0
  321. package/dist/modules/desktop/shortcut.js +2 -0
  322. package/dist/modules/desktop/shortcut.js.map +1 -0
  323. package/dist/modules/http/caller.cjs +1 -0
  324. package/dist/modules/http/caller.d.cts +18 -0
  325. package/dist/modules/http/caller.d.cts.map +1 -0
  326. package/dist/modules/http/caller.d.ts +18 -0
  327. package/dist/modules/http/caller.d.ts.map +1 -0
  328. package/dist/modules/http/caller.js +2 -0
  329. package/dist/modules/http/caller.js.map +1 -0
  330. package/dist/modules/http/error.cjs +1 -0
  331. package/dist/modules/http/error.d.cts +2 -0
  332. package/dist/modules/http/error.d.ts +2 -0
  333. package/dist/modules/http/error.js +2 -0
  334. package/dist/modules/http/error.js.map +1 -0
  335. package/dist/modules/http/failure.cjs +1 -0
  336. package/dist/modules/http/failure.d.cts +14 -0
  337. package/dist/modules/http/failure.d.cts.map +1 -0
  338. package/dist/modules/http/failure.d.ts +14 -0
  339. package/dist/modules/http/failure.d.ts.map +1 -0
  340. package/dist/modules/http/failure.js +2 -0
  341. package/dist/modules/http/failure.js.map +1 -0
  342. package/dist/modules/http/fetcher.cjs +1 -0
  343. package/dist/modules/http/fetcher.d.cts +6 -0
  344. package/dist/modules/http/fetcher.d.cts.map +1 -0
  345. package/dist/modules/http/fetcher.d.ts +6 -0
  346. package/dist/modules/http/fetcher.d.ts.map +1 -0
  347. package/dist/modules/http/fetcher.js +2 -0
  348. package/dist/modules/http/fetcher.js.map +1 -0
  349. package/dist/modules/http/index.cjs +1 -0
  350. package/dist/modules/http/index.d.cts +6 -0
  351. package/dist/modules/http/index.d.ts +6 -0
  352. package/dist/modules/http/index.js +1 -0
  353. package/dist/modules/http/response.cjs +1 -0
  354. package/dist/modules/http/response.d.cts +6 -0
  355. package/dist/modules/http/response.d.cts.map +1 -0
  356. package/dist/modules/http/response.d.ts +6 -0
  357. package/dist/modules/http/response.d.ts.map +1 -0
  358. package/dist/modules/http/response.js +2 -0
  359. package/dist/modules/http/response.js.map +1 -0
  360. package/dist/modules/supabase/express/client.cjs +1 -0
  361. package/dist/modules/supabase/express/client.d.cts +3 -0
  362. package/dist/modules/supabase/express/client.d.cts.map +1 -0
  363. package/dist/modules/supabase/express/client.d.ts +3 -0
  364. package/dist/modules/supabase/express/client.d.ts.map +1 -0
  365. package/dist/modules/supabase/express/client.js +2 -0
  366. package/dist/modules/supabase/express/client.js.map +1 -0
  367. package/dist/modules/supabase/express/index.cjs +1 -0
  368. package/dist/modules/supabase/express/index.d.cts +3 -0
  369. package/dist/modules/supabase/express/index.d.ts +3 -0
  370. package/dist/modules/supabase/express/index.js +1 -0
  371. package/dist/modules/supabase/express/server.cjs +1 -0
  372. package/dist/modules/supabase/express/server.d.cts +2 -0
  373. package/dist/modules/supabase/express/server.d.ts +2 -0
  374. package/dist/modules/supabase/express/server.js +1 -0
  375. package/dist/modules/supabase/next/client.cjs +1 -0
  376. package/dist/modules/supabase/next/client.d.cts +60 -0
  377. package/dist/modules/supabase/next/client.d.cts.map +1 -0
  378. package/dist/modules/supabase/next/client.d.ts +60 -0
  379. package/dist/modules/supabase/next/client.d.ts.map +1 -0
  380. package/dist/modules/supabase/next/client.js +2 -0
  381. package/dist/modules/supabase/next/client.js.map +1 -0
  382. package/dist/modules/supabase/next/index.cjs +1 -0
  383. package/dist/modules/supabase/next/index.d.cts +5 -0
  384. package/dist/modules/supabase/next/index.d.ts +5 -0
  385. package/dist/modules/supabase/next/index.js +1 -0
  386. package/dist/modules/supabase/next/middleware.cjs +1 -0
  387. package/dist/modules/supabase/next/middleware.d.cts +2 -0
  388. package/dist/modules/supabase/next/middleware.d.cts.map +1 -0
  389. package/dist/modules/supabase/next/middleware.d.ts +2 -0
  390. package/dist/modules/supabase/next/middleware.d.ts.map +1 -0
  391. package/dist/modules/supabase/next/middleware.js +2 -0
  392. package/dist/modules/supabase/next/middleware.js.map +1 -0
  393. package/dist/modules/supabase/next/server.cjs +1 -0
  394. package/dist/modules/supabase/next/server.d.cts +61 -0
  395. package/dist/modules/supabase/next/server.d.cts.map +1 -0
  396. package/dist/modules/supabase/next/server.d.ts +61 -0
  397. package/dist/modules/supabase/next/server.d.ts.map +1 -0
  398. package/dist/modules/supabase/next/server.js +2 -0
  399. package/dist/modules/supabase/next/server.js.map +1 -0
  400. package/dist/rolldown-runtime-BocRIvOZ.cjs +1 -0
  401. package/dist/utils/formatter.cjs +1 -0
  402. package/dist/utils/formatter.d.cts +11 -0
  403. package/dist/utils/formatter.d.cts.map +1 -0
  404. package/dist/utils/formatter.d.ts +2 -0
  405. package/dist/utils/formatter.js +2 -0
  406. package/dist/utils/formatter.js.map +1 -0
  407. package/dist/utils/interface.cjs +0 -0
  408. package/dist/utils/interface.d.cts +2 -0
  409. package/dist/utils/interface.d.ts +2 -0
  410. package/dist/utils/interface.js +1 -0
  411. package/dist/utils/normalization.cjs +1 -0
  412. package/dist/utils/normalization.d.cts +10 -0
  413. package/dist/utils/normalization.d.cts.map +1 -0
  414. package/dist/utils/normalization.d.ts +10 -0
  415. package/dist/utils/normalization.d.ts.map +1 -0
  416. package/dist/utils/normalization.js +2 -0
  417. package/dist/utils/normalization.js.map +1 -0
  418. package/docs/auth.md +189 -0
  419. package/docs/modules.md +100 -0
  420. package/package.json +198 -0
@@ -0,0 +1,283 @@
1
+ import { CookieMethodsServer } from "@supabase/ssr";
2
+ import { REALTIME_SUBSCRIBE_STATES, RealtimeChannel, RealtimeChannelOptions, SupabaseClient } from "@supabase/supabase-js";
3
+ import { AxiosInstance, AxiosRequestConfig, AxiosResponse, Method } from "axios";
4
+ import { ZodType } from "zod";
5
+ import { JWTPayload, JWTVerifyGetKey } from "jose";
6
+ import { ResourceRequestInput, VerifyAccessTokenRequestOptions } from "better-auth/oauth2";
7
+ import { BetterAuthOptions } from "better-auth";
8
+ declare class CallerError extends Error {
9
+ readonly status?: number;
10
+ readonly code?: string;
11
+ readonly details?: unknown;
12
+ constructor(message: string, options?: CallerErrorOptions);
13
+ }
14
+ /** Do not propagate raw Axios errors (which contain credentials and request bodies). */
15
+ declare function normalizeCallerError(error: unknown): CallerError;
16
+ interface AuthCookieInput {
17
+ secure: boolean;
18
+ maxAgeSeconds: number;
19
+ path?: string;
20
+ }
21
+ interface OAuthIdentityClaims {
22
+ sub: string;
23
+ name?: string;
24
+ email?: string;
25
+ email_verified?: boolean;
26
+ preferred_username?: string | null;
27
+ picture?: string | null;
28
+ }
29
+ type DatabaseSchema<T> = string & keyof Omit<T, "__InternalSupabase">;
30
+ type DefaultSchema<T> = "public" extends DatabaseSchema<T> ? "public" : DatabaseSchema<T>;
31
+ interface AuthRetryOptions {
32
+ /** App session read/refresh or trusted IPC; never return OAuth tokens. */
33
+ refresh(signal: AbortSignal): Promise<boolean>;
34
+ getStatus(error: unknown): number | undefined;
35
+ }
36
+ interface AuthRetryInput {
37
+ enabled?: boolean;
38
+ signal?: AbortSignal;
39
+ }
40
+ /** Public identity projection; provider roles never overwrite local roles. */
41
+ interface AuthIdentity {
42
+ subject: string;
43
+ name?: string;
44
+ email?: string;
45
+ emailVerified?: boolean;
46
+ username?: string | null;
47
+ image?: string | null;
48
+ }
49
+ interface AuthPolicy {
50
+ sessionMaxAgeMs: number;
51
+ transactionMaxAgeMs: number;
52
+ identityMaxAgeMs: number;
53
+ refreshLeewayMs: number;
54
+ clockToleranceSeconds: number;
55
+ logoutMaxAgeSeconds: number;
56
+ /** Cover the longest accepted access/app-session lifetime, not logout JWT expiry. */
57
+ revocationRetentionMs: number;
58
+ }
59
+ type AuthErrorCode = "invalid_configuration" | "rejected" | "forbidden" | "unavailable" | "cancelled";
60
+ interface AuthFreshnessInput {
61
+ verifiedAt: number;
62
+ accessExpiresAt: number;
63
+ fresh?: boolean;
64
+ }
65
+ interface AuthFreshness {
66
+ expired: boolean;
67
+ refresh: boolean;
68
+ verifyIdentity: boolean;
69
+ }
70
+ interface VerifiedLogout {
71
+ jti: string;
72
+ subject?: string;
73
+ sid?: string;
74
+ issuedAt: number;
75
+ receiptExpiresAt: number;
76
+ revokeUntil: number;
77
+ }
78
+ interface LogoutStorage {
79
+ /** One transaction: deduplicate jti, persist revocation, invalidate matching sessions.
80
+ * When both sid/sub exist, match BOTH. Subject-only markers apply to sessions
81
+ * created at/before the end of issuedAt's second (JWT iat has second precision).
82
+ * Fence insert/replace to prevent refresh resurrection.
83
+ */
84
+ apply(logout: VerifiedLogout): Promise<boolean>;
85
+ isRevoked(input: {
86
+ subject: string;
87
+ sid?: string;
88
+ issuedAt: number;
89
+ now: number;
90
+ }): Promise<boolean>;
91
+ }
92
+ interface ProofStorage {
93
+ /** Atomic insert-if-absent; a live replay key must never be overwritten. */
94
+ consume(key: string, expiresAt: number): Promise<boolean>;
95
+ }
96
+ interface LogoutVerifierOptions {
97
+ issuer: string;
98
+ clientId: string;
99
+ getVerificationKey(): Promise<JWTVerifyGetKey>;
100
+ storage: LogoutStorage;
101
+ algorithms?: readonly ("RS256" | "ES256" | "EdDSA")[];
102
+ requireSid?: boolean;
103
+ policy?: Partial<AuthPolicy>;
104
+ now?: () => number;
105
+ }
106
+ interface ResourceAuthOptions {
107
+ /** Explicit issuer/audience, trusted JWKS URL or confidential introspection configuration. */
108
+ verification: Omit<VerifyAccessTokenRequestOptions, "dpop">;
109
+ proof: ProofStorage;
110
+ revocation: LogoutStorage;
111
+ /** UserInfo/introspection supplied by the app. Reject inactive identity, throw unavailable on outages. */
112
+ verifyActive(claims: JWTPayload, request: ResourceRequestInput): Promise<void>;
113
+ onlineVerification: "always" | "sensitive";
114
+ /** Defaults true. A provider without sid must use onlineVerification: always. */
115
+ requireSid?: boolean;
116
+ allowLoopbackHttp?: boolean;
117
+ policy?: Partial<AuthPolicy>;
118
+ now?: () => number;
119
+ }
120
+ type CommonCookieMethods = Pick<CookieMethodsServer, "getAll" | "setAll">;
121
+ type SupabaseAnyClient = SupabaseClient<any, any, any>;
122
+ type RealtimeUtils = {
123
+ createChannel: (topic: string, options?: RealtimeChannelOptions) => RealtimeChannel;
124
+ subscribe: (channel: RealtimeChannel, callback?: (status: REALTIME_SUBSCRIBE_STATES, error?: Error) => void) => Promise<REALTIME_SUBSCRIBE_STATES>;
125
+ removeChannel: (channel: RealtimeChannel) => Promise<"ok" | "timed out" | "error">;
126
+ removeAllChannels: () => Promise<("ok" | "timed out" | "error")[]>;
127
+ };
128
+ type UploadInput = {
129
+ bucket: string;
130
+ path: string;
131
+ fileBody: File | Blob | ArrayBuffer | ArrayBufferView | string;
132
+ options?: Record<string, unknown>;
133
+ };
134
+ type UploadUtils = {
135
+ upload: (input: UploadInput) => Promise<any>;
136
+ upsert: (input: UploadInput) => Promise<any>;
137
+ remove: (bucket: string, paths: string[]) => Promise<any>;
138
+ getPublicUrl: (bucket: string, path: string) => {
139
+ data: {
140
+ publicUrl: string;
141
+ };
142
+ };
143
+ createSignedUrl: (bucket: string, path: string, expiresIn: number) => Promise<any>;
144
+ };
145
+ interface DesktopRpcRequest {
146
+ url: string;
147
+ method: "GET" | "POST";
148
+ body?: string;
149
+ }
150
+ interface DesktopRpcResponse {
151
+ status: number;
152
+ body: string;
153
+ }
154
+ interface DesktopRpcPolicy {
155
+ origin?: string;
156
+ endpoint?: string;
157
+ maxUrlLength?: number;
158
+ maxBodyBytes?: number;
159
+ maxResponseBytes?: number;
160
+ }
161
+ interface DesktopRpcHandlerOptions extends DesktopRpcPolicy {
162
+ handle(request: Request): Promise<Response>;
163
+ }
164
+ interface DesktopRpcTransportOptions extends DesktopRpcPolicy {
165
+ request(input: DesktopRpcRequest, signal?: AbortSignal): Promise<DesktopRpcResponse>;
166
+ }
167
+ interface ShortcutDefinition {
168
+ id: string;
169
+ label: string;
170
+ defaultAccelerator: string;
171
+ }
172
+ interface Shortcut extends ShortcutDefinition {
173
+ accelerator: string;
174
+ }
175
+ interface ShortcutPolicy {
176
+ isMac: boolean;
177
+ /** Reserved bindings/actions belong to each app, not this package. */
178
+ reserved: readonly string[];
179
+ }
180
+ type CallerResponseHandler<Data> = "json" | "text" | "blob" | "arrayBuffer" | "stream" | "content-type" | ((response: AxiosResponse<unknown>) => Data | Promise<Data>);
181
+ interface CallerToastOptions<Data> {
182
+ success?: string | ((data: Data) => string);
183
+ error?: string | ((error: CallerError) => string);
184
+ }
185
+ interface CallerRequestOptions<Data = unknown, Body = unknown, Params = Record<string, unknown>> extends Omit<AxiosRequestConfig<Body>, "url" | "method" | "data" | "params" | "auth" | "baseURL" | "signal"> {
186
+ url: string;
187
+ method?: Method;
188
+ body?: Body;
189
+ params?: Params;
190
+ query?: Params;
191
+ baseURL?: string | null;
192
+ signal?: AbortSignal;
193
+ auth?: boolean;
194
+ unwrapData?: boolean;
195
+ schema?: ZodType<Data>;
196
+ responseHandler?: CallerResponseHandler<Data>;
197
+ cache?: RequestCache;
198
+ credentials?: RequestCredentials;
199
+ redirect?: RequestRedirect;
200
+ /** Mutations must explicitly opt into replay after a 401 (idempotent/auth-before-write). */
201
+ retryUnsafe?: boolean;
202
+ toast?: boolean | CallerToastOptions<Data>;
203
+ onSuccess?(data: Data): void | Promise<void>;
204
+ onError?(error: CallerError): void | Promise<void>;
205
+ }
206
+ interface CallerOptions {
207
+ client: AxiosInstance;
208
+ refresh?(signal: AbortSignal): Promise<boolean>;
209
+ /** App supplies UI notification implementation. No UI dependency in this module. */
210
+ notify?(kind: "success" | "error", message: string): void;
211
+ /** Explicit sanitizer for trusted endpoint errors; never receive Axios config. */
212
+ mapError?(error: CallerError, responseData: unknown): CallerError;
213
+ canRetry?(url: string): boolean;
214
+ }
215
+ type CallerMethodOptions<Data, Body, Params> = Omit<CallerRequestOptions<Data, Body, Params>, "url" | "method" | "body">;
216
+ interface CallerErrorOptions {
217
+ status?: number;
218
+ code?: string;
219
+ /** Opt-in safe endpoint metadata only; never include Axios config/request/cause. */
220
+ details?: unknown;
221
+ }
222
+ interface FetcherOptions<Body = unknown, Params = Record<string, unknown>> extends Omit<AxiosRequestConfig<Body>, "url" | "method" | "data" | "params" | "withCredentials"> {
223
+ url: string | URL;
224
+ method: Method;
225
+ body?: Body;
226
+ params?: Params;
227
+ cache?: RequestCache;
228
+ credentials?: RequestCredentials;
229
+ redirect?: RequestRedirect;
230
+ }
231
+ interface WebResponseOptions {
232
+ /** Explicitly empty a successful body, as distinct from JSON null. */
233
+ emptyBody?: boolean;
234
+ /** Node streams need an app/runtime-specific conversion. */
235
+ mapBody?(data: unknown): BodyInit | null;
236
+ }
237
+ /** Validated identity only, never an authorization/session/token cache. */
238
+ interface IdentityCacheOptions<Value> {
239
+ load(credential: string): Promise<Value>;
240
+ /** Inject key derivation for non-token credentials; default is SHA-256. */
241
+ key?(credential: string): Promise<string>;
242
+ maxAgeMs?: number;
243
+ capacity?: number;
244
+ maxPending?: number;
245
+ now?: () => number;
246
+ }
247
+ interface IdentityCacheInput {
248
+ fresh?: boolean;
249
+ signal?: AbortSignal;
250
+ }
251
+ interface OAuthIdentityValidatorOptions {
252
+ providerId: string;
253
+ /** App-owned additional-field projection. Never match identities by email. */
254
+ subject(user: Parameters<NonNullable<NonNullable<BetterAuthOptions["user"]>["validateUserInfo"]>>[0]["user"]): unknown;
255
+ allowed?(profile: Record<string, unknown>): boolean | Promise<boolean>;
256
+ }
257
+ interface AuthSessionBinding {
258
+ id: string;
259
+ userId: string;
260
+ subject: string;
261
+ sid?: string;
262
+ expiresAt: number;
263
+ }
264
+ interface SessionGrantGuardOptions {
265
+ /** Authoritative native session read, not a cookie-cache-only result. */
266
+ read(): Promise<AuthSessionBinding | null>;
267
+ /** App verifies persistent revocation and current local permissions. */
268
+ assertAllowed(binding: Readonly<AuthSessionBinding>): Promise<void>;
269
+ now?: () => number;
270
+ }
271
+ interface AuthRevocation {
272
+ subject?: string;
273
+ sid?: string;
274
+ issuedAt: number;
275
+ expiresAt: number;
276
+ }
277
+ interface AuthRevocationIdentity {
278
+ subject: string;
279
+ sid?: string;
280
+ issuedAt: number;
281
+ }
282
+ export { LogoutVerifierOptions as A, SupabaseAnyClient as B, DesktopRpcRequest as C, IdentityCacheInput as D, FetcherOptions as E, ResourceAuthOptions as F, CallerError as G, UploadUtils as H, SessionGrantGuardOptions as I, normalizeCallerError as K, Shortcut as L, OAuthIdentityValidatorOptions as M, ProofStorage as N, IdentityCacheOptions as O, RealtimeUtils as P, ShortcutDefinition as R, DesktopRpcPolicy as S, DesktopRpcTransportOptions as T, VerifiedLogout as U, UploadInput as V, WebResponseOptions as W, CallerToastOptions as _, AuthIdentity as a, DefaultSchema as b, AuthRetryOptions as c, AuthSessionBinding as d, CallerErrorOptions as f, CallerResponseHandler as g, CallerRequestOptions as h, AuthFreshnessInput as i, OAuthIdentityClaims as j, LogoutStorage as k, AuthRevocation as l, CallerOptions as m, AuthErrorCode as n, AuthPolicy as o, CallerMethodOptions as p, AuthFreshness as r, AuthRetryInput as s, AuthCookieInput as t, AuthRevocationIdentity as u, CommonCookieMethods as v, DesktopRpcResponse as w, DesktopRpcHandlerOptions as x, DatabaseSchema as y, ShortcutPolicy as z };
283
+ //# sourceMappingURL=interface-ii8DV63k.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface-ii8DV63k.d.cts","names":[],"sources":["../src/modules/http/error.ts","../src/utils/interface.ts"],"mappings":"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"}
@@ -0,0 +1,283 @@
1
+ import { CookieMethodsServer } from "@supabase/ssr";
2
+ import { REALTIME_SUBSCRIBE_STATES, RealtimeChannel, RealtimeChannelOptions, SupabaseClient } from "@supabase/supabase-js";
3
+ import { AxiosInstance, AxiosRequestConfig, AxiosResponse, Method } from "axios";
4
+ import { ZodType } from "zod";
5
+ import { JWTPayload, JWTVerifyGetKey } from "jose";
6
+ import { ResourceRequestInput, VerifyAccessTokenRequestOptions } from "better-auth/oauth2";
7
+ import { BetterAuthOptions } from "better-auth";
8
+ declare class CallerError extends Error {
9
+ readonly status?: number;
10
+ readonly code?: string;
11
+ readonly details?: unknown;
12
+ constructor(message: string, options?: CallerErrorOptions);
13
+ }
14
+ /** Do not propagate raw Axios errors (which contain credentials and request bodies). */
15
+ declare function normalizeCallerError(error: unknown): CallerError;
16
+ interface AuthCookieInput {
17
+ secure: boolean;
18
+ maxAgeSeconds: number;
19
+ path?: string;
20
+ }
21
+ interface OAuthIdentityClaims {
22
+ sub: string;
23
+ name?: string;
24
+ email?: string;
25
+ email_verified?: boolean;
26
+ preferred_username?: string | null;
27
+ picture?: string | null;
28
+ }
29
+ type DatabaseSchema<T> = string & keyof Omit<T, "__InternalSupabase">;
30
+ type DefaultSchema<T> = "public" extends DatabaseSchema<T> ? "public" : DatabaseSchema<T>;
31
+ interface AuthRetryOptions {
32
+ /** App session read/refresh or trusted IPC; never return OAuth tokens. */
33
+ refresh(signal: AbortSignal): Promise<boolean>;
34
+ getStatus(error: unknown): number | undefined;
35
+ }
36
+ interface AuthRetryInput {
37
+ enabled?: boolean;
38
+ signal?: AbortSignal;
39
+ }
40
+ /** Public identity projection; provider roles never overwrite local roles. */
41
+ interface AuthIdentity {
42
+ subject: string;
43
+ name?: string;
44
+ email?: string;
45
+ emailVerified?: boolean;
46
+ username?: string | null;
47
+ image?: string | null;
48
+ }
49
+ interface AuthPolicy {
50
+ sessionMaxAgeMs: number;
51
+ transactionMaxAgeMs: number;
52
+ identityMaxAgeMs: number;
53
+ refreshLeewayMs: number;
54
+ clockToleranceSeconds: number;
55
+ logoutMaxAgeSeconds: number;
56
+ /** Cover the longest accepted access/app-session lifetime, not logout JWT expiry. */
57
+ revocationRetentionMs: number;
58
+ }
59
+ type AuthErrorCode = "invalid_configuration" | "rejected" | "forbidden" | "unavailable" | "cancelled";
60
+ interface AuthFreshnessInput {
61
+ verifiedAt: number;
62
+ accessExpiresAt: number;
63
+ fresh?: boolean;
64
+ }
65
+ interface AuthFreshness {
66
+ expired: boolean;
67
+ refresh: boolean;
68
+ verifyIdentity: boolean;
69
+ }
70
+ interface VerifiedLogout {
71
+ jti: string;
72
+ subject?: string;
73
+ sid?: string;
74
+ issuedAt: number;
75
+ receiptExpiresAt: number;
76
+ revokeUntil: number;
77
+ }
78
+ interface LogoutStorage {
79
+ /** One transaction: deduplicate jti, persist revocation, invalidate matching sessions.
80
+ * When both sid/sub exist, match BOTH. Subject-only markers apply to sessions
81
+ * created at/before the end of issuedAt's second (JWT iat has second precision).
82
+ * Fence insert/replace to prevent refresh resurrection.
83
+ */
84
+ apply(logout: VerifiedLogout): Promise<boolean>;
85
+ isRevoked(input: {
86
+ subject: string;
87
+ sid?: string;
88
+ issuedAt: number;
89
+ now: number;
90
+ }): Promise<boolean>;
91
+ }
92
+ interface ProofStorage {
93
+ /** Atomic insert-if-absent; a live replay key must never be overwritten. */
94
+ consume(key: string, expiresAt: number): Promise<boolean>;
95
+ }
96
+ interface LogoutVerifierOptions {
97
+ issuer: string;
98
+ clientId: string;
99
+ getVerificationKey(): Promise<JWTVerifyGetKey>;
100
+ storage: LogoutStorage;
101
+ algorithms?: readonly ("RS256" | "ES256" | "EdDSA")[];
102
+ requireSid?: boolean;
103
+ policy?: Partial<AuthPolicy>;
104
+ now?: () => number;
105
+ }
106
+ interface ResourceAuthOptions {
107
+ /** Explicit issuer/audience, trusted JWKS URL or confidential introspection configuration. */
108
+ verification: Omit<VerifyAccessTokenRequestOptions, "dpop">;
109
+ proof: ProofStorage;
110
+ revocation: LogoutStorage;
111
+ /** UserInfo/introspection supplied by the app. Reject inactive identity, throw unavailable on outages. */
112
+ verifyActive(claims: JWTPayload, request: ResourceRequestInput): Promise<void>;
113
+ onlineVerification: "always" | "sensitive";
114
+ /** Defaults true. A provider without sid must use onlineVerification: always. */
115
+ requireSid?: boolean;
116
+ allowLoopbackHttp?: boolean;
117
+ policy?: Partial<AuthPolicy>;
118
+ now?: () => number;
119
+ }
120
+ type CommonCookieMethods = Pick<CookieMethodsServer, "getAll" | "setAll">;
121
+ type SupabaseAnyClient = SupabaseClient<any, any, any>;
122
+ type RealtimeUtils = {
123
+ createChannel: (topic: string, options?: RealtimeChannelOptions) => RealtimeChannel;
124
+ subscribe: (channel: RealtimeChannel, callback?: (status: REALTIME_SUBSCRIBE_STATES, error?: Error) => void) => Promise<REALTIME_SUBSCRIBE_STATES>;
125
+ removeChannel: (channel: RealtimeChannel) => Promise<"ok" | "timed out" | "error">;
126
+ removeAllChannels: () => Promise<("ok" | "timed out" | "error")[]>;
127
+ };
128
+ type UploadInput = {
129
+ bucket: string;
130
+ path: string;
131
+ fileBody: File | Blob | ArrayBuffer | ArrayBufferView | string;
132
+ options?: Record<string, unknown>;
133
+ };
134
+ type UploadUtils = {
135
+ upload: (input: UploadInput) => Promise<any>;
136
+ upsert: (input: UploadInput) => Promise<any>;
137
+ remove: (bucket: string, paths: string[]) => Promise<any>;
138
+ getPublicUrl: (bucket: string, path: string) => {
139
+ data: {
140
+ publicUrl: string;
141
+ };
142
+ };
143
+ createSignedUrl: (bucket: string, path: string, expiresIn: number) => Promise<any>;
144
+ };
145
+ interface DesktopRpcRequest {
146
+ url: string;
147
+ method: "GET" | "POST";
148
+ body?: string;
149
+ }
150
+ interface DesktopRpcResponse {
151
+ status: number;
152
+ body: string;
153
+ }
154
+ interface DesktopRpcPolicy {
155
+ origin?: string;
156
+ endpoint?: string;
157
+ maxUrlLength?: number;
158
+ maxBodyBytes?: number;
159
+ maxResponseBytes?: number;
160
+ }
161
+ interface DesktopRpcHandlerOptions extends DesktopRpcPolicy {
162
+ handle(request: Request): Promise<Response>;
163
+ }
164
+ interface DesktopRpcTransportOptions extends DesktopRpcPolicy {
165
+ request(input: DesktopRpcRequest, signal?: AbortSignal): Promise<DesktopRpcResponse>;
166
+ }
167
+ interface ShortcutDefinition {
168
+ id: string;
169
+ label: string;
170
+ defaultAccelerator: string;
171
+ }
172
+ interface Shortcut extends ShortcutDefinition {
173
+ accelerator: string;
174
+ }
175
+ interface ShortcutPolicy {
176
+ isMac: boolean;
177
+ /** Reserved bindings/actions belong to each app, not this package. */
178
+ reserved: readonly string[];
179
+ }
180
+ type CallerResponseHandler<Data> = "json" | "text" | "blob" | "arrayBuffer" | "stream" | "content-type" | ((response: AxiosResponse<unknown>) => Data | Promise<Data>);
181
+ interface CallerToastOptions<Data> {
182
+ success?: string | ((data: Data) => string);
183
+ error?: string | ((error: CallerError) => string);
184
+ }
185
+ interface CallerRequestOptions<Data = unknown, Body = unknown, Params = Record<string, unknown>> extends Omit<AxiosRequestConfig<Body>, "url" | "method" | "data" | "params" | "auth" | "baseURL" | "signal"> {
186
+ url: string;
187
+ method?: Method;
188
+ body?: Body;
189
+ params?: Params;
190
+ query?: Params;
191
+ baseURL?: string | null;
192
+ signal?: AbortSignal;
193
+ auth?: boolean;
194
+ unwrapData?: boolean;
195
+ schema?: ZodType<Data>;
196
+ responseHandler?: CallerResponseHandler<Data>;
197
+ cache?: RequestCache;
198
+ credentials?: RequestCredentials;
199
+ redirect?: RequestRedirect;
200
+ /** Mutations must explicitly opt into replay after a 401 (idempotent/auth-before-write). */
201
+ retryUnsafe?: boolean;
202
+ toast?: boolean | CallerToastOptions<Data>;
203
+ onSuccess?(data: Data): void | Promise<void>;
204
+ onError?(error: CallerError): void | Promise<void>;
205
+ }
206
+ interface CallerOptions {
207
+ client: AxiosInstance;
208
+ refresh?(signal: AbortSignal): Promise<boolean>;
209
+ /** App supplies UI notification implementation. No UI dependency in this module. */
210
+ notify?(kind: "success" | "error", message: string): void;
211
+ /** Explicit sanitizer for trusted endpoint errors; never receive Axios config. */
212
+ mapError?(error: CallerError, responseData: unknown): CallerError;
213
+ canRetry?(url: string): boolean;
214
+ }
215
+ type CallerMethodOptions<Data, Body, Params> = Omit<CallerRequestOptions<Data, Body, Params>, "url" | "method" | "body">;
216
+ interface CallerErrorOptions {
217
+ status?: number;
218
+ code?: string;
219
+ /** Opt-in safe endpoint metadata only; never include Axios config/request/cause. */
220
+ details?: unknown;
221
+ }
222
+ interface FetcherOptions<Body = unknown, Params = Record<string, unknown>> extends Omit<AxiosRequestConfig<Body>, "url" | "method" | "data" | "params" | "withCredentials"> {
223
+ url: string | URL;
224
+ method: Method;
225
+ body?: Body;
226
+ params?: Params;
227
+ cache?: RequestCache;
228
+ credentials?: RequestCredentials;
229
+ redirect?: RequestRedirect;
230
+ }
231
+ interface WebResponseOptions {
232
+ /** Explicitly empty a successful body, as distinct from JSON null. */
233
+ emptyBody?: boolean;
234
+ /** Node streams need an app/runtime-specific conversion. */
235
+ mapBody?(data: unknown): BodyInit | null;
236
+ }
237
+ /** Validated identity only, never an authorization/session/token cache. */
238
+ interface IdentityCacheOptions<Value> {
239
+ load(credential: string): Promise<Value>;
240
+ /** Inject key derivation for non-token credentials; default is SHA-256. */
241
+ key?(credential: string): Promise<string>;
242
+ maxAgeMs?: number;
243
+ capacity?: number;
244
+ maxPending?: number;
245
+ now?: () => number;
246
+ }
247
+ interface IdentityCacheInput {
248
+ fresh?: boolean;
249
+ signal?: AbortSignal;
250
+ }
251
+ interface OAuthIdentityValidatorOptions {
252
+ providerId: string;
253
+ /** App-owned additional-field projection. Never match identities by email. */
254
+ subject(user: Parameters<NonNullable<NonNullable<BetterAuthOptions["user"]>["validateUserInfo"]>>[0]["user"]): unknown;
255
+ allowed?(profile: Record<string, unknown>): boolean | Promise<boolean>;
256
+ }
257
+ interface AuthSessionBinding {
258
+ id: string;
259
+ userId: string;
260
+ subject: string;
261
+ sid?: string;
262
+ expiresAt: number;
263
+ }
264
+ interface SessionGrantGuardOptions {
265
+ /** Authoritative native session read, not a cookie-cache-only result. */
266
+ read(): Promise<AuthSessionBinding | null>;
267
+ /** App verifies persistent revocation and current local permissions. */
268
+ assertAllowed(binding: Readonly<AuthSessionBinding>): Promise<void>;
269
+ now?: () => number;
270
+ }
271
+ interface AuthRevocation {
272
+ subject?: string;
273
+ sid?: string;
274
+ issuedAt: number;
275
+ expiresAt: number;
276
+ }
277
+ interface AuthRevocationIdentity {
278
+ subject: string;
279
+ sid?: string;
280
+ issuedAt: number;
281
+ }
282
+ export { LogoutVerifierOptions as A, SupabaseAnyClient as B, DesktopRpcRequest as C, IdentityCacheInput as D, FetcherOptions as E, ResourceAuthOptions as F, CallerError as G, UploadUtils as H, SessionGrantGuardOptions as I, normalizeCallerError as K, Shortcut as L, OAuthIdentityValidatorOptions as M, ProofStorage as N, IdentityCacheOptions as O, RealtimeUtils as P, ShortcutDefinition as R, DesktopRpcPolicy as S, DesktopRpcTransportOptions as T, VerifiedLogout as U, UploadInput as V, WebResponseOptions as W, CallerToastOptions as _, AuthIdentity as a, DefaultSchema as b, AuthRetryOptions as c, AuthSessionBinding as d, CallerErrorOptions as f, CallerResponseHandler as g, CallerRequestOptions as h, AuthFreshnessInput as i, OAuthIdentityClaims as j, LogoutStorage as k, AuthRevocation as l, CallerOptions as m, AuthErrorCode as n, AuthPolicy as o, CallerMethodOptions as p, AuthFreshness as r, AuthRetryInput as s, AuthCookieInput as t, AuthRevocationIdentity as u, CommonCookieMethods as v, DesktopRpcResponse as w, DesktopRpcHandlerOptions as x, DatabaseSchema as y, ShortcutPolicy as z };
283
+ //# sourceMappingURL=interface-ii8DV63k.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface-ii8DV63k.d.ts","names":[],"sources":["../src/modules/http/error.ts","../src/utils/interface.ts"],"mappings":"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"}
File without changes
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./retry.cjs"),t=require("../interface.cjs"),n=require("../policy.cjs");exports.AuthError=t.AuthError,exports.createAuthFreshnessPolicy=n.createAuthFreshnessPolicy,exports.createAuthPolicy=n.createAuthPolicy,exports.createAuthRetry=e.createAuthRetry,exports.waitForAuthOperation=e.waitForAuthOperation;
@@ -0,0 +1,6 @@
1
+ /** SDK owns login/useSession/signOut. This entry only coordinates request retries. */
2
+ import { createAuthRetry, waitForAuthOperation } from "./retry.cjs";
3
+ import { c as AuthRetryOptions, i as AuthFreshnessInput, n as AuthErrorCode, o as AuthPolicy, r as AuthFreshness, s as AuthRetryInput } from "../../../interface-ii8DV63k.cjs";
4
+ import { AuthError } from "../interface.cjs";
5
+ import { createAuthFreshnessPolicy, createAuthPolicy } from "../policy.cjs";
6
+ export { AuthError, type AuthErrorCode, type AuthFreshness, type AuthFreshnessInput, type AuthPolicy, type AuthRetryInput, type AuthRetryOptions, createAuthFreshnessPolicy, createAuthPolicy, createAuthRetry, waitForAuthOperation };
@@ -0,0 +1,6 @@
1
+ /** SDK owns login/useSession/signOut. This entry only coordinates request retries. */
2
+ import { createAuthRetry, waitForAuthOperation } from "./retry.js";
3
+ import { c as AuthRetryOptions, i as AuthFreshnessInput, n as AuthErrorCode, o as AuthPolicy, r as AuthFreshness, s as AuthRetryInput } from "../../../interface-ii8DV63k.js";
4
+ import { AuthError } from "../interface.js";
5
+ import { createAuthFreshnessPolicy, createAuthPolicy } from "../policy.js";
6
+ export { AuthError, type AuthErrorCode, type AuthFreshness, type AuthFreshnessInput, type AuthPolicy, type AuthRetryInput, type AuthRetryOptions, createAuthFreshnessPolicy, createAuthPolicy, createAuthRetry, waitForAuthOperation };
@@ -0,0 +1 @@
1
+ import{createAuthRetry as e,waitForAuthOperation as t}from"./retry.js";import{AuthError as n}from"../interface.js";import{createAuthFreshnessPolicy as r,createAuthPolicy as i}from"../policy.js";export{n as AuthError,r as createAuthFreshnessPolicy,i as createAuthPolicy,e as createAuthRetry,t as waitForAuthOperation};
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});async function e(e,t){return t?await new Promise((n,r)=>{let i=()=>{t.removeEventListener(`abort`,i),r(t.reason)};t.addEventListener(`abort`,i,{once:!0}),t.aborted&&i(),(async()=>{try{n(await e)}catch(e){r(e)}finally{t.removeEventListener(`abort`,i)}})()}):await e}function t(t){let n,r,i=0,a=!1;function o(){i++,r?.abort(),n=void 0}function s(){if(n)return n;r=new AbortController;let e=r.signal,o=i,s;return s=(async()=>{await Promise.resolve();try{return e.aborted||a||o!==i?!1:await t.refresh(e)&&o===i&&!a&&!e.aborted}catch{return!1}finally{n===s&&(n=void 0)}})(),n=s,s}return{async withAuthRetry(n,r={}){r.signal?.throwIfAborted();let o=i;try{return await n()}catch(c){if(r.signal?.throwIfAborted(),a||o!==i||r.enabled===!1||t.getStatus(c)!==401||!await e(s(),r.signal)||o!==i||a)throw c;return r.signal?.throwIfAborted(),await n()}},reset:o,dispose(){a=!0,o()}}}exports.createAuthRetry=t,exports.waitForAuthOperation=e;
@@ -0,0 +1,11 @@
1
+ import { c as AuthRetryOptions, s as AuthRetryInput } from "../../../interface-ii8DV63k.cjs";
2
+ /** Waiter cancellation must not abort a refresh needed by other requests. */
3
+ export declare function waitForAuthOperation<Value>(operation: Promise<Value>, signal?: AbortSignal): Promise<Value>;
4
+ /** One refresh flight per factory, one retry per request. Reset on logout/account change. */
5
+ export declare function createAuthRetry(options: AuthRetryOptions): {
6
+ withAuthRetry<Value>(request: () => Promise<Value>, input?: AuthRetryInput): Promise<Value>;
7
+ reset: () => void;
8
+ dispose(): void;
9
+ };
10
+ export type { AuthRetryInput, AuthRetryOptions };
11
+ //# sourceMappingURL=retry.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.d.cts","names":[],"sources":["../../../../src/modules/auth/client/retry.ts"],"mappings":";;wBAGsB,qBAAqB,OACzC,WAAW,QAAQ,QACnB,SAAS,cACR,QAAQ;;wBAuBK,gBAAgB,SAAS;EAoCjB,cAAA,OAAK,eACR,QAAQ,QAAM,QACtB,iBACN,QAAQ"}
@@ -0,0 +1,11 @@
1
+ import { c as AuthRetryOptions, s as AuthRetryInput } from "../../../interface-ii8DV63k.js";
2
+ /** Waiter cancellation must not abort a refresh needed by other requests. */
3
+ export declare function waitForAuthOperation<Value>(operation: Promise<Value>, signal?: AbortSignal): Promise<Value>;
4
+ /** One refresh flight per factory, one retry per request. Reset on logout/account change. */
5
+ export declare function createAuthRetry(options: AuthRetryOptions): {
6
+ withAuthRetry<Value>(request: () => Promise<Value>, input?: AuthRetryInput): Promise<Value>;
7
+ reset: () => void;
8
+ dispose(): void;
9
+ };
10
+ export type { AuthRetryInput, AuthRetryOptions };
11
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.d.ts","names":[],"sources":["../../../../src/modules/auth/client/retry.ts"],"mappings":";;wBAGsB,qBAAqB,OACzC,WAAW,QAAQ,QACnB,SAAS,cACR,QAAQ;;wBAuBK,gBAAgB,SAAS;EAoCjB,cAAA,OAAK,eACR,QAAQ,QAAM,QACtB,iBACN,QAAQ"}
@@ -0,0 +1,2 @@
1
+ async function e(e,t){return t?await new Promise((n,r)=>{let i=()=>{t.removeEventListener(`abort`,i),r(t.reason)};t.addEventListener(`abort`,i,{once:!0}),t.aborted&&i(),(async()=>{try{n(await e)}catch(e){r(e)}finally{t.removeEventListener(`abort`,i)}})()}):await e}function t(t){let n,r,i=0,a=!1;function o(){i++,r?.abort(),n=void 0}function s(){if(n)return n;r=new AbortController;let e=r.signal,o=i,s;return s=(async()=>{await Promise.resolve();try{return e.aborted||a||o!==i?!1:await t.refresh(e)&&o===i&&!a&&!e.aborted}catch{return!1}finally{n===s&&(n=void 0)}})(),n=s,s}return{async withAuthRetry(n,r={}){r.signal?.throwIfAborted();let o=i;try{return await n()}catch(c){if(r.signal?.throwIfAborted(),a||o!==i||r.enabled===!1||t.getStatus(c)!==401||!await e(s(),r.signal)||o!==i||a)throw c;return r.signal?.throwIfAborted(),await n()}},reset:o,dispose(){a=!0,o()}}}export{t as createAuthRetry,e as waitForAuthOperation};
2
+ //# sourceMappingURL=retry.js.map