@stacksjs/types 0.70.23 → 0.70.26

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 (161) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/src/ai.d.ts +37 -0
  3. package/dist/src/analytics.d.ts +36 -0
  4. package/dist/src/api.d.ts +26 -0
  5. package/dist/src/app.d.ts +28 -0
  6. package/dist/src/attributes.d.ts +1 -0
  7. package/dist/src/auth.d.ts +49 -0
  8. package/dist/src/auto-imports.d.ts +8 -0
  9. package/dist/{binary.d.ts → src/binary.d.ts} +4 -1
  10. package/dist/src/cache.d.ts +79 -0
  11. package/dist/{cdn.d.ts → src/cdn.d.ts} +1 -1
  12. package/dist/{chat.d.ts → src/chat.d.ts} +29 -48
  13. package/dist/src/cli.d.ts +308 -0
  14. package/dist/{cloud.d.ts → src/cloud.d.ts} +81 -26
  15. package/dist/{components.d.ts → src/components.d.ts} +1 -4
  16. package/dist/{configure.d.ts → src/configure.d.ts} +1 -1
  17. package/dist/{cron-jobs.d.ts → src/cron-jobs.d.ts} +33 -37
  18. package/dist/src/dashboard.d.ts +33 -0
  19. package/dist/{database.d.ts → src/database.d.ts} +20 -12
  20. package/dist/src/dependencies.d.ts +17 -0
  21. package/dist/src/deploy.d.ts +16 -0
  22. package/dist/{dns.d.ts → src/dns.d.ts} +59 -59
  23. package/dist/src/docs.d.ts +23 -0
  24. package/dist/src/email.d.ts +201 -0
  25. package/dist/src/env.d.ts +1 -0
  26. package/dist/{errors.d.ts → src/errors.d.ts} +17 -24
  27. package/dist/src/events.d.ts +31 -0
  28. package/dist/src/exit-code.d.ts +10 -0
  29. package/dist/{file-systems.d.ts → src/file-systems.d.ts} +10 -6
  30. package/dist/{git.d.ts → src/git.d.ts} +9 -6
  31. package/dist/src/hashing.d.ts +57 -0
  32. package/dist/src/helpers.d.ts +1 -0
  33. package/dist/src/i18n.d.ts +65 -0
  34. package/dist/src/index.d.ts +70 -0
  35. package/dist/{library.d.ts → src/library.d.ts} +31 -33
  36. package/dist/src/logging.d.ts +12 -0
  37. package/dist/{manifest.d.ts → src/manifest.d.ts} +4 -1
  38. package/dist/src/model-names.d.ts +1 -0
  39. package/dist/src/model.d.ts +251 -0
  40. package/dist/{notifications.d.ts → src/notifications.d.ts} +1 -26
  41. package/dist/src/oauth.d.ts +290 -0
  42. package/dist/{pages.d.ts → src/pages.d.ts} +1 -1
  43. package/dist/src/payments.d.ts +322 -0
  44. package/dist/src/phone.d.ts +52 -0
  45. package/dist/src/ports.d.ts +20 -0
  46. package/dist/src/promise.d.ts +1 -0
  47. package/dist/src/push.d.ts +108 -0
  48. package/dist/src/queue.d.ts +310 -0
  49. package/dist/src/reactivity.d.ts +1 -0
  50. package/dist/src/realtime.d.ts +443 -0
  51. package/dist/src/request.d.ts +154 -0
  52. package/dist/{response.d.ts → src/response.d.ts} +1 -1
  53. package/dist/src/router.d.ts +105 -0
  54. package/dist/{saas.d.ts → src/saas.d.ts} +2 -2
  55. package/dist/src/scheduler.d.ts +1 -0
  56. package/dist/{search-engine.d.ts → src/search-engine.d.ts} +41 -45
  57. package/dist/{security.d.ts → src/security.d.ts} +4 -8
  58. package/dist/{server.d.ts → src/server.d.ts} +1 -1
  59. package/dist/src/services.d.ts +140 -0
  60. package/dist/{settings-config.d.ts → src/settings-config.d.ts} +1 -1
  61. package/dist/src/sms.d.ts +144 -0
  62. package/dist/src/stack-extensions.d.ts +137 -0
  63. package/dist/src/stacks.d.ts +40 -0
  64. package/dist/src/storage.d.ts +105 -0
  65. package/dist/src/table-names.d.ts +1 -0
  66. package/dist/src/tables.d.ts +34 -0
  67. package/dist/src/team.d.ts +7 -0
  68. package/dist/src/ui.d.ts +55 -0
  69. package/dist/src/utils.d.ts +39 -0
  70. package/package.json +13 -32
  71. package/src/ai.ts +20 -6
  72. package/src/analytics.ts +38 -1
  73. package/src/app.ts +38 -0
  74. package/src/attributes.ts +5 -1
  75. package/src/auth.ts +122 -0
  76. package/src/auto-imports.ts +8 -1
  77. package/src/cache.ts +226 -69
  78. package/src/chat.ts +0 -20
  79. package/src/cli.ts +24 -9
  80. package/src/cloud.ts +40 -1
  81. package/src/components.ts +3 -5
  82. package/src/cron-jobs.ts +1 -1
  83. package/src/dashboard.ts +40 -0
  84. package/src/database.ts +18 -2
  85. package/src/dns.ts +1 -1
  86. package/src/docs.ts +3 -3
  87. package/src/email.ts +303 -13
  88. package/src/errors.ts +2 -3
  89. package/src/events.ts +10 -5
  90. package/src/git.ts +3 -3
  91. package/src/hashing.ts +15 -19
  92. package/src/i18n.ts +105 -3
  93. package/src/index.ts +9 -5
  94. package/src/library.ts +0 -5
  95. package/src/model-names.ts +1 -1
  96. package/src/model.ts +87 -10
  97. package/src/oauth.ts +488 -0
  98. package/src/payments.ts +370 -27
  99. package/src/phone.ts +62 -0
  100. package/src/push.ts +107 -0
  101. package/src/queue.ts +386 -28
  102. package/src/reactivity.ts +1 -1
  103. package/src/realtime.ts +584 -0
  104. package/src/request.ts +344 -22
  105. package/src/router.ts +62 -4
  106. package/src/search-engine.ts +13 -13
  107. package/src/services.ts +100 -5
  108. package/src/sms.ts +263 -3
  109. package/src/stack-extensions.ts +184 -0
  110. package/src/stacks.ts +34 -4
  111. package/src/storage.ts +140 -6
  112. package/src/table-names.ts +1 -1
  113. package/src/ui.ts +20 -12
  114. package/src/utils.ts +1 -1
  115. package/dist/ai.d.ts +0 -20
  116. package/dist/analytics.d.ts +0 -13
  117. package/dist/api.d.ts +0 -26
  118. package/dist/app.d.ts +0 -32
  119. package/dist/attributes.d.ts +0 -1
  120. package/dist/auto-imports.d.ts +0 -1
  121. package/dist/build.d.ts +0 -2
  122. package/dist/cache.d.ts +0 -49
  123. package/dist/cli.d.ts +0 -310
  124. package/dist/dependencies.d.ts +0 -16
  125. package/dist/deploy.d.ts +0 -10
  126. package/dist/docs.d.ts +0 -26
  127. package/dist/email.d.ts +0 -107
  128. package/dist/events.d.ts +0 -5
  129. package/dist/exit-code.d.ts +0 -5
  130. package/dist/hashing.d.ts +0 -36
  131. package/dist/helpers.d.ts +0 -1
  132. package/dist/i18n.d.ts +0 -11
  133. package/dist/index.d.ts +0 -65
  134. package/dist/inspect.d.ts +0 -3
  135. package/dist/logging.d.ts +0 -6
  136. package/dist/model-names.d.ts +0 -1
  137. package/dist/model.d.ts +0 -232
  138. package/dist/payments.d.ts +0 -94
  139. package/dist/ports.d.ts +0 -13
  140. package/dist/promise.d.ts +0 -1
  141. package/dist/push.d.ts +0 -35
  142. package/dist/pwa.d.ts +0 -3
  143. package/dist/queue.d.ts +0 -45
  144. package/dist/reactivity.d.ts +0 -1
  145. package/dist/request.d.ts +0 -49
  146. package/dist/router.d.ts +0 -65
  147. package/dist/scheduler.d.ts +0 -1
  148. package/dist/services.d.ts +0 -81
  149. package/dist/ssg.d.ts +0 -3
  150. package/dist/stacks.d.ts +0 -54
  151. package/dist/storage.d.ts +0 -31
  152. package/dist/table-names.d.ts +0 -1
  153. package/dist/tables.d.ts +0 -34
  154. package/dist/team.d.ts +0 -8
  155. package/dist/ui.d.ts +0 -47
  156. package/dist/utils.d.ts +0 -27
  157. package/src/build.ts +0 -2
  158. package/src/inspect.ts +0 -10
  159. package/src/layout.ts +0 -8
  160. package/src/pwa.ts +0 -8
  161. package/src/ssg.ts +0 -3
package/src/payments.ts CHANGED
@@ -1,32 +1,81 @@
1
+ /**
2
+ * Payment Types
3
+ *
4
+ * Type definitions for the payments module.
5
+ */
6
+
1
7
  import type Stripe from 'stripe'
2
8
 
9
+ // =============================================================================
10
+ // Configuration Types
11
+ // =============================================================================
12
+
3
13
  export interface PaymentOptions {
14
+ /**
15
+ * Payment provider
16
+ */
4
17
  driver: 'stripe'
5
18
 
6
- stripe: {
7
- publishableKey: string
8
- secretKey: string
9
- }
19
+ /**
20
+ * Stripe configuration
21
+ */
22
+ stripe: StripeConfig
23
+
24
+ /**
25
+ * Default currency (ISO 4217 code)
26
+ */
27
+ currency?: string
28
+
29
+ /**
30
+ * Webhook configuration
31
+ */
32
+ webhook?: WebhookConfig
10
33
  }
11
34
 
12
- export type PaymentConfig = Partial<PaymentOptions>
35
+ export interface StripeConfig {
36
+ /**
37
+ * Stripe publishable key (client-side)
38
+ */
39
+ publishableKey: string
13
40
 
14
- export interface ChargeOptions {
15
- currency?: string
16
- source?: string
17
- description?: string
18
- chargeId?: string
19
- limit?: number
20
- metadata?: object
21
- searchOptions: {
22
- query?: string
23
- limit?: number
24
- }
41
+ /**
42
+ * Stripe secret key (server-side)
43
+ */
44
+ secretKey: string
45
+
46
+ /**
47
+ * Stripe API version
48
+ */
49
+ apiVersion?: string
50
+
51
+ /**
52
+ * Webhook signing secret
53
+ */
54
+ webhookSecret?: string
25
55
  }
26
56
 
57
+ export interface WebhookConfig {
58
+ /**
59
+ * Webhook endpoint secret
60
+ */
61
+ secret: string
62
+
63
+ /**
64
+ * Tolerance in seconds for webhook timestamp verification
65
+ */
66
+ tolerance?: number
67
+ }
68
+
69
+ export type PaymentConfig = Partial<PaymentOptions>
70
+
71
+ // =============================================================================
72
+ // Customer Types
73
+ // =============================================================================
74
+
27
75
  export interface StripeCustomerOptions {
28
76
  address?: {
29
77
  line1?: string
78
+ line2?: string
30
79
  city?: string
31
80
  state?: string
32
81
  postal_code?: string
@@ -43,12 +92,12 @@ export interface CustomerOptions {
43
92
  description?: string
44
93
  address?: string
45
94
  email?: string
46
- metadata?: object
95
+ metadata?: Record<string, string>
47
96
  name?: string
48
97
  payment_method?: string
49
- shipping: string
98
+ shipping?: ShippingInfo
50
99
  listOptions?: {
51
- created?: object
100
+ created?: Record<string, unknown>
52
101
  ending_before?: string
53
102
  limit?: number
54
103
  starting_after?: string
@@ -61,9 +110,291 @@ export interface CustomerOptions {
61
110
  }
62
111
  }
63
112
 
113
+ export interface ShippingInfo {
114
+ address: {
115
+ line1: string
116
+ line2?: string
117
+ city?: string
118
+ state?: string
119
+ postal_code?: string
120
+ country?: string
121
+ }
122
+ name: string
123
+ phone?: string
124
+ }
125
+
126
+ // =============================================================================
127
+ // Charge Types
128
+ // =============================================================================
129
+
130
+ export interface ChargeOptions {
131
+ currency?: string
132
+ source?: string
133
+ description?: string
134
+ chargeId?: string
135
+ limit?: number
136
+ metadata?: Record<string, string>
137
+ searchOptions?: {
138
+ query?: string
139
+ limit?: number
140
+ }
141
+ }
142
+
143
+ export interface ChargeResult {
144
+ id: string
145
+ amount: number
146
+ currency: string
147
+ status: 'succeeded' | 'pending' | 'failed'
148
+ paymentMethod?: string
149
+ receiptUrl?: string
150
+ refunded: boolean
151
+ refundedAmount?: number
152
+ }
153
+
154
+ // =============================================================================
155
+ // Checkout Types
156
+ // =============================================================================
157
+
158
+ export interface CheckoutLineItem {
159
+ priceId: string
160
+ quantity: number
161
+ }
162
+
163
+ export interface CheckoutOptions extends Partial<Stripe.Checkout.SessionCreateParams> {
164
+ /**
165
+ * Enable automatic tax calculation
166
+ */
167
+ enableTax?: boolean
168
+
169
+ /**
170
+ * Allow promotion codes
171
+ */
172
+ allowPromotions?: boolean
173
+ }
174
+
175
+ export interface CheckoutSessionResult {
176
+ id: string
177
+ url: string | null
178
+ status: string
179
+ customerId?: string
180
+ subscriptionId?: string
181
+ paymentIntentId?: string
182
+ }
183
+
184
+ // =============================================================================
185
+ // Subscription Types
186
+ // =============================================================================
187
+
188
+ export interface SubscriptionOptions {
189
+ /**
190
+ * Subscription type/name
191
+ */
192
+ type: string
193
+
194
+ /**
195
+ * Price lookup key
196
+ */
197
+ lookupKey: string
198
+
199
+ /**
200
+ * Trial period in days
201
+ */
202
+ trialDays?: number
203
+
204
+ /**
205
+ * Coupon or promotion code
206
+ */
207
+ coupon?: string
208
+
209
+ /**
210
+ * Additional metadata
211
+ */
212
+ metadata?: Record<string, string>
213
+ }
214
+
215
+ export interface SubscriptionResult {
216
+ id: string
217
+ status: SubscriptionStatus
218
+ currentPeriodEnd: Date
219
+ cancelAtPeriodEnd: boolean
220
+ items: SubscriptionItem[]
221
+ latestInvoiceId?: string
222
+ }
223
+
224
+ export type SubscriptionStatus =
225
+ | 'active'
226
+ | 'canceled'
227
+ | 'incomplete'
228
+ | 'incomplete_expired'
229
+ | 'past_due'
230
+ | 'paused'
231
+ | 'trialing'
232
+ | 'unpaid'
233
+
234
+ export interface SubscriptionItem {
235
+ id: string
236
+ priceId: string
237
+ productId: string
238
+ quantity: number
239
+ }
240
+
241
+ // =============================================================================
242
+ // Invoice Types
243
+ // =============================================================================
244
+
245
+ export interface InvoiceResult {
246
+ id: string
247
+ number: string | null
248
+ status: InvoiceStatus
249
+ amountDue: number
250
+ amountPaid: number
251
+ currency: string
252
+ dueDate: Date | null
253
+ paidAt: Date | null
254
+ hostedInvoiceUrl: string | null
255
+ pdfUrl: string | null
256
+ }
257
+
258
+ export type InvoiceStatus =
259
+ | 'draft'
260
+ | 'open'
261
+ | 'paid'
262
+ | 'uncollectible'
263
+ | 'void'
264
+
265
+ // =============================================================================
266
+ // Payment Method Types
267
+ // =============================================================================
268
+
269
+ export interface PaymentMethodResult {
270
+ id: string
271
+ type: PaymentMethodType
272
+ card?: CardDetails
273
+ isDefault: boolean
274
+ }
275
+
276
+ export type PaymentMethodType =
277
+ | 'card'
278
+ | 'bank_account'
279
+ | 'sepa_debit'
280
+ | 'ideal'
281
+ | 'sofort'
282
+ | 'giropay'
283
+
284
+ export interface CardDetails {
285
+ brand: string
286
+ last4: string
287
+ expMonth: number
288
+ expYear: number
289
+ funding: 'credit' | 'debit' | 'prepaid' | 'unknown'
290
+ }
291
+
292
+ // =============================================================================
293
+ // Product & Price Types
294
+ // =============================================================================
295
+
296
+ export interface ProductOptions {
297
+ name: string
298
+ description?: string
299
+ images?: string[]
300
+ metadata?: Record<string, string>
301
+ active?: boolean
302
+ }
303
+
304
+ export interface PriceOptions {
305
+ productId: string
306
+ unitAmount: number
307
+ currency?: string
308
+ recurring?: {
309
+ interval: 'day' | 'week' | 'month' | 'year'
310
+ intervalCount?: number
311
+ }
312
+ lookupKey?: string
313
+ metadata?: Record<string, string>
314
+ }
315
+
316
+ // =============================================================================
317
+ // Coupon Types
318
+ // =============================================================================
319
+
320
+ export interface CouponOptions {
321
+ id?: string
322
+ name?: string
323
+ percentOff?: number
324
+ amountOff?: number
325
+ currency?: string
326
+ duration: 'forever' | 'once' | 'repeating'
327
+ durationInMonths?: number
328
+ maxRedemptions?: number
329
+ redeemBy?: Date
330
+ }
331
+
332
+ export interface PromotionCodeOptions {
333
+ couponId: string
334
+ code: string
335
+ maxRedemptions?: number
336
+ expiresAt?: Date
337
+ firstTimeTransaction?: boolean
338
+ minimumAmount?: number
339
+ minimumAmountCurrency?: string
340
+ }
341
+
342
+ // =============================================================================
343
+ // Webhook Types
344
+ // =============================================================================
345
+
346
+ export type WebhookEventType =
347
+ | 'payment_intent.succeeded'
348
+ | 'payment_intent.payment_failed'
349
+ | 'payment_intent.created'
350
+ | 'payment_intent.canceled'
351
+ | 'customer.subscription.created'
352
+ | 'customer.subscription.updated'
353
+ | 'customer.subscription.deleted'
354
+ | 'customer.subscription.trial_will_end'
355
+ | 'customer.created'
356
+ | 'customer.updated'
357
+ | 'customer.deleted'
358
+ | 'invoice.paid'
359
+ | 'invoice.payment_failed'
360
+ | 'invoice.finalized'
361
+ | 'invoice.created'
362
+ | 'checkout.session.completed'
363
+ | 'checkout.session.expired'
364
+ | 'charge.succeeded'
365
+ | 'charge.failed'
366
+ | 'charge.refunded'
367
+ | 'charge.dispute.created'
368
+ | 'charge.dispute.closed'
369
+ | 'payment_method.attached'
370
+ | 'payment_method.detached'
371
+ | 'setup_intent.succeeded'
372
+ | 'setup_intent.setup_failed'
373
+
374
+ export interface WebhookEvent<T = unknown> {
375
+ id: string
376
+ type: WebhookEventType
377
+ data: {
378
+ object: T
379
+ previousAttributes?: Partial<T>
380
+ }
381
+ created: number
382
+ livemode: boolean
383
+ }
384
+
385
+ export interface WebhookHandlerResult {
386
+ handled: boolean
387
+ eventType: string
388
+ error?: string
389
+ }
390
+
391
+ // =============================================================================
392
+ // Dispute Types
393
+ // =============================================================================
394
+
64
395
  export interface DisputeOptions {
65
396
  dp_id?: string
66
- metadata?: object
397
+ metadata?: Record<string, string>
67
398
  listOptions?: {
68
399
  charge?: string
69
400
  payment_intent?: string
@@ -74,10 +405,14 @@ export interface DisputeOptions {
74
405
  }
75
406
  }
76
407
 
408
+ // =============================================================================
409
+ // Event Types
410
+ // =============================================================================
411
+
77
412
  export interface EventOptions {
78
413
  event_id?: string
79
414
  listOptions?: {
80
- created?: object
415
+ created?: Record<string, unknown>
81
416
  delivery_success?: boolean
82
417
  ending_before?: string
83
418
  limit?: number
@@ -86,12 +421,20 @@ export interface EventOptions {
86
421
  }
87
422
  }
88
423
 
89
- export interface CheckoutLineItem {
90
- priceId: string
91
- quantity: number
424
+ // =============================================================================
425
+ // Utility Types
426
+ // =============================================================================
427
+
428
+ export interface PaginatedResult<T> {
429
+ data: T[]
430
+ hasMore: boolean
431
+ totalCount?: number
92
432
  }
93
433
 
94
- export interface CheckoutOptions extends Partial<Stripe.Checkout.SessionCreateParams> {
95
- enableTax?: boolean
96
- allowPromotions?: boolean
434
+ export interface AmountBreakdown {
435
+ subtotal: number
436
+ tax: number
437
+ discount: number
438
+ total: number
439
+ currency: string
97
440
  }
package/src/phone.ts ADDED
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Phone/Voice Service Configuration Types
3
+ * Powered by Amazon Connect
4
+ */
5
+
6
+ export interface PhoneNumberConfig {
7
+ type: 'TOLL_FREE' | 'DID' | 'UIFN'
8
+ countryCode: string
9
+ description?: string
10
+ contactFlowId?: string
11
+ notifyOnCall?: string[] // team member emails/phones
12
+ }
13
+
14
+ export interface PhoneNotificationConfig {
15
+ enabled: boolean
16
+ channels: ('email' | 'sms' | 'slack' | 'webhook')[]
17
+ webhookUrl?: string
18
+ slackChannel?: string
19
+ }
20
+
21
+ export interface BusinessHoursSchedule {
22
+ day: 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY'
23
+ start: string // HH:MM format
24
+ end: string // HH:MM format
25
+ }
26
+
27
+ export interface BusinessHoursConfig {
28
+ timezone: string
29
+ schedule: BusinessHoursSchedule[]
30
+ }
31
+
32
+ export interface VoicemailConfig {
33
+ enabled: boolean
34
+ transcription: boolean
35
+ maxDurationSeconds: number
36
+ greeting?: string
37
+ }
38
+
39
+ export interface PhoneInstanceConfig {
40
+ alias: string
41
+ inboundCallsEnabled: boolean
42
+ outboundCallsEnabled: boolean
43
+ }
44
+
45
+ export interface PhoneNotificationsConfig {
46
+ incomingCall?: PhoneNotificationConfig
47
+ missedCall?: PhoneNotificationConfig
48
+ voicemail?: PhoneNotificationConfig
49
+ }
50
+
51
+ export interface PhoneOptions {
52
+ enabled: boolean
53
+ provider: 'connect' // Amazon Connect
54
+
55
+ instance?: PhoneInstanceConfig
56
+ phoneNumbers: PhoneNumberConfig[]
57
+ notifications: PhoneNotificationsConfig
58
+ voicemail: VoicemailConfig
59
+ businessHours?: BusinessHoursConfig
60
+ }
61
+
62
+ export type PhoneConfig = Partial<PhoneOptions>
package/src/push.ts CHANGED
@@ -1,3 +1,64 @@
1
+ /**
2
+ * Push Notification Configuration Types
3
+ * Supports APNs (Apple) and FCM (Firebase/Google)
4
+ */
5
+
6
+ /**
7
+ * Apple Push Notification Service (APNs) configuration
8
+ */
9
+ export interface APNsProviderConfig {
10
+ /** APNs Key ID from Apple Developer Portal */
11
+ keyId: string
12
+ /** Team ID from Apple Developer Portal */
13
+ teamId: string
14
+ /** Path to the private key file (p8) or the key content */
15
+ privateKey: string
16
+ /** iOS app bundle ID (e.g., com.example.app) */
17
+ bundleId: string
18
+ /** Use production APNs server (default: false for sandbox) */
19
+ production?: boolean
20
+ }
21
+
22
+ /**
23
+ * Firebase Cloud Messaging (FCM) configuration
24
+ */
25
+ export interface FCMProviderConfig {
26
+ /** Firebase project ID */
27
+ projectId: string
28
+ /** Service account client email */
29
+ clientEmail: string
30
+ /** Service account private key (PEM format) */
31
+ privateKey: string
32
+ }
33
+
34
+ /**
35
+ * Push notification provider configuration
36
+ */
37
+ export interface PushProviderOptions {
38
+ /** APNs configuration (optional) */
39
+ apns?: APNsProviderConfig
40
+ /** FCM configuration (optional) */
41
+ fcm?: FCMProviderConfig
42
+ }
43
+
44
+ /**
45
+ * Push notification options
46
+ */
47
+ export interface PushOptions {
48
+ /** Enable push notifications */
49
+ enabled: boolean
50
+ /** Default provider to use */
51
+ defaultProvider?: 'apns' | 'fcm'
52
+ /** Provider configurations */
53
+ providers: PushProviderOptions
54
+ }
55
+
56
+ /**
57
+ * Push notification configuration type
58
+ */
59
+ export type PushConfig = Partial<PushOptions>
60
+
61
+ // Legacy types for backwards compatibility
1
62
  export interface FCMPushNotificationOptions {
2
63
  eventName: string
3
64
  to: {
@@ -34,3 +95,49 @@ export interface ExpoPushNotificationOptions {
34
95
  mutableContent: boolean
35
96
  }
36
97
  }
98
+
99
+ /**
100
+ * Result from a push notification operation
101
+ */
102
+ export interface PushResult {
103
+ /** Whether the operation was successful */
104
+ success: boolean
105
+ /** The provider that handled the notification */
106
+ provider: string
107
+ /** Human-readable message about the result */
108
+ message: string
109
+ /** Message ID returned from the provider */
110
+ messageId?: string
111
+ /** Additional provider-specific data */
112
+ data?: Record<string, any>
113
+ }
114
+
115
+ /**
116
+ * Push message structure
117
+ */
118
+ export interface PushMessage {
119
+ /** Device token(s) to send to */
120
+ to: string | string[]
121
+ /** Notification title */
122
+ title?: string
123
+ /** Notification body */
124
+ body: string
125
+ /** Additional data payload */
126
+ data?: Record<string, any>
127
+ /** Badge count */
128
+ badge?: number
129
+ /** Sound to play */
130
+ sound?: 'default' | null
131
+ /** Message priority */
132
+ priority?: 'default' | 'normal' | 'high'
133
+ }
134
+
135
+ /**
136
+ * Push ticket from Expo
137
+ */
138
+ export interface PushTicket {
139
+ id?: string
140
+ status: 'ok' | 'error'
141
+ message?: string
142
+ details?: Record<string, any>
143
+ }