@adcp/sdk 16.0.0-beta.1 → 16.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/core/SingleAgentClient.d.mts +10 -1
- package/dist/lib/core/SingleAgentClient.d.ts +10 -1
- package/dist/lib/core/SingleAgentClient.js +29 -8
- package/dist/lib/core/SingleAgentClient.mjs +29 -8
- package/dist/lib/identity-3.3/generated-compat.d.mts +34 -0
- package/dist/lib/identity-3.3/generated-compat.d.ts +34 -0
- package/dist/lib/identity-3.3/generated-compat.js +16 -0
- package/dist/lib/identity-3.3/generated-compat.mjs +0 -0
- package/dist/lib/identity-3.3/index.d.mts +2 -2
- package/dist/lib/identity-3.3/index.d.ts +2 -2
- package/dist/lib/identity-3.3/index.js +4 -0
- package/dist/lib/identity-3.3/index.mjs +5 -1
- package/dist/lib/identity-3.3/lifecycle.d.mts +17 -5
- package/dist/lib/identity-3.3/lifecycle.d.ts +17 -5
- package/dist/lib/identity-3.3/lifecycle.js +32 -5
- package/dist/lib/identity-3.3/lifecycle.mjs +38 -6
- package/dist/lib/identity-3.3/revocation.d.mts +39 -3
- package/dist/lib/identity-3.3/revocation.d.ts +39 -3
- package/dist/lib/identity-3.3/revocation.js +88 -18
- package/dist/lib/identity-3.3/revocation.mjs +89 -19
- package/dist/lib/identity-3.3/server.d.mts +12 -0
- package/dist/lib/identity-3.3/server.d.ts +12 -0
- package/dist/lib/identity-3.3/server.js +103 -43
- package/dist/lib/identity-3.3/server.mjs +111 -45
- package/dist/lib/identity-3.3/trust.d.mts +62 -1
- package/dist/lib/identity-3.3/trust.d.ts +62 -1
- package/dist/lib/identity-3.3/trust.js +126 -21
- package/dist/lib/identity-3.3/trust.mjs +124 -21
- package/dist/lib/identity-3.3/types.d.mts +39 -11
- package/dist/lib/identity-3.3/types.d.ts +39 -11
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.mjs +2 -0
- package/dist/lib/protocols/index.d.mts +1 -1
- package/dist/lib/protocols/index.d.ts +1 -1
- package/dist/lib/protocols/index.js +2 -2
- package/dist/lib/protocols/index.mjs +2 -2
- package/dist/lib/reporting/bigquery/index.js +8 -0
- package/dist/lib/reporting/bigquery/index.mjs +8 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/auth-signature.d.mts +6 -1
- package/dist/lib/server/auth-signature.d.ts +6 -1
- package/dist/lib/server/auth-signature.js +24 -13
- package/dist/lib/server/auth-signature.mjs +29 -13
- package/dist/lib/server/auth.d.mts +2 -2
- package/dist/lib/server/auth.d.ts +2 -2
- package/dist/lib/server/create-adcp-server.js +31 -10
- package/dist/lib/server/create-adcp-server.mjs +37 -11
- package/dist/lib/signing/crypto.js +8 -0
- package/dist/lib/signing/crypto.mjs +9 -1
- package/dist/lib/signing/fetch-async.js +1 -1
- package/dist/lib/signing/fetch-async.mjs +1 -1
- package/dist/lib/signing/fetch.js +1 -1
- package/dist/lib/signing/fetch.mjs +1 -1
- package/dist/lib/signing/middleware.js +9 -0
- package/dist/lib/signing/middleware.mjs +14 -0
- package/dist/lib/signing/parser.d.mts +8 -5
- package/dist/lib/signing/parser.d.ts +8 -5
- package/dist/lib/signing/parser.js +77 -61
- package/dist/lib/signing/parser.mjs +77 -61
- package/dist/lib/signing/revocation.js +3 -0
- package/dist/lib/signing/revocation.mjs +3 -0
- package/dist/lib/signing/verifier.js +1 -1
- package/dist/lib/signing/verifier.mjs +1 -1
- package/dist/lib/signing/web-bot-auth.d.mts +84 -10
- package/dist/lib/signing/web-bot-auth.d.ts +84 -10
- package/dist/lib/signing/web-bot-auth.js +259 -82
- package/dist/lib/signing/web-bot-auth.mjs +259 -87
- package/dist/lib/signing/webhook-verifier.js +1 -1
- package/dist/lib/signing/webhook-verifier.mjs +1 -1
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/v2/projection/catalog-snapshot.js +3 -1
- package/dist/lib/v2/projection/catalog-snapshot.mjs +3 -1
- package/dist/lib/v2/projection/creative-delivery.d.mts +31 -9
- package/dist/lib/v2/projection/creative-delivery.d.ts +31 -9
- package/dist/lib/v2/projection/index.d.mts +1 -1
- package/dist/lib/v2/projection/index.d.ts +1 -1
- package/dist/lib/v2/projection/index.js +2 -0
- package/dist/lib/v2/projection/index.mjs +2 -0
- package/dist/lib/v2/projection/legacy-routes.d.mts +10 -0
- package/dist/lib/v2/projection/legacy-routes.d.ts +10 -0
- package/dist/lib/v2/projection/legacy-routes.js +7 -0
- package/dist/lib/v2/projection/legacy-routes.mjs +6 -0
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/REPORTING-LEDGER.md +15 -5
- package/docs/guides/REPORTING-OPERATIONS.md +17 -11
- package/docs/llms.txt +2 -2
- package/docs/migration-12-to-13.md +8 -0
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-agent-identity-3.3.md +150 -11
- package/package.json +3 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** Experimental drafts; the released SDK wire/schema pin remains 3.2.4. */
|
|
2
|
-
|
|
2
|
+
import type { GeneratedAccountCapabilities, ResolveAgentOnboarding } from './generated-compat';
|
|
3
3
|
export type BillingParty = 'operator' | 'agent' | 'advertiser';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
kind:
|
|
4
|
+
type DraftAgentOnboardingRequirementKind = 'agent_identity' | 'grant' | 'billing_entity' | 'contract' | 'credit_application' | 'aao_verified' | 'storyboard' | 'sandbox' | 'experimental_feature';
|
|
5
|
+
interface DraftAgentOnboardingRequirement {
|
|
6
|
+
kind: DraftAgentOnboardingRequirementKind;
|
|
7
7
|
role?: string;
|
|
8
8
|
verification_modes?: string[];
|
|
9
9
|
specialisms?: string[];
|
|
@@ -11,23 +11,50 @@ export interface AgentOnboardingRequirement {
|
|
|
11
11
|
id?: string;
|
|
12
12
|
ext?: Record<string, unknown>;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
mode:
|
|
14
|
+
interface DraftAgentOnboardingTier {
|
|
15
|
+
mode: 'open' | 'application' | 'invite_only';
|
|
16
16
|
url?: string;
|
|
17
|
-
requirements?:
|
|
17
|
+
requirements?: DraftAgentOnboardingRequirement[];
|
|
18
18
|
ext?: Record<string, unknown>;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
sandbox?:
|
|
22
|
-
billing?: Partial<Record<BillingParty,
|
|
20
|
+
interface DraftAgentOnboarding {
|
|
21
|
+
sandbox?: DraftAgentOnboardingTier;
|
|
22
|
+
billing?: Partial<Record<BillingParty, DraftAgentOnboardingTier>>;
|
|
23
23
|
url?: string;
|
|
24
24
|
documentation_url?: string;
|
|
25
25
|
message?: string;
|
|
26
26
|
ext?: Record<string, unknown>;
|
|
27
27
|
}
|
|
28
|
+
/** `get_adcp_capabilities.account.agent_onboarding`: how a seller onboards buyer agents. */
|
|
29
|
+
export type AgentOnboarding = ResolveAgentOnboarding<GeneratedAccountCapabilities, DraftAgentOnboarding>;
|
|
30
|
+
type AgentOnboardingBilling = NonNullable<AgentOnboarding['billing']>;
|
|
31
|
+
/** The onboarding mode for sandbox access or for one billing party. */
|
|
32
|
+
export type AgentOnboardingTier = NonNullable<AgentOnboarding['sandbox']> | NonNullable<AgentOnboardingBilling[keyof AgentOnboardingBilling]>;
|
|
33
|
+
export type AgentOnboardingMode = AgentOnboardingTier['mode'];
|
|
34
|
+
/** One requirement an onboarding mode imposes, discriminated by `kind`. */
|
|
35
|
+
export type AgentOnboardingRequirement = NonNullable<AgentOnboardingTier['requirements']>[number];
|
|
36
|
+
export type AgentOnboardingRequirementKind = AgentOnboardingRequirement['kind'];
|
|
37
|
+
/**
|
|
38
|
+
* A requirement as an evaluator sees it. `kind` accepts any string because a
|
|
39
|
+
* counterparty on a newer revision may publish kinds this SDK does not know,
|
|
40
|
+
* and readers MUST treat those as unsatisfiable rather than reject the
|
|
41
|
+
* posture. Structural on purpose: every {@link AgentOnboardingRequirement} is
|
|
42
|
+
* assignable to it, whichever shape the pinned schemas give that type.
|
|
43
|
+
* `verified_specialisms` is the revised #8170 name for `specialisms`.
|
|
44
|
+
*/
|
|
45
|
+
export interface ObservedAgentOnboardingRequirement {
|
|
46
|
+
kind: AgentOnboardingRequirementKind | (string & {});
|
|
47
|
+
role?: string;
|
|
48
|
+
verification_modes?: readonly string[];
|
|
49
|
+
specialisms?: readonly string[];
|
|
50
|
+
verified_specialisms?: readonly string[];
|
|
51
|
+
adcp_version?: string;
|
|
52
|
+
id?: string;
|
|
53
|
+
ext?: Record<string, unknown>;
|
|
54
|
+
}
|
|
28
55
|
export interface BuyerOnboardingPosture {
|
|
29
56
|
mode: 'considers_unsolicited' | 'application' | 'invite_only';
|
|
30
|
-
requirements?:
|
|
57
|
+
requirements?: ObservedAgentOnboardingRequirement[];
|
|
31
58
|
url?: string;
|
|
32
59
|
documentation_url?: string;
|
|
33
60
|
message?: string;
|
|
@@ -125,3 +152,4 @@ export type Identity33GetPrincipalResponse = Omit<import('../types/tools.generat
|
|
|
125
152
|
kind: 'failed';
|
|
126
153
|
}>;
|
|
127
154
|
};
|
|
155
|
+
export {};
|
package/dist/lib/index.d.mts
CHANGED
|
@@ -216,7 +216,7 @@ export { FormatAsset, imageAssetSlot, videoAssetSlot, audioAssetSlot, textAssetS
|
|
|
216
216
|
export { Render, urlRender, htmlRender, bothRender } from './utils/render-builders.mjs';
|
|
217
217
|
export { FormatRender, displayRender, parameterizedRender, templateRender, type DimensionsRender, type ParameterizedRender, type RenderItem, } from './utils/format-render-builders.mjs';
|
|
218
218
|
export { CanonicalFormat, canonicalFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclaration as Format, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type ProductCardDetailedFields, type ProductCardFields, } from './v2/projection/index.mjs';
|
|
219
|
-
export { toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, packageRefsForFormatOptions, FormatOptionRefsLookupError, CreativeFormatCapabilityError, CreativeFormatProjectionError, type CreativeFormatWireMode, type LegacyFormatConversionContext, type LegacyFormatConverter, type LegacyFormatResolutionContext, type LegacyFormatResolver, legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, canonicalFormatLegacyResolverFromRoutes, legacyRoutesForProduct, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, type CanonicalFormatLegacyResolver, type CanonicalFormatLegacyResolutionContext, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, type CanonicalCreativeAsset, type CanonicalCreativeAsset as CreativeAsset, type CanonicalSyncCreativeAsset, type CanonicalCreateMediaBuyInput, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyRequest as CreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreateMediaBuyResponse as CreateMediaBuyResponse, type CanonicalCreativeResponse, type CanonicalCreativeFilters, type CanonicalCreativeFilters as CreativeFilters, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetCreativeDeliveryResponse as GetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse as GetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalGetMediaBuysResponse as GetMediaBuysResponse, type CanonicalGetProductsResponse as GetProductsResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsRequest as GetProductsRequest, type CanonicalListCreativesRequest, type CanonicalListCreativesRequest as ListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalListCreativesResponse as ListCreativesResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageRequest as PackageRequest, type CanonicalPackageUpdate, type CanonicalPackageUpdate as PackageUpdate, type CanonicalPackage, type CanonicalPackage as Package, type CanonicalPlacement, type CanonicalPlacement as Placement, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeRequest as PreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalPreviewCreativeResponse as PreviewCreativeResponse, type CanonicalProduct, type CanonicalProduct as Product, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesRequest as SyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalSyncCreativesResponse as SyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyRequest as UpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type CanonicalUpdateMediaBuyResponse as UpdateMediaBuyResponse, type LegacyCreativeAsset, type CanonicalCreativeFormatSelectorContainer, type PackageFormatRefs, type ProjectionDiagnostic, type SyncCreativeFormatProjection, } from './v2/projection/index.mjs';
|
|
219
|
+
export { toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, packageRefsForFormatOptions, FormatOptionRefsLookupError, CreativeFormatCapabilityError, CreativeFormatProjectionError, type CreativeFormatWireMode, type LegacyFormatConversionContext, type LegacyFormatConverter, type LegacyFormatResolutionContext, type LegacyFormatResolver, legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, canonicalFormatLegacyResolverFromRoutes, carryFormatOptionOrigins, legacyRoutesForProduct, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, type CanonicalFormatLegacyResolver, type CanonicalFormatLegacyResolutionContext, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, type CanonicalCreativeAsset, type CanonicalCreativeAsset as CreativeAsset, type CanonicalSyncCreativeAsset, type CanonicalCreateMediaBuyInput, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyRequest as CreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreateMediaBuyResponse as CreateMediaBuyResponse, type CanonicalCreativeResponse, type CanonicalCreativeFilters, type CanonicalCreativeFilters as CreativeFilters, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetCreativeDeliveryResponse as GetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse as GetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalGetMediaBuysResponse as GetMediaBuysResponse, type CanonicalGetProductsResponse as GetProductsResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsRequest as GetProductsRequest, type CanonicalListCreativesRequest, type CanonicalListCreativesRequest as ListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalListCreativesResponse as ListCreativesResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageRequest as PackageRequest, type CanonicalPackageUpdate, type CanonicalPackageUpdate as PackageUpdate, type CanonicalPackage, type CanonicalPackage as Package, type CanonicalPlacement, type CanonicalPlacement as Placement, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeRequest as PreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalPreviewCreativeResponse as PreviewCreativeResponse, type CanonicalProduct, type CanonicalProduct as Product, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesRequest as SyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalSyncCreativesResponse as SyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyRequest as UpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type CanonicalUpdateMediaBuyResponse as UpdateMediaBuyResponse, type LegacyCreativeAsset, type CanonicalCreativeFormatSelectorContainer, type PackageFormatRefs, type ProjectionDiagnostic, type SyncCreativeFormatProjection, } from './v2/projection/index.mjs';
|
|
220
220
|
export { activationKey, segmentIdActivationKey, keyValueActivationKey } from './utils/activation-key-builders.mjs';
|
|
221
221
|
export { signalId, catalogSignalId, agentSignalId, getSignalId, getSignalIssuer } from './utils/signal-id-builders.mjs';
|
|
222
222
|
export { buildActivateSignalRequest, getSignalActivationId, getSignalPricingOptionIds, normalizeDiscoveredSignal, } from './utils/signal-discovery-helpers.mjs';
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -216,7 +216,7 @@ export { FormatAsset, imageAssetSlot, videoAssetSlot, audioAssetSlot, textAssetS
|
|
|
216
216
|
export { Render, urlRender, htmlRender, bothRender } from './utils/render-builders';
|
|
217
217
|
export { FormatRender, displayRender, parameterizedRender, templateRender, type DimensionsRender, type ParameterizedRender, type RenderItem, } from './utils/format-render-builders';
|
|
218
218
|
export { CanonicalFormat, canonicalFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclaration as Format, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type ProductCardDetailedFields, type ProductCardFields, } from './v2/projection';
|
|
219
|
-
export { toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, packageRefsForFormatOptions, FormatOptionRefsLookupError, CreativeFormatCapabilityError, CreativeFormatProjectionError, type CreativeFormatWireMode, type LegacyFormatConversionContext, type LegacyFormatConverter, type LegacyFormatResolutionContext, type LegacyFormatResolver, legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, canonicalFormatLegacyResolverFromRoutes, legacyRoutesForProduct, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, type CanonicalFormatLegacyResolver, type CanonicalFormatLegacyResolutionContext, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, type CanonicalCreativeAsset, type CanonicalCreativeAsset as CreativeAsset, type CanonicalSyncCreativeAsset, type CanonicalCreateMediaBuyInput, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyRequest as CreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreateMediaBuyResponse as CreateMediaBuyResponse, type CanonicalCreativeResponse, type CanonicalCreativeFilters, type CanonicalCreativeFilters as CreativeFilters, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetCreativeDeliveryResponse as GetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse as GetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalGetMediaBuysResponse as GetMediaBuysResponse, type CanonicalGetProductsResponse as GetProductsResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsRequest as GetProductsRequest, type CanonicalListCreativesRequest, type CanonicalListCreativesRequest as ListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalListCreativesResponse as ListCreativesResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageRequest as PackageRequest, type CanonicalPackageUpdate, type CanonicalPackageUpdate as PackageUpdate, type CanonicalPackage, type CanonicalPackage as Package, type CanonicalPlacement, type CanonicalPlacement as Placement, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeRequest as PreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalPreviewCreativeResponse as PreviewCreativeResponse, type CanonicalProduct, type CanonicalProduct as Product, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesRequest as SyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalSyncCreativesResponse as SyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyRequest as UpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type CanonicalUpdateMediaBuyResponse as UpdateMediaBuyResponse, type LegacyCreativeAsset, type CanonicalCreativeFormatSelectorContainer, type PackageFormatRefs, type ProjectionDiagnostic, type SyncCreativeFormatProjection, } from './v2/projection';
|
|
219
|
+
export { toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, packageRefsForFormatOptions, FormatOptionRefsLookupError, CreativeFormatCapabilityError, CreativeFormatProjectionError, type CreativeFormatWireMode, type LegacyFormatConversionContext, type LegacyFormatConverter, type LegacyFormatResolutionContext, type LegacyFormatResolver, legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, canonicalFormatLegacyResolverFromRoutes, carryFormatOptionOrigins, legacyRoutesForProduct, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, type CanonicalFormatLegacyResolver, type CanonicalFormatLegacyResolutionContext, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, type CanonicalCreativeAsset, type CanonicalCreativeAsset as CreativeAsset, type CanonicalSyncCreativeAsset, type CanonicalCreateMediaBuyInput, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyRequest as CreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreateMediaBuyResponse as CreateMediaBuyResponse, type CanonicalCreativeResponse, type CanonicalCreativeFilters, type CanonicalCreativeFilters as CreativeFilters, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetCreativeDeliveryResponse as GetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse as GetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalGetMediaBuysResponse as GetMediaBuysResponse, type CanonicalGetProductsResponse as GetProductsResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsRequest as GetProductsRequest, type CanonicalListCreativesRequest, type CanonicalListCreativesRequest as ListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalListCreativesResponse as ListCreativesResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageRequest as PackageRequest, type CanonicalPackageUpdate, type CanonicalPackageUpdate as PackageUpdate, type CanonicalPackage, type CanonicalPackage as Package, type CanonicalPlacement, type CanonicalPlacement as Placement, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeRequest as PreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalPreviewCreativeResponse as PreviewCreativeResponse, type CanonicalProduct, type CanonicalProduct as Product, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesRequest as SyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalSyncCreativesResponse as SyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyRequest as UpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type CanonicalUpdateMediaBuyResponse as UpdateMediaBuyResponse, type LegacyCreativeAsset, type CanonicalCreativeFormatSelectorContainer, type PackageFormatRefs, type ProjectionDiagnostic, type SyncCreativeFormatProjection, } from './v2/projection';
|
|
220
220
|
export { activationKey, segmentIdActivationKey, keyValueActivationKey } from './utils/activation-key-builders';
|
|
221
221
|
export { signalId, catalogSignalId, agentSignalId, getSignalId, getSignalIssuer } from './utils/signal-id-builders';
|
|
222
222
|
export { buildActivateSignalRequest, getSignalActivationId, getSignalPricingOptionIds, normalizeDiscoveredSignal, } from './utils/signal-discovery-helpers';
|
package/dist/lib/index.js
CHANGED
|
@@ -286,6 +286,7 @@ __export(index_exports, {
|
|
|
286
286
|
canonicalReferenceCacheKey: () => import_canonical_references.canonicalReferenceCacheKey,
|
|
287
287
|
canonicalize: () => import_jcs.canonicalize,
|
|
288
288
|
canonicalizeAgentUrl: () => import_resolve_agent_properties.canonicalizeAgentUrl,
|
|
289
|
+
carryFormatOptionOrigins: () => import_projection2.carryFormatOptionOrigins,
|
|
289
290
|
catalogAssetSlot: () => import_format_asset_slot_builders.catalogAssetSlot,
|
|
290
291
|
catalogSignalId: () => import_signal_id_builders.catalogSignalId,
|
|
291
292
|
checkGovernance: () => import_server.checkGovernance,
|
|
@@ -1131,6 +1132,7 @@ function createAdCPClientFromEnv() {
|
|
|
1131
1132
|
canonicalReferenceCacheKey,
|
|
1132
1133
|
canonicalize,
|
|
1133
1134
|
canonicalizeAgentUrl,
|
|
1135
|
+
carryFormatOptionOrigins,
|
|
1134
1136
|
catalogAssetSlot,
|
|
1135
1137
|
catalogSignalId,
|
|
1136
1138
|
checkGovernance,
|
package/dist/lib/index.mjs
CHANGED
|
@@ -575,6 +575,7 @@ import {
|
|
|
575
575
|
legacyFormatConverterFromCatalogSnapshots,
|
|
576
576
|
canonicalFormatLegacyResolverFromCatalogSnapshots,
|
|
577
577
|
canonicalFormatLegacyResolverFromRoutes,
|
|
578
|
+
carryFormatOptionOrigins,
|
|
578
579
|
legacyRoutesForProduct,
|
|
579
580
|
projectionAdaptersFromCatalogSnapshots
|
|
580
581
|
} from "./v2/projection/index.mjs";
|
|
@@ -1089,6 +1090,7 @@ export {
|
|
|
1089
1090
|
canonicalReferenceCacheKey,
|
|
1090
1091
|
canonicalize,
|
|
1091
1092
|
canonicalizeAgentUrl,
|
|
1093
|
+
carryFormatOptionOrigins,
|
|
1092
1094
|
catalogAssetSlot,
|
|
1093
1095
|
catalogSignalId,
|
|
1094
1096
|
checkGovernance,
|
|
@@ -197,7 +197,7 @@ export interface PreparedProtocolToolCall {
|
|
|
197
197
|
args: Record<string, unknown>;
|
|
198
198
|
/** Native A2A TaskPushNotificationConfig retained independently of AdCP registration. */
|
|
199
199
|
pushNotificationConfig?: PushNotificationConfig;
|
|
200
|
-
/** Stable operation ID generated for
|
|
200
|
+
/** Stable operation ID generated for an AdCP 3.1+ application webhook registration. */
|
|
201
201
|
operationId?: string;
|
|
202
202
|
}
|
|
203
203
|
/**
|
|
@@ -197,7 +197,7 @@ export interface PreparedProtocolToolCall {
|
|
|
197
197
|
args: Record<string, unknown>;
|
|
198
198
|
/** Native A2A TaskPushNotificationConfig retained independently of AdCP registration. */
|
|
199
199
|
pushNotificationConfig?: PushNotificationConfig;
|
|
200
|
-
/** Stable operation ID generated for
|
|
200
|
+
/** Stable operation ID generated for an AdCP 3.1+ application webhook registration. */
|
|
201
201
|
operationId?: string;
|
|
202
202
|
}
|
|
203
203
|
/**
|
|
@@ -179,7 +179,7 @@ function prepareProtocolToolCall(agent, args, options = {}) {
|
|
|
179
179
|
const argsWithVersion = applyVersionEnvelope(args, envelope);
|
|
180
180
|
applyPublishedSchemaCompatibility(options.toolName, argsWithVersion, args);
|
|
181
181
|
const effectiveBundle = typeof argsWithVersion.adcp_version === "string" ? (0, import_schema_loader.resolveBundleKey)(argsWithVersion.adcp_version) : void 0;
|
|
182
|
-
const usesApplicationRegistration = options.serverVersion !== "v2" && (0, import_adcp_version_config.isAdcpVersionAtLeast)(effectiveBundle, "3.
|
|
182
|
+
const usesApplicationRegistration = options.serverVersion !== "v2" && (0, import_adcp_version_config.isAdcpVersionAtLeast)(effectiveBundle, "3.1.0");
|
|
183
183
|
let pushNotificationConfig;
|
|
184
184
|
let applicationPushNotificationConfig;
|
|
185
185
|
let operationId;
|
|
@@ -213,7 +213,7 @@ function prepareProtocolToolCall(agent, args, options = {}) {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
return {
|
|
216
|
-
// AdCP 3.
|
|
216
|
+
// AdCP 3.1+ task-webhook registration is application-layer data on every
|
|
217
217
|
// transport. A2A's native TaskPushNotificationConfig is a distinct
|
|
218
218
|
// transport feature and must not replace this argument.
|
|
219
219
|
args: applicationPushNotificationConfig ? { ...argsWithVersion, push_notification_config: applicationPushNotificationConfig } : argsWithVersion,
|
|
@@ -159,7 +159,7 @@ function prepareProtocolToolCall(agent, args, options = {}) {
|
|
|
159
159
|
const argsWithVersion = applyVersionEnvelope(args, envelope);
|
|
160
160
|
applyPublishedSchemaCompatibility(options.toolName, argsWithVersion, args);
|
|
161
161
|
const effectiveBundle = typeof argsWithVersion.adcp_version === "string" ? resolveBundleKey(argsWithVersion.adcp_version) : void 0;
|
|
162
|
-
const usesApplicationRegistration = options.serverVersion !== "v2" && isAdcpVersionAtLeast(effectiveBundle, "3.
|
|
162
|
+
const usesApplicationRegistration = options.serverVersion !== "v2" && isAdcpVersionAtLeast(effectiveBundle, "3.1.0");
|
|
163
163
|
let pushNotificationConfig;
|
|
164
164
|
let applicationPushNotificationConfig;
|
|
165
165
|
let operationId;
|
|
@@ -193,7 +193,7 @@ function prepareProtocolToolCall(agent, args, options = {}) {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
return {
|
|
196
|
-
// AdCP 3.
|
|
196
|
+
// AdCP 3.1+ task-webhook registration is application-layer data on every
|
|
197
197
|
// transport. A2A's native TaskPushNotificationConfig is a distinct
|
|
198
198
|
// transport feature and must not replace this argument.
|
|
199
199
|
args: applicationPushNotificationConfig ? { ...argsWithVersion, push_notification_config: applicationPushNotificationConfig } : argsWithVersion,
|
|
@@ -67,6 +67,7 @@ ALTER TABLE adcp_reporting_warehouse_sinks
|
|
|
67
67
|
const MAX_LOAD_TIMEOUT = 6 * 36e5;
|
|
68
68
|
const MAX_TIMEOUT_DOUBLINGS = 16;
|
|
69
69
|
let warnedLabelsIgnored = false;
|
|
70
|
+
let warnedLocationUnset = false;
|
|
70
71
|
const PROJECT = /^[a-z][a-z0-9-]{4,61}[a-z0-9]$/;
|
|
71
72
|
const DATASET_OR_TABLE = /^[A-Za-z_][A-Za-z0-9_]{0,1023}$/;
|
|
72
73
|
const NAME = /^[A-Za-z0-9_.:-]{1,128}$/;
|
|
@@ -97,6 +98,13 @@ function createBigQueryReportingWarehouseSinkV1(options) {
|
|
|
97
98
|
{ code: "ADCP_BIGQUERY_SINK_LABELS_IGNORED", type: "DeprecationWarning" }
|
|
98
99
|
);
|
|
99
100
|
}
|
|
101
|
+
if (!options.location && !warnedLocationUnset) {
|
|
102
|
+
warnedLocationUnset = true;
|
|
103
|
+
process.emitWarning(
|
|
104
|
+
'BigQuery warehouse sink option `location` is not set. Replay lookups of load jobs need it for datasets outside the US and EU multi-regions: without it BigQuery answers 404, the sink uploads again, gets a 409, and then fails with a "check projectId and location" error.',
|
|
105
|
+
{ code: "ADCP_BIGQUERY_SINK_LOCATION_UNSET" }
|
|
106
|
+
);
|
|
107
|
+
}
|
|
100
108
|
const tables = {
|
|
101
109
|
projectId: options.projectId,
|
|
102
110
|
datasetId: options.datasetId,
|
|
@@ -29,6 +29,7 @@ ALTER TABLE adcp_reporting_warehouse_sinks
|
|
|
29
29
|
const MAX_LOAD_TIMEOUT = 6 * 36e5;
|
|
30
30
|
const MAX_TIMEOUT_DOUBLINGS = 16;
|
|
31
31
|
let warnedLabelsIgnored = false;
|
|
32
|
+
let warnedLocationUnset = false;
|
|
32
33
|
const PROJECT = /^[a-z][a-z0-9-]{4,61}[a-z0-9]$/;
|
|
33
34
|
const DATASET_OR_TABLE = /^[A-Za-z_][A-Za-z0-9_]{0,1023}$/;
|
|
34
35
|
const NAME = /^[A-Za-z0-9_.:-]{1,128}$/;
|
|
@@ -59,6 +60,13 @@ function createBigQueryReportingWarehouseSinkV1(options) {
|
|
|
59
60
|
{ code: "ADCP_BIGQUERY_SINK_LABELS_IGNORED", type: "DeprecationWarning" }
|
|
60
61
|
);
|
|
61
62
|
}
|
|
63
|
+
if (!options.location && !warnedLocationUnset) {
|
|
64
|
+
warnedLocationUnset = true;
|
|
65
|
+
process.emitWarning(
|
|
66
|
+
'BigQuery warehouse sink option `location` is not set. Replay lookups of load jobs need it for datasets outside the US and EU multi-regions: without it BigQuery answers 404, the sink uploads again, gets a 409, and then fails with a "check projectId and location" error.',
|
|
67
|
+
{ code: "ADCP_BIGQUERY_SINK_LOCATION_UNSET" }
|
|
68
|
+
);
|
|
69
|
+
}
|
|
62
70
|
const tables = {
|
|
63
71
|
projectId: options.projectId,
|
|
64
72
|
datasetId: options.datasetId,
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"source_sha": "4e553ad955f83b49c7d221ab5c3ff78237ad02e3",
|
|
5
5
|
"source_tarball_sha256": "580656d6466ef9f0d1119985e6726c2efea718dc671e2ad30957fcb2fd54af0f",
|
|
6
6
|
"upstream_adcp_version": "2.5.3",
|
|
7
|
-
"synced_at": "2026-10-
|
|
7
|
+
"synced_at": "2026-10-15T16:11:40.051Z"
|
|
8
8
|
}
|
|
@@ -49,7 +49,12 @@ export interface VerifySignatureAsAuthenticatorOptions {
|
|
|
49
49
|
/** Explicit experimental profile. Verification never creates a principal or fetches trust.json. */
|
|
50
50
|
webBotAuth?: {
|
|
51
51
|
directory: import('../signing/web-bot-auth.mjs').SignatureDirectoryResolver;
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Revocation belongs to the identity layer: use
|
|
54
|
+
* `createIdentity33PrincipalResolver({ revocation })`. Required only when
|
|
55
|
+
* `resolvePrincipal` does not check revocation itself.
|
|
56
|
+
*/
|
|
57
|
+
isRevoked?: (origin: string, keyid: string) => Promise<boolean>;
|
|
53
58
|
/** Resolve only an existing audited binding; handle identity-established callers with anonymous scope. */
|
|
54
59
|
resolvePrincipal: (signers: readonly VerifiedWebBotSigner[], operation: ResolvedOperation) => Promise<AuthPrincipal>;
|
|
55
60
|
};
|
|
@@ -49,7 +49,12 @@ export interface VerifySignatureAsAuthenticatorOptions {
|
|
|
49
49
|
/** Explicit experimental profile. Verification never creates a principal or fetches trust.json. */
|
|
50
50
|
webBotAuth?: {
|
|
51
51
|
directory: import('../signing/web-bot-auth').SignatureDirectoryResolver;
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Revocation belongs to the identity layer: use
|
|
54
|
+
* `createIdentity33PrincipalResolver({ revocation })`. Required only when
|
|
55
|
+
* `resolvePrincipal` does not check revocation itself.
|
|
56
|
+
*/
|
|
57
|
+
isRevoked?: (origin: string, keyid: string) => Promise<boolean>;
|
|
53
58
|
/** Resolve only an existing audited binding; handle identity-established callers with anonymous scope. */
|
|
54
59
|
resolvePrincipal: (signers: readonly VerifiedWebBotSigner[], operation: ResolvedOperation) => Promise<AuthPrincipal>;
|
|
55
60
|
};
|
|
@@ -42,6 +42,10 @@ function verifySignatureAsAuthenticator(options) {
|
|
|
42
42
|
throw new TypeError(
|
|
43
43
|
"Web Bot Auth requires an origin-binding migration fence; use createIdentity33PrincipalResolver or supply assertLegacyOriginAllowed"
|
|
44
44
|
);
|
|
45
|
+
if (options.webBotAuth && !options.webBotAuth.isRevoked && !(0, import_web_bot_auth2.isWebBotAuthRevocationChecked)(options.webBotAuth.resolvePrincipal))
|
|
46
|
+
throw new TypeError(
|
|
47
|
+
"Web Bot Auth requires origin revocation: use createIdentity33PrincipalResolver({ revocation }) or supply isRevoked"
|
|
48
|
+
);
|
|
45
49
|
const revocationStore = options.revocationStore ?? new import_revocation.InMemoryRevocationStore();
|
|
46
50
|
const authenticator = async (req) => {
|
|
47
51
|
if (!hasSignatureHeader(req)) return null;
|
|
@@ -62,21 +66,22 @@ function verifySignatureAsAuthenticator(options) {
|
|
|
62
66
|
throw new import_web_bot_auth2.WebBotAuthError(403, "raw_body_missing");
|
|
63
67
|
const signers = await (0, import_web_bot_auth2.verifyWebBotAuth)(requestLike, {
|
|
64
68
|
directory: options.webBotAuth.directory,
|
|
65
|
-
deferAuthorizationErrors: typeof options.resolveOperation(req) === "string",
|
|
66
69
|
replayStore,
|
|
67
|
-
isRevoked: options.webBotAuth.isRevoked,
|
|
68
70
|
now: options.now,
|
|
69
|
-
|
|
70
|
-
"get_adcp_capabilities",
|
|
71
|
-
"get_principal",
|
|
72
|
-
"list_creative_formats",
|
|
73
|
-
"list_accounts"
|
|
74
|
-
].includes(String(options.resolveOperation(req)))
|
|
71
|
+
...options.webBotAuth.isRevoked && { isRevoked: options.webBotAuth.isRevoked }
|
|
75
72
|
});
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
const operation = options.resolveOperation(req);
|
|
74
|
+
let principal2;
|
|
75
|
+
let deferredFailure;
|
|
76
|
+
try {
|
|
77
|
+
principal2 = await options.webBotAuth.resolvePrincipal(signers, operation);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
if (error instanceof import_web_bot_auth2.WebBotAuthError || error instanceof import_web_bot_auth2.WebBotAuthUnavailableError) throw error;
|
|
80
|
+
if (typeof operation !== "string") throw (0, import_web_bot_auth2.webBotAuthPrincipalFailureError)(error);
|
|
81
|
+
const deferred = (0, import_web_bot_auth2.deferWebBotAuthPrincipalFailure)(signers, error);
|
|
82
|
+
principal2 = { principal: deferred.principal };
|
|
83
|
+
deferredFailure = deferred.authorizationFailure;
|
|
84
|
+
}
|
|
80
85
|
const signer2 = signers[signers.length - 1];
|
|
81
86
|
req.verifiedSigner = {
|
|
82
87
|
keyid: signer2.keyid,
|
|
@@ -90,7 +95,9 @@ function verifySignatureAsAuthenticator(options) {
|
|
|
90
95
|
...principal2.extra,
|
|
91
96
|
webBotAuthAuthorization: {
|
|
92
97
|
signer: failed ?? signer2,
|
|
93
|
-
...failed && {
|
|
98
|
+
...(failed?.authorizationFailure ?? deferredFailure) && {
|
|
99
|
+
authorizationFailure: failed?.authorizationFailure ?? deferredFailure
|
|
100
|
+
}
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
103
|
};
|
|
@@ -117,6 +124,10 @@ function verifySignatureAsAuthenticator(options) {
|
|
|
117
124
|
} catch (err) {
|
|
118
125
|
if (err instanceof import_web_bot_auth2.WebBotAuthError)
|
|
119
126
|
throw new import_auth.AuthError(err.message, { cause: err, status: err.status, headers: err.headers, body: err.body });
|
|
127
|
+
if (err instanceof import_web_bot_auth2.WebBotAuthUnavailableError) {
|
|
128
|
+
const outage = (0, import_web_bot_auth2.webBotAuthUnavailableResponse)();
|
|
129
|
+
throw new import_auth.AuthError(err.message, { cause: err, ...outage });
|
|
130
|
+
}
|
|
120
131
|
if (err instanceof import_errors.RequestSignatureError) {
|
|
121
132
|
throw new import_auth.AuthError(`Signature rejected (${err.code}).`, { cause: err });
|
|
122
133
|
}
|
|
@@ -3,6 +3,11 @@ import { RequestSignatureError } from "../signing/errors.mjs";
|
|
|
3
3
|
import {
|
|
4
4
|
selectSignatureProfile,
|
|
5
5
|
verifyWebBotAuth,
|
|
6
|
+
isWebBotAuthRevocationChecked,
|
|
7
|
+
webBotAuthUnavailableResponse,
|
|
8
|
+
WebBotAuthUnavailableError,
|
|
9
|
+
deferWebBotAuthPrincipalFailure,
|
|
10
|
+
webBotAuthPrincipalFailureError,
|
|
6
11
|
WebBotAuthError
|
|
7
12
|
} from "../signing/web-bot-auth.mjs";
|
|
8
13
|
import { InMemoryReplayStore } from "../signing/replay.mjs";
|
|
@@ -34,6 +39,10 @@ function verifySignatureAsAuthenticator(options) {
|
|
|
34
39
|
throw new TypeError(
|
|
35
40
|
"Web Bot Auth requires an origin-binding migration fence; use createIdentity33PrincipalResolver or supply assertLegacyOriginAllowed"
|
|
36
41
|
);
|
|
42
|
+
if (options.webBotAuth && !options.webBotAuth.isRevoked && !isWebBotAuthRevocationChecked(options.webBotAuth.resolvePrincipal))
|
|
43
|
+
throw new TypeError(
|
|
44
|
+
"Web Bot Auth requires origin revocation: use createIdentity33PrincipalResolver({ revocation }) or supply isRevoked"
|
|
45
|
+
);
|
|
37
46
|
const revocationStore = options.revocationStore ?? new InMemoryRevocationStore();
|
|
38
47
|
const authenticator = async (req) => {
|
|
39
48
|
if (!hasSignatureHeader(req)) return null;
|
|
@@ -54,21 +63,22 @@ function verifySignatureAsAuthenticator(options) {
|
|
|
54
63
|
throw new WebBotAuthError(403, "raw_body_missing");
|
|
55
64
|
const signers = await verifyWebBotAuth(requestLike, {
|
|
56
65
|
directory: options.webBotAuth.directory,
|
|
57
|
-
deferAuthorizationErrors: typeof options.resolveOperation(req) === "string",
|
|
58
66
|
replayStore,
|
|
59
|
-
isRevoked: options.webBotAuth.isRevoked,
|
|
60
67
|
now: options.now,
|
|
61
|
-
|
|
62
|
-
"get_adcp_capabilities",
|
|
63
|
-
"get_principal",
|
|
64
|
-
"list_creative_formats",
|
|
65
|
-
"list_accounts"
|
|
66
|
-
].includes(String(options.resolveOperation(req)))
|
|
68
|
+
...options.webBotAuth.isRevoked && { isRevoked: options.webBotAuth.isRevoked }
|
|
67
69
|
});
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
const operation = options.resolveOperation(req);
|
|
71
|
+
let principal2;
|
|
72
|
+
let deferredFailure;
|
|
73
|
+
try {
|
|
74
|
+
principal2 = await options.webBotAuth.resolvePrincipal(signers, operation);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
if (error instanceof WebBotAuthError || error instanceof WebBotAuthUnavailableError) throw error;
|
|
77
|
+
if (typeof operation !== "string") throw webBotAuthPrincipalFailureError(error);
|
|
78
|
+
const deferred = deferWebBotAuthPrincipalFailure(signers, error);
|
|
79
|
+
principal2 = { principal: deferred.principal };
|
|
80
|
+
deferredFailure = deferred.authorizationFailure;
|
|
81
|
+
}
|
|
72
82
|
const signer2 = signers[signers.length - 1];
|
|
73
83
|
req.verifiedSigner = {
|
|
74
84
|
keyid: signer2.keyid,
|
|
@@ -82,7 +92,9 @@ function verifySignatureAsAuthenticator(options) {
|
|
|
82
92
|
...principal2.extra,
|
|
83
93
|
webBotAuthAuthorization: {
|
|
84
94
|
signer: failed ?? signer2,
|
|
85
|
-
...failed && {
|
|
95
|
+
...(failed?.authorizationFailure ?? deferredFailure) && {
|
|
96
|
+
authorizationFailure: failed?.authorizationFailure ?? deferredFailure
|
|
97
|
+
}
|
|
86
98
|
}
|
|
87
99
|
}
|
|
88
100
|
};
|
|
@@ -109,6 +121,10 @@ function verifySignatureAsAuthenticator(options) {
|
|
|
109
121
|
} catch (err) {
|
|
110
122
|
if (err instanceof WebBotAuthError)
|
|
111
123
|
throw new AuthError(err.message, { cause: err, status: err.status, headers: err.headers, body: err.body });
|
|
124
|
+
if (err instanceof WebBotAuthUnavailableError) {
|
|
125
|
+
const outage = webBotAuthUnavailableResponse();
|
|
126
|
+
throw new AuthError(err.message, { cause: err, ...outage });
|
|
127
|
+
}
|
|
112
128
|
if (err instanceof RequestSignatureError) {
|
|
113
129
|
throw new AuthError(`Signature rejected (${err.code}).`, { cause: err });
|
|
114
130
|
}
|
|
@@ -145,12 +145,12 @@ export type Authenticator = (req: IncomingMessage) => AuthResult | Promise<AuthR
|
|
|
145
145
|
*/
|
|
146
146
|
export declare class AuthError extends Error {
|
|
147
147
|
readonly publicMessage: string;
|
|
148
|
-
readonly status?: 400 | 403 | 429;
|
|
148
|
+
readonly status?: 400 | 403 | 429 | 503;
|
|
149
149
|
readonly body?: Record<string, unknown>;
|
|
150
150
|
readonly headers?: Record<string, string>;
|
|
151
151
|
constructor(publicMessage: string, options?: {
|
|
152
152
|
cause?: unknown;
|
|
153
|
-
status?: 400 | 403 | 429;
|
|
153
|
+
status?: 400 | 403 | 429 | 503;
|
|
154
154
|
headers?: Record<string, string>;
|
|
155
155
|
body?: Record<string, unknown>;
|
|
156
156
|
});
|
|
@@ -145,12 +145,12 @@ export type Authenticator = (req: IncomingMessage) => AuthResult | Promise<AuthR
|
|
|
145
145
|
*/
|
|
146
146
|
export declare class AuthError extends Error {
|
|
147
147
|
readonly publicMessage: string;
|
|
148
|
-
readonly status?: 400 | 403 | 429;
|
|
148
|
+
readonly status?: 400 | 403 | 429 | 503;
|
|
149
149
|
readonly body?: Record<string, unknown>;
|
|
150
150
|
readonly headers?: Record<string, string>;
|
|
151
151
|
constructor(publicMessage: string, options?: {
|
|
152
152
|
cause?: unknown;
|
|
153
|
-
status?: 400 | 403 | 429;
|
|
153
|
+
status?: 400 | 403 | 429 | 503;
|
|
154
154
|
headers?: Record<string, string>;
|
|
155
155
|
body?: Record<string, unknown>;
|
|
156
156
|
});
|
|
@@ -1433,6 +1433,10 @@ function buildSignedRequestsPreTransport(signedRequests, effectiveRequestSigning
|
|
|
1433
1433
|
throw new Error(
|
|
1434
1434
|
"Web Bot Auth requires an origin-binding migration fence; use createIdentity33PrincipalResolver or supply assertLegacyOriginAllowed"
|
|
1435
1435
|
);
|
|
1436
|
+
if (signedRequests.webBotAuth && !signedRequests.webBotAuth.isRevoked && !(0, import_web_bot_auth2.isWebBotAuthRevocationChecked)(signedRequests.webBotAuth.resolvePrincipal))
|
|
1437
|
+
throw new Error(
|
|
1438
|
+
"Web Bot Auth requires origin revocation: use createIdentity33PrincipalResolver({ revocation }) or supply isRevoked"
|
|
1439
|
+
);
|
|
1436
1440
|
const requiredFor = effectiveRequestSigning.required_for ?? [];
|
|
1437
1441
|
const verifier = (0, import_middleware.createExpressVerifier)({
|
|
1438
1442
|
capability: {
|
|
@@ -1462,20 +1466,25 @@ function buildSignedRequestsPreTransport(signedRequests, effectiveRequestSigning
|
|
|
1462
1466
|
const signers = await (0, import_web_bot_auth2.verifyWebBotAuth)(
|
|
1463
1467
|
{ method: req.method ?? "POST", url: requestTarget, headers: req.headers, body: req.rawBody ?? "" },
|
|
1464
1468
|
{
|
|
1469
|
+
// Identity verification needs only key discovery and replay state;
|
|
1470
|
+
// revocation and binding belong to the principal resolver.
|
|
1465
1471
|
directory: signedRequests.webBotAuth.directory,
|
|
1466
|
-
deferAuthorizationErrors: typeof (0, import_operation_resolution.resolveRequestOperation)({ rawBody: req.rawBody, method: req.method, url: req.url }) === "string",
|
|
1467
1472
|
replayStore: signedRequests.replayStore,
|
|
1468
|
-
isRevoked: signedRequests.webBotAuth.isRevoked
|
|
1469
|
-
requireFreshRevocation: ![
|
|
1470
|
-
"get_adcp_capabilities",
|
|
1471
|
-
"get_principal",
|
|
1472
|
-
"list_creative_formats",
|
|
1473
|
-
"list_accounts"
|
|
1474
|
-
].includes(String((0, import_operation_resolution.resolveRequestOperation)({ rawBody: req.rawBody, method: req.method, url: req.url })))
|
|
1473
|
+
...signedRequests.webBotAuth.isRevoked && { isRevoked: signedRequests.webBotAuth.isRevoked }
|
|
1475
1474
|
}
|
|
1476
1475
|
);
|
|
1477
1476
|
const operation = (0, import_operation_resolution.resolveRequestOperation)({ rawBody: req.rawBody, method: req.method, url: req.url });
|
|
1478
|
-
|
|
1477
|
+
let principal;
|
|
1478
|
+
let deferredFailure;
|
|
1479
|
+
try {
|
|
1480
|
+
principal = await signedRequests.webBotAuth.resolvePrincipal(signers, operation);
|
|
1481
|
+
} catch (error) {
|
|
1482
|
+
if (error instanceof import_web_bot_auth2.WebBotAuthError || error instanceof import_web_bot_auth2.WebBotAuthUnavailableError) throw error;
|
|
1483
|
+
if (typeof operation !== "string") throw (0, import_web_bot_auth2.webBotAuthPrincipalFailureError)(error);
|
|
1484
|
+
const deferred = (0, import_web_bot_auth2.deferWebBotAuthPrincipalFailure)(signers, error);
|
|
1485
|
+
principal = { principal: deferred.principal };
|
|
1486
|
+
deferredFailure = deferred.authorizationFailure;
|
|
1487
|
+
}
|
|
1479
1488
|
const signer = signers[signers.length - 1];
|
|
1480
1489
|
const failed = signers.find((s) => s.authorizationFailure);
|
|
1481
1490
|
const guardedPrincipal = {
|
|
@@ -1484,7 +1493,9 @@ function buildSignedRequestsPreTransport(signedRequests, effectiveRequestSigning
|
|
|
1484
1493
|
...principal.extra,
|
|
1485
1494
|
webBotAuthAuthorization: {
|
|
1486
1495
|
signer: failed ?? signer,
|
|
1487
|
-
...failed && {
|
|
1496
|
+
...(failed?.authorizationFailure ?? deferredFailure) && {
|
|
1497
|
+
authorizationFailure: failed?.authorizationFailure ?? deferredFailure
|
|
1498
|
+
}
|
|
1488
1499
|
}
|
|
1489
1500
|
}
|
|
1490
1501
|
};
|
|
@@ -1495,6 +1506,12 @@ function buildSignedRequestsPreTransport(signedRequests, effectiveRequestSigning
|
|
|
1495
1506
|
});
|
|
1496
1507
|
return false;
|
|
1497
1508
|
} catch (error) {
|
|
1509
|
+
if (error instanceof import_web_bot_auth2.WebBotAuthUnavailableError) {
|
|
1510
|
+
const outage = (0, import_web_bot_auth2.webBotAuthUnavailableResponse)();
|
|
1511
|
+
res.writeHead(outage.status, { ...outage.headers, "Content-Type": "application/json" });
|
|
1512
|
+
res.end(JSON.stringify(outage.body));
|
|
1513
|
+
return true;
|
|
1514
|
+
}
|
|
1498
1515
|
const rejected = error instanceof import_web_bot_auth2.WebBotAuthError ? error : new import_web_bot_auth2.WebBotAuthError(403, "identity_rejected");
|
|
1499
1516
|
res.writeHead(rejected.status, { ...rejected.headers, "Content-Type": "application/json" });
|
|
1500
1517
|
res.end(JSON.stringify(rejected.body));
|
|
@@ -2981,6 +2998,8 @@ function createAdcpServer(config) {
|
|
|
2981
2998
|
try {
|
|
2982
2999
|
await config.identity33.authorize(ctx, toolName, params);
|
|
2983
3000
|
} catch (error) {
|
|
3001
|
+
if (error instanceof import_trust.TrustRecordUnavailableError)
|
|
3002
|
+
return finalize((0, import_errors2.adcpError)("SERVICE_UNAVAILABLE", { message: error.message, recovery: "transient" }));
|
|
2984
3003
|
if (error instanceof import_trust.IdentityAuthorizationError)
|
|
2985
3004
|
return finalize(
|
|
2986
3005
|
(0, import_errors2.adcpError)("PERMISSION_DENIED", {
|
|
@@ -4604,6 +4623,8 @@ function createAdcpServer(config) {
|
|
|
4604
4623
|
params
|
|
4605
4624
|
);
|
|
4606
4625
|
} catch (error) {
|
|
4626
|
+
if (error instanceof import_trust.TrustRecordUnavailableError)
|
|
4627
|
+
return (0, import_errors2.adcpError)("SERVICE_UNAVAILABLE", { message: error.message, recovery: "transient" });
|
|
4607
4628
|
if (error instanceof import_trust.IdentityAuthorizationError)
|
|
4608
4629
|
return (0, import_errors2.adcpError)("PERMISSION_DENIED", {
|
|
4609
4630
|
message: error.message,
|