@stacksjs/types 0.70.88 → 0.70.91

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 (77) hide show
  1. package/dist/ai.d.ts +37 -0
  2. package/dist/analytics.d.ts +36 -0
  3. package/dist/api.d.ts +26 -0
  4. package/dist/app.d.ts +28 -0
  5. package/dist/attributes.d.ts +1 -0
  6. package/dist/auth.d.ts +62 -0
  7. package/dist/auto-imports.d.ts +8 -0
  8. package/dist/binary.d.ts +11 -0
  9. package/dist/cache.d.ts +88 -0
  10. package/dist/cdn.d.ts +4 -0
  11. package/dist/chat.d.ts +69 -0
  12. package/dist/cli.d.ts +316 -0
  13. package/dist/cloud.d.ts +366 -0
  14. package/dist/cms.d.ts +12 -0
  15. package/dist/commerce.d.ts +14 -0
  16. package/dist/components.d.ts +9 -0
  17. package/dist/configure.d.ts +12 -0
  18. package/dist/cors.d.ts +47 -0
  19. package/dist/cron-jobs.d.ts +61 -0
  20. package/dist/dashboard.d.ts +108 -0
  21. package/dist/database.d.ts +76 -0
  22. package/dist/dependencies.d.ts +17 -0
  23. package/dist/deploy.d.ts +16 -0
  24. package/dist/dns.d.ts +362 -0
  25. package/dist/docs.d.ts +23 -0
  26. package/dist/email.d.ts +207 -0
  27. package/dist/env.d.ts +1 -0
  28. package/dist/errors.d.ts +84 -0
  29. package/dist/events.d.ts +31 -0
  30. package/dist/exit-code.d.ts +10 -0
  31. package/dist/feature-flags.d.ts +17 -0
  32. package/dist/file-systems.d.ts +60 -0
  33. package/dist/git.d.ts +60 -0
  34. package/dist/hashing.d.ts +57 -0
  35. package/dist/helpers.d.ts +1 -0
  36. package/dist/i18n.d.ts +65 -0
  37. package/dist/index.d.ts +80 -0
  38. package/dist/index.js +2 -0
  39. package/dist/library.d.ts +799 -0
  40. package/dist/logging.d.ts +15 -0
  41. package/dist/manifest.d.ts +9 -0
  42. package/dist/marketing.d.ts +12 -0
  43. package/dist/model-dashboard-augmentation.d.ts +8 -0
  44. package/dist/model-names.d.ts +1 -0
  45. package/dist/model.d.ts +256 -0
  46. package/dist/monitoring.d.ts +12 -0
  47. package/dist/notifications.d.ts +126 -0
  48. package/dist/oauth.d.ts +290 -0
  49. package/dist/pages.d.ts +10 -0
  50. package/dist/payments.d.ts +322 -0
  51. package/dist/phone.d.ts +65 -0
  52. package/dist/ports.d.ts +20 -0
  53. package/dist/promise.d.ts +1 -0
  54. package/dist/push.d.ts +108 -0
  55. package/dist/queue.d.ts +312 -0
  56. package/dist/reactivity.d.ts +1 -0
  57. package/dist/realtime.d.ts +443 -0
  58. package/dist/request.d.ts +265 -0
  59. package/dist/response.d.ts +15 -0
  60. package/dist/router.d.ts +105 -0
  61. package/dist/saas.d.ts +32 -0
  62. package/dist/scheduler.d.ts +1 -0
  63. package/dist/search-engine.d.ts +129 -0
  64. package/dist/security.d.ts +18 -0
  65. package/dist/server.d.ts +16 -0
  66. package/dist/services.d.ts +149 -0
  67. package/dist/settings-config.d.ts +9 -0
  68. package/dist/sms.d.ts +144 -0
  69. package/dist/stack-extensions.d.ts +137 -0
  70. package/dist/stacks.d.ts +46 -0
  71. package/dist/storage.d.ts +104 -0
  72. package/dist/table-names.d.ts +1 -0
  73. package/dist/tables.d.ts +34 -0
  74. package/dist/team.d.ts +7 -0
  75. package/dist/ui.d.ts +55 -0
  76. package/dist/utils.d.ts +39 -0
  77. package/package.json +3 -3
package/dist/push.d.ts ADDED
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Push Notification Configuration Types
3
+ * Supports APNs (Apple) and FCM (Firebase/Google)
4
+ */
5
+ /**
6
+ * Apple Push Notification Service (APNs) configuration
7
+ */
8
+ export declare interface APNsProviderConfig {
9
+ keyId: string
10
+ teamId: string
11
+ privateKey: string
12
+ bundleId: string
13
+ production?: boolean
14
+ }
15
+ /**
16
+ * Firebase Cloud Messaging (FCM) configuration
17
+ */
18
+ export declare interface FCMProviderConfig {
19
+ projectId: string
20
+ clientEmail: string
21
+ privateKey: string
22
+ }
23
+ /**
24
+ * Push notification provider configuration
25
+ */
26
+ export declare interface PushProviderOptions {
27
+ apns?: APNsProviderConfig
28
+ fcm?: FCMProviderConfig
29
+ }
30
+ /**
31
+ * Push notification options
32
+ */
33
+ export declare interface PushOptions {
34
+ enabled: boolean
35
+ defaultProvider?: 'apns' | 'fcm'
36
+ providers: PushProviderOptions
37
+ }
38
+ // Legacy types for backwards compatibility
39
+ export declare interface FCMPushNotificationOptions {
40
+ eventName: string
41
+ to: {
42
+ subscriberId: string
43
+ }
44
+ payload: {
45
+ deviceTokens: Array<string>
46
+ badge: boolean
47
+ clickAction: string
48
+ color: string
49
+ icon: string
50
+ sound: string
51
+ }
52
+ }
53
+ export declare interface ExpoPushNotificationOptions {
54
+ eventName: string
55
+ to: {
56
+ subscriberId: string
57
+ }
58
+ payload: {
59
+ to: string[]
60
+ data: object
61
+ title: string
62
+ body: string
63
+ ttl: number
64
+ expiration: number
65
+ priority: 'default' | 'normal' | 'high'
66
+ subtitle: string
67
+ sound: 'default' | null
68
+ badge: number
69
+ channelId: string
70
+ categoryId: string
71
+ mutableContent: boolean
72
+ }
73
+ }
74
+ /**
75
+ * Result from a push notification operation
76
+ */
77
+ export declare interface PushResult {
78
+ success: boolean
79
+ provider: string
80
+ message: string
81
+ messageId?: string
82
+ data?: Record<string, any>
83
+ }
84
+ /**
85
+ * Push message structure
86
+ */
87
+ export declare interface PushMessage {
88
+ to: string | string[]
89
+ title?: string
90
+ body: string
91
+ data?: Record<string, any>
92
+ badge?: number
93
+ sound?: 'default' | null
94
+ priority?: 'default' | 'normal' | 'high'
95
+ }
96
+ /**
97
+ * Push ticket from Expo
98
+ */
99
+ export declare interface PushTicket {
100
+ id?: string
101
+ status: 'ok' | 'error'
102
+ message?: string
103
+ details?: Record<string, any>
104
+ }
105
+ /**
106
+ * Push notification configuration type
107
+ */
108
+ export type PushConfig = Partial<PushOptions>;
@@ -0,0 +1,312 @@
1
+ import type { DeepPartial } from './utils';
2
+ import type { JobOptions } from './cron-jobs';
3
+ /**
4
+ * Queue presets for common configurations
5
+ */
6
+ export declare const QueuePresets: {
7
+ /**
8
+ * Development preset - uses sync driver
9
+ */
10
+ development: {
11
+ default: 'sync';
12
+ connections: {
13
+ sync: {
14
+ driver: 'sync'
15
+ }
16
+ };
17
+ failed: {
18
+ driver: 'database';
19
+ table: 'failed_jobs'
20
+ }
21
+ };
22
+ /**
23
+ * Production preset - uses Redis with bun-queue
24
+ */
25
+ production: {
26
+ default: 'redis';
27
+ connections: {
28
+ redis: {
29
+ driver: 'redis';
30
+ prefix: 'stacks:queue';
31
+ concurrency: 5;
32
+ distributedLock: true;
33
+ metrics: {
34
+ enabled: true
35
+ };
36
+ defaultDeadLetterOptions: {
37
+ enabled: true;
38
+ maxRetries: 3
39
+ }
40
+ }
41
+ };
42
+ failed: {
43
+ driver: 'redis';
44
+ prefix: 'stacks:failed'
45
+ };
46
+ worker: {
47
+ concurrency: 5;
48
+ shutdownTimeout: 30000
49
+ }
50
+ };
51
+ /**
52
+ * High performance preset - optimized for throughput
53
+ */
54
+ highPerformance: {
55
+ default: 'redis';
56
+ connections: {
57
+ redis: {
58
+ driver: 'redis';
59
+ prefix: 'stacks:queue';
60
+ concurrency: 20;
61
+ distributedLock: true;
62
+ metrics: {
63
+ enabled: true;
64
+ collectInterval: 5000
65
+ };
66
+ horizontalScaling: {
67
+ enabled: true;
68
+ maxWorkersPerInstance: 20;
69
+ jobsPerWorker: 50
70
+ };
71
+ defaultDeadLetterOptions: {
72
+ enabled: true;
73
+ maxRetries: 5
74
+ }
75
+ }
76
+ };
77
+ failed: {
78
+ driver: 'redis';
79
+ prefix: 'stacks:failed'
80
+ };
81
+ worker: {
82
+ concurrency: 20;
83
+ shutdownTimeout: 60000
84
+ }
85
+ };
86
+ /**
87
+ * Database preset - uses database driver
88
+ */
89
+ database: {
90
+ default: 'database';
91
+ connections: {
92
+ database: {
93
+ driver: 'database';
94
+ table: 'jobs';
95
+ queue: 'default';
96
+ retryAfter: 90
97
+ }
98
+ };
99
+ failed: {
100
+ driver: 'database';
101
+ table: 'failed_jobs'
102
+ }
103
+ }
104
+ };
105
+ /**
106
+ * Rate limiter configuration
107
+ */
108
+ export declare interface QueueRateLimiter {
109
+ max: number
110
+ duration: number
111
+ keyPrefix?: string | ((_data: any) => string)
112
+ }
113
+ /**
114
+ * Backoff configuration for job retries
115
+ */
116
+ export declare interface QueueBackoff {
117
+ type: 'fixed' | 'exponential'
118
+ delay: number
119
+ }
120
+ /**
121
+ * Dead letter queue configuration
122
+ */
123
+ export declare interface DeadLetterQueueConfig {
124
+ enabled?: boolean
125
+ queueSuffix?: string
126
+ maxRetries?: number
127
+ processFailed?: boolean
128
+ removeFromOriginalQueue?: boolean
129
+ }
130
+ /**
131
+ * Horizontal scaling configuration
132
+ */
133
+ export declare interface HorizontalScalingConfig {
134
+ enabled?: boolean
135
+ instanceId?: string
136
+ maxWorkersPerInstance?: number
137
+ jobsPerWorker?: number
138
+ leaderElection?: {
139
+ heartbeatInterval?: number
140
+ leaderTimeout?: number
141
+ }
142
+ workCoordination?: {
143
+ pollInterval?: number
144
+ keyPrefix?: string
145
+ }
146
+ }
147
+ /**
148
+ * Metrics configuration
149
+ */
150
+ export declare interface QueueMetricsConfig {
151
+ enabled: boolean
152
+ collectInterval?: number
153
+ }
154
+ /**
155
+ * Redis connection configuration for queue
156
+ */
157
+ export declare interface QueueRedisConfig {
158
+ url?: string
159
+ host?: string
160
+ port?: number
161
+ password?: string
162
+ db?: number
163
+ prefix?: string
164
+ }
165
+ /**
166
+ * Job options for queue operations
167
+ */
168
+ export declare interface QueueJobOptions {
169
+ delay?: number
170
+ attempts?: number
171
+ backoff?: QueueBackoff
172
+ removeOnComplete?: boolean | number
173
+ removeOnFail?: boolean | number
174
+ priority?: number
175
+ lifo?: boolean
176
+ timeout?: number
177
+ jobId?: string
178
+ dependsOn?: string | string[]
179
+ keepJobs?: boolean
180
+ deadLetter?: boolean | DeadLetterQueueConfig
181
+ repeat?: {
182
+ every?: number
183
+ limit?: number
184
+ cron?: string
185
+ tz?: string
186
+ startDate?: Date | number
187
+ endDate?: Date | number
188
+ }
189
+ }
190
+ /**
191
+ * Redis driver connection configuration
192
+ */
193
+ export declare interface RedisConnectionConfig {
194
+ driver: 'redis'
195
+ redis?: QueueRedisConfig
196
+ prefix?: string
197
+ defaultJobOptions?: QueueJobOptions
198
+ limiter?: QueueRateLimiter
199
+ metrics?: QueueMetricsConfig
200
+ stalledJobCheckInterval?: number
201
+ maxStalledJobRetries?: number
202
+ distributedLock?: boolean
203
+ defaultDeadLetterOptions?: DeadLetterQueueConfig
204
+ horizontalScaling?: HorizontalScalingConfig
205
+ logLevel?: QueueLogLevel
206
+ concurrency?: number
207
+ }
208
+ /**
209
+ * Database driver connection configuration
210
+ */
211
+ export declare interface DatabaseConnectionConfig {
212
+ driver: 'database'
213
+ table?: string
214
+ queue?: string
215
+ retryAfter?: number
216
+ }
217
+ /**
218
+ * SQS driver connection configuration
219
+ */
220
+ export declare interface SqsConnectionConfig {
221
+ driver: 'sqs'
222
+ key?: string
223
+ secret?: string
224
+ prefix?: string
225
+ suffix?: string
226
+ queue?: string
227
+ region?: string
228
+ }
229
+ /**
230
+ * Sync driver connection configuration
231
+ */
232
+ export declare interface SyncConnectionConfig {
233
+ driver: 'sync'
234
+ }
235
+ /**
236
+ * Memory driver connection configuration
237
+ */
238
+ export declare interface MemoryConnectionConfig {
239
+ driver: 'memory'
240
+ maxSize?: number
241
+ }
242
+ export declare interface Dispatchable {
243
+ dispatch: () => Promise<void>
244
+ dispatchNow: () => Promise<void>
245
+ delay: (seconds: number) => this
246
+ afterResponse: () => this
247
+ chain: (jobs: Dispatchable[]) => this
248
+ onQueue: (queue: string) => this
249
+ }
250
+ export declare interface QueueOptions {
251
+ enabled?: boolean
252
+ env?: string[]
253
+ default: QueueDriver
254
+ connections: {
255
+ sync?: SyncConnectionConfig
256
+ database?: DatabaseConnectionConfig
257
+ redis?: RedisConnectionConfig
258
+ sqs?: SqsConnectionConfig
259
+ memory?: MemoryConnectionConfig
260
+ [key: string]: QueueConnectionConfig | undefined
261
+ }
262
+ failed: {
263
+ driver: 'database' | 'redis'
264
+ database?: string
265
+ table?: string
266
+ prefix?: string
267
+ }
268
+ batching?: {
269
+ driver: 'database' | 'redis'
270
+ table?: string
271
+ prefix?: string
272
+ }
273
+ worker?: {
274
+ concurrency?: number
275
+ shutdownTimeout?: number
276
+ }
277
+ }
278
+ // @ts-ignore - QueueOption extends JobOptions with compatible overrides
279
+ export declare interface QueueOption extends JobOptions {
280
+ delay?: number
281
+ payload?: any
282
+ afterResponse?: any
283
+ context?: string
284
+ maxTries?: number
285
+ chainedJobs?: Dispatchable[]
286
+ queue?: string
287
+ priority?: number
288
+ backoff?: number[] | QueueBackoff
289
+ timeout?: number
290
+ immediate?: boolean
291
+ }
292
+ /**
293
+ * Queue driver type
294
+ */
295
+ export type QueueDriver = 'sync' | 'database' | 'redis' | 'sqs' | 'memory';
296
+ /**
297
+ * Job status
298
+ */
299
+ export type JobStatus = 'waiting' | 'active' | 'completed' | 'failed' | 'delayed' | 'paused';
300
+ /**
301
+ * Log level for queue operations
302
+ */
303
+ export type QueueLogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
304
+ /**
305
+ * Queue connection configuration
306
+ */
307
+ export type QueueConnectionConfig = | RedisConnectionConfig
308
+ | DatabaseConnectionConfig
309
+ | SqsConnectionConfig
310
+ | SyncConnectionConfig
311
+ | MemoryConnectionConfig;
312
+ export type QueueConfig = DeepPartial<QueueOptions>;
@@ -0,0 +1 @@
1
+ export type { Ref } from '@stacksjs/stx';