@venturekit/notify 0.0.46 → 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 +127 -3
- package/dist/client.d.ts +11 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +118 -13
- package/dist/client.js.map +1 -1
- package/dist/devices/devices.d.ts +136 -0
- package/dist/devices/devices.d.ts.map +1 -0
- package/dist/devices/devices.js +179 -0
- package/dist/devices/devices.js.map +1 -0
- package/dist/devices/index.d.ts +6 -0
- package/dist/devices/index.d.ts.map +1 -0
- package/dist/devices/index.js +3 -0
- package/dist/devices/index.js.map +1 -0
- package/dist/devices/push.d.ts +154 -0
- package/dist/devices/push.d.ts.map +1 -0
- package/dist/devices/push.js +171 -0
- package/dist/devices/push.js.map +1 -0
- package/dist/dispatcher.d.ts.map +1 -1
- package/dist/dispatcher.js +6 -1
- package/dist/dispatcher.js.map +1 -1
- package/dist/inbox/inbox.d.ts +3 -2
- package/dist/inbox/inbox.d.ts.map +1 -1
- package/dist/inbox/inbox.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/migrations/0000_vk_notify_push_devices.sql +73 -0
- package/dist/migrations/0000_vk_notify_templates.sql +75 -0
- package/dist/migrations/vk_notify_006_dedupe_key.sql +19 -0
- package/dist/providers/index.d.ts +3 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -1
- 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-expo.d.ts +3 -1
- package/dist/providers/push-expo.d.ts.map +1 -1
- package/dist/providers/push-expo.js +5 -3
- package/dist/providers/push-expo.js.map +1 -1
- 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 +59 -0
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js +16 -0
- package/dist/providers/types.js.map +1 -1
- package/dist/querier.d.ts +20 -0
- package/dist/querier.d.ts.map +1 -0
- package/dist/querier.js +16 -0
- package/dist/querier.js.map +1 -0
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +1 -0
- package/dist/store/index.js.map +1 -1
- package/dist/store/postgres.d.ts.map +1 -1
- package/dist/store/postgres.js +23 -4
- package/dist/store/postgres.js.map +1 -1
- package/dist/store/types.d.ts +18 -1
- package/dist/store/types.d.ts.map +1 -1
- package/dist/store/types.js +14 -1
- package/dist/store/types.js.map +1 -1
- package/dist/templates/index.d.ts +5 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +3 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/stored.d.ts +200 -0
- package/dist/templates/stored.d.ts.map +1 -0
- package/dist/templates/stored.js +248 -0
- package/dist/templates/stored.js.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +22 -6
- package/src/migrations/0000_vk_notify_push_devices.sql +73 -0
- package/src/migrations/0000_vk_notify_templates.sql +75 -0
- package/src/migrations/vk_notify_006_dedupe_key.sql +19 -0
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"push-apns.js","sourceRoot":"","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AAC,MAA0C;IAC/E,MAAM,OAAO,GAAkB,MAAM,CAAC;IACtC,OAAO;QACL,OAAO;QACP,IAAI,EAAE,WAAW;QACjB,KAAK,CAAC,IAAI,CAAC,OAA4B;YACrC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,YAAY,CAClC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,EAC1K,MAAM,CACP,CAAC;YACF,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;gBACnC,IAAI,OAAO,EAAE,IAAI;oBAAE,MAAM,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE,EAAE,6CAA6C,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;gBACxH,MAAM,OAAO,GAAG,gCAAgC,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,CAAC;gBACpF,IAAI,OAAO,EAAE,SAAS;oBAAE,MAAM,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBAC7D,MAAM,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;YACvC,CAAC;YACD,OAAO,EAAE,iBAAiB,EAAE,OAAO,CAAC,SAAS,EAAE,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC;QACrF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -139,7 +139,9 @@ export interface ExpoPushProviderConfig extends ExpoPushConfig {
|
|
|
139
139
|
* Error mapping follows the dispatcher's contract: `DeviceNotRegistered` and a
|
|
140
140
|
* malformed request are {@link ProviderHardError} (no retry — the token is gone
|
|
141
141
|
* or the request is wrong), while a network blip, a 429 or a 5xx are
|
|
142
|
-
* {@link ProviderSendError} (retry on the next tick).
|
|
142
|
+
* {@link ProviderSendError} (retry on the next tick). A gone device is the
|
|
143
|
+
* {@link PushDeviceGoneError} subclass, which is how the dispatcher knows to
|
|
144
|
+
* revoke the token as well as fail the row.
|
|
143
145
|
*/
|
|
144
146
|
export declare function createExpoPushProvider(config?: ExpoPushProviderConfig): NotifyProvider;
|
|
145
147
|
//# sourceMappingURL=push-expo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-expo.d.ts","sourceRoot":"","sources":["../../src/providers/push-expo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"push-expo.d.ts","sourceRoot":"","sources":["../../src/providers/push-expo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,EAIL,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAUpB,mFAAmF;AACnF,MAAM,MAAM,SAAS,GAAG,CACtB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,KACpE,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC,CAAC;AAExE,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,mD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AO,CAAC,iBAAiB,EAAE,CAAC,CA6C9B;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,MAAM,GAAE,cAAmB,GAC1B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAgC1C;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,GAAE,sBAA2B,GAClC,cAAc,CA4ChB"}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* depends on the person actually seeing the message — a fallback to SMS, an
|
|
37
37
|
* escalation — should key off an act of theirs, not off a receipt.
|
|
38
38
|
*/
|
|
39
|
-
import { ProviderHardError, ProviderSendError, } from './types.js';
|
|
39
|
+
import { ProviderHardError, ProviderSendError, PushDeviceGoneError, } from './types.js';
|
|
40
40
|
const SEND_URL = 'https://exp.host/--/api/v2/push/send';
|
|
41
41
|
const RECEIPTS_URL = 'https://exp.host/--/api/v2/push/getReceipts';
|
|
42
42
|
/** Expo's documented ceiling for one send request. */
|
|
@@ -165,7 +165,9 @@ export async function fetchExpoPushReceipts(ticketIds, config = {}) {
|
|
|
165
165
|
* Error mapping follows the dispatcher's contract: `DeviceNotRegistered` and a
|
|
166
166
|
* malformed request are {@link ProviderHardError} (no retry — the token is gone
|
|
167
167
|
* or the request is wrong), while a network blip, a 429 or a 5xx are
|
|
168
|
-
* {@link ProviderSendError} (retry on the next tick).
|
|
168
|
+
* {@link ProviderSendError} (retry on the next tick). A gone device is the
|
|
169
|
+
* {@link PushDeviceGoneError} subclass, which is how the dispatcher knows to
|
|
170
|
+
* revoke the token as well as fail the row.
|
|
169
171
|
*/
|
|
170
172
|
export function createExpoPushProvider(config = {}) {
|
|
171
173
|
const channel = 'push';
|
|
@@ -191,7 +193,7 @@ export function createExpoPushProvider(config = {}) {
|
|
|
191
193
|
/* A dead token will never succeed; retrying it wastes attempts and keeps
|
|
192
194
|
pushing at an app that is gone. */
|
|
193
195
|
if (isDeviceGone(ticket)) {
|
|
194
|
-
throw new
|
|
196
|
+
throw new PushDeviceGoneError(request.to, `[notify:push-expo] device not registered: ${request.to}`);
|
|
195
197
|
}
|
|
196
198
|
throw new ProviderSendError(`[notify:push-expo] rejected: ${reason}`);
|
|
197
199
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-expo.js","sourceRoot":"","sources":["../../src/providers/push-expo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"push-expo.js","sourceRoot":"","sources":["../../src/providers/push-expo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GAIpB,MAAM,YAAY,CAAC;AAEpB,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AACxD,MAAM,YAAY,GAAG,6CAA6C,CAAC;AAEnE,sDAAsD;AACtD,MAAM,UAAU,GAAG,GAAG,CAAC;AACvB,6DAA6D;AAC7D,MAAM,cAAc,GAAG,IAAI,CAAC;AAyD5B;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAoD;IAEpD,OAAO,MAAM,EAAE,OAAO,EAAE,KAAK,KAAK,qBAAqB,CAAC;AAC1D,CAAC;AAED,SAAS,OAAO,CAAC,WAA2B;IAC1C,OAAO;QACL,cAAc,EAAE,kBAAkB;QAClC,MAAM,EAAE,kBAAkB;QAC1B,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,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ACtE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI;oBAC1B;8EAC0D;oBAC1D,IAAI,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE;oBAChD,KAAK,EAAE,MAAM,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY;oBAC1E,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAC3E;aACF,EACD,MAAM,CACP,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC;YAC9B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBACpD,MAAM,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,OAAO,IAAI,eAAe,CAAC;gBAC5E;qDACqC;gBACrC,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;oBACzB,MAAM,IAAI,mBAAmB,CAC3B,OAAO,CAAC,EAAE,EACV,6CAA6C,OAAO,CAAC,EAAE,EAAE,CAC1D,CAAC;gBACJ,CAAC;gBACD,MAAM,IAAI,iBAAiB,CAAC,gCAAgC,MAAM,EAAE,CAAC,CAAC;YACxE,CAAC;YAED,OAAO;gBACL,iBAAiB,EAAE,MAAM,CAAC,EAAE;gBAC5B,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE;gBACxB,OAAO;aACR,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/notify — Firebase Cloud Messaging push provider (HTTP 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;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAA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