@h3ravel/arquebus 0.6.16 → 0.7.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/bin/index.cjs +11 -9
- package/bin/index.js +11 -9
- package/dist/concerns/chunk-Bop6jNiL.js +15 -0
- package/dist/concerns/index.cjs +3540 -0
- package/dist/concerns/index.d.ts +5226 -0
- package/dist/concerns/index.js +3457 -0
- package/dist/index.cjs +10 -8
- package/dist/index.js +10 -8
- package/dist/inspector/index.cjs +10 -8
- package/dist/inspector/index.js +10 -8
- package/dist/migrations/index.cjs +10 -8
- package/dist/migrations/index.js +10 -8
- package/dist/relations/index.cjs +3464 -0
- package/dist/relations/index.d.ts +2 -0
- package/dist/relations/index.js +3441 -0
- package/package.json +21 -1
- package/types/generics.ts +19 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/arquebus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Arquebus ORM is a Beautiful, expressive ORM inspired by Laravel's Eloquent, designed for TypeScript applications and for the H3ravel Framework.",
|
|
5
5
|
"homepage": "https://h3ravel.toneflix.net/arquebus",
|
|
6
6
|
"bin": {
|
|
@@ -71,6 +71,26 @@
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
+
"./concerns": {
|
|
75
|
+
"import": {
|
|
76
|
+
"types": "./dist/concerns/index.d.ts",
|
|
77
|
+
"default": "./dist/concerns/index.js"
|
|
78
|
+
},
|
|
79
|
+
"require": {
|
|
80
|
+
"types": "./dist/concerns/index.d.cts",
|
|
81
|
+
"default": "./dist/concerns/index.cjs"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"./relations": {
|
|
85
|
+
"import": {
|
|
86
|
+
"types": "./dist/relations/index.d.ts",
|
|
87
|
+
"default": "./dist/relations/index.js"
|
|
88
|
+
},
|
|
89
|
+
"require": {
|
|
90
|
+
"types": "./dist/relations/index.d.cts",
|
|
91
|
+
"default": "./dist/relations/index.cjs"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
74
94
|
"./migrations": {
|
|
75
95
|
"import": {
|
|
76
96
|
"types": "./dist/migrations/index.d.ts",
|
package/types/generics.ts
CHANGED
|
@@ -47,16 +47,16 @@ export type ReturnTypeOfMethod<T, K extends keyof T> = T[K] extends (
|
|
|
47
47
|
|
|
48
48
|
export type SnakeToCamelCase<S extends string> =
|
|
49
49
|
S extends `${infer T}_${infer U}`
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
? `${T}${Capitalize<SnakeToCamelCase<U>>}`
|
|
51
|
+
: S
|
|
52
52
|
|
|
53
53
|
// declare const model: ModelDecorator;
|
|
54
54
|
export type CamelToSnakeCase<S extends string> =
|
|
55
55
|
S extends `${infer T}${infer U}`
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
? U extends Uncapitalize<U>
|
|
57
|
+
? `${Uncapitalize<T>}${CamelToSnakeCase<U>}`
|
|
58
|
+
: `${Uncapitalize<T>}_${CamelToSnakeCase<U>}`
|
|
59
|
+
: S
|
|
60
60
|
|
|
61
61
|
export type FunctionPropertyNames<T> = {
|
|
62
62
|
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never
|
|
@@ -64,12 +64,12 @@ export type FunctionPropertyNames<T> = {
|
|
|
64
64
|
|
|
65
65
|
export type RelationNames<T> =
|
|
66
66
|
FunctionPropertyNames<T> extends infer R
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
? R extends `relation${infer P}`
|
|
68
|
+
? P extends 'sToData' | 'loaded'
|
|
69
|
+
? never
|
|
70
|
+
: CamelToSnakeCase<P>
|
|
71
|
+
: never
|
|
72
|
+
: never
|
|
73
73
|
|
|
74
74
|
export type MixinConstructor<T = TGeneric> = new (...args: any[]) => T
|
|
75
75
|
export type AbstractConstructor<T = TGeneric> = abstract new (
|
|
@@ -82,18 +82,18 @@ export type MixinReturn<
|
|
|
82
82
|
Mixins extends ((base: any) => any)[],
|
|
83
83
|
> =
|
|
84
84
|
Base extends MixinConstructor<infer B>
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
? IntersectionOfInstances<InstanceTypeOfMixins<Mixins>> & B
|
|
86
|
+
: never
|
|
87
87
|
|
|
88
88
|
export type InstanceTypeOfMixins<T extends ((base: any) => any)[]> = T extends [
|
|
89
89
|
infer Head,
|
|
90
90
|
...infer Tail,
|
|
91
91
|
]
|
|
92
92
|
? Head extends (base: any) => infer R
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
? Tail extends ((base: any) => any)[]
|
|
94
|
+
? R | InstanceTypeOfMixins<Tail>
|
|
95
|
+
: R
|
|
96
|
+
: never
|
|
97
97
|
: never
|
|
98
98
|
|
|
99
99
|
export type IntersectionOfInstances<U> = (
|
|
@@ -103,7 +103,7 @@ export type IntersectionOfInstances<U> = (
|
|
|
103
103
|
: never
|
|
104
104
|
|
|
105
105
|
export interface DeepMixinFunction {
|
|
106
|
-
<MC extends MixinConstructor, P extends ((base: any) => any)[]>(
|
|
106
|
+
<MC extends MixinConstructor, P extends ((base: any) => any)[]> (
|
|
107
107
|
Base: MC,
|
|
108
108
|
...mixins: P
|
|
109
109
|
): MixinReturn<MC, P>
|