@auersperg/flare 0.3.1 → 0.3.4

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 (52) hide show
  1. package/README.md +13 -8
  2. package/dist/cli/{chunk-x14smx1y.js → chunk-5s6zv1h9.js} +1 -1
  3. package/dist/cli/chunk-5tjevcsj.js +1174 -0
  4. package/dist/cli/{chunk-5cq8wgte.js → chunk-5yg1zj5n.js} +48 -29
  5. package/dist/cli/{chunk-786w6vrj.js → chunk-fv98dfg5.js} +21 -1
  6. package/dist/cli/flare.js +120 -4
  7. package/dist/platform/admin.js +790 -0
  8. package/dist/platform/dashboard/_astro/auth-view.CuxQ12Fa.js +1 -0
  9. package/dist/platform/dashboard/_astro/badge.DwKWvVfO.js +1 -0
  10. package/dist/platform/dashboard/_astro/card.Bdqmram9.js +1 -0
  11. package/dist/platform/dashboard/_astro/cli-approval.VKPc8wYS.js +1 -0
  12. package/dist/platform/dashboard/_astro/client.BUUZgEFj.js +1 -0
  13. package/dist/platform/dashboard/_astro/client.DYdPL2z4.js +9 -0
  14. package/dist/platform/dashboard/_astro/common.HrRZXwD9.js +1 -0
  15. package/dist/platform/dashboard/_astro/dashboard.CH594XTw.js +3 -0
  16. package/dist/platform/dashboard/_astro/data-view.CcyUYvId.js +1 -0
  17. package/dist/platform/dashboard/_astro/function-badge.MlTRYkqM.js +1 -0
  18. package/dist/platform/dashboard/_astro/functions-view.C8JWdNAh.js +1 -0
  19. package/dist/platform/dashboard/_astro/geist-cyrillic-ext-wght-normal.DjL33-gN.woff2 +0 -0
  20. package/dist/platform/dashboard/_astro/geist-cyrillic-wght-normal.BEAKL7Jp.woff2 +0 -0
  21. package/dist/platform/dashboard/_astro/geist-latin-ext-wght-normal.DC-KSUi6.woff2 +0 -0
  22. package/dist/platform/dashboard/_astro/geist-latin-wght-normal.BgDaEnEv.woff2 +0 -0
  23. package/dist/platform/dashboard/_astro/geist-vietnamese-wght-normal.6IgcOCM7.woff2 +0 -0
  24. package/dist/platform/dashboard/_astro/index.DiiMDa7R.css +2 -0
  25. package/dist/platform/dashboard/_astro/input-group.3twGpQ77.js +1 -0
  26. package/dist/platform/dashboard/_astro/react-dom.DwX89IcG.js +1 -0
  27. package/dist/platform/dashboard/_astro/refresh-cw.B0Cj85jJ.js +1 -0
  28. package/dist/platform/dashboard/_astro/sdk-view.CRFkbEyS.js +1 -0
  29. package/dist/platform/dashboard/_astro/services-view.B2suYnaG.js +1 -0
  30. package/dist/platform/dashboard/_astro/settings-view.BFP47ySK.js +3 -0
  31. package/dist/platform/dashboard/_astro/status-badge.BV1dzbX9.js +1 -0
  32. package/dist/platform/dashboard/_astro/table-guide.DzBDP6fC.js +2 -0
  33. package/dist/platform/dashboard/_astro/tabs.GRO5rCrK.js +1 -0
  34. package/dist/platform/dashboard/_headers +3 -0
  35. package/dist/platform/dashboard/bootstrap/action.js +263 -0
  36. package/dist/platform/dashboard/bootstrap/api.ts +5 -0
  37. package/dist/platform/dashboard/bootstrap/facet.js +914 -0
  38. package/dist/platform/dashboard/bootstrap/manifest.json +5 -0
  39. package/dist/platform/dashboard/bootstrap/openapi.json +18 -0
  40. package/dist/platform/dashboard/bootstrap/release.json +11 -0
  41. package/dist/platform/dashboard/bootstrap/schema.json +1 -0
  42. package/dist/platform/dashboard/index.html +1 -0
  43. package/dist/platform/manifest.json +230 -0
  44. package/dist/platform/migrations/0001.sql +8 -0
  45. package/dist/platform/migrations/0002_project_aliases.sql +6 -0
  46. package/dist/platform/migrations/0003_cli_login.sql +9 -0
  47. package/dist/platform/migrations/0004_retention.sql +4 -0
  48. package/dist/platform/migrations/0005_project_deletion.sql +11 -0
  49. package/dist/platform/migrations/0006_platform_installation.sql +8 -0
  50. package/dist/platform/runtime.js +9392 -0
  51. package/dist/sdk/client.js +10 -2
  52. package/package.json +1 -1
package/README.md CHANGED
@@ -24,7 +24,7 @@ Standard Schema / Standard JSON Schema validators define one contract for CLI, d
24
24
 
25
25
  0.3 is intentionally incompatible with the SQL/Drizzle API and release ABI 1–3. No compatibility adapters or historical app SQL journals remain. Use a fresh environment; local builds do not erase existing cloud data. Browser/server-JS clients remain portable; only CLI/build tooling requires Bun. No automatic retry of ambiguous mutations.
26
26
 
27
- Private, unpublished, UNLICENSED. See the root architecture and maintenance documents for cloud acceptance and remaining product gates.
27
+ MIT-licensed; npm preview package `@auersperg/flare`. See the root architecture and maintenance documents for cloud acceptance and remaining product gates.
28
28
 
29
29
  Scheduling: mutation `jobs.schedule(path,args,{delaySeconds})` and `jobs.cancel(id)` share the transaction. Cancel only removes a not-yet-enqueued outbox entry; it never aborts a running action. `paginate` adapts record count to its byte budget; `take` fails instead of silently truncating bulky results.
30
30
 
@@ -45,7 +45,7 @@ Mutation outbox entries and data commit together. Native Queues batches confirm
45
45
  The CLI is compiled separately from the portable SDK in this package. Bun 1.4.3+; no local dashboard or emulator.
46
46
 
47
47
  ```sh
48
- bun add @auersperg/flare@next # target registry flow; currently install a private packed archive
48
+ bun add @auersperg/flare@next # npm preview, next tag
49
49
  bunx --bun --package @auersperg/flare@next flare dev # browser approval → project → native schema/types → cloud-dev watch
50
50
  bunx --bun --package @auersperg/flare@next flare deploy # build and confirm production deployment
51
51
  ```
@@ -63,7 +63,7 @@ flare deploy --env dev --release release
63
63
 
64
64
  Immutable output contains facet/action modules, `schema.json`, manifest, checksums, generated TypeScript API and OpenAPI 3.1. Only ABI 4 is accepted. No old `tables` declarations, `--migrations` flag or Drizzle pipeline.
65
65
 
66
- Browser approval is protected by online Access/owner authorization and same-origin CSRF. Project-scoped credentials stay outside source/frontend env. Dev publishes to an already provisioned platform; general `platform init` is not implemented. No npm publication or cloud provisioning occurs during local verification.
66
+ Browser approval is protected by online Access/owner authorization and same-origin CSRF. Project-scoped credentials stay outside source/frontend env. Dev publishes to an already provisioned platform. Source 0.3.4 includes `platform install|status|update` plus a checksummed Core/dashboard payload, with separate Cloudflare account authorization; see [platform lifecycle](../../docs/platform-lifecycle.md). Disposable install/recovery and a genuine 0.3.3 → 0.3.4 upgrade passed in the owner’s Cloudflare account. This remains a trusted-team preview; independent-account acceptance with a full-scope platform CLI token is not yet complete. Check the registry for exact-version availability rather than assuming a moving tag contains the platform commands. No npm publication or cloud provisioning occurs during local verification.
67
67
 
68
68
  ## Immutable releases
69
69
 
@@ -80,6 +80,8 @@ Promote copies the selected immutable dev bundle to prod without recompiling or
80
80
 
81
81
  `--cmd` generates client references for the exact selected bundle and builds the frontend **before** activating the backend. The child receives the selected environment URL via `FLARE_URL`, `PUBLIC_FLARE_URL`, `VITE_FLARE_URL`, `NEXT_PUBLIC_FLARE_URL` and `EXPO_PUBLIC_FLARE_URL`; local dev env files remain unchanged. A failed build does not publish backend code. Framework build variables must be public URLs, not credentials.
82
82
 
83
+ Every CLI deploy compares the expected active backend hash, including without `--cmd`; conflicts are not retried. A failed frontend build restores the previous generated `api.ts`/`references.ts` (or their absence). Invalid/unconfirmed deployments do not scaffold or evaluate app code. Management errors retain HTTP status; interrupted writes and malformed successful responses are reported as unknown outcomes, never replayed automatically.
84
+
83
85
  Frontend hosting stays with native Wrangler or another hosting tool. An application release script can sequence Flare + build + Wrangler. Frontend publication failure after backend activation is an explicit partial release, not an atomic transaction. Dashboard Health → Development/Production releases offers contract inspection, backend promotion and rollback on demand, with no polling. It does not publish the frontend.
84
86
 
85
87
  Isolated historical preview environments and a paired frontend/backend version catalogue are not implemented. A saved backend hash is not a preview URL or a Git commit. Use additive contracts when old clients may remain active.
@@ -108,18 +110,21 @@ const url = import.meta.env.PUBLIC_FLARE_URL;
108
110
  const auth = createPasswordAuth({ url });
109
111
  const client = createClient({ url, getToken: auth.getToken });
110
112
  const stopAuth = auth.onChange(() => client.refreshAuth());
111
- await auth.register("my-login", "a long unique passphrase");
112
- // Later: await auth.login(login, password), auth.me(), auth.changePassword(old, next).
113
+ await auth.restore(); // Verify a saved session before rendering protected UI.
114
+ // Explicit sign-in: auth.register(login, password) or auth.login(login, password).
115
+ // Account operations: auth.me(), auth.changePassword(old, next).
113
116
  await auth.logout();
114
117
  stopAuth();
115
118
  client.dispose();
119
+ auth.dispose();
116
120
  ```
117
121
 
118
- Sessions are memory-only and expire after at most 12 hours. Reload requires login again. Password reset/block/revoke in Auth disconnects affected live users. Owner/Access manages accounts; application users and project CLI credentials do not gain dashboard privileges. Public login/registration have bounded rate limits; public registration is not equivalent to public access to private rows. Passwords require 6–128 characters. There is no email verification/recovery or MFA in this minimal version; owner reset is available. Existing short-lived R2 download grants remain valid for their explicit TTL, not until session logout.
122
+ Sessions expire after at most 12 hours. Browsers default to localStorage scoped to the deployment URL; `restore()` verifies the saved session against the server. Server/mobile callers provide storage explicitly or use `storage: null` for memory-only auth. Temporary network failures do not erase saved credentials; cross-tab logout is synchronized. `dispose()` is not logout. This is bearer-token storage, not HttpOnly-cookie authentication: prevent XSS in the application. No perpetual refresh is implemented.
123
+
124
+ Password reset/block/revoke disconnects affected live users. Live cache is cleared when authorization is rejected, including during reconnect ticket acquisition; a transient connection failure keeps the last valid snapshot. Owner/Access manages accounts; application users and project CLI credentials do not gain account-management privileges. Handlers enforce record ownership. Passwords require 6–128 characters; registration is rate-limited and closed by default. Email verification/recovery and MFA are not implemented. Existing R2 download grants remain valid for their explicit TTL, not until session logout.
119
125
 
120
126
  ## License and distribution
121
127
 
122
128
  SDK and CLI are MIT-licensed; see LICENSE. npm name: `@auersperg/flare`.
123
- The `flare` binary remains unchanged. This preview is not published yet; the
124
- first npm publication uses the `next` tag. Core/dashboard are separate private
129
+ The `flare` binary remains unchanged. Preview releases are published under the `next` tag. Core/dashboard are separate non-published
125
130
  components and are not included in this package.
@@ -102,7 +102,7 @@ ${url}`);
102
102
  await writeFile(join(directory, key + ".json"), JSON.stringify({ token, expiresAt: result.expiresAt }) + `
103
103
  `, { mode: 384 });
104
104
  process.env.FLARE_DEPLOY_TOKEN = token;
105
- const { link } = await import("./chunk-5cq8wgte.js");
105
+ const { link } = await import("./chunk-5yg1zj5n.js");
106
106
  return link({ platform, project: result.project });
107
107
  }
108
108
  throw Error("Login expired. Run flare dev again.");