@adcp/sdk 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/adapters/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/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/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 +0 -9
- 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/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/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,24 +3,212 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Sellers MAY use codes not in this vocabulary for platform-specific errors.
|
|
5
5
|
* Agents MUST handle unknown codes by falling back to the recovery classification.
|
|
6
|
+
*
|
|
7
|
+
* The `StandardErrorCode` union is derived from `ErrorCodeValues` in
|
|
8
|
+
* `enums.generated.ts` (auto-generated from `schemas/cache/{version}/enums/error-code.json`).
|
|
9
|
+
* The runtime lookup table `STANDARD_ERROR_CODES` is asserted complete via
|
|
10
|
+
* `satisfies Record<StandardErrorCode, ErrorCodeInfo>` — adding a code to the
|
|
11
|
+
* spec without filling in a description and recovery will fail typecheck.
|
|
6
12
|
*/
|
|
13
|
+
import { ErrorCodeValues } from './enums.generated';
|
|
7
14
|
export type ErrorRecovery = 'transient' | 'correctable' | 'terminal';
|
|
8
15
|
/**
|
|
9
16
|
* Standard error codes defined in the AdCP specification.
|
|
10
17
|
* Use these for type-safe error handling in agent recovery logic.
|
|
11
18
|
*/
|
|
12
|
-
export type StandardErrorCode =
|
|
13
|
-
interface ErrorCodeInfo {
|
|
14
|
-
description: string;
|
|
15
|
-
recovery: ErrorRecovery;
|
|
16
|
-
}
|
|
19
|
+
export type StandardErrorCode = (typeof ErrorCodeValues)[number];
|
|
17
20
|
/**
|
|
18
|
-
* Runtime lookup table for the
|
|
21
|
+
* Runtime lookup table for the standard AdCP error codes.
|
|
19
22
|
* Each entry includes a description and the recommended recovery strategy.
|
|
23
|
+
*
|
|
24
|
+
* Recovery classifications mirror the spec's `enumDescriptions` block in
|
|
25
|
+
* `error-code.json`. Descriptions are condensed to the first-sentence summary;
|
|
26
|
+
* agents needing the full prescriptive text should consult the schema directly.
|
|
20
27
|
*/
|
|
21
|
-
export declare const STANDARD_ERROR_CODES:
|
|
28
|
+
export declare const STANDARD_ERROR_CODES: {
|
|
29
|
+
readonly INVALID_REQUEST: {
|
|
30
|
+
readonly description: "Request is malformed, missing required fields, or violates schema constraints";
|
|
31
|
+
readonly recovery: "correctable";
|
|
32
|
+
};
|
|
33
|
+
readonly AUTH_REQUIRED: {
|
|
34
|
+
readonly description: "Authentication is required to access this resource";
|
|
35
|
+
readonly recovery: "correctable";
|
|
36
|
+
};
|
|
37
|
+
readonly RATE_LIMITED: {
|
|
38
|
+
readonly description: "Request rate exceeded; retry after the retry_after interval";
|
|
39
|
+
readonly recovery: "transient";
|
|
40
|
+
};
|
|
41
|
+
readonly SERVICE_UNAVAILABLE: {
|
|
42
|
+
readonly description: "Seller service is temporarily unavailable";
|
|
43
|
+
readonly recovery: "transient";
|
|
44
|
+
};
|
|
45
|
+
readonly POLICY_VIOLATION: {
|
|
46
|
+
readonly description: "Request violates the seller's content or advertising policies";
|
|
47
|
+
readonly recovery: "correctable";
|
|
48
|
+
};
|
|
49
|
+
readonly PRODUCT_NOT_FOUND: {
|
|
50
|
+
readonly description: "One or more referenced product IDs are unknown or expired";
|
|
51
|
+
readonly recovery: "correctable";
|
|
52
|
+
};
|
|
53
|
+
readonly PRODUCT_UNAVAILABLE: {
|
|
54
|
+
readonly description: "The requested product is sold out or no longer available";
|
|
55
|
+
readonly recovery: "correctable";
|
|
56
|
+
};
|
|
57
|
+
readonly PROPOSAL_EXPIRED: {
|
|
58
|
+
readonly description: "A referenced proposal ID has passed its expires_at timestamp";
|
|
59
|
+
readonly recovery: "correctable";
|
|
60
|
+
};
|
|
61
|
+
readonly BUDGET_TOO_LOW: {
|
|
62
|
+
readonly description: "Budget is below the seller's minimum";
|
|
63
|
+
readonly recovery: "correctable";
|
|
64
|
+
};
|
|
65
|
+
readonly CREATIVE_REJECTED: {
|
|
66
|
+
readonly description: "Creative failed content policy review";
|
|
67
|
+
readonly recovery: "correctable";
|
|
68
|
+
};
|
|
69
|
+
readonly UNSUPPORTED_FEATURE: {
|
|
70
|
+
readonly description: "A requested feature or field is not supported by this seller";
|
|
71
|
+
readonly recovery: "correctable";
|
|
72
|
+
};
|
|
73
|
+
readonly AUDIENCE_TOO_SMALL: {
|
|
74
|
+
readonly description: "Audience segment is below the minimum required size for targeting";
|
|
75
|
+
readonly recovery: "correctable";
|
|
76
|
+
};
|
|
77
|
+
readonly ACCOUNT_NOT_FOUND: {
|
|
78
|
+
readonly description: "The account reference could not be resolved";
|
|
79
|
+
readonly recovery: "terminal";
|
|
80
|
+
};
|
|
81
|
+
readonly ACCOUNT_SETUP_REQUIRED: {
|
|
82
|
+
readonly description: "Natural key resolved but the account needs setup before use";
|
|
83
|
+
readonly recovery: "correctable";
|
|
84
|
+
};
|
|
85
|
+
readonly ACCOUNT_AMBIGUOUS: {
|
|
86
|
+
readonly description: "Natural key resolves to multiple accounts";
|
|
87
|
+
readonly recovery: "correctable";
|
|
88
|
+
};
|
|
89
|
+
readonly ACCOUNT_PAYMENT_REQUIRED: {
|
|
90
|
+
readonly description: "Account has an outstanding balance requiring payment before new buys";
|
|
91
|
+
readonly recovery: "terminal";
|
|
92
|
+
};
|
|
93
|
+
readonly ACCOUNT_SUSPENDED: {
|
|
94
|
+
readonly description: "Account has been suspended";
|
|
95
|
+
readonly recovery: "terminal";
|
|
96
|
+
};
|
|
97
|
+
readonly COMPLIANCE_UNSATISFIED: {
|
|
98
|
+
readonly description: "A required disclosure from the brief's compliance section cannot be satisfied by the target format";
|
|
99
|
+
readonly recovery: "correctable";
|
|
100
|
+
};
|
|
101
|
+
readonly GOVERNANCE_DENIED: {
|
|
102
|
+
readonly description: "A registered governance agent denied the transaction";
|
|
103
|
+
readonly recovery: "correctable";
|
|
104
|
+
};
|
|
105
|
+
readonly BUDGET_EXHAUSTED: {
|
|
106
|
+
readonly description: "Account or campaign budget has been fully spent";
|
|
107
|
+
readonly recovery: "terminal";
|
|
108
|
+
};
|
|
109
|
+
readonly BUDGET_EXCEEDED: {
|
|
110
|
+
readonly description: "Operation would exceed the allocated budget for the media buy or package";
|
|
111
|
+
readonly recovery: "correctable";
|
|
112
|
+
};
|
|
113
|
+
readonly CONFLICT: {
|
|
114
|
+
readonly description: "Concurrent modification detected; the resource was modified between read and write";
|
|
115
|
+
readonly recovery: "transient";
|
|
116
|
+
};
|
|
117
|
+
readonly IDEMPOTENCY_CONFLICT: {
|
|
118
|
+
readonly description: "An earlier request with the same idempotency_key was processed with a different canonical payload. Use a fresh UUID v4 for the new request, or resend the exact original payload to get the cached response.";
|
|
119
|
+
readonly recovery: "correctable";
|
|
120
|
+
};
|
|
121
|
+
readonly IDEMPOTENCY_EXPIRED: {
|
|
122
|
+
readonly description: "The idempotency_key is past the seller's replay window. If the prior call succeeded, look up the resource by natural key before retrying; otherwise mint a fresh UUID v4.";
|
|
123
|
+
readonly recovery: "correctable";
|
|
124
|
+
};
|
|
125
|
+
readonly CREATIVE_DEADLINE_EXCEEDED: {
|
|
126
|
+
readonly description: "Creative change submitted after the package's creative_deadline";
|
|
127
|
+
readonly recovery: "correctable";
|
|
128
|
+
};
|
|
129
|
+
readonly INVALID_STATE: {
|
|
130
|
+
readonly description: "Operation is not permitted for the resource's current status";
|
|
131
|
+
readonly recovery: "correctable";
|
|
132
|
+
};
|
|
133
|
+
readonly MEDIA_BUY_NOT_FOUND: {
|
|
134
|
+
readonly description: "Referenced media buy does not exist or is not accessible";
|
|
135
|
+
readonly recovery: "correctable";
|
|
136
|
+
};
|
|
137
|
+
readonly NOT_CANCELLABLE: {
|
|
138
|
+
readonly description: "The media buy or package cannot be canceled in its current state";
|
|
139
|
+
readonly recovery: "correctable";
|
|
140
|
+
};
|
|
141
|
+
readonly PACKAGE_NOT_FOUND: {
|
|
142
|
+
readonly description: "Referenced package does not exist within the specified media buy";
|
|
143
|
+
readonly recovery: "correctable";
|
|
144
|
+
};
|
|
145
|
+
readonly CREATIVE_NOT_FOUND: {
|
|
146
|
+
readonly description: "Referenced creative does not exist in the agent's creative library";
|
|
147
|
+
readonly recovery: "correctable";
|
|
148
|
+
};
|
|
149
|
+
readonly SIGNAL_NOT_FOUND: {
|
|
150
|
+
readonly description: "Referenced signal does not exist in the agent's catalog";
|
|
151
|
+
readonly recovery: "correctable";
|
|
152
|
+
};
|
|
153
|
+
readonly SESSION_NOT_FOUND: {
|
|
154
|
+
readonly description: "SI session ID is invalid, expired, or does not exist";
|
|
155
|
+
readonly recovery: "correctable";
|
|
156
|
+
};
|
|
157
|
+
readonly PLAN_NOT_FOUND: {
|
|
158
|
+
readonly description: "Referenced governance plan does not exist or is not accessible";
|
|
159
|
+
readonly recovery: "correctable";
|
|
160
|
+
};
|
|
161
|
+
readonly REFERENCE_NOT_FOUND: {
|
|
162
|
+
readonly description: "Generic fallback for a referenced identifier, grant, session, or other resource that does not exist or is not accessible by the caller";
|
|
163
|
+
readonly recovery: "correctable";
|
|
164
|
+
};
|
|
165
|
+
readonly SESSION_TERMINATED: {
|
|
166
|
+
readonly description: "SI session has already been terminated and cannot accept further messages";
|
|
167
|
+
readonly recovery: "correctable";
|
|
168
|
+
};
|
|
169
|
+
readonly VALIDATION_ERROR: {
|
|
170
|
+
readonly description: "Request contains invalid field values or violates business rules beyond schema validation";
|
|
171
|
+
readonly recovery: "correctable";
|
|
172
|
+
};
|
|
173
|
+
readonly PRODUCT_EXPIRED: {
|
|
174
|
+
readonly description: "One or more referenced products have passed their expires_at timestamp";
|
|
175
|
+
readonly recovery: "correctable";
|
|
176
|
+
};
|
|
177
|
+
readonly PROPOSAL_NOT_COMMITTED: {
|
|
178
|
+
readonly description: "The referenced proposal has proposal_status 'draft' and cannot be used to create a media buy";
|
|
179
|
+
readonly recovery: "correctable";
|
|
180
|
+
};
|
|
181
|
+
readonly IO_REQUIRED: {
|
|
182
|
+
readonly description: "The committed proposal requires a signed insertion order but no io_acceptance was provided";
|
|
183
|
+
readonly recovery: "correctable";
|
|
184
|
+
};
|
|
185
|
+
readonly TERMS_REJECTED: {
|
|
186
|
+
readonly description: "Buyer-proposed measurement_terms were rejected by the seller";
|
|
187
|
+
readonly recovery: "correctable";
|
|
188
|
+
};
|
|
189
|
+
readonly REQUOTE_REQUIRED: {
|
|
190
|
+
readonly description: "An update_media_buy request changes the parameter envelope (budget, flight dates, volume, targeting) the original quote was priced against";
|
|
191
|
+
readonly recovery: "correctable";
|
|
192
|
+
};
|
|
193
|
+
readonly VERSION_UNSUPPORTED: {
|
|
194
|
+
readonly description: "The declared adcp_major_version is not supported by this seller";
|
|
195
|
+
readonly recovery: "correctable";
|
|
196
|
+
};
|
|
197
|
+
readonly CAMPAIGN_SUSPENDED: {
|
|
198
|
+
readonly description: "Campaign governance has been suspended pending human review";
|
|
199
|
+
readonly recovery: "transient";
|
|
200
|
+
};
|
|
201
|
+
readonly GOVERNANCE_UNAVAILABLE: {
|
|
202
|
+
readonly description: "A registered governance agent is unreachable and the seller cannot obtain a governance decision";
|
|
203
|
+
readonly recovery: "transient";
|
|
204
|
+
};
|
|
205
|
+
readonly PERMISSION_DENIED: {
|
|
206
|
+
readonly description: "The authenticated caller is not authorized for the requested action under the seller's policies, or a required signed credential is missing or invalid";
|
|
207
|
+
readonly recovery: "correctable";
|
|
208
|
+
};
|
|
209
|
+
};
|
|
22
210
|
/**
|
|
23
|
-
* Check whether an error code is one of the
|
|
211
|
+
* Check whether an error code is one of the standard AdCP codes.
|
|
24
212
|
*/
|
|
25
213
|
export declare function isStandardErrorCode(code: string): code is StandardErrorCode;
|
|
26
214
|
/**
|
|
@@ -28,5 +216,4 @@ export declare function isStandardErrorCode(code: string): code is StandardError
|
|
|
28
216
|
* Returns the standard recovery for known codes, or undefined for custom codes.
|
|
29
217
|
*/
|
|
30
218
|
export declare function getErrorRecovery(code: string): ErrorRecovery | undefined;
|
|
31
|
-
export {};
|
|
32
219
|
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/lib/types/error-codes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/lib/types/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAOjE;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0L4B,CAAC;AAE9D;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,iBAAiB,CAE3E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAKxE"}
|
|
@@ -4,90 +4,104 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Sellers MAY use codes not in this vocabulary for platform-specific errors.
|
|
6
6
|
* Agents MUST handle unknown codes by falling back to the recovery classification.
|
|
7
|
+
*
|
|
8
|
+
* The `StandardErrorCode` union is derived from `ErrorCodeValues` in
|
|
9
|
+
* `enums.generated.ts` (auto-generated from `schemas/cache/{version}/enums/error-code.json`).
|
|
10
|
+
* The runtime lookup table `STANDARD_ERROR_CODES` is asserted complete via
|
|
11
|
+
* `satisfies Record<StandardErrorCode, ErrorCodeInfo>` — adding a code to the
|
|
12
|
+
* spec without filling in a description and recovery will fail typecheck.
|
|
7
13
|
*/
|
|
8
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
15
|
exports.STANDARD_ERROR_CODES = void 0;
|
|
10
16
|
exports.isStandardErrorCode = isStandardErrorCode;
|
|
11
17
|
exports.getErrorRecovery = getErrorRecovery;
|
|
12
18
|
/**
|
|
13
|
-
* Runtime lookup table for the
|
|
19
|
+
* Runtime lookup table for the standard AdCP error codes.
|
|
14
20
|
* Each entry includes a description and the recommended recovery strategy.
|
|
21
|
+
*
|
|
22
|
+
* Recovery classifications mirror the spec's `enumDescriptions` block in
|
|
23
|
+
* `error-code.json`. Descriptions are condensed to the first-sentence summary;
|
|
24
|
+
* agents needing the full prescriptive text should consult the schema directly.
|
|
15
25
|
*/
|
|
16
26
|
exports.STANDARD_ERROR_CODES = {
|
|
17
27
|
INVALID_REQUEST: {
|
|
18
|
-
description: '
|
|
28
|
+
description: 'Request is malformed, missing required fields, or violates schema constraints',
|
|
19
29
|
recovery: 'correctable',
|
|
20
30
|
},
|
|
21
31
|
AUTH_REQUIRED: {
|
|
22
|
-
description: 'Authentication is required
|
|
32
|
+
description: 'Authentication is required to access this resource',
|
|
23
33
|
recovery: 'correctable',
|
|
24
34
|
},
|
|
25
35
|
RATE_LIMITED: {
|
|
26
|
-
description: '
|
|
36
|
+
description: 'Request rate exceeded; retry after the retry_after interval',
|
|
27
37
|
recovery: 'transient',
|
|
28
38
|
},
|
|
29
39
|
SERVICE_UNAVAILABLE: {
|
|
30
|
-
description: '
|
|
40
|
+
description: 'Seller service is temporarily unavailable',
|
|
31
41
|
recovery: 'transient',
|
|
32
42
|
},
|
|
33
43
|
POLICY_VIOLATION: {
|
|
34
|
-
description:
|
|
44
|
+
description: "Request violates the seller's content or advertising policies",
|
|
35
45
|
recovery: 'correctable',
|
|
36
46
|
},
|
|
37
47
|
PRODUCT_NOT_FOUND: {
|
|
38
|
-
description: '
|
|
48
|
+
description: 'One or more referenced product IDs are unknown or expired',
|
|
39
49
|
recovery: 'correctable',
|
|
40
50
|
},
|
|
41
51
|
PRODUCT_UNAVAILABLE: {
|
|
42
|
-
description: 'The product
|
|
43
|
-
recovery: '
|
|
52
|
+
description: 'The requested product is sold out or no longer available',
|
|
53
|
+
recovery: 'correctable',
|
|
44
54
|
},
|
|
45
55
|
PROPOSAL_EXPIRED: {
|
|
46
|
-
description: '
|
|
56
|
+
description: 'A referenced proposal ID has passed its expires_at timestamp',
|
|
47
57
|
recovery: 'correctable',
|
|
48
58
|
},
|
|
49
59
|
BUDGET_TOO_LOW: {
|
|
50
|
-
description:
|
|
60
|
+
description: "Budget is below the seller's minimum",
|
|
51
61
|
recovery: 'correctable',
|
|
52
62
|
},
|
|
53
63
|
CREATIVE_REJECTED: {
|
|
54
|
-
description: '
|
|
64
|
+
description: 'Creative failed content policy review',
|
|
55
65
|
recovery: 'correctable',
|
|
56
66
|
},
|
|
57
67
|
UNSUPPORTED_FEATURE: {
|
|
58
|
-
description: '
|
|
59
|
-
recovery: '
|
|
68
|
+
description: 'A requested feature or field is not supported by this seller',
|
|
69
|
+
recovery: 'correctable',
|
|
60
70
|
},
|
|
61
71
|
AUDIENCE_TOO_SMALL: {
|
|
62
|
-
description: '
|
|
72
|
+
description: 'Audience segment is below the minimum required size for targeting',
|
|
63
73
|
recovery: 'correctable',
|
|
64
74
|
},
|
|
65
75
|
ACCOUNT_NOT_FOUND: {
|
|
66
|
-
description: 'The
|
|
76
|
+
description: 'The account reference could not be resolved',
|
|
67
77
|
recovery: 'terminal',
|
|
68
78
|
},
|
|
69
79
|
ACCOUNT_SETUP_REQUIRED: {
|
|
70
|
-
description: '
|
|
71
|
-
recovery: '
|
|
80
|
+
description: 'Natural key resolved but the account needs setup before use',
|
|
81
|
+
recovery: 'correctable',
|
|
72
82
|
},
|
|
73
83
|
ACCOUNT_AMBIGUOUS: {
|
|
74
|
-
description: '
|
|
84
|
+
description: 'Natural key resolves to multiple accounts',
|
|
75
85
|
recovery: 'correctable',
|
|
76
86
|
},
|
|
77
87
|
ACCOUNT_PAYMENT_REQUIRED: {
|
|
78
|
-
description: '
|
|
88
|
+
description: 'Account has an outstanding balance requiring payment before new buys',
|
|
79
89
|
recovery: 'terminal',
|
|
80
90
|
},
|
|
81
91
|
ACCOUNT_SUSPENDED: {
|
|
82
|
-
description: '
|
|
92
|
+
description: 'Account has been suspended',
|
|
83
93
|
recovery: 'terminal',
|
|
84
94
|
},
|
|
85
95
|
COMPLIANCE_UNSATISFIED: {
|
|
86
|
-
description: '
|
|
96
|
+
description: "A required disclosure from the brief's compliance section cannot be satisfied by the target format",
|
|
97
|
+
recovery: 'correctable',
|
|
98
|
+
},
|
|
99
|
+
GOVERNANCE_DENIED: {
|
|
100
|
+
description: 'A registered governance agent denied the transaction',
|
|
87
101
|
recovery: 'correctable',
|
|
88
102
|
},
|
|
89
103
|
BUDGET_EXHAUSTED: {
|
|
90
|
-
description: '
|
|
104
|
+
description: 'Account or campaign budget has been fully spent',
|
|
91
105
|
recovery: 'terminal',
|
|
92
106
|
},
|
|
93
107
|
BUDGET_EXCEEDED: {
|
|
@@ -95,8 +109,8 @@ exports.STANDARD_ERROR_CODES = {
|
|
|
95
109
|
recovery: 'correctable',
|
|
96
110
|
},
|
|
97
111
|
CONFLICT: {
|
|
98
|
-
description: '
|
|
99
|
-
recovery: '
|
|
112
|
+
description: 'Concurrent modification detected; the resource was modified between read and write',
|
|
113
|
+
recovery: 'transient',
|
|
100
114
|
},
|
|
101
115
|
IDEMPOTENCY_CONFLICT: {
|
|
102
116
|
description: 'An earlier request with the same idempotency_key was processed with a different canonical payload. Use a fresh UUID v4 for the new request, or resend the exact original payload to get the cached response.',
|
|
@@ -106,6 +120,10 @@ exports.STANDARD_ERROR_CODES = {
|
|
|
106
120
|
description: "The idempotency_key is past the seller's replay window. If the prior call succeeded, look up the resource by natural key before retrying; otherwise mint a fresh UUID v4.",
|
|
107
121
|
recovery: 'correctable',
|
|
108
122
|
},
|
|
123
|
+
CREATIVE_DEADLINE_EXCEEDED: {
|
|
124
|
+
description: "Creative change submitted after the package's creative_deadline",
|
|
125
|
+
recovery: 'correctable',
|
|
126
|
+
},
|
|
109
127
|
INVALID_STATE: {
|
|
110
128
|
description: "Operation is not permitted for the resource's current status",
|
|
111
129
|
recovery: 'correctable',
|
|
@@ -122,13 +140,73 @@ exports.STANDARD_ERROR_CODES = {
|
|
|
122
140
|
description: 'Referenced package does not exist within the specified media buy',
|
|
123
141
|
recovery: 'correctable',
|
|
124
142
|
},
|
|
143
|
+
CREATIVE_NOT_FOUND: {
|
|
144
|
+
description: "Referenced creative does not exist in the agent's creative library",
|
|
145
|
+
recovery: 'correctable',
|
|
146
|
+
},
|
|
147
|
+
SIGNAL_NOT_FOUND: {
|
|
148
|
+
description: "Referenced signal does not exist in the agent's catalog",
|
|
149
|
+
recovery: 'correctable',
|
|
150
|
+
},
|
|
151
|
+
SESSION_NOT_FOUND: {
|
|
152
|
+
description: 'SI session ID is invalid, expired, or does not exist',
|
|
153
|
+
recovery: 'correctable',
|
|
154
|
+
},
|
|
155
|
+
PLAN_NOT_FOUND: {
|
|
156
|
+
description: 'Referenced governance plan does not exist or is not accessible',
|
|
157
|
+
recovery: 'correctable',
|
|
158
|
+
},
|
|
159
|
+
REFERENCE_NOT_FOUND: {
|
|
160
|
+
description: 'Generic fallback for a referenced identifier, grant, session, or other resource that does not exist or is not accessible by the caller',
|
|
161
|
+
recovery: 'correctable',
|
|
162
|
+
},
|
|
163
|
+
SESSION_TERMINATED: {
|
|
164
|
+
description: 'SI session has already been terminated and cannot accept further messages',
|
|
165
|
+
recovery: 'correctable',
|
|
166
|
+
},
|
|
125
167
|
VALIDATION_ERROR: {
|
|
126
168
|
description: 'Request contains invalid field values or violates business rules beyond schema validation',
|
|
127
169
|
recovery: 'correctable',
|
|
128
170
|
},
|
|
171
|
+
PRODUCT_EXPIRED: {
|
|
172
|
+
description: 'One or more referenced products have passed their expires_at timestamp',
|
|
173
|
+
recovery: 'correctable',
|
|
174
|
+
},
|
|
175
|
+
PROPOSAL_NOT_COMMITTED: {
|
|
176
|
+
description: "The referenced proposal has proposal_status 'draft' and cannot be used to create a media buy",
|
|
177
|
+
recovery: 'correctable',
|
|
178
|
+
},
|
|
179
|
+
IO_REQUIRED: {
|
|
180
|
+
description: 'The committed proposal requires a signed insertion order but no io_acceptance was provided',
|
|
181
|
+
recovery: 'correctable',
|
|
182
|
+
},
|
|
183
|
+
TERMS_REJECTED: {
|
|
184
|
+
description: 'Buyer-proposed measurement_terms were rejected by the seller',
|
|
185
|
+
recovery: 'correctable',
|
|
186
|
+
},
|
|
187
|
+
REQUOTE_REQUIRED: {
|
|
188
|
+
description: 'An update_media_buy request changes the parameter envelope (budget, flight dates, volume, targeting) the original quote was priced against',
|
|
189
|
+
recovery: 'correctable',
|
|
190
|
+
},
|
|
191
|
+
VERSION_UNSUPPORTED: {
|
|
192
|
+
description: 'The declared adcp_major_version is not supported by this seller',
|
|
193
|
+
recovery: 'correctable',
|
|
194
|
+
},
|
|
195
|
+
CAMPAIGN_SUSPENDED: {
|
|
196
|
+
description: 'Campaign governance has been suspended pending human review',
|
|
197
|
+
recovery: 'transient',
|
|
198
|
+
},
|
|
199
|
+
GOVERNANCE_UNAVAILABLE: {
|
|
200
|
+
description: 'A registered governance agent is unreachable and the seller cannot obtain a governance decision',
|
|
201
|
+
recovery: 'transient',
|
|
202
|
+
},
|
|
203
|
+
PERMISSION_DENIED: {
|
|
204
|
+
description: "The authenticated caller is not authorized for the requested action under the seller's policies, or a required signed credential is missing or invalid",
|
|
205
|
+
recovery: 'correctable',
|
|
206
|
+
},
|
|
129
207
|
};
|
|
130
208
|
/**
|
|
131
|
-
* Check whether an error code is one of the
|
|
209
|
+
* Check whether an error code is one of the standard AdCP codes.
|
|
132
210
|
*/
|
|
133
211
|
function isStandardErrorCode(code) {
|
|
134
212
|
return code in exports.STANDARD_ERROR_CODES;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../../src/lib/types/error-codes.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../../src/lib/types/error-codes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAwNH,kDAEC;AAMD,4CAKC;AApND;;;;;;;GAOG;AACU,QAAA,oBAAoB,GAAG;IAClC,eAAe,EAAE;QACf,WAAW,EAAE,+EAA+E;QAC5F,QAAQ,EAAE,aAAa;KACxB;IACD,aAAa,EAAE;QACb,WAAW,EAAE,oDAAoD;QACjE,QAAQ,EAAE,aAAa;KACxB;IACD,YAAY,EAAE;QACZ,WAAW,EAAE,6DAA6D;QAC1E,QAAQ,EAAE,WAAW;KACtB;IACD,mBAAmB,EAAE;QACnB,WAAW,EAAE,2CAA2C;QACxD,QAAQ,EAAE,WAAW;KACtB;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,+DAA+D;QAC5E,QAAQ,EAAE,aAAa;KACxB;IACD,iBAAiB,EAAE;QACjB,WAAW,EAAE,2DAA2D;QACxE,QAAQ,EAAE,aAAa;KACxB;IACD,mBAAmB,EAAE;QACnB,WAAW,EAAE,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QAAQ,EAAE,aAAa;KACxB;IACD,cAAc,EAAE;QACd,WAAW,EAAE,8DAA8D;QAC3E,QAAQ,EAAE,aAAa;KACxB;IACD,gBAAgB,EAAE;QAChB,WAAW,EACT,4IAA4I;QAC9I,QAAQ,EAAE,aAAa;KACxB;IACD,mBAAmB,EAAE;QACnB,WAAW,EAAE,iEAAiE;QAC9E,QAAQ,EAAE,aAAa;KACxB;IACD,kBAAkB,EAAE;QAClB,WAAW,EAAE,6DAA6D;QAC1E,QAAQ,EAAE,WAAW;KACtB;IACD,sBAAsB,EAAE;QACtB,WAAW,EAAE,iGAAiG;QAC9G,QAAQ,EAAE,WAAW;KACtB;IACD,iBAAiB,EAAE;QACjB,WAAW,EACT,wJAAwJ;QAC1J,QAAQ,EAAE,aAAa;KACxB;CAC0D,CAAC;AAE9D;;GAEG;AACH,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,IAAI,4BAAoB,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,4BAAoB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC7C,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/v2-5/index.ts"],"names":[],"mappings":"AAaA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AdCP v2.5 type surface — re-export the generated request/response
|
|
3
|
+
// interfaces so consumers can import them as a namespace:
|
|
4
|
+
//
|
|
5
|
+
// import * as V25 from '@adcp/sdk/types/v2-5';
|
|
6
|
+
// const req: V25.CreateMediaBuyRequest = ...;
|
|
7
|
+
//
|
|
8
|
+
// Or by name:
|
|
9
|
+
//
|
|
10
|
+
// import type { CreateMediaBuyRequest } from '@adcp/sdk/types/v2-5';
|
|
11
|
+
//
|
|
12
|
+
// The generated file is the source of truth; refresh by running
|
|
13
|
+
// `npm run sync-schemas:v2.5 && npm run generate-types:v2.5`.
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
__exportStar(require("./tools.generated"), exports);
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/types/v2-5/index.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,0DAA0D;AAC1D,EAAE;AACF,iDAAiD;AACjD,gDAAgD;AAChD,EAAE;AACF,cAAc;AACd,EAAE;AACF,uEAAuE;AACvE,EAAE;AACF,gEAAgE;AAChE,8DAA8D;;;;;;;;;;;;;;;;AAE9D,oDAAkC"}
|