@visulima/notification 0.0.1 → 1.0.0-alpha.2

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 (149) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE.md +874 -0
  3. package/README.md +313 -6
  4. package/dist/channels/email/index.d.ts +46 -0
  5. package/dist/channels/email/index.js +1 -0
  6. package/dist/channels/inapp/index.d.ts +99 -0
  7. package/dist/channels/inapp/index.js +1 -0
  8. package/dist/digest/index.d.ts +128 -0
  9. package/dist/digest/index.js +1 -0
  10. package/dist/events/index.d.ts +37 -0
  11. package/dist/events/index.js +1 -0
  12. package/dist/i18n/index.d.ts +42 -0
  13. package/dist/i18n/index.js +1 -0
  14. package/dist/index.d.ts +174 -0
  15. package/dist/index.js +1 -0
  16. package/dist/layouts/index.d.ts +45 -0
  17. package/dist/layouts/index.js +1 -0
  18. package/dist/middleware/index.d.ts +382 -0
  19. package/dist/middleware/index.js +1 -0
  20. package/dist/packem_shared/MemoryDigestStore-Bw-sE5MI.js +1 -0
  21. package/dist/packem_shared/MemoryEventStore-BGD_xRxu.js +1 -0
  22. package/dist/packem_shared/MemoryInAppStore-48qlrDCx.js +1 -0
  23. package/dist/packem_shared/MemoryQueue-CXgWoZoY.js +1 -0
  24. package/dist/packem_shared/Notification-B22tuJPy.js +1 -0
  25. package/dist/packem_shared/NotificationError-DVfMJQ1u.js +1 -0
  26. package/dist/packem_shared/NotificationMessageBuilder-Br_aZusY.js +1 -0
  27. package/dist/packem_shared/RequiredOptionError-CuL42XRq.js +1 -0
  28. package/dist/packem_shared/UnstorageDigestStore-QAcO3Vb_.js +1 -0
  29. package/dist/packem_shared/UnstorageInAppStore-Bq2LoDMO.js +1 -0
  30. package/dist/packem_shared/apnsProvider-C9WSv5sc.js +1 -0
  31. package/dist/packem_shared/circuitBreakerMiddleware-BlZN7SVT.js +1 -0
  32. package/dist/packem_shared/composeMiddleware-D6dR8DUS.js +1 -0
  33. package/dist/packem_shared/createDigester-vMNPejGF.js +1 -0
  34. package/dist/packem_shared/createNotificationWorkflow-B70OgeED.js +1 -0
  35. package/dist/packem_shared/createQueueWorker-DjQBxjXc.js +1 -0
  36. package/dist/packem_shared/createTranslator-CY91C2eS.js +1 -0
  37. package/dist/packem_shared/credentials-CG0zkn-W.js +1 -0
  38. package/dist/packem_shared/dedupeMiddleware-CQmPJd_h.js +1 -0
  39. package/dist/packem_shared/defineLayout-73TNxYPq.js +1 -0
  40. package/dist/packem_shared/defineProvider-C9q-7iwt.js +1 -0
  41. package/dist/packem_shared/discordProvider-ewPfe-J7.js +1 -0
  42. package/dist/packem_shared/emailChannel-CNDlX96Q.js +1 -0
  43. package/dist/packem_shared/expoProvider-CXq101FD.js +1 -0
  44. package/dist/packem_shared/failoverProvider-D1dAmW8U.js +1 -0
  45. package/dist/packem_shared/fcmProvider-WdJGZ55l.js +1 -0
  46. package/dist/packem_shared/getHeader-C_gkdnMQ.js +1 -0
  47. package/dist/packem_shared/hmacBase64-BhhoX0uo.js +1 -0
  48. package/dist/packem_shared/http-BMYcUNBU.js +1 -0
  49. package/dist/packem_shared/id-C_FRCsUM.js +1 -0
  50. package/dist/packem_shared/inAppProvider-ElbahgSj.js +1 -0
  51. package/dist/packem_shared/loggingMiddleware-Cs6EDLcL.js +1 -0
  52. package/dist/packem_shared/messageBirdProvider-CHUFB0hd.js +1 -0
  53. package/dist/packem_shared/mockProvider-BLwTZlkw.js +1 -0
  54. package/dist/packem_shared/msTeamsProvider-DBhrmuSd.js +1 -0
  55. package/dist/packem_shared/notification.d-DFCVTods.d.ts +104 -0
  56. package/dist/packem_shared/otelProvider-b6LVo0BS.js +1 -0
  57. package/dist/packem_shared/plivoProvider-CIOl6DWw.js +1 -0
  58. package/dist/packem_shared/provider.d-BQAGriz6.d.ts +33 -0
  59. package/dist/packem_shared/rateLimitMiddleware-DWmEYq-m.js +1 -0
  60. package/dist/packem_shared/retryMiddleware-uUJDcUoP.js +1 -0
  61. package/dist/packem_shared/roundRobinProvider-BetXJUUm.js +1 -0
  62. package/dist/packem_shared/slackProvider-N1wNtAZ3.js +1 -0
  63. package/dist/packem_shared/slackWebhook-GEx_GdcV.js +1 -0
  64. package/dist/packem_shared/sms-CU-OZvNU.js +1 -0
  65. package/dist/packem_shared/snsProvider-KCciJ-nj.js +4 -0
  66. package/dist/packem_shared/snsWebhook-ChZnBBT3.js +1 -0
  67. package/dist/packem_shared/standardWebhook-B-LxP8U7.js +1 -0
  68. package/dist/packem_shared/suppressionMiddleware-CY-Qo1A_.js +1 -0
  69. package/dist/packem_shared/telegramProvider-jqR5BhJL.js +1 -0
  70. package/dist/packem_shared/telemetryMiddleware-B1N4k171.js +1 -0
  71. package/dist/packem_shared/telnyxProvider-C8TMPir1.js +1 -0
  72. package/dist/packem_shared/tracer.d-Co1s_NwG.d.ts +494 -0
  73. package/dist/packem_shared/twilioProvider-BxI0e6LX.js +1 -0
  74. package/dist/packem_shared/twilioWebhook-F0mTmGXD.js +1 -0
  75. package/dist/packem_shared/types.d-67TogK4k.d.ts +33 -0
  76. package/dist/packem_shared/types.d-C1GoEAlI.d-Bv3grfyD.d.ts +83 -0
  77. package/dist/packem_shared/types.d-CximoA8M.d.ts +29 -0
  78. package/dist/packem_shared/types.d-GUzX1jTk.d.ts +235 -0
  79. package/dist/packem_shared/types.d-td-F2Oh0.d.ts +10 -0
  80. package/dist/packem_shared/unstorage.DqlWKU2I.d-CogP3Etw.d.ts +120 -0
  81. package/dist/packem_shared/vonageProvider-BF76ca89.js +1 -0
  82. package/dist/packem_shared/webPushProvider-B962RwsA.js +1 -0
  83. package/dist/packem_shared/webcrypto-bY7wJCB5.js +1 -0
  84. package/dist/packem_shared/webhookProvider-BALSb2pc.js +1 -0
  85. package/dist/preferences/index.d.ts +49 -0
  86. package/dist/preferences/index.js +1 -0
  87. package/dist/providers/chat/discord/index.d.ts +14 -0
  88. package/dist/providers/chat/discord/index.js +1 -0
  89. package/dist/providers/chat/msteams/index.d.ts +14 -0
  90. package/dist/providers/chat/msteams/index.js +1 -0
  91. package/dist/providers/chat/slack/index.d.ts +19 -0
  92. package/dist/providers/chat/slack/index.js +1 -0
  93. package/dist/providers/chat/telegram/index.d.ts +18 -0
  94. package/dist/providers/chat/telegram/index.js +1 -0
  95. package/dist/providers/failover/index.d.ts +16 -0
  96. package/dist/providers/failover/index.js +1 -0
  97. package/dist/providers/mock/index.d.ts +29 -0
  98. package/dist/providers/mock/index.js +1 -0
  99. package/dist/providers/opentelemetry/index.d.ts +21 -0
  100. package/dist/providers/opentelemetry/index.js +1 -0
  101. package/dist/providers/push/apns/index.d.ts +24 -0
  102. package/dist/providers/push/apns/index.js +1 -0
  103. package/dist/providers/push/expo/index.d.ts +14 -0
  104. package/dist/providers/push/expo/index.js +1 -0
  105. package/dist/providers/push/fcm/index.d.ts +26 -0
  106. package/dist/providers/push/fcm/index.js +1 -0
  107. package/dist/providers/push/web-push/index.d.ts +36 -0
  108. package/dist/providers/push/web-push/index.js +1 -0
  109. package/dist/providers/roundrobin/index.d.ts +17 -0
  110. package/dist/providers/roundrobin/index.js +1 -0
  111. package/dist/providers/sms/messagebird/index.d.ts +16 -0
  112. package/dist/providers/sms/messagebird/index.js +1 -0
  113. package/dist/providers/sms/plivo/index.d.ts +18 -0
  114. package/dist/providers/sms/plivo/index.js +1 -0
  115. package/dist/providers/sms/sns/index.d.ts +21 -0
  116. package/dist/providers/sms/sns/index.js +1 -0
  117. package/dist/providers/sms/telnyx/index.d.ts +18 -0
  118. package/dist/providers/sms/telnyx/index.js +1 -0
  119. package/dist/providers/sms/twilio/index.d.ts +20 -0
  120. package/dist/providers/sms/twilio/index.js +1 -0
  121. package/dist/providers/sms/vonage/index.d.ts +18 -0
  122. package/dist/providers/sms/vonage/index.js +1 -0
  123. package/dist/providers/webhook/index.d.ts +18 -0
  124. package/dist/providers/webhook/index.js +1 -0
  125. package/dist/queue/bullmq-queue.d.ts +58 -0
  126. package/dist/queue/bullmq-queue.js +1 -0
  127. package/dist/queue/index.d.ts +50 -0
  128. package/dist/queue/index.js +1 -0
  129. package/dist/queue/pg-boss-queue.d.ts +66 -0
  130. package/dist/queue/pg-boss-queue.js +1 -0
  131. package/dist/queue/sqs-queue.d.ts +91 -0
  132. package/dist/queue/sqs-queue.js +1 -0
  133. package/dist/queue/unstorage-queue.d.ts +30 -0
  134. package/dist/queue/unstorage-queue.js +1 -0
  135. package/dist/routing/index.d.ts +35 -0
  136. package/dist/routing/index.js +1 -0
  137. package/dist/template-engines/handlebars.d.ts +16 -0
  138. package/dist/template-engines/handlebars.js +1 -0
  139. package/dist/template-engines/liquid.d.ts +16 -0
  140. package/dist/template-engines/liquid.js +1 -0
  141. package/dist/template-engines/string.d.ts +20 -0
  142. package/dist/template-engines/string.js +1 -0
  143. package/dist/utils/result.d.ts +54 -0
  144. package/dist/utils/result.js +1 -0
  145. package/dist/webhooks/index.d.ts +110 -0
  146. package/dist/webhooks/index.js +1 -0
  147. package/dist/workflow/index.d.ts +83 -0
  148. package/dist/workflow/index.js +1 -0
  149. package/package.json +283 -43
@@ -0,0 +1,235 @@
1
+ type EmailRecipients = EmailAddressLike | string | (EmailAddressLike | string)[];
2
+ /**
3
+ * Utility type for values that can be promises.
4
+ */
5
+ type MaybePromise<T> = T | Promise<T>;
6
+ /**
7
+ * The logical delivery channels a notification can be routed through.
8
+ */
9
+ type ChannelType = "chat" | "email" | "inapp" | "push" | "sms" | "webhook";
10
+ /**
11
+ * Feature flags indicating what capabilities a provider supports. Used to gate
12
+ * payloads before sending (see `checkFeatureSupport`) and to surface capabilities
13
+ * to consumers.
14
+ */
15
+ interface FeatureFlags {
16
+ /** Supports file/media attachments (MMS, rich push images). */
17
+ attachments?: boolean;
18
+ /** Supports sending to many recipients in a single API call. */
19
+ batchSending?: boolean;
20
+ /** Reports delivery receipts / status callbacks. */
21
+ deliveryReceipts?: boolean;
22
+ /** Supports media URLs (MMS images, push images). */
23
+ media?: boolean;
24
+ /** Supports rich structured content (Slack blocks, cards, action buttons). */
25
+ richContent?: boolean;
26
+ /** Supports scheduled / delayed sending. */
27
+ scheduling?: boolean;
28
+ /** Supports provider-side templates. */
29
+ templates?: boolean;
30
+ /** Supports open/click tracking. */
31
+ tracking?: boolean;
32
+ }
33
+ /**
34
+ * Base configuration shared by every provider.
35
+ */
36
+ interface BaseConfig {
37
+ debug?: boolean;
38
+ logger?: Console;
39
+ retries?: number;
40
+ timeout?: number;
41
+ }
42
+ /**
43
+ * Fields common to every channel payload.
44
+ */
45
+ interface BaseNotificationPayload {
46
+ /**
47
+ * Idempotency key to dedupe retried sends at the provider (where supported)
48
+ * and in the dedupe middleware.
49
+ */
50
+ idempotencyKey?: string;
51
+ /**
52
+ * Arbitrary metadata passed through to the provider and emitted on events.
53
+ */
54
+ metadata?: Record<string, unknown>;
55
+ /**
56
+ * Optional scheduled send time (providers advertising `scheduling`).
57
+ */
58
+ scheduledAt?: Date | string;
59
+ }
60
+ /**
61
+ * SMS / MMS payload.
62
+ */
63
+ interface SmsPayload extends BaseNotificationPayload {
64
+ /** Sender id or phone number (overrides provider default). */
65
+ from?: string;
66
+ /** Media URLs for MMS. */
67
+ mediaUrls?: string[];
68
+ /** Message body. */
69
+ text: string;
70
+ /** Destination phone number(s) in E.164 format. */
71
+ to: string | string[];
72
+ }
73
+ /**
74
+ * Push notification payload (mobile + web push).
75
+ */
76
+ interface PushPayload extends BaseNotificationPayload {
77
+ /** Badge count (iOS). */
78
+ badge?: number;
79
+ /** Notification body. */
80
+ body: string;
81
+ /** Action invoked when the notification is tapped. */
82
+ clickAction?: string;
83
+ /** Custom key/value data payload. */
84
+ data?: Record<string, unknown>;
85
+ /** Image URL for rich push. */
86
+ imageUrl?: string;
87
+ /** Sound to play. */
88
+ sound?: string;
89
+ /** Notification title. */
90
+ title?: string;
91
+ /** Device token(s) / subscription target(s). */
92
+ to: string | string[];
93
+ }
94
+ /**
95
+ * Chat payload (Slack, Discord, Teams, Telegram, ...).
96
+ */
97
+ interface ChatPayload extends BaseNotificationPayload {
98
+ /** Provider-specific rich content (Slack blocks, Discord embeds, ...). */
99
+ blocks?: unknown;
100
+ /** Plain-text message body. */
101
+ text: string;
102
+ /** Thread / reply target. */
103
+ threadId?: string;
104
+ /** Channel id, conversation id or webhook target (overrides provider default). */
105
+ to?: string;
106
+ }
107
+ /**
108
+ * In-app inbox payload.
109
+ */
110
+ interface InAppPayload extends BaseNotificationPayload {
111
+ /** Optional CTA actions. */
112
+ actions?: {
113
+ label: string;
114
+ url?: string;
115
+ }[];
116
+ /** Notification body. */
117
+ body: string;
118
+ /** Custom key/value data payload. */
119
+ data?: Record<string, unknown>;
120
+ /** Notification title. */
121
+ title?: string;
122
+ /** Subscriber id the notification belongs to. */
123
+ to: string;
124
+ }
125
+ /**
126
+ * An email address, optionally with a display name.
127
+ */
128
+ interface EmailAddressLike {
129
+ email: string;
130
+ name?: string;
131
+ }
132
+ /**
133
+ * Email channel payload. Delivered through `@visulima/email` by the email channel adapter;
134
+ * the shape mirrors `EmailOptions` so it passes through with minimal mapping.
135
+ */
136
+ interface EmailChannelPayload extends BaseNotificationPayload {
137
+ attachments?: unknown[];
138
+ bcc?: EmailRecipients;
139
+ cc?: EmailRecipients;
140
+ from?: EmailAddressLike | string;
141
+ headers?: Record<string, string>;
142
+ html?: string;
143
+ replyTo?: EmailAddressLike | string;
144
+ subject: string;
145
+ text?: string;
146
+ to: EmailRecipients;
147
+ }
148
+ /**
149
+ * Generic outbound webhook payload.
150
+ */
151
+ interface WebhookPayload extends BaseNotificationPayload {
152
+ /** JSON-serialisable request body. */
153
+ body: unknown;
154
+ /** Extra request headers. */
155
+ headers?: Record<string, string>;
156
+ /** HTTP method (defaults to POST). */
157
+ method?: string;
158
+ /** Target URL (overrides provider default). */
159
+ url?: string;
160
+ }
161
+ /**
162
+ * Union of all built-in channel payloads.
163
+ */
164
+ type NotificationPayload = ChatPayload | EmailChannelPayload | InAppPayload | PushPayload | SmsPayload | WebhookPayload;
165
+ /**
166
+ * Per-recipient delivery outcome for multi-recipient sends.
167
+ */
168
+ interface RecipientResult {
169
+ error?: string;
170
+ id: string;
171
+ messageId?: string;
172
+ status: "failed" | "sent";
173
+ }
174
+ /**
175
+ * Normalised result of a successful provider send.
176
+ */
177
+ interface NotificationResult {
178
+ channel?: ChannelType;
179
+ messageId: string;
180
+ provider?: string;
181
+ /** Per-recipient breakdown when a single call targets many recipients. */
182
+ recipients?: RecipientResult[];
183
+ response?: unknown;
184
+ sent: boolean;
185
+ timestamp: Date;
186
+ }
187
+ /**
188
+ * A successful send receipt.
189
+ */
190
+ interface SuccessReceipt {
191
+ channel?: ChannelType;
192
+ messageId: string;
193
+ provider?: string;
194
+ response?: unknown;
195
+ successful: true;
196
+ timestamp: Date;
197
+ }
198
+ /**
199
+ * A failed send receipt.
200
+ */
201
+ interface FailureReceipt {
202
+ channel?: ChannelType;
203
+ errorMessages: string[];
204
+ provider?: string;
205
+ successful: false;
206
+ }
207
+ /**
208
+ * Discriminated send receipt returned by the high-level facade.
209
+ */
210
+ type Receipt = FailureReceipt | SuccessReceipt;
211
+ /**
212
+ * Generic result tuple used across providers and middleware.
213
+ */
214
+ interface Result<T = unknown> {
215
+ data?: T;
216
+ error?: unknown;
217
+ success: boolean;
218
+ }
219
+ /**
220
+ * Lifecycle event names emitted on the event bus and parsed from provider webhooks.
221
+ */
222
+ type NotificationEventType = "bounced" | "clicked" | "delivered" | "failed" | "interacted" | "queued" | "read" | "sent";
223
+ /**
224
+ * Normalised lifecycle / delivery event.
225
+ */
226
+ interface NotificationEvent {
227
+ channel?: ChannelType;
228
+ messageId: string;
229
+ metadata?: Record<string, unknown>;
230
+ provider?: string;
231
+ recipient?: string;
232
+ timestamp: Date;
233
+ type: NotificationEventType;
234
+ }
235
+ export { BaseNotificationPayload as B, ChannelType as C, EmailChannelPayload as E, FeatureFlags as F, InAppPayload as I, MaybePromise as M, NotificationEvent as N, PushPayload as P, Result as R, SmsPayload as S, WebhookPayload as W, NotificationResult as a, ChatPayload as b, Receipt as c, BaseConfig as d, NotificationEventType as e, EmailAddressLike as f, FailureReceipt as g, NotificationPayload as h, RecipientResult as i, SuccessReceipt as j };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Template render function type. Engines accept a template, optional data and
3
+ * engine-specific options and return the rendered string (sync or async).
4
+ * @param template Template content (typically a string).
5
+ * @param data Data/variables to pass to the template.
6
+ * @param options Options specific to the template engine.
7
+ * @returns The rendered string.
8
+ */
9
+ type TemplateRenderer = (template: unknown, data?: Record<string, unknown>, options?: Record<string, unknown>) => string | Promise<string>;
10
+ export { TemplateRenderer as T };
@@ -0,0 +1,120 @@
1
+ type StorageValue = null | string | number | boolean | object;
2
+ type WatchEvent = "update" | "remove";
3
+ type WatchCallback = (event: WatchEvent, key: string) => any;
4
+ type MaybePromise<T> = T | Promise<T>;
5
+ type MaybeDefined<T> = T extends any ? T : any;
6
+ type Unwatch = () => MaybePromise<void>;
7
+ interface StorageMeta {
8
+ atime?: Date;
9
+ mtime?: Date;
10
+ ttl?: number;
11
+ [key: string]: StorageValue | Date | undefined;
12
+ }
13
+ type TransactionOptions = Record<string, any>;
14
+ type GetKeysOptions = TransactionOptions & {
15
+ maxDepth?: number;
16
+ };
17
+ interface DriverFlags {
18
+ maxDepth?: boolean;
19
+ ttl?: boolean;
20
+ }
21
+ interface Driver<OptionsT = any, InstanceT = any> {
22
+ name?: string;
23
+ flags?: DriverFlags;
24
+ options?: OptionsT;
25
+ getInstance?: () => InstanceT;
26
+ hasItem: (key: string, opts: TransactionOptions) => MaybePromise<boolean>;
27
+ getItem: (key: string, opts?: TransactionOptions) => MaybePromise<StorageValue>;
28
+ /** @experimental */
29
+ getItems?: (items: {
30
+ key: string;
31
+ options?: TransactionOptions;
32
+ }[], commonOptions?: TransactionOptions) => MaybePromise<{
33
+ key: string;
34
+ value: StorageValue;
35
+ }[]>;
36
+ /** @experimental */
37
+ getItemRaw?: (key: string, opts: TransactionOptions) => MaybePromise<unknown>;
38
+ setItem?: (key: string, value: string, opts: TransactionOptions) => MaybePromise<void>;
39
+ /** @experimental */
40
+ setItems?: (items: {
41
+ key: string;
42
+ value: string;
43
+ options?: TransactionOptions;
44
+ }[], commonOptions?: TransactionOptions) => MaybePromise<void>;
45
+ /** @experimental */
46
+ setItemRaw?: (key: string, value: any, opts: TransactionOptions) => MaybePromise<void>;
47
+ removeItem?: (key: string, opts: TransactionOptions) => MaybePromise<void>;
48
+ getMeta?: (key: string, opts: TransactionOptions) => MaybePromise<StorageMeta | null>;
49
+ getKeys: (base: string, opts: GetKeysOptions) => MaybePromise<string[]>;
50
+ clear?: (base: string, opts: TransactionOptions) => MaybePromise<void>;
51
+ dispose?: () => MaybePromise<void>;
52
+ watch?: (callback: WatchCallback) => MaybePromise<Unwatch>;
53
+ }
54
+ type StorageDefinition = {
55
+ items: unknown;
56
+ [key: string]: unknown;
57
+ };
58
+ type StorageItemMap<T> = T extends StorageDefinition ? T["items"] : T;
59
+ type StorageItemType<T, K> = K extends keyof StorageItemMap<T> ? StorageItemMap<T>[K] : T extends StorageDefinition ? StorageValue : T;
60
+ interface Storage<T extends StorageValue = StorageValue> {
61
+ hasItem<U extends Extract<T, StorageDefinition>, K extends keyof StorageItemMap<U>>(key: K, opts?: TransactionOptions): Promise<boolean>;
62
+ hasItem(key: string, opts?: TransactionOptions): Promise<boolean>;
63
+ getItem<U extends Extract<T, StorageDefinition>, K extends string & keyof StorageItemMap<U>>(key: K, ops?: TransactionOptions): Promise<StorageItemType<T, K> | null>;
64
+ getItem<R = StorageItemType<T, string>>(key: string, opts?: TransactionOptions): Promise<R | null>;
65
+ /** @experimental */
66
+ getItems: <U extends T>(items: (string | {
67
+ key: string;
68
+ options?: TransactionOptions;
69
+ })[], commonOptions?: TransactionOptions) => Promise<{
70
+ key: string;
71
+ value: U;
72
+ }[]>;
73
+ /** @experimental See https://github.com/unjs/unstorage/issues/142 */
74
+ getItemRaw: <T = any>(key: string, opts?: TransactionOptions) => Promise<MaybeDefined<T> | null>;
75
+ setItem<U extends Extract<T, StorageDefinition>, K extends keyof StorageItemMap<U>>(key: K, value: StorageItemType<T, K>, opts?: TransactionOptions): Promise<void>;
76
+ setItem<U extends T>(key: string, value: U, opts?: TransactionOptions): Promise<void>;
77
+ /** @experimental */
78
+ setItems: <U extends T>(items: {
79
+ key: string;
80
+ value: U;
81
+ options?: TransactionOptions;
82
+ }[], commonOptions?: TransactionOptions) => Promise<void>;
83
+ /** @experimental See https://github.com/unjs/unstorage/issues/142 */
84
+ setItemRaw: <T = any>(key: string, value: MaybeDefined<T>, opts?: TransactionOptions) => Promise<void>;
85
+ removeItem<U extends Extract<T, StorageDefinition>, K extends keyof StorageItemMap<U>>(key: K, opts?: (TransactionOptions & {
86
+ removeMeta?: boolean;
87
+ }) | boolean): Promise<void>;
88
+ removeItem(key: string, opts?: (TransactionOptions & {
89
+ removeMeta?: boolean;
90
+ }) | boolean): Promise<void>;
91
+ getMeta: (key: string, opts?: (TransactionOptions & {
92
+ nativeOnly?: boolean;
93
+ }) | boolean) => MaybePromise<StorageMeta>;
94
+ setMeta: (key: string, value: StorageMeta, opts?: TransactionOptions) => Promise<void>;
95
+ removeMeta: (key: string, opts?: TransactionOptions) => Promise<void>;
96
+ getKeys: (base?: string, opts?: GetKeysOptions) => Promise<string[]>;
97
+ clear: (base?: string, opts?: TransactionOptions) => Promise<void>;
98
+ dispose: () => Promise<void>;
99
+ watch: (callback: WatchCallback) => Promise<Unwatch>;
100
+ unwatch: () => Promise<void>;
101
+ mount: (base: string, driver: Driver) => Storage;
102
+ unmount: (base: string, dispose?: boolean) => Promise<void>;
103
+ getMount: (key?: string) => {
104
+ base: string;
105
+ driver: Driver;
106
+ };
107
+ getMounts: (base?: string, options?: {
108
+ parents?: boolean;
109
+ }) => {
110
+ base: string;
111
+ driver: Driver;
112
+ }[];
113
+ keys: Storage["getKeys"];
114
+ get: Storage<T>["getItem"];
115
+ set: Storage<T>["setItem"];
116
+ has: Storage<T>["hasItem"];
117
+ del: Storage<T>["removeItem"];
118
+ remove: Storage<T>["removeItem"];
119
+ }
120
+ export type { Storage as S };
@@ -0,0 +1 @@
1
+ import n from"./RequiredOptionError-CuL42XRq.js";import{defineProvider as l}from"./defineProvider-C9q-7iwt.js";import{t as g}from"./credentials-CG0zkn-W.js";import{r as y}from"./http-BMYcUNBU.js";import{s as v,b as w}from"./sms-CU-OZvNU.js";const S="https://rest.nexmo.com",P=l(d=>{const e=d??{};if(!e.apiKey)throw new n("vonage","apiKey");if(!e.apiSecret)throw new n("vonage","apiSecret");const o=e.endpoint??S,p=e.retries??3,c=e.timeout??3e4,m=`${o}/sms/json`,f=async(t,a)=>{const s=a.from??e.from;if(!s)return{error:"Missing sender: provide `from` on the payload or provider config",id:t,status:"failed"};const u=new URLSearchParams({api_key:e.apiKey,api_secret:e.apiSecret,from:s,text:a.text,to:t}),r=await y(m,{body:u.toString(),headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"POST",timeout:c},p);if(!r.success||!r.data)return{error:r.error instanceof Error?r.error.message:"Request failed",id:t,status:"failed"};const i=r.data.body.messages?.[0];return i?.status!=="0"?{error:i?.["error-text"]??`Vonage status ${i?.status??"unknown"}`,id:t,status:"failed"}:{id:t,messageId:i["message-id"],status:"sent"}};return{channel:"sms",endpoint:o,features:{batchSending:!1,deliveryReceipts:!0,media:!1},id:"vonage",initialize:()=>{},isAvailable:()=>!!(e.apiKey&&e.apiSecret),options:e,send:async t=>{const a=await v(g(t.to),async s=>f(s,t));return w("vonage",a)},validateCredentials:()=>!!(e.apiKey&&e.apiSecret)}});export{P as default};
@@ -0,0 +1 @@
1
+ import K from"./RequiredOptionError-CuL42XRq.js";import{defineProvider as C}from"./defineProvider-C9q-7iwt.js";import{t as A}from"./credentials-CG0zkn-W.js";import{m as E}from"./http-BMYcUNBU.js";import{n as U}from"./id-C_FRCsUM.js";import{a as $}from"./sms-CU-OZvNU.js";import{u as y,f as S,t as f,s as d,r as k,c as g,h as P,a as T}from"./webcrypto-bY7wJCB5.js";const j=2419200,x=i=>{let e=i;if(typeof i=="string")try{e=JSON.parse(i)}catch{return}const t=e;if(!(!t||typeof t.endpoint!="string"||typeof t.keys?.p256dh!="string"||typeof t.keys.auth!="string"))return t},B=async(i,e)=>{const t=S(e),p=f(t.slice(1,33)),r=f(t.slice(33,65));return d().importKey("jwk",{crv:"P-256",d:i,ext:!0,key_ops:["sign"],kty:"EC",x:p,y:r},{name:"ECDSA",namedCurve:"P-256"},!1,["sign"])},D=async(i,e,t)=>{const p=f(y(JSON.stringify({alg:"ES256",typ:"JWT"}))),r=f(y(JSON.stringify({aud:i,exp:Math.floor(Date.now()/1e3)+720*60,sub:e}))),u=`${p}.${r}`,a=await d().sign({hash:"SHA-256",name:"ECDSA"},t,y(u));return`${u}.${f(new Uint8Array(a))}`},H=async(i,e)=>{const t=S(i.keys.p256dh),p=S(i.keys.auth),r=k(16),u=await d().generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveBits"]),a=new Uint8Array(await d().exportKey("raw",u.publicKey)),n=await d().importKey("raw",t,{name:"ECDH",namedCurve:"P-256"},!1,[]),m=new Uint8Array(await d().deriveBits({name:"ECDH",public:n},u.privateKey,256)),s=g(y("WebPush: info\0"),t,a),l=await P(p,m,s,32),v=await P(r,l,y("Content-Encoding: aes128gcm\0"),16),w=await P(r,l,y("Content-Encoding: nonce\0"),12),b=await d().importKey("raw",v,{name:"AES-GCM"},!1,["encrypt"]),h=g(e,new Uint8Array([2])),o=new Uint8Array(await d().encrypt({iv:w,name:"AES-GCM"},b,h)),c=g(r,T(4096,4),new Uint8Array([a.length]),a);return g(c,o)},z=C(i=>{const e=i??{};if(!e.vapidPublicKey||!e.vapidPrivateKey||!e.vapidSubject)throw new K("web-push",["vapidPublicKey","vapidPrivateKey","vapidSubject"]);const t=e.ttl??j,p=e.urgency??"normal",r=e.timeout??3e4,u=async(a,n,m)=>{const s=x(a);if(!s)return{error:"Invalid push subscription (expected { endpoint, keys: { p256dh, auth } })",id:a,status:"failed"};const{origin:l}=new URL(s.endpoint),v=await D(l,e.vapidSubject,m),w=JSON.stringify({badge:n.badge,body:n.body,data:n.data,image:n.imageUrl,title:n.title}),b=await H(s,y(w)),h={Authorization:`vapid t=${v},k=${e.vapidPublicKey}`,"Content-Encoding":"aes128gcm","Content-Type":"application/octet-stream",TTL:String(t),Urgency:p},o=await E(s.endpoint,{body:b,headers:h,method:"POST",timeout:r});if(!o.success||!o.data)return{error:o.error instanceof Error?o.error.message:"Request failed",id:a,status:"failed"};const{status:c}=o.data;return c===404||c===410?{error:`Subscription gone (HTTP ${String(c)}) — remove this subscription`,id:a,status:"failed"}:c>=400?{error:`HTTP ${String(c)}: ${typeof o.data.body=="string"?o.data.body:""}`.trim(),id:a,status:"failed"}:{id:a,messageId:U("web-push"),status:"sent"}};return{channel:"push",features:{batchSending:!1,media:!1,richContent:!0},id:"web-push",initialize:()=>{},isAvailable:()=>!!(e.vapidPublicKey&&e.vapidPrivateKey&&e.vapidSubject),options:e,send:async a=>{const n=A(a.to),m=await B(e.vapidPrivateKey,e.vapidPublicKey),s=[];for(const l of n)s.push(await u(l,a,m));return $("push","web-push",s)},validateCredentials:()=>!!(e.vapidPublicKey&&e.vapidPrivateKey&&e.vapidSubject)}});export{z as default};
@@ -0,0 +1 @@
1
+ const l=r=>new Uint8Array(new ArrayBuffer(r)),i=r=>{if(r.buffer instanceof ArrayBuffer)return r;const t=l(r.length);return t.set(r),t},o=()=>globalThis.crypto.subtle,u=r=>{const t=l(r);return globalThis.crypto.getRandomValues(t),t},c=r=>{const t=new TextEncoder().encode(r),e=l(t.length);return e.set(t),e},y=(...r)=>{let t=0;for(const a of r)t+=a.length;const e=l(t);let n=0;for(const a of r)e.set(a,n),n+=a.length;return e},g=r=>{let t="";for(const e of r)t+=e.toString(16).padStart(2,"0");return t},h=r=>{let t="";for(const e of r)t+=String.fromCodePoint(e);return btoa(t)},A=r=>{let t=h(r).replaceAll("+","-").replaceAll("/","_");for(;t.endsWith("=");)t=t.slice(0,-1);return t},w=r=>{const t=r.replaceAll("-","+").replaceAll("_","/"),e=t.padEnd(t.length+(4-t.length%4)%4,"="),n=atob(e),a=l(n.length);for(let s=0;s<n.length;s+=1)a[s]=n.codePointAt(s)??0;return a},d=(r,t)=>{const e=l(t);let n=r;for(let a=t-1;a>=0;a-=1)e[a]=n%256,n=Math.floor(n/256);return e},p=async r=>{const t=await o().digest("SHA-256",r);return new Uint8Array(t)},m=async(r,t)=>{const e=await o().importKey("raw",r,{hash:"SHA-256",name:"HMAC"},!1,["sign"]),n=await o().sign("HMAC",e,t);return new Uint8Array(n)},B=async(r,t,e)=>{const n=typeof r=="string"?c(r):i(r),a=typeof t=="string"?c(t):i(t),s=await o().importKey("raw",n,{hash:e,name:"HMAC"},!1,["sign"]),f=await o().sign("HMAC",s,a);return new Uint8Array(f)},H=async(r,t,e,n)=>{const a=await o().importKey("raw",t,"HKDF",!1,["deriveBits"]),s=await o().deriveBits({hash:"SHA-256",info:e,name:"HKDF",salt:r},a,n*8);return new Uint8Array(s)};export{d as a,g as b,y as c,p as d,m as e,w as f,h as g,H as h,B as i,u as r,o as s,A as t,c as u};
@@ -0,0 +1 @@
1
+ import s from"./NotificationError-DVfMJQ1u.js";import i from"./RequiredOptionError-CuL42XRq.js";import{r as d}from"./http-BMYcUNBU.js";import{n as u}from"./id-C_FRCsUM.js";const w=(t={})=>{const a=t.retries??3,n=t.timeout??3e4;return{channel:"webhook",endpoint:t.url,features:{},id:"webhook",initialize:()=>{},isAvailable:()=>!0,send:async o=>{const r=o.url??t.url;if(!r)throw new i("webhook","url");const e=await d(r,{body:typeof o.body=="string"?o.body:JSON.stringify(o.body),headers:{"Content-Type":"application/json",...t.headers,...o.headers},method:o.method??t.method??"POST",timeout:n},a);return!e.success||!e.data?{error:new s("webhook",e.error instanceof Error?e.error.message:"Request failed"),success:!1}:e.data.status>=400?{error:new s("webhook",`HTTP ${String(e.data.status)}`),success:!1}:{data:{channel:"webhook",messageId:u("webhook"),provider:"webhook",response:e.data.body,sent:!0,timestamp:new Date},success:!0}}}};export{w as webhookProvider};
@@ -0,0 +1,49 @@
1
+ import { ChannelGate } from "../routing/index.js";
2
+ import { C as ChannelType } from "../packem_shared/types.d-GUzX1jTk.js";
3
+ import "../packem_shared/notification.d-DFCVTods.js";
4
+ import "../packem_shared/types.d-CximoA8M.js";
5
+ import "../packem_shared/provider.d-BQAGriz6.js";
6
+ /**
7
+ * A subscriber's channel preferences. A channel set to `false` is opted out; channels
8
+ * absent default to allowed.
9
+ */
10
+ interface SubscriberPreferences {
11
+ channels: Partial<Record<ChannelType, boolean>>;
12
+ }
13
+ interface IsAllowedOptions {
14
+ /** Critical notifications bypass opt-outs (e.g. security alerts). */
15
+ critical?: boolean;
16
+ }
17
+ /**
18
+ * Stores per-subscriber channel preferences and answers allow/deny questions.
19
+ */
20
+ interface PreferenceStore {
21
+ get: (subscriberId: string) => Promise<SubscriberPreferences> | SubscriberPreferences;
22
+ isAllowed: (subscriberId: string, channel: ChannelType, options?: IsAllowedOptions) => Promise<boolean> | boolean;
23
+ set: (subscriberId: string, preferences: SubscriberPreferences) => Promise<void> | void;
24
+ }
25
+ /**
26
+ * In-memory {@link PreferenceStore}.
27
+ */
28
+ declare class MemoryPreferenceStore implements PreferenceStore {
29
+ #private;
30
+ get(subscriberId: string): SubscriberPreferences;
31
+ set(subscriberId: string, preferences: SubscriberPreferences): void;
32
+ isAllowed(subscriberId: string, channel: ChannelType, options?: IsAllowedOptions): boolean;
33
+ }
34
+ /**
35
+ * Builds a {@link ChannelGate} for `route(...)` from a preference store. The subscriber id
36
+ * is resolved from each payload (default: the payload's `to` field, stringified).
37
+ * @param store The preference store.
38
+ * @param options Resolution options.
39
+ * @param options.critical When true the produced gate treats every send as critical, bypassing opt-outs.
40
+ * @param options.subscriberId Resolver mapping a payload to its subscriber id (defaults to the `to` field).
41
+ * @returns A gate suitable for `route(notification, message, { gate })`.
42
+ */
43
+ declare const preferencesGate: (store: PreferenceStore, options?: {
44
+ critical?: boolean;
45
+ subscriberId?: (payload: {
46
+ to?: unknown;
47
+ }) => string | undefined;
48
+ }) => ChannelGate;
49
+ export { IsAllowedOptions, MemoryPreferenceStore, PreferenceStore, SubscriberPreferences, preferencesGate };
@@ -0,0 +1 @@
1
+ class l{#e=new Map;get(e){return this.#e.get(e)??{channels:{}}}set(e,r){this.#e.set(e,r)}isAllowed(e,r,s={}){return s.critical?!0:this.get(e).channels[r]!==!1}}const o=(c,e={})=>{const r=n=>{const{to:t}=n;if(t!=null)return typeof t=="string"?t:JSON.stringify(t)},s=e.subscriberId??r;return async(n,t)=>{const i=s(t);return i?c.isAllowed(i,n,{critical:e.critical}):!0}};export{l as MemoryPreferenceStore,o as preferencesGate};
@@ -0,0 +1,14 @@
1
+ import { d as BaseConfig, b as ChatPayload } from "../../../packem_shared/types.d-GUzX1jTk.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-BQAGriz6.js";
3
+ interface DiscordConfig extends BaseConfig {
4
+ /** Override the bot username for the message. */
5
+ username?: string;
6
+ /** Discord webhook URL. Required. */
7
+ webhookUrl: string;
8
+ }
9
+ /**
10
+ * Discord chat provider via Incoming Webhooks. Edge-safe — `fetch` only.
11
+ * @see https://discord.com/developers/docs/resources/webhook#execute-webhook
12
+ */
13
+ declare const discordProvider: ProviderFactory<DiscordConfig, ChatPayload>;
14
+ export { type DiscordConfig, discordProvider };
@@ -0,0 +1 @@
1
+ import{default as o}from"../../../packem_shared/discordProvider-ewPfe-J7.js";export{o as discordProvider};
@@ -0,0 +1,14 @@
1
+ import { d as BaseConfig, b as ChatPayload } from "../../../packem_shared/types.d-GUzX1jTk.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-BQAGriz6.js";
3
+ interface MsTeamsConfig extends BaseConfig {
4
+ /** Microsoft Teams Incoming Webhook URL. Required. */
5
+ webhookUrl: string;
6
+ }
7
+ /**
8
+ * Microsoft Teams chat provider via Incoming Webhook. When `blocks` is provided it is
9
+ * sent verbatim (e.g. an Adaptive Card / MessageCard), otherwise a plain MessageCard is
10
+ * built from `text`. Edge-safe — `fetch` only.
11
+ * @see https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using
12
+ */
13
+ declare const msTeamsProvider: ProviderFactory<MsTeamsConfig, ChatPayload>;
14
+ export { type MsTeamsConfig, msTeamsProvider };
@@ -0,0 +1 @@
1
+ import{default as a}from"../../../packem_shared/msTeamsProvider-DBhrmuSd.js";export{a as msTeamsProvider};
@@ -0,0 +1,19 @@
1
+ import { d as BaseConfig, b as ChatPayload } from "../../../packem_shared/types.d-GUzX1jTk.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-BQAGriz6.js";
3
+ interface SlackConfig extends BaseConfig {
4
+ /** Default channel id/name used when the payload omits `to` (Web API mode). */
5
+ defaultChannel?: string;
6
+ /** Override the API base URL (Web API mode). */
7
+ endpoint?: string;
8
+ /** Bot/User OAuth token (`xoxb-...`) for the Web API. Required unless `webhookUrl` is set. */
9
+ token?: string;
10
+ /** Incoming webhook URL. When set, takes precedence over the Web API. */
11
+ webhookUrl?: string;
12
+ }
13
+ /**
14
+ * Slack chat provider. Supports both Incoming Webhooks (`webhookUrl`) and the Web API
15
+ * (`token` + channel). Edge-safe — `fetch` only.
16
+ * @see https://api.slack.com/methods/chat.postMessage
17
+ */
18
+ declare const slackProvider: ProviderFactory<SlackConfig, ChatPayload>;
19
+ export { type SlackConfig, slackProvider };
@@ -0,0 +1 @@
1
+ import{default as e}from"../../../packem_shared/slackProvider-N1wNtAZ3.js";export{e as slackProvider};
@@ -0,0 +1,18 @@
1
+ import { d as BaseConfig, b as ChatPayload } from "../../../packem_shared/types.d-GUzX1jTk.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-BQAGriz6.js";
3
+ interface TelegramConfig extends BaseConfig {
4
+ /** Telegram bot token (`123456:ABC-DEF...`). Required. */
5
+ botToken: string;
6
+ /** Default chat id used when the payload omits `to`. */
7
+ defaultChatId?: number | string;
8
+ /** Override the API base URL. */
9
+ endpoint?: string;
10
+ /** Default parse mode (`MarkdownV2`, `HTML`, ...). */
11
+ parseMode?: string;
12
+ }
13
+ /**
14
+ * Telegram chat provider via the Bot API. Edge-safe — `fetch` only.
15
+ * @see https://core.telegram.org/bots/api#sendmessage
16
+ */
17
+ declare const telegramProvider: ProviderFactory<TelegramConfig, ChatPayload>;
18
+ export { type TelegramConfig, telegramProvider };
@@ -0,0 +1 @@
1
+ import{default as a}from"../../../packem_shared/telegramProvider-jqR5BhJL.js";export{a as telegramProvider};
@@ -0,0 +1,16 @@
1
+ import { B as BaseNotificationPayload } from "../../packem_shared/types.d-GUzX1jTk.js";
2
+ import { P as Provider } from "../../packem_shared/provider.d-BQAGriz6.js";
3
+ interface FailoverConfig {
4
+ /** Provider id reported on results (default `"failover"`). */
5
+ id?: string;
6
+ /** Logger for failover transitions. */
7
+ logger?: Console;
8
+ }
9
+ /**
10
+ * Wraps several same-channel providers and tries each in order until one succeeds.
11
+ * @param providers The providers to fail over between (highest priority first).
12
+ * @param config Optional config.
13
+ * @returns A composite provider.
14
+ */
15
+ declare const failoverProvider: <PayloadT extends BaseNotificationPayload>(providers: Provider<unknown, PayloadT>[], config?: FailoverConfig) => Provider<unknown, PayloadT>;
16
+ export { type FailoverConfig, failoverProvider };
@@ -0,0 +1 @@
1
+ import{failoverProvider as e}from"../../packem_shared/failoverProvider-D1dAmW8U.js";export{e as failoverProvider};
@@ -0,0 +1,29 @@
1
+ import { C as ChannelType, B as BaseNotificationPayload } from "../../packem_shared/types.d-GUzX1jTk.js";
2
+ import { a as ProviderFactory } from "../../packem_shared/provider.d-BQAGriz6.js";
3
+ interface MockSentMessage {
4
+ messageId: string;
5
+ payload: BaseNotificationPayload;
6
+ timestamp: Date;
7
+ }
8
+ interface MockProviderConfig {
9
+ /** Channel to advertise (defaults to `"sms"`). */
10
+ channel?: ChannelType;
11
+ /** When set, every `send` fails with this message. */
12
+ failWith?: string;
13
+ /** Provider id (defaults to `"mock"`). */
14
+ id?: string;
15
+ }
16
+ interface MockProviderInstance {
17
+ /** Clears the recorded message log. */
18
+ clear: () => void;
19
+ /** Returns the most recently sent message, if any. */
20
+ last: () => MockSentMessage | undefined;
21
+ /** All messages recorded by this provider. */
22
+ readonly sent: MockSentMessage[];
23
+ }
24
+ /**
25
+ * In-memory provider for tests and local development. Records every payload it is
26
+ * asked to send and can be configured to fail deterministically.
27
+ */
28
+ declare const mockProvider: ProviderFactory<MockProviderConfig, BaseNotificationPayload, MockProviderInstance>;
29
+ export { type MockProviderConfig, type MockProviderInstance, type MockSentMessage, mockProvider };
@@ -0,0 +1 @@
1
+ import{mockProvider as e}from"../../packem_shared/mockProvider-BLwTZlkw.js";export{e as mockProvider};
@@ -0,0 +1,21 @@
1
+ import { T as Tracer } from "../../packem_shared/tracer.d-Co1s_NwG.js";
2
+ import { B as BaseNotificationPayload } from "../../packem_shared/types.d-GUzX1jTk.js";
3
+ import { P as Provider } from "../../packem_shared/provider.d-BQAGriz6.js";
4
+ interface OtelProviderConfig {
5
+ /**
6
+ * The OpenTelemetry {@link Tracer} used to create spans. When omitted, a no-op tracer is
7
+ * used so the wrapper is inert until the host application supplies one (keeping
8
+ * `@opentelemetry/api` an optional peer dependency).
9
+ */
10
+ tracer?: Tracer;
11
+ }
12
+ /**
13
+ * Wraps any {@link Provider} and records an OpenTelemetry span per `send` call. Edge-safe:
14
+ * `@opentelemetry/api` is runtime-agnostic and the tracer is injected, so nothing is bundled
15
+ * when tracing is disabled.
16
+ * @param inner The provider to wrap.
17
+ * @param config Optional config; supply a `tracer` to emit real spans.
18
+ * @returns A provider that delegates to `inner` while tracing each send.
19
+ */
20
+ declare const otelProvider: <PayloadT extends BaseNotificationPayload>(inner: Provider<unknown, PayloadT>, config?: OtelProviderConfig) => Provider<unknown, PayloadT>;
21
+ export { type OtelProviderConfig, otelProvider };
@@ -0,0 +1 @@
1
+ import{otelProvider as e}from"../../packem_shared/otelProvider-b6LVo0BS.js";export{e as otelProvider};
@@ -0,0 +1,24 @@
1
+ import { d as BaseConfig, P as PushPayload } from "../../../packem_shared/types.d-GUzX1jTk.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-BQAGriz6.js";
3
+ interface ApnsConfig extends BaseConfig {
4
+ /** The app bundle id, sent as the `apns-topic` header. */
5
+ bundleId: string;
6
+ /** The 10-character Key ID of the signing key, used as the JWT `kid`. */
7
+ keyId: string;
8
+ /** Send to the production gateway when `true`, otherwise the sandbox gateway (default `false`). */
9
+ production?: boolean;
10
+ /** The ES256 signing key in PEM format (contents of the `.p8` file). */
11
+ signingKey: string;
12
+ /** The 10-character Apple Developer Team ID, used as the JWT `iss`. */
13
+ teamId: string;
14
+ }
15
+ /**
16
+ * Apple Push Notification service (APNs) provider.
17
+ *
18
+ * NODE-ONLY: APNs mandates HTTP/2 with token-based (JWT/ES256) auth, so this provider uses
19
+ * `node:http2` and `node:crypto`. It is NOT edge/Cloudflare-Workers-safe and will not run on
20
+ * Web-only runtimes that lack `node:http2`.
21
+ * @see https://developer.apple.com/documentation/usernotifications/sending-notification-requests-to-apns
22
+ */
23
+ declare const apnsProvider: ProviderFactory<ApnsConfig, PushPayload>;
24
+ export { type ApnsConfig, apnsProvider };
@@ -0,0 +1 @@
1
+ import{default as e}from"../../../packem_shared/apnsProvider-C9WSv5sc.js";export{e as apnsProvider};
@@ -0,0 +1,14 @@
1
+ import { d as BaseConfig, P as PushPayload } from "../../../packem_shared/types.d-GUzX1jTk.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-BQAGriz6.js";
3
+ interface ExpoConfig extends BaseConfig {
4
+ /** Expo access token (required for projects with enhanced security). */
5
+ accessToken?: string;
6
+ /** Override the API base URL. */
7
+ endpoint?: string;
8
+ }
9
+ /**
10
+ * Expo push provider. Sends a batch of device tokens in one call. Edge-safe — `fetch` only.
11
+ * @see https://docs.expo.dev/push-notifications/sending-notifications/
12
+ */
13
+ declare const expoProvider: ProviderFactory<ExpoConfig, PushPayload>;
14
+ export { type ExpoConfig, expoProvider };