mcp-scraper 0.73.0 → 0.73.2
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 +17 -1
- package/README.md +1 -1
- package/dist/{analytics-repository-MSLJBHLU.js → analytics-repository-7XYPQ2YJ.js} +1 -1
- package/dist/bin/api-server.js +2 -2
- package/dist/bin/mcp-scraper-cli.js +1 -1
- package/dist/bin/mcp-scraper-install.js +1 -1
- package/dist/bin/mcp-stdio-server.js +2 -2
- package/dist/{chunk-5EWXRBEH.js → chunk-M6XDENOO.js} +151 -23
- package/dist/{chunk-KRIIVDV2.js → chunk-ODPUNZDK.js} +1 -1
- package/dist/{chunk-JIWGG7Z4.js → chunk-Q7OPT73D.js} +1 -1
- package/dist/{server-N6MCRSQW.js → server-4DZD6ACE.js} +31 -23
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ All notable changes to MCP Scraper are documented here. The format is based on [
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.73.2] - 2026-08-28
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Normalized every PostgreSQL-backed Journey timestamp to RFC 3339 at the report boundary, so confirmed totals, enhanced journeys, session chronology, and candidate-review dates satisfy the generated Web contract instead of surfacing a false unavailable state.
|
|
12
|
+
|
|
13
|
+
## [0.73.1] - 2026-08-28
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Applied additive, idempotent X-Ray schema changes as individually committed statements so production reads cannot deadlock against a release-long DDL transaction and an interrupted migration can resume safely.
|
|
18
|
+
- Reused the earliest confirmed person when a verified email, phone, account ID, or order identity already belongs to the Site graph, preventing a normalized account ID from splitting a legacy email-keyed journey.
|
|
19
|
+
|
|
7
20
|
## [0.73.0] - 2026-08-27
|
|
8
21
|
|
|
9
22
|
### Added
|
|
@@ -27,6 +40,7 @@ All notable changes to MCP Scraper are documented here. The format is based on [
|
|
|
27
40
|
- Prevented cross-Site identity, privacy, and Journey references; removed subject-specific export/provider payload remnants on withdrawal or deletion; and normalized unknown/deleted references to zero-discovery responses.
|
|
28
41
|
- Normalized PostgreSQL timestamp projections and reconciled consent-withdrawal responses with the strict public REST contract.
|
|
29
42
|
- Made consented login and first-party form resolution self-initialize an approved Site-scoped primary identity graph, so older Sites persist stable person references and masked profiles without manual namespace setup.
|
|
43
|
+
- Retried the authenticated browser identity handoff during the bounded Pixel/consent bootstrap window, preventing a consent-readiness race from leaving a signed-in visitor anonymous for the rest of the page.
|
|
30
44
|
|
|
31
45
|
## [0.72.7] - 2026-08-27
|
|
32
46
|
|
|
@@ -1308,7 +1322,9 @@ All notable changes to MCP Scraper are documented here. The format is based on [
|
|
|
1308
1322
|
- Write actions remain unavailable until the account owner explicitly enables them.
|
|
1309
1323
|
- Provider-specific connection data is normalized into one agent-facing contract.
|
|
1310
1324
|
|
|
1311
|
-
[Unreleased]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.73.
|
|
1325
|
+
[Unreleased]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.73.2...HEAD
|
|
1326
|
+
[0.73.2]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.73.1...v0.73.2
|
|
1327
|
+
[0.73.1]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.73.0...v0.73.1
|
|
1312
1328
|
[0.73.0]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.72.7...v0.73.0
|
|
1313
1329
|
[0.72.7]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.72.6...v0.72.7
|
|
1314
1330
|
[0.72.6]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.72.5...v0.72.6
|
package/README.md
CHANGED
|
@@ -173,7 +173,7 @@ Build the branded one-click bundle:
|
|
|
173
173
|
npm run build:mcpb
|
|
174
174
|
```
|
|
175
175
|
|
|
176
|
-
The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.73.
|
|
176
|
+
The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.73.2`, SHA-256 `427b5b11320d575eee064d4b9bc2b1995155439bb9ce669eae066a249807e70a`). Install it by opening or dragging it into Claude Desktop. Claude displays the `MCP Scraper` install card, icon, API-key configuration field, and manually curated current-release message from the bundle manifest.
|
|
177
177
|
|
|
178
178
|
The MCPB install exposes every tool — web-intelligence plus all `browser_*` tools — through the one `mcp-scraper` server.
|
|
179
179
|
|
package/dist/bin/api-server.js
CHANGED
|
@@ -17,7 +17,7 @@ loadDotEnv();
|
|
|
17
17
|
async function main() {
|
|
18
18
|
const [{ serve }, { app }, { startWorker }, { migrate }] = await Promise.all([
|
|
19
19
|
import("@hono/node-server"),
|
|
20
|
-
import("../server-
|
|
20
|
+
import("../server-4DZD6ACE.js"),
|
|
21
21
|
import("../worker-CBK5DWEE.js"),
|
|
22
22
|
import("../db-566MOHHD.js")
|
|
23
23
|
]);
|
|
@@ -25,7 +25,7 @@ async function main() {
|
|
|
25
25
|
try {
|
|
26
26
|
await migrate();
|
|
27
27
|
if (process.env.ANALYTICS_DATABASE_URL) {
|
|
28
|
-
const { migrateAnalytics } = await import("../analytics-repository-
|
|
28
|
+
const { migrateAnalytics } = await import("../analytics-repository-7XYPQ2YJ.js");
|
|
29
29
|
await migrateAnalytics();
|
|
30
30
|
}
|
|
31
31
|
startWorker();
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "../chunk-Q2J23DHY.js";
|
|
5
5
|
import {
|
|
6
6
|
PACKAGE_VERSION
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-Q7OPT73D.js";
|
|
8
8
|
|
|
9
9
|
// bin/mcp-scraper-install.ts
|
|
10
10
|
var noColor = process.argv.includes("--no-color") || process.env.NO_COLOR !== void 0 || process.env.FORCE_COLOR === "0" || !process.stdout.isTTY;
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
registerScheduledResultsMcpTools,
|
|
14
14
|
registerSerpIntelligenceCaptureTools,
|
|
15
15
|
resolveDeploymentProfile
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-ODPUNZDK.js";
|
|
17
17
|
import "../chunk-PGJQDMC2.js";
|
|
18
18
|
import "../chunk-T3MZISOF.js";
|
|
19
19
|
import "../chunk-7RQULQF3.js";
|
|
@@ -26,7 +26,7 @@ import "../chunk-VXLU74YZ.js";
|
|
|
26
26
|
import "../chunk-GGZEC22A.js";
|
|
27
27
|
import {
|
|
28
28
|
PACKAGE_VERSION
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-Q7OPT73D.js";
|
|
30
30
|
import "../chunk-DNM65UCK.js";
|
|
31
31
|
import "../chunk-EQJRPDUS.js";
|
|
32
32
|
import "../chunk-WEFPBAAG.js";
|
|
@@ -860,7 +860,6 @@ async function closeAnalyticsPool() {
|
|
|
860
860
|
async function migrateAnalytics() {
|
|
861
861
|
const db = getAnalyticsPool();
|
|
862
862
|
const client = await db.connect();
|
|
863
|
-
await client.query("BEGIN");
|
|
864
863
|
try {
|
|
865
864
|
await client.query(`
|
|
866
865
|
CREATE TABLE IF NOT EXISTS analytics_schema_migrations (
|
|
@@ -2607,9 +2606,7 @@ async function migrateAnalytics() {
|
|
|
2607
2606
|
VALUES ('2026-08-05.1'), ('2026-08-05.2'), ('2026-08-05.3'), ('2026-08-05.4'), ('2026-08-05.5'), ('2026-08-05.6'), ('2026-08-05.7'), ('2026-08-05.8'), ('2026-08-05.9'), ('2026-08-05.10'), ('2026-08-05.11'), ('2026-08-05.12'), ('2026-08-05.13'), ('2026-08-05.14'), ('2026-08-26.1'), ('2026-08-26.2'), ('2026-08-26.3'), ('2026-08-26.4'), ('2026-08-27.1')
|
|
2608
2607
|
ON CONFLICT (version) DO NOTHING
|
|
2609
2608
|
`);
|
|
2610
|
-
await client.query("COMMIT");
|
|
2611
2609
|
} catch (error) {
|
|
2612
|
-
await client.query("ROLLBACK");
|
|
2613
2610
|
throw error;
|
|
2614
2611
|
} finally {
|
|
2615
2612
|
client.release();
|
|
@@ -4903,6 +4900,140 @@ async function backfillAnalyticsConfirmedHistory(client, input) {
|
|
|
4903
4900
|
conversions: conversions.rowCount ?? 0
|
|
4904
4901
|
};
|
|
4905
4902
|
}
|
|
4903
|
+
async function resolveAndMergeConfirmedAnalyticsPerson(client, input) {
|
|
4904
|
+
const matches = await client.query(
|
|
4905
|
+
`SELECT p.id
|
|
4906
|
+
FROM analytics_people p
|
|
4907
|
+
JOIN (
|
|
4908
|
+
SELECT DISTINCT e.person_id
|
|
4909
|
+
FROM analytics_identity_nodes n
|
|
4910
|
+
JOIN analytics_identity_edges e ON e.identity_node_id=n.id AND e.site_id=n.site_id
|
|
4911
|
+
WHERE n.site_id=$1 AND EXISTS (
|
|
4912
|
+
SELECT 1 FROM jsonb_to_recordset($2::jsonb) signal(kind text,value_hmac text)
|
|
4913
|
+
WHERE signal.kind=n.kind AND signal.value_hmac=n.value_hmac
|
|
4914
|
+
)
|
|
4915
|
+
) matched ON matched.person_id=p.id
|
|
4916
|
+
WHERE p.site_id=$1 AND (p.namespace_id=$3 OR p.namespace_id IS NULL)
|
|
4917
|
+
ORDER BY p.first_seen_at ASC,p.id ASC
|
|
4918
|
+
FOR UPDATE OF p`,
|
|
4919
|
+
[
|
|
4920
|
+
input.siteId,
|
|
4921
|
+
JSON.stringify(input.signals.map((signal) => ({ kind: signal.kind, value_hmac: signal.valueHmac }))),
|
|
4922
|
+
input.namespaceId
|
|
4923
|
+
]
|
|
4924
|
+
);
|
|
4925
|
+
const canonicalId = matches.rows[0]?.id;
|
|
4926
|
+
if (!canonicalId) {
|
|
4927
|
+
const inserted = await client.query(
|
|
4928
|
+
`INSERT INTO analytics_people(id, site_id, namespace_id, crm_person_ref, public_ref) VALUES ($1,$2,$3,$4,$5)
|
|
4929
|
+
ON CONFLICT(site_id, crm_person_ref) DO UPDATE SET last_seen_at = now(),
|
|
4930
|
+
namespace_id=COALESCE(analytics_people.namespace_id,EXCLUDED.namespace_id),
|
|
4931
|
+
public_ref=COALESCE(analytics_people.public_ref,EXCLUDED.public_ref) RETURNING id`,
|
|
4932
|
+
[randomUUID2(), input.siteId, input.namespaceId, input.crmPersonRef, newAnalyticsPersonPublicRef()]
|
|
4933
|
+
);
|
|
4934
|
+
return inserted.rows[0].id;
|
|
4935
|
+
}
|
|
4936
|
+
await client.query(
|
|
4937
|
+
`UPDATE analytics_people SET last_seen_at=now(),
|
|
4938
|
+
namespace_id=COALESCE(namespace_id,$2),public_ref=COALESCE(public_ref,$3)
|
|
4939
|
+
WHERE id=$1 AND site_id=$4`,
|
|
4940
|
+
[canonicalId, input.namespaceId, newAnalyticsPersonPublicRef(), input.siteId]
|
|
4941
|
+
);
|
|
4942
|
+
const duplicateIds = matches.rows.slice(1).map((row) => row.id);
|
|
4943
|
+
if (duplicateIds.length === 0) return canonicalId;
|
|
4944
|
+
await client.query(
|
|
4945
|
+
`DELETE FROM analytics_identity_edges duplicate
|
|
4946
|
+
USING analytics_identity_edges canonical
|
|
4947
|
+
WHERE duplicate.site_id=$1 AND duplicate.person_id=ANY($2::uuid[])
|
|
4948
|
+
AND canonical.site_id=duplicate.site_id AND canonical.person_id=$3
|
|
4949
|
+
AND canonical.identity_node_id=duplicate.identity_node_id
|
|
4950
|
+
AND canonical.evidence_kind=duplicate.evidence_kind`,
|
|
4951
|
+
[input.siteId, duplicateIds, canonicalId]
|
|
4952
|
+
);
|
|
4953
|
+
await client.query(
|
|
4954
|
+
`UPDATE analytics_identity_edges SET person_id=$3,namespace_id=$4
|
|
4955
|
+
WHERE site_id=$1 AND person_id=ANY($2::uuid[])`,
|
|
4956
|
+
[input.siteId, duplicateIds, canonicalId, input.namespaceId]
|
|
4957
|
+
);
|
|
4958
|
+
for (const table of [
|
|
4959
|
+
"analytics_form_submissions",
|
|
4960
|
+
"analytics_events",
|
|
4961
|
+
"analytics_conversions",
|
|
4962
|
+
"analytics_sessions",
|
|
4963
|
+
"analytics_attribution_touches",
|
|
4964
|
+
"analytics_external_events",
|
|
4965
|
+
"analytics_restricted_data",
|
|
4966
|
+
"analytics_crm_outbound_jobs"
|
|
4967
|
+
]) {
|
|
4968
|
+
await client.query(
|
|
4969
|
+
`UPDATE ${table} SET person_id=$3 WHERE site_id=$1 AND person_id=ANY($2::uuid[])`,
|
|
4970
|
+
[input.siteId, duplicateIds, canonicalId]
|
|
4971
|
+
);
|
|
4972
|
+
}
|
|
4973
|
+
await client.query(
|
|
4974
|
+
"UPDATE analytics_activation_jobs SET person_id=$2 WHERE person_id=ANY($1::uuid[])",
|
|
4975
|
+
[duplicateIds, canonicalId]
|
|
4976
|
+
);
|
|
4977
|
+
await client.query(
|
|
4978
|
+
`UPDATE analytics_candidate_associations SET promoted_person_id=$3,namespace_id=$4
|
|
4979
|
+
WHERE site_id=$1 AND promoted_person_id=ANY($2::uuid[])`,
|
|
4980
|
+
[input.siteId, duplicateIds, canonicalId, input.namespaceId]
|
|
4981
|
+
);
|
|
4982
|
+
await client.query(
|
|
4983
|
+
`DELETE FROM analytics_candidate_promotions duplicate
|
|
4984
|
+
USING analytics_candidate_promotions canonical
|
|
4985
|
+
WHERE duplicate.site_id=$1 AND duplicate.person_id=ANY($2::uuid[])
|
|
4986
|
+
AND canonical.site_id=duplicate.site_id AND canonical.person_id=$3
|
|
4987
|
+
AND canonical.association_id=duplicate.association_id`,
|
|
4988
|
+
[input.siteId, duplicateIds, canonicalId]
|
|
4989
|
+
);
|
|
4990
|
+
await client.query(
|
|
4991
|
+
`UPDATE analytics_candidate_promotions SET person_id=$3,namespace_id=$4
|
|
4992
|
+
WHERE site_id=$1 AND person_id=ANY($2::uuid[])`,
|
|
4993
|
+
[input.siteId, duplicateIds, canonicalId, input.namespaceId]
|
|
4994
|
+
);
|
|
4995
|
+
await client.query(
|
|
4996
|
+
`DELETE FROM analytics_crm_person_mappings duplicate
|
|
4997
|
+
USING analytics_crm_person_mappings canonical
|
|
4998
|
+
WHERE duplicate.site_id=$1 AND duplicate.person_id=ANY($2::uuid[])
|
|
4999
|
+
AND canonical.site_id=duplicate.site_id AND canonical.person_id=$3
|
|
5000
|
+
AND canonical.connection_id=duplicate.connection_id`,
|
|
5001
|
+
[input.siteId, duplicateIds, canonicalId]
|
|
5002
|
+
);
|
|
5003
|
+
await client.query(
|
|
5004
|
+
`UPDATE analytics_crm_person_mappings SET person_id=$3,namespace_id=$4
|
|
5005
|
+
WHERE site_id=$1 AND person_id=ANY($2::uuid[])`,
|
|
5006
|
+
[input.siteId, duplicateIds, canonicalId, input.namespaceId]
|
|
5007
|
+
);
|
|
5008
|
+
await client.query(
|
|
5009
|
+
`DELETE FROM analytics_prediction_results duplicate
|
|
5010
|
+
USING analytics_prediction_results canonical
|
|
5011
|
+
WHERE duplicate.site_id=$1 AND duplicate.person_id=ANY($2::uuid[])
|
|
5012
|
+
AND canonical.site_id=duplicate.site_id AND canonical.person_id=$3
|
|
5013
|
+
AND canonical.manifest_id=duplicate.manifest_id`,
|
|
5014
|
+
[input.siteId, duplicateIds, canonicalId]
|
|
5015
|
+
);
|
|
5016
|
+
for (const table of ["analytics_score_evaluations", "analytics_prediction_results"]) {
|
|
5017
|
+
await client.query(
|
|
5018
|
+
`UPDATE ${table} SET person_id=$3,namespace_id=$4
|
|
5019
|
+
WHERE site_id=$1 AND person_id=ANY($2::uuid[])`,
|
|
5020
|
+
[input.siteId, duplicateIds, canonicalId, input.namespaceId]
|
|
5021
|
+
);
|
|
5022
|
+
}
|
|
5023
|
+
await client.query(
|
|
5024
|
+
"UPDATE analytics_identity_profile_access_audits SET person_id=$3 WHERE site_id=$1 AND person_id=ANY($2::uuid[])",
|
|
5025
|
+
[input.siteId, duplicateIds, canonicalId]
|
|
5026
|
+
);
|
|
5027
|
+
await client.query(
|
|
5028
|
+
"UPDATE analytics_identity_tombstones SET person_id=$3 WHERE site_id=$1 AND person_id=ANY($2::uuid[])",
|
|
5029
|
+
[input.siteId, duplicateIds, canonicalId]
|
|
5030
|
+
);
|
|
5031
|
+
await client.query(
|
|
5032
|
+
"DELETE FROM analytics_people WHERE site_id=$1 AND id=ANY($2::uuid[])",
|
|
5033
|
+
[input.siteId, duplicateIds]
|
|
5034
|
+
);
|
|
5035
|
+
return canonicalId;
|
|
5036
|
+
}
|
|
4906
5037
|
async function linkAnalyticsIdentityInTransaction(client, input) {
|
|
4907
5038
|
const stable = input.customerId || input.orderId || input.email || input.phone;
|
|
4908
5039
|
if (!stable) return null;
|
|
@@ -4924,14 +5055,12 @@ async function linkAnalyticsIdentityInTransaction(client, input) {
|
|
|
4924
5055
|
signals: tombstoneSignals
|
|
4925
5056
|
});
|
|
4926
5057
|
const crmPersonRef = `XRay::${identityHmac("person_ref", stable).slice(0, 24)}`;
|
|
4927
|
-
const
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
);
|
|
4934
|
-
const personId = person.rows[0].id;
|
|
5058
|
+
const personId = await resolveAndMergeConfirmedAnalyticsPerson(client, {
|
|
5059
|
+
siteId: input.siteId,
|
|
5060
|
+
namespaceId,
|
|
5061
|
+
crmPersonRef,
|
|
5062
|
+
signals: tombstoneSignals
|
|
5063
|
+
});
|
|
4935
5064
|
const signals = [];
|
|
4936
5065
|
if (input.visitorId)
|
|
4937
5066
|
signals.push({ kind: "visitor_id", value: input.visitorId, evidence: "pixel_identify", confidence: 0.98 });
|
|
@@ -4995,21 +5124,20 @@ async function linkAnalyticsFormIdentity(input) {
|
|
|
4995
5124
|
return { personId: null, linkedSignals: 0 };
|
|
4996
5125
|
}
|
|
4997
5126
|
const namespaceId = await ensurePrimaryAnalyticsIdentityNamespace(client, input.siteId, "form");
|
|
5127
|
+
const deterministicSignals = [
|
|
5128
|
+
...input.email ? [{ kind: "email", valueHmac: identityHmac("email", input.email) }] : [],
|
|
5129
|
+
...input.phone ? [{ kind: "phone", valueHmac: identityHmac("phone", input.phone) }] : []
|
|
5130
|
+
];
|
|
4998
5131
|
await assertAnalyticsIdentitySignalsNotTombstoned(client, {
|
|
4999
5132
|
siteId: input.siteId,
|
|
5000
|
-
signals:
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5133
|
+
signals: deterministicSignals
|
|
5134
|
+
});
|
|
5135
|
+
const personId = await resolveAndMergeConfirmedAnalyticsPerson(client, {
|
|
5136
|
+
siteId: input.siteId,
|
|
5137
|
+
namespaceId,
|
|
5138
|
+
crmPersonRef: input.crmPersonRef,
|
|
5139
|
+
signals: deterministicSignals
|
|
5004
5140
|
});
|
|
5005
|
-
const person = await client.query(
|
|
5006
|
-
`INSERT INTO analytics_people(id, site_id, namespace_id, crm_person_ref, public_ref) VALUES ($1,$2,$3,$4,$5)
|
|
5007
|
-
ON CONFLICT(site_id, crm_person_ref) DO UPDATE SET last_seen_at = now(),
|
|
5008
|
-
namespace_id=COALESCE(analytics_people.namespace_id,EXCLUDED.namespace_id),
|
|
5009
|
-
public_ref=COALESCE(analytics_people.public_ref,EXCLUDED.public_ref) RETURNING id`,
|
|
5010
|
-
[randomUUID2(), input.siteId, namespaceId, input.crmPersonRef, newAnalyticsPersonPublicRef()]
|
|
5011
|
-
);
|
|
5012
|
-
const personId = person.rows[0].id;
|
|
5013
5141
|
const signals = [];
|
|
5014
5142
|
if (input.visitorId)
|
|
5015
5143
|
signals.push({
|
|
@@ -153,7 +153,7 @@ import {
|
|
|
153
153
|
upsertAnalyticsAdSpend,
|
|
154
154
|
upsertAnalyticsHostGroup,
|
|
155
155
|
verifyAnalyticsWebhookSignature
|
|
156
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-M6XDENOO.js";
|
|
157
157
|
import {
|
|
158
158
|
claimServiceConnectionAction,
|
|
159
159
|
ensureServiceConnectionsSchema,
|
|
@@ -280,7 +280,7 @@ import {
|
|
|
280
280
|
resolveDeploymentProfile,
|
|
281
281
|
resolveLocalSourcebookSchemaType,
|
|
282
282
|
transcribeMediaUrl
|
|
283
|
-
} from "./chunk-
|
|
283
|
+
} from "./chunk-ODPUNZDK.js";
|
|
284
284
|
import {
|
|
285
285
|
auditImageUrls,
|
|
286
286
|
auditImages,
|
|
@@ -345,7 +345,7 @@ import {
|
|
|
345
345
|
} from "./chunk-GGZEC22A.js";
|
|
346
346
|
import {
|
|
347
347
|
PACKAGE_VERSION
|
|
348
|
-
} from "./chunk-
|
|
348
|
+
} from "./chunk-Q7OPT73D.js";
|
|
349
349
|
import {
|
|
350
350
|
SITE_EXTRACT_ARTIFACT_PREFIX,
|
|
351
351
|
abandonExtractSettlement,
|
|
@@ -34541,6 +34541,14 @@ function nullableNumber(value) {
|
|
|
34541
34541
|
const number = Number(value);
|
|
34542
34542
|
return Number.isFinite(number) ? number : null;
|
|
34543
34543
|
}
|
|
34544
|
+
function isoTimestamp(value) {
|
|
34545
|
+
const timestamp3 = value instanceof Date ? value : new Date(value);
|
|
34546
|
+
if (!Number.isFinite(timestamp3.getTime())) throw new Error("analytics_timestamp_invalid");
|
|
34547
|
+
return timestamp3.toISOString();
|
|
34548
|
+
}
|
|
34549
|
+
function nullableIsoTimestamp(value) {
|
|
34550
|
+
return value === null ? null : isoTimestamp(value);
|
|
34551
|
+
}
|
|
34544
34552
|
function page(siteId, rows, limit, map) {
|
|
34545
34553
|
const hasNextPage = rows.length > limit;
|
|
34546
34554
|
const visible = rows.slice(0, limit);
|
|
@@ -34607,16 +34615,16 @@ async function analyticsSessions(input, db = getAnalyticsPool()) {
|
|
|
34607
34615
|
input.eventName?.slice(0, 160) ?? null,
|
|
34608
34616
|
limit + 1
|
|
34609
34617
|
]);
|
|
34610
|
-
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: row.started_at, _cursorId: row.internal_id }));
|
|
34618
|
+
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: isoTimestamp(row.started_at), _cursorId: row.internal_id }));
|
|
34611
34619
|
return page(input.siteId, rows, limit, (row) => ({
|
|
34612
34620
|
sessionRef: createAnalyticsReportReference("session", input.siteId, row.internal_id),
|
|
34613
34621
|
visitorRef: createAnalyticsReportReference("visitor", input.siteId, `visitor:${row.visitor_hmac}`),
|
|
34614
34622
|
personRef: row.person_id ? createAnalyticsReportReference("person", input.siteId, row.person_id) : null,
|
|
34615
34623
|
returning: row.session_number > 1,
|
|
34616
34624
|
sessionNumber: row.session_number,
|
|
34617
|
-
startedAt: row.started_at,
|
|
34618
|
-
lastActiveAt: row.last_active_at,
|
|
34619
|
-
endedAt: row.ended_at,
|
|
34625
|
+
startedAt: isoTimestamp(row.started_at),
|
|
34626
|
+
lastActiveAt: isoTimestamp(row.last_active_at),
|
|
34627
|
+
endedAt: nullableIsoTimestamp(row.ended_at),
|
|
34620
34628
|
durationMs: nullableNumber(row.duration_ms),
|
|
34621
34629
|
landingPath: row.landing_path,
|
|
34622
34630
|
exitPath: row.exit_path,
|
|
@@ -34663,7 +34671,7 @@ async function analyticsVisitors(input, db = getAnalyticsPool()) {
|
|
|
34663
34671
|
input.converted ?? null,
|
|
34664
34672
|
limit + 1
|
|
34665
34673
|
]);
|
|
34666
|
-
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: row.last_seen_at, _cursorId: row.last_session_id }));
|
|
34674
|
+
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: isoTimestamp(row.last_seen_at), _cursorId: row.last_session_id }));
|
|
34667
34675
|
return page(input.siteId, rows, limit, (row) => ({
|
|
34668
34676
|
visitorRef: createAnalyticsReportReference(
|
|
34669
34677
|
"visitor",
|
|
@@ -34674,8 +34682,8 @@ async function analyticsVisitors(input, db = getAnalyticsPool()) {
|
|
|
34674
34682
|
known: Boolean(row.person_id),
|
|
34675
34683
|
returning: row.session_count > 1,
|
|
34676
34684
|
sessions: row.session_count,
|
|
34677
|
-
firstSeenAt: row.first_seen_at,
|
|
34678
|
-
lastSeenAt: row.last_seen_at,
|
|
34685
|
+
firstSeenAt: isoTimestamp(row.first_seen_at),
|
|
34686
|
+
lastSeenAt: isoTimestamp(row.last_seen_at),
|
|
34679
34687
|
durationMs: nullableNumber(row.duration_ms),
|
|
34680
34688
|
pages: row.pageview_count,
|
|
34681
34689
|
events: row.event_count,
|
|
@@ -34917,9 +34925,9 @@ async function analyticsSessionTimeline(input, db = getAnalyticsPool()) {
|
|
|
34917
34925
|
LEFT JOIN first_touch f ON f.session_id=s.session_hmac LEFT JOIN conversion_stats c ON c.session_id=s.session_hmac
|
|
34918
34926
|
ORDER BY s.started_at DESC,s.id DESC LIMIT 50`, [...subjectValues])
|
|
34919
34927
|
]);
|
|
34920
|
-
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: row.occurred_at, _cursorId: row.stable_id }));
|
|
34928
|
+
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: isoTimestamp(row.occurred_at), _cursorId: row.stable_id }));
|
|
34921
34929
|
const timeline = page(input.siteId, rows, limit, (row) => ({
|
|
34922
|
-
occurredAt: row.occurred_at,
|
|
34930
|
+
occurredAt: isoTimestamp(row.occurred_at),
|
|
34923
34931
|
type: row.entry_type,
|
|
34924
34932
|
name: row.name,
|
|
34925
34933
|
path: row.path,
|
|
@@ -34982,8 +34990,8 @@ async function analyticsSessionTimeline(input, db = getAnalyticsPool()) {
|
|
|
34982
34990
|
})),
|
|
34983
34991
|
sessions: sessionsResult.rows.map((row) => ({
|
|
34984
34992
|
sessionRef: createAnalyticsReportReference("session", input.siteId, row.internal_id),
|
|
34985
|
-
startedAt: row.started_at,
|
|
34986
|
-
endedAt: row.ended_at,
|
|
34993
|
+
startedAt: isoTimestamp(row.started_at),
|
|
34994
|
+
endedAt: nullableIsoTimestamp(row.ended_at),
|
|
34987
34995
|
durationMs: nullableNumber(row.duration_ms),
|
|
34988
34996
|
pageviews: Number(row.pageviews),
|
|
34989
34997
|
events: Number(row.events),
|
|
@@ -35035,12 +35043,12 @@ async function analyticsConfirmedJourneys(input, db = getAnalyticsPool()) {
|
|
|
35035
35043
|
cursor?.id ?? null,
|
|
35036
35044
|
limit + 1
|
|
35037
35045
|
]);
|
|
35038
|
-
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: row.last_seen_at, _cursorId: row.person_id }));
|
|
35046
|
+
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: isoTimestamp(row.last_seen_at), _cursorId: row.person_id }));
|
|
35039
35047
|
const resultPage = page(input.siteId, rows, limit, (row) => ({
|
|
35040
35048
|
journeyTier: "confirmed",
|
|
35041
35049
|
personRef: createAnalyticsReportReference("person", input.siteId, row.person_id),
|
|
35042
|
-
firstSeenAt: row.first_seen_at,
|
|
35043
|
-
lastSeenAt: row.last_seen_at,
|
|
35050
|
+
firstSeenAt: isoTimestamp(row.first_seen_at),
|
|
35051
|
+
lastSeenAt: isoTimestamp(row.last_seen_at),
|
|
35044
35052
|
sessions: row.session_count,
|
|
35045
35053
|
events: row.event_count,
|
|
35046
35054
|
conversions: row.conversion_count,
|
|
@@ -35113,7 +35121,7 @@ async function analyticsBestGuessJourneys(input, db = getAnalyticsPool()) {
|
|
|
35113
35121
|
cursor?.id ?? null,
|
|
35114
35122
|
limit + 1
|
|
35115
35123
|
]);
|
|
35116
|
-
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: row.updated_at, _cursorId: row.association_id }));
|
|
35124
|
+
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: isoTimestamp(row.updated_at), _cursorId: row.association_id }));
|
|
35117
35125
|
const resultPage = page(input.siteId, rows, limit, (row) => ({
|
|
35118
35126
|
journeyTier: "candidate_assisted",
|
|
35119
35127
|
inferenceRef: createAnalyticsReportReference("candidate", input.siteId, row.association_id),
|
|
@@ -35134,7 +35142,7 @@ async function analyticsBestGuessJourneys(input, db = getAnalyticsPool()) {
|
|
|
35134
35142
|
modelVersion: row.model_version,
|
|
35135
35143
|
featureClasses: row.feature_kinds,
|
|
35136
35144
|
coverage: row.inferred_sessions > 0 ? "incremental_sessions_available" : "no_incremental_sessions",
|
|
35137
|
-
expiresAt: row.expires_at,
|
|
35145
|
+
expiresAt: isoTimestamp(row.expires_at),
|
|
35138
35146
|
provenance: "consented_high_confidence_candidate_association"
|
|
35139
35147
|
}));
|
|
35140
35148
|
return { journeyTier: "candidate_assisted", totalsAreSeparated: true, ...resultPage };
|
|
@@ -35162,15 +35170,15 @@ async function analyticsInferenceReview(input, db = getAnalyticsPool()) {
|
|
|
35162
35170
|
cursor?.id ?? null,
|
|
35163
35171
|
limit + 1
|
|
35164
35172
|
]);
|
|
35165
|
-
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: row.updated_at, _cursorId: row.association_id }));
|
|
35173
|
+
const rows = result2.rows.map((row) => ({ ...row, _cursorAt: isoTimestamp(row.updated_at), _cursorId: row.association_id }));
|
|
35166
35174
|
return page(input.siteId, rows, limit, (row) => ({
|
|
35167
35175
|
inferenceRef: createAnalyticsReportReference("candidate", input.siteId, row.association_id),
|
|
35168
35176
|
confidenceBand: row.confidence_band,
|
|
35169
35177
|
modelVersion: row.model_version,
|
|
35170
35178
|
featureClasses: row.feature_kinds,
|
|
35171
|
-
firstObservedAt: row.first_observed_at,
|
|
35172
|
-
lastObservedAt: row.last_observed_at,
|
|
35173
|
-
expiresAt: row.expires_at,
|
|
35179
|
+
firstObservedAt: isoTimestamp(row.first_observed_at),
|
|
35180
|
+
lastObservedAt: isoTimestamp(row.last_observed_at),
|
|
35181
|
+
expiresAt: isoTimestamp(row.expires_at),
|
|
35174
35182
|
action: "diagnostic_only",
|
|
35175
35183
|
eligibleForConfirmedMetrics: false,
|
|
35176
35184
|
eligibleForCrmOrActivation: false
|