@adcp/sdk 17.0.0-beta.24 → 17.0.0-beta.26
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/lib/adapters/version/schema-projection.d.mts +11 -0
- package/dist/lib/adapters/version/schema-projection.d.ts +11 -0
- package/dist/lib/adapters/version/schema-projection.js +52 -0
- package/dist/lib/adapters/version/schema-projection.mjs +51 -0
- package/dist/lib/discovery/property-crawler.d.mts +11 -0
- package/dist/lib/discovery/property-crawler.d.ts +11 -0
- package/dist/lib/discovery/property-crawler.js +15 -2
- package/dist/lib/discovery/property-crawler.mjs +15 -2
- package/dist/lib/discovery/resolve-agent-properties.d.mts +81 -8
- package/dist/lib/discovery/resolve-agent-properties.d.ts +81 -8
- package/dist/lib/discovery/resolve-agent-properties.js +94 -14
- package/dist/lib/discovery/resolve-agent-properties.mjs +91 -13
- package/dist/lib/discovery/validate-adagents.d.mts +7 -0
- package/dist/lib/discovery/validate-adagents.d.ts +7 -0
- package/dist/lib/entrypoints/discovery.d.mts +1 -1
- package/dist/lib/entrypoints/discovery.d.ts +1 -1
- package/dist/lib/entrypoints/discovery.js +4 -0
- package/dist/lib/entrypoints/discovery.mjs +5 -1
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +4 -0
- package/dist/lib/index.mjs +5 -1
- package/dist/lib/reporting/evidence.d.mts +8 -0
- package/dist/lib/reporting/evidence.d.ts +8 -0
- package/dist/lib/reporting/evidence.js +10 -2
- package/dist/lib/reporting/evidence.mjs +8 -1
- package/dist/lib/reporting/ledger/index.d.mts +1 -1
- package/dist/lib/reporting/ledger/index.d.ts +1 -1
- package/dist/lib/reporting/ledger/index.js +3 -1
- package/dist/lib/reporting/ledger/index.mjs +4 -2
- package/dist/lib/reporting/ledger/status-ingest.js +3 -2
- package/dist/lib/reporting/ledger/status-ingest.mjs +3 -2
- package/dist/lib/reporting/subscriptions/engine.js +1 -1
- package/dist/lib/reporting/subscriptions/engine.mjs +1 -1
- package/dist/lib/server/account-response-identity.d.mts +4 -3
- package/dist/lib/server/account-response-identity.d.ts +4 -3
- package/dist/lib/server/account-response-identity.js +8 -4
- package/dist/lib/server/account-response-identity.mjs +8 -4
- package/dist/lib/server/credential-policy.js +5 -0
- package/dist/lib/server/credential-policy.mjs +5 -0
- package/dist/lib/server/decisioning/account.js +14 -3
- package/dist/lib/server/decisioning/account.mjs +16 -4
- package/dist/lib/server/notification-subscriptions/runtime.d.mts +6 -0
- package/dist/lib/server/notification-subscriptions/runtime.d.ts +6 -0
- package/dist/lib/server/notification-subscriptions/runtime.js +99 -0
- package/dist/lib/server/notification-subscriptions/runtime.mjs +98 -0
- package/dist/lib/server/principal/reporting-subscriptions.js +4 -1
- package/dist/lib/server/principal/reporting-subscriptions.mjs +4 -1
- package/dist/lib/server/reporting-delivery-config.d.mts +2 -2
- package/dist/lib/server/reporting-delivery-config.d.ts +2 -2
- package/dist/lib/server/reporting-delivery-config.js +9 -3
- package/dist/lib/server/reporting-delivery-config.mjs +9 -3
- package/dist/lib/server/wire-safe.js +3 -0
- package/dist/lib/server/wire-safe.mjs +3 -0
- package/dist/lib/supply-path/validation.d.mts +8 -0
- package/dist/lib/supply-path/validation.d.ts +8 -0
- package/dist/lib/testing/compliance/comply.js +1 -1
- package/dist/lib/testing/compliance/comply.mjs +3 -2
- package/dist/lib/testing/storyboard/index.d.mts +1 -1
- package/dist/lib/testing/storyboard/index.d.ts +1 -1
- package/dist/lib/testing/storyboard/index.js +6 -0
- package/dist/lib/testing/storyboard/index.mjs +6 -0
- package/dist/lib/testing/storyboard/loader.js +52 -28
- package/dist/lib/testing/storyboard/loader.mjs +52 -28
- package/dist/lib/testing/storyboard/runner.d.mts +24 -1
- package/dist/lib/testing/storyboard/runner.d.ts +24 -1
- package/dist/lib/testing/storyboard/runner.js +75 -7
- package/dist/lib/testing/storyboard/runner.mjs +72 -7
- package/dist/lib/testing/storyboard/types.d.mts +51 -6
- package/dist/lib/testing/storyboard/types.d.ts +51 -6
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/types/wellknown-schemas.generated.d.mts +16 -16
- package/dist/lib/types/wellknown-schemas.generated.d.ts +16 -16
- package/dist/lib/utils/json-depth.d.mts +8 -0
- package/dist/lib/utils/json-depth.d.ts +8 -0
- package/dist/lib/utils/json-depth.js +18 -2
- package/dist/lib/utils/json-depth.mjs +16 -1
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/STORYBOARD-CAPABILITY-GATES.md +96 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +5 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-16-to-17.md +47 -8
- package/package.json +1 -1
|
@@ -18,13 +18,18 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var resolve_agent_properties_exports = {};
|
|
20
20
|
__export(resolve_agent_properties_exports, {
|
|
21
|
+
agentUrlMatchesAuthorizedEntry: () => agentUrlMatchesAuthorizedEntry,
|
|
21
22
|
canonicalizeAgentUrl: () => canonicalizeAgentUrl,
|
|
22
23
|
getAllProperties: () => getAllProperties,
|
|
23
24
|
listAgentPropertyMap: () => listAgentPropertyMap,
|
|
24
|
-
resolveAgentProperties: () => resolveAgentProperties
|
|
25
|
+
resolveAgentProperties: () => resolveAgentProperties,
|
|
26
|
+
usesOriginOnlyAgentMatching: () => usesOriginOnlyAgentMatching
|
|
25
27
|
});
|
|
26
28
|
module.exports = __toCommonJS(resolve_agent_properties_exports);
|
|
27
29
|
var import_inline_publisher_properties = require('./inline-publisher-properties.js');
|
|
30
|
+
var import_version = require('../version.js');
|
|
31
|
+
var import_adcp_version_config = require('../utils/adcp-version-config.js');
|
|
32
|
+
const ORIGIN_ONLY_AGENT_MATCHING_SINCE = "3.3.0-beta.0";
|
|
28
33
|
function canonicalizeAgentUrl(raw) {
|
|
29
34
|
const parsed = parseAgentUrl(raw);
|
|
30
35
|
if (!parsed) return null;
|
|
@@ -33,6 +38,38 @@ function canonicalizeAgentUrl(raw) {
|
|
|
33
38
|
const query = parsed.search ? decodeUnreservedPercentEncoding(parsed.search) : fragmentlessHref.endsWith("?") ? "?" : "";
|
|
34
39
|
return `${parsed.protocol}//${parsed.host}${path}${query}`;
|
|
35
40
|
}
|
|
41
|
+
function canonicalAgentUrlParts(raw) {
|
|
42
|
+
const url = canonicalizeAgentUrl(raw);
|
|
43
|
+
if (url === null) return null;
|
|
44
|
+
const parsed = new URL(url);
|
|
45
|
+
const origin = `${parsed.protocol}//${parsed.host}`;
|
|
46
|
+
return { url, originOnly: url === `${origin}/`, rootDotless: stripRootDot(parsed, url, origin) };
|
|
47
|
+
}
|
|
48
|
+
function stripRootDot(parsed, url, origin) {
|
|
49
|
+
const host = parsed.hostname;
|
|
50
|
+
if (host.startsWith("[") || !host.endsWith(".")) return { url, origin };
|
|
51
|
+
if (host.endsWith("..") || host === ".") return null;
|
|
52
|
+
const dotless = `${parsed.protocol}//${host.slice(0, -1)}${parsed.port ? `:${parsed.port}` : ""}`;
|
|
53
|
+
return { url: dotless + url.slice(origin.length), origin: dotless };
|
|
54
|
+
}
|
|
55
|
+
function usesOriginOnlyAgentMatching(adcpVersion = import_version.ADCP_VERSION) {
|
|
56
|
+
return (0, import_adcp_version_config.isAdcpVersionAtLeast)(adcpVersion, ORIGIN_ONLY_AGENT_MATCHING_SINCE);
|
|
57
|
+
}
|
|
58
|
+
function agentUrlMatchesAuthorizedEntry(entryUrl, agentUrl, options = {}) {
|
|
59
|
+
const entry = canonicalAgentUrlParts(entryUrl);
|
|
60
|
+
const agent = canonicalAgentUrlParts(agentUrl);
|
|
61
|
+
if (!entry || !agent) return false;
|
|
62
|
+
return matchCanonicalAgentUrl(entry, agent, usesOriginOnlyAgentMatching(options.adcpVersion)) !== "none";
|
|
63
|
+
}
|
|
64
|
+
function matchCanonicalAgentUrl(entry, agent, originOnlyMatching) {
|
|
65
|
+
if (!originOnlyMatching) return entry.url === agent.url ? "exact" : "none";
|
|
66
|
+
const e = entry.rootDotless;
|
|
67
|
+
const a = agent.rootDotless;
|
|
68
|
+
if (!e || !a) return "none";
|
|
69
|
+
if (e.url === a.url) return "exact";
|
|
70
|
+
if (entry.originOnly && e.origin === a.origin) return "origin";
|
|
71
|
+
return "none";
|
|
72
|
+
}
|
|
36
73
|
function parseAgentUrl(raw) {
|
|
37
74
|
if (typeof raw !== "string" || raw.length === 0) return null;
|
|
38
75
|
let parsed;
|
|
@@ -45,25 +82,66 @@ function parseAgentUrl(raw) {
|
|
|
45
82
|
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return null;
|
|
46
83
|
return parsed;
|
|
47
84
|
}
|
|
48
|
-
function resolveAgentProperties(adAgents, agentUrl) {
|
|
49
|
-
const wanted =
|
|
85
|
+
function resolveAgentProperties(adAgents, agentUrl, options = {}) {
|
|
86
|
+
const wanted = canonicalAgentUrlParts(agentUrl);
|
|
50
87
|
if (!wanted) {
|
|
51
88
|
return { properties: [], cross_publisher: [], cross_publisher_expanded: [], unresolvable: "agent_not_listed" };
|
|
52
89
|
}
|
|
90
|
+
const originOnlyMatching = usesOriginOnlyAgentMatching(options.adcpVersion);
|
|
53
91
|
const entries = Array.isArray(adAgents.authorized_agents) ? adAgents.authorized_agents : [];
|
|
54
|
-
const matches =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return { properties: [], cross_publisher: [], cross_publisher_expanded: [], unresolvable: "ambiguous_agent_url" };
|
|
92
|
+
const matches = [];
|
|
93
|
+
for (const e of entries) {
|
|
94
|
+
if (!e || typeof e.url !== "string") continue;
|
|
95
|
+
const canon = canonicalAgentUrlParts(e.url);
|
|
96
|
+
if (!canon) continue;
|
|
97
|
+
if (matchCanonicalAgentUrl(canon, wanted, originOnlyMatching) !== "none") matches.push(e);
|
|
61
98
|
}
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
99
|
+
const first = matches[0];
|
|
100
|
+
if (!first) {
|
|
64
101
|
return { properties: [], cross_publisher: [], cross_publisher_expanded: [], unresolvable: "agent_not_listed" };
|
|
65
102
|
}
|
|
66
|
-
|
|
103
|
+
if (!originOnlyMatching) {
|
|
104
|
+
if (matches.length > 1) {
|
|
105
|
+
return { properties: [], cross_publisher: [], cross_publisher_expanded: [], unresolvable: "ambiguous_agent_url" };
|
|
106
|
+
}
|
|
107
|
+
return resolveMatchedAgentProperties(adAgents, first);
|
|
108
|
+
}
|
|
109
|
+
if (matches.length === 1) {
|
|
110
|
+
return { ...resolveMatchedAgentProperties(adAgents, first), matched_entries: [first] };
|
|
111
|
+
}
|
|
112
|
+
return unionAgentScopes(
|
|
113
|
+
matches.map((entry) => resolveMatchedAgentProperties(adAgents, entry)),
|
|
114
|
+
matches
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
function unionAgentScopes(scopes, entries) {
|
|
118
|
+
const properties = uniqueByValue(scopes.flatMap((s) => s.properties));
|
|
119
|
+
const cross_publisher = uniqueByValue(scopes.flatMap((s) => s.cross_publisher));
|
|
120
|
+
const cross_publisher_expanded = uniqueByValue(scopes.flatMap((s) => s.cross_publisher_expanded));
|
|
121
|
+
const empty = properties.length === 0 && cross_publisher.length === 0;
|
|
122
|
+
const reason = scopes.find((s) => s.unresolvable !== void 0)?.unresolvable;
|
|
123
|
+
return {
|
|
124
|
+
properties,
|
|
125
|
+
cross_publisher,
|
|
126
|
+
cross_publisher_expanded,
|
|
127
|
+
matched_entry: entries[0],
|
|
128
|
+
matched_entries: entries,
|
|
129
|
+
...empty && reason !== void 0 ? { unresolvable: reason } : {}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function uniqueByValue(items) {
|
|
133
|
+
const seenRefs = /* @__PURE__ */ new Set();
|
|
134
|
+
const seenValues = /* @__PURE__ */ new Set();
|
|
135
|
+
const out = [];
|
|
136
|
+
for (const item of items) {
|
|
137
|
+
if (seenRefs.has(item)) continue;
|
|
138
|
+
seenRefs.add(item);
|
|
139
|
+
const value = JSON.stringify(item);
|
|
140
|
+
if (seenValues.has(value)) continue;
|
|
141
|
+
seenValues.add(value);
|
|
142
|
+
out.push(item);
|
|
143
|
+
}
|
|
144
|
+
return out;
|
|
67
145
|
}
|
|
68
146
|
function resolveMatchedAgentProperties(adAgents, entry) {
|
|
69
147
|
const allProperties = filterRevokedProperties(adAgents.properties, adAgents.revoked_publisher_domains);
|
|
@@ -275,8 +353,10 @@ function allowsLegacyBareInline(adAgents) {
|
|
|
275
353
|
}
|
|
276
354
|
// Annotate the CommonJS export names for ESM import in node:
|
|
277
355
|
0 && (module.exports = {
|
|
356
|
+
agentUrlMatchesAuthorizedEntry,
|
|
278
357
|
canonicalizeAgentUrl,
|
|
279
358
|
getAllProperties,
|
|
280
359
|
listAgentPropertyMap,
|
|
281
|
-
resolveAgentProperties
|
|
360
|
+
resolveAgentProperties,
|
|
361
|
+
usesOriginOnlyAgentMatching
|
|
282
362
|
});
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { resolveInlinePublisherProperties } from "./inline-publisher-properties.mjs";
|
|
2
|
+
import { ADCP_VERSION } from "../version.mjs";
|
|
3
|
+
import { isAdcpVersionAtLeast } from "../utils/adcp-version-config.mjs";
|
|
4
|
+
const ORIGIN_ONLY_AGENT_MATCHING_SINCE = "3.3.0-beta.0";
|
|
2
5
|
function canonicalizeAgentUrl(raw) {
|
|
3
6
|
const parsed = parseAgentUrl(raw);
|
|
4
7
|
if (!parsed) return null;
|
|
@@ -7,6 +10,38 @@ function canonicalizeAgentUrl(raw) {
|
|
|
7
10
|
const query = parsed.search ? decodeUnreservedPercentEncoding(parsed.search) : fragmentlessHref.endsWith("?") ? "?" : "";
|
|
8
11
|
return `${parsed.protocol}//${parsed.host}${path}${query}`;
|
|
9
12
|
}
|
|
13
|
+
function canonicalAgentUrlParts(raw) {
|
|
14
|
+
const url = canonicalizeAgentUrl(raw);
|
|
15
|
+
if (url === null) return null;
|
|
16
|
+
const parsed = new URL(url);
|
|
17
|
+
const origin = `${parsed.protocol}//${parsed.host}`;
|
|
18
|
+
return { url, originOnly: url === `${origin}/`, rootDotless: stripRootDot(parsed, url, origin) };
|
|
19
|
+
}
|
|
20
|
+
function stripRootDot(parsed, url, origin) {
|
|
21
|
+
const host = parsed.hostname;
|
|
22
|
+
if (host.startsWith("[") || !host.endsWith(".")) return { url, origin };
|
|
23
|
+
if (host.endsWith("..") || host === ".") return null;
|
|
24
|
+
const dotless = `${parsed.protocol}//${host.slice(0, -1)}${parsed.port ? `:${parsed.port}` : ""}`;
|
|
25
|
+
return { url: dotless + url.slice(origin.length), origin: dotless };
|
|
26
|
+
}
|
|
27
|
+
function usesOriginOnlyAgentMatching(adcpVersion = ADCP_VERSION) {
|
|
28
|
+
return isAdcpVersionAtLeast(adcpVersion, ORIGIN_ONLY_AGENT_MATCHING_SINCE);
|
|
29
|
+
}
|
|
30
|
+
function agentUrlMatchesAuthorizedEntry(entryUrl, agentUrl, options = {}) {
|
|
31
|
+
const entry = canonicalAgentUrlParts(entryUrl);
|
|
32
|
+
const agent = canonicalAgentUrlParts(agentUrl);
|
|
33
|
+
if (!entry || !agent) return false;
|
|
34
|
+
return matchCanonicalAgentUrl(entry, agent, usesOriginOnlyAgentMatching(options.adcpVersion)) !== "none";
|
|
35
|
+
}
|
|
36
|
+
function matchCanonicalAgentUrl(entry, agent, originOnlyMatching) {
|
|
37
|
+
if (!originOnlyMatching) return entry.url === agent.url ? "exact" : "none";
|
|
38
|
+
const e = entry.rootDotless;
|
|
39
|
+
const a = agent.rootDotless;
|
|
40
|
+
if (!e || !a) return "none";
|
|
41
|
+
if (e.url === a.url) return "exact";
|
|
42
|
+
if (entry.originOnly && e.origin === a.origin) return "origin";
|
|
43
|
+
return "none";
|
|
44
|
+
}
|
|
10
45
|
function parseAgentUrl(raw) {
|
|
11
46
|
if (typeof raw !== "string" || raw.length === 0) return null;
|
|
12
47
|
let parsed;
|
|
@@ -19,25 +54,66 @@ function parseAgentUrl(raw) {
|
|
|
19
54
|
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return null;
|
|
20
55
|
return parsed;
|
|
21
56
|
}
|
|
22
|
-
function resolveAgentProperties(adAgents, agentUrl) {
|
|
23
|
-
const wanted =
|
|
57
|
+
function resolveAgentProperties(adAgents, agentUrl, options = {}) {
|
|
58
|
+
const wanted = canonicalAgentUrlParts(agentUrl);
|
|
24
59
|
if (!wanted) {
|
|
25
60
|
return { properties: [], cross_publisher: [], cross_publisher_expanded: [], unresolvable: "agent_not_listed" };
|
|
26
61
|
}
|
|
62
|
+
const originOnlyMatching = usesOriginOnlyAgentMatching(options.adcpVersion);
|
|
27
63
|
const entries = Array.isArray(adAgents.authorized_agents) ? adAgents.authorized_agents : [];
|
|
28
|
-
const matches =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return { properties: [], cross_publisher: [], cross_publisher_expanded: [], unresolvable: "ambiguous_agent_url" };
|
|
64
|
+
const matches = [];
|
|
65
|
+
for (const e of entries) {
|
|
66
|
+
if (!e || typeof e.url !== "string") continue;
|
|
67
|
+
const canon = canonicalAgentUrlParts(e.url);
|
|
68
|
+
if (!canon) continue;
|
|
69
|
+
if (matchCanonicalAgentUrl(canon, wanted, originOnlyMatching) !== "none") matches.push(e);
|
|
35
70
|
}
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
71
|
+
const first = matches[0];
|
|
72
|
+
if (!first) {
|
|
38
73
|
return { properties: [], cross_publisher: [], cross_publisher_expanded: [], unresolvable: "agent_not_listed" };
|
|
39
74
|
}
|
|
40
|
-
|
|
75
|
+
if (!originOnlyMatching) {
|
|
76
|
+
if (matches.length > 1) {
|
|
77
|
+
return { properties: [], cross_publisher: [], cross_publisher_expanded: [], unresolvable: "ambiguous_agent_url" };
|
|
78
|
+
}
|
|
79
|
+
return resolveMatchedAgentProperties(adAgents, first);
|
|
80
|
+
}
|
|
81
|
+
if (matches.length === 1) {
|
|
82
|
+
return { ...resolveMatchedAgentProperties(adAgents, first), matched_entries: [first] };
|
|
83
|
+
}
|
|
84
|
+
return unionAgentScopes(
|
|
85
|
+
matches.map((entry) => resolveMatchedAgentProperties(adAgents, entry)),
|
|
86
|
+
matches
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function unionAgentScopes(scopes, entries) {
|
|
90
|
+
const properties = uniqueByValue(scopes.flatMap((s) => s.properties));
|
|
91
|
+
const cross_publisher = uniqueByValue(scopes.flatMap((s) => s.cross_publisher));
|
|
92
|
+
const cross_publisher_expanded = uniqueByValue(scopes.flatMap((s) => s.cross_publisher_expanded));
|
|
93
|
+
const empty = properties.length === 0 && cross_publisher.length === 0;
|
|
94
|
+
const reason = scopes.find((s) => s.unresolvable !== void 0)?.unresolvable;
|
|
95
|
+
return {
|
|
96
|
+
properties,
|
|
97
|
+
cross_publisher,
|
|
98
|
+
cross_publisher_expanded,
|
|
99
|
+
matched_entry: entries[0],
|
|
100
|
+
matched_entries: entries,
|
|
101
|
+
...empty && reason !== void 0 ? { unresolvable: reason } : {}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function uniqueByValue(items) {
|
|
105
|
+
const seenRefs = /* @__PURE__ */ new Set();
|
|
106
|
+
const seenValues = /* @__PURE__ */ new Set();
|
|
107
|
+
const out = [];
|
|
108
|
+
for (const item of items) {
|
|
109
|
+
if (seenRefs.has(item)) continue;
|
|
110
|
+
seenRefs.add(item);
|
|
111
|
+
const value = JSON.stringify(item);
|
|
112
|
+
if (seenValues.has(value)) continue;
|
|
113
|
+
seenValues.add(value);
|
|
114
|
+
out.push(item);
|
|
115
|
+
}
|
|
116
|
+
return out;
|
|
41
117
|
}
|
|
42
118
|
function resolveMatchedAgentProperties(adAgents, entry) {
|
|
43
119
|
const allProperties = filterRevokedProperties(adAgents.properties, adAgents.revoked_publisher_domains);
|
|
@@ -248,8 +324,10 @@ function allowsLegacyBareInline(adAgents) {
|
|
|
248
324
|
return typeof adAgents.$schema !== "string" || adAgents.$schema.length === 0;
|
|
249
325
|
}
|
|
250
326
|
export {
|
|
327
|
+
agentUrlMatchesAuthorizedEntry,
|
|
251
328
|
canonicalizeAgentUrl,
|
|
252
329
|
getAllProperties,
|
|
253
330
|
listAgentPropertyMap,
|
|
254
|
-
resolveAgentProperties
|
|
331
|
+
resolveAgentProperties,
|
|
332
|
+
usesOriginOnlyAgentMatching
|
|
255
333
|
};
|
|
@@ -103,6 +103,13 @@ export interface ValidateAdAgentsOptions {
|
|
|
103
103
|
/**
|
|
104
104
|
* Validate `adagents.json` for a publisher domain. Implements the
|
|
105
105
|
* ads.txt `MANAGERDOMAIN` one-hop fallback specified in adcp#4175.
|
|
106
|
+
*
|
|
107
|
+
* This locates and loads the file; it does not decide whether a given agent
|
|
108
|
+
* is authorized. Check an agent against `result.adagents` with
|
|
109
|
+
* `resolveAgentProperties` or `agentUrlMatchesAuthorizedEntry`, passing the
|
|
110
|
+
* negotiated or targeted `adcpVersion`: at AdCP 3.3 or later an origin-only
|
|
111
|
+
* `authorized_agents[].url` authorizes the agent at any path on that origin
|
|
112
|
+
* (adcp#8862).
|
|
106
113
|
*/
|
|
107
114
|
export declare function validateAdAgents(publisherDomain: string, options?: ValidateAdAgentsOptions): Promise<AdAgentsValidationResult>;
|
|
108
115
|
/**
|
|
@@ -103,6 +103,13 @@ export interface ValidateAdAgentsOptions {
|
|
|
103
103
|
/**
|
|
104
104
|
* Validate `adagents.json` for a publisher domain. Implements the
|
|
105
105
|
* ads.txt `MANAGERDOMAIN` one-hop fallback specified in adcp#4175.
|
|
106
|
+
*
|
|
107
|
+
* This locates and loads the file; it does not decide whether a given agent
|
|
108
|
+
* is authorized. Check an agent against `result.adagents` with
|
|
109
|
+
* `resolveAgentProperties` or `agentUrlMatchesAuthorizedEntry`, passing the
|
|
110
|
+
* negotiated or targeted `adcpVersion`: at AdCP 3.3 or later an origin-only
|
|
111
|
+
* `authorized_agents[].url` authorizes the agent at any path on that origin
|
|
112
|
+
* (adcp#8862).
|
|
106
113
|
*/
|
|
107
114
|
export declare function validateAdAgents(publisherDomain: string, options?: ValidateAdAgentsOptions): Promise<AdAgentsValidationResult>;
|
|
108
115
|
/**
|
|
@@ -2,7 +2,7 @@ export { PropertyIndex, getPropertyIndex, resetPropertyIndex, type PropertyMatch
|
|
|
2
2
|
export { NetworkConsistencyChecker, type NetworkConsistencyCheckerConfig, type NetworkCheckReport, type CheckSummary, type CheckProgress, type OrphanedPointer, type StalePointer, type MissingPointer, type SchemaError, type AgentHealthResult, type DomainDetail, type DomainStatus, } from '../discovery/network-consistency-checker.mjs';
|
|
3
3
|
export type { Property, PropertyIdentifier, PropertyIdentifierType, PropertyType, AdAgentsJson, AuthorizedAgent, AuthorizationType, PublisherPropertySelector as AdAgentsPublisherPropertySelector, SinglePublisherPropertySelector, CompactPublisherPropertySelector, } from '../discovery/types.mjs';
|
|
4
4
|
export { parsePublisherPropertySelector, expandPublisherPropertySelector, expandPublisherPropertySelectors, isCompactPublisherPropertySelector, publisherDomainsCoveredBySelectors, PublisherPropertySelectorParseError, type PublisherPropertySelectorError, } from '../discovery/publisher-property-selector.mjs';
|
|
5
|
-
export { resolveAgentProperties, listAgentPropertyMap, getAllProperties, canonicalizeAgentUrl, type ResolvedAgentScope, type ResolveUnresolvableReason, } from '../discovery/resolve-agent-properties.mjs';
|
|
5
|
+
export { resolveAgentProperties, listAgentPropertyMap, getAllProperties, canonicalizeAgentUrl, agentUrlMatchesAuthorizedEntry, usesOriginOnlyAgentMatching, type AgentUrlMatchOptions, type ResolvedAgentScope, type ResolveUnresolvableReason, } from '../discovery/resolve-agent-properties.mjs';
|
|
6
6
|
export { resolveInlinePublisherProperties, resolveSingularInline, detectInlineFederatedDivergence, type InlineResolutionResult, type InlineFederatedDivergence, } from '../discovery/inline-publisher-properties.mjs';
|
|
7
7
|
export { fetchAgentAuthorizationsFromDirectory, type AgentAuthorizationsIterator, type FetchAgentAuthorizationsOptions, type DirectoryLookupPage, type DirectoryPublisherEntry, type DirectoryDiscoveryMethod, type DirectoryPublisherStatus, } from '../discovery/agent-directory.mjs';
|
|
8
8
|
export { validateAdAgents, parseManagerDomain, type DiscoveryMethod, type AdAgentsValidationResult, type ValidateAdAgentsOptions, } from '../discovery/validate-adagents.mjs';
|
|
@@ -2,7 +2,7 @@ export { PropertyIndex, getPropertyIndex, resetPropertyIndex, type PropertyMatch
|
|
|
2
2
|
export { NetworkConsistencyChecker, type NetworkConsistencyCheckerConfig, type NetworkCheckReport, type CheckSummary, type CheckProgress, type OrphanedPointer, type StalePointer, type MissingPointer, type SchemaError, type AgentHealthResult, type DomainDetail, type DomainStatus, } from '../discovery/network-consistency-checker';
|
|
3
3
|
export type { Property, PropertyIdentifier, PropertyIdentifierType, PropertyType, AdAgentsJson, AuthorizedAgent, AuthorizationType, PublisherPropertySelector as AdAgentsPublisherPropertySelector, SinglePublisherPropertySelector, CompactPublisherPropertySelector, } from '../discovery/types';
|
|
4
4
|
export { parsePublisherPropertySelector, expandPublisherPropertySelector, expandPublisherPropertySelectors, isCompactPublisherPropertySelector, publisherDomainsCoveredBySelectors, PublisherPropertySelectorParseError, type PublisherPropertySelectorError, } from '../discovery/publisher-property-selector';
|
|
5
|
-
export { resolveAgentProperties, listAgentPropertyMap, getAllProperties, canonicalizeAgentUrl, type ResolvedAgentScope, type ResolveUnresolvableReason, } from '../discovery/resolve-agent-properties';
|
|
5
|
+
export { resolveAgentProperties, listAgentPropertyMap, getAllProperties, canonicalizeAgentUrl, agentUrlMatchesAuthorizedEntry, usesOriginOnlyAgentMatching, type AgentUrlMatchOptions, type ResolvedAgentScope, type ResolveUnresolvableReason, } from '../discovery/resolve-agent-properties';
|
|
6
6
|
export { resolveInlinePublisherProperties, resolveSingularInline, detectInlineFederatedDivergence, type InlineResolutionResult, type InlineFederatedDivergence, } from '../discovery/inline-publisher-properties';
|
|
7
7
|
export { fetchAgentAuthorizationsFromDirectory, type AgentAuthorizationsIterator, type FetchAgentAuthorizationsOptions, type DirectoryLookupPage, type DirectoryPublisherEntry, type DirectoryDiscoveryMethod, type DirectoryPublisherStatus, } from '../discovery/agent-directory';
|
|
8
8
|
export { validateAdAgents, parseManagerDomain, type DiscoveryMethod, type AdAgentsValidationResult, type ValidateAdAgentsOptions, } from '../discovery/validate-adagents';
|
|
@@ -21,6 +21,7 @@ __export(discovery_exports, {
|
|
|
21
21
|
NetworkConsistencyChecker: () => import_network_consistency_checker.NetworkConsistencyChecker,
|
|
22
22
|
PropertyIndex: () => import_property_index.PropertyIndex,
|
|
23
23
|
PublisherPropertySelectorParseError: () => import_publisher_property_selector.PublisherPropertySelectorParseError,
|
|
24
|
+
agentUrlMatchesAuthorizedEntry: () => import_resolve_agent_properties.agentUrlMatchesAuthorizedEntry,
|
|
24
25
|
canonicalizeAgentUrl: () => import_resolve_agent_properties.canonicalizeAgentUrl,
|
|
25
26
|
detectInlineFederatedDivergence: () => import_inline_publisher_properties.detectInlineFederatedDivergence,
|
|
26
27
|
expandPublisherPropertySelector: () => import_publisher_property_selector.expandPublisherPropertySelector,
|
|
@@ -37,6 +38,7 @@ __export(discovery_exports, {
|
|
|
37
38
|
resolveAgentProperties: () => import_resolve_agent_properties.resolveAgentProperties,
|
|
38
39
|
resolveInlinePublisherProperties: () => import_inline_publisher_properties.resolveInlinePublisherProperties,
|
|
39
40
|
resolveSingularInline: () => import_inline_publisher_properties.resolveSingularInline,
|
|
41
|
+
usesOriginOnlyAgentMatching: () => import_resolve_agent_properties.usesOriginOnlyAgentMatching,
|
|
40
42
|
validateAdAgents: () => import_validate_adagents.validateAdAgents
|
|
41
43
|
});
|
|
42
44
|
module.exports = __toCommonJS(discovery_exports);
|
|
@@ -52,6 +54,7 @@ var import_validate_adagents = require('../discovery/validate-adagents.js');
|
|
|
52
54
|
NetworkConsistencyChecker,
|
|
53
55
|
PropertyIndex,
|
|
54
56
|
PublisherPropertySelectorParseError,
|
|
57
|
+
agentUrlMatchesAuthorizedEntry,
|
|
55
58
|
canonicalizeAgentUrl,
|
|
56
59
|
detectInlineFederatedDivergence,
|
|
57
60
|
expandPublisherPropertySelector,
|
|
@@ -68,5 +71,6 @@ var import_validate_adagents = require('../discovery/validate-adagents.js');
|
|
|
68
71
|
resolveAgentProperties,
|
|
69
72
|
resolveInlinePublisherProperties,
|
|
70
73
|
resolveSingularInline,
|
|
74
|
+
usesOriginOnlyAgentMatching,
|
|
71
75
|
validateAdAgents
|
|
72
76
|
});
|
|
@@ -18,7 +18,9 @@ import {
|
|
|
18
18
|
resolveAgentProperties,
|
|
19
19
|
listAgentPropertyMap,
|
|
20
20
|
getAllProperties,
|
|
21
|
-
canonicalizeAgentUrl
|
|
21
|
+
canonicalizeAgentUrl,
|
|
22
|
+
agentUrlMatchesAuthorizedEntry,
|
|
23
|
+
usesOriginOnlyAgentMatching
|
|
22
24
|
} from "../discovery/resolve-agent-properties.mjs";
|
|
23
25
|
import {
|
|
24
26
|
resolveInlinePublisherProperties,
|
|
@@ -36,6 +38,7 @@ export {
|
|
|
36
38
|
NetworkConsistencyChecker,
|
|
37
39
|
PropertyIndex,
|
|
38
40
|
PublisherPropertySelectorParseError,
|
|
41
|
+
agentUrlMatchesAuthorizedEntry,
|
|
39
42
|
canonicalizeAgentUrl,
|
|
40
43
|
detectInlineFederatedDivergence,
|
|
41
44
|
expandPublisherPropertySelector,
|
|
@@ -52,5 +55,6 @@ export {
|
|
|
52
55
|
resolveAgentProperties,
|
|
53
56
|
resolveInlinePublisherProperties,
|
|
54
57
|
resolveSingularInline,
|
|
58
|
+
usesOriginOnlyAgentMatching,
|
|
55
59
|
validateAdAgents
|
|
56
60
|
};
|
package/dist/lib/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ export { PropertyCrawler, type AgentInfo, type CrawlResult, type PropertyCrawler
|
|
|
11
11
|
export { NetworkConsistencyChecker, type NetworkConsistencyCheckerConfig, type NetworkCheckReport, type CheckSummary, type CheckProgress, type OrphanedPointer, type StalePointer, type MissingPointer, type SchemaError, type AgentHealthResult, type DomainDetail, type DomainStatus, } from './discovery/network-consistency-checker.mjs';
|
|
12
12
|
export type { Property, PropertyIdentifier, PropertyIdentifierType, PropertyType, AdAgentsJson, AuthorizedAgent, AuthorizationType, PublisherPropertySelector as AdAgentsPublisherPropertySelector, SinglePublisherPropertySelector, CompactPublisherPropertySelector, } from './discovery/types.mjs';
|
|
13
13
|
export { parsePublisherPropertySelector, expandPublisherPropertySelector, expandPublisherPropertySelectors, isCompactPublisherPropertySelector, publisherDomainsCoveredBySelectors, PublisherPropertySelectorParseError, type PublisherPropertySelectorError, } from './discovery/publisher-property-selector.mjs';
|
|
14
|
-
export { resolveAgentProperties, listAgentPropertyMap, getAllProperties, canonicalizeAgentUrl, type ResolvedAgentScope, type ResolveUnresolvableReason, } from './discovery/resolve-agent-properties.mjs';
|
|
14
|
+
export { resolveAgentProperties, listAgentPropertyMap, getAllProperties, canonicalizeAgentUrl, agentUrlMatchesAuthorizedEntry, usesOriginOnlyAgentMatching, type AgentUrlMatchOptions, type ResolvedAgentScope, type ResolveUnresolvableReason, } from './discovery/resolve-agent-properties.mjs';
|
|
15
15
|
export { resolveInlinePublisherProperties, resolveSingularInline, detectInlineFederatedDivergence, type InlineResolutionResult, type InlineFederatedDivergence, } from './discovery/inline-publisher-properties.mjs';
|
|
16
16
|
export { fetchAgentAuthorizationsFromDirectory, type AgentAuthorizationsIterator, type FetchAgentAuthorizationsOptions, type DirectoryLookupPage, type DirectoryPublisherEntry, type DirectoryDiscoveryMethod, type DirectoryPublisherStatus, } from './discovery/agent-directory.mjs';
|
|
17
17
|
export { validateAdAgents, parseManagerDomain, type DiscoveryMethod, type AdAgentsValidationResult, type ValidateAdAgentsOptions, } from './discovery/validate-adagents.mjs';
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { PropertyCrawler, type AgentInfo, type CrawlResult, type PropertyCrawler
|
|
|
11
11
|
export { NetworkConsistencyChecker, type NetworkConsistencyCheckerConfig, type NetworkCheckReport, type CheckSummary, type CheckProgress, type OrphanedPointer, type StalePointer, type MissingPointer, type SchemaError, type AgentHealthResult, type DomainDetail, type DomainStatus, } from './discovery/network-consistency-checker';
|
|
12
12
|
export type { Property, PropertyIdentifier, PropertyIdentifierType, PropertyType, AdAgentsJson, AuthorizedAgent, AuthorizationType, PublisherPropertySelector as AdAgentsPublisherPropertySelector, SinglePublisherPropertySelector, CompactPublisherPropertySelector, } from './discovery/types';
|
|
13
13
|
export { parsePublisherPropertySelector, expandPublisherPropertySelector, expandPublisherPropertySelectors, isCompactPublisherPropertySelector, publisherDomainsCoveredBySelectors, PublisherPropertySelectorParseError, type PublisherPropertySelectorError, } from './discovery/publisher-property-selector';
|
|
14
|
-
export { resolveAgentProperties, listAgentPropertyMap, getAllProperties, canonicalizeAgentUrl, type ResolvedAgentScope, type ResolveUnresolvableReason, } from './discovery/resolve-agent-properties';
|
|
14
|
+
export { resolveAgentProperties, listAgentPropertyMap, getAllProperties, canonicalizeAgentUrl, agentUrlMatchesAuthorizedEntry, usesOriginOnlyAgentMatching, type AgentUrlMatchOptions, type ResolvedAgentScope, type ResolveUnresolvableReason, } from './discovery/resolve-agent-properties';
|
|
15
15
|
export { resolveInlinePublisherProperties, resolveSingularInline, detectInlineFederatedDivergence, type InlineResolutionResult, type InlineFederatedDivergence, } from './discovery/inline-publisher-properties';
|
|
16
16
|
export { fetchAgentAuthorizationsFromDirectory, type AgentAuthorizationsIterator, type FetchAgentAuthorizationsOptions, type DirectoryLookupPage, type DirectoryPublisherEntry, type DirectoryDiscoveryMethod, type DirectoryPublisherStatus, } from './discovery/agent-directory';
|
|
17
17
|
export { validateAdAgents, parseManagerDomain, type DiscoveryMethod, type AdAgentsValidationResult, type ValidateAdAgentsOptions, } from './discovery/validate-adagents';
|
package/dist/lib/index.js
CHANGED
|
@@ -239,6 +239,7 @@ __export(index_exports, {
|
|
|
239
239
|
addSpanAttributes: () => import_observability.addSpanAttributes,
|
|
240
240
|
adjustedMediaBuyDeliveryNotification: () => import_media_buy_delivery_notification_builders.adjustedMediaBuyDeliveryNotification,
|
|
241
241
|
agentSignalId: () => import_signal_id_builders.agentSignalId,
|
|
242
|
+
agentUrlMatchesAuthorizedEntry: () => import_resolve_agent_properties.agentUrlMatchesAuthorizedEntry,
|
|
242
243
|
applyBrandAssetMappings: () => import_brand.applyBrandAssetMappings,
|
|
243
244
|
applyTargetingInput: () => import_media_buy.applyTargetingInput,
|
|
244
245
|
assertCreativeTransition: () => import_server.assertCreativeTransition,
|
|
@@ -715,6 +716,7 @@ __export(index_exports, {
|
|
|
715
716
|
urlRender: () => import_render_builders.urlRender,
|
|
716
717
|
useIdempotencyKey: () => import_idempotency.useIdempotencyKey,
|
|
717
718
|
usesDeprecatedAssetsField: () => import_format_assets.usesDeprecatedAssetsField,
|
|
719
|
+
usesOriginOnlyAgentMatching: () => import_resolve_agent_properties.usesOriginOnlyAgentMatching,
|
|
718
720
|
usesV3CreativeAssignments: () => import_creative_adapter.usesV3CreativeAssignments,
|
|
719
721
|
usesV3RenderFields: () => import_preview_normalizer.usesV3RenderFields,
|
|
720
722
|
usesV3Renders: () => import_format_renders.usesV3Renders,
|
|
@@ -1109,6 +1111,7 @@ function createAdCPClientFromEnv() {
|
|
|
1109
1111
|
addSpanAttributes,
|
|
1110
1112
|
adjustedMediaBuyDeliveryNotification,
|
|
1111
1113
|
agentSignalId,
|
|
1114
|
+
agentUrlMatchesAuthorizedEntry,
|
|
1112
1115
|
applyBrandAssetMappings,
|
|
1113
1116
|
applyTargetingInput,
|
|
1114
1117
|
assertCreativeTransition,
|
|
@@ -1585,6 +1588,7 @@ function createAdCPClientFromEnv() {
|
|
|
1585
1588
|
urlRender,
|
|
1586
1589
|
useIdempotencyKey,
|
|
1587
1590
|
usesDeprecatedAssetsField,
|
|
1591
|
+
usesOriginOnlyAgentMatching,
|
|
1588
1592
|
usesV3CreativeAssignments,
|
|
1589
1593
|
usesV3RenderFields,
|
|
1590
1594
|
usesV3Renders,
|
package/dist/lib/index.mjs
CHANGED
|
@@ -57,7 +57,9 @@ import {
|
|
|
57
57
|
resolveAgentProperties,
|
|
58
58
|
listAgentPropertyMap,
|
|
59
59
|
getAllProperties,
|
|
60
|
-
canonicalizeAgentUrl
|
|
60
|
+
canonicalizeAgentUrl,
|
|
61
|
+
agentUrlMatchesAuthorizedEntry,
|
|
62
|
+
usesOriginOnlyAgentMatching
|
|
61
63
|
} from "./discovery/resolve-agent-properties.mjs";
|
|
62
64
|
import {
|
|
63
65
|
resolveInlinePublisherProperties,
|
|
@@ -1068,6 +1070,7 @@ export {
|
|
|
1068
1070
|
addSpanAttributes,
|
|
1069
1071
|
adjustedMediaBuyDeliveryNotification,
|
|
1070
1072
|
agentSignalId,
|
|
1073
|
+
agentUrlMatchesAuthorizedEntry,
|
|
1071
1074
|
applyBrandAssetMappings,
|
|
1072
1075
|
applyTargetingInput,
|
|
1073
1076
|
assertCreativeTransition,
|
|
@@ -1544,6 +1547,7 @@ export {
|
|
|
1544
1547
|
urlRender,
|
|
1545
1548
|
useIdempotencyKey,
|
|
1546
1549
|
usesDeprecatedAssetsField,
|
|
1550
|
+
usesOriginOnlyAgentMatching,
|
|
1547
1551
|
usesV3CreativeAssignments,
|
|
1548
1552
|
usesV3RenderFields,
|
|
1549
1553
|
usesV3Renders,
|
|
@@ -3,3 +3,11 @@ export declare function isReportingCanonicalDigest(value: unknown): boolean;
|
|
|
3
3
|
export declare function isReportingVerificationEvidence(value: unknown): boolean;
|
|
4
4
|
export declare function isReportingReceiptEvidence(value: unknown): boolean;
|
|
5
5
|
export declare function isReportingAdjustmentReceiptEvidence(value: unknown): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* JSON paths of members a materialization carries, at any depth, that its
|
|
8
|
+
* bundled schema does not declare. AdCP 3.3.0-beta.6 opened these schemas
|
|
9
|
+
* (adcontextprotocol/adcp#8866), so schema validation alone now accepts them; a
|
|
10
|
+
* store or managed runtime refuses evidence that reports any, as it did while
|
|
11
|
+
* the schemas were closed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function undeclaredReportingMaterializationMembers(materialization: unknown): string[];
|
|
@@ -3,3 +3,11 @@ export declare function isReportingCanonicalDigest(value: unknown): boolean;
|
|
|
3
3
|
export declare function isReportingVerificationEvidence(value: unknown): boolean;
|
|
4
4
|
export declare function isReportingReceiptEvidence(value: unknown): boolean;
|
|
5
5
|
export declare function isReportingAdjustmentReceiptEvidence(value: unknown): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* JSON paths of members a materialization carries, at any depth, that its
|
|
8
|
+
* bundled schema does not declare. AdCP 3.3.0-beta.6 opened these schemas
|
|
9
|
+
* (adcontextprotocol/adcp#8866), so schema validation alone now accepts them; a
|
|
10
|
+
* store or managed runtime refuses evidence that reports any, as it did while
|
|
11
|
+
* the schemas were closed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function undeclaredReportingMaterializationMembers(materialization: unknown): string[];
|
|
@@ -22,9 +22,11 @@ __export(evidence_exports, {
|
|
|
22
22
|
isReportingCanonicalDigest: () => isReportingCanonicalDigest,
|
|
23
23
|
isReportingControlTotals: () => isReportingControlTotals,
|
|
24
24
|
isReportingReceiptEvidence: () => isReportingReceiptEvidence,
|
|
25
|
-
isReportingVerificationEvidence: () => isReportingVerificationEvidence
|
|
25
|
+
isReportingVerificationEvidence: () => isReportingVerificationEvidence,
|
|
26
|
+
undeclaredReportingMaterializationMembers: () => undeclaredReportingMaterializationMembers
|
|
26
27
|
});
|
|
27
28
|
module.exports = __toCommonJS(evidence_exports);
|
|
29
|
+
var import_schema_projection = require('../adapters/version/schema-projection.js');
|
|
28
30
|
const CONTROL_TOTAL_NAME = /^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/;
|
|
29
31
|
const CANONICAL_DECIMAL = /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$/;
|
|
30
32
|
const SHA256_HEX = /^[A-Fa-f0-9]{64}$/;
|
|
@@ -155,11 +157,17 @@ function isReportingAdjustmentReceiptEvidence(value) {
|
|
|
155
157
|
if (value.status === "accepted") return value.rejection_codes === void 0;
|
|
156
158
|
return Array.isArray(value.rejection_codes) && value.rejection_codes.length > 0 && new Set(value.rejection_codes).size === value.rejection_codes.length && value.rejection_codes.every((code) => typeof code === "string" && /^[A-Z][A-Z0-9_]{0,127}$/.test(code));
|
|
157
159
|
}
|
|
160
|
+
function undeclaredReportingMaterializationMembers(materialization) {
|
|
161
|
+
return (0, import_schema_projection.projectToDeclaredMembers)("core/reporting-materialization.json", materialization).dropped.map(
|
|
162
|
+
(drop) => drop.path
|
|
163
|
+
);
|
|
164
|
+
}
|
|
158
165
|
// Annotate the CommonJS export names for ESM import in node:
|
|
159
166
|
0 && (module.exports = {
|
|
160
167
|
isReportingAdjustmentReceiptEvidence,
|
|
161
168
|
isReportingCanonicalDigest,
|
|
162
169
|
isReportingControlTotals,
|
|
163
170
|
isReportingReceiptEvidence,
|
|
164
|
-
isReportingVerificationEvidence
|
|
171
|
+
isReportingVerificationEvidence,
|
|
172
|
+
undeclaredReportingMaterializationMembers
|
|
165
173
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { projectToDeclaredMembers } from "../adapters/version/schema-projection.mjs";
|
|
1
2
|
const CONTROL_TOTAL_NAME = /^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/;
|
|
2
3
|
const CANONICAL_DECIMAL = /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$/;
|
|
3
4
|
const SHA256_HEX = /^[A-Fa-f0-9]{64}$/;
|
|
@@ -128,10 +129,16 @@ function isReportingAdjustmentReceiptEvidence(value) {
|
|
|
128
129
|
if (value.status === "accepted") return value.rejection_codes === void 0;
|
|
129
130
|
return Array.isArray(value.rejection_codes) && value.rejection_codes.length > 0 && new Set(value.rejection_codes).size === value.rejection_codes.length && value.rejection_codes.every((code) => typeof code === "string" && /^[A-Z][A-Z0-9_]{0,127}$/.test(code));
|
|
130
131
|
}
|
|
132
|
+
function undeclaredReportingMaterializationMembers(materialization) {
|
|
133
|
+
return projectToDeclaredMembers("core/reporting-materialization.json", materialization).dropped.map(
|
|
134
|
+
(drop) => drop.path
|
|
135
|
+
);
|
|
136
|
+
}
|
|
131
137
|
export {
|
|
132
138
|
isReportingAdjustmentReceiptEvidence,
|
|
133
139
|
isReportingCanonicalDigest,
|
|
134
140
|
isReportingControlTotals,
|
|
135
141
|
isReportingReceiptEvidence,
|
|
136
|
-
isReportingVerificationEvidence
|
|
142
|
+
isReportingVerificationEvidence,
|
|
143
|
+
undeclaredReportingMaterializationMembers
|
|
137
144
|
};
|
|
@@ -30,5 +30,5 @@ export * from './offering-validation.mjs';
|
|
|
30
30
|
export * from './issue-events.mjs';
|
|
31
31
|
export { compareReportingInstants } from './instant.mjs';
|
|
32
32
|
export { isFrozenCalendarRulesMismatch, reportingPeriodDate, reportingPeriodSchedule } from './schedule.mjs';
|
|
33
|
-
export { isReportingAdjustmentReceiptEvidence, isReportingReceiptEvidence, isReportingVerificationEvidence, } from '../evidence.mjs';
|
|
33
|
+
export { isReportingAdjustmentReceiptEvidence, isReportingReceiptEvidence, isReportingVerificationEvidence, undeclaredReportingMaterializationMembers, } from '../evidence.mjs';
|
|
34
34
|
export { isWellFormedUnicodeString } from '../../utils/well-formed-unicode.mjs';
|
|
@@ -30,5 +30,5 @@ export * from './offering-validation';
|
|
|
30
30
|
export * from './issue-events';
|
|
31
31
|
export { compareReportingInstants } from './instant';
|
|
32
32
|
export { isFrozenCalendarRulesMismatch, reportingPeriodDate, reportingPeriodSchedule } from './schedule';
|
|
33
|
-
export { isReportingAdjustmentReceiptEvidence, isReportingReceiptEvidence, isReportingVerificationEvidence, } from '../evidence';
|
|
33
|
+
export { isReportingAdjustmentReceiptEvidence, isReportingReceiptEvidence, isReportingVerificationEvidence, undeclaredReportingMaterializationMembers, } from '../evidence';
|
|
34
34
|
export { isWellFormedUnicodeString } from '../../utils/well-formed-unicode';
|
|
@@ -26,7 +26,8 @@ __export(ledger_exports, {
|
|
|
26
26
|
isReportingVerificationEvidence: () => import_evidence.isReportingVerificationEvidence,
|
|
27
27
|
isWellFormedUnicodeString: () => import_well_formed_unicode.isWellFormedUnicodeString,
|
|
28
28
|
reportingPeriodDate: () => import_schedule.reportingPeriodDate,
|
|
29
|
-
reportingPeriodSchedule: () => import_schedule.reportingPeriodSchedule
|
|
29
|
+
reportingPeriodSchedule: () => import_schedule.reportingPeriodSchedule,
|
|
30
|
+
undeclaredReportingMaterializationMembers: () => import_evidence.undeclaredReportingMaterializationMembers
|
|
30
31
|
});
|
|
31
32
|
module.exports = __toCommonJS(ledger_exports);
|
|
32
33
|
__reExport(ledger_exports, require('./types.js'), module.exports);
|
|
@@ -56,6 +57,7 @@ var import_well_formed_unicode = require('../../utils/well-formed-unicode.js');
|
|
|
56
57
|
isWellFormedUnicodeString,
|
|
57
58
|
reportingPeriodDate,
|
|
58
59
|
reportingPeriodSchedule,
|
|
60
|
+
undeclaredReportingMaterializationMembers,
|
|
59
61
|
...require('./types.js'),
|
|
60
62
|
...require('./health.js'),
|
|
61
63
|
...require('./coverage.js'),
|
|
@@ -16,7 +16,8 @@ import { isFrozenCalendarRulesMismatch, reportingPeriodDate, reportingPeriodSche
|
|
|
16
16
|
import {
|
|
17
17
|
isReportingAdjustmentReceiptEvidence,
|
|
18
18
|
isReportingReceiptEvidence,
|
|
19
|
-
isReportingVerificationEvidence
|
|
19
|
+
isReportingVerificationEvidence,
|
|
20
|
+
undeclaredReportingMaterializationMembers
|
|
20
21
|
} from "../evidence.mjs";
|
|
21
22
|
import { isWellFormedUnicodeString } from "../../utils/well-formed-unicode.mjs";
|
|
22
23
|
export {
|
|
@@ -27,5 +28,6 @@ export {
|
|
|
27
28
|
isReportingVerificationEvidence,
|
|
28
29
|
isWellFormedUnicodeString,
|
|
29
30
|
reportingPeriodDate,
|
|
30
|
-
reportingPeriodSchedule
|
|
31
|
+
reportingPeriodSchedule,
|
|
32
|
+
undeclaredReportingMaterializationMembers
|
|
31
33
|
};
|
|
@@ -493,7 +493,7 @@ function boundedRecovery(value) {
|
|
|
493
493
|
return value === "transient" || value === "correctable" || value === "terminal" ? value : void 0;
|
|
494
494
|
}
|
|
495
495
|
function boundedErrorField(value) {
|
|
496
|
-
return typeof value === "string" && !
|
|
496
|
+
return typeof value === "string" && !CONTROL_CHARACTER.test(value) && (0, import_well_formed_unicode.isWellFormedUnicodeString)(value) && Buffer.byteLength(value, "utf8") <= import_types.REPORTING_CONSUMER_STATUS_ERROR_FIELD_MAX_BYTES ? value : void 0;
|
|
497
497
|
}
|
|
498
498
|
function boundedErrorKeyword(value) {
|
|
499
499
|
return typeof value === "string" && /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(value) ? value : void 0;
|
|
@@ -536,11 +536,12 @@ function requestStatusIds(value) {
|
|
|
536
536
|
const statuses = isRecord(value) && Array.isArray(value.statuses) ? value.statuses : [];
|
|
537
537
|
return statuses.length > 0 && statuses.length <= 100 ? statuses.map(reportingStatusId) : ["invalid-reporting-status-id"];
|
|
538
538
|
}
|
|
539
|
+
const CONTROL_CHARACTER = /[\u0000-\u001f\u007f-\u009f\u2028\u2029]/;
|
|
539
540
|
function zodPathToPointer(path) {
|
|
540
541
|
let pointer = "";
|
|
541
542
|
for (const value of path) {
|
|
542
543
|
const raw = String(value);
|
|
543
|
-
if (
|
|
544
|
+
if (CONTROL_CHARACTER.test(raw) || !(0, import_well_formed_unicode.isWellFormedUnicodeString)(raw)) return void 0;
|
|
544
545
|
if (Buffer.byteLength(raw, "utf8") > import_types.REPORTING_CONSUMER_STATUS_ERROR_FIELD_MAX_BYTES) return void 0;
|
|
545
546
|
const segment = raw.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
546
547
|
const next = `${pointer}/${segment}`;
|