@adcp/sdk 9.5.0 → 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/AsyncHandler.d.ts +6 -0
- package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
- package/dist/lib/core/AsyncHandler.js.map +1 -1
- package/dist/lib/core/ConversationTypes.d.ts +14 -0
- package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts +31 -0
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +84 -0
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +3 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +3 -1
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/substitution/index.d.ts +2 -0
- package/dist/lib/substitution/index.d.ts.map +1 -1
- package/dist/lib/substitution/index.js +3 -1
- package/dist/lib/substitution/index.js.map +1 -1
- package/dist/lib/substitution/observer/html-parser.d.ts.map +1 -1
- package/dist/lib/substitution/observer/html-parser.js +27 -9
- package/dist/lib/substitution/observer/html-parser.js.map +1 -1
- package/dist/lib/substitution/translate.d.ts +89 -0
- package/dist/lib/substitution/translate.d.ts.map +1 -0
- package/dist/lib/substitution/translate.js +144 -0
- package/dist/lib/substitution/translate.js.map +1 -0
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +36 -9
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/substitution/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC1F,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAEhG,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE1F,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,gCAAgC,EAChC,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE1G,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/substitution/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC1F,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAEhG,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE1F,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,gCAAgC,EAChC,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE1G,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.divergenceOffset = exports.isUnreservedOnly = exports.equalUnderHexCasePolicy = exports.encodeUnreserved = exports.DEFAULT_SSRF_POLICY = exports.enforceSsrfPolicyResolved = exports.enforceSsrfPolicy = exports.DEFAULT_MACRO_PROHIBITED_PATTERN = exports.assertUnreservedOnly = exports.assertSchemePreserved = exports.assertRfc3986Safe = exports.assertNoNestedExpansion = exports.matchBindings = exports.extractTrackerUrls = exports.getCatalogMacroVector = exports.CATALOG_MACRO_VECTORS = exports.MacroInRawValueError = exports.SubstitutionEncoder = exports.PreviewFetchError = exports.SubstitutionObserver = void 0;
|
|
30
|
+
exports.translateUniversalMacros = exports.divergenceOffset = exports.isUnreservedOnly = exports.equalUnderHexCasePolicy = exports.encodeUnreserved = exports.DEFAULT_SSRF_POLICY = exports.enforceSsrfPolicyResolved = exports.enforceSsrfPolicy = exports.DEFAULT_MACRO_PROHIBITED_PATTERN = exports.assertUnreservedOnly = exports.assertSchemePreserved = exports.assertRfc3986Safe = exports.assertNoNestedExpansion = exports.matchBindings = exports.extractTrackerUrls = exports.getCatalogMacroVector = exports.CATALOG_MACRO_VECTORS = exports.MacroInRawValueError = exports.SubstitutionEncoder = exports.PreviewFetchError = exports.SubstitutionObserver = void 0;
|
|
31
31
|
var SubstitutionObserver_1 = require("./observer/SubstitutionObserver");
|
|
32
32
|
Object.defineProperty(exports, "SubstitutionObserver", { enumerable: true, get: function () { return SubstitutionObserver_1.SubstitutionObserver; } });
|
|
33
33
|
Object.defineProperty(exports, "PreviewFetchError", { enumerable: true, get: function () { return SubstitutionObserver_1.PreviewFetchError; } });
|
|
@@ -53,4 +53,6 @@ Object.defineProperty(exports, "encodeUnreserved", { enumerable: true, get: func
|
|
|
53
53
|
Object.defineProperty(exports, "equalUnderHexCasePolicy", { enumerable: true, get: function () { return rfc3986_1.equalUnderHexCasePolicy; } });
|
|
54
54
|
Object.defineProperty(exports, "isUnreservedOnly", { enumerable: true, get: function () { return rfc3986_1.isUnreservedOnly; } });
|
|
55
55
|
Object.defineProperty(exports, "divergenceOffset", { enumerable: true, get: function () { return rfc3986_1.divergenceOffset; } });
|
|
56
|
+
var translate_1 = require("./translate");
|
|
57
|
+
Object.defineProperty(exports, "translateUniversalMacros", { enumerable: true, get: function () { return translate_1.translateUniversalMacros; } });
|
|
56
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/substitution/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAEH,wEAA0F;AAAjF,4HAAA,oBAAoB,OAAA;AAAE,yHAAA,iBAAiB,OAAA;AAGhD,qEAA0F;AAAjF,0HAAA,mBAAmB,OAAA;AAAE,2HAAA,oBAAoB,OAAA;AAElD,qCAAyE;AAAhE,g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CAAuD;AAA9C,qHAAA,wBAAwB,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-parser.d.ts","sourceRoot":"","sources":["../../../../src/lib/substitution/observer/html-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA6BjD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CA0BnE;
|
|
1
|
+
{"version":3,"file":"html-parser.d.ts","sourceRoot":"","sources":["../../../../src/lib/substitution/observer/html-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA6BjD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CA0BnE;AAiQD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D"}
|
|
@@ -230,10 +230,11 @@ function collectAttributes(body, tag, line, out) {
|
|
|
230
230
|
* `}`.
|
|
231
231
|
*
|
|
232
232
|
* This is NOT the full HTML5 named-character-reference table (~2200
|
|
233
|
-
* entries). The decoder additionally post-filters
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
233
|
+
* entries). The decoder additionally post-filters via
|
|
234
|
+
* `__hasResidualEntity`: if the value still contains a browser-decodable
|
|
235
|
+
* entity this table missed (a `&name;` with a trailing semicolon, or a
|
|
236
|
+
* numeric `&#...` reference), it is treated as undecodable and the URL is
|
|
237
|
+
* dropped — refusing to classify rather than risking under-extraction.
|
|
237
238
|
*/
|
|
238
239
|
const NAMED_ENTITIES = {
|
|
239
240
|
amp: '&',
|
|
@@ -270,12 +271,29 @@ const NAMED_ENTITIES = {
|
|
|
270
271
|
percnt: '%',
|
|
271
272
|
};
|
|
272
273
|
/**
|
|
273
|
-
* Detects an ampersand
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
* rather than extract a
|
|
274
|
+
* Detects an ampersand sequence that a browser would decode but the
|
|
275
|
+
* limited `NAMED_ENTITIES` table above did not — after decoding, any
|
|
276
|
+
* match signals browser-visible content that diverges from what we
|
|
277
|
+
* extracted, so callers drop the value rather than extract a
|
|
278
|
+
* partially-decoded URL.
|
|
279
|
+
*
|
|
280
|
+
* Two branches mirror how browsers decode references:
|
|
281
|
+
*
|
|
282
|
+
* - NAMED (`&name;`): a trailing semicolon is REQUIRED. Browsers only
|
|
283
|
+
* decode a fixed legacy set of named references without a semicolon
|
|
284
|
+
* (`&`, `<`, `>`, `"`, `©`, ` `, `Æ`, ...),
|
|
285
|
+
* and none of those legacy no-semicolon entities are the dangerous
|
|
286
|
+
* URL-scheme chars (`:`, `/`, `\`) — those require the semicolon
|
|
287
|
+
* (`:`, `/`, `\`). Demanding a semicolon here means a
|
|
288
|
+
* literal query string like `?mb=1&pkg=2` (which a browser renders
|
|
289
|
+
* verbatim, decoding nothing) is not mistaken for a smuggled entity,
|
|
290
|
+
* while `&someentity;` the table missed still trips the check.
|
|
291
|
+
* - NUMERIC (`:` / `:`): the semicolon is optional, matching
|
|
292
|
+
* the browser's lenient numeric decoding. A `&key=value` query never
|
|
293
|
+
* starts a key with `#`, so this branch does not collide with normal
|
|
294
|
+
* query strings.
|
|
277
295
|
*/
|
|
278
|
-
const RESIDUAL_ENTITY_RE = /&(?:[A-Za-z][A-Za-z0-9]{1,31}
|
|
296
|
+
const RESIDUAL_ENTITY_RE = /&(?:[A-Za-z][A-Za-z0-9]{1,31};|#[xX]?[0-9A-Fa-f]+;?)/;
|
|
279
297
|
function decodeHtmlEntities(s) {
|
|
280
298
|
return (s
|
|
281
299
|
.replace(/&#[xX]([0-9A-Fa-f]+);?/g, (_, hex) => safeCodePoint(parseInt(hex, 16)))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-parser.js","sourceRoot":"","sources":["../../../../src/lib/substitution/observer/html-parser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAqCH,gDA0BC;
|
|
1
|
+
{"version":3,"file":"html-parser.js","sourceRoot":"","sources":["../../../../src/lib/substitution/observer/html-parser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAqCH,gDA0BC;AAuQD,kDAEC;AApUD,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAEhD,MAAM,kBAAkB,GAAsC;IAC5D,CAAC,EAAE,CAAC,MAAM,CAAC;IACX,GAAG,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;IACtB,MAAM,EAAE,CAAC,KAAK,CAAC;IACf,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,SAAS,CAAC;CAClB,CAAC;AAEF,MAAM,cAAc,GAAsB;IACxC,qBAAqB;IACrB,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;CAChB,CAAC;AAEF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AASzC;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,IAAY;IAC7C,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,OAAO,GAAuB,EAAE,CAAC;IACvC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACjF,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YACzB,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,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tB,CAAC,CAAC,CACL,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,EAAU;IAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,QAAQ;QAAE,OAAO,QAAQ,CAAC;IACrE,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IACjD,OAAO,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seller-side helper that translates universal macro tokens in a pixel URL's
|
|
3
|
+
* query parameter VALUES using a caller-supplied mapping. Macro tokens in key
|
|
4
|
+
* position pass through untouched — only query-parameter values are translated.
|
|
5
|
+
*
|
|
6
|
+
* Universal macros match `\{[A-Z][A-Z0-9_]*\}` (upper-snake, single braces).
|
|
7
|
+
* Native ad-server tokens (`%%X%%`, `{{x}}`) are not matched and pass through.
|
|
8
|
+
*
|
|
9
|
+
* Per query parameter:
|
|
10
|
+
* - No universal macro → left untouched (literal param passes through).
|
|
11
|
+
* - All macros in the param are in `mapping` → every occurrence replaced in
|
|
12
|
+
* a single pass. A `native` entry is inserted raw; a `value` entry is
|
|
13
|
+
* percent-encoded with the RFC 3986 unreserved whitelist.
|
|
14
|
+
* - Any macro in the param is NOT in `mapping` → the entire parameter is
|
|
15
|
+
* dropped, its key is recorded in `dropped_params`, and each unmapped
|
|
16
|
+
* macro token is recorded in `unmapped_macros`.
|
|
17
|
+
*
|
|
18
|
+
* The substitution is a single pass: a translated value that itself contains
|
|
19
|
+
* `{…}` is not re-expanded.
|
|
20
|
+
*
|
|
21
|
+
* A URL ending in a bare `?` with no parameters returns without the trailing
|
|
22
|
+
* `?` (e.g. `https://px.example/i?` → `https://px.example/i`).
|
|
23
|
+
*
|
|
24
|
+
* Privacy note: dropping a parameter whose macro is unmapped silently removes
|
|
25
|
+
* that tracker — including consent/privacy macros (`{GDPR_CONSENT}`,
|
|
26
|
+
* `{US_PRIVACY}`) if a mapping is forgotten. Consent/privacy macros that get
|
|
27
|
+
* dropped are surfaced separately in `dropped_consent_macros`; callers SHOULD
|
|
28
|
+
* inspect it (and `unmapped_macros`) so a missing consent signal is caught
|
|
29
|
+
* rather than shipped as a degraded pixel.
|
|
30
|
+
*
|
|
31
|
+
* URLSearchParams is intentionally avoided — it force-encodes values and would
|
|
32
|
+
* corrupt native ad-server tokens (e.g. `%%GDPR%%`). Query manipulation is
|
|
33
|
+
* done textually so native tokens remain raw and value-encoding is controlled.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* A mapping from universal macro token (e.g. `'{GDPR}'`) to either:
|
|
37
|
+
* - `{ native: string }` — inserted verbatim (not percent-encoded), for
|
|
38
|
+
* downstream ad-server tokens like `%%GDPR%%`.
|
|
39
|
+
* - `{ value: string }` — inserted after RFC 3986 unreserved-whitelist
|
|
40
|
+
* percent-encoding, for seller-supplied data values.
|
|
41
|
+
*/
|
|
42
|
+
export type MacroMapping = Record<string, {
|
|
43
|
+
native: string;
|
|
44
|
+
} | {
|
|
45
|
+
value: string;
|
|
46
|
+
}>;
|
|
47
|
+
/** Result of {@link translateUniversalMacros}. */
|
|
48
|
+
export interface TranslateResult {
|
|
49
|
+
/** The translated URL. Base, path, and fragment are unchanged. */
|
|
50
|
+
url: string;
|
|
51
|
+
/**
|
|
52
|
+
* Keys of query parameters that were dropped due to unmapped macros.
|
|
53
|
+
* One entry per dropped parameter instance, so a repeated key can appear
|
|
54
|
+
* more than once.
|
|
55
|
+
*/
|
|
56
|
+
dropped_params: string[];
|
|
57
|
+
/**
|
|
58
|
+
* Unique unmapped macro tokens encountered across all dropped parameters.
|
|
59
|
+
* Deduplicated: the same token is recorded at most once regardless of how
|
|
60
|
+
* many parameters reference it.
|
|
61
|
+
*/
|
|
62
|
+
unmapped_macros: string[];
|
|
63
|
+
/**
|
|
64
|
+
* Subset of `unmapped_macros` that are consent/privacy signals (`{GDPR}`,
|
|
65
|
+
* `{GDPR_CONSENT}`, `{US_PRIVACY}`, `{GPP_STRING}`, `{GPP_SID}`,
|
|
66
|
+
* `{LIMIT_AD_TRACKING}`). Surfaced separately so a forgotten-mapping drop of
|
|
67
|
+
* a compliance-relevant macro isn't lost among benign drops. Deduplicated.
|
|
68
|
+
*/
|
|
69
|
+
dropped_consent_macros: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Macro tokens whose `value` entry looks like a native ad-server token
|
|
72
|
+
* (`%%…%%`, `{{…}}`, `${…}`, `[UPPER_SNAKE]`). Such a value will be
|
|
73
|
+
* percent-encoded and break at impression time — almost always it should
|
|
74
|
+
* have been a `native` entry. Deduplicated.
|
|
75
|
+
*
|
|
76
|
+
* Note: this is mapping-scoped, not URL-scoped — it lints the whole
|
|
77
|
+
* `mapping`, so a suspect entry is reported even if its macro never appears
|
|
78
|
+
* in `input_pixel_url` (unlike `unmapped_macros`/`dropped_params`, which are
|
|
79
|
+
* URL-scoped). Empty when no mapping is suspect.
|
|
80
|
+
*/
|
|
81
|
+
suspect_native_values: string[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Translate universal macro tokens in the query-parameter values of
|
|
85
|
+
* `input_pixel_url` using `mapping`. See module-level documentation for the
|
|
86
|
+
* substitution rules and the privacy note on dropped parameters.
|
|
87
|
+
*/
|
|
88
|
+
export declare function translateUniversalMacros(input_pixel_url: string, mapping: MacroMapping): TranslateResult;
|
|
89
|
+
//# sourceMappingURL=translate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../src/lib/substitution/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AA+BH;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElF,kDAAkD;AAClD,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;;;OAIG;IACH,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;OAKG;IACH,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC;;;;;;;;;;OAUG;IACH,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,eAAe,CAwFxG"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Seller-side helper that translates universal macro tokens in a pixel URL's
|
|
4
|
+
* query parameter VALUES using a caller-supplied mapping. Macro tokens in key
|
|
5
|
+
* position pass through untouched — only query-parameter values are translated.
|
|
6
|
+
*
|
|
7
|
+
* Universal macros match `\{[A-Z][A-Z0-9_]*\}` (upper-snake, single braces).
|
|
8
|
+
* Native ad-server tokens (`%%X%%`, `{{x}}`) are not matched and pass through.
|
|
9
|
+
*
|
|
10
|
+
* Per query parameter:
|
|
11
|
+
* - No universal macro → left untouched (literal param passes through).
|
|
12
|
+
* - All macros in the param are in `mapping` → every occurrence replaced in
|
|
13
|
+
* a single pass. A `native` entry is inserted raw; a `value` entry is
|
|
14
|
+
* percent-encoded with the RFC 3986 unreserved whitelist.
|
|
15
|
+
* - Any macro in the param is NOT in `mapping` → the entire parameter is
|
|
16
|
+
* dropped, its key is recorded in `dropped_params`, and each unmapped
|
|
17
|
+
* macro token is recorded in `unmapped_macros`.
|
|
18
|
+
*
|
|
19
|
+
* The substitution is a single pass: a translated value that itself contains
|
|
20
|
+
* `{…}` is not re-expanded.
|
|
21
|
+
*
|
|
22
|
+
* A URL ending in a bare `?` with no parameters returns without the trailing
|
|
23
|
+
* `?` (e.g. `https://px.example/i?` → `https://px.example/i`).
|
|
24
|
+
*
|
|
25
|
+
* Privacy note: dropping a parameter whose macro is unmapped silently removes
|
|
26
|
+
* that tracker — including consent/privacy macros (`{GDPR_CONSENT}`,
|
|
27
|
+
* `{US_PRIVACY}`) if a mapping is forgotten. Consent/privacy macros that get
|
|
28
|
+
* dropped are surfaced separately in `dropped_consent_macros`; callers SHOULD
|
|
29
|
+
* inspect it (and `unmapped_macros`) so a missing consent signal is caught
|
|
30
|
+
* rather than shipped as a degraded pixel.
|
|
31
|
+
*
|
|
32
|
+
* URLSearchParams is intentionally avoided — it force-encodes values and would
|
|
33
|
+
* corrupt native ad-server tokens (e.g. `%%GDPR%%`). Query manipulation is
|
|
34
|
+
* done textually so native tokens remain raw and value-encoding is controlled.
|
|
35
|
+
*/
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.translateUniversalMacros = translateUniversalMacros;
|
|
38
|
+
const rfc3986_1 = require("./rfc3986");
|
|
39
|
+
/** Universal macro token pattern: `{UPPER_SNAKE}`. */
|
|
40
|
+
const UNIVERSAL_MACRO = /\{[A-Z][A-Z0-9_]*\}/g;
|
|
41
|
+
/**
|
|
42
|
+
* Shapes of common ad-server native tokens (`%%X%%`, `{{x}}`, `${x}`, `[X]`).
|
|
43
|
+
* A legitimate `value` entry — a literal data value — never takes this shape,
|
|
44
|
+
* so a `value` that matches it almost certainly belongs in a `native` entry.
|
|
45
|
+
* The bracket form is constrained to upper-snake token names (VAST-style, e.g.
|
|
46
|
+
* `[CACHEBUSTING]`) so ordinary bracketed values like `[1,2,3]` or `[redacted]`
|
|
47
|
+
* are not flagged.
|
|
48
|
+
*/
|
|
49
|
+
const NATIVE_TOKEN_SHAPE = /^(?:%%.+%%|\{\{.+\}\}|\$\{.+\}|\[[A-Z][A-Z0-9_]*\])$/;
|
|
50
|
+
/**
|
|
51
|
+
* Consent/privacy-signalling universal macros. Dropping one because its
|
|
52
|
+
* mapping was forgotten is a compliance hazard, so these are reported
|
|
53
|
+
* separately from benign drops.
|
|
54
|
+
*/
|
|
55
|
+
const CONSENT_MACROS = new Set([
|
|
56
|
+
'{GDPR}',
|
|
57
|
+
'{GDPR_CONSENT}',
|
|
58
|
+
'{US_PRIVACY}',
|
|
59
|
+
'{GPP_STRING}',
|
|
60
|
+
'{GPP_SID}',
|
|
61
|
+
'{LIMIT_AD_TRACKING}',
|
|
62
|
+
]);
|
|
63
|
+
/**
|
|
64
|
+
* Translate universal macro tokens in the query-parameter values of
|
|
65
|
+
* `input_pixel_url` using `mapping`. See module-level documentation for the
|
|
66
|
+
* substitution rules and the privacy note on dropped parameters.
|
|
67
|
+
*/
|
|
68
|
+
function translateUniversalMacros(input_pixel_url, mapping) {
|
|
69
|
+
const suspect_native_values = [];
|
|
70
|
+
const suspectSeen = new Set();
|
|
71
|
+
for (const [macro, entry] of Object.entries(mapping)) {
|
|
72
|
+
if ('value' in entry && NATIVE_TOKEN_SHAPE.test(entry.value) && !suspectSeen.has(macro)) {
|
|
73
|
+
suspectSeen.add(macro);
|
|
74
|
+
suspect_native_values.push(macro);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Split off the fragment first so it is never touched.
|
|
78
|
+
const fragmentIdx = input_pixel_url.indexOf('#');
|
|
79
|
+
const withoutFragment = fragmentIdx === -1 ? input_pixel_url : input_pixel_url.slice(0, fragmentIdx);
|
|
80
|
+
const fragment = fragmentIdx === -1 ? '' : input_pixel_url.slice(fragmentIdx);
|
|
81
|
+
// Split base (scheme + host + path) from query.
|
|
82
|
+
const queryIdx = withoutFragment.indexOf('?');
|
|
83
|
+
if (queryIdx === -1) {
|
|
84
|
+
return {
|
|
85
|
+
url: input_pixel_url,
|
|
86
|
+
dropped_params: [],
|
|
87
|
+
unmapped_macros: [],
|
|
88
|
+
dropped_consent_macros: [],
|
|
89
|
+
suspect_native_values,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const base = withoutFragment.slice(0, queryIdx);
|
|
93
|
+
const rawQuery = withoutFragment.slice(queryIdx + 1);
|
|
94
|
+
const dropped_params = [];
|
|
95
|
+
const unmapped_macros = [];
|
|
96
|
+
const unmappedSeen = new Set();
|
|
97
|
+
const dropped_consent_macros = [];
|
|
98
|
+
const consentSeen = new Set();
|
|
99
|
+
const outputParts = [];
|
|
100
|
+
for (const rawParam of rawQuery.split('&')) {
|
|
101
|
+
const eqIdx = rawParam.indexOf('=');
|
|
102
|
+
const key = eqIdx === -1 ? rawParam : rawParam.slice(0, eqIdx);
|
|
103
|
+
const value = eqIdx === -1 ? '' : rawParam.slice(eqIdx + 1);
|
|
104
|
+
// Find every universal macro token in the raw value.
|
|
105
|
+
const tokens = value.match(UNIVERSAL_MACRO);
|
|
106
|
+
if (!tokens) {
|
|
107
|
+
// No universal macros — pass through verbatim.
|
|
108
|
+
outputParts.push(rawParam);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
// Check for any unmapped macro in this parameter.
|
|
112
|
+
const missing = tokens.filter(t => !(t in mapping));
|
|
113
|
+
if (missing.length > 0) {
|
|
114
|
+
dropped_params.push(key);
|
|
115
|
+
for (const m of missing) {
|
|
116
|
+
if (!unmappedSeen.has(m)) {
|
|
117
|
+
unmappedSeen.add(m);
|
|
118
|
+
unmapped_macros.push(m);
|
|
119
|
+
}
|
|
120
|
+
if (CONSENT_MACROS.has(m) && !consentSeen.has(m)) {
|
|
121
|
+
consentSeen.add(m);
|
|
122
|
+
dropped_consent_macros.push(m);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
// All macros are mapped — replace in a single pass.
|
|
128
|
+
// String.replace with a global regex does not re-scan substituted output,
|
|
129
|
+
// so macro tokens inside a translated value are never expanded.
|
|
130
|
+
const translated = value.replace(UNIVERSAL_MACRO, token => {
|
|
131
|
+
const entry = mapping[token];
|
|
132
|
+
if (!entry) {
|
|
133
|
+
// Unreachable: all tokens were verified above, but TypeScript narrows.
|
|
134
|
+
return token;
|
|
135
|
+
}
|
|
136
|
+
return 'native' in entry ? entry.native : (0, rfc3986_1.encodeUnreserved)(entry.value);
|
|
137
|
+
});
|
|
138
|
+
outputParts.push(`${key}=${translated}`);
|
|
139
|
+
}
|
|
140
|
+
const newQuery = outputParts.join('&');
|
|
141
|
+
const url = newQuery ? `${base}?${newQuery}${fragment}` : `${base}${fragment}`;
|
|
142
|
+
return { url, dropped_params, unmapped_macros, dropped_consent_macros, suspect_native_values };
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=translate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.js","sourceRoot":"","sources":["../../../src/lib/substitution/translate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;AAkFH,4DAwFC;AAxKD,uCAA6C;AAE7C,sDAAsD;AACtD,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,sDAAsD,CAAC;AAElF;;;;GAIG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS;IACrC,QAAQ;IACR,gBAAgB;IAChB,cAAc;IACd,cAAc;IACd,WAAW;IACX,qBAAqB;CACtB,CAAC,CAAC;AAgDH;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,eAAuB,EAAE,OAAqB;IACrF,MAAM,qBAAqB,GAAa,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;IACtC,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC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OAAO,CAAC,CAyDzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAyBpH;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,cAAc,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB;AA4eD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,iBAAsB,GAC9B,qBAAqB,GAAG,SAAS,CAgBnC"}
|
|
@@ -1920,6 +1920,10 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1920
1920
|
// default `depends_on` resolution ("all prior phases") doesn't re-scan
|
|
1921
1921
|
// the storyboard. Phases push their own id at end-of-phase.
|
|
1922
1922
|
const priorPhaseIds = [];
|
|
1923
|
+
// Phase → branch-set membership, resolved once up front so the stateful
|
|
1924
|
+
// cascade (and the post-loop branch-set re-grade) can consult it. Phases
|
|
1925
|
+
// outside any branch set are absent from the map.
|
|
1926
|
+
const branchSetsByPhaseId = resolveBranchSets(storyboard);
|
|
1923
1927
|
// Helpers for per-phase cascade state.
|
|
1924
1928
|
const effectiveDependsOn = (phase, prior) => phase.depends_on ?? prior;
|
|
1925
1929
|
const cascadeForPhase = (phase, prior) => {
|
|
@@ -1928,7 +1932,26 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1928
1932
|
if (phaseStatefulCascades.has(phase.id)) {
|
|
1929
1933
|
return { tripped: true, trigger: phaseStatefulCascades.get(phase.id) ?? null };
|
|
1930
1934
|
}
|
|
1935
|
+
// Branch-set peers under `any_of` are mutually-exclusive ALTERNATIVES, not
|
|
1936
|
+
// a stateful dependency chain: a conformant seller satisfies exactly one
|
|
1937
|
+
// peer, so the non-taken peer(s) fail by design (storyboard-schema.yaml,
|
|
1938
|
+
// "Per-step grading in any_of branch patterns"). A peer's expected
|
|
1939
|
+
// failure must NOT cascade-skip a sibling peer — doing so suppresses the
|
|
1940
|
+
// only viable contribution and fails the any_of gate even though the
|
|
1941
|
+
// seller behaved conformantly. Exclude same-branch-set peers from this
|
|
1942
|
+
// phase's cascade dependencies. (adcontextprotocol/adcp-client#2305)
|
|
1943
|
+
//
|
|
1944
|
+
// Scoped to `any_of` deliberately: `BranchSetSpec.semantics` is typed
|
|
1945
|
+
// `string` to leave room for future semantics (e.g. `all_of`/`one_of`)
|
|
1946
|
+
// where peers legitimately DO depend on each other and must keep
|
|
1947
|
+
// cascading. `all_of` is rejected at load time today, so this is
|
|
1948
|
+
// forward-compat hardening rather than live behavior.
|
|
1949
|
+
const ownSpec = branchSetsByPhaseId.get(phase.id);
|
|
1950
|
+
const ownAnyOfBranchSet = ownSpec?.semantics === 'any_of' ? ownSpec.id : undefined;
|
|
1931
1951
|
for (const depId of effectiveDependsOn(phase, prior)) {
|
|
1952
|
+
if (ownAnyOfBranchSet !== undefined && branchSetsByPhaseId.get(depId)?.id === ownAnyOfBranchSet) {
|
|
1953
|
+
continue;
|
|
1954
|
+
}
|
|
1932
1955
|
if (phaseStatefulCascades.has(depId)) {
|
|
1933
1956
|
return { tripped: true, trigger: phaseStatefulCascades.get(depId) ?? null };
|
|
1934
1957
|
}
|
|
@@ -2775,8 +2798,9 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
2775
2798
|
// contribution status isn't knowable inside the per-phase loop. Runs
|
|
2776
2799
|
// before storyboard-scoped assertions so `onEnd` hooks see the finalized
|
|
2777
2800
|
// per-step grades (a moot peer's "failure" should not trip a cross-step
|
|
2778
|
-
// invariant).
|
|
2779
|
-
|
|
2801
|
+
// invariant). `branchSetsByPhaseId` was resolved before the phase loop so
|
|
2802
|
+
// the stateful cascade could consult it (branch-set peers don't cascade
|
|
2803
|
+
// onto each other); reuse it here.
|
|
2780
2804
|
const branchSetDelta = applyBranchSetGrading(storyboard.phases, phaseResults, branchSetsByPhaseId, contributions, contributionSources, countedAsFailed);
|
|
2781
2805
|
skippedCount += branchSetDelta.skippedDelta;
|
|
2782
2806
|
// Fire storyboard-scoped assertions. These observe the full run and can
|
|
@@ -3303,12 +3327,14 @@ client, step, storyboardId, phaseId, context, allSteps, options, state) {
|
|
|
3303
3327
|
extraction: { path: 'none' },
|
|
3304
3328
|
};
|
|
3305
3329
|
}
|
|
3306
|
-
// Account-mode capability gate:
|
|
3307
|
-
// (require_operator_auth:
|
|
3308
|
-
//
|
|
3309
|
-
//
|
|
3310
|
-
//
|
|
3311
|
-
//
|
|
3330
|
+
// Account-mode capability gate: when the seller declared explicit mode
|
|
3331
|
+
// (require_operator_auth: true) and does not advertise sync_accounts,
|
|
3332
|
+
// sync_accounts does not apply — grade not_applicable rather than
|
|
3333
|
+
// missing_tool so adopters can distinguish "your capability declaration
|
|
3334
|
+
// says this path isn't yours" from "you forgot to implement a required
|
|
3335
|
+
// tool." If the seller explicitly advertises sync_accounts, run it: account
|
|
3336
|
+
// discovery mode and account-level write surfaces such as notification
|
|
3337
|
+
// config registration are orthogonal.
|
|
3312
3338
|
//
|
|
3313
3339
|
// list_accounts is NOT gated here: it appears in audience_sync and other
|
|
3314
3340
|
// storyboard flows regardless of account mode, so it is always applicable.
|
|
@@ -3319,7 +3345,8 @@ client, step, storyboardId, phaseId, context, allSteps, options, state) {
|
|
|
3319
3345
|
const rawCaps = options._profile?.raw_capabilities;
|
|
3320
3346
|
if (rawCaps !== undefined) {
|
|
3321
3347
|
const requireOperatorAuth = resolveCapabilityPath(rawCaps, 'account.require_operator_auth');
|
|
3322
|
-
|
|
3348
|
+
const syncAccountsAdvertised = options.agentTools?.includes('sync_accounts') === true;
|
|
3349
|
+
if (requireOperatorAuth === true && !syncAccountsAdvertised) {
|
|
3323
3350
|
const detail = `Agent declared explicit account mode (require_operator_auth: true); ` +
|
|
3324
3351
|
`sync_accounts is not applicable — list_accounts is the correct tool for this account shape.`;
|
|
3325
3352
|
const next = getNextStepPreview(step.id, allSteps, context, runState.runnerVars);
|