@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.
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/queue.ts DELETED
@@ -1,413 +0,0 @@
1
- import type { JobOptions } from './cron-jobs'
2
- import type { DeepPartial } from './utils'
3
-
4
- /**
5
- * Queue driver type
6
- */
7
- export type QueueDriver = 'sync' | 'database' | 'redis' | 'sqs' | 'memory'
8
-
9
- /**
10
- * Job status
11
- */
12
- export type JobStatus = 'waiting' | 'active' | 'completed' | 'failed' | 'delayed' | 'paused'
13
-
14
- /**
15
- * Log level for queue operations
16
- */
17
- export type QueueLogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'
18
-
19
- /**
20
- * Rate limiter configuration
21
- */
22
- export interface QueueRateLimiter {
23
- /** Maximum number of jobs to process */
24
- max: number
25
- /** Duration in milliseconds */
26
- duration: number
27
- /** Key prefix for rate limiting */
28
- keyPrefix?: string | ((_data: any) => string)
29
- }
30
-
31
- /**
32
- * Backoff configuration for job retries
33
- */
34
- export interface QueueBackoff {
35
- /** Backoff type */
36
- type: 'fixed' | 'exponential'
37
- /** Delay in milliseconds */
38
- delay: number
39
- }
40
-
41
- /**
42
- * Dead letter queue configuration
43
- */
44
- export interface DeadLetterQueueConfig {
45
- /** Enable dead letter queue */
46
- enabled?: boolean
47
- /** Suffix for dead letter queue name */
48
- queueSuffix?: string
49
- /** Maximum retries before moving to dead letter queue */
50
- maxRetries?: number
51
- /** Automatically process failed jobs */
52
- processFailed?: boolean
53
- /** Remove from original queue's failed list */
54
- removeFromOriginalQueue?: boolean
55
- }
56
-
57
- /**
58
- * Horizontal scaling configuration
59
- */
60
- export interface HorizontalScalingConfig {
61
- /** Enable horizontal scaling */
62
- enabled?: boolean
63
- /** Instance identifier */
64
- instanceId?: string
65
- /** Maximum workers per instance */
66
- maxWorkersPerInstance?: number
67
- /** Jobs per worker */
68
- jobsPerWorker?: number
69
- /** Leader election configuration */
70
- leaderElection?: {
71
- heartbeatInterval?: number
72
- leaderTimeout?: number
73
- }
74
- /** Work coordination configuration */
75
- workCoordination?: {
76
- pollInterval?: number
77
- keyPrefix?: string
78
- }
79
- }
80
-
81
- /**
82
- * Metrics configuration
83
- */
84
- export interface QueueMetricsConfig {
85
- /** Enable metrics collection */
86
- enabled: boolean
87
- /** Collection interval in milliseconds */
88
- collectInterval?: number
89
- }
90
-
91
- /**
92
- * Redis connection configuration for queue
93
- */
94
- export interface QueueRedisConfig {
95
- /** Redis URL */
96
- url?: string
97
- /** Redis host */
98
- host?: string
99
- /** Redis port */
100
- port?: number
101
- /** Redis password */
102
- password?: string
103
- /** Redis database number */
104
- db?: number
105
- /** Key prefix */
106
- prefix?: string
107
- }
108
-
109
- /**
110
- * Job options for queue operations
111
- */
112
- export interface QueueJobOptions {
113
- /** Delay in milliseconds before processing */
114
- delay?: number
115
- /** Number of retry attempts */
116
- attempts?: number
117
- /** Backoff configuration */
118
- backoff?: QueueBackoff
119
- /** Remove job on completion */
120
- removeOnComplete?: boolean | number
121
- /** Remove job on failure */
122
- removeOnFail?: boolean | number
123
- /** Job priority (higher = processed first) */
124
- priority?: number
125
- /** Process in LIFO order */
126
- lifo?: boolean
127
- /** Job timeout in milliseconds */
128
- timeout?: number
129
- /** Custom job ID */
130
- jobId?: string
131
- /** Job dependencies */
132
- dependsOn?: string | string[]
133
- /** Keep jobs in history */
134
- keepJobs?: boolean
135
- /** Dead letter queue options */
136
- deadLetter?: boolean | DeadLetterQueueConfig
137
- /** Repeat configuration for recurring jobs */
138
- repeat?: {
139
- /** Repeat every N milliseconds */
140
- every?: number
141
- /** Maximum number of repeats */
142
- limit?: number
143
- /** Cron expression */
144
- cron?: string
145
- /** Timezone */
146
- tz?: string
147
- /** Start date */
148
- startDate?: Date | number
149
- /** End date */
150
- endDate?: Date | number
151
- }
152
- }
153
-
154
- /**
155
- * Redis driver connection configuration
156
- */
157
- export interface RedisConnectionConfig {
158
- driver: 'redis'
159
- /** Redis configuration */
160
- redis?: QueueRedisConfig
161
- /** Key prefix for queue keys */
162
- prefix?: string
163
- /** Default job options */
164
- defaultJobOptions?: QueueJobOptions
165
- /** Rate limiter configuration */
166
- limiter?: QueueRateLimiter
167
- /** Metrics configuration */
168
- metrics?: QueueMetricsConfig
169
- /** Stalled job check interval in milliseconds */
170
- stalledJobCheckInterval?: number
171
- /** Maximum stalled job retries */
172
- maxStalledJobRetries?: number
173
- /** Enable distributed locking */
174
- distributedLock?: boolean
175
- /** Default dead letter queue options */
176
- defaultDeadLetterOptions?: DeadLetterQueueConfig
177
- /** Horizontal scaling configuration */
178
- horizontalScaling?: HorizontalScalingConfig
179
- /** Log level */
180
- logLevel?: QueueLogLevel
181
- /** Worker concurrency */
182
- concurrency?: number
183
- }
184
-
185
- /**
186
- * Database driver connection configuration
187
- */
188
- export interface DatabaseConnectionConfig {
189
- driver: 'database'
190
- /** Database table name */
191
- table?: string
192
- /** Queue name */
193
- queue?: string
194
- /** Retry after seconds */
195
- retryAfter?: number
196
- }
197
-
198
- /**
199
- * SQS driver connection configuration
200
- */
201
- export interface SqsConnectionConfig {
202
- driver: 'sqs'
203
- /** AWS access key */
204
- key?: string
205
- /** AWS secret key */
206
- secret?: string
207
- /** Queue URL prefix */
208
- prefix?: string
209
- /** Queue URL suffix */
210
- suffix?: string
211
- /** Queue name */
212
- queue?: string
213
- /** AWS region */
214
- region?: string
215
- }
216
-
217
- /**
218
- * Sync driver connection configuration
219
- */
220
- export interface SyncConnectionConfig {
221
- driver: 'sync'
222
- }
223
-
224
- /**
225
- * Memory driver connection configuration
226
- */
227
- export interface MemoryConnectionConfig {
228
- driver: 'memory'
229
- /** Maximum queue size */
230
- maxSize?: number
231
- }
232
-
233
- /**
234
- * Queue connection configuration
235
- */
236
- export type QueueConnectionConfig =
237
- | RedisConnectionConfig
238
- | DatabaseConnectionConfig
239
- | SqsConnectionConfig
240
- | SyncConnectionConfig
241
- | MemoryConnectionConfig
242
-
243
- export interface Dispatchable {
244
- dispatch: () => Promise<void>
245
- dispatchNow: () => Promise<void>
246
- delay: (seconds: number) => this
247
- afterResponse: () => this
248
- chain: (jobs: Dispatchable[]) => this
249
- onQueue: (queue: string) => this
250
- }
251
-
252
- export interface QueueOptions {
253
- /**
254
- * Top-level feature gate. When `false`, the queue runtime is skipped at
255
- * boot (no Job/FailedJob model load, no queue worker startup). Missing or
256
- * `true` means the queue feature is on.
257
- */
258
- enabled?: boolean
259
- /** Optional deploy-target gate, e.g. `['production']`. */
260
- env?: string[]
261
- /** Default queue driver */
262
- default: QueueDriver
263
- /** Queue connections */
264
- connections: {
265
- sync?: SyncConnectionConfig
266
- database?: DatabaseConnectionConfig
267
- redis?: RedisConnectionConfig
268
- sqs?: SqsConnectionConfig
269
- memory?: MemoryConnectionConfig
270
- [key: string]: QueueConnectionConfig | undefined
271
- }
272
- /** Failed jobs configuration */
273
- failed: {
274
- driver: 'database' | 'redis'
275
- database?: string
276
- table?: string
277
- prefix?: string
278
- }
279
- /** Batching configuration */
280
- batching?: {
281
- driver: 'database' | 'redis'
282
- table?: string
283
- prefix?: string
284
- }
285
- /** Worker configuration */
286
- worker?: {
287
- /** Number of concurrent workers */
288
- concurrency?: number
289
- /** Graceful shutdown timeout in milliseconds */
290
- shutdownTimeout?: number
291
- }
292
- }
293
-
294
- // @ts-ignore - QueueOption extends JobOptions with compatible overrides
295
- export interface QueueOption extends JobOptions {
296
- delay?: number
297
- payload?: any
298
- afterResponse?: any
299
- context?: string
300
- maxTries?: number
301
- chainedJobs?: Dispatchable[]
302
- /** Queue name to dispatch to */
303
- queue?: string
304
- /** Job priority */
305
- priority?: number
306
- /** Backoff configuration */
307
- backoff?: number[] | QueueBackoff
308
- /** Job timeout */
309
- timeout?: number
310
- /** Immediate execution */
311
- immediate?: boolean
312
- }
313
-
314
- export type QueueConfig = DeepPartial<QueueOptions>
315
-
316
- /**
317
- * Queue presets for common configurations
318
- */
319
- export const QueuePresets = {
320
- /**
321
- * Development preset - uses sync driver
322
- */
323
- development: {
324
- default: 'sync' as const,
325
- connections: {
326
- sync: { driver: 'sync' as const },
327
- },
328
- failed: {
329
- driver: 'database' as const,
330
- table: 'failed_jobs',
331
- },
332
- },
333
-
334
- /**
335
- * Production preset - uses Redis with bun-queue
336
- */
337
- production: {
338
- default: 'redis' as const,
339
- connections: {
340
- redis: {
341
- driver: 'redis' as const,
342
- prefix: 'stacks:queue',
343
- concurrency: 5,
344
- distributedLock: true,
345
- metrics: { enabled: true },
346
- defaultDeadLetterOptions: {
347
- enabled: true,
348
- maxRetries: 3,
349
- },
350
- },
351
- },
352
- failed: {
353
- driver: 'redis' as const,
354
- prefix: 'stacks:failed',
355
- },
356
- worker: {
357
- concurrency: 5,
358
- shutdownTimeout: 30000,
359
- },
360
- },
361
-
362
- /**
363
- * High performance preset - optimized for throughput
364
- */
365
- highPerformance: {
366
- default: 'redis' as const,
367
- connections: {
368
- redis: {
369
- driver: 'redis' as const,
370
- prefix: 'stacks:queue',
371
- concurrency: 20,
372
- distributedLock: true,
373
- metrics: { enabled: true, collectInterval: 5000 },
374
- horizontalScaling: {
375
- enabled: true,
376
- maxWorkersPerInstance: 20,
377
- jobsPerWorker: 50,
378
- },
379
- defaultDeadLetterOptions: {
380
- enabled: true,
381
- maxRetries: 5,
382
- },
383
- },
384
- },
385
- failed: {
386
- driver: 'redis' as const,
387
- prefix: 'stacks:failed',
388
- },
389
- worker: {
390
- concurrency: 20,
391
- shutdownTimeout: 60000,
392
- },
393
- },
394
-
395
- /**
396
- * Database preset - uses database driver
397
- */
398
- database: {
399
- default: 'database' as const,
400
- connections: {
401
- database: {
402
- driver: 'database' as const,
403
- table: 'jobs',
404
- queue: 'default',
405
- retryAfter: 90,
406
- },
407
- },
408
- failed: {
409
- driver: 'database' as const,
410
- table: 'failed_jobs',
411
- },
412
- },
413
- } as const
package/src/reactivity.ts DELETED
@@ -1 +0,0 @@
1
- export type { Ref } from '@stacksjs/stx'