@xylex-group/athena 2.4.1 → 2.6.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.
- package/README.md +52 -1
- package/bin/athena-js.js +0 -0
- package/dist/browser.cjs +1912 -49
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +8 -7
- package/dist/browser.d.ts +8 -7
- package/dist/browser.js +1905 -50
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +708 -22
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +3 -3
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +708 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/cookies.d.cts +1 -174
- package/dist/cookies.d.ts +1 -174
- package/dist/index-CVcQCGyG.d.cts +174 -0
- package/dist/index-CVcQCGyG.d.ts +174 -0
- package/dist/index.cjs +1912 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +1905 -50
- package/dist/index.js.map +1 -1
- package/dist/{model-form-4LPnOPAF.d.cts → model-form-BaHWi3gm.d.cts} +1 -1
- package/dist/{model-form-CO4-LmNC.d.ts → model-form-Dh6gWjL0.d.ts} +1 -1
- package/dist/{pipeline-CR4V15jF.d.ts → pipeline-Ce3pTw5h.d.ts} +1 -1
- package/dist/{pipeline-DZeExYMA.d.cts → pipeline-D1ZYeoH7.d.cts} +1 -1
- package/dist/{react-email-Buhcpglm.d.ts → react-email-B8O1Jeff.d.cts} +596 -23
- package/dist/{react-email-6mOyxBo4.d.cts → react-email-CDEF0jij.d.ts} +596 -23
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/{types-D1JvL21V.d.cts → types-CUuo4NDi.d.cts} +1 -1
- package/dist/{types-09Q4D86N.d.cts → types-DSX6AT5B.d.cts} +3 -3
- package/dist/{types-09Q4D86N.d.ts → types-DSX6AT5B.d.ts} +3 -3
- package/dist/{types-DU3gNdFv.d.ts → types-DapchQY5.d.ts} +1 -1
- package/package.json +193 -192
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# athena-js
|
|
2
2
|
|
|
3
|
-
current version: `2.
|
|
3
|
+
current version: `2.6.0`
|
|
4
4
|
`@xylex-group/athena` is a database driver and API gateway SDK that lets you interact with SQL backends over HTTP through a fluent builder API. It ships a typed query builder for Node.js / server environments plus Athena-native React hooks for client-side use.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
@@ -188,6 +188,56 @@ pnpm add @react-email/components @react-email/render
|
|
|
188
188
|
|
|
189
189
|
Auth responses follow the same envelope style: `{ ok, status, data, error, errorDetails, raw }`.
|
|
190
190
|
|
|
191
|
+
#### Native auth bootstrap helpers
|
|
192
|
+
|
|
193
|
+
If you want to remove `better-auth` from an app that is already aligned to
|
|
194
|
+
Athena Auth session semantics, the SDK now ships a native bootstrap layer with
|
|
195
|
+
an Athena-native `athenaAuth({...})` export that matches the Better Auth
|
|
196
|
+
top-level contract:
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
import { athenaAuth } from "@xylex-group/athena";
|
|
200
|
+
|
|
201
|
+
export function getAuth(env: {
|
|
202
|
+
DB: unknown;
|
|
203
|
+
ATHENA_AUTH_URL: string;
|
|
204
|
+
ATHENA_AUTH_SECRET: string;
|
|
205
|
+
GITHUB_CLIENT_ID: string;
|
|
206
|
+
GITHUB_CLIENT_SECRET: string;
|
|
207
|
+
}) {
|
|
208
|
+
return athenaAuth({
|
|
209
|
+
baseURL: env.ATHENA_AUTH_URL,
|
|
210
|
+
secret: env.ATHENA_AUTH_SECRET,
|
|
211
|
+
database: env.DB,
|
|
212
|
+
socialProviders: {
|
|
213
|
+
github: {
|
|
214
|
+
clientId: env.GITHUB_CLIENT_ID,
|
|
215
|
+
clientSecret: env.GITHUB_CLIENT_SECRET,
|
|
216
|
+
scope: ["repo", "read:org", "user:email"],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
The returned auth object now carries the Better Auth-style top-level contract:
|
|
224
|
+
|
|
225
|
+
- `handler(request)`
|
|
226
|
+
- `api`
|
|
227
|
+
- `options`
|
|
228
|
+
- `$context`
|
|
229
|
+
- `$ERROR_CODES`
|
|
230
|
+
|
|
231
|
+
This native layer currently covers:
|
|
232
|
+
|
|
233
|
+
- typed auth bootstrap config
|
|
234
|
+
- session cookie set/clear helpers via the SDK cookie primitives
|
|
235
|
+
|
|
236
|
+
It also supports dynamic `baseURL` host resolution plus static/dynamic
|
|
237
|
+
`trustedOrigins` and `trustedProviders` on the native server bootstrap.
|
|
238
|
+
|
|
239
|
+
For the full details and current scope, see [`docs/auth/server-bootstrap.mdx`](docs/auth/server-bootstrap.mdx).
|
|
240
|
+
|
|
191
241
|
### Typed schema registry (model-first)
|
|
192
242
|
|
|
193
243
|
You can keep `createClient(...).from<T>(...)` as-is, or opt into a typed registry:
|
|
@@ -251,6 +301,7 @@ Generator supports:
|
|
|
251
301
|
- Multiple schema syncs such as `public` plus `athena`, with schema-safe default output paths
|
|
252
302
|
- Placeholder-driven output paths
|
|
253
303
|
- Feature flags (`features.emitRegistry`, `features.emitRelations`)
|
|
304
|
+
- Typed env-backed config fields via `generatorEnv(...)` for connection strings, schema lists, naming styles, flags, and placeholder maps
|
|
254
305
|
|
|
255
306
|
For full generator configuration and troubleshooting, see [`docs/generator-config.md`](./docs/generator-config.md).
|
|
256
307
|
For full CLI commands, help behavior, and troubleshooting, see [`docs/cli-command-reference.md`](./docs/cli-command-reference.md).
|
package/bin/athena-js.js
CHANGED
|
File without changes
|