@canonry/canonry 7.51.5 → 7.51.6
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/dist/ads-ABAT3K4K.js +544 -0
- package/dist/agent-5G4DRLYX.js +70 -0
- package/dist/agent-ask-UDVCZRO7.js +139 -0
- package/dist/agent-conversations-5E4JP2QZ.js +52 -0
- package/dist/agent-memory-7IIJ4HGZ.js +92 -0
- package/dist/agent-providers-BOXPUXZ4.js +55 -0
- package/dist/agent-transcript-4O56G6PQ.js +77 -0
- package/dist/analytics-PKMWX5XL.js +240 -0
- package/dist/apply-OK4XEBDA.js +175 -0
- package/dist/backfill-2OT56CX2.js +41 -0
- package/dist/backlinks-547WCHND.js +303 -0
- package/dist/bing-ZVBV4ZD5.js +418 -0
- package/dist/bootstrap-HUB7XQ73.js +326 -0
- package/dist/cdp-KQKQ4PWJ.js +162 -0
- package/dist/chunk-2G6IP3MO.js +517 -0
- package/dist/chunk-42D2LE2B.js +1273 -0
- package/dist/chunk-4MJYGB56.js +124 -0
- package/dist/chunk-63ISSSGX.js +9150 -0
- package/dist/{chunk-PLYJX67A.js → chunk-6G6FTDWC.js} +8080 -13939
- package/dist/chunk-6GO5VVAC.js +15 -0
- package/dist/{chunk-4YCGZGA3.js → chunk-73P65KPW.js} +2 -2
- package/dist/chunk-7B2Q4NJE.js +133 -0
- package/dist/{chunk-JBZZEIM2.js → chunk-7WZ2FPB4.js} +2 -13
- package/dist/chunk-AOJU5LKX.js +8 -0
- package/dist/chunk-B2FR2ZQ4.js +420 -0
- package/dist/{chunk-HAHXPJQ5.js → chunk-B5J675KK.js} +16 -1684
- package/dist/{chunk-SFMWHPMX.js → chunk-D6COIM3U.js} +17128 -17143
- package/dist/{chunk-A3WSAAQS.js → chunk-DGVUTH7W.js} +9086 -34522
- package/dist/chunk-ELCLGWUT.js +83 -0
- package/dist/chunk-GO2J7SYT.js +1034 -0
- package/dist/chunk-HACZUMGM.js +145 -0
- package/dist/chunk-HM4NNKLG.js +94 -0
- package/dist/chunk-I3A56PFP.js +58 -0
- package/dist/chunk-I77PLCWG.js +961 -0
- package/dist/chunk-ISOQPVPY.js +232 -0
- package/dist/chunk-KFT5LOP2.js +610 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-MMEO22MF.js +38 -0
- package/dist/chunk-NHQ2U5I4.js +78 -0
- package/dist/chunk-PCXRFT3N.js +530 -0
- package/dist/chunk-PITHTCAX.js +15376 -0
- package/dist/chunk-QWKPSFGL.js +30 -0
- package/dist/chunk-RKIXES2B.js +609 -0
- package/dist/chunk-TSENU4GG.js +18 -0
- package/dist/{chunk-HLVEB5TB.js → chunk-TUTKNUMV.js} +7 -5
- package/dist/chunk-U3AHE2RT.js +1160 -0
- package/dist/chunk-UQ3MOZGC.js +644 -0
- package/dist/{chunk-AZFPA7JV.js → chunk-VBCE4CLX.js} +6 -4
- package/dist/chunk-VJWDBFSL.js +69 -0
- package/dist/chunk-VYMZ3QXG.js +8264 -0
- package/dist/chunk-WAULJDKO.js +2686 -0
- package/dist/chunk-WDFI5YMD.js +204 -0
- package/dist/chunk-XEBKF4N5.js +8 -0
- package/dist/chunk-Z7IUAJOF.js +13 -0
- package/dist/{chunk-KEATAHXH.js → chunk-ZWJRY5UI.js} +358 -581
- package/dist/chunk-ZXUAWVWM.js +15 -0
- package/dist/citations-UYB2RU5U.js +106 -0
- package/dist/{cli-catalog-MO6Z2CIZ.js → cli-catalog-F6FI7NB2.js} +5 -3
- package/dist/cli-commands-ZG5ILKDA.js +19 -0
- package/dist/cli.js +35 -29
- package/dist/competitor-EKP4R7YY.js +561 -0
- package/dist/content-DREE6JF3.js +257 -0
- package/dist/dashboard-ZALEOLLU.js +71 -0
- package/dist/demo-JG4Y22O4.js +75 -0
- package/dist/{demo-server-GIWDJGJX.js → demo-server-3A4J2C65.js} +22 -9
- package/dist/discover-W6GMD2HS.js +372 -0
- package/dist/discover-eval-CKFZHRBW.js +282 -0
- package/dist/doctor-TNGBSUMA.js +152 -0
- package/dist/evidence-3H2GFQBZ.js +57 -0
- package/dist/export-cmd-WUIKU5GK.js +49 -0
- package/dist/ga-JI6REFO4.js +911 -0
- package/dist/gbp-4ENDM5NS.js +370 -0
- package/dist/google-HKQSCLOC.js +946 -0
- package/dist/google-marketing-KQR5J2S4.js +403 -0
- package/dist/health-cmd-TS7EMMCS.js +64 -0
- package/dist/history-MSD5DK6K.js +90 -0
- package/dist/index.d.ts +47 -47
- package/dist/index.js +29 -6
- package/dist/init-L6WAEOWX.js +432 -0
- package/dist/insights-RTZ3IZTD.js +63 -0
- package/dist/intelligence-service-TH52PCNJ.js +15 -0
- package/dist/keys-625DZBRM.js +116 -0
- package/dist/keyword-CW46RNRR.js +164 -0
- package/dist/logs-V33SHBIW.js +30 -0
- package/dist/mcp-DFEDPSEG.js +14 -0
- package/dist/mcp.js +14 -5
- package/dist/measurement-plan-6W37RUOP.js +42 -0
- package/dist/notify-DSUOT7WO.js +125 -0
- package/dist/organic-evidence-BMN6L4OB.js +53 -0
- package/dist/overview-WRRMBZ6S.js +213 -0
- package/dist/project-2GJIU3FE.js +460 -0
- package/dist/query-3XPMGJUA.js +211 -0
- package/dist/research-V433CKJ4.js +200 -0
- package/dist/results-export-RGBU7QQQ.js +27 -0
- package/dist/run-NIAC6OJN.js +31 -0
- package/dist/schedule-KDWXRIE7.js +177 -0
- package/dist/search-626MPUJN.js +42 -0
- package/dist/serve-73SMMASI.js +557 -0
- package/dist/session-7WWOETZB.js +47 -0
- package/dist/settings-VKFQO6F2.js +107 -0
- package/dist/skills-5HC5H7TE.js +33 -0
- package/dist/snapshot-BSJUHFBC.js +538 -0
- package/dist/src-F6HM73TN.js +316 -0
- package/dist/status-V4OWP7LZ.js +126 -0
- package/dist/support-ARF4HER7.js +24 -0
- package/dist/technical-aeo-TG7CGU3F.js +625 -0
- package/dist/telemetry-O2IUNUBW.js +118 -0
- package/dist/tools-2GJIDKND.js +41 -0
- package/dist/traffic-XV4I3UPH.js +1295 -0
- package/dist/users-VGBLDL5K.js +170 -0
- package/dist/visibility-stats-UKJYJ6PP.js +241 -0
- package/dist/wordpress-JZA7CGC6.js +600 -0
- package/package.json +1 -1
- package/dist/chunk-4QQYYRHV.js +0 -23082
- package/dist/cli-commands-FOJR3HHU.js +0 -15
- package/dist/intelligence-service-XQCNWAPL.js +0 -9
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
measurementDraftApplyAssignmentsRequestSchema,
|
|
3
|
+
measurementDraftApplyGroupMembershipRequestSchema,
|
|
4
|
+
measurementDraftApplyPairedAssignmentsRequestSchema,
|
|
5
|
+
measurementDraftApplySitemapSelectionRequestSchema,
|
|
6
|
+
measurementDraftClassifyAssignmentsRequestSchema,
|
|
7
|
+
measurementDraftClearAssignmentsRequestSchema,
|
|
8
|
+
measurementDraftCreateRequestSchema,
|
|
9
|
+
measurementDraftExcludeTargetRequestSchema,
|
|
10
|
+
measurementDraftImportSitemapRequestSchema,
|
|
11
|
+
measurementDraftMergeTargetsRequestSchema,
|
|
12
|
+
measurementDraftPreviewAssignmentsRequestSchema,
|
|
13
|
+
measurementDraftPreviewGroupMembershipRequestSchema,
|
|
14
|
+
measurementDraftPublishRequestSchema,
|
|
15
|
+
measurementDraftRebindTargetRequestSchema,
|
|
16
|
+
measurementDraftRemoveAssignmentRequestSchema,
|
|
17
|
+
measurementDraftRemoveCompetitorRequestSchema,
|
|
18
|
+
measurementDraftRemoveGroupRequestSchema,
|
|
19
|
+
measurementDraftRenameTargetRequestSchema,
|
|
20
|
+
measurementDraftReplaceAssignmentsRequestSchema,
|
|
21
|
+
measurementDraftUpsertCompetitorRequestSchema,
|
|
22
|
+
measurementDraftUpsertGroupRequestSchema,
|
|
23
|
+
measurementDraftUpsertMarketRequestSchema,
|
|
24
|
+
measurementDraftUpsertTargetRequestSchema
|
|
25
|
+
} from "./chunk-D6COIM3U.js";
|
|
26
|
+
|
|
27
|
+
// src/measurement-draft-actions.ts
|
|
28
|
+
import { z } from "zod";
|
|
29
|
+
var idempotencyKeySchema = z.string().trim().min(1).describe(
|
|
30
|
+
"A fresh request key. Reuse it only when retrying the identical request."
|
|
31
|
+
);
|
|
32
|
+
var draftEtagSchema = z.string().trim().min(1).optional().describe(
|
|
33
|
+
"Current draft ETag from canonry_measurement_draft_get. The API requires it for draft edits, publish, and discard; omit it only to receive the API\u2019s actionable 428 response."
|
|
34
|
+
);
|
|
35
|
+
function mutationOperationSchema(action, request) {
|
|
36
|
+
return z.object({
|
|
37
|
+
action: z.literal(action),
|
|
38
|
+
request,
|
|
39
|
+
etag: draftEtagSchema,
|
|
40
|
+
idempotencyKey: idempotencyKeySchema
|
|
41
|
+
}).strict().describe(`Operation for ${action}.`);
|
|
42
|
+
}
|
|
43
|
+
var measurementDraftOperationSchema = z.discriminatedUnion("action", [
|
|
44
|
+
z.object({
|
|
45
|
+
action: z.literal("create"),
|
|
46
|
+
request: measurementDraftCreateRequestSchema,
|
|
47
|
+
idempotencyKey: idempotencyKeySchema
|
|
48
|
+
}).strict().describe("Operation for create."),
|
|
49
|
+
mutationOperationSchema("import-sitemap", measurementDraftImportSitemapRequestSchema),
|
|
50
|
+
mutationOperationSchema("apply-sitemap-selection", measurementDraftApplySitemapSelectionRequestSchema),
|
|
51
|
+
mutationOperationSchema("upsert-target", measurementDraftUpsertTargetRequestSchema),
|
|
52
|
+
mutationOperationSchema("rename-target", measurementDraftRenameTargetRequestSchema),
|
|
53
|
+
mutationOperationSchema("merge-targets", measurementDraftMergeTargetsRequestSchema),
|
|
54
|
+
mutationOperationSchema("exclude-target", measurementDraftExcludeTargetRequestSchema),
|
|
55
|
+
mutationOperationSchema("rebind-target", measurementDraftRebindTargetRequestSchema),
|
|
56
|
+
mutationOperationSchema("apply-assignments", measurementDraftApplyAssignmentsRequestSchema),
|
|
57
|
+
z.object({
|
|
58
|
+
action: z.literal("preview-assignments"),
|
|
59
|
+
request: measurementDraftPreviewAssignmentsRequestSchema
|
|
60
|
+
}).strict().describe("Read-semantic assignment impact preview."),
|
|
61
|
+
mutationOperationSchema("replace-assignments", measurementDraftReplaceAssignmentsRequestSchema),
|
|
62
|
+
mutationOperationSchema("apply-paired-assignments", measurementDraftApplyPairedAssignmentsRequestSchema),
|
|
63
|
+
mutationOperationSchema("remove-assignment", measurementDraftRemoveAssignmentRequestSchema),
|
|
64
|
+
mutationOperationSchema("clear-assignments", measurementDraftClearAssignmentsRequestSchema),
|
|
65
|
+
mutationOperationSchema("classify-assignments", measurementDraftClassifyAssignmentsRequestSchema),
|
|
66
|
+
mutationOperationSchema("upsert-group", measurementDraftUpsertGroupRequestSchema),
|
|
67
|
+
mutationOperationSchema("upsert-market", measurementDraftUpsertMarketRequestSchema),
|
|
68
|
+
mutationOperationSchema("remove-group", measurementDraftRemoveGroupRequestSchema),
|
|
69
|
+
z.object({
|
|
70
|
+
action: z.literal("preview-group-membership"),
|
|
71
|
+
request: measurementDraftPreviewGroupMembershipRequestSchema
|
|
72
|
+
}).strict().describe("Read-semantic CSV group-membership preview."),
|
|
73
|
+
mutationOperationSchema("apply-group-membership", measurementDraftApplyGroupMembershipRequestSchema),
|
|
74
|
+
mutationOperationSchema("upsert-competitor", measurementDraftUpsertCompetitorRequestSchema),
|
|
75
|
+
mutationOperationSchema("remove-competitor", measurementDraftRemoveCompetitorRequestSchema),
|
|
76
|
+
z.object({ action: z.literal("compile-preview") }).strict().describe("Operation for compile-preview."),
|
|
77
|
+
z.object({ action: z.literal("diff-preview") }).strict().describe("Operation for diff-preview."),
|
|
78
|
+
mutationOperationSchema("publish", measurementDraftPublishRequestSchema),
|
|
79
|
+
z.object({
|
|
80
|
+
action: z.literal("discard"),
|
|
81
|
+
etag: draftEtagSchema,
|
|
82
|
+
idempotencyKey: idempotencyKeySchema
|
|
83
|
+
}).strict().describe("Operation for discard.")
|
|
84
|
+
]);
|
|
85
|
+
function runMeasurementDraftAction(client, project, actionInput) {
|
|
86
|
+
switch (actionInput.action) {
|
|
87
|
+
case "create":
|
|
88
|
+
return client.createMeasurementPlanDraft(project, actionInput.request, actionInput.idempotencyKey);
|
|
89
|
+
case "import-sitemap":
|
|
90
|
+
return client.importMeasurementDraftSitemap(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
91
|
+
case "apply-sitemap-selection":
|
|
92
|
+
return client.applyMeasurementDraftSitemapSelection(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
93
|
+
case "upsert-target":
|
|
94
|
+
return client.upsertMeasurementDraftTarget(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
95
|
+
case "rename-target":
|
|
96
|
+
return client.renameMeasurementDraftTarget(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
97
|
+
case "merge-targets":
|
|
98
|
+
return client.mergeMeasurementDraftTargets(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
99
|
+
case "exclude-target":
|
|
100
|
+
return client.excludeMeasurementDraftTarget(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
101
|
+
case "rebind-target":
|
|
102
|
+
return client.rebindMeasurementDraftTarget(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
103
|
+
case "apply-assignments":
|
|
104
|
+
return client.applyMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
105
|
+
case "preview-assignments":
|
|
106
|
+
return client.previewMeasurementDraftAssignments(project, actionInput.request);
|
|
107
|
+
case "replace-assignments":
|
|
108
|
+
return client.replaceMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
109
|
+
case "apply-paired-assignments":
|
|
110
|
+
return client.applyPairedMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
111
|
+
case "remove-assignment":
|
|
112
|
+
return client.removeMeasurementDraftAssignment(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
113
|
+
case "clear-assignments":
|
|
114
|
+
return client.clearMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
115
|
+
case "classify-assignments":
|
|
116
|
+
return client.classifyMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
117
|
+
case "upsert-group":
|
|
118
|
+
return client.upsertMeasurementDraftGroup(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
119
|
+
case "upsert-market":
|
|
120
|
+
return client.upsertMeasurementDraftMarket(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
121
|
+
case "remove-group":
|
|
122
|
+
return client.removeMeasurementDraftGroup(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
123
|
+
case "preview-group-membership":
|
|
124
|
+
return client.previewMeasurementDraftGroupMembership(project, actionInput.request);
|
|
125
|
+
case "apply-group-membership":
|
|
126
|
+
return client.applyMeasurementDraftGroupMembership(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
127
|
+
case "upsert-competitor":
|
|
128
|
+
return client.upsertMeasurementDraftCompetitor(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
129
|
+
case "remove-competitor":
|
|
130
|
+
return client.removeMeasurementDraftCompetitor(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
131
|
+
case "compile-preview":
|
|
132
|
+
return client.compileMeasurementDraftPreview(project);
|
|
133
|
+
case "diff-preview":
|
|
134
|
+
return client.diffMeasurementDraftPreview(project);
|
|
135
|
+
case "publish":
|
|
136
|
+
return client.publishMeasurementDraft(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
|
|
137
|
+
case "discard":
|
|
138
|
+
return client.discardMeasurementDraft(project, actionInput.idempotencyKey, actionInput.etag);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
measurementDraftOperationSchema,
|
|
144
|
+
runMeasurementDraftAction
|
|
145
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CliError,
|
|
3
|
+
EXIT_SYSTEM_ERROR
|
|
4
|
+
} from "./chunk-HGMYEDAQ.js";
|
|
5
|
+
import {
|
|
6
|
+
describeError
|
|
7
|
+
} from "./chunk-D6COIM3U.js";
|
|
8
|
+
|
|
9
|
+
// src/gsc-sitemap-submission.ts
|
|
10
|
+
function dedupeGscSitemapUrls(urls) {
|
|
11
|
+
return [...new Set(urls.map((url) => url.trim()).filter(Boolean))];
|
|
12
|
+
}
|
|
13
|
+
async function resolveDiscoveredGscSitemapUrls(client, project, mode) {
|
|
14
|
+
const topLevel = await client.gscSitemaps(project);
|
|
15
|
+
if (mode === "indexes") {
|
|
16
|
+
return dedupeGscSitemapUrls(
|
|
17
|
+
topLevel.preferredSubmissionUrls.length > 0 ? topLevel.preferredSubmissionUrls : topLevel.sitemaps.map((sitemap) => sitemap.path)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const indexes = topLevel.sitemaps.filter((sitemap) => sitemap.isSitemapsIndex).map((sitemap) => sitemap.path);
|
|
21
|
+
const expandedIndexUrls = [];
|
|
22
|
+
for (let offset = 0; offset < indexes.length; offset += 4) {
|
|
23
|
+
const children = await Promise.all(
|
|
24
|
+
indexes.slice(offset, offset + 4).map((sitemapIndex) => client.gscSitemaps(project, { sitemapIndex }))
|
|
25
|
+
);
|
|
26
|
+
children.forEach((result, index) => {
|
|
27
|
+
const sitemapIndex = indexes[offset + index];
|
|
28
|
+
expandedIndexUrls.push(...result.sitemaps.length > 0 ? result.sitemaps.map((sitemap) => sitemap.path) : [sitemapIndex]);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return dedupeGscSitemapUrls([
|
|
32
|
+
...topLevel.sitemaps.filter((sitemap) => !sitemap.isSitemapsIndex).map((sitemap) => sitemap.path),
|
|
33
|
+
...expandedIndexUrls
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
function requireGscSitemapUrls(project, sitemapUrls) {
|
|
37
|
+
if (sitemapUrls.length > 0) return;
|
|
38
|
+
throw new CliError({
|
|
39
|
+
code: "CLI_USAGE_ERROR",
|
|
40
|
+
message: "no GSC sitemaps found; provide a URL or use --configured",
|
|
41
|
+
displayMessage: "Error: no GSC sitemaps found; provide a URL or use --configured",
|
|
42
|
+
details: { command: "google.submit-sitemap", project }
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async function submitGscSitemapBatches(client, project, sitemapUrls, opts = {}) {
|
|
46
|
+
const batches = Array.from(
|
|
47
|
+
{ length: Math.ceil(sitemapUrls.length / 50) },
|
|
48
|
+
(_, index) => sitemapUrls.slice(index * 50, index * 50 + 50)
|
|
49
|
+
);
|
|
50
|
+
const aggregate = {
|
|
51
|
+
summary: { total: 0, accepted: 0, failed: 0 },
|
|
52
|
+
results: []
|
|
53
|
+
};
|
|
54
|
+
for (const [index, batchSitemapUrls] of batches.entries()) {
|
|
55
|
+
try {
|
|
56
|
+
const result = await client.gscSubmitSitemaps(project, { sitemapUrls: batchSitemapUrls });
|
|
57
|
+
aggregate.summary.total += result.summary.total;
|
|
58
|
+
aggregate.summary.accepted += result.summary.accepted;
|
|
59
|
+
aggregate.summary.failed += result.summary.failed;
|
|
60
|
+
aggregate.results.push(...result.results);
|
|
61
|
+
opts.onProgress?.(index + 1, batches.length);
|
|
62
|
+
} catch (cause) {
|
|
63
|
+
if (index === 0) throw cause;
|
|
64
|
+
const attempted = aggregate.summary.total + batchSitemapUrls.length;
|
|
65
|
+
const remaining = sitemapUrls.length - attempted;
|
|
66
|
+
throw new CliError({
|
|
67
|
+
code: "GOOGLE_SITEMAP_SUBMISSION_PARTIAL",
|
|
68
|
+
message: `Sitemap submission stopped at batch ${index + 1}/${batches.length}; ${aggregate.summary.accepted} accepted, ${aggregate.summary.failed} failed, ${batchSitemapUrls.length} unconfirmed, ${remaining} not attempted.`,
|
|
69
|
+
displayMessage: `Sitemap submission stopped at batch ${index + 1}/${batches.length}; ${aggregate.summary.accepted} accepted, ${aggregate.summary.failed} failed, ${batchSitemapUrls.length} unconfirmed, ${remaining} not attempted. Earlier accepted submissions were not rolled back.`,
|
|
70
|
+
exitCode: cause instanceof CliError && cause.exitCode === 1 ? 1 : EXIT_SYSTEM_ERROR,
|
|
71
|
+
details: {
|
|
72
|
+
project,
|
|
73
|
+
accepted: aggregate.summary.accepted,
|
|
74
|
+
failed: aggregate.summary.failed,
|
|
75
|
+
completed: aggregate.summary.total,
|
|
76
|
+
attempted,
|
|
77
|
+
unconfirmed: batchSitemapUrls.length,
|
|
78
|
+
remaining,
|
|
79
|
+
unconfirmedBatch: { index: index + 1, total: batches.length, sitemapUrls: batchSitemapUrls },
|
|
80
|
+
partialResult: aggregate,
|
|
81
|
+
cause: cause instanceof CliError ? { code: cause.code, message: cause.message, details: cause.details } : { message: describeError(cause) }
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return aggregate;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
dedupeGscSitemapUrls,
|
|
91
|
+
resolveDiscoveredGscSitemapUrls,
|
|
92
|
+
requireGscSitemapUrls,
|
|
93
|
+
submitGscSitemapBatches
|
|
94
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registeredProviderNames
|
|
3
|
+
} from "./chunk-QWKPSFGL.js";
|
|
4
|
+
import {
|
|
5
|
+
configExists,
|
|
6
|
+
loadConfigRaw
|
|
7
|
+
} from "./chunk-UQ3MOZGC.js";
|
|
8
|
+
|
|
9
|
+
// src/setup-state.ts
|
|
10
|
+
import fs from "fs";
|
|
11
|
+
async function buildSetupState() {
|
|
12
|
+
if (!configExists()) return void 0;
|
|
13
|
+
let provider_count = 0;
|
|
14
|
+
let has_keywords = false;
|
|
15
|
+
let project_count = 0;
|
|
16
|
+
let is_first_run = true;
|
|
17
|
+
let dbPath;
|
|
18
|
+
try {
|
|
19
|
+
const raw = loadConfigRaw();
|
|
20
|
+
if (raw) {
|
|
21
|
+
is_first_run = !raw.anonymousId;
|
|
22
|
+
provider_count = registeredProviderNames(raw).length;
|
|
23
|
+
if (typeof raw.database === "string" && raw.database.length > 0) {
|
|
24
|
+
dbPath = raw.database;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
if (dbPath && fs.existsSync(dbPath)) {
|
|
30
|
+
try {
|
|
31
|
+
const { createClient, projects, queries: queriesTable } = await import("./src-F6HM73TN.js");
|
|
32
|
+
const db = createClient(dbPath);
|
|
33
|
+
project_count = db.select({ id: projects.id }).from(projects).all().length;
|
|
34
|
+
const firstQuery = db.select({ id: queriesTable.id }).from(queriesTable).limit(1).all();
|
|
35
|
+
has_keywords = firstQuery.length > 0;
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return { provider_count, has_keywords, project_count, is_first_run };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/serve-handoff.ts
|
|
43
|
+
var pendingServeHandoff = false;
|
|
44
|
+
function queueServeHandoff() {
|
|
45
|
+
pendingServeHandoff = true;
|
|
46
|
+
}
|
|
47
|
+
async function runPendingServeHandoff(format) {
|
|
48
|
+
if (!pendingServeHandoff) return;
|
|
49
|
+
pendingServeHandoff = false;
|
|
50
|
+
const { serveCommand } = await import("./serve-73SMMASI.js");
|
|
51
|
+
await serveCommand(format);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
buildSetupState,
|
|
56
|
+
queueServeHandoff,
|
|
57
|
+
runPendingServeHandoff
|
|
58
|
+
};
|