@adcp/sdk 6.1.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/adapters/legacy/v2-5/create_media_buy.d.ts +4 -0
- package/dist/lib/adapters/legacy/v2-5/create_media_buy.d.ts.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/create_media_buy.js +10 -0
- package/dist/lib/adapters/legacy/v2-5/create_media_buy.js.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/get_products.d.ts +9 -0
- package/dist/lib/adapters/legacy/v2-5/get_products.d.ts.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/get_products.js +15 -0
- package/dist/lib/adapters/legacy/v2-5/get_products.js.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/index.d.ts +35 -0
- package/dist/lib/adapters/legacy/v2-5/index.d.ts.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/index.js +56 -0
- package/dist/lib/adapters/legacy/v2-5/index.js.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/list_creative_formats.d.ts +9 -0
- package/dist/lib/adapters/legacy/v2-5/list_creative_formats.d.ts.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/list_creative_formats.js +15 -0
- package/dist/lib/adapters/legacy/v2-5/list_creative_formats.js.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/preview_creative.d.ts +4 -0
- package/dist/lib/adapters/legacy/v2-5/preview_creative.d.ts.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/preview_creative.js +10 -0
- package/dist/lib/adapters/legacy/v2-5/preview_creative.js.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.ts +11 -0
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.ts.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.js +16 -0
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.js.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/types.d.ts +40 -0
- package/dist/lib/adapters/legacy/v2-5/types.d.ts.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/types.js +25 -0
- package/dist/lib/adapters/legacy/v2-5/types.js.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/update_media_buy.d.ts +4 -0
- package/dist/lib/adapters/legacy/v2-5/update_media_buy.d.ts.map +1 -0
- package/dist/lib/adapters/legacy/v2-5/update_media_buy.js +12 -0
- package/dist/lib/adapters/legacy/v2-5/update_media_buy.js.map +1 -0
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/ConversationTypes.d.ts +7 -0
- package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts +9 -14
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +96 -40
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/core/TaskExecutor.d.ts +5 -0
- package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
- package/dist/lib/core/TaskExecutor.js +12 -1
- package/dist/lib/core/TaskExecutor.js.map +1 -1
- package/dist/lib/errors/index.d.ts +30 -0
- package/dist/lib/errors/index.d.ts.map +1 -1
- package/dist/lib/errors/index.js +36 -1
- package/dist/lib/errors/index.js.map +1 -1
- package/dist/lib/index.d.ts +4 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +12 -8
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/protocols/a2a.d.ts.map +1 -1
- package/dist/lib/protocols/a2a.js +5 -1
- package/dist/lib/protocols/a2a.js.map +1 -1
- package/dist/lib/protocols/index.d.ts +53 -3
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +19 -8
- package/dist/lib/protocols/index.js.map +1 -1
- package/dist/lib/protocols/mcp.d.ts.map +1 -1
- package/dist/lib/protocols/mcp.js +13 -5
- package/dist/lib/protocols/mcp.js.map +1 -1
- package/dist/lib/protocols/responseSizeLimit.d.ts +25 -0
- package/dist/lib/protocols/responseSizeLimit.d.ts.map +1 -0
- package/dist/lib/protocols/responseSizeLimit.js +141 -0
- package/dist/lib/protocols/responseSizeLimit.js.map +1 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/decisioning/account.d.ts +84 -16
- 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/async-outcome.d.ts +16 -10
- package/dist/lib/server/decisioning/async-outcome.d.ts.map +1 -1
- package/dist/lib/server/decisioning/async-outcome.js +15 -56
- package/dist/lib/server/decisioning/async-outcome.js.map +1 -1
- package/dist/lib/server/decisioning/errors-typed.d.ts +10 -4
- package/dist/lib/server/decisioning/errors-typed.d.ts.map +1 -1
- package/dist/lib/server/decisioning/errors-typed.js +13 -29
- package/dist/lib/server/decisioning/errors-typed.js.map +1 -1
- package/dist/lib/server/decisioning/helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/helpers.js +0 -2
- package/dist/lib/server/decisioning/helpers.js.map +1 -1
- package/dist/lib/server/decisioning/index.d.ts +2 -2
- package/dist/lib/server/decisioning/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js +4 -1
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/manifest-helpers.js +0 -2
- package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +65 -12
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/start-time.d.ts.map +1 -1
- package/dist/lib/server/decisioning/start-time.js +0 -2
- package/dist/lib/server/decisioning/start-time.js.map +1 -1
- package/dist/lib/server/decisioning/tenant-registry.d.ts +99 -3
- package/dist/lib/server/decisioning/tenant-registry.d.ts.map +1 -1
- package/dist/lib/server/decisioning/tenant-registry.js +223 -0
- package/dist/lib/server/decisioning/tenant-registry.js.map +1 -1
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +46 -11
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/storyboard-tracks.js +22 -5
- package/dist/lib/testing/compliance/storyboard-tracks.js.map +1 -1
- package/dist/lib/testing/compliance/types.d.ts +21 -1
- package/dist/lib/testing/compliance/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/default-invariants.js +17 -0
- package/dist/lib/testing/storyboard/default-invariants.js.map +1 -1
- package/dist/lib/testing/storyboard/loader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/loader.js +41 -0
- package/dist/lib/testing/storyboard/loader.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +107 -17
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/types.d.ts +37 -0
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/types.js.map +1 -1
- package/dist/lib/types/error-codes.d.ts +196 -9
- package/dist/lib/types/error-codes.d.ts.map +1 -1
- package/dist/lib/types/error-codes.js +104 -26
- package/dist/lib/types/error-codes.js.map +1 -1
- package/dist/lib/types/v2-5/index.d.ts +2 -0
- package/dist/lib/types/v2-5/index.d.ts.map +1 -0
- package/dist/lib/types/v2-5/index.js +30 -0
- package/dist/lib/types/v2-5/index.js.map +1 -0
- package/dist/lib/types/v2-5/tools.generated.d.ts +3507 -0
- package/dist/lib/types/v2-5/tools.generated.d.ts.map +1 -0
- package/dist/lib/types/v2-5/tools.generated.js +6 -0
- package/dist/lib/types/v2-5/tools.generated.js.map +1 -0
- package/dist/lib/utils/buyer-retry-policy.d.ts +136 -0
- package/dist/lib/utils/buyer-retry-policy.d.ts.map +1 -0
- package/dist/lib/utils/buyer-retry-policy.js +247 -0
- package/dist/lib/utils/buyer-retry-policy.js.map +1 -0
- package/dist/lib/utils/sync-creatives-adapter.d.ts +18 -8
- package/dist/lib/utils/sync-creatives-adapter.d.ts.map +1 -1
- package/dist/lib/utils/sync-creatives-adapter.js +70 -17
- package/dist/lib/utils/sync-creatives-adapter.js.map +1 -1
- package/dist/lib/validation/client-hooks.d.ts +13 -8
- package/dist/lib/validation/client-hooks.d.ts.map +1 -1
- package/dist/lib/validation/client-hooks.js +12 -12
- package/dist/lib/validation/client-hooks.js.map +1 -1
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/docs/guides/BUILD-AN-AGENT.md +2 -0
- package/docs/llms.txt +39 -22
- package/examples/decisioning-platform-multi-tenant.ts +26 -4
- package/package.json +11 -1
- package/skills/build-seller-agent/SKILL.md +38 -5
- package/skills/build-seller-agent/specialisms/sales-guaranteed.md +4 -3
- package/skills/call-adcp-agent.previous/SKILL.md +83 -4
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
* Typed `AdcpError` subclasses. Adopters pick from a closed set of class
|
|
4
4
|
* imports rather than memorizing string codes + recovery semantics.
|
|
5
5
|
*
|
|
6
|
-
* Each class encodes the canonical `code` / `
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* class
|
|
6
|
+
* Each class encodes the canonical `code` / `field` / `suggestion` shape
|
|
7
|
+
* for its scenario. `recovery` is inherited from the spec via
|
|
8
|
+
* `getErrorRecovery(code)` — these classes never hardcode it. That keeps
|
|
9
|
+
* the typed-class hierarchy in lockstep with the canonical recovery
|
|
10
|
+
* classifications in `STANDARD_ERROR_CODES` (which derives from the
|
|
11
|
+
* generated `ErrorCodeValues`). When the spec rev changes a recovery
|
|
12
|
+
* value, every typed class picks it up automatically.
|
|
13
|
+
*
|
|
14
|
+
* LLM-generated platforms get autocomplete on the import; humans skim
|
|
15
|
+
* the list to find the right class for their case.
|
|
10
16
|
*
|
|
11
17
|
* Empirical baseline (Emma matrix v17, 2026-04-30): LLM-generated
|
|
12
18
|
* sellers throw generic `Error` because the AdcpError code catalog
|
|
@@ -27,13 +33,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
33
|
exports.PolicyViolationError = exports.GovernanceDeniedError = exports.ComplianceUnsatisfiedError = exports.UnsupportedFeatureError = exports.ServiceUnavailableError = exports.RateLimitedError = exports.PermissionDeniedError = exports.AuthRequiredError = exports.BackwardsTimeRangeError = exports.InvalidStateError = exports.InvalidRequestError = exports.IdempotencyConflictError = exports.BudgetExhaustedError = exports.BudgetTooLowError = exports.CreativeRejectedError = exports.ProductUnavailableError = exports.CreativeNotFoundError = exports.ProductNotFoundError = exports.MediaBuyNotFoundError = exports.PackageNotFoundError = void 0;
|
|
28
34
|
const async_outcome_1 = require("./async-outcome");
|
|
29
35
|
// ---------------------------------------------------------------------------
|
|
30
|
-
// Resource-not-found family
|
|
31
|
-
// with the same ID can't succeed. Buyer must fetch a fresh ID.
|
|
36
|
+
// Resource-not-found family.
|
|
32
37
|
// ---------------------------------------------------------------------------
|
|
33
38
|
class PackageNotFoundError extends async_outcome_1.AdcpError {
|
|
34
39
|
constructor(packageId, opts = {}) {
|
|
35
40
|
super('PACKAGE_NOT_FOUND', {
|
|
36
|
-
recovery: 'terminal',
|
|
37
41
|
message: opts.message ?? `Package not found: ${packageId}`,
|
|
38
42
|
field: 'package_id',
|
|
39
43
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -45,7 +49,6 @@ exports.PackageNotFoundError = PackageNotFoundError;
|
|
|
45
49
|
class MediaBuyNotFoundError extends async_outcome_1.AdcpError {
|
|
46
50
|
constructor(mediaBuyId, opts = {}) {
|
|
47
51
|
super('MEDIA_BUY_NOT_FOUND', {
|
|
48
|
-
recovery: 'terminal',
|
|
49
52
|
message: opts.message ?? `Media buy not found: ${mediaBuyId}`,
|
|
50
53
|
field: 'media_buy_id',
|
|
51
54
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -57,7 +60,6 @@ exports.MediaBuyNotFoundError = MediaBuyNotFoundError;
|
|
|
57
60
|
class ProductNotFoundError extends async_outcome_1.AdcpError {
|
|
58
61
|
constructor(productId, opts = {}) {
|
|
59
62
|
super('PRODUCT_NOT_FOUND', {
|
|
60
|
-
recovery: 'terminal',
|
|
61
63
|
message: opts.message ?? `Product not found: ${productId}`,
|
|
62
64
|
field: 'product_id',
|
|
63
65
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -69,7 +71,6 @@ exports.ProductNotFoundError = ProductNotFoundError;
|
|
|
69
71
|
class CreativeNotFoundError extends async_outcome_1.AdcpError {
|
|
70
72
|
constructor(creativeId, opts = {}) {
|
|
71
73
|
super('CREATIVE_NOT_FOUND', {
|
|
72
|
-
recovery: 'terminal',
|
|
73
74
|
message: opts.message ?? `Creative not found: ${creativeId}`,
|
|
74
75
|
field: 'creative_id',
|
|
75
76
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -82,16 +83,14 @@ exports.CreativeNotFoundError = CreativeNotFoundError;
|
|
|
82
83
|
// `Error` subclass for the framework's `accounts.resolve()` path (caught
|
|
83
84
|
// and translated internally). Adopters who need the wire-facing
|
|
84
85
|
// `ACCOUNT_NOT_FOUND` error code throw `new AdcpError('ACCOUNT_NOT_FOUND',
|
|
85
|
-
// {
|
|
86
|
+
// { message: '...', field: 'account.id' })` directly — recovery defaults
|
|
87
|
+
// to the spec value (`terminal`) via `getErrorRecovery`.
|
|
86
88
|
// ---------------------------------------------------------------------------
|
|
87
89
|
// Resource-unavailable family — id is right but state precludes use.
|
|
88
|
-
// `recovery: 'terminal'` for sold-out / unavailable; buyer needs to choose
|
|
89
|
-
// something else.
|
|
90
90
|
// ---------------------------------------------------------------------------
|
|
91
91
|
class ProductUnavailableError extends async_outcome_1.AdcpError {
|
|
92
92
|
constructor(productId, opts = {}) {
|
|
93
93
|
super('PRODUCT_UNAVAILABLE', {
|
|
94
|
-
recovery: 'terminal',
|
|
95
94
|
message: opts.message ?? `Product unavailable (sold out / no inventory): ${productId}`,
|
|
96
95
|
field: 'product_id',
|
|
97
96
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -103,7 +102,6 @@ exports.ProductUnavailableError = ProductUnavailableError;
|
|
|
103
102
|
class CreativeRejectedError extends async_outcome_1.AdcpError {
|
|
104
103
|
constructor(creativeId, reason, opts = {}) {
|
|
105
104
|
super('CREATIVE_REJECTED', {
|
|
106
|
-
recovery: 'terminal',
|
|
107
105
|
message: opts.message ?? `Creative ${creativeId} rejected: ${reason}`,
|
|
108
106
|
field: 'creative_id',
|
|
109
107
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -123,7 +121,6 @@ class BudgetTooLowError extends async_outcome_1.AdcpError {
|
|
|
123
121
|
? `Floor is ${opts.floor}.`
|
|
124
122
|
: 'Budget below required floor.';
|
|
125
123
|
super('BUDGET_TOO_LOW', {
|
|
126
|
-
recovery: 'correctable',
|
|
127
124
|
message: opts.message ?? floorStr,
|
|
128
125
|
field: 'total_budget',
|
|
129
126
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -135,7 +132,6 @@ exports.BudgetTooLowError = BudgetTooLowError;
|
|
|
135
132
|
class BudgetExhaustedError extends async_outcome_1.AdcpError {
|
|
136
133
|
constructor(opts = {}) {
|
|
137
134
|
super('BUDGET_EXHAUSTED', {
|
|
138
|
-
recovery: 'terminal',
|
|
139
135
|
message: opts.message ?? 'Budget exhausted.',
|
|
140
136
|
field: 'total_budget',
|
|
141
137
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -150,7 +146,6 @@ exports.BudgetExhaustedError = BudgetExhaustedError;
|
|
|
150
146
|
class IdempotencyConflictError extends async_outcome_1.AdcpError {
|
|
151
147
|
constructor(opts = {}) {
|
|
152
148
|
super('IDEMPOTENCY_CONFLICT', {
|
|
153
|
-
recovery: 'terminal',
|
|
154
149
|
message: opts.message ?? 'Same idempotency_key with different payload.',
|
|
155
150
|
field: 'idempotency_key',
|
|
156
151
|
suggestion: opts.suggestion ?? 'Use a fresh idempotency_key for the new payload.',
|
|
@@ -165,7 +160,6 @@ exports.IdempotencyConflictError = IdempotencyConflictError;
|
|
|
165
160
|
class InvalidRequestError extends async_outcome_1.AdcpError {
|
|
166
161
|
constructor(field, message, opts = {}) {
|
|
167
162
|
super('INVALID_REQUEST', {
|
|
168
|
-
recovery: 'correctable',
|
|
169
163
|
message,
|
|
170
164
|
field,
|
|
171
165
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -177,7 +171,6 @@ exports.InvalidRequestError = InvalidRequestError;
|
|
|
177
171
|
class InvalidStateError extends async_outcome_1.AdcpError {
|
|
178
172
|
constructor(field, message, opts = {}) {
|
|
179
173
|
super('INVALID_STATE', {
|
|
180
|
-
recovery: 'terminal',
|
|
181
174
|
message,
|
|
182
175
|
field,
|
|
183
176
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -193,7 +186,6 @@ exports.InvalidStateError = InvalidStateError;
|
|
|
193
186
|
class BackwardsTimeRangeError extends async_outcome_1.AdcpError {
|
|
194
187
|
constructor(opts = {}) {
|
|
195
188
|
super('INVALID_REQUEST', {
|
|
196
|
-
recovery: 'correctable',
|
|
197
189
|
message: opts.message ?? 'start_time must be before end_time.',
|
|
198
190
|
field: 'start_time',
|
|
199
191
|
suggestion: opts.suggestion ?? 'Verify the buyer-provided campaign window.',
|
|
@@ -208,7 +200,6 @@ exports.BackwardsTimeRangeError = BackwardsTimeRangeError;
|
|
|
208
200
|
class AuthRequiredError extends async_outcome_1.AdcpError {
|
|
209
201
|
constructor(opts = {}) {
|
|
210
202
|
super('AUTH_REQUIRED', {
|
|
211
|
-
recovery: 'terminal',
|
|
212
203
|
message: opts.message ?? 'Authentication required.',
|
|
213
204
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
214
205
|
...(opts.details !== undefined && { details: opts.details }),
|
|
@@ -219,7 +210,6 @@ exports.AuthRequiredError = AuthRequiredError;
|
|
|
219
210
|
class PermissionDeniedError extends async_outcome_1.AdcpError {
|
|
220
211
|
constructor(action, opts = {}) {
|
|
221
212
|
super('PERMISSION_DENIED', {
|
|
222
|
-
recovery: 'terminal',
|
|
223
213
|
message: opts.message ?? `Permission denied for ${action}.`,
|
|
224
214
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
225
215
|
details: { ...(opts.details ?? {}), action },
|
|
@@ -233,7 +223,6 @@ exports.PermissionDeniedError = PermissionDeniedError;
|
|
|
233
223
|
class RateLimitedError extends async_outcome_1.AdcpError {
|
|
234
224
|
constructor(retryAfterSeconds, opts = {}) {
|
|
235
225
|
super('RATE_LIMITED', {
|
|
236
|
-
recovery: 'transient',
|
|
237
226
|
message: opts.message ?? `Rate limited. Retry after ${retryAfterSeconds}s.`,
|
|
238
227
|
retry_after: Math.max(1, Math.min(3600, Math.floor(retryAfterSeconds))),
|
|
239
228
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -245,7 +234,6 @@ exports.RateLimitedError = RateLimitedError;
|
|
|
245
234
|
class ServiceUnavailableError extends async_outcome_1.AdcpError {
|
|
246
235
|
constructor(opts = {}) {
|
|
247
236
|
super('SERVICE_UNAVAILABLE', {
|
|
248
|
-
recovery: 'transient',
|
|
249
237
|
message: opts.message ?? 'Service temporarily unavailable.',
|
|
250
238
|
retry_after: opts.retryAfterSeconds != null ? Math.max(1, Math.min(3600, Math.floor(opts.retryAfterSeconds))) : 60,
|
|
251
239
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
@@ -257,7 +245,6 @@ exports.ServiceUnavailableError = ServiceUnavailableError;
|
|
|
257
245
|
class UnsupportedFeatureError extends async_outcome_1.AdcpError {
|
|
258
246
|
constructor(feature, opts = {}) {
|
|
259
247
|
super('UNSUPPORTED_FEATURE', {
|
|
260
|
-
recovery: 'terminal',
|
|
261
248
|
message: opts.message ?? `Feature not supported: ${feature}.`,
|
|
262
249
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
263
250
|
details: { ...(opts.details ?? {}), feature },
|
|
@@ -271,7 +258,6 @@ exports.UnsupportedFeatureError = UnsupportedFeatureError;
|
|
|
271
258
|
class ComplianceUnsatisfiedError extends async_outcome_1.AdcpError {
|
|
272
259
|
constructor(reason, opts = {}) {
|
|
273
260
|
super('COMPLIANCE_UNSATISFIED', {
|
|
274
|
-
recovery: 'terminal',
|
|
275
261
|
message: opts.message ?? `Compliance not satisfied: ${reason}`,
|
|
276
262
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
277
263
|
details: { ...(opts.details ?? {}), reason },
|
|
@@ -282,7 +268,6 @@ exports.ComplianceUnsatisfiedError = ComplianceUnsatisfiedError;
|
|
|
282
268
|
class GovernanceDeniedError extends async_outcome_1.AdcpError {
|
|
283
269
|
constructor(reason, opts = {}) {
|
|
284
270
|
super('GOVERNANCE_DENIED', {
|
|
285
|
-
recovery: 'terminal',
|
|
286
271
|
message: opts.message ?? `Governance denied: ${reason}`,
|
|
287
272
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
288
273
|
details: { ...(opts.details ?? {}), reason },
|
|
@@ -293,7 +278,6 @@ exports.GovernanceDeniedError = GovernanceDeniedError;
|
|
|
293
278
|
class PolicyViolationError extends async_outcome_1.AdcpError {
|
|
294
279
|
constructor(policy, opts = {}) {
|
|
295
280
|
super('POLICY_VIOLATION', {
|
|
296
|
-
recovery: 'terminal',
|
|
297
281
|
message: opts.message ?? `Policy violation: ${policy}`,
|
|
298
282
|
...(opts.suggestion !== undefined && { suggestion: opts.suggestion }),
|
|
299
283
|
details: { ...(opts.details ?? {}), policy },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-typed.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/errors-typed.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"errors-typed.js","sourceR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,IAAI,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;CAAE,GAC1D,SAAS,CAKX;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAChE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,SAAS,CAYX;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC"}
|
|
@@ -81,7 +81,6 @@ async function batchPoll(ids, lookup) {
|
|
|
81
81
|
*/
|
|
82
82
|
function validationError(message, opts) {
|
|
83
83
|
return new async_outcome_1.AdcpError((opts?.code ?? 'VALIDATION_ERROR'), {
|
|
84
|
-
recovery: 'correctable',
|
|
85
84
|
message,
|
|
86
85
|
...(opts?.field !== undefined && { field: opts.field }),
|
|
87
86
|
});
|
|
@@ -125,7 +124,6 @@ function upstreamError(prefix, e, extraDetails) {
|
|
|
125
124
|
const upstreamMsg = typeof e.message === 'string' && e.message.length > 0 ? e.message : 'upstream error';
|
|
126
125
|
const details = extraDetails !== undefined ? (0, pick_safe_details_1.pickSafeDetails)(extraDetails, Object.keys(extraDetails)) : undefined;
|
|
127
126
|
return new async_outcome_1.AdcpError(errorCode, {
|
|
128
|
-
recovery: 'transient',
|
|
129
127
|
message: `${prefix}: ${upstreamMsg}`,
|
|
130
128
|
...(isRateLimited && { retry_after: 60 }),
|
|
131
129
|
...(details !== undefined && { details }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAoCH,8BAiBC;AAyBD,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAoCH,8BAiBC;AAyBD,0CAQC;AAkCD,sCAgBC;AAtID,mDAA4D;AAC5D,4DAAuD;AAEvD,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,SAAS,CAC7B,GAAoB,EACpB,MAAkE;IAElE,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAC7B,GAAG,CAAC,GAAG,CAAC,KAAK,EAAC,EAAE,EAAC,EAAE;QACjB,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,EAAE,CAAC,CAAC;QAC3B,OAAO,CAAC,EAAE,EAAE,CAAC,CAAU,CAAC;IAC1B,CAAC,CAAC,CACH,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAgB,CAAC;IACvC,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,eAAe,CAC7B,OAAe,EACf,IAA2D;IAE3D,OAAO,IAAI,yBAAS,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,kBAAkB,CAAc,EAAE;QACpE,OAA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CursorRequest } from './pagination';
|
|
15
15
|
export { publishStatusChange, setStatusChangeBus, getStatusChangeBus, createInMemoryStatusChangeBus, type StatusChange, type StatusChangeBus, type StatusChangeResourceType, type StatusChangeListener, type PublishStatusChangeOpts, } from './status-changes';
|
|
16
16
|
export type { DecisioningCapabilities, CreativeAgentRef, TargetingCapabilities, ReportingCapabilities, } from './capabilities';
|
|
17
|
-
export type { Account, AuthPrincipal, AccountStore, AccountFilter, SyncAccountsResultRow, AdcpAccountStatus, ResolveContext, ResolvedAuthInfo, } from './account';
|
|
17
|
+
export type { Account, AuthPrincipal, AccountStore, AccountFilter, SyncAccountsResultRow, AdcpAccountStatus, ResolveContext, AccountToolContext, ResolvedAuthInfo, } from './account';
|
|
18
18
|
export { AccountNotFoundError, refAccountId } from './account';
|
|
19
19
|
export type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';
|
|
20
20
|
export { identityStatusMappers } from './status-mappers';
|
|
@@ -34,7 +34,7 @@ export { createAdcpServerFromPlatform, getAllAdcpMigrations, type CreateAdcpServ
|
|
|
34
34
|
export { PlatformConfigError, validatePlatform } from './runtime/validate-platform';
|
|
35
35
|
export { createInMemoryTaskRegistry, type TaskRegistry, type TaskRecord, type TaskStatus, } from './runtime/task-registry';
|
|
36
36
|
export { createPostgresTaskRegistry, getDecisioningTaskRegistryMigration, type CreatePostgresTaskRegistryOptions, type PgQueryable, } from './runtime/postgres-task-registry';
|
|
37
|
-
export { createTenantRegistry, createDefaultJwksValidator, type TenantRegistry, type TenantConfig, type TenantSigningKey, type TenantStatus, type TenantHealth, type TenantRegistryOptions, type JwksValidator, type JwksValidationResult, } from './tenant-registry';
|
|
37
|
+
export { createTenantRegistry, createDefaultJwksValidator, createSelfSignedTenantKey, createNoopJwksValidator, type TenantRegistry, type TenantConfig, type TenantSigningKey, type TenantStatus, type TenantHealth, type TenantRegistryOptions, type JwksValidator, type JwksValidationResult, } from './tenant-registry';
|
|
38
38
|
export { getAsset, requireAsset } from './manifest-helpers';
|
|
39
39
|
export { buildListCreativesResponse, type BuildListCreativesResponseOpts } from './list-helpers';
|
|
40
40
|
export { resolveStartTime, type ResolveStartTimeOptions } from './start-time';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAMtF,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO9D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,OAAO,EACP,aAAa,EACb,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,WAAW,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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAMtF,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO9D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,OAAO,EACP,aAAa,EACb,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG/D,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9G,OAAO,EAAE,qBAAqB,EAAE,MAAM,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
|
|
14
|
-
exports.
|
|
14
|
+
exports.buildProduct = exports.upstreamError = exports.validationError = exports.batchPoll = exports.mountTenantAdmin = exports.createTenantAdminHandlers = exports.createTenantAdminRouter = exports.resolveStartTime = exports.buildListCreativesResponse = exports.requireAsset = exports.getAsset = exports.createNoopJwksValidator = exports.createSelfSignedTenantKey = exports.createDefaultJwksValidator = exports.createTenantRegistry = exports.getDecisioningTaskRegistryMigration = exports.createPostgresTaskRegistry = exports.createInMemoryTaskRegistry = exports.validatePlatform = exports.PlatformConfigError = exports.getAllAdcpMigrations = exports.createAdcpServerFromPlatform = exports.identityStatusMappers = exports.refAccountId = exports.AccountNotFoundError = exports.createInMemoryStatusChangeBus = exports.getStatusChangeBus = exports.setStatusChangeBus = exports.publishStatusChange = exports.PolicyViolationError = exports.GovernanceDeniedError = exports.ComplianceUnsatisfiedError = exports.UnsupportedFeatureError = exports.ServiceUnavailableError = exports.RateLimitedError = exports.PermissionDeniedError = exports.AuthRequiredError = exports.BackwardsTimeRangeError = exports.InvalidStateError = exports.InvalidRequestError = exports.IdempotencyConflictError = exports.BudgetExhaustedError = exports.BudgetTooLowError = exports.CreativeRejectedError = exports.ProductUnavailableError = exports.CreativeNotFoundError = exports.ProductNotFoundError = exports.MediaBuyNotFoundError = exports.PackageNotFoundError = exports.AdcpError = void 0;
|
|
15
|
+
exports.buildPackage = exports.buildPricingOption = void 0;
|
|
15
16
|
// Adopter-facing structured-error primitive.
|
|
16
17
|
//
|
|
17
18
|
// `AdcpError` is the canonical throwable for structured rejection. Specialism
|
|
@@ -83,6 +84,8 @@ Object.defineProperty(exports, "getDecisioningTaskRegistryMigration", { enumerab
|
|
|
83
84
|
var tenant_registry_1 = require("./tenant-registry");
|
|
84
85
|
Object.defineProperty(exports, "createTenantRegistry", { enumerable: true, get: function () { return tenant_registry_1.createTenantRegistry; } });
|
|
85
86
|
Object.defineProperty(exports, "createDefaultJwksValidator", { enumerable: true, get: function () { return tenant_registry_1.createDefaultJwksValidator; } });
|
|
87
|
+
Object.defineProperty(exports, "createSelfSignedTenantKey", { enumerable: true, get: function () { return tenant_registry_1.createSelfSignedTenantKey; } });
|
|
88
|
+
Object.defineProperty(exports, "createNoopJwksValidator", { enumerable: true, get: function () { return tenant_registry_1.createNoopJwksValidator; } });
|
|
86
89
|
// Manifest helpers — typed accessors for creative_manifest.assets values.
|
|
87
90
|
// Save adopters from writing the same null-check + discriminator-check
|
|
88
91
|
// boilerplate per call.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;AAEH,6CAA6C;AAC7C,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,qCAAqC;AACrC,EAAE;AACF,yEAAyE;AACzE,yEAAyE;AACzE,yEAAyE;AACzE,oCAAoC;AACpC,iDAAsF;AAAnC,0GAAA,SAAS,OAAA;AAE5D,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,uDAAuD;AACvD,+CAqBwB;AApBtB,oHAAA,oBAAoB,OAAA;AACpB,qHAAA,qBAAqB,OAAA;AACrB,oHAAA,oBAAoB,OAAA;AACpB,qHAAA,qBAAqB,OAAA;AACrB,uHAAA,uBAAuB,OAAA;AACvB,qHAAA,qBAAqB,OAAA;AACrB,iHAAA,iBAAiB,OAAA;AACjB,oHAAA,oBAAoB,OAAA;AACpB,wHAAA,wBAAwB,OAAA;AACxB,mHAAA,mBAAmB,OAAA;AACnB,iHAAA,iBAAiB,OAAA;AACjB,uHAAA,uBAAuB,OAAA;AACvB,iHAAA,iBAAiB,OAAA;AACjB,qHAAA,qBAAqB,OAAA;AACrB,gHAAA,gBAAgB,OAAA;AAChB,uHAAA,uBAAuB,OAAA;AACvB,uH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HAAA,yBAAyB,OAAA;AACzB,gHAAA,gBAAgB,OAAA;AAKlB,6EAA6E;AAC7E,2EAA2E;AAC3E,qCAAsE;AAA7D,oGAAA,SAAS,OAAA;AAAE,0GAAA,eAAe,OAAA;AAAE,wGAAA,aAAa,OAAA;AAGlD,uEAAuE;AACvE,qEAAqE;AACrE,yEAAyE;AACzE,qCAAqC;AACrC,uDAAoF;AAA3E,gHAAA,YAAY,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AAAE,gHAAA,YAAY,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGpF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EAClD,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,GACX,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,SAAS,CAIvD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EACtD,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,EACZ,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"manifest-helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGpF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EAClD,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,GACX,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,SAAS,CAIvD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EACtD,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,EACZ,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,CAiB3C"}
|
|
@@ -60,14 +60,12 @@ function requireAsset(manifest, assetId, assetType, messageOverride) {
|
|
|
60
60
|
const asset = manifest?.assets?.[assetId];
|
|
61
61
|
if (!asset) {
|
|
62
62
|
throw new async_outcome_1.AdcpError('INVALID_REQUEST', {
|
|
63
|
-
recovery: 'correctable',
|
|
64
63
|
message: messageOverride ?? `creative_manifest.assets.${assetId} is required`,
|
|
65
64
|
field: `creative_manifest.assets.${assetId}`,
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
if (asset.asset_type !== assetType) {
|
|
69
68
|
throw new async_outcome_1.AdcpError('INVALID_REQUEST', {
|
|
70
|
-
recovery: 'correctable',
|
|
71
69
|
message: messageOverride ??
|
|
72
70
|
`creative_manifest.assets.${assetId} must be a ${assetType} asset (got asset_type='${asset.asset_type}')`,
|
|
73
71
|
field: `creative_manifest.assets.${assetId}.asset_type`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-helpers.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAyBH,4BAQC;AAiBD,
|
|
1
|
+
{"version":3,"file":"manifest-helpers.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAyBH,4BAQC;AAiBD,oCAsBC;AApED,mDAA4C;AAE5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,QAAQ,CACtB,QAAsC,EACtC,OAAe,EACf,SAAY;IAEZ,MAAM,KAAK,GAAG,QAAQ,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC/D,OAAO,KAAkD,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,YAAY,CAC1B,QAAsC,EACtC,OAAe,EACf,SAAY,EACZ,eAAwB;IAExB,MAAM,KAAK,GAAG,QAAQ,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,yBAAS,CAAC,iBAAiB,EAAE;YACrC,OAAO,EAAE,eAAe,IAAI,4BAA4B,OAAO,cAAc;YAC7E,KAAK,EAAE,4BAA4B,OAAO,EAAE;SAC7C,CAAC,CAAC;IACL,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,IAAI,yBAAS,CAAC,iBAAiB,EAAE;YACrC,OAAO,EACL,eAAe;gBACf,4BAA4B,OAAO,cAAc,SAAS,2BAA2B,KAAK,CAAC,UAAU,IAAI;YAC3G,KAAK,EAAE,4BAA4B,OAAO,aAAa;SACxD,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAkD,CAAC;AAC5D,CAAC"}
|
|
@@ -844,14 +844,64 @@ function buildDefaultTaskRegistry() {
|
|
|
844
844
|
}
|
|
845
845
|
return (0, task_registry_1.createInMemoryTaskRegistry)();
|
|
846
846
|
}
|
|
847
|
+
/**
|
|
848
|
+
* Run a platform method with reactive token refresh on `AUTH_REQUIRED`.
|
|
849
|
+
* Without a refresh fn (or no `refresh` at all) this passes the call
|
|
850
|
+
* through. With one, catches `AUTH_REQUIRED`, calls `refresh.fn`, mutates
|
|
851
|
+
* `account.authInfo.token` (and `expiresAt` if returned), and retries the
|
|
852
|
+
* inner call exactly once.
|
|
853
|
+
*
|
|
854
|
+
* Failure modes:
|
|
855
|
+
* - Refresh hook throws → re-throw `AUTH_REQUIRED` with `recovery: 'correctable'`
|
|
856
|
+
* so the buyer re-links via their UI.
|
|
857
|
+
* - Retried call throws `AUTH_REQUIRED` again → bubble out (don't refresh
|
|
858
|
+
* a second time).
|
|
859
|
+
*/
|
|
860
|
+
async function runWithTokenRefresh(fn, refresh) {
|
|
861
|
+
if (!refresh?.fn)
|
|
862
|
+
return fn();
|
|
863
|
+
try {
|
|
864
|
+
return await fn();
|
|
865
|
+
}
|
|
866
|
+
catch (err) {
|
|
867
|
+
if (!(err instanceof async_outcome_1.AdcpError) || err.code !== 'AUTH_REQUIRED') {
|
|
868
|
+
throw err;
|
|
869
|
+
}
|
|
870
|
+
let refreshed;
|
|
871
|
+
try {
|
|
872
|
+
refreshed = await refresh.fn(refresh.account, 'auth_required');
|
|
873
|
+
}
|
|
874
|
+
catch {
|
|
875
|
+
// Refresh-fn exception text is intentionally NOT echoed on the wire
|
|
876
|
+
// — upstream identity-provider error messages routinely embed
|
|
877
|
+
// refresh-token prefixes, internal hostnames, OAuth provider error
|
|
878
|
+
// codes, and stack-trace fragments. Adopters log details server-
|
|
879
|
+
// side; the buyer gets a fixed message + correctable recovery
|
|
880
|
+
// signaling they need to re-authorize.
|
|
881
|
+
throw new async_outcome_1.AdcpError('AUTH_REQUIRED', {
|
|
882
|
+
message: 'Token refresh failed; re-authentication required',
|
|
883
|
+
recovery: 'correctable',
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
refresh.account.authInfo.token = refreshed.token;
|
|
887
|
+
if (refreshed.expiresAt !== undefined) {
|
|
888
|
+
refresh.account.authInfo.expiresAt = refreshed.expiresAt;
|
|
889
|
+
}
|
|
890
|
+
return fn();
|
|
891
|
+
}
|
|
892
|
+
}
|
|
847
893
|
/**
|
|
848
894
|
* Project a sync platform call onto the wire dispatch shape. `AdcpError`
|
|
849
895
|
* throws → wire `adcp_error` envelope; other thrown errors bubble to the
|
|
850
896
|
* framework's `SERVICE_UNAVAILABLE` mapping.
|
|
897
|
+
*
|
|
898
|
+
* When `refresh` is provided and the call throws `AUTH_REQUIRED`, the
|
|
899
|
+
* framework calls `refresh.fn(refresh.account, 'auth_required')`, updates
|
|
900
|
+
* `account.authInfo.token`, and retries the platform method once.
|
|
851
901
|
*/
|
|
852
|
-
async function projectSync(fn, mapResult) {
|
|
902
|
+
async function projectSync(fn, mapResult, refresh) {
|
|
853
903
|
try {
|
|
854
|
-
const result = await fn
|
|
904
|
+
const result = await runWithTokenRefresh(fn, refresh);
|
|
855
905
|
const wire = mapResult(result);
|
|
856
906
|
// Single-chokepoint runtime strip: ctx_metadata MUST NEVER cross to the
|
|
857
907
|
// buyer. Defense-in-depth (compile-time WireShape<T> + runtime walk).
|
|
@@ -885,7 +935,6 @@ async function projectSync(fn, mapResult) {
|
|
|
885
935
|
return (0, errors_1.adcpError)('ACCOUNT_NOT_FOUND', {
|
|
886
936
|
message: 'Account not found',
|
|
887
937
|
field: 'account',
|
|
888
|
-
recovery: 'terminal',
|
|
889
938
|
});
|
|
890
939
|
}
|
|
891
940
|
throw err;
|
|
@@ -1519,7 +1568,6 @@ function extractPushConfig(params, _logger, opts = {}) {
|
|
|
1519
1568
|
throw new async_outcome_1.AdcpError('INVALID_REQUEST', {
|
|
1520
1569
|
message: `push_notification_config.url rejected: ${validation.reason}`,
|
|
1521
1570
|
field: 'push_notification_config.url',
|
|
1522
|
-
recovery: 'terminal',
|
|
1523
1571
|
});
|
|
1524
1572
|
}
|
|
1525
1573
|
url = rawUrl;
|
|
@@ -1531,7 +1579,6 @@ function extractPushConfig(params, _logger, opts = {}) {
|
|
|
1531
1579
|
throw new async_outcome_1.AdcpError('INVALID_REQUEST', {
|
|
1532
1580
|
message: `push_notification_config.token rejected: ${validation.reason}`,
|
|
1533
1581
|
field: 'push_notification_config.token',
|
|
1534
|
-
recovery: 'terminal',
|
|
1535
1582
|
});
|
|
1536
1583
|
}
|
|
1537
1584
|
token = rawToken;
|
|
@@ -1719,7 +1766,6 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
1719
1766
|
return (0, errors_1.adcpError)('INVALID_REQUEST', {
|
|
1720
1767
|
message: 'update_media_buy requires media_buy_id',
|
|
1721
1768
|
field: 'media_buy_id',
|
|
1722
|
-
recovery: 'correctable',
|
|
1723
1769
|
});
|
|
1724
1770
|
}
|
|
1725
1771
|
// Auto-hydrate: attach the full MediaBuy (wire shape + ctx_metadata)
|
|
@@ -1761,7 +1807,6 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
1761
1807
|
if (!sales.syncCreatives) {
|
|
1762
1808
|
return (0, errors_1.adcpError)('UNSUPPORTED_FEATURE', {
|
|
1763
1809
|
message: 'sync_creatives not supported by this sales platform',
|
|
1764
|
-
recovery: 'terminal',
|
|
1765
1810
|
});
|
|
1766
1811
|
}
|
|
1767
1812
|
return projectSync(async () => {
|
|
@@ -1880,7 +1925,6 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
1880
1925
|
if (!('previewCreative' in creative)) {
|
|
1881
1926
|
return (0, errors_1.adcpError)('UNSUPPORTED_FEATURE', {
|
|
1882
1927
|
message: 'preview_creative not supported by this platform',
|
|
1883
|
-
recovery: 'terminal',
|
|
1884
1928
|
});
|
|
1885
1929
|
}
|
|
1886
1930
|
const reqCtx = ctxFor(ctx);
|
|
@@ -1892,7 +1936,6 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
1892
1936
|
if (!creative.syncCreatives) {
|
|
1893
1937
|
return (0, errors_1.adcpError)('UNSUPPORTED_FEATURE', {
|
|
1894
1938
|
message: 'sync_creatives not supported by this creative platform',
|
|
1895
|
-
recovery: 'terminal',
|
|
1896
1939
|
});
|
|
1897
1940
|
}
|
|
1898
1941
|
return projectSync(async () => {
|
|
@@ -1917,7 +1960,6 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
1917
1960
|
if (!('listCreatives' in creative)) {
|
|
1918
1961
|
return (0, errors_1.adcpError)('UNSUPPORTED_FEATURE', {
|
|
1919
1962
|
message: 'list_creatives not supported by this platform',
|
|
1920
|
-
recovery: 'terminal',
|
|
1921
1963
|
});
|
|
1922
1964
|
}
|
|
1923
1965
|
const reqCtx = ctxFor(ctx);
|
|
@@ -1927,7 +1969,6 @@ function buildCreativeHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
1927
1969
|
if (!('getCreativeDelivery' in creative)) {
|
|
1928
1970
|
return (0, errors_1.adcpError)('UNSUPPORTED_FEATURE', {
|
|
1929
1971
|
message: 'get_creative_delivery not supported by this platform',
|
|
1930
|
-
recovery: 'terminal',
|
|
1931
1972
|
});
|
|
1932
1973
|
}
|
|
1933
1974
|
const reqCtx = ctxFor(ctx);
|
|
@@ -2184,11 +2225,23 @@ function buildAccountHandlers(platform, ctxFor) {
|
|
|
2184
2225
|
}
|
|
2185
2226
|
if (accounts.getAccountFinancials) {
|
|
2186
2227
|
handlers.getAccountFinancials = async (params, ctx) => {
|
|
2228
|
+
// Resolve the account first so `ctx.account` is populated when the
|
|
2229
|
+
// platform method runs. Adopters fronting an upstream platform read
|
|
2230
|
+
// tokens / upstream IDs off `ctx.account.ctx_metadata` without
|
|
2231
|
+
// having to re-resolve from `params.account`.
|
|
2187
2232
|
const resolveCtx = {
|
|
2188
2233
|
...(ctx.authInfo !== undefined && { authInfo: ctx.authInfo }),
|
|
2189
2234
|
toolName: 'get_account_financials',
|
|
2190
2235
|
};
|
|
2191
|
-
|
|
2236
|
+
const resolved = await accounts.resolve(params.account, resolveCtx);
|
|
2237
|
+
if (!resolved) {
|
|
2238
|
+
throw new async_outcome_1.AdcpError('ACCOUNT_NOT_FOUND', {
|
|
2239
|
+
message: 'Account not found',
|
|
2240
|
+
recovery: 'terminal',
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
const toolCtx = { ...resolveCtx, account: resolved };
|
|
2244
|
+
return projectSync(() => accounts.getAccountFinancials(params, toolCtx), r => r, accounts.refreshToken ? { account: resolved, fn: accounts.refreshToken.bind(accounts) } : undefined);
|
|
2192
2245
|
};
|
|
2193
2246
|
}
|
|
2194
2247
|
return handlers;
|