@adcp/sdk 17.0.0-beta.21 → 17.0.0-beta.22
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/README.md +26 -2
- package/dist/lib/client/core.d.mts +4 -0
- package/dist/lib/client/core.d.ts +4 -0
- package/dist/lib/client/core.js +13 -0
- package/dist/lib/client/core.mjs +12 -0
- package/dist/lib/conformance/property-lists.d.mts +1 -1
- package/dist/lib/conformance/property-lists.d.ts +1 -1
- package/dist/lib/conformance/property-lists.js +1 -1
- package/dist/lib/conformance/property-lists.mjs +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +10 -1
- package/dist/lib/core/SingleAgentClient.d.ts +10 -1
- package/dist/lib/core/SingleAgentClient.js +56 -7
- package/dist/lib/core/SingleAgentClient.mjs +61 -7
- package/dist/lib/core/targeting-helpers.d.mts +123 -0
- package/dist/lib/core/targeting-helpers.d.ts +123 -0
- package/dist/lib/core/targeting-helpers.js +412 -0
- package/dist/lib/core/targeting-helpers.mjs +370 -0
- package/dist/lib/entrypoints/client-account-changes.d.mts +5 -0
- package/dist/lib/entrypoints/client-account-changes.d.ts +5 -0
- package/dist/lib/entrypoints/client-account-changes.js +28 -0
- package/dist/lib/entrypoints/client-account-changes.mjs +4 -0
- package/dist/lib/entrypoints/client-webhook-stores.d.mts +2 -0
- package/dist/lib/entrypoints/client-webhook-stores.d.ts +2 -0
- package/dist/lib/entrypoints/client-webhook-stores.js +37 -0
- package/dist/lib/entrypoints/client-webhook-stores.mjs +16 -0
- package/dist/lib/entrypoints/discovery.d.mts +9 -0
- package/dist/lib/entrypoints/discovery.d.ts +9 -0
- package/dist/lib/entrypoints/discovery.js +72 -0
- package/dist/lib/entrypoints/discovery.mjs +56 -0
- package/dist/lib/entrypoints/errors.d.mts +11 -0
- package/dist/lib/entrypoints/errors.d.ts +11 -0
- package/dist/lib/entrypoints/errors.js +159 -0
- package/dist/lib/entrypoints/errors.mjs +132 -0
- package/dist/lib/entrypoints/media-buy.d.mts +5 -0
- package/dist/lib/entrypoints/media-buy.d.ts +5 -0
- package/dist/lib/entrypoints/media-buy.js +119 -0
- package/dist/lib/entrypoints/media-buy.mjs +100 -0
- package/dist/lib/entrypoints/registry.d.mts +5 -0
- package/dist/lib/entrypoints/registry.d.ts +5 -0
- package/dist/lib/entrypoints/registry.js +61 -0
- package/dist/lib/entrypoints/registry.mjs +40 -0
- package/dist/lib/entrypoints/utils.d.mts +7 -0
- package/dist/lib/entrypoints/utils.d.ts +7 -0
- package/dist/lib/entrypoints/utils.js +100 -0
- package/dist/lib/entrypoints/utils.mjs +72 -0
- package/dist/lib/entrypoints/version.d.mts +3 -0
- package/dist/lib/entrypoints/version.d.ts +3 -0
- package/dist/lib/entrypoints/version.js +57 -0
- package/dist/lib/entrypoints/version.mjs +36 -0
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/media-buy/action-contracts.js +3 -3
- package/dist/lib/media-buy/action-contracts.mjs +1 -1
- package/dist/lib/media-buy/creative-start-policy.d.mts +19 -0
- package/dist/lib/media-buy/creative-start-policy.d.ts +19 -0
- package/dist/lib/media-buy/creative-start-policy.js +59 -0
- package/dist/lib/media-buy/creative-start-policy.mjs +31 -0
- package/dist/lib/media-buy/valid-actions.d.mts +47 -0
- package/dist/lib/media-buy/valid-actions.d.ts +47 -0
- package/dist/lib/media-buy/valid-actions.js +42 -0
- package/dist/lib/media-buy/valid-actions.mjs +18 -0
- package/dist/lib/net/pin-and-bind-fetch.d.mts +121 -0
- package/dist/lib/net/pin-and-bind-fetch.d.ts +121 -0
- package/dist/lib/net/pin-and-bind-fetch.js +209 -0
- package/dist/lib/net/pin-and-bind-fetch.mjs +183 -0
- package/dist/lib/registry/types.generated.d.ts +18 -2
- package/dist/lib/reporting/ledger/index.d.mts +1 -0
- package/dist/lib/reporting/ledger/index.d.ts +1 -0
- package/dist/lib/reporting/ledger/index.js +3 -1
- package/dist/lib/reporting/ledger/index.mjs +1 -0
- package/dist/lib/reporting/ledger/instant.d.mts +5 -0
- package/dist/lib/reporting/ledger/instant.d.ts +5 -0
- package/dist/lib/reporting/ledger/instant.js +10 -0
- package/dist/lib/reporting/ledger/instant.mjs +9 -0
- package/dist/lib/reporting/ledger/issue-events.d.mts +333 -0
- package/dist/lib/reporting/ledger/issue-events.d.ts +333 -0
- package/dist/lib/reporting/ledger/issue-events.js +310 -0
- package/dist/lib/reporting/ledger/issue-events.mjs +282 -0
- package/dist/lib/reporting/service/index.d.mts +36 -1
- package/dist/lib/reporting/service/index.d.ts +36 -1
- package/dist/lib/reporting/service/index.js +51 -1
- package/dist/lib/reporting/service/index.mjs +52 -2
- package/dist/lib/reporting/service/scheduler-support.d.mts +1 -1
- package/dist/lib/reporting/service/scheduler-support.d.ts +1 -1
- package/dist/lib/reporting/service/scheduler-support.js +1 -1
- package/dist/lib/reporting/service/scheduler-support.mjs +1 -1
- package/dist/lib/server/capabilities-release-projection.d.mts +43 -0
- package/dist/lib/server/capabilities-release-projection.d.ts +43 -0
- package/dist/lib/server/capabilities-release-projection.js +128 -0
- package/dist/lib/server/capabilities-release-projection.mjs +112 -0
- package/dist/lib/server/create-adcp-server.d.mts +29 -5
- package/dist/lib/server/create-adcp-server.d.ts +29 -5
- package/dist/lib/server/create-adcp-server.js +95 -22
- package/dist/lib/server/create-adcp-server.mjs +106 -21
- package/dist/lib/server/decisioning/capabilities.d.mts +27 -0
- package/dist/lib/server/decisioning/capabilities.d.ts +27 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js +99 -27
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +103 -27
- package/dist/lib/server/declared-input-schema.d.mts +108 -0
- package/dist/lib/server/declared-input-schema.d.ts +108 -0
- package/dist/lib/server/declared-input-schema.js +167 -0
- package/dist/lib/server/declared-input-schema.mjs +137 -0
- package/dist/lib/server/envelope-allowlist.d.mts +1 -105
- package/dist/lib/server/envelope-allowlist.d.ts +1 -105
- package/dist/lib/server/envelope-allowlist.js +3 -79
- package/dist/lib/server/envelope-allowlist.mjs +1 -71
- package/dist/lib/server/errors.d.mts +1 -186
- package/dist/lib/server/errors.d.ts +1 -186
- package/dist/lib/server/errors.js +3 -98
- package/dist/lib/server/errors.mjs +1 -94
- package/dist/lib/server/index.d.mts +1 -1
- package/dist/lib/server/index.d.ts +1 -1
- package/dist/lib/server/mcp-modern-server.js +21 -4
- package/dist/lib/server/mcp-modern-server.mjs +21 -4
- package/dist/lib/server/media-buy-action-resolver.d.mts +7 -0
- package/dist/lib/server/media-buy-action-resolver.d.ts +7 -0
- package/dist/lib/server/media-buy-action-resolver.js +10 -1
- package/dist/lib/server/media-buy-action-resolver.mjs +10 -1
- package/dist/lib/server/media-buy-helpers.d.mts +1 -47
- package/dist/lib/server/media-buy-helpers.d.ts +1 -47
- package/dist/lib/server/media-buy-helpers.js +3 -23
- package/dist/lib/server/media-buy-helpers.mjs +1 -18
- package/dist/lib/server/pick-safe-details.d.mts +1 -89
- package/dist/lib/server/pick-safe-details.d.ts +1 -89
- package/dist/lib/server/pick-safe-details.js +3 -61
- package/dist/lib/server/pick-safe-details.mjs +1 -56
- package/dist/lib/server/pin-and-bind-fetch.d.mts +1 -121
- package/dist/lib/server/pin-and-bind-fetch.d.ts +1 -121
- package/dist/lib/server/pin-and-bind-fetch.js +3 -190
- package/dist/lib/server/pin-and-bind-fetch.mjs +1 -183
- package/dist/lib/server/targeting-helpers.d.mts +1 -123
- package/dist/lib/server/targeting-helpers.d.ts +1 -123
- package/dist/lib/server/targeting-helpers.js +3 -393
- package/dist/lib/server/targeting-helpers.mjs +1 -370
- package/dist/lib/server/test-controller.js +7 -3
- package/dist/lib/server/test-controller.mjs +7 -3
- package/dist/lib/storage/memory-ledger.js +219 -1
- package/dist/lib/storage/memory-ledger.mjs +223 -1
- package/dist/lib/testing/compliance/storyboard-tracks.js +0 -4
- package/dist/lib/testing/compliance/storyboard-tracks.mjs +0 -4
- package/dist/lib/testing/comply-controller.js +7 -2
- package/dist/lib/testing/comply-controller.mjs +7 -2
- package/dist/lib/testing/storyboard/request-signing/grader.d.mts +21 -0
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +21 -0
- package/dist/lib/testing/storyboard/request-signing/grader.js +31 -0
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +30 -0
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +1 -1
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +2 -1
- package/dist/lib/testing/storyboard/request-signing/types.d.mts +12 -0
- package/dist/lib/testing/storyboard/request-signing/types.d.ts +12 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +7 -2
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +7 -2
- package/dist/lib/testing/storyboard/runner.js +2 -2
- package/dist/lib/testing/storyboard/runner.mjs +2 -2
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/utils/adcp-error-response.d.mts +196 -0
- package/dist/lib/utils/adcp-error-response.d.ts +196 -0
- package/dist/lib/utils/adcp-error-response.js +118 -0
- package/dist/lib/utils/adcp-error-response.mjs +95 -0
- package/dist/lib/utils/buyer-retry-policy.js +2 -2
- package/dist/lib/utils/buyer-retry-policy.mjs +1 -1
- package/dist/lib/utils/capabilities.d.mts +6 -0
- package/dist/lib/utils/capabilities.d.ts +6 -0
- package/dist/lib/utils/capabilities.js +6 -2
- package/dist/lib/utils/capabilities.mjs +6 -2
- package/dist/lib/utils/envelope-allowlist.d.mts +105 -0
- package/dist/lib/utils/envelope-allowlist.d.ts +105 -0
- package/dist/lib/utils/envelope-allowlist.js +98 -0
- package/dist/lib/utils/envelope-allowlist.mjs +71 -0
- package/dist/lib/utils/pick-safe-details.d.mts +89 -0
- package/dist/lib/utils/pick-safe-details.d.ts +89 -0
- package/dist/lib/utils/pick-safe-details.js +80 -0
- package/dist/lib/utils/pick-safe-details.mjs +56 -0
- package/dist/lib/v2/projection/augment-response.d.mts +4 -0
- package/dist/lib/v2/projection/augment-response.d.ts +4 -0
- package/dist/lib/v2/projection/creative-delivery.d.mts +20 -3
- package/dist/lib/v2/projection/creative-delivery.d.ts +20 -3
- package/dist/lib/v2/projection/creative-delivery.js +20 -4
- package/dist/lib/v2/projection/creative-delivery.mjs +19 -4
- package/dist/lib/v2/projection/index.d.mts +2 -2
- package/dist/lib/v2/projection/index.d.ts +2 -2
- package/dist/lib/v2/projection/index.js +4 -0
- package/dist/lib/v2/projection/index.mjs +5 -1
- package/dist/lib/v2/projection/legacy-metadata.d.mts +7 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +7 -0
- package/dist/lib/v2/projection/legacy-metadata.js +14 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs +12 -0
- package/dist/lib/v2/projection/legacy-routes.d.mts +11 -0
- package/dist/lib/v2/projection/legacy-routes.d.ts +11 -0
- package/dist/lib/v2/projection/legacy-routes.js +2 -1
- package/dist/lib/v2/projection/legacy-routes.mjs +7 -2
- package/dist/lib/v2/projection/v1-to-v2.d.mts +21 -1
- package/dist/lib/v2/projection/v1-to-v2.d.ts +21 -1
- package/dist/lib/v2/projection/v1-to-v2.js +18 -11
- package/dist/lib/v2/projection/v1-to-v2.mjs +19 -11
- 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/CREATIVE-DELIVERY.md +12 -0
- package/docs/guides/REPORTING-LEDGER.md +121 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +1 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-16-to-17.md +149 -0
- package/docs/migration-reporting-storage-package.md +10 -0
- package/package.json +106 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Agent, fetch as undiciFetch, Request as UndiciRequest } from "undici";
|
|
2
|
+
import { lookup as nativeDnsLookup } from "node:dns";
|
|
3
|
+
import { isIPv6 } from "node:net";
|
|
4
|
+
import { isAlwaysBlocked, isLoopbackIp, isPrivateIp } from "./address-guards.mjs";
|
|
5
|
+
import { enforceSsrfPolicy, enforceSsrfPolicyResolved } from "../substitution/observer/ssrf.mjs";
|
|
6
|
+
const WEBHOOK_SSRF_POLICY = Object.freeze({
|
|
7
|
+
schemes_allowed: Object.freeze(["https"]),
|
|
8
|
+
schemes_denied: Object.freeze(["http", "file", "gopher", "ftp", "ftps", "data", "javascript", "about", "ws", "wss"]),
|
|
9
|
+
hosts_denied_ipv4_cidrs: Object.freeze([
|
|
10
|
+
"0.0.0.0/8",
|
|
11
|
+
"10.0.0.0/8",
|
|
12
|
+
"100.64.0.0/10",
|
|
13
|
+
"127.0.0.0/8",
|
|
14
|
+
"169.254.0.0/16",
|
|
15
|
+
"172.16.0.0/12",
|
|
16
|
+
"192.0.0.0/24",
|
|
17
|
+
"192.168.0.0/16",
|
|
18
|
+
"224.0.0.0/4",
|
|
19
|
+
"240.0.0.0/4"
|
|
20
|
+
]),
|
|
21
|
+
hosts_denied_ipv6_cidrs: Object.freeze([
|
|
22
|
+
"::1/128",
|
|
23
|
+
"::/128",
|
|
24
|
+
"::ffff:0:0/96",
|
|
25
|
+
"64:ff9b::/96",
|
|
26
|
+
"fc00::/7",
|
|
27
|
+
"fe80::/10",
|
|
28
|
+
"ff00::/8"
|
|
29
|
+
]),
|
|
30
|
+
hosts_denied_metadata: Object.freeze([
|
|
31
|
+
"metadata.google.internal",
|
|
32
|
+
"metadata",
|
|
33
|
+
"metadata.packet.net",
|
|
34
|
+
"fd00:ec2::254"
|
|
35
|
+
]),
|
|
36
|
+
host_literal_policy: "allow",
|
|
37
|
+
shared_private_address_policy: "deny"
|
|
38
|
+
});
|
|
39
|
+
const LOOPBACK_OK_WEBHOOK_SSRF_POLICY = Object.freeze({
|
|
40
|
+
schemes_allowed: Object.freeze(["http", "https"]),
|
|
41
|
+
schemes_denied: Object.freeze(["file", "gopher", "ftp", "ftps", "data", "javascript", "about", "ws", "wss"]),
|
|
42
|
+
hosts_denied_ipv4_cidrs: Object.freeze([
|
|
43
|
+
"0.0.0.0/8",
|
|
44
|
+
"10.0.0.0/8",
|
|
45
|
+
"100.64.0.0/10",
|
|
46
|
+
// 127.0.0.0/8 omitted — loopback allowed for tests.
|
|
47
|
+
"169.254.0.0/16",
|
|
48
|
+
"172.16.0.0/12",
|
|
49
|
+
"192.0.0.0/24",
|
|
50
|
+
"192.168.0.0/16",
|
|
51
|
+
"224.0.0.0/4",
|
|
52
|
+
"240.0.0.0/4"
|
|
53
|
+
]),
|
|
54
|
+
hosts_denied_ipv6_cidrs: Object.freeze([
|
|
55
|
+
// ::1/128 and ::/128 omitted — IPv6 loopback allowed for tests.
|
|
56
|
+
"::ffff:0:0/96",
|
|
57
|
+
"64:ff9b::/96",
|
|
58
|
+
"fc00::/7",
|
|
59
|
+
"fe80::/10",
|
|
60
|
+
"ff00::/8"
|
|
61
|
+
]),
|
|
62
|
+
hosts_denied_metadata: Object.freeze([
|
|
63
|
+
"metadata.google.internal",
|
|
64
|
+
"metadata",
|
|
65
|
+
"metadata.packet.net",
|
|
66
|
+
"fd00:ec2::254"
|
|
67
|
+
]),
|
|
68
|
+
host_literal_policy: "allow",
|
|
69
|
+
shared_private_address_policy: "allow_loopback"
|
|
70
|
+
});
|
|
71
|
+
const DEFAULT_LOOKUP_ALL = (hostname, options, callback) => {
|
|
72
|
+
nativeDnsLookup(hostname, { ...options, all: true }, (err, addresses) => {
|
|
73
|
+
callback(err, addresses);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
function createPinAndBindFetch(options = {}) {
|
|
77
|
+
const policy = options.policy ?? WEBHOOK_SSRF_POLICY;
|
|
78
|
+
const lookupImpl = options.lookup ?? DEFAULT_LOOKUP_ALL;
|
|
79
|
+
const guardedLookup = (hostname, opts, callback) => {
|
|
80
|
+
const wantsAll = opts?.all === true;
|
|
81
|
+
lookupImpl(hostname, { ...opts ?? {}, all: true }, (err, addresses) => {
|
|
82
|
+
if (err) {
|
|
83
|
+
callback(err);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (!Array.isArray(addresses) || addresses.length === 0) {
|
|
87
|
+
callback(
|
|
88
|
+
makeSsrfError(`DNS resolution returned no addresses for ${hostname}`, "dns_revalidation:no_addresses")
|
|
89
|
+
);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const url = new URL(`https://${bracketIfV6(hostname)}`);
|
|
93
|
+
const ips = addresses.map((a) => a.address);
|
|
94
|
+
if (ips.some(isAlwaysBlocked)) {
|
|
95
|
+
callback(makeSsrfError(`Host ${hostname} resolves to an always-blocked address`, "always_blocked_address"));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const result = enforceSsrfPolicyResolved(url, ips, policy);
|
|
99
|
+
if (!result.allowed) {
|
|
100
|
+
callback(makeSsrfError(`Host ${hostname} resolves to an address denied by SSRF policy`, result.rule ?? "ssrf"));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (ips.some((ip) => isSharedPrivateAddressDenied(ip, policy))) {
|
|
104
|
+
callback(
|
|
105
|
+
makeSsrfError(
|
|
106
|
+
`Host ${hostname} resolves to a private, non-routable, or reserved address`,
|
|
107
|
+
"shared_private_address"
|
|
108
|
+
)
|
|
109
|
+
);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (wantsAll) {
|
|
113
|
+
callback(null, addresses);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const first = addresses[0];
|
|
117
|
+
callback(null, first.address, first.family);
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
const dispatcher = new Agent({
|
|
121
|
+
...options.agentOptions ?? {},
|
|
122
|
+
connect: {
|
|
123
|
+
...options.agentOptions?.connect ?? {},
|
|
124
|
+
// undici's connect type accepts a lookup with the dns.lookup signature.
|
|
125
|
+
lookup: guardedLookup
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
const wrapped = async (input, init) => {
|
|
129
|
+
const url = resolveRequestUrl(input);
|
|
130
|
+
if (!url) {
|
|
131
|
+
throw makeSsrfError("Unsupported or invalid URL input", "invalid_url");
|
|
132
|
+
}
|
|
133
|
+
const hostname = url.hostname.replace(/^\[|\]$/g, "");
|
|
134
|
+
if (isAlwaysBlocked(hostname)) {
|
|
135
|
+
throw makeSsrfError(`Host ${hostname} is an always-blocked address`, "always_blocked_address");
|
|
136
|
+
}
|
|
137
|
+
const sync = enforceSsrfPolicy(url, policy);
|
|
138
|
+
if (!sync.allowed) {
|
|
139
|
+
throw makeSsrfError(sync.message ?? "SSRF policy denied URL", sync.rule ?? "ssrf");
|
|
140
|
+
}
|
|
141
|
+
if (isSharedPrivateAddressDenied(hostname, policy)) {
|
|
142
|
+
throw makeSsrfError(`Host ${hostname} is a private, non-routable, or reserved address`, "shared_private_address");
|
|
143
|
+
}
|
|
144
|
+
const redirect = init?.redirect === "error" ? "error" : "manual";
|
|
145
|
+
const runtimeInput = input;
|
|
146
|
+
const checkedInput = runtimeInput instanceof globalThis.Request || runtimeInput instanceof UndiciRequest ? new UndiciRequest(url.href, runtimeInput) : url.href;
|
|
147
|
+
return undiciFetch(checkedInput, {
|
|
148
|
+
...init,
|
|
149
|
+
redirect,
|
|
150
|
+
dispatcher
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
return wrapped;
|
|
154
|
+
}
|
|
155
|
+
function isSharedPrivateAddressDenied(address, policy) {
|
|
156
|
+
if (!isPrivateIp(address)) return false;
|
|
157
|
+
if (policy.shared_private_address_policy === "deny") return true;
|
|
158
|
+
if (policy.shared_private_address_policy === "allow_loopback") return !isLoopbackIp(address);
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
function resolveRequestUrl(input) {
|
|
162
|
+
try {
|
|
163
|
+
if (typeof input === "string") return new URL(input);
|
|
164
|
+
if (input instanceof URL) return new URL(input.href);
|
|
165
|
+
if (input instanceof globalThis.Request || input instanceof UndiciRequest) return new URL(input.url);
|
|
166
|
+
} catch {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
function bracketIfV6(host) {
|
|
172
|
+
return isIPv6(host) ? `[${host}]` : host;
|
|
173
|
+
}
|
|
174
|
+
function makeSsrfError(message, rule) {
|
|
175
|
+
const err = new Error(`pin-and-bind: ${rule}: ${message}`);
|
|
176
|
+
err.code = "EADCP_SSRF_BLOCKED";
|
|
177
|
+
return err;
|
|
178
|
+
}
|
|
179
|
+
export {
|
|
180
|
+
LOOPBACK_OK_WEBHOOK_SSRF_POLICY,
|
|
181
|
+
WEBHOOK_SSRF_POLICY,
|
|
182
|
+
createPinAndBindFetch
|
|
183
|
+
};
|
|
@@ -2645,7 +2645,7 @@ export interface components {
|
|
|
2645
2645
|
tracks: {
|
|
2646
2646
|
[key: string]: string;
|
|
2647
2647
|
};
|
|
2648
|
-
/** @description Latest-run per-track summary.
|
|
2648
|
+
/** @description Latest-run per-track summary. A track with has_coverage_gap_skip=true has steps that were not exercised for a setup reason, such as a runner fixture gap (fixture_unavailable) or a missing comply_test_controller. The track may still pass. */
|
|
2649
2649
|
track_details?: {
|
|
2650
2650
|
track: string;
|
|
2651
2651
|
status: string;
|
|
@@ -2653,7 +2653,13 @@ export interface components {
|
|
|
2653
2653
|
passed_count: number;
|
|
2654
2654
|
duration_ms: number;
|
|
2655
2655
|
has_coverage_gap_skip?: boolean;
|
|
2656
|
+
/** @description Skipped steps in this track, counted by skip reason (e.g. fixture_unavailable, missing_test_controller, capability_unsupported). Absent when nothing was skipped. */
|
|
2657
|
+
skipped_by_reason?: {
|
|
2658
|
+
[key: string]: number;
|
|
2659
|
+
};
|
|
2656
2660
|
}[];
|
|
2661
|
+
/** @description True when any track in the latest run has a coverage-gap skip. Reported beside status, not folded into it: a passing run can have incomplete coverage, and storyboards that were not exercised do not count toward verification badges. */
|
|
2662
|
+
coverage_incomplete?: boolean;
|
|
2657
2663
|
streak_days: number;
|
|
2658
2664
|
last_checked_at: string | null;
|
|
2659
2665
|
headline: string | null;
|
|
@@ -4233,7 +4239,7 @@ export interface components {
|
|
|
4233
4239
|
tracks?: {
|
|
4234
4240
|
[key: string]: string;
|
|
4235
4241
|
};
|
|
4236
|
-
/** @description Latest-run per-track summary.
|
|
4242
|
+
/** @description Latest-run per-track summary. A track with has_coverage_gap_skip=true has steps that were not exercised for a setup reason, such as a runner fixture gap (fixture_unavailable) or a missing comply_test_controller. The track may still pass. */
|
|
4237
4243
|
track_details?: {
|
|
4238
4244
|
track: string;
|
|
4239
4245
|
status: string;
|
|
@@ -4241,7 +4247,13 @@ export interface components {
|
|
|
4241
4247
|
passed_count: number;
|
|
4242
4248
|
duration_ms: number;
|
|
4243
4249
|
has_coverage_gap_skip?: boolean;
|
|
4250
|
+
/** @description Skipped steps in this track, counted by skip reason (e.g. fixture_unavailable, missing_test_controller, capability_unsupported). Absent when nothing was skipped. */
|
|
4251
|
+
skipped_by_reason?: {
|
|
4252
|
+
[key: string]: number;
|
|
4253
|
+
};
|
|
4244
4254
|
}[];
|
|
4255
|
+
/** @description True when any track in the latest run has a coverage-gap skip. Reported beside status, not folded into it: a passing run can have incomplete coverage, and storyboards that were not exercised do not count toward verification badges. */
|
|
4256
|
+
coverage_incomplete?: boolean;
|
|
4245
4257
|
streak_days?: number;
|
|
4246
4258
|
last_checked_at?: string | null;
|
|
4247
4259
|
last_passed_at?: string | null;
|
|
@@ -4623,6 +4635,8 @@ export interface components {
|
|
|
4623
4635
|
relevant_bundle_ids: string[];
|
|
4624
4636
|
failing_bundle_count: number;
|
|
4625
4637
|
incomplete_bundle_count: number;
|
|
4638
|
+
/** @description Universal bundles left partial only because the agent advertises none of the tools for a surface it does not declare. They do not count as incomplete. */
|
|
4639
|
+
not_applicable_universal_bundle_ids?: string[];
|
|
4626
4640
|
relevant_failure_count: number;
|
|
4627
4641
|
missing_universal_bundle: boolean;
|
|
4628
4642
|
missing_protocol_bundle: boolean;
|
|
@@ -4683,6 +4697,8 @@ export interface components {
|
|
|
4683
4697
|
tracks_skipped: number;
|
|
4684
4698
|
tracks_partial: number;
|
|
4685
4699
|
tracks_json?: unknown;
|
|
4700
|
+
/** @description True when any track in this run has a coverage-gap skip (tracks_json[].has_coverage_gap_skip). */
|
|
4701
|
+
coverage_incomplete?: boolean;
|
|
4686
4702
|
total_duration_ms: number | null;
|
|
4687
4703
|
triggered_by: string;
|
|
4688
4704
|
tested_at: string;
|
|
@@ -27,6 +27,7 @@ export * from './row-encoding.mjs';
|
|
|
27
27
|
export * from './row-storage-errors.mjs';
|
|
28
28
|
export * from './receipts.mjs';
|
|
29
29
|
export * from './offering-validation.mjs';
|
|
30
|
+
export * from './issue-events.mjs';
|
|
30
31
|
export { compareReportingInstants } from './instant.mjs';
|
|
31
32
|
export { isFrozenCalendarRulesMismatch, reportingPeriodDate, reportingPeriodSchedule } from './schedule.mjs';
|
|
32
33
|
export { isReportingAdjustmentReceiptEvidence, isReportingReceiptEvidence, isReportingVerificationEvidence, } from '../evidence.mjs';
|
|
@@ -27,6 +27,7 @@ export * from './row-encoding';
|
|
|
27
27
|
export * from './row-storage-errors';
|
|
28
28
|
export * from './receipts';
|
|
29
29
|
export * from './offering-validation';
|
|
30
|
+
export * from './issue-events';
|
|
30
31
|
export { compareReportingInstants } from './instant';
|
|
31
32
|
export { isFrozenCalendarRulesMismatch, reportingPeriodDate, reportingPeriodSchedule } from './schedule';
|
|
32
33
|
export { isReportingAdjustmentReceiptEvidence, isReportingReceiptEvidence, isReportingVerificationEvidence, } from '../evidence';
|
|
@@ -41,6 +41,7 @@ __reExport(ledger_exports, require('./row-encoding.js'), module.exports);
|
|
|
41
41
|
__reExport(ledger_exports, require('./row-storage-errors.js'), module.exports);
|
|
42
42
|
__reExport(ledger_exports, require('./receipts.js'), module.exports);
|
|
43
43
|
__reExport(ledger_exports, require('./offering-validation.js'), module.exports);
|
|
44
|
+
__reExport(ledger_exports, require('./issue-events.js'), module.exports);
|
|
44
45
|
var import_instant = require('./instant.js');
|
|
45
46
|
var import_schedule = require('./schedule.js');
|
|
46
47
|
var import_evidence = require('../evidence.js');
|
|
@@ -66,5 +67,6 @@ var import_well_formed_unicode = require('../../utils/well-formed-unicode.js');
|
|
|
66
67
|
...require('./row-encoding.js'),
|
|
67
68
|
...require('./row-storage-errors.js'),
|
|
68
69
|
...require('./receipts.js'),
|
|
69
|
-
...require('./offering-validation.js')
|
|
70
|
+
...require('./offering-validation.js'),
|
|
71
|
+
...require('./issue-events.js')
|
|
70
72
|
});
|
|
@@ -10,6 +10,7 @@ export * from "./row-encoding.mjs";
|
|
|
10
10
|
export * from "./row-storage-errors.mjs";
|
|
11
11
|
export * from "./receipts.mjs";
|
|
12
12
|
export * from "./offering-validation.mjs";
|
|
13
|
+
export * from "./issue-events.mjs";
|
|
13
14
|
import { compareReportingInstants } from "./instant.mjs";
|
|
14
15
|
import { isFrozenCalendarRulesMismatch, reportingPeriodDate, reportingPeriodSchedule } from "./schedule.mjs";
|
|
15
16
|
import {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export declare function compareReportingInstants(left: string, right: string): number;
|
|
2
2
|
export declare function canonicalReportingInstant(value: string): string;
|
|
3
3
|
export declare function compareReportingInstantToOffset(value: string, base: string, offsetMilliseconds: number): number;
|
|
4
|
+
/**
|
|
5
|
+
* `base` plus `offsetMilliseconds`, keeping every fractional digit of `base`. Going through `Date` would floor a
|
|
6
|
+
* sub-millisecond instant and land the result before the exact boundary.
|
|
7
|
+
*/
|
|
8
|
+
export declare function addReportingInstantOffset(base: string, offsetMilliseconds: number): string;
|
|
4
9
|
export declare function reportingInstantHasDuration(start: string, end: string, durationMilliseconds: number): boolean;
|
|
5
10
|
export declare function reportingPeriodOrdinal(start: string, anchor: string, durationMilliseconds: number): bigint | null;
|
|
6
11
|
export declare function reportingDurationCeilOrdinal(anchor: string, effectiveFrom: string, durationMilliseconds: number): bigint;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export declare function compareReportingInstants(left: string, right: string): number;
|
|
2
2
|
export declare function canonicalReportingInstant(value: string): string;
|
|
3
3
|
export declare function compareReportingInstantToOffset(value: string, base: string, offsetMilliseconds: number): number;
|
|
4
|
+
/**
|
|
5
|
+
* `base` plus `offsetMilliseconds`, keeping every fractional digit of `base`. Going through `Date` would floor a
|
|
6
|
+
* sub-millisecond instant and land the result before the exact boundary.
|
|
7
|
+
*/
|
|
8
|
+
export declare function addReportingInstantOffset(base: string, offsetMilliseconds: number): string;
|
|
4
9
|
export declare function reportingInstantHasDuration(start: string, end: string, durationMilliseconds: number): boolean;
|
|
5
10
|
export declare function reportingPeriodOrdinal(start: string, anchor: string, durationMilliseconds: number): bigint | null;
|
|
6
11
|
export declare function reportingDurationCeilOrdinal(anchor: string, effectiveFrom: string, durationMilliseconds: number): bigint;
|
|
@@ -18,6 +18,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var instant_exports = {};
|
|
20
20
|
__export(instant_exports, {
|
|
21
|
+
addReportingInstantOffset: () => addReportingInstantOffset,
|
|
21
22
|
canonicalReportingInstant: () => canonicalReportingInstant,
|
|
22
23
|
compareReportingInstantToOffset: () => compareReportingInstantToOffset,
|
|
23
24
|
compareReportingInstants: () => compareReportingInstants,
|
|
@@ -72,6 +73,14 @@ function compareReportingInstantToOffset(value, base, offsetMilliseconds) {
|
|
|
72
73
|
const offset = durationUnits(offsetMilliseconds, delta.scale);
|
|
73
74
|
return delta.units < offset ? -1 : delta.units > offset ? 1 : 0;
|
|
74
75
|
}
|
|
76
|
+
function addReportingInstantOffset(base, offsetMilliseconds) {
|
|
77
|
+
const parsed = parseReportingInstant(base);
|
|
78
|
+
const scale = Math.max(3, parsed.fraction.length);
|
|
79
|
+
const units = scaledValue(parsed, scale) + durationUnits(offsetMilliseconds, scale);
|
|
80
|
+
const unit = 10n ** BigInt(scale);
|
|
81
|
+
const wholeSecond = new Date(Number(units / unit) * 1e3).toISOString().replace(".000Z", "");
|
|
82
|
+
return `${wholeSecond}.${(units % unit).toString().padStart(scale, "0")}Z`;
|
|
83
|
+
}
|
|
75
84
|
function reportingInstantHasDuration(start, end, durationMilliseconds) {
|
|
76
85
|
const delta = difference(end, start);
|
|
77
86
|
return delta.units === durationUnits(durationMilliseconds, delta.scale);
|
|
@@ -90,6 +99,7 @@ function reportingDurationCeilOrdinal(anchor, effectiveFrom, durationMillisecond
|
|
|
90
99
|
}
|
|
91
100
|
// Annotate the CommonJS export names for ESM import in node:
|
|
92
101
|
0 && (module.exports = {
|
|
102
|
+
addReportingInstantOffset,
|
|
93
103
|
canonicalReportingInstant,
|
|
94
104
|
compareReportingInstantToOffset,
|
|
95
105
|
compareReportingInstants,
|
|
@@ -44,6 +44,14 @@ function compareReportingInstantToOffset(value, base, offsetMilliseconds) {
|
|
|
44
44
|
const offset = durationUnits(offsetMilliseconds, delta.scale);
|
|
45
45
|
return delta.units < offset ? -1 : delta.units > offset ? 1 : 0;
|
|
46
46
|
}
|
|
47
|
+
function addReportingInstantOffset(base, offsetMilliseconds) {
|
|
48
|
+
const parsed = parseReportingInstant(base);
|
|
49
|
+
const scale = Math.max(3, parsed.fraction.length);
|
|
50
|
+
const units = scaledValue(parsed, scale) + durationUnits(offsetMilliseconds, scale);
|
|
51
|
+
const unit = 10n ** BigInt(scale);
|
|
52
|
+
const wholeSecond = new Date(Number(units / unit) * 1e3).toISOString().replace(".000Z", "");
|
|
53
|
+
return `${wholeSecond}.${(units % unit).toString().padStart(scale, "0")}Z`;
|
|
54
|
+
}
|
|
47
55
|
function reportingInstantHasDuration(start, end, durationMilliseconds) {
|
|
48
56
|
const delta = difference(end, start);
|
|
49
57
|
return delta.units === durationUnits(durationMilliseconds, delta.scale);
|
|
@@ -61,6 +69,7 @@ function reportingDurationCeilOrdinal(anchor, effectiveFrom, durationMillisecond
|
|
|
61
69
|
return (delta.units + duration - 1n) / duration;
|
|
62
70
|
}
|
|
63
71
|
export {
|
|
72
|
+
addReportingInstantOffset,
|
|
64
73
|
canonicalReportingInstant,
|
|
65
74
|
compareReportingInstantToOffset,
|
|
66
75
|
compareReportingInstants,
|