workers-start 0.8.0 → 0.10.0
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/CHANGELOG.md +9 -0
- package/README.md +121 -12
- package/dist/google.d.ts +148 -0
- package/dist/google.d.ts.map +1 -0
- package/dist/google.js +224 -0
- package/dist/google.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/mail.d.ts +71 -0
- package/dist/mail.d.ts.map +1 -0
- package/dist/mail.js +157 -0
- package/dist/mail.js.map +1 -0
- package/dist/sentry.d.ts +96 -0
- package/dist/sentry.d.ts.map +1 -0
- package/dist/sentry.js +119 -0
- package/dist/sentry.js.map +1 -0
- package/package.json +22 -2
- package/src/google.ts +418 -0
- package/src/index.ts +63 -0
- package/src/mail.ts +227 -0
- package/src/sentry.ts +178 -0
package/src/google.ts
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google APIs as a service account, on WebCrypto and `fetch` only: the signed
|
|
3
|
+
* JWT exchanged for an access token (cached per account and scope), the GA4
|
|
4
|
+
* Data API's `runReport` and `batchRunReports`, and Search Console's
|
|
5
|
+
* `searchAnalytics.query`. Runs in workerd and Node.
|
|
6
|
+
*
|
|
7
|
+
* The API helpers take a token rather than an account, so a token from
|
|
8
|
+
* anywhere (gcloud impersonation in a script, say) works with them too.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
|
|
12
|
+
export const GA4_SCOPE = "https://www.googleapis.com/auth/analytics.readonly";
|
|
13
|
+
export const SEARCH_CONSOLE_SCOPE =
|
|
14
|
+
"https://www.googleapis.com/auth/webmasters.readonly";
|
|
15
|
+
|
|
16
|
+
export interface ServiceAccount {
|
|
17
|
+
clientEmail: string;
|
|
18
|
+
/** The PKCS#8 PEM. Escaped `\n` sequences are fine. */
|
|
19
|
+
privateKey: string;
|
|
20
|
+
/** Sent as the JWT's `kid` when present. */
|
|
21
|
+
privateKeyId?: string | undefined;
|
|
22
|
+
/** Defaults to Google's token endpoint. */
|
|
23
|
+
tokenUri?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** A Google API answered with an error status. */
|
|
27
|
+
export class GoogleApiError extends Error {
|
|
28
|
+
override readonly name = "GoogleApiError";
|
|
29
|
+
constructor(
|
|
30
|
+
message: string,
|
|
31
|
+
readonly status: number,
|
|
32
|
+
/** Google's error body, when it sent JSON. */
|
|
33
|
+
readonly body?: unknown,
|
|
34
|
+
) {
|
|
35
|
+
super(message);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The key file JSON (`client_email`, `private_key`, ...) as an account, or null when it is not one. */
|
|
40
|
+
export function parseServiceAccount(
|
|
41
|
+
raw: string | undefined | null,
|
|
42
|
+
): ServiceAccount | null {
|
|
43
|
+
if (!raw) return null;
|
|
44
|
+
try {
|
|
45
|
+
const v = JSON.parse(raw) as Record<string, unknown>;
|
|
46
|
+
if (typeof v.client_email !== "string" || typeof v.private_key !== "string")
|
|
47
|
+
return null;
|
|
48
|
+
return {
|
|
49
|
+
clientEmail: v.client_email,
|
|
50
|
+
privateKey: v.private_key,
|
|
51
|
+
privateKeyId:
|
|
52
|
+
typeof v.private_key_id === "string" ? v.private_key_id : undefined,
|
|
53
|
+
tokenUri: typeof v.token_uri === "string" ? v.token_uri : undefined,
|
|
54
|
+
};
|
|
55
|
+
} catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const PKCS8_HEADER = "-----BEGIN PRIVATE KEY-----";
|
|
61
|
+
const PKCS8_FOOTER = "-----END PRIVATE KEY-----";
|
|
62
|
+
const RS256 = { name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" } as const;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Imports the account's private key for signing. Throws a clear error for a
|
|
66
|
+
* PKCS#1 key (`BEGIN RSA PRIVATE KEY`, which WebCrypto cannot import) or for
|
|
67
|
+
* a value that is not a PEM at all.
|
|
68
|
+
*/
|
|
69
|
+
export async function importServiceAccountKey(pem: string): Promise<CryptoKey> {
|
|
70
|
+
const text = pem.replace(/\\n/g, "\n").trim();
|
|
71
|
+
if (text.startsWith("-----BEGIN RSA PRIVATE KEY-----")) {
|
|
72
|
+
throw new Error(
|
|
73
|
+
"The private key is PKCS#1 (BEGIN RSA PRIVATE KEY). WebCrypto imports PKCS#8 only (BEGIN PRIVATE KEY), which is what a Google service account key file holds.",
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
const start = text.indexOf(PKCS8_HEADER);
|
|
77
|
+
const end = text.indexOf(PKCS8_FOOTER);
|
|
78
|
+
if (start === -1 || end === -1) {
|
|
79
|
+
throw new Error(
|
|
80
|
+
"The private key is not a PEM. Copy the private_key field from the service account JSON as it is.",
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
const body = text.slice(start + PKCS8_HEADER.length, end).replace(/\s+/g, "");
|
|
84
|
+
let der: Uint8Array<ArrayBuffer>;
|
|
85
|
+
try {
|
|
86
|
+
der = Uint8Array.from(atob(body), (ch) => ch.charCodeAt(0));
|
|
87
|
+
} catch {
|
|
88
|
+
throw new Error("The private key's body is not valid base64.");
|
|
89
|
+
}
|
|
90
|
+
return crypto.subtle.importKey("pkcs8", der, RS256, false, ["sign"]);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const encoder = new TextEncoder();
|
|
94
|
+
function b64url(data: string | Uint8Array): string {
|
|
95
|
+
const bytes = typeof data === "string" ? encoder.encode(data) : data;
|
|
96
|
+
let bin = "";
|
|
97
|
+
for (const b of bytes) bin += String.fromCharCode(b);
|
|
98
|
+
return btoa(bin).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** The signed RS256 assertion Google exchanges for an access token. */
|
|
102
|
+
export async function serviceAccountJwt(
|
|
103
|
+
account: ServiceAccount,
|
|
104
|
+
scopes: string | readonly string[],
|
|
105
|
+
nowMs: number = Date.now(),
|
|
106
|
+
): Promise<string> {
|
|
107
|
+
const iat = Math.floor(nowMs / 1000);
|
|
108
|
+
const header: Record<string, string> = { alg: "RS256", typ: "JWT" };
|
|
109
|
+
if (account.privateKeyId) header.kid = account.privateKeyId;
|
|
110
|
+
const claims = {
|
|
111
|
+
iss: account.clientEmail,
|
|
112
|
+
scope: typeof scopes === "string" ? scopes : scopes.join(" "),
|
|
113
|
+
aud: account.tokenUri ?? GOOGLE_TOKEN_URL,
|
|
114
|
+
iat,
|
|
115
|
+
exp: iat + 3600,
|
|
116
|
+
};
|
|
117
|
+
const input = `${b64url(JSON.stringify(header))}.${b64url(JSON.stringify(claims))}`;
|
|
118
|
+
const key = await importServiceAccountKey(account.privateKey);
|
|
119
|
+
const sig = await crypto.subtle.sign(RS256, key, encoder.encode(input));
|
|
120
|
+
return `${input}.${b64url(new Uint8Array(sig))}`;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
type Fetch = (url: string, init?: RequestInit) => Promise<Response>;
|
|
124
|
+
|
|
125
|
+
export interface GoogleAuthOptions {
|
|
126
|
+
fetch?: Fetch;
|
|
127
|
+
/** Milliseconds since the epoch. */
|
|
128
|
+
now?: () => number;
|
|
129
|
+
/** Refresh this many seconds before the token expires. Default 300. */
|
|
130
|
+
marginSeconds?: number;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export type GoogleTokenSource = (
|
|
134
|
+
account: ServiceAccount,
|
|
135
|
+
scopes: string | readonly string[],
|
|
136
|
+
) => Promise<string>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A token source with its own cache. Tokens are kept per account and scope
|
|
140
|
+
* until `marginSeconds` before they expire. Concurrent calls share one
|
|
141
|
+
* exchange, and a failed exchange is not cached.
|
|
142
|
+
*/
|
|
143
|
+
export function createGoogleAuth(
|
|
144
|
+
options: GoogleAuthOptions = {},
|
|
145
|
+
): GoogleTokenSource {
|
|
146
|
+
const {
|
|
147
|
+
fetch: fetcher = (url, init) => fetch(url, init),
|
|
148
|
+
now = Date.now,
|
|
149
|
+
marginSeconds = 300,
|
|
150
|
+
} = options;
|
|
151
|
+
const cache = new Map<
|
|
152
|
+
string,
|
|
153
|
+
{ token: Promise<string>; expiresAt: number }
|
|
154
|
+
>();
|
|
155
|
+
|
|
156
|
+
return (account, scopes) => {
|
|
157
|
+
const scope = typeof scopes === "string" ? scopes : scopes.join(" ");
|
|
158
|
+
const key = `${account.clientEmail}\n${scope}`;
|
|
159
|
+
const hit = cache.get(key);
|
|
160
|
+
if (hit && hit.expiresAt > now()) return hit.token;
|
|
161
|
+
const entry = { token: Promise.resolve(""), expiresAt: Infinity };
|
|
162
|
+
entry.token = (async () => {
|
|
163
|
+
const assertion = await serviceAccountJwt(account, scope, now());
|
|
164
|
+
const res = await fetcher(account.tokenUri ?? GOOGLE_TOKEN_URL, {
|
|
165
|
+
method: "POST",
|
|
166
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
167
|
+
body: new URLSearchParams({
|
|
168
|
+
grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
|
|
169
|
+
assertion,
|
|
170
|
+
}).toString(),
|
|
171
|
+
});
|
|
172
|
+
const body = (await res.json().catch(() => null)) as {
|
|
173
|
+
access_token?: string;
|
|
174
|
+
expires_in?: number;
|
|
175
|
+
error?: string;
|
|
176
|
+
error_description?: string;
|
|
177
|
+
} | null;
|
|
178
|
+
if (!res.ok || !body?.access_token) {
|
|
179
|
+
const why = body?.error_description ?? body?.error ?? "no access token";
|
|
180
|
+
throw new GoogleApiError(
|
|
181
|
+
`Google token exchange failed (${res.status}): ${why}`,
|
|
182
|
+
res.status,
|
|
183
|
+
body,
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
entry.expiresAt =
|
|
187
|
+
now() + ((body.expires_in ?? 3600) - marginSeconds) * 1000;
|
|
188
|
+
return body.access_token;
|
|
189
|
+
})();
|
|
190
|
+
entry.token.catch(() => {
|
|
191
|
+
if (cache.get(key) === entry) cache.delete(key);
|
|
192
|
+
});
|
|
193
|
+
cache.set(key, entry);
|
|
194
|
+
return entry.token;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
let shared: GoogleTokenSource | undefined;
|
|
199
|
+
|
|
200
|
+
/** An access token from a token source shared by the whole isolate. */
|
|
201
|
+
export function googleAccessToken(
|
|
202
|
+
account: ServiceAccount,
|
|
203
|
+
scopes: string | readonly string[],
|
|
204
|
+
): Promise<string> {
|
|
205
|
+
shared ??= createGoogleAuth();
|
|
206
|
+
return shared(account, scopes);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface GoogleCallOptions {
|
|
210
|
+
fetch?: Fetch;
|
|
211
|
+
/** Abort after this long. Default 10 seconds. */
|
|
212
|
+
timeoutMs?: number;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
async function googleJson<T>(
|
|
216
|
+
url: string,
|
|
217
|
+
token: string,
|
|
218
|
+
body: unknown,
|
|
219
|
+
{
|
|
220
|
+
fetch: fetcher = (u, i) => fetch(u, i),
|
|
221
|
+
timeoutMs = 10_000,
|
|
222
|
+
}: GoogleCallOptions,
|
|
223
|
+
what: string,
|
|
224
|
+
): Promise<T> {
|
|
225
|
+
const res = await fetcher(url, {
|
|
226
|
+
method: "POST",
|
|
227
|
+
headers: {
|
|
228
|
+
authorization: `Bearer ${token}`,
|
|
229
|
+
"content-type": "application/json",
|
|
230
|
+
},
|
|
231
|
+
body: JSON.stringify(body),
|
|
232
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
233
|
+
});
|
|
234
|
+
const json = (await res.json().catch(() => null)) as unknown;
|
|
235
|
+
if (!res.ok) {
|
|
236
|
+
const message =
|
|
237
|
+
(json as { error?: { message?: string } } | null)?.error?.message ??
|
|
238
|
+
res.statusText;
|
|
239
|
+
throw new GoogleApiError(
|
|
240
|
+
`${what} failed (${res.status}): ${message}`,
|
|
241
|
+
res.status,
|
|
242
|
+
json,
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
return json as T;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// GA4 Data API
|
|
249
|
+
|
|
250
|
+
export interface Ga4DateRange {
|
|
251
|
+
startDate: string;
|
|
252
|
+
endDate: string;
|
|
253
|
+
name?: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** A GA4 filter expression, passed through as Google defines it. */
|
|
257
|
+
export type Ga4FilterExpression = Record<string, unknown>;
|
|
258
|
+
|
|
259
|
+
export interface Ga4ReportRequest {
|
|
260
|
+
dimensions?: { name: string }[];
|
|
261
|
+
metrics: { name: string }[];
|
|
262
|
+
dateRanges: Ga4DateRange[];
|
|
263
|
+
dimensionFilter?: Ga4FilterExpression;
|
|
264
|
+
metricFilter?: Ga4FilterExpression;
|
|
265
|
+
orderBys?: Record<string, unknown>[];
|
|
266
|
+
limit?: number;
|
|
267
|
+
offset?: number;
|
|
268
|
+
metricAggregations?: ("TOTAL" | "MAXIMUM" | "MINIMUM" | "COUNT")[];
|
|
269
|
+
keepEmptyRows?: boolean;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
interface Ga4Row {
|
|
273
|
+
dimensionValues?: { value?: string }[];
|
|
274
|
+
metricValues?: { value?: string }[];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface Ga4Report {
|
|
278
|
+
dimensionHeaders?: { name: string }[];
|
|
279
|
+
metricHeaders?: { name: string; type?: string }[];
|
|
280
|
+
rows?: Ga4Row[];
|
|
281
|
+
totals?: Ga4Row[];
|
|
282
|
+
rowCount?: number;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const ga4Url = (propertyId: string, method: string) =>
|
|
286
|
+
`https://analyticsdata.googleapis.com/v1beta/properties/${encodeURIComponent(propertyId.replace(/^properties\//, ""))}:${method}`;
|
|
287
|
+
|
|
288
|
+
/** One GA4 report. `propertyId` is the number, with or without `properties/`. */
|
|
289
|
+
export function ga4RunReport(
|
|
290
|
+
token: string,
|
|
291
|
+
propertyId: string,
|
|
292
|
+
request: Ga4ReportRequest,
|
|
293
|
+
options: GoogleCallOptions = {},
|
|
294
|
+
): Promise<Ga4Report> {
|
|
295
|
+
return googleJson(
|
|
296
|
+
ga4Url(propertyId, "runReport"),
|
|
297
|
+
token,
|
|
298
|
+
request,
|
|
299
|
+
options,
|
|
300
|
+
"GA4 runReport",
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/** Up to five GA4 reports in one call, in order. */
|
|
305
|
+
export async function ga4BatchRunReports(
|
|
306
|
+
token: string,
|
|
307
|
+
propertyId: string,
|
|
308
|
+
requests: readonly Ga4ReportRequest[],
|
|
309
|
+
options: GoogleCallOptions = {},
|
|
310
|
+
): Promise<Ga4Report[]> {
|
|
311
|
+
if (requests.length > 5)
|
|
312
|
+
throw new Error("GA4 batchRunReports takes at most 5 reports.");
|
|
313
|
+
const res = await googleJson<{ reports?: Ga4Report[] }>(
|
|
314
|
+
ga4Url(propertyId, "batchRunReports"),
|
|
315
|
+
token,
|
|
316
|
+
{ requests },
|
|
317
|
+
options,
|
|
318
|
+
"GA4 batchRunReports",
|
|
319
|
+
);
|
|
320
|
+
return res.reports ?? [];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export type Ga4RowObject = Record<string, string | number>;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* A report's rows as objects keyed by header name: dimensions as strings,
|
|
327
|
+
* metrics as numbers. `totals: true` reads the totals rows instead.
|
|
328
|
+
*/
|
|
329
|
+
export function ga4Rows(
|
|
330
|
+
report: Ga4Report,
|
|
331
|
+
{ totals = false }: { totals?: boolean } = {},
|
|
332
|
+
): Ga4RowObject[] {
|
|
333
|
+
const dims = report.dimensionHeaders?.map((h) => h.name) ?? [];
|
|
334
|
+
const mets = report.metricHeaders?.map((h) => h.name) ?? [];
|
|
335
|
+
return ((totals ? report.totals : report.rows) ?? []).map((row) => {
|
|
336
|
+
const out: Ga4RowObject = {};
|
|
337
|
+
dims.forEach((name, i) => {
|
|
338
|
+
out[name] = row.dimensionValues?.[i]?.value ?? "";
|
|
339
|
+
});
|
|
340
|
+
mets.forEach((name, i) => {
|
|
341
|
+
out[name] = Number(row.metricValues?.[i]?.value ?? 0);
|
|
342
|
+
});
|
|
343
|
+
return out;
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/** A filter matching a dimension against a list of values. */
|
|
348
|
+
export function inListFilter(
|
|
349
|
+
fieldName: string,
|
|
350
|
+
values: readonly string[],
|
|
351
|
+
): Ga4FilterExpression {
|
|
352
|
+
return { filter: { fieldName, inListFilter: { values: [...values] } } };
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Search Console
|
|
356
|
+
|
|
357
|
+
export interface SearchAnalyticsQuery {
|
|
358
|
+
startDate: string;
|
|
359
|
+
endDate: string;
|
|
360
|
+
dimensions?: (
|
|
361
|
+
| "query"
|
|
362
|
+
| "page"
|
|
363
|
+
| "country"
|
|
364
|
+
| "device"
|
|
365
|
+
| "date"
|
|
366
|
+
| "searchAppearance"
|
|
367
|
+
)[];
|
|
368
|
+
type?: "web" | "image" | "video" | "news" | "discover" | "googleNews";
|
|
369
|
+
dimensionFilterGroups?: Record<string, unknown>[];
|
|
370
|
+
aggregationType?: "auto" | "byPage" | "byProperty";
|
|
371
|
+
dataState?: "final" | "all";
|
|
372
|
+
rowLimit?: number;
|
|
373
|
+
startRow?: number;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export interface SearchAnalyticsRow {
|
|
377
|
+
keys: string[];
|
|
378
|
+
clicks: number;
|
|
379
|
+
impressions: number;
|
|
380
|
+
ctr: number;
|
|
381
|
+
position: number;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Search Console rows for `siteUrl` (`sc-domain:example.com` or a URL
|
|
386
|
+
* prefix). With `all: true` it pages with `startRow` until Google returns a
|
|
387
|
+
* short page.
|
|
388
|
+
*/
|
|
389
|
+
export async function searchConsoleQuery(
|
|
390
|
+
token: string,
|
|
391
|
+
siteUrl: string,
|
|
392
|
+
query: SearchAnalyticsQuery,
|
|
393
|
+
options: GoogleCallOptions & { all?: boolean } = {},
|
|
394
|
+
): Promise<SearchAnalyticsRow[]> {
|
|
395
|
+
const url = `https://www.googleapis.com/webmasters/v3/sites/${encodeURIComponent(siteUrl)}/searchAnalytics/query`;
|
|
396
|
+
const pageSize = query.rowLimit ?? (options.all ? 25_000 : 1_000);
|
|
397
|
+
const rows: SearchAnalyticsRow[] = [];
|
|
398
|
+
let startRow = query.startRow ?? 0;
|
|
399
|
+
for (;;) {
|
|
400
|
+
const res = await googleJson<{ rows?: Partial<SearchAnalyticsRow>[] }>(
|
|
401
|
+
url,
|
|
402
|
+
token,
|
|
403
|
+
{ ...query, rowLimit: pageSize, startRow },
|
|
404
|
+
options,
|
|
405
|
+
"Search Console query",
|
|
406
|
+
);
|
|
407
|
+
const page = (res.rows ?? []).map((r) => ({
|
|
408
|
+
keys: r.keys ?? [],
|
|
409
|
+
clicks: r.clicks ?? 0,
|
|
410
|
+
impressions: r.impressions ?? 0,
|
|
411
|
+
ctr: r.ctr ?? 0,
|
|
412
|
+
position: r.position ?? 0,
|
|
413
|
+
}));
|
|
414
|
+
rows.push(...page);
|
|
415
|
+
if (!options.all || page.length < pageSize) return rows;
|
|
416
|
+
startRow += page.length;
|
|
417
|
+
}
|
|
418
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -37,6 +37,35 @@ export {
|
|
|
37
37
|
wantsMarkdown,
|
|
38
38
|
withHeaders,
|
|
39
39
|
} from "./entry.js";
|
|
40
|
+
export type {
|
|
41
|
+
Ga4DateRange,
|
|
42
|
+
Ga4FilterExpression,
|
|
43
|
+
Ga4Report,
|
|
44
|
+
Ga4ReportRequest,
|
|
45
|
+
Ga4RowObject,
|
|
46
|
+
GoogleAuthOptions,
|
|
47
|
+
GoogleCallOptions,
|
|
48
|
+
GoogleTokenSource,
|
|
49
|
+
SearchAnalyticsQuery,
|
|
50
|
+
SearchAnalyticsRow,
|
|
51
|
+
ServiceAccount,
|
|
52
|
+
} from "./google.js";
|
|
53
|
+
export {
|
|
54
|
+
createGoogleAuth,
|
|
55
|
+
GA4_SCOPE,
|
|
56
|
+
GOOGLE_TOKEN_URL,
|
|
57
|
+
GoogleApiError,
|
|
58
|
+
ga4BatchRunReports,
|
|
59
|
+
ga4Rows,
|
|
60
|
+
ga4RunReport,
|
|
61
|
+
googleAccessToken,
|
|
62
|
+
importServiceAccountKey,
|
|
63
|
+
inListFilter,
|
|
64
|
+
parseServiceAccount,
|
|
65
|
+
SEARCH_CONSOLE_SCOPE,
|
|
66
|
+
searchConsoleQuery,
|
|
67
|
+
serviceAccountJwt,
|
|
68
|
+
} from "./google.js";
|
|
40
69
|
export type {
|
|
41
70
|
HeadLink,
|
|
42
71
|
HeadScript,
|
|
@@ -47,6 +76,23 @@ export type {
|
|
|
47
76
|
SiteHead,
|
|
48
77
|
} from "./head.js";
|
|
49
78
|
export { createPageHead, jsonLdScript } from "./head.js";
|
|
79
|
+
export type {
|
|
80
|
+
MailAddress,
|
|
81
|
+
MailAttachment,
|
|
82
|
+
Mailer,
|
|
83
|
+
MailMessage,
|
|
84
|
+
MailResult,
|
|
85
|
+
ResendOptions,
|
|
86
|
+
SendEmailBinding,
|
|
87
|
+
} from "./mail.js";
|
|
88
|
+
export {
|
|
89
|
+
checkMessage,
|
|
90
|
+
cloudflareMailer,
|
|
91
|
+
escapeHtml,
|
|
92
|
+
MailError,
|
|
93
|
+
recordingMailer,
|
|
94
|
+
resendMailer,
|
|
95
|
+
} from "./mail.js";
|
|
50
96
|
export type {
|
|
51
97
|
AnalyticsScriptOptions,
|
|
52
98
|
GaEventParams,
|
|
@@ -60,6 +106,23 @@ export {
|
|
|
60
106
|
tagManagerScript,
|
|
61
107
|
themeScript,
|
|
62
108
|
} from "./scripts.js";
|
|
109
|
+
export type {
|
|
110
|
+
BrowserSentryOptions,
|
|
111
|
+
SentryEventLike,
|
|
112
|
+
WorkerSentryOptions,
|
|
113
|
+
} from "./sentry.js";
|
|
114
|
+
export {
|
|
115
|
+
BROWSER_DENY_URLS,
|
|
116
|
+
browserSentryOptions,
|
|
117
|
+
dropLocalEvents,
|
|
118
|
+
EXTENSION_ERROR,
|
|
119
|
+
isBrowserNoise,
|
|
120
|
+
isLocalEvent,
|
|
121
|
+
NETWORK_ERROR,
|
|
122
|
+
USER_REJECTION,
|
|
123
|
+
validDsn,
|
|
124
|
+
workerSentryOptions,
|
|
125
|
+
} from "./sentry.js";
|
|
63
126
|
export type { RobotsOptions, RobotsRule, SitemapEntry } from "./seo.js";
|
|
64
127
|
export { escapeXml, robotsTxt, sitemapXml } from "./seo.js";
|
|
65
128
|
export type { WorkersModule } from "./workers.js";
|