@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,370 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { lookup as dnsLookup } from "node:dns/promises";
|
|
3
|
+
import { callMCPTool } from "../protocols/mcp.mjs";
|
|
4
|
+
import { isAlwaysBlocked, isPrivateIp } from "../net/index.mjs";
|
|
5
|
+
import { isInternalProbesAllowed } from "../utils/probe-policy.mjs";
|
|
6
|
+
import { createPinAndBindFetch } from "../net/pin-and-bind-fetch.mjs";
|
|
7
|
+
import { unwrapProtocolResponse } from "../utils/response-unwrapper.mjs";
|
|
8
|
+
const DEFAULT_RESOLVE_LIST_PAGE_SIZE = 1e3;
|
|
9
|
+
class MemoryResolvedListCache {
|
|
10
|
+
entries = /* @__PURE__ */ new Map();
|
|
11
|
+
get(key, nowMs = Date.now()) {
|
|
12
|
+
const entry = this.entries.get(key);
|
|
13
|
+
if (!entry) return void 0;
|
|
14
|
+
if (entry.expiresAtMs <= nowMs) {
|
|
15
|
+
this.entries.delete(key);
|
|
16
|
+
return void 0;
|
|
17
|
+
}
|
|
18
|
+
return cloneResolvedList(entry.value);
|
|
19
|
+
}
|
|
20
|
+
set(key, entry) {
|
|
21
|
+
this.entries.set(key, {
|
|
22
|
+
expiresAtMs: entry.expiresAtMs,
|
|
23
|
+
value: cloneResolvedList(entry.value)
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
delete(key) {
|
|
27
|
+
return this.entries.delete(key);
|
|
28
|
+
}
|
|
29
|
+
clear() {
|
|
30
|
+
this.entries.clear();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function createResolvedListCache() {
|
|
34
|
+
return new MemoryResolvedListCache();
|
|
35
|
+
}
|
|
36
|
+
const defaultResolvedListCache = createResolvedListCache();
|
|
37
|
+
function clearDefaultResolvedListCache() {
|
|
38
|
+
defaultResolvedListCache.clear();
|
|
39
|
+
}
|
|
40
|
+
const defaultResolveListFetchBase = createPinAndBindFetch();
|
|
41
|
+
const defaultResolveListFetch = (input, init) => defaultResolveListFetchBase(input, { ...init, redirect: "manual" });
|
|
42
|
+
const defaultResolveListCallTool = (agentUrl, toolName, args, authToken) => callMCPTool(agentUrl, toolName, args, authToken, [], void 0, void 0, defaultResolveListFetch);
|
|
43
|
+
function resolvedListPayload(result, kind) {
|
|
44
|
+
if (!result || typeof result !== "object" || Array.isArray(result)) return result;
|
|
45
|
+
const envelope = result;
|
|
46
|
+
const isMcp = "structuredContent" in envelope || "content" in envelope || "isError" in envelope;
|
|
47
|
+
let payload;
|
|
48
|
+
try {
|
|
49
|
+
payload = isMcp ? unwrapProtocolResponse(envelope, void 0, "mcp") : envelope;
|
|
50
|
+
} catch (cause) {
|
|
51
|
+
throw new Error(`${kind}_list_invalid_response`, { cause });
|
|
52
|
+
}
|
|
53
|
+
const data = payload && typeof payload === "object" ? payload : void 0;
|
|
54
|
+
if (envelope.isError === true || data?.adcp_error !== void 0) {
|
|
55
|
+
throw Object.assign(new Error(`${kind}_list_invalid_response`, { cause: data?.adcp_error }), {
|
|
56
|
+
adcp_error: data?.adcp_error
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return payload;
|
|
60
|
+
}
|
|
61
|
+
async function resolvePropertyList(ref, options = {}) {
|
|
62
|
+
const structurallyNormalizedRef = await normalizePropertyListReference(ref, { resolveDns: false });
|
|
63
|
+
const cache = cacheForOptions(options);
|
|
64
|
+
const nowMs = nowMsForOptions(options);
|
|
65
|
+
const cacheKey = resolvedListCacheKey("property", structurallyNormalizedRef, options);
|
|
66
|
+
const cached = cacheKey && !options.strictResponseValidation ? cache?.get(cacheKey, nowMs) : void 0;
|
|
67
|
+
if (cached) return cached;
|
|
68
|
+
const normalizedRef = options.callTool ? structurallyNormalizedRef : await normalizePropertyListReference(structurallyNormalizedRef, { resolveDns: false });
|
|
69
|
+
const result = await fetchResolvedPropertyList(normalizedRef, options);
|
|
70
|
+
cacheResolvedList(cache, cacheKey, result, nowMs);
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
async function fetchResolvedPropertyList(ref, options) {
|
|
74
|
+
const callTool = options.callTool ?? defaultResolveListCallTool;
|
|
75
|
+
const identifiers = [];
|
|
76
|
+
let listId;
|
|
77
|
+
let cacheValidUntil;
|
|
78
|
+
let missingCacheValidUntil = false;
|
|
79
|
+
let cursor;
|
|
80
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
81
|
+
for (let pageIndex = 0; pageIndex < maxPagesForOptions(options); pageIndex += 1) {
|
|
82
|
+
const args = buildResolveListArgs(ref.list_id, pageSizeForOptions(options), cursor);
|
|
83
|
+
const raw = resolvedListPayload(
|
|
84
|
+
await callTool(ref.agent_url, "get_property_list", args, ref.auth_token),
|
|
85
|
+
"property"
|
|
86
|
+
);
|
|
87
|
+
if (!raw || typeof raw !== "object" || !("list" in raw)) {
|
|
88
|
+
throw new Error("property_list_invalid_response");
|
|
89
|
+
}
|
|
90
|
+
const response = raw;
|
|
91
|
+
if (response.status !== void 0 && response.status !== "completed" || raw.errors !== void 0 && (!Array.isArray(raw.errors) || raw.errors.some((error) => !error || typeof error !== "object" || error.severity !== "warning")) || raw.adcp_error !== void 0 || !Array.isArray(response.identifiers)) {
|
|
92
|
+
throw new Error("property_list_invalid_response");
|
|
93
|
+
}
|
|
94
|
+
if (options.strictResponseValidation) {
|
|
95
|
+
const { GetPropertyListResponseSchema } = await import("../types/schemas.generated.mjs");
|
|
96
|
+
if (!GetPropertyListResponseSchema.safeParse(raw).success || response.status !== "completed" || response.identifiers.length > pageSizeForOptions(options)) {
|
|
97
|
+
throw new Error("property_list_invalid_response");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (!response.list || response.list.list_id !== ref.list_id || response.identifiers !== void 0 && (!Array.isArray(response.identifiers) || response.identifiers.some(
|
|
101
|
+
(identifier) => !identifier || typeof identifier !== "object" || typeof identifier.type !== "string" || typeof identifier.value !== "string"
|
|
102
|
+
))) {
|
|
103
|
+
throw new Error("property_list_invalid_response");
|
|
104
|
+
}
|
|
105
|
+
listId = response.list.list_id;
|
|
106
|
+
identifiers.push(...response.identifiers ?? []);
|
|
107
|
+
if (typeof response.cache_valid_until === "string") {
|
|
108
|
+
cacheValidUntil = earliestIsoTimestamp(cacheValidUntil, response.cache_valid_until);
|
|
109
|
+
} else {
|
|
110
|
+
missingCacheValidUntil = true;
|
|
111
|
+
}
|
|
112
|
+
const pagination = readPagination(response.pagination);
|
|
113
|
+
if (pagination.invalid) {
|
|
114
|
+
throw new Error("property_list_invalid_pagination");
|
|
115
|
+
}
|
|
116
|
+
if (!pagination.hasMore) {
|
|
117
|
+
return {
|
|
118
|
+
listId,
|
|
119
|
+
agentUrl: ref.agent_url,
|
|
120
|
+
identifiers,
|
|
121
|
+
cacheValidUntil: missingCacheValidUntil ? void 0 : cacheValidUntil
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
if (!pagination.cursor) {
|
|
125
|
+
throw new Error("property_list_invalid_pagination");
|
|
126
|
+
}
|
|
127
|
+
if (seenCursors.has(pagination.cursor)) throw new Error("property_list_invalid_pagination");
|
|
128
|
+
seenCursors.add(pagination.cursor);
|
|
129
|
+
cursor = pagination.cursor;
|
|
130
|
+
}
|
|
131
|
+
throw new Error("property_list_pagination_limit_exceeded");
|
|
132
|
+
}
|
|
133
|
+
async function resolveCollectionList(ref, options = {}) {
|
|
134
|
+
const structurallyNormalizedRef = await normalizeCollectionListReference(ref, { resolveDns: false });
|
|
135
|
+
const cache = cacheForOptions(options);
|
|
136
|
+
const nowMs = nowMsForOptions(options);
|
|
137
|
+
const cacheKey = resolvedListCacheKey("collection", structurallyNormalizedRef, options);
|
|
138
|
+
const cached = cacheKey && !options.strictResponseValidation ? cache?.get(cacheKey, nowMs) : void 0;
|
|
139
|
+
if (cached) return cached;
|
|
140
|
+
const normalizedRef = options.callTool ? structurallyNormalizedRef : await normalizeCollectionListReference(structurallyNormalizedRef, { resolveDns: false });
|
|
141
|
+
const result = await fetchResolvedCollectionList(normalizedRef, options);
|
|
142
|
+
cacheResolvedList(cache, cacheKey, result, nowMs);
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
async function fetchResolvedCollectionList(ref, options) {
|
|
146
|
+
const callTool = options.callTool ?? defaultResolveListCallTool;
|
|
147
|
+
const collections = [];
|
|
148
|
+
let listId;
|
|
149
|
+
let cacheValidUntil;
|
|
150
|
+
let missingCacheValidUntil = false;
|
|
151
|
+
let cursor;
|
|
152
|
+
for (let pageIndex = 0; pageIndex < maxPagesForOptions(options); pageIndex += 1) {
|
|
153
|
+
const args = buildResolveListArgs(ref.list_id, pageSizeForOptions(options), cursor);
|
|
154
|
+
const raw = resolvedListPayload(
|
|
155
|
+
await callTool(ref.agent_url, "get_collection_list", args, ref.auth_token),
|
|
156
|
+
"collection"
|
|
157
|
+
);
|
|
158
|
+
if (!raw || typeof raw !== "object" || !("list" in raw)) {
|
|
159
|
+
throw new Error("collection_list_invalid_response");
|
|
160
|
+
}
|
|
161
|
+
const response = raw;
|
|
162
|
+
if (response.status !== void 0 && response.status !== "completed" || raw.errors !== void 0 && (!Array.isArray(raw.errors) || raw.errors.some((error) => !error || typeof error !== "object" || error.severity !== "warning")) || !response.list || response.list.list_id !== ref.list_id || !Array.isArray(response.collections) || response.collections.some(
|
|
163
|
+
(collection) => !collection || typeof collection !== "object" || Array.isArray(collection) || ["publisher_domain", "collection_id", "collection_rid", "name"].some(
|
|
164
|
+
(field) => field in collection && typeof collection[field] !== "string"
|
|
165
|
+
) || collection.distribution_ids !== void 0 && (!Array.isArray(collection.distribution_ids) || collection.distribution_ids.some(
|
|
166
|
+
(identifier) => !identifier || typeof identifier !== "object" || typeof identifier.type !== "string" || typeof identifier.value !== "string"
|
|
167
|
+
))
|
|
168
|
+
)) {
|
|
169
|
+
throw new Error("collection_list_invalid_response");
|
|
170
|
+
}
|
|
171
|
+
if (options.strictResponseValidation) {
|
|
172
|
+
const { GetCollectionListResponseSchema } = await import("../types/schemas.generated.mjs");
|
|
173
|
+
if (!GetCollectionListResponseSchema.safeParse(raw).success || response.status !== "completed" || response.collections.length > pageSizeForOptions(options)) {
|
|
174
|
+
throw new Error("collection_list_invalid_response");
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
listId = response.list.list_id;
|
|
178
|
+
collections.push(...response.collections ?? []);
|
|
179
|
+
if (typeof response.cache_valid_until === "string") {
|
|
180
|
+
cacheValidUntil = earliestIsoTimestamp(cacheValidUntil, response.cache_valid_until);
|
|
181
|
+
} else {
|
|
182
|
+
missingCacheValidUntil = true;
|
|
183
|
+
}
|
|
184
|
+
const pagination = readPagination(response.pagination);
|
|
185
|
+
if (pagination.invalid) {
|
|
186
|
+
throw new Error("collection_list_invalid_pagination");
|
|
187
|
+
}
|
|
188
|
+
if (!pagination.hasMore) {
|
|
189
|
+
return {
|
|
190
|
+
listId,
|
|
191
|
+
agentUrl: ref.agent_url,
|
|
192
|
+
collections,
|
|
193
|
+
cacheValidUntil: missingCacheValidUntil ? void 0 : cacheValidUntil
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
if (!pagination.cursor) {
|
|
197
|
+
throw new Error("collection_list_invalid_pagination");
|
|
198
|
+
}
|
|
199
|
+
cursor = pagination.cursor;
|
|
200
|
+
}
|
|
201
|
+
throw new Error("collection_list_pagination_limit_exceeded");
|
|
202
|
+
}
|
|
203
|
+
function resolvedListCacheKey(kind, ref, options = {}) {
|
|
204
|
+
const scope = ref.auth_token ?? options.cacheScopeKey;
|
|
205
|
+
if (!scope) return void 0;
|
|
206
|
+
const material = JSON.stringify({
|
|
207
|
+
kind,
|
|
208
|
+
agent_url: ref.agent_url,
|
|
209
|
+
list_id: ref.list_id,
|
|
210
|
+
scope_sha256: sha256(scope),
|
|
211
|
+
page_size: options.pageSize ?? DEFAULT_RESOLVE_LIST_PAGE_SIZE,
|
|
212
|
+
resolve: true
|
|
213
|
+
});
|
|
214
|
+
return `adcp-resolved-list:${sha256(material)}`;
|
|
215
|
+
}
|
|
216
|
+
async function normalizePropertyListReference(ref, options) {
|
|
217
|
+
return {
|
|
218
|
+
...ref,
|
|
219
|
+
agent_url: await normalizeListAgentUrl(ref.agent_url, options)
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
async function normalizeCollectionListReference(ref, options) {
|
|
223
|
+
return {
|
|
224
|
+
...ref,
|
|
225
|
+
agent_url: await normalizeListAgentUrl(ref.agent_url, options)
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
async function normalizeListAgentUrl(raw, options) {
|
|
229
|
+
let url;
|
|
230
|
+
try {
|
|
231
|
+
url = new URL(raw);
|
|
232
|
+
} catch {
|
|
233
|
+
throw new Error("list_agent_url_invalid");
|
|
234
|
+
}
|
|
235
|
+
if (url.username || url.password || url.search || url.hash) {
|
|
236
|
+
throw new Error("list_agent_url_malformed");
|
|
237
|
+
}
|
|
238
|
+
const allowInternal = isInternalProbesAllowed();
|
|
239
|
+
if (url.protocol !== "https:" && !(allowInternal && url.protocol === "http:")) {
|
|
240
|
+
throw new Error("list_agent_url_insecure");
|
|
241
|
+
}
|
|
242
|
+
const hostname = url.hostname.replace(/^\[|\]$/g, "");
|
|
243
|
+
if (isAlwaysBlocked(hostname)) {
|
|
244
|
+
throw new Error("list_agent_url_always_blocked");
|
|
245
|
+
}
|
|
246
|
+
if (!allowInternal && isPrivateIp(hostname)) {
|
|
247
|
+
throw new Error("list_agent_url_private_address");
|
|
248
|
+
}
|
|
249
|
+
if (options.resolveDns) {
|
|
250
|
+
let addresses;
|
|
251
|
+
try {
|
|
252
|
+
addresses = await dnsLookup(hostname, { all: true });
|
|
253
|
+
} catch {
|
|
254
|
+
throw new Error("list_agent_url_dns_failed");
|
|
255
|
+
}
|
|
256
|
+
if (addresses.length === 0) {
|
|
257
|
+
throw new Error("list_agent_url_dns_empty");
|
|
258
|
+
}
|
|
259
|
+
for (const { address } of addresses) {
|
|
260
|
+
if (isAlwaysBlocked(address)) {
|
|
261
|
+
throw new Error("list_agent_url_always_blocked");
|
|
262
|
+
}
|
|
263
|
+
if (!allowInternal && isPrivateIp(address)) {
|
|
264
|
+
throw new Error("list_agent_url_private_address");
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return url.toString();
|
|
269
|
+
}
|
|
270
|
+
function buildResolveListArgs(listId, pageSize, cursor) {
|
|
271
|
+
const args = {
|
|
272
|
+
list_id: listId,
|
|
273
|
+
resolve: true
|
|
274
|
+
};
|
|
275
|
+
const pagination = {};
|
|
276
|
+
pagination.max_results = pageSize;
|
|
277
|
+
if (cursor) pagination.cursor = cursor;
|
|
278
|
+
if (Object.keys(pagination).length > 0) args.pagination = pagination;
|
|
279
|
+
return args;
|
|
280
|
+
}
|
|
281
|
+
function cacheForOptions(options) {
|
|
282
|
+
if (options.callTool && options.cache === void 0) return void 0;
|
|
283
|
+
return options.cache === false ? void 0 : options.cache ?? defaultResolvedListCache;
|
|
284
|
+
}
|
|
285
|
+
function cacheResolvedList(cache, cacheKey, value, nowMs) {
|
|
286
|
+
if (!cache || !cacheKey || !value.cacheValidUntil) return;
|
|
287
|
+
const expiresAtMs = Date.parse(value.cacheValidUntil);
|
|
288
|
+
if (!Number.isFinite(expiresAtMs) || expiresAtMs <= nowMs) return;
|
|
289
|
+
cache.set(cacheKey, { value, expiresAtMs });
|
|
290
|
+
}
|
|
291
|
+
function nowMsForOptions(options) {
|
|
292
|
+
const now = options.now?.();
|
|
293
|
+
if (now instanceof Date) return now.getTime();
|
|
294
|
+
if (typeof now === "number") return now;
|
|
295
|
+
return Date.now();
|
|
296
|
+
}
|
|
297
|
+
function maxPagesForOptions(options) {
|
|
298
|
+
return options.maxPages ?? 100;
|
|
299
|
+
}
|
|
300
|
+
function pageSizeForOptions(options) {
|
|
301
|
+
return options.pageSize ?? DEFAULT_RESOLVE_LIST_PAGE_SIZE;
|
|
302
|
+
}
|
|
303
|
+
function readPagination(value) {
|
|
304
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return { hasMore: false, invalid: false };
|
|
305
|
+
const pagination = value;
|
|
306
|
+
const cursor = typeof pagination.cursor === "string" && pagination.cursor.length > 0 ? pagination.cursor : void 0;
|
|
307
|
+
const invalid = pagination.has_more !== void 0 && typeof pagination.has_more !== "boolean" || cursor !== void 0 && pagination.has_more !== true;
|
|
308
|
+
return {
|
|
309
|
+
hasMore: pagination.has_more === true,
|
|
310
|
+
cursor,
|
|
311
|
+
invalid
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
function earliestIsoTimestamp(current, next) {
|
|
315
|
+
if (!current) return next;
|
|
316
|
+
const currentMs = Date.parse(current);
|
|
317
|
+
const nextMs = Date.parse(next);
|
|
318
|
+
if (!Number.isFinite(currentMs)) return next;
|
|
319
|
+
if (!Number.isFinite(nextMs)) return current;
|
|
320
|
+
return nextMs < currentMs ? next : current;
|
|
321
|
+
}
|
|
322
|
+
function cloneResolvedList(value) {
|
|
323
|
+
return structuredClone(value);
|
|
324
|
+
}
|
|
325
|
+
function sha256(value) {
|
|
326
|
+
return createHash("sha256").update(value, "utf8").digest("hex");
|
|
327
|
+
}
|
|
328
|
+
function matchesPropertyList(property, list) {
|
|
329
|
+
return list.identifiers.some((entry) => identifiersMatch(property, entry));
|
|
330
|
+
}
|
|
331
|
+
function identifiersMatch(property, entry) {
|
|
332
|
+
if (property.type !== entry.type) return false;
|
|
333
|
+
if (property.type !== "domain") {
|
|
334
|
+
return property.value === entry.value;
|
|
335
|
+
}
|
|
336
|
+
return domainMatches(property.value, entry.value);
|
|
337
|
+
}
|
|
338
|
+
function domainMatches(candidate, pattern) {
|
|
339
|
+
const c = candidate.toLowerCase();
|
|
340
|
+
const p = pattern.toLowerCase();
|
|
341
|
+
if (c === p) return true;
|
|
342
|
+
if (p.startsWith("*.")) {
|
|
343
|
+
const suffix = p.slice(1);
|
|
344
|
+
return c.endsWith(suffix) && c !== p.slice(2);
|
|
345
|
+
}
|
|
346
|
+
return c === `www.${p}` || c === `m.${p}`;
|
|
347
|
+
}
|
|
348
|
+
function matchesCollectionList(collection, list) {
|
|
349
|
+
return list.collections.some((entry) => collectionsMatch(collection, entry));
|
|
350
|
+
}
|
|
351
|
+
function collectionsMatch(a, b) {
|
|
352
|
+
if (a.collection_rid && b.collection_rid && a.collection_rid === b.collection_rid) {
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
if (!a.distribution_ids?.length || !b.distribution_ids?.length) return false;
|
|
356
|
+
return a.distribution_ids.some(
|
|
357
|
+
(aid) => b.distribution_ids.some((bid) => aid.type === bid.type && aid.value === bid.value)
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
export {
|
|
361
|
+
DEFAULT_RESOLVE_LIST_PAGE_SIZE,
|
|
362
|
+
clearDefaultResolvedListCache,
|
|
363
|
+
createResolvedListCache,
|
|
364
|
+
defaultResolvedListCache,
|
|
365
|
+
matchesCollectionList,
|
|
366
|
+
matchesPropertyList,
|
|
367
|
+
resolveCollectionList,
|
|
368
|
+
resolvePropertyList,
|
|
369
|
+
resolvedListCacheKey
|
|
370
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from '../client/account-change-cursor.mjs';
|
|
2
|
+
export * from '../client/account-changes.mjs';
|
|
3
|
+
export * from '../client/account-change-subscription.mjs';
|
|
4
|
+
export * from '../notifications/account-change-recorded.mjs';
|
|
5
|
+
export type { AccountChangeFeedCapabilities } from '../utils/capabilities.mjs';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from '../client/account-change-cursor';
|
|
2
|
+
export * from '../client/account-changes';
|
|
3
|
+
export * from '../client/account-change-subscription';
|
|
4
|
+
export * from '../notifications/account-change-recorded';
|
|
5
|
+
export type { AccountChangeFeedCapabilities } from '../utils/capabilities';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var client_account_changes_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(client_account_changes_exports);
|
|
18
|
+
__reExport(client_account_changes_exports, require('../client/account-change-cursor.js'), module.exports);
|
|
19
|
+
__reExport(client_account_changes_exports, require('../client/account-changes.js'), module.exports);
|
|
20
|
+
__reExport(client_account_changes_exports, require('../client/account-change-subscription.js'), module.exports);
|
|
21
|
+
__reExport(client_account_changes_exports, require('../notifications/account-change-recorded.js'), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require('../client/account-change-cursor.js'),
|
|
25
|
+
...require('../client/account-changes.js'),
|
|
26
|
+
...require('../client/account-change-subscription.js'),
|
|
27
|
+
...require('../notifications/account-change-recorded.js')
|
|
28
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { pgWebhookRegistrationStore, getWebhookRegistrationMigration, WEBHOOK_REGISTRATION_MIGRATION, cleanupExpiredWebhookRegistrations, type PgWebhookRegistrationStoreOptions, type CleanupExpiredWebhookRegistrationsOptions, } from '../core/postgres-webhook-registration-store.mjs';
|
|
2
|
+
export { redisWebhookRegistrationStore, type RedisWebhookRegistrationStoreOptions, } from '../core/redis-webhook-registration-store.mjs';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { pgWebhookRegistrationStore, getWebhookRegistrationMigration, WEBHOOK_REGISTRATION_MIGRATION, cleanupExpiredWebhookRegistrations, type PgWebhookRegistrationStoreOptions, type CleanupExpiredWebhookRegistrationsOptions, } from '../core/postgres-webhook-registration-store';
|
|
2
|
+
export { redisWebhookRegistrationStore, type RedisWebhookRegistrationStoreOptions, } from '../core/redis-webhook-registration-store';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var client_webhook_stores_exports = {};
|
|
20
|
+
__export(client_webhook_stores_exports, {
|
|
21
|
+
WEBHOOK_REGISTRATION_MIGRATION: () => import_postgres_webhook_registration_store.WEBHOOK_REGISTRATION_MIGRATION,
|
|
22
|
+
cleanupExpiredWebhookRegistrations: () => import_postgres_webhook_registration_store.cleanupExpiredWebhookRegistrations,
|
|
23
|
+
getWebhookRegistrationMigration: () => import_postgres_webhook_registration_store.getWebhookRegistrationMigration,
|
|
24
|
+
pgWebhookRegistrationStore: () => import_postgres_webhook_registration_store.pgWebhookRegistrationStore,
|
|
25
|
+
redisWebhookRegistrationStore: () => import_redis_webhook_registration_store.redisWebhookRegistrationStore
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(client_webhook_stores_exports);
|
|
28
|
+
var import_postgres_webhook_registration_store = require('../core/postgres-webhook-registration-store.js');
|
|
29
|
+
var import_redis_webhook_registration_store = require('../core/redis-webhook-registration-store.js');
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
WEBHOOK_REGISTRATION_MIGRATION,
|
|
33
|
+
cleanupExpiredWebhookRegistrations,
|
|
34
|
+
getWebhookRegistrationMigration,
|
|
35
|
+
pgWebhookRegistrationStore,
|
|
36
|
+
redisWebhookRegistrationStore
|
|
37
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pgWebhookRegistrationStore,
|
|
3
|
+
getWebhookRegistrationMigration,
|
|
4
|
+
WEBHOOK_REGISTRATION_MIGRATION,
|
|
5
|
+
cleanupExpiredWebhookRegistrations
|
|
6
|
+
} from "../core/postgres-webhook-registration-store.mjs";
|
|
7
|
+
import {
|
|
8
|
+
redisWebhookRegistrationStore
|
|
9
|
+
} from "../core/redis-webhook-registration-store.mjs";
|
|
10
|
+
export {
|
|
11
|
+
WEBHOOK_REGISTRATION_MIGRATION,
|
|
12
|
+
cleanupExpiredWebhookRegistrations,
|
|
13
|
+
getWebhookRegistrationMigration,
|
|
14
|
+
pgWebhookRegistrationStore,
|
|
15
|
+
redisWebhookRegistrationStore
|
|
16
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { PropertyIndex, getPropertyIndex, resetPropertyIndex, type PropertyMatch, type AgentAuthorization, } from '../discovery/property-index.mjs';
|
|
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
|
+
export type { Property, PropertyIdentifier, PropertyIdentifierType, PropertyType, AdAgentsJson, AuthorizedAgent, AuthorizationType, PublisherPropertySelector as AdAgentsPublisherPropertySelector, SinglePublisherPropertySelector, CompactPublisherPropertySelector, } from '../discovery/types.mjs';
|
|
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';
|
|
6
|
+
export { resolveInlinePublisherProperties, resolveSingularInline, detectInlineFederatedDivergence, type InlineResolutionResult, type InlineFederatedDivergence, } from '../discovery/inline-publisher-properties.mjs';
|
|
7
|
+
export { fetchAgentAuthorizationsFromDirectory, type AgentAuthorizationsIterator, type FetchAgentAuthorizationsOptions, type DirectoryLookupPage, type DirectoryPublisherEntry, type DirectoryDiscoveryMethod, type DirectoryPublisherStatus, } from '../discovery/agent-directory.mjs';
|
|
8
|
+
export { validateAdAgents, parseManagerDomain, type DiscoveryMethod, type AdAgentsValidationResult, type ValidateAdAgentsOptions, } from '../discovery/validate-adagents.mjs';
|
|
9
|
+
export type { AuthorizationCollectionSelector, ProductCollectionSelector, CollectionDistribution, DiscoveryCollection, } from '../discovery/types.mjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { PropertyIndex, getPropertyIndex, resetPropertyIndex, type PropertyMatch, type AgentAuthorization, } from '../discovery/property-index';
|
|
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
|
+
export type { Property, PropertyIdentifier, PropertyIdentifierType, PropertyType, AdAgentsJson, AuthorizedAgent, AuthorizationType, PublisherPropertySelector as AdAgentsPublisherPropertySelector, SinglePublisherPropertySelector, CompactPublisherPropertySelector, } from '../discovery/types';
|
|
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';
|
|
6
|
+
export { resolveInlinePublisherProperties, resolveSingularInline, detectInlineFederatedDivergence, type InlineResolutionResult, type InlineFederatedDivergence, } from '../discovery/inline-publisher-properties';
|
|
7
|
+
export { fetchAgentAuthorizationsFromDirectory, type AgentAuthorizationsIterator, type FetchAgentAuthorizationsOptions, type DirectoryLookupPage, type DirectoryPublisherEntry, type DirectoryDiscoveryMethod, type DirectoryPublisherStatus, } from '../discovery/agent-directory';
|
|
8
|
+
export { validateAdAgents, parseManagerDomain, type DiscoveryMethod, type AdAgentsValidationResult, type ValidateAdAgentsOptions, } from '../discovery/validate-adagents';
|
|
9
|
+
export type { AuthorizationCollectionSelector, ProductCollectionSelector, CollectionDistribution, DiscoveryCollection, } from '../discovery/types';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var discovery_exports = {};
|
|
20
|
+
__export(discovery_exports, {
|
|
21
|
+
NetworkConsistencyChecker: () => import_network_consistency_checker.NetworkConsistencyChecker,
|
|
22
|
+
PropertyIndex: () => import_property_index.PropertyIndex,
|
|
23
|
+
PublisherPropertySelectorParseError: () => import_publisher_property_selector.PublisherPropertySelectorParseError,
|
|
24
|
+
canonicalizeAgentUrl: () => import_resolve_agent_properties.canonicalizeAgentUrl,
|
|
25
|
+
detectInlineFederatedDivergence: () => import_inline_publisher_properties.detectInlineFederatedDivergence,
|
|
26
|
+
expandPublisherPropertySelector: () => import_publisher_property_selector.expandPublisherPropertySelector,
|
|
27
|
+
expandPublisherPropertySelectors: () => import_publisher_property_selector.expandPublisherPropertySelectors,
|
|
28
|
+
fetchAgentAuthorizationsFromDirectory: () => import_agent_directory.fetchAgentAuthorizationsFromDirectory,
|
|
29
|
+
getAllProperties: () => import_resolve_agent_properties.getAllProperties,
|
|
30
|
+
getPropertyIndex: () => import_property_index.getPropertyIndex,
|
|
31
|
+
isCompactPublisherPropertySelector: () => import_publisher_property_selector.isCompactPublisherPropertySelector,
|
|
32
|
+
listAgentPropertyMap: () => import_resolve_agent_properties.listAgentPropertyMap,
|
|
33
|
+
parseManagerDomain: () => import_validate_adagents.parseManagerDomain,
|
|
34
|
+
parsePublisherPropertySelector: () => import_publisher_property_selector.parsePublisherPropertySelector,
|
|
35
|
+
publisherDomainsCoveredBySelectors: () => import_publisher_property_selector.publisherDomainsCoveredBySelectors,
|
|
36
|
+
resetPropertyIndex: () => import_property_index.resetPropertyIndex,
|
|
37
|
+
resolveAgentProperties: () => import_resolve_agent_properties.resolveAgentProperties,
|
|
38
|
+
resolveInlinePublisherProperties: () => import_inline_publisher_properties.resolveInlinePublisherProperties,
|
|
39
|
+
resolveSingularInline: () => import_inline_publisher_properties.resolveSingularInline,
|
|
40
|
+
validateAdAgents: () => import_validate_adagents.validateAdAgents
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(discovery_exports);
|
|
43
|
+
var import_property_index = require('../discovery/property-index.js');
|
|
44
|
+
var import_network_consistency_checker = require('../discovery/network-consistency-checker.js');
|
|
45
|
+
var import_publisher_property_selector = require('../discovery/publisher-property-selector.js');
|
|
46
|
+
var import_resolve_agent_properties = require('../discovery/resolve-agent-properties.js');
|
|
47
|
+
var import_inline_publisher_properties = require('../discovery/inline-publisher-properties.js');
|
|
48
|
+
var import_agent_directory = require('../discovery/agent-directory.js');
|
|
49
|
+
var import_validate_adagents = require('../discovery/validate-adagents.js');
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
NetworkConsistencyChecker,
|
|
53
|
+
PropertyIndex,
|
|
54
|
+
PublisherPropertySelectorParseError,
|
|
55
|
+
canonicalizeAgentUrl,
|
|
56
|
+
detectInlineFederatedDivergence,
|
|
57
|
+
expandPublisherPropertySelector,
|
|
58
|
+
expandPublisherPropertySelectors,
|
|
59
|
+
fetchAgentAuthorizationsFromDirectory,
|
|
60
|
+
getAllProperties,
|
|
61
|
+
getPropertyIndex,
|
|
62
|
+
isCompactPublisherPropertySelector,
|
|
63
|
+
listAgentPropertyMap,
|
|
64
|
+
parseManagerDomain,
|
|
65
|
+
parsePublisherPropertySelector,
|
|
66
|
+
publisherDomainsCoveredBySelectors,
|
|
67
|
+
resetPropertyIndex,
|
|
68
|
+
resolveAgentProperties,
|
|
69
|
+
resolveInlinePublisherProperties,
|
|
70
|
+
resolveSingularInline,
|
|
71
|
+
validateAdAgents
|
|
72
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PropertyIndex,
|
|
3
|
+
getPropertyIndex,
|
|
4
|
+
resetPropertyIndex
|
|
5
|
+
} from "../discovery/property-index.mjs";
|
|
6
|
+
import {
|
|
7
|
+
NetworkConsistencyChecker
|
|
8
|
+
} from "../discovery/network-consistency-checker.mjs";
|
|
9
|
+
import {
|
|
10
|
+
parsePublisherPropertySelector,
|
|
11
|
+
expandPublisherPropertySelector,
|
|
12
|
+
expandPublisherPropertySelectors,
|
|
13
|
+
isCompactPublisherPropertySelector,
|
|
14
|
+
publisherDomainsCoveredBySelectors,
|
|
15
|
+
PublisherPropertySelectorParseError
|
|
16
|
+
} from "../discovery/publisher-property-selector.mjs";
|
|
17
|
+
import {
|
|
18
|
+
resolveAgentProperties,
|
|
19
|
+
listAgentPropertyMap,
|
|
20
|
+
getAllProperties,
|
|
21
|
+
canonicalizeAgentUrl
|
|
22
|
+
} from "../discovery/resolve-agent-properties.mjs";
|
|
23
|
+
import {
|
|
24
|
+
resolveInlinePublisherProperties,
|
|
25
|
+
resolveSingularInline,
|
|
26
|
+
detectInlineFederatedDivergence
|
|
27
|
+
} from "../discovery/inline-publisher-properties.mjs";
|
|
28
|
+
import {
|
|
29
|
+
fetchAgentAuthorizationsFromDirectory
|
|
30
|
+
} from "../discovery/agent-directory.mjs";
|
|
31
|
+
import {
|
|
32
|
+
validateAdAgents,
|
|
33
|
+
parseManagerDomain
|
|
34
|
+
} from "../discovery/validate-adagents.mjs";
|
|
35
|
+
export {
|
|
36
|
+
NetworkConsistencyChecker,
|
|
37
|
+
PropertyIndex,
|
|
38
|
+
PublisherPropertySelectorParseError,
|
|
39
|
+
canonicalizeAgentUrl,
|
|
40
|
+
detectInlineFederatedDivergence,
|
|
41
|
+
expandPublisherPropertySelector,
|
|
42
|
+
expandPublisherPropertySelectors,
|
|
43
|
+
fetchAgentAuthorizationsFromDirectory,
|
|
44
|
+
getAllProperties,
|
|
45
|
+
getPropertyIndex,
|
|
46
|
+
isCompactPublisherPropertySelector,
|
|
47
|
+
listAgentPropertyMap,
|
|
48
|
+
parseManagerDomain,
|
|
49
|
+
parsePublisherPropertySelector,
|
|
50
|
+
publisherDomainsCoveredBySelectors,
|
|
51
|
+
resetPropertyIndex,
|
|
52
|
+
resolveAgentProperties,
|
|
53
|
+
resolveInlinePublisherProperties,
|
|
54
|
+
resolveSingularInline,
|
|
55
|
+
validateAdAgents
|
|
56
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { ADCPError, TaskTimeoutError, MaxClarificationError, DeferredTaskError, TaskAbortedError, AgentNotFoundError, UnsupportedTaskError, ProtocolError, ValidationError as ADCPValidationError, RequestValidationError, MissingInputHandlerError, InvalidContextError, ConfigurationError, AuthenticationCredentialsRejectedError, AuthenticationRequiredError, FeatureUnsupportedError, ProtocolFeatureUnsupportedError, UnsupportedBuyingModeError, AccountRequiredError, AccountPendingApprovalError, AccountAmbiguousError, BuyerSetupError, AccountNotFoundError, AccountRequestError, AccountSetupRequiredError, AccountPaymentRequiredError, AccountNotProvisionedError, SDK_ERROR_TO_PROTOCOL_ERROR_CODE, VersionUnsupportedError, IdempotencyConflictError, IdempotencyExpiredError, ResponseTooLargeError, AgentRateLimitedError, ActionNotAllowedError, PreparedFixturesDeniedError, ReportingSubscriptionError, CoverageInputError, ReportingSubscriptionEngineError, adcpErrorToTypedError, getClientPreflightAdcpError, isADCPError, isErrorOfType, isPreDispatchError, extractErrorInfo, is401Error, mapSdkErrorCodeToProtocolErrorCode, } from '../errors/index.mjs';
|
|
2
|
+
export type { OAuthMetadataInfo, ClientPreflightAdcpErrorInfo, ClientPreflightAdcpErrorRecovery, FeatureUnsupportedErrorOptions, ProtocolFeatureUnsupportedErrorOptions, VersionUnsupportedErrorOptions, ActionNotAllowedErrorDetails, ActionNotAllowedReasonValue, ActionNotAllowedAttemptedAction, ActionNotAllowedAvailableAction, ActionNotAllowedRecovery, AdcpErrorRecovery, ReportingSubscriptionErrorCode, ReportingSubscriptionErrorOptions, CoverageInputErrorCode, CoverageInputErrorDetail, ReportingSubscriptionEngineErrorCode, } from '../errors/index.mjs';
|
|
3
|
+
export type { Error as TaskErrorDetail } from '../types/core.generated.mjs';
|
|
4
|
+
export { STANDARD_ERROR_CODES, isStandardErrorCode, getErrorRecovery, DEFAULT_UNKNOWN_ERROR_RECOVERY, } from '../types/error-codes.mjs';
|
|
5
|
+
export type { StandardErrorCode, ErrorRecovery } from '../types/error-codes.mjs';
|
|
6
|
+
export { isRetryable, getRetryDelay } from '../utils/retry.mjs';
|
|
7
|
+
export { decideRetry, BuyerRetryPolicy } from '../utils/buyer-retry-policy.mjs';
|
|
8
|
+
export type { RetryDecision, RetryContext, RetryDecisionOverride } from '../utils/buyer-retry-policy.mjs';
|
|
9
|
+
export { extractAdcpErrorInfo, extractCorrelationId, resolveRecovery, getExpectedAction, extractAdcpErrorFromMcp, extractAdcpErrorFromTransport, extractVersionUnsupportedDetails, } from '../utils/error-extraction.mjs';
|
|
10
|
+
export type { ExtractedAdcpError, VersionUnsupportedDetails } from '../utils/error-extraction.mjs';
|
|
11
|
+
export { isAdcpError, isAdcpSuccess, isTerminalAdcpError } from '../utils/response-unwrapper.mjs';
|