@stacksjs/types 0.70.23 → 0.70.25

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.
Files changed (161) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/src/ai.d.ts +37 -0
  3. package/dist/src/analytics.d.ts +36 -0
  4. package/dist/src/api.d.ts +26 -0
  5. package/dist/src/app.d.ts +28 -0
  6. package/dist/src/attributes.d.ts +1 -0
  7. package/dist/src/auth.d.ts +49 -0
  8. package/dist/src/auto-imports.d.ts +8 -0
  9. package/dist/{binary.d.ts → src/binary.d.ts} +4 -1
  10. package/dist/src/cache.d.ts +79 -0
  11. package/dist/{cdn.d.ts → src/cdn.d.ts} +1 -1
  12. package/dist/{chat.d.ts → src/chat.d.ts} +29 -48
  13. package/dist/src/cli.d.ts +308 -0
  14. package/dist/{cloud.d.ts → src/cloud.d.ts} +81 -26
  15. package/dist/{components.d.ts → src/components.d.ts} +1 -4
  16. package/dist/{configure.d.ts → src/configure.d.ts} +1 -1
  17. package/dist/{cron-jobs.d.ts → src/cron-jobs.d.ts} +33 -37
  18. package/dist/src/dashboard.d.ts +33 -0
  19. package/dist/{database.d.ts → src/database.d.ts} +20 -12
  20. package/dist/src/dependencies.d.ts +17 -0
  21. package/dist/src/deploy.d.ts +16 -0
  22. package/dist/{dns.d.ts → src/dns.d.ts} +59 -59
  23. package/dist/src/docs.d.ts +23 -0
  24. package/dist/src/email.d.ts +201 -0
  25. package/dist/src/env.d.ts +1 -0
  26. package/dist/{errors.d.ts → src/errors.d.ts} +17 -24
  27. package/dist/src/events.d.ts +31 -0
  28. package/dist/src/exit-code.d.ts +10 -0
  29. package/dist/{file-systems.d.ts → src/file-systems.d.ts} +10 -6
  30. package/dist/{git.d.ts → src/git.d.ts} +9 -6
  31. package/dist/src/hashing.d.ts +57 -0
  32. package/dist/src/helpers.d.ts +1 -0
  33. package/dist/src/i18n.d.ts +65 -0
  34. package/dist/src/index.d.ts +70 -0
  35. package/dist/{library.d.ts → src/library.d.ts} +31 -33
  36. package/dist/src/logging.d.ts +12 -0
  37. package/dist/{manifest.d.ts → src/manifest.d.ts} +4 -1
  38. package/dist/src/model-names.d.ts +1 -0
  39. package/dist/src/model.d.ts +251 -0
  40. package/dist/{notifications.d.ts → src/notifications.d.ts} +1 -26
  41. package/dist/src/oauth.d.ts +290 -0
  42. package/dist/{pages.d.ts → src/pages.d.ts} +1 -1
  43. package/dist/src/payments.d.ts +322 -0
  44. package/dist/src/phone.d.ts +52 -0
  45. package/dist/src/ports.d.ts +20 -0
  46. package/dist/src/promise.d.ts +1 -0
  47. package/dist/src/push.d.ts +108 -0
  48. package/dist/src/queue.d.ts +310 -0
  49. package/dist/src/reactivity.d.ts +1 -0
  50. package/dist/src/realtime.d.ts +443 -0
  51. package/dist/src/request.d.ts +154 -0
  52. package/dist/{response.d.ts → src/response.d.ts} +1 -1
  53. package/dist/src/router.d.ts +105 -0
  54. package/dist/{saas.d.ts → src/saas.d.ts} +2 -2
  55. package/dist/src/scheduler.d.ts +1 -0
  56. package/dist/{search-engine.d.ts → src/search-engine.d.ts} +41 -45
  57. package/dist/{security.d.ts → src/security.d.ts} +4 -8
  58. package/dist/{server.d.ts → src/server.d.ts} +1 -1
  59. package/dist/src/services.d.ts +140 -0
  60. package/dist/{settings-config.d.ts → src/settings-config.d.ts} +1 -1
  61. package/dist/src/sms.d.ts +144 -0
  62. package/dist/src/stack-extensions.d.ts +137 -0
  63. package/dist/src/stacks.d.ts +40 -0
  64. package/dist/src/storage.d.ts +105 -0
  65. package/dist/src/table-names.d.ts +1 -0
  66. package/dist/src/tables.d.ts +34 -0
  67. package/dist/src/team.d.ts +7 -0
  68. package/dist/src/ui.d.ts +55 -0
  69. package/dist/src/utils.d.ts +39 -0
  70. package/package.json +13 -32
  71. package/src/ai.ts +20 -6
  72. package/src/analytics.ts +38 -1
  73. package/src/app.ts +38 -0
  74. package/src/attributes.ts +5 -1
  75. package/src/auth.ts +122 -0
  76. package/src/auto-imports.ts +8 -1
  77. package/src/cache.ts +226 -69
  78. package/src/chat.ts +0 -20
  79. package/src/cli.ts +24 -9
  80. package/src/cloud.ts +40 -1
  81. package/src/components.ts +3 -5
  82. package/src/cron-jobs.ts +1 -1
  83. package/src/dashboard.ts +40 -0
  84. package/src/database.ts +18 -2
  85. package/src/dns.ts +1 -1
  86. package/src/docs.ts +3 -3
  87. package/src/email.ts +303 -13
  88. package/src/errors.ts +2 -3
  89. package/src/events.ts +10 -5
  90. package/src/git.ts +3 -3
  91. package/src/hashing.ts +15 -19
  92. package/src/i18n.ts +105 -3
  93. package/src/index.ts +9 -5
  94. package/src/library.ts +0 -5
  95. package/src/model-names.ts +1 -1
  96. package/src/model.ts +87 -10
  97. package/src/oauth.ts +488 -0
  98. package/src/payments.ts +370 -27
  99. package/src/phone.ts +62 -0
  100. package/src/push.ts +107 -0
  101. package/src/queue.ts +386 -28
  102. package/src/reactivity.ts +1 -1
  103. package/src/realtime.ts +584 -0
  104. package/src/request.ts +344 -22
  105. package/src/router.ts +62 -4
  106. package/src/search-engine.ts +13 -13
  107. package/src/services.ts +100 -5
  108. package/src/sms.ts +263 -3
  109. package/src/stack-extensions.ts +184 -0
  110. package/src/stacks.ts +34 -4
  111. package/src/storage.ts +140 -6
  112. package/src/table-names.ts +1 -1
  113. package/src/ui.ts +20 -12
  114. package/src/utils.ts +1 -1
  115. package/dist/ai.d.ts +0 -20
  116. package/dist/analytics.d.ts +0 -13
  117. package/dist/api.d.ts +0 -26
  118. package/dist/app.d.ts +0 -32
  119. package/dist/attributes.d.ts +0 -1
  120. package/dist/auto-imports.d.ts +0 -1
  121. package/dist/build.d.ts +0 -2
  122. package/dist/cache.d.ts +0 -49
  123. package/dist/cli.d.ts +0 -310
  124. package/dist/dependencies.d.ts +0 -16
  125. package/dist/deploy.d.ts +0 -10
  126. package/dist/docs.d.ts +0 -26
  127. package/dist/email.d.ts +0 -107
  128. package/dist/events.d.ts +0 -5
  129. package/dist/exit-code.d.ts +0 -5
  130. package/dist/hashing.d.ts +0 -36
  131. package/dist/helpers.d.ts +0 -1
  132. package/dist/i18n.d.ts +0 -11
  133. package/dist/index.d.ts +0 -65
  134. package/dist/inspect.d.ts +0 -3
  135. package/dist/logging.d.ts +0 -6
  136. package/dist/model-names.d.ts +0 -1
  137. package/dist/model.d.ts +0 -232
  138. package/dist/payments.d.ts +0 -94
  139. package/dist/ports.d.ts +0 -13
  140. package/dist/promise.d.ts +0 -1
  141. package/dist/push.d.ts +0 -35
  142. package/dist/pwa.d.ts +0 -3
  143. package/dist/queue.d.ts +0 -45
  144. package/dist/reactivity.d.ts +0 -1
  145. package/dist/request.d.ts +0 -49
  146. package/dist/router.d.ts +0 -65
  147. package/dist/scheduler.d.ts +0 -1
  148. package/dist/services.d.ts +0 -81
  149. package/dist/ssg.d.ts +0 -3
  150. package/dist/stacks.d.ts +0 -54
  151. package/dist/storage.d.ts +0 -31
  152. package/dist/table-names.d.ts +0 -1
  153. package/dist/tables.d.ts +0 -34
  154. package/dist/team.d.ts +0 -8
  155. package/dist/ui.d.ts +0 -47
  156. package/dist/utils.d.ts +0 -27
  157. package/src/build.ts +0 -2
  158. package/src/inspect.ts +0 -10
  159. package/src/layout.ts +0 -8
  160. package/src/pwa.ts +0 -8
  161. package/src/ssg.ts +0 -3
package/src/email.ts CHANGED
@@ -1,4 +1,274 @@
1
- import type { I18n } from 'vue-email'
1
+ /**
2
+ * i18n bag passed to STX email templates at render time. Stacks emails
3
+ * are STX, not vue-email — keys/values are user-defined per template.
4
+ * The shape is intentionally open: each template declares its own
5
+ * placeholders and the renderer interpolates them as-is.
6
+ */
7
+ export interface I18n {
8
+ [key: string]: unknown
9
+ }
10
+
11
+ export interface AutoResponderConfig {
12
+ enabled: boolean
13
+ subject: string
14
+ body: string
15
+ schedule?: {
16
+ start?: string
17
+ end?: string
18
+ }
19
+ }
20
+
21
+ export interface EmailFilterRule {
22
+ field: 'from' | 'to' | 'subject' | 'body'
23
+ operator: 'contains' | 'equals' | 'startsWith' | 'endsWith' | 'regex'
24
+ value: string
25
+ action: 'move' | 'delete' | 'forward' | 'label'
26
+ actionValue?: string
27
+ }
28
+
29
+ export interface MailboxConfig {
30
+ /** Email address (preferred) - e.g., 'chris@stacksjs.com' */
31
+ email?: string
32
+ /** @deprecated Use 'email' instead */
33
+ address?: string
34
+ displayName?: string
35
+ /**
36
+ * Password for IMAP/SMTP authentication.
37
+ * If not provided, will be looked up from MAIL_PASSWORD_<USERNAME> env var.
38
+ * Passwords are stored in AWS Secrets Manager after first deploy.
39
+ */
40
+ password?: string
41
+ forwardTo?: string[]
42
+ autoResponder?: AutoResponderConfig
43
+ filters?: EmailFilterRule[]
44
+ }
45
+
46
+ export interface MailServerInstanceConfig {
47
+ /**
48
+ * EC2 instance type for the mail server
49
+ * @default 't4g.nano' for serverless, 't3.small' for server mode
50
+ */
51
+ type?: 't4g.nano' | 't4g.micro' | 't4g.small' | 't4g.medium' | 't3.nano' | 't3.micro' | 't3.small' | 't3.medium' | 't3.large' | 't3.xlarge'
52
+
53
+ /**
54
+ * Use spot instance for cost savings (~70% cheaper)
55
+ * Note: Spot instances can be interrupted with 2-minute warning
56
+ * @default false
57
+ */
58
+ spot?: boolean
59
+
60
+ /**
61
+ * Root volume size in GB
62
+ * @default 8 for serverless, 30 for server mode
63
+ */
64
+ diskSize?: number
65
+
66
+ /**
67
+ * SSH key pair name for instance access (optional)
68
+ */
69
+ keyPair?: string
70
+ }
71
+
72
+ export interface MailServerPortsConfig {
73
+ /**
74
+ * Standard SMTP port
75
+ * @default 25
76
+ */
77
+ smtp?: number
78
+
79
+ /**
80
+ * SMTP over TLS (implicit TLS)
81
+ * @default 465
82
+ */
83
+ smtps?: number
84
+
85
+ /**
86
+ * SMTP submission port (STARTTLS)
87
+ * @default 587
88
+ */
89
+ submission?: number
90
+
91
+ /**
92
+ * IMAP port (plaintext, not recommended)
93
+ * @default 143
94
+ */
95
+ imap?: number
96
+
97
+ /**
98
+ * IMAP over TLS
99
+ * @default 993
100
+ */
101
+ imaps?: number
102
+
103
+ /**
104
+ * POP3 port (plaintext, not recommended)
105
+ * @default 110
106
+ */
107
+ pop3?: number
108
+
109
+ /**
110
+ * POP3 over TLS
111
+ * @default 995
112
+ */
113
+ pop3s?: number
114
+
115
+ /**
116
+ * @deprecated Use 'submission' instead
117
+ */
118
+ smtpStartTls?: number
119
+ }
120
+
121
+ export interface MailServerFeaturesConfig {
122
+ /**
123
+ * Enable IMAP server
124
+ * @default true
125
+ */
126
+ imap?: boolean
127
+
128
+ /**
129
+ * Enable POP3 server
130
+ * @default true
131
+ */
132
+ pop3?: boolean
133
+
134
+ /**
135
+ * Enable webmail interface (future)
136
+ * @default false
137
+ */
138
+ webmail?: boolean
139
+
140
+ /**
141
+ * Enable CalDAV for calendar sync
142
+ * @default false
143
+ */
144
+ calDAV?: boolean
145
+
146
+ /**
147
+ * Enable CardDAV for contacts sync
148
+ * @default false
149
+ */
150
+ cardDAV?: boolean
151
+
152
+ /**
153
+ * Enable Exchange ActiveSync
154
+ * @default false
155
+ */
156
+ activeSync?: boolean
157
+ }
158
+
159
+ /**
160
+ * Email category types for automatic email categorization (Gmail-style)
161
+ */
162
+ export type EmailCategory = 'social' | 'forums' | 'updates' | 'promotions' | 'primary'
163
+
164
+ /**
165
+ * Patterns for matching emails to categories
166
+ */
167
+ export interface CategoryPatterns {
168
+ /**
169
+ * Domain names to match (e.g., 'facebookmail.com', 'twitter.com')
170
+ * Matched against the sender's email domain
171
+ */
172
+ domains?: string[]
173
+
174
+ /**
175
+ * Substrings to match in the sender address (e.g., 'notification@', '@social.')
176
+ */
177
+ substrings?: string[]
178
+
179
+ /**
180
+ * Email headers to match (e.g., { 'list-id': [''], 'precedence': ['list', 'bulk'] })
181
+ * Empty string array means "header exists"
182
+ */
183
+ headers?: Record<string, string[]>
184
+ }
185
+
186
+ /**
187
+ * Configuration for automatic email categorization
188
+ */
189
+ export interface EmailCategorizationConfig {
190
+ /**
191
+ * Enable automatic email categorization into Gmail-style folders
192
+ * @default true
193
+ */
194
+ enabled?: boolean
195
+
196
+ /**
197
+ * Social category patterns (Facebook, Twitter, LinkedIn, etc.)
198
+ */
199
+ social?: CategoryPatterns
200
+
201
+ /**
202
+ * Forums category patterns (mailing lists, Google Groups, etc.)
203
+ */
204
+ forums?: CategoryPatterns
205
+
206
+ /**
207
+ * Updates category patterns (GitHub, Stripe, shipping notifications, etc.)
208
+ */
209
+ updates?: CategoryPatterns
210
+
211
+ /**
212
+ * Promotions category patterns (marketing emails, newsletters, etc.)
213
+ */
214
+ promotions?: CategoryPatterns
215
+ }
216
+
217
+ export interface EmailServerConfig {
218
+ enabled: boolean
219
+ scan?: boolean // spam/virus scanning
220
+
221
+ /**
222
+ * Server mode:
223
+ * - 'server': Full-featured Zig mail server with IMAP, POP3, CalDAV, etc. (default)
224
+ * - 'serverless': Lightweight TypeScript/Bun server (~$3/month)
225
+ * @default 'server'
226
+ */
227
+ mode?: 'serverless' | 'server'
228
+
229
+ storage?: {
230
+ bucket?: string
231
+ retentionDays?: number
232
+ archiveAfterDays?: number
233
+ }
234
+ forwarding?: Record<string, string[]> // alias -> destinations
235
+ autoResponders?: AutoResponderConfig[]
236
+
237
+ /**
238
+ * Mail server instance configuration
239
+ * Controls the EC2 instance that runs IMAP/SMTP
240
+ */
241
+ instance?: MailServerInstanceConfig
242
+
243
+ /**
244
+ * Mail server ports configuration
245
+ */
246
+ ports?: MailServerPortsConfig
247
+
248
+ /**
249
+ * Mail server features (only available in 'server' mode)
250
+ */
251
+ features?: MailServerFeaturesConfig
252
+
253
+ /**
254
+ * Subdomain for the mail server
255
+ * @default 'mail'
256
+ * @example 'mail' -> mail.yourdomain.com
257
+ */
258
+ subdomain?: string
259
+
260
+ /**
261
+ * Automatic email categorization (Gmail-style folders)
262
+ * Categorizes incoming emails into Social, Forums, Updates, Promotions folders
263
+ */
264
+ categorization?: EmailCategorizationConfig
265
+ }
266
+
267
+ export interface EmailNotificationsConfig {
268
+ newEmail?: boolean
269
+ bounces?: boolean
270
+ complaints?: boolean
271
+ }
2
272
 
3
273
  export interface EmailOptions {
4
274
  from: {
@@ -6,16 +276,16 @@ export interface EmailOptions {
6
276
  address: string
7
277
  }
8
278
 
9
- mailboxes: string[]
279
+ mailboxes: string[] | MailboxConfig[]
280
+ domain?: string
10
281
 
11
282
  url: string
12
283
  charset: string
13
284
 
14
- server: {
15
- scan?: boolean
16
- }
285
+ server: EmailServerConfig
286
+ notifications?: EmailNotificationsConfig
17
287
 
18
- default: 'ses' | 'sendgrid' | 'mailgun' | 'mailtrap'
288
+ default: 'log' | 'ses' | 'sendgrid' | 'mailgun' | 'mailtrap' | 'smtp'
19
289
  }
20
290
 
21
291
  export type EmailConfig = Partial<EmailOptions>
@@ -29,14 +299,24 @@ export interface EmailResult {
29
299
  success: boolean
30
300
  provider: string
31
301
  messageId?: string
32
- [key: string]: any
302
+ /** Additional metadata from the email provider */
303
+ metadata?: Record<string, unknown>
33
304
  }
34
305
 
35
306
  // Base configuration interface
36
307
  export interface EmailDriverConfig {
37
308
  maxRetries?: number
38
309
  retryTimeout?: number
39
- [key: string]: any
310
+ }
311
+
312
+ /** Options for email template rendering */
313
+ export interface EmailTemplateOptions {
314
+ /** Template variables to replace */
315
+ variables?: Record<string, string | number | boolean | undefined | null>
316
+ /** Layout to wrap the template in */
317
+ layout?: string | false
318
+ /** Subject line for the email */
319
+ subject?: string
40
320
  }
41
321
 
42
322
  // Email driver interface
@@ -45,15 +325,15 @@ export interface EmailDriver {
45
325
  name: string
46
326
 
47
327
  /** Send an email */
48
- send: (message: EmailMessage, options?: RenderOptions) => Promise<EmailResult>
328
+ send: (message: EmailMessage, options?: EmailTemplateOptions) => Promise<EmailResult>
49
329
 
50
330
  /** Configure the driver */
51
331
  configure: (config: EmailDriverConfig) => void
52
332
  }
53
333
 
54
334
  export interface EmailMessage {
55
- /** Required sender email address */
56
- from: EmailAddress
335
+ /** Sender email address (optional, will use config default if not provided) */
336
+ from?: EmailAddress
57
337
  /** Primary recipient(s) */
58
338
  to: string | string[] | EmailAddress[]
59
339
  /** Carbon copy recipient(s) */
@@ -62,12 +342,22 @@ export interface EmailMessage {
62
342
  bcc?: string | string[] | EmailAddress[]
63
343
  /** Email subject line */
64
344
  subject: string
65
- /** Path to email template or HTML content */
345
+ /** Path to email template (Vue component) */
66
346
  template?: string
67
- /** Optional plain text fallback */
347
+ /** Direct HTML content for the email body */
348
+ html?: string
349
+ /** Plain text fallback (recommended for accessibility) */
68
350
  text?: string
69
351
  /** Optional attachments */
70
352
  attachments?: EmailAttachment[]
353
+ /**
354
+ * Extra raw headers to inject into the outgoing envelope.
355
+ * Used by the newsletter package for `List-Unsubscribe` /
356
+ * `List-Unsubscribe-Post` (RFC 8058). Drivers that don't yet wire
357
+ * this through silently ignore — it never affects transactional
358
+ * sends.
359
+ */
360
+ headers?: Record<string, string>
71
361
  /** Optional callback after successful delivery */
72
362
  onSuccess?: () => Promise<{ message: string }> | { message: string }
73
363
  /** Optional callback after failed delivery */
package/src/errors.ts CHANGED
@@ -26,7 +26,6 @@ export interface ErrorOptions {
26
26
  'activeUrl': string
27
27
  'alpha': string
28
28
  'alphaNumeric': string
29
- 'minLength': string
30
29
  'maxLength': string
31
30
  'fixedLength': string
32
31
  'confirmed': string
@@ -86,13 +85,13 @@ export interface ErrorOptions {
86
85
 
87
86
  // record
88
87
  'record': string
89
- 'record.minLength': string
88
+ 'record.min': string
90
89
  'record.maxLength': string
91
90
  'record.fixedLength': string
92
91
 
93
92
  // array
94
93
  'array': string
95
- 'array.minLength': string
94
+ 'array.min': string
96
95
  'array.maxLength': string
97
96
  'array.fixedLength': string
98
97
  'notEmpty': string
package/src/events.ts CHANGED
@@ -7,12 +7,12 @@
7
7
  *
8
8
  * @example To fire an event, you may use any of the following approaches:
9
9
  * ```ts
10
- * dispatch('user:registered', { name: 'Chris', email: 'chris@stacksjs.org' })
10
+ * dispatch('user:registered', { name: 'Chris', email: 'chris@stacksjs.com' })
11
11
  *
12
12
  * // alternatively, you may use the following:
13
- * useEvent('user:registered', { name: 'Chris', email: 'chris@stacksjs.org' })
14
- * events.emit('user:registered', { name: 'Chris', email: 'chris@stacksjs.org' })
15
- * useEvents.emit('user:registered', { name: 'Chris', email: 'chris@stacksjs.org' })
13
+ * useEvent('user:registered', { name: 'Chris', email: 'chris@stacksjs.com' })
14
+ * events.emit('user:registered', { name: 'Chris', email: 'chris@stacksjs.com' })
15
+ * useEvents.emit('user:registered', { name: 'Chris', email: 'chris@stacksjs.com' })
16
16
  * ```
17
17
  *
18
18
  * @example To capture an event, you may use any of the following approaches:
@@ -29,4 +29,9 @@ export interface Events {
29
29
  [key: string]: string[]
30
30
  }
31
31
 
32
- export * from '../../../types/events'
32
+ // `storage/framework/types/events.ts` is a project-generated declaration
33
+ // (one entry per model: `'<name>:created' | '<name>:updated' | …`). Use
34
+ // `export type *` so Bun erases the import at runtime — the file lives in
35
+ // the consumer project, not in the published `@stacksjs/types` package, so
36
+ // a value-level `export *` would fail to resolve once the package ships.
37
+ export type * from '../../../types/events'
package/src/git.ts CHANGED
@@ -28,7 +28,7 @@ export interface GitOptions {
28
28
  *
29
29
  * The git commit scopes to use.
30
30
  *
31
- * @see https://stacksjs.org/docs/git/scopes
31
+ * @see https://stacksjs.com/docs/git/scopes
32
32
  * @example
33
33
  * git: [
34
34
  * scopes: [
@@ -46,7 +46,7 @@ export interface GitOptions {
46
46
  * The git commit types to use.
47
47
  *
48
48
  * @default array
49
- * @see https://stacksjs.org/docs/git/types
49
+ * @see https://stacksjs.com/docs/git/types
50
50
  * @see https://www.conventionalcommits.org/en/v1.0.0/
51
51
  * @example
52
52
  * ```ts
@@ -81,7 +81,7 @@ export interface GitOptions {
81
81
  * confirmCommit: 'Are you sure you want to proceed with the commit above?',
82
82
  * }
83
83
  * ```
84
- * @see https://stacksjs.org/docs/git/messages
84
+ * @see https://stacksjs.com/docs/git/messages
85
85
  */
86
86
  messages: {
87
87
  type: string
package/src/hashing.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * longer it takes malicious users to generate "rainbow tables" of all possible string hash
10
10
  * values that may be used in brute force attacks against applications.
11
11
  *
12
- * @see https://stacksjs.org/docs/hashing
12
+ * @see https://stacksjs.com/docs/hashing
13
13
  */
14
14
  export interface HashingOptions {
15
15
  /**
@@ -19,7 +19,7 @@ export interface HashingOptions {
19
19
  * passwords for your application. By default, the bcrypt algorithm is
20
20
  * used; however, you remain free to modify this option if you wish.
21
21
  *
22
- * @see https://stacksjs.org/docs/hashing
22
+ * @see https://stacksjs.com/docs/hashing
23
23
  */
24
24
  driver: 'argon2' | 'argon2id' | 'argon2i' | 'argon2d' | 'bcrypt'
25
25
 
@@ -30,7 +30,7 @@ export interface HashingOptions {
30
30
  * passwords are hashed using the Bcrypt algorithm. This will allow you
31
31
  * to control the amount of time it takes to hash the given password.
32
32
  *
33
- * @see https://stacksjs.org/docs/hashing
33
+ * @see https://stacksjs.com/docs/hashing
34
34
  */
35
35
  bcrypt?: BcryptOptions
36
36
 
@@ -41,7 +41,7 @@ export interface HashingOptions {
41
41
  * passwords are hashed using the Argon algorithm. These will allow you
42
42
  * to control the amount of time it takes to hash the given password.
43
43
  *
44
- * @see https://stacksjs.org/docs/hashing
44
+ * @see https://stacksjs.com/docs/hashing
45
45
  */
46
46
  argon2?: ArgonOptions
47
47
  }
@@ -55,23 +55,19 @@ export type HashingConfig = Partial<HashingOptions>
55
55
  * passwords are hashed using the Bcrypt algorithm. This will allow you
56
56
  * to control the amount of time it takes to hash the given password.
57
57
  *
58
- * @see https://stacksjs.org/docs/hashing
58
+ * @see https://stacksjs.com/docs/hashing
59
59
  */
60
60
  export interface BcryptOptions {
61
61
  /**
62
- * Bcrypt salt rounds.
62
+ * Bcrypt rounds (cost factor).
63
+ * This is a number between 4-31.
64
+ * Higher values = more secure but slower.
65
+ * Laravel default: 10-12
63
66
  *
64
- * @default number 10
65
- * @see https://stacksjs.org/docs/hashing
67
+ * @default 12
68
+ * @see https://stacksjs.com/docs/hashing
66
69
  */
67
70
  rounds: number
68
-
69
- /**
70
- * Bcrypt cost. This is a number between 4-31.
71
- * @default number 4
72
- * @see https://stacksjs.org/docs/hashing
73
- */
74
- cost: number
75
71
  }
76
72
 
77
73
  /**
@@ -81,7 +77,7 @@ export interface BcryptOptions {
81
77
  * passwords are hashed using the Argon algorithm. These will allow you
82
78
  * to control the amount of time it takes to hash the given password.
83
79
  *
84
- * @see https://stacksjs.org/docs/hashing
80
+ * @see https://stacksjs.com/docs/hashing
85
81
  */
86
82
  export interface ArgonOptions {
87
83
  /**
@@ -90,7 +86,7 @@ export interface ArgonOptions {
90
86
  * Amount of memory (in kibibytes) to use.
91
87
  *
92
88
  * @default number 65536
93
- * @see https://stacksjs.org/docs/hashing
89
+ * @see https://stacksjs.com/docs/hashing
94
90
  */
95
91
  memory?: number
96
92
 
@@ -100,7 +96,7 @@ export interface ArgonOptions {
100
96
  // * Degree of parallelism (i.e. number of threads).
101
97
  // *
102
98
  // * @default number 1
103
- // * @see https://stacksjs.org/docs/hashing
99
+ // * @see https://stacksjs.com/docs/hashing
104
100
  // */
105
101
  // threads?: number
106
102
 
@@ -110,7 +106,7 @@ export interface ArgonOptions {
110
106
  * Execution time.
111
107
  *
112
108
  * @default number 1
113
- * @see https://stacksjs.org/docs/hashing
109
+ * @see https://stacksjs.com/docs/hashing
114
110
  */
115
111
  time?: number
116
112
  }
package/src/i18n.ts CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Vite plugin options for Vue I18n
3
+ */
1
4
  interface VitePluginVueI18nOptions {
2
5
  forceStringify?: boolean
3
6
  runtimeOnly?: boolean
@@ -9,11 +12,110 @@ interface VitePluginVueI18nOptions {
9
12
  useVueI18nImportName?: boolean
10
13
  }
11
14
 
15
+ /**
16
+ * Translation messages - can be nested objects or strings
17
+ */
18
+ export type TranslationMessages = {
19
+ [key: string]: string | TranslationMessages
20
+ }
21
+
22
+ /**
23
+ * All translations keyed by locale
24
+ */
25
+ export type Translations = {
26
+ [locale: string]: TranslationMessages
27
+ }
28
+
29
+ /**
30
+ * Date/time format configurations per locale
31
+ */
32
+ export type DateTimeFormats = {
33
+ [locale: string]: {
34
+ [formatName: string]: Intl.DateTimeFormatOptions
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Number format configurations per locale
40
+ */
41
+ export type NumberFormats = {
42
+ [locale: string]: {
43
+ [formatName: string]: Intl.NumberFormatOptions
44
+ }
45
+ }
46
+
12
47
  /**
13
48
  * **Internationalization Options**
14
49
  *
15
- * The i18n option.
16
- *
17
- * @see https://github.com/intlify/bundle-tools/blob/main/packages/vite-plugin-vue-i18n/src/options.ts
50
+ * Configuration for the i18n system.
51
+ */
52
+ export interface I18nOptions {
53
+ /**
54
+ * Default locale
55
+ * @default 'en'
56
+ */
57
+ locale: string
58
+
59
+ /**
60
+ * Fallback locale when translation is not found
61
+ * @default 'en'
62
+ */
63
+ fallbackLocale: string
64
+
65
+ /**
66
+ * Available locales
67
+ */
68
+ availableLocales?: string[]
69
+
70
+ /**
71
+ * Directory containing translation files
72
+ * @default 'lang'
73
+ */
74
+ langDir?: string
75
+
76
+ /**
77
+ * Initial translations
78
+ */
79
+ messages?: Translations
80
+
81
+ /**
82
+ * Whether to warn about missing translations in development
83
+ * @default true
84
+ */
85
+ warnMissing?: boolean
86
+
87
+ /**
88
+ * Separator for nested keys
89
+ * @default '.'
90
+ */
91
+ keySeparator?: string
92
+
93
+ /**
94
+ * Plural separator
95
+ * @default '|'
96
+ */
97
+ pluralSeparator?: string
98
+
99
+ /**
100
+ * Date/time formatting options
101
+ */
102
+ dateTimeFormats?: DateTimeFormats
103
+
104
+ /**
105
+ * Number formatting options
106
+ */
107
+ numberFormats?: NumberFormats
108
+
109
+ /**
110
+ * Vite plugin options
111
+ */
112
+ vite?: VitePluginVueI18nOptions
113
+ }
114
+
115
+ export type I18nConfig = Partial<I18nOptions>
116
+
117
+ /**
118
+ * Legacy alias
119
+ * @deprecated Use I18nOptions instead
18
120
  */
19
121
  export type i18nOptions = VitePluginVueI18nOptions