@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,100 @@
1
+ # Shared modules
2
+
3
+ See [auth.md](auth.md) for SDK boundaries and breaking legacy removals.
4
+
5
+ | Module | Responsibility |
6
+ | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
7
+ | `modules/auth/client` | Framework-independent request retry coordination and freshness decisions |
8
+ | `modules/auth/server` | Identity cache/validator, native-session grant guard, revocation predicate, origin checks, native SDK resource verification and signed logout |
9
+ | `modules/http` | Injected Axios fetcher/caller, validation, safe errors, Web Response conversion |
10
+ | `modules/desktop` | Framework-free RPC packets and shortcut validation; not an auth engine |
11
+ | `modules/common` | Supabase admin/client/realtime/upload helpers |
12
+ | `modules/supabase/next` | Supabase SSR integration |
13
+ | `modules/supabase/express` | Supabase server/client integration |
14
+
15
+ All configuration, credentials, adapters, callbacks, runtime platform objects
16
+ and service destinations are supplied by the owning app. No module reads env,
17
+ connects to DB on import, creates a configured Better Auth instance, opens a
18
+ listener, or imports UI. Reusable contracts live in `src/utils/interface.ts`;
19
+ pure formatting lives in `src/utils/formatter.ts`. Internal module imports use
20
+ `@/` and async logic uses async/await with try/catch/finally.
21
+
22
+ HTTP callers retain injected runtime adapters (including desktop XHR) and do
23
+ not change QUIC/network settings. Caller mutations must opt into unsafe retries;
24
+ auth endpoints do not retry implicitly. Web Response conversion preserves
25
+ individual Set-Cookie, status and Location headers, and removes stale wire
26
+ encoding/length/hop-by-hop headers. Custom error mapping/notifications are app
27
+ callbacks, not UI package dependencies.
28
+
29
+ Desktop RPC still requires app-owned IPC sender/frame validation and trusted
30
+ preload transport. Shortcut policies/registration/persistence stay in the app.
31
+ Supabase credentials/RLS/ownership remain app responsibilities.
32
+
33
+ Use `bun run typecheck`, `bun run test`, `bun run test:types` and `bun run test:exports` before releasing. The app-owned Better Auth SDK peer and direct
34
+ import requirements are listed in auth.md. GitHub distribution remains private-to-npm;
35
+ pin consumers to a tested release commit/tag. No app dependency or DB/cloud state
36
+ is changed by building this package.
37
+
38
+ ## Shared infrastructure extraction (M03–M10, M15–M20)
39
+
40
+ These are library mechanisms, not an application migration. Use the public
41
+ `@gorth-io/structure` subpaths after publishing/installing a new version.
42
+ Better Auth remains an external host peer; `cores/auth/*` remains blocked.
43
+
44
+ | Public entry | API | Host responsibilities |
45
+ | --- | --- | --- |
46
+ | `modules/auth/server` | `createBearerVerifier`, `authFailure`, claim/continuity assertions | Trusted issuer/JWKS/audience, scopes, client-to-app binding, revocation and local ACL |
47
+ | `modules/auth/server` | `createOAuthProviderConfig`, `mapOAuthUserProfile` | Call native `genericOAuth`; create the auth instance, hooks, cookies, provider ID and app policy |
48
+ | `modules/auth/server` | `createUserInfoCache`, `oauthUserInfoSchema` | Inject loader/parser/admission predicate; own endpoint, transport and DB synchronization |
49
+ | `modules/auth/server` | `createAtomicProofStorage`, existing proof/logout/revocation helpers | Durable atomic expired-key replacement/insert-if-absent, SQL transactions, receipt persistence |
50
+ | `modules/auth/server` | `createMachineTokenRequest`, `parseMachineToken` | Supply credentials, scopes/resources and trusted token endpoint; execute the grant via bounded transport |
51
+ | `modules/http` | `ServiceError`, `serviceFailure` | Public error vocabulary; explicitly map other native/framework errors |
52
+ | `modules/database` | `parseDatabasePoolOptions`, `createDatabasePoolFactory` | Read env; cache, close and observe pools; own schema/migrations |
53
+ | `modules/database/postgres` | `createPostgresPool` | Node-only explicit factory call; no eager connection on import |
54
+ | `modules/desktop` | `releaseVersion`, `isNewerRelease`, `parseRelease`, proxy schema/config | Artifact trust/signatures, download/install, OS state and credentials |
55
+ | `modules/desktop` | `resolveDesktopRpcPolicy` | Forge/env/socket lifecycle, IPC origin/frame checks and renderer boundaries |
56
+ | `utils/normalization` | `parseHttpEndpoint`, `parseByteCount`, `parseEpochMilliseconds` | Destination allowlists and application-specific defaults; display formatters remain separate |
57
+
58
+ ```ts
59
+ import { genericOAuth } from "better-auth/plugins/generic-oauth";
60
+ import { createOAuthProviderConfig } from "@gorth-io/structure/modules/auth/server";
61
+
62
+ // All values/callbacks below come from the owning app's validated configuration.
63
+ const config = createOAuthProviderConfig({
64
+ ...providerOptions,
65
+ scopes: requestedScopes,
66
+ resources: registeredResources,
67
+ });
68
+ const providerPlugin = genericOAuth({ config: [config] });
69
+ ```
70
+
71
+ `createBearerVerifier` is JWT Bearer-only and rejects DPoP-bound grants. Use
72
+ the existing `createResourceAuth` with durable proof/revocation stores for DPoP.
73
+ Its `authorize` callback must still enforce the owning service's client/scope
74
+ binding and local status. `authFailure` projects safe codes/challenges, not raw
75
+ provider causes. `serviceFailure` omits validation input/custom messages.
76
+
77
+ `createUserInfoCache` adds typed profile parsing, expected-subject checking and
78
+ an injected admission predicate to the existing bounded/coalescing/fenced cache.
79
+ `createSessionGrantGuard` re-reads the app binding around native SDK operations;
80
+ `assertTokenContinuity` binds verified sub/sid to that local session. These helpers
81
+ do not implement refresh, account linking, user persistence or app authorization.
82
+
83
+ The replay adapter has no in-memory fallback. Its `reserve` callback must be
84
+ atomic across all deployment instances; tests using a fake store do not prove
85
+ production database atomicity. Rate-limit storage follows the same host-owned rule.
86
+
87
+ `createAtomicDpopReplayStore({ reserve })` accepts the native SDK reservation
88
+ directly. It preserves both `now` and `expiresAt` as Date values, so a durable SQL
89
+ adapter keeps the verifier's clock and transaction boundary. Duplicate reservations
90
+ return false; invalid input and storage failures fail closed. It does not verify
91
+ proofs or replace the native Better Auth DPoP verifier.
92
+
93
+ M16 implements data/protocol normalization only. No localized byte/date/name UI
94
+ formatter was moved from Primitive or an app. M19 exposes existing RPC option
95
+ validation; `.env.local` loading remains a host concern using the platform API.
96
+
97
+ Verification: `bun run typecheck`, `bun run test:types`, `bun run test`,
98
+ `bun run build`, then `bun run test:exports`. No install/publish/database command
99
+ is part of these checks. The Ably Spaces facade now follows its installed SDK's
100
+ named exports (`createSpacesClient`); that SDK no longer has a default export.
package/package.json ADDED
@@ -0,0 +1,198 @@
1
+ {
2
+ "name": "@gorth-io/structure",
3
+ "version": "0.0.0-alpha.10",
4
+ "description": "TypeScript infrastructure for HTTP clients, authentication coordination, Supabase, and database integrations in the gorth-io ecosystem.",
5
+ "type": "module",
6
+ "author": "Gorthenburg",
7
+ "license": "GORTH",
8
+ "private": false,
9
+ "keywords": [
10
+ "gorth",
11
+ "supabase",
12
+ "ably",
13
+ "postgres",
14
+ "graphql",
15
+ "better-auth",
16
+ "client",
17
+ "server",
18
+ "desktop"
19
+ ],
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/gorth-io/base-structure.git"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public",
26
+ "tag": "alpha",
27
+ "registry": "https://registry.npmjs.org"
28
+ },
29
+ "main": "./dist/index.cjs",
30
+ "module": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "files": [
33
+ "dist",
34
+ "docs/auth.md",
35
+ "docs/modules.md"
36
+ ],
37
+ "engines": {
38
+ "node": "24.x"
39
+ },
40
+ "packageManager": "bun@1.4.4",
41
+ "exports": {
42
+ "./modules/database": {
43
+ "types": "./dist/modules/database/index.d.ts",
44
+ "import": "./dist/modules/database/index.js",
45
+ "require": "./dist/modules/database/index.cjs"
46
+ },
47
+ "./utils/*": {
48
+ "types": "./dist/utils/*.d.ts",
49
+ "import": "./dist/utils/*.js",
50
+ "require": "./dist/utils/*.cjs"
51
+ },
52
+ "./modules/http": {
53
+ "types": "./dist/modules/http/index.d.ts",
54
+ "import": "./dist/modules/http/index.js",
55
+ "require": "./dist/modules/http/index.cjs"
56
+ },
57
+ "./modules/desktop": {
58
+ "types": "./dist/modules/desktop/index.d.ts",
59
+ "import": "./dist/modules/desktop/index.js",
60
+ "require": "./dist/modules/desktop/index.cjs"
61
+ },
62
+ "./modules/auth/client": {
63
+ "types": "./dist/modules/auth/client/index.d.ts",
64
+ "import": "./dist/modules/auth/client/index.js",
65
+ "require": "./dist/modules/auth/client/index.cjs"
66
+ },
67
+ "./modules/auth/server": {
68
+ "types": "./dist/modules/auth/server/index.d.ts",
69
+ "import": "./dist/modules/auth/server/index.js",
70
+ "require": "./dist/modules/auth/server/index.cjs"
71
+ },
72
+ ".": {
73
+ "types": "./dist/index.d.ts",
74
+ "import": "./dist/index.js",
75
+ "require": "./dist/index.cjs"
76
+ },
77
+ "./lib/*": {
78
+ "types": "./dist/lib/*.d.ts",
79
+ "import": "./dist/lib/*.js",
80
+ "require": "./dist/lib/*.cjs"
81
+ },
82
+ "./modules/*": {
83
+ "types": "./dist/modules/*.d.ts",
84
+ "import": "./dist/modules/*.js",
85
+ "require": "./dist/modules/*.cjs"
86
+ },
87
+ "./modules/*/*": {
88
+ "types": "./dist/modules/*/*.d.ts",
89
+ "import": "./dist/modules/*/*.js",
90
+ "require": "./dist/modules/*/*.cjs"
91
+ },
92
+ "./modules/*/*/*": {
93
+ "types": "./dist/modules/*/*/*.d.ts",
94
+ "import": "./dist/modules/*/*/*.js",
95
+ "require": "./dist/modules/*/*/*.cjs"
96
+ },
97
+ "./cores/*": {
98
+ "types": "./dist/cores/*.d.ts",
99
+ "import": "./dist/cores/*.js",
100
+ "require": "./dist/cores/*.cjs"
101
+ },
102
+ "./cores/*/*": {
103
+ "types": "./dist/cores/*/*.d.ts",
104
+ "import": "./dist/cores/*/*.js",
105
+ "require": "./dist/cores/*/*.cjs"
106
+ },
107
+ "./cores/*/*/*": {
108
+ "types": "./dist/cores/*/*/*.d.ts",
109
+ "import": "./dist/cores/*/*/*.js",
110
+ "require": "./dist/cores/*/*/*.cjs"
111
+ },
112
+ "./cores/auth": null,
113
+ "./cores/auth/*": null
114
+ },
115
+ "typesVersions": {
116
+ "*": {
117
+ "modules/database": [
118
+ "dist/modules/database/index.d.ts"
119
+ ],
120
+ "utils/*": [
121
+ "dist/utils/*.d.ts"
122
+ ],
123
+ "modules/http": [
124
+ "dist/modules/http/index.d.ts"
125
+ ],
126
+ "modules/desktop": [
127
+ "dist/modules/desktop/index.d.ts"
128
+ ],
129
+ "modules/auth/client": [
130
+ "dist/modules/auth/client/index.d.ts"
131
+ ],
132
+ "modules/auth/server": [
133
+ "dist/modules/auth/server/index.d.ts"
134
+ ],
135
+ "cores/*": [
136
+ "dist/cores/*.d.ts"
137
+ ],
138
+ "cores/*/*": [
139
+ "dist/cores/*/*.d.ts"
140
+ ],
141
+ "cores/*/*/*": [
142
+ "dist/cores/*/*/*.d.ts"
143
+ ],
144
+ "common/*": [
145
+ "dist/common/*.d.ts"
146
+ ],
147
+ "*": [
148
+ "dist/index.d.ts"
149
+ ]
150
+ }
151
+ },
152
+ "scripts": {
153
+ "build": "tsdown --minify",
154
+ "prepack": "bun run build",
155
+ "verify": "bun verify",
156
+ "dev": "tsdown --format esm,cjs --dts --out-dir dist --watch --no-clean",
157
+ "lint": "eslint",
158
+ "format": "prettier --write \"**/*.{ts,tsx}\"",
159
+ "typecheck": "tsc --noEmit",
160
+ "update": "bun update",
161
+ "test": "node --import tsx --test tests/*.test.ts",
162
+ "test:types": "tsc --project tsconfig.test.json",
163
+ "test:exports": "node --test tests/auth-exports.test.mjs"
164
+ },
165
+ "dependencies": {
166
+ "@ably/ai-transport": "^0.11.0",
167
+ "@ably/chat": "^2.0.0",
168
+ "@ably/spaces": "^0.6.0",
169
+ "@supabase/postgrest-js": "^2.119.0",
170
+ "@supabase/server": "^1.9.2",
171
+ "@supabase/ssr": "^0.12.7",
172
+ "@supabase/supabase-js": "^2.119.0",
173
+ "ably": "^2.30.0",
174
+ "axios": "^1.21.1",
175
+ "graphql": "^16.14.2",
176
+ "graphql-request": "^7.4.0",
177
+ "graphql-tag": "^2.12.7",
178
+ "jose": "^6.2.17",
179
+ "pg": "^8.23.1",
180
+ "postgres": "^4.1.1",
181
+ "uuid": "^14.0.3",
182
+ "zod": "^4.6.7"
183
+ },
184
+ "devDependencies": {
185
+ "@types/node": "^26.6.6",
186
+ "@types/pg": "^8.23.1",
187
+ "better-auth": "1.7.21",
188
+ "eslint": "^9.39.5",
189
+ "prettier": "^3.10.0",
190
+ "tsdown": "^0.23.7",
191
+ "tsx": "^4.23.15",
192
+ "typescript": "^5.9.3",
193
+ "vitest": "^5.1.0"
194
+ },
195
+ "peerDependencies": {
196
+ "better-auth": "^1.7.21"
197
+ }
198
+ }