@stacksjs/types 0.70.86 → 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/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
|
-
}
|