@jxsuite/connector 0.5.7 → 0.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 CHANGED
@@ -4,21 +4,12 @@
4
4
 
5
5
  ## Overview
6
6
 
7
- `@jxsuite/connector` is the Jx extension bridging sites to live databases. It contributes two
8
- project.json sections and serves them over the canonical `/_jx/data` wire contract
9
- (specs/extensions.md §11 and §12):
10
-
11
- - **`connections`**: named database connections. Entries carry identifiers and env-var _names_
12
- only (`binding`, `databaseId`, `urlEnv`, `hyperdriveId`); secret values live in `.dev.vars`
13
- locally and the platform secret store in production. Providers: Cloudflare **D1**, **Supabase**
14
- (postgres over postgres-js/Hyperdrive), and file-backed **Sqlite** (bun:sqlite).
15
- - **`data`**: dynamic tables. Each entry names its connection, a column `schema` (plain Jx field
16
- schemas plus relationship refs; see specs/relationships.md), an `id` strategy
17
- (`"uuid"` | `"integer"`), `timestamps`, `indexes`, `permissions`
18
- (`public | none | authenticated | owner | role:<r>`), and an optional `ownerField`.
19
-
20
- Kysely is the data bridge: one JSON-drivable query/schema builder across D1, postgres, and
21
- sqlite, on Workers, Bun, and node.
7
+ `@jxsuite/connector` is the Jx extension bridging sites to live databases. It contributes two project.json sections and serves them over the canonical `/_jx/data` wire contract (specs/extensions.md §11 and §12):
8
+
9
+ - **`connections`**: named database connections. Entries carry identifiers and env-var _names_ only (`binding`, `databaseId`, `urlEnv`, `hyperdriveId`); secret values live in `.dev.vars` locally and the platform secret store in production. Providers: Cloudflare **D1**, **Supabase** (postgres over postgres-js/Hyperdrive), and file-backed **Sqlite** (bun:sqlite).
10
+ - **`data`**: dynamic tables. Each entry names its connection, a column `schema` (plain Jx field schemas plus relationship refs; see specs/relationships.md), an `id` strategy (`"uuid"` | `"integer"`), `timestamps`, `indexes`, `permissions` (`public | none | authenticated | owner | role:<r>`), and an optional `ownerField`.
11
+
12
+ Kysely is the data bridge: one JSON-drivable query/schema builder across D1, postgres, and sqlite, on Workers, Bun, and node.
22
13
 
23
14
  ## Enable it
24
15
 
@@ -40,39 +31,23 @@ sqlite, on Workers, Bun, and node.
40
31
  }
41
32
  ```
42
33
 
43
- Then `jx schema` (regenerates the project schemas) and `jx db push [--dry-run]` (additive-only
44
- schema sync: tables and columns are created, never dropped or retyped). In dev, the server
45
- stands D1 connections in with local SQLite at `.jx/data/<connection>.sqlite`, auto-synced on
46
- first touch.
34
+ Then `jx schema` (regenerates the project schemas) and `jx db push [--dry-run]` (additive-only schema sync: tables and columns are created, never dropped or retyped). In dev, the server stands D1 connections in with local SQLite at `.jx/data/<connection>.sqlite`, auto-synced on first touch.
47
35
 
48
36
  ## State classes
49
37
 
50
- - `TableQuery` / `TableEntry`: rows (content filter grammar: `filter`, `sort`, `limit`,
51
- `offset`, `include`) and single rows by id (`#/$params/<name>` refs resolve against the route).
52
- - `TableInsert` / `TableUpdate` / `TableDelete`: form-friendly write actions
53
- (`"onsubmit": { "$ref": "#/state/addComment" }` reads the form's FormData).
38
+ - `TableQuery` / `TableEntry`: rows (content filter grammar: `filter`, `sort`, `limit`, `offset`, `include`) and single rows by id (`#/$params/<name>` refs resolve against the route).
39
+ - `TableInsert` / `TableUpdate` / `TableDelete`: form-friendly write actions (`"onsubmit": { "$ref": "#/state/addComment" }` reads the form's FormData).
54
40
 
55
- In compiled sites these **lower** to core defs (specs/extensions.md §8.3): queries become plain
56
- `Request` fetches against `/_jx/data`, actions become inline `Function` handlers, so no extension
57
- code ships to the browser. Read-after-write rides the `_v` convention: lowered queries append
58
- `_v=${(state._v || 0)}` to their URL and successful writes bump `state._v`, re-running every
59
- query effect on the page.
41
+ In compiled sites these **lower** to core defs (specs/extensions.md §8.3): queries become plain `Request` fetches against `/_jx/data`, actions become inline `Function` handlers, so no extension code ships to the browser. Read-after-write rides the `_v` convention: lowered queries append `_v=${(state._v || 0)}` to their URL and successful writes bump `state._v`, re-running every query effect on the page.
60
42
 
61
43
  ## Permissions (fail-closed)
62
44
 
63
- `public` rules pass without auth; `none` always denies; every other rule requires the auth
64
- extension's hooks on the shared server context, so absent auth means 401. Defaults: read `public`,
65
- writes `none`. Owner rules scope reads/writes via `ownerField`.
45
+ `public` rules pass without auth; `none` always denies; every other rule requires the auth extension's hooks on the shared server context, so absent auth means 401. Defaults: read `public`, writes `none`. Owner rules scope reads/writes via `ownerField`.
66
46
 
67
47
  ## Field-union extras
68
48
 
69
- Table columns are plain core field schemas plus relationship refs, so this package ships **no**
70
- `schemas.fields` fragment. That manifest convention (a fragment whose `$defs` members join the
71
- per-project field union) exists for extensions that need shapes beyond the core union.
49
+ Table columns are plain core field schemas plus relationship refs, so this package ships **no** `schemas.fields` fragment. That manifest convention (a fragment whose `$defs` members join the per-project field union) exists for extensions that need shapes beyond the core union.
72
50
 
73
51
  ## Versioning
74
52
 
75
- Published to npm as `@jxsuite/connector`, TypeScript source like every `@jxsuite` package,
76
- following the monorepo's release train. Extensions may depend on core packages
77
- (`@jxsuite/schema`) but never the reverse; the auth extension builds on this package's
78
- `resolveDialect` seam and permission types (`@jxsuite/connector/types`).
53
+ Published to npm as `@jxsuite/connector`, TypeScript source like every `@jxsuite` package, following the monorepo's release train. Extensions may depend on core packages (`@jxsuite/schema`) but never the reverse; the auth extension builds on this package's `resolveDialect` seam and permission types (`@jxsuite/connector/types`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/connector",
3
- "version": "0.5.7",
3
+ "version": "0.6.0",
4
4
  "description": "Jx database connections and dynamic data tables served over /_jx/data",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -57,16 +57,16 @@
57
57
  "upgrade": "bun update --latest && bun install"
58
58
  },
59
59
  "dependencies": {
60
- "@jxsuite/schema": "^2.1.0",
60
+ "@jxsuite/schema": "^2.2.0",
61
61
  "kysely": "^0.29.5",
62
62
  "kysely-d1": "^0.4.0",
63
63
  "kysely-postgres-js": "^4.0.0",
64
64
  "postgres": "^3.4.9"
65
65
  },
66
66
  "devDependencies": {
67
- "@cloudflare/workers-types": "^5.20260829.1",
67
+ "@cloudflare/workers-types": "^5.20260911.1",
68
68
  "ajv": "^8.20.0",
69
- "hono": "^4.13.5"
69
+ "hono": "^4.13.7"
70
70
  },
71
71
  "jx": "./jx-extension.json"
72
72
  }
@@ -14,7 +14,7 @@
14
14
 
15
15
  "$studio": {
16
16
  "settings": {
17
- "icon": "sp-icon-data",
17
+ "icon": "database",
18
18
  "label": "Connections",
19
19
  "order": 60,
20
20
  "layout": "map",
@@ -22,7 +22,7 @@
22
22
 
23
23
  "$studio": {
24
24
  "settings": {
25
- "icon": "sp-icon-table",
25
+ "icon": "rows",
26
26
  "label": "Data Tables",
27
27
  "order": 55,
28
28
  "layout": "map",