@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.
Files changed (76) hide show
  1. package/package.json +19 -5
  2. package/src/ai.ts +0 -41
  3. package/src/analytics.ts +0 -58
  4. package/src/api.ts +0 -77
  5. package/src/app.ts +0 -189
  6. package/src/attributes.ts +0 -5
  7. package/src/auth.ts +0 -161
  8. package/src/auto-imports.ts +0 -8
  9. package/src/binary.ts +0 -13
  10. package/src/cache.ts +0 -325
  11. package/src/cdn.ts +0 -17
  12. package/src/chat.ts +0 -193
  13. package/src/cli.ts +0 -445
  14. package/src/cloud.ts +0 -381
  15. package/src/cms.ts +0 -14
  16. package/src/commerce.ts +0 -18
  17. package/src/components.ts +0 -62
  18. package/src/configure.ts +0 -13
  19. package/src/cors.ts +0 -86
  20. package/src/cron-jobs.ts +0 -146
  21. package/src/dashboard.ts +0 -218
  22. package/src/database.ts +0 -117
  23. package/src/dependencies.ts +0 -69
  24. package/src/deploy.ts +0 -17
  25. package/src/dns.ts +0 -470
  26. package/src/docs.ts +0 -27
  27. package/src/email.ts +0 -511
  28. package/src/env.ts +0 -1
  29. package/src/errors.ts +0 -110
  30. package/src/events.ts +0 -37
  31. package/src/exit-code.ts +0 -10
  32. package/src/file-systems.ts +0 -70
  33. package/src/git.ts +0 -133
  34. package/src/hashing.ts +0 -127
  35. package/src/helpers.ts +0 -9
  36. package/src/i18n.ts +0 -121
  37. package/src/index.ts +0 -80
  38. package/src/library.ts +0 -911
  39. package/src/logging.ts +0 -62
  40. package/src/manifest.ts +0 -9
  41. package/src/marketing.ts +0 -14
  42. package/src/model-dashboard-augmentation.ts +0 -51
  43. package/src/model-names.ts +0 -1
  44. package/src/model.ts +0 -353
  45. package/src/monitoring.ts +0 -14
  46. package/src/native.ts +0 -0
  47. package/src/notifications.ts +0 -153
  48. package/src/oauth.ts +0 -488
  49. package/src/pages.ts +0 -10
  50. package/src/payments.ts +0 -440
  51. package/src/phone.ts +0 -78
  52. package/src/ports.ts +0 -20
  53. package/src/promise.ts +0 -1
  54. package/src/push.ts +0 -143
  55. package/src/queue.ts +0 -413
  56. package/src/reactivity.ts +0 -1
  57. package/src/realtime.ts +0 -584
  58. package/src/request.ts +0 -541
  59. package/src/response.ts +0 -16
  60. package/src/router.ts +0 -124
  61. package/src/saas.ts +0 -33
  62. package/src/scheduler.ts +0 -1
  63. package/src/search-engine.ts +0 -251
  64. package/src/security.ts +0 -23
  65. package/src/server.ts +0 -16
  66. package/src/services.ts +0 -211
  67. package/src/settings-config.ts +0 -10
  68. package/src/sms.ts +0 -265
  69. package/src/stack-extensions.ts +0 -184
  70. package/src/stacks.ts +0 -339
  71. package/src/storage.ts +0 -173
  72. package/src/table-names.ts +0 -1
  73. package/src/tables.ts +0 -57
  74. package/src/team.ts +0 -8
  75. package/src/ui.ts +0 -197
  76. package/src/utils.ts +0 -46
package/src/sms.ts DELETED
@@ -1,265 +0,0 @@
1
- /**
2
- * SMS Service Configuration Types
3
- * Supports Twilio, Vonage, and AWS providers
4
- */
5
-
6
- // =============================================================================
7
- // Core SMS Types
8
- // =============================================================================
9
-
10
- export type SmsProvider = 'twilio' | 'vonage' | 'pinpoint' | 'sns'
11
-
12
- export interface SmsMessage {
13
- /**
14
- * Recipient phone number (E.164 format recommended)
15
- */
16
- to: string | string[]
17
-
18
- /**
19
- * Message body
20
- */
21
- body: string
22
-
23
- /**
24
- * Sender ID or phone number
25
- */
26
- from?: string
27
-
28
- /**
29
- * Optional media URLs (MMS)
30
- */
31
- mediaUrls?: string[]
32
-
33
- /**
34
- * Callback URL for status updates
35
- */
36
- statusCallback?: string
37
-
38
- /**
39
- * Additional provider-specific options
40
- */
41
- options?: Record<string, unknown>
42
- }
43
-
44
- export interface SmsSendResult {
45
- success: boolean
46
- messageId?: string
47
- status?: SmsStatus
48
- to: string
49
- error?: string
50
- provider: SmsProvider
51
- segments?: number
52
- price?: number
53
- currency?: string
54
- }
55
-
56
- export type SmsStatus =
57
- | 'queued'
58
- | 'sending'
59
- | 'sent'
60
- | 'delivered'
61
- | 'failed'
62
- | 'undelivered'
63
- | 'unknown'
64
-
65
- export interface SmsStatusUpdate {
66
- messageId: string
67
- to: string
68
- status: SmsStatus
69
- timestamp: Date
70
- errorCode?: string
71
- errorMessage?: string
72
- }
73
-
74
- // =============================================================================
75
- // Provider Configurations
76
- // =============================================================================
77
-
78
- export interface TwilioConfig {
79
- accountSid: string
80
- authToken: string
81
- from?: string
82
- messagingServiceSid?: string
83
- statusCallback?: string
84
- }
85
-
86
- export interface VonageConfig {
87
- apiKey: string
88
- apiSecret: string
89
- from?: string
90
- applicationId?: string
91
- privateKey?: string
92
- }
93
-
94
- export interface AwsSmsConfig {
95
- region: string
96
- accessKeyId?: string
97
- secretAccessKey?: string
98
- senderId?: string
99
- originationNumber?: string
100
- }
101
-
102
- // =============================================================================
103
- // SMS Options (Main Config)
104
- // =============================================================================
105
-
106
- export interface SmsTemplateConfig {
107
- name: string
108
- body: string
109
- variables?: string[]
110
- }
111
-
112
- export interface SmsOptOutConfig {
113
- enabled: boolean
114
- keywords: string[]
115
- }
116
-
117
- export interface SmsTwoWayConfig {
118
- enabled: boolean
119
- webhookUrl?: string
120
- snsTopicArn?: string
121
- }
122
-
123
- export interface SmsInboxConfig {
124
- enabled: boolean
125
- bucket: string
126
- prefix?: string
127
- retentionDays?: number
128
- }
129
-
130
- export interface SmsOptions {
131
- /**
132
- * Enable SMS functionality
133
- */
134
- enabled: boolean
135
-
136
- /**
137
- * Default SMS provider
138
- */
139
- provider: SmsProvider
140
-
141
- /**
142
- * Default sender ID or phone number
143
- */
144
- from?: string
145
-
146
- /**
147
- * Default country code for phone number formatting
148
- */
149
- defaultCountryCode?: string
150
-
151
- /**
152
- * Message type (affects pricing and delivery)
153
- */
154
- messageType?: 'TRANSACTIONAL' | 'PROMOTIONAL'
155
-
156
- /**
157
- * Provider-specific configurations
158
- */
159
- drivers: {
160
- twilio?: TwilioConfig
161
- vonage?: VonageConfig
162
- pinpoint?: AwsSmsConfig
163
- sns?: AwsSmsConfig
164
- }
165
-
166
- /**
167
- * Opt-out handling configuration
168
- */
169
- optOut?: SmsOptOutConfig
170
-
171
- /**
172
- * Two-way messaging configuration
173
- */
174
- twoWay?: SmsTwoWayConfig
175
-
176
- /**
177
- * Message templates
178
- */
179
- templates?: SmsTemplateConfig[]
180
-
181
- /**
182
- * Inbox configuration for storing received messages
183
- */
184
- inbox?: SmsInboxConfig
185
-
186
- /**
187
- * Max monthly spend limit
188
- */
189
- maxSpendPerMonth?: number
190
- }
191
-
192
- export type SmsConfig = Partial<SmsOptions>
193
-
194
- // =============================================================================
195
- // SMS Driver Interface
196
- // =============================================================================
197
-
198
- export interface SmsDriver {
199
- /**
200
- * Send an SMS message
201
- */
202
- send(message: SmsMessage): Promise<SmsSendResult>
203
-
204
- /**
205
- * Send multiple SMS messages
206
- */
207
- sendBulk(messages: SmsMessage[]): Promise<SmsSendResult[]>
208
-
209
- /**
210
- * Get message status
211
- */
212
- getStatus?(messageId: string): Promise<SmsStatusUpdate>
213
-
214
- /**
215
- * Verify a phone number
216
- */
217
- verify?(phoneNumber: string): Promise<{ valid: boolean, carrier?: string, type?: string }>
218
-
219
- /**
220
- * Get account balance/usage
221
- */
222
- getBalance?(): Promise<{ balance: number, currency: string }>
223
- }
224
-
225
- // =============================================================================
226
- // Verification Types (for 2FA/OTP)
227
- // =============================================================================
228
-
229
- export interface VerificationRequest {
230
- to: string
231
- channel?: 'sms' | 'call' | 'whatsapp'
232
- codeLength?: number
233
- locale?: string
234
- customMessage?: string
235
- }
236
-
237
- export interface VerificationResult {
238
- success: boolean
239
- verificationId?: string
240
- status: 'pending' | 'approved' | 'denied' | 'expired'
241
- error?: string
242
- }
243
-
244
- export interface VerificationCheckRequest {
245
- verificationId?: string
246
- to: string
247
- code: string
248
- }
249
-
250
- export interface SmsVerificationDriver {
251
- /**
252
- * Start a verification (send OTP)
253
- */
254
- startVerification(request: VerificationRequest): Promise<VerificationResult>
255
-
256
- /**
257
- * Check a verification code
258
- */
259
- checkVerification(request: VerificationCheckRequest): Promise<VerificationResult>
260
-
261
- /**
262
- * Cancel a pending verification
263
- */
264
- cancelVerification?(verificationId: string): Promise<boolean>
265
- }
@@ -1,184 +0,0 @@
1
- /**
2
- * Known top-level directories in a Stacks project that a stack extension can provide.
3
- * Uses `(string & {})` to allow custom directories while still providing autocomplete.
4
- */
5
- export type StackDirectory =
6
- | 'app'
7
- | 'config'
8
- | 'database'
9
- | 'resources'
10
- | 'routes'
11
- | 'public'
12
- | 'locales'
13
- | 'docs'
14
- | (string & {})
15
-
16
- // ─── Stack Extensions Registry ──────────────────────────────────────────────
17
- //
18
- // This is the central registry of known stack extensions. Third-party authors
19
- // can submit a PR to add their stack here. Once merged, all Stacks users get
20
- // autocomplete and type safety for the new stack name.
21
- //
22
- // To add your stack, add a new entry below following the pattern:
23
- // 'your-stack-name': { package: '@your-org/your-stack', description: '...' },
24
- //
25
- // Requirements for PRs:
26
- // - The package must be published to npm
27
- // - The package.json must contain a valid `stacks` field with a `name`
28
- // - The description should be concise (under 80 chars)
29
- // ─────────────────────────────────────────────────────────────────────────────
30
-
31
- interface StackRegistryEntry {
32
- /** The npm package name */
33
- package: string
34
- /** A short description of what this stack provides */
35
- description: string
36
- /** GitHub repository (e.g. 'stacksjs/blog-stack') */
37
- github?: string
38
- }
39
-
40
- /**
41
- * The central registry of known stack extensions.
42
- *
43
- * Third-party stack authors: submit a PR to add your stack here.
44
- * Once merged, all Stacks users will get autocomplete for your stack name.
45
- */
46
- export const stackExtensionRegistry = {
47
- // ── Community Stacks ────────────────────────────────────────────────────
48
- // Add your stack here via PR! Follow the pattern:
49
- // 'your-stack': { package: '@your-org/your-stack', description: 'What it does' },
50
- //
51
- // Once merged, all Stacks users get autocomplete for your stack name.
52
- } as const satisfies Record<string, StackRegistryEntry>
53
-
54
- /**
55
- * All known stack extension names, derived from the registry.
56
- * Uses `(string & {})` to also accept any custom/unregistered stack name.
57
- */
58
- export type KnownStackName = keyof typeof stackExtensionRegistry | (string & {})
59
-
60
- /**
61
- * Metadata for a stack extension, defined in the `stacks` field of a stack's package.json.
62
- *
63
- * @example
64
- * ```json
65
- * {
66
- * "name": "@stacksjs/blog",
67
- * "stacks": {
68
- * "name": "blog",
69
- * "description": "Blog functionality for Stacks",
70
- * "directories": ["app", "config", "database", "resources"]
71
- * }
72
- * }
73
- * ```
74
- */
75
- export interface StackMeta {
76
- /** Short identifier for the stack (e.g. 'blog', 'commerce') */
77
- name: KnownStackName
78
- /** Human-readable description of what this stack provides */
79
- description?: string
80
- /** Semver version of the stack */
81
- version?: string
82
- /** Which top-level directories this stack provides. Defaults to all known directories if omitted. */
83
- directories?: StackDirectory[]
84
- /** Lifecycle hooks that run during install/uninstall */
85
- hooks?: {
86
- preInstall?: string
87
- postInstall?: string
88
- preUninstall?: string
89
- postUninstall?: string
90
- }
91
- }
92
-
93
- export type ConflictStrategy = 'skip' | 'overwrite' | 'backup'
94
-
95
- /** Tracks a single installed stack in the lock file */
96
- export interface StackManifestEntry {
97
- /** The npm package name (e.g. '@stacksjs/blog') */
98
- packageName: string
99
- /** The stack's short name */
100
- name: string
101
- /** Installed version */
102
- version: string
103
- /** ISO timestamp of when this stack was installed */
104
- installedAt: string
105
- /** All files that were copied into the project, relative to project root */
106
- files: string[]
107
- /** Files that were skipped due to conflicts */
108
- skipped: string[]
109
- /** The conflict strategy used during this install */
110
- conflictStrategy: ConflictStrategy
111
- }
112
-
113
- /** The stacks.lock.json file format */
114
- export interface StackLock {
115
- version: 1
116
- generatedAt: string
117
- stacks: Record<string, StackManifestEntry>
118
- }
119
-
120
- export interface StackInstallOptions {
121
- /** The stack name or package name to install */
122
- name: KnownStackName
123
- /** How to handle file conflicts. Defaults to 'skip'. */
124
- conflict?: ConflictStrategy
125
- /** Force overwrite all files (shorthand for conflict: 'overwrite') */
126
- force?: boolean
127
- /** Show what would happen without making changes */
128
- dryRun?: boolean
129
- /** Enable verbose output */
130
- verbose?: boolean
131
- }
132
-
133
- export interface StackUninstallOptions {
134
- /** The stack name or package name to uninstall */
135
- name: KnownStackName
136
- /** Force removal even if files were modified after install */
137
- force?: boolean
138
- /** Enable verbose output */
139
- verbose?: boolean
140
- }
141
-
142
- /** Display format for the `stack:list` command */
143
- export interface StackListEntry {
144
- name: string
145
- packageName: string
146
- version: string
147
- description?: string
148
- installed: boolean
149
- installedAt?: string
150
- fileCount?: number
151
- }
152
-
153
- /**
154
- * A stack extension entry in the registry (`config/stacks.ts`).
155
- *
156
- * Can be either:
157
- * - A string (the stack name or package name)
158
- * - A full object with name, URL, and GitHub repository
159
- *
160
- * @example
161
- * ```ts
162
- * export default [
163
- * 'blog', // shorthand — autocomplete from registry
164
- * '@stacksjs/commerce', // scoped package shorthand
165
- * { name: 'analytics', github: 'stacksjs/analytics-stack' },
166
- * ] satisfies StackExtensionRegistry
167
- * ```
168
- */
169
- export interface StackExtensionEntry {
170
- /** The stack name or package name */
171
- name: KnownStackName
172
- /** The stack's website URL */
173
- url?: string
174
- /** GitHub repository (e.g. 'stacksjs/blog-stack') */
175
- github?: string
176
- /** npm package name if different from the name */
177
- package?: string
178
- }
179
-
180
- /**
181
- * The registry type for `config/stacks.ts`.
182
- * Accepts both string shorthands and full objects.
183
- */
184
- export type StackExtensionRegistry = (KnownStackName | StackExtensionEntry)[]