@stacksjs/types 0.64.6 → 0.65.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/ai.d.ts +15 -0
- package/dist/analytics.d.ts +15 -0
- package/dist/api.d.ts +67 -0
- package/dist/app.d.ts +135 -0
- package/dist/auto-imports.d.ts +1 -0
- package/dist/binary.d.ts +11 -0
- package/dist/build.d.ts +2 -0
- package/dist/cache.d.ts +62 -0
- package/dist/cdn.d.ts +16 -0
- package/dist/chat.d.ts +3 -0
- package/dist/cli.d.ts +246 -0
- package/dist/cloud.d.ts +69 -0
- package/dist/components.d.ts +60 -0
- package/dist/configure.d.ts +12 -0
- package/dist/cron-jobs.d.ts +43 -0
- package/dist/database.d.ts +47 -0
- package/dist/dependencies.d.ts +62 -0
- package/dist/deploy.d.ts +16 -0
- package/dist/dns.d.ts +175 -0
- package/dist/docs.d.ts +22 -0
- package/dist/email.d.ts +11 -0
- package/dist/env.d.ts +0 -0
- package/dist/errors.d.ts +70 -0
- package/dist/events.d.ts +30 -0
- package/dist/exit-code.d.ts +10 -0
- package/dist/file-systems.d.ts +60 -0
- package/dist/git.d.ts +128 -0
- package/dist/hashing.d.ts +100 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/i18n.d.ts +19 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +11 -10
- package/dist/inspect.d.ts +9 -0
- package/dist/layout.d.ts +0 -0
- package/dist/library.d.ts +142 -0
- package/dist/logging.d.ts +28 -0
- package/dist/manifest.d.ts +9 -0
- package/dist/model-names.d.ts +1 -0
- package/dist/model.d.ts +144 -0
- package/dist/native.d.ts +0 -0
- package/dist/notifications.d.ts +106 -0
- package/dist/pages.d.ts +10 -0
- package/dist/payments.d.ts +60 -0
- package/dist/ports.d.ts +20 -0
- package/dist/promise.d.ts +1 -0
- package/dist/push.d.ts +31 -0
- package/dist/pwa.d.ts +7 -0
- package/dist/queue.d.ts +34 -0
- package/dist/reactivity.d.ts +1 -0
- package/dist/request.d.ts +30 -0
- package/dist/router.d.ts +55 -0
- package/dist/scheduler.d.ts +1 -0
- package/dist/search-engine.d.ts +114 -0
- package/dist/security.d.ts +18 -0
- package/dist/server.d.ts +6 -0
- package/dist/services.d.ts +29 -0
- package/dist/settings-config.d.ts +9 -0
- package/dist/sms.d.ts +0 -0
- package/dist/ssg.d.ts +2 -0
- package/dist/stacks.d.ts +204 -0
- package/dist/storage.d.ts +12 -0
- package/dist/tables.d.ts +52 -0
- package/dist/team.d.ts +8 -0
- package/dist/ui.d.ts +165 -0
- package/dist/utils.d.ts +30 -0
- package/package.json +19 -19
- package/src/api.ts +6 -6
- package/src/app.ts +1 -1
- package/src/chat.ts +1 -1
- package/src/cli.ts +7 -3
- package/src/cloud.ts +1 -1
- package/src/cron-jobs.ts +1 -0
- package/src/deploy.ts +1 -0
- package/src/errors.ts +50 -51
- package/src/git.ts +1 -1
- package/src/helpers.ts +3 -2
- package/src/index.ts +8 -7
- package/src/model-names.ts +1 -10
- package/src/model.ts +35 -19
- package/src/notifications.ts +1 -5
- package/src/request.ts +16 -15
- package/src/router.ts +1 -0
- package/src/search-engine.ts +3 -3
- package/src/server.ts +16 -0
- package/src/settings-config.ts +2 -2
- package/src/stacks.ts +0 -1
package/src/errors.ts
CHANGED
|
@@ -7,55 +7,54 @@
|
|
|
7
7
|
// toString(): string
|
|
8
8
|
// }
|
|
9
9
|
|
|
10
|
-
// export type StacksError = Error
|
|
11
10
|
export type CommandError = Error
|
|
12
11
|
|
|
13
12
|
export interface ErrorOptions {
|
|
14
13
|
messages: {
|
|
15
|
-
string: string
|
|
16
|
-
email: string
|
|
17
|
-
regex: string
|
|
18
|
-
url: string
|
|
19
|
-
activeUrl: string
|
|
20
|
-
alpha: string
|
|
21
|
-
alphaNumeric: string
|
|
22
|
-
minLength: string
|
|
23
|
-
maxLength: string
|
|
24
|
-
fixedLength: string
|
|
25
|
-
confirmed: string
|
|
26
|
-
endsWith: string
|
|
27
|
-
startsWith: string
|
|
28
|
-
sameAs: string
|
|
29
|
-
notSameAs: string
|
|
30
|
-
in: string
|
|
31
|
-
notIn: string
|
|
32
|
-
ipAddress: string
|
|
33
|
-
uuid: string
|
|
34
|
-
ascii: string
|
|
35
|
-
creditCard: string
|
|
36
|
-
hexCode: string
|
|
37
|
-
iban: string
|
|
38
|
-
jwt: string
|
|
39
|
-
coordinates: string
|
|
40
|
-
mobile: string
|
|
41
|
-
passport: string
|
|
42
|
-
postalCode: string
|
|
14
|
+
'string': string
|
|
15
|
+
'email': string
|
|
16
|
+
'regex': string
|
|
17
|
+
'url': string
|
|
18
|
+
'activeUrl': string
|
|
19
|
+
'alpha': string
|
|
20
|
+
'alphaNumeric': string
|
|
21
|
+
'minLength': string
|
|
22
|
+
'maxLength': string
|
|
23
|
+
'fixedLength': string
|
|
24
|
+
'confirmed': string
|
|
25
|
+
'endsWith': string
|
|
26
|
+
'startsWith': string
|
|
27
|
+
'sameAs': string
|
|
28
|
+
'notSameAs': string
|
|
29
|
+
'in': string
|
|
30
|
+
'notIn': string
|
|
31
|
+
'ipAddress': string
|
|
32
|
+
'uuid': string
|
|
33
|
+
'ascii': string
|
|
34
|
+
'creditCard': string
|
|
35
|
+
'hexCode': string
|
|
36
|
+
'iban': string
|
|
37
|
+
'jwt': string
|
|
38
|
+
'coordinates': string
|
|
39
|
+
'mobile': string
|
|
40
|
+
'passport': string
|
|
41
|
+
'postalCode': string
|
|
43
42
|
|
|
44
43
|
// boolean
|
|
45
|
-
boolean: string
|
|
44
|
+
'boolean': string
|
|
46
45
|
|
|
47
46
|
// number
|
|
48
|
-
number: string
|
|
49
|
-
min: string
|
|
50
|
-
max: string
|
|
51
|
-
range: string
|
|
52
|
-
positive: string
|
|
53
|
-
negative: string
|
|
54
|
-
decimal: string
|
|
55
|
-
withoutDecimals: string
|
|
47
|
+
'number': string
|
|
48
|
+
'min': string
|
|
49
|
+
'max': string
|
|
50
|
+
'range': string
|
|
51
|
+
'positive': string
|
|
52
|
+
'negative': string
|
|
53
|
+
'decimal': string
|
|
54
|
+
'withoutDecimals': string
|
|
56
55
|
|
|
57
56
|
// date
|
|
58
|
-
date: string
|
|
57
|
+
'date': string
|
|
59
58
|
'date.equals': string
|
|
60
59
|
'date.after': string
|
|
61
60
|
'date.before': string
|
|
@@ -66,38 +65,38 @@ export interface ErrorOptions {
|
|
|
66
65
|
'date.afterField': string
|
|
67
66
|
|
|
68
67
|
// accepted
|
|
69
|
-
accepted: string
|
|
68
|
+
'accepted': string
|
|
70
69
|
|
|
71
70
|
// enum
|
|
72
|
-
enum: string
|
|
71
|
+
'enum': string
|
|
73
72
|
|
|
74
73
|
// literal
|
|
75
|
-
literal: string
|
|
74
|
+
'literal': string
|
|
76
75
|
|
|
77
76
|
// object
|
|
78
|
-
object: string
|
|
77
|
+
'object': string
|
|
79
78
|
|
|
80
79
|
// record
|
|
81
|
-
record: string
|
|
80
|
+
'record': string
|
|
82
81
|
'record.minLength': string
|
|
83
82
|
'record.maxLength': string
|
|
84
83
|
'record.fixedLength': string
|
|
85
84
|
|
|
86
85
|
// array
|
|
87
|
-
array: string
|
|
86
|
+
'array': string
|
|
88
87
|
'array.minLength': string
|
|
89
88
|
'array.maxLength': string
|
|
90
89
|
'array.fixedLength': string
|
|
91
|
-
notEmpty: string
|
|
92
|
-
distinct: string
|
|
90
|
+
'notEmpty': string
|
|
91
|
+
'distinct': string
|
|
93
92
|
|
|
94
93
|
// tuple
|
|
95
|
-
tuple: string
|
|
94
|
+
'tuple': string
|
|
96
95
|
|
|
97
96
|
// union
|
|
98
|
-
union: string
|
|
99
|
-
unionGroup: string
|
|
100
|
-
unionOfTypes: string
|
|
97
|
+
'union': string
|
|
98
|
+
'unionGroup': string
|
|
99
|
+
'unionOfTypes': string
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
|
package/src/git.ts
CHANGED
package/src/helpers.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { toString } from '@stacksjs/strings'
|
|
2
2
|
|
|
3
|
-
export function getTypeName(v: any) {
|
|
4
|
-
if (v === null)
|
|
3
|
+
export function getTypeName(v: any): string {
|
|
4
|
+
if (v === null)
|
|
5
|
+
return 'null'
|
|
5
6
|
const type = toString(v).slice(8, -1).toLowerCase()
|
|
6
7
|
|
|
7
8
|
return typeof v === 'object' || typeof v === 'function' ? type : typeof v
|
package/src/index.ts
CHANGED
|
@@ -18,14 +18,15 @@ export * from './dependencies'
|
|
|
18
18
|
export * from './deploy'
|
|
19
19
|
export * from './dns'
|
|
20
20
|
export * from './docs'
|
|
21
|
-
export * from './errors'
|
|
22
21
|
export * from './email'
|
|
23
22
|
export * from './env'
|
|
23
|
+
export * from './errors'
|
|
24
24
|
export * from './events'
|
|
25
25
|
export * from './exit-code'
|
|
26
26
|
export * from './file-systems'
|
|
27
27
|
export * from './git'
|
|
28
28
|
export * from './hashing'
|
|
29
|
+
export * from './helpers'
|
|
29
30
|
export * from './i18n'
|
|
30
31
|
export * from './inspect'
|
|
31
32
|
// export * from './layout'
|
|
@@ -39,24 +40,24 @@ export * from './pages'
|
|
|
39
40
|
export * from './payments'
|
|
40
41
|
export * from './ports'
|
|
41
42
|
export * from './promise'
|
|
42
|
-
export * from './pwa'
|
|
43
43
|
export * from './push'
|
|
44
|
+
export * from './pwa'
|
|
44
45
|
export * from './queue'
|
|
45
|
-
export * from './request'
|
|
46
46
|
export * from './reactivity'
|
|
47
|
+
export * from './request'
|
|
47
48
|
export * from './router'
|
|
48
49
|
export * from './scheduler'
|
|
49
50
|
export * from './search-engine'
|
|
50
51
|
export * from './security'
|
|
52
|
+
export * from './server'
|
|
51
53
|
export * from './services'
|
|
52
54
|
export * from './settings-config.ts'
|
|
53
55
|
export * from './sms'
|
|
54
56
|
export * from './ssg'
|
|
55
|
-
export * from './storage'
|
|
56
57
|
export * from './stacks'
|
|
57
|
-
export * from './
|
|
58
|
+
export * from './storage'
|
|
58
59
|
export * from './tables'
|
|
60
|
+
export * from './team'
|
|
59
61
|
export * from './ui'
|
|
60
|
-
export * from './utils'
|
|
61
62
|
|
|
62
|
-
export * from './
|
|
63
|
+
export * from './utils'
|
package/src/model-names.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
export type ModelNames =
|
|
2
|
-
| 'Project'
|
|
3
|
-
| 'SubscriberEmail'
|
|
4
|
-
| 'AccessToken'
|
|
5
|
-
| 'Team'
|
|
6
|
-
| 'Subscriber'
|
|
7
|
-
| 'Deployment'
|
|
8
|
-
| 'Release'
|
|
9
|
-
| 'User'
|
|
10
|
-
| 'Post'
|
|
1
|
+
export type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post'
|
package/src/model.ts
CHANGED
|
@@ -4,13 +4,27 @@ import type { DeepPartial, Nullable, SearchOptions } from '.'
|
|
|
4
4
|
|
|
5
5
|
export type Model = Partial<ModelOptions>
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export interface FieldArrayElement {
|
|
8
|
+
entity: string
|
|
9
|
+
charValue?: string | null
|
|
10
|
+
// Add other properties as needed
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ModelElement {
|
|
14
|
+
field: string
|
|
15
|
+
default: string | number | boolean | Date | undefined | null
|
|
16
|
+
unique: boolean
|
|
17
|
+
fieldArray: FieldArrayElement | null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AuthOptions {
|
|
8
21
|
useTwoFactor?: boolean
|
|
22
|
+
usePasskey?: boolean
|
|
9
23
|
}
|
|
10
24
|
|
|
11
25
|
type ActionPath = string
|
|
12
26
|
type ActionName = string
|
|
13
|
-
type Action = ActionPath | ActionName
|
|
27
|
+
type Action = ActionPath | ActionName | undefined
|
|
14
28
|
|
|
15
29
|
export type ApiRoutes = 'index' | 'show' | 'store' | 'update' | 'destroy'
|
|
16
30
|
|
|
@@ -21,7 +35,7 @@ export interface SeedOptions {
|
|
|
21
35
|
|
|
22
36
|
type LogAttribute = string
|
|
23
37
|
|
|
24
|
-
|
|
38
|
+
interface ActivityLogOption {
|
|
25
39
|
exclude: LogAttribute[]
|
|
26
40
|
include: LogAttribute[] // default to “*”
|
|
27
41
|
logOnly: LogAttribute[]
|
|
@@ -38,9 +52,11 @@ interface BelongsToManyType {
|
|
|
38
52
|
export interface ApiSettings {
|
|
39
53
|
uri: string
|
|
40
54
|
middleware: string[]
|
|
41
|
-
routes:
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
routes:
|
|
56
|
+
| {
|
|
57
|
+
[key in ApiRoutes]: Action
|
|
58
|
+
}
|
|
59
|
+
| string[]
|
|
44
60
|
openApi: boolean
|
|
45
61
|
}
|
|
46
62
|
|
|
@@ -60,7 +76,7 @@ export interface SoftDeleteOptions {
|
|
|
60
76
|
deletedAt?: string // defaults to 'deleted_at' & can be used for localized tables
|
|
61
77
|
}
|
|
62
78
|
|
|
63
|
-
|
|
79
|
+
interface Base {}
|
|
64
80
|
|
|
65
81
|
/**
|
|
66
82
|
* Model.
|
|
@@ -102,24 +118,24 @@ export interface ModelOptions extends Base {
|
|
|
102
118
|
// relationships
|
|
103
119
|
hasOne?:
|
|
104
120
|
| {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
121
|
+
model: ModelNames
|
|
122
|
+
foreignKey?: string
|
|
123
|
+
relationName?: string
|
|
124
|
+
}[]
|
|
109
125
|
| string[]
|
|
110
126
|
hasMany?:
|
|
111
127
|
| {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
128
|
+
model: ModelNames // should be typed as ModelName
|
|
129
|
+
foreignKey?: string
|
|
130
|
+
relationName?: string
|
|
131
|
+
}[]
|
|
116
132
|
| ModelNames[]
|
|
117
133
|
belongsTo?:
|
|
118
134
|
| {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
135
|
+
model: ModelNames // should be typed as ModelName
|
|
136
|
+
foreignKey?: string
|
|
137
|
+
relationName?: string
|
|
138
|
+
}[]
|
|
123
139
|
| ModelNames[] // belongsTo: 'User'
|
|
124
140
|
belongsToMany?: BelongsToManyType[] | ModelNames[]
|
|
125
141
|
hasOneThrough?: {
|
package/src/notifications.ts
CHANGED
package/src/request.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { VineType } from '@stacksjs/types'
|
|
2
2
|
|
|
3
|
+
export type * from '../../../types/requests'
|
|
3
4
|
interface RequestData {
|
|
4
|
-
[key: string]:
|
|
5
|
+
[key: string]: any
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
type RouteParams = { [key: string]: string | number } | null
|
|
@@ -16,31 +17,31 @@ interface CustomAttributes {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export interface RequestInstance {
|
|
19
|
-
addQuery(url: URL)
|
|
20
|
+
addQuery: (url: URL) => void
|
|
20
21
|
|
|
21
|
-
addBodies(params: any)
|
|
22
|
+
addBodies: (params: any) => void
|
|
22
23
|
|
|
23
|
-
addParam(param: RouteParams)
|
|
24
|
+
addParam: (param: RouteParams) => void
|
|
24
25
|
|
|
25
|
-
get(element:
|
|
26
|
+
get: <T>(element: T) => string | undefined
|
|
26
27
|
|
|
27
|
-
header(element: string)
|
|
28
|
+
header: (element: string) => string | number | boolean | null
|
|
28
29
|
|
|
29
|
-
Header(element: string)
|
|
30
|
+
Header: (element: string) => string | number | boolean | null
|
|
30
31
|
|
|
31
|
-
all()
|
|
32
|
+
all: () => RequestData
|
|
32
33
|
|
|
33
|
-
validate(attributes: CustomAttributes)
|
|
34
|
+
validate: (attributes: CustomAttributes) => void
|
|
34
35
|
|
|
35
|
-
has(element: string)
|
|
36
|
+
has: (element: string) => boolean
|
|
36
37
|
|
|
37
|
-
isEmpty()
|
|
38
|
+
isEmpty: () => boolean
|
|
38
39
|
|
|
39
|
-
extractParamsFromRoute(routePattern: string, pathname: string)
|
|
40
|
+
extractParamsFromRoute: (routePattern: string, pathname: string) => void
|
|
40
41
|
|
|
41
|
-
getParam(key: string)
|
|
42
|
+
getParam: (key: string) => number | string | null
|
|
42
43
|
|
|
43
|
-
getParams()
|
|
44
|
+
getParams: () => RouteParams
|
|
44
45
|
|
|
45
|
-
getParamAsInt(key: string)
|
|
46
|
+
getParamAsInt: (key: string) => number | null
|
|
46
47
|
}
|
package/src/router.ts
CHANGED
package/src/search-engine.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type {
|
|
|
2
2
|
EnqueuedTask,
|
|
3
3
|
Hits,
|
|
4
4
|
Index,
|
|
5
|
-
IndexOptions,
|
|
6
5
|
IndexesResults,
|
|
6
|
+
IndexOptions,
|
|
7
7
|
MeiliSearch,
|
|
8
8
|
Settings as MeilisearchOptions,
|
|
9
9
|
DocumentOptions as RecordOptions,
|
|
@@ -151,11 +151,11 @@ export type {
|
|
|
151
151
|
EnqueuedTask,
|
|
152
152
|
Hits,
|
|
153
153
|
Index,
|
|
154
|
-
IndexOptions,
|
|
155
154
|
IndexesResults,
|
|
155
|
+
IndexOptions,
|
|
156
156
|
MeiliSearch,
|
|
157
|
-
RecordOptions,
|
|
158
157
|
MeilisearchOptions,
|
|
158
|
+
RecordOptions,
|
|
159
159
|
SearchParams,
|
|
160
160
|
SearchResponse,
|
|
161
161
|
}
|
package/src/server.ts
ADDED
package/src/settings-config.ts
CHANGED