@adcp/sdk 14.0.0 → 14.2.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 +35 -2
- package/dist/lib/core/SingleAgentClient.d.ts +35 -2
- package/dist/lib/core/SingleAgentClient.js +377 -36
- package/dist/lib/core/SingleAgentClient.mjs +387 -38
- package/dist/lib/core/TaskExecutor.d.mts +3 -1
- package/dist/lib/core/TaskExecutor.d.ts +3 -1
- package/dist/lib/core/TaskExecutor.js +17 -12
- package/dist/lib/core/TaskExecutor.mjs +17 -12
- 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 +93 -0
- package/dist/lib/core/buyer-account-registry.d.ts +93 -0
- package/dist/lib/core/buyer-account-registry.js +602 -0
- package/dist/lib/core/buyer-account-registry.mjs +578 -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 +7 -4
- package/dist/lib/index.d.ts +7 -4
- package/dist/lib/index.js +29 -0
- package/dist/lib/index.mjs +31 -1
- package/dist/lib/net/agent-transport-fetch.d.mts +4 -0
- package/dist/lib/net/agent-transport-fetch.d.ts +4 -0
- package/dist/lib/net/agent-transport-fetch.js +18 -5
- package/dist/lib/net/agent-transport-fetch.mjs +17 -5
- 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 +3 -1
- package/dist/lib/signing/agent-resolver/errors.d.ts +3 -1
- package/dist/lib/signing/agent-resolver/errors.js +6 -0
- package/dist/lib/signing/agent-resolver/errors.mjs +6 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.d.mts +11 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts +11 -0
- package/dist/lib/signing/agent-resolver/fetch-helpers.js +37 -2
- package/dist/lib/signing/agent-resolver/fetch-helpers.mjs +40 -3
- 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 +148 -137
- package/dist/lib/signing/agent-resolver/resolve-agent.mjs +157 -139
- 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 +29 -75
- package/dist/lib/signing/brand-jwks.d.ts +29 -75
- package/dist/lib/signing/brand-jwks.js +120 -182
- package/dist/lib/signing/brand-jwks.mjs +120 -182
- package/dist/lib/signing/errors.d.mts +7 -3
- package/dist/lib/signing/errors.d.ts +7 -3
- package/dist/lib/signing/errors.js +7 -2
- package/dist/lib/signing/errors.mjs +7 -2
- 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 +50 -5
- package/dist/lib/signing/verifier.mjs +50 -5
- 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 +42 -2
- 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/types/accept-proposal.d.ts +19 -1
- package/dist/lib/types/buy-products.d.ts +19 -1
- package/dist/lib/types/check-governance.d.ts +19 -1
- package/dist/lib/types/comply-test-controller.d.ts +19 -1
- package/dist/lib/types/control-media-buy.d.ts +19 -1
- package/dist/lib/types/core.generated.d.mts +14 -1
- package/dist/lib/types/core.generated.d.ts +14 -1
- package/dist/lib/types/create-media-buy.d.ts +14 -1
- package/dist/lib/types/get-media-buys.d.ts +14 -1
- package/dist/lib/types/get-products.d.ts +19 -1
- package/dist/lib/types/list-products.d.ts +19 -1
- package/dist/lib/types/refine-proposals.d.ts +19 -1
- package/dist/lib/types/request-proposals.d.ts +19 -1
- package/dist/lib/types/schemas.generated.d.ts +12 -3
- package/dist/lib/types/schemas.generated.js +4 -1
- package/dist/lib/types/schemas.generated.mjs +4 -1
- package/dist/lib/types/tools.generated.d.mts +14 -1
- package/dist/lib/types/tools.generated.d.ts +14 -1
- package/dist/lib/types/update-media-buy.d.ts +14 -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/webhooks/index.d.mts +24 -0
- package/dist/lib/webhooks/index.d.ts +24 -0
- package/dist/lib/webhooks/index.js +50 -24
- package/dist/lib/webhooks/index.mjs +49 -24
- package/dist/lib/wholesale-feed-sync/index.d.mts +2 -0
- package/dist/lib/wholesale-feed-sync/index.d.ts +2 -0
- package/dist/lib/wholesale-feed-sync/index.js +7 -0
- package/dist/lib/wholesale-feed-sync/index.mjs +4 -0
- package/dist/lib/wholesale-feed-sync/mirror.d.mts +97 -0
- package/dist/lib/wholesale-feed-sync/mirror.d.ts +97 -0
- package/dist/lib/wholesale-feed-sync/mirror.js +350 -0
- package/dist/lib/wholesale-feed-sync/mirror.mjs +322 -0
- package/dist/lib/wholesale-feed-sync/sync.d.mts +13 -29
- package/dist/lib/wholesale-feed-sync/sync.d.ts +13 -29
- package/dist/lib/wholesale-feed-sync/sync.js +208 -281
- package/dist/lib/wholesale-feed-sync/sync.mjs +213 -281
- package/dist/lib/wholesale-feed-sync/types.d.mts +4 -3
- package/dist/lib/wholesale-feed-sync/types.d.ts +4 -3
- package/docs/README.md +6 -0
- 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/BUYER-STORAGE.md +3 -0
- package/docs/guides/FIRST-CALL-TO-A-SELLER.md +106 -0
- package/docs/guides/SIGNING-GUIDE.md +16 -7
- package/docs/guides/account-resolution.md +132 -10
- package/docs/llms.txt +3 -2
- package/docs/migration-14.0-to-14.1.md +85 -0
- 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 +125 -0
- package/docs/recipes/verifying-inbound-webhooks.md +60 -15
- package/package.json +3 -2
- package/skills/adcp-brand.previous/SKILL.md +0 -200
- package/skills/adcp-creative.previous/SKILL.md +0 -305
- package/skills/adcp-governance.previous/SKILL.md +0 -566
- package/skills/adcp-measurement.previous/SKILL.md +0 -136
- package/skills/adcp-media-buy.previous/SKILL.md +0 -556
- package/skills/adcp-si.previous/SKILL.md +0 -206
- package/skills/adcp-signals.previous/SKILL.md +0 -204
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RequestSigningErrorCodeMetadata } from "../types/enums.generated.mjs";
|
|
1
2
|
class ADCPError extends Error {
|
|
2
3
|
constructor(message, details) {
|
|
3
4
|
super(message);
|
|
@@ -105,6 +106,7 @@ class AccountRequiredError extends ADCPError {
|
|
|
105
106
|
accountModel;
|
|
106
107
|
taskName;
|
|
107
108
|
code = "ACCOUNT_REQUIRED";
|
|
109
|
+
fault = "buyer_setup";
|
|
108
110
|
}
|
|
109
111
|
class AccountPendingApprovalError extends ADCPError {
|
|
110
112
|
constructor(account, accountId) {
|
|
@@ -116,6 +118,7 @@ class AccountPendingApprovalError extends ADCPError {
|
|
|
116
118
|
account;
|
|
117
119
|
accountId;
|
|
118
120
|
code = "ACCOUNT_PENDING_APPROVAL";
|
|
121
|
+
fault = "buyer_setup";
|
|
119
122
|
}
|
|
120
123
|
class AccountAmbiguousError extends ADCPError {
|
|
121
124
|
constructor(candidates) {
|
|
@@ -126,6 +129,36 @@ class AccountAmbiguousError extends ADCPError {
|
|
|
126
129
|
candidates;
|
|
127
130
|
code = "ACCOUNT_AMBIGUOUS";
|
|
128
131
|
}
|
|
132
|
+
class BuyerSetupError extends ADCPError {
|
|
133
|
+
fault = "buyer_setup";
|
|
134
|
+
}
|
|
135
|
+
class AccountNotFoundError extends BuyerSetupError {
|
|
136
|
+
code = "ACCOUNT_NOT_FOUND";
|
|
137
|
+
constructor(message = "The account has not been provisioned at this seller.") {
|
|
138
|
+
super(message);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
class AccountSetupRequiredError extends BuyerSetupError {
|
|
142
|
+
code = "ACCOUNT_SETUP_REQUIRED";
|
|
143
|
+
constructor(message = "Complete account setup before making account-scoped requests.") {
|
|
144
|
+
super(message);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
class AccountPaymentRequiredError extends BuyerSetupError {
|
|
148
|
+
code = "ACCOUNT_PAYMENT_REQUIRED";
|
|
149
|
+
constructor(message = "Complete account payment before making account-scoped requests.") {
|
|
150
|
+
super(message);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
class AccountNotProvisionedError extends AccountNotFoundError {
|
|
154
|
+
constructor(account, taskName) {
|
|
155
|
+
super(`${taskName} requires an account provisioned at this seller. Call client.accounts.ensure first.`);
|
|
156
|
+
this.account = account;
|
|
157
|
+
this.taskName = taskName;
|
|
158
|
+
}
|
|
159
|
+
account;
|
|
160
|
+
taskName;
|
|
161
|
+
}
|
|
129
162
|
class ProtocolError extends ADCPError {
|
|
130
163
|
constructor(protocol, message, originalError) {
|
|
131
164
|
super(`${protocol.toUpperCase()} protocol error: ${message}`);
|
|
@@ -181,13 +214,21 @@ class ConfigurationError extends ADCPError {
|
|
|
181
214
|
code = "CONFIGURATION_ERROR";
|
|
182
215
|
}
|
|
183
216
|
class AuthenticationRequiredError extends ADCPError {
|
|
184
|
-
constructor(agentUrl, oauthMetadata, message, challenge) {
|
|
185
|
-
const defaultMessage = buildAuthRequiredMessage(agentUrl, oauthMetadata, challenge);
|
|
217
|
+
constructor(agentUrl, oauthMetadata, message, challenge, signedRejection) {
|
|
218
|
+
const defaultMessage = buildAuthRequiredMessage(agentUrl, oauthMetadata, challenge, !!signedRejection);
|
|
186
219
|
super(message || defaultMessage);
|
|
187
220
|
this.agentUrl = agentUrl;
|
|
188
221
|
this.oauthMetadata = oauthMetadata;
|
|
189
222
|
this.challenge = challenge;
|
|
190
223
|
this.details = { agentUrl, oauthMetadata, challenge };
|
|
224
|
+
if (signedRejection) {
|
|
225
|
+
this.requestSigned = true;
|
|
226
|
+
this.status = signedRejection.status;
|
|
227
|
+
const signatureCode = getRequestSignatureRejectionCode(challenge);
|
|
228
|
+
if (signatureCode) this.signatureErrorCode = signatureCode;
|
|
229
|
+
Object.defineProperty(this, "responseBody", { value: signedRejection.responseBody, enumerable: false });
|
|
230
|
+
this.details = { agentUrl, challenge, requestSigned: true, status: this.status };
|
|
231
|
+
}
|
|
191
232
|
}
|
|
192
233
|
agentUrl;
|
|
193
234
|
oauthMetadata;
|
|
@@ -245,7 +286,12 @@ function sanitizeAgentUrlForError(value) {
|
|
|
245
286
|
return "invalid_url";
|
|
246
287
|
}
|
|
247
288
|
}
|
|
248
|
-
function buildAuthRequiredMessage(agentUrl, oauthMetadata, challenge) {
|
|
289
|
+
function buildAuthRequiredMessage(agentUrl, oauthMetadata, challenge, requestSigned = false) {
|
|
290
|
+
if (requestSigned || challenge?.scheme === "signature") {
|
|
291
|
+
const code = getRequestSignatureRejectionCode(challenge);
|
|
292
|
+
const suggestion = code ? ` ${RequestSigningErrorCodeMetadata[code].suggestion}.` : "";
|
|
293
|
+
return `Authentication failed with HTTP 401 for ${sanitizeAgentUrlForError(agentUrl)}. ` + (requestSigned ? "The seller rejected an SDK-signed request" : "The seller requires a valid request signature") + (code ? ` (${code})` : "") + ". Check signature verification and key discovery (brand_json_url \u2192 agents[] \u2192 jwks_uri)." + (requestSigned && !challenge ? " No authentication challenge was returned; check configured credentials too." : "") + suggestion + (requestSigned ? " A bounded seller diagnostic is available on responseBody when captured." : "");
|
|
294
|
+
}
|
|
249
295
|
if (challenge && challenge.scheme !== "bearer") {
|
|
250
296
|
if (challenge.scheme === "basic") {
|
|
251
297
|
return `Authentication required for ${agentUrl}. Agent (or its fronting gateway) speaks HTTP Basic (RFC 7617). Configure via createTestClient({ auth: { type: 'basic', username, password } }) \u2014 or from the CLI, --auth <user:pass> --auth-scheme basic.`;
|
|
@@ -258,6 +304,10 @@ function buildAuthRequiredMessage(agentUrl, oauthMetadata, challenge) {
|
|
|
258
304
|
}
|
|
259
305
|
return `Authentication required for ${agentUrl}. No OAuth metadata available - provide auth_token in agent config.`;
|
|
260
306
|
}
|
|
307
|
+
function getRequestSignatureRejectionCode(challenge) {
|
|
308
|
+
if (challenge?.scheme !== "signature" || !challenge.error) return void 0;
|
|
309
|
+
return Object.prototype.hasOwnProperty.call(RequestSigningErrorCodeMetadata, challenge.error) ? challenge.error : void 0;
|
|
310
|
+
}
|
|
261
311
|
class IdempotencyConflictError extends ADCPError {
|
|
262
312
|
code = "IDEMPOTENCY_CONFLICT";
|
|
263
313
|
// Exposed via the getter so `console.log(err)` and JSON.stringify don't
|
|
@@ -463,6 +513,12 @@ function is401Error(error, got401Flag = false) {
|
|
|
463
513
|
}
|
|
464
514
|
function adcpErrorToTypedError(adcpError, idempotencyKey) {
|
|
465
515
|
switch (adcpError.code) {
|
|
516
|
+
case "ACCOUNT_NOT_FOUND":
|
|
517
|
+
return new AccountNotFoundError(adcpError.message);
|
|
518
|
+
case "ACCOUNT_SETUP_REQUIRED":
|
|
519
|
+
return new AccountSetupRequiredError(adcpError.message);
|
|
520
|
+
case "ACCOUNT_PAYMENT_REQUIRED":
|
|
521
|
+
return new AccountPaymentRequiredError(adcpError.message);
|
|
466
522
|
case "IDEMPOTENCY_CONFLICT":
|
|
467
523
|
return new IdempotencyConflictError(idempotencyKey, adcpError.message);
|
|
468
524
|
case "IDEMPOTENCY_EXPIRED":
|
|
@@ -540,12 +596,17 @@ function extractErrorInfo(error) {
|
|
|
540
596
|
export {
|
|
541
597
|
ADCPError,
|
|
542
598
|
AccountAmbiguousError,
|
|
599
|
+
AccountNotFoundError,
|
|
600
|
+
AccountNotProvisionedError,
|
|
601
|
+
AccountPaymentRequiredError,
|
|
543
602
|
AccountPendingApprovalError,
|
|
544
603
|
AccountRequiredError,
|
|
604
|
+
AccountSetupRequiredError,
|
|
545
605
|
ActionNotAllowedError,
|
|
546
606
|
AgentNotFoundError,
|
|
547
607
|
AuthenticationCredentialsRejectedError,
|
|
548
608
|
AuthenticationRequiredError,
|
|
609
|
+
BuyerSetupError,
|
|
549
610
|
ConfigurationError,
|
|
550
611
|
DeferredTaskError,
|
|
551
612
|
FeatureUnsupportedError,
|
|
@@ -12,6 +12,7 @@ import type { CheckGovernanceRequest, GovernancePhase, PlannedDelivery } from '.
|
|
|
12
12
|
import type { JwksResolver } from '../signing/jwks.mjs';
|
|
13
13
|
import type { ReplayStore } from '../signing/replay.mjs';
|
|
14
14
|
import type { RevocationStore } from '../signing/revocation.mjs';
|
|
15
|
+
import { type HttpsJwksResolverOptions } from '../signing/jwks-https.mjs';
|
|
15
16
|
export declare const GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS: readonly ["authorized_commitment", "authorized_task", "authorized_payload_hash"];
|
|
16
17
|
export type GovernanceAuthorizationCriticalClaim = (typeof GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS)[number];
|
|
17
18
|
export type GovernanceEnforcementMode = 'signed_context' | 'online_execution_check';
|
|
@@ -101,6 +102,18 @@ export interface GovernanceRevocationStatus {
|
|
|
101
102
|
export interface GovernanceRevocationResolver {
|
|
102
103
|
resolve(issuer: string, kid: string, jti: string): GovernanceRevocationStatus | Promise<GovernanceRevocationStatus>;
|
|
103
104
|
}
|
|
105
|
+
/** Authenticated buyer context, never the JWS payload or a sibling brand's record. */
|
|
106
|
+
export interface GovernanceBuyerIdentity {
|
|
107
|
+
/** For signed buyers, pass AgentResolution.brandJson without refetching its host. */
|
|
108
|
+
brandJson: unknown;
|
|
109
|
+
/** Domain of the governed request's brand; portfolio brands require an exact URL hostname match (including www). */
|
|
110
|
+
brandDomain: string;
|
|
111
|
+
/** Trusted resolver factory; implementations may cache by canonical JWKS URI. */
|
|
112
|
+
jwksForUri?: (jwksUri: string) => JwksResolver;
|
|
113
|
+
/** Reuse this options object across requests to share its bounded resolver cache. */
|
|
114
|
+
jwksOptions?: HttpsJwksResolverOptions;
|
|
115
|
+
}
|
|
116
|
+
export declare function createGovernanceAgentJwksResolver(issuer: string, buyer: GovernanceBuyerIdentity): JwksResolver;
|
|
104
117
|
export interface VerifyGovernanceAuthorizationOptions {
|
|
105
118
|
token: unknown;
|
|
106
119
|
expectedIssuer: string;
|
|
@@ -111,7 +124,9 @@ export interface VerifyGovernanceAuthorizationOptions {
|
|
|
111
124
|
actualCommitment: GovernanceCommitment;
|
|
112
125
|
/** Defaults to `intent`, the phase accepted by a downstream service. */
|
|
113
126
|
expectedPhase?: 'intent';
|
|
114
|
-
jwks
|
|
127
|
+
jwks?: JwksResolver;
|
|
128
|
+
/** When supplied, discover keys from this exact authenticated buyer record. */
|
|
129
|
+
buyerIdentity?: GovernanceBuyerIdentity;
|
|
115
130
|
replayStore: GovernanceReplayStore;
|
|
116
131
|
/** Optional governance-key revocation source. */
|
|
117
132
|
revocationStore?: RevocationStore;
|
|
@@ -178,6 +193,7 @@ export declare class GovernanceAuthorizationError extends Error {
|
|
|
178
193
|
}
|
|
179
194
|
export interface GovernanceEnforcementMiddlewareInput {
|
|
180
195
|
token: unknown;
|
|
196
|
+
buyerIdentity?: GovernanceBuyerIdentity;
|
|
181
197
|
authenticatedCaller: string;
|
|
182
198
|
task: string;
|
|
183
199
|
payload: Record<string, unknown>;
|
|
@@ -12,6 +12,7 @@ import type { CheckGovernanceRequest, GovernancePhase, PlannedDelivery } from '.
|
|
|
12
12
|
import type { JwksResolver } from '../signing/jwks';
|
|
13
13
|
import type { ReplayStore } from '../signing/replay';
|
|
14
14
|
import type { RevocationStore } from '../signing/revocation';
|
|
15
|
+
import { type HttpsJwksResolverOptions } from '../signing/jwks-https';
|
|
15
16
|
export declare const GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS: readonly ["authorized_commitment", "authorized_task", "authorized_payload_hash"];
|
|
16
17
|
export type GovernanceAuthorizationCriticalClaim = (typeof GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS)[number];
|
|
17
18
|
export type GovernanceEnforcementMode = 'signed_context' | 'online_execution_check';
|
|
@@ -101,6 +102,18 @@ export interface GovernanceRevocationStatus {
|
|
|
101
102
|
export interface GovernanceRevocationResolver {
|
|
102
103
|
resolve(issuer: string, kid: string, jti: string): GovernanceRevocationStatus | Promise<GovernanceRevocationStatus>;
|
|
103
104
|
}
|
|
105
|
+
/** Authenticated buyer context, never the JWS payload or a sibling brand's record. */
|
|
106
|
+
export interface GovernanceBuyerIdentity {
|
|
107
|
+
/** For signed buyers, pass AgentResolution.brandJson without refetching its host. */
|
|
108
|
+
brandJson: unknown;
|
|
109
|
+
/** Domain of the governed request's brand; portfolio brands require an exact URL hostname match (including www). */
|
|
110
|
+
brandDomain: string;
|
|
111
|
+
/** Trusted resolver factory; implementations may cache by canonical JWKS URI. */
|
|
112
|
+
jwksForUri?: (jwksUri: string) => JwksResolver;
|
|
113
|
+
/** Reuse this options object across requests to share its bounded resolver cache. */
|
|
114
|
+
jwksOptions?: HttpsJwksResolverOptions;
|
|
115
|
+
}
|
|
116
|
+
export declare function createGovernanceAgentJwksResolver(issuer: string, buyer: GovernanceBuyerIdentity): JwksResolver;
|
|
104
117
|
export interface VerifyGovernanceAuthorizationOptions {
|
|
105
118
|
token: unknown;
|
|
106
119
|
expectedIssuer: string;
|
|
@@ -111,7 +124,9 @@ export interface VerifyGovernanceAuthorizationOptions {
|
|
|
111
124
|
actualCommitment: GovernanceCommitment;
|
|
112
125
|
/** Defaults to `intent`, the phase accepted by a downstream service. */
|
|
113
126
|
expectedPhase?: 'intent';
|
|
114
|
-
jwks
|
|
127
|
+
jwks?: JwksResolver;
|
|
128
|
+
/** When supplied, discover keys from this exact authenticated buyer record. */
|
|
129
|
+
buyerIdentity?: GovernanceBuyerIdentity;
|
|
115
130
|
replayStore: GovernanceReplayStore;
|
|
116
131
|
/** Optional governance-key revocation source. */
|
|
117
132
|
revocationStore?: RevocationStore;
|
|
@@ -178,6 +193,7 @@ export declare class GovernanceAuthorizationError extends Error {
|
|
|
178
193
|
}
|
|
179
194
|
export interface GovernanceEnforcementMiddlewareInput {
|
|
180
195
|
token: unknown;
|
|
196
|
+
buyerIdentity?: GovernanceBuyerIdentity;
|
|
181
197
|
authenticatedCaller: string;
|
|
182
198
|
task: string;
|
|
183
199
|
payload: Record<string, unknown>;
|
|
@@ -28,6 +28,7 @@ __export(authorization_exports, {
|
|
|
28
28
|
buildGovernanceIntentRequest: () => buildGovernanceIntentRequest,
|
|
29
29
|
buildGovernanceProposedCommitment: () => buildGovernanceProposedCommitment,
|
|
30
30
|
computeGovernedPayloadHash: () => computeGovernedPayloadHash,
|
|
31
|
+
createGovernanceAgentJwksResolver: () => createGovernanceAgentJwksResolver,
|
|
31
32
|
createGovernanceEnforcementMiddleware: () => createGovernanceEnforcementMiddleware,
|
|
32
33
|
getGovernanceEnforcementTasks: () => getGovernanceEnforcementTasks,
|
|
33
34
|
governancePurchaseTypeForTask: () => governancePurchaseTypeForTask,
|
|
@@ -40,6 +41,8 @@ module.exports = __toCommonJS(authorization_exports);
|
|
|
40
41
|
var import_node_crypto = require("node:crypto");
|
|
41
42
|
var import_jose = require("jose");
|
|
42
43
|
var import_jcs = require('../utils/jcs.js');
|
|
44
|
+
var import_jwks_https = require('../signing/jwks-https.js');
|
|
45
|
+
var import_select_agent = require('../signing/agent-resolver/select-agent.js');
|
|
43
46
|
var import_strict_json = require('../signing/agent-resolver/strict-json.js');
|
|
44
47
|
const GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS = Object.freeze([
|
|
45
48
|
"authorized_commitment",
|
|
@@ -99,6 +102,42 @@ class InMemoryGovernanceReplayStore {
|
|
|
99
102
|
return scope;
|
|
100
103
|
}
|
|
101
104
|
}
|
|
105
|
+
const governanceDefaultResolvers = /* @__PURE__ */ new Map();
|
|
106
|
+
const governanceConfiguredResolvers = /* @__PURE__ */ new WeakMap();
|
|
107
|
+
function createGovernanceAgentJwksResolver(issuer, buyer) {
|
|
108
|
+
const record = (0, import_select_agent.relyingPartyAgentRecord)(buyer.brandJson, buyer.brandDomain);
|
|
109
|
+
const entry = (0, import_select_agent.selectAgentByUrl)(record, issuer, { agentType: "governance" });
|
|
110
|
+
const uri = (0, import_select_agent.agentJwksUri)(entry);
|
|
111
|
+
if (buyer.jwksForUri) return buyer.jwksForUri(uri);
|
|
112
|
+
const key = (0, import_select_agent.canonicalAgentUrl)(uri);
|
|
113
|
+
let cache = governanceDefaultResolvers;
|
|
114
|
+
if (buyer.jwksOptions) {
|
|
115
|
+
const existing = governanceConfiguredResolvers.get(buyer.jwksOptions);
|
|
116
|
+
cache = existing ?? /* @__PURE__ */ new Map();
|
|
117
|
+
if (!existing) governanceConfiguredResolvers.set(buyer.jwksOptions, cache);
|
|
118
|
+
}
|
|
119
|
+
let resolver = cache.get(key);
|
|
120
|
+
if (!resolver) {
|
|
121
|
+
const maxAge = buyer.jwksOptions?.maxAgeSeconds ?? 1800;
|
|
122
|
+
const minCooldown = buyer.jwksOptions?.minCooldownSeconds ?? 30;
|
|
123
|
+
if (!Number.isFinite(maxAge) || maxAge <= 0) {
|
|
124
|
+
throw new TypeError("Governance maxAgeSeconds must be a finite positive number");
|
|
125
|
+
}
|
|
126
|
+
if (!Number.isFinite(minCooldown) || minCooldown < 0) {
|
|
127
|
+
throw new TypeError("Governance minCooldownSeconds must be a finite non-negative number");
|
|
128
|
+
}
|
|
129
|
+
resolver = new import_jwks_https.HttpsJwksResolver(uri, {
|
|
130
|
+
...buyer.jwksOptions,
|
|
131
|
+
maxAgeSeconds: Math.min(maxAge, 1800),
|
|
132
|
+
minCooldownSeconds: Math.max(minCooldown, 30),
|
|
133
|
+
minCacheAgeSeconds: 60,
|
|
134
|
+
failClosed: true
|
|
135
|
+
});
|
|
136
|
+
if (cache.size >= 512) cache.delete(cache.keys().next().value);
|
|
137
|
+
cache.set(key, resolver);
|
|
138
|
+
}
|
|
139
|
+
return resolver;
|
|
140
|
+
}
|
|
102
141
|
function buildGovernanceCommitment(amount, currency) {
|
|
103
142
|
if (!Number.isFinite(amount) || amount < 0) {
|
|
104
143
|
throw new TypeError("Governance commitment amount must be finite and non-negative");
|
|
@@ -300,14 +339,21 @@ async function verifyGovernanceAuthorization(options) {
|
|
|
300
339
|
if (decodedClaims.authorized_task === void 0 !== (decodedClaims.authorized_payload_hash === void 0)) {
|
|
301
340
|
return reject("governance_token_invalid", "authorized_task and authorized_payload_hash must appear together");
|
|
302
341
|
}
|
|
303
|
-
|
|
342
|
+
let canonicalIssuer;
|
|
343
|
+
try {
|
|
344
|
+
if (typeof decodedClaims.iss !== "string") throw new TypeError("Missing issuer");
|
|
345
|
+
canonicalIssuer = (0, import_select_agent.canonicalAgentUrl)(decodedClaims.iss);
|
|
346
|
+
if (canonicalIssuer !== (0, import_select_agent.canonicalAgentUrl)(options.expectedIssuer)) throw new TypeError("Issuer mismatch");
|
|
347
|
+
} catch {
|
|
304
348
|
return reject("governance_token_invalid", "Governance token issuer mismatch");
|
|
305
349
|
}
|
|
306
350
|
const kid = typeof protectedHeader.kid === "string" ? protectedHeader.kid : "";
|
|
307
351
|
if (!kid) return reject("governance_key_unknown", "Governance signing kid is missing");
|
|
308
352
|
let jwk;
|
|
309
353
|
try {
|
|
310
|
-
|
|
354
|
+
const resolver = options.buyerIdentity ? createGovernanceAgentJwksResolver(canonicalIssuer, options.buyerIdentity) : options.jwks;
|
|
355
|
+
if (!resolver) return reject("governance_key_unknown", "No governance key resolver or buyer identity configured");
|
|
356
|
+
jwk = await resolver.resolve(kid);
|
|
311
357
|
} catch {
|
|
312
358
|
return reject("governance_key_unknown", "Governance signing key could not be resolved");
|
|
313
359
|
}
|
|
@@ -331,7 +377,7 @@ async function verifyGovernanceAuthorization(options) {
|
|
|
331
377
|
if (options.revocationStore && await options.revocationStore.isRevoked(kid)) {
|
|
332
378
|
return reject("governance_token_revoked", "Governance signing key is revoked");
|
|
333
379
|
}
|
|
334
|
-
if (options.isJtiRevoked && typeof decodedClaims.jti === "string" && await options.isJtiRevoked(
|
|
380
|
+
if (options.isJtiRevoked && typeof decodedClaims.jti === "string" && await options.isJtiRevoked(canonicalIssuer, decodedClaims.jti)) {
|
|
335
381
|
return reject("governance_token_revoked", "Governance token is revoked");
|
|
336
382
|
}
|
|
337
383
|
} catch {
|
|
@@ -401,8 +447,8 @@ async function verifyGovernanceAuthorization(options) {
|
|
|
401
447
|
let hasFreshCombinedRevocation = false;
|
|
402
448
|
if (options.revocationResolver) {
|
|
403
449
|
try {
|
|
404
|
-
const status = await options.revocationResolver.resolve(
|
|
405
|
-
if (status.issuer !==
|
|
450
|
+
const status = await options.revocationResolver.resolve(canonicalIssuer, kid, decodedClaims.jti);
|
|
451
|
+
if ((0, import_select_agent.canonicalAgentUrl)(status.issuer) !== canonicalIssuer || typeof status.keyRevoked !== "boolean" || typeof status.jtiRevoked !== "boolean" || !Number.isFinite(status.nextUpdate) || status.nextUpdate < now) {
|
|
406
452
|
return reject("governance_token_revoked", "Governance revocation status is stale or mismatched");
|
|
407
453
|
}
|
|
408
454
|
if (status.keyRevoked || status.jtiRevoked) {
|
|
@@ -455,7 +501,7 @@ async function verifyGovernanceAuthorization(options) {
|
|
|
455
501
|
try {
|
|
456
502
|
const idempotencyKey = typeof options.payload.idempotency_key === "string" ? options.payload.idempotency_key : void 0;
|
|
457
503
|
replayResult = await options.replayStore.consume(
|
|
458
|
-
|
|
504
|
+
canonicalIssuer,
|
|
459
505
|
decodedClaims.aud,
|
|
460
506
|
decodedClaims.jti,
|
|
461
507
|
decodedClaims.exp + skew,
|
|
@@ -500,7 +546,8 @@ function createGovernanceEnforcementMiddleware(config) {
|
|
|
500
546
|
expectedTask: input.task,
|
|
501
547
|
payload: input.payload,
|
|
502
548
|
actualCommitment: input.actualCommitment,
|
|
503
|
-
expectedPhase: input.expectedPhase
|
|
549
|
+
expectedPhase: input.expectedPhase,
|
|
550
|
+
...input.buyerIdentity !== void 0 && { buyerIdentity: input.buyerIdentity }
|
|
504
551
|
});
|
|
505
552
|
if (!result.ok) throw new GovernanceAuthorizationError(result);
|
|
506
553
|
return next(result);
|
|
@@ -531,6 +578,7 @@ function decodeJsonObject(segment) {
|
|
|
531
578
|
buildGovernanceIntentRequest,
|
|
532
579
|
buildGovernanceProposedCommitment,
|
|
533
580
|
computeGovernedPayloadHash,
|
|
581
|
+
createGovernanceAgentJwksResolver,
|
|
534
582
|
createGovernanceEnforcementMiddleware,
|
|
535
583
|
getGovernanceEnforcementTasks,
|
|
536
584
|
governancePurchaseTypeForTask,
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { compactVerify, importJWK } from "jose";
|
|
3
3
|
import { canonicalize } from "../utils/jcs.mjs";
|
|
4
|
+
import { HttpsJwksResolver } from "../signing/jwks-https.mjs";
|
|
5
|
+
import {
|
|
6
|
+
relyingPartyAgentRecord,
|
|
7
|
+
selectAgentByUrl,
|
|
8
|
+
agentJwksUri,
|
|
9
|
+
canonicalAgentUrl
|
|
10
|
+
} from "../signing/agent-resolver/select-agent.mjs";
|
|
4
11
|
import { parseStrictJson } from "../signing/agent-resolver/strict-json.mjs";
|
|
5
12
|
const GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS = Object.freeze([
|
|
6
13
|
"authorized_commitment",
|
|
@@ -60,6 +67,42 @@ class InMemoryGovernanceReplayStore {
|
|
|
60
67
|
return scope;
|
|
61
68
|
}
|
|
62
69
|
}
|
|
70
|
+
const governanceDefaultResolvers = /* @__PURE__ */ new Map();
|
|
71
|
+
const governanceConfiguredResolvers = /* @__PURE__ */ new WeakMap();
|
|
72
|
+
function createGovernanceAgentJwksResolver(issuer, buyer) {
|
|
73
|
+
const record = relyingPartyAgentRecord(buyer.brandJson, buyer.brandDomain);
|
|
74
|
+
const entry = selectAgentByUrl(record, issuer, { agentType: "governance" });
|
|
75
|
+
const uri = agentJwksUri(entry);
|
|
76
|
+
if (buyer.jwksForUri) return buyer.jwksForUri(uri);
|
|
77
|
+
const key = canonicalAgentUrl(uri);
|
|
78
|
+
let cache = governanceDefaultResolvers;
|
|
79
|
+
if (buyer.jwksOptions) {
|
|
80
|
+
const existing = governanceConfiguredResolvers.get(buyer.jwksOptions);
|
|
81
|
+
cache = existing ?? /* @__PURE__ */ new Map();
|
|
82
|
+
if (!existing) governanceConfiguredResolvers.set(buyer.jwksOptions, cache);
|
|
83
|
+
}
|
|
84
|
+
let resolver = cache.get(key);
|
|
85
|
+
if (!resolver) {
|
|
86
|
+
const maxAge = buyer.jwksOptions?.maxAgeSeconds ?? 1800;
|
|
87
|
+
const minCooldown = buyer.jwksOptions?.minCooldownSeconds ?? 30;
|
|
88
|
+
if (!Number.isFinite(maxAge) || maxAge <= 0) {
|
|
89
|
+
throw new TypeError("Governance maxAgeSeconds must be a finite positive number");
|
|
90
|
+
}
|
|
91
|
+
if (!Number.isFinite(minCooldown) || minCooldown < 0) {
|
|
92
|
+
throw new TypeError("Governance minCooldownSeconds must be a finite non-negative number");
|
|
93
|
+
}
|
|
94
|
+
resolver = new HttpsJwksResolver(uri, {
|
|
95
|
+
...buyer.jwksOptions,
|
|
96
|
+
maxAgeSeconds: Math.min(maxAge, 1800),
|
|
97
|
+
minCooldownSeconds: Math.max(minCooldown, 30),
|
|
98
|
+
minCacheAgeSeconds: 60,
|
|
99
|
+
failClosed: true
|
|
100
|
+
});
|
|
101
|
+
if (cache.size >= 512) cache.delete(cache.keys().next().value);
|
|
102
|
+
cache.set(key, resolver);
|
|
103
|
+
}
|
|
104
|
+
return resolver;
|
|
105
|
+
}
|
|
63
106
|
function buildGovernanceCommitment(amount, currency) {
|
|
64
107
|
if (!Number.isFinite(amount) || amount < 0) {
|
|
65
108
|
throw new TypeError("Governance commitment amount must be finite and non-negative");
|
|
@@ -261,14 +304,21 @@ async function verifyGovernanceAuthorization(options) {
|
|
|
261
304
|
if (decodedClaims.authorized_task === void 0 !== (decodedClaims.authorized_payload_hash === void 0)) {
|
|
262
305
|
return reject("governance_token_invalid", "authorized_task and authorized_payload_hash must appear together");
|
|
263
306
|
}
|
|
264
|
-
|
|
307
|
+
let canonicalIssuer;
|
|
308
|
+
try {
|
|
309
|
+
if (typeof decodedClaims.iss !== "string") throw new TypeError("Missing issuer");
|
|
310
|
+
canonicalIssuer = canonicalAgentUrl(decodedClaims.iss);
|
|
311
|
+
if (canonicalIssuer !== canonicalAgentUrl(options.expectedIssuer)) throw new TypeError("Issuer mismatch");
|
|
312
|
+
} catch {
|
|
265
313
|
return reject("governance_token_invalid", "Governance token issuer mismatch");
|
|
266
314
|
}
|
|
267
315
|
const kid = typeof protectedHeader.kid === "string" ? protectedHeader.kid : "";
|
|
268
316
|
if (!kid) return reject("governance_key_unknown", "Governance signing kid is missing");
|
|
269
317
|
let jwk;
|
|
270
318
|
try {
|
|
271
|
-
|
|
319
|
+
const resolver = options.buyerIdentity ? createGovernanceAgentJwksResolver(canonicalIssuer, options.buyerIdentity) : options.jwks;
|
|
320
|
+
if (!resolver) return reject("governance_key_unknown", "No governance key resolver or buyer identity configured");
|
|
321
|
+
jwk = await resolver.resolve(kid);
|
|
272
322
|
} catch {
|
|
273
323
|
return reject("governance_key_unknown", "Governance signing key could not be resolved");
|
|
274
324
|
}
|
|
@@ -292,7 +342,7 @@ async function verifyGovernanceAuthorization(options) {
|
|
|
292
342
|
if (options.revocationStore && await options.revocationStore.isRevoked(kid)) {
|
|
293
343
|
return reject("governance_token_revoked", "Governance signing key is revoked");
|
|
294
344
|
}
|
|
295
|
-
if (options.isJtiRevoked && typeof decodedClaims.jti === "string" && await options.isJtiRevoked(
|
|
345
|
+
if (options.isJtiRevoked && typeof decodedClaims.jti === "string" && await options.isJtiRevoked(canonicalIssuer, decodedClaims.jti)) {
|
|
296
346
|
return reject("governance_token_revoked", "Governance token is revoked");
|
|
297
347
|
}
|
|
298
348
|
} catch {
|
|
@@ -362,8 +412,8 @@ async function verifyGovernanceAuthorization(options) {
|
|
|
362
412
|
let hasFreshCombinedRevocation = false;
|
|
363
413
|
if (options.revocationResolver) {
|
|
364
414
|
try {
|
|
365
|
-
const status = await options.revocationResolver.resolve(
|
|
366
|
-
if (status.issuer !==
|
|
415
|
+
const status = await options.revocationResolver.resolve(canonicalIssuer, kid, decodedClaims.jti);
|
|
416
|
+
if (canonicalAgentUrl(status.issuer) !== canonicalIssuer || typeof status.keyRevoked !== "boolean" || typeof status.jtiRevoked !== "boolean" || !Number.isFinite(status.nextUpdate) || status.nextUpdate < now) {
|
|
367
417
|
return reject("governance_token_revoked", "Governance revocation status is stale or mismatched");
|
|
368
418
|
}
|
|
369
419
|
if (status.keyRevoked || status.jtiRevoked) {
|
|
@@ -416,7 +466,7 @@ async function verifyGovernanceAuthorization(options) {
|
|
|
416
466
|
try {
|
|
417
467
|
const idempotencyKey = typeof options.payload.idempotency_key === "string" ? options.payload.idempotency_key : void 0;
|
|
418
468
|
replayResult = await options.replayStore.consume(
|
|
419
|
-
|
|
469
|
+
canonicalIssuer,
|
|
420
470
|
decodedClaims.aud,
|
|
421
471
|
decodedClaims.jti,
|
|
422
472
|
decodedClaims.exp + skew,
|
|
@@ -461,7 +511,8 @@ function createGovernanceEnforcementMiddleware(config) {
|
|
|
461
511
|
expectedTask: input.task,
|
|
462
512
|
payload: input.payload,
|
|
463
513
|
actualCommitment: input.actualCommitment,
|
|
464
|
-
expectedPhase: input.expectedPhase
|
|
514
|
+
expectedPhase: input.expectedPhase,
|
|
515
|
+
...input.buyerIdentity !== void 0 && { buyerIdentity: input.buyerIdentity }
|
|
465
516
|
});
|
|
466
517
|
if (!result.ok) throw new GovernanceAuthorizationError(result);
|
|
467
518
|
return next(result);
|
|
@@ -491,6 +542,7 @@ export {
|
|
|
491
542
|
buildGovernanceIntentRequest,
|
|
492
543
|
buildGovernanceProposedCommitment,
|
|
493
544
|
computeGovernedPayloadHash,
|
|
545
|
+
createGovernanceAgentJwksResolver,
|
|
494
546
|
createGovernanceEnforcementMiddleware,
|
|
495
547
|
getGovernanceEnforcementTasks,
|
|
496
548
|
governancePurchaseTypeForTask,
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* advisory — the authoritative check happens in the governance agent, which
|
|
14
14
|
* resolves category synonyms and custom policies server-side.
|
|
15
15
|
*/
|
|
16
|
-
export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, verifyGovernanceAuthorization, } from './authorization.mjs';
|
|
17
|
-
export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, InMemoryGovernanceReplayStoreOptions, VerifyGovernanceAuthorizationOptions, } from './authorization.mjs';
|
|
16
|
+
export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, verifyGovernanceAuthorization, createGovernanceAgentJwksResolver, } from './authorization.mjs';
|
|
17
|
+
export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, InMemoryGovernanceReplayStoreOptions, VerifyGovernanceAuthorizationOptions, GovernanceBuyerIdentity, } from './authorization.mjs';
|
|
18
18
|
/**
|
|
19
19
|
* `policy_categories` values that MUST set `human_review_required: true`
|
|
20
20
|
* under GDPR Art 22 / EU AI Act Annex III. Matches the schema's `if/then`
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* advisory — the authoritative check happens in the governance agent, which
|
|
14
14
|
* resolves category synonyms and custom policies server-side.
|
|
15
15
|
*/
|
|
16
|
-
export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, verifyGovernanceAuthorization, } from './authorization';
|
|
17
|
-
export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, InMemoryGovernanceReplayStoreOptions, VerifyGovernanceAuthorizationOptions, } from './authorization';
|
|
16
|
+
export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, verifyGovernanceAuthorization, createGovernanceAgentJwksResolver, } from './authorization';
|
|
17
|
+
export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, InMemoryGovernanceReplayStoreOptions, VerifyGovernanceAuthorizationOptions, GovernanceBuyerIdentity, } from './authorization';
|
|
18
18
|
/**
|
|
19
19
|
* `policy_categories` values that MUST set `human_review_required: true`
|
|
20
20
|
* under GDPR Art 22 / EU AI Act Annex III. Matches the schema's `if/then`
|
|
@@ -32,6 +32,7 @@ __export(governance_exports, {
|
|
|
32
32
|
buildHumanOverride: () => buildHumanOverride,
|
|
33
33
|
buildHumanReviewPlan: () => buildHumanReviewPlan,
|
|
34
34
|
computeGovernedPayloadHash: () => import_authorization.computeGovernedPayloadHash,
|
|
35
|
+
createGovernanceAgentJwksResolver: () => import_authorization.createGovernanceAgentJwksResolver,
|
|
35
36
|
createGovernanceEnforcementMiddleware: () => import_authorization.createGovernanceEnforcementMiddleware,
|
|
36
37
|
getGovernanceEnforcementTasks: () => import_authorization.getGovernanceEnforcementTasks,
|
|
37
38
|
governancePurchaseTypeForTask: () => import_authorization.governancePurchaseTypeForTask,
|
|
@@ -156,6 +157,7 @@ function validateGovernancePlan(plan) {
|
|
|
156
157
|
buildHumanOverride,
|
|
157
158
|
buildHumanReviewPlan,
|
|
158
159
|
computeGovernedPayloadHash,
|
|
160
|
+
createGovernanceAgentJwksResolver,
|
|
159
161
|
createGovernanceEnforcementMiddleware,
|
|
160
162
|
getGovernanceEnforcementTasks,
|
|
161
163
|
governancePurchaseTypeForTask,
|
|
@@ -15,7 +15,8 @@ import {
|
|
|
15
15
|
governanceTaskRequiresProposedCommitment,
|
|
16
16
|
targetDeclaresGovernanceEnforcement,
|
|
17
17
|
targetDeclaresLegacyGovernanceAwareness,
|
|
18
|
-
verifyGovernanceAuthorization
|
|
18
|
+
verifyGovernanceAuthorization,
|
|
19
|
+
createGovernanceAgentJwksResolver
|
|
19
20
|
} from "./authorization.mjs";
|
|
20
21
|
const REGULATED_HUMAN_REVIEW_CATEGORIES = Object.freeze([
|
|
21
22
|
"fair_housing",
|
|
@@ -129,6 +130,7 @@ export {
|
|
|
129
130
|
buildHumanOverride,
|
|
130
131
|
buildHumanReviewPlan,
|
|
131
132
|
computeGovernedPayloadHash,
|
|
133
|
+
createGovernanceAgentJwksResolver,
|
|
132
134
|
createGovernanceEnforcementMiddleware,
|
|
133
135
|
getGovernanceEnforcementTasks,
|
|
134
136
|
governancePurchaseTypeForTask,
|
package/dist/lib/index.d.mts
CHANGED
|
@@ -37,12 +37,12 @@ export type { GovernanceConfig, CampaignGovernanceConfig, GovernanceCheckResult,
|
|
|
37
37
|
export { GovernanceMiddleware } from './core/GovernanceMiddleware.mjs';
|
|
38
38
|
export { isGovernanceApproved, isGovernanceConditions, isGovernanceDenied, normalizeGovernanceVerdict, } from './core/GovernanceTypes.mjs';
|
|
39
39
|
export type { GovernanceDebugEntry } from './core/GovernanceMiddleware.mjs';
|
|
40
|
-
export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, buildHumanReviewPlan, buildHumanOverride, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, validateGovernancePlan, verifyGovernanceAuthorization, REGULATED_HUMAN_REVIEW_CATEGORIES, ANNEX_III_POLICY_IDS, } from './governance/index.mjs';
|
|
40
|
+
export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, buildHumanReviewPlan, buildHumanOverride, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, validateGovernancePlan, verifyGovernanceAuthorization, createGovernanceAgentJwksResolver, REGULATED_HUMAN_REVIEW_CATEGORIES, ANNEX_III_POLICY_IDS, } from './governance/index.mjs';
|
|
41
41
|
export { ssrfSafeFetch, decodeBodyAsJsonOrText, SSRF_TRANSIENT_CODES, SsrfRefusedError, isPrivateIp, isAlwaysBlocked, isLikelyPrivateUrl, type SsrfRefusedCode, type SsrfDnsLookup, type SsrfFetchOptions, type SsrfFetchResult, } from './net/index.mjs';
|
|
42
42
|
export { createCanonicalReferenceCache, createCanonicalReferenceResolver, canonicalReferenceCacheKey, resolveCanonicalReference, resolveFormatSchemaReference, resolvePlatformExtensionsReference, type CanonicalReference, type CanonicalReferenceCache, type CanonicalReferenceCacheOptions, type CanonicalReferenceError, type CanonicalReferenceErrorCode, type CanonicalReferenceFailureResult, type CanonicalReferenceKind, type CanonicalReferenceResolveOptions, type CanonicalReferenceResolvedResult, type CanonicalReferenceResolver, type CanonicalReferenceResolverOptions, type CanonicalReferenceResult, type CanonicalReferenceStatus, type ExternalRefDigestMap, type FormatSchemaReferenceResolvedResult, type FormatSchemaReferenceResult, type PlatformExtensionsReferenceResult, } from './canonical-references/index.mjs';
|
|
43
43
|
export { assessAcceptancePolicy, createAcceptancePolicyCatalogResolver, resolveAcceptancePolicyCatalog, resolveAcceptancePolicyProfiles, resolveVerifiedAcceptancePolicyProfiles, type AcceptancePolicyCatalog, type AcceptancePolicyCatalogErrorCode, type AcceptancePolicyCatalogFailure, type AcceptancePolicyCatalogIssue, type AcceptancePolicyCatalogResolver, type AcceptancePolicyCatalogResult, type AcceptancePolicyCatalogSuccess, type AcceptancePolicyDiscoveryCapability, type AcceptancePolicyProfile, type AcceptancePolicyProfileResolution, type AcceptancePolicyRegistryPolicy, type AcceptancePolicyRegistryResolver, type AcceptancePolicyReference, type AcceptancePolicyRequirement, type AcceptancePolicyRule, type AcceptancePolicySurface, type RegistryAcceptancePolicyProfileReference, type ResolveAcceptancePolicyCatalogOptions, type ResolveVerifiedAcceptancePolicyProfilesOptions, type ResolvedAcceptancePolicyDefault, type VerifiedAcceptancePolicyProfilesResult, type VerifiedAcceptancePolicyProfilesSuccess, } from './acceptance-policy/index.mjs';
|
|
44
44
|
export { type AcceptancePolicyAssessment, type AcceptancePolicyAssessmentDiagnostic, type AcceptancePolicyAssessmentDiagnosticCode, type AcceptancePolicyMatchedRule, type AcceptancePolicyOutcome, type AssessAcceptancePolicyInput, } from './acceptance-policy/evaluator.mjs';
|
|
45
|
-
export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, BuildHumanReviewPlanInput, BuildHumanOverrideInput, DataSubjectContestation, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernancePlan, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, GovernanceValidationIssue, HumanOverride, InMemoryGovernanceReplayStoreOptions, PlanBudget, ReallocationAutonomy, VerifyGovernanceAuthorizationOptions, } from './governance/index.mjs';
|
|
45
|
+
export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, BuildHumanReviewPlanInput, BuildHumanOverrideInput, DataSubjectContestation, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernancePlan, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, GovernanceValidationIssue, HumanOverride, InMemoryGovernanceReplayStoreOptions, PlanBudget, ReallocationAutonomy, VerifyGovernanceAuthorizationOptions, GovernanceBuyerIdentity, } from './governance/index.mjs';
|
|
46
46
|
export type { BaseTaskEvent, ProtocolRequestEvent, ProtocolResponseEvent, TaskStatusEvent, ObjectEvent, TaskEvent, TaskEventCallbacks, } from './core/TaskEventTypes.mjs';
|
|
47
47
|
export { createOperationId } from './core/TaskEventTypes.mjs';
|
|
48
48
|
export type { AsyncHandlerConfig, WebhookMetadata, Activity, NotificationMetadata, MediaBuyDeliveryNotification, CreateMediaBuyStatusChangeHandler, UpdateMediaBuyStatusChangeHandler, SyncCreativesStatusChangeHandler, GetProductsStatusChangeHandler, ListProductsStatusChangeHandler, } from './core/AsyncHandler.mjs';
|
|
@@ -53,7 +53,7 @@ export * from './handlers/types.mjs';
|
|
|
53
53
|
export type { Storage, AtomicTakeStorage, DeferredTaskStorage, BatchStorage, PatternStorage, AgentCapabilities, ConversationState, DeferredTaskState, StorageConfig, StorageFactory, StorageMiddleware, } from './storage/interfaces.mjs';
|
|
54
54
|
export { MemoryStorage, createMemoryStorage, createMemoryStorageConfig } from './storage/MemoryStorage.mjs';
|
|
55
55
|
export { ADCPError, TaskTimeoutError, MaxClarificationError, DeferredTaskError, TaskAbortedError, AgentNotFoundError, UnsupportedTaskError, ProtocolError, ValidationError as ADCPValidationError, // Rename to avoid conflict
|
|
56
|
-
MissingInputHandlerError, InvalidContextError, ConfigurationError, AuthenticationCredentialsRejectedError, AuthenticationRequiredError, FeatureUnsupportedError, ProtocolFeatureUnsupportedError, UnsupportedBuyingModeError, AccountRequiredError, AccountPendingApprovalError, AccountAmbiguousError, SDK_ERROR_TO_PROTOCOL_ERROR_CODE, VersionUnsupportedError, IdempotencyConflictError, IdempotencyExpiredError, ResponseTooLargeError, ActionNotAllowedError, adcpErrorToTypedError, getClientPreflightAdcpError, isADCPError, isErrorOfType, extractErrorInfo, is401Error, mapSdkErrorCodeToProtocolErrorCode, } from './errors/index.mjs';
|
|
56
|
+
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';
|
|
57
57
|
export type { OAuthMetadataInfo, ClientPreflightAdcpErrorInfo, ClientPreflightAdcpErrorRecovery, FeatureUnsupportedErrorOptions, ProtocolFeatureUnsupportedErrorOptions, ActionNotAllowedErrorDetails, ActionNotAllowedReasonValue, ActionNotAllowedAttemptedAction, ActionNotAllowedAvailableAction, ActionNotAllowedRecovery, } from './errors/index.mjs';
|
|
58
58
|
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';
|
|
59
59
|
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';
|
|
@@ -237,7 +237,8 @@ export { resolvePreviewAuthority, type PlacementPreviewCandidate, type PreviewAu
|
|
|
237
237
|
export { isStatusCompleted, isStatusWorking, isStatusInputRequired, isStatusSubmitted, isStatusFailed, isStatusRejected, isGetProductsCompleted, isGetProductsWorking, isGetProductsInputRequired, isGetProductsSubmitted, isGetProductsFailed, isCreateMediaBuyCompleted, isCreateMediaBuyWorking, isCreateMediaBuyInputRequired, isCreateMediaBuySubmitted, isCreateMediaBuyFailed, isUpdateMediaBuyCompleted, isUpdateMediaBuyWorking, isUpdateMediaBuyInputRequired, isUpdateMediaBuySubmitted, isUpdateMediaBuyFailed, isSyncCreativesCompleted, isSyncCreativesWorking, isSyncCreativesInputRequired, isSyncCreativesSubmitted, isSyncCreativesFailed, } from './utils/typeGuards.mjs';
|
|
238
238
|
export { getAdcpVersion, getLibraryVersion, isCompatibleWith, getCompatibleVersions, parseAdcpMajorVersion, ADCP_VERSION, ADCP_MAJOR_VERSION, LIBRARY_VERSION, COMPATIBLE_ADCP_VERSIONS, VERSION_INFO, } from './version.mjs';
|
|
239
239
|
export type { AdcpVersion } from './version.mjs';
|
|
240
|
-
export { listBundledAdcpVersions, resolveAdcpVersion } from './utils/adcp-version-config.mjs';
|
|
240
|
+
export { listBundledAdcpVersions, resolveAdcpVersion, isAdcpVersionAtLeast, sellerAdvertises31, shouldOmit31Fields, } from './utils/adcp-version-config.mjs';
|
|
241
|
+
export { redactSecrets } from './utils/redact-secrets.mjs';
|
|
241
242
|
export { getTracer, isTracingEnabled, injectTraceHeaders, withSpan, addSpanAttributes, recordSpanException, } from './observability/index.mjs';
|
|
242
243
|
export { Agent as LegacyAgent, AgentCollection as LegacyAgentCollection } from './agents/index.generated.mjs';
|
|
243
244
|
export { LegacyContentStandardsAdapter, type LegacyIContentStandardsAdapter, type LegacyContentEvaluationResult, LegacyContentStandardsErrorCodes, isLegacyContentStandardsError, legacyDefaultContentStandardsAdapter, PropertyListAdapter, type IPropertyListAdapter, type ResolvedProperty, PropertyListErrorCodes, isPropertyListError, defaultPropertyListAdapter, SISessionManager, AISISessionManager, type ISISessionManager, type SISession, SIErrorCodes, defaultSISessionManager, GovernanceAdapter, defaultGovernanceAdapter, type IGovernanceAdapter, type GovernanceAdapterConfig, type GovernanceAdapterErrorCode, type CommittedCheckRequest, type LegacyCommittedCheckRequest, type ModernCommittedCheckRequest, GovernanceAdapterError, GovernanceAdapterErrorCodes, isGovernanceAdapterError, InMemoryImplicitAccountStore, defaultImplicitKeyFn, type ImplicitAccountStoreOptions, createOAuthPassthroughResolver, type OAuthPassthroughResolverOptions, createRosterAccountStore, type RosterAccountStoreOptions, createDerivedAccountStore, type DerivedAccountStoreOptions, type DerivedAccountStoreBaseOptions, type DerivedSingletonAccountStoreOptions, type DerivedRosterAccountStoreOptions, } from './adapters/index.mjs';
|
|
@@ -272,3 +273,5 @@ export { mediaBuyActionResolver } from './server/media-buy-action-resolver.mjs';
|
|
|
272
273
|
export type { SellerActionDecision, SellerActionResolutionOptions, SellerActionResolution, } from './server/media-buy-action-resolver.mjs';
|
|
273
274
|
export * from './supply-path/index.mjs';
|
|
274
275
|
export type { AuthorizationCollectionSelector, ProductCollectionSelector, CollectionDistribution, DiscoveryCollection, } from './discovery/types.mjs';
|
|
276
|
+
export { BuyerAccountRegistry, type AccountPolicy, type BuyerAccountStorage, type BuyerAccountRegistryOptions, type BuyerAccountDispatch, type BuyerAccountProvisioningDispatch, type EnsureAccountOptions, type ProvisionedAccount, } from './core/buyer-account-registry.mjs';
|
|
277
|
+
export { createProductCache, ProductCache, type ProductCacheOptions } from './core/product-cache.mjs';
|