@adcp/sdk 14.0.0 → 14.1.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/adapters/implicit-account-store.d.mts +12 -7
- package/dist/lib/adapters/implicit-account-store.d.ts +12 -7
- package/dist/lib/adapters/implicit-account-store.js +69 -15
- package/dist/lib/adapters/implicit-account-store.mjs +69 -15
- package/dist/lib/core/AgentClient.d.mts +1 -0
- package/dist/lib/core/AgentClient.d.ts +1 -0
- package/dist/lib/core/AgentClient.js +3 -0
- package/dist/lib/core/AgentClient.mjs +3 -0
- package/dist/lib/core/SingleAgentClient.d.mts +31 -1
- package/dist/lib/core/SingleAgentClient.d.ts +31 -1
- package/dist/lib/core/SingleAgentClient.js +355 -35
- package/dist/lib/core/SingleAgentClient.mjs +365 -37
- package/dist/lib/core/TaskExecutor.js +2 -1
- package/dist/lib/core/TaskExecutor.mjs +2 -1
- package/dist/lib/core/account-key.d.mts +3 -0
- package/dist/lib/core/account-key.d.ts +3 -0
- package/dist/lib/core/account-key.js +41 -0
- package/dist/lib/core/account-key.mjs +17 -0
- package/dist/lib/core/account-resolution.d.mts +2 -0
- package/dist/lib/core/account-resolution.d.ts +2 -0
- package/dist/lib/core/buyer-account-registry.d.mts +65 -0
- package/dist/lib/core/buyer-account-registry.d.ts +65 -0
- package/dist/lib/core/buyer-account-registry.js +518 -0
- package/dist/lib/core/buyer-account-registry.mjs +494 -0
- package/dist/lib/core/product-cache.d.mts +18 -0
- package/dist/lib/core/product-cache.d.ts +18 -0
- package/dist/lib/core/product-cache.js +137 -0
- package/dist/lib/core/product-cache.mjs +112 -0
- package/dist/lib/errors/index.d.mts +40 -1
- package/dist/lib/errors/index.d.ts +40 -1
- package/dist/lib/errors/index.js +69 -3
- package/dist/lib/errors/index.mjs +64 -3
- package/dist/lib/governance/authorization.d.mts +17 -1
- package/dist/lib/governance/authorization.d.ts +17 -1
- package/dist/lib/governance/authorization.js +55 -7
- package/dist/lib/governance/authorization.mjs +59 -7
- package/dist/lib/governance/index.d.mts +2 -2
- package/dist/lib/governance/index.d.ts +2 -2
- package/dist/lib/governance/index.js +2 -0
- package/dist/lib/governance/index.mjs +3 -1
- package/dist/lib/index.d.mts +5 -3
- package/dist/lib/index.d.ts +5 -3
- package/dist/lib/index.js +20 -0
- package/dist/lib/index.mjs +19 -0
- package/dist/lib/protocols/a2a.js +9 -1
- package/dist/lib/protocols/a2a.mjs +9 -1
- package/dist/lib/protocols/index.js +9 -2
- package/dist/lib/protocols/index.mjs +9 -2
- package/dist/lib/protocols/mcp-modern.js +2 -1
- package/dist/lib/protocols/mcp-modern.mjs +2 -1
- package/dist/lib/protocols/mcp.js +5 -2
- package/dist/lib/protocols/mcp.mjs +5 -2
- package/dist/lib/protocols/rawResponseCapture.d.mts +6 -0
- package/dist/lib/protocols/rawResponseCapture.d.ts +6 -0
- package/dist/lib/protocols/rawResponseCapture.js +41 -29
- package/dist/lib/protocols/rawResponseCapture.mjs +40 -29
- package/dist/lib/protocols/signedRequestRejection.d.mts +9 -0
- package/dist/lib/protocols/signedRequestRejection.d.ts +9 -0
- package/dist/lib/protocols/signedRequestRejection.js +209 -0
- package/dist/lib/protocols/signedRequestRejection.mjs +189 -0
- package/dist/lib/protocols/transportDiagnostics.d.mts +1 -0
- package/dist/lib/protocols/transportDiagnostics.d.ts +1 -0
- package/dist/lib/protocols/transportDiagnostics.js +2 -0
- package/dist/lib/protocols/transportDiagnostics.mjs +1 -0
- package/dist/lib/registry/types.generated.d.mts +112 -45
- package/dist/lib/registry/types.generated.d.ts +112 -45
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/account-provisioning.d.mts +2 -0
- package/dist/lib/server/account-provisioning.d.ts +2 -0
- package/dist/lib/server/account-provisioning.js +30 -0
- package/dist/lib/server/account-provisioning.mjs +6 -0
- package/dist/lib/server/account-reference-warnings.d.mts +12 -0
- package/dist/lib/server/account-reference-warnings.d.ts +12 -0
- package/dist/lib/server/account-reference-warnings.js +48 -0
- package/dist/lib/server/account-reference-warnings.mjs +23 -0
- package/dist/lib/server/auth-signature.js +1 -0
- package/dist/lib/server/auth-signature.mjs +1 -0
- package/dist/lib/server/create-adcp-server.d.mts +34 -0
- package/dist/lib/server/create-adcp-server.d.ts +34 -0
- package/dist/lib/server/create-adcp-server.js +225 -14
- package/dist/lib/server/create-adcp-server.mjs +225 -14
- package/dist/lib/server/decisioning/account.d.mts +2 -0
- package/dist/lib/server/decisioning/account.d.ts +2 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js +49 -10
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +49 -10
- package/dist/lib/server/index.d.mts +2 -2
- package/dist/lib/server/index.d.ts +2 -2
- package/dist/lib/server/index.js +2 -0
- package/dist/lib/server/index.mjs +3 -1
- package/dist/lib/signing/agent-resolver/consistency.d.mts +6 -13
- package/dist/lib/signing/agent-resolver/consistency.d.ts +6 -13
- package/dist/lib/signing/agent-resolver/consistency.js +0 -1
- package/dist/lib/signing/agent-resolver/consistency.mjs +0 -1
- package/dist/lib/signing/agent-resolver/errors.d.mts +1 -1
- package/dist/lib/signing/agent-resolver/errors.d.ts +1 -1
- package/dist/lib/signing/agent-resolver/fetch-helpers.d.mts +2 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts +2 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.js +2 -1
- package/dist/lib/signing/agent-resolver/fetch-helpers.mjs +2 -1
- package/dist/lib/signing/agent-resolver/jwks-set.js +24 -3
- package/dist/lib/signing/agent-resolver/jwks-set.mjs +24 -3
- package/dist/lib/signing/agent-resolver/legacy-brand.d.mts +15 -0
- package/dist/lib/signing/agent-resolver/legacy-brand.d.ts +15 -0
- package/dist/lib/signing/agent-resolver/legacy-brand.js +60 -0
- package/dist/lib/signing/agent-resolver/legacy-brand.mjs +36 -0
- package/dist/lib/signing/agent-resolver/operator-authorization.d.mts +13 -0
- package/dist/lib/signing/agent-resolver/operator-authorization.d.ts +13 -0
- package/dist/lib/signing/agent-resolver/operator-authorization.js +108 -0
- package/dist/lib/signing/agent-resolver/operator-authorization.mjs +84 -0
- package/dist/lib/signing/agent-resolver/resolve-agent.d.mts +14 -4
- package/dist/lib/signing/agent-resolver/resolve-agent.d.ts +14 -4
- package/dist/lib/signing/agent-resolver/resolve-agent.js +101 -132
- package/dist/lib/signing/agent-resolver/resolve-agent.mjs +102 -133
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.mts +7 -1
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.ts +7 -1
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.js +50 -17
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.mjs +50 -17
- package/dist/lib/signing/agent-resolver/select-agent.d.mts +14 -15
- package/dist/lib/signing/agent-resolver/select-agent.d.ts +14 -15
- package/dist/lib/signing/agent-resolver/select-agent.js +98 -13
- package/dist/lib/signing/agent-resolver/select-agent.mjs +95 -13
- package/dist/lib/signing/brand-jwks.d.mts +27 -75
- package/dist/lib/signing/brand-jwks.d.ts +27 -75
- package/dist/lib/signing/brand-jwks.js +112 -182
- package/dist/lib/signing/brand-jwks.mjs +112 -182
- package/dist/lib/signing/errors.d.mts +3 -1
- package/dist/lib/signing/errors.d.ts +3 -1
- package/dist/lib/signing/errors.js +4 -1
- package/dist/lib/signing/errors.mjs +4 -1
- package/dist/lib/signing/jwks-https.d.mts +7 -0
- package/dist/lib/signing/jwks-https.d.ts +7 -0
- package/dist/lib/signing/jwks-https.js +31 -8
- package/dist/lib/signing/jwks-https.mjs +31 -8
- package/dist/lib/signing/jwks.d.mts +8 -0
- package/dist/lib/signing/jwks.d.ts +8 -0
- package/dist/lib/signing/middleware.js +2 -1
- package/dist/lib/signing/middleware.mjs +2 -1
- package/dist/lib/signing/publisher-pins.d.mts +11 -0
- package/dist/lib/signing/publisher-pins.d.ts +11 -0
- package/dist/lib/signing/publisher-pins.js +125 -0
- package/dist/lib/signing/publisher-pins.mjs +101 -0
- package/dist/lib/signing/server.d.mts +1 -0
- package/dist/lib/signing/server.d.ts +1 -0
- package/dist/lib/signing/types.d.mts +5 -0
- package/dist/lib/signing/types.d.ts +5 -0
- package/dist/lib/signing/verifier.js +49 -4
- package/dist/lib/signing/verifier.mjs +49 -4
- package/dist/lib/signing/webhook-verifier.d.mts +7 -2
- package/dist/lib/signing/webhook-verifier.d.ts +7 -2
- package/dist/lib/signing/webhook-verifier.js +42 -2
- package/dist/lib/signing/webhook-verifier.mjs +43 -3
- package/dist/lib/testing/storyboard/account-policy.d.mts +2 -0
- package/dist/lib/testing/storyboard/account-policy.d.ts +2 -0
- package/dist/lib/testing/storyboard/account-policy.js +35 -0
- package/dist/lib/testing/storyboard/account-policy.mjs +11 -0
- package/dist/lib/testing/storyboard/context.js +6 -0
- package/dist/lib/testing/storyboard/context.mjs +6 -0
- package/dist/lib/testing/storyboard/request-builder.js +12 -2
- package/dist/lib/testing/storyboard/request-builder.mjs +12 -2
- package/dist/lib/testing/storyboard/runner.js +3 -2
- package/dist/lib/testing/storyboard/runner.mjs +3 -2
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/wholesale-feed-sync/sync.d.mts +1 -0
- package/dist/lib/wholesale-feed-sync/sync.d.ts +1 -0
- package/dist/lib/wholesale-feed-sync/sync.js +92 -21
- package/dist/lib/wholesale-feed-sync/sync.mjs +92 -21
- package/dist/lib/wholesale-feed-sync/types.d.mts +4 -3
- package/dist/lib/wholesale-feed-sync/types.d.ts +4 -3
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/BUILD-AN-AGENT.md +2 -2
- package/docs/guides/BUYER-QUICKSTART-3.2.md +2 -0
- package/docs/guides/FIRST-CALL-TO-A-SELLER.md +104 -0
- package/docs/guides/SIGNING-GUIDE.md +16 -7
- package/docs/guides/account-resolution.md +86 -0
- package/docs/llms.txt +3 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-4.x-to-5.x.md +1 -0
- package/docs/migration-agent-resolution-3.3.md +123 -0
- package/docs/recipes/verifying-inbound-webhooks.md +56 -15
- package/package.json +2 -2
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { buildSignatureBase, canonicalTargetUri, getHeaderValue } from "./canonicalize.mjs";
|
|
2
2
|
import { contentDigestMatches } from "./content-digest.mjs";
|
|
3
|
-
import { RequestSignatureError, WebhookSignatureError } from "./errors.mjs";
|
|
3
|
+
import { RequestSignatureError, WebhookSignatureError, RequestSigningErrorCodeMetadata } from "./errors.mjs";
|
|
4
|
+
import { AgentResolverError } from "./agent-resolver/errors.mjs";
|
|
5
|
+
import { BrandJsonResolverError } from "./brand-jwks.mjs";
|
|
4
6
|
import { parseSignature, parseSignatureInput } from "./parser.mjs";
|
|
5
7
|
import { jwkToPublicKey, verifySignature } from "./crypto.mjs";
|
|
8
|
+
import { assertPublisherPins } from "./publisher-pins.mjs";
|
|
6
9
|
import { InMemoryReplayStore } from "./replay.mjs";
|
|
7
10
|
import { InMemoryRevocationStore } from "./revocation.mjs";
|
|
8
11
|
import { ALLOWED_ALGS, CLOCK_SKEW_TOLERANCE_SECONDS, MAX_SIGNATURE_WINDOW_SECONDS } from "./types.mjs";
|
|
12
|
+
function keyDiscoveryRetryable(error) {
|
|
13
|
+
if (error instanceof AgentResolverError) return RequestSigningErrorCodeMetadata[error.code].recovery === "transient";
|
|
14
|
+
if (error instanceof BrandJsonResolverError) return error.code === "fetch_failed";
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
9
17
|
const WEBHOOK_SIGNING_TAG = "adcp/webhook-signing/v1";
|
|
10
18
|
const WEBHOOK_MANDATORY_COMPONENTS = [
|
|
11
19
|
"@method",
|
|
@@ -57,7 +65,22 @@ async function verifyWebhookSignature(request, options) {
|
|
|
57
65
|
validateWindow(parsedInput.params.created, parsedInput.params.expires, now);
|
|
58
66
|
validateCoveredComponents(parsedInput.components);
|
|
59
67
|
const canonicalWebhookTarget = validateTargetUri(request.url);
|
|
60
|
-
|
|
68
|
+
let keyResolution;
|
|
69
|
+
try {
|
|
70
|
+
keyResolution = options.jwks.resolveWithMetadata ? await options.jwks.resolveWithMetadata(parsedInput.params.keyid) : { jwk: await options.jwks.resolve(parsedInput.params.keyid) };
|
|
71
|
+
} catch (error) {
|
|
72
|
+
try {
|
|
73
|
+
options.onKeyResolutionError?.(error);
|
|
74
|
+
} catch {
|
|
75
|
+
}
|
|
76
|
+
throw new WebhookSignatureError(
|
|
77
|
+
"webhook_signature_key_unknown",
|
|
78
|
+
7,
|
|
79
|
+
"Signing key discovery or publisher pin check failed.",
|
|
80
|
+
void 0,
|
|
81
|
+
keyDiscoveryRetryable(error)
|
|
82
|
+
);
|
|
83
|
+
}
|
|
61
84
|
const jwk = keyResolution.jwk;
|
|
62
85
|
if (!jwk) {
|
|
63
86
|
throw new WebhookSignatureError(
|
|
@@ -139,6 +162,23 @@ async function verifyWebhookSignature(request, options) {
|
|
|
139
162
|
"Content-Digest header does not match recomputed body hash."
|
|
140
163
|
);
|
|
141
164
|
}
|
|
165
|
+
if (options.publisherPins) {
|
|
166
|
+
try {
|
|
167
|
+
await assertPublisherPins(jwk, options.publisherPins, currentTime);
|
|
168
|
+
} catch (error) {
|
|
169
|
+
try {
|
|
170
|
+
options.onKeyResolutionError?.(error);
|
|
171
|
+
} catch {
|
|
172
|
+
}
|
|
173
|
+
throw new WebhookSignatureError(
|
|
174
|
+
"webhook_signature_key_unknown",
|
|
175
|
+
7,
|
|
176
|
+
"Signing key is outside the applicable publisher pins.",
|
|
177
|
+
void 0,
|
|
178
|
+
keyDiscoveryRetryable(error)
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
142
182
|
if (keyResolution.operatorAuthorizationValidUntil !== void 0) {
|
|
143
183
|
assertDelegatedOperatorAuthorizationActive(keyResolution.operatorAuthorizationValidUntil, currentTime());
|
|
144
184
|
}
|
|
@@ -162,7 +202,7 @@ async function verifyWebhookSignature(request, options) {
|
|
|
162
202
|
if (keyResolution.operatorAuthorizationValidUntil !== void 0) {
|
|
163
203
|
assertDelegatedOperatorAuthorizationActive(keyResolution.operatorAuthorizationValidUntil, currentTime());
|
|
164
204
|
}
|
|
165
|
-
const agent_url = options.agentUrlForKeyid?.(jwk.kid);
|
|
205
|
+
const agent_url = keyResolution.agentUrl ?? options.agentUrlForKeyid?.(jwk.kid);
|
|
166
206
|
return {
|
|
167
207
|
status: "verified",
|
|
168
208
|
keyid: jwk.kid,
|
|
@@ -0,0 +1,35 @@
|
|
|
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 account_policy_exports = {};
|
|
20
|
+
__export(account_policy_exports, {
|
|
21
|
+
ACCOUNT_FREE_DISCOVERY_TASKS: () => ACCOUNT_FREE_DISCOVERY_TASKS
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(account_policy_exports);
|
|
24
|
+
const ACCOUNT_FREE_DISCOVERY_TASKS = /* @__PURE__ */ new Set([
|
|
25
|
+
"get_products",
|
|
26
|
+
"list_products",
|
|
27
|
+
"get_signals",
|
|
28
|
+
"request_proposals",
|
|
29
|
+
"refine_proposals",
|
|
30
|
+
"decline_proposals"
|
|
31
|
+
]);
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
ACCOUNT_FREE_DISCOVERY_TASKS
|
|
35
|
+
});
|
|
@@ -100,15 +100,21 @@ function readCompactMediaBuyFields(data) {
|
|
|
100
100
|
const CONTEXT_EXTRACTORS = {
|
|
101
101
|
sync_accounts(data) {
|
|
102
102
|
const d = data;
|
|
103
|
+
if (d?.dry_run === true) return {};
|
|
103
104
|
const accounts = d?.accounts;
|
|
104
105
|
if (!accounts?.[0]) return {};
|
|
105
106
|
const first = accounts[0];
|
|
107
|
+
if (first.action === "failed") return {};
|
|
106
108
|
const extracted = {};
|
|
107
109
|
if (first.account_id) extracted.account_id = first.account_id;
|
|
108
110
|
if (first.status) extracted.account_status = first.status;
|
|
109
111
|
const accountRef = {};
|
|
110
112
|
if (first.brand) accountRef.brand = first.brand;
|
|
111
113
|
if (first.operator) accountRef.operator = first.operator;
|
|
114
|
+
for (const field of ["operator_unit", "currency", "timezone", "sandbox"]) {
|
|
115
|
+
if (first[field] !== void 0) accountRef[field] = first[field];
|
|
116
|
+
}
|
|
117
|
+
if (!first.brand && !first.operator && first.account_id) accountRef.account_id = first.account_id;
|
|
112
118
|
extracted.account = accountRef;
|
|
113
119
|
return extracted;
|
|
114
120
|
},
|
|
@@ -67,15 +67,21 @@ function readCompactMediaBuyFields(data) {
|
|
|
67
67
|
const CONTEXT_EXTRACTORS = {
|
|
68
68
|
sync_accounts(data) {
|
|
69
69
|
const d = data;
|
|
70
|
+
if (d?.dry_run === true) return {};
|
|
70
71
|
const accounts = d?.accounts;
|
|
71
72
|
if (!accounts?.[0]) return {};
|
|
72
73
|
const first = accounts[0];
|
|
74
|
+
if (first.action === "failed") return {};
|
|
73
75
|
const extracted = {};
|
|
74
76
|
if (first.account_id) extracted.account_id = first.account_id;
|
|
75
77
|
if (first.status) extracted.account_status = first.status;
|
|
76
78
|
const accountRef = {};
|
|
77
79
|
if (first.brand) accountRef.brand = first.brand;
|
|
78
80
|
if (first.operator) accountRef.operator = first.operator;
|
|
81
|
+
for (const field of ["operator_unit", "currency", "timezone", "sandbox"]) {
|
|
82
|
+
if (first[field] !== void 0) accountRef[field] = first[field];
|
|
83
|
+
}
|
|
84
|
+
if (!first.brand && !first.operator && first.account_id) accountRef.account_id = first.account_id;
|
|
79
85
|
extracted.account = accountRef;
|
|
80
86
|
return extracted;
|
|
81
87
|
},
|
|
@@ -24,6 +24,7 @@ __export(request_builder_exports, {
|
|
|
24
24
|
hasRequestEnricher: () => hasRequestEnricher
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(request_builder_exports);
|
|
27
|
+
var import_account_policy = require('./account-policy.js');
|
|
27
28
|
var import_node_crypto = require("node:crypto");
|
|
28
29
|
var import_client = require('../client.js');
|
|
29
30
|
var import_context = require('./context.js');
|
|
@@ -102,6 +103,15 @@ function resolveMediaBuyAccount(fixtureAccount, contextAccount, options) {
|
|
|
102
103
|
}
|
|
103
104
|
return resolvedAccount;
|
|
104
105
|
}
|
|
106
|
+
function resolveDiscoveryAccount(task, fixtureAccount, contextAccount, options) {
|
|
107
|
+
if (import_account_policy.ACCOUNT_FREE_DISCOVERY_TASKS.has(task) && contextAccount === void 0 && hasUnresolvedContextReference(fixtureAccount))
|
|
108
|
+
return void 0;
|
|
109
|
+
if (import_account_policy.ACCOUNT_FREE_DISCOVERY_TASKS.has(task) && fixtureAccount === void 0 && contextAccount === void 0)
|
|
110
|
+
return void 0;
|
|
111
|
+
if (contextAccount === void 0 && fixtureAccount && typeof fixtureAccount === "object" && "account_id" in fixtureAccount)
|
|
112
|
+
return fixtureAccount;
|
|
113
|
+
return resolveMediaBuyAccount(fixtureAccount, contextAccount, options);
|
|
114
|
+
}
|
|
105
115
|
const OPERATION_SCOPED_CONTROLLER_SCENARIOS = /* @__PURE__ */ new Set([
|
|
106
116
|
"force_create_media_buy_arm",
|
|
107
117
|
"force_get_products_arm",
|
|
@@ -193,7 +203,7 @@ const REQUEST_ENRICHERS = {
|
|
|
193
203
|
) : {};
|
|
194
204
|
const fixtureAccount = fixtureFields.account;
|
|
195
205
|
const fixtureWholesaleAccount = fixtureFields.buying_mode === "wholesale" && fixtureAccount !== void 0 && !hasUnresolvedContextReference(fixtureAccount) ? fixtureAccount : void 0;
|
|
196
|
-
const resolvedAccount = fixtureWholesaleAccount ??
|
|
206
|
+
const resolvedAccount = fixtureWholesaleAccount ?? resolveDiscoveryAccount("get_products", fixtureAccount, context.account, options);
|
|
197
207
|
if (fixtureFields.buying_mode === "wholesale") {
|
|
198
208
|
return {
|
|
199
209
|
...fixtureFields,
|
|
@@ -471,7 +481,7 @@ const REQUEST_ENRICHERS = {
|
|
|
471
481
|
) : {};
|
|
472
482
|
const fixtureAccount = fixtureFields.account;
|
|
473
483
|
const fixtureWholesaleAccount = fixtureFields.discovery_mode === "wholesale" && fixtureAccount !== void 0 && !hasUnresolvedContextReference(fixtureAccount) ? fixtureAccount : void 0;
|
|
474
|
-
const account = fixtureWholesaleAccount ??
|
|
484
|
+
const account = fixtureWholesaleAccount ?? resolveDiscoveryAccount("get_signals", fixtureAccount, context.account, options);
|
|
475
485
|
if (fixtureFields.discovery_mode === "wholesale") {
|
|
476
486
|
return { ...fixtureFields, account };
|
|
477
487
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ACCOUNT_FREE_DISCOVERY_TASKS } from "./account-policy.mjs";
|
|
1
2
|
import { createHash } from "node:crypto";
|
|
2
3
|
import { resolveBrand, resolveAccount } from "../client.mjs";
|
|
3
4
|
import { injectContext } from "./context.mjs";
|
|
@@ -76,6 +77,15 @@ function resolveMediaBuyAccount(fixtureAccount, contextAccount, options) {
|
|
|
76
77
|
}
|
|
77
78
|
return resolvedAccount;
|
|
78
79
|
}
|
|
80
|
+
function resolveDiscoveryAccount(task, fixtureAccount, contextAccount, options) {
|
|
81
|
+
if (ACCOUNT_FREE_DISCOVERY_TASKS.has(task) && contextAccount === void 0 && hasUnresolvedContextReference(fixtureAccount))
|
|
82
|
+
return void 0;
|
|
83
|
+
if (ACCOUNT_FREE_DISCOVERY_TASKS.has(task) && fixtureAccount === void 0 && contextAccount === void 0)
|
|
84
|
+
return void 0;
|
|
85
|
+
if (contextAccount === void 0 && fixtureAccount && typeof fixtureAccount === "object" && "account_id" in fixtureAccount)
|
|
86
|
+
return fixtureAccount;
|
|
87
|
+
return resolveMediaBuyAccount(fixtureAccount, contextAccount, options);
|
|
88
|
+
}
|
|
79
89
|
const OPERATION_SCOPED_CONTROLLER_SCENARIOS = /* @__PURE__ */ new Set([
|
|
80
90
|
"force_create_media_buy_arm",
|
|
81
91
|
"force_get_products_arm",
|
|
@@ -167,7 +177,7 @@ const REQUEST_ENRICHERS = {
|
|
|
167
177
|
) : {};
|
|
168
178
|
const fixtureAccount = fixtureFields.account;
|
|
169
179
|
const fixtureWholesaleAccount = fixtureFields.buying_mode === "wholesale" && fixtureAccount !== void 0 && !hasUnresolvedContextReference(fixtureAccount) ? fixtureAccount : void 0;
|
|
170
|
-
const resolvedAccount = fixtureWholesaleAccount ??
|
|
180
|
+
const resolvedAccount = fixtureWholesaleAccount ?? resolveDiscoveryAccount("get_products", fixtureAccount, context.account, options);
|
|
171
181
|
if (fixtureFields.buying_mode === "wholesale") {
|
|
172
182
|
return {
|
|
173
183
|
...fixtureFields,
|
|
@@ -445,7 +455,7 @@ const REQUEST_ENRICHERS = {
|
|
|
445
455
|
) : {};
|
|
446
456
|
const fixtureAccount = fixtureFields.account;
|
|
447
457
|
const fixtureWholesaleAccount = fixtureFields.discovery_mode === "wholesale" && fixtureAccount !== void 0 && !hasUnresolvedContextReference(fixtureAccount) ? fixtureAccount : void 0;
|
|
448
|
-
const account = fixtureWholesaleAccount ??
|
|
458
|
+
const account = fixtureWholesaleAccount ?? resolveDiscoveryAccount("get_signals", fixtureAccount, context.account, options);
|
|
449
459
|
if (fixtureFields.discovery_mode === "wholesale") {
|
|
450
460
|
return { ...fixtureFields, account };
|
|
451
461
|
}
|
|
@@ -61,6 +61,7 @@ module.exports = __toCommonJS(runner_exports);
|
|
|
61
61
|
var import_node_crypto = require("node:crypto");
|
|
62
62
|
var import_node_fs = require("node:fs");
|
|
63
63
|
var import_node_path = require("node:path");
|
|
64
|
+
var import_account_policy = require('./account-policy.js');
|
|
64
65
|
var import_client = require('../client.js');
|
|
65
66
|
var import_protocols = require('../../protocols/index.js');
|
|
66
67
|
var import_rawResponseCapture = require('../../protocols/rawResponseCapture.js');
|
|
@@ -4291,7 +4292,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
4291
4292
|
const updatedContext = { ...context };
|
|
4292
4293
|
(0, import_context.forwardAliasCache)(context, updatedContext);
|
|
4293
4294
|
const hasData = taskResult?.data !== void 0 && taskResult?.data !== null;
|
|
4294
|
-
if (passed && hasData && taskResult) {
|
|
4295
|
+
if (passed && hasData && taskResult && !(effectiveStep.task === "sync_accounts" && request.dry_run === true)) {
|
|
4295
4296
|
const extracted = (0, import_context.extractContextWithProvenance)(effectiveStep.task, taskResult.data, step.id);
|
|
4296
4297
|
for (const group of extracted.clearGroups ?? []) {
|
|
4297
4298
|
if (group.when && !group.when.values.includes(updatedContext[group.when.key])) continue;
|
|
@@ -6210,7 +6211,7 @@ function applyBrandInvariant(request, options, taskName, stepFlags) {
|
|
|
6210
6211
|
result.account = merged;
|
|
6211
6212
|
}
|
|
6212
6213
|
}
|
|
6213
|
-
} else if (topAccountOk && taskName !== "list_accounts") {
|
|
6214
|
+
} else if (topAccountOk && taskName !== "list_accounts" && !import_account_policy.ACCOUNT_FREE_DISCOVERY_TASKS.has(taskName ?? "")) {
|
|
6214
6215
|
result.account = (0, import_client2.resolveAccount)(options);
|
|
6215
6216
|
}
|
|
6216
6217
|
return result;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createHash, createHmac } from "node:crypto";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { basename, join } from "node:path";
|
|
4
|
+
import { ACCOUNT_FREE_DISCOVERY_TASKS } from "./account-policy.mjs";
|
|
4
5
|
import {
|
|
5
6
|
createTestClient,
|
|
6
7
|
getOrCreateClientResolution,
|
|
@@ -4313,7 +4314,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
4313
4314
|
const updatedContext = { ...context };
|
|
4314
4315
|
forwardAliasCache(context, updatedContext);
|
|
4315
4316
|
const hasData = taskResult?.data !== void 0 && taskResult?.data !== null;
|
|
4316
|
-
if (passed && hasData && taskResult) {
|
|
4317
|
+
if (passed && hasData && taskResult && !(effectiveStep.task === "sync_accounts" && request.dry_run === true)) {
|
|
4317
4318
|
const extracted = extractContextWithProvenance(effectiveStep.task, taskResult.data, step.id);
|
|
4318
4319
|
for (const group of extracted.clearGroups ?? []) {
|
|
4319
4320
|
if (group.when && !group.when.values.includes(updatedContext[group.when.key])) continue;
|
|
@@ -6232,7 +6233,7 @@ function applyBrandInvariant(request, options, taskName, stepFlags) {
|
|
|
6232
6233
|
result.account = merged;
|
|
6233
6234
|
}
|
|
6234
6235
|
}
|
|
6235
|
-
} else if (topAccountOk && taskName !== "list_accounts") {
|
|
6236
|
+
} else if (topAccountOk && taskName !== "list_accounts" && !ACCOUNT_FREE_DISCOVERY_TASKS.has(taskName ?? "")) {
|
|
6236
6237
|
result.account = resolveAccount(options);
|
|
6237
6238
|
}
|
|
6238
6239
|
return result;
|
|
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
|
|
|
197
197
|
*/
|
|
198
198
|
export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
|
|
199
199
|
/** Capability semver emitted in run summaries and used for advisory expiry. */
|
|
200
|
-
export declare const RUNNER_CAPABILITY_VERSION = "14.
|
|
200
|
+
export declare const RUNNER_CAPABILITY_VERSION = "14.1.0";
|
|
201
201
|
/** True when a failed validation contributes to the owning step's grade. */
|
|
202
202
|
export declare function validationFailsStep(result: ValidationResult): boolean;
|
|
203
203
|
/**
|
|
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
|
|
|
197
197
|
*/
|
|
198
198
|
export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
|
|
199
199
|
/** Capability semver emitted in run summaries and used for advisory expiry. */
|
|
200
|
-
export declare const RUNNER_CAPABILITY_VERSION = "14.
|
|
200
|
+
export declare const RUNNER_CAPABILITY_VERSION = "14.1.0";
|
|
201
201
|
/** True when a failed validation contributes to the owning step's grade. */
|
|
202
202
|
export declare function validationFailsStep(result: ValidationResult): boolean;
|
|
203
203
|
/**
|
package/dist/lib/version.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AdCP SDK library version
|
|
3
3
|
*/
|
|
4
|
-
export declare const LIBRARY_VERSION = "14.
|
|
4
|
+
export declare const LIBRARY_VERSION = "14.1.0";
|
|
5
5
|
/**
|
|
6
6
|
* AdCP specification version this library is built for
|
|
7
7
|
*/
|
|
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
|
|
|
33
33
|
* Full version information
|
|
34
34
|
*/
|
|
35
35
|
export declare const VERSION_INFO: {
|
|
36
|
-
readonly library: "14.
|
|
36
|
+
readonly library: "14.1.0";
|
|
37
37
|
readonly adcp: "3.2.1";
|
|
38
38
|
readonly compatibleVersions: readonly ["v2.5", "v2.6", "v3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.1.19", "3.1.20", "3.1.21", "3.1.22", "3.1.23", "3.1.24", "3.2.1", "3.2"];
|
|
39
|
-
readonly generatedAt: "2026-10-
|
|
39
|
+
readonly generatedAt: "2026-10-04T03:18:45.725Z";
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
42
|
* Get the AdCP specification version this library is built for
|
package/dist/lib/version.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AdCP SDK library version
|
|
3
3
|
*/
|
|
4
|
-
export declare const LIBRARY_VERSION = "14.
|
|
4
|
+
export declare const LIBRARY_VERSION = "14.1.0";
|
|
5
5
|
/**
|
|
6
6
|
* AdCP specification version this library is built for
|
|
7
7
|
*/
|
|
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
|
|
|
33
33
|
* Full version information
|
|
34
34
|
*/
|
|
35
35
|
export declare const VERSION_INFO: {
|
|
36
|
-
readonly library: "14.
|
|
36
|
+
readonly library: "14.1.0";
|
|
37
37
|
readonly adcp: "3.2.1";
|
|
38
38
|
readonly compatibleVersions: readonly ["v2.5", "v2.6", "v3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.1.19", "3.1.20", "3.1.21", "3.1.22", "3.1.23", "3.1.24", "3.2.1", "3.2"];
|
|
39
|
-
readonly generatedAt: "2026-10-
|
|
39
|
+
readonly generatedAt: "2026-10-04T03:18:45.725Z";
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
42
|
* Get the AdCP specification version this library is built for
|
package/dist/lib/version.js
CHANGED
|
@@ -31,7 +31,7 @@ __export(version_exports, {
|
|
|
31
31
|
toReleasePrecisionVersion: () => toReleasePrecisionVersion
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(version_exports);
|
|
34
|
-
const LIBRARY_VERSION = "14.
|
|
34
|
+
const LIBRARY_VERSION = "14.1.0";
|
|
35
35
|
const ADCP_VERSION = "3.2.1";
|
|
36
36
|
const ADCP_MAJOR_VERSION = 3;
|
|
37
37
|
const COMPATIBLE_ADCP_VERSIONS = [
|
|
@@ -95,10 +95,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
|
|
|
95
95
|
"3.2"
|
|
96
96
|
];
|
|
97
97
|
const VERSION_INFO = {
|
|
98
|
-
library: "14.
|
|
98
|
+
library: "14.1.0",
|
|
99
99
|
adcp: "3.2.1",
|
|
100
100
|
compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
|
|
101
|
-
generatedAt: "2026-10-
|
|
101
|
+
generatedAt: "2026-10-04T03:18:45.725Z"
|
|
102
102
|
};
|
|
103
103
|
function getAdcpVersion() {
|
|
104
104
|
return ADCP_VERSION;
|
package/dist/lib/version.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const LIBRARY_VERSION = "14.
|
|
1
|
+
const LIBRARY_VERSION = "14.1.0";
|
|
2
2
|
const ADCP_VERSION = "3.2.1";
|
|
3
3
|
const ADCP_MAJOR_VERSION = 3;
|
|
4
4
|
const COMPATIBLE_ADCP_VERSIONS = [
|
|
@@ -62,10 +62,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
|
|
|
62
62
|
"3.2"
|
|
63
63
|
];
|
|
64
64
|
const VERSION_INFO = {
|
|
65
|
-
library: "14.
|
|
65
|
+
library: "14.1.0",
|
|
66
66
|
adcp: "3.2.1",
|
|
67
67
|
compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
|
|
68
|
-
generatedAt: "2026-10-
|
|
68
|
+
generatedAt: "2026-10-04T03:18:45.725Z"
|
|
69
69
|
};
|
|
70
70
|
function getAdcpVersion() {
|
|
71
71
|
return ADCP_VERSION;
|
|
@@ -140,6 +140,7 @@ export declare class WholesaleFeedSync extends EventEmitter<WholesaleFeedSyncEve
|
|
|
140
140
|
get lastEventAt(): Date | undefined;
|
|
141
141
|
private resolveMode;
|
|
142
142
|
private bootstrap;
|
|
143
|
+
private handleBootstrapFailure;
|
|
143
144
|
/** Returns `true` when the seller short-circuited with `unchanged: true`. */
|
|
144
145
|
private bootstrapProducts;
|
|
145
146
|
private bootstrapSignals;
|
|
@@ -140,6 +140,7 @@ export declare class WholesaleFeedSync extends EventEmitter<WholesaleFeedSyncEve
|
|
|
140
140
|
get lastEventAt(): Date | undefined;
|
|
141
141
|
private resolveMode;
|
|
142
142
|
private bootstrap;
|
|
143
|
+
private handleBootstrapFailure;
|
|
143
144
|
/** Returns `true` when the seller short-circuited with `unchanged: true`. */
|
|
144
145
|
private bootstrapProducts;
|
|
145
146
|
private bootstrapSignals;
|