@visulima/notification 1.0.8 → 1.0.10

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 (108) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/channels/email/index.d.ts +23 -23
  3. package/dist/channels/email/index.js +1 -1
  4. package/dist/channels/inapp/index.d.ts +31 -31
  5. package/dist/digest/index.d.ts +55 -55
  6. package/dist/digest/index.js +1 -1
  7. package/dist/events/index.d.ts +16 -16
  8. package/dist/i18n/index.d.ts +21 -21
  9. package/dist/i18n/index.js +1 -1
  10. package/dist/index.d.ts +97 -108
  11. package/dist/index.js +1 -1
  12. package/dist/layouts/index.d.ts +28 -28
  13. package/dist/middleware/index.d.ts +49 -49
  14. package/dist/middleware/index.js +1 -1
  15. package/dist/packem_shared/{Notification-B22tuJPy.js → Notification-DH2mcFWI.js} +1 -1
  16. package/dist/packem_shared/NotificationError-B8CyoEaX.js +1 -0
  17. package/dist/packem_shared/{RequiredOptionError-CuL42XRq.js → RequiredOptionError-Bs282gKK.js} +1 -1
  18. package/dist/packem_shared/apnsProvider-BPH0pHvd.js +1 -0
  19. package/dist/packem_shared/{circuitBreakerMiddleware-BlZN7SVT.js → circuitBreakerMiddleware-CRBi0H7e.js} +1 -1
  20. package/dist/packem_shared/{createDigester-vMNPejGF.js → createDigester-DenmT8_X.js} +1 -1
  21. package/dist/packem_shared/{createNotificationWorkflow-B70OgeED.js → createNotificationWorkflow-5AY-ays0.js} +1 -1
  22. package/dist/packem_shared/{createTranslator-CY91C2eS.js → createTranslator-ByyvYNfG.js} +1 -1
  23. package/dist/packem_shared/{discordProvider-BhfXcCcI.js → discordProvider-BvKwrC8K.js} +1 -1
  24. package/dist/packem_shared/{emailChannel-CNDlX96Q.js → emailChannel-Cf8wZPZL.js} +1 -1
  25. package/dist/packem_shared/{expoProvider-DsZR4sUk.js → expoProvider-13gY7Ne8.js} +1 -1
  26. package/dist/packem_shared/{failoverProvider-D1dAmW8U.js → failoverProvider-DXcwmYev.js} +1 -1
  27. package/dist/packem_shared/{fcmProvider-DWRx8XBv.js → fcmProvider-DsGjzBzz.js} +1 -1
  28. package/dist/packem_shared/{messageBirdProvider-BfiTaNLn.js → messageBirdProvider-D1c3jUqj.js} +1 -1
  29. package/dist/packem_shared/{mockProvider-BLwTZlkw.js → mockProvider-DZ3immtm.js} +1 -1
  30. package/dist/packem_shared/{msTeamsProvider-DrmL3RYX.js → msTeamsProvider-Cd-BUhH1.js} +1 -1
  31. package/dist/packem_shared/notification.d-D0ado_cy.d.ts +104 -0
  32. package/dist/packem_shared/{plivoProvider-Dr8d5yD3.js → plivoProvider-C_koQ8X-.js} +1 -1
  33. package/dist/packem_shared/{provider.d-BQAGriz6.d.ts → provider.d-Dh32nRm9.d.ts} +10 -10
  34. package/dist/packem_shared/{roundRobinProvider-BetXJUUm.js → roundRobinProvider-CK3Vyc_u.js} +1 -1
  35. package/dist/packem_shared/{slackProvider-DPG1IlA0.js → slackProvider-B92QDf3e.js} +1 -1
  36. package/dist/packem_shared/{sms-CU-OZvNU.js → sms-64HGUCLu.js} +1 -1
  37. package/dist/packem_shared/{snsProvider-C2T2UxDK.js → snsProvider-CPGjOUP_.js} +1 -1
  38. package/dist/packem_shared/{telegramProvider-wyx3ksVm.js → telegramProvider-BmmroM5A.js} +1 -1
  39. package/dist/packem_shared/{telnyxProvider-jgpEwgPh.js → telnyxProvider-C41tE4VF.js} +1 -1
  40. package/dist/packem_shared/{tracer.d-Co1s_NwG.d.ts → tracer.d-BPznIQx9.d.ts} +2 -2
  41. package/dist/packem_shared/{twilioProvider-DMYWqvgZ.js → twilioProvider-DanDTzi3.js} +1 -1
  42. package/dist/packem_shared/{types.d-67TogK4k.d.ts → types.d--kw9ifOI.d.ts} +6 -6
  43. package/dist/packem_shared/types.d-BU-37j3S.d.ts +10 -0
  44. package/dist/packem_shared/{types.d-GUzX1jTk.d.ts → types.d-C7l7qdMG.d.ts} +52 -52
  45. package/dist/packem_shared/{types.d-CximoA8M.d.ts → types.d-CRs03TYV.d.ts} +13 -13
  46. package/dist/packem_shared/{types.d-C1GoEAlI.d-Bv3grfyD.d.ts → types.d-CcjfiGpo.d-DuZME7ry.d.ts} +27 -34
  47. package/dist/packem_shared/{vonageProvider-CT4KoWXu.js → vonageProvider-epeGBWW8.js} +1 -1
  48. package/dist/packem_shared/{webPushProvider-DwjmWASr.js → webPushProvider-K6-Drhaf.js} +1 -1
  49. package/dist/packem_shared/{webhookProvider-CPA1nKXJ.js → webhookProvider-DlwFyaGc.js} +1 -1
  50. package/dist/preferences/index.d.ts +19 -19
  51. package/dist/providers/chat/discord/index.d.ts +5 -5
  52. package/dist/providers/chat/discord/index.js +1 -1
  53. package/dist/providers/chat/msteams/index.d.ts +7 -7
  54. package/dist/providers/chat/msteams/index.js +1 -1
  55. package/dist/providers/chat/slack/index.d.ts +6 -6
  56. package/dist/providers/chat/slack/index.js +1 -1
  57. package/dist/providers/chat/telegram/index.d.ts +5 -5
  58. package/dist/providers/chat/telegram/index.js +1 -1
  59. package/dist/providers/failover/index.d.ts +7 -7
  60. package/dist/providers/failover/index.js +1 -1
  61. package/dist/providers/mock/index.d.ts +5 -5
  62. package/dist/providers/mock/index.js +1 -1
  63. package/dist/providers/opentelemetry/index.d.ts +14 -14
  64. package/dist/providers/push/apns/index.d.ts +9 -9
  65. package/dist/providers/push/apns/index.js +1 -1
  66. package/dist/providers/push/expo/index.d.ts +5 -5
  67. package/dist/providers/push/expo/index.js +1 -1
  68. package/dist/providers/push/fcm/index.d.ts +13 -13
  69. package/dist/providers/push/fcm/index.js +1 -1
  70. package/dist/providers/push/web-push/index.d.ts +11 -11
  71. package/dist/providers/push/web-push/index.js +1 -1
  72. package/dist/providers/roundrobin/index.d.ts +8 -8
  73. package/dist/providers/roundrobin/index.js +1 -1
  74. package/dist/providers/sms/messagebird/index.d.ts +5 -5
  75. package/dist/providers/sms/messagebird/index.js +1 -1
  76. package/dist/providers/sms/plivo/index.d.ts +5 -5
  77. package/dist/providers/sms/plivo/index.js +1 -1
  78. package/dist/providers/sms/sns/index.d.ts +6 -6
  79. package/dist/providers/sms/sns/index.js +1 -1
  80. package/dist/providers/sms/telnyx/index.d.ts +5 -5
  81. package/dist/providers/sms/telnyx/index.js +1 -1
  82. package/dist/providers/sms/twilio/index.d.ts +5 -5
  83. package/dist/providers/sms/twilio/index.js +1 -1
  84. package/dist/providers/sms/vonage/index.d.ts +5 -5
  85. package/dist/providers/sms/vonage/index.js +1 -1
  86. package/dist/providers/webhook/index.d.ts +7 -7
  87. package/dist/providers/webhook/index.js +1 -1
  88. package/dist/queue/bullmq-queue.d.ts +24 -24
  89. package/dist/queue/index.d.ts +15 -15
  90. package/dist/queue/pg-boss-queue.d.ts +26 -26
  91. package/dist/queue/sqs-queue.d.ts +27 -27
  92. package/dist/queue/unstorage-queue.d.ts +14 -14
  93. package/dist/routing/index.d.ts +22 -22
  94. package/dist/template-engines/handlebars.d.ts +13 -13
  95. package/dist/template-engines/handlebars.js +1 -1
  96. package/dist/template-engines/liquid.d.ts +13 -13
  97. package/dist/template-engines/liquid.js +1 -1
  98. package/dist/template-engines/string.d.ts +17 -17
  99. package/dist/utils/result.d.ts +32 -32
  100. package/dist/utils/result.js +1 -1
  101. package/dist/webhooks/index.d.ts +84 -84
  102. package/dist/workflow/index.d.ts +42 -42
  103. package/dist/workflow/index.js +1 -1
  104. package/package.json +2 -2
  105. package/dist/packem_shared/NotificationError-DVfMJQ1u.js +0 -1
  106. package/dist/packem_shared/apnsProvider-C9WSv5sc.js +0 -1
  107. package/dist/packem_shared/notification.d-DFCVTods.d.ts +0 -104
  108. package/dist/packem_shared/types.d-td-F2Oh0.d.ts +0 -10
@@ -2,9 +2,9 @@ import { StandardSchemaV1 } from '@standard-schema/spec';
2
2
  /** A value that may be returned directly or as a promise. */
3
3
  type MaybePromise<T> = Promise<T> | T;
4
4
  /**
5
- * A human-friendly duration. Either a raw millisecond count, a structured
6
- * `{ amount, unit }` pair, or a `{ cron }` expression resolved against "now".
7
- */
5
+ * A human-friendly duration. Either a raw millisecond count, a structured
6
+ * `{ amount, unit }` pair, or a `{ cron }` expression resolved against "now".
7
+ */
8
8
  type Duration = number | {
9
9
  amount: number;
10
10
  unit: DurationUnit;
@@ -14,43 +14,41 @@ type Duration = number | {
14
14
  };
15
15
  /** Units accepted by the structured {@link Duration} form. */
16
16
  type DurationUnit = "days" | "hours" | "milliseconds" | "minutes" | "ms" | "seconds" | "weeks";
17
- /** A JSON-serialisable snapshot of an `Error`, persisted in run history. */
18
-
19
17
  /**
20
- * The context handed to a workflow body. Every durable operation goes through
21
- * `ctx` so the engine can record, skip and resume it deterministically.
22
- *
23
- * IMPORTANT: any side effect that must run *exactly once* has to be wrapped in
24
- * {@link RunContext.step}. Code outside `step`/`sleep`/`waitForEvent` re-executes
25
- * on every replay.
26
- */
18
+ * The context handed to a workflow body. Every durable operation goes through
19
+ * `ctx` so the engine can record, skip and resume it deterministically.
20
+ *
21
+ * IMPORTANT: any side effect that must run *exactly once* has to be wrapped in
22
+ * {@link RunContext.step}. Code outside `step`/`sleep`/`waitForEvent` re-executes
23
+ * on every replay.
24
+ */
27
25
  interface RunContext<PayloadT = unknown> {
28
26
  /** The validated trigger payload. */
29
27
  readonly payload: PayloadT;
30
28
  /** The id of the current run. */
31
29
  readonly runId: string;
32
30
  /**
33
- * Durably pause the run for a duration, then resume.
34
- * @param id A stable, unique id for this sleep.
35
- * @param duration How long to pause.
36
- */
31
+ * Durably pause the run for a duration, then resume.
32
+ * @param id A stable, unique id for this sleep.
33
+ * @param duration How long to pause.
34
+ */
37
35
  sleep: (id: string, duration: Duration) => Promise<void>;
38
36
  /**
39
- * Run a side effect exactly once. The result is recorded; on replay the
40
- * recorded value is returned without re-executing the function.
41
- * @param id A stable, unique id for this step within the workflow.
42
- * @param function_ The side effect to run.
43
- */
37
+ * Run a side effect exactly once. The result is recorded; on replay the
38
+ * recorded value is returned without re-executing the function.
39
+ * @param id A stable, unique id for this step within the workflow.
40
+ * @param function_ The side effect to run.
41
+ */
44
42
  step: <T>(id: string, function_: () => MaybePromise<T>) => Promise<T>;
45
43
  /**
46
- * Durably suspend until an external event is delivered via
47
- * `runtime.signal(runId, name, payload)`, or the optional timeout elapses.
48
- * @param id A stable, unique id for this wait.
49
- * @param name The event name to wait for.
50
- * @param options Optional settings for the wait.
51
- * @param options.timeout How long to wait before resolving to `undefined`.
52
- * @returns The signalled payload, or `undefined` on timeout.
53
- */
44
+ * Durably suspend until an external event is delivered via
45
+ * `runtime.signal(runId, name, payload)`, or the optional timeout elapses.
46
+ * @param id A stable, unique id for this wait.
47
+ * @param name The event name to wait for.
48
+ * @param options Optional settings for the wait.
49
+ * @param options.timeout How long to wait before resolving to `undefined`.
50
+ * @returns The signalled payload, or `undefined` on timeout.
51
+ */
54
52
  waitForEvent: <T = unknown>(id: string, name: string, options?: {
55
53
  timeout?: Duration;
56
54
  }) => Promise<T | undefined>;
@@ -75,9 +73,4 @@ interface WorkflowDefinition<PayloadT = unknown, OutputT = unknown> extends Work
75
73
  /** Brand marking this object as a defined workflow. */
76
74
  readonly [WORKFLOW_BRAND]: true;
77
75
  }
78
- /**
79
- * The persisted form of a run. `snapshot` is the opaque XState persisted
80
- * snapshot; `status`, `wakeAt` and `eventName` are denormalised so a store can
81
- * answer {@link WorkflowStore.due} and signal lookups without parsing it.
82
- */
83
76
  export { Duration as D, MaybePromise as M, WorkflowConfig as W, WorkflowDefinition as a };
@@ -1 +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-DT3tyixg.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};
1
+ import n from"./RequiredOptionError-Bs282gKK.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-DT3tyixg.js";import{s as v,b as w}from"./sms-64HGUCLu.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};
@@ -1 +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-DT3tyixg.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};
1
+ import K from"./RequiredOptionError-Bs282gKK.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-DT3tyixg.js";import{n as U}from"./id-C_FRCsUM.js";import{a as $}from"./sms-64HGUCLu.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};
@@ -1 +1 @@
1
- import s from"./NotificationError-DVfMJQ1u.js";import i from"./RequiredOptionError-CuL42XRq.js";import{r as d}from"./http-DT3tyixg.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};
1
+ import s from"./NotificationError-B8CyoEaX.js";import i from"./RequiredOptionError-Bs282gKK.js";import{r as d}from"./http-DT3tyixg.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};
@@ -1,12 +1,12 @@
1
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";
2
+ import { C as ChannelType } from "../packem_shared/types.d-C7l7qdMG.js";
3
+ import "../packem_shared/notification.d-D0ado_cy.js";
4
+ import "../packem_shared/types.d-CRs03TYV.js";
5
+ import "../packem_shared/provider.d-Dh32nRm9.js";
6
6
  /**
7
- * A subscriber's channel preferences. A channel set to `false` is opted out; channels
8
- * absent default to allowed.
9
- */
7
+ * A subscriber's channel preferences. A channel set to `false` is opted out; channels
8
+ * absent default to allowed.
9
+ */
10
10
  interface SubscriberPreferences {
11
11
  channels: Partial<Record<ChannelType, boolean>>;
12
12
  }
@@ -15,16 +15,16 @@ interface IsAllowedOptions {
15
15
  critical?: boolean;
16
16
  }
17
17
  /**
18
- * Stores per-subscriber channel preferences and answers allow/deny questions.
19
- */
18
+ * Stores per-subscriber channel preferences and answers allow/deny questions.
19
+ */
20
20
  interface PreferenceStore {
21
21
  get: (subscriberId: string) => Promise<SubscriberPreferences> | SubscriberPreferences;
22
22
  isAllowed: (subscriberId: string, channel: ChannelType, options?: IsAllowedOptions) => Promise<boolean> | boolean;
23
23
  set: (subscriberId: string, preferences: SubscriberPreferences) => Promise<void> | void;
24
24
  }
25
25
  /**
26
- * In-memory {@link PreferenceStore}.
27
- */
26
+ * In-memory {@link PreferenceStore}.
27
+ */
28
28
  declare class MemoryPreferenceStore implements PreferenceStore {
29
29
  #private;
30
30
  get(subscriberId: string): SubscriberPreferences;
@@ -32,14 +32,14 @@ declare class MemoryPreferenceStore implements PreferenceStore {
32
32
  isAllowed(subscriberId: string, channel: ChannelType, options?: IsAllowedOptions): boolean;
33
33
  }
34
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
- */
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
43
  declare const preferencesGate: (store: PreferenceStore, options?: {
44
44
  critical?: boolean;
45
45
  subscriberId?: (payload: {
@@ -1,5 +1,5 @@
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";
1
+ import { d as BaseConfig, b as ChatPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface DiscordConfig extends BaseConfig {
4
4
  /** Override the bot username for the message. */
5
5
  username?: string;
@@ -7,8 +7,8 @@ interface DiscordConfig extends BaseConfig {
7
7
  webhookUrl: string;
8
8
  }
9
9
  /**
10
- * Discord chat provider via Incoming Webhooks. Edge-safe — `fetch` only.
11
- * @see https://discord.com/developers/docs/resources/webhook#execute-webhook
12
- */
10
+ * Discord chat provider via Incoming Webhooks. Edge-safe — `fetch` only.
11
+ * @see https://discord.com/developers/docs/resources/webhook#execute-webhook
12
+ */
13
13
  declare const discordProvider: ProviderFactory<DiscordConfig, ChatPayload>;
14
14
  export { type DiscordConfig, discordProvider };
@@ -1 +1 @@
1
- import{default as o}from"../../../packem_shared/discordProvider-BhfXcCcI.js";export{o as discordProvider};
1
+ import{default as o}from"../../../packem_shared/discordProvider-BvKwrC8K.js";export{o as discordProvider};
@@ -1,14 +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";
1
+ import { d as BaseConfig, b as ChatPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface MsTeamsConfig extends BaseConfig {
4
4
  /** Microsoft Teams Incoming Webhook URL. Required. */
5
5
  webhookUrl: string;
6
6
  }
7
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
- */
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
13
  declare const msTeamsProvider: ProviderFactory<MsTeamsConfig, ChatPayload>;
14
14
  export { type MsTeamsConfig, msTeamsProvider };
@@ -1 +1 @@
1
- import{default as a}from"../../../packem_shared/msTeamsProvider-DrmL3RYX.js";export{a as msTeamsProvider};
1
+ import{default as a}from"../../../packem_shared/msTeamsProvider-Cd-BUhH1.js";export{a as msTeamsProvider};
@@ -1,5 +1,5 @@
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";
1
+ import { d as BaseConfig, b as ChatPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface SlackConfig extends BaseConfig {
4
4
  /** Default channel id/name used when the payload omits `to` (Web API mode). */
5
5
  defaultChannel?: string;
@@ -11,9 +11,9 @@ interface SlackConfig extends BaseConfig {
11
11
  webhookUrl?: string;
12
12
  }
13
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
- */
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
18
  declare const slackProvider: ProviderFactory<SlackConfig, ChatPayload>;
19
19
  export { type SlackConfig, slackProvider };
@@ -1 +1 @@
1
- import{default as e}from"../../../packem_shared/slackProvider-DPG1IlA0.js";export{e as slackProvider};
1
+ import{default as e}from"../../../packem_shared/slackProvider-B92QDf3e.js";export{e as slackProvider};
@@ -1,5 +1,5 @@
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";
1
+ import { d as BaseConfig, b as ChatPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface TelegramConfig extends BaseConfig {
4
4
  /** Telegram bot token (`123456:ABC-DEF...`). Required. */
5
5
  botToken: string;
@@ -11,8 +11,8 @@ interface TelegramConfig extends BaseConfig {
11
11
  parseMode?: string;
12
12
  }
13
13
  /**
14
- * Telegram chat provider via the Bot API. Edge-safe — `fetch` only.
15
- * @see https://core.telegram.org/bots/api#sendmessage
16
- */
14
+ * Telegram chat provider via the Bot API. Edge-safe — `fetch` only.
15
+ * @see https://core.telegram.org/bots/api#sendmessage
16
+ */
17
17
  declare const telegramProvider: ProviderFactory<TelegramConfig, ChatPayload>;
18
18
  export { type TelegramConfig, telegramProvider };
@@ -1 +1 @@
1
- import{default as a}from"../../../packem_shared/telegramProvider-wyx3ksVm.js";export{a as telegramProvider};
1
+ import{default as a}from"../../../packem_shared/telegramProvider-BmmroM5A.js";export{a as telegramProvider};
@@ -1,5 +1,5 @@
1
- import { B as BaseNotificationPayload } from "../../packem_shared/types.d-GUzX1jTk.js";
2
- import { P as Provider } from "../../packem_shared/provider.d-BQAGriz6.js";
1
+ import { B as BaseNotificationPayload } from "../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { P as Provider } from "../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface FailoverConfig {
4
4
  /** Provider id reported on results (default `"failover"`). */
5
5
  id?: string;
@@ -7,10 +7,10 @@ interface FailoverConfig {
7
7
  logger?: Console;
8
8
  }
9
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
- */
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
15
  declare const failoverProvider: <PayloadT extends BaseNotificationPayload>(providers: Provider<unknown, PayloadT>[], config?: FailoverConfig) => Provider<unknown, PayloadT>;
16
16
  export { type FailoverConfig, failoverProvider };
@@ -1 +1 @@
1
- import{failoverProvider as e}from"../../packem_shared/failoverProvider-D1dAmW8U.js";export{e as failoverProvider};
1
+ import{failoverProvider as e}from"../../packem_shared/failoverProvider-DXcwmYev.js";export{e as failoverProvider};
@@ -1,5 +1,5 @@
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";
1
+ import { C as ChannelType, B as BaseNotificationPayload } from "../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface MockSentMessage {
4
4
  messageId: string;
5
5
  payload: BaseNotificationPayload;
@@ -22,8 +22,8 @@ interface MockProviderInstance {
22
22
  readonly sent: MockSentMessage[];
23
23
  }
24
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
- */
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
28
  declare const mockProvider: ProviderFactory<MockProviderConfig, BaseNotificationPayload, MockProviderInstance>;
29
29
  export { type MockProviderConfig, type MockProviderInstance, type MockSentMessage, mockProvider };
@@ -1 +1 @@
1
- import{mockProvider as e}from"../../packem_shared/mockProvider-BLwTZlkw.js";export{e as mockProvider};
1
+ import{mockProvider as e}from"../../packem_shared/mockProvider-DZ3immtm.js";export{e as mockProvider};
@@ -1,21 +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";
1
+ import { T as Tracer } from "../../packem_shared/tracer.d-BPznIQx9.js";
2
+ import { B as BaseNotificationPayload } from "../../packem_shared/types.d-C7l7qdMG.js";
3
+ import { P as Provider } from "../../packem_shared/provider.d-Dh32nRm9.js";
4
4
  interface OtelProviderConfig {
5
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
- */
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
10
  tracer?: Tracer;
11
11
  }
12
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
- */
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
20
  declare const otelProvider: <PayloadT extends BaseNotificationPayload>(inner: Provider<unknown, PayloadT>, config?: OtelProviderConfig) => Provider<unknown, PayloadT>;
21
21
  export { type OtelProviderConfig, otelProvider };
@@ -1,5 +1,5 @@
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";
1
+ import { d as BaseConfig, P as PushPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface ApnsConfig extends BaseConfig {
4
4
  /** The app bundle id, sent as the `apns-topic` header. */
5
5
  bundleId: string;
@@ -13,12 +13,12 @@ interface ApnsConfig extends BaseConfig {
13
13
  teamId: string;
14
14
  }
15
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
- */
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
23
  declare const apnsProvider: ProviderFactory<ApnsConfig, PushPayload>;
24
24
  export { type ApnsConfig, apnsProvider };
@@ -1 +1 @@
1
- import{default as e}from"../../../packem_shared/apnsProvider-C9WSv5sc.js";export{e as apnsProvider};
1
+ import{default as e}from"../../../packem_shared/apnsProvider-BPH0pHvd.js";export{e as apnsProvider};
@@ -1,5 +1,5 @@
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";
1
+ import { d as BaseConfig, P as PushPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface ExpoConfig extends BaseConfig {
4
4
  /** Expo access token (required for projects with enhanced security). */
5
5
  accessToken?: string;
@@ -7,8 +7,8 @@ interface ExpoConfig extends BaseConfig {
7
7
  endpoint?: string;
8
8
  }
9
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
- */
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
13
  declare const expoProvider: ProviderFactory<ExpoConfig, PushPayload>;
14
14
  export { type ExpoConfig, expoProvider };
@@ -1 +1 @@
1
- import{default as r}from"../../../packem_shared/expoProvider-DsZR4sUk.js";export{r as expoProvider};
1
+ import{default as r}from"../../../packem_shared/expoProvider-13gY7Ne8.js";export{r as expoProvider};
@@ -1,26 +1,26 @@
1
- import { M as MaybePromise, 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";
1
+ import { M as MaybePromise, d as BaseConfig, P as PushPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface FcmConfig extends BaseConfig {
4
4
  /**
5
- * A static OAuth2 access token. Prefer {@link FcmConfig.getAccessToken} for tokens
6
- * that expire. One of `accessToken` / `getAccessToken` is required.
7
- */
5
+ * A static OAuth2 access token. Prefer {@link FcmConfig.getAccessToken} for tokens
6
+ * that expire. One of `accessToken` / `getAccessToken` is required.
7
+ */
8
8
  accessToken?: string;
9
9
  /** Override the API base URL. */
10
10
  endpoint?: string;
11
11
  /**
12
- * Returns a fresh OAuth2 access token. Lets you plug in `google-auth-library` /
13
- * `firebase-admin` without bundling Google's SDK or `node:crypto` — keeping the
14
- * provider edge-safe.
15
- */
12
+ * Returns a fresh OAuth2 access token. Lets you plug in `google-auth-library` /
13
+ * `firebase-admin` without bundling Google's SDK or `node:crypto` — keeping the
14
+ * provider edge-safe.
15
+ */
16
16
  getAccessToken?: () => MaybePromise<string>;
17
17
  /** Firebase project id. Required. */
18
18
  projectId: string;
19
19
  }
20
20
  /**
21
- * Firebase Cloud Messaging provider (HTTP v1). Edge-safe — you supply the OAuth2 token
22
- * (static or via `getAccessToken`), so no `node:crypto`/Google SDK is bundled.
23
- * @see https://firebase.google.com/docs/cloud-messaging/send-message
24
- */
21
+ * Firebase Cloud Messaging provider (HTTP v1). Edge-safe — you supply the OAuth2 token
22
+ * (static or via `getAccessToken`), so no `node:crypto`/Google SDK is bundled.
23
+ * @see https://firebase.google.com/docs/cloud-messaging/send-message
24
+ */
25
25
  declare const fcmProvider: ProviderFactory<FcmConfig, PushPayload>;
26
26
  export { type FcmConfig, fcmProvider };
@@ -1 +1 @@
1
- import{default as f}from"../../../packem_shared/fcmProvider-DWRx8XBv.js";export{f as fcmProvider};
1
+ import{default as f}from"../../../packem_shared/fcmProvider-DsGjzBzz.js";export{f as fcmProvider};
@@ -1,9 +1,9 @@
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";
1
+ import { d as BaseConfig, P as PushPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  /**
4
- * A W3C Push API subscription. The `to` field of a push payload carries one of these
5
- * (as an object, or its JSON string form) when targeting the web-push provider.
6
- */
4
+ * A W3C Push API subscription. The `to` field of a push payload carries one of these
5
+ * (as an object, or its JSON string form) when targeting the web-push provider.
6
+ */
7
7
  interface PushSubscriptionLike {
8
8
  /** The push service endpoint URL the encrypted payload is delivered to. */
9
9
  endpoint: string;
@@ -26,11 +26,11 @@ interface WebPushConfig extends BaseConfig {
26
26
  vapidSubject: string;
27
27
  }
28
28
  /**
29
- * Web Push provider (VAPID + RFC 8291 `aes128gcm`). Fully edge-safe — JWT signing and
30
- * payload encryption run on Web Crypto (ECDSA/ECDH P-256, HKDF, AES-GCM); no `node:*`.
31
- * The `to` target carries a Push API subscription (object or its JSON string form).
32
- * @see https://datatracker.ietf.org/doc/html/rfc8291
33
- * @see https://datatracker.ietf.org/doc/html/rfc8292
34
- */
29
+ * Web Push provider (VAPID + RFC 8291 `aes128gcm`). Fully edge-safe — JWT signing and
30
+ * payload encryption run on Web Crypto (ECDSA/ECDH P-256, HKDF, AES-GCM); no `node:*`.
31
+ * The `to` target carries a Push API subscription (object or its JSON string form).
32
+ * @see https://datatracker.ietf.org/doc/html/rfc8291
33
+ * @see https://datatracker.ietf.org/doc/html/rfc8292
34
+ */
35
35
  declare const webPushProvider: ProviderFactory<WebPushConfig, PushPayload>;
36
36
  export { type PushSubscriptionLike, type WebPushConfig, webPushProvider };
@@ -1 +1 @@
1
- import{default as o}from"../../../packem_shared/webPushProvider-DwjmWASr.js";export{o as webPushProvider};
1
+ import{default as o}from"../../../packem_shared/webPushProvider-K6-Drhaf.js";export{o as webPushProvider};
@@ -1,5 +1,5 @@
1
- import { B as BaseNotificationPayload } from "../../packem_shared/types.d-GUzX1jTk.js";
2
- import { P as Provider } from "../../packem_shared/provider.d-BQAGriz6.js";
1
+ import { B as BaseNotificationPayload } from "../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { P as Provider } from "../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface RoundRobinConfig {
4
4
  /** When true, falls through to the next provider on failure (default true). */
5
5
  failover?: boolean;
@@ -7,11 +7,11 @@ interface RoundRobinConfig {
7
7
  id?: string;
8
8
  }
9
9
  /**
10
- * Wraps several same-channel providers and distributes sends across them in rotation.
11
- * Optionally falls over to the next provider on failure.
12
- * @param providers The providers to balance across.
13
- * @param config Optional config.
14
- * @returns A composite provider.
15
- */
10
+ * Wraps several same-channel providers and distributes sends across them in rotation.
11
+ * Optionally falls over to the next provider on failure.
12
+ * @param providers The providers to balance across.
13
+ * @param config Optional config.
14
+ * @returns A composite provider.
15
+ */
16
16
  declare const roundRobinProvider: <PayloadT extends BaseNotificationPayload>(providers: Provider<unknown, PayloadT>[], config?: RoundRobinConfig) => Provider<unknown, PayloadT>;
17
17
  export { type RoundRobinConfig, roundRobinProvider };
@@ -1 +1 @@
1
- import{roundRobinProvider as d}from"../../packem_shared/roundRobinProvider-BetXJUUm.js";export{d as roundRobinProvider};
1
+ import{roundRobinProvider as d}from"../../packem_shared/roundRobinProvider-CK3Vyc_u.js";export{d as roundRobinProvider};
@@ -1,5 +1,5 @@
1
- import { d as BaseConfig, S as SmsPayload } from "../../../packem_shared/types.d-GUzX1jTk.js";
2
- import { a as ProviderFactory } from "../../../packem_shared/provider.d-BQAGriz6.js";
1
+ import { d as BaseConfig, S as SmsPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface MessageBirdConfig extends BaseConfig {
4
4
  /** MessageBird (Bird) access key. */
5
5
  accessKey: string;
@@ -9,8 +9,8 @@ interface MessageBirdConfig extends BaseConfig {
9
9
  from?: string;
10
10
  }
11
11
  /**
12
- * MessageBird (Bird) SMS provider. Sends to many recipients in one call.
13
- * @see https://docs.bird.com/api/sms-messaging
14
- */
12
+ * MessageBird (Bird) SMS provider. Sends to many recipients in one call.
13
+ * @see https://docs.bird.com/api/sms-messaging
14
+ */
15
15
  declare const messageBirdProvider: ProviderFactory<MessageBirdConfig, SmsPayload>;
16
16
  export { type MessageBirdConfig, messageBirdProvider };
@@ -1 +1 @@
1
- import{default as a}from"../../../packem_shared/messageBirdProvider-BfiTaNLn.js";export{a as messageBirdProvider};
1
+ import{default as a}from"../../../packem_shared/messageBirdProvider-D1c3jUqj.js";export{a as messageBirdProvider};
@@ -1,5 +1,5 @@
1
- import { d as BaseConfig, S as SmsPayload } from "../../../packem_shared/types.d-GUzX1jTk.js";
2
- import { a as ProviderFactory } from "../../../packem_shared/provider.d-BQAGriz6.js";
1
+ import { d as BaseConfig, S as SmsPayload } from "../../../packem_shared/types.d-C7l7qdMG.js";
2
+ import { a as ProviderFactory } from "../../../packem_shared/provider.d-Dh32nRm9.js";
3
3
  interface PlivoConfig extends BaseConfig {
4
4
  /** Plivo Auth ID. */
5
5
  authId: string;
@@ -11,8 +11,8 @@ interface PlivoConfig extends BaseConfig {
11
11
  from?: string;
12
12
  }
13
13
  /**
14
- * Plivo SMS provider. Sends to many recipients in one call (`dst` joined by `&lt;`).
15
- * @see https://www.plivo.com/docs/sms/api/message
16
- */
14
+ * Plivo SMS provider. Sends to many recipients in one call (`dst` joined by `&lt;`).
15
+ * @see https://www.plivo.com/docs/sms/api/message
16
+ */
17
17
  declare const plivoProvider: ProviderFactory<PlivoConfig, SmsPayload>;
18
18
  export { type PlivoConfig, plivoProvider };