@stacksjs/orm 0.75.158 → 0.75.160
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/define-model.d.ts +6 -2
- package/dist/model-types.d.ts +4 -1
- package/package.json +23 -23
package/dist/define-model.d.ts
CHANGED
|
@@ -242,9 +242,13 @@ declare type DefaultTypeToken<TAttribute> = TAttribute extends { default: infer
|
|
|
242
242
|
: TDefault extends Record<string, unknown> ? 'json'
|
|
243
243
|
: never
|
|
244
244
|
: never;
|
|
245
|
-
declare type InferenceHint<TAttribute> = TAttribute extends { type: unknown }
|
|
245
|
+
declare type InferenceHint<TAttribute> = TAttribute extends { type: unknown }
|
|
246
246
|
? object
|
|
247
|
-
:
|
|
247
|
+
: TAttribute extends { validation: { rule: { readonly name: 'enum' } } }
|
|
248
|
+
? { type: ValidationRuleOf<TAttribute> }
|
|
249
|
+
: TAttribute extends { factory: (...args: never[]) => unknown }
|
|
250
|
+
? object
|
|
251
|
+
: [ValidationRuleOf<TAttribute>] extends [never]
|
|
248
252
|
? [DefaultTypeToken<TAttribute>] extends [never]
|
|
249
253
|
? object
|
|
250
254
|
: { type: DefaultTypeToken<TAttribute> }
|
package/dist/model-types.d.ts
CHANGED
|
@@ -55,7 +55,10 @@ declare type WidenDefault<TValue> = TValue extends string
|
|
|
55
55
|
: TValue;
|
|
56
56
|
declare type AttributeValue<TAttribute> = TAttribute extends { readonly type: infer TType }
|
|
57
57
|
? PrimitiveType<TType>
|
|
58
|
-
|
|
58
|
+
// A factory often returns string even when validation admits only an enum.
|
|
59
|
+
// Keep that declared set of values, rather than widening it to the factory.
|
|
60
|
+
: TAttribute extends { readonly validation: { readonly rule: { readonly name: 'enum' } & Validator<infer TValue> } } ? TValue
|
|
61
|
+
: TAttribute extends { readonly factory: (...args: never[]) => infer TValue } ? TValue
|
|
59
62
|
: TAttribute extends { readonly validation: { readonly rule: infer TRule } }
|
|
60
63
|
? TRule extends Validator<infer TValue> ? TValue : unknown
|
|
61
64
|
: TAttribute extends { readonly default: infer TDefault } ? WidenDefault<TDefault>
|
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.160",
|
|
6
6
|
"description": "The Stacks ORM integration",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -63,31 +63,31 @@
|
|
|
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.160",
|
|
67
|
+
"@stacksjs/cli": "0.75.160",
|
|
68
|
+
"@stacksjs/config": "0.75.160",
|
|
69
|
+
"@stacksjs/database": "0.75.160",
|
|
70
|
+
"@stacksjs/env": "0.75.160",
|
|
71
|
+
"@stacksjs/error-handling": "0.75.160",
|
|
72
|
+
"@stacksjs/events": "0.75.160",
|
|
73
|
+
"@stacksjs/logging": "0.75.160",
|
|
74
|
+
"@stacksjs/model-meta": "0.75.160",
|
|
75
|
+
"@stacksjs/pagination": "0.75.160",
|
|
76
|
+
"@stacksjs/path": "0.75.160",
|
|
77
|
+
"@stacksjs/query-builder": "0.75.160",
|
|
78
|
+
"@stacksjs/realtime": "0.75.160",
|
|
79
|
+
"@stacksjs/router": "0.75.160",
|
|
80
|
+
"@stacksjs/storage": "0.75.160",
|
|
81
|
+
"@stacksjs/strings": "0.75.160",
|
|
82
82
|
"@stacksjs/ts-validation": "^0.5.6",
|
|
83
|
-
"@stacksjs/validation": "0.75.
|
|
83
|
+
"@stacksjs/validation": "0.75.160",
|
|
84
84
|
"bun-query-builder": "^0.3.8"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@stacksjs/auth": "0.75.
|
|
88
|
-
"@stacksjs/payments": "0.75.
|
|
89
|
-
"@stacksjs/queue": "0.75.
|
|
90
|
-
"@stacksjs/search-engine": "0.75.
|
|
87
|
+
"@stacksjs/auth": "0.75.160",
|
|
88
|
+
"@stacksjs/payments": "0.75.160",
|
|
89
|
+
"@stacksjs/queue": "0.75.160",
|
|
90
|
+
"@stacksjs/search-engine": "0.75.160",
|
|
91
91
|
"stripe": "23.0.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependenciesMeta": {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@stacksjs/types": "0.75.
|
|
111
|
+
"@stacksjs/types": "0.75.160",
|
|
112
112
|
"better-dx": "^0.2.24",
|
|
113
113
|
"stripe": "23.0.0"
|
|
114
114
|
}
|