@stacksjs/types 0.58.73 → 0.59.1
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 +19 -0
- package/dist/api.d.ts +59 -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 +88 -0
- package/dist/cdn.d.ts +16 -0
- package/dist/chat.d.ts +4 -0
- package/dist/cli.d.ts +278 -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 +37 -0
- package/dist/dependencies.d.ts +62 -0
- package/dist/deploy.d.ts +12 -0
- package/dist/dns.d.ts +175 -0
- package/dist/docs.d.ts +22 -0
- package/dist/email.d.ts +14 -0
- package/dist/env.d.ts +1 -0
- package/dist/errors.d.ts +1 -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 +129 -0
- package/dist/hashing.d.ts +109 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/i18n.d.ts +19 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +8 -1785
- package/dist/inspect.d.ts +9 -0
- package/dist/library.d.ts +134 -0
- package/dist/logger.d.ts +49 -0
- package/dist/manifest.d.ts +9 -0
- package/dist/model.d.ts +70 -0
- package/dist/money.d.ts +2 -0
- package/dist/notifications.d.ts +117 -0
- package/dist/pages.d.ts +10 -0
- package/dist/payments.d.ts +60 -0
- package/dist/ports.d.ts +19 -0
- package/dist/promise.d.ts +1 -0
- package/dist/push.d.ts +35 -0
- package/dist/pwa.d.ts +7 -0
- package/dist/queue.d.ts +36 -0
- package/dist/reactivity.d.ts +1 -0
- package/dist/router.d.ts +78 -0
- package/dist/scheduler.d.ts +1 -0
- package/dist/search-engine.d.ts +118 -0
- package/dist/security.d.ts +18 -0
- package/dist/services.d.ts +33 -0
- package/dist/sms.d.ts +1 -0
- package/dist/ssg.d.ts +2 -0
- package/dist/stacks.d.ts +196 -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 +33 -0
- package/package.json +8 -9
- package/src/chat.ts +1 -2
- package/src/cli.ts +1 -1
- package/src/cloud.ts +2 -0
- package/src/index.ts +0 -1
- package/src/model.ts +19 -9
- package/src/router.ts +22 -2
- package/src/scheduler.ts +1 -1
- package/src/services.ts +0 -4
- package/src/sms.ts +3 -3
- package/src/request.ts +0 -3
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Null or whatever.
|
|
3
|
+
*/
|
|
4
|
+
export type Nullable<T> = T | null | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Function
|
|
7
|
+
*/
|
|
8
|
+
export type Fn<T = void> = () => T;
|
|
9
|
+
/**
|
|
10
|
+
* Array, or not yet
|
|
11
|
+
*/
|
|
12
|
+
export type Arrayable<T> = T | Array<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor.
|
|
15
|
+
*/
|
|
16
|
+
export type Constructor<T = void> = new (...args: any[]) => T;
|
|
17
|
+
/**
|
|
18
|
+
* Defines an intersection type of all union items.
|
|
19
|
+
*
|
|
20
|
+
* @param U Union of any types that will be intersected.
|
|
21
|
+
* @returns U items intersected
|
|
22
|
+
* @see https://stackoverflow.com/a/50375286/9259330
|
|
23
|
+
*/
|
|
24
|
+
export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
25
|
+
export type MergeInsertions<T> = T extends object ? {
|
|
26
|
+
[K in keyof T]: MergeInsertions<T[K]>;
|
|
27
|
+
} : T;
|
|
28
|
+
export type DeepMerge<F, S> = MergeInsertions<{
|
|
29
|
+
[K in keyof F | keyof S]: K extends keyof S & keyof F ? DeepMerge<F[K], S[K]> : K extends keyof S ? S[K] : K extends keyof F ? F[K] : never;
|
|
30
|
+
}>;
|
|
31
|
+
export type DeepPartial<T> = {
|
|
32
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
33
|
+
};
|
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.59.1",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -51,18 +51,17 @@
|
|
|
51
51
|
"@mdit-vue/plugin-component": "^2.0.0",
|
|
52
52
|
"@mdit-vue/plugin-frontmatter": "^2.0.0",
|
|
53
53
|
"@mdit-vue/types": "^2.0.0",
|
|
54
|
-
"@novu/stateless": "^0.23.1",
|
|
55
54
|
"@rollup/pluginutils": "^5.1.0",
|
|
56
55
|
"@stacksjs/validation": "latest",
|
|
57
56
|
"@types/aws4": "^1.11.6",
|
|
58
57
|
"@types/bcryptjs": "^2.4.6",
|
|
59
|
-
"@types/bun": "^1.0.
|
|
58
|
+
"@types/bun": "^1.0.8",
|
|
60
59
|
"@types/crypto-js": "^4.2.2",
|
|
61
|
-
"@types/eslint": "^8.56.
|
|
60
|
+
"@types/eslint": "^8.56.5",
|
|
62
61
|
"@types/fs-extra": "^11.0.4",
|
|
63
62
|
"@types/markdown-it-link-attributes": "^3.0.4",
|
|
64
63
|
"@types/minimatch": "^5.1.2",
|
|
65
|
-
"@types/node": "^20.11.
|
|
64
|
+
"@types/node": "^20.11.24",
|
|
66
65
|
"@types/nprogress": "^0.2.3",
|
|
67
66
|
"@vinejs/vine": "^1.7.1",
|
|
68
67
|
"cac": "^6.7.14",
|
|
@@ -73,15 +72,15 @@
|
|
|
73
72
|
"unocss": "^0.58.5",
|
|
74
73
|
"unplugin-auto-import": "^0.17.5",
|
|
75
74
|
"unplugin-vue-components": "^0.26.0",
|
|
76
|
-
"vite": "^5.1.
|
|
75
|
+
"vite": "^5.1.5",
|
|
77
76
|
"vite-plugin-inspect": "^0.8.3",
|
|
78
|
-
"vite-plugin-pwa": "^0.19.
|
|
77
|
+
"vite-plugin-pwa": "^0.19.2",
|
|
79
78
|
"vite-ssg": "^0.23.6",
|
|
80
79
|
"vitepress": "1.0.0-rc.44",
|
|
81
|
-
"vue": "^3.4.
|
|
80
|
+
"vue": "^3.4.21"
|
|
82
81
|
},
|
|
83
82
|
"devDependencies": {
|
|
84
|
-
"aws-cdk-lib": "^2.
|
|
83
|
+
"aws-cdk-lib": "^2.131.0",
|
|
85
84
|
"typescript": "^5.3.3"
|
|
86
85
|
}
|
|
87
86
|
}
|
package/src/chat.ts
CHANGED
package/src/cli.ts
CHANGED
|
@@ -322,7 +322,7 @@ export interface ProjectsOptions extends CliOptions {
|
|
|
322
322
|
}
|
|
323
323
|
export interface PreinstallOptions extends CliOptions { }
|
|
324
324
|
export interface PrepublishOptions extends CliOptions { }
|
|
325
|
-
export interface
|
|
325
|
+
export interface PortsOptions extends CliOptions {
|
|
326
326
|
ports?: Partial<Ports>
|
|
327
327
|
}
|
|
328
328
|
export interface TinkerOptions extends CliOptions { }
|
package/src/cloud.ts
CHANGED
package/src/index.ts
CHANGED
package/src/model.ts
CHANGED
|
@@ -25,27 +25,37 @@ interface Base {}
|
|
|
25
25
|
export interface ModelOptions extends Base {
|
|
26
26
|
name: string // defaults to the file name of the model
|
|
27
27
|
table: string // defaults to the lowercase, plural name of the model
|
|
28
|
-
|
|
28
|
+
primaryKey?: string // defaults to `id`
|
|
29
|
+
autoIncrement?: boolean // defaults to true
|
|
30
|
+
|
|
31
|
+
traits: {
|
|
32
|
+
useUuid?: boolean // defaults to false
|
|
33
|
+
useTimestamps?: boolean | TimestampOptions // defaults to true
|
|
34
|
+
useSoftDeletes?: boolean | SoftDeleteOptions // defaults to false
|
|
35
|
+
|
|
36
|
+
useAuth?: boolean | AuthOptions // defaults to false
|
|
37
|
+
authenticatable?: boolean | AuthOptions // useAuth alias
|
|
38
|
+
useSeeder?: boolean | SeedOptions // defaults to a count of 10
|
|
39
|
+
seedable?: boolean | SeedOptions // useSeeder alias
|
|
40
|
+
useSearch?: boolean | SearchEngineSettings // defaults to false
|
|
41
|
+
searchable?: boolean | SearchEngineSettings // useSearch alias
|
|
42
|
+
}
|
|
43
|
+
|
|
29
44
|
fields: Fields
|
|
45
|
+
|
|
46
|
+
// relationships
|
|
30
47
|
hasOne: string // hasOne: 'Post'
|
|
31
48
|
hasMany: {
|
|
32
49
|
model: string // should be typed as ModelName
|
|
33
50
|
foreignKey?: string
|
|
34
51
|
}
|
|
52
|
+
belongsTo: string // belongsTo: 'User'
|
|
35
53
|
belongsToMany: object
|
|
36
54
|
hasThrough: {
|
|
37
55
|
model: string // should be typed as ModelName
|
|
38
56
|
through: string
|
|
39
57
|
using: string
|
|
40
58
|
}
|
|
41
|
-
authenticatable: boolean | AuthOptions
|
|
42
|
-
seedable: boolean | SeedOptions
|
|
43
|
-
searchable: boolean | SearchEngineSettings
|
|
44
|
-
useSeed: boolean | SeedOptions
|
|
45
|
-
useSearch: boolean | SearchEngineSettings
|
|
46
|
-
useSearchEngine: boolean | SearchEngineSettings
|
|
47
|
-
useTimestamps: boolean | TimestampOptions
|
|
48
|
-
useSoftDeletes: boolean | SoftDeleteOptions
|
|
49
59
|
|
|
50
60
|
attributes: {
|
|
51
61
|
[key: string]: {
|
package/src/router.ts
CHANGED
|
@@ -49,10 +49,10 @@ export interface Route {
|
|
|
49
49
|
statusCode?: StatusCode
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export interface
|
|
52
|
+
export interface MiddlewareOptions {
|
|
53
53
|
name: string
|
|
54
|
+
description?: string
|
|
54
55
|
priority: number
|
|
55
|
-
|
|
56
56
|
handle: Function
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -71,3 +71,23 @@ export interface RouteGroupOptions {
|
|
|
71
71
|
prefix?: string
|
|
72
72
|
middleware?: Route['middleware']
|
|
73
73
|
}
|
|
74
|
+
|
|
75
|
+
type Prefix = string
|
|
76
|
+
|
|
77
|
+
export interface RouterInterface {
|
|
78
|
+
get: (url: Route['url'], callback: Route['callback']) => Promise<this>
|
|
79
|
+
post: (url: Route['url'], callback: Route['callback']) => this
|
|
80
|
+
view: (url: Route['url'], callback: Route['callback']) => this
|
|
81
|
+
redirect: (url: Route['url'], callback: Route['callback'], status?: RedirectCode) => this
|
|
82
|
+
delete: (url: Route['url'], callback: Route['callback']) => this
|
|
83
|
+
patch: (url: Route['url'], callback: Route['callback']) => this
|
|
84
|
+
put: (url: Route['url'], callback: Route['callback']) => this
|
|
85
|
+
email: (url: Route['url']) => Promise<this>
|
|
86
|
+
health: () => Promise<this>
|
|
87
|
+
job: (url: Route['url']) => Promise<this>
|
|
88
|
+
action: (url: Route['url']) => Promise<this>
|
|
89
|
+
group: (options: Prefix | RouteGroupOptions, callback: () => void) => this
|
|
90
|
+
name: (name: string) => this
|
|
91
|
+
middleware: (middleware: Route['middleware']) => this
|
|
92
|
+
getRoutes: () => Promise<Route[]>
|
|
93
|
+
}
|
package/src/scheduler.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Schedule
|
|
1
|
+
export type { Schedule } from '@stacksjs/scheduler'
|
package/src/services.ts
CHANGED
package/src/sms.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ISmsOptions as SmsOptions } from '@novu/stateless'
|
|
1
|
+
// import type { ISmsOptions as SmsOptions } from '@novu/stateless'
|
|
2
2
|
|
|
3
|
-
export type { SmsOptions }
|
|
3
|
+
// export type { SmsOptions }
|
|
4
4
|
|
|
5
|
-
export type SmsConfig = SmsOptions
|
|
5
|
+
// export type SmsConfig = SmsOptions
|
package/src/request.ts
DELETED