@noy-db/in-nextjs 0.4.0-pre.3 → 0.4.0-pre.5
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/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { Noydb, Vault } from '@noy-db/hub';
|
|
|
22
22
|
*
|
|
23
23
|
* The default session store reads an opaque session token from a
|
|
24
24
|
* cookie (`noydb_session` by default) and passes it to the hub. The
|
|
25
|
-
* token IS NOT the vault
|
|
25
|
+
* token IS NOT the vault secret — it's a reference token that
|
|
26
26
|
* the hub resolves against its own session table. Tokens rotate on
|
|
27
27
|
* every unlock and invalidate on logout.
|
|
28
28
|
*
|
|
@@ -140,7 +140,7 @@ declare function withVault<T extends Request, R>(vaultName: string, handler: (va
|
|
|
140
140
|
declare function withNoydb<T extends Request, R>(handler: (db: Noydb, request: T) => Promise<R>): (request: T) => Promise<R>;
|
|
141
141
|
/**
|
|
142
142
|
* Server action helper — write a new session on login. Called from a
|
|
143
|
-
* server action that validated the user's
|
|
143
|
+
* server action that validated the user's secret through
|
|
144
144
|
* `@noy-db/on-*` and received a session token back.
|
|
145
145
|
*/
|
|
146
146
|
declare function writeSession(value: {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * **@noy-db/in-nextjs** — Next.js App Router helpers for noy-db.\n *\n * Two surfaces:\n *\n * - **Default export** (this file): **server-only** helpers that\n * use Next's `cookies()` and `headers()` APIs. Import from\n * `@noy-db/in-nextjs` inside server components, route handlers,\n * and server actions.\n *\n * - **`@noy-db/in-nextjs/client`**: re-exports of `@noy-db/in-react`\n * hooks for client components. Import from\n * `@noy-db/in-nextjs/client` inside any `'use client'` file.\n *\n * Keeping them in separate entry points means Next's bundler prunes\n * the server helpers out of the client bundle automatically — no\n * manual `'use server'` / `'use client'` annotations needed.\n *\n * ## Cookie-based session\n *\n * The default session store reads an opaque session token from a\n * cookie (`noydb_session` by default) and passes it to the hub. The\n * token IS NOT the vault passphrase — it's a reference token that\n * the hub resolves against its own session table. Tokens rotate on\n * every unlock and invalidate on logout.\n *\n * ```ts\n * // app/invoices/page.tsx (server component)\n * import { getNoydb, getVault } from '@noy-db/in-nextjs'\n *\n * export default async function InvoicesPage() {\n * const db = await getNoydb()\n * const vault = await getVault(db, 'acme')\n * const invoices = await vault.collection('invoices').list()\n * return <InvoicesList items={invoices} />\n * }\n * ```\n *\n * ```ts\n * // app/api/invoices/route.ts (route handler)\n * import { withVault } from '@noy-db/in-nextjs'\n * import { NextResponse } from 'next/server'\n *\n * export const GET = withVault('acme', async (vault) => {\n * const invoices = await vault.collection('invoices').list()\n * return NextResponse.json(invoices)\n * })\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { Noydb, Vault } from '@noy-db/hub'\n\n// ─── Session-store abstraction ─────────────────────────────────────────\n\n/**\n * Pluggable session resolver. Default implementation reads from Next's\n * `cookies()` API; consumers can swap in a header-based or memory-based\n * resolver for testing or custom auth.\n */\nexport interface SessionStore {\n /** Returns the user id + session token for the current request, or null when absent. */\n read(): Promise<{ userId: string; sessionToken: string } | null>\n /** Write a new session token (called on unlock or rotation). */\n write(value: { userId: string; sessionToken: string; maxAgeSeconds?: number }): Promise<void>\n /** Clear the session (called on logout). */\n clear(): Promise<void>\n}\n\n/**\n * Duck-typed `cookies()` return — we don't import from `next/headers`\n * directly so tests don't need Next's runtime.\n */\nexport interface NextCookieJar {\n get(name: string): { name: string; value: string } | undefined\n set(name: string, value: string, options?: { httpOnly?: boolean; secure?: boolean; sameSite?: 'lax' | 'strict' | 'none'; maxAge?: number; path?: string }): void\n delete(name: string): void\n}\n\nexport interface CookieSessionOptions {\n /** How to obtain Next's cookie jar. Default dynamically imports `next/headers`. */\n readonly cookies?: () => Promise<NextCookieJar> | NextCookieJar\n /** Cookie name for the session token. Default `'noydb_session'`. */\n readonly cookieName?: string\n /** Cookie name for the user id. Default `'noydb_user'`. */\n readonly userCookieName?: string\n /** Cookie maxAge in seconds. Default 1 hour. */\n readonly maxAgeSeconds?: number\n}\n\nasync function defaultCookies(): Promise<NextCookieJar> {\n // Dynamic import keeps `next/headers` out of non-Next environments.\n const mod = (await import('next/headers').catch(() => null)) as\n | { cookies: () => Promise<NextCookieJar> | NextCookieJar }\n | null\n if (!mod) {\n throw new Error(\n \"[@noy-db/in-nextjs] `next/headers` is unavailable. Supply a custom `cookies` resolver \" +\n \"in cookieSession({ cookies: () => … }) when running outside a Next.js server context.\",\n )\n }\n return mod.cookies()\n}\n\n/** Build a cookie-backed session store for Next.js server contexts. */\nexport function cookieSession(options: CookieSessionOptions = {}): SessionStore {\n const cookieName = options.cookieName ?? 'noydb_session'\n const userCookieName = options.userCookieName ?? 'noydb_user'\n const getJar = options.cookies ?? defaultCookies\n const maxAgeSeconds = options.maxAgeSeconds ?? 3600\n\n return {\n async read() {\n const jar = await Promise.resolve(getJar())\n const sessionCookie = jar.get(cookieName)\n const userCookie = jar.get(userCookieName)\n if (!sessionCookie || !userCookie) return null\n return { userId: userCookie.value, sessionToken: sessionCookie.value }\n },\n async write(value) {\n const jar = await Promise.resolve(getJar())\n const opts = {\n httpOnly: true,\n secure: true,\n sameSite: 'lax' as const,\n path: '/',\n maxAge: value.maxAgeSeconds ?? maxAgeSeconds,\n }\n jar.set(cookieName, value.sessionToken, opts)\n jar.set(userCookieName, value.userId, opts)\n },\n async clear() {\n const jar = await Promise.resolve(getJar())\n jar.delete(cookieName)\n jar.delete(userCookieName)\n },\n }\n}\n\n// ─── Server helpers ────────────────────────────────────────────────────\n\n/**\n * The Noydb factory contract — consumers call `setNoydbFactory()` at\n * app init with whatever store + auth wiring they prefer. The factory\n * receives the current session and returns an opened Noydb instance.\n */\nexport type NoydbFactory = (session: { userId: string; sessionToken: string } | null) => Promise<Noydb>\n\nlet configured: { factory: NoydbFactory; session: SessionStore } | null = null\n\n/**\n * Configure the Next.js integration. Call once at app init (e.g. in\n * `app/layout.tsx` or a `lib/noydb.ts` module).\n */\nexport function configureNoydb(options: { factory: NoydbFactory; session?: SessionStore }): void {\n configured = {\n factory: options.factory,\n session: options.session ?? cookieSession(),\n }\n}\n\nfunction requireConfig(): NonNullable<typeof configured> {\n if (!configured) {\n throw new Error(\n \"[@noy-db/in-nextjs] configureNoydb({ factory, session }) must be called before getNoydb().\",\n )\n }\n return configured\n}\n\n/**\n * Server-only helper. Reads the current session from cookies, invokes\n * the configured factory, and returns an open `Noydb` instance.\n */\nexport async function getNoydb(): Promise<Noydb> {\n const { factory, session } = requireConfig()\n const current = await session.read()\n return factory(current)\n}\n\n/** Convenience: open a vault by name, returning the `Vault` directly. */\nexport async function getVault(db: Noydb, name: string): Promise<Vault> {\n return db.openVault(name)\n}\n\n/**\n * Route-handler wrapper. Opens the vault once per request and passes\n * it to your handler. The Noydb instance is closed on exit so the\n * session keys don't outlive the response.\n */\nexport function withVault<T extends Request, R>(\n vaultName: string,\n handler: (vault: Vault, request: T) => Promise<R>,\n): (request: T) => Promise<R> {\n return async (request: T) => {\n const db = await getNoydb()\n try {\n const vault = await db.openVault(vaultName)\n return await handler(vault, request)\n } finally {\n await safeClose(db)\n }\n }\n}\n\n/**\n * Route-handler wrapper that does NOT open a vault — use when the\n * handler needs direct `Noydb` access (e.g. managing multiple vaults\n * per request).\n */\nexport function withNoydb<T extends Request, R>(\n handler: (db: Noydb, request: T) => Promise<R>,\n): (request: T) => Promise<R> {\n return async (request: T) => {\n const db = await getNoydb()\n try {\n return await handler(db, request)\n } finally {\n await safeClose(db)\n }\n }\n}\n\n/**\n * Server action helper — write a new session on login. Called from a\n * server action that validated the user's passphrase through\n * `@noy-db/on-*` and received a session token back.\n */\nexport async function writeSession(value: { userId: string; sessionToken: string; maxAgeSeconds?: number }): Promise<void> {\n const { session } = requireConfig()\n await session.write(value)\n}\n\n/** Server action helper — clear the session on logout. */\nexport async function clearSession(): Promise<void> {\n const { session } = requireConfig()\n await session.clear()\n}\n\n/** Introspection — useful for tests. Resets the configured factory. */\nexport function resetNoydbConfig(): void {\n configured = null\n}\n\n/**\n * Defensively close a Noydb instance, tolerating sync + async close\n * signatures without tripping `await-thenable` lint.\n */\nasync function safeClose(db: Noydb): Promise<void> {\n try {\n const result: unknown = db.close()\n if (result && typeof (result as { then?: unknown }).then === 'function') {\n await (result as Promise<unknown>)\n }\n } catch {\n // best-effort — never block the response on teardown\n }\n}\n"],"mappings":";AA2FA,eAAe,iBAAyC;AAEtD,QAAM,MAAO,MAAM,OAAO,cAAc,EAAE,MAAM,MAAM,IAAI;AAG1D,MAAI,CAAC,KAAK;AACR,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,SAAO,IAAI,QAAQ;AACrB;AAGO,SAAS,cAAc,UAAgC,CAAC,GAAiB;AAC9E,QAAM,aAAa,QAAQ,cAAc;AACzC,QAAM,iBAAiB,QAAQ,kBAAkB;AACjD,QAAM,SAAS,QAAQ,WAAW;AAClC,QAAM,gBAAgB,QAAQ,iBAAiB;AAE/C,SAAO;AAAA,IACL,MAAM,OAAO;AACX,YAAM,MAAM,MAAM,QAAQ,QAAQ,OAAO,CAAC;AAC1C,YAAM,gBAAgB,IAAI,IAAI,UAAU;AACxC,YAAM,aAAa,IAAI,IAAI,cAAc;AACzC,UAAI,CAAC,iBAAiB,CAAC,WAAY,QAAO;AAC1C,aAAO,EAAE,QAAQ,WAAW,OAAO,cAAc,cAAc,MAAM;AAAA,IACvE;AAAA,IACA,MAAM,MAAM,OAAO;AACjB,YAAM,MAAM,MAAM,QAAQ,QAAQ,OAAO,CAAC;AAC1C,YAAM,OAAO;AAAA,QACX,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAM;AAAA,QACN,QAAQ,MAAM,iBAAiB;AAAA,MACjC;AACA,UAAI,IAAI,YAAY,MAAM,cAAc,IAAI;AAC5C,UAAI,IAAI,gBAAg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,IAAI,cAAc;AAClC,QAAM,QAAQ,MAAM;AACtB;AAGO,SAAS,mBAAyB;AACvC,eAAa;AACf;AAMA,eAAe,UAAU,IAA0B;AACjD,MAAI;AACF,UAAM,SAAkB,GAAG,MAAM;AACjC,QAAI,UAAU,OAAQ,OAA8B,SAAS,YAAY;AACvE,YAAO;AAAA,IACT;AAAA,EACF,QAAQ;AAAA,EAER;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * **@noy-db/in-nextjs** — Next.js App Router helpers for noy-db.\n *\n * Two surfaces:\n *\n * - **Default export** (this file): **server-only** helpers that\n * use Next's `cookies()` and `headers()` APIs. Import from\n * `@noy-db/in-nextjs` inside server components, route handlers,\n * and server actions.\n *\n * - **`@noy-db/in-nextjs/client`**: re-exports of `@noy-db/in-react`\n * hooks for client components. Import from\n * `@noy-db/in-nextjs/client` inside any `'use client'` file.\n *\n * Keeping them in separate entry points means Next's bundler prunes\n * the server helpers out of the client bundle automatically — no\n * manual `'use server'` / `'use client'` annotations needed.\n *\n * ## Cookie-based session\n *\n * The default session store reads an opaque session token from a\n * cookie (`noydb_session` by default) and passes it to the hub. The\n * token IS NOT the vault secret — it's a reference token that\n * the hub resolves against its own session table. Tokens rotate on\n * every unlock and invalidate on logout.\n *\n * ```ts\n * // app/invoices/page.tsx (server component)\n * import { getNoydb, getVault } from '@noy-db/in-nextjs'\n *\n * export default async function InvoicesPage() {\n * const db = await getNoydb()\n * const vault = await getVault(db, 'acme')\n * const invoices = await vault.collection('invoices').list()\n * return <InvoicesList items={invoices} />\n * }\n * ```\n *\n * ```ts\n * // app/api/invoices/route.ts (route handler)\n * import { withVault } from '@noy-db/in-nextjs'\n * import { NextResponse } from 'next/server'\n *\n * export const GET = withVault('acme', async (vault) => {\n * const invoices = await vault.collection('invoices').list()\n * return NextResponse.json(invoices)\n * })\n * ```\n *\n * @packageDocumentation\n */\n\nimport type { Noydb, Vault } from '@noy-db/hub'\n\n// ─── Session-store abstraction ─────────────────────────────────────────\n\n/**\n * Pluggable session resolver. Default implementation reads from Next's\n * `cookies()` API; consumers can swap in a header-based or memory-based\n * resolver for testing or custom auth.\n */\nexport interface SessionStore {\n /** Returns the user id + session token for the current request, or null when absent. */\n read(): Promise<{ userId: string; sessionToken: string } | null>\n /** Write a new session token (called on unlock or rotation). */\n write(value: { userId: string; sessionToken: string; maxAgeSeconds?: number }): Promise<void>\n /** Clear the session (called on logout). */\n clear(): Promise<void>\n}\n\n/**\n * Duck-typed `cookies()` return — we don't import from `next/headers`\n * directly so tests don't need Next's runtime.\n */\nexport interface NextCookieJar {\n get(name: string): { name: string; value: string } | undefined\n set(name: string, value: string, options?: { httpOnly?: boolean; secure?: boolean; sameSite?: 'lax' | 'strict' | 'none'; maxAge?: number; path?: string }): void\n delete(name: string): void\n}\n\nexport interface CookieSessionOptions {\n /** How to obtain Next's cookie jar. Default dynamically imports `next/headers`. */\n readonly cookies?: () => Promise<NextCookieJar> | NextCookieJar\n /** Cookie name for the session token. Default `'noydb_session'`. */\n readonly cookieName?: string\n /** Cookie name for the user id. Default `'noydb_user'`. */\n readonly userCookieName?: string\n /** Cookie maxAge in seconds. Default 1 hour. */\n readonly maxAgeSeconds?: number\n}\n\nasync function defaultCookies(): Promise<NextCookieJar> {\n // Dynamic import keeps `next/headers` out of non-Next environments.\n const mod = (await import('next/headers').catch(() => null)) as\n | { cookies: () => Promise<NextCookieJar> | NextCookieJar }\n | null\n if (!mod) {\n throw new Error(\n \"[@noy-db/in-nextjs] `next/headers` is unavailable. Supply a custom `cookies` resolver \" +\n \"in cookieSession({ cookies: () => … }) when running outside a Next.js server context.\",\n )\n }\n return mod.cookies()\n}\n\n/** Build a cookie-backed session store for Next.js server contexts. */\nexport function cookieSession(options: CookieSessionOptions = {}): SessionStore {\n const cookieName = options.cookieName ?? 'noydb_session'\n const userCookieName = options.userCookieName ?? 'noydb_user'\n const getJar = options.cookies ?? defaultCookies\n const maxAgeSeconds = options.maxAgeSeconds ?? 3600\n\n return {\n async read() {\n const jar = await Promise.resolve(getJar())\n const sessionCookie = jar.get(cookieName)\n const userCookie = jar.get(userCookieName)\n if (!sessionCookie || !userCookie) return null\n return { userId: userCookie.value, sessionToken: sessionCookie.value }\n },\n async write(value) {\n const jar = await Promise.resolve(getJar())\n const opts = {\n httpOnly: true,\n secure: true,\n sameSite: 'lax' as const,\n path: '/',\n maxAge: value.maxAgeSeconds ?? maxAgeSeconds,\n }\n jar.set(cookieName, value.sessionToken, opts)\n jar.set(userCookieName, value.userId, opts)\n },\n async clear() {\n const jar = await Promise.resolve(getJar())\n jar.delete(cookieName)\n jar.delete(userCookieName)\n },\n }\n}\n\n// ─── Server helpers ────────────────────────────────────────────────────\n\n/**\n * The Noydb factory contract — consumers call `setNoydbFactory()` at\n * app init with whatever store + auth wiring they prefer. The factory\n * receives the current session and returns an opened Noydb instance.\n */\nexport type NoydbFactory = (session: { userId: string; sessionToken: string } | null) => Promise<Noydb>\n\nlet configured: { factory: NoydbFactory; session: SessionStore } | null = null\n\n/**\n * Configure the Next.js integration. Call once at app init (e.g. in\n * `app/layout.tsx` or a `lib/noydb.ts` module).\n */\nexport function configureNoydb(options: { factory: NoydbFactory; session?: SessionStore }): void {\n configured = {\n factory: options.factory,\n session: options.session ?? cookieSession(),\n }\n}\n\nfunction requireConfig(): NonNullable<typeof configured> {\n if (!configured) {\n throw new Error(\n \"[@noy-db/in-nextjs] configureNoydb({ factory, session }) must be called before getNoydb().\",\n )\n }\n return configured\n}\n\n/**\n * Server-only helper. Reads the current session from cookies, invokes\n * the configured factory, and returns an open `Noydb` instance.\n */\nexport async function getNoydb(): Promise<Noydb> {\n const { factory, session } = requireConfig()\n const current = await session.read()\n return factory(current)\n}\n\n/** Convenience: open a vault by name, returning the `Vault` directly. */\nexport async function getVault(db: Noydb, name: string): Promise<Vault> {\n return db.openVault(name)\n}\n\n/**\n * Route-handler wrapper. Opens the vault once per request and passes\n * it to your handler. The Noydb instance is closed on exit so the\n * session keys don't outlive the response.\n */\nexport function withVault<T extends Request, R>(\n vaultName: string,\n handler: (vault: Vault, request: T) => Promise<R>,\n): (request: T) => Promise<R> {\n return async (request: T) => {\n const db = await getNoydb()\n try {\n const vault = await db.openVault(vaultName)\n return await handler(vault, request)\n } finally {\n await safeClose(db)\n }\n }\n}\n\n/**\n * Route-handler wrapper that does NOT open a vault — use when the\n * handler needs direct `Noydb` access (e.g. managing multiple vaults\n * per request).\n */\nexport function withNoydb<T extends Request, R>(\n handler: (db: Noydb, request: T) => Promise<R>,\n): (request: T) => Promise<R> {\n return async (request: T) => {\n const db = await getNoydb()\n try {\n return await handler(db, request)\n } finally {\n await safeClose(db)\n }\n }\n}\n\n/**\n * Server action helper — write a new session on login. Called from a\n * server action that validated the user's secret through\n * `@noy-db/on-*` and received a session token back.\n */\nexport async function writeSession(value: { userId: string; sessionToken: string; maxAgeSeconds?: number }): Promise<void> {\n const { session } = requireConfig()\n await session.write(value)\n}\n\n/** Server action helper — clear the session on logout. */\nexport async function clearSession(): Promise<void> {\n const { session } = requireConfig()\n await session.clear()\n}\n\n/** Introspection — useful for tests. Resets the configured factory. */\nexport function resetNoydbConfig(): void {\n configured = null\n}\n\n/**\n * Defensively close a Noydb instance, tolerating sync + async close\n * signatures without tripping `await-thenable` lint.\n */\nasync function safeClose(db: Noydb): Promise<void> {\n try {\n const result: unknown = db.close()\n if (result && typeof (result as { then?: unknown }).then === 'function') {\n await (result as Promise<unknown>)\n }\n } catch {\n // best-effort — never block the response on teardown\n }\n}\n"],"mappings":";AA2FA,eAAe,iBAAyC;AAEtD,QAAM,MAAO,MAAM,OAAO,cAAc,EAAE,MAAM,MAAM,IAAI;AAG1D,MAAI,CAAC,KAAK;AACR,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,SAAO,IAAI,QAAQ;AACrB;AAGO,SAAS,cAAc,UAAgC,CAAC,GAAiB;AAC9E,QAAM,aAAa,QAAQ,cAAc;AACzC,QAAM,iBAAiB,QA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8B;AACtE,SAAO,GAAG,UAAU,IAAI;AAC1B;AAOO,SAAS,UACd,WACA,SAC4B;AAC5B,SAAO,OAAO,YAAe;AAC3B,UAAM,KAAK,MAAM,SAAS;AAC1B,QAAI;AACF,YAAM,QAAQ,MAAM,GAAG,UAAU,SAAS;AAC1C,aAAO,MAAM,QAAQ,OAAO,OAAO;AAAA,IACrC,UAAE;AACA,YAAM,UAAU,EAAE;AAAA,IACpB;AAAA,EACF;AACF;AAOO,SAAS,UACd,SAC4B;AAC5B,SAAO,OAAO,YAAe;AAC3B,UAAM,KAAK,MAAM,SAAS;AAC1B,QAAI;AACF,aAAO,MAAM,QAAQ,IAAI,OAAO;AAAA,IAClC,UAAE;AACA,YAAM,UAAU,EAAE;AAAA,IACpB;AAAA,EACF;AACF;AAOA,eAAsB,aAAa,OAAwF;AACzH,QAAM,EAAE,QAAQ,IAAI,cAAc;AAClC,QAAM,QAAQ,MAAM,KAAK;AAC3B;AAGA,eAAsB,eAA8B;AAClD,QAAM,EAAE,QAAQ,IAAI,cAAc;AAClC,QAAM,QAAQ,MAAM;AACtB;AAGO,SAAS,mBAAyB;AACvC,eAAa;AACf;AAMA,eAAe,UAAU,IAA0B;AACjD,MAAI;AACF,UAAM,SAAkB,GAAG,MAAM;AACjC,QAAI,UAAU,OAAQ,OAA8B,SAAS,YAAY;AACvE,YAAO;AAAA,IACT;AAAA,EACF,QAAQ;AAAA,EAER;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noy-db/in-nextjs",
|
|
3
|
-
"version": "0.4.0-pre.
|
|
3
|
+
"version": "0.4.0-pre.5",
|
|
4
4
|
"description": "Next.js App Router helpers for noy-db — server components, route handlers, client hooks, and cookie-based session. Thin bridge that composes @noy-db/in-react with Next's cookies()/headers() APIs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "vLannaAi <vicio@lanna.ai>",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"next": "^14.0.0 || ^15.0.0",
|
|
40
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
41
|
-
"@noy-db/hub": "0.4.0-pre.
|
|
42
|
-
"@noy-db/in-react": "0.4.0-pre.
|
|
41
|
+
"@noy-db/hub": "0.4.0-pre.5",
|
|
42
|
+
"@noy-db/in-react": "0.4.0-pre.5"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"next": {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@noy-db/hub": "0.4.0-pre.
|
|
57
|
-
"@noy-db/in-react": "0.4.0-pre.
|
|
56
|
+
"@noy-db/hub": "0.4.0-pre.5",
|
|
57
|
+
"@noy-db/in-react": "0.4.0-pre.5"
|
|
58
58
|
},
|
|
59
59
|
"keywords": [
|
|
60
60
|
"noy-db",
|