@stacksjs/types 0.70.85 → 0.70.87
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 +19 -5
- package/src/ai.ts +0 -41
- package/src/analytics.ts +0 -58
- package/src/api.ts +0 -77
- package/src/app.ts +0 -189
- package/src/attributes.ts +0 -5
- package/src/auth.ts +0 -161
- package/src/auto-imports.ts +0 -8
- package/src/binary.ts +0 -13
- package/src/cache.ts +0 -325
- package/src/cdn.ts +0 -17
- package/src/chat.ts +0 -193
- package/src/cli.ts +0 -445
- package/src/cloud.ts +0 -381
- package/src/cms.ts +0 -14
- package/src/commerce.ts +0 -18
- package/src/components.ts +0 -62
- package/src/configure.ts +0 -13
- package/src/cors.ts +0 -86
- package/src/cron-jobs.ts +0 -146
- package/src/dashboard.ts +0 -218
- package/src/database.ts +0 -117
- package/src/dependencies.ts +0 -69
- package/src/deploy.ts +0 -17
- package/src/dns.ts +0 -470
- package/src/docs.ts +0 -27
- package/src/email.ts +0 -511
- package/src/env.ts +0 -1
- package/src/errors.ts +0 -110
- package/src/events.ts +0 -37
- package/src/exit-code.ts +0 -10
- package/src/file-systems.ts +0 -70
- package/src/git.ts +0 -133
- package/src/hashing.ts +0 -127
- package/src/helpers.ts +0 -9
- package/src/i18n.ts +0 -121
- package/src/index.ts +0 -80
- package/src/library.ts +0 -911
- package/src/logging.ts +0 -62
- package/src/manifest.ts +0 -9
- package/src/marketing.ts +0 -14
- package/src/model-dashboard-augmentation.ts +0 -51
- package/src/model-names.ts +0 -1
- package/src/model.ts +0 -353
- package/src/monitoring.ts +0 -14
- package/src/native.ts +0 -0
- package/src/notifications.ts +0 -153
- package/src/oauth.ts +0 -488
- package/src/pages.ts +0 -10
- package/src/payments.ts +0 -440
- package/src/phone.ts +0 -78
- package/src/ports.ts +0 -20
- package/src/promise.ts +0 -1
- package/src/push.ts +0 -143
- package/src/queue.ts +0 -413
- package/src/reactivity.ts +0 -1
- package/src/realtime.ts +0 -584
- package/src/request.ts +0 -541
- package/src/response.ts +0 -16
- package/src/router.ts +0 -124
- package/src/saas.ts +0 -33
- package/src/scheduler.ts +0 -1
- package/src/search-engine.ts +0 -251
- package/src/security.ts +0 -23
- package/src/server.ts +0 -16
- package/src/services.ts +0 -211
- package/src/settings-config.ts +0 -10
- package/src/sms.ts +0 -265
- package/src/stack-extensions.ts +0 -184
- package/src/stacks.ts +0 -339
- package/src/storage.ts +0 -173
- package/src/table-names.ts +0 -1
- package/src/tables.ts +0 -57
- package/src/team.ts +0 -8
- package/src/ui.ts +0 -197
- package/src/utils.ts +0 -46
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.87",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -43,8 +43,7 @@
|
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"files": [
|
|
45
45
|
"README.md",
|
|
46
|
-
"dist"
|
|
47
|
-
"src"
|
|
46
|
+
"dist"
|
|
48
47
|
],
|
|
49
48
|
"scripts": {
|
|
50
49
|
"build": "bun build.ts",
|
|
@@ -66,10 +65,25 @@
|
|
|
66
65
|
}
|
|
67
66
|
},
|
|
68
67
|
"devDependencies": {
|
|
69
|
-
"@stacksjs/validation": "0.70.
|
|
68
|
+
"@stacksjs/validation": "0.70.87",
|
|
70
69
|
"@types/bun": "^1.3.11",
|
|
71
70
|
"meilisearch": "^0.59.0",
|
|
72
71
|
"typescript": "^7.0.2"
|
|
73
72
|
},
|
|
74
|
-
"sideEffects": false
|
|
73
|
+
"sideEffects": false,
|
|
74
|
+
"publishConfig": {
|
|
75
|
+
"exports": {
|
|
76
|
+
".": {
|
|
77
|
+
"types": "./dist/index.d.ts",
|
|
78
|
+
"bun": "./dist/index.js",
|
|
79
|
+
"import": "./dist/index.js",
|
|
80
|
+
"default": "./dist/index.js"
|
|
81
|
+
},
|
|
82
|
+
"./*": {
|
|
83
|
+
"bun": "./dist/*",
|
|
84
|
+
"import": "./dist/*",
|
|
85
|
+
"default": "./dist/*"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
75
89
|
}
|
package/src/ai.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
type AiModel =
|
|
2
|
-
// Amazon Titan
|
|
3
|
-
| 'amazon.titan-embed-text-v1'
|
|
4
|
-
| 'amazon.titan-embed-text-v2:0'
|
|
5
|
-
| 'amazon.titan-text-lite-v1'
|
|
6
|
-
| 'amazon.titan-text-express-v1'
|
|
7
|
-
| 'amazon.titan-text-premier-v1:0'
|
|
8
|
-
| 'amazon.titan-embed-image-v1'
|
|
9
|
-
| 'amazon.titan-image-generator-v1'
|
|
10
|
-
| 'amazon.titan-image-generator-v2:0'
|
|
11
|
-
// Anthropic Claude (current models via Bedrock)
|
|
12
|
-
| 'anthropic.claude-sonnet-4-20250514-v1:0'
|
|
13
|
-
| 'anthropic.claude-haiku-4-20250514-v1:0'
|
|
14
|
-
| 'anthropic.claude-3-5-sonnet-20241022-v2:0'
|
|
15
|
-
| 'anthropic.claude-3-5-haiku-20241022-v1:0'
|
|
16
|
-
| 'anthropic.claude-3-opus-20240229-v1:0'
|
|
17
|
-
| 'anthropic.claude-3-sonnet-20240229-v1:0'
|
|
18
|
-
| 'anthropic.claude-3-haiku-20240307-v1:0'
|
|
19
|
-
// Meta Llama 3
|
|
20
|
-
| 'meta.llama3-8b-instruct-v1:0'
|
|
21
|
-
| 'meta.llama3-70b-instruct-v1:0'
|
|
22
|
-
| 'meta.llama3-1-8b-instruct-v1:0'
|
|
23
|
-
| 'meta.llama3-1-70b-instruct-v1:0'
|
|
24
|
-
| 'meta.llama3-1-405b-instruct-v1:0'
|
|
25
|
-
// Allow custom model strings
|
|
26
|
-
| (string & {})
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* **AI Options**
|
|
30
|
-
*
|
|
31
|
-
* This configuration defines all of your AI options. Because Stacks is fully-typed, you
|
|
32
|
-
* may hover any of the options below and the definitions will be provided. In case you
|
|
33
|
-
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
34
|
-
*/
|
|
35
|
-
export interface AiOptions {
|
|
36
|
-
default: AiModel
|
|
37
|
-
models: AiModel[]
|
|
38
|
-
deploy: boolean
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type AiConfig = Partial<AiOptions>
|
package/src/analytics.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
/** The analytics driver/provider to use */
|
|
10
|
-
driver: 'google-analytics' | 'fathom' | 'plausible' | 'self-hosted'
|
|
11
|
-
|
|
12
|
-
drivers: {
|
|
13
|
-
/** Google Analytics configuration */
|
|
14
|
-
googleAnalytics?: {
|
|
15
|
-
/** GA4 Measurement ID (e.g., G-XXXXXXXXXX) */
|
|
16
|
-
trackingId: string
|
|
17
|
-
/** Enable debug mode */
|
|
18
|
-
debug?: boolean
|
|
19
|
-
}
|
|
20
|
-
/** Fathom Analytics configuration (privacy-focused) */
|
|
21
|
-
fathom?: {
|
|
22
|
-
/** Fathom site ID */
|
|
23
|
-
siteId: string
|
|
24
|
-
/** Custom script URL */
|
|
25
|
-
scriptUrl?: string
|
|
26
|
-
/** Honor Do Not Track browser setting */
|
|
27
|
-
honorDnt?: boolean
|
|
28
|
-
/** Enable SPA mode for client-side routing */
|
|
29
|
-
spa?: boolean
|
|
30
|
-
}
|
|
31
|
-
/** Plausible Analytics configuration (privacy-focused, open source) */
|
|
32
|
-
plausible?: {
|
|
33
|
-
/** Your domain (e.g., example.com) */
|
|
34
|
-
domain: string
|
|
35
|
-
/** Custom script URL (for self-hosted Plausible) */
|
|
36
|
-
scriptUrl?: string
|
|
37
|
-
/** Track localhost during development */
|
|
38
|
-
trackLocalhost?: boolean
|
|
39
|
-
/** Enable hash-based routing */
|
|
40
|
-
hashMode?: boolean
|
|
41
|
-
}
|
|
42
|
-
/** Self-hosted analytics configuration (using Stacks Analytics / dynamodb-tooling) */
|
|
43
|
-
selfHosted?: {
|
|
44
|
-
/** Site ID for tracking */
|
|
45
|
-
siteId: string
|
|
46
|
-
/** API endpoint URL for collecting analytics (e.g., https://api.example.com/analytics) */
|
|
47
|
-
apiEndpoint: string
|
|
48
|
-
/** Honor Do Not Track browser setting */
|
|
49
|
-
honorDnt?: boolean
|
|
50
|
-
/** Track hash changes as page views */
|
|
51
|
-
trackHashChanges?: boolean
|
|
52
|
-
/** Track outbound link clicks */
|
|
53
|
-
trackOutboundLinks?: boolean
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export type AnalyticsConfig = Partial<AnalyticsOptions>
|
package/src/api.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
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
|
-
middleware: string[]
|
|
31
|
-
|
|
32
|
-
routes:
|
|
33
|
-
| {
|
|
34
|
-
index: boolean
|
|
35
|
-
show: boolean
|
|
36
|
-
store: boolean
|
|
37
|
-
update: boolean
|
|
38
|
-
destroy: boolean
|
|
39
|
-
}
|
|
40
|
-
| boolean
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* **API Prewarm**
|
|
44
|
-
*
|
|
45
|
-
* This configuration determines the prewarming behavior of your API. Prewarming eliminates
|
|
46
|
-
* cold starts in your API. If this value is set to `true`, the API will be prewarmed
|
|
47
|
-
* every 5 minutes. If you provide a number, Stacks will prewarm the
|
|
48
|
-
* specified number of containers every 5 minutes.
|
|
49
|
-
*
|
|
50
|
-
* @default true
|
|
51
|
-
* @example false
|
|
52
|
-
* @example 10
|
|
53
|
-
*/
|
|
54
|
-
prewarm: boolean | number
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* **API Memory Size**
|
|
58
|
-
*
|
|
59
|
-
* This value defines the memory size for your API.
|
|
60
|
-
*
|
|
61
|
-
* @default 512
|
|
62
|
-
*/
|
|
63
|
-
memorySize: number
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* **API Timeout**
|
|
67
|
-
*
|
|
68
|
-
* This value defines the timeout for your API.
|
|
69
|
-
*
|
|
70
|
-
* @default 30
|
|
71
|
-
*/
|
|
72
|
-
timeout: number
|
|
73
|
-
|
|
74
|
-
deploy: boolean
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export type ApiConfig = Partial<ApiOptions>
|
package/src/app.ts
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
export type AppEnvType = 'local' | 'dev' | 'stage' | 'prod' | 'testing' | string
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* **Application Options**
|
|
5
|
-
*
|
|
6
|
-
* This configuration defines all of your application options. Because Stacks is fully-typed,
|
|
7
|
-
* you may hover any of the options below and the definitions will be provided. In case
|
|
8
|
-
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
9
|
-
*/
|
|
10
|
-
export interface AppOptions {
|
|
11
|
-
/**
|
|
12
|
-
* **Application Name**
|
|
13
|
-
*
|
|
14
|
-
* This value is the name of your application. This value is used when the
|
|
15
|
-
* framework needs to place the application's name in a log or any
|
|
16
|
-
* other location as required by the application or its packages.
|
|
17
|
-
*
|
|
18
|
-
* @default string "Stacks"
|
|
19
|
-
*/
|
|
20
|
-
name: string
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* **Application Description**
|
|
24
|
-
*
|
|
25
|
-
* This value is the description of your application. This value is used when the
|
|
26
|
-
* framework generates meta tags for the frontend.
|
|
27
|
-
*/
|
|
28
|
-
description: string
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* **Application Environment**
|
|
32
|
-
*
|
|
33
|
-
* This value determines the "environment" your application is currently
|
|
34
|
-
* running in. This may determine how you prefer to configure various
|
|
35
|
-
* services the application utilizes. Set this in your ".env" file
|
|
36
|
-
*
|
|
37
|
-
* @default "local"
|
|
38
|
-
*/
|
|
39
|
-
env: AppEnvType
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* **Application URL**
|
|
43
|
-
*
|
|
44
|
-
* This URL is used by the console to properly generate URLs when using
|
|
45
|
-
* the Buddy command line tool. You should set this to the root of
|
|
46
|
-
* your application so that it is used when running Buddy tasks.
|
|
47
|
-
*
|
|
48
|
-
* @default string "stacks.localhost"
|
|
49
|
-
* @example "my-project.test"
|
|
50
|
-
*/
|
|
51
|
-
url: string
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* **Redirect URLs**
|
|
55
|
-
*
|
|
56
|
-
* A Redirect URL is a URL that permanently redirects to the Application URL.
|
|
57
|
-
* This is useful for when you have multiple domains that you want to redirect
|
|
58
|
-
* to your application. You can set this to a string or an array of strings.
|
|
59
|
-
*
|
|
60
|
-
* @default []
|
|
61
|
-
* @example "['stacksjs.com', 'stacksjs.dev']"
|
|
62
|
-
*/
|
|
63
|
-
redirectUrls: string | string[]
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* **Application Debug Mode**
|
|
67
|
-
*
|
|
68
|
-
* When your application is in debug mode, detailed error messages with
|
|
69
|
-
* stack traces will be shown on every error that occurs within your
|
|
70
|
-
* application. If disabled, a simple generic error page is shown.
|
|
71
|
-
*
|
|
72
|
-
* @default true
|
|
73
|
-
*/
|
|
74
|
-
debug: boolean
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* **Maintenance Mode**
|
|
78
|
-
*
|
|
79
|
-
* When your application is in maintenance mode, a simple maintenance
|
|
80
|
-
* page will be shown on every request into your application.
|
|
81
|
-
*
|
|
82
|
-
* @default false
|
|
83
|
-
*/
|
|
84
|
-
maintenanceMode: boolean
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* **Coming Soon Mode**
|
|
88
|
-
*
|
|
89
|
-
* When enabled, public web requests can render a launch screen while
|
|
90
|
-
* optionally allowing preview access through a secret bypass.
|
|
91
|
-
*
|
|
92
|
-
* @default false
|
|
93
|
-
*/
|
|
94
|
-
comingSoonMode?: boolean
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* **Coming Soon Secret**
|
|
98
|
-
*
|
|
99
|
-
* Optional preview token used to bypass coming soon mode.
|
|
100
|
-
*/
|
|
101
|
-
comingSoonSecret?: string
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* **Encryption Key**
|
|
105
|
-
*
|
|
106
|
-
* This key is used by the Stacks encrypter service and should be set to
|
|
107
|
-
* a random, 32 character string, otherwise these encrypted strings will
|
|
108
|
-
* not be safe. Please do this before deploying an application!
|
|
109
|
-
*/
|
|
110
|
-
key: string
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* **Application Timezone**
|
|
114
|
-
*
|
|
115
|
-
* Here you may specify the default timezone for your application, which
|
|
116
|
-
* will be used by Stacks and date-time functions. We have gone ahead
|
|
117
|
-
* and set this to a sensible default for you out of the box.
|
|
118
|
-
*
|
|
119
|
-
* @default string "UTC"
|
|
120
|
-
*/
|
|
121
|
-
timezone: string
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* **Application Locale Configuration**
|
|
125
|
-
*
|
|
126
|
-
* The application locale determines the default locale that will be used
|
|
127
|
-
* by the translation service provider. You are free to set this value
|
|
128
|
-
* to any of the locales which will be supported by the application.
|
|
129
|
-
*
|
|
130
|
-
* @default string "en"
|
|
131
|
-
* @example
|
|
132
|
-
* de // ./lang/de.yml needs to be present for this
|
|
133
|
-
*/
|
|
134
|
-
locale: string
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* **Application Fallback Locale**
|
|
138
|
-
*
|
|
139
|
-
* The fallback locale determines the locale to use when the current one
|
|
140
|
-
* is not available. You may change the value to correspond to any of
|
|
141
|
-
* the language folders that are provided through your application.
|
|
142
|
-
*
|
|
143
|
-
* @default string "en"
|
|
144
|
-
*/
|
|
145
|
-
fallbackLocale: 'en'
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* **Cipher**
|
|
149
|
-
*
|
|
150
|
-
* Description WIP.
|
|
151
|
-
*
|
|
152
|
-
* @default string "aes-256-cbc"
|
|
153
|
-
*/
|
|
154
|
-
cipher: string
|
|
155
|
-
|
|
156
|
-
// inspect: <InspectOptions>{},
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* **Documentation Mode**
|
|
160
|
-
*
|
|
161
|
-
* $appUrl becomes your Documentation URL.
|
|
162
|
-
*
|
|
163
|
-
* @default false
|
|
164
|
-
*/
|
|
165
|
-
docMode: boolean
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* **Primary Brand Color**
|
|
169
|
-
*
|
|
170
|
-
* The primary color used for branding in emails and UI components.
|
|
171
|
-
* Should be a valid CSS color value (hex, rgb, etc.)
|
|
172
|
-
*
|
|
173
|
-
* @default "#3b82f6"
|
|
174
|
-
* @example "#3b82f6"
|
|
175
|
-
*/
|
|
176
|
-
primaryColor: string
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* **Support Email**
|
|
180
|
-
*
|
|
181
|
-
* The email address users should contact for support.
|
|
182
|
-
* Used in transactional emails and error messages.
|
|
183
|
-
*
|
|
184
|
-
* @example "support@example.com"
|
|
185
|
-
*/
|
|
186
|
-
supportEmail: string
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export type AppConfig = Partial<AppOptions>
|
package/src/attributes.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Project-generated `Attributes` interface lives at
|
|
2
|
-
// `storage/framework/types/attributes.ts` (one big union of every model's
|
|
3
|
-
// fillable column). Re-export type-only so Bun's runtime resolver doesn't
|
|
4
|
-
// try to load the file from the shipped `@stacksjs/types` package.
|
|
5
|
-
export type * from '../../../types/attributes'
|
package/src/auth.ts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
export interface AuthOptions {
|
|
2
|
-
/**
|
|
3
|
-
* Top-level feature gate. When `false`, the auth feature is inert at boot
|
|
4
|
-
* (no token/password-reset/email-verification flows wired up). Missing or
|
|
5
|
-
* `true` means auth is on.
|
|
6
|
-
*/
|
|
7
|
-
enabled?: boolean
|
|
8
|
-
/** Optional deploy-target gate, e.g. `['production']`. */
|
|
9
|
-
env?: string[]
|
|
10
|
-
/**
|
|
11
|
-
* The default authentication guard to use
|
|
12
|
-
*/
|
|
13
|
-
default: string
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The authentication guards available
|
|
17
|
-
*/
|
|
18
|
-
guards: {
|
|
19
|
-
[key: string]: {
|
|
20
|
-
/**
|
|
21
|
-
* The authentication driver to use
|
|
22
|
-
*/
|
|
23
|
-
driver: 'session' | 'token'
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* The authentication provider to use
|
|
27
|
-
*/
|
|
28
|
-
provider: string
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* The authentication providers available
|
|
34
|
-
*/
|
|
35
|
-
providers: {
|
|
36
|
-
[key: string]: {
|
|
37
|
-
/**
|
|
38
|
-
* The database driver to use
|
|
39
|
-
*/
|
|
40
|
-
driver: 'database'
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The database table to use
|
|
44
|
-
*/
|
|
45
|
-
table: string
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* The username field used for authentication
|
|
51
|
-
*/
|
|
52
|
-
username: string
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* The password field used for authentication
|
|
56
|
-
*/
|
|
57
|
-
password: string
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* The access-token expiry time in milliseconds. Defaults to 1 hour —
|
|
61
|
-
* the matching refresh token below covers the longer-lived window.
|
|
62
|
-
*/
|
|
63
|
-
tokenExpiry: number
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* The refresh-token expiry time in milliseconds. Defaults to 30 days.
|
|
67
|
-
* Refresh tokens are single-use and rotate on every refresh exchange.
|
|
68
|
-
*/
|
|
69
|
-
refreshTokenExpiry?: number
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* The token rotation time in hours
|
|
73
|
-
*/
|
|
74
|
-
tokenRotation: number
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The token abilities that are granted by default
|
|
78
|
-
*/
|
|
79
|
-
defaultAbilities: string[]
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* The token name used when creating new tokens
|
|
83
|
-
*/
|
|
84
|
-
defaultTokenName: string
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Password reset configuration
|
|
88
|
-
*/
|
|
89
|
-
passwordReset: {
|
|
90
|
-
/**
|
|
91
|
-
* Token expiration time in minutes
|
|
92
|
-
* @default 60
|
|
93
|
-
*/
|
|
94
|
-
expire: number
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Throttle time in seconds between password reset requests
|
|
98
|
-
* @default 60
|
|
99
|
-
*/
|
|
100
|
-
throttle: number
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Reset-link URL template. Supports `{token}` and `{email}`
|
|
104
|
-
* placeholders. Absolute templates (`https://…`) are used as-is;
|
|
105
|
-
* path templates are prefixed with the app URL. Lets apps whose
|
|
106
|
-
* reset page lives on a custom route reuse `passwordResets().sendEmail()`
|
|
107
|
-
* instead of hand-rolling the send.
|
|
108
|
-
* @default '/password/reset/{token}?email={email}'
|
|
109
|
-
*/
|
|
110
|
-
url?: string
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Email verification configuration
|
|
115
|
-
*/
|
|
116
|
-
emailVerification?: {
|
|
117
|
-
/**
|
|
118
|
-
* Token expiration time in minutes
|
|
119
|
-
* @default 60
|
|
120
|
-
*/
|
|
121
|
-
expire?: number
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Verification-link URL template. Supports `{id}` and `{token}`
|
|
125
|
-
* placeholders. Absolute templates (`https://…`) are used as-is;
|
|
126
|
-
* path templates are prefixed with the app URL. Lets apps whose
|
|
127
|
-
* verify page lives on a custom route reuse `sendVerificationEmail()`
|
|
128
|
-
* instead of hand-rolling the send.
|
|
129
|
-
* @default '/verify-email/{id}/{token}'
|
|
130
|
-
*/
|
|
131
|
-
url?: string
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export type AuthConfig = Partial<AuthOptions>
|
|
136
|
-
|
|
137
|
-
export interface AuthInstance {
|
|
138
|
-
guard: string
|
|
139
|
-
provider: string
|
|
140
|
-
user?: any
|
|
141
|
-
token?: string
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export type GuardType = 'session' | 'token'
|
|
145
|
-
export type ProviderType = 'database'
|
|
146
|
-
|
|
147
|
-
export interface AuthDriver {
|
|
148
|
-
attempt: (credentials: any) => Promise<boolean>
|
|
149
|
-
validate: (token: string) => Promise<boolean>
|
|
150
|
-
login: (credentials: any) => Promise<{ token: string } | null>
|
|
151
|
-
logout: () => Promise<void>
|
|
152
|
-
user: () => Promise<any>
|
|
153
|
-
token: () => string | null
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface Authenticatable {
|
|
157
|
-
getAuthIdentifier: () => any
|
|
158
|
-
getAuthPassword: () => string
|
|
159
|
-
getRememberToken: () => string
|
|
160
|
-
setRememberToken: (token: string) => void
|
|
161
|
-
}
|
package/src/auto-imports.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// `unplugin-auto-import` isn't a runtime dependency of @stacksjs/types — we
|
|
2
|
-
// only re-publish its option shape so users get autocomplete in user-land
|
|
3
|
-
// configs. The local type intentionally mirrors the upstream `Options`
|
|
4
|
-
// surface as an open record; if/when this package adopts unplugin-auto-import
|
|
5
|
-
// as a real dependency, swap this for `import type { Options }` from there.
|
|
6
|
-
export interface AutoImportsOptions {
|
|
7
|
-
[key: string]: unknown
|
|
8
|
-
}
|
package/src/binary.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
deploy: boolean
|
|
10
|
-
// path: string // TODO: add this for a configurable path where the commands are located
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type BinaryConfig = Partial<BinaryOptions>
|