@sequenceholdings/orm 2.5.0 → 2.6.1
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 +23 -0
- package/dist/cli.cjs +23 -11
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +23 -11
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs +10 -5
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +37 -30
- package/dist/client.d.ts +37 -30
- package/dist/client.js +10 -6
- package/dist/client.js.map +1 -1
- package/dist/compiler.cjs +127 -9
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.d.cts +25 -2
- package/dist/compiler.d.ts +25 -2
- package/dist/compiler.js +125 -10
- package/dist/compiler.js.map +1 -1
- package/dist/index.cjs +260 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -3
- package/dist/index.d.ts +25 -3
- package/dist/index.js +260 -139
- package/dist/index.js.map +1 -1
- package/dist/ir.cjs +5 -1
- package/dist/ir.cjs.map +1 -1
- package/dist/ir.js +5 -1
- package/dist/ir.js.map +1 -1
- package/dist/predicate-v2.cjs +5 -1
- package/dist/predicate-v2.cjs.map +1 -1
- package/dist/predicate-v2.js +5 -1
- package/dist/predicate-v2.js.map +1 -1
- package/dist/sdl.cjs +7 -1
- package/dist/sdl.cjs.map +1 -1
- package/dist/sdl.js +7 -1
- package/dist/sdl.js.map +1 -1
- package/package.json +1 -1
- package/templates/orm-namespace/package.json +2 -0
- package/templates/orm-namespace/schema/tables.ts +7 -3
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"validate": "seq-studio orm validate",
|
|
7
|
+
"lint": "seq-studio orm validate",
|
|
7
8
|
"generate": "seq-studio orm generate",
|
|
8
9
|
"diff": "seq-studio orm diff",
|
|
9
10
|
"apply": "seq-studio orm apply",
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
"@graphql-codegen/typed-document-node": "^5.1.1",
|
|
21
22
|
"@graphql-codegen/typescript": "^4.1.6",
|
|
22
23
|
"@graphql-codegen/typescript-operations": "^4.6.1",
|
|
24
|
+
"@sequenceholdings/studio-cli": "^0.5.1",
|
|
23
25
|
"typescript": "^5.6.0"
|
|
24
26
|
},
|
|
25
27
|
"engines": {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
defineEnum, defineTable, t, toMany, toOne, toPlatformUser, type SeqTable,
|
|
3
|
+
} from '@sequenceholdings/orm/authoring'
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Tables are TypeScript, but they SERIALIZE to data — the server never runs
|
|
@@ -17,7 +19,9 @@ import { defineEnum, defineTable, t, toMany, toOne, toPlatformUser } from '@sequ
|
|
|
17
19
|
*/
|
|
18
20
|
export const dealStatus = defineEnum('deal_status', ['open', 'won', 'lost'])
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
// Tables that link to each other need an explicit `SeqTable` annotation:
|
|
23
|
+
// TypeScript cannot infer a type through a mutually recursive `() => table`.
|
|
24
|
+
export const deals: SeqTable = defineTable(
|
|
21
25
|
'deals',
|
|
22
26
|
{
|
|
23
27
|
id: t.uuid().primaryKey().default('gen_random_uuid()'),
|
|
@@ -48,7 +52,7 @@ export const deals = defineTable(
|
|
|
48
52
|
},
|
|
49
53
|
)
|
|
50
54
|
|
|
51
|
-
export const comments = defineTable(
|
|
55
|
+
export const comments: SeqTable = defineTable(
|
|
52
56
|
'comments',
|
|
53
57
|
{
|
|
54
58
|
id: t.uuid().primaryKey().default('gen_random_uuid()'),
|