@stacksjs/types 0.58.48 → 0.58.50
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 +6 -5
- package/src/ai.ts +25 -0
- package/src/analytics.ts +21 -0
- package/src/api.ts +65 -0
- package/src/app.ts +172 -0
- package/src/auto-imports.ts +1 -0
- package/src/binary.ts +12 -0
- package/src/build.ts +2 -0
- package/src/cache.ts +98 -0
- package/src/cdn.ts +17 -0
- package/src/chat.ts +5 -0
- package/src/cli.ts +305 -0
- package/src/cloud.ts +85 -0
- package/src/components.ts +64 -0
- package/src/configure.ts +6 -0
- package/src/cron-jobs.ts +45 -0
- package/src/database.ts +45 -0
- package/src/dependencies.ts +69 -0
- package/src/deploy.ts +13 -0
- package/src/dns.ts +186 -0
- package/src/docs.ts +22 -0
- package/src/email.ts +16 -0
- package/src/env.ts +1 -0
- package/src/errors.ts +11 -0
- package/src/events.ts +30 -0
- package/src/exit-code.ts +10 -0
- package/src/file-systems.ts +70 -0
- package/src/git.ts +133 -0
- package/src/hashing.ts +131 -0
- package/src/helpers.ts +11 -0
- package/src/i18n.ts +19 -0
- package/src/index.ts +58 -0
- package/src/inspect.ts +10 -0
- package/src/layout.ts +8 -0
- package/src/library.ts +156 -0
- package/src/manifest.ts +9 -0
- package/src/model.ts +72 -0
- package/src/money.ts +3 -0
- package/src/native.ts +0 -0
- package/src/notifications.ts +147 -0
- package/src/pages.ts +10 -0
- package/src/payments.ts +65 -0
- package/src/promise.ts +1 -0
- package/src/push.ts +36 -0
- package/src/pwa.ts +8 -0
- package/src/queue.ts +36 -0
- package/src/reactivity.ts +1 -0
- package/src/router.ts +70 -0
- package/src/scheduler.ts +1 -0
- package/src/search-engine.ts +136 -0
- package/src/security.ts +23 -0
- package/src/services.ts +44 -0
- package/src/sms.ts +5 -0
- package/src/ssg.ts +3 -0
- package/src/stacks.ts +226 -0
- package/src/storage.ts +13 -0
- package/src/tables.ts +57 -0
- package/src/team.ts +8 -0
- package/src/ui.ts +197 -0
- package/src/utils.ts +47 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
4
|
+
"version": "0.58.50",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
],
|
|
37
37
|
"files": [
|
|
38
38
|
"README.md",
|
|
39
|
-
"dist"
|
|
39
|
+
"dist",
|
|
40
|
+
"src"
|
|
40
41
|
],
|
|
41
42
|
"scripts": {
|
|
42
43
|
"build": "bun --bun build.ts",
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"@types/fs-extra": "^11.0.4",
|
|
62
63
|
"@types/markdown-it-link-attributes": "^3.0.4",
|
|
63
64
|
"@types/minimatch": "^5.1.2",
|
|
64
|
-
"@types/node": "^20.11.
|
|
65
|
+
"@types/node": "^20.11.16",
|
|
65
66
|
"@types/nprogress": "^0.2.3",
|
|
66
67
|
"@vinejs/vine": "^1.7.1",
|
|
67
68
|
"cac": "^6.7.14",
|
|
@@ -76,11 +77,11 @@
|
|
|
76
77
|
"vite-plugin-inspect": "^0.8.3",
|
|
77
78
|
"vite-plugin-pwa": "^0.17.5",
|
|
78
79
|
"vite-ssg": "^0.23.6",
|
|
79
|
-
"vitepress": "1.0.0-rc.
|
|
80
|
+
"vitepress": "1.0.0-rc.41",
|
|
80
81
|
"vue": "^3.4.15"
|
|
81
82
|
},
|
|
82
83
|
"devDependencies": {
|
|
83
|
-
"aws-cdk-lib": "^2.
|
|
84
|
+
"aws-cdk-lib": "^2.126.0",
|
|
84
85
|
"typescript": "^5.3.3"
|
|
85
86
|
}
|
|
86
87
|
}
|
package/src/ai.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type AiModel = 'amazon.titan-embed-text-v1'
|
|
2
|
+
| 'amazon.titan-text-lite-v1'
|
|
3
|
+
| 'amazon.titan-text-express-v1'
|
|
4
|
+
| 'amazon.titan-embed-image-v1'
|
|
5
|
+
| 'amazon.titan-image-generator-v1'
|
|
6
|
+
| 'anthropic.claude-v1'
|
|
7
|
+
| 'anthropic.claude-v2'
|
|
8
|
+
| 'anthropic.claude-v2:1'
|
|
9
|
+
| 'anthropic.claude-instant-v1'
|
|
10
|
+
| 'meta.llama2-13b-chat-v1'
|
|
11
|
+
| 'meta.llama2-70b-chat-v1'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* **AI Options**
|
|
15
|
+
*
|
|
16
|
+
* This configuration defines all of your AI options. Because Stacks is fully-typed, you
|
|
17
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
18
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
19
|
+
*/
|
|
20
|
+
export interface AiOptions {
|
|
21
|
+
default: AiModel
|
|
22
|
+
models: AiModel[]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type AiConfig = Partial<AiOptions>
|
package/src/analytics.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **Analytics Options**
|
|
3
|
+
*
|
|
4
|
+
* This configuration defines all of your Analytics options. Because Stacks is fully-typed, you
|
|
5
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
6
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
7
|
+
*/
|
|
8
|
+
export interface AnalyticsOptions {
|
|
9
|
+
driver: 'google-analytics' | 'fathom'
|
|
10
|
+
|
|
11
|
+
drivers: {
|
|
12
|
+
googleAnalytics?: {
|
|
13
|
+
trackingId: string
|
|
14
|
+
}
|
|
15
|
+
fathom?: {
|
|
16
|
+
siteId: string
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type AnalyticsConfig = Partial<AnalyticsOptions>
|
package/src/api.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **API Options**
|
|
3
|
+
*
|
|
4
|
+
* This configuration defines all of your API options. Because Stacks is fully-typed, you
|
|
5
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
6
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
7
|
+
*/
|
|
8
|
+
export interface ApiOptions {
|
|
9
|
+
/**
|
|
10
|
+
* **API Description**
|
|
11
|
+
*
|
|
12
|
+
* This value defines the description for your API.
|
|
13
|
+
*
|
|
14
|
+
* @default "Stacks API"
|
|
15
|
+
*/
|
|
16
|
+
description: string
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* **API Prefix**
|
|
20
|
+
*
|
|
21
|
+
* This value defines the prefix for all of your API routes. For example, if you set
|
|
22
|
+
* this value to `api`, all of your API routes will be prefixed with `/api`. This
|
|
23
|
+
* value is useful for when you want to version your API.
|
|
24
|
+
*
|
|
25
|
+
* @default string "api"
|
|
26
|
+
* @example string "api/v1"
|
|
27
|
+
*/
|
|
28
|
+
prefix: string
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* **API Prewarm**
|
|
32
|
+
*
|
|
33
|
+
* This configuration determines the prewarming behavior of your API. Prewarming eliminates
|
|
34
|
+
* cold starts in your API. If this value is set to `true`, the API will be prewarmed
|
|
35
|
+
* every 5 minutes. If you provide a number, Stacks will prewarm the
|
|
36
|
+
* specified number of containers every 5 minutes.
|
|
37
|
+
*
|
|
38
|
+
* @default true
|
|
39
|
+
* @example false
|
|
40
|
+
* @example 10
|
|
41
|
+
*/
|
|
42
|
+
prewarm: boolean | number
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* **API Memory Size**
|
|
46
|
+
*
|
|
47
|
+
* This value defines the memory size for your API.
|
|
48
|
+
*
|
|
49
|
+
* @default 512
|
|
50
|
+
*/
|
|
51
|
+
memorySize: number
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* **API Timeout**
|
|
55
|
+
*
|
|
56
|
+
* This value defines the timeout for your API.
|
|
57
|
+
*
|
|
58
|
+
* @default 30
|
|
59
|
+
*/
|
|
60
|
+
timeout: number
|
|
61
|
+
|
|
62
|
+
deploy: boolean
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type ApiConfig = Partial<ApiOptions>
|
package/src/app.ts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
export type AppEnvType = 'production' | 'development' | 'staging' | 'local' | 'stage' | 'dev' | 'prod'
|
|
2
|
+
|
|
3
|
+
interface Ports {
|
|
4
|
+
frontend: number
|
|
5
|
+
backend: number // proxies api
|
|
6
|
+
api: number // the Bun server
|
|
7
|
+
admin: number
|
|
8
|
+
library: number
|
|
9
|
+
desktop: number
|
|
10
|
+
email: number
|
|
11
|
+
docs: number
|
|
12
|
+
inspect: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* **Application Options**
|
|
17
|
+
*
|
|
18
|
+
* This configuration defines all of your application options. Because Stacks is fully-typed,
|
|
19
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
20
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
21
|
+
*/
|
|
22
|
+
export interface AppOptions {
|
|
23
|
+
/**
|
|
24
|
+
* **Application Name**
|
|
25
|
+
*
|
|
26
|
+
* This value is the name of your application. This value is used when the
|
|
27
|
+
* framework needs to place the application's name in a log or any
|
|
28
|
+
* other location as required by the application or its packages.
|
|
29
|
+
*
|
|
30
|
+
* @default string "Stacks"
|
|
31
|
+
*/
|
|
32
|
+
name: string
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* **Application Description**
|
|
36
|
+
*
|
|
37
|
+
* This value is the description of your application. This value is used when the
|
|
38
|
+
* framework generates meta tags for the frontend.
|
|
39
|
+
*/
|
|
40
|
+
description: string
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* **Application Environment**
|
|
44
|
+
*
|
|
45
|
+
* This value determines the "environment" your application is currently
|
|
46
|
+
* running in. This may determine how you prefer to configure various
|
|
47
|
+
* services the application utilizes. Set this in your ".env" file
|
|
48
|
+
*
|
|
49
|
+
* @default "development"
|
|
50
|
+
*/
|
|
51
|
+
env: AppEnvType
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* **Application URL**
|
|
55
|
+
*
|
|
56
|
+
* This URL is used by the console to properly generate URLs when using
|
|
57
|
+
* the Buddy command line tool. You should set this to the root of
|
|
58
|
+
* your application so that it is used when running Buddy tasks.
|
|
59
|
+
*
|
|
60
|
+
* @default string "stacks.localhost"
|
|
61
|
+
* @example "my-project.test"
|
|
62
|
+
*/
|
|
63
|
+
url: string
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* **Redirect URLs**
|
|
67
|
+
*
|
|
68
|
+
* A Redirect URL is a URL that permanently redirects to the Application URL.
|
|
69
|
+
* This is useful for when you have multiple domains that you want to redirect
|
|
70
|
+
* to your application. You can set this to a string or an array of strings.
|
|
71
|
+
*
|
|
72
|
+
* @default []
|
|
73
|
+
* @example "['stacksjs.com', 'stacksjs.dev']"
|
|
74
|
+
*/
|
|
75
|
+
redirectUrls: string | string[]
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* **Application Debug Mode**
|
|
79
|
+
*
|
|
80
|
+
* When your application is in debug mode, detailed error messages with
|
|
81
|
+
* stack traces will be shown on every error that occurs within your
|
|
82
|
+
* application. If disabled, a simple generic error page is shown.
|
|
83
|
+
*
|
|
84
|
+
* @default true
|
|
85
|
+
*/
|
|
86
|
+
debug: boolean
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* **Maintenance Mode**
|
|
90
|
+
*
|
|
91
|
+
* When your application is in maintenance mode, a simple maintenance
|
|
92
|
+
* page will be shown on every request into your application.
|
|
93
|
+
*
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
maintenanceMode: boolean
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* **Encryption Key**
|
|
100
|
+
*
|
|
101
|
+
* This key is used by the Stacks encrypter service and should be set to
|
|
102
|
+
* a random, 32 character string, otherwise these encrypted strings will
|
|
103
|
+
* not be safe. Please do this before deploying an application!
|
|
104
|
+
*/
|
|
105
|
+
key: string
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* **Application Ports**
|
|
109
|
+
*
|
|
110
|
+
* This port is used by the Stacks servers when running your application, library, email services,
|
|
111
|
+
* and other services. You may change this port to any other port that is free
|
|
112
|
+
* on your machine, as long as the following 6 ports are also available.
|
|
113
|
+
*/
|
|
114
|
+
ports: Ports
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* **Application Timezone**
|
|
118
|
+
*
|
|
119
|
+
* Here you may specify the default timezone for your application, which
|
|
120
|
+
* will be used by Stacks and date-time functions. We have gone ahead
|
|
121
|
+
* and set this to a sensible default for you out of the box.
|
|
122
|
+
*
|
|
123
|
+
* @default string "UTC"
|
|
124
|
+
*/
|
|
125
|
+
timezone: string
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* **Application Locale Configuration**
|
|
129
|
+
*
|
|
130
|
+
* The application locale determines the default locale that will be used
|
|
131
|
+
* by the translation service provider. You are free to set this value
|
|
132
|
+
* to any of the locales which will be supported by the application.
|
|
133
|
+
*
|
|
134
|
+
* @default string "en"
|
|
135
|
+
* @example
|
|
136
|
+
* de // ./lang/de.yml needs to be present for this
|
|
137
|
+
*/
|
|
138
|
+
locale: string
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* **Application Fallback Locale**
|
|
142
|
+
*
|
|
143
|
+
* The fallback locale determines the locale to use when the current one
|
|
144
|
+
* is not available. You may change the value to correspond to any of
|
|
145
|
+
* the language folders that are provided through your application.
|
|
146
|
+
*
|
|
147
|
+
* @default string "en"
|
|
148
|
+
*/
|
|
149
|
+
fallbackLocale: 'en'
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* **Cipher**
|
|
153
|
+
*
|
|
154
|
+
* Description WIP.
|
|
155
|
+
*
|
|
156
|
+
* @default string "aes-256-cbc"
|
|
157
|
+
*/
|
|
158
|
+
cipher: string
|
|
159
|
+
|
|
160
|
+
// inspect: <InspectOptions>{},
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* **Documentation Mode**
|
|
164
|
+
*
|
|
165
|
+
* $appUrl becomes your Documentation URL.
|
|
166
|
+
*
|
|
167
|
+
* @default false
|
|
168
|
+
*/
|
|
169
|
+
docMode: boolean
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type AppConfig = Partial<AppOptions>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Options as AutoImportsOptions } from 'unplugin-auto-import/types'
|
package/src/binary.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Binary/CLI Options used in `./config/cli.ts`.
|
|
3
|
+
*/
|
|
4
|
+
export interface BinaryOptions {
|
|
5
|
+
name: string
|
|
6
|
+
command: string
|
|
7
|
+
description: string
|
|
8
|
+
source: string
|
|
9
|
+
// path: string // TODO: add this for a configurable path where the commands are located
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type BinaryConfig = Partial<BinaryOptions>
|
package/src/build.ts
ADDED
package/src/cache.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export interface CacheOptions {
|
|
2
|
+
/**
|
|
3
|
+
* **Cache Driver**
|
|
4
|
+
*
|
|
5
|
+
* This value determines the cache driver that will be used by your application to store
|
|
6
|
+
* cached data. By default, Stacks uses the "redis" driver, which stores cached data in
|
|
7
|
+
* in a self-configufed Redis instance. You may use any of the other drivers provided
|
|
8
|
+
* by Stacks or write your own custom driver.
|
|
9
|
+
*
|
|
10
|
+
* @default "redis"
|
|
11
|
+
* @example "redis"
|
|
12
|
+
* @example "memcached"
|
|
13
|
+
* @example "dynamodb"
|
|
14
|
+
*
|
|
15
|
+
* @see https://stacks.js.org/docs/cache
|
|
16
|
+
*/
|
|
17
|
+
driver: string
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* **Cache Prefix**
|
|
21
|
+
*
|
|
22
|
+
* This value determines the prefix that will be used when storing items in the cache. This
|
|
23
|
+
* prefix may be useful when multiple applications are sharing the same cache driver so that
|
|
24
|
+
* they may avoid collisions when attempting to retrieve items from the cache.
|
|
25
|
+
*
|
|
26
|
+
* @default string "stacks"
|
|
27
|
+
* @example "stacks"
|
|
28
|
+
*
|
|
29
|
+
* @see https://stacks.js.org/docs/cache
|
|
30
|
+
*/
|
|
31
|
+
prefix: string
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* **Cache TTL**
|
|
35
|
+
*
|
|
36
|
+
* This value determines the default time to live for items stored in the cache. This value
|
|
37
|
+
* may be overridden when storing items in the cache. If no value is specified, the cache
|
|
38
|
+
* driver will default to a reasonable time to live for the given item.
|
|
39
|
+
*
|
|
40
|
+
* @default number 3600
|
|
41
|
+
* @example 3600
|
|
42
|
+
* @example 3600 * 24
|
|
43
|
+
* @example -1 (never expires)
|
|
44
|
+
*/
|
|
45
|
+
ttl: number
|
|
46
|
+
|
|
47
|
+
drivers: {
|
|
48
|
+
redis?: {
|
|
49
|
+
connection: string
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* **Redis Host**
|
|
53
|
+
*
|
|
54
|
+
* This value determines the host that will be used to connect to the Redis server.
|
|
55
|
+
*
|
|
56
|
+
* @default string "localhost"
|
|
57
|
+
* @example "localhost"
|
|
58
|
+
*/
|
|
59
|
+
host: string
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* **Redis Port**
|
|
63
|
+
*
|
|
64
|
+
* This value determines the port that will be used to connect to the Redis server.
|
|
65
|
+
*
|
|
66
|
+
* @default number 6379
|
|
67
|
+
* @example 6379
|
|
68
|
+
*/
|
|
69
|
+
port: number
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* **Redis Username**
|
|
73
|
+
*
|
|
74
|
+
* This value determines the username that will be used to connect to the Redis server.
|
|
75
|
+
*
|
|
76
|
+
* @default string ""
|
|
77
|
+
* @example "admin"
|
|
78
|
+
*/
|
|
79
|
+
username: string
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* **Redis Password**
|
|
83
|
+
*
|
|
84
|
+
* This value determines the password that will be used to connect to the Redis server.
|
|
85
|
+
*
|
|
86
|
+
* @default string ""
|
|
87
|
+
* @example "password"
|
|
88
|
+
*/
|
|
89
|
+
password: string
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
memcached?: object
|
|
93
|
+
|
|
94
|
+
dynamodb?: object
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type CacheConfig = Partial<CacheOptions>
|
package/src/cdn.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface CdnOptions {
|
|
2
|
+
/**
|
|
3
|
+
* **CDN Driver**
|
|
4
|
+
*
|
|
5
|
+
* This value determines the default CDN driver that will be used when interacting with the
|
|
6
|
+
* CDN service. This value may be overridden when interacting with the CDN service.
|
|
7
|
+
*
|
|
8
|
+
* @default "cloudfront"
|
|
9
|
+
* @example "cloudfront"
|
|
10
|
+
* @example "fastly" wip
|
|
11
|
+
*
|
|
12
|
+
* @see https://stacks.js.org/docs/cdn
|
|
13
|
+
*/
|
|
14
|
+
driver: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type CdnConfig = Partial<CdnOptions>
|