@stacksjs/types 0.61.24 → 0.62.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/dist/index.js +6 -6
- package/package.json +11 -11
- package/src/index.ts +1 -0
- package/src/model-names.ts +10 -1
- package/src/model.ts +15 -10
- package/src/request.ts +37 -13
- package/src/settings-config.ts +10 -0
package/dist/index.js
CHANGED
|
@@ -397,7 +397,7 @@ var require_pluralize = __commonJS((exports, module) => {
|
|
|
397
397
|
});
|
|
398
398
|
// src/cron-jobs.ts
|
|
399
399
|
var Every;
|
|
400
|
-
(
|
|
400
|
+
((Every2) => {
|
|
401
401
|
Every2["Minute"] = "* * * * *";
|
|
402
402
|
Every2["TwoMinutes"] = "*/2 * * * *";
|
|
403
403
|
Every2["FiveMinutes"] = "*/5 * * * *";
|
|
@@ -412,10 +412,10 @@ var Every;
|
|
|
412
412
|
Every2["Weekend"] = "0 0 * * 0,6";
|
|
413
413
|
Every2["Month"] = "0 0 1 * *";
|
|
414
414
|
Every2["Year"] = "0 0 1 1 *";
|
|
415
|
-
})(Every
|
|
415
|
+
})(Every ||= {});
|
|
416
416
|
// src/docs.ts
|
|
417
417
|
var SocialLinkIcon;
|
|
418
|
-
(
|
|
418
|
+
((SocialLinkIcon2) => {
|
|
419
419
|
SocialLinkIcon2["Discord"] = "discord";
|
|
420
420
|
SocialLinkIcon2["Facebook"] = "facebook";
|
|
421
421
|
SocialLinkIcon2["GitHub"] = "github";
|
|
@@ -425,14 +425,14 @@ var SocialLinkIcon;
|
|
|
425
425
|
SocialLinkIcon2["Slack"] = "slack";
|
|
426
426
|
SocialLinkIcon2["Twitter"] = "twitter";
|
|
427
427
|
SocialLinkIcon2["YouTube"] = "youtube";
|
|
428
|
-
})(SocialLinkIcon
|
|
428
|
+
})(SocialLinkIcon ||= {});
|
|
429
429
|
// src/exit-code.ts
|
|
430
430
|
var ExitCode;
|
|
431
|
-
(
|
|
431
|
+
((ExitCode2) => {
|
|
432
432
|
ExitCode2[ExitCode2["Success"] = 0] = "Success";
|
|
433
433
|
ExitCode2[ExitCode2["FatalError"] = 1] = "FatalError";
|
|
434
434
|
ExitCode2[ExitCode2["InvalidArgument"] = 9] = "InvalidArgument";
|
|
435
|
-
})(ExitCode
|
|
435
|
+
})(ExitCode ||= {});
|
|
436
436
|
// src/logger.ts
|
|
437
437
|
import {LogLevels, LogTypes} from "consola";
|
|
438
438
|
// ../strings/src/utils.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.62.0",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@rollup/pluginutils": "^5.1.0",
|
|
56
56
|
"@stacksjs/validation": "latest",
|
|
57
57
|
"@types/aws4": "^1.11.6",
|
|
58
|
-
"@types/bun": "^1.1.
|
|
58
|
+
"@types/bun": "^1.1.6",
|
|
59
59
|
"@types/crypto-js": "^4.2.2",
|
|
60
60
|
"@types/fs-extra": "^11.0.4",
|
|
61
61
|
"@types/markdown-it-link-attributes": "^3.0.5",
|
|
@@ -64,21 +64,21 @@
|
|
|
64
64
|
"@vinejs/vine": "^2.1.0",
|
|
65
65
|
"cac": "^6.7.14",
|
|
66
66
|
"markdown-it": "^14.1.0",
|
|
67
|
-
"meilisearch": "^0.
|
|
67
|
+
"meilisearch": "^0.41.0",
|
|
68
68
|
"neverthrow": "^6.2.2",
|
|
69
69
|
"ora": "^8.0.1",
|
|
70
|
-
"unocss": "^0.
|
|
70
|
+
"unocss": "^0.61.3",
|
|
71
71
|
"unplugin-auto-import": "^0.17.6",
|
|
72
|
-
"unplugin-vue-components": "^0.27.
|
|
73
|
-
"vite": "^5.
|
|
72
|
+
"unplugin-vue-components": "^0.27.2",
|
|
73
|
+
"vite": "^5.3.3",
|
|
74
74
|
"vite-plugin-inspect": "^0.8.4",
|
|
75
75
|
"vite-plugin-pwa": "^0.20.0",
|
|
76
|
-
"vite-ssg": "^0.23.
|
|
77
|
-
"vitepress": "1.
|
|
78
|
-
"vue": "^3.4.
|
|
76
|
+
"vite-ssg": "^0.23.8",
|
|
77
|
+
"vitepress": "1.3.0",
|
|
78
|
+
"vue": "^3.4.31"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"aws-cdk-lib": "^2.
|
|
82
|
-
"typescript": "^5.
|
|
81
|
+
"aws-cdk-lib": "^2.148.1",
|
|
82
|
+
"typescript": "^5.5.3"
|
|
83
83
|
}
|
|
84
84
|
}
|
package/src/index.ts
CHANGED
package/src/model-names.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export type ModelNames =
|
|
1
|
+
export type ModelNames =
|
|
2
|
+
| 'Project'
|
|
3
|
+
| 'SubscriberEmail'
|
|
4
|
+
| 'AccessToken'
|
|
5
|
+
| 'Team'
|
|
6
|
+
| 'Subscriber'
|
|
7
|
+
| 'Deployment'
|
|
8
|
+
| 'Release'
|
|
9
|
+
| 'User'
|
|
10
|
+
| 'Post'
|
package/src/model.ts
CHANGED
|
@@ -2,7 +2,9 @@ import type { ModelNames, Model as ModelType } from '@stacksjs/types'
|
|
|
2
2
|
import type { VineBoolean, VineNumber, VineString } from '@vinejs/vine'
|
|
3
3
|
import type { DeepPartial, Nullable, SearchOptions } from '.'
|
|
4
4
|
|
|
5
|
-
export type AuthOptions = {
|
|
5
|
+
export type AuthOptions = {
|
|
6
|
+
useTwoFactor?: boolean
|
|
7
|
+
}
|
|
6
8
|
|
|
7
9
|
export type ApiRoutes = 'index' | 'show' | 'store' | 'update' | 'destroy'
|
|
8
10
|
|
|
@@ -11,6 +13,14 @@ export interface SeedOptions {
|
|
|
11
13
|
count: number
|
|
12
14
|
}
|
|
13
15
|
|
|
16
|
+
interface BelongsToManyType {
|
|
17
|
+
model: ModelNames
|
|
18
|
+
firstForeignKey?: string
|
|
19
|
+
secondForeignKey?: string
|
|
20
|
+
pivotTable?: string
|
|
21
|
+
relationName?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
export interface ApiSettings {
|
|
15
25
|
uri: string
|
|
16
26
|
middleware: string[]
|
|
@@ -87,15 +97,7 @@ export interface ModelOptions extends Base {
|
|
|
87
97
|
relationName?: string
|
|
88
98
|
}[]
|
|
89
99
|
| ModelNames[] // belongsTo: 'User'
|
|
90
|
-
belongsToMany:
|
|
91
|
-
| {
|
|
92
|
-
model: ModelNames
|
|
93
|
-
firstForeignKey?: string
|
|
94
|
-
secondForeignKey?: string
|
|
95
|
-
pivotTable?: string
|
|
96
|
-
relationName?: string
|
|
97
|
-
}
|
|
98
|
-
| ModelNames[]
|
|
100
|
+
belongsToMany: BelongsToManyType[] | ModelNames[]
|
|
99
101
|
hasOneThrough: {
|
|
100
102
|
model: ModelNames
|
|
101
103
|
through: ModelNames
|
|
@@ -116,7 +118,10 @@ export interface ModelOptions extends Base {
|
|
|
116
118
|
export interface Attribute {
|
|
117
119
|
default?: string | number | boolean | Date
|
|
118
120
|
unique?: boolean
|
|
121
|
+
order?: number
|
|
119
122
|
required?: boolean
|
|
123
|
+
hidden?: boolean
|
|
124
|
+
fillable?: boolean
|
|
120
125
|
factory?: () => any
|
|
121
126
|
validation?: {
|
|
122
127
|
rule: VineType
|
package/src/request.ts
CHANGED
|
@@ -1,27 +1,51 @@
|
|
|
1
|
+
import type { VineType } from '@stacksjs/types'
|
|
2
|
+
|
|
1
3
|
interface RequestData {
|
|
2
|
-
|
|
4
|
+
[key: string]: string
|
|
3
5
|
}
|
|
4
|
-
|
|
6
|
+
|
|
5
7
|
type RouteParams = { [key: string]: string } | null
|
|
6
8
|
|
|
9
|
+
interface ValidationType {
|
|
10
|
+
rule: VineType
|
|
11
|
+
message: { [key: string]: string }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ValidationField {
|
|
15
|
+
[key: string]: string | ValidationType
|
|
16
|
+
validation: ValidationType
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface CustomAttributes {
|
|
20
|
+
[key: string]: ValidationField
|
|
21
|
+
}
|
|
22
|
+
|
|
7
23
|
export interface RequestInstance {
|
|
8
|
-
|
|
24
|
+
addQuery(url: URL): void
|
|
25
|
+
|
|
26
|
+
addBodies(params: any): void
|
|
27
|
+
|
|
28
|
+
addParam(param: RouteParams): void
|
|
9
29
|
|
|
10
|
-
|
|
30
|
+
get(element: string): string | number | undefined
|
|
11
31
|
|
|
12
|
-
|
|
32
|
+
header(element: string): string | number | boolean | null
|
|
13
33
|
|
|
14
|
-
|
|
34
|
+
Header(element: string): string | number | boolean | null
|
|
15
35
|
|
|
16
|
-
|
|
36
|
+
all(): RequestData
|
|
17
37
|
|
|
18
|
-
|
|
38
|
+
validate(attributes: CustomAttributes): void
|
|
19
39
|
|
|
20
|
-
|
|
40
|
+
has(element: string): boolean
|
|
21
41
|
|
|
22
|
-
|
|
42
|
+
isEmpty(): boolean
|
|
23
43
|
|
|
24
|
-
|
|
44
|
+
extractParamsFromRoute(routePattern: string, pathname: string): void
|
|
25
45
|
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
getParam(key: string): number | string | null
|
|
47
|
+
|
|
48
|
+
getParams(): RouteParams
|
|
49
|
+
|
|
50
|
+
getParamAsInt(key: string): number | null
|
|
51
|
+
}
|