@aurabase/aurabase-js 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 (343) hide show
  1. package/README.md +26 -795
  2. package/{packages/aurabase/dist/AuraClient-DAtDbfPB.d.ts → dist/AuraClient-BcFE8u1v.d.cts} +1 -1
  3. package/{packages/aurabase/dist/AuraClient-DAtDbfPB.d.cts → dist/AuraClient-BcFE8u1v.d.ts} +1 -1
  4. package/{packages/aurabase/dist → dist}/index.d.cts +1 -1
  5. package/{packages/aurabase/dist → dist}/index.d.ts +1 -1
  6. package/{packages/aurabase/dist → dist}/ssr.d.cts +1 -1
  7. package/{packages/aurabase/dist → dist}/ssr.d.ts +1 -1
  8. package/package.json +72 -82
  9. package/.changeset/config.json +0 -11
  10. package/CHANGELOG.md +0 -30
  11. package/packages/ai/LICENSE +0 -21
  12. package/packages/ai/README.md +0 -106
  13. package/packages/ai/dist/index.cjs +0 -229
  14. package/packages/ai/dist/index.d.cts +0 -139
  15. package/packages/ai/dist/index.d.ts +0 -139
  16. package/packages/ai/dist/index.js +0 -226
  17. package/packages/ai/node_modules/.bin/esbuild +0 -19
  18. package/packages/ai/node_modules/.bin/tsc +0 -22
  19. package/packages/ai/node_modules/.bin/tsserver +0 -22
  20. package/packages/ai/node_modules/.bin/tsup +0 -22
  21. package/packages/ai/node_modules/.bin/tsup-node +0 -22
  22. package/packages/ai/node_modules/.bin/vite +0 -22
  23. package/packages/ai/node_modules/.bin/vitest +0 -22
  24. package/packages/ai/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  25. package/packages/ai/package.json +0 -61
  26. package/packages/ai/src/AiService.ts +0 -226
  27. package/packages/ai/src/index.ts +0 -18
  28. package/packages/ai/src/sse.ts +0 -141
  29. package/packages/ai/src/types.ts +0 -30
  30. package/packages/ai/tests/chat-stream.test.ts +0 -151
  31. package/packages/ai/tests/rag-namespaces.test.ts +0 -54
  32. package/packages/ai/tests/sse.test.ts +0 -69
  33. package/packages/ai/tsconfig.json +0 -5
  34. package/packages/ai/tsup.config.ts +0 -11
  35. package/packages/aurabase/LICENSE +0 -21
  36. package/packages/aurabase/README.md +0 -64
  37. package/packages/aurabase/node_modules/.bin/esbuild +0 -19
  38. package/packages/aurabase/node_modules/.bin/tsc +0 -22
  39. package/packages/aurabase/node_modules/.bin/tsserver +0 -22
  40. package/packages/aurabase/node_modules/.bin/tsup +0 -22
  41. package/packages/aurabase/node_modules/.bin/tsup-node +0 -22
  42. package/packages/aurabase/node_modules/.bin/vite +0 -22
  43. package/packages/aurabase/node_modules/.bin/vitest +0 -22
  44. package/packages/aurabase/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  45. package/packages/aurabase/package.json +0 -80
  46. package/packages/aurabase/src/AuraClient.ts +0 -237
  47. package/packages/aurabase/src/index.ts +0 -152
  48. package/packages/aurabase/src/ssr.ts +0 -156
  49. package/packages/aurabase/tests/ai-streaming-rag-e2e.test.ts +0 -82
  50. package/packages/aurabase/tests/ai.test.ts +0 -111
  51. package/packages/aurabase/tests/auth-admin.test.ts +0 -515
  52. package/packages/aurabase/tests/auth-e2e.test.ts +0 -135
  53. package/packages/aurabase/tests/auth-hardening.test.ts +0 -206
  54. package/packages/aurabase/tests/auth.test.ts +0 -947
  55. package/packages/aurabase/tests/database.test.ts +0 -230
  56. package/packages/aurabase/tests/db-types-e2e.test.ts +0 -217
  57. package/packages/aurabase/tests/dispose.test.ts +0 -23
  58. package/packages/aurabase/tests/foreign-token.e2e.test.ts +0 -129
  59. package/packages/aurabase/tests/functions.test.ts +0 -107
  60. package/packages/aurabase/tests/integration.test.ts +0 -413
  61. package/packages/aurabase/tests/live-production-validation.js +0 -241
  62. package/packages/aurabase/tests/live-sdk-production-validation.js +0 -293
  63. package/packages/aurabase/tests/mocks.ts +0 -139
  64. package/packages/aurabase/tests/notifications.test.ts +0 -314
  65. package/packages/aurabase/tests/observability-backup.test.ts +0 -186
  66. package/packages/aurabase/tests/observability-hook.test.ts +0 -130
  67. package/packages/aurabase/tests/production-robustness.test.ts +0 -268
  68. package/packages/aurabase/tests/public-api-surface.test.ts +0 -53
  69. package/packages/aurabase/tests/query-builder.test.ts +0 -329
  70. package/packages/aurabase/tests/readme-smoke-e2e.test.ts +0 -231
  71. package/packages/aurabase/tests/realtime-filter-e2e.test.ts +0 -344
  72. package/packages/aurabase/tests/refresh-locks.test.ts +0 -210
  73. package/packages/aurabase/tests/retry-option.test.ts +0 -17
  74. package/packages/aurabase/tests/rpc-e2e.test.ts +0 -254
  75. package/packages/aurabase/tests/rs256-local-e2e.test.ts +0 -114
  76. package/packages/aurabase/tests/rt-alias-public-e2e.test.ts +0 -235
  77. package/packages/aurabase/tests/rt-http-broadcast-e2e.test.ts +0 -124
  78. package/packages/aurabase/tests/service-role-guard.test.ts +0 -99
  79. package/packages/aurabase/tests/ssr.test.ts +0 -91
  80. package/packages/aurabase/tests/storage-backend-e2e.test.ts +0 -481
  81. package/packages/aurabase/tests/storage-sdk-parity-e2e.test.ts +0 -104
  82. package/packages/aurabase/tests/storage-transform-e2e.test.ts +0 -684
  83. package/packages/aurabase/tests/storage.test.ts +0 -55
  84. package/packages/aurabase/tests/types/client-generic.test-d.ts +0 -79
  85. package/packages/aurabase/tests/types/docs-snippets.test-d.ts +0 -571
  86. package/packages/aurabase/tests/types/error-code.test-d.ts +0 -53
  87. package/packages/aurabase/tsconfig.json +0 -5
  88. package/packages/aurabase/tsconfig.test-d.json +0 -5
  89. package/packages/aurabase/tsup.config.ts +0 -11
  90. package/packages/aurabase/vitest.config.ts +0 -16
  91. package/packages/aurabase/vitest.e2e.config.ts +0 -9
  92. package/packages/auth/LICENSE +0 -21
  93. package/packages/auth/README.md +0 -215
  94. package/packages/auth/dist/index.cjs +0 -1175
  95. package/packages/auth/dist/index.d.cts +0 -397
  96. package/packages/auth/dist/index.d.ts +0 -397
  97. package/packages/auth/dist/index.js +0 -1170
  98. package/packages/auth/node_modules/.bin/esbuild +0 -19
  99. package/packages/auth/node_modules/.bin/tsc +0 -22
  100. package/packages/auth/node_modules/.bin/tsserver +0 -22
  101. package/packages/auth/node_modules/.bin/tsup +0 -22
  102. package/packages/auth/node_modules/.bin/tsup-node +0 -22
  103. package/packages/auth/node_modules/.bin/vite +0 -22
  104. package/packages/auth/node_modules/.bin/vitest +0 -22
  105. package/packages/auth/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  106. package/packages/auth/package.json +0 -61
  107. package/packages/auth/src/AuthAdminService.ts +0 -149
  108. package/packages/auth/src/AuthService.ts +0 -1166
  109. package/packages/auth/src/SessionManager.ts +0 -92
  110. package/packages/auth/src/index.ts +0 -17
  111. package/packages/auth/src/jwks.ts +0 -337
  112. package/packages/auth/src/pkce.ts +0 -27
  113. package/packages/auth/src/types.ts +0 -89
  114. package/packages/auth/tests/auth-lifecycle.test.ts +0 -149
  115. package/packages/auth/tests/detect-session.test.ts +0 -361
  116. package/packages/auth/tests/getclaims.test.ts +0 -780
  117. package/packages/auth/tests/is-mfa-challenge.test.ts +0 -27
  118. package/packages/auth/tests/password-recovery.test.ts +0 -124
  119. package/packages/auth/tests/pkce.test.ts +0 -192
  120. package/packages/auth/tests/session-manager.test.ts +0 -103
  121. package/packages/auth/tests/set-session.test.ts +0 -139
  122. package/packages/auth/tests/verify-otp.test.ts +0 -153
  123. package/packages/auth/tsconfig.json +0 -5
  124. package/packages/auth/tsup.config.ts +0 -11
  125. package/packages/core/LICENSE +0 -21
  126. package/packages/core/README.md +0 -132
  127. package/packages/core/dist/index.cjs +0 -695
  128. package/packages/core/dist/index.d.cts +0 -1137
  129. package/packages/core/dist/index.d.ts +0 -1137
  130. package/packages/core/dist/index.js +0 -673
  131. package/packages/core/node_modules/.bin/esbuild +0 -22
  132. package/packages/core/node_modules/.bin/tsc +0 -22
  133. package/packages/core/node_modules/.bin/tsserver +0 -22
  134. package/packages/core/node_modules/.bin/tsup +0 -22
  135. package/packages/core/node_modules/.bin/tsup-node +0 -22
  136. package/packages/core/node_modules/.bin/vite +0 -22
  137. package/packages/core/node_modules/.bin/vitest +0 -22
  138. package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  139. package/packages/core/package.json +0 -57
  140. package/packages/core/src/AuraError.ts +0 -89
  141. package/packages/core/src/BaseService.ts +0 -44
  142. package/packages/core/src/client.ts +0 -34
  143. package/packages/core/src/cookie-utils.ts +0 -42
  144. package/packages/core/src/fetch.ts +0 -435
  145. package/packages/core/src/index.ts +0 -22
  146. package/packages/core/src/retry.ts +0 -63
  147. package/packages/core/src/serialize.ts +0 -6
  148. package/packages/core/src/stores/BaseAuthStore.ts +0 -164
  149. package/packages/core/src/stores/LocalAuthStore.ts +0 -199
  150. package/packages/core/src/types.ts +0 -1042
  151. package/packages/core/tests/auth-store.test.ts +0 -300
  152. package/packages/core/tests/error-code.test.ts +0 -61
  153. package/packages/core/tests/error.test.ts +0 -24
  154. package/packages/core/tests/fetch.test.ts +0 -286
  155. package/packages/core/tests/mocks.ts +0 -139
  156. package/packages/core/tests/observability.test.ts +0 -86
  157. package/packages/core/tests/refresh-hardening.test.ts +0 -164
  158. package/packages/core/tests/refresh-observability.test.ts +0 -111
  159. package/packages/core/tests/retry.test.ts +0 -106
  160. package/packages/core/tests/serialize.test.ts +0 -12
  161. package/packages/core/tests/timeout.test.ts +0 -79
  162. package/packages/core/tsconfig.json +0 -5
  163. package/packages/core/tsup.config.ts +0 -11
  164. package/packages/db/LICENSE +0 -21
  165. package/packages/db/README.md +0 -152
  166. package/packages/db/VENDORED.md +0 -93
  167. package/packages/db/dist/index.cjs +0 -544
  168. package/packages/db/dist/index.d.cts +0 -1111
  169. package/packages/db/dist/index.d.ts +0 -1111
  170. package/packages/db/dist/index.js +0 -541
  171. package/packages/db/node_modules/.bin/esbuild +0 -19
  172. package/packages/db/node_modules/.bin/tsc +0 -22
  173. package/packages/db/node_modules/.bin/tsserver +0 -22
  174. package/packages/db/node_modules/.bin/tsup +0 -22
  175. package/packages/db/node_modules/.bin/tsup-node +0 -22
  176. package/packages/db/node_modules/.bin/vite +0 -22
  177. package/packages/db/node_modules/.bin/vitest +0 -22
  178. package/packages/db/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  179. package/packages/db/package.json +0 -62
  180. package/packages/db/src/DatabaseService.ts +0 -170
  181. package/packages/db/src/QueryBuilder.ts +0 -830
  182. package/packages/db/src/index.ts +0 -2
  183. package/packages/db/src/pgrst-types/common/common.ts +0 -86
  184. package/packages/db/src/pgrst-types/common/rpc.ts +0 -151
  185. package/packages/db/src/pgrst-types/feature-flags.ts +0 -20
  186. package/packages/db/src/pgrst-types/types.ts +0 -134
  187. package/packages/db/src/select-query-parser/parser.ts +0 -479
  188. package/packages/db/src/select-query-parser/result.ts +0 -553
  189. package/packages/db/src/select-query-parser/types.ts +0 -132
  190. package/packages/db/src/select-query-parser/utils.ts +0 -707
  191. package/packages/db/tests/filters.test.ts +0 -81
  192. package/packages/db/tests/mutations-filtered.e2e.test.ts +0 -132
  193. package/packages/db/tests/mutations-filtered.test.ts +0 -188
  194. package/packages/db/tests/order.test.ts +0 -45
  195. package/packages/db/tests/rpc.test.ts +0 -41
  196. package/packages/db/tests/scale/build-large-schema.ts +0 -94
  197. package/packages/db/tests/scale/scale-compile.test.ts +0 -167
  198. package/packages/db/tests/schema.test.ts +0 -77
  199. package/packages/db/tests/single-accept.e2e.test.ts +0 -123
  200. package/packages/db/tests/single.test.ts +0 -211
  201. package/packages/db/tests/types/filters.test-d.ts +0 -52
  202. package/packages/db/tests/types/fixtures.ts +0 -40
  203. package/packages/db/tests/types/from-views.test-d.ts +0 -18
  204. package/packages/db/tests/types/mutations.test-d.ts +0 -23
  205. package/packages/db/tests/types/rpc.test-d.ts +0 -60
  206. package/packages/db/tests/types/schema-shape.test-d.ts +0 -8
  207. package/packages/db/tests/types/select-inference.test-d.ts +0 -38
  208. package/packages/db/tests/vendored/fixtures.ts +0 -83
  209. package/packages/db/tests/vendored/get-result.test-d.ts +0 -75
  210. package/packages/db/tsconfig.json +0 -5
  211. package/packages/db/tsconfig.test-d.json +0 -5
  212. package/packages/db/tsup.config.ts +0 -11
  213. package/packages/db/vitest.config.ts +0 -8
  214. package/packages/functions/LICENSE +0 -21
  215. package/packages/functions/README.md +0 -96
  216. package/packages/functions/dist/index.cjs +0 -173
  217. package/packages/functions/dist/index.d.cts +0 -81
  218. package/packages/functions/dist/index.d.ts +0 -81
  219. package/packages/functions/dist/index.js +0 -168
  220. package/packages/functions/node_modules/.bin/esbuild +0 -19
  221. package/packages/functions/node_modules/.bin/tsc +0 -22
  222. package/packages/functions/node_modules/.bin/tsserver +0 -22
  223. package/packages/functions/node_modules/.bin/tsup +0 -22
  224. package/packages/functions/node_modules/.bin/tsup-node +0 -22
  225. package/packages/functions/node_modules/.bin/vite +0 -22
  226. package/packages/functions/node_modules/.bin/vitest +0 -22
  227. package/packages/functions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  228. package/packages/functions/package.json +0 -60
  229. package/packages/functions/src/FunctionsService.ts +0 -188
  230. package/packages/functions/src/errors.ts +0 -70
  231. package/packages/functions/src/index.ts +0 -6
  232. package/packages/functions/tests/invoke.test.ts +0 -97
  233. package/packages/functions/tests/response-type-errors.test.ts +0 -135
  234. package/packages/functions/tsconfig.json +0 -5
  235. package/packages/functions/tsup.config.ts +0 -11
  236. package/packages/gen/LICENSE +0 -21
  237. package/packages/gen/README.md +0 -84
  238. package/packages/gen/dist/cli.cjs +0 -334
  239. package/packages/gen/dist/cli.d.cts +0 -1
  240. package/packages/gen/dist/cli.d.ts +0 -1
  241. package/packages/gen/dist/cli.js +0 -332
  242. package/packages/gen/dist/index.cjs +0 -257
  243. package/packages/gen/dist/index.d.cts +0 -12
  244. package/packages/gen/dist/index.d.ts +0 -12
  245. package/packages/gen/dist/index.js +0 -255
  246. package/packages/gen/node_modules/.bin/esbuild +0 -19
  247. package/packages/gen/node_modules/.bin/tsc +0 -22
  248. package/packages/gen/node_modules/.bin/tsserver +0 -22
  249. package/packages/gen/node_modules/.bin/tsup +0 -22
  250. package/packages/gen/node_modules/.bin/tsup-node +0 -22
  251. package/packages/gen/node_modules/.bin/vite +0 -22
  252. package/packages/gen/node_modules/.bin/vitest +0 -22
  253. package/packages/gen/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  254. package/packages/gen/package.json +0 -66
  255. package/packages/gen/src/cli.ts +0 -67
  256. package/packages/gen/src/generate.ts +0 -0
  257. package/packages/gen/src/index.ts +0 -2
  258. package/packages/gen/tests/compile.test.ts +0 -213
  259. package/packages/gen/tests/e2e.test.ts +0 -130
  260. package/packages/gen/tests/generate.test.ts +0 -396
  261. package/packages/gen/tsconfig.json +0 -5
  262. package/packages/gen/tsup.config.ts +0 -11
  263. package/packages/notifications/LICENSE +0 -21
  264. package/packages/notifications/README.md +0 -134
  265. package/packages/notifications/dist/index.cjs +0 -128
  266. package/packages/notifications/dist/index.d.cts +0 -81
  267. package/packages/notifications/dist/index.d.ts +0 -81
  268. package/packages/notifications/dist/index.js +0 -125
  269. package/packages/notifications/node_modules/.bin/esbuild +0 -19
  270. package/packages/notifications/node_modules/.bin/tsc +0 -22
  271. package/packages/notifications/node_modules/.bin/tsserver +0 -22
  272. package/packages/notifications/node_modules/.bin/tsup +0 -22
  273. package/packages/notifications/node_modules/.bin/tsup-node +0 -22
  274. package/packages/notifications/node_modules/.bin/vite +0 -22
  275. package/packages/notifications/node_modules/.bin/vitest +0 -22
  276. package/packages/notifications/package.json +0 -60
  277. package/packages/notifications/src/NotificationsService.ts +0 -230
  278. package/packages/notifications/src/index.ts +0 -19
  279. package/packages/notifications/tsconfig.json +0 -5
  280. package/packages/notifications/tsup.config.ts +0 -11
  281. package/packages/realtime/LICENSE +0 -21
  282. package/packages/realtime/README.md +0 -183
  283. package/packages/realtime/dist/index.cjs +0 -977
  284. package/packages/realtime/dist/index.d.cts +0 -259
  285. package/packages/realtime/dist/index.d.ts +0 -259
  286. package/packages/realtime/dist/index.js +0 -973
  287. package/packages/realtime/node_modules/.bin/esbuild +0 -19
  288. package/packages/realtime/node_modules/.bin/tsc +0 -22
  289. package/packages/realtime/node_modules/.bin/tsserver +0 -22
  290. package/packages/realtime/node_modules/.bin/tsup +0 -22
  291. package/packages/realtime/node_modules/.bin/tsup-node +0 -22
  292. package/packages/realtime/node_modules/.bin/vite +0 -22
  293. package/packages/realtime/node_modules/.bin/vitest +0 -22
  294. package/packages/realtime/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  295. package/packages/realtime/package.json +0 -60
  296. package/packages/realtime/src/AuraChannel.ts +0 -485
  297. package/packages/realtime/src/HeartbeatManager.ts +0 -73
  298. package/packages/realtime/src/RealtimeService.ts +0 -505
  299. package/packages/realtime/src/columnFilter.ts +0 -301
  300. package/packages/realtime/src/index.ts +0 -4
  301. package/packages/realtime/tests/ack-routing.test.ts +0 -81
  302. package/packages/realtime/tests/column-filter.test.ts +0 -144
  303. package/packages/realtime/tests/dispatch.test.ts +0 -191
  304. package/packages/realtime/tests/heartbeat.test.ts +0 -67
  305. package/packages/realtime/tests/http-broadcast.test.ts +0 -68
  306. package/packages/realtime/tests/realtime-token.test.ts +0 -43
  307. package/packages/realtime/tests/reconnect-race.test.ts +0 -149
  308. package/packages/realtime/tests/ref-id.test.ts +0 -34
  309. package/packages/realtime/tests/set-auth.test.ts +0 -70
  310. package/packages/realtime/tsconfig.json +0 -5
  311. package/packages/realtime/tsup.config.ts +0 -11
  312. package/packages/storage/LICENSE +0 -21
  313. package/packages/storage/README.md +0 -141
  314. package/packages/storage/dist/index.cjs +0 -333
  315. package/packages/storage/dist/index.d.cts +0 -185
  316. package/packages/storage/dist/index.d.ts +0 -185
  317. package/packages/storage/dist/index.js +0 -329
  318. package/packages/storage/node_modules/.bin/esbuild +0 -19
  319. package/packages/storage/node_modules/.bin/tsc +0 -22
  320. package/packages/storage/node_modules/.bin/tsserver +0 -22
  321. package/packages/storage/node_modules/.bin/tsup +0 -22
  322. package/packages/storage/node_modules/.bin/tsup-node +0 -22
  323. package/packages/storage/node_modules/.bin/vite +0 -22
  324. package/packages/storage/node_modules/.bin/vitest +0 -22
  325. package/packages/storage/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  326. package/packages/storage/package.json +0 -60
  327. package/packages/storage/src/DownloadBuilder.ts +0 -60
  328. package/packages/storage/src/StorageService.ts +0 -323
  329. package/packages/storage/src/index.ts +0 -2
  330. package/packages/storage/src/path.ts +0 -35
  331. package/packages/storage/src/transform.ts +0 -15
  332. package/packages/storage/tests/download.test.ts +0 -64
  333. package/packages/storage/tests/parity.test.ts +0 -154
  334. package/packages/storage/tests/path.test.ts +0 -87
  335. package/packages/storage/tests/transform.test.ts +0 -79
  336. package/packages/storage/tsconfig.json +0 -5
  337. package/packages/storage/tsup.config.ts +0 -11
  338. package/pnpm-workspace.yaml +0 -24
  339. package/tsconfig.base.json +0 -15
  340. /package/{packages/aurabase/dist → dist}/index.cjs +0 -0
  341. /package/{packages/aurabase/dist → dist}/index.js +0 -0
  342. /package/{packages/aurabase/dist → dist}/ssr.cjs +0 -0
  343. /package/{packages/aurabase/dist → dist}/ssr.js +0 -0
package/README.md CHANGED
@@ -1,69 +1,29 @@
1
- # Aurabase JavaScript SDK
1
+ # aurabase
2
2
 
3
- ![npm](https://img.shields.io/npm/v/aurabase) ![license](https://img.shields.io/badge/license-MIT-blue) ![node](https://img.shields.io/badge/node-%3E%3D20-brightgreen) ![TypeScript](https://img.shields.io/badge/TypeScript-5-blue)
3
+ Client JavaScript/TypeScript officiel d'Aurabase : point d'entrée principal du SDK, agrégeant les 8 packages de service (`@aurabase/*`) derrière `createClient`/`createAdminClient` et l'export `aurabase/ssr`.
4
4
 
5
- > **Pre-release — not yet published to npm.** Version numbers and badges above reflect the workspace version; there is no published `aurabase` package yet.
5
+ ![npm](https://img.shields.io/npm/v/aurabase) ![license](https://img.shields.io/badge/license-MIT-blue)
6
6
 
7
- Official JavaScript/TypeScript client for Aurabase.
8
-
9
- The package name is `aurabase`. It targets Node.js 20+ and browser runtimes with `fetch`, and it exports both ESM and CommonJS builds from `dist/`.
10
-
11
- ## Structure (monorepo)
12
-
13
- Le SDK est un monorepo pnpm. Le package `aurabase` agrège tous les sous-packages et reste le point d'entrée principal (surface publique inchangée).
14
-
15
- | Package | Contenu |
16
- |---|---|
17
- | `aurabase` | `createClient`, `createAdminClient`, `AuraClient`, `./ssr` — point d'entrée principal |
18
- | `@aurabase/core` | fetch, erreurs, types, stores, `BaseService`, interface `AuraClientLike` |
19
- | `@aurabase/auth` | `AuthService`, `AuthAdminService` |
20
- | `@aurabase/db` | `DatabaseService`, `QueryBuilder` |
21
- | `@aurabase/storage` | `StorageService` |
22
- | `@aurabase/realtime` | `RealtimeService`, `AuraChannel`, `HeartbeatManager` |
23
- | `@aurabase/functions` | `FunctionsService` |
24
- | `@aurabase/ai` | `AiService` |
25
- | `@aurabase/notifications` | `NotificationsService`, `NotificationsAdminService` |
26
- | `@aurabase/gen` | CLI `aurabase-gen` — générateur de types `Database` (dev-dependency, non inclus dans `aurabase`) |
27
-
28
- Import principal (inchangé) :
29
-
30
- ```ts
31
- import { createClient } from 'aurabase'
32
- ```
33
-
34
- Import ciblé (tree-shaking / usage avancé) :
35
-
36
- ```ts
37
- import { AuthService } from '@aurabase/auth'
38
- ```
39
-
40
- Développement (workspace pnpm, à la racine `aurabase-js/`) :
41
-
42
- ```bash
43
- pnpm install
44
- pnpm -r build # build tous les packages (ordre topologique)
45
- pnpm -r typecheck
46
- pnpm -r test
47
- ```
7
+ > Pre-release — pas encore publié sur npm.
48
8
 
49
9
  ## Installation
50
10
 
51
11
  ```bash
52
- npm install aurabase
12
+ npm i @aurabase/aurabase-js
53
13
  ```
54
14
 
55
- For local development inside this repository:
15
+ ## Rôle
56
16
 
57
- ```bash
58
- cd aurabase-js
59
- npm install
60
- npm run build
61
- ```
17
+ Ce package ne réimplémente aucune logique de service : il compose `AuthService`, `DatabaseService`, `StorageService`, `RealtimeService`, `FunctionsService`, `AiService` et `NotificationsService` (chacun dans son propre package `@aurabase/*`) derrière un seul client.
18
+
19
+ - `createClient(baseUrl, projectId, apiKey, options?)` — client applicatif standard.
20
+ - `createAdminClient(baseUrl, projectId, serviceRoleKey, options?)` — client serveur avec `authAdmin` (clé `service_role`, jamais côté navigateur).
21
+ - `aurabase/ssr` — `createServerClient`/`createBrowserClient` pour Next.js et frameworks SSR (cookies, session partagée serveur/navigateur).
62
22
 
63
23
  ## Quick Start
64
24
 
65
25
  ```ts
66
- import { createClient } from 'aurabase'
26
+ import { createClient } from '@aurabase/aurabase-js'
67
27
 
68
28
  const aura = createClient(
69
29
  'http://localhost:8080',
@@ -83,751 +43,22 @@ if (error) {
83
43
  }
84
44
  ```
85
45
 
86
- ## Client Creation
87
-
88
- ```ts
89
- import { createClient } from 'aurabase'
90
-
91
- const aura = createClient(baseUrl, projectId, apiKey)
92
- ```
93
-
94
- Arguments:
95
-
96
- - `baseUrl`: Aurabase gateway data-plane URL, for example `http://localhost:8080`.
97
- - `projectId`: project UUID or project identifier used by backend routes.
98
- - `apiKey`: project API key. Most data-plane operations require it.
99
-
100
- You can also pass options:
101
-
102
- ```ts
103
- const aura = createClient('http://localhost:8080', projectId, apiKey, {
104
- auth: { persistSession: true },
105
- fetch: customFetch,
106
- })
107
- ```
108
-
109
- Alternative form:
110
-
111
- ```ts
112
- const aura = createClient('http://localhost:8080', projectId, {
113
- apiKey,
114
- auth: { persistSession: false },
115
- })
116
- ```
117
-
118
- If no API key is provided, the SDK logs a warning. Public auth routes can still work, but most operations require the `apikey` header.
119
-
120
- ## Response Shape
121
-
122
- All service methods return an `AuraResponse<T>`:
123
-
124
- ```ts
125
- type AuraResponse<T> = {
126
- data: T | null
127
- error: {
128
- code: string
129
- message: string
130
- details?: unknown
131
- } | null
132
- meta?: {
133
- total?: number
134
- next_cursor?: string
135
- }
136
- }
137
- ```
138
-
139
- Example:
140
-
141
- ```ts
142
- const { data, error } = await aura.auth.getUser()
143
-
144
- if (error) {
145
- throw new Error(error.message)
146
- }
147
- ```
148
-
149
- Query builder calls can opt into throwing:
150
-
151
- ```ts
152
- const { data: post } = await aura.db
153
- .from('posts')
154
- .eq('id', postId)
155
- .single()
156
- .throwOnError()
157
- ```
158
-
159
- ## Auth
160
-
161
- The auth service is available at `aura.auth`.
162
-
163
- ### Email And Password
164
-
165
- ```ts
166
- const signup = await aura.auth.signUp({
167
- email: 'user@example.com',
168
- password: 'correct horse battery staple',
169
- })
170
-
171
- const login = await aura.auth.signInWithPassword({
172
- email: 'user@example.com',
173
- password: 'correct horse battery staple',
174
- })
175
-
176
- await aura.auth.signOut()
177
- ```
178
-
179
- Successful sign-up/sign-in responses save the access token, refresh token and user in the configured auth store.
180
-
181
- ### Session
182
-
183
- ```ts
184
- const session = await aura.auth.getSession()
185
- const refreshed = await aura.auth.refreshSession()
186
-
187
- const sessions = await aura.auth.listSessions()
188
- await aura.auth.revokeSession('session-id')
189
- await aura.auth.revokeAllSessions()
190
- ```
191
-
192
- The SDK performs lazy token refresh before authenticated HTTP requests when the stored access token is near expiry and a refresh token exists.
193
-
194
- ### Auth State
195
-
196
- ```ts
197
- const subscription = aura.auth.onAuthStateChange(({ event, user }) => {
198
- console.log(event, user?.email)
199
- })
200
-
201
- subscription.unsubscribe()
202
- ```
203
-
204
- Events currently emitted by the SDK (`AuthChangePayload.event`):
205
-
206
- - `INITIAL_SESSION` (emitted once on subscribe, Supabase parity)
207
- - `SIGNED_IN`
208
- - `SIGNED_OUT`
209
- - `TOKEN_REFRESHED`
210
- - `USER_UPDATED`
211
- - `MFA_CHALLENGE`
212
-
213
- ### User Profile
214
-
215
- ```ts
216
- const user = await aura.auth.getUser()
217
-
218
- await aura.auth.updateUser({
219
- email: 'new@example.com',
220
- data: { display_name: 'Ada' },
221
- })
222
-
223
- await aura.auth.updatePassword('new-password', 'current-password')
224
- ```
225
-
226
- ### Magic Links, OTP And Anonymous Auth
227
-
228
- ```ts
229
- await aura.auth.signInWithMagicLink({
230
- email: 'user@example.com',
231
- redirect_url: 'http://localhost:3000/auth/callback',
232
- })
233
-
234
- await aura.auth.signInWithEmailOtp('user@example.com')
235
- await aura.auth.verifyEmailOtp('user@example.com', '123456')
236
-
237
- await aura.auth.signInWithSmsOtp('+15551234567')
238
- await aura.auth.verifySmsOtp('+15551234567', '123456')
239
-
240
- await aura.auth.signInAnonymously()
241
- ```
242
-
243
- ### OAuth
244
-
245
- `signInWithOAuth` always returns `{ url }` in `data` (implicit flow by default), and additionally redirects the browser via `window.location.href` when a `window` is present.
246
-
247
- ```ts
248
- const { data, error } = await aura.auth.signInWithOAuth('github', {
249
- redirectTo: 'http://localhost:3000/auth/callback',
250
- scopes: 'read:user user:email',
251
- flowType: 'pkce', // opt-in; requires a persistent auth store (LocalAuthStore) in the browser
252
- })
253
-
254
- if (error) throw error
255
-
256
- // Server-side / SSR: no automatic redirect, redirect manually using data!.url
257
- console.log(data!.url)
258
- ```
259
-
260
- Native/mobile ID token exchange:
261
-
262
- ```ts
263
- await aura.auth.signInWithIdToken('google', idToken, accessToken)
264
- ```
265
-
266
- ### MFA
267
-
268
- ```ts
269
- const enrollment = await aura.auth.mfaEnroll()
270
-
271
- await aura.auth.mfaVerifySetup('123456')
272
-
273
- await aura.auth.mfaVerify({
274
- mfa_token: 'mfa-token-from-login-response',
275
- code: '123456',
276
- })
277
-
278
- await aura.auth.regenerateRecoveryCodes('123456')
279
- await aura.auth.mfaUnenroll('current-password')
280
- ```
281
-
282
- ### Identity Linking
283
-
284
- ```ts
285
- const identities = await aura.auth.listIdentities()
286
- const link = await aura.auth.linkIdentity('github')
287
- await aura.auth.unlinkIdentity('identity-id')
288
- ```
289
-
290
- ## Database
291
-
292
- The database service is available at `aura.db`.
293
-
294
- ### Select
295
-
296
- ```ts
297
- const posts = await aura.db
298
- .from('posts')
299
- .select('id,title,author_id')
300
- .eq('published', true)
301
- .order('created_at', 'desc')
302
- .limit(20)
303
- ```
304
-
305
- Supported filters:
306
-
307
- - `eq(column, value)`
308
- - `neq(column, value)`
309
- - `gt(column, value)`
310
- - `gte(column, value)`
311
- - `lt(column, value)`
312
- - `lte(column, value)`
313
- - `like(column, pattern)`
314
- - `ilike(column, pattern)`
315
- - `is(column, 'null' | 'not_null')`
316
- - `in(column, values)`
317
- - `or([{ column, op, value }])`
318
-
319
- Modifiers:
320
-
321
- - `select(columns)`
322
- - `order(column, 'asc' | 'desc')`
323
- - `limit(n)`
324
- - `offset(n)`
325
- - `count('exact' | 'estimated')`
326
- - `single()`
327
- - `throwOnError()`
328
-
329
- ### Single Row
330
-
331
- ```ts
332
- const post = await aura.db
333
- .from('posts')
334
- .eq('id', 'post-id')
335
- .single()
336
- ```
337
-
338
- ### Insert, Update, Delete, Upsert
339
-
340
- ```ts
341
- await aura.db.from('posts').insert({
342
- title: 'Hello',
343
- published: false,
344
- })
345
-
346
- await aura.db.from('posts').update('post-id', {
347
- published: true,
348
- })
349
-
350
- await aura.db.from('posts').delete('post-id')
351
-
352
- await aura.db.from('posts').upsert(
353
- { id: 'post-id', title: 'Updated' },
354
- { onConflict: 'id' },
355
- )
356
- ```
357
-
358
- ### Raw SQL And Schema
359
-
360
- ```ts
361
- const rows = await aura.db.sql('SELECT count(*) FROM posts')
362
- const schema = await aura.db.schema() // { tables, functions }
363
- ```
364
-
365
- Raw SQL is sent to `POST /v1/db/{project_id}/raw` and is subject to backend validation and rate limiting.
366
-
367
- ### RPC (Postgres Functions)
368
-
369
- ```ts
370
- const { data: sum } = await aura.db.rpc('add', { a: 1, b: 2 })
371
- const { data: thing } = await aura.db.rpc('list_things', {}).eq('id', 2).select('id,name').single()
372
- const { data, meta } = await aura.db.rpc('list_things', {}, { count: 'exact' })
373
- ```
374
-
375
- `options` accepts `{ count?: 'exact' | 'planned' | 'estimated'; head?: boolean; get?: boolean }`. Typed strictly when `Database['public']['Functions'][fn]` is known (see [Generated Database Types](#generated-database-types)); permissive otherwise. Postgres-only — see [`@aurabase/db` README](packages/db/README.md#fonctions-postgres-rpc) for the full reference.
376
-
377
- ## Storage
378
-
379
- The storage service is available at `aura.storage`.
380
-
381
- ### Buckets
382
-
383
- ```ts
384
- const buckets = await aura.storage.listBuckets()
385
-
386
- await aura.storage.createBucket('avatars', {
387
- public: true,
388
- fileSizeLimit: 5 * 1024 * 1024,
389
- allowedMimeTypes: ['image/png', 'image/jpeg'],
390
- })
391
-
392
- const bucket = await aura.storage.getBucket('avatars')
393
- await aura.storage.deleteBucket('avatars')
394
- ```
395
-
396
- ### Objects
397
-
398
- ```ts
399
- await aura.storage.upload('avatars', 'users/1.png', file, {
400
- contentType: 'image/png',
401
- upsert: true,
402
- })
403
-
404
- const files = await aura.storage.list('avatars', {
405
- prefix: 'users/',
406
- limit: 100,
407
- })
408
-
409
- const blob = await aura.storage.download('avatars', 'users/1.png')
410
-
411
- await aura.storage.copy('avatars', 'users/1.png', 'archive/1.png')
412
- await aura.storage.move('avatars', 'archive/1.png', 'users/1.png')
413
- await aura.storage.remove('avatars', ['users/1.png'])
414
-
415
- const metadata = await aura.storage.getMetadata('avatars', 'users/1.png')
416
- ```
417
-
418
- ### URLs
419
-
420
- ```ts
421
- const signed = await aura.storage.createSignedUrl('avatars', 'users/1.png', 600)
422
- const upload = await aura.storage.createSignedUploadUrl('avatars', 'users/1.png', 300)
423
-
424
- const publicUrl = aura.storage.getPublicUrl('avatars', 'users/1.png')
425
- ```
426
-
427
- ### Transformations d'image
428
-
429
- `getPublicUrl()`, `download()` et `createSignedUrl()` acceptent une option `{ transform: ImageTransform }` (`width`/`height`/`resize`/`quality`/`format`) pour un rendu à la volée côté backend (redimensionnement, recadrage, ré-encodage) :
430
-
431
- ```ts
432
- const thumbnail = aura.storage.getPublicUrl('avatars', 'users/1.png', {
433
- transform: { width: 200, resize: 'cover' },
434
- })
435
- ```
436
-
437
- Détails (flag projet, borne 2500px, `quality` JPEG uniquement, cache serveur des dérivés) : [README `@aurabase/storage`](packages/storage/README.md#transformations-dimage).
438
-
439
- ## Realtime
440
-
441
- The realtime service is available at `aura.realtime`, and `aura.channel(name)` is a shortcut for `aura.realtime.channel(name)`.
442
-
443
- ```ts
444
- const unsubscribe = aura.realtime.onStateChange((state) => {
445
- console.log('realtime state:', state)
446
- })
447
-
448
- aura.realtime.connect()
449
- ```
450
-
451
- Connection states:
452
-
453
- - `disconnected`
454
- - `connecting`
455
- - `connected`
456
- - `reconnecting`
457
-
458
- An application-level heartbeat (`ping`) is sent every **25 seconds** via a dedicated Worker to avoid browser timer throttling in background tabs. Automatic reconnection uses exponential backoff with jitter.
459
-
460
- ### Postgres Changes
461
-
462
- ```ts
463
- const channel = aura.channel('db:public.posts')
464
- .on(
465
- 'postgres_changes',
466
- { event: 'INSERT', schema: 'public', table: 'posts' },
467
- (payload) => {
468
- console.log('insert:', payload)
469
- },
470
- )
471
- .subscribe((status, error) => {
472
- console.log(status, error)
473
- })
474
-
475
- aura.realtime.connect()
476
- ```
477
-
478
- An optional `filter` field (PostgREST/Supabase syntax, `"column=operator.value"`) restricts events to rows matching the condition, e.g. `filter: 'room_id=eq.42'`. Supported operators: `eq, neq, lt, lte, gt, gte, in, like, ilike, is, match, imatch, isdistinct`, negation via `not.` (`status=not.eq.done`), and AND via commas (`room_id=eq.42,qty=gt.5`, commas inside `in.(...)` don't split conditions). Filtering is server-authoritative with a client-side fail-closed fallback; `DELETE` events are matched against the old row. Full reference: [`@aurabase/realtime` README](packages/realtime/README.md#filtres-de-colonne-postgres_changes).
479
-
480
- ### Broadcast
481
-
482
- ```ts
483
- const channel = aura.realtime.channel('room-1', {
484
- broadcast: { ack: true, self: true },
485
- })
486
-
487
- channel
488
- .on('broadcast', { event: 'cursor-pos' }, (payload) => {
489
- console.log(payload)
490
- })
491
- .subscribe()
492
-
493
- aura.realtime.connect()
494
-
495
- const status = await channel.send({
496
- type: 'broadcast',
497
- event: 'cursor-pos',
498
- payload: { x: 100, y: 200 },
499
- })
500
- ```
501
-
502
- `send()` resolves to `ok`, `timeout` or `error`.
503
-
504
- ### Presence
505
-
506
- ```ts
507
- const channel = aura.channel('room-1', {
508
- config: { presence: { key: 'user-1' } },
509
- })
510
-
511
- channel
512
- .on('presence', { event: 'sync' }, () => {
513
- console.log(channel.presenceState())
514
- })
515
- .on('presence', { event: 'join' }, console.log)
516
- .on('presence', { event: 'leave' }, console.log)
517
- .subscribe()
518
-
519
- aura.realtime.connect()
520
-
521
- await channel.track({ online_at: new Date().toISOString() })
522
- await channel.untrack()
523
- ```
524
-
525
- ### Cleanup
526
-
527
- ```ts
528
- aura.realtime.removeChannel('room-1')
529
- aura.realtime.removeAllChannels()
530
- aura.realtime.disconnect()
531
- unsubscribe()
532
- ```
533
-
534
- ## Functions
535
-
536
- The functions service is available at `aura.functions`.
537
-
538
- ```ts
539
- const result = await aura.functions.invoke('hello', {
540
- method: 'POST',
541
- path: '/welcome',
542
- headers: { 'x-request-source': 'sdk' },
543
- body: { name: 'Ada' },
544
- })
545
- ```
546
-
547
- Management helpers currently exposed by the SDK:
548
-
549
- ```ts
550
- await aura.functions.list()
551
- await aura.functions.get('hello')
552
-
553
- await aura.functions.listJobs({ status: 'pending', limit: 10 })
554
- await aura.functions.getJob('job-id')
555
-
556
- await aura.functions.listCronJobs()
557
- await aura.functions.createCronJob('nightly', '0 0 * * * *', 'hello', {
558
- payload: { ok: true },
559
- })
560
- await aura.functions.deleteCronJob('nightly')
561
- ```
562
-
563
- ## AI
564
-
565
- The AI service is available at `aura.ai`.
566
-
567
- ```ts
568
- const chat = await aura.ai.chat([
569
- { role: 'system', content: 'Answer briefly.' },
570
- { role: 'user', content: 'What is Aurabase?' },
571
- ], {
572
- temperature: 0.2,
573
- })
574
- ```
575
-
576
- Other methods:
577
-
578
- ```ts
579
- await aura.ai.embed({
580
- text: 'Aurabase is a BaaS platform.',
581
- namespace: 'docs',
582
- metadata: { source: 'readme' },
583
- })
584
-
585
- await aura.ai.semanticSearch('auth setup', 'docs', {
586
- top_k: 5,
587
- threshold: 0.7,
588
- })
589
-
590
- await aura.ai.ragIngest({
591
- namespace: 'docs',
592
- content: 'Aurabase uses a Rust gateway.',
593
- })
594
-
595
- await aura.ai.rag({
596
- namespace: 'docs',
597
- question: 'How does the gateway work?',
598
- })
599
-
600
- await aura.ai.nl2sql(
601
- 'How many users signed up today?',
602
- 'users(id uuid, created_at timestamptz)',
603
- )
604
- ```
605
-
606
- ## Notifications
46
+ ## Sous-packages
607
47
 
608
- The notifications service is available at `aura.notifications`.
609
-
610
- ```ts
611
- await aura.notifications.send(
612
- 'email',
613
- 'user@example.com',
614
- 'Welcome to Aurabase',
615
- {
616
- subject: 'Welcome',
617
- variables: { name: 'Ada' },
618
- },
619
- )
620
-
621
- await aura.notifications.list({ limit: 20 })
622
- await aura.notifications.get('notification-id')
623
- ```
624
-
625
- Templates:
626
-
627
- ```ts
628
- await aura.notifications.listTemplates()
629
- await aura.notifications.getTemplate('template-id')
630
-
631
- await aura.notifications.createTemplate({
632
- name: 'welcome',
633
- channel: 'email',
634
- subject: 'Welcome',
635
- body: 'Hello {{ name }}',
636
- variables: ['name'],
637
- })
638
-
639
- await aura.notifications.updateTemplate('template-id', {
640
- subject: 'New subject',
641
- })
642
-
643
- await aura.notifications.deleteTemplate('template-id')
644
- ```
645
-
646
- ## SSR Helpers
647
-
648
- Import SSR helpers from `aurabase/ssr`.
649
-
650
- ```ts
651
- import { createServerClient } from 'aurabase/ssr'
652
-
653
- const aura = createServerClient(baseUrl, projectId, {
654
- apiKey,
655
- cookies: {
656
- getAll: () => request.cookies.getAll(),
657
- setAll: (cookies) => {
658
- for (const cookie of cookies) {
659
- response.cookies.set(cookie.name, cookie.value, cookie.options)
660
- }
661
- },
662
- },
663
- })
664
- ```
665
-
666
- Browser helper:
667
-
668
- ```ts
669
- import { createBrowserClient } from 'aurabase/ssr'
670
-
671
- const aura = createBrowserClient(baseUrl, projectId, apiKey)
672
- ```
673
-
674
- Cookie utilities are also exported:
675
-
676
- ```ts
677
- import { parseCookieHeader, serializeCookieHeader } from 'aurabase/ssr'
678
- ```
679
-
680
- ## Custom Auth Storage
681
-
682
- By default:
683
-
684
- - Browser runtime uses `LocalAuthStore` when `localStorage` exists.
685
- - Node/runtime without `localStorage` uses `BaseAuthStore`.
686
- - Passing `auth.persistSession: false` uses in-memory storage.
687
- - Passing `auth.storage` uses your provided `BaseAuthStore` implementation.
688
-
689
- ```ts
690
- import { BaseAuthStore, createClient } from 'aurabase'
691
-
692
- const storage = new BaseAuthStore()
693
-
694
- const aura = createClient(baseUrl, projectId, apiKey, {
695
- auth: { storage },
696
- })
697
- ```
698
-
699
- ## Advanced Admin Auth API
700
-
701
- `AuthAdminService` is exported for advanced usage, but it is not exposed as an `aura.auth.admin` shortcut in the current client.
702
-
703
- ```ts
704
- import { AuthAdminService, createClient } from 'aurabase'
705
-
706
- const aura = createClient(baseUrl, projectId, apiKey)
707
- const authAdmin = new AuthAdminService(aura)
708
-
709
- await authAdmin.listUsers({ limit: 50 })
710
- await authAdmin.getSettings()
711
- ```
712
-
713
- Available admin helpers include user CRUD, ban/unban, magic link generation, audit log, auth settings and email templates.
714
-
715
- ## Headers And Authentication
716
-
717
- HTTP requests made through service helpers automatically inject:
718
-
719
- - `apikey: <apiKey>` when the client was created with an API key.
720
- - `Authorization: Bearer <access_token>` when the auth store has an access token.
721
- - `Content-Type: application/json` for JSON request bodies.
722
-
723
- Realtime WebSocket connections send auth through query params because browsers do not support custom WebSocket headers:
724
-
725
- - `?token=<access_token>`
726
- - `?apikey=<apiKey>`
727
-
728
- ## Scripts
729
-
730
- ```bash
731
- npm run build # build ESM/CJS/types with tsup
732
- npm run typecheck # run TypeScript without emitting files
733
- npm run test # run Vitest once
734
- npm run test:watch # run Vitest in watch mode
735
- ```
736
-
737
- ## Exports
738
-
739
- Root export:
740
-
741
- ```ts
742
- import {
743
- createClient,
744
- AuraClient,
745
- AuraError,
746
- isAuraError,
747
- BaseAuthStore,
748
- LocalAuthStore,
749
- QueryBuilder,
750
- } from 'aurabase'
751
- ```
752
-
753
- Service classes and public types are also exported from the root package.
754
-
755
- SSR export:
756
-
757
- ```ts
758
- import {
759
- createServerClient,
760
- createBrowserClient,
761
- parseCookieHeader,
762
- serializeCookieHeader,
763
- } from 'aurabase/ssr'
764
- ```
765
-
766
- ## Generated Database Types
767
-
768
- Database types are not hand-written: generate them from your project's live schema with the `@aurabase/gen` CLI, then pass them to `createClient<Database>` for typed `select()`/`insert()`/`update()`.
769
-
770
- ```bash
771
- npm i -D @aurabase/gen
772
-
773
- npx aurabase-gen \
774
- --url http://localhost:8080 \
775
- --project my-project \
776
- --key aura_anon_xxx \
777
- --out database.types.ts \
778
- --schema public \
779
- --type-name Database
780
- ```
781
-
782
- ```ts
783
- import { createClient } from 'aurabase'
784
- import type { Database } from './database.types' // generated by @aurabase/gen
785
-
786
- const aura = createClient<Database>('http://localhost:8080', 'my-project', 'aura_anon_xxx')
787
-
788
- // select()/insert()/update() are now inferred from the real columns of `posts`.
789
- const { data } = await aura.db.from('posts').select('id,title').eq('id', 'post-id').single()
790
- ```
791
-
792
- `Functions` is now generated from the project's Postgres functions (used by `db.rpc()` for strict `args` typing and scalar return typing). Generated `SetofOptions.to` is a placeholder that never matches a real table — `@aurabase/gen` doesn't resolve which table a `SETOF` return actually targets — so a SETOF function's `.select()` falls back to `Record<string, unknown>[]`. Strict column-level typing of a SETOF return requires a hand-written `Database` type with `SetofOptions.to` pointing at a real table. `Views`, `Enums` and `CompositeTypes` are still always generated empty (`Record<string, never>`) — only `Tables` and `Functions` are introspected today. Full CLI reference and limitations: [`@aurabase/gen` README](packages/gen/README.md).
793
-
794
- ## Current Limitations
795
-
796
- - `rpc()` is Postgres-only — not available on projects using MongoDB as the database engine (`aura.db.schema()` returns `functions: []` there).
797
- - No streaming responses (functions invocation and AI chat/RAG are request/response, not streamed).
798
- - No client-side query transforms/composition helpers beyond the `QueryBuilder` filters/modifiers listed above (parité postgrest-js partielle : pas de `range()`, `csv()`, `geojson()`, `explain()`, `abortSignal()`, `returns()`).
799
- - `AuthAdminService` is available via `client.authAdmin` (browser guard warns) or `createAdminClient()` (server-only, requires a `service_role` key).
800
- - Realtime requires a runtime with `WebSocket`.
801
- - File upload APIs require `FormData` and `Blob` support.
802
- - API behavior depends on the running Aurabase backend and project permissions.
803
-
804
- ## Package Documentation
805
-
806
- Each package below has its own README with detailed usage, limitations and links back here:
807
-
808
- | Package | README |
48
+ | Package | Contenu |
809
49
  |---|---|
810
- | `aurabase` (meta) | [packages/aurabase/README.md](packages/aurabase/README.md) |
811
- | `@aurabase/core` | [packages/core/README.md](packages/core/README.md) |
812
- | `@aurabase/auth` | [packages/auth/README.md](packages/auth/README.md) |
813
- | `@aurabase/db` | [packages/db/README.md](packages/db/README.md) |
814
- | `@aurabase/storage` | [packages/storage/README.md](packages/storage/README.md) |
815
- | `@aurabase/realtime` | [packages/realtime/README.md](packages/realtime/README.md) |
816
- | `@aurabase/functions` | [packages/functions/README.md](packages/functions/README.md) |
817
- | `@aurabase/ai` | [packages/ai/README.md](packages/ai/README.md) |
818
- | `@aurabase/notifications` | [packages/notifications/README.md](packages/notifications/README.md) |
819
- | `@aurabase/gen` | [packages/gen/README.md](packages/gen/README.md) |
50
+ | [`@aurabase/core`](../core) | fetch, erreurs, types, stores, `BaseService`, interface `AuraClientLike` |
51
+ | [`@aurabase/auth`](../auth) | `AuthService`, `AuthAdminService` |
52
+ | [`@aurabase/db`](../db) | `DatabaseService`, `QueryBuilder` |
53
+ | [`@aurabase/storage`](../storage) | `StorageService` |
54
+ | [`@aurabase/realtime`](../realtime) | `RealtimeService`, `AuraChannel`, `HeartbeatManager` |
55
+ | [`@aurabase/functions`](../functions) | `FunctionsService` |
56
+ | [`@aurabase/ai`](../ai) | `AiService` |
57
+ | [`@aurabase/notifications`](../notifications) | `NotificationsService`, `NotificationsAdminService` |
58
+ | [`@aurabase/gen`](../gen) | générateur CLI de types `Database` (dev-dependency, non inclus dans `aurabase`) |
820
59
 
821
- ## Releases & Versioning
822
-
823
- This monorepo uses [Changesets](https://github.com/changesets/changesets) to version and publish packages.
824
-
825
- ```bash
826
- pnpm changeset # describe the change (bump type + summary) — run per PR/feature
827
- pnpm changeset version # consume changesets, bump package.json versions, update changelogs
828
- git add . && git commit -m "chore: version packages"
829
- ```
60
+ Tous ces packages (hors `@aurabase/gen`) sont des dépendances directes de `aurabase` : les installer séparément n'est utile que pour du tree-shaking ciblé ou pour composer votre propre client.
830
61
 
831
- Release history: [CHANGELOG.md](./CHANGELOG.md).
62
+ ## Documentation
832
63
 
833
- Note: `.changeset/config.json` currently has `"access": "restricted"` — switch it to `"public"` before the first npm publish (all `@aurabase/*` packages and `aurabase` are meant to be public, scoped packages).
64
+ Cette page ne couvre que le rôle du package d'agrégation. Documentation de référence complète : voir le [README du dépôt](../../README.md).