@adcp/sdk 16.0.0-beta.6 → 16.0.0-beta.8
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 +17 -0
- package/dist/lib/conformance/index.d.mts +2 -0
- package/dist/lib/conformance/index.d.ts +2 -0
- package/dist/lib/conformance/index.js +3 -0
- package/dist/lib/conformance/index.mjs +2 -0
- package/dist/lib/conformance/property-lists.d.mts +14 -0
- package/dist/lib/conformance/property-lists.d.ts +14 -0
- package/dist/lib/conformance/property-lists.js +45 -0
- package/dist/lib/conformance/property-lists.mjs +21 -0
- package/dist/lib/conformance/runConformance.js +20 -1
- package/dist/lib/conformance/runConformance.mjs +20 -1
- package/dist/lib/conformance/types.d.mts +3 -0
- package/dist/lib/conformance/types.d.ts +3 -0
- package/dist/lib/core/SingleAgentClient.d.mts +13 -3
- package/dist/lib/core/SingleAgentClient.d.ts +13 -3
- package/dist/lib/core/SingleAgentClient.js +109 -21
- package/dist/lib/core/SingleAgentClient.mjs +112 -22
- package/dist/lib/core/TaskExecutor.d.mts +1 -0
- package/dist/lib/core/TaskExecutor.d.ts +1 -0
- package/dist/lib/core/TaskExecutor.js +48 -34
- package/dist/lib/core/TaskExecutor.mjs +49 -35
- package/dist/lib/identifiers.d.mts +53 -0
- package/dist/lib/identifiers.d.ts +53 -0
- package/dist/lib/identifiers.js +212 -0
- package/dist/lib/identifiers.mjs +163 -0
- package/dist/lib/identity-3.3/revocation.js +5 -4
- package/dist/lib/identity-3.3/revocation.mjs +5 -4
- package/dist/lib/index.d.mts +3 -1
- package/dist/lib/index.d.ts +3 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.mjs +1 -0
- package/dist/lib/media-buy/index.d.mts +1 -1
- package/dist/lib/media-buy/index.d.ts +1 -1
- package/dist/lib/media-buy/property-policy.d.mts +15 -1
- package/dist/lib/media-buy/property-policy.d.ts +15 -1
- package/dist/lib/media-buy/property-policy.js +135 -3
- package/dist/lib/media-buy/property-policy.mjs +134 -3
- package/dist/lib/registry/index.d.mts +12 -0
- package/dist/lib/registry/index.d.ts +12 -0
- package/dist/lib/registry/index.js +159 -5
- package/dist/lib/registry/index.mjs +156 -4
- package/dist/lib/registry/types.d.mts +23 -0
- package/dist/lib/registry/types.d.ts +23 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/auth-signature.js +23 -2
- package/dist/lib/server/auth-signature.mjs +26 -2
- package/dist/lib/server/auth.d.mts +6 -0
- package/dist/lib/server/auth.d.ts +6 -0
- package/dist/lib/server/auth.js +6 -0
- package/dist/lib/server/auth.mjs +6 -0
- package/dist/lib/server/create-adcp-server.js +19 -3
- package/dist/lib/server/create-adcp-server.mjs +23 -4
- package/dist/lib/server/decisioning/runtime/from-platform.js +6 -2
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +6 -2
- package/dist/lib/server/decisioning/specialisms/lists.d.mts +4 -4
- package/dist/lib/server/decisioning/specialisms/lists.d.ts +4 -4
- package/dist/lib/server/index.d.mts +3 -0
- package/dist/lib/server/index.d.ts +3 -0
- package/dist/lib/server/index.js +8 -1
- package/dist/lib/server/index.mjs +4 -0
- package/dist/lib/server/property-lists.d.mts +36 -0
- package/dist/lib/server/property-lists.d.ts +36 -0
- package/dist/lib/server/property-lists.js +154 -0
- package/dist/lib/server/property-lists.mjs +129 -0
- package/dist/lib/server/serve.js +2 -1
- package/dist/lib/server/serve.mjs +2 -1
- package/dist/lib/server/targeting-helpers.d.mts +2 -0
- package/dist/lib/server/targeting-helpers.d.ts +2 -0
- package/dist/lib/server/targeting-helpers.js +28 -1
- package/dist/lib/server/targeting-helpers.mjs +18 -1
- package/dist/lib/server/webhook-emitter.js +1 -0
- package/dist/lib/server/webhook-emitter.mjs +2 -1
- package/dist/lib/signing/crypto.d.mts +1 -1
- package/dist/lib/signing/crypto.d.ts +1 -1
- package/dist/lib/signing/crypto.js +37 -2
- package/dist/lib/signing/crypto.mjs +37 -2
- package/dist/lib/signing/parser.d.mts +6 -0
- package/dist/lib/signing/parser.d.ts +6 -0
- package/dist/lib/signing/parser.js +7 -3
- package/dist/lib/signing/parser.mjs +6 -3
- package/dist/lib/signing/server.d.mts +1 -1
- package/dist/lib/signing/server.d.ts +1 -1
- package/dist/lib/signing/server.mjs +5 -1
- package/dist/lib/signing/web-bot-auth.d.mts +61 -22
- package/dist/lib/signing/web-bot-auth.d.ts +61 -22
- package/dist/lib/signing/web-bot-auth.js +286 -266
- package/dist/lib/signing/web-bot-auth.mjs +288 -277
- package/dist/lib/signing/webhook-verifier.d.mts +11 -0
- package/dist/lib/signing/webhook-verifier.d.ts +11 -0
- package/dist/lib/signing/webhook-verifier.js +11 -3
- package/dist/lib/signing/webhook-verifier.mjs +11 -3
- package/dist/lib/supply-path/verify.js +12 -2
- package/dist/lib/supply-path/verify.mjs +2 -2
- package/dist/lib/testing/client.js +3 -5
- package/dist/lib/testing/client.mjs +4 -6
- package/dist/lib/testing/compliance/comply.js +7 -2
- package/dist/lib/testing/compliance/comply.mjs +8 -3
- package/dist/lib/testing/index.d.mts +1 -1
- package/dist/lib/testing/index.d.ts +1 -1
- package/dist/lib/testing/index.js +4 -2
- package/dist/lib/testing/index.mjs +8 -2
- package/dist/lib/testing/storyboard/runner.js +12 -12
- package/dist/lib/testing/storyboard/runner.mjs +14 -13
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/testing/storyboard/validations.js +23 -1
- package/dist/lib/testing/storyboard/validations.mjs +28 -2
- package/dist/lib/testing/types.d.mts +39 -0
- package/dist/lib/testing/types.d.ts +39 -0
- package/dist/lib/v2/projection/augment-response.js +6 -3
- package/dist/lib/v2/projection/augment-response.mjs +8 -5
- package/dist/lib/v2/projection/creative-delivery.js +29 -17
- package/dist/lib/v2/projection/creative-delivery.mjs +31 -18
- package/dist/lib/v2/projection/v1-to-v2.d.mts +7 -0
- package/dist/lib/v2/projection/v1-to-v2.d.ts +7 -0
- package/dist/lib/v2/projection/v1-to-v2.js +70 -2
- package/dist/lib/v2/projection/v1-to-v2.mjs +72 -1
- package/dist/lib/validation/index.d.mts +1 -1
- package/dist/lib/validation/index.d.ts +1 -1
- package/dist/lib/validation/index.js +4 -2
- package/dist/lib/validation/index.mjs +4 -2
- package/dist/lib/validation/schema-loader.d.mts +26 -0
- package/dist/lib/validation/schema-loader.d.ts +26 -0
- package/dist/lib/validation/schema-loader.js +98 -14
- package/dist/lib/validation/schema-loader.mjs +95 -13
- 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/PROPERTY-LISTS.md +264 -0
- package/docs/guides/SIGNING-GUIDE.md +25 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +34 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-agent-identity-3.3.md +60 -23
- package/package.json +1 -1
|
@@ -0,0 +1,212 @@
|
|
|
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 identifiers_exports = {};
|
|
20
|
+
__export(identifiers_exports, {
|
|
21
|
+
IdentifierValidationError: () => IdentifierValidationError,
|
|
22
|
+
normalizeAndroidPackageIdentifier: () => normalizeAndroidPackageIdentifier,
|
|
23
|
+
normalizeAppleAppStoreIdentifier: () => normalizeAppleAppStoreIdentifier,
|
|
24
|
+
normalizeAppleTvBundleIdentifier: () => normalizeAppleTvBundleIdentifier,
|
|
25
|
+
normalizeBundleIdentifier: () => normalizeBundleIdentifier,
|
|
26
|
+
normalizeDomainIdentifier: () => normalizeDomainIdentifier,
|
|
27
|
+
normalizeFireTvAsinIdentifier: () => normalizeFireTvAsinIdentifier,
|
|
28
|
+
normalizeGooglePlayIdentifier: () => normalizeGooglePlayIdentifier,
|
|
29
|
+
normalizeIosBundleIdentifier: () => normalizeIosBundleIdentifier,
|
|
30
|
+
normalizePropertyIdentifier: () => normalizePropertyIdentifier,
|
|
31
|
+
normalizeRokuStoreIdentifier: () => normalizeRokuStoreIdentifier,
|
|
32
|
+
normalizeSamsungAppIdentifier: () => normalizeSamsungAppIdentifier,
|
|
33
|
+
normalizeSubdomainIdentifier: () => normalizeSubdomainIdentifier,
|
|
34
|
+
validateAndroidPackageIdentifier: () => validateAndroidPackageIdentifier,
|
|
35
|
+
validateAppleAppStoreIdentifier: () => validateAppleAppStoreIdentifier,
|
|
36
|
+
validateAppleTvBundleIdentifier: () => validateAppleTvBundleIdentifier,
|
|
37
|
+
validateBundleIdentifier: () => validateBundleIdentifier,
|
|
38
|
+
validateDomainIdentifier: () => validateDomainIdentifier,
|
|
39
|
+
validateFireTvAsinIdentifier: () => validateFireTvAsinIdentifier,
|
|
40
|
+
validateGooglePlayIdentifier: () => validateGooglePlayIdentifier,
|
|
41
|
+
validateIosBundleIdentifier: () => validateIosBundleIdentifier,
|
|
42
|
+
validatePropertyIdentifier: () => validatePropertyIdentifier,
|
|
43
|
+
validatePublisherDomain: () => validatePublisherDomain,
|
|
44
|
+
validateRokuStoreIdentifier: () => validateRokuStoreIdentifier,
|
|
45
|
+
validateSamsungAppIdentifier: () => validateSamsungAppIdentifier,
|
|
46
|
+
validateSubdomainIdentifier: () => validateSubdomainIdentifier
|
|
47
|
+
});
|
|
48
|
+
module.exports = __toCommonJS(identifiers_exports);
|
|
49
|
+
var import_node_net = require("node:net");
|
|
50
|
+
var import_node_url = require("node:url");
|
|
51
|
+
class IdentifierValidationError extends TypeError {
|
|
52
|
+
constructor(code, identifierType, message) {
|
|
53
|
+
super(message);
|
|
54
|
+
this.code = code;
|
|
55
|
+
this.identifierType = identifierType;
|
|
56
|
+
}
|
|
57
|
+
code;
|
|
58
|
+
identifierType;
|
|
59
|
+
name = "IdentifierValidationError";
|
|
60
|
+
}
|
|
61
|
+
const PUBLISHER_DOMAIN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/;
|
|
62
|
+
function isDomain(value) {
|
|
63
|
+
if (value.length > 253 || !PUBLISHER_DOMAIN.test(value) || value.split(".").some((label) => label.length > 63) || (0, import_node_net.isIP)(value))
|
|
64
|
+
return false;
|
|
65
|
+
try {
|
|
66
|
+
return !(0, import_node_net.isIP)(new URL(`https://${value}`).hostname);
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function accepted(input, value) {
|
|
72
|
+
return { ok: true, value, ...input === value ? {} : { rewrite: { from: input, to: value } } };
|
|
73
|
+
}
|
|
74
|
+
function rejected(type, code = "invalid_identifier") {
|
|
75
|
+
return {
|
|
76
|
+
ok: false,
|
|
77
|
+
error: new IdentifierValidationError(
|
|
78
|
+
code,
|
|
79
|
+
type,
|
|
80
|
+
code === "invalid_publisher_domain" ? "publisher_domain must be a canonical lowercase hostname without wildcards, URLs, or IP addresses" : `Invalid ${type} identifier`
|
|
81
|
+
)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function validatePublisherDomain(value) {
|
|
85
|
+
return typeof value === "string" && isDomain(value) ? accepted(value, value) : rejected("publisher_domain", "invalid_publisher_domain");
|
|
86
|
+
}
|
|
87
|
+
function normalizeHostname(input, type) {
|
|
88
|
+
if (typeof input !== "string") return rejected(type);
|
|
89
|
+
let value = input.trim();
|
|
90
|
+
if (/^https?:\/\//i.test(value)) {
|
|
91
|
+
try {
|
|
92
|
+
const url = new URL(value);
|
|
93
|
+
if (url.username || url.password) return rejected(type);
|
|
94
|
+
value = url.hostname;
|
|
95
|
+
} catch {
|
|
96
|
+
return rejected(type);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const wildcard = value.startsWith("*.");
|
|
100
|
+
if (wildcard && type !== "domain") return rejected(type);
|
|
101
|
+
if (/[\s/\\:@?#%]/.test(wildcard ? value.slice(2) : value)) return rejected(type);
|
|
102
|
+
const host = (0, import_node_url.domainToASCII)((wildcard ? value.slice(2) : value).toLowerCase().replace(/\.$/, ""));
|
|
103
|
+
if (!isDomain(host)) return rejected(type);
|
|
104
|
+
return accepted(input, `${wildcard ? "*." : ""}${host}`);
|
|
105
|
+
}
|
|
106
|
+
const normalizeDomainIdentifier = (value) => normalizeHostname(value, "domain");
|
|
107
|
+
const normalizeSubdomainIdentifier = (value) => normalizeHostname(value, "subdomain");
|
|
108
|
+
function normalizePattern(type, input, pattern, uppercase = false) {
|
|
109
|
+
if (typeof input !== "string") return rejected(type);
|
|
110
|
+
const value = uppercase ? input.trim().toUpperCase() : input.trim();
|
|
111
|
+
return pattern.test(value) ? accepted(input, value) : rejected(type);
|
|
112
|
+
}
|
|
113
|
+
const normalizeIosBundleIdentifier = (value) => normalizePattern("ios_bundle", value, /^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/);
|
|
114
|
+
const normalizeAndroidPackageIdentifier = (value) => normalizePattern("android_package", value, /^[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)+$/);
|
|
115
|
+
const normalizeAppleAppStoreIdentifier = (value) => normalizePattern("apple_app_store_id", value, /^[1-9][0-9]*$/);
|
|
116
|
+
const normalizeGooglePlayIdentifier = (value) => normalizePattern("google_play_id", value, /^[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)+$/);
|
|
117
|
+
const normalizeRokuStoreIdentifier = (value) => normalizePattern("roku_store_id", value, /^[1-9][0-9]*$/);
|
|
118
|
+
const normalizeFireTvAsinIdentifier = (value) => normalizePattern("fire_tv_asin", value, /^[A-Z0-9]{10}$/, true);
|
|
119
|
+
const normalizeSamsungAppIdentifier = (value) => normalizePattern("samsung_app_id", value, /^[A-Za-z0-9._-]+$/);
|
|
120
|
+
const normalizeAppleTvBundleIdentifier = (value) => normalizePattern("apple_tv_bundle", value, /^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/);
|
|
121
|
+
const normalizeBundleIdentifier = (value) => normalizePattern("bundle_id", value, /^[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)+$/);
|
|
122
|
+
function normalizePropertyIdentifier(type, value) {
|
|
123
|
+
switch (type) {
|
|
124
|
+
case "domain":
|
|
125
|
+
return normalizeDomainIdentifier(value);
|
|
126
|
+
case "subdomain":
|
|
127
|
+
return normalizeSubdomainIdentifier(value);
|
|
128
|
+
case "ios_bundle":
|
|
129
|
+
return normalizeIosBundleIdentifier(value);
|
|
130
|
+
case "android_package":
|
|
131
|
+
return normalizeAndroidPackageIdentifier(value);
|
|
132
|
+
case "apple_app_store_id":
|
|
133
|
+
return normalizeAppleAppStoreIdentifier(value);
|
|
134
|
+
case "google_play_id":
|
|
135
|
+
return normalizeGooglePlayIdentifier(value);
|
|
136
|
+
case "roku_store_id":
|
|
137
|
+
return normalizeRokuStoreIdentifier(value);
|
|
138
|
+
case "fire_tv_asin":
|
|
139
|
+
return normalizeFireTvAsinIdentifier(value);
|
|
140
|
+
case "samsung_app_id":
|
|
141
|
+
return normalizeSamsungAppIdentifier(value);
|
|
142
|
+
case "apple_tv_bundle":
|
|
143
|
+
return normalizeAppleTvBundleIdentifier(value);
|
|
144
|
+
case "bundle_id":
|
|
145
|
+
return normalizeBundleIdentifier(value);
|
|
146
|
+
case "apple_podcast_id":
|
|
147
|
+
return normalizePattern(type, value, /^[1-9][0-9]*$/);
|
|
148
|
+
case "rss_url": {
|
|
149
|
+
if (typeof value !== "string") return rejected(type);
|
|
150
|
+
try {
|
|
151
|
+
const url = new URL(value.trim());
|
|
152
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || !isDomain(url.hostname))
|
|
153
|
+
return rejected(type);
|
|
154
|
+
return accepted(value, url.toString());
|
|
155
|
+
} catch {
|
|
156
|
+
return rejected(type);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
case "network_id":
|
|
160
|
+
case "venue_id":
|
|
161
|
+
case "screen_id":
|
|
162
|
+
case "openooh_venue_type":
|
|
163
|
+
case "spotify_collection_id":
|
|
164
|
+
case "podcast_guid":
|
|
165
|
+
case "station_id":
|
|
166
|
+
case "facility_id":
|
|
167
|
+
return normalizePattern(type, value, /^[^\x00-\x1f\x7f]+$/);
|
|
168
|
+
default:
|
|
169
|
+
return rejected(type, "unsupported_identifier_type");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const validatePropertyIdentifier = normalizePropertyIdentifier;
|
|
173
|
+
const validateDomainIdentifier = normalizeDomainIdentifier;
|
|
174
|
+
const validateSubdomainIdentifier = normalizeSubdomainIdentifier;
|
|
175
|
+
const validateIosBundleIdentifier = normalizeIosBundleIdentifier;
|
|
176
|
+
const validateAndroidPackageIdentifier = normalizeAndroidPackageIdentifier;
|
|
177
|
+
const validateAppleAppStoreIdentifier = normalizeAppleAppStoreIdentifier;
|
|
178
|
+
const validateGooglePlayIdentifier = normalizeGooglePlayIdentifier;
|
|
179
|
+
const validateRokuStoreIdentifier = normalizeRokuStoreIdentifier;
|
|
180
|
+
const validateFireTvAsinIdentifier = normalizeFireTvAsinIdentifier;
|
|
181
|
+
const validateSamsungAppIdentifier = normalizeSamsungAppIdentifier;
|
|
182
|
+
const validateAppleTvBundleIdentifier = normalizeAppleTvBundleIdentifier;
|
|
183
|
+
const validateBundleIdentifier = normalizeBundleIdentifier;
|
|
184
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
185
|
+
0 && (module.exports = {
|
|
186
|
+
IdentifierValidationError,
|
|
187
|
+
normalizeAndroidPackageIdentifier,
|
|
188
|
+
normalizeAppleAppStoreIdentifier,
|
|
189
|
+
normalizeAppleTvBundleIdentifier,
|
|
190
|
+
normalizeBundleIdentifier,
|
|
191
|
+
normalizeDomainIdentifier,
|
|
192
|
+
normalizeFireTvAsinIdentifier,
|
|
193
|
+
normalizeGooglePlayIdentifier,
|
|
194
|
+
normalizeIosBundleIdentifier,
|
|
195
|
+
normalizePropertyIdentifier,
|
|
196
|
+
normalizeRokuStoreIdentifier,
|
|
197
|
+
normalizeSamsungAppIdentifier,
|
|
198
|
+
normalizeSubdomainIdentifier,
|
|
199
|
+
validateAndroidPackageIdentifier,
|
|
200
|
+
validateAppleAppStoreIdentifier,
|
|
201
|
+
validateAppleTvBundleIdentifier,
|
|
202
|
+
validateBundleIdentifier,
|
|
203
|
+
validateDomainIdentifier,
|
|
204
|
+
validateFireTvAsinIdentifier,
|
|
205
|
+
validateGooglePlayIdentifier,
|
|
206
|
+
validateIosBundleIdentifier,
|
|
207
|
+
validatePropertyIdentifier,
|
|
208
|
+
validatePublisherDomain,
|
|
209
|
+
validateRokuStoreIdentifier,
|
|
210
|
+
validateSamsungAppIdentifier,
|
|
211
|
+
validateSubdomainIdentifier
|
|
212
|
+
});
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { isIP } from "node:net";
|
|
2
|
+
import { domainToASCII } from "node:url";
|
|
3
|
+
class IdentifierValidationError extends TypeError {
|
|
4
|
+
constructor(code, identifierType, message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.code = code;
|
|
7
|
+
this.identifierType = identifierType;
|
|
8
|
+
}
|
|
9
|
+
code;
|
|
10
|
+
identifierType;
|
|
11
|
+
name = "IdentifierValidationError";
|
|
12
|
+
}
|
|
13
|
+
const PUBLISHER_DOMAIN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/;
|
|
14
|
+
function isDomain(value) {
|
|
15
|
+
if (value.length > 253 || !PUBLISHER_DOMAIN.test(value) || value.split(".").some((label) => label.length > 63) || isIP(value))
|
|
16
|
+
return false;
|
|
17
|
+
try {
|
|
18
|
+
return !isIP(new URL(`https://${value}`).hostname);
|
|
19
|
+
} catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function accepted(input, value) {
|
|
24
|
+
return { ok: true, value, ...input === value ? {} : { rewrite: { from: input, to: value } } };
|
|
25
|
+
}
|
|
26
|
+
function rejected(type, code = "invalid_identifier") {
|
|
27
|
+
return {
|
|
28
|
+
ok: false,
|
|
29
|
+
error: new IdentifierValidationError(
|
|
30
|
+
code,
|
|
31
|
+
type,
|
|
32
|
+
code === "invalid_publisher_domain" ? "publisher_domain must be a canonical lowercase hostname without wildcards, URLs, or IP addresses" : `Invalid ${type} identifier`
|
|
33
|
+
)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function validatePublisherDomain(value) {
|
|
37
|
+
return typeof value === "string" && isDomain(value) ? accepted(value, value) : rejected("publisher_domain", "invalid_publisher_domain");
|
|
38
|
+
}
|
|
39
|
+
function normalizeHostname(input, type) {
|
|
40
|
+
if (typeof input !== "string") return rejected(type);
|
|
41
|
+
let value = input.trim();
|
|
42
|
+
if (/^https?:\/\//i.test(value)) {
|
|
43
|
+
try {
|
|
44
|
+
const url = new URL(value);
|
|
45
|
+
if (url.username || url.password) return rejected(type);
|
|
46
|
+
value = url.hostname;
|
|
47
|
+
} catch {
|
|
48
|
+
return rejected(type);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const wildcard = value.startsWith("*.");
|
|
52
|
+
if (wildcard && type !== "domain") return rejected(type);
|
|
53
|
+
if (/[\s/\\:@?#%]/.test(wildcard ? value.slice(2) : value)) return rejected(type);
|
|
54
|
+
const host = domainToASCII((wildcard ? value.slice(2) : value).toLowerCase().replace(/\.$/, ""));
|
|
55
|
+
if (!isDomain(host)) return rejected(type);
|
|
56
|
+
return accepted(input, `${wildcard ? "*." : ""}${host}`);
|
|
57
|
+
}
|
|
58
|
+
const normalizeDomainIdentifier = (value) => normalizeHostname(value, "domain");
|
|
59
|
+
const normalizeSubdomainIdentifier = (value) => normalizeHostname(value, "subdomain");
|
|
60
|
+
function normalizePattern(type, input, pattern, uppercase = false) {
|
|
61
|
+
if (typeof input !== "string") return rejected(type);
|
|
62
|
+
const value = uppercase ? input.trim().toUpperCase() : input.trim();
|
|
63
|
+
return pattern.test(value) ? accepted(input, value) : rejected(type);
|
|
64
|
+
}
|
|
65
|
+
const normalizeIosBundleIdentifier = (value) => normalizePattern("ios_bundle", value, /^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/);
|
|
66
|
+
const normalizeAndroidPackageIdentifier = (value) => normalizePattern("android_package", value, /^[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)+$/);
|
|
67
|
+
const normalizeAppleAppStoreIdentifier = (value) => normalizePattern("apple_app_store_id", value, /^[1-9][0-9]*$/);
|
|
68
|
+
const normalizeGooglePlayIdentifier = (value) => normalizePattern("google_play_id", value, /^[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)+$/);
|
|
69
|
+
const normalizeRokuStoreIdentifier = (value) => normalizePattern("roku_store_id", value, /^[1-9][0-9]*$/);
|
|
70
|
+
const normalizeFireTvAsinIdentifier = (value) => normalizePattern("fire_tv_asin", value, /^[A-Z0-9]{10}$/, true);
|
|
71
|
+
const normalizeSamsungAppIdentifier = (value) => normalizePattern("samsung_app_id", value, /^[A-Za-z0-9._-]+$/);
|
|
72
|
+
const normalizeAppleTvBundleIdentifier = (value) => normalizePattern("apple_tv_bundle", value, /^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/);
|
|
73
|
+
const normalizeBundleIdentifier = (value) => normalizePattern("bundle_id", value, /^[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)+$/);
|
|
74
|
+
function normalizePropertyIdentifier(type, value) {
|
|
75
|
+
switch (type) {
|
|
76
|
+
case "domain":
|
|
77
|
+
return normalizeDomainIdentifier(value);
|
|
78
|
+
case "subdomain":
|
|
79
|
+
return normalizeSubdomainIdentifier(value);
|
|
80
|
+
case "ios_bundle":
|
|
81
|
+
return normalizeIosBundleIdentifier(value);
|
|
82
|
+
case "android_package":
|
|
83
|
+
return normalizeAndroidPackageIdentifier(value);
|
|
84
|
+
case "apple_app_store_id":
|
|
85
|
+
return normalizeAppleAppStoreIdentifier(value);
|
|
86
|
+
case "google_play_id":
|
|
87
|
+
return normalizeGooglePlayIdentifier(value);
|
|
88
|
+
case "roku_store_id":
|
|
89
|
+
return normalizeRokuStoreIdentifier(value);
|
|
90
|
+
case "fire_tv_asin":
|
|
91
|
+
return normalizeFireTvAsinIdentifier(value);
|
|
92
|
+
case "samsung_app_id":
|
|
93
|
+
return normalizeSamsungAppIdentifier(value);
|
|
94
|
+
case "apple_tv_bundle":
|
|
95
|
+
return normalizeAppleTvBundleIdentifier(value);
|
|
96
|
+
case "bundle_id":
|
|
97
|
+
return normalizeBundleIdentifier(value);
|
|
98
|
+
case "apple_podcast_id":
|
|
99
|
+
return normalizePattern(type, value, /^[1-9][0-9]*$/);
|
|
100
|
+
case "rss_url": {
|
|
101
|
+
if (typeof value !== "string") return rejected(type);
|
|
102
|
+
try {
|
|
103
|
+
const url = new URL(value.trim());
|
|
104
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || !isDomain(url.hostname))
|
|
105
|
+
return rejected(type);
|
|
106
|
+
return accepted(value, url.toString());
|
|
107
|
+
} catch {
|
|
108
|
+
return rejected(type);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
case "network_id":
|
|
112
|
+
case "venue_id":
|
|
113
|
+
case "screen_id":
|
|
114
|
+
case "openooh_venue_type":
|
|
115
|
+
case "spotify_collection_id":
|
|
116
|
+
case "podcast_guid":
|
|
117
|
+
case "station_id":
|
|
118
|
+
case "facility_id":
|
|
119
|
+
return normalizePattern(type, value, /^[^\x00-\x1f\x7f]+$/);
|
|
120
|
+
default:
|
|
121
|
+
return rejected(type, "unsupported_identifier_type");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const validatePropertyIdentifier = normalizePropertyIdentifier;
|
|
125
|
+
const validateDomainIdentifier = normalizeDomainIdentifier;
|
|
126
|
+
const validateSubdomainIdentifier = normalizeSubdomainIdentifier;
|
|
127
|
+
const validateIosBundleIdentifier = normalizeIosBundleIdentifier;
|
|
128
|
+
const validateAndroidPackageIdentifier = normalizeAndroidPackageIdentifier;
|
|
129
|
+
const validateAppleAppStoreIdentifier = normalizeAppleAppStoreIdentifier;
|
|
130
|
+
const validateGooglePlayIdentifier = normalizeGooglePlayIdentifier;
|
|
131
|
+
const validateRokuStoreIdentifier = normalizeRokuStoreIdentifier;
|
|
132
|
+
const validateFireTvAsinIdentifier = normalizeFireTvAsinIdentifier;
|
|
133
|
+
const validateSamsungAppIdentifier = normalizeSamsungAppIdentifier;
|
|
134
|
+
const validateAppleTvBundleIdentifier = normalizeAppleTvBundleIdentifier;
|
|
135
|
+
const validateBundleIdentifier = normalizeBundleIdentifier;
|
|
136
|
+
export {
|
|
137
|
+
IdentifierValidationError,
|
|
138
|
+
normalizeAndroidPackageIdentifier,
|
|
139
|
+
normalizeAppleAppStoreIdentifier,
|
|
140
|
+
normalizeAppleTvBundleIdentifier,
|
|
141
|
+
normalizeBundleIdentifier,
|
|
142
|
+
normalizeDomainIdentifier,
|
|
143
|
+
normalizeFireTvAsinIdentifier,
|
|
144
|
+
normalizeGooglePlayIdentifier,
|
|
145
|
+
normalizeIosBundleIdentifier,
|
|
146
|
+
normalizePropertyIdentifier,
|
|
147
|
+
normalizeRokuStoreIdentifier,
|
|
148
|
+
normalizeSamsungAppIdentifier,
|
|
149
|
+
normalizeSubdomainIdentifier,
|
|
150
|
+
validateAndroidPackageIdentifier,
|
|
151
|
+
validateAppleAppStoreIdentifier,
|
|
152
|
+
validateAppleTvBundleIdentifier,
|
|
153
|
+
validateBundleIdentifier,
|
|
154
|
+
validateDomainIdentifier,
|
|
155
|
+
validateFireTvAsinIdentifier,
|
|
156
|
+
validateGooglePlayIdentifier,
|
|
157
|
+
validateIosBundleIdentifier,
|
|
158
|
+
validatePropertyIdentifier,
|
|
159
|
+
validatePublisherDomain,
|
|
160
|
+
validateRokuStoreIdentifier,
|
|
161
|
+
validateSamsungAppIdentifier,
|
|
162
|
+
validateSubdomainIdentifier
|
|
163
|
+
};
|
|
@@ -225,7 +225,8 @@ class OriginRevocationResolver {
|
|
|
225
225
|
for (const token of tokens) {
|
|
226
226
|
try {
|
|
227
227
|
const header = (0, import_jose.decodeProtectedHeader)(token);
|
|
228
|
-
if (header.typ !== "adcp-gov-revocation+jws" || typeof header.kid !== "string" ||
|
|
228
|
+
if (header.typ !== "adcp-gov-revocation+jws" || typeof header.kid !== "string" || // Directory keys are Ed25519 or RSA-PSS under the profile (adcp#7894).
|
|
229
|
+
header.alg !== "EdDSA" && header.alg !== "PS512")
|
|
229
230
|
continue;
|
|
230
231
|
await this.options.directory.resolve(header.kid, origin);
|
|
231
232
|
const checked = this.options.directory.getVerifiedDirectory(origin);
|
|
@@ -234,7 +235,7 @@ class OriginRevocationResolver {
|
|
|
234
235
|
const jwk = checked.keys.find((key) => key.kid === header.kid);
|
|
235
236
|
if (!jwk) continue;
|
|
236
237
|
const result = await (0, import_jose.compactVerify)(token, await (0, import_jose.importJWK)(jwk, header.alg), {
|
|
237
|
-
algorithms: [
|
|
238
|
+
algorithms: [header.alg]
|
|
238
239
|
});
|
|
239
240
|
verifiedPayload = result.payload;
|
|
240
241
|
break;
|
|
@@ -295,8 +296,8 @@ async function createSignedOriginRevocationList(snapshot, privateKey) {
|
|
|
295
296
|
const kid = (0, import_web_bot_auth.jwkThumbprint)(privateKey);
|
|
296
297
|
if (privateKey.kid && privateKey.kid !== kid)
|
|
297
298
|
throw new TypeError("Revocation signing kid must be the JWK thumbprint");
|
|
298
|
-
const alg = privateKey.crv === "Ed25519" ? "EdDSA" : privateKey.
|
|
299
|
-
if (!alg || !privateKey.d) throw new TypeError("Revocations require a private Ed25519 or
|
|
299
|
+
const alg = privateKey.crv === "Ed25519" ? "EdDSA" : privateKey.kty === "RSA" ? "PS512" : void 0;
|
|
300
|
+
if (!alg || !privateKey.d) throw new TypeError("Revocations require a private Ed25519 or RSA key");
|
|
300
301
|
return new import_jose.CompactSign(Buffer.from(JSON.stringify(snapshot))).setProtectedHeader({ alg, kid, typ: "adcp-gov-revocation+jws" }).sign(await (0, import_jose.importJWK)(privateKey, alg));
|
|
301
302
|
}
|
|
302
303
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -204,7 +204,8 @@ class OriginRevocationResolver {
|
|
|
204
204
|
for (const token of tokens) {
|
|
205
205
|
try {
|
|
206
206
|
const header = decodeProtectedHeader(token);
|
|
207
|
-
if (header.typ !== "adcp-gov-revocation+jws" || typeof header.kid !== "string" ||
|
|
207
|
+
if (header.typ !== "adcp-gov-revocation+jws" || typeof header.kid !== "string" || // Directory keys are Ed25519 or RSA-PSS under the profile (adcp#7894).
|
|
208
|
+
header.alg !== "EdDSA" && header.alg !== "PS512")
|
|
208
209
|
continue;
|
|
209
210
|
await this.options.directory.resolve(header.kid, origin);
|
|
210
211
|
const checked = this.options.directory.getVerifiedDirectory(origin);
|
|
@@ -213,7 +214,7 @@ class OriginRevocationResolver {
|
|
|
213
214
|
const jwk = checked.keys.find((key) => key.kid === header.kid);
|
|
214
215
|
if (!jwk) continue;
|
|
215
216
|
const result = await compactVerify(token, await importJWK(jwk, header.alg), {
|
|
216
|
-
algorithms: [
|
|
217
|
+
algorithms: [header.alg]
|
|
217
218
|
});
|
|
218
219
|
verifiedPayload = result.payload;
|
|
219
220
|
break;
|
|
@@ -274,8 +275,8 @@ async function createSignedOriginRevocationList(snapshot, privateKey) {
|
|
|
274
275
|
const kid = jwkThumbprint(privateKey);
|
|
275
276
|
if (privateKey.kid && privateKey.kid !== kid)
|
|
276
277
|
throw new TypeError("Revocation signing kid must be the JWK thumbprint");
|
|
277
|
-
const alg = privateKey.crv === "Ed25519" ? "EdDSA" : privateKey.
|
|
278
|
-
if (!alg || !privateKey.d) throw new TypeError("Revocations require a private Ed25519 or
|
|
278
|
+
const alg = privateKey.crv === "Ed25519" ? "EdDSA" : privateKey.kty === "RSA" ? "PS512" : void 0;
|
|
279
|
+
if (!alg || !privateKey.d) throw new TypeError("Revocations require a private Ed25519 or RSA key");
|
|
279
280
|
return new CompactSign(Buffer.from(JSON.stringify(snapshot))).setProtectedHeader({ alg, kid, typ: "adcp-gov-revocation+jws" }).sign(await importJWK(privateKey, alg));
|
|
280
281
|
}
|
|
281
282
|
export {
|
package/dist/lib/index.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from './identifiers.mjs';
|
|
2
|
+
export type { ResolveIdentifiersAllOptions, ResolveIdentifierOutcome } from './registry/index.mjs';
|
|
1
3
|
export { RegistryClient, RegistryRequestError, isRegistryRequestError, RegistrySync, PropertyRegistry, InMemoryCursorStore, FileCursorStore, buildCommunityMirrorAdagents, } from './registry/index.mjs';
|
|
2
4
|
export type { RegistrySyncConfig, RegistrySyncState, RegistrySyncTransport, RegistrySyncEvents, AgentFilter, RegistrySyncProperty, CursorStore, PropertyRegistryConfig, FeedStreamQuery, FeedStreamMessage, FeedHeartbeat, FeedStreamErrorData, OpenFeedStreamOptions, FeedFreshness, } from './registry/index.mjs';
|
|
3
5
|
export { openFeedStream, parseSseStream, sanitizeStreamText, DEFAULT_MAX_SSE_FRAME_BYTES, FeedStreamError, FeedStreamUnsupportedError, FeedStreamCursorExpiredError, FeedStreamHttpError, FeedStreamParseError, } from './registry/index.mjs';
|
|
@@ -57,7 +59,7 @@ export { MemoryStorage, createMemoryStorage, createMemoryStorageConfig } from '.
|
|
|
57
59
|
export { ADCPError, TaskTimeoutError, MaxClarificationError, DeferredTaskError, TaskAbortedError, AgentNotFoundError, UnsupportedTaskError, ProtocolError, ValidationError as ADCPValidationError, // Rename to avoid conflict
|
|
58
60
|
MissingInputHandlerError, InvalidContextError, ConfigurationError, AuthenticationCredentialsRejectedError, AuthenticationRequiredError, FeatureUnsupportedError, ProtocolFeatureUnsupportedError, UnsupportedBuyingModeError, AccountRequiredError, AccountPendingApprovalError, AccountAmbiguousError, BuyerSetupError, AccountNotFoundError, AccountSetupRequiredError, AccountPaymentRequiredError, AccountNotProvisionedError, SDK_ERROR_TO_PROTOCOL_ERROR_CODE, VersionUnsupportedError, IdempotencyConflictError, IdempotencyExpiredError, ResponseTooLargeError, ActionNotAllowedError, adcpErrorToTypedError, getClientPreflightAdcpError, isADCPError, isErrorOfType, extractErrorInfo, is401Error, mapSdkErrorCodeToProtocolErrorCode, } from './errors/index.mjs';
|
|
59
61
|
export type { OAuthMetadataInfo, ClientPreflightAdcpErrorInfo, ClientPreflightAdcpErrorRecovery, FeatureUnsupportedErrorOptions, ProtocolFeatureUnsupportedErrorOptions, ActionNotAllowedErrorDetails, ActionNotAllowedReasonValue, ActionNotAllowedAttemptedAction, ActionNotAllowedAvailableAction, ActionNotAllowedRecovery, } from './errors/index.mjs';
|
|
60
|
-
export type { ActionNotAllowedDetails, ActionNotAllowedReason, AvailableActionsResult, AvailableActionsSource, DecomposedUpdateMediaBuy, DecomposedUpdateMediaBuyMutation, LegacyCoarseAction, MediaBuyActionContext, MediaBuyActionId, MediaBuyActionMode, MediaBuyAvailableAction, MediaBuyMutationDirection, MediaBuyMutationScope, MediaBuyUpdateFieldAction, MediaBuyValidAction, ModeMismatchRecovery, PreflightAllowed, PreflightDenial, PreflightDenied, BuyerPropertyPolicy, NormalizedPolicyDomain, ProductPolicyProductLike, ProductPropertyPolicyDiagnostic, ProductPropertyPolicyDiagnosticCode, ProductPropertyPolicyDiagnosticSeverity, ProductPropertyPolicyMode, ProductPropertyPolicySelectorBehavior, ProductPropertyPolicyValidationResult, PreflightResult, ResolvedAction, SLAWindow, SlaWindow, StructuredOnlyMediaBuyAction, ResolvedTargetingInput, TargetingInputFor, ValidateProductsAgainstPropertyPolicyOptions, UpdateFieldEntry, UpdateMediaBuyRequestLike, } from './media-buy/index.mjs';
|
|
62
|
+
export type { ActionNotAllowedDetails, ActionNotAllowedReason, AvailableActionsResult, AvailableActionsSource, DecomposedUpdateMediaBuy, DecomposedUpdateMediaBuyMutation, LegacyCoarseAction, MediaBuyActionContext, MediaBuyActionId, MediaBuyActionMode, MediaBuyAvailableAction, MediaBuyMutationDirection, MediaBuyMutationScope, MediaBuyUpdateFieldAction, MediaBuyValidAction, ModeMismatchRecovery, PreflightAllowed, PreflightDenial, PreflightDenied, BuyerPropertyPolicy, NormalizedPolicyDomain, ProductPolicyProductLike, ProductPolicyResolvedProperty, ProductPropertyPolicyIdentifier, ProductPropertyPolicyDiagnostic, ProductPropertyPolicyDiagnosticCode, ProductPropertyPolicyDiagnosticSeverity, ProductPropertyPolicyMode, ProductPropertyPolicySelectorBehavior, ProductPropertyPolicyValidationResult, PreflightResult, ResolvedAction, SLAWindow, SlaWindow, StructuredOnlyMediaBuyAction, ResolvedTargetingInput, TargetingInputFor, ValidateProductsAgainstPropertyPolicyOptions, UpdateFieldEntry, UpdateMediaBuyRequestLike, } from './media-buy/index.mjs';
|
|
61
63
|
export { ACTIONS_BY_FIELD, LEGACY_COARSE_ACTIONS, STRUCTURED_ONLY_MEDIA_BUY_ACTIONS, UPDATE_FIELDS_BY_ACTION, applyTargetingInput, hasTargetingClears, resolveTargetingInput, canAddPackages, canCancel, canDecreaseBudget, canExtendFlight, canIncreaseBudget, canPause, canReallocateBudget, canRemoveCreative, canRemovePackages, canReplaceCreative, canResume, canShortenFlight, canUpdateCreativeAssignments, canUpdateFlightDates, canUpdateFrequencyCaps, canUpdatePacing, canUpdateTargeting, decomposeUpdateMediaBuy, findAvailableAction, getActionForMutation, getAvailableActions, getRollupParent, ProductPropertyPolicyError, normalizeDomainForPropertyPolicy, preflightUpdateMediaBuy, recoveryForModeMismatch, validateProductsAgainstPropertyPolicy, } from './media-buy/index.mjs';
|
|
62
64
|
export { InputRequiredError } from './core/TaskExecutor.mjs';
|
|
63
65
|
export { generateIdempotencyKey, isMutatingTask, requestUsesIdempotency, isValidIdempotencyKey, useIdempotencyKey, redactIdempotencyKey, IDEMPOTENCY_KEY_PATTERN, MUTATING_TASKS, } from './utils/idempotency.mjs';
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from './identifiers';
|
|
2
|
+
export type { ResolveIdentifiersAllOptions, ResolveIdentifierOutcome } from './registry';
|
|
1
3
|
export { RegistryClient, RegistryRequestError, isRegistryRequestError, RegistrySync, PropertyRegistry, InMemoryCursorStore, FileCursorStore, buildCommunityMirrorAdagents, } from './registry';
|
|
2
4
|
export type { RegistrySyncConfig, RegistrySyncState, RegistrySyncTransport, RegistrySyncEvents, AgentFilter, RegistrySyncProperty, CursorStore, PropertyRegistryConfig, FeedStreamQuery, FeedStreamMessage, FeedHeartbeat, FeedStreamErrorData, OpenFeedStreamOptions, FeedFreshness, } from './registry';
|
|
3
5
|
export { openFeedStream, parseSseStream, sanitizeStreamText, DEFAULT_MAX_SSE_FRAME_BYTES, FeedStreamError, FeedStreamUnsupportedError, FeedStreamCursorExpiredError, FeedStreamHttpError, FeedStreamParseError, } from './registry';
|
|
@@ -57,7 +59,7 @@ export { MemoryStorage, createMemoryStorage, createMemoryStorageConfig } from '.
|
|
|
57
59
|
export { ADCPError, TaskTimeoutError, MaxClarificationError, DeferredTaskError, TaskAbortedError, AgentNotFoundError, UnsupportedTaskError, ProtocolError, ValidationError as ADCPValidationError, // Rename to avoid conflict
|
|
58
60
|
MissingInputHandlerError, InvalidContextError, ConfigurationError, AuthenticationCredentialsRejectedError, AuthenticationRequiredError, FeatureUnsupportedError, ProtocolFeatureUnsupportedError, UnsupportedBuyingModeError, AccountRequiredError, AccountPendingApprovalError, AccountAmbiguousError, BuyerSetupError, AccountNotFoundError, AccountSetupRequiredError, AccountPaymentRequiredError, AccountNotProvisionedError, SDK_ERROR_TO_PROTOCOL_ERROR_CODE, VersionUnsupportedError, IdempotencyConflictError, IdempotencyExpiredError, ResponseTooLargeError, ActionNotAllowedError, adcpErrorToTypedError, getClientPreflightAdcpError, isADCPError, isErrorOfType, extractErrorInfo, is401Error, mapSdkErrorCodeToProtocolErrorCode, } from './errors';
|
|
59
61
|
export type { OAuthMetadataInfo, ClientPreflightAdcpErrorInfo, ClientPreflightAdcpErrorRecovery, FeatureUnsupportedErrorOptions, ProtocolFeatureUnsupportedErrorOptions, ActionNotAllowedErrorDetails, ActionNotAllowedReasonValue, ActionNotAllowedAttemptedAction, ActionNotAllowedAvailableAction, ActionNotAllowedRecovery, } from './errors';
|
|
60
|
-
export type { ActionNotAllowedDetails, ActionNotAllowedReason, AvailableActionsResult, AvailableActionsSource, DecomposedUpdateMediaBuy, DecomposedUpdateMediaBuyMutation, LegacyCoarseAction, MediaBuyActionContext, MediaBuyActionId, MediaBuyActionMode, MediaBuyAvailableAction, MediaBuyMutationDirection, MediaBuyMutationScope, MediaBuyUpdateFieldAction, MediaBuyValidAction, ModeMismatchRecovery, PreflightAllowed, PreflightDenial, PreflightDenied, BuyerPropertyPolicy, NormalizedPolicyDomain, ProductPolicyProductLike, ProductPropertyPolicyDiagnostic, ProductPropertyPolicyDiagnosticCode, ProductPropertyPolicyDiagnosticSeverity, ProductPropertyPolicyMode, ProductPropertyPolicySelectorBehavior, ProductPropertyPolicyValidationResult, PreflightResult, ResolvedAction, SLAWindow, SlaWindow, StructuredOnlyMediaBuyAction, ResolvedTargetingInput, TargetingInputFor, ValidateProductsAgainstPropertyPolicyOptions, UpdateFieldEntry, UpdateMediaBuyRequestLike, } from './media-buy';
|
|
62
|
+
export type { ActionNotAllowedDetails, ActionNotAllowedReason, AvailableActionsResult, AvailableActionsSource, DecomposedUpdateMediaBuy, DecomposedUpdateMediaBuyMutation, LegacyCoarseAction, MediaBuyActionContext, MediaBuyActionId, MediaBuyActionMode, MediaBuyAvailableAction, MediaBuyMutationDirection, MediaBuyMutationScope, MediaBuyUpdateFieldAction, MediaBuyValidAction, ModeMismatchRecovery, PreflightAllowed, PreflightDenial, PreflightDenied, BuyerPropertyPolicy, NormalizedPolicyDomain, ProductPolicyProductLike, ProductPolicyResolvedProperty, ProductPropertyPolicyIdentifier, ProductPropertyPolicyDiagnostic, ProductPropertyPolicyDiagnosticCode, ProductPropertyPolicyDiagnosticSeverity, ProductPropertyPolicyMode, ProductPropertyPolicySelectorBehavior, ProductPropertyPolicyValidationResult, PreflightResult, ResolvedAction, SLAWindow, SlaWindow, StructuredOnlyMediaBuyAction, ResolvedTargetingInput, TargetingInputFor, ValidateProductsAgainstPropertyPolicyOptions, UpdateFieldEntry, UpdateMediaBuyRequestLike, } from './media-buy';
|
|
61
63
|
export { ACTIONS_BY_FIELD, LEGACY_COARSE_ACTIONS, STRUCTURED_ONLY_MEDIA_BUY_ACTIONS, UPDATE_FIELDS_BY_ACTION, applyTargetingInput, hasTargetingClears, resolveTargetingInput, canAddPackages, canCancel, canDecreaseBudget, canExtendFlight, canIncreaseBudget, canPause, canReallocateBudget, canRemoveCreative, canRemovePackages, canReplaceCreative, canResume, canShortenFlight, canUpdateCreativeAssignments, canUpdateFlightDates, canUpdateFrequencyCaps, canUpdatePacing, canUpdateTargeting, decomposeUpdateMediaBuy, findAvailableAction, getActionForMutation, getAvailableActions, getRollupParent, ProductPropertyPolicyError, normalizeDomainForPropertyPolicy, preflightUpdateMediaBuy, recoveryForModeMismatch, validateProductsAgainstPropertyPolicy, } from './media-buy';
|
|
62
64
|
export { InputRequiredError } from './core/TaskExecutor';
|
|
63
65
|
export { generateIdempotencyKey, isMutatingTask, requestUsesIdempotency, isValidIdempotencyKey, useIdempotencyKey, redactIdempotencyKey, IDEMPOTENCY_KEY_PATTERN, MUTATING_TASKS, } from './utils/idempotency';
|
package/dist/lib/index.js
CHANGED
|
@@ -735,6 +735,7 @@ __export(index_exports, {
|
|
|
735
735
|
withSpan: () => import_observability.withSpan
|
|
736
736
|
});
|
|
737
737
|
module.exports = __toCommonJS(index_exports);
|
|
738
|
+
__reExport(index_exports, require('./identifiers.js'), module.exports);
|
|
738
739
|
var import_registry = require('./registry/index.js');
|
|
739
740
|
var import_registry2 = require('./registry/index.js');
|
|
740
741
|
var import_brand = require('./brand/index.js');
|
|
@@ -1583,6 +1584,7 @@ function createAdCPClientFromEnv() {
|
|
|
1583
1584
|
withAdditiveCanonicalFormatOptions,
|
|
1584
1585
|
withMCPConnectionScope,
|
|
1585
1586
|
withSpan,
|
|
1587
|
+
...require('./identifiers.js'),
|
|
1586
1588
|
...require('./principal/index.js'),
|
|
1587
1589
|
...require('./handlers/types.js'),
|
|
1588
1590
|
...require('./negotiation/index.js'),
|
package/dist/lib/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ export { LEGACY_COARSE_ACTIONS } from './types.mjs';
|
|
|
4
4
|
export type { LiveMediaBuyAction } from './action-types.mjs';
|
|
5
5
|
export type { AvailableActionsResult, AvailableActionsSource } from './available-actions.mjs';
|
|
6
6
|
export { findAvailableAction, getAvailableActions, getRollupParent, __resetValidActionsWarningForTests, } from './available-actions.mjs';
|
|
7
|
-
export type { BuyerPropertyPolicy, NormalizedPolicyDomain, ProductPolicyProductLike, ProductPropertyPolicyDiagnostic, ProductPropertyPolicyDiagnosticCode, ProductPropertyPolicyDiagnosticSeverity, ProductPropertyPolicyMode, ProductPropertyPolicySelectorBehavior, ProductPropertyPolicyValidationResult, ValidateProductsAgainstPropertyPolicyOptions, } from './property-policy.mjs';
|
|
7
|
+
export type { BuyerPropertyPolicy, NormalizedPolicyDomain, ProductPolicyProductLike, ProductPolicyResolvedProperty, ProductPropertyPolicyIdentifier, ProductPropertyPolicyDiagnostic, ProductPropertyPolicyDiagnosticCode, ProductPropertyPolicyDiagnosticSeverity, ProductPropertyPolicyMode, ProductPropertyPolicySelectorBehavior, ProductPropertyPolicyValidationResult, ValidateProductsAgainstPropertyPolicyOptions, } from './property-policy.mjs';
|
|
8
8
|
export { ProductPropertyPolicyError, normalizeDomainForPropertyPolicy, validateProductsAgainstPropertyPolicy, } from './property-policy.mjs';
|
|
9
9
|
export type { DecomposedUpdateMediaBuy, DecomposedUpdateMediaBuyMutation, MediaBuyMutationDirection, MediaBuyMutationScope, ModeMismatchRecovery, PreflightAllowed, PreflightDenial, PreflightDenied, PreflightResult, ResolvedAction, } from './preflight.mjs';
|
|
10
10
|
export { canAddPackages, canCancel, canDecreaseBudget, canExtendFlight, canIncreaseBudget, canPause, canReallocateBudget, canRemoveCreative, canRemovePackages, canReplaceCreative, canResume, canShortenFlight, canUpdateCreativeAssignments, canUpdateFlightDates, canUpdateFrequencyCaps, canUpdatePacing, canUpdateTargeting, decomposeUpdateMediaBuy, getActionForMutation, preflightUpdateMediaBuy, recoveryForModeMismatch, } from './preflight.mjs';
|
|
@@ -4,7 +4,7 @@ export { LEGACY_COARSE_ACTIONS } from './types';
|
|
|
4
4
|
export type { LiveMediaBuyAction } from './action-types';
|
|
5
5
|
export type { AvailableActionsResult, AvailableActionsSource } from './available-actions';
|
|
6
6
|
export { findAvailableAction, getAvailableActions, getRollupParent, __resetValidActionsWarningForTests, } from './available-actions';
|
|
7
|
-
export type { BuyerPropertyPolicy, NormalizedPolicyDomain, ProductPolicyProductLike, ProductPropertyPolicyDiagnostic, ProductPropertyPolicyDiagnosticCode, ProductPropertyPolicyDiagnosticSeverity, ProductPropertyPolicyMode, ProductPropertyPolicySelectorBehavior, ProductPropertyPolicyValidationResult, ValidateProductsAgainstPropertyPolicyOptions, } from './property-policy';
|
|
7
|
+
export type { BuyerPropertyPolicy, NormalizedPolicyDomain, ProductPolicyProductLike, ProductPolicyResolvedProperty, ProductPropertyPolicyIdentifier, ProductPropertyPolicyDiagnostic, ProductPropertyPolicyDiagnosticCode, ProductPropertyPolicyDiagnosticSeverity, ProductPropertyPolicyMode, ProductPropertyPolicySelectorBehavior, ProductPropertyPolicyValidationResult, ValidateProductsAgainstPropertyPolicyOptions, } from './property-policy';
|
|
8
8
|
export { ProductPropertyPolicyError, normalizeDomainForPropertyPolicy, validateProductsAgainstPropertyPolicy, } from './property-policy';
|
|
9
9
|
export type { DecomposedUpdateMediaBuy, DecomposedUpdateMediaBuyMutation, MediaBuyMutationDirection, MediaBuyMutationScope, ModeMismatchRecovery, PreflightAllowed, PreflightDenial, PreflightDenied, PreflightResult, ResolvedAction, } from './preflight';
|
|
10
10
|
export { canAddPackages, canCancel, canDecreaseBudget, canExtendFlight, canIncreaseBudget, canPause, canReallocateBudget, canRemoveCreative, canRemovePackages, canReplaceCreative, canResume, canShortenFlight, canUpdateCreativeAssignments, canUpdateFlightDates, canUpdateFrequencyCaps, canUpdatePacing, canUpdateTargeting, decomposeUpdateMediaBuy, getActionForMutation, preflightUpdateMediaBuy, recoveryForModeMismatch, } from './preflight';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function isSupportedPropertyIdentifierType(type: string): boolean;
|
|
1
2
|
export type ProductPropertyPolicyMode = 'audit' | 'filter' | 'reject_response';
|
|
2
3
|
export type ProductPropertyPolicySelectorBehavior = 'allow' | 'flag' | 'reject';
|
|
3
4
|
export interface BuyerPropertyPolicy {
|
|
@@ -10,6 +11,13 @@ export interface BuyerPropertyPolicy {
|
|
|
10
11
|
* `*.example.com` matches subdomains only).
|
|
11
12
|
*/
|
|
12
13
|
allowedPropertyIdentifiers?: readonly ProductPropertyPolicyIdentifier[];
|
|
14
|
+
/**
|
|
15
|
+
* Complete publisher catalogs, keyed by canonical publisher domain. Enables
|
|
16
|
+
* app/CTV identifier matching for all/by_id/by_tag selectors. Omitted keys
|
|
17
|
+
* mean unresolved metadata; an empty array means a known empty catalog.
|
|
18
|
+
* Property IDs remain publisher-scoped and are never treated as app IDs.
|
|
19
|
+
*/
|
|
20
|
+
publisherProperties?: Readonly<Record<string, readonly ProductPolicyResolvedProperty[] | undefined>>;
|
|
13
21
|
/**
|
|
14
22
|
* Require products to match the allowed domain/identifier set even when that
|
|
15
23
|
* set is empty. Used when a request property_list resolves successfully to
|
|
@@ -56,7 +64,12 @@ export interface ProductPropertyPolicyIdentifier {
|
|
|
56
64
|
type: string;
|
|
57
65
|
value: string;
|
|
58
66
|
}
|
|
59
|
-
export
|
|
67
|
+
export interface ProductPolicyResolvedProperty {
|
|
68
|
+
property_id?: string;
|
|
69
|
+
identifiers: readonly ProductPropertyPolicyIdentifier[];
|
|
70
|
+
tags?: readonly string[];
|
|
71
|
+
}
|
|
72
|
+
export type ProductPropertyPolicyDiagnosticCode = 'outside_property_list' | 'excluded_domain' | 'excluded_property_id' | 'missing_publisher_properties' | 'unresolved_tag_selector' | 'unknown_selector' | 'malformed_publisher_domain' | 'unresolved_property_identifiers' | 'excluded_resolved_property';
|
|
60
73
|
export type ProductPropertyPolicyDiagnosticSeverity = 'rejected' | 'flagged';
|
|
61
74
|
export interface ProductPropertyPolicyDiagnostic {
|
|
62
75
|
code: ProductPropertyPolicyDiagnosticCode;
|
|
@@ -75,6 +88,7 @@ export interface ProductPropertyPolicyDiagnostic {
|
|
|
75
88
|
matched_excluded_domain?: string;
|
|
76
89
|
property_ids?: string[];
|
|
77
90
|
matched_property_ids?: string[];
|
|
91
|
+
identifier_types?: string[];
|
|
78
92
|
}
|
|
79
93
|
export interface ProductPropertyPolicyValidationResult<TProduct extends ProductPolicyProductLike> {
|
|
80
94
|
mode: ProductPropertyPolicyMode;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function isSupportedPropertyIdentifierType(type: string): boolean;
|
|
1
2
|
export type ProductPropertyPolicyMode = 'audit' | 'filter' | 'reject_response';
|
|
2
3
|
export type ProductPropertyPolicySelectorBehavior = 'allow' | 'flag' | 'reject';
|
|
3
4
|
export interface BuyerPropertyPolicy {
|
|
@@ -10,6 +11,13 @@ export interface BuyerPropertyPolicy {
|
|
|
10
11
|
* `*.example.com` matches subdomains only).
|
|
11
12
|
*/
|
|
12
13
|
allowedPropertyIdentifiers?: readonly ProductPropertyPolicyIdentifier[];
|
|
14
|
+
/**
|
|
15
|
+
* Complete publisher catalogs, keyed by canonical publisher domain. Enables
|
|
16
|
+
* app/CTV identifier matching for all/by_id/by_tag selectors. Omitted keys
|
|
17
|
+
* mean unresolved metadata; an empty array means a known empty catalog.
|
|
18
|
+
* Property IDs remain publisher-scoped and are never treated as app IDs.
|
|
19
|
+
*/
|
|
20
|
+
publisherProperties?: Readonly<Record<string, readonly ProductPolicyResolvedProperty[] | undefined>>;
|
|
13
21
|
/**
|
|
14
22
|
* Require products to match the allowed domain/identifier set even when that
|
|
15
23
|
* set is empty. Used when a request property_list resolves successfully to
|
|
@@ -56,7 +64,12 @@ export interface ProductPropertyPolicyIdentifier {
|
|
|
56
64
|
type: string;
|
|
57
65
|
value: string;
|
|
58
66
|
}
|
|
59
|
-
export
|
|
67
|
+
export interface ProductPolicyResolvedProperty {
|
|
68
|
+
property_id?: string;
|
|
69
|
+
identifiers: readonly ProductPropertyPolicyIdentifier[];
|
|
70
|
+
tags?: readonly string[];
|
|
71
|
+
}
|
|
72
|
+
export type ProductPropertyPolicyDiagnosticCode = 'outside_property_list' | 'excluded_domain' | 'excluded_property_id' | 'missing_publisher_properties' | 'unresolved_tag_selector' | 'unknown_selector' | 'malformed_publisher_domain' | 'unresolved_property_identifiers' | 'excluded_resolved_property';
|
|
60
73
|
export type ProductPropertyPolicyDiagnosticSeverity = 'rejected' | 'flagged';
|
|
61
74
|
export interface ProductPropertyPolicyDiagnostic {
|
|
62
75
|
code: ProductPropertyPolicyDiagnosticCode;
|
|
@@ -75,6 +88,7 @@ export interface ProductPropertyPolicyDiagnostic {
|
|
|
75
88
|
matched_excluded_domain?: string;
|
|
76
89
|
property_ids?: string[];
|
|
77
90
|
matched_property_ids?: string[];
|
|
91
|
+
identifier_types?: string[];
|
|
78
92
|
}
|
|
79
93
|
export interface ProductPropertyPolicyValidationResult<TProduct extends ProductPolicyProductLike> {
|
|
80
94
|
mode: ProductPropertyPolicyMode;
|