@stacksjs/orm 0.75.569 → 0.75.572
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/models/Comment.ts +3 -3
- package/dist/models/Content/Post.ts +3 -3
- package/dist/models/EmailList.ts +8 -6
- package/dist/models/Subscriber.ts +2 -0
- package/dist/models/Team.ts +2 -0
- package/dist/models/User.ts +3 -0
- package/dist/transaction.d.ts +15 -4
- package/dist/transaction.js +1 -1
- package/package.json +24 -24
package/dist/models/Comment.ts
CHANGED
|
@@ -104,11 +104,11 @@ export default defineModel({
|
|
|
104
104
|
isApproved: {
|
|
105
105
|
required: false,
|
|
106
106
|
fillable: true,
|
|
107
|
-
default:
|
|
107
|
+
default: false,
|
|
108
108
|
validation: {
|
|
109
|
-
rule: schema.
|
|
109
|
+
rule: schema.boolean(),
|
|
110
110
|
},
|
|
111
|
-
factory: faker => faker.
|
|
111
|
+
factory: faker => faker.datatype.boolean(),
|
|
112
112
|
},
|
|
113
113
|
},
|
|
114
114
|
|
|
@@ -227,12 +227,12 @@ export default defineModel({
|
|
|
227
227
|
order: 13,
|
|
228
228
|
fillable: true,
|
|
229
229
|
validation: {
|
|
230
|
-
rule: schema.
|
|
230
|
+
rule: schema.boolean(),
|
|
231
231
|
message: {
|
|
232
|
-
|
|
232
|
+
boolean: 'Featured must be yes or no',
|
|
233
233
|
},
|
|
234
234
|
},
|
|
235
|
-
factory: faker => faker.
|
|
235
|
+
factory: faker => faker.datatype.boolean(),
|
|
236
236
|
},
|
|
237
237
|
},
|
|
238
238
|
|
package/dist/models/EmailList.ts
CHANGED
|
@@ -117,24 +117,26 @@ export default defineModel({
|
|
|
117
117
|
factory: faker => faker.helpers.arrayElement(['active', 'active', 'active', 'inactive']),
|
|
118
118
|
},
|
|
119
119
|
|
|
120
|
+
// Yes or no, and declared as one: a switch in a form, `true` or `false`
|
|
121
|
+
// in a query. Declared as a number, the form asked for 0 or 1.
|
|
120
122
|
isPublic: {
|
|
121
123
|
required: false,
|
|
122
124
|
fillable: true,
|
|
123
|
-
default:
|
|
125
|
+
default: true,
|
|
124
126
|
validation: {
|
|
125
|
-
rule: schema.
|
|
127
|
+
rule: schema.boolean(),
|
|
126
128
|
},
|
|
127
|
-
factory: faker => faker.
|
|
129
|
+
factory: faker => faker.datatype.boolean(),
|
|
128
130
|
},
|
|
129
131
|
|
|
130
132
|
doubleOptIn: {
|
|
131
133
|
required: false,
|
|
132
134
|
fillable: true,
|
|
133
|
-
default:
|
|
135
|
+
default: true,
|
|
134
136
|
validation: {
|
|
135
|
-
rule: schema.
|
|
137
|
+
rule: schema.boolean(),
|
|
136
138
|
},
|
|
137
|
-
factory: () =>
|
|
139
|
+
factory: () => true,
|
|
138
140
|
},
|
|
139
141
|
},
|
|
140
142
|
|
package/dist/models/Team.ts
CHANGED
|
@@ -76,6 +76,8 @@ export default defineModel({
|
|
|
76
76
|
|
|
77
77
|
dashboard: {
|
|
78
78
|
columns: ['name', 'memberCount', 'status', 'createdAt'],
|
|
79
|
+
// The row of numbers above the list: teams, active ones, members.
|
|
80
|
+
regions: { listTop: 'DataStatCards' },
|
|
79
81
|
// A count of members is called what it counts.
|
|
80
82
|
fields: {
|
|
81
83
|
memberCount: { label: 'Members' },
|
package/dist/models/User.ts
CHANGED
|
@@ -165,6 +165,9 @@ export default defineModel({
|
|
|
165
165
|
// The list is for telling accounts apart. The two-factor step, the
|
|
166
166
|
// billing id and the rest are on the account's own page.
|
|
167
167
|
columns: ['name', 'email', 'emailVerifiedAt', 'createdAt'],
|
|
168
|
+
// The row of numbers above the list: how many, how many are new, how
|
|
169
|
+
// many confirmed their email.
|
|
170
|
+
regions: { listTop: 'DataStatCards' },
|
|
168
171
|
// An avatar is a picture, not the address of one.
|
|
169
172
|
fields: {
|
|
170
173
|
// Chosen as a file, and shown as the picture it is.
|
package/dist/transaction.d.ts
CHANGED
|
@@ -10,15 +10,26 @@ import { db } from '@stacksjs/database/runtime';
|
|
|
10
10
|
* not rebound to this handle, so `User.find()` or an instance relation call
|
|
11
11
|
* inside the callback cannot be assumed to observe uncommitted `tx` writes.
|
|
12
12
|
*
|
|
13
|
+
* It is done when it returns: BEGIN, the callback and COMMIT have happened by
|
|
14
|
+
* the next line, and what the callback returned is the result. A callback that
|
|
15
|
+
* is `async` is waited for, and the transaction is then a promise.
|
|
16
|
+
*
|
|
13
17
|
* @example
|
|
14
18
|
* ```ts
|
|
19
|
+
* const userId = transaction((tx) => {
|
|
20
|
+
* const user = tx.insertInto('users').values({ name: 'Alice' }).returning('id').first()
|
|
21
|
+
* tx.insertInto('profiles').values({ user_id: user.id }).execute()
|
|
22
|
+
* return user.id
|
|
23
|
+
* })
|
|
24
|
+
*
|
|
25
|
+
* // An async callback, awaited as before:
|
|
15
26
|
* await transaction(async (tx) => {
|
|
16
27
|
* await tx.insertInto('users').values({ name: 'Alice' }).execute()
|
|
17
|
-
* await
|
|
28
|
+
* await notifyBilling()
|
|
18
29
|
* })
|
|
19
30
|
* ```
|
|
20
31
|
*/
|
|
21
|
-
export declare function transaction<T>(callback: (tx: TransactionHandle) =>
|
|
32
|
+
export declare function transaction<T>(callback: (tx: TransactionHandle) => T, options?: TransactionOptions): T;
|
|
22
33
|
/**
|
|
23
34
|
* Create a savepoint within a transaction for nested rollback support.
|
|
24
35
|
*
|
|
@@ -34,7 +45,7 @@ export declare function transaction<T>(callback: (tx: TransactionHandle) => Prom
|
|
|
34
45
|
* })
|
|
35
46
|
* ```
|
|
36
47
|
*/
|
|
37
|
-
export declare function savepoint<T>(callback: (sp: TransactionHandle) =>
|
|
48
|
+
export declare function savepoint<T>(callback: (sp: TransactionHandle) => T): T;
|
|
38
49
|
/**
|
|
39
50
|
* Wrap a function to automatically run within a transaction when called.
|
|
40
51
|
*
|
|
@@ -50,7 +61,7 @@ export declare function savepoint<T>(callback: (sp: TransactionHandle) => Promis
|
|
|
50
61
|
* const user = await createUserWithProfile('Alice', 'Hello world')
|
|
51
62
|
* ```
|
|
52
63
|
*/
|
|
53
|
-
export declare function transactional<TArgs extends unknown[], R>(fn: (tx: TransactionHandle, ...args: TArgs) =>
|
|
64
|
+
export declare function transactional<TArgs extends unknown[], R>(fn: (tx: TransactionHandle, ...args: TArgs) => R, options?: TransactionOptions): (...args: TArgs) => R;
|
|
54
65
|
export declare interface TransactionOptions {
|
|
55
66
|
retries?: number
|
|
56
67
|
isolation?: 'read committed' | 'repeatable read' | 'serializable'
|
package/dist/transaction.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{db}from"@stacksjs/database/runtime";export
|
|
1
|
+
import{db}from"@stacksjs/database/runtime";export function transaction(callback,options){return db.transaction(callback,options)}export function savepoint(callback){return db.savepoint(callback)}export function transactional(fn,options){return db.transactional(fn,options)}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/orm",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.572",
|
|
6
6
|
"description": "The Stacks ORM integration",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -63,32 +63,32 @@
|
|
|
63
63
|
"prepublishOnly": "bun run build"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@stacksjs/cache": "0.75.
|
|
67
|
-
"@stacksjs/cli": "0.75.
|
|
68
|
-
"@stacksjs/config": "0.75.
|
|
69
|
-
"@stacksjs/database": "0.75.
|
|
70
|
-
"@stacksjs/env": "0.75.
|
|
71
|
-
"@stacksjs/error-handling": "0.75.
|
|
72
|
-
"@stacksjs/events": "0.75.
|
|
73
|
-
"@stacksjs/logging": "0.75.
|
|
74
|
-
"@stacksjs/model-meta": "0.75.
|
|
75
|
-
"@stacksjs/pagination": "0.75.
|
|
76
|
-
"@stacksjs/path": "0.75.
|
|
77
|
-
"@stacksjs/query-builder": "0.75.
|
|
78
|
-
"@stacksjs/realtime": "0.75.
|
|
79
|
-
"@stacksjs/router": "0.75.
|
|
80
|
-
"@stacksjs/storage": "0.75.
|
|
81
|
-
"@stacksjs/strings": "0.75.
|
|
66
|
+
"@stacksjs/cache": "0.75.572",
|
|
67
|
+
"@stacksjs/cli": "0.75.572",
|
|
68
|
+
"@stacksjs/config": "0.75.572",
|
|
69
|
+
"@stacksjs/database": "0.75.572",
|
|
70
|
+
"@stacksjs/env": "0.75.572",
|
|
71
|
+
"@stacksjs/error-handling": "0.75.572",
|
|
72
|
+
"@stacksjs/events": "0.75.572",
|
|
73
|
+
"@stacksjs/logging": "0.75.572",
|
|
74
|
+
"@stacksjs/model-meta": "0.75.572",
|
|
75
|
+
"@stacksjs/pagination": "0.75.572",
|
|
76
|
+
"@stacksjs/path": "0.75.572",
|
|
77
|
+
"@stacksjs/query-builder": "0.75.572",
|
|
78
|
+
"@stacksjs/realtime": "0.75.572",
|
|
79
|
+
"@stacksjs/router": "0.75.572",
|
|
80
|
+
"@stacksjs/storage": "0.75.572",
|
|
81
|
+
"@stacksjs/strings": "0.75.572",
|
|
82
82
|
"@stacksjs/ts-validation": "^0.5.7",
|
|
83
|
-
"@stacksjs/validation": "0.75.
|
|
84
|
-
"bun-query-builder": "^0.
|
|
83
|
+
"@stacksjs/validation": "0.75.572",
|
|
84
|
+
"bun-query-builder": "^0.6.0",
|
|
85
85
|
"stripe": "23.0.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@stacksjs/auth": "0.75.
|
|
89
|
-
"@stacksjs/payments": "0.75.
|
|
90
|
-
"@stacksjs/queue": "0.75.
|
|
91
|
-
"@stacksjs/search-engine": "0.75.
|
|
88
|
+
"@stacksjs/auth": "0.75.572",
|
|
89
|
+
"@stacksjs/payments": "0.75.572",
|
|
90
|
+
"@stacksjs/queue": "0.75.572",
|
|
91
|
+
"@stacksjs/search-engine": "0.75.572"
|
|
92
92
|
},
|
|
93
93
|
"peerDependenciesMeta": {
|
|
94
94
|
"@stacksjs/auth": {
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@stacksjs/types": "0.75.
|
|
105
|
+
"@stacksjs/types": "0.75.572",
|
|
106
106
|
"better-dx": "^0.2.24"
|
|
107
107
|
}
|
|
108
108
|
}
|