submitnow-mcp 0.0.0-stage → 2.2.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.
@@ -0,0 +1,614 @@
1
+ import crypto from 'node:crypto';
2
+ import zlib from 'node:zlib';
3
+ import { resolveIndexNowEndpoint, validateKeyLocationScope, } from "./indexnow-endpoints.js";
4
+ import { safeFetch, SafeFetchError } from "./safe-fetch.js";
5
+ import { analyzeUrlList, chunkUrls, filterSitemapEntriesByLastMod, MAX_INDEXNOW_BATCH_SIZE, parseRobotsTxtSitemaps, parseSitemapXmlString, } from "./seo-tools.js";
6
+ const KEY_PATTERN = /^[a-zA-Z0-9-]{8,128}$/;
7
+ const MAX_KEY_BODY_BYTES = 4096;
8
+ const MAX_ROBOTS_BYTES = 512 * 1024;
9
+ const MAX_SITEMAP_DOWNLOAD_BYTES = 10 * 1024 * 1024;
10
+ const MAX_SITEMAP_DECOMPRESSED_BYTES = 25 * 1024 * 1024;
11
+ const CHILD_CONCURRENCY = 4;
12
+ export function generateSecureKey() {
13
+ return crypto.randomBytes(24).toString('hex');
14
+ }
15
+ function normalizeKeyInput(rawKey) {
16
+ const trimmed = rawKey.trim();
17
+ return trimmed.toLowerCase().endsWith('.txt')
18
+ ? trimmed.slice(0, -4)
19
+ : trimmed;
20
+ }
21
+ function normalizeHostInput(rawHost) {
22
+ const trimmed = rawHost.trim();
23
+ if (!trimmed)
24
+ return null;
25
+ try {
26
+ const parsed = trimmed.startsWith('http://') || trimmed.startsWith('https://')
27
+ ? new URL(trimmed)
28
+ : new URL(`https://${trimmed}`);
29
+ return parsed.hostname || null;
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
35
+ export async function verifyRemoteKeyFile(input) {
36
+ const key = normalizeKeyInput(input.key);
37
+ if (!KEY_PATTERN.test(key)) {
38
+ return {
39
+ ok: false,
40
+ errorCode: 'invalid_key',
41
+ message: 'Key must be 8–128 characters using letters, numbers, and dashes.',
42
+ };
43
+ }
44
+ const host = normalizeHostInput(input.host);
45
+ if (!host) {
46
+ return {
47
+ ok: false,
48
+ errorCode: 'invalid_host',
49
+ message: 'Host must be a valid domain name.',
50
+ };
51
+ }
52
+ let keyLocation;
53
+ if (input.keyLocation?.trim()) {
54
+ try {
55
+ keyLocation = new URL(input.keyLocation.trim());
56
+ }
57
+ catch {
58
+ return {
59
+ ok: false,
60
+ errorCode: 'invalid_key_location',
61
+ message: 'Key location must be a valid http(s) URL.',
62
+ };
63
+ }
64
+ if ((keyLocation.protocol !== 'http:' && keyLocation.protocol !== 'https:') ||
65
+ keyLocation.hostname !== host) {
66
+ return {
67
+ ok: false,
68
+ errorCode: 'invalid_key_location',
69
+ message: 'Key location must use http(s) on the same host.',
70
+ };
71
+ }
72
+ }
73
+ else {
74
+ keyLocation = new URL(`https://${host}/${key}.txt`);
75
+ }
76
+ try {
77
+ const response = await safeFetch(keyLocation, {
78
+ timeoutMs: 8000,
79
+ maxBytes: MAX_KEY_BODY_BYTES,
80
+ maxRedirects: 5,
81
+ accept: 'text/plain, */*',
82
+ allowTruncate: true,
83
+ });
84
+ const issues = [];
85
+ if (response.status === 404) {
86
+ issues.push('not_found');
87
+ }
88
+ else if (!response.ok) {
89
+ issues.push('http_error');
90
+ }
91
+ if (new URL(response.finalUrl).hostname !== host) {
92
+ issues.push('redirected_off_host');
93
+ }
94
+ const { bytes, truncated } = response;
95
+ const hasBom = bytes[0] === 0xef && bytes[1] === 0xbb && bytes[2] === 0xbf;
96
+ if (truncated)
97
+ issues.push('body_too_large');
98
+ const raw = new TextDecoder('utf-8').decode(bytes);
99
+ const body = raw.replace(/^\uFEFF/, '').trim();
100
+ if (response.ok) {
101
+ if (hasBom)
102
+ issues.push('byte_order_mark');
103
+ if (!body) {
104
+ issues.push('empty_body');
105
+ }
106
+ else if (/^<(!doctype|html)/i.test(body)) {
107
+ issues.push('html_response');
108
+ }
109
+ else if (body !== key) {
110
+ issues.push('key_mismatch');
111
+ }
112
+ }
113
+ return {
114
+ ok: true,
115
+ valid: issues.length === 0,
116
+ keyLocation: keyLocation.toString(),
117
+ finalUrl: response.finalUrl,
118
+ status: response.status,
119
+ contentType: response.headers.get('content-type'),
120
+ body: body.slice(0, 200),
121
+ issues,
122
+ };
123
+ }
124
+ catch (error) {
125
+ if (error instanceof SafeFetchError) {
126
+ if (error.code === 'blocked_url') {
127
+ return { ok: false, errorCode: 'blocked_url', message: error.message };
128
+ }
129
+ if (error.code === 'timeout') {
130
+ return { ok: false, errorCode: 'timeout', message: error.message };
131
+ }
132
+ }
133
+ return {
134
+ ok: false,
135
+ errorCode: 'fetch_failed',
136
+ message: 'Failed to fetch key file.',
137
+ };
138
+ }
139
+ }
140
+ function normalizeSitemapInputUrl(raw) {
141
+ const trimmed = raw.trim();
142
+ if (!trimmed)
143
+ return null;
144
+ try {
145
+ const withScheme = trimmed.startsWith('http://') || trimmed.startsWith('https://')
146
+ ? trimmed
147
+ : `https://${trimmed}`;
148
+ const url = new URL(withScheme);
149
+ return url.protocol === 'http:' || url.protocol === 'https:' ? url : null;
150
+ }
151
+ catch {
152
+ return null;
153
+ }
154
+ }
155
+ function isRootDomainUrl(url) {
156
+ return (url.pathname === '/' || url.pathname === '') && !url.search;
157
+ }
158
+ function decodeSitemapBytes(bytes) {
159
+ const isGzip = bytes.byteLength >= 2 && bytes[0] === 0x1f && bytes[1] === 0x8b;
160
+ if (isGzip) {
161
+ const gunzipped = zlib.gunzipSync(bytes, {
162
+ maxOutputLength: MAX_SITEMAP_DECOMPRESSED_BYTES,
163
+ });
164
+ return new TextDecoder('utf-8').decode(gunzipped);
165
+ }
166
+ return new TextDecoder('utf-8').decode(bytes);
167
+ }
168
+ /**
169
+ * Discovers candidate sitemap URLs when a caller passes a bare domain/origin
170
+ * (e.g. `example.com` or `https://example.com/`): checks `robots.txt` for
171
+ * `Sitemap:` lines first, then falls back to `/sitemap_index.xml` and `/sitemap.xml`.
172
+ */
173
+ async function discoverRootSitemaps(originUrl, remainingMs) {
174
+ const robotsUrl = new URL('/robots.txt', originUrl);
175
+ try {
176
+ const res = await safeFetch(robotsUrl, {
177
+ timeoutMs: Math.min(6_000, Math.max(1_000, remainingMs)),
178
+ maxBytes: MAX_ROBOTS_BYTES,
179
+ maxRedirects: 5,
180
+ accept: 'text/plain, */*',
181
+ allowTruncate: true,
182
+ });
183
+ if (res.ok) {
184
+ const text = new TextDecoder('utf-8').decode(res.bytes);
185
+ const declared = parseRobotsTxtSitemaps(text);
186
+ if (declared.length > 0) {
187
+ return { ok: true, candidates: declared, viaRobots: true };
188
+ }
189
+ }
190
+ }
191
+ catch (error) {
192
+ if (error instanceof SafeFetchError && error.code === 'blocked_url') {
193
+ return { ok: false, errorCode: 'blocked_url', message: error.message };
194
+ }
195
+ }
196
+ return {
197
+ ok: true,
198
+ candidates: [
199
+ new URL('/sitemap_index.xml', originUrl).toString(),
200
+ new URL('/sitemap.xml', originUrl).toString(),
201
+ ],
202
+ viaRobots: false,
203
+ };
204
+ }
205
+ export async function fetchRemoteSitemapEntries(input) {
206
+ const maxChildSitemaps = Math.min(Math.max(1, input.maxChildSitemaps ?? 20), 50);
207
+ const maxUrls = Math.min(Math.max(1, input.maxUrls ?? 50_000), 100_000);
208
+ const deadline = Date.now() + (input.deadlineMs ?? 22_000);
209
+ const parsedInput = normalizeSitemapInputUrl(input.url);
210
+ if (!parsedInput) {
211
+ return {
212
+ ok: false,
213
+ errorCode: 'invalid_url',
214
+ message: 'Provide a valid http(s) sitemap URL or domain.',
215
+ };
216
+ }
217
+ const fetchOne = async (target) => {
218
+ const remaining = deadline - Date.now();
219
+ if (remaining <= 500) {
220
+ return { ok: false, errorCode: 'timeout' };
221
+ }
222
+ try {
223
+ const res = await safeFetch(target, {
224
+ timeoutMs: Math.min(10_000, remaining),
225
+ maxBytes: MAX_SITEMAP_DOWNLOAD_BYTES,
226
+ maxRedirects: 5,
227
+ accept: 'application/xml, text/xml, application/gzip, */*',
228
+ });
229
+ if (!res.ok) {
230
+ return { ok: false, errorCode: 'http_error', status: res.status };
231
+ }
232
+ let xml;
233
+ try {
234
+ xml = decodeSitemapBytes(res.bytes);
235
+ }
236
+ catch {
237
+ return { ok: false, errorCode: 'response_too_large' };
238
+ }
239
+ const parsed = parseSitemapXmlString(xml);
240
+ if (parsed.error === 'invalid_xml' || parsed.type === 'unsupported') {
241
+ return { ok: false, errorCode: 'invalid_xml' };
242
+ }
243
+ return { ok: true, finalUrl: res.finalUrl, parsed };
244
+ }
245
+ catch (error) {
246
+ if (error instanceof SafeFetchError) {
247
+ if (error.code === 'blocked_url') {
248
+ return { ok: false, errorCode: 'blocked_url' };
249
+ }
250
+ if (error.code === 'timeout') {
251
+ return { ok: false, errorCode: 'timeout' };
252
+ }
253
+ if (error.code === 'response_too_large') {
254
+ return { ok: false, errorCode: 'response_too_large' };
255
+ }
256
+ }
257
+ return { ok: false, errorCode: 'fetch_failed' };
258
+ }
259
+ };
260
+ const entriesByUrl = new Map();
261
+ const visitedSitemaps = new Set();
262
+ const queue = [];
263
+ let sourceUrl = parsedInput.toString();
264
+ let duplicateCount = 0;
265
+ let invalidLocationsCount = 0;
266
+ let fetchedSitemapsCount = 0;
267
+ let childSitemapsFound = 0;
268
+ let failedSitemapsCount = 0;
269
+ let truncatedBySitemapLimit = false;
270
+ let truncatedByUrlLimit = false;
271
+ const addEntries = (items) => {
272
+ for (const item of items) {
273
+ if (entriesByUrl.has(item.url)) {
274
+ duplicateCount += 1;
275
+ continue;
276
+ }
277
+ if (entriesByUrl.size >= maxUrls) {
278
+ truncatedByUrlLimit = true;
279
+ break;
280
+ }
281
+ entriesByUrl.set(item.url, item);
282
+ }
283
+ };
284
+ const enqueueChildren = (urls, depth) => {
285
+ for (const childUrl of urls) {
286
+ if (visitedSitemaps.has(childUrl))
287
+ continue;
288
+ visitedSitemaps.add(childUrl);
289
+ childSitemapsFound += 1;
290
+ if (queue.length >= maxChildSitemaps) {
291
+ truncatedBySitemapLimit = true;
292
+ continue;
293
+ }
294
+ queue.push({ url: childUrl, depth });
295
+ }
296
+ };
297
+ if (isRootDomainUrl(parsedInput)) {
298
+ const discovered = await discoverRootSitemaps(parsedInput, deadline - Date.now());
299
+ if (!discovered.ok) {
300
+ return discovered;
301
+ }
302
+ if (discovered.viaRobots) {
303
+ sourceUrl = new URL('/robots.txt', parsedInput).toString();
304
+ enqueueChildren(discovered.candidates, 1);
305
+ }
306
+ else {
307
+ // Probe common fallback locations until one valid sitemap succeeds
308
+ let lastFailure = {
309
+ errorCode: 'fetch_failed',
310
+ };
311
+ let foundRoot = false;
312
+ for (const candidate of discovered.candidates) {
313
+ const res = await fetchOne(new URL(candidate));
314
+ if (res.ok) {
315
+ foundRoot = true;
316
+ sourceUrl = res.finalUrl;
317
+ visitedSitemaps.add(res.finalUrl);
318
+ fetchedSitemapsCount += 1;
319
+ duplicateCount += res.parsed.duplicateCount;
320
+ invalidLocationsCount += res.parsed.invalidLocations.length;
321
+ if (res.parsed.type === 'urlset') {
322
+ addEntries(res.parsed.entries);
323
+ }
324
+ else if (res.parsed.type === 'index') {
325
+ enqueueChildren(res.parsed.childSitemaps, 1);
326
+ }
327
+ break;
328
+ }
329
+ lastFailure = { errorCode: res.errorCode, status: res.status };
330
+ if (res.errorCode === 'blocked_url')
331
+ break;
332
+ }
333
+ if (!foundRoot) {
334
+ return {
335
+ ok: false,
336
+ errorCode: lastFailure.errorCode,
337
+ status: lastFailure.status,
338
+ message: `Could not discover a sitemap (${lastFailure.errorCode}).`,
339
+ };
340
+ }
341
+ }
342
+ }
343
+ else {
344
+ const rootFetch = await fetchOne(parsedInput);
345
+ if (!rootFetch.ok) {
346
+ return {
347
+ ok: false,
348
+ errorCode: rootFetch.errorCode,
349
+ status: rootFetch.status,
350
+ message: `Failed to read sitemap (${rootFetch.errorCode}).`,
351
+ };
352
+ }
353
+ sourceUrl = rootFetch.finalUrl;
354
+ visitedSitemaps.add(rootFetch.finalUrl);
355
+ fetchedSitemapsCount = 1;
356
+ duplicateCount += rootFetch.parsed.duplicateCount;
357
+ invalidLocationsCount += rootFetch.parsed.invalidLocations.length;
358
+ if (rootFetch.parsed.type === 'urlset') {
359
+ addEntries(rootFetch.parsed.entries);
360
+ }
361
+ else if (rootFetch.parsed.type === 'index') {
362
+ enqueueChildren(rootFetch.parsed.childSitemaps, 1);
363
+ }
364
+ }
365
+ if (queue.length > 0) {
366
+ let cursor = 0;
367
+ const worker = async () => {
368
+ while (cursor < queue.length) {
369
+ if (truncatedByUrlLimit || Date.now() >= deadline - 500)
370
+ break;
371
+ const item = queue[cursor];
372
+ cursor += 1;
373
+ const childUrl = normalizeSitemapInputUrl(item.url);
374
+ if (!childUrl) {
375
+ failedSitemapsCount += 1;
376
+ continue;
377
+ }
378
+ const childRes = await fetchOne(childUrl);
379
+ if (!childRes.ok) {
380
+ failedSitemapsCount += 1;
381
+ continue;
382
+ }
383
+ fetchedSitemapsCount += 1;
384
+ duplicateCount += childRes.parsed.duplicateCount;
385
+ invalidLocationsCount += childRes.parsed.invalidLocations.length;
386
+ if (childRes.parsed.type === 'urlset') {
387
+ addEntries(childRes.parsed.entries);
388
+ }
389
+ else if (childRes.parsed.type === 'index' && item.depth < 2) {
390
+ enqueueChildren(childRes.parsed.childSitemaps, item.depth + 1);
391
+ }
392
+ }
393
+ };
394
+ const workerCount = Math.min(CHILD_CONCURRENCY, queue.length);
395
+ await Promise.all(Array.from({ length: workerCount }, () => worker()));
396
+ }
397
+ const allEntries = Array.from(entriesByUrl.values());
398
+ if (allEntries.length === 0) {
399
+ return {
400
+ ok: false,
401
+ errorCode: 'empty_sitemap',
402
+ message: 'No valid http(s) URLs found in sitemap.',
403
+ };
404
+ }
405
+ const filtered = filterSitemapEntriesByLastMod(allEntries, input.maxAgeDays ?? null);
406
+ return {
407
+ ok: true,
408
+ sourceUrl,
409
+ fetchedSitemapsCount,
410
+ childSitemapsFound,
411
+ failedSitemapsCount,
412
+ duplicateCount,
413
+ invalidLocationsCount,
414
+ totalExtractedCount: allEntries.length,
415
+ entries: filtered.matched,
416
+ filteredOutByLastModCount: filtered.olderCount,
417
+ withoutLastModCount: filtered.withoutLastModCount,
418
+ truncatedBySitemapLimit,
419
+ truncatedByUrlLimit,
420
+ };
421
+ }
422
+ function mapHttpStatusToErrorCode(status) {
423
+ switch (status) {
424
+ case 400:
425
+ return 'bing_invalid_request';
426
+ case 403:
427
+ return 'bing_invalid_key';
428
+ case 422:
429
+ return 'bing_invalid_url_list';
430
+ case 429:
431
+ return 'bing_rate_limited';
432
+ default:
433
+ return 'bing_error';
434
+ }
435
+ }
436
+ export async function submitIndexNowBatches(input) {
437
+ const key = normalizeKeyInput(input.key);
438
+ if (!KEY_PATTERN.test(key)) {
439
+ return {
440
+ ok: false,
441
+ errorCode: 'invalid_key',
442
+ message: 'Key must be 8–128 characters using letters, numbers, and dashes.',
443
+ };
444
+ }
445
+ const analysis = analyzeUrlList(input.urls.join('\n'));
446
+ if (analysis.invalidInputs.length > 0) {
447
+ return {
448
+ ok: false,
449
+ errorCode: 'invalid_urls',
450
+ message: `Invalid URL found: ${analysis.invalidInputs[0]}`,
451
+ details: { invalidUrl: analysis.invalidInputs[0] },
452
+ };
453
+ }
454
+ if (analysis.validUrls.length === 0) {
455
+ return {
456
+ ok: false,
457
+ errorCode: 'invalid_urls',
458
+ message: 'Provide at least one valid http(s) URL.',
459
+ };
460
+ }
461
+ if (input.enforceSingleBatch &&
462
+ analysis.validUrls.length > MAX_INDEXNOW_BATCH_SIZE) {
463
+ return {
464
+ ok: false,
465
+ errorCode: 'too_many_urls',
466
+ message: `Too many URLs (${analysis.validUrls.length}). Max is ${MAX_INDEXNOW_BATCH_SIZE} per request.`,
467
+ details: { max: MAX_INDEXNOW_BATCH_SIZE, got: analysis.validUrls.length },
468
+ };
469
+ }
470
+ if (analysis.hostGroups.length !== 1) {
471
+ return {
472
+ ok: false,
473
+ errorCode: 'mixed_hosts',
474
+ message: 'All URLs in one submission must belong to the same host.',
475
+ details: { hosts: analysis.hostGroups.map((g) => g.host).slice(0, 10) },
476
+ };
477
+ }
478
+ const parsedUrls = analysis.validUrls.map((raw) => new URL(raw));
479
+ const derivedHost = parsedUrls[0].hostname;
480
+ const providedHost = input.host ? normalizeHostInput(input.host) : null;
481
+ if (input.host && !providedHost) {
482
+ return {
483
+ ok: false,
484
+ errorCode: 'invalid_host',
485
+ message: 'Provided host is invalid.',
486
+ };
487
+ }
488
+ if (providedHost && providedHost !== derivedHost) {
489
+ return {
490
+ ok: false,
491
+ errorCode: 'host_mismatch',
492
+ message: `Host ${providedHost} does not match URL host ${derivedHost}.`,
493
+ details: { derivedHost, providedHost },
494
+ };
495
+ }
496
+ const host = providedHost ?? derivedHost;
497
+ let keyLocationUrl;
498
+ if (input.keyLocation?.trim()) {
499
+ try {
500
+ keyLocationUrl = new URL(input.keyLocation.trim());
501
+ }
502
+ catch {
503
+ return {
504
+ ok: false,
505
+ errorCode: 'invalid_key_location',
506
+ message: 'Key location must be a valid http(s) URL.',
507
+ };
508
+ }
509
+ }
510
+ else {
511
+ const safeProto = parsedUrls[0].protocol === 'http:' ? 'http:' : 'https:';
512
+ keyLocationUrl = new URL(`${safeProto}//${host}/${key}.txt`);
513
+ }
514
+ const scope = validateKeyLocationScope(keyLocationUrl, host, parsedUrls);
515
+ if (!scope.valid) {
516
+ return {
517
+ ok: false,
518
+ errorCode: scope.reason === 'subdirectory_mismatch'
519
+ ? 'key_location_scope_mismatch'
520
+ : scope.reason === 'protocol_mismatch'
521
+ ? 'key_location_protocol_mismatch'
522
+ : 'invalid_key_location',
523
+ message: `Key location scope validation failed (${scope.reason}).`,
524
+ details: {
525
+ keyProtocol: keyLocationUrl.protocol,
526
+ directoryPrefix: scope.directoryPrefix,
527
+ invalidUrl: scope.invalidUrl,
528
+ },
529
+ };
530
+ }
531
+ const endpoint = resolveIndexNowEndpoint(input.endpointId);
532
+ const chunks = input.enforceSingleBatch
533
+ ? [analysis.validUrls]
534
+ : chunkUrls(analysis.validUrls, MAX_INDEXNOW_BATCH_SIZE);
535
+ const batchResults = [];
536
+ if (input.dryRun) {
537
+ for (let i = 0; i < chunks.length; i += 1) {
538
+ batchResults.push({ index: i + 1, count: chunks[i].length, status: 0 });
539
+ }
540
+ return {
541
+ ok: true,
542
+ dryRun: true,
543
+ endpointId: endpoint.id,
544
+ endpointName: endpoint.name,
545
+ endpointUrl: endpoint.url,
546
+ host,
547
+ keyLocation: keyLocationUrl.toString(),
548
+ submittedCount: analysis.validUrls.length,
549
+ status: 0,
550
+ batches: batchResults,
551
+ };
552
+ }
553
+ let lastStatus = 200;
554
+ for (let i = 0; i < chunks.length; i += 1) {
555
+ const payload = {
556
+ host,
557
+ key,
558
+ keyLocation: keyLocationUrl.toString(),
559
+ urlList: chunks[i],
560
+ };
561
+ let response;
562
+ try {
563
+ response = await fetch(endpoint.url, {
564
+ method: 'POST',
565
+ headers: { 'Content-Type': 'application/json; charset=utf-8' },
566
+ body: JSON.stringify(payload),
567
+ signal: AbortSignal.timeout(15_000),
568
+ });
569
+ }
570
+ catch (error) {
571
+ return {
572
+ ok: false,
573
+ errorCode: error instanceof DOMException && error.name === 'TimeoutError'
574
+ ? 'timeout'
575
+ : 'network_error',
576
+ message: error instanceof Error ? error.message : 'IndexNow request failed.',
577
+ details: { failedBatch: i + 1, totalBatches: chunks.length },
578
+ };
579
+ }
580
+ if (!response.ok) {
581
+ const bodyPreview = await response.text().catch(() => '');
582
+ return {
583
+ ok: false,
584
+ errorCode: mapHttpStatusToErrorCode(response.status),
585
+ message: `Endpoint returned HTTP ${response.status} on batch ${i + 1}/${chunks.length}.`,
586
+ details: {
587
+ status: response.status,
588
+ endpointName: endpoint.name,
589
+ failedBatch: i + 1,
590
+ totalBatches: chunks.length,
591
+ bodyPreview: bodyPreview.slice(0, 500),
592
+ },
593
+ };
594
+ }
595
+ lastStatus = response.status;
596
+ batchResults.push({
597
+ index: i + 1,
598
+ count: chunks[i].length,
599
+ status: response.status,
600
+ });
601
+ }
602
+ return {
603
+ ok: true,
604
+ dryRun: false,
605
+ endpointId: endpoint.id,
606
+ endpointName: endpoint.name,
607
+ endpointUrl: endpoint.url,
608
+ host,
609
+ keyLocation: keyLocationUrl.toString(),
610
+ submittedCount: analysis.validUrls.length,
611
+ status: lastStatus,
612
+ batches: batchResults,
613
+ };
614
+ }