@adcp/sdk 17.0.0-beta.21 → 17.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -2
- package/dist/lib/client/core.d.mts +4 -0
- package/dist/lib/client/core.d.ts +4 -0
- package/dist/lib/client/core.js +13 -0
- package/dist/lib/client/core.mjs +12 -0
- package/dist/lib/conformance/property-lists.d.mts +1 -1
- package/dist/lib/conformance/property-lists.d.ts +1 -1
- package/dist/lib/conformance/property-lists.js +1 -1
- package/dist/lib/conformance/property-lists.mjs +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +10 -1
- package/dist/lib/core/SingleAgentClient.d.ts +10 -1
- package/dist/lib/core/SingleAgentClient.js +56 -7
- package/dist/lib/core/SingleAgentClient.mjs +61 -7
- package/dist/lib/core/targeting-helpers.d.mts +123 -0
- package/dist/lib/core/targeting-helpers.d.ts +123 -0
- package/dist/lib/core/targeting-helpers.js +412 -0
- package/dist/lib/core/targeting-helpers.mjs +370 -0
- package/dist/lib/entrypoints/client-account-changes.d.mts +5 -0
- package/dist/lib/entrypoints/client-account-changes.d.ts +5 -0
- package/dist/lib/entrypoints/client-account-changes.js +28 -0
- package/dist/lib/entrypoints/client-account-changes.mjs +4 -0
- package/dist/lib/entrypoints/client-webhook-stores.d.mts +2 -0
- package/dist/lib/entrypoints/client-webhook-stores.d.ts +2 -0
- package/dist/lib/entrypoints/client-webhook-stores.js +37 -0
- package/dist/lib/entrypoints/client-webhook-stores.mjs +16 -0
- package/dist/lib/entrypoints/discovery.d.mts +9 -0
- package/dist/lib/entrypoints/discovery.d.ts +9 -0
- package/dist/lib/entrypoints/discovery.js +72 -0
- package/dist/lib/entrypoints/discovery.mjs +56 -0
- package/dist/lib/entrypoints/errors.d.mts +11 -0
- package/dist/lib/entrypoints/errors.d.ts +11 -0
- package/dist/lib/entrypoints/errors.js +159 -0
- package/dist/lib/entrypoints/errors.mjs +132 -0
- package/dist/lib/entrypoints/media-buy.d.mts +5 -0
- package/dist/lib/entrypoints/media-buy.d.ts +5 -0
- package/dist/lib/entrypoints/media-buy.js +119 -0
- package/dist/lib/entrypoints/media-buy.mjs +100 -0
- package/dist/lib/entrypoints/registry.d.mts +5 -0
- package/dist/lib/entrypoints/registry.d.ts +5 -0
- package/dist/lib/entrypoints/registry.js +61 -0
- package/dist/lib/entrypoints/registry.mjs +40 -0
- package/dist/lib/entrypoints/utils.d.mts +7 -0
- package/dist/lib/entrypoints/utils.d.ts +7 -0
- package/dist/lib/entrypoints/utils.js +100 -0
- package/dist/lib/entrypoints/utils.mjs +72 -0
- package/dist/lib/entrypoints/version.d.mts +3 -0
- package/dist/lib/entrypoints/version.d.ts +3 -0
- package/dist/lib/entrypoints/version.js +57 -0
- package/dist/lib/entrypoints/version.mjs +36 -0
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/media-buy/action-contracts.js +3 -3
- package/dist/lib/media-buy/action-contracts.mjs +1 -1
- package/dist/lib/media-buy/creative-start-policy.d.mts +19 -0
- package/dist/lib/media-buy/creative-start-policy.d.ts +19 -0
- package/dist/lib/media-buy/creative-start-policy.js +59 -0
- package/dist/lib/media-buy/creative-start-policy.mjs +31 -0
- package/dist/lib/media-buy/valid-actions.d.mts +47 -0
- package/dist/lib/media-buy/valid-actions.d.ts +47 -0
- package/dist/lib/media-buy/valid-actions.js +42 -0
- package/dist/lib/media-buy/valid-actions.mjs +18 -0
- package/dist/lib/net/pin-and-bind-fetch.d.mts +121 -0
- package/dist/lib/net/pin-and-bind-fetch.d.ts +121 -0
- package/dist/lib/net/pin-and-bind-fetch.js +209 -0
- package/dist/lib/net/pin-and-bind-fetch.mjs +183 -0
- package/dist/lib/registry/types.generated.d.ts +18 -2
- package/dist/lib/reporting/ledger/index.d.mts +1 -0
- package/dist/lib/reporting/ledger/index.d.ts +1 -0
- package/dist/lib/reporting/ledger/index.js +3 -1
- package/dist/lib/reporting/ledger/index.mjs +1 -0
- package/dist/lib/reporting/ledger/instant.d.mts +5 -0
- package/dist/lib/reporting/ledger/instant.d.ts +5 -0
- package/dist/lib/reporting/ledger/instant.js +10 -0
- package/dist/lib/reporting/ledger/instant.mjs +9 -0
- package/dist/lib/reporting/ledger/issue-events.d.mts +333 -0
- package/dist/lib/reporting/ledger/issue-events.d.ts +333 -0
- package/dist/lib/reporting/ledger/issue-events.js +310 -0
- package/dist/lib/reporting/ledger/issue-events.mjs +282 -0
- package/dist/lib/reporting/service/index.d.mts +36 -1
- package/dist/lib/reporting/service/index.d.ts +36 -1
- package/dist/lib/reporting/service/index.js +51 -1
- package/dist/lib/reporting/service/index.mjs +52 -2
- package/dist/lib/reporting/service/scheduler-support.d.mts +1 -1
- package/dist/lib/reporting/service/scheduler-support.d.ts +1 -1
- package/dist/lib/reporting/service/scheduler-support.js +1 -1
- package/dist/lib/reporting/service/scheduler-support.mjs +1 -1
- package/dist/lib/server/capabilities-release-projection.d.mts +43 -0
- package/dist/lib/server/capabilities-release-projection.d.ts +43 -0
- package/dist/lib/server/capabilities-release-projection.js +128 -0
- package/dist/lib/server/capabilities-release-projection.mjs +112 -0
- package/dist/lib/server/create-adcp-server.d.mts +29 -5
- package/dist/lib/server/create-adcp-server.d.ts +29 -5
- package/dist/lib/server/create-adcp-server.js +95 -22
- package/dist/lib/server/create-adcp-server.mjs +106 -21
- package/dist/lib/server/decisioning/capabilities.d.mts +27 -0
- package/dist/lib/server/decisioning/capabilities.d.ts +27 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js +99 -27
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +103 -27
- package/dist/lib/server/declared-input-schema.d.mts +108 -0
- package/dist/lib/server/declared-input-schema.d.ts +108 -0
- package/dist/lib/server/declared-input-schema.js +167 -0
- package/dist/lib/server/declared-input-schema.mjs +137 -0
- package/dist/lib/server/envelope-allowlist.d.mts +1 -105
- package/dist/lib/server/envelope-allowlist.d.ts +1 -105
- package/dist/lib/server/envelope-allowlist.js +3 -79
- package/dist/lib/server/envelope-allowlist.mjs +1 -71
- package/dist/lib/server/errors.d.mts +1 -186
- package/dist/lib/server/errors.d.ts +1 -186
- package/dist/lib/server/errors.js +3 -98
- package/dist/lib/server/errors.mjs +1 -94
- package/dist/lib/server/index.d.mts +1 -1
- package/dist/lib/server/index.d.ts +1 -1
- package/dist/lib/server/mcp-modern-server.js +21 -4
- package/dist/lib/server/mcp-modern-server.mjs +21 -4
- package/dist/lib/server/media-buy-action-resolver.d.mts +7 -0
- package/dist/lib/server/media-buy-action-resolver.d.ts +7 -0
- package/dist/lib/server/media-buy-action-resolver.js +10 -1
- package/dist/lib/server/media-buy-action-resolver.mjs +10 -1
- package/dist/lib/server/media-buy-helpers.d.mts +1 -47
- package/dist/lib/server/media-buy-helpers.d.ts +1 -47
- package/dist/lib/server/media-buy-helpers.js +3 -23
- package/dist/lib/server/media-buy-helpers.mjs +1 -18
- package/dist/lib/server/pick-safe-details.d.mts +1 -89
- package/dist/lib/server/pick-safe-details.d.ts +1 -89
- package/dist/lib/server/pick-safe-details.js +3 -61
- package/dist/lib/server/pick-safe-details.mjs +1 -56
- package/dist/lib/server/pin-and-bind-fetch.d.mts +1 -121
- package/dist/lib/server/pin-and-bind-fetch.d.ts +1 -121
- package/dist/lib/server/pin-and-bind-fetch.js +3 -190
- package/dist/lib/server/pin-and-bind-fetch.mjs +1 -183
- package/dist/lib/server/targeting-helpers.d.mts +1 -123
- package/dist/lib/server/targeting-helpers.d.ts +1 -123
- package/dist/lib/server/targeting-helpers.js +3 -393
- package/dist/lib/server/targeting-helpers.mjs +1 -370
- package/dist/lib/server/test-controller.js +7 -3
- package/dist/lib/server/test-controller.mjs +7 -3
- package/dist/lib/storage/memory-ledger.js +219 -1
- package/dist/lib/storage/memory-ledger.mjs +223 -1
- package/dist/lib/testing/compliance/storyboard-tracks.js +0 -4
- package/dist/lib/testing/compliance/storyboard-tracks.mjs +0 -4
- package/dist/lib/testing/comply-controller.js +7 -2
- package/dist/lib/testing/comply-controller.mjs +7 -2
- package/dist/lib/testing/storyboard/request-signing/grader.d.mts +21 -0
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +21 -0
- package/dist/lib/testing/storyboard/request-signing/grader.js +31 -0
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +30 -0
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +1 -1
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +2 -1
- package/dist/lib/testing/storyboard/request-signing/types.d.mts +12 -0
- package/dist/lib/testing/storyboard/request-signing/types.d.ts +12 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +7 -2
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +7 -2
- package/dist/lib/testing/storyboard/runner.js +2 -2
- package/dist/lib/testing/storyboard/runner.mjs +2 -2
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/utils/adcp-error-response.d.mts +196 -0
- package/dist/lib/utils/adcp-error-response.d.ts +196 -0
- package/dist/lib/utils/adcp-error-response.js +118 -0
- package/dist/lib/utils/adcp-error-response.mjs +95 -0
- package/dist/lib/utils/buyer-retry-policy.js +2 -2
- package/dist/lib/utils/buyer-retry-policy.mjs +1 -1
- package/dist/lib/utils/capabilities.d.mts +6 -0
- package/dist/lib/utils/capabilities.d.ts +6 -0
- package/dist/lib/utils/capabilities.js +6 -2
- package/dist/lib/utils/capabilities.mjs +6 -2
- package/dist/lib/utils/envelope-allowlist.d.mts +105 -0
- package/dist/lib/utils/envelope-allowlist.d.ts +105 -0
- package/dist/lib/utils/envelope-allowlist.js +98 -0
- package/dist/lib/utils/envelope-allowlist.mjs +71 -0
- package/dist/lib/utils/pick-safe-details.d.mts +89 -0
- package/dist/lib/utils/pick-safe-details.d.ts +89 -0
- package/dist/lib/utils/pick-safe-details.js +80 -0
- package/dist/lib/utils/pick-safe-details.mjs +56 -0
- package/dist/lib/v2/projection/augment-response.d.mts +4 -0
- package/dist/lib/v2/projection/augment-response.d.ts +4 -0
- package/dist/lib/v2/projection/creative-delivery.d.mts +20 -3
- package/dist/lib/v2/projection/creative-delivery.d.ts +20 -3
- package/dist/lib/v2/projection/creative-delivery.js +20 -4
- package/dist/lib/v2/projection/creative-delivery.mjs +19 -4
- package/dist/lib/v2/projection/index.d.mts +2 -2
- package/dist/lib/v2/projection/index.d.ts +2 -2
- package/dist/lib/v2/projection/index.js +4 -0
- package/dist/lib/v2/projection/index.mjs +5 -1
- package/dist/lib/v2/projection/legacy-metadata.d.mts +7 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +7 -0
- package/dist/lib/v2/projection/legacy-metadata.js +14 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs +12 -0
- package/dist/lib/v2/projection/legacy-routes.d.mts +11 -0
- package/dist/lib/v2/projection/legacy-routes.d.ts +11 -0
- package/dist/lib/v2/projection/legacy-routes.js +2 -1
- package/dist/lib/v2/projection/legacy-routes.mjs +7 -2
- package/dist/lib/v2/projection/v1-to-v2.d.mts +21 -1
- package/dist/lib/v2/projection/v1-to-v2.d.ts +21 -1
- package/dist/lib/v2/projection/v1-to-v2.js +18 -11
- package/dist/lib/v2/projection/v1-to-v2.mjs +19 -11
- 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/CREATIVE-DELIVERY.md +12 -0
- package/docs/guides/REPORTING-LEDGER.md +121 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +1 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-16-to-17.md +149 -0
- package/docs/migration-reporting-storage-package.md +10 -0
- package/package.json +106 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RegistryClient,
|
|
3
|
+
RegistryRequestError,
|
|
4
|
+
isRegistryRequestError,
|
|
5
|
+
RegistrySync,
|
|
6
|
+
PropertyRegistry,
|
|
7
|
+
InMemoryCursorStore,
|
|
8
|
+
FileCursorStore,
|
|
9
|
+
buildCommunityMirrorAdagents
|
|
10
|
+
} from "../registry/index.mjs";
|
|
11
|
+
import {
|
|
12
|
+
openFeedStream,
|
|
13
|
+
parseSseStream,
|
|
14
|
+
sanitizeStreamText,
|
|
15
|
+
DEFAULT_MAX_SSE_FRAME_BYTES,
|
|
16
|
+
FeedStreamError,
|
|
17
|
+
FeedStreamUnsupportedError,
|
|
18
|
+
FeedStreamCursorExpiredError,
|
|
19
|
+
FeedStreamHttpError,
|
|
20
|
+
FeedStreamParseError
|
|
21
|
+
} from "../registry/index.mjs";
|
|
22
|
+
export {
|
|
23
|
+
DEFAULT_MAX_SSE_FRAME_BYTES,
|
|
24
|
+
FeedStreamCursorExpiredError,
|
|
25
|
+
FeedStreamError,
|
|
26
|
+
FeedStreamHttpError,
|
|
27
|
+
FeedStreamParseError,
|
|
28
|
+
FeedStreamUnsupportedError,
|
|
29
|
+
FileCursorStore,
|
|
30
|
+
InMemoryCursorStore,
|
|
31
|
+
PropertyRegistry,
|
|
32
|
+
RegistryClient,
|
|
33
|
+
RegistryRequestError,
|
|
34
|
+
RegistrySync,
|
|
35
|
+
buildCommunityMirrorAdagents,
|
|
36
|
+
isRegistryRequestError,
|
|
37
|
+
openFeedStream,
|
|
38
|
+
parseSseStream,
|
|
39
|
+
sanitizeStreamText
|
|
40
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { canonicalize, canonicalJsonSha256 } from '../utils/jcs.mjs';
|
|
2
|
+
export { getAuthoritativeMediaBuyStatus, isMediaBuyStatus } from '../utils/media-buy-status.mjs';
|
|
3
|
+
export { unwrapProtocolResponse, isAdcpError, isAdcpSuccess, isTerminalAdcpError, hasAdvisorySuccessPayload, } from '../utils/response-unwrapper.mjs';
|
|
4
|
+
export { buildSyntheticV3Capabilities, parseCapabilitiesResponse, supportsV3, supportsProtocol, supportsPropertyListFiltering, supportsContentStandards, supportsSyncCreatives, supportsBuyingMode, requiresOperatorAuth, requiresAccountForProducts, supportsSandbox, supportsExperimentalFeature, resolveFeature, listDeclaredFeatures, MEDIA_BUY_TOOLS, SIGNALS_TOOLS, GOVERNANCE_TOOLS, CREATIVE_TOOLS, EVENT_TRACKING_TOOLS, ACCOUNT_TOOLS, PROTOCOL_TOOLS, BRAND_RIGHTS_TOOLS, TASK_FEATURE_MAP, } from '../utils/capabilities.mjs';
|
|
5
|
+
export type { AdcpCapabilities, AdcpMajorVersion, AdcpProtocol, AccountCapabilities, BuyingMode, MediaBuyFeatures, ToolInfo, FeatureName, IdempotencyCapabilities, } from '../utils/capabilities.mjs';
|
|
6
|
+
export type { BrandManifest, BrandManifestReference, AssetContentType, PromotedProducts, PromotedOfferings, Measurement, } from '../types/compat.mjs';
|
|
7
|
+
export { brandManifestToBrandReference, promotedProductsToCatalog, promotedOfferingsToCatalog } from '../types/compat.mjs';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { canonicalize, canonicalJsonSha256 } from '../utils/jcs';
|
|
2
|
+
export { getAuthoritativeMediaBuyStatus, isMediaBuyStatus } from '../utils/media-buy-status';
|
|
3
|
+
export { unwrapProtocolResponse, isAdcpError, isAdcpSuccess, isTerminalAdcpError, hasAdvisorySuccessPayload, } from '../utils/response-unwrapper';
|
|
4
|
+
export { buildSyntheticV3Capabilities, parseCapabilitiesResponse, supportsV3, supportsProtocol, supportsPropertyListFiltering, supportsContentStandards, supportsSyncCreatives, supportsBuyingMode, requiresOperatorAuth, requiresAccountForProducts, supportsSandbox, supportsExperimentalFeature, resolveFeature, listDeclaredFeatures, MEDIA_BUY_TOOLS, SIGNALS_TOOLS, GOVERNANCE_TOOLS, CREATIVE_TOOLS, EVENT_TRACKING_TOOLS, ACCOUNT_TOOLS, PROTOCOL_TOOLS, BRAND_RIGHTS_TOOLS, TASK_FEATURE_MAP, } from '../utils/capabilities';
|
|
5
|
+
export type { AdcpCapabilities, AdcpMajorVersion, AdcpProtocol, AccountCapabilities, BuyingMode, MediaBuyFeatures, ToolInfo, FeatureName, IdempotencyCapabilities, } from '../utils/capabilities';
|
|
6
|
+
export type { BrandManifest, BrandManifestReference, AssetContentType, PromotedProducts, PromotedOfferings, Measurement, } from '../types/compat';
|
|
7
|
+
export { brandManifestToBrandReference, promotedProductsToCatalog, promotedOfferingsToCatalog } from '../types/compat';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
ACCOUNT_TOOLS: () => import_capabilities.ACCOUNT_TOOLS,
|
|
22
|
+
BRAND_RIGHTS_TOOLS: () => import_capabilities.BRAND_RIGHTS_TOOLS,
|
|
23
|
+
CREATIVE_TOOLS: () => import_capabilities.CREATIVE_TOOLS,
|
|
24
|
+
EVENT_TRACKING_TOOLS: () => import_capabilities.EVENT_TRACKING_TOOLS,
|
|
25
|
+
GOVERNANCE_TOOLS: () => import_capabilities.GOVERNANCE_TOOLS,
|
|
26
|
+
MEDIA_BUY_TOOLS: () => import_capabilities.MEDIA_BUY_TOOLS,
|
|
27
|
+
PROTOCOL_TOOLS: () => import_capabilities.PROTOCOL_TOOLS,
|
|
28
|
+
SIGNALS_TOOLS: () => import_capabilities.SIGNALS_TOOLS,
|
|
29
|
+
TASK_FEATURE_MAP: () => import_capabilities.TASK_FEATURE_MAP,
|
|
30
|
+
brandManifestToBrandReference: () => import_compat.brandManifestToBrandReference,
|
|
31
|
+
buildSyntheticV3Capabilities: () => import_capabilities.buildSyntheticV3Capabilities,
|
|
32
|
+
canonicalJsonSha256: () => import_jcs.canonicalJsonSha256,
|
|
33
|
+
canonicalize: () => import_jcs.canonicalize,
|
|
34
|
+
getAuthoritativeMediaBuyStatus: () => import_media_buy_status.getAuthoritativeMediaBuyStatus,
|
|
35
|
+
hasAdvisorySuccessPayload: () => import_response_unwrapper.hasAdvisorySuccessPayload,
|
|
36
|
+
isAdcpError: () => import_response_unwrapper.isAdcpError,
|
|
37
|
+
isAdcpSuccess: () => import_response_unwrapper.isAdcpSuccess,
|
|
38
|
+
isMediaBuyStatus: () => import_media_buy_status.isMediaBuyStatus,
|
|
39
|
+
isTerminalAdcpError: () => import_response_unwrapper.isTerminalAdcpError,
|
|
40
|
+
listDeclaredFeatures: () => import_capabilities.listDeclaredFeatures,
|
|
41
|
+
parseCapabilitiesResponse: () => import_capabilities.parseCapabilitiesResponse,
|
|
42
|
+
promotedOfferingsToCatalog: () => import_compat.promotedOfferingsToCatalog,
|
|
43
|
+
promotedProductsToCatalog: () => import_compat.promotedProductsToCatalog,
|
|
44
|
+
requiresAccountForProducts: () => import_capabilities.requiresAccountForProducts,
|
|
45
|
+
requiresOperatorAuth: () => import_capabilities.requiresOperatorAuth,
|
|
46
|
+
resolveFeature: () => import_capabilities.resolveFeature,
|
|
47
|
+
supportsBuyingMode: () => import_capabilities.supportsBuyingMode,
|
|
48
|
+
supportsContentStandards: () => import_capabilities.supportsContentStandards,
|
|
49
|
+
supportsExperimentalFeature: () => import_capabilities.supportsExperimentalFeature,
|
|
50
|
+
supportsPropertyListFiltering: () => import_capabilities.supportsPropertyListFiltering,
|
|
51
|
+
supportsProtocol: () => import_capabilities.supportsProtocol,
|
|
52
|
+
supportsSandbox: () => import_capabilities.supportsSandbox,
|
|
53
|
+
supportsSyncCreatives: () => import_capabilities.supportsSyncCreatives,
|
|
54
|
+
supportsV3: () => import_capabilities.supportsV3,
|
|
55
|
+
unwrapProtocolResponse: () => import_response_unwrapper.unwrapProtocolResponse
|
|
56
|
+
});
|
|
57
|
+
module.exports = __toCommonJS(utils_exports);
|
|
58
|
+
var import_jcs = require('../utils/jcs.js');
|
|
59
|
+
var import_media_buy_status = require('../utils/media-buy-status.js');
|
|
60
|
+
var import_response_unwrapper = require('../utils/response-unwrapper.js');
|
|
61
|
+
var import_capabilities = require('../utils/capabilities.js');
|
|
62
|
+
var import_compat = require('../types/compat.js');
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
ACCOUNT_TOOLS,
|
|
66
|
+
BRAND_RIGHTS_TOOLS,
|
|
67
|
+
CREATIVE_TOOLS,
|
|
68
|
+
EVENT_TRACKING_TOOLS,
|
|
69
|
+
GOVERNANCE_TOOLS,
|
|
70
|
+
MEDIA_BUY_TOOLS,
|
|
71
|
+
PROTOCOL_TOOLS,
|
|
72
|
+
SIGNALS_TOOLS,
|
|
73
|
+
TASK_FEATURE_MAP,
|
|
74
|
+
brandManifestToBrandReference,
|
|
75
|
+
buildSyntheticV3Capabilities,
|
|
76
|
+
canonicalJsonSha256,
|
|
77
|
+
canonicalize,
|
|
78
|
+
getAuthoritativeMediaBuyStatus,
|
|
79
|
+
hasAdvisorySuccessPayload,
|
|
80
|
+
isAdcpError,
|
|
81
|
+
isAdcpSuccess,
|
|
82
|
+
isMediaBuyStatus,
|
|
83
|
+
isTerminalAdcpError,
|
|
84
|
+
listDeclaredFeatures,
|
|
85
|
+
parseCapabilitiesResponse,
|
|
86
|
+
promotedOfferingsToCatalog,
|
|
87
|
+
promotedProductsToCatalog,
|
|
88
|
+
requiresAccountForProducts,
|
|
89
|
+
requiresOperatorAuth,
|
|
90
|
+
resolveFeature,
|
|
91
|
+
supportsBuyingMode,
|
|
92
|
+
supportsContentStandards,
|
|
93
|
+
supportsExperimentalFeature,
|
|
94
|
+
supportsPropertyListFiltering,
|
|
95
|
+
supportsProtocol,
|
|
96
|
+
supportsSandbox,
|
|
97
|
+
supportsSyncCreatives,
|
|
98
|
+
supportsV3,
|
|
99
|
+
unwrapProtocolResponse
|
|
100
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { canonicalize, canonicalJsonSha256 } from "../utils/jcs.mjs";
|
|
2
|
+
import { getAuthoritativeMediaBuyStatus, isMediaBuyStatus } from "../utils/media-buy-status.mjs";
|
|
3
|
+
import {
|
|
4
|
+
unwrapProtocolResponse,
|
|
5
|
+
isAdcpError,
|
|
6
|
+
isAdcpSuccess,
|
|
7
|
+
isTerminalAdcpError,
|
|
8
|
+
hasAdvisorySuccessPayload
|
|
9
|
+
} from "../utils/response-unwrapper.mjs";
|
|
10
|
+
import {
|
|
11
|
+
buildSyntheticV3Capabilities,
|
|
12
|
+
parseCapabilitiesResponse,
|
|
13
|
+
supportsV3,
|
|
14
|
+
supportsProtocol,
|
|
15
|
+
supportsPropertyListFiltering,
|
|
16
|
+
supportsContentStandards,
|
|
17
|
+
supportsSyncCreatives,
|
|
18
|
+
supportsBuyingMode,
|
|
19
|
+
requiresOperatorAuth,
|
|
20
|
+
requiresAccountForProducts,
|
|
21
|
+
supportsSandbox,
|
|
22
|
+
supportsExperimentalFeature,
|
|
23
|
+
resolveFeature,
|
|
24
|
+
listDeclaredFeatures,
|
|
25
|
+
MEDIA_BUY_TOOLS,
|
|
26
|
+
SIGNALS_TOOLS,
|
|
27
|
+
GOVERNANCE_TOOLS,
|
|
28
|
+
CREATIVE_TOOLS,
|
|
29
|
+
EVENT_TRACKING_TOOLS,
|
|
30
|
+
ACCOUNT_TOOLS,
|
|
31
|
+
PROTOCOL_TOOLS,
|
|
32
|
+
BRAND_RIGHTS_TOOLS,
|
|
33
|
+
TASK_FEATURE_MAP
|
|
34
|
+
} from "../utils/capabilities.mjs";
|
|
35
|
+
import { brandManifestToBrandReference, promotedProductsToCatalog, promotedOfferingsToCatalog } from "../types/compat.mjs";
|
|
36
|
+
export {
|
|
37
|
+
ACCOUNT_TOOLS,
|
|
38
|
+
BRAND_RIGHTS_TOOLS,
|
|
39
|
+
CREATIVE_TOOLS,
|
|
40
|
+
EVENT_TRACKING_TOOLS,
|
|
41
|
+
GOVERNANCE_TOOLS,
|
|
42
|
+
MEDIA_BUY_TOOLS,
|
|
43
|
+
PROTOCOL_TOOLS,
|
|
44
|
+
SIGNALS_TOOLS,
|
|
45
|
+
TASK_FEATURE_MAP,
|
|
46
|
+
brandManifestToBrandReference,
|
|
47
|
+
buildSyntheticV3Capabilities,
|
|
48
|
+
canonicalJsonSha256,
|
|
49
|
+
canonicalize,
|
|
50
|
+
getAuthoritativeMediaBuyStatus,
|
|
51
|
+
hasAdvisorySuccessPayload,
|
|
52
|
+
isAdcpError,
|
|
53
|
+
isAdcpSuccess,
|
|
54
|
+
isMediaBuyStatus,
|
|
55
|
+
isTerminalAdcpError,
|
|
56
|
+
listDeclaredFeatures,
|
|
57
|
+
parseCapabilitiesResponse,
|
|
58
|
+
promotedOfferingsToCatalog,
|
|
59
|
+
promotedProductsToCatalog,
|
|
60
|
+
requiresAccountForProducts,
|
|
61
|
+
requiresOperatorAuth,
|
|
62
|
+
resolveFeature,
|
|
63
|
+
supportsBuyingMode,
|
|
64
|
+
supportsContentStandards,
|
|
65
|
+
supportsExperimentalFeature,
|
|
66
|
+
supportsPropertyListFiltering,
|
|
67
|
+
supportsProtocol,
|
|
68
|
+
supportsSandbox,
|
|
69
|
+
supportsSyncCreatives,
|
|
70
|
+
supportsV3,
|
|
71
|
+
unwrapProtocolResponse
|
|
72
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { getAdcpVersion, getLibraryVersion, isCompatibleWith, getCompatibleVersions, parseAdcpMajorVersion, ADCP_VERSION, ADCP_MAJOR_VERSION, LIBRARY_VERSION, COMPATIBLE_ADCP_VERSIONS, VERSION_INFO, } from '../version.mjs';
|
|
2
|
+
export type { AdcpVersion } from '../version.mjs';
|
|
3
|
+
export { listBundledAdcpVersions, resolveAdcpVersion, isAdcpVersionAtLeast, sellerAdvertises31, shouldOmit31Fields, } from '../utils/adcp-version-config.mjs';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { getAdcpVersion, getLibraryVersion, isCompatibleWith, getCompatibleVersions, parseAdcpMajorVersion, ADCP_VERSION, ADCP_MAJOR_VERSION, LIBRARY_VERSION, COMPATIBLE_ADCP_VERSIONS, VERSION_INFO, } from '../version';
|
|
2
|
+
export type { AdcpVersion } from '../version';
|
|
3
|
+
export { listBundledAdcpVersions, resolveAdcpVersion, isAdcpVersionAtLeast, sellerAdvertises31, shouldOmit31Fields, } from '../utils/adcp-version-config';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var version_exports = {};
|
|
20
|
+
__export(version_exports, {
|
|
21
|
+
ADCP_MAJOR_VERSION: () => import_version.ADCP_MAJOR_VERSION,
|
|
22
|
+
ADCP_VERSION: () => import_version.ADCP_VERSION,
|
|
23
|
+
COMPATIBLE_ADCP_VERSIONS: () => import_version.COMPATIBLE_ADCP_VERSIONS,
|
|
24
|
+
LIBRARY_VERSION: () => import_version.LIBRARY_VERSION,
|
|
25
|
+
VERSION_INFO: () => import_version.VERSION_INFO,
|
|
26
|
+
getAdcpVersion: () => import_version.getAdcpVersion,
|
|
27
|
+
getCompatibleVersions: () => import_version.getCompatibleVersions,
|
|
28
|
+
getLibraryVersion: () => import_version.getLibraryVersion,
|
|
29
|
+
isAdcpVersionAtLeast: () => import_adcp_version_config.isAdcpVersionAtLeast,
|
|
30
|
+
isCompatibleWith: () => import_version.isCompatibleWith,
|
|
31
|
+
listBundledAdcpVersions: () => import_adcp_version_config.listBundledAdcpVersions,
|
|
32
|
+
parseAdcpMajorVersion: () => import_version.parseAdcpMajorVersion,
|
|
33
|
+
resolveAdcpVersion: () => import_adcp_version_config.resolveAdcpVersion,
|
|
34
|
+
sellerAdvertises31: () => import_adcp_version_config.sellerAdvertises31,
|
|
35
|
+
shouldOmit31Fields: () => import_adcp_version_config.shouldOmit31Fields
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(version_exports);
|
|
38
|
+
var import_version = require('../version.js');
|
|
39
|
+
var import_adcp_version_config = require('../utils/adcp-version-config.js');
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
ADCP_MAJOR_VERSION,
|
|
43
|
+
ADCP_VERSION,
|
|
44
|
+
COMPATIBLE_ADCP_VERSIONS,
|
|
45
|
+
LIBRARY_VERSION,
|
|
46
|
+
VERSION_INFO,
|
|
47
|
+
getAdcpVersion,
|
|
48
|
+
getCompatibleVersions,
|
|
49
|
+
getLibraryVersion,
|
|
50
|
+
isAdcpVersionAtLeast,
|
|
51
|
+
isCompatibleWith,
|
|
52
|
+
listBundledAdcpVersions,
|
|
53
|
+
parseAdcpMajorVersion,
|
|
54
|
+
resolveAdcpVersion,
|
|
55
|
+
sellerAdvertises31,
|
|
56
|
+
shouldOmit31Fields
|
|
57
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getAdcpVersion,
|
|
3
|
+
getLibraryVersion,
|
|
4
|
+
isCompatibleWith,
|
|
5
|
+
getCompatibleVersions,
|
|
6
|
+
parseAdcpMajorVersion,
|
|
7
|
+
ADCP_VERSION,
|
|
8
|
+
ADCP_MAJOR_VERSION,
|
|
9
|
+
LIBRARY_VERSION,
|
|
10
|
+
COMPATIBLE_ADCP_VERSIONS,
|
|
11
|
+
VERSION_INFO
|
|
12
|
+
} from "../version.mjs";
|
|
13
|
+
import {
|
|
14
|
+
listBundledAdcpVersions,
|
|
15
|
+
resolveAdcpVersion,
|
|
16
|
+
isAdcpVersionAtLeast,
|
|
17
|
+
sellerAdvertises31,
|
|
18
|
+
shouldOmit31Fields
|
|
19
|
+
} from "../utils/adcp-version-config.mjs";
|
|
20
|
+
export {
|
|
21
|
+
ADCP_MAJOR_VERSION,
|
|
22
|
+
ADCP_VERSION,
|
|
23
|
+
COMPATIBLE_ADCP_VERSIONS,
|
|
24
|
+
LIBRARY_VERSION,
|
|
25
|
+
VERSION_INFO,
|
|
26
|
+
getAdcpVersion,
|
|
27
|
+
getCompatibleVersions,
|
|
28
|
+
getLibraryVersion,
|
|
29
|
+
isAdcpVersionAtLeast,
|
|
30
|
+
isCompatibleWith,
|
|
31
|
+
listBundledAdcpVersions,
|
|
32
|
+
parseAdcpMajorVersion,
|
|
33
|
+
resolveAdcpVersion,
|
|
34
|
+
sellerAdvertises31,
|
|
35
|
+
shouldOmit31Fields
|
|
36
|
+
};
|
package/dist/lib/index.d.mts
CHANGED
|
@@ -118,7 +118,7 @@ export type { Error as TaskErrorDetail } from './types/core.generated.mjs';
|
|
|
118
118
|
export { STANDARD_ERROR_CODES, isStandardErrorCode, getErrorRecovery, DEFAULT_UNKNOWN_ERROR_RECOVERY, } from './types/error-codes.mjs';
|
|
119
119
|
export type { StandardErrorCode, ErrorRecovery } from './types/error-codes.mjs';
|
|
120
120
|
export { adcpError, legacyCapabilitiesResponse, legacyProductsResponse, legacyMediaBuyResponse, legacyDeliveryResponse, legacyListAccountsResponse, legacyListCreativeFormatsResponse, legacyUpdateMediaBuyResponse, legacyGetMediaBuysResponse, legacyPerformanceFeedbackResponse, legacyBuildCreativeResponse, legacyBuildCreativeMultiResponse, legacyPreviewCreativeResponse, legacyCreativeDeliveryResponse, legacyListCreativesResponse, legacyListPropertyListsResponse, legacyListCollectionListsResponse, legacyListContentStandardsResponse, legacyGetPlanAuditLogsResponse, legacySyncCreativesResponse, legacyGetSignalsResponse, legacyActivateSignalResponse, legacyCancelMediaBuyResponse, legacyAcquireRightsResponse, legacyAcquireRightsAcquired, legacyAcquireRightsPendingApproval, legacyAcquireRightsRejected, legacySyncAccountsResponse, legacySyncGovernanceResponse, legacyReportUsageResponse, validActionsForStatus, MEDIA_BUY_TRANSITIONS, getMediaBuyTransitions, CREATIVE_ASSET_TRANSITIONS, isLegalMediaBuyTransition, isLegalCreativeTransition, assertMediaBuyTransition, assertCreativeTransition, getAccountMode, isSandboxOrMockAccount, assertSandboxAccount, taskToolResponse, registerAdcpTaskTool, createTaskCapableServer, InMemoryTaskStore, isTerminal, serve, taskScopeFromPrincipal, UnknownHostError, hostname, resolveHost, verifyIntrospection, registerTestController, handleTestControllerRequest, TestControllerError, toMcpResponse, TOOL_INPUT_SHAPE, CONTROLLER_SCENARIOS, DISCOVERY_ARM_SCENARIOS, REPORTING_SUBSCRIPTION_PROBE_SCENARIO, REPORTING_SUBSCRIPTION_PROBE_OPERATIONS, RESET_STATE_SCENARIO, reportingSubscriptionProbeParamsError, SEED_SCENARIOS, SESSION_ENTRY_CAP, enforceMapCap, createSeedFixtureCache, PostgresTaskStore, cleanupExpiredTasks, getMcpTasksMigration, MCP_TASKS_MIGRATION, ADCP_PRE_TRANSPORT, checkGovernance, governanceDeniedError, DEFAULT_REPORTING_CAPABILITIES, InMemoryStateStore, PostgresStateStore, getAdcpStateMigration, ADCP_STATE_MIGRATION, StateError, PatchConflictError, SESSION_KEY_FIELD, createSessionedStore, scopedStore, patchWithRetry, isPutIfMatchConflict, requireSessionKey, structuredSerialize, structuredDeserialize, createIdempotencyStore, memoryBackend, pgBackend, getIdempotencyMigration, IDEMPOTENCY_MIGRATION, cleanupExpiredIdempotency, redisBackend, createLazyBackend, hashPayload, IdempotencyClaimOwnershipError, getServeRequestContext, ADCP_SERVE_REQUEST_CONTEXT, createA2AAdapter, A2AInvocationError, MCP_APP_RESOURCE_MIME_TYPE, ADCP_MIRRORED_STRUCTURED_CONTENT_META_KEY, } from './server/index.mjs';
|
|
121
|
-
export type { AdcpErrorOptions, AdcpErrorResponse, McpToolResponse, ValidAction, CancelMediaBuyInput, AdcpTaskToolConfig, TaskStore, TaskMessageQueue, CreateTaskOptions, ToolTaskHandler, CreateTaskRequestHandlerExtra, TaskRequestHandlerExtra, CreateTaskResult, GetTaskResult, Task, ServeContext, ServeOptions, PgQueryable, PostgresTaskStoreOptions, ReportingSubscriptionProbeOperation, ReportingSubscriptionProbeParams, ReportingSubscriptionProbeSimulated, ReportingSubscriptionProbeSetAccountTimezoneResult, ReportingSubscriptionProbeTimezoneCutover, TestControllerStore, TestControllerStoreFactory, TestControllerStoreOrFactory, ControllerScenario, SeedScenario, SeedFixtureCache, SessionContext, OnInstructionsError, MaybePromise, LegacyAdcpServerConfig, LegacyAdcpToolMap, AdcpServerToolName, AdcpCapabilitiesConfig, LegacyAdcpCustomToolConfig, LegacyAdcpCustomToolHandler, LegacyAdcpCustomToolHandlerExtra, McpAppUiMeta, McpAppMeta, AdcpMcpResourceDefinition, McpAppResourceCsp, McpAppResourcePermissions, McpAppResourceUiMeta, McpAppResourceMeta, McpAppResourceReadContext, AdcpLogger, LegacyHandlerContext, LegacyMediaBuyHandlers, LegacySignalsHandlers, LegacyCreativeHandlers, LegacyGovernanceHandlers, LegacyAccountHandlers, LegacyEventTrackingHandlers, LegacySponsoredIntelligenceHandlers, SignedRequestsConfig, AdcpPreTransport, AdcpServer, AdcpServerTransport, AdcpTestRequest, AdcpTestToolsCallRequest, AdcpTestResponse, AdcpInvokeOptions, StructuredContentFallbackTransport, StructuredContentTextFallback, StructuredContentTextFallbackContext, CheckGovernanceOptions, GovernanceCallResult, GovernanceApproved, GovernanceDenied, GovernanceConditions, AdcpStateStore, ListOptions as StateListOptions, ListResult as StateListResult, PostgresStateStoreOptions, InMemoryStateStoreOptions, VersionedDocument, PutIfMatchResult, PatchWithRetryOptions, StateErrorCode, SessionKeyContext, IdempotencyStore, IdempotencyStoreConfig, IdempotencyBackend, IdempotencyCacheEntry, IdempotencyCheckResult, MemoryBackendOptions, PgBackendOptions, RedisBackendOptions, RedisBackendClient, RedisLikeClient, LazyBackendFactory, LazyBackendOptions, A2AAdapter, A2AAdapterOptions, A2AAgentCardOverrides, A2AAgentCapabilitiesOverride, A2AAgentSkillOverride, A2AMountOptions, ExpressAppLike, LegacyHttpSecurityScheme, LegacySecurityScheme, AccountMode, RequireCacheScopeWhenProducts, ServerPayload, GetProductsPayload, CreateMediaBuyPayload, UpdateMediaBuyPayload, GetMediaBuysPayload, GetMediaBuyDeliveryPayload, ListCreativesPayload, GetCreativeDeliveryPayload, CanonicalPreviewCreativePayload, PreviewCreativePayload, LegacyGetProductsPayload, LegacyCreateMediaBuyPayload, LegacyUpdateMediaBuyPayload, LegacyGetMediaBuysPayload, LegacyGetMediaBuyDeliveryPayload, LegacyListCreativesPayload, LegacyGetCreativeDeliveryPayload, LegacyListCreativeFormatsPayload, LegacyListCreativeFormatsResponsePayload, LegacyListCreativeFormatsServerPayload, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyBuildCreativeVariantPayload, LegacyPreviewCreativePayload, SyncCreativesPayload, SyncCreativesSuccessPayload, SyncCreativesErrorPayload, } from './server/index.mjs';
|
|
121
|
+
export type { AdcpErrorOptions, AdcpErrorResponse, AdcpMutationOutcome, McpToolResponse, ValidAction, CancelMediaBuyInput, AdcpTaskToolConfig, TaskStore, TaskMessageQueue, CreateTaskOptions, ToolTaskHandler, CreateTaskRequestHandlerExtra, TaskRequestHandlerExtra, CreateTaskResult, GetTaskResult, Task, ServeContext, ServeOptions, PgQueryable, PostgresTaskStoreOptions, ReportingSubscriptionProbeOperation, ReportingSubscriptionProbeParams, ReportingSubscriptionProbeSimulated, ReportingSubscriptionProbeSetAccountTimezoneResult, ReportingSubscriptionProbeTimezoneCutover, TestControllerStore, TestControllerStoreFactory, TestControllerStoreOrFactory, ControllerScenario, SeedScenario, SeedFixtureCache, SessionContext, OnInstructionsError, MaybePromise, LegacyAdcpServerConfig, LegacyAdcpToolMap, AdcpServerToolName, AdcpCapabilitiesConfig, LegacyAdcpCustomToolConfig, LegacyAdcpCustomToolHandler, LegacyAdcpCustomToolHandlerExtra, McpAppUiMeta, McpAppMeta, AdcpMcpResourceDefinition, McpAppResourceCsp, McpAppResourcePermissions, McpAppResourceUiMeta, McpAppResourceMeta, McpAppResourceReadContext, AdcpLogger, LegacyHandlerContext, LegacyMediaBuyHandlers, LegacySignalsHandlers, LegacyCreativeHandlers, LegacyGovernanceHandlers, LegacyAccountHandlers, LegacyEventTrackingHandlers, LegacySponsoredIntelligenceHandlers, SignedRequestsConfig, AdcpPreTransport, AdcpServer, AdcpServerTransport, AdcpTestRequest, AdcpTestToolsCallRequest, AdcpTestResponse, AdcpInvokeOptions, StructuredContentFallbackTransport, StructuredContentTextFallback, StructuredContentTextFallbackContext, CheckGovernanceOptions, GovernanceCallResult, GovernanceApproved, GovernanceDenied, GovernanceConditions, AdcpStateStore, ListOptions as StateListOptions, ListResult as StateListResult, PostgresStateStoreOptions, InMemoryStateStoreOptions, VersionedDocument, PutIfMatchResult, PatchWithRetryOptions, StateErrorCode, SessionKeyContext, IdempotencyStore, IdempotencyStoreConfig, IdempotencyBackend, IdempotencyCacheEntry, IdempotencyCheckResult, MemoryBackendOptions, PgBackendOptions, RedisBackendOptions, RedisBackendClient, RedisLikeClient, LazyBackendFactory, LazyBackendOptions, A2AAdapter, A2AAdapterOptions, A2AAgentCardOverrides, A2AAgentCapabilitiesOverride, A2AAgentSkillOverride, A2AMountOptions, ExpressAppLike, LegacyHttpSecurityScheme, LegacySecurityScheme, AccountMode, RequireCacheScopeWhenProducts, ServerPayload, GetProductsPayload, CreateMediaBuyPayload, UpdateMediaBuyPayload, GetMediaBuysPayload, GetMediaBuyDeliveryPayload, ListCreativesPayload, GetCreativeDeliveryPayload, CanonicalPreviewCreativePayload, PreviewCreativePayload, LegacyGetProductsPayload, LegacyCreateMediaBuyPayload, LegacyUpdateMediaBuyPayload, LegacyGetMediaBuysPayload, LegacyGetMediaBuyDeliveryPayload, LegacyListCreativesPayload, LegacyGetCreativeDeliveryPayload, LegacyListCreativeFormatsPayload, LegacyListCreativeFormatsResponsePayload, LegacyListCreativeFormatsServerPayload, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyBuildCreativeVariantPayload, LegacyPreviewCreativePayload, SyncCreativesPayload, SyncCreativesSuccessPayload, SyncCreativesErrorPayload, } from './server/index.mjs';
|
|
122
122
|
export { isRetryable, getRetryDelay } from './utils/retry.mjs';
|
|
123
123
|
export { decideRetry, BuyerRetryPolicy } from './utils/buyer-retry-policy.mjs';
|
|
124
124
|
export type { RetryDecision, RetryContext, RetryDecisionOverride } from './utils/buyer-retry-policy.mjs';
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -118,7 +118,7 @@ export type { Error as TaskErrorDetail } from './types/core.generated';
|
|
|
118
118
|
export { STANDARD_ERROR_CODES, isStandardErrorCode, getErrorRecovery, DEFAULT_UNKNOWN_ERROR_RECOVERY, } from './types/error-codes';
|
|
119
119
|
export type { StandardErrorCode, ErrorRecovery } from './types/error-codes';
|
|
120
120
|
export { adcpError, legacyCapabilitiesResponse, legacyProductsResponse, legacyMediaBuyResponse, legacyDeliveryResponse, legacyListAccountsResponse, legacyListCreativeFormatsResponse, legacyUpdateMediaBuyResponse, legacyGetMediaBuysResponse, legacyPerformanceFeedbackResponse, legacyBuildCreativeResponse, legacyBuildCreativeMultiResponse, legacyPreviewCreativeResponse, legacyCreativeDeliveryResponse, legacyListCreativesResponse, legacyListPropertyListsResponse, legacyListCollectionListsResponse, legacyListContentStandardsResponse, legacyGetPlanAuditLogsResponse, legacySyncCreativesResponse, legacyGetSignalsResponse, legacyActivateSignalResponse, legacyCancelMediaBuyResponse, legacyAcquireRightsResponse, legacyAcquireRightsAcquired, legacyAcquireRightsPendingApproval, legacyAcquireRightsRejected, legacySyncAccountsResponse, legacySyncGovernanceResponse, legacyReportUsageResponse, validActionsForStatus, MEDIA_BUY_TRANSITIONS, getMediaBuyTransitions, CREATIVE_ASSET_TRANSITIONS, isLegalMediaBuyTransition, isLegalCreativeTransition, assertMediaBuyTransition, assertCreativeTransition, getAccountMode, isSandboxOrMockAccount, assertSandboxAccount, taskToolResponse, registerAdcpTaskTool, createTaskCapableServer, InMemoryTaskStore, isTerminal, serve, taskScopeFromPrincipal, UnknownHostError, hostname, resolveHost, verifyIntrospection, registerTestController, handleTestControllerRequest, TestControllerError, toMcpResponse, TOOL_INPUT_SHAPE, CONTROLLER_SCENARIOS, DISCOVERY_ARM_SCENARIOS, REPORTING_SUBSCRIPTION_PROBE_SCENARIO, REPORTING_SUBSCRIPTION_PROBE_OPERATIONS, RESET_STATE_SCENARIO, reportingSubscriptionProbeParamsError, SEED_SCENARIOS, SESSION_ENTRY_CAP, enforceMapCap, createSeedFixtureCache, PostgresTaskStore, cleanupExpiredTasks, getMcpTasksMigration, MCP_TASKS_MIGRATION, ADCP_PRE_TRANSPORT, checkGovernance, governanceDeniedError, DEFAULT_REPORTING_CAPABILITIES, InMemoryStateStore, PostgresStateStore, getAdcpStateMigration, ADCP_STATE_MIGRATION, StateError, PatchConflictError, SESSION_KEY_FIELD, createSessionedStore, scopedStore, patchWithRetry, isPutIfMatchConflict, requireSessionKey, structuredSerialize, structuredDeserialize, createIdempotencyStore, memoryBackend, pgBackend, getIdempotencyMigration, IDEMPOTENCY_MIGRATION, cleanupExpiredIdempotency, redisBackend, createLazyBackend, hashPayload, IdempotencyClaimOwnershipError, getServeRequestContext, ADCP_SERVE_REQUEST_CONTEXT, createA2AAdapter, A2AInvocationError, MCP_APP_RESOURCE_MIME_TYPE, ADCP_MIRRORED_STRUCTURED_CONTENT_META_KEY, } from './server';
|
|
121
|
-
export type { AdcpErrorOptions, AdcpErrorResponse, McpToolResponse, ValidAction, CancelMediaBuyInput, AdcpTaskToolConfig, TaskStore, TaskMessageQueue, CreateTaskOptions, ToolTaskHandler, CreateTaskRequestHandlerExtra, TaskRequestHandlerExtra, CreateTaskResult, GetTaskResult, Task, ServeContext, ServeOptions, PgQueryable, PostgresTaskStoreOptions, ReportingSubscriptionProbeOperation, ReportingSubscriptionProbeParams, ReportingSubscriptionProbeSimulated, ReportingSubscriptionProbeSetAccountTimezoneResult, ReportingSubscriptionProbeTimezoneCutover, TestControllerStore, TestControllerStoreFactory, TestControllerStoreOrFactory, ControllerScenario, SeedScenario, SeedFixtureCache, SessionContext, OnInstructionsError, MaybePromise, LegacyAdcpServerConfig, LegacyAdcpToolMap, AdcpServerToolName, AdcpCapabilitiesConfig, LegacyAdcpCustomToolConfig, LegacyAdcpCustomToolHandler, LegacyAdcpCustomToolHandlerExtra, McpAppUiMeta, McpAppMeta, AdcpMcpResourceDefinition, McpAppResourceCsp, McpAppResourcePermissions, McpAppResourceUiMeta, McpAppResourceMeta, McpAppResourceReadContext, AdcpLogger, LegacyHandlerContext, LegacyMediaBuyHandlers, LegacySignalsHandlers, LegacyCreativeHandlers, LegacyGovernanceHandlers, LegacyAccountHandlers, LegacyEventTrackingHandlers, LegacySponsoredIntelligenceHandlers, SignedRequestsConfig, AdcpPreTransport, AdcpServer, AdcpServerTransport, AdcpTestRequest, AdcpTestToolsCallRequest, AdcpTestResponse, AdcpInvokeOptions, StructuredContentFallbackTransport, StructuredContentTextFallback, StructuredContentTextFallbackContext, CheckGovernanceOptions, GovernanceCallResult, GovernanceApproved, GovernanceDenied, GovernanceConditions, AdcpStateStore, ListOptions as StateListOptions, ListResult as StateListResult, PostgresStateStoreOptions, InMemoryStateStoreOptions, VersionedDocument, PutIfMatchResult, PatchWithRetryOptions, StateErrorCode, SessionKeyContext, IdempotencyStore, IdempotencyStoreConfig, IdempotencyBackend, IdempotencyCacheEntry, IdempotencyCheckResult, MemoryBackendOptions, PgBackendOptions, RedisBackendOptions, RedisBackendClient, RedisLikeClient, LazyBackendFactory, LazyBackendOptions, A2AAdapter, A2AAdapterOptions, A2AAgentCardOverrides, A2AAgentCapabilitiesOverride, A2AAgentSkillOverride, A2AMountOptions, ExpressAppLike, LegacyHttpSecurityScheme, LegacySecurityScheme, AccountMode, RequireCacheScopeWhenProducts, ServerPayload, GetProductsPayload, CreateMediaBuyPayload, UpdateMediaBuyPayload, GetMediaBuysPayload, GetMediaBuyDeliveryPayload, ListCreativesPayload, GetCreativeDeliveryPayload, CanonicalPreviewCreativePayload, PreviewCreativePayload, LegacyGetProductsPayload, LegacyCreateMediaBuyPayload, LegacyUpdateMediaBuyPayload, LegacyGetMediaBuysPayload, LegacyGetMediaBuyDeliveryPayload, LegacyListCreativesPayload, LegacyGetCreativeDeliveryPayload, LegacyListCreativeFormatsPayload, LegacyListCreativeFormatsResponsePayload, LegacyListCreativeFormatsServerPayload, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyBuildCreativeVariantPayload, LegacyPreviewCreativePayload, SyncCreativesPayload, SyncCreativesSuccessPayload, SyncCreativesErrorPayload, } from './server';
|
|
121
|
+
export type { AdcpErrorOptions, AdcpErrorResponse, AdcpMutationOutcome, McpToolResponse, ValidAction, CancelMediaBuyInput, AdcpTaskToolConfig, TaskStore, TaskMessageQueue, CreateTaskOptions, ToolTaskHandler, CreateTaskRequestHandlerExtra, TaskRequestHandlerExtra, CreateTaskResult, GetTaskResult, Task, ServeContext, ServeOptions, PgQueryable, PostgresTaskStoreOptions, ReportingSubscriptionProbeOperation, ReportingSubscriptionProbeParams, ReportingSubscriptionProbeSimulated, ReportingSubscriptionProbeSetAccountTimezoneResult, ReportingSubscriptionProbeTimezoneCutover, TestControllerStore, TestControllerStoreFactory, TestControllerStoreOrFactory, ControllerScenario, SeedScenario, SeedFixtureCache, SessionContext, OnInstructionsError, MaybePromise, LegacyAdcpServerConfig, LegacyAdcpToolMap, AdcpServerToolName, AdcpCapabilitiesConfig, LegacyAdcpCustomToolConfig, LegacyAdcpCustomToolHandler, LegacyAdcpCustomToolHandlerExtra, McpAppUiMeta, McpAppMeta, AdcpMcpResourceDefinition, McpAppResourceCsp, McpAppResourcePermissions, McpAppResourceUiMeta, McpAppResourceMeta, McpAppResourceReadContext, AdcpLogger, LegacyHandlerContext, LegacyMediaBuyHandlers, LegacySignalsHandlers, LegacyCreativeHandlers, LegacyGovernanceHandlers, LegacyAccountHandlers, LegacyEventTrackingHandlers, LegacySponsoredIntelligenceHandlers, SignedRequestsConfig, AdcpPreTransport, AdcpServer, AdcpServerTransport, AdcpTestRequest, AdcpTestToolsCallRequest, AdcpTestResponse, AdcpInvokeOptions, StructuredContentFallbackTransport, StructuredContentTextFallback, StructuredContentTextFallbackContext, CheckGovernanceOptions, GovernanceCallResult, GovernanceApproved, GovernanceDenied, GovernanceConditions, AdcpStateStore, ListOptions as StateListOptions, ListResult as StateListResult, PostgresStateStoreOptions, InMemoryStateStoreOptions, VersionedDocument, PutIfMatchResult, PatchWithRetryOptions, StateErrorCode, SessionKeyContext, IdempotencyStore, IdempotencyStoreConfig, IdempotencyBackend, IdempotencyCacheEntry, IdempotencyCheckResult, MemoryBackendOptions, PgBackendOptions, RedisBackendOptions, RedisBackendClient, RedisLikeClient, LazyBackendFactory, LazyBackendOptions, A2AAdapter, A2AAdapterOptions, A2AAgentCardOverrides, A2AAgentCapabilitiesOverride, A2AAgentSkillOverride, A2AMountOptions, ExpressAppLike, LegacyHttpSecurityScheme, LegacySecurityScheme, AccountMode, RequireCacheScopeWhenProducts, ServerPayload, GetProductsPayload, CreateMediaBuyPayload, UpdateMediaBuyPayload, GetMediaBuysPayload, GetMediaBuyDeliveryPayload, ListCreativesPayload, GetCreativeDeliveryPayload, CanonicalPreviewCreativePayload, PreviewCreativePayload, LegacyGetProductsPayload, LegacyCreateMediaBuyPayload, LegacyUpdateMediaBuyPayload, LegacyGetMediaBuysPayload, LegacyGetMediaBuyDeliveryPayload, LegacyListCreativesPayload, LegacyGetCreativeDeliveryPayload, LegacyListCreativeFormatsPayload, LegacyListCreativeFormatsResponsePayload, LegacyListCreativeFormatsServerPayload, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyBuildCreativeVariantPayload, LegacyPreviewCreativePayload, SyncCreativesPayload, SyncCreativesSuccessPayload, SyncCreativesErrorPayload, } from './server';
|
|
122
122
|
export { isRetryable, getRetryDelay } from './utils/retry';
|
|
123
123
|
export { decideRetry, BuyerRetryPolicy } from './utils/buyer-retry-policy';
|
|
124
124
|
export type { RetryDecision, RetryContext, RetryDecisionOverride } from './utils/buyer-retry-policy';
|
|
@@ -43,7 +43,7 @@ __export(action_contracts_exports, {
|
|
|
43
43
|
module.exports = __toCommonJS(action_contracts_exports);
|
|
44
44
|
var import_action_metadata = require('./action-metadata.generated.js');
|
|
45
45
|
var import_legacy_action_ids = require('./legacy-action-ids.js');
|
|
46
|
-
var
|
|
46
|
+
var import_valid_actions = require('./valid-actions.js');
|
|
47
47
|
var import_available_actions = require('./available-actions.js');
|
|
48
48
|
const NON_TERMINAL_ACTION_STATUSES = ["pending_creatives", "pending_start", "active", "paused"];
|
|
49
49
|
function isOperationalMediaBuyAction(action) {
|
|
@@ -81,10 +81,10 @@ function actionAllowedStatuses(term) {
|
|
|
81
81
|
if (term.allowed_statuses && !term.allowed_statuses.includes(status)) return false;
|
|
82
82
|
if (term.allowed_statuses) return true;
|
|
83
83
|
if (["pause", "resume", "cancel"].includes(term.action)) {
|
|
84
|
-
return (0,
|
|
84
|
+
return (0, import_valid_actions.validActionsForStatus)(status).includes(term.action);
|
|
85
85
|
}
|
|
86
86
|
const parent = (0, import_available_actions.getRollupParent)(term.action) ?? (["update_budget_allocation", "update_spend_target"].includes(term.action) ? "update_budget" : "update_packages");
|
|
87
|
-
const defaults = (0,
|
|
87
|
+
const defaults = (0, import_valid_actions.validActionsForStatus)(status);
|
|
88
88
|
return defaults.includes(term.action === "add_packages" ? term.action : parent);
|
|
89
89
|
});
|
|
90
90
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
LEGACY_AVAILABLE_ACTIONS
|
|
6
6
|
} from "./action-metadata.generated.mjs";
|
|
7
7
|
import { V3_1_ACTION_IDS } from "./legacy-action-ids.mjs";
|
|
8
|
-
import { validActionsForStatus } from "
|
|
8
|
+
import { validActionsForStatus } from "./valid-actions.mjs";
|
|
9
9
|
import { getRollupParent } from "./available-actions.mjs";
|
|
10
10
|
const NON_TERMINAL_ACTION_STATUSES = ["pending_creatives", "pending_start", "active", "paused"];
|
|
11
11
|
function isOperationalMediaBuyAction(action) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The package field that opts a package into the initial-start gate. */
|
|
2
|
+
export declare const CREATIVE_START_POLICY_FIELD = "start_requires_all_creatives_approved";
|
|
3
|
+
/** The capability a seller declares to accept `true`. */
|
|
4
|
+
export declare const CREATIVE_START_POLICY_FEATURE = "media_buy.features.creative_start_policy";
|
|
5
|
+
/** Field paths (`packages[N].start_requires_all_creatives_approved`) of every package that sets the policy to `true`. */
|
|
6
|
+
export declare function creativeStartPolicyOptInFields(params: unknown): string[];
|
|
7
|
+
/** Whether a `get_adcp_capabilities` response declares `media_buy.features.creative_start_policy: true`. */
|
|
8
|
+
export declare function declaresCreativeStartPolicy(capabilities: unknown): boolean;
|
|
9
|
+
/** Seller-side refusal of an opted-in `control_media_buy`, for `adcpError('UNSUPPORTED_FEATURE', ...)`. */
|
|
10
|
+
export declare function undeclaredCreativeStartPolicyRefusal(fields: readonly string[]): {
|
|
11
|
+
message: string;
|
|
12
|
+
field: string | undefined;
|
|
13
|
+
suggestion: string;
|
|
14
|
+
recovery: "correctable";
|
|
15
|
+
details: {
|
|
16
|
+
feature: string;
|
|
17
|
+
fields: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The package field that opts a package into the initial-start gate. */
|
|
2
|
+
export declare const CREATIVE_START_POLICY_FIELD = "start_requires_all_creatives_approved";
|
|
3
|
+
/** The capability a seller declares to accept `true`. */
|
|
4
|
+
export declare const CREATIVE_START_POLICY_FEATURE = "media_buy.features.creative_start_policy";
|
|
5
|
+
/** Field paths (`packages[N].start_requires_all_creatives_approved`) of every package that sets the policy to `true`. */
|
|
6
|
+
export declare function creativeStartPolicyOptInFields(params: unknown): string[];
|
|
7
|
+
/** Whether a `get_adcp_capabilities` response declares `media_buy.features.creative_start_policy: true`. */
|
|
8
|
+
export declare function declaresCreativeStartPolicy(capabilities: unknown): boolean;
|
|
9
|
+
/** Seller-side refusal of an opted-in `control_media_buy`, for `adcpError('UNSUPPORTED_FEATURE', ...)`. */
|
|
10
|
+
export declare function undeclaredCreativeStartPolicyRefusal(fields: readonly string[]): {
|
|
11
|
+
message: string;
|
|
12
|
+
field: string | undefined;
|
|
13
|
+
suggestion: string;
|
|
14
|
+
recovery: "correctable";
|
|
15
|
+
details: {
|
|
16
|
+
feature: string;
|
|
17
|
+
fields: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var creative_start_policy_exports = {};
|
|
20
|
+
__export(creative_start_policy_exports, {
|
|
21
|
+
CREATIVE_START_POLICY_FEATURE: () => CREATIVE_START_POLICY_FEATURE,
|
|
22
|
+
CREATIVE_START_POLICY_FIELD: () => CREATIVE_START_POLICY_FIELD,
|
|
23
|
+
creativeStartPolicyOptInFields: () => creativeStartPolicyOptInFields,
|
|
24
|
+
declaresCreativeStartPolicy: () => declaresCreativeStartPolicy,
|
|
25
|
+
undeclaredCreativeStartPolicyRefusal: () => undeclaredCreativeStartPolicyRefusal
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(creative_start_policy_exports);
|
|
28
|
+
const CREATIVE_START_POLICY_FIELD = "start_requires_all_creatives_approved";
|
|
29
|
+
const CREATIVE_START_POLICY_FEATURE = "media_buy.features.creative_start_policy";
|
|
30
|
+
const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
31
|
+
function creativeStartPolicyOptInFields(params) {
|
|
32
|
+
const packages = record(params) ? params.packages : void 0;
|
|
33
|
+
if (!Array.isArray(packages)) return [];
|
|
34
|
+
return packages.flatMap(
|
|
35
|
+
(pkg, index) => record(pkg) && pkg[CREATIVE_START_POLICY_FIELD] === true ? [`packages[${index}].${CREATIVE_START_POLICY_FIELD}`] : []
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function declaresCreativeStartPolicy(capabilities) {
|
|
39
|
+
const mediaBuy = record(capabilities) ? capabilities.media_buy : void 0;
|
|
40
|
+
const features = record(mediaBuy) ? mediaBuy.features : void 0;
|
|
41
|
+
return record(features) && features.creative_start_policy === true;
|
|
42
|
+
}
|
|
43
|
+
function undeclaredCreativeStartPolicyRefusal(fields) {
|
|
44
|
+
return {
|
|
45
|
+
message: `${CREATIVE_START_POLICY_FIELD}: true requires ${CREATIVE_START_POLICY_FEATURE}, which this seller does not declare`,
|
|
46
|
+
field: fields[0],
|
|
47
|
+
suggestion: `Omit ${CREATIVE_START_POLICY_FIELD} or send false; check ${CREATIVE_START_POLICY_FEATURE} in get_adcp_capabilities before opting in`,
|
|
48
|
+
recovery: "correctable",
|
|
49
|
+
details: { feature: CREATIVE_START_POLICY_FEATURE, fields: [...fields] }
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
CREATIVE_START_POLICY_FEATURE,
|
|
55
|
+
CREATIVE_START_POLICY_FIELD,
|
|
56
|
+
creativeStartPolicyOptInFields,
|
|
57
|
+
declaresCreativeStartPolicy,
|
|
58
|
+
undeclaredCreativeStartPolicyRefusal
|
|
59
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const CREATIVE_START_POLICY_FIELD = "start_requires_all_creatives_approved";
|
|
2
|
+
const CREATIVE_START_POLICY_FEATURE = "media_buy.features.creative_start_policy";
|
|
3
|
+
const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4
|
+
function creativeStartPolicyOptInFields(params) {
|
|
5
|
+
const packages = record(params) ? params.packages : void 0;
|
|
6
|
+
if (!Array.isArray(packages)) return [];
|
|
7
|
+
return packages.flatMap(
|
|
8
|
+
(pkg, index) => record(pkg) && pkg[CREATIVE_START_POLICY_FIELD] === true ? [`packages[${index}].${CREATIVE_START_POLICY_FIELD}`] : []
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
function declaresCreativeStartPolicy(capabilities) {
|
|
12
|
+
const mediaBuy = record(capabilities) ? capabilities.media_buy : void 0;
|
|
13
|
+
const features = record(mediaBuy) ? mediaBuy.features : void 0;
|
|
14
|
+
return record(features) && features.creative_start_policy === true;
|
|
15
|
+
}
|
|
16
|
+
function undeclaredCreativeStartPolicyRefusal(fields) {
|
|
17
|
+
return {
|
|
18
|
+
message: `${CREATIVE_START_POLICY_FIELD}: true requires ${CREATIVE_START_POLICY_FEATURE}, which this seller does not declare`,
|
|
19
|
+
field: fields[0],
|
|
20
|
+
suggestion: `Omit ${CREATIVE_START_POLICY_FIELD} or send false; check ${CREATIVE_START_POLICY_FEATURE} in get_adcp_capabilities before opting in`,
|
|
21
|
+
recovery: "correctable",
|
|
22
|
+
details: { feature: CREATIVE_START_POLICY_FEATURE, fields: [...fields] }
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
CREATIVE_START_POLICY_FEATURE,
|
|
27
|
+
CREATIVE_START_POLICY_FIELD,
|
|
28
|
+
creativeStartPolicyOptInFields,
|
|
29
|
+
declaresCreativeStartPolicy,
|
|
30
|
+
undeclaredCreativeStartPolicyRefusal
|
|
31
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media buy response helpers that eliminate common implementation traps.
|
|
3
|
+
*
|
|
4
|
+
* These helpers encode protocol rules (status→valid_actions mapping,
|
|
5
|
+
* required cancellation metadata, initial revision numbers) so agent
|
|
6
|
+
* builders get the right shape by default.
|
|
7
|
+
*/
|
|
8
|
+
import type { MediaBuyStatus, CanceledBy, Package } from '../types/core.generated.mjs';
|
|
9
|
+
import type { CreateMediaBuySuccess } from '../types/tools.generated.mjs';
|
|
10
|
+
/**
|
|
11
|
+
* Actions a buyer can perform on a media buy.
|
|
12
|
+
* Derived from the generated schema to stay in sync automatically.
|
|
13
|
+
*/
|
|
14
|
+
export type ValidAction = NonNullable<CreateMediaBuySuccess['valid_actions']>[number];
|
|
15
|
+
/**
|
|
16
|
+
* Returns the default set of valid buyer actions for a given media buy status.
|
|
17
|
+
*
|
|
18
|
+
* Terminal statuses (completed, rejected, canceled) return an empty array.
|
|
19
|
+
* Active statuses return the full set of actions; paused restricts to
|
|
20
|
+
* resume, cancel, and budget/date updates.
|
|
21
|
+
*
|
|
22
|
+
* Both pending statuses allow full modification — the protocol permits
|
|
23
|
+
* restructuring a buy (packages, budget, dates) while awaiting creatives
|
|
24
|
+
* or start date.
|
|
25
|
+
*
|
|
26
|
+
* Sellers with restricted capabilities can filter the result:
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const actions = validActionsForStatus('active')
|
|
29
|
+
* .filter(a => a !== 'sync_creatives'); // no creative management
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function validActionsForStatus(status: MediaBuyStatus): ValidAction[];
|
|
33
|
+
/**
|
|
34
|
+
* Input for cancelMediaBuyResponse(). Requires the fields that agent builders
|
|
35
|
+
* commonly forget — canceled_by and revision are mandatory,
|
|
36
|
+
* canceled_at defaults to now.
|
|
37
|
+
*/
|
|
38
|
+
export interface CancelMediaBuyInput {
|
|
39
|
+
media_buy_id: string;
|
|
40
|
+
canceled_by: CanceledBy;
|
|
41
|
+
/** Current revision after the cancellation update. */
|
|
42
|
+
revision: number;
|
|
43
|
+
reason?: string;
|
|
44
|
+
canceled_at?: string;
|
|
45
|
+
affected_packages?: Package[];
|
|
46
|
+
sandbox?: boolean;
|
|
47
|
+
}
|