@stacksjs/types 0.70.86 → 0.70.88

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 (151) hide show
  1. package/package.json +19 -5
  2. package/dist/ai.d.ts +0 -37
  3. package/dist/analytics.d.ts +0 -36
  4. package/dist/api.d.ts +0 -26
  5. package/dist/app.d.ts +0 -28
  6. package/dist/attributes.d.ts +0 -1
  7. package/dist/auth.d.ts +0 -56
  8. package/dist/auto-imports.d.ts +0 -8
  9. package/dist/binary.d.ts +0 -11
  10. package/dist/cache.d.ts +0 -88
  11. package/dist/cdn.d.ts +0 -4
  12. package/dist/chat.d.ts +0 -69
  13. package/dist/cli.d.ts +0 -316
  14. package/dist/cloud.d.ts +0 -366
  15. package/dist/cms.d.ts +0 -12
  16. package/dist/commerce.d.ts +0 -14
  17. package/dist/components.d.ts +0 -9
  18. package/dist/configure.d.ts +0 -12
  19. package/dist/cors.d.ts +0 -47
  20. package/dist/cron-jobs.d.ts +0 -61
  21. package/dist/dashboard.d.ts +0 -108
  22. package/dist/database.d.ts +0 -76
  23. package/dist/dependencies.d.ts +0 -17
  24. package/dist/deploy.d.ts +0 -16
  25. package/dist/dns.d.ts +0 -362
  26. package/dist/docs.d.ts +0 -23
  27. package/dist/email.d.ts +0 -207
  28. package/dist/env.d.ts +0 -1
  29. package/dist/errors.d.ts +0 -84
  30. package/dist/events.d.ts +0 -31
  31. package/dist/exit-code.d.ts +0 -10
  32. package/dist/file-systems.d.ts +0 -60
  33. package/dist/git.d.ts +0 -60
  34. package/dist/hashing.d.ts +0 -57
  35. package/dist/helpers.d.ts +0 -1
  36. package/dist/i18n.d.ts +0 -65
  37. package/dist/index.d.ts +0 -79
  38. package/dist/index.js +0 -2
  39. package/dist/library.d.ts +0 -799
  40. package/dist/logging.d.ts +0 -15
  41. package/dist/manifest.d.ts +0 -9
  42. package/dist/marketing.d.ts +0 -12
  43. package/dist/model-dashboard-augmentation.d.ts +0 -8
  44. package/dist/model-names.d.ts +0 -1
  45. package/dist/model.d.ts +0 -256
  46. package/dist/monitoring.d.ts +0 -12
  47. package/dist/notifications.d.ts +0 -126
  48. package/dist/oauth.d.ts +0 -290
  49. package/dist/pages.d.ts +0 -10
  50. package/dist/payments.d.ts +0 -322
  51. package/dist/phone.d.ts +0 -65
  52. package/dist/ports.d.ts +0 -20
  53. package/dist/promise.d.ts +0 -1
  54. package/dist/push.d.ts +0 -108
  55. package/dist/queue.d.ts +0 -312
  56. package/dist/reactivity.d.ts +0 -1
  57. package/dist/realtime.d.ts +0 -443
  58. package/dist/request.d.ts +0 -265
  59. package/dist/response.d.ts +0 -15
  60. package/dist/router.d.ts +0 -105
  61. package/dist/saas.d.ts +0 -32
  62. package/dist/scheduler.d.ts +0 -1
  63. package/dist/search-engine.d.ts +0 -129
  64. package/dist/security.d.ts +0 -18
  65. package/dist/server.d.ts +0 -16
  66. package/dist/services.d.ts +0 -149
  67. package/dist/settings-config.d.ts +0 -9
  68. package/dist/sms.d.ts +0 -144
  69. package/dist/stack-extensions.d.ts +0 -137
  70. package/dist/stacks.d.ts +0 -45
  71. package/dist/storage.d.ts +0 -104
  72. package/dist/table-names.d.ts +0 -1
  73. package/dist/tables.d.ts +0 -34
  74. package/dist/team.d.ts +0 -7
  75. package/dist/ui.d.ts +0 -55
  76. package/dist/utils.d.ts +0 -39
  77. package/src/ai.ts +0 -41
  78. package/src/analytics.ts +0 -58
  79. package/src/api.ts +0 -77
  80. package/src/app.ts +0 -189
  81. package/src/attributes.ts +0 -5
  82. package/src/auth.ts +0 -161
  83. package/src/auto-imports.ts +0 -8
  84. package/src/binary.ts +0 -13
  85. package/src/cache.ts +0 -325
  86. package/src/cdn.ts +0 -17
  87. package/src/chat.ts +0 -193
  88. package/src/cli.ts +0 -445
  89. package/src/cloud.ts +0 -381
  90. package/src/cms.ts +0 -14
  91. package/src/commerce.ts +0 -18
  92. package/src/components.ts +0 -62
  93. package/src/configure.ts +0 -13
  94. package/src/cors.ts +0 -86
  95. package/src/cron-jobs.ts +0 -146
  96. package/src/dashboard.ts +0 -218
  97. package/src/database.ts +0 -117
  98. package/src/dependencies.ts +0 -69
  99. package/src/deploy.ts +0 -17
  100. package/src/dns.ts +0 -470
  101. package/src/docs.ts +0 -27
  102. package/src/email.ts +0 -511
  103. package/src/env.ts +0 -1
  104. package/src/errors.ts +0 -110
  105. package/src/events.ts +0 -37
  106. package/src/exit-code.ts +0 -10
  107. package/src/file-systems.ts +0 -70
  108. package/src/git.ts +0 -133
  109. package/src/hashing.ts +0 -127
  110. package/src/helpers.ts +0 -9
  111. package/src/i18n.ts +0 -121
  112. package/src/index.ts +0 -80
  113. package/src/library.ts +0 -911
  114. package/src/logging.ts +0 -62
  115. package/src/manifest.ts +0 -9
  116. package/src/marketing.ts +0 -14
  117. package/src/model-dashboard-augmentation.ts +0 -51
  118. package/src/model-names.ts +0 -1
  119. package/src/model.ts +0 -353
  120. package/src/monitoring.ts +0 -14
  121. package/src/native.ts +0 -0
  122. package/src/notifications.ts +0 -153
  123. package/src/oauth.ts +0 -488
  124. package/src/pages.ts +0 -10
  125. package/src/payments.ts +0 -440
  126. package/src/phone.ts +0 -78
  127. package/src/ports.ts +0 -20
  128. package/src/promise.ts +0 -1
  129. package/src/push.ts +0 -143
  130. package/src/queue.ts +0 -413
  131. package/src/reactivity.ts +0 -1
  132. package/src/realtime.ts +0 -584
  133. package/src/request.ts +0 -541
  134. package/src/response.ts +0 -16
  135. package/src/router.ts +0 -124
  136. package/src/saas.ts +0 -33
  137. package/src/scheduler.ts +0 -1
  138. package/src/search-engine.ts +0 -251
  139. package/src/security.ts +0 -23
  140. package/src/server.ts +0 -16
  141. package/src/services.ts +0 -211
  142. package/src/settings-config.ts +0 -10
  143. package/src/sms.ts +0 -265
  144. package/src/stack-extensions.ts +0 -184
  145. package/src/stacks.ts +0 -339
  146. package/src/storage.ts +0 -173
  147. package/src/table-names.ts +0 -1
  148. package/src/tables.ts +0 -57
  149. package/src/team.ts +0 -8
  150. package/src/ui.ts +0 -197
  151. package/src/utils.ts +0 -46
package/src/realtime.ts DELETED
@@ -1,584 +0,0 @@
1
- /**
2
- * Realtime deployment mode
3
- * - 'serverless': Uses API Gateway WebSocket + Lambda + DynamoDB
4
- * - 'server': Uses ts-broadcasting Bun WebSocket server (ECS/Fargate)
5
- */
6
- export type RealtimeMode = 'serverless' | 'server'
7
-
8
- /**
9
- * Redis adapter configuration for horizontal scaling
10
- */
11
- export interface RealtimeRedisConfig {
12
- enabled?: boolean
13
- host?: string
14
- port?: number
15
- password?: string
16
- prefix?: string
17
- cluster?: boolean
18
- sentinels?: Array<{ host: string, port: number }>
19
- sentinelName?: string
20
- }
21
-
22
- /**
23
- * Rate limiting configuration
24
- */
25
- export interface RealtimeRateLimitConfig {
26
- enabled?: boolean
27
- maxConnectionsPerIp?: number
28
- maxMessagesPerSecond?: number
29
- maxPayloadSize?: number
30
- banDuration?: number
31
- }
32
-
33
- /**
34
- * Encryption configuration
35
- */
36
- export interface RealtimeEncryptionConfig {
37
- enabled?: boolean
38
- algorithm?: 'aes-256-gcm' | 'chacha20-poly1305'
39
- keyRotationInterval?: number
40
- }
41
-
42
- /**
43
- * Webhook configuration
44
- */
45
- export interface RealtimeWebhooksConfig {
46
- enabled?: boolean
47
- url?: string
48
- events?: Array<'connection' | 'disconnection' | 'subscription' | 'message' | 'error'>
49
- headers?: Record<string, string>
50
- timeout?: number
51
- retries?: number
52
- }
53
-
54
- /**
55
- * Queue integration configuration
56
- */
57
- export interface RealtimeQueueConfig {
58
- enabled?: boolean
59
- driver?: 'redis' | 'sqs' | 'memory'
60
- batchSize?: number
61
- flushInterval?: number
62
- }
63
-
64
- /**
65
- * Load management configuration
66
- */
67
- export interface RealtimeLoadConfig {
68
- maxConnections?: number
69
- backpressureThreshold?: number
70
- messageQueueSize?: number
71
- gracefulShutdownTimeout?: number
72
- }
73
-
74
- /**
75
- * Presence channel configuration
76
- */
77
- export interface RealtimePresenceConfig {
78
- enabled?: boolean
79
- maxMembersPerChannel?: number
80
- memberInfoTtl?: number
81
- }
82
-
83
- /**
84
- * Server mode configuration (ts-broadcasting)
85
- */
86
- export interface RealtimeServerConfig {
87
- /**
88
- * Server host
89
- */
90
- host?: string
91
-
92
- /**
93
- * Server port
94
- */
95
- port?: number
96
-
97
- /**
98
- * WebSocket scheme
99
- */
100
- scheme?: 'ws' | 'wss'
101
-
102
- /**
103
- * Server driver
104
- */
105
- driver?: 'bun' | 'reverb' | 'pusher' | 'ably'
106
-
107
- /**
108
- * Redis adapter for horizontal scaling
109
- */
110
- redis?: RealtimeRedisConfig
111
-
112
- /**
113
- * Rate limiting configuration
114
- */
115
- rateLimit?: RealtimeRateLimitConfig
116
-
117
- /**
118
- * Encryption configuration
119
- */
120
- encryption?: RealtimeEncryptionConfig
121
-
122
- /**
123
- * Webhook configuration
124
- */
125
- webhooks?: RealtimeWebhooksConfig
126
-
127
- /**
128
- * Queue integration
129
- */
130
- queue?: RealtimeQueueConfig
131
-
132
- /**
133
- * Load management
134
- */
135
- loadManagement?: RealtimeLoadConfig
136
-
137
- /**
138
- * Number of server instances (for container deployment)
139
- */
140
- instances?: number
141
-
142
- /**
143
- * Auto-scaling configuration
144
- */
145
- autoScaling?: {
146
- min?: number
147
- max?: number
148
- targetCPU?: number
149
- targetMemory?: number
150
- }
151
-
152
- /**
153
- * Health check configuration
154
- */
155
- healthCheck?: {
156
- enabled?: boolean
157
- path?: string
158
- interval?: number
159
- }
160
-
161
- /**
162
- * Metrics configuration
163
- */
164
- metrics?: {
165
- enabled?: boolean
166
- port?: number
167
- path?: string
168
- }
169
-
170
- /**
171
- * TLS configuration
172
- */
173
- tls?: {
174
- enabled?: boolean
175
- cert?: string
176
- key?: string
177
- }
178
- }
179
-
180
- /**
181
- * Serverless mode configuration
182
- */
183
- export interface RealtimeServerlessConfig {
184
- /**
185
- * Connection timeout in seconds
186
- */
187
- connectionTimeout?: number
188
-
189
- /**
190
- * Idle timeout in seconds
191
- */
192
- idleTimeout?: number
193
-
194
- /**
195
- * API Gateway stage name
196
- */
197
- stageName?: string
198
-
199
- /**
200
- * Lambda memory size
201
- */
202
- memorySize?: number
203
-
204
- /**
205
- * Lambda timeout
206
- */
207
- timeout?: number
208
-
209
- /**
210
- * Lambda provisioned concurrency
211
- */
212
- provisionedConcurrency?: number
213
- }
214
-
215
- /**
216
- * Channel configuration
217
- */
218
- export interface RealtimeChannelsConfig {
219
- /**
220
- * Enable public channels
221
- */
222
- public?: boolean
223
-
224
- /**
225
- * Enable private channels
226
- */
227
- private?: boolean
228
-
229
- /**
230
- * Enable presence channels
231
- */
232
- presence?: boolean | RealtimePresenceConfig
233
- }
234
-
235
- export interface RealtimeOptions {
236
- /**
237
- * Enable realtime functionality
238
- */
239
- enabled?: boolean
240
-
241
- /**
242
- * Deployment mode: 'serverless' (API Gateway) or 'server' (ts-broadcasting)
243
- */
244
- mode?: RealtimeMode
245
-
246
- /**
247
- * The default realtime driver to use (for backward compatibility)
248
- */
249
- driver?: 'socket' | 'pusher' | 'bun' | 'reverb' | 'ably'
250
-
251
- /**
252
- * Server mode configuration (ts-broadcasting)
253
- */
254
- server?: RealtimeServerConfig
255
-
256
- /**
257
- * Serverless mode configuration (API Gateway WebSocket)
258
- */
259
- serverless?: RealtimeServerlessConfig
260
-
261
- /**
262
- * Channel configuration
263
- */
264
- channels?: RealtimeChannelsConfig
265
-
266
- /**
267
- * Configuration for the Socket.IO driver (legacy)
268
- */
269
- socket?: {
270
- /**
271
- * The port to run the Socket.IO server on
272
- */
273
- port?: number
274
-
275
- /**
276
- * The host to run the Socket.IO server on
277
- */
278
- host?: string
279
-
280
- /**
281
- * CORS configuration
282
- */
283
- cors?: {
284
- origin: string | string[]
285
- methods: string[]
286
- }
287
- }
288
-
289
- /**
290
- * Configuration for the Pusher driver
291
- */
292
- pusher?: {
293
- /**
294
- * Pusher app ID
295
- */
296
- appId: string
297
-
298
- /**
299
- * Pusher key
300
- */
301
- key: string
302
-
303
- /**
304
- * Pusher secret
305
- */
306
- secret: string
307
-
308
- /**
309
- * Pusher cluster
310
- */
311
- cluster?: string
312
-
313
- /**
314
- * Whether to use TLS
315
- */
316
- useTLS?: boolean
317
- }
318
-
319
- /**
320
- * Application credentials (for Pusher-compatible servers)
321
- */
322
- app?: {
323
- id?: string
324
- key?: string
325
- secret?: string
326
- }
327
-
328
- /**
329
- * Custom domain for WebSocket endpoint
330
- */
331
- domain?: string
332
-
333
- /**
334
- * Debug mode
335
- */
336
- debug?: boolean
337
- }
338
-
339
- export type RealtimeConfig = Partial<RealtimeOptions>
340
-
341
- export interface RealtimeInstance {
342
- event: string
343
- handle?: (data?: any) => Promise<{ channel: string, type: 'public' | 'private' | 'presence' } | void>
344
- }
345
-
346
- export type DriverType = 'socket' | 'pusher' | 'bun' | 'reverb' | 'ably'
347
- export type ChannelType = 'public' | 'private' | 'presence'
348
-
349
- export interface RealtimeDriver {
350
- connect: () => Promise<void>
351
- disconnect: () => Promise<void>
352
- subscribe: (channel: string, callback: (data: any) => void) => void
353
- unsubscribe: (channel: string) => void
354
- publish: (channel: string, data: any) => void
355
- broadcast: (channel: string, event: string, data?: any, type?: ChannelType) => void
356
- isConnected: () => boolean
357
- }
358
-
359
- export interface Broadcastable {
360
- broadcastEvent: () => Promise<void>
361
- broadcastEventNow: () => Promise<void>
362
- setChannel: (channel: string) => this
363
- excludeCurrentUser: () => this
364
- setPresenceChannel: () => this
365
- setPrivateChannel: () => this
366
- }
367
-
368
- export interface BroadcastInstance {
369
- channel?: string
370
- event?: string
371
- handle?: (data: any) => Promise<void>
372
- }
373
-
374
- /**
375
- * Realtime configuration presets for common use cases
376
- */
377
- export const RealtimePresets = {
378
- /**
379
- * Server mode presets (ts-broadcasting)
380
- */
381
- server: {
382
- /**
383
- * Development preset - minimal config, debug enabled
384
- */
385
- development: {
386
- enabled: true,
387
- mode: 'server' as const,
388
- debug: true,
389
- server: {
390
- host: 'localhost',
391
- port: 6001,
392
- scheme: 'ws' as const,
393
- driver: 'bun' as const,
394
- rateLimit: { enabled: false },
395
- healthCheck: { enabled: true, path: '/health' },
396
- },
397
- channels: { public: true, private: true, presence: true },
398
- },
399
-
400
- /**
401
- * Production preset - optimized for production workloads
402
- */
403
- production: {
404
- enabled: true,
405
- mode: 'server' as const,
406
- debug: false,
407
- server: {
408
- host: '0.0.0.0',
409
- port: 6001,
410
- scheme: 'wss' as const,
411
- driver: 'bun' as const,
412
- redis: { enabled: true, prefix: 'stacks:realtime:' },
413
- rateLimit: {
414
- enabled: true,
415
- maxConnectionsPerIp: 100,
416
- maxMessagesPerSecond: 50,
417
- maxPayloadSize: 65536,
418
- },
419
- loadManagement: {
420
- maxConnections: 10000,
421
- backpressureThreshold: 1000,
422
- messageQueueSize: 10000,
423
- gracefulShutdownTimeout: 30000,
424
- },
425
- autoScaling: { min: 2, max: 10, targetCPU: 70 },
426
- healthCheck: { enabled: true, path: '/health', interval: 30 },
427
- metrics: { enabled: true, port: 9090, path: '/metrics' },
428
- },
429
- channels: { public: true, private: true, presence: true },
430
- },
431
-
432
- /**
433
- * High performance preset - optimized for high throughput
434
- */
435
- highPerformance: {
436
- enabled: true,
437
- mode: 'server' as const,
438
- server: {
439
- driver: 'bun' as const,
440
- redis: { enabled: true, cluster: true },
441
- rateLimit: {
442
- enabled: true,
443
- maxConnectionsPerIp: 500,
444
- maxMessagesPerSecond: 200,
445
- maxPayloadSize: 131072,
446
- },
447
- loadManagement: {
448
- maxConnections: 100000,
449
- backpressureThreshold: 5000,
450
- messageQueueSize: 50000,
451
- gracefulShutdownTimeout: 60000,
452
- },
453
- autoScaling: { min: 4, max: 50, targetCPU: 60 },
454
- },
455
- },
456
-
457
- /**
458
- * Chat application preset
459
- */
460
- chat: {
461
- enabled: true,
462
- mode: 'server' as const,
463
- server: {
464
- driver: 'bun' as const,
465
- redis: { enabled: true },
466
- rateLimit: {
467
- enabled: true,
468
- maxConnectionsPerIp: 10,
469
- maxMessagesPerSecond: 20,
470
- },
471
- loadManagement: { maxConnections: 50000 },
472
- },
473
- channels: {
474
- public: true,
475
- private: true,
476
- presence: { enabled: true, maxMembersPerChannel: 500, memberInfoTtl: 60 },
477
- },
478
- },
479
-
480
- /**
481
- * Gaming preset - low latency, high throughput
482
- */
483
- gaming: {
484
- enabled: true,
485
- mode: 'server' as const,
486
- server: {
487
- driver: 'bun' as const,
488
- redis: { enabled: true, cluster: true },
489
- rateLimit: {
490
- enabled: true,
491
- maxConnectionsPerIp: 50,
492
- maxMessagesPerSecond: 100,
493
- },
494
- loadManagement: {
495
- maxConnections: 50000,
496
- backpressureThreshold: 2000,
497
- messageQueueSize: 20000,
498
- },
499
- autoScaling: { min: 2, max: 20, targetCPU: 50 },
500
- },
501
- channels: { public: true, private: true, presence: true },
502
- },
503
- },
504
-
505
- /**
506
- * Serverless mode presets (API Gateway WebSocket)
507
- */
508
- serverless: {
509
- /**
510
- * Development preset
511
- */
512
- development: {
513
- enabled: true,
514
- mode: 'serverless' as const,
515
- debug: true,
516
- serverless: {
517
- connectionTimeout: 3600,
518
- idleTimeout: 600,
519
- stageName: 'dev',
520
- memorySize: 256,
521
- timeout: 30,
522
- },
523
- channels: { public: true, private: true, presence: true },
524
- },
525
-
526
- /**
527
- * Production preset
528
- */
529
- production: {
530
- enabled: true,
531
- mode: 'serverless' as const,
532
- debug: false,
533
- serverless: {
534
- connectionTimeout: 3600,
535
- idleTimeout: 600,
536
- stageName: 'production',
537
- memorySize: 512,
538
- timeout: 30,
539
- provisionedConcurrency: 2,
540
- },
541
- channels: { public: true, private: true, presence: true },
542
- },
543
-
544
- /**
545
- * Notifications preset - simple push notifications
546
- */
547
- notifications: {
548
- enabled: true,
549
- mode: 'serverless' as const,
550
- serverless: {
551
- connectionTimeout: 7200,
552
- idleTimeout: 1800,
553
- memorySize: 256,
554
- timeout: 15,
555
- },
556
- channels: { public: true, private: true, presence: false },
557
- },
558
- },
559
- } as const
560
-
561
- /**
562
- * Options for the emit function
563
- */
564
- export interface EmitOptions {
565
- /**
566
- * Make this a private channel (requires authentication)
567
- */
568
- private?: boolean
569
-
570
- /**
571
- * Make this a presence channel (tracks who's online)
572
- */
573
- presence?: boolean
574
-
575
- /**
576
- * Exclude specific user IDs from receiving this event
577
- */
578
- exclude?: string | string[]
579
-
580
- /**
581
- * Specify which driver to use (overrides default)
582
- */
583
- driver?: DriverType
584
- }