@stacksjs/types 0.61.20 → 0.61.21
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/package.json +8 -8
- package/src/index.ts +1 -0
- package/src/model-names.ts +1 -9
- package/src/model.ts +2 -2
- package/src/request.ts +27 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.61.
|
|
4
|
+
"version": "0.61.21",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@stacksjs/validation": "latest",
|
|
49
|
-
"neverthrow": "^6.2.
|
|
49
|
+
"neverthrow": "^6.2.2"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@mdit-vue/plugin-component": "^2.1.3",
|
|
@@ -61,24 +61,24 @@
|
|
|
61
61
|
"@types/markdown-it-link-attributes": "^3.0.5",
|
|
62
62
|
"@types/minimatch": "^5.1.2",
|
|
63
63
|
"@types/nprogress": "^0.2.3",
|
|
64
|
-
"@vinejs/vine": "^2.
|
|
64
|
+
"@vinejs/vine": "^2.1.0",
|
|
65
65
|
"cac": "^6.7.14",
|
|
66
66
|
"markdown-it": "^14.1.0",
|
|
67
67
|
"meilisearch": "^0.40.0",
|
|
68
|
-
"neverthrow": "^6.2.
|
|
68
|
+
"neverthrow": "^6.2.2",
|
|
69
69
|
"ora": "^8.0.1",
|
|
70
|
-
"unocss": "^0.60.
|
|
70
|
+
"unocss": "^0.60.4",
|
|
71
71
|
"unplugin-auto-import": "^0.17.6",
|
|
72
72
|
"unplugin-vue-components": "^0.27.0",
|
|
73
|
-
"vite": "^5.2.
|
|
73
|
+
"vite": "^5.2.12",
|
|
74
74
|
"vite-plugin-inspect": "^0.8.4",
|
|
75
75
|
"vite-plugin-pwa": "^0.20.0",
|
|
76
76
|
"vite-ssg": "^0.23.7",
|
|
77
|
-
"vitepress": "1.2.
|
|
77
|
+
"vitepress": "1.2.3",
|
|
78
78
|
"vue": "^3.4.27"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"aws-cdk-lib": "^2.
|
|
81
|
+
"aws-cdk-lib": "^2.144.0",
|
|
82
82
|
"typescript": "^5.4.5"
|
|
83
83
|
}
|
|
84
84
|
}
|
package/src/index.ts
CHANGED
package/src/model-names.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export type ModelNames =
|
|
2
|
-
| 'Project'
|
|
3
|
-
| 'SubscriberEmail'
|
|
4
|
-
| 'AccessToken'
|
|
5
|
-
| 'Team'
|
|
6
|
-
| 'Subscriber'
|
|
7
|
-
| 'Deployment'
|
|
8
|
-
| 'User'
|
|
9
|
-
| 'Post'
|
|
1
|
+
export type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Subscriber' | 'Deployment' | 'User' | 'Post'
|
package/src/model.ts
CHANGED
|
@@ -60,7 +60,7 @@ export interface ModelOptions extends Base {
|
|
|
60
60
|
seedable?: boolean | SeedOptions // useSeeder alias
|
|
61
61
|
useSearch?: boolean | SearchOptions // defaults to false
|
|
62
62
|
searchable?: boolean | SearchOptions // useSearch alias
|
|
63
|
-
useApi?:
|
|
63
|
+
useApi?: ApiOptions | boolean
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
attributes: Attributes
|
|
@@ -118,7 +118,7 @@ export interface Attribute {
|
|
|
118
118
|
unique?: boolean
|
|
119
119
|
required?: boolean
|
|
120
120
|
factory?: () => any
|
|
121
|
-
|
|
121
|
+
validation?: {
|
|
122
122
|
rule: VineType
|
|
123
123
|
message: ValidatorMessage
|
|
124
124
|
}
|
package/src/request.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface RequestData {
|
|
2
|
+
[key: string]: string
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
type RouteParams = { [key: string]: string } | null
|
|
6
|
+
|
|
7
|
+
export interface RequestInstance {
|
|
8
|
+
addQuery(url: URL): void;
|
|
9
|
+
|
|
10
|
+
addParam(param: RouteParams): void;
|
|
11
|
+
|
|
12
|
+
get(element: string): string | number | undefined;
|
|
13
|
+
|
|
14
|
+
all(): RequestData;
|
|
15
|
+
|
|
16
|
+
has(element: string): boolean;
|
|
17
|
+
|
|
18
|
+
isEmpty(): boolean;
|
|
19
|
+
|
|
20
|
+
extractParamsFromRoute(routePattern: string, pathname: string): void;
|
|
21
|
+
|
|
22
|
+
getParam(key: string): number | string | null;
|
|
23
|
+
|
|
24
|
+
getParams(): RouteParams;
|
|
25
|
+
|
|
26
|
+
getParamAsInt(key: string): number | null;
|
|
27
|
+
}
|