@jxsuite/connector 0.1.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.
@@ -0,0 +1,81 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jxsuite.com/schemas/connector/Supabase.class.json",
4
+ "title": "Supabase",
5
+ "description": "Supabase (postgres) connection provider over postgres-js; from Workers via a Hyperdrive binding, elsewhere via the urlEnv-named connection URL",
6
+ "$prototype": "Class",
7
+ "extends": "Object",
8
+ "$implementation": "./supabase.js",
9
+
10
+ "connector": {
11
+ "provider": "supabase",
12
+ "kind": "postgres",
13
+ "serve": "@jxsuite/connector/worker",
14
+ "module": "@jxsuite/connector/supabase"
15
+ },
16
+
17
+ "$defs": {
18
+ "methods": {
19
+ "dialect": {
20
+ "role": "dialect",
21
+ "$prototype": "Function",
22
+ "access": "public",
23
+ "scope": "static",
24
+ "identifier": "dialect",
25
+ "timing": ["compiler", "server"],
26
+ "parameters": [
27
+ { "identifier": "connection", "type": { "type": "object" } },
28
+ { "identifier": "env", "type": { "type": "object" } }
29
+ ],
30
+ "returnType": { "type": "object" },
31
+ "description": "Kysely postgres-js dialect: Hyperdrive binding first, then the urlEnv-named env var"
32
+ },
33
+ "deploySchema": {
34
+ "role": "deploySchema",
35
+ "$prototype": "Function",
36
+ "access": "public",
37
+ "scope": "static",
38
+ "identifier": "deploySchema",
39
+ "timing": ["compiler", "server"],
40
+ "parameters": [
41
+ { "identifier": "tables", "type": { "type": "object" } },
42
+ { "identifier": "connection", "type": { "type": "object" } },
43
+ {
44
+ "identifier": "options",
45
+ "type": {
46
+ "type": "object",
47
+ "properties": { "env": { "type": "object" }, "dryRun": { "type": "boolean" } }
48
+ }
49
+ }
50
+ ],
51
+ "returnType": { "type": "object" },
52
+ "description": "Additive schema sync: { statements, applied, warnings }"
53
+ },
54
+ "bindings": {
55
+ "role": "bindings",
56
+ "$prototype": "Function",
57
+ "access": "public",
58
+ "scope": "static",
59
+ "identifier": "bindings",
60
+ "timing": ["compiler", "server"],
61
+ "parameters": [{ "identifier": "connection", "type": { "type": "object" } }],
62
+ "returnType": { "type": "object" },
63
+ "description": "Wrangler config fragment: the hyperdrive binding when hyperdriveId is set"
64
+ },
65
+ "testConnection": {
66
+ "role": "testConnection",
67
+ "$prototype": "Function",
68
+ "access": "public",
69
+ "scope": "static",
70
+ "identifier": "testConnection",
71
+ "timing": ["compiler", "server"],
72
+ "parameters": [
73
+ { "identifier": "connection", "type": { "type": "object" } },
74
+ { "identifier": "env", "type": { "type": "object" } }
75
+ ],
76
+ "returnType": { "type": "object" },
77
+ "description": "Probe the connection with `select 1`: { ok, error? }"
78
+ }
79
+ }
80
+ }
81
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jxsuite.com/schemas/connector/TableDelete.class.json",
4
+ "title": "TableDelete",
5
+ "description": "Delete action: DELETE /_jx/data/<table>/<id> (id: literal, ${...} template, or #/$params ref); lowered to an inline Function handler in compiled sites",
6
+ "$prototype": "Class",
7
+ "extends": "Object",
8
+ "$implementation": "./table-delete.js",
9
+
10
+ "$studio": {
11
+ "stateDefaults": { "timing": "client" }
12
+ },
13
+
14
+ "$defs": {
15
+ "parameters": {
16
+ "table": {
17
+ "identifier": "table",
18
+ "type": { "type": "string" },
19
+ "description": "Name of a `data` section table"
20
+ },
21
+ "id": {
22
+ "identifier": "id",
23
+ "type": { "type": ["string", "integer", "object"] },
24
+ "description": "Row id: a literal, a ${...} template, or { \"$ref\": \"#/$params/<name>\" }"
25
+ }
26
+ },
27
+ "constructor": {
28
+ "role": "constructor",
29
+ "parameters": [{ "$ref": "#/$defs/parameters/table" }, { "$ref": "#/$defs/parameters/id" }],
30
+ "body": ["this.config = config;"]
31
+ },
32
+ "methods": {
33
+ "resolve": {
34
+ "role": "method",
35
+ "scope": "instance",
36
+ "identifier": "resolve",
37
+ "returnType": { "type": "object" },
38
+ "description": "An event handler performing the delete and bumping state._v"
39
+ },
40
+ "lower": {
41
+ "role": "lower",
42
+ "$prototype": "Function",
43
+ "access": "public",
44
+ "scope": "static",
45
+ "identifier": "lower",
46
+ "timing": ["compiler"],
47
+ "parameters": [
48
+ { "identifier": "def", "type": { "type": "object" } },
49
+ { "identifier": "context", "type": { "type": "object" } }
50
+ ],
51
+ "returnType": { "type": "object" },
52
+ "description": "Rewrite into an inline Function def fetching DELETE /_jx/data/<table>/<id>"
53
+ }
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jxsuite.com/schemas/connector/TableEntry.class.json",
4
+ "title": "TableEntry",
5
+ "description": "One row of a dynamic table by id — `#/$params/<name>` refs resolve against the route; lowered to a core Request def in compiled sites",
6
+ "$prototype": "Class",
7
+ "extends": "Object",
8
+ "$implementation": "./table-state.js",
9
+
10
+ "$studio": {
11
+ "stateDefaults": { "timing": "client" }
12
+ },
13
+
14
+ "$defs": {
15
+ "parameters": {
16
+ "table": {
17
+ "identifier": "table",
18
+ "type": { "type": "string" },
19
+ "description": "Name of a `data` section table"
20
+ },
21
+ "id": {
22
+ "identifier": "id",
23
+ "type": { "type": ["string", "integer", "object"] },
24
+ "description": "Row id: a literal, a ${...} template, or { \"$ref\": \"#/$params/<name>\" }"
25
+ },
26
+ "include": {
27
+ "identifier": "include",
28
+ "type": { "type": ["array", "string"] },
29
+ "description": "Reference fields to expand"
30
+ }
31
+ },
32
+ "constructor": {
33
+ "role": "constructor",
34
+ "parameters": [
35
+ { "$ref": "#/$defs/parameters/table" },
36
+ { "$ref": "#/$defs/parameters/id" },
37
+ { "$ref": "#/$defs/parameters/include" }
38
+ ],
39
+ "body": ["this.config = config;"]
40
+ },
41
+ "methods": {
42
+ "resolve": {
43
+ "role": "method",
44
+ "scope": "instance",
45
+ "identifier": "resolve",
46
+ "returnType": { "type": "object" },
47
+ "description": "The row, or null"
48
+ },
49
+ "lower": {
50
+ "role": "lower",
51
+ "$prototype": "Function",
52
+ "access": "public",
53
+ "scope": "static",
54
+ "identifier": "lower",
55
+ "timing": ["compiler"],
56
+ "parameters": [
57
+ { "identifier": "def", "type": { "type": "object" } },
58
+ { "identifier": "context", "type": { "type": "object" } }
59
+ ],
60
+ "returnType": { "type": "object" },
61
+ "description": "Rewrite into a core Request def for one row (route params substituted at lower time)"
62
+ }
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jxsuite.com/schemas/connector/TableInsert.class.json",
4
+ "title": "TableInsert",
5
+ "description": "Insert action: POST a row to /_jx/data/<table> from a form submit (FormData merged under literal values); lowered to an inline Function handler in compiled sites",
6
+ "$prototype": "Class",
7
+ "extends": "Object",
8
+ "$implementation": "./table-insert.js",
9
+
10
+ "$studio": {
11
+ "stateDefaults": { "timing": "client" }
12
+ },
13
+
14
+ "$defs": {
15
+ "parameters": {
16
+ "table": {
17
+ "identifier": "table",
18
+ "type": { "type": "string" },
19
+ "description": "Name of a `data` section table"
20
+ },
21
+ "values": {
22
+ "identifier": "values",
23
+ "type": { "type": "object" },
24
+ "description": "Literal payload columns merged over the submitting form's FormData"
25
+ }
26
+ },
27
+ "constructor": {
28
+ "role": "constructor",
29
+ "parameters": [
30
+ { "$ref": "#/$defs/parameters/table" },
31
+ { "$ref": "#/$defs/parameters/values" }
32
+ ],
33
+ "body": ["this.config = config;"]
34
+ },
35
+ "methods": {
36
+ "resolve": {
37
+ "role": "method",
38
+ "scope": "instance",
39
+ "identifier": "resolve",
40
+ "returnType": { "type": "object" },
41
+ "description": "An event handler performing the insert and bumping state._v"
42
+ },
43
+ "lower": {
44
+ "role": "lower",
45
+ "$prototype": "Function",
46
+ "access": "public",
47
+ "scope": "static",
48
+ "identifier": "lower",
49
+ "timing": ["compiler"],
50
+ "parameters": [
51
+ { "identifier": "def", "type": { "type": "object" } },
52
+ { "identifier": "context", "type": { "type": "object" } }
53
+ ],
54
+ "returnType": { "type": "object" },
55
+ "description": "Rewrite into an inline Function def fetching POST /_jx/data/<table>"
56
+ }
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jxsuite.com/schemas/connector/TableQuery.class.json",
4
+ "title": "TableQuery",
5
+ "description": "Rows of a dynamic table matching a content-grammar filter/sort/limit — fetched from /_jx/data in browsers, read directly under node, and lowered to a core Request def in compiled sites",
6
+ "$prototype": "Class",
7
+ "extends": "Object",
8
+ "$implementation": "./table-state.js",
9
+
10
+ "$studio": {
11
+ "stateDefaults": { "timing": "client" }
12
+ },
13
+
14
+ "$defs": {
15
+ "parameters": {
16
+ "table": {
17
+ "identifier": "table",
18
+ "type": { "type": "string" },
19
+ "description": "Name of a `data` section table"
20
+ },
21
+ "filter": {
22
+ "identifier": "filter",
23
+ "type": { "type": ["array", "object"] },
24
+ "description": "Content filter grammar: rule array [{ field, op, value }] or equality-object shorthand"
25
+ },
26
+ "sort": {
27
+ "identifier": "sort",
28
+ "type": { "type": ["array", "object"] },
29
+ "description": "Sort rule { field, order } or a list of them"
30
+ },
31
+ "limit": { "identifier": "limit", "type": { "type": "integer" } },
32
+ "offset": { "identifier": "offset", "type": { "type": "integer" } },
33
+ "include": {
34
+ "identifier": "include",
35
+ "type": { "type": ["array", "string"] },
36
+ "description": "Reference fields to expand (to-one table refs and junction to-many fields)"
37
+ }
38
+ },
39
+ "constructor": {
40
+ "role": "constructor",
41
+ "parameters": [
42
+ { "$ref": "#/$defs/parameters/table" },
43
+ { "$ref": "#/$defs/parameters/filter" },
44
+ { "$ref": "#/$defs/parameters/sort" },
45
+ { "$ref": "#/$defs/parameters/limit" },
46
+ { "$ref": "#/$defs/parameters/offset" },
47
+ { "$ref": "#/$defs/parameters/include" }
48
+ ],
49
+ "body": ["this.config = config;"]
50
+ },
51
+ "methods": {
52
+ "resolve": {
53
+ "role": "method",
54
+ "scope": "instance",
55
+ "identifier": "resolve",
56
+ "returnType": { "type": "array" },
57
+ "description": "The matching rows"
58
+ },
59
+ "lower": {
60
+ "role": "lower",
61
+ "$prototype": "Function",
62
+ "access": "public",
63
+ "scope": "static",
64
+ "identifier": "lower",
65
+ "timing": ["compiler"],
66
+ "parameters": [
67
+ { "identifier": "def", "type": { "type": "object" } },
68
+ { "identifier": "context", "type": { "type": "object" } }
69
+ ],
70
+ "returnType": { "type": "object" },
71
+ "description": "Rewrite into a core Request def: /_jx/data URL with preserved template placeholders plus the `_v` read-after-write param"
72
+ }
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jxsuite.com/schemas/connector/TableUpdate.class.json",
4
+ "title": "TableUpdate",
5
+ "description": "Update action: PATCH a row at /_jx/data/<table>/<id> (id: literal, ${...} template, or #/$params ref); lowered to an inline Function handler in compiled sites",
6
+ "$prototype": "Class",
7
+ "extends": "Object",
8
+ "$implementation": "./table-update.js",
9
+
10
+ "$studio": {
11
+ "stateDefaults": { "timing": "client" }
12
+ },
13
+
14
+ "$defs": {
15
+ "parameters": {
16
+ "table": {
17
+ "identifier": "table",
18
+ "type": { "type": "string" },
19
+ "description": "Name of a `data` section table"
20
+ },
21
+ "id": {
22
+ "identifier": "id",
23
+ "type": { "type": ["string", "integer", "object"] },
24
+ "description": "Row id: a literal, a ${...} template, or { \"$ref\": \"#/$params/<name>\" }"
25
+ },
26
+ "values": {
27
+ "identifier": "values",
28
+ "type": { "type": "object" },
29
+ "description": "Literal payload columns merged over the submitting form's FormData"
30
+ }
31
+ },
32
+ "constructor": {
33
+ "role": "constructor",
34
+ "parameters": [
35
+ { "$ref": "#/$defs/parameters/table" },
36
+ { "$ref": "#/$defs/parameters/id" },
37
+ { "$ref": "#/$defs/parameters/values" }
38
+ ],
39
+ "body": ["this.config = config;"]
40
+ },
41
+ "methods": {
42
+ "resolve": {
43
+ "role": "method",
44
+ "scope": "instance",
45
+ "identifier": "resolve",
46
+ "returnType": { "type": "object" },
47
+ "description": "An event handler performing the update and bumping state._v"
48
+ },
49
+ "lower": {
50
+ "role": "lower",
51
+ "$prototype": "Function",
52
+ "access": "public",
53
+ "scope": "static",
54
+ "identifier": "lower",
55
+ "timing": ["compiler"],
56
+ "parameters": [
57
+ { "identifier": "def", "type": { "type": "object" } },
58
+ { "identifier": "context", "type": { "type": "object" } }
59
+ ],
60
+ "returnType": { "type": "object" },
61
+ "description": "Rewrite into an inline Function def fetching PATCH /_jx/data/<table>/<id>"
62
+ }
63
+ }
64
+ }
65
+ }