@adcp/sdk 7.7.0 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -0
- package/bin/adcp.js +3 -1
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts +8 -0
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +15 -0
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/errors/index.d.ts +54 -0
- package/dist/lib/errors/index.d.ts.map +1 -1
- package/dist/lib/errors/index.js +132 -1
- package/dist/lib/errors/index.js.map +1 -1
- package/dist/lib/index.d.ts +6 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +39 -9
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/media-buy/available-actions.d.ts +60 -0
- package/dist/lib/media-buy/available-actions.d.ts.map +1 -0
- package/dist/lib/media-buy/available-actions.js +112 -0
- package/dist/lib/media-buy/available-actions.js.map +1 -0
- package/dist/lib/media-buy/index.d.ts +9 -0
- package/dist/lib/media-buy/index.d.ts.map +1 -0
- package/dist/lib/media-buy/index.js +36 -0
- package/dist/lib/media-buy/index.js.map +1 -0
- package/dist/lib/media-buy/preflight.d.ts +118 -0
- package/dist/lib/media-buy/preflight.d.ts.map +1 -0
- package/dist/lib/media-buy/preflight.js +376 -0
- package/dist/lib/media-buy/preflight.js.map +1 -0
- package/dist/lib/media-buy/types.d.ts +113 -0
- package/dist/lib/media-buy/types.d.ts.map +1 -0
- package/dist/lib/media-buy/types.js +25 -0
- package/dist/lib/media-buy/types.js.map +1 -0
- package/dist/lib/media-buy/update-fields.generated.d.ts +14 -0
- package/dist/lib/media-buy/update-fields.generated.d.ts.map +1 -0
- package/dist/lib/media-buy/update-fields.generated.js +137 -0
- package/dist/lib/media-buy/update-fields.generated.js.map +1 -0
- package/dist/lib/protocols/mcp.d.ts.map +1 -1
- package/dist/lib/protocols/mcp.js +63 -4
- package/dist/lib/protocols/mcp.js.map +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/ctx-metadata/backends/pg.d.ts +12 -3
- package/dist/lib/server/ctx-metadata/backends/pg.d.ts.map +1 -1
- package/dist/lib/server/ctx-metadata/backends/pg.js +59 -23
- package/dist/lib/server/ctx-metadata/backends/pg.js.map +1 -1
- package/dist/lib/server/ctx-metadata/backends/redis.d.ts +163 -0
- package/dist/lib/server/ctx-metadata/backends/redis.d.ts.map +1 -0
- package/dist/lib/server/ctx-metadata/backends/redis.js +204 -0
- package/dist/lib/server/ctx-metadata/backends/redis.js.map +1 -0
- package/dist/lib/server/ctx-metadata/index.d.ts +2 -0
- package/dist/lib/server/ctx-metadata/index.d.ts.map +1 -1
- package/dist/lib/server/ctx-metadata/index.js +3 -1
- package/dist/lib/server/ctx-metadata/index.js.map +1 -1
- package/dist/lib/server/decisioning/account.d.ts +27 -0
- package/dist/lib/server/decisioning/account.d.ts.map +1 -1
- package/dist/lib/server/decisioning/account.js.map +1 -1
- package/dist/lib/server/decisioning/context.d.ts +65 -0
- package/dist/lib/server/decisioning/context.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +59 -58
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/to-context.d.ts +1 -1
- package/dist/lib/server/decisioning/runtime/to-context.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/to-context.js +2 -1
- package/dist/lib/server/decisioning/runtime/to-context.js.map +1 -1
- package/dist/lib/server/idempotency/backends/redis.d.ts +171 -0
- package/dist/lib/server/idempotency/backends/redis.d.ts.map +1 -0
- package/dist/lib/server/idempotency/backends/redis.js +253 -0
- package/dist/lib/server/idempotency/backends/redis.js.map +1 -0
- package/dist/lib/server/idempotency/index.d.ts +2 -0
- package/dist/lib/server/idempotency/index.d.ts.map +1 -1
- package/dist/lib/server/idempotency/index.js +3 -1
- package/dist/lib/server/idempotency/index.js.map +1 -1
- package/dist/lib/server/idempotency/store.d.ts +44 -0
- package/dist/lib/server/idempotency/store.d.ts.map +1 -1
- package/dist/lib/server/idempotency/store.js.map +1 -1
- package/dist/lib/server/index.d.ts +4 -4
- package/dist/lib/server/index.d.ts.map +1 -1
- package/dist/lib/server/index.js +3 -1
- package/dist/lib/server/index.js.map +1 -1
- package/dist/lib/signing/jwks-helpers.d.ts +8 -1
- package/dist/lib/signing/jwks-helpers.d.ts.map +1 -1
- package/dist/lib/signing/jwks-helpers.js.map +1 -1
- package/dist/lib/signing/redis-replay-store.d.ts +180 -0
- package/dist/lib/signing/redis-replay-store.d.ts.map +1 -0
- package/dist/lib/signing/redis-replay-store.js +270 -0
- package/dist/lib/signing/redis-replay-store.js.map +1 -0
- package/dist/lib/signing/server.d.ts +1 -0
- package/dist/lib/signing/server.d.ts.map +1 -1
- package/dist/lib/signing/server.js +4 -2
- package/dist/lib/signing/server.js.map +1 -1
- package/dist/lib/signing/signer.d.ts +22 -1
- package/dist/lib/signing/signer.d.ts.map +1 -1
- package/dist/lib/signing/signer.js +5 -16
- package/dist/lib/signing/signer.js.map +1 -1
- package/dist/lib/signing/testing.d.ts +4 -3
- package/dist/lib/signing/testing.d.ts.map +1 -1
- package/dist/lib/signing/testing.js +6 -1
- package/dist/lib/signing/testing.js.map +1 -1
- package/dist/lib/testing/storyboard/agent-routing.d.ts +20 -3
- package/dist/lib/testing/storyboard/agent-routing.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/agent-routing.js +60 -10
- package/dist/lib/testing/storyboard/agent-routing.js.map +1 -1
- package/dist/lib/testing/storyboard/default-invariants.js +111 -59
- package/dist/lib/testing/storyboard/default-invariants.js.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +24 -10
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/grader.js +123 -29
- package/dist/lib/testing/storyboard/request-signing/grader.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +13 -0
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/types.d.ts +85 -2
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/types.js.map +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/validations.js +41 -22
- package/dist/lib/testing/storyboard/validations.js.map +1 -1
- package/dist/lib/utils/redis-default-prefix-warn.d.ts +60 -0
- package/dist/lib/utils/redis-default-prefix-warn.d.ts.map +1 -0
- package/dist/lib/utils/redis-default-prefix-warn.js +95 -0
- package/dist/lib/utils/redis-default-prefix-warn.js.map +1 -0
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/package.json +8 -2
|
@@ -1801,7 +1801,7 @@ function bucketWebhookError(msg) {
|
|
|
1801
1801
|
return 'UNKNOWN';
|
|
1802
1802
|
}
|
|
1803
1803
|
function makeCtxFor(ctxMetadataStore) {
|
|
1804
|
-
return handlerCtx => (0, to_context_1.buildRequestContext)(handlerCtx, ctxMetadataStore);
|
|
1804
|
+
return (handlerCtx, input) => (0, to_context_1.buildRequestContext)(handlerCtx, ctxMetadataStore, input);
|
|
1805
1805
|
}
|
|
1806
1806
|
/**
|
|
1807
1807
|
* Project a framework `HandlerContext` / `RequestContext` to the public
|
|
@@ -1821,11 +1821,12 @@ function makeCtxFor(ctxMetadataStore) {
|
|
|
1821
1821
|
* `authInfo` / `agent` keys absent rather than `undefined` — adopters
|
|
1822
1822
|
* can use `'authInfo' in ctx` as a presence check.
|
|
1823
1823
|
*/
|
|
1824
|
-
function toResolveCtx(ctx, toolName) {
|
|
1824
|
+
function toResolveCtx(ctx, toolName, input) {
|
|
1825
1825
|
return {
|
|
1826
1826
|
...(ctx.authInfo !== undefined && { authInfo: ctx.authInfo }),
|
|
1827
1827
|
toolName,
|
|
1828
1828
|
...(ctx.agent != null && { agent: ctx.agent }),
|
|
1829
|
+
...(input != null && { input }),
|
|
1829
1830
|
};
|
|
1830
1831
|
}
|
|
1831
1832
|
/**
|
|
@@ -2461,7 +2462,7 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2461
2462
|
return {
|
|
2462
2463
|
...((sales?.getProducts || proposalManager) && {
|
|
2463
2464
|
getProducts: async (params, ctx) => {
|
|
2464
|
-
const reqCtx = ctxFor(ctx);
|
|
2465
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2465
2466
|
// v1.5 seam: intercept refine[i].action='finalize' before
|
|
2466
2467
|
// dispatching to the manager / sales. When the framework
|
|
2467
2468
|
// commits the proposal inline, project the response directly.
|
|
@@ -2551,7 +2552,7 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2551
2552
|
}),
|
|
2552
2553
|
...(sales?.createMediaBuy && {
|
|
2553
2554
|
createMediaBuy: async (params, ctx) => {
|
|
2554
|
-
const reqCtx = ctxFor(ctx);
|
|
2555
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2555
2556
|
// Auto-hydrate: walk `params.packages`, attach the full Product object
|
|
2556
2557
|
// (including `ctx_metadata`) at `pkg.product`. Publisher reads
|
|
2557
2558
|
// `pkg.product.format_ids`, `pkg.product.ctx_metadata?.gam?.ad_unit_ids`
|
|
@@ -2628,7 +2629,7 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2628
2629
|
}),
|
|
2629
2630
|
...(sales?.updateMediaBuy && {
|
|
2630
2631
|
updateMediaBuy: async (params, ctx) => {
|
|
2631
|
-
const reqCtx = ctxFor(ctx);
|
|
2632
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2632
2633
|
// `media_buy_id` is required on the wire schema, but `validation: 'off'`
|
|
2633
2634
|
// mode skips the schema parse — guard at the seam so platform code can
|
|
2634
2635
|
// trust the value rather than re-checking. Also catches buyers calling
|
|
@@ -2700,7 +2701,7 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2700
2701
|
},
|
|
2701
2702
|
}),
|
|
2702
2703
|
syncCreatives: async (params, ctx) => {
|
|
2703
|
-
const reqCtx = ctxFor(ctx);
|
|
2704
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2704
2705
|
const creatives = params.creatives ?? [];
|
|
2705
2706
|
if (!sales?.syncCreatives) {
|
|
2706
2707
|
return (0, errors_1.adcpError)('UNSUPPORTED_FEATURE', {
|
|
@@ -2724,7 +2725,7 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2724
2725
|
},
|
|
2725
2726
|
...(sales?.getMediaBuyDelivery && {
|
|
2726
2727
|
getMediaBuyDelivery: async (params, ctx) => {
|
|
2727
|
-
const reqCtx = ctxFor(ctx);
|
|
2728
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2728
2729
|
// v1.5 seam: hydrate ctx.recipes for delivery reads. Per
|
|
2729
2730
|
// Resolutions §5, recipe-driven delivery aggregation needs the
|
|
2730
2731
|
// same recipe view the originating createMediaBuy used.
|
|
@@ -2767,7 +2768,7 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2767
2768
|
// `sales.getMediaBuys is not a function`.
|
|
2768
2769
|
...(sales?.getMediaBuys && {
|
|
2769
2770
|
getMediaBuys: async (params, ctx) => {
|
|
2770
|
-
const reqCtx = ctxFor(ctx);
|
|
2771
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2771
2772
|
return projectSync(async () => {
|
|
2772
2773
|
const result = await sales.getMediaBuys(params, reqCtx);
|
|
2773
2774
|
warnIfTruncatedMultiIdResponse('getMediaBuys', 'media_buy_ids', params.media_buy_ids, result?.media_buys, logger);
|
|
@@ -2779,7 +2780,7 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2779
2780
|
}),
|
|
2780
2781
|
...(sales?.providePerformanceFeedback && {
|
|
2781
2782
|
providePerformanceFeedback: async (params, ctx) => {
|
|
2782
|
-
const reqCtx = ctxFor(ctx);
|
|
2783
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2783
2784
|
// Auto-hydrate `req.media_buy` from the prior createMediaBuy /
|
|
2784
2785
|
// getMediaBuys store entry, plus `req.creative` when the buyer
|
|
2785
2786
|
// scoped feedback to a specific creative, plus `req.package`
|
|
@@ -2794,13 +2795,13 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2794
2795
|
}),
|
|
2795
2796
|
...(sales?.listCreativeFormats && {
|
|
2796
2797
|
listCreativeFormats: async (params, ctx) => {
|
|
2797
|
-
const reqCtx = ctxFor(ctx);
|
|
2798
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2798
2799
|
return projectSync(() => sales.listCreativeFormats(params, reqCtx), r => r);
|
|
2799
2800
|
},
|
|
2800
2801
|
}),
|
|
2801
2802
|
...(sales?.listCreatives && {
|
|
2802
2803
|
listCreatives: async (params, ctx) => {
|
|
2803
|
-
const reqCtx = ctxFor(ctx);
|
|
2804
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2804
2805
|
return projectSync(async () => {
|
|
2805
2806
|
const result = await sales.listCreatives(params, reqCtx);
|
|
2806
2807
|
warnIfTruncatedMultiIdResponse('listCreatives', 'creative_ids', params.creative_ids, result?.creatives, logger);
|
|
@@ -2846,7 +2847,7 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2846
2847
|
return undefined;
|
|
2847
2848
|
return {
|
|
2848
2849
|
buildCreative: async (params, ctx) => {
|
|
2849
|
-
const reqCtx = ctxFor(ctx);
|
|
2850
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2850
2851
|
return projectSync(() => creative.buildCreative(params, reqCtx), ret => projectBuildCreativeReturn(ret));
|
|
2851
2852
|
},
|
|
2852
2853
|
previewCreative: async (params, ctx) => {
|
|
@@ -2856,7 +2857,7 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2856
2857
|
'Add `previewCreative(req, ctx)` to your CreativeBuilderPlatform / CreativeAdServerPlatform literal.',
|
|
2857
2858
|
});
|
|
2858
2859
|
}
|
|
2859
|
-
const reqCtx = ctxFor(ctx);
|
|
2860
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2860
2861
|
return projectSync(() => creative.previewCreative(params, reqCtx), preview => preview);
|
|
2861
2862
|
},
|
|
2862
2863
|
// No-account tool — `list_creative_formats` request schema doesn't carry
|
|
@@ -2872,7 +2873,7 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2872
2873
|
'or delegate via `capabilities.creative_agents`.',
|
|
2873
2874
|
});
|
|
2874
2875
|
}
|
|
2875
|
-
const reqCtx = ctxFor(ctx);
|
|
2876
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2876
2877
|
return projectSync(() => creative.listCreativeFormats(params, reqCtx), r => r);
|
|
2877
2878
|
},
|
|
2878
2879
|
// Only register sync_creatives when the platform actually implements it.
|
|
@@ -2882,7 +2883,7 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2882
2883
|
// buildAccountHandlers — see comment at line 4544.
|
|
2883
2884
|
...(creative.syncCreatives != null && {
|
|
2884
2885
|
syncCreatives: async (params, ctx) => {
|
|
2885
|
-
const reqCtx = ctxFor(ctx);
|
|
2886
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2886
2887
|
const creatives = params.creatives ?? [];
|
|
2887
2888
|
return projectSync(async () => {
|
|
2888
2889
|
const push = extractPushConfig(params, logger, {
|
|
@@ -2910,7 +2911,7 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2910
2911
|
...('listCreatives' in creative &&
|
|
2911
2912
|
creative.listCreatives != null && {
|
|
2912
2913
|
listCreatives: async (params, ctx) => {
|
|
2913
|
-
const reqCtx = ctxFor(ctx);
|
|
2914
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2914
2915
|
return projectSync(async () => {
|
|
2915
2916
|
const result = await creative.listCreatives(params, reqCtx);
|
|
2916
2917
|
warnIfTruncatedMultiIdResponse('listCreatives', 'creative_ids', params.creative_ids, result?.creatives, logger);
|
|
@@ -2921,7 +2922,7 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2921
2922
|
...('getCreativeDelivery' in creative &&
|
|
2922
2923
|
creative.getCreativeDelivery != null && {
|
|
2923
2924
|
getCreativeDelivery: async (params, ctx) => {
|
|
2924
|
-
const reqCtx = ctxFor(ctx);
|
|
2925
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2925
2926
|
return projectSync(async () => {
|
|
2926
2927
|
const result = await creative.getCreativeDelivery(params, reqCtx);
|
|
2927
2928
|
warnIfTruncatedMultiIdResponse('getCreativeDelivery', 'creative_ids', params.creative_ids, result?.creative_deliveries, logger);
|
|
@@ -2944,26 +2945,26 @@ function buildEventTrackingHandlers(platform, ctxFor) {
|
|
|
2944
2945
|
const handlers = {};
|
|
2945
2946
|
if (audiences) {
|
|
2946
2947
|
handlers.syncAudiences = async (params, ctx) => {
|
|
2947
|
-
const reqCtx = ctxFor(ctx);
|
|
2948
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2948
2949
|
const audienceList = (params.audiences ?? []);
|
|
2949
2950
|
return projectSync(() => audiences.syncAudiences(audienceList, reqCtx), rows => ({ audiences: rows }));
|
|
2950
2951
|
};
|
|
2951
2952
|
}
|
|
2952
2953
|
if (sales?.syncCatalogs) {
|
|
2953
2954
|
handlers.syncCatalogs = async (params, ctx) => {
|
|
2954
|
-
const reqCtx = ctxFor(ctx);
|
|
2955
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2955
2956
|
return projectSync(() => sales.syncCatalogs(params, reqCtx), r => r);
|
|
2956
2957
|
};
|
|
2957
2958
|
}
|
|
2958
2959
|
if (sales?.logEvent) {
|
|
2959
2960
|
handlers.logEvent = async (params, ctx) => {
|
|
2960
|
-
const reqCtx = ctxFor(ctx);
|
|
2961
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2961
2962
|
return projectSync(() => sales.logEvent(params, reqCtx), r => r);
|
|
2962
2963
|
};
|
|
2963
2964
|
}
|
|
2964
2965
|
if (sales?.syncEventSources) {
|
|
2965
2966
|
handlers.syncEventSources = async (params, ctx) => {
|
|
2966
|
-
const reqCtx = ctxFor(ctx);
|
|
2967
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2967
2968
|
return projectSync(() => sales.syncEventSources(params, reqCtx), r => r);
|
|
2968
2969
|
};
|
|
2969
2970
|
}
|
|
@@ -2975,7 +2976,7 @@ function buildSignalsHandlers(platform, ctxFor, ctxMetadataStore, logger) {
|
|
|
2975
2976
|
return undefined;
|
|
2976
2977
|
return {
|
|
2977
2978
|
getSignals: async (params, ctx) => {
|
|
2978
|
-
const reqCtx = ctxFor(ctx);
|
|
2979
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2979
2980
|
return projectSync(async () => {
|
|
2980
2981
|
const result = await signals.getSignals(params, reqCtx);
|
|
2981
2982
|
// signal_ids is `SignalID[]` (`{source, data_provider_domain, id}`
|
|
@@ -2989,7 +2990,7 @@ function buildSignalsHandlers(platform, ctxFor, ctxMetadataStore, logger) {
|
|
|
2989
2990
|
}, r => r);
|
|
2990
2991
|
},
|
|
2991
2992
|
activateSignal: async (params, ctx) => {
|
|
2992
|
-
const reqCtx = ctxFor(ctx);
|
|
2993
|
+
const reqCtx = ctxFor(ctx, params);
|
|
2993
2994
|
// Auto-hydrate `req.signal` from the prior getSignals store entry —
|
|
2994
2995
|
// publisher reads pricing options, agent segment id, ctx_metadata
|
|
2995
2996
|
// directly without the buyer round-tripping the full signal object.
|
|
@@ -3022,11 +3023,11 @@ function buildSponsoredIntelligenceHandlers(platform, ctxFor, ctxMetadataStore,
|
|
|
3022
3023
|
return undefined;
|
|
3023
3024
|
return {
|
|
3024
3025
|
getOffering: async (params, ctx) => {
|
|
3025
|
-
const reqCtx = ctxFor(ctx);
|
|
3026
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3026
3027
|
return projectSync(() => si.getOffering(params, reqCtx), r => r);
|
|
3027
3028
|
},
|
|
3028
3029
|
initiateSession: async (params, ctx) => {
|
|
3029
|
-
const reqCtx = ctxFor(ctx);
|
|
3030
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3030
3031
|
return projectSync(async () => {
|
|
3031
3032
|
const result = await si.initiateSession(params, reqCtx);
|
|
3032
3033
|
// Auto-store the session record so subsequent `sendMessage` /
|
|
@@ -3073,7 +3074,7 @@ function buildSponsoredIntelligenceHandlers(platform, ctxFor, ctxMetadataStore,
|
|
|
3073
3074
|
}, r => r);
|
|
3074
3075
|
},
|
|
3075
3076
|
sendMessage: async (params, ctx) => {
|
|
3076
|
-
const reqCtx = ctxFor(ctx);
|
|
3077
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3077
3078
|
// Auto-hydrate `req.session` from the stored si_session record. The
|
|
3078
3079
|
// schema-driven hydrator reads `params.session_id` and attaches the
|
|
3079
3080
|
// stored session at `params.session` (via the `_id` → strip
|
|
@@ -3082,7 +3083,7 @@ function buildSponsoredIntelligenceHandlers(platform, ctxFor, ctxMetadataStore,
|
|
|
3082
3083
|
return projectSync(() => si.sendMessage(params, reqCtx), r => r);
|
|
3083
3084
|
},
|
|
3084
3085
|
terminateSession: async (params, ctx) => {
|
|
3085
|
-
const reqCtx = ctxFor(ctx);
|
|
3086
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3086
3087
|
await hydrateForTool(ctxMetadataStore, reqCtx.account?.id, 'si_terminate_session', params, logger);
|
|
3087
3088
|
return projectSync(async () => {
|
|
3088
3089
|
const result = await si.terminateSession(params, reqCtx);
|
|
@@ -3126,11 +3127,11 @@ function buildBrandRightsHandlers(platform, ctxFor, ctxMetadataStore, logger) {
|
|
|
3126
3127
|
return undefined;
|
|
3127
3128
|
return {
|
|
3128
3129
|
getBrandIdentity: async (params, ctx) => {
|
|
3129
|
-
const reqCtx = ctxFor(ctx);
|
|
3130
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3130
3131
|
return projectSync(() => br.getBrandIdentity(params, reqCtx), r => r);
|
|
3131
3132
|
},
|
|
3132
3133
|
getRights: async (params, ctx) => {
|
|
3133
|
-
const reqCtx = ctxFor(ctx);
|
|
3134
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3134
3135
|
return projectSync(async () => {
|
|
3135
3136
|
const result = await br.getRights(params, reqCtx);
|
|
3136
3137
|
// Auto-store rights offerings so subsequent acquire_rights can
|
|
@@ -3146,7 +3147,7 @@ function buildBrandRightsHandlers(platform, ctxFor, ctxMetadataStore, logger) {
|
|
|
3146
3147
|
// PendingApproval arm rides the buyer's `push_notification_config` webhook
|
|
3147
3148
|
// (the spec doesn't define a polling tool for `acquire_rights`).
|
|
3148
3149
|
acquireRights: async (params, ctx) => {
|
|
3149
|
-
const reqCtx = ctxFor(ctx);
|
|
3150
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3150
3151
|
// Auto-hydrate `req.rights` from the prior getRights catalog entry.
|
|
3151
3152
|
// Publisher reads selected pricing option + ctx_metadata directly.
|
|
3152
3153
|
// Schema-driven via `x-entity` (#1109); destination field stays at
|
|
@@ -3168,7 +3169,7 @@ function buildBrandRightsHandlers(platform, ctxFor, ctxMetadataStore, logger) {
|
|
|
3168
3169
|
// the immediate response carries `implementation_date: null` to
|
|
3169
3170
|
// signal pending state.
|
|
3170
3171
|
updateRights: async (params, ctx) => {
|
|
3171
|
-
const reqCtx = ctxFor(ctx);
|
|
3172
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3172
3173
|
await hydrateForTool(ctxMetadataStore, reqCtx.account?.id, 'update_rights', params, logger);
|
|
3173
3174
|
return projectSync(() => br.updateRights(params, reqCtx), r => r);
|
|
3174
3175
|
},
|
|
@@ -3184,100 +3185,100 @@ function buildGovernanceHandlers(platform, ctxFor) {
|
|
|
3184
3185
|
const handlers = {};
|
|
3185
3186
|
if (cg) {
|
|
3186
3187
|
handlers.checkGovernance = async (params, ctx) => {
|
|
3187
|
-
const reqCtx = ctxFor(ctx);
|
|
3188
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3188
3189
|
return projectSync(() => cg.checkGovernance(params, reqCtx), r => r);
|
|
3189
3190
|
};
|
|
3190
3191
|
handlers.syncPlans = async (params, ctx) => {
|
|
3191
|
-
const reqCtx = ctxFor(ctx);
|
|
3192
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3192
3193
|
return projectSync(() => cg.syncPlans(params, reqCtx), r => r);
|
|
3193
3194
|
};
|
|
3194
3195
|
handlers.reportPlanOutcome = async (params, ctx) => {
|
|
3195
|
-
const reqCtx = ctxFor(ctx);
|
|
3196
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3196
3197
|
return projectSync(() => cg.reportPlanOutcome(params, reqCtx), r => r);
|
|
3197
3198
|
};
|
|
3198
3199
|
handlers.getPlanAuditLogs = async (params, ctx) => {
|
|
3199
|
-
const reqCtx = ctxFor(ctx);
|
|
3200
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3200
3201
|
return projectSync(() => cg.getPlanAuditLogs(params, reqCtx), r => r);
|
|
3201
3202
|
};
|
|
3202
3203
|
}
|
|
3203
3204
|
if (pl) {
|
|
3204
3205
|
handlers.createPropertyList = async (params, ctx) => {
|
|
3205
|
-
const reqCtx = ctxFor(ctx);
|
|
3206
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3206
3207
|
return projectSync(() => pl.createPropertyList(params, reqCtx), r => r);
|
|
3207
3208
|
};
|
|
3208
3209
|
handlers.updatePropertyList = async (params, ctx) => {
|
|
3209
|
-
const reqCtx = ctxFor(ctx);
|
|
3210
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3210
3211
|
return projectSync(() => pl.updatePropertyList(params, reqCtx), r => r);
|
|
3211
3212
|
};
|
|
3212
3213
|
handlers.getPropertyList = async (params, ctx) => {
|
|
3213
|
-
const reqCtx = ctxFor(ctx);
|
|
3214
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3214
3215
|
return projectSync(() => pl.getPropertyList(params, reqCtx), r => r);
|
|
3215
3216
|
};
|
|
3216
3217
|
handlers.listPropertyLists = async (params, ctx) => {
|
|
3217
|
-
const reqCtx = ctxFor(ctx);
|
|
3218
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3218
3219
|
return projectSync(() => pl.listPropertyLists(params, reqCtx), r => r);
|
|
3219
3220
|
};
|
|
3220
3221
|
handlers.deletePropertyList = async (params, ctx) => {
|
|
3221
|
-
const reqCtx = ctxFor(ctx);
|
|
3222
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3222
3223
|
return projectSync(() => pl.deletePropertyList(params, reqCtx), r => r);
|
|
3223
3224
|
};
|
|
3224
3225
|
}
|
|
3225
3226
|
if (cl) {
|
|
3226
3227
|
handlers.createCollectionList = async (params, ctx) => {
|
|
3227
|
-
const reqCtx = ctxFor(ctx);
|
|
3228
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3228
3229
|
return projectSync(() => cl.createCollectionList(params, reqCtx), r => r);
|
|
3229
3230
|
};
|
|
3230
3231
|
handlers.updateCollectionList = async (params, ctx) => {
|
|
3231
|
-
const reqCtx = ctxFor(ctx);
|
|
3232
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3232
3233
|
return projectSync(() => cl.updateCollectionList(params, reqCtx), r => r);
|
|
3233
3234
|
};
|
|
3234
3235
|
handlers.getCollectionList = async (params, ctx) => {
|
|
3235
|
-
const reqCtx = ctxFor(ctx);
|
|
3236
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3236
3237
|
return projectSync(() => cl.getCollectionList(params, reqCtx), r => r);
|
|
3237
3238
|
};
|
|
3238
3239
|
handlers.listCollectionLists = async (params, ctx) => {
|
|
3239
|
-
const reqCtx = ctxFor(ctx);
|
|
3240
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3240
3241
|
return projectSync(() => cl.listCollectionLists(params, reqCtx), r => r);
|
|
3241
3242
|
};
|
|
3242
3243
|
handlers.deleteCollectionList = async (params, ctx) => {
|
|
3243
|
-
const reqCtx = ctxFor(ctx);
|
|
3244
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3244
3245
|
return projectSync(() => cl.deleteCollectionList(params, reqCtx), r => r);
|
|
3245
3246
|
};
|
|
3246
3247
|
}
|
|
3247
3248
|
if (cs) {
|
|
3248
3249
|
handlers.listContentStandards = async (params, ctx) => {
|
|
3249
|
-
const reqCtx = ctxFor(ctx);
|
|
3250
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3250
3251
|
return projectSync(() => cs.listContentStandards(params, reqCtx), r => r);
|
|
3251
3252
|
};
|
|
3252
3253
|
handlers.getContentStandards = async (params, ctx) => {
|
|
3253
|
-
const reqCtx = ctxFor(ctx);
|
|
3254
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3254
3255
|
return projectSync(() => cs.getContentStandards(params, reqCtx), r => r);
|
|
3255
3256
|
};
|
|
3256
3257
|
handlers.createContentStandards = async (params, ctx) => {
|
|
3257
|
-
const reqCtx = ctxFor(ctx);
|
|
3258
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3258
3259
|
return projectSync(() => cs.createContentStandards(params, reqCtx), r => r);
|
|
3259
3260
|
};
|
|
3260
3261
|
handlers.updateContentStandards = async (params, ctx) => {
|
|
3261
|
-
const reqCtx = ctxFor(ctx);
|
|
3262
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3262
3263
|
return projectSync(() => cs.updateContentStandards(params, reqCtx), r => r);
|
|
3263
3264
|
};
|
|
3264
3265
|
handlers.calibrateContent = async (params, ctx) => {
|
|
3265
|
-
const reqCtx = ctxFor(ctx);
|
|
3266
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3266
3267
|
return projectSync(() => cs.calibrateContent(params, reqCtx), r => r);
|
|
3267
3268
|
};
|
|
3268
3269
|
handlers.validateContentDelivery = async (params, ctx) => {
|
|
3269
|
-
const reqCtx = ctxFor(ctx);
|
|
3270
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3270
3271
|
return projectSync(() => cs.validateContentDelivery(params, reqCtx), r => r);
|
|
3271
3272
|
};
|
|
3272
3273
|
if (cs.getMediaBuyArtifacts) {
|
|
3273
3274
|
handlers.getMediaBuyArtifacts = async (params, ctx) => {
|
|
3274
|
-
const reqCtx = ctxFor(ctx);
|
|
3275
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3275
3276
|
return projectSync(() => cs.getMediaBuyArtifacts(params, reqCtx), r => r);
|
|
3276
3277
|
};
|
|
3277
3278
|
}
|
|
3278
3279
|
if (cs.getCreativeFeatures) {
|
|
3279
3280
|
handlers.getCreativeFeatures = async (params, ctx) => {
|
|
3280
|
-
const reqCtx = ctxFor(ctx);
|
|
3281
|
+
const reqCtx = ctxFor(ctx, params);
|
|
3281
3282
|
return projectSync(() => cs.getCreativeFeatures(params, reqCtx), r => r);
|
|
3282
3283
|
};
|
|
3283
3284
|
}
|
|
@@ -3300,21 +3301,21 @@ function buildAccountHandlers(platform, ctxFor) {
|
|
|
3300
3301
|
if (accounts.upsert) {
|
|
3301
3302
|
handlers.syncAccounts = async (params, ctx) => {
|
|
3302
3303
|
const refs = (params.accounts ?? []);
|
|
3303
|
-
const resolveCtx = toResolveCtx(ctx, 'sync_accounts');
|
|
3304
|
+
const resolveCtx = toResolveCtx(ctx, 'sync_accounts', params);
|
|
3304
3305
|
return projectSync(() => accounts.upsert(refs, resolveCtx), rows => ({ accounts: rows.map(account_1.toWireSyncAccountRow) }));
|
|
3305
3306
|
};
|
|
3306
3307
|
}
|
|
3307
3308
|
if (accounts.syncGovernance) {
|
|
3308
3309
|
handlers.syncGovernance = async (params, ctx) => {
|
|
3309
3310
|
const entries = params.accounts;
|
|
3310
|
-
const resolveCtx = toResolveCtx(ctx, 'sync_governance');
|
|
3311
|
+
const resolveCtx = toResolveCtx(ctx, 'sync_governance', params);
|
|
3311
3312
|
return projectSync(() => accounts.syncGovernance(entries, resolveCtx), rows => ({ accounts: rows.map(account_1.toWireSyncGovernanceRow) }));
|
|
3312
3313
|
};
|
|
3313
3314
|
}
|
|
3314
3315
|
if (accounts.list) {
|
|
3315
3316
|
handlers.listAccounts = async (params, ctx) => {
|
|
3316
3317
|
const filter = params;
|
|
3317
|
-
const resolveCtx = toResolveCtx(ctx, 'list_accounts');
|
|
3318
|
+
const resolveCtx = toResolveCtx(ctx, 'list_accounts', params);
|
|
3318
3319
|
// Wrap in projectSync so adopter `throw new AdcpError('PERMISSION_DENIED', ...)`
|
|
3319
3320
|
// from the list impl projects to the structured wire envelope rather
|
|
3320
3321
|
// than falling through to the framework's `SERVICE_UNAVAILABLE` mapping.
|
|
@@ -3326,7 +3327,7 @@ function buildAccountHandlers(platform, ctxFor) {
|
|
|
3326
3327
|
}
|
|
3327
3328
|
if (accounts.reportUsage) {
|
|
3328
3329
|
handlers.reportUsage = async (params, ctx) => {
|
|
3329
|
-
const resolveCtx = toResolveCtx(ctx, 'report_usage');
|
|
3330
|
+
const resolveCtx = toResolveCtx(ctx, 'report_usage', params);
|
|
3330
3331
|
return projectSync(() => accounts.reportUsage(params, resolveCtx), r => r);
|
|
3331
3332
|
};
|
|
3332
3333
|
}
|
|
@@ -3336,7 +3337,7 @@ function buildAccountHandlers(platform, ctxFor) {
|
|
|
3336
3337
|
// platform method runs. Adopters fronting an upstream platform read
|
|
3337
3338
|
// tokens / upstream IDs off `ctx.account.ctx_metadata` without
|
|
3338
3339
|
// having to re-resolve from `params.account`.
|
|
3339
|
-
const resolveCtx = toResolveCtx(ctx, 'get_account_financials');
|
|
3340
|
+
const resolveCtx = toResolveCtx(ctx, 'get_account_financials', params);
|
|
3340
3341
|
refuseInlineAccountIdWhenForbidden(accounts.resolution, params.account);
|
|
3341
3342
|
const resolved = await accounts.resolve(params.account, resolveCtx);
|
|
3342
3343
|
if (!resolved) {
|