@venturekit/notify 0.0.47 → 0.0.48
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.
- package/README.md +37 -15
- package/dist/devices/devices.d.ts +10 -9
- package/dist/devices/devices.d.ts.map +1 -1
- package/dist/devices/devices.js +8 -7
- package/dist/devices/devices.js.map +1 -1
- package/dist/devices/index.d.ts +2 -2
- package/dist/devices/index.d.ts.map +1 -1
- package/dist/devices/index.js +1 -1
- package/dist/devices/index.js.map +1 -1
- package/dist/devices/push.d.ts +91 -21
- package/dist/devices/push.d.ts.map +1 -1
- package/dist/devices/push.js +119 -34
- package/dist/devices/push.js.map +1 -1
- package/dist/providers/index.d.ts +3 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +2 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/push-apns.d.ts +117 -0
- package/dist/providers/push-apns.d.ts.map +1 -0
- package/dist/providers/push-apns.js +279 -0
- package/dist/providers/push-apns.js.map +1 -0
- package/dist/providers/push-fcm.d.ts +92 -0
- package/dist/providers/push-fcm.d.ts.map +1 -0
- package/dist/providers/push-fcm.js +299 -0
- package/dist/providers/push-fcm.js.map +1 -0
- package/dist/providers/types.d.ts +49 -1
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js +2 -1
- package/dist/providers/types.js.map +1 -1
- package/package.json +14 -6
package/dist/devices/push.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/devices/push.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/devices/push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EAA6C,MAAM,2BAA2B,CAAC;AACzI,OAAO,EAAE,cAAc,EAAsB,MAAM,0BA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AAQ,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,OAAO,IAAI,CAAC,CAAC;YACrB,SAAS;QACX,CAAC;QACD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC;QACxJ,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI;YAAE,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;aACxC,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;YAClB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC;;YAAM,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,gBAAgB,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;IACxH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
* // ↑ direct subpath — useful when bundling and you want
|
|
12
12
|
* // precise tree-shaking control.
|
|
13
13
|
*/
|
|
14
|
-
export { ProviderHardError, ProviderSendError, PushDeviceGoneError, type NotifyProvider, type ProviderSendRequest, type ProviderSendResult, } from './types.js';
|
|
14
|
+
export { ProviderHardError, ProviderSendError, PushDeviceGoneError, type NotifyProvider, type ProviderSendRequest, type ProviderSendResult, type PushSendMessage, type PushSendOutcome, type PushPayloadFormat, } from './types.js';
|
|
15
15
|
export { createSesEmailProvider, type SesEmailProviderConfig, __resetSesClientForTests, } from './email-ses.js';
|
|
16
16
|
export { createMetaWhatsAppProvider, createSecretsTokenResolver, type MetaWhatsAppProvider, type MetaWhatsAppProviderConfig, type WhatsAppTemplateCategory, type WhatsAppTemplateCategoryReported, type WhatsAppTemplateStatus, type WhatsAppTemplateRejectedReason, type WhatsAppTemplateComponent, type WhatsAppTemplateInput, type WhatsAppTemplateCreateResult, type WhatsAppTemplateStatusResult, type WhatsAppTemplateUpdateInput, type WhatsAppTemplateUpdateResult, type WhatsAppTemplateDeleteInput, type WhatsAppTemplateDeleteResult, } from './whatsapp-meta.js';
|
|
17
17
|
export { toMetaLanguage, fromMetaLanguage, DEFAULT_META_LANGUAGE_MAP, } from './whatsapp-meta-language.js';
|
|
18
18
|
export { metaTemplateParameter, metaTemplateBody, normalizeMetaCategory, metaCategoryCost, META_TEMPLATE_BODY_MAX, META_FLAT_COSTS, type MetaTemplateTextParameter, type MetaTemplateBodyComponent, type MetaCategoryCosts, } from './whatsapp-meta-template.js';
|
|
19
19
|
export { verifyMetaWebhookSignature, handleMetaWebhookVerification, parseMetaWebhookEvents, MetaWebhookSignatureError, MetaWebhookVerificationError, MetaWebhookPayloadError, META_SIGNATURE_HEADER, type VerifyMetaWebhookSignatureInput, type HandleMetaWebhookVerificationInput, type MetaWebhookQuery, type MetaWebhookEvent, type MetaTemplateWebhookEventBase, type MetaTemplateCategoryChangedEvent, type MetaTemplateCategoryChangeScheduledEvent, type MetaTemplateStatusUpdatedEvent, type MetaUnknownWebhookEvent, type WhatsAppTemplateStatusEvent, createMetaWhatsAppWebhookHandler, type MetaWhatsAppWebhookHandler, type MetaWhatsAppWebhookHandlerConfig, WHATSAPP_APP_SECRET_ENV, WHATSAPP_VERIFY_TOKEN_SECRET_ENV, } from './whatsapp-meta-webhook.js';
|
|
20
20
|
export { createExpoPushProvider, sendExpoPush, fetchExpoPushReceipts, isDeviceGone, type ExpoPushConfig, type ExpoPushProviderConfig, type ExpoPushMessage, type ExpoPushTicket, type ExpoPushTicketFor, type ExpoPushReceipt, type FetchLike, } from './push-expo.js';
|
|
21
|
+
export { createFcmPushProvider, sendFcmPush, prepareFcmPush, parseFcmServiceAccount, fcmAccessToken, fcmRequestBody, fcmOutcome, type FcmPushConfig, type FcmPushProviderConfig, type FcmServiceAccount, } from './push-fcm.js';
|
|
22
|
+
export { createApnsPushProvider, sendApnsPush, prepareApnsPush, parseApnsKey, apnsProviderToken, apnsPayload, apnsOutcome, createHttp2ApnsTransport, type ApnsKey, type ApnsPushConfig, type ApnsPushMessage, type ApnsRequest, type ApnsResponse, type ApnsTransport, } from './push-apns.js';
|
|
21
23
|
export { createSmsNoopProvider } from './sms-noop.js';
|
|
22
24
|
export { createPushNoopProvider } from './push-noop.js';
|
|
23
25
|
export { createEmailNoopProvider, type EmailNoopOptions } from './email-noop.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B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C;AAExB,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,UAAU,EACV,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,wBAAwB,EACxB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/providers/index.js
CHANGED
|
@@ -18,6 +18,8 @@ export { toMetaLanguage, fromMetaLanguage, DEFAULT_META_LANGUAGE_MAP, } from './
|
|
|
18
18
|
export { metaTemplateParameter, metaTemplateBody, normalizeMetaCategory, metaCategoryCost, META_TEMPLATE_BODY_MAX, META_FLAT_COSTS, } from './whatsapp-meta-template.js';
|
|
19
19
|
export { verifyMetaWebhookSignature, handleMetaWebhookVerification, parseMetaWebhookEvents, MetaWebhookSignatureError, MetaWebhookVerificationError, MetaWebhookPayloadError, META_SIGNATURE_HEADER, createMetaWhatsAppWebhookHandler, WHATSAPP_APP_SECRET_ENV, WHATSAPP_VERIFY_TOKEN_SECRET_ENV, } from './whatsapp-meta-webhook.js';
|
|
20
20
|
export { createExpoPushProvider, sendExpoPush, fetchExpoPushReceipts, isDeviceGone, } from './push-expo.js';
|
|
21
|
+
export { createFcmPushProvider, sendFcmPush, prepareFcmPush, parseFcmServiceAccount, fcmAccessToken, fcmRequestBody, fcmOutcome, } from './push-fcm.js';
|
|
22
|
+
export { createApnsPushProvider, sendApnsPush, prepareApnsPush, parseApnsKey, apnsProviderToken, apnsPayload, apnsOutcome, createHttp2ApnsTransport, } from './push-apns.js';
|
|
21
23
|
export { createSmsNoopProvider } from './sms-noop.js';
|
|
22
24
|
export { createPushNoopProvider } from './push-noop.js';
|
|
23
25
|
export { createEmailNoopProvider } from './email-noop.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GAOpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,sBAAsB,EAEtB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,GAe3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,GAIhB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EAWrB,gCAAgC,EAGhC,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,qBAAqB,EACrB,YAAY,GAQb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,UAAU,GAIX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,wBAAwB,GAOzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAyB,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAA8B,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/notify — Apple Push Notification service provider (token-based, HTTP/2).
|
|
3
|
+
*
|
|
4
|
+
* iOS push is APNs whatever sits in front of it; this talks to it directly with an **APNs
|
|
5
|
+
* auth key** (developer.apple.com › Keys, *Apple Push Notifications service*): the `.p8`
|
|
6
|
+
* file, its key id and the team id. One key serves every app of the team, in both
|
|
7
|
+
* environments; the app a push is for is its **topic** (the bundle id), per message.
|
|
8
|
+
*
|
|
9
|
+
* ### Authorisation
|
|
10
|
+
*
|
|
11
|
+
* Each request carries a provider token — an ES256 JWT `{ iss: teamId, iat }` with the key id
|
|
12
|
+
* in its header, signed here with `node:crypto`. Apple refuses one older than an hour and
|
|
13
|
+
* throttles one renewed more often than every twenty minutes, so it is cached per key for
|
|
14
|
+
* forty minutes, process-wide.
|
|
15
|
+
*
|
|
16
|
+
* ### The connection
|
|
17
|
+
*
|
|
18
|
+
* APNs speaks HTTP/2 only (`node:http2`; `fetch` cannot reach it). A send opens one session,
|
|
19
|
+
* multiplexes its requests on it, and closes it when the last answer is in — an open session
|
|
20
|
+
* would keep a Lambda's event loop alive until its timeout. Tests inject an
|
|
21
|
+
* {@link ApnsTransport} instead.
|
|
22
|
+
*
|
|
23
|
+
* ### Environments
|
|
24
|
+
*
|
|
25
|
+
* A token belongs to the environment of the build that registered it: `production` for a
|
|
26
|
+
* TestFlight or App Store build, `sandbox` for a development build run from Xcode. Sending
|
|
27
|
+
* to the other one answers `BadDeviceToken`. Pick the environment per deployment (production
|
|
28
|
+
* on the deployed stages, sandbox locally).
|
|
29
|
+
*
|
|
30
|
+
* ### What the answer means
|
|
31
|
+
*
|
|
32
|
+
* Final, like FCM's — no receipt to ask for later. `410 Unregistered` and `BadDeviceToken`
|
|
33
|
+
* are `gone` (revoke the token); 429, 5xx and an expired provider token are `retryable`; an
|
|
34
|
+
* expired or refused provider token drops the cached JWT so the next send signs a new one
|
|
35
|
+
* (`InvalidProviderToken` — the wrong key id or team — is not worth a retry). `DeviceTokenNotForTopic` is a
|
|
36
|
+
* configuration mistake (the wrong bundle id for the app) and is reported, never revoked.
|
|
37
|
+
*/
|
|
38
|
+
import { type NotifyProvider, type PushPayloadFormat, type PushSendMessage, type PushSendOutcome } from './types.js';
|
|
39
|
+
/** An APNs auth key: the `.p8` text, its key id, the team it belongs to. */
|
|
40
|
+
export interface ApnsKey {
|
|
41
|
+
teamId: string;
|
|
42
|
+
keyId: string;
|
|
43
|
+
/** The `.p8` file's text (`-----BEGIN PRIVATE KEY-----…`). */
|
|
44
|
+
privateKey: string;
|
|
45
|
+
}
|
|
46
|
+
/** One HTTP/2 request to APNs, and its answer — the seam tests replace. */
|
|
47
|
+
export interface ApnsRequest {
|
|
48
|
+
origin: string;
|
|
49
|
+
path: string;
|
|
50
|
+
headers: Record<string, string>;
|
|
51
|
+
body: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ApnsResponse {
|
|
54
|
+
status: number;
|
|
55
|
+
headers: Record<string, string | undefined>;
|
|
56
|
+
body: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ApnsTransport {
|
|
59
|
+
request(request: ApnsRequest): Promise<ApnsResponse>;
|
|
60
|
+
close(): void;
|
|
61
|
+
}
|
|
62
|
+
export interface ApnsPushConfig {
|
|
63
|
+
/** The key: {@link ApnsKey}, or JSON text `{ "teamId", "keyId", "privateKey" }` (`key` is accepted for `privateKey`). */
|
|
64
|
+
key: ApnsKey | string;
|
|
65
|
+
/** Default `'production'`. */
|
|
66
|
+
environment?: 'production' | 'sandbox';
|
|
67
|
+
/** The bundle id for messages that do not name their own `topic`. */
|
|
68
|
+
topic?: string;
|
|
69
|
+
/** Payload layout for the receiving app. Default `'standard'`. */
|
|
70
|
+
format?: PushPayloadFormat;
|
|
71
|
+
/** Requests in flight at once on the session. Default 8. */
|
|
72
|
+
concurrency?: number;
|
|
73
|
+
/** Injected for tests; the caller then owns it (it is not closed). Default: a `node:http2` session per send. */
|
|
74
|
+
transport?: ApnsTransport;
|
|
75
|
+
/** Injected for tests. Defaults to `Date.now`. */
|
|
76
|
+
now?: () => number;
|
|
77
|
+
}
|
|
78
|
+
/** A message for APNs: the common fields, and the app it is for. */
|
|
79
|
+
export interface ApnsPushMessage extends PushSendMessage {
|
|
80
|
+
/** The app's bundle id (`apns-topic`); falls back to {@link ApnsPushConfig.topic}. */
|
|
81
|
+
topic?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Read an APNs key, refusing one that cannot sign. */
|
|
84
|
+
export declare function parseApnsKey(input: ApnsPushConfig['key']): ApnsKey;
|
|
85
|
+
/** Forget every cached provider token. For tests. */
|
|
86
|
+
export declare function __resetApnsTokensForTests(): void;
|
|
87
|
+
/** The provider token for this key: the cached one while it is under forty minutes old. */
|
|
88
|
+
export declare function apnsProviderToken(key: ApnsKey, now?: () => number): string;
|
|
89
|
+
/** The JSON body APNs is sent for one message, in the app's payload layout. */
|
|
90
|
+
export declare function apnsPayload(message: PushSendMessage, format?: PushPayloadFormat): Record<string, unknown>;
|
|
91
|
+
/** What one APNs answer means for the token it was about. */
|
|
92
|
+
export declare function apnsOutcome(to: string, response: ApnsResponse): PushSendOutcome;
|
|
93
|
+
/** One `node:http2` session to an APNs origin, opened on the first request. */
|
|
94
|
+
export declare function createHttp2ApnsTransport(): ApnsTransport;
|
|
95
|
+
/**
|
|
96
|
+
* Read the key and sign a provider token — everything that can fail for the whole send — and
|
|
97
|
+
* return the sender. Throws {@link ProviderHardError} for a key that cannot sign; having
|
|
98
|
+
* returned, the sender never throws: each token's fate is in its {@link PushSendOutcome}. Each
|
|
99
|
+
* call of the sender opens its own HTTP/2 session (unless a transport was injected) and closes
|
|
100
|
+
* it before resolving.
|
|
101
|
+
*/
|
|
102
|
+
export declare function prepareApnsPush(config: ApnsPushConfig): (messages: readonly ApnsPushMessage[]) => Promise<PushSendOutcome[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Send to many APNs device tokens, one outcome per token, in order. Throws only what
|
|
105
|
+
* {@link prepareApnsPush} throws — before anything is sent.
|
|
106
|
+
*/
|
|
107
|
+
export declare function sendApnsPush(messages: readonly ApnsPushMessage[], config: ApnsPushConfig): Promise<PushSendOutcome[]>;
|
|
108
|
+
/**
|
|
109
|
+
* A `NotifyProvider` for the `push` channel, where `to` is one APNs device token of the app
|
|
110
|
+
* named by `config.topic` — for the outbox and its dispatcher. A dead token is a
|
|
111
|
+
* {@link PushDeviceGoneError}, a retryable refusal a {@link ProviderSendError}, anything else
|
|
112
|
+
* a {@link ProviderHardError}.
|
|
113
|
+
*/
|
|
114
|
+
export declare function createApnsPushProvider(config: ApnsPushConfig & {
|
|
115
|
+
topic: string;
|
|
116
|
+
}): NotifyProvider;
|
|
117
|
+
//# sourceMappingURL=push-apns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-apns.d.ts","sourceRoot":"","sources":["../../src/providers/push-apns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAIH,OAAO,EAIL,KAAK,cAAc,EAGnB,KAAK,iBAAiB,EACtB,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BAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,OAAO,CAqBlE;AAMD,qDAAqD;AACrD,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAED,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,GAAE,MAAM,MAAiB,GAAG,MAAM,CAgBpF;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,GAAE,iBAA8B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASrH;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,eAAe,CAe/E;AAED,+EAA+E;AAC/E,wBAAgB,wBAAwB,IAAI,aAAa,CAiDxD;AAeD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC,CAoC5H;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAG3H;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAmBjG"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/notify — Apple Push Notification service provider (token-based, HTTP/2).
|
|
3
|
+
*
|
|
4
|
+
* iOS push is APNs whatever sits in front of it; this talks to it directly with an **APNs
|
|
5
|
+
* auth key** (developer.apple.com › Keys, *Apple Push Notifications service*): the `.p8`
|
|
6
|
+
* file, its key id and the team id. One key serves every app of the team, in both
|
|
7
|
+
* environments; the app a push is for is its **topic** (the bundle id), per message.
|
|
8
|
+
*
|
|
9
|
+
* ### Authorisation
|
|
10
|
+
*
|
|
11
|
+
* Each request carries a provider token — an ES256 JWT `{ iss: teamId, iat }` with the key id
|
|
12
|
+
* in its header, signed here with `node:crypto`. Apple refuses one older than an hour and
|
|
13
|
+
* throttles one renewed more often than every twenty minutes, so it is cached per key for
|
|
14
|
+
* forty minutes, process-wide.
|
|
15
|
+
*
|
|
16
|
+
* ### The connection
|
|
17
|
+
*
|
|
18
|
+
* APNs speaks HTTP/2 only (`node:http2`; `fetch` cannot reach it). A send opens one session,
|
|
19
|
+
* multiplexes its requests on it, and closes it when the last answer is in — an open session
|
|
20
|
+
* would keep a Lambda's event loop alive until its timeout. Tests inject an
|
|
21
|
+
* {@link ApnsTransport} instead.
|
|
22
|
+
*
|
|
23
|
+
* ### Environments
|
|
24
|
+
*
|
|
25
|
+
* A token belongs to the environment of the build that registered it: `production` for a
|
|
26
|
+
* TestFlight or App Store build, `sandbox` for a development build run from Xcode. Sending
|
|
27
|
+
* to the other one answers `BadDeviceToken`. Pick the environment per deployment (production
|
|
28
|
+
* on the deployed stages, sandbox locally).
|
|
29
|
+
*
|
|
30
|
+
* ### What the answer means
|
|
31
|
+
*
|
|
32
|
+
* Final, like FCM's — no receipt to ask for later. `410 Unregistered` and `BadDeviceToken`
|
|
33
|
+
* are `gone` (revoke the token); 429, 5xx and an expired provider token are `retryable`; an
|
|
34
|
+
* expired or refused provider token drops the cached JWT so the next send signs a new one
|
|
35
|
+
* (`InvalidProviderToken` — the wrong key id or team — is not worth a retry). `DeviceTokenNotForTopic` is a
|
|
36
|
+
* configuration mistake (the wrong bundle id for the app) and is reported, never revoked.
|
|
37
|
+
*/
|
|
38
|
+
import { sign } from 'node:crypto';
|
|
39
|
+
import { ProviderHardError, ProviderSendError, PushDeviceGoneError, } from './types.js';
|
|
40
|
+
const ORIGINS = {
|
|
41
|
+
production: 'https://api.push.apple.com',
|
|
42
|
+
sandbox: 'https://api.sandbox.push.apple.com',
|
|
43
|
+
};
|
|
44
|
+
/** Reuse a provider token this long: inside Apple's hour, past its twenty-minute renewal floor. */
|
|
45
|
+
const JWT_REUSE_MS = 40 * 60_000;
|
|
46
|
+
const DEFAULT_CONCURRENCY = 8;
|
|
47
|
+
const REQUEST_TIMEOUT_MS = 10_000;
|
|
48
|
+
const TEN_CHARS = /^[A-Z0-9]{10}$/;
|
|
49
|
+
/** Read an APNs key, refusing one that cannot sign. */
|
|
50
|
+
export function parseApnsKey(input) {
|
|
51
|
+
let raw;
|
|
52
|
+
if (typeof input === 'string') {
|
|
53
|
+
try {
|
|
54
|
+
raw = JSON.parse(input);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
throw new ProviderHardError('[notify:push-apns] the key is not JSON — expected { "teamId", "keyId", "privateKey" }');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
raw = input;
|
|
62
|
+
}
|
|
63
|
+
const text = (value) => (typeof value === 'string' ? value.trim() : '');
|
|
64
|
+
const key = {
|
|
65
|
+
teamId: text(raw.teamId),
|
|
66
|
+
keyId: text(raw.keyId),
|
|
67
|
+
privateKey: text(raw.privateKey) || text(raw.key),
|
|
68
|
+
};
|
|
69
|
+
if (!TEN_CHARS.test(key.teamId))
|
|
70
|
+
throw new ProviderHardError('[notify:push-apns] teamId must be the ten-character Apple team id');
|
|
71
|
+
if (!TEN_CHARS.test(key.keyId))
|
|
72
|
+
throw new ProviderHardError('[notify:push-apns] keyId must be the ten-character id of the APNs key');
|
|
73
|
+
if (!key.privateKey.includes('PRIVATE KEY'))
|
|
74
|
+
throw new ProviderHardError('[notify:push-apns] privateKey must be the .p8 file\'s text');
|
|
75
|
+
return key;
|
|
76
|
+
}
|
|
77
|
+
const base64url = (input) => Buffer.from(input).toString('base64url');
|
|
78
|
+
const jwts = new Map();
|
|
79
|
+
/** Forget every cached provider token. For tests. */
|
|
80
|
+
export function __resetApnsTokensForTests() {
|
|
81
|
+
jwts.clear();
|
|
82
|
+
}
|
|
83
|
+
/** The provider token for this key: the cached one while it is under forty minutes old. */
|
|
84
|
+
export function apnsProviderToken(key, now = Date.now) {
|
|
85
|
+
const id = `${key.teamId}.${key.keyId}`;
|
|
86
|
+
const cached = jwts.get(id);
|
|
87
|
+
if (cached && now() - cached.issuedAtMs < JWT_REUSE_MS)
|
|
88
|
+
return cached.jwt;
|
|
89
|
+
const header = base64url(JSON.stringify({ alg: 'ES256', kid: key.keyId }));
|
|
90
|
+
const claims = base64url(JSON.stringify({ iss: key.teamId, iat: Math.floor(now() / 1000) }));
|
|
91
|
+
let signature;
|
|
92
|
+
try {
|
|
93
|
+
/* JWS wants the raw r‖s pair, not node's default DER */
|
|
94
|
+
signature = sign('sha256', Buffer.from(`${header}.${claims}`), { key: key.privateKey, dsaEncoding: 'ieee-p1363' });
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
throw new ProviderHardError('[notify:push-apns] the .p8 key cannot sign — paste the file unmodified', err);
|
|
98
|
+
}
|
|
99
|
+
const jwt = `${header}.${claims}.${base64url(signature)}`;
|
|
100
|
+
jwts.set(id, { jwt, issuedAtMs: now() });
|
|
101
|
+
return jwt;
|
|
102
|
+
}
|
|
103
|
+
/** The JSON body APNs is sent for one message, in the app's payload layout. */
|
|
104
|
+
export function apnsPayload(message, format = 'standard') {
|
|
105
|
+
const aps = {
|
|
106
|
+
...(message.title || message.body ? { alert: { ...(message.title ? { title: message.title } : {}), ...(message.body ? { body: message.body } : {}) } } : {}),
|
|
107
|
+
...(message.sound === null ? {} : { sound: 'default' }),
|
|
108
|
+
...(message.badge !== undefined ? { badge: message.badge } : {}),
|
|
109
|
+
};
|
|
110
|
+
/* `expo-notifications` reads `content.data` from the `body` key (NotificationRecords.swift) */
|
|
111
|
+
if (format === 'expo-notifications')
|
|
112
|
+
return { aps, body: message.data ?? {} };
|
|
113
|
+
return { ...(message.data ?? {}), aps };
|
|
114
|
+
}
|
|
115
|
+
/** What one APNs answer means for the token it was about. */
|
|
116
|
+
export function apnsOutcome(to, response) {
|
|
117
|
+
if (response.status === 200) {
|
|
118
|
+
return { to, messageId: response.headers['apns-id'] ?? `apns:${Date.now()}`, error: null, gone: false, retryable: false };
|
|
119
|
+
}
|
|
120
|
+
let reason = `HTTP ${response.status}`;
|
|
121
|
+
try {
|
|
122
|
+
const parsed = JSON.parse(response.body);
|
|
123
|
+
if (typeof parsed.reason === 'string' && parsed.reason)
|
|
124
|
+
reason = parsed.reason;
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
/* an empty or non-JSON body: the status says it */
|
|
128
|
+
}
|
|
129
|
+
const gone = response.status === 410 || reason === 'Unregistered' || reason === 'BadDeviceToken';
|
|
130
|
+
/* an expired provider token is re-signed on the next send; an invalid one is the wrong key or team, and stays wrong */
|
|
131
|
+
const retryable = !gone && (response.status === 429 || response.status >= 500 || reason === 'ExpiredProviderToken');
|
|
132
|
+
return { to, messageId: null, error: reason, gone, retryable };
|
|
133
|
+
}
|
|
134
|
+
/** One `node:http2` session to an APNs origin, opened on the first request. */
|
|
135
|
+
export function createHttp2ApnsTransport() {
|
|
136
|
+
let http2;
|
|
137
|
+
let session;
|
|
138
|
+
let sessionOrigin = '';
|
|
139
|
+
const connect = async (origin) => {
|
|
140
|
+
http2 ??= await import('node:http2');
|
|
141
|
+
if (!session || session.closed || session.destroyed || sessionOrigin !== origin) {
|
|
142
|
+
session?.close();
|
|
143
|
+
session = http2.connect(origin);
|
|
144
|
+
sessionOrigin = origin;
|
|
145
|
+
/* a dead session is replaced on the next request; its streams fail on their own */
|
|
146
|
+
session.on('error', () => {
|
|
147
|
+
session = undefined;
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return session;
|
|
151
|
+
};
|
|
152
|
+
return {
|
|
153
|
+
async request(req) {
|
|
154
|
+
const s = await connect(req.origin);
|
|
155
|
+
return new Promise((resolve, reject) => {
|
|
156
|
+
const stream = s.request({ ':method': 'POST', ':path': req.path, 'content-type': 'application/json', ...req.headers });
|
|
157
|
+
let status = 0;
|
|
158
|
+
const headers = {};
|
|
159
|
+
let body = '';
|
|
160
|
+
stream.setEncoding('utf8');
|
|
161
|
+
stream.setTimeout(REQUEST_TIMEOUT_MS, () => {
|
|
162
|
+
stream.close(http2.constants.NGHTTP2_CANCEL);
|
|
163
|
+
reject(new Error('APNs request timed out'));
|
|
164
|
+
});
|
|
165
|
+
stream.on('response', (h) => {
|
|
166
|
+
status = Number(h[':status']);
|
|
167
|
+
for (const [name, value] of Object.entries(h))
|
|
168
|
+
headers[name] = Array.isArray(value) ? value.join(', ') : value === undefined ? undefined : String(value);
|
|
169
|
+
});
|
|
170
|
+
stream.on('data', (chunk) => {
|
|
171
|
+
body += chunk;
|
|
172
|
+
});
|
|
173
|
+
stream.on('end', () => resolve({ status, headers, body }));
|
|
174
|
+
stream.on('error', reject);
|
|
175
|
+
stream.end(req.body);
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
close() {
|
|
179
|
+
session?.close();
|
|
180
|
+
session = undefined;
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
async function pool(items, size, work) {
|
|
185
|
+
const out = new Array(items.length);
|
|
186
|
+
let next = 0;
|
|
187
|
+
const lanes = Array.from({ length: Math.max(1, Math.min(size, items.length)) }, async () => {
|
|
188
|
+
while (next < items.length) {
|
|
189
|
+
const i = next++;
|
|
190
|
+
out[i] = await work(items[i]);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
await Promise.all(lanes);
|
|
194
|
+
return out;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Read the key and sign a provider token — everything that can fail for the whole send — and
|
|
198
|
+
* return the sender. Throws {@link ProviderHardError} for a key that cannot sign; having
|
|
199
|
+
* returned, the sender never throws: each token's fate is in its {@link PushSendOutcome}. Each
|
|
200
|
+
* call of the sender opens its own HTTP/2 session (unless a transport was injected) and closes
|
|
201
|
+
* it before resolving.
|
|
202
|
+
*/
|
|
203
|
+
export function prepareApnsPush(config) {
|
|
204
|
+
const key = parseApnsKey(config.key);
|
|
205
|
+
const now = config.now ?? Date.now;
|
|
206
|
+
apnsProviderToken(key, now);
|
|
207
|
+
const origin = ORIGINS[config.environment ?? 'production'];
|
|
208
|
+
const format = config.format ?? 'standard';
|
|
209
|
+
return async (messages) => {
|
|
210
|
+
if (messages.length === 0)
|
|
211
|
+
return [];
|
|
212
|
+
const transport = config.transport ?? createHttp2ApnsTransport();
|
|
213
|
+
try {
|
|
214
|
+
return await pool(messages, config.concurrency ?? DEFAULT_CONCURRENCY, async (message) => {
|
|
215
|
+
const topic = message.topic ?? config.topic;
|
|
216
|
+
if (!topic)
|
|
217
|
+
return { to: message.to, messageId: null, error: 'no_topic', gone: false, retryable: false };
|
|
218
|
+
const headers = {
|
|
219
|
+
authorization: `bearer ${apnsProviderToken(key, now)}`,
|
|
220
|
+
'apns-topic': topic,
|
|
221
|
+
'apns-push-type': 'alert',
|
|
222
|
+
/* `default` delivers at once on iOS, as on Expo; `normal` lets the phone pick its moment */
|
|
223
|
+
'apns-priority': message.priority === 'normal' ? '5' : '10',
|
|
224
|
+
...(message.ttl !== undefined ? { 'apns-expiration': String(Math.floor(now() / 1000) + Math.max(0, Math.floor(message.ttl))) } : {}),
|
|
225
|
+
};
|
|
226
|
+
let response;
|
|
227
|
+
try {
|
|
228
|
+
response = await transport.request({ origin, path: `/3/device/${encodeURIComponent(message.to)}`, headers, body: JSON.stringify(apnsPayload(message, format)) });
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return { to: message.to, messageId: null, error: 'network', gone: false, retryable: true };
|
|
232
|
+
}
|
|
233
|
+
const outcome = apnsOutcome(message.to, response);
|
|
234
|
+
if (outcome.error === 'ExpiredProviderToken' || outcome.error === 'InvalidProviderToken')
|
|
235
|
+
jwts.delete(`${key.teamId}.${key.keyId}`);
|
|
236
|
+
return outcome;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
finally {
|
|
240
|
+
if (!config.transport)
|
|
241
|
+
transport.close();
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Send to many APNs device tokens, one outcome per token, in order. Throws only what
|
|
247
|
+
* {@link prepareApnsPush} throws — before anything is sent.
|
|
248
|
+
*/
|
|
249
|
+
export async function sendApnsPush(messages, config) {
|
|
250
|
+
if (messages.length === 0)
|
|
251
|
+
return [];
|
|
252
|
+
return prepareApnsPush(config)(messages);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* A `NotifyProvider` for the `push` channel, where `to` is one APNs device token of the app
|
|
256
|
+
* named by `config.topic` — for the outbox and its dispatcher. A dead token is a
|
|
257
|
+
* {@link PushDeviceGoneError}, a retryable refusal a {@link ProviderSendError}, anything else
|
|
258
|
+
* a {@link ProviderHardError}.
|
|
259
|
+
*/
|
|
260
|
+
export function createApnsPushProvider(config) {
|
|
261
|
+
const channel = 'push';
|
|
262
|
+
return {
|
|
263
|
+
channel,
|
|
264
|
+
name: 'apns-push',
|
|
265
|
+
async send(request) {
|
|
266
|
+
const [outcome] = await sendApnsPush([{ to: request.to, ...(request.message.subject ? { title: request.message.subject } : {}), body: request.message.text, data: { notificationId: request.notificationId } }], config);
|
|
267
|
+
if (!outcome || !outcome.messageId) {
|
|
268
|
+
if (outcome?.gone)
|
|
269
|
+
throw new PushDeviceGoneError(request.to, `[notify:push-apns] device not registered: ${request.to}`);
|
|
270
|
+
const message = `[notify:push-apns] rejected: ${outcome?.error ?? 'unknown error'}`;
|
|
271
|
+
if (outcome?.retryable)
|
|
272
|
+
throw new ProviderSendError(message);
|
|
273
|
+
throw new ProviderHardError(message);
|
|
274
|
+
}
|
|
275
|
+
return { providerMessageId: outcome.messageId, acceptedAtMs: Date.now(), channel };
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=push-apns.js.map
|
|
@@ -0,0 +1 @@
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TTP v1).
|
|
3
|
+
*
|
|
4
|
+
* Android's push is FCM whatever sits in front of it; this talks to it directly, with the
|
|
5
|
+
* Firebase project's **service account** (Project settings › Service accounts › Generate new
|
|
6
|
+
* private key): no Expo project, no relay, one HTTPS request per device token.
|
|
7
|
+
*
|
|
8
|
+
* ### Authorisation
|
|
9
|
+
*
|
|
10
|
+
* HTTP v1 takes an OAuth 2.0 access token, minted here from the service account by the
|
|
11
|
+
* JWT-bearer grant (an RS256 assertion signed with `node:crypto`, no Google SDK) and cached
|
|
12
|
+
* per service account until a minute before it expires — so a warm Lambda asks Google once
|
|
13
|
+
* an hour, not once a send.
|
|
14
|
+
*
|
|
15
|
+
* ### One request per token, and what the answer means
|
|
16
|
+
*
|
|
17
|
+
* HTTP v1 has no multicast: every token is its own request, sent {@link FcmPushConfig.concurrency}
|
|
18
|
+
* at a time. Each answer is final — there is no receipt to ask for later, unlike Expo — and
|
|
19
|
+
* becomes a {@link PushSendOutcome}:
|
|
20
|
+
*
|
|
21
|
+
* - `UNREGISTERED` (404), or `INVALID_ARGUMENT` about the registration token: the token is
|
|
22
|
+
* dead — `gone`, revoke it. Any other `INVALID_ARGUMENT` is the message's fault and says
|
|
23
|
+
* nothing about the device.
|
|
24
|
+
* - 429, 5xx, a network failure: `retryable`.
|
|
25
|
+
* - `SENDER_ID_MISMATCH`: the token belongs to another Firebase project — a configuration
|
|
26
|
+
* mistake (the app's `google-services.json` and this service account disagree), so it is
|
|
27
|
+
* reported, never revoked.
|
|
28
|
+
*
|
|
29
|
+
* A service account that cannot be read, or that Google refuses, throws before anything is
|
|
30
|
+
* sent ({@link prepareFcmPush}).
|
|
31
|
+
*/
|
|
32
|
+
import type { FetchLike } from './push-expo.js';
|
|
33
|
+
export type { FetchLike };
|
|
34
|
+
import { type NotifyProvider, type PushPayloadFormat, type PushSendMessage, type PushSendOutcome } from './types.js';
|
|
35
|
+
/** The fields of a Firebase service-account key this provider uses. */
|
|
36
|
+
export interface FcmServiceAccount {
|
|
37
|
+
projectId: string;
|
|
38
|
+
clientEmail: string;
|
|
39
|
+
privateKey: string;
|
|
40
|
+
tokenUri: string;
|
|
41
|
+
}
|
|
42
|
+
export interface FcmPushConfig {
|
|
43
|
+
/** The service-account key: its JSON text as downloaded, the parsed object, or {@link FcmServiceAccount}. */
|
|
44
|
+
serviceAccount: string | Record<string, unknown> | FcmServiceAccount;
|
|
45
|
+
/** Payload layout for the receiving app. Default `'standard'`. */
|
|
46
|
+
format?: PushPayloadFormat;
|
|
47
|
+
/** Requests in flight at once. Default 8. */
|
|
48
|
+
concurrency?: number;
|
|
49
|
+
/** Injected for tests. Defaults to the global `fetch`. */
|
|
50
|
+
fetchImpl?: FetchLike;
|
|
51
|
+
/** Injected for tests. Defaults to `Date.now`. */
|
|
52
|
+
now?: () => number;
|
|
53
|
+
}
|
|
54
|
+
/** Read a service-account key, refusing one that lacks what the send needs. */
|
|
55
|
+
export declare function parseFcmServiceAccount(input: FcmPushConfig['serviceAccount']): FcmServiceAccount;
|
|
56
|
+
/** Forget every cached access token. For tests. */
|
|
57
|
+
export declare function __resetFcmTokensForTests(): void;
|
|
58
|
+
/** An access token for this service account: the cached one while it has more than a minute left. */
|
|
59
|
+
export declare function fcmAccessToken(account: FcmServiceAccount, options?: {
|
|
60
|
+
fetchImpl?: FetchLike;
|
|
61
|
+
now?: () => number;
|
|
62
|
+
}): Promise<string>;
|
|
63
|
+
/** The HTTP v1 request body for one message (`{ message: … }`), in the app's payload layout. */
|
|
64
|
+
export declare function fcmRequestBody(message: PushSendMessage, format?: PushPayloadFormat): {
|
|
65
|
+
message: Record<string, unknown>;
|
|
66
|
+
};
|
|
67
|
+
/** What one HTTP v1 answer means for the token it was about. */
|
|
68
|
+
export declare function fcmOutcome(to: string, status: number, json: unknown): PushSendOutcome;
|
|
69
|
+
/**
|
|
70
|
+
* Read the service account and fetch its access token — everything that can fail for the
|
|
71
|
+
* whole send — and return the sender. Throws {@link ProviderHardError} for a key that cannot
|
|
72
|
+
* be used and {@link ProviderSendError} when Google could not be reached; having returned,
|
|
73
|
+
* the sender never throws: each token's fate is in its {@link PushSendOutcome}.
|
|
74
|
+
*/
|
|
75
|
+
export declare function prepareFcmPush(config: FcmPushConfig): Promise<(messages: readonly PushSendMessage[]) => Promise<PushSendOutcome[]>>;
|
|
76
|
+
/**
|
|
77
|
+
* Send to many FCM registration tokens, one outcome per token, in order. Throws only what
|
|
78
|
+
* {@link prepareFcmPush} throws — before anything is sent.
|
|
79
|
+
*/
|
|
80
|
+
export declare function sendFcmPush(messages: readonly PushSendMessage[], config: FcmPushConfig): Promise<PushSendOutcome[]>;
|
|
81
|
+
export interface FcmPushProviderConfig extends FcmPushConfig {
|
|
82
|
+
/** Android channel id for sends that do not name one. */
|
|
83
|
+
defaultChannelId?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A `NotifyProvider` for the `push` channel, where `to` is one FCM registration token — for the
|
|
87
|
+
* outbox and its dispatcher. A dead token is a {@link PushDeviceGoneError} (the dispatcher
|
|
88
|
+
* revokes it), a retryable refusal a {@link ProviderSendError}, anything else a
|
|
89
|
+
* {@link ProviderHardError}.
|
|
90
|
+
*/
|
|
91
|
+
export declare function createFcmPushProvider(config: FcmPushProviderConfig): NotifyProvider;
|
|
92
|
+
//# sourceMappingURL=push-fcm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-fcm.d.ts","sourceRoot":"","sources":["../../src/providers/push-fcm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,OAAO,EAIL,KAAK,cAAc,EAGnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAUpB,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IACh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