@adcp/sdk 17.0.0-beta.0 → 17.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/adapters/keyed-account-store.js +1 -1
- package/dist/lib/adapters/keyed-account-store.mjs +1 -1
- package/dist/lib/adapters/version/3.0/brand-fields.d.mts +7 -1
- package/dist/lib/adapters/version/3.0/brand-fields.d.ts +7 -1
- package/dist/lib/adapters/version/3.0/brand-fields.js +139 -3
- package/dist/lib/adapters/version/3.0/brand-fields.mjs +136 -2
- package/dist/lib/adapters/version/3.0/index.js +6 -0
- package/dist/lib/adapters/version/3.0/index.mjs +7 -1
- package/dist/lib/adapters/version/3.1/bidding.js +1 -1
- package/dist/lib/adapters/version/3.1/bidding.mjs +1 -1
- package/dist/lib/adapters/version/types.d.mts +5 -0
- package/dist/lib/adapters/version/types.d.ts +5 -0
- package/dist/lib/canonical-references/index.js +2 -0
- package/dist/lib/canonical-references/index.mjs +2 -0
- package/dist/lib/client/account-changes.d.mts +3 -1
- package/dist/lib/client/account-changes.d.ts +3 -1
- package/dist/lib/client/account-changes.js +22 -2
- package/dist/lib/client/account-changes.mjs +22 -2
- package/dist/lib/conformance/oracle.js +3 -2
- package/dist/lib/conformance/oracle.mjs +3 -2
- package/dist/lib/core/AgentClient.d.mts +165 -1
- package/dist/lib/core/AgentClient.d.ts +165 -1
- package/dist/lib/core/AgentClient.js +446 -8
- package/dist/lib/core/AgentClient.mjs +446 -8
- package/dist/lib/core/ConversationTypes.d.mts +8 -0
- package/dist/lib/core/ConversationTypes.d.ts +8 -0
- package/dist/lib/core/ProtocolResponseParser.d.mts +1 -1
- package/dist/lib/core/ProtocolResponseParser.d.ts +1 -1
- package/dist/lib/core/ProtocolResponseParser.js +28 -18
- package/dist/lib/core/ProtocolResponseParser.mjs +11 -1
- package/dist/lib/core/ResponseValidator.js +1 -1
- package/dist/lib/core/ResponseValidator.mjs +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +122 -7
- package/dist/lib/core/SingleAgentClient.d.ts +122 -7
- package/dist/lib/core/SingleAgentClient.js +601 -96
- package/dist/lib/core/SingleAgentClient.mjs +590 -84
- package/dist/lib/core/TaskExecutor.d.mts +7 -0
- package/dist/lib/core/TaskExecutor.d.ts +7 -0
- package/dist/lib/core/TaskExecutor.js +23 -8
- package/dist/lib/core/TaskExecutor.mjs +23 -8
- package/dist/lib/core/task-status.d.mts +2 -0
- package/dist/lib/core/task-status.d.ts +2 -0
- package/dist/lib/core/task-status.js +11 -2
- package/dist/lib/core/task-status.mjs +9 -1
- package/dist/lib/errors/index.d.mts +22 -0
- package/dist/lib/errors/index.d.ts +22 -0
- package/dist/lib/errors/index.js +43 -0
- package/dist/lib/errors/index.mjs +42 -0
- package/dist/lib/identity-3.3/trust.d.mts +1 -4
- package/dist/lib/identity-3.3/trust.d.ts +1 -4
- package/dist/lib/identity-3.3/trust.js +34 -21
- package/dist/lib/identity-3.3/trust.mjs +34 -21
- package/dist/lib/identity-3.3/validation.js +5 -3
- package/dist/lib/identity-3.3/validation.mjs +6 -4
- package/dist/lib/index.d.mts +7 -53
- package/dist/lib/index.d.ts +7 -53
- package/dist/lib/index.js +13 -0
- package/dist/lib/index.mjs +9 -0
- package/dist/lib/media-buy/compatibility.js +6 -1
- package/dist/lib/media-buy/compatibility.mjs +6 -1
- package/dist/lib/protocols/mcp-modern.d.mts +2 -0
- package/dist/lib/protocols/mcp-modern.d.ts +2 -0
- package/dist/lib/protocols/mcp-modern.js +31 -5
- package/dist/lib/protocols/mcp-modern.mjs +31 -5
- package/dist/lib/protocols/mcp-scope.d.mts +6 -1
- package/dist/lib/protocols/mcp-scope.d.ts +6 -1
- package/dist/lib/protocols/mcp-scope.js +25 -3
- package/dist/lib/protocols/mcp-scope.mjs +24 -3
- package/dist/lib/protocols/mcp.js +12 -6
- package/dist/lib/protocols/mcp.mjs +13 -6
- package/dist/lib/reporting/inspection.js +1 -0
- package/dist/lib/reporting/inspection.mjs +1 -0
- package/dist/lib/reporting/ledger/coverage.d.mts +5 -0
- package/dist/lib/reporting/ledger/coverage.d.ts +5 -0
- package/dist/lib/reporting/ledger/coverage.js +37 -3
- package/dist/lib/reporting/ledger/coverage.mjs +36 -3
- package/dist/lib/reporting/ledger/handler.js +7 -4
- package/dist/lib/reporting/ledger/handler.mjs +7 -4
- package/dist/lib/reporting/ledger/producer.js +215 -69
- package/dist/lib/reporting/ledger/producer.mjs +217 -70
- package/dist/lib/reporting/ledger/schedule.d.mts +2 -2
- package/dist/lib/reporting/ledger/schedule.d.ts +2 -2
- package/dist/lib/reporting/ledger/schedule.js +8 -5
- package/dist/lib/reporting/ledger/schedule.mjs +8 -5
- package/dist/lib/reporting/ledger/status-ingest.d.mts +1 -1
- package/dist/lib/reporting/ledger/status-ingest.d.ts +1 -1
- package/dist/lib/reporting/ledger/status-ingest.js +4 -3
- package/dist/lib/reporting/ledger/status-ingest.mjs +4 -3
- package/dist/lib/reporting/ledger/types.d.mts +36 -1
- package/dist/lib/reporting/ledger/types.d.ts +36 -1
- package/dist/lib/reporting/service/index.d.mts +14 -1
- package/dist/lib/reporting/service/index.d.ts +14 -1
- package/dist/lib/reporting/service/index.js +24 -12
- package/dist/lib/reporting/service/index.mjs +24 -12
- package/dist/lib/schemas/browser.d.mts +2 -0
- package/dist/lib/schemas/browser.d.ts +2 -0
- package/dist/lib/schemas/browser.js +3 -0
- package/dist/lib/schemas/browser.mjs +2 -0
- package/dist/lib/schemas/index.d.mts +5 -3
- package/dist/lib/schemas/index.d.ts +5 -3
- package/dist/lib/schemas/index.js +5 -0
- package/dist/lib/schemas/index.mjs +4 -0
- package/dist/lib/server/account-response-identity.d.mts +17 -0
- package/dist/lib/server/account-response-identity.d.ts +17 -0
- package/dist/lib/server/account-response-identity.js +52 -0
- package/dist/lib/server/account-response-identity.mjs +28 -0
- package/dist/lib/server/account-sync-contract.js +2 -2
- package/dist/lib/server/account-sync-contract.mjs +2 -2
- package/dist/lib/server/create-adcp-server.js +33 -20
- package/dist/lib/server/create-adcp-server.mjs +36 -12
- package/dist/lib/server/decisioning/account.d.mts +36 -10
- package/dist/lib/server/decisioning/account.d.ts +36 -10
- package/dist/lib/server/decisioning/account.js +33 -14
- package/dist/lib/server/decisioning/account.mjs +33 -14
- package/dist/lib/server/decisioning/runtime/from-platform.d.mts +5 -5
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +5 -5
- package/dist/lib/server/decisioning/runtime/from-platform.js +4 -4
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +4 -4
- package/dist/lib/server/media-buy-store.d.mts +26 -12
- package/dist/lib/server/media-buy-store.d.ts +26 -12
- package/dist/lib/server/media-buy-store.js +69 -21
- package/dist/lib/server/media-buy-store.mjs +69 -21
- package/dist/lib/server/notification-subscriptions/runtime.d.mts +1 -1
- package/dist/lib/server/notification-subscriptions/runtime.d.ts +1 -1
- package/dist/lib/server/notification-subscriptions/runtime.js +4 -0
- package/dist/lib/server/notification-subscriptions/runtime.mjs +4 -0
- package/dist/lib/server/responses.js +9 -1
- package/dist/lib/server/responses.mjs +9 -1
- package/dist/lib/signing/agent-fetch.d.mts +1 -1
- package/dist/lib/signing/agent-fetch.d.ts +1 -1
- package/dist/lib/signing/agent-fetch.js +3 -3
- package/dist/lib/signing/agent-fetch.mjs +3 -3
- package/dist/lib/testing/client.d.mts +1 -0
- package/dist/lib/testing/client.d.ts +1 -0
- package/dist/lib/testing/client.js +6 -5
- package/dist/lib/testing/client.mjs +6 -5
- package/dist/lib/testing/storyboard/agent-routing.d.mts +5 -2
- package/dist/lib/testing/storyboard/agent-routing.d.ts +5 -2
- package/dist/lib/testing/storyboard/agent-routing.js +11 -4
- package/dist/lib/testing/storyboard/agent-routing.mjs +11 -4
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.js +60 -14
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.mjs +60 -14
- package/dist/lib/testing/storyboard/compliance.d.mts +2 -5
- package/dist/lib/testing/storyboard/compliance.d.ts +2 -5
- package/dist/lib/testing/storyboard/compliance.js +62 -13
- package/dist/lib/testing/storyboard/compliance.mjs +63 -14
- package/dist/lib/testing/storyboard/context.d.mts +13 -3
- package/dist/lib/testing/storyboard/context.d.ts +13 -3
- package/dist/lib/testing/storyboard/context.js +15 -10
- package/dist/lib/testing/storyboard/context.mjs +15 -10
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.mts +2 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.ts +2 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +11 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +10 -0
- package/dist/lib/testing/storyboard/runner.js +141 -13
- package/dist/lib/testing/storyboard/runner.mjs +141 -13
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/testing/storyboard/validations.js +4 -1
- package/dist/lib/testing/storyboard/validations.mjs +4 -1
- package/dist/lib/testing/test-controller.js +3 -0
- package/dist/lib/testing/test-controller.mjs +3 -0
- package/dist/lib/types/accept-proposal.d.ts +20 -28
- package/dist/lib/types/asset-instances.d.mts +1 -1
- package/dist/lib/types/asset-instances.d.ts +1 -1
- package/dist/lib/types/buy-products.d.ts +20 -28
- package/dist/lib/types/check-governance.d.ts +20 -28
- package/dist/lib/types/comply-test-controller.d.ts +20 -28
- package/dist/lib/types/control-media-buy.d.ts +20 -28
- package/dist/lib/types/core.generated.d.mts +273 -184
- package/dist/lib/types/core.generated.d.ts +273 -184
- package/dist/lib/types/create-media-buy.d.ts +20 -28
- package/dist/lib/types/get-media-buys.d.ts +20 -28
- package/dist/lib/types/get-products.d.ts +20 -28
- package/dist/lib/types/index.d.mts +6 -1
- package/dist/lib/types/index.d.ts +6 -1
- package/dist/lib/types/index.js +6 -1
- package/dist/lib/types/index.mjs +4 -1
- package/dist/lib/types/inline-enums.generated.d.mts +30 -4
- package/dist/lib/types/inline-enums.generated.d.ts +30 -4
- package/dist/lib/types/inline-enums.generated.js +41 -2
- package/dist/lib/types/inline-enums.generated.mjs +28 -2
- package/dist/lib/types/list-products.d.ts +20 -28
- package/dist/lib/types/list-proposals.d.ts +20 -28
- package/dist/lib/types/media-buy-delivery-report.d.mts +6 -0
- package/dist/lib/types/media-buy-delivery-report.d.ts +6 -0
- package/dist/lib/types/media-buy-delivery-report.js +16 -0
- package/dist/lib/types/media-buy-delivery-report.mjs +0 -0
- package/dist/lib/types/refine-proposals.d.ts +20 -28
- package/dist/lib/types/request-proposals.d.ts +20 -28
- package/dist/lib/types/schemas.generated.d.ts +63113 -127273
- package/dist/lib/types/schemas.generated.js +759 -770
- package/dist/lib/types/schemas.generated.mjs +759 -770
- package/dist/lib/types/targeting-keys.generated.d.mts +4 -0
- package/dist/lib/types/targeting-keys.generated.d.ts +4 -0
- package/dist/lib/types/targeting-keys.generated.js +109 -0
- package/dist/lib/types/targeting-keys.generated.mjs +84 -0
- package/dist/lib/types/tools.generated.d.mts +2 -68
- package/dist/lib/types/tools.generated.d.ts +2 -68
- package/dist/lib/types/update-media-buy.d.ts +20 -28
- package/dist/lib/utils/adcp-version-config.js +5 -2
- package/dist/lib/utils/adcp-version-config.mjs +5 -2
- package/dist/lib/utils/envelope-status-compat.d.mts +18 -1
- package/dist/lib/utils/envelope-status-compat.d.ts +18 -1
- package/dist/lib/utils/envelope-status-compat.js +11 -5
- package/dist/lib/utils/envelope-status-compat.mjs +11 -5
- package/dist/lib/utils/response-unwrapper.js +18 -10
- package/dist/lib/utils/response-unwrapper.mjs +18 -10
- package/dist/lib/v2/format-schema/resolver.js +1 -1
- package/dist/lib/v2/format-schema/resolver.mjs +1 -1
- package/dist/lib/v2/projection/creative-delivery.js +159 -39
- package/dist/lib/v2/projection/creative-delivery.mjs +163 -39
- package/dist/lib/v2/projection/index.d.mts +1 -0
- package/dist/lib/v2/projection/index.d.ts +1 -0
- package/dist/lib/v2/projection/index.js +3 -0
- package/dist/lib/v2/projection/index.mjs +2 -0
- package/dist/lib/v2/projection/legacy-metadata.d.mts +19 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +19 -0
- package/dist/lib/v2/projection/legacy-metadata.js +91 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs +86 -0
- package/dist/lib/v2/projection/v1-to-v2.d.mts +1 -1
- package/dist/lib/v2/projection/v1-to-v2.d.ts +1 -1
- package/dist/lib/v2/projection/v1-to-v2.js +12 -9
- package/dist/lib/v2/projection/v1-to-v2.mjs +12 -9
- package/dist/lib/validation/budget-allocation.d.mts +3 -3
- package/dist/lib/validation/budget-allocation.d.ts +3 -3
- package/dist/lib/validation/compact-schema.d.mts +27 -0
- package/dist/lib/validation/compact-schema.d.ts +27 -0
- package/dist/lib/validation/compact-schema.js +276 -0
- package/dist/lib/validation/compact-schema.mjs +250 -0
- package/dist/lib/validation/media-buy-delivery-report.d.mts +8 -0
- package/dist/lib/validation/media-buy-delivery-report.d.ts +8 -0
- package/dist/lib/validation/media-buy-delivery-report.js +31 -0
- package/dist/lib/validation/media-buy-delivery-report.mjs +7 -0
- package/dist/lib/validation/nonempty-array.d.mts +15 -0
- package/dist/lib/validation/nonempty-array.d.ts +15 -0
- package/dist/lib/validation/nonempty-array.js +41 -0
- package/dist/lib/validation/nonempty-array.mjs +7 -0
- package/dist/lib/validation/schema-diagnostic-origins.d.mts +21 -0
- package/dist/lib/validation/schema-diagnostic-origins.d.ts +21 -0
- package/dist/lib/validation/schema-diagnostic-origins.js +193 -0
- package/dist/lib/validation/schema-diagnostic-origins.mjs +169 -0
- package/dist/lib/validation/schema-loader.js +86 -16
- package/dist/lib/validation/schema-loader.mjs +82 -16
- package/dist/lib/validation/schema-validator.d.mts +10 -19
- package/dist/lib/validation/schema-validator.d.ts +10 -19
- package/dist/lib/validation/schema-validator.js +136 -43
- package/dist/lib/validation/schema-validator.mjs +140 -44
- package/dist/lib/validation/sync-creatives.d.mts +22 -22
- package/dist/lib/validation/sync-creatives.d.ts +22 -22
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/webhooks/index.d.mts +3 -0
- package/dist/lib/webhooks/index.d.ts +3 -0
- package/dist/lib/webhooks/index.js +3 -0
- package/dist/lib/webhooks/index.mjs +2 -0
- package/dist/lib/webhooks/media-buy-delivery.d.mts +43 -0
- package/dist/lib/webhooks/media-buy-delivery.d.ts +43 -0
- package/dist/lib/webhooks/media-buy-delivery.js +119 -0
- package/dist/lib/webhooks/media-buy-delivery.mjs +94 -0
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/COLLECTION-FIXTURE-FOUNDATION.md +11 -0
- package/docs/guides/DELIVERY-WEBHOOK-PARSING.md +142 -0
- package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +27 -1
- package/docs/guides/REPORTING-LEDGER.md +93 -0
- package/docs/guides/REPORTING-STABILITY.md +1 -1
- package/docs/guides/TYPED-CLIENT-TOOLS.md +49 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-16-to-17.md +202 -2
- package/docs/migration-6.6-to-6.7.md +14 -0
- package/docs/migration-account-change-feed.md +15 -0
- package/docs/migration-reporting-storage-package.md +1 -1
- package/docs/recipes/verifying-inbound-webhooks.md +18 -2
- package/package.json +2 -2
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var account_response_identity_exports = {};
|
|
20
|
+
__export(account_response_identity_exports, {
|
|
21
|
+
projectAccountResponseIdentityFields: () => projectAccountResponseIdentityFields
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(account_response_identity_exports);
|
|
24
|
+
var import_schema_loader = require('../validation/schema-loader.js');
|
|
25
|
+
const IDENTITY_RESPONSE_SCHEMAS = {
|
|
26
|
+
account: "core/account-ref.json",
|
|
27
|
+
operator_unit: "core/operator-unit.json",
|
|
28
|
+
identity_change: "core/account-identity-change.json",
|
|
29
|
+
identity_change_preview: "core/account-identity-change-preview.json"
|
|
30
|
+
};
|
|
31
|
+
function projectAccountResponseIdentityFields(account) {
|
|
32
|
+
const fields = account;
|
|
33
|
+
const projected = {};
|
|
34
|
+
for (const [field, schemaRef] of Object.entries(IDENTITY_RESPONSE_SCHEMAS)) {
|
|
35
|
+
const value = fields[field];
|
|
36
|
+
if (value === void 0) continue;
|
|
37
|
+
const snapshot = structuredClone(value);
|
|
38
|
+
const validate = (0, import_schema_loader.getSchemaValidatorByRef)(schemaRef);
|
|
39
|
+
if (!validate) throw new Error(`Account response identity schema unavailable: ${schemaRef}.`);
|
|
40
|
+
if (!validate(snapshot)) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Account response ${field} must match its canonical identity schema without retained internal fields.`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
Object.assign(projected, { [field]: snapshot });
|
|
46
|
+
}
|
|
47
|
+
return projected;
|
|
48
|
+
}
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
projectAccountResponseIdentityFields
|
|
52
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getSchemaValidatorByRef } from "../validation/schema-loader.mjs";
|
|
2
|
+
const IDENTITY_RESPONSE_SCHEMAS = {
|
|
3
|
+
account: "core/account-ref.json",
|
|
4
|
+
operator_unit: "core/operator-unit.json",
|
|
5
|
+
identity_change: "core/account-identity-change.json",
|
|
6
|
+
identity_change_preview: "core/account-identity-change-preview.json"
|
|
7
|
+
};
|
|
8
|
+
function projectAccountResponseIdentityFields(account) {
|
|
9
|
+
const fields = account;
|
|
10
|
+
const projected = {};
|
|
11
|
+
for (const [field, schemaRef] of Object.entries(IDENTITY_RESPONSE_SCHEMAS)) {
|
|
12
|
+
const value = fields[field];
|
|
13
|
+
if (value === void 0) continue;
|
|
14
|
+
const snapshot = structuredClone(value);
|
|
15
|
+
const validate = getSchemaValidatorByRef(schemaRef);
|
|
16
|
+
if (!validate) throw new Error(`Account response identity schema unavailable: ${schemaRef}.`);
|
|
17
|
+
if (!validate(snapshot)) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`Account response ${field} must match its canonical identity schema without retained internal fields.`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
Object.assign(projected, { [field]: snapshot });
|
|
23
|
+
}
|
|
24
|
+
return projected;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
projectAccountResponseIdentityFields
|
|
28
|
+
};
|
|
@@ -205,9 +205,9 @@ async function checkSyncAccountRows(accounts, entries, existing, rows, indices,
|
|
|
205
205
|
field: `accounts[${index}]${termsViolation ? ".payment_terms" : billingViolation ? ".billing" : ""}`
|
|
206
206
|
}
|
|
207
207
|
).toStructuredError();
|
|
208
|
+
const anchor = row.account !== void 0 ? { account: row.account } : { brand: row.brand, operator: row.operator };
|
|
208
209
|
row = {
|
|
209
|
-
|
|
210
|
-
operator: row.operator,
|
|
210
|
+
...anchor,
|
|
211
211
|
...priorId === row.account_id && priorId && { account_id: priorId },
|
|
212
212
|
action: "failed",
|
|
213
213
|
status: existing[offset]?.status ?? row.status,
|
|
@@ -178,9 +178,9 @@ async function checkSyncAccountRows(accounts, entries, existing, rows, indices,
|
|
|
178
178
|
field: `accounts[${index}]${termsViolation ? ".payment_terms" : billingViolation ? ".billing" : ""}`
|
|
179
179
|
}
|
|
180
180
|
).toStructuredError();
|
|
181
|
+
const anchor = row.account !== void 0 ? { account: row.account } : { brand: row.brand, operator: row.operator };
|
|
181
182
|
row = {
|
|
182
|
-
|
|
183
|
-
operator: row.operator,
|
|
183
|
+
...anchor,
|
|
184
184
|
...priorId === row.account_id && priorId && { account_id: priorId },
|
|
185
185
|
action: "failed",
|
|
186
186
|
status: existing[offset]?.status ?? row.status,
|
|
@@ -30,6 +30,7 @@ __export(create_adcp_server_exports, {
|
|
|
30
30
|
requireSessionKey: () => requireSessionKey
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(create_adcp_server_exports);
|
|
33
|
+
var import_adcp_version_config = require('../utils/adcp-version-config.js');
|
|
33
34
|
var import_web_bot_auth = require('../signing/web-bot-auth.js');
|
|
34
35
|
var import_version = require('../adapters/version/index.js');
|
|
35
36
|
var import_schema_loader = require('../validation/schema-loader.js');
|
|
@@ -40,7 +41,7 @@ var import_validation = require('../identity-3.3/validation.js');
|
|
|
40
41
|
var import_trust = require('../identity-3.3/trust.js');
|
|
41
42
|
var import_zod = require("zod");
|
|
42
43
|
var import_version2 = require('../version.js');
|
|
43
|
-
var
|
|
44
|
+
var import_adcp_version_config2 = require('../utils/adcp-version-config.js');
|
|
44
45
|
var import_errors = require('../errors/index.js');
|
|
45
46
|
var import_schema_loader2 = require('../validation/schema-loader.js');
|
|
46
47
|
var import_schemas = require('../schemas/index.js');
|
|
@@ -962,8 +963,7 @@ function projectValueToCapabilitySchema(root, schema, value, depth = 0) {
|
|
|
962
963
|
return projectedObject;
|
|
963
964
|
}
|
|
964
965
|
function projectCapabilitiesToVersion(data, version) {
|
|
965
|
-
const
|
|
966
|
-
const schema = asProjectionSchema(validator?.schema);
|
|
966
|
+
const schema = asProjectionSchema((0, import_schema_loader2.getToolSchemaDocument)("get_adcp_capabilities", "sync", version)?.schema);
|
|
967
967
|
if (!schema) return data;
|
|
968
968
|
const projected = projectValueToCapabilitySchema(schema, schema, data);
|
|
969
969
|
if (!isPlainObject(projected)) return data;
|
|
@@ -1392,7 +1392,9 @@ function injectContextIntoResponse(response, context) {
|
|
|
1392
1392
|
syncContentJsonText(response, sc, mirrorsStructuredContent);
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
|
-
function injectEnvelopeStatusIntoResponse(response, toolName) {
|
|
1395
|
+
function injectEnvelopeStatusIntoResponse(response, toolName, servedVersion) {
|
|
1396
|
+
if (servedVersion && (0, import_adcp_version_config.isPre31AdcpVersion)(servedVersion) && MEDIA_BUY_RESPONSE_TOOLS_REQUIRING_STATUS_SPLIT.has(toolName) && response.isError !== true)
|
|
1397
|
+
return;
|
|
1396
1398
|
const sc = response.structuredContent;
|
|
1397
1399
|
if (!sc || typeof sc !== "object") return;
|
|
1398
1400
|
if ("status" in sc) return;
|
|
@@ -1416,12 +1418,23 @@ const MEDIA_BUY_STATUS_VALUES = /* @__PURE__ */ new Set([
|
|
|
1416
1418
|
"rejected",
|
|
1417
1419
|
"canceled"
|
|
1418
1420
|
]);
|
|
1419
|
-
function normalizeMediaBuyStatusCollision(response, toolName) {
|
|
1421
|
+
function normalizeMediaBuyStatusCollision(response, toolName, servedVersion) {
|
|
1420
1422
|
if (!MEDIA_BUY_RESPONSE_TOOLS_REQUIRING_STATUS_SPLIT.has(toolName)) return;
|
|
1421
1423
|
const sc = response.structuredContent;
|
|
1422
1424
|
if (!sc || typeof sc !== "object") return;
|
|
1425
|
+
if (servedVersion && (0, import_adcp_version_config.isPre31AdcpVersion)(servedVersion)) {
|
|
1426
|
+
const adapted = typeof sc.media_buy_status === "string" ? (0, import_version.getVersionAdapter)("3.0", toolName)?.downgradeResponse?.(sc) : void 0;
|
|
1427
|
+
if (adapted && adapted.data !== sc && adapted.data && typeof adapted.data === "object") {
|
|
1428
|
+
const mirrors = contentTextMirrorsStructuredContent(response, sc);
|
|
1429
|
+
response.structuredContent = adapted.data;
|
|
1430
|
+
syncContentJsonText(response, response.structuredContent, mirrors);
|
|
1431
|
+
}
|
|
1432
|
+
return;
|
|
1433
|
+
}
|
|
1423
1434
|
const status = sc.status;
|
|
1424
1435
|
if (typeof status !== "string" || !MEDIA_BUY_STATUS_VALUES.has(status)) return;
|
|
1436
|
+
if (servedVersion && sc.media_buy_status === void 0 && (status === "completed" || status === "rejected" || status === "canceled"))
|
|
1437
|
+
return;
|
|
1425
1438
|
const looksLikeMediaBuyPayload = typeof sc.media_buy_id === "string" || "media_buy_status" in sc || Array.isArray(sc.packages);
|
|
1426
1439
|
if (!looksLikeMediaBuyPayload) return;
|
|
1427
1440
|
const mirrorsStructuredContent = contentTextMirrorsStructuredContent(response, sc);
|
|
@@ -1798,7 +1811,7 @@ function supportedVersionsForTool(toolName, ranges, capConfig, serverPin) {
|
|
|
1798
1811
|
}
|
|
1799
1812
|
const PUSH_OPERATION_ID_PATTERN = /^[A-Za-z0-9_.:-]{1,255}$/;
|
|
1800
1813
|
function releaseRequiresPushOperationId(release) {
|
|
1801
|
-
return (0,
|
|
1814
|
+
return (0, import_adcp_version_config2.isAdcpVersionAtLeast)((0, import_schema_loader2.resolveBundleKey)(release), "3.2.0-beta.5");
|
|
1802
1815
|
}
|
|
1803
1816
|
function pushOperationIdError(params, release) {
|
|
1804
1817
|
const config = params.push_notification_config;
|
|
@@ -2082,18 +2095,18 @@ function createAdcpServer(config) {
|
|
|
2082
2095
|
logger.warn(message);
|
|
2083
2096
|
}
|
|
2084
2097
|
const credentialPolicyPatterns = credentialPolicy === void 0 || typeof credentialPolicy === "string" ? void 0 : credentialPolicy.patterns;
|
|
2085
|
-
const adcpVersion = (0,
|
|
2098
|
+
const adcpVersion = (0, import_adcp_version_config2.resolveAdcpVersion)(
|
|
2086
2099
|
configuredAdcpVersion ?? (config.identity33 ? "3.3" : config.proposalNegotiation ? import_version3.ADCP_VERSION : void 0)
|
|
2087
2100
|
);
|
|
2088
2101
|
const toolVersionRanges = parseToolVersionRanges(config.toolVersions);
|
|
2089
2102
|
const toolAvailableForRelease = (toolName, release) => toolIsAvailableInRelease(toolVersionRanges, toolName, release);
|
|
2090
|
-
const movingSupportedVersion = capConfig?.supported_versions?.find(
|
|
2103
|
+
const movingSupportedVersion = capConfig?.supported_versions?.find(import_adcp_version_config2.isMovingAdcpPrereleaseFamilyAlias);
|
|
2091
2104
|
if (movingSupportedVersion) {
|
|
2092
2105
|
throw new Error(
|
|
2093
2106
|
`createAdcpServer: capabilities.supported_versions contains moving prerelease-family alias ${JSON.stringify(movingSupportedVersion)}; pin ${JSON.stringify((0, import_version2.toReleasePrecisionVersion)(import_version3.ADCP_VERSION))} instead`
|
|
2094
2107
|
);
|
|
2095
2108
|
}
|
|
2096
|
-
const configuredDefaultVersion = configuredDefaultAdcpVersion === void 0 ? void 0 : (0,
|
|
2109
|
+
const configuredDefaultVersion = configuredDefaultAdcpVersion === void 0 ? void 0 : (0, import_adcp_version_config2.resolveAdcpVersion)(configuredDefaultAdcpVersion, "defaultAdcpVersion");
|
|
2097
2110
|
const maximumRelease = parseAdcpRelease(adcpVersion);
|
|
2098
2111
|
const requestedDefaultRelease = configuredDefaultVersion === void 0 ? void 0 : parseAdcpRelease(configuredDefaultVersion);
|
|
2099
2112
|
if (maximumRelease === void 0) {
|
|
@@ -2430,8 +2443,8 @@ function createAdcpServer(config) {
|
|
|
2430
2443
|
enrichErrorTwoLayer(response, toolName, (0, import_error_arm_tools.getToolsWithErrorArm)(release.validationVersion));
|
|
2431
2444
|
if (!isErrorResponse(response)) {
|
|
2432
2445
|
response = downgradeTaskStatusResult(toolName, response, release.validationVersion);
|
|
2433
|
-
normalizeMediaBuyStatusCollision(response, toolName);
|
|
2434
|
-
injectEnvelopeStatusIntoResponse(response, toolName);
|
|
2446
|
+
normalizeMediaBuyStatusCollision(response, toolName, release.validationVersion);
|
|
2447
|
+
injectEnvelopeStatusIntoResponse(response, toolName, release.validationVersion);
|
|
2435
2448
|
const validationError = protocolTaskResponseValidationError(toolName, response, params);
|
|
2436
2449
|
if (validationError) return finalizeProtocolTaskToolResponse(toolName, params, validationError, opts);
|
|
2437
2450
|
}
|
|
@@ -2810,8 +2823,8 @@ function createAdcpServer(config) {
|
|
|
2810
2823
|
const finalizeProtocolEnvelope = (response) => {
|
|
2811
2824
|
sanitizeAdcpErrorEnvelope(response);
|
|
2812
2825
|
enrichErrorTwoLayer(response, toolName, requestErrorArms);
|
|
2813
|
-
normalizeMediaBuyStatusCollision(response, toolName);
|
|
2814
|
-
injectEnvelopeStatusIntoResponse(response, toolName);
|
|
2826
|
+
normalizeMediaBuyStatusCollision(response, toolName, requestRelease.validationVersion);
|
|
2827
|
+
injectEnvelopeStatusIntoResponse(response, toolName, requestRelease.validationVersion);
|
|
2815
2828
|
injectContextIntoResponse(response, params.context);
|
|
2816
2829
|
injectVersionIntoResponse(response, requestRelease.wireVersion);
|
|
2817
2830
|
return response;
|
|
@@ -2840,7 +2853,7 @@ function createAdcpServer(config) {
|
|
|
2840
2853
|
const offered = capabilitiesData.webhook_signing?.profiles ?? [
|
|
2841
2854
|
"adcp/webhook-signing/v1"
|
|
2842
2855
|
];
|
|
2843
|
-
if (typeof selectedProfile !== "string" || !offered.includes(selectedProfile) || selectedProfile === "web-bot-auth" && (!config.identity33 || !(0,
|
|
2856
|
+
if (typeof selectedProfile !== "string" || !offered.includes(selectedProfile) || selectedProfile === "web-bot-auth" && (!config.identity33 || !(0, import_adcp_version_config2.isAdcpVersionAtLeast)(requestRelease.wireVersion, "3.3")) || selectedProfile === "web-bot-auth" && registration.authentication !== void 0)
|
|
2844
2857
|
return finalize(
|
|
2845
2858
|
(0, import_errors2.adcpError)("INVALID_REQUEST", {
|
|
2846
2859
|
message: "Unsupported or ambiguous webhook signing profile",
|
|
@@ -3028,7 +3041,7 @@ function createAdcpServer(config) {
|
|
|
3028
3041
|
params,
|
|
3029
3042
|
requestRelease.validationVersion,
|
|
3030
3043
|
proposalRefinementCapabilities,
|
|
3031
|
-
!!config.identity33 && (0,
|
|
3044
|
+
!!config.identity33 && (0, import_adcp_version_config2.isAdcpVersionAtLeast)(requestRelease.wireVersion, "3.3")
|
|
3032
3045
|
);
|
|
3033
3046
|
if (!outcome.valid) {
|
|
3034
3047
|
if ("refinementError" in outcome && outcome.refinementError?.code === "UNSUPPORTED_FEATURE") {
|
|
@@ -3101,7 +3114,7 @@ function createAdcpServer(config) {
|
|
|
3101
3114
|
}
|
|
3102
3115
|
}
|
|
3103
3116
|
let unresolvedAccountPassThrough = false;
|
|
3104
|
-
const requireVerifiedAccountReferences = strictAccountReferences || (0,
|
|
3117
|
+
const requireVerifiedAccountReferences = strictAccountReferences || (0, import_adcp_version_config2.isAdcpVersionAtLeast)(requestRelease.validationVersion, "3.3.0-beta.0");
|
|
3105
3118
|
const suppliedAccountRef = hasAccount && params.account != null && !(requireVerifiedAccountReferences && toolName === "list_accounts");
|
|
3106
3119
|
if (suppliedAccountRef && toolName === "list_accounts") {
|
|
3107
3120
|
(0, import_account_reference_warnings.warnAccountReferenceDeprecation)(
|
|
@@ -4003,8 +4016,8 @@ function createAdcpServer(config) {
|
|
|
4003
4016
|
formatted = normalizeGetProductsCacheScope(formatted, params, ctx.account, ctx.authInfo, exposeErrorDetails) ?? formatted;
|
|
4004
4017
|
}
|
|
4005
4018
|
if (!isErrorResponse(formatted)) {
|
|
4006
|
-
normalizeMediaBuyStatusCollision(formatted, toolName);
|
|
4007
|
-
injectEnvelopeStatusIntoResponse(formatted, toolName);
|
|
4019
|
+
normalizeMediaBuyStatusCollision(formatted, toolName, adcpVersion);
|
|
4020
|
+
injectEnvelopeStatusIntoResponse(formatted, toolName, adcpVersion);
|
|
4008
4021
|
}
|
|
4009
4022
|
}
|
|
4010
4023
|
if (translatesRelease && !isErrorResponse(formatted) && formatted.structuredContent) {
|
|
@@ -4040,7 +4053,7 @@ function createAdcpServer(config) {
|
|
|
4040
4053
|
payload,
|
|
4041
4054
|
requestRelease.validationVersion,
|
|
4042
4055
|
void 0,
|
|
4043
|
-
!!config.identity33 && (0,
|
|
4056
|
+
!!config.identity33 && (0, import_adcp_version_config2.isAdcpVersionAtLeast)(requestRelease.wireVersion, "3.3")
|
|
4044
4057
|
);
|
|
4045
4058
|
if (!outcome.valid) {
|
|
4046
4059
|
logger.warn(
|
|
@@ -4935,7 +4948,7 @@ function createAdcpServer(config) {
|
|
|
4935
4948
|
delete validationPayload.media_buy.proposal_refinement;
|
|
4936
4949
|
delete validationPayload.media_buy.lifecycle_tools;
|
|
4937
4950
|
}
|
|
4938
|
-
const responseOutcome = config.identity33 && (0,
|
|
4951
|
+
const responseOutcome = config.identity33 && (0, import_adcp_version_config2.isAdcpVersionAtLeast)(release.wireVersion, "3.3") ? (0, import_validation.validateIdentity33Payload)(
|
|
4939
4952
|
"get_adcp_capabilities",
|
|
4940
4953
|
"response",
|
|
4941
4954
|
validationPayload,
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { isPre31AdcpVersion } from "../utils/adcp-version-config.mjs";
|
|
1
2
|
import { assertWebBotAuthSigningKey, getWebBotAuthLegacyOriginGate } from "../signing/web-bot-auth.mjs";
|
|
2
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
downgradeResponse,
|
|
5
|
+
getVersionAdapter,
|
|
6
|
+
translationSteps,
|
|
7
|
+
upgradeRequest
|
|
8
|
+
} from "../adapters/version/index.mjs";
|
|
3
9
|
import {
|
|
4
10
|
isIdentity33SchemaScope,
|
|
5
11
|
withIdentity33SchemaScope,
|
|
@@ -37,7 +43,13 @@ import {
|
|
|
37
43
|
resolveAdcpVersion
|
|
38
44
|
} from "../utils/adcp-version-config.mjs";
|
|
39
45
|
import { ConfigurationError } from "../errors/index.mjs";
|
|
40
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
getValidator,
|
|
48
|
+
getToolSchemaDocument,
|
|
49
|
+
hasSchemaBundle,
|
|
50
|
+
resolveBundleKey,
|
|
51
|
+
getMcpProfileInputSchema
|
|
52
|
+
} from "../validation/schema-loader.mjs";
|
|
41
53
|
import { TOOL_INPUT_SHAPES } from "../schemas/index.mjs";
|
|
42
54
|
import { TaskTypeValues } from "../types/enums.generated.mjs";
|
|
43
55
|
import { bundleSupportsAdcpVersionField } from "../protocols/index.mjs";
|
|
@@ -1053,8 +1065,7 @@ function projectValueToCapabilitySchema(root, schema, value, depth = 0) {
|
|
|
1053
1065
|
return projectedObject;
|
|
1054
1066
|
}
|
|
1055
1067
|
function projectCapabilitiesToVersion(data, version) {
|
|
1056
|
-
const
|
|
1057
|
-
const schema = asProjectionSchema(validator?.schema);
|
|
1068
|
+
const schema = asProjectionSchema(getToolSchemaDocument("get_adcp_capabilities", "sync", version)?.schema);
|
|
1058
1069
|
if (!schema) return data;
|
|
1059
1070
|
const projected = projectValueToCapabilitySchema(schema, schema, data);
|
|
1060
1071
|
if (!isPlainObject(projected)) return data;
|
|
@@ -1483,7 +1494,9 @@ function injectContextIntoResponse(response, context) {
|
|
|
1483
1494
|
syncContentJsonText(response, sc, mirrorsStructuredContent);
|
|
1484
1495
|
}
|
|
1485
1496
|
}
|
|
1486
|
-
function injectEnvelopeStatusIntoResponse(response, toolName) {
|
|
1497
|
+
function injectEnvelopeStatusIntoResponse(response, toolName, servedVersion) {
|
|
1498
|
+
if (servedVersion && isPre31AdcpVersion(servedVersion) && MEDIA_BUY_RESPONSE_TOOLS_REQUIRING_STATUS_SPLIT.has(toolName) && response.isError !== true)
|
|
1499
|
+
return;
|
|
1487
1500
|
const sc = response.structuredContent;
|
|
1488
1501
|
if (!sc || typeof sc !== "object") return;
|
|
1489
1502
|
if ("status" in sc) return;
|
|
@@ -1507,12 +1520,23 @@ const MEDIA_BUY_STATUS_VALUES = /* @__PURE__ */ new Set([
|
|
|
1507
1520
|
"rejected",
|
|
1508
1521
|
"canceled"
|
|
1509
1522
|
]);
|
|
1510
|
-
function normalizeMediaBuyStatusCollision(response, toolName) {
|
|
1523
|
+
function normalizeMediaBuyStatusCollision(response, toolName, servedVersion) {
|
|
1511
1524
|
if (!MEDIA_BUY_RESPONSE_TOOLS_REQUIRING_STATUS_SPLIT.has(toolName)) return;
|
|
1512
1525
|
const sc = response.structuredContent;
|
|
1513
1526
|
if (!sc || typeof sc !== "object") return;
|
|
1527
|
+
if (servedVersion && isPre31AdcpVersion(servedVersion)) {
|
|
1528
|
+
const adapted = typeof sc.media_buy_status === "string" ? getVersionAdapter("3.0", toolName)?.downgradeResponse?.(sc) : void 0;
|
|
1529
|
+
if (adapted && adapted.data !== sc && adapted.data && typeof adapted.data === "object") {
|
|
1530
|
+
const mirrors = contentTextMirrorsStructuredContent(response, sc);
|
|
1531
|
+
response.structuredContent = adapted.data;
|
|
1532
|
+
syncContentJsonText(response, response.structuredContent, mirrors);
|
|
1533
|
+
}
|
|
1534
|
+
return;
|
|
1535
|
+
}
|
|
1514
1536
|
const status = sc.status;
|
|
1515
1537
|
if (typeof status !== "string" || !MEDIA_BUY_STATUS_VALUES.has(status)) return;
|
|
1538
|
+
if (servedVersion && sc.media_buy_status === void 0 && (status === "completed" || status === "rejected" || status === "canceled"))
|
|
1539
|
+
return;
|
|
1516
1540
|
const looksLikeMediaBuyPayload = typeof sc.media_buy_id === "string" || "media_buy_status" in sc || Array.isArray(sc.packages);
|
|
1517
1541
|
if (!looksLikeMediaBuyPayload) return;
|
|
1518
1542
|
const mirrorsStructuredContent = contentTextMirrorsStructuredContent(response, sc);
|
|
@@ -2521,8 +2545,8 @@ function createAdcpServer(config) {
|
|
|
2521
2545
|
enrichErrorTwoLayer(response, toolName, getToolsWithErrorArm(release.validationVersion));
|
|
2522
2546
|
if (!isErrorResponse(response)) {
|
|
2523
2547
|
response = downgradeTaskStatusResult(toolName, response, release.validationVersion);
|
|
2524
|
-
normalizeMediaBuyStatusCollision(response, toolName);
|
|
2525
|
-
injectEnvelopeStatusIntoResponse(response, toolName);
|
|
2548
|
+
normalizeMediaBuyStatusCollision(response, toolName, release.validationVersion);
|
|
2549
|
+
injectEnvelopeStatusIntoResponse(response, toolName, release.validationVersion);
|
|
2526
2550
|
const validationError = protocolTaskResponseValidationError(toolName, response, params);
|
|
2527
2551
|
if (validationError) return finalizeProtocolTaskToolResponse(toolName, params, validationError, opts);
|
|
2528
2552
|
}
|
|
@@ -2901,8 +2925,8 @@ function createAdcpServer(config) {
|
|
|
2901
2925
|
const finalizeProtocolEnvelope = (response) => {
|
|
2902
2926
|
sanitizeAdcpErrorEnvelope(response);
|
|
2903
2927
|
enrichErrorTwoLayer(response, toolName, requestErrorArms);
|
|
2904
|
-
normalizeMediaBuyStatusCollision(response, toolName);
|
|
2905
|
-
injectEnvelopeStatusIntoResponse(response, toolName);
|
|
2928
|
+
normalizeMediaBuyStatusCollision(response, toolName, requestRelease.validationVersion);
|
|
2929
|
+
injectEnvelopeStatusIntoResponse(response, toolName, requestRelease.validationVersion);
|
|
2906
2930
|
injectContextIntoResponse(response, params.context);
|
|
2907
2931
|
injectVersionIntoResponse(response, requestRelease.wireVersion);
|
|
2908
2932
|
return response;
|
|
@@ -4094,8 +4118,8 @@ function createAdcpServer(config) {
|
|
|
4094
4118
|
formatted = normalizeGetProductsCacheScope(formatted, params, ctx.account, ctx.authInfo, exposeErrorDetails) ?? formatted;
|
|
4095
4119
|
}
|
|
4096
4120
|
if (!isErrorResponse(formatted)) {
|
|
4097
|
-
normalizeMediaBuyStatusCollision(formatted, toolName);
|
|
4098
|
-
injectEnvelopeStatusIntoResponse(formatted, toolName);
|
|
4121
|
+
normalizeMediaBuyStatusCollision(formatted, toolName, adcpVersion);
|
|
4122
|
+
injectEnvelopeStatusIntoResponse(formatted, toolName, adcpVersion);
|
|
4099
4123
|
}
|
|
4100
4124
|
}
|
|
4101
4125
|
if (translatesRelease && !isErrorResponse(formatted) && formatted.structuredContent) {
|
|
@@ -633,11 +633,10 @@ export interface AccountStore<TCtxMeta = Record<string, unknown>> {
|
|
|
633
633
|
* already run, and note the framework performs no such check for
|
|
634
634
|
* `'explicit'` / `'implicit'`, where the entry key is buyer-declared.
|
|
635
635
|
*
|
|
636
|
-
* **
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
* adcontextprotocol/adcp#7517.
|
|
636
|
+
* **Echo the selected release's identity anchor.** AdCP 3.2+ settings-update
|
|
637
|
+
* rows carry `account` instead of flat `brand` + `operator`; provisioning
|
|
638
|
+
* rows carry the natural key. Older releases require `brand` + `operator`
|
|
639
|
+
* on every row. Failed 3.2+ rows may omit an unknown lifecycle `status`.
|
|
641
640
|
*
|
|
642
641
|
* In AdCP 3.1 beta, adopters that need settings-update entries with
|
|
643
642
|
* `notification_configs[]` can read the full wire body from `ctx.input`
|
|
@@ -890,18 +889,26 @@ export type AccountFilter = ListAccountsRequest;
|
|
|
890
889
|
* returned rows — same MUST-NOT-LEAK rule the framework enforces on
|
|
891
890
|
* `Account.authInfo`.
|
|
892
891
|
*/
|
|
893
|
-
|
|
892
|
+
interface SyncAccountsResultFields {
|
|
894
893
|
account_id?: string;
|
|
895
|
-
|
|
896
|
-
|
|
894
|
+
/** Current canonical operator unit, distinct from the seller account ID. */
|
|
895
|
+
operator_unit?: SyncAccountsRow['operator_unit'];
|
|
896
|
+
/** Current persisted account revision, including during a dry-run preview. */
|
|
897
|
+
revision?: SyncAccountsRow['revision'];
|
|
898
|
+
/** Pending or rejected desired identity; canonical fields remain unchanged. */
|
|
899
|
+
identity_change?: SyncAccountsRow['identity_change'];
|
|
900
|
+
/** Non-persisted evaluation of an identity change requested in a dry run. */
|
|
901
|
+
identity_change_preview?: SyncAccountsRow['identity_change_preview'];
|
|
902
|
+
currency?: SyncAccountsRow['currency'];
|
|
903
|
+
timezone?: SyncAccountsRow['timezone'];
|
|
897
904
|
/** Human-readable account name assigned by the seller. */
|
|
898
905
|
name?: string;
|
|
899
|
-
action: 'created' | 'updated' | 'unchanged' | 'failed';
|
|
900
|
-
status: AdcpAccountStatus;
|
|
901
906
|
/** Invoiced-to party. Echoes the request's `billing` after seller acceptance. */
|
|
902
907
|
billing?: BillingParty;
|
|
903
908
|
/** Business entity invoiced. `bank` is stripped on emit (write-only). */
|
|
904
909
|
billing_entity?: BusinessEntity;
|
|
910
|
+
/** Request-only staging data. The entire field MUST NOT appear in responses. */
|
|
911
|
+
destination_billing_entity?: never;
|
|
905
912
|
account_scope?: AccountScope;
|
|
906
913
|
/** Setup payload for `pending_approval` accounts (URL/message/expiry). */
|
|
907
914
|
setup?: WireAccount['setup'];
|
|
@@ -926,6 +933,25 @@ export interface SyncAccountsResultRow {
|
|
|
926
933
|
warnings?: string[];
|
|
927
934
|
sandbox?: boolean;
|
|
928
935
|
}
|
|
936
|
+
/**
|
|
937
|
+
* Provisioning results use the natural key; 3.2+ settings-update results use
|
|
938
|
+
* account instead. Only failed results can omit an unknown lifecycle status.
|
|
939
|
+
*/
|
|
940
|
+
export type SyncAccountsResultRow = SyncAccountsResultFields & ({
|
|
941
|
+
account: NonNullable<SyncAccountsRow['account']>;
|
|
942
|
+
brand?: never;
|
|
943
|
+
operator?: never;
|
|
944
|
+
} | {
|
|
945
|
+
account?: never;
|
|
946
|
+
brand: BrandReference;
|
|
947
|
+
operator: string;
|
|
948
|
+
}) & ({
|
|
949
|
+
action: 'failed';
|
|
950
|
+
status?: AdcpAccountStatus;
|
|
951
|
+
} | {
|
|
952
|
+
action: 'created' | 'updated' | 'unchanged';
|
|
953
|
+
status: AdcpAccountStatus;
|
|
954
|
+
});
|
|
929
955
|
export type AdcpAccountStatus = 'active' | 'pending_approval' | 'rejected' | 'payment_required' | 'suspended' | 'closed';
|
|
930
956
|
/**
|
|
931
957
|
* Project a framework `Account<TCtxMeta>` to the wire `Account` shape.
|
|
@@ -633,11 +633,10 @@ export interface AccountStore<TCtxMeta = Record<string, unknown>> {
|
|
|
633
633
|
* already run, and note the framework performs no such check for
|
|
634
634
|
* `'explicit'` / `'implicit'`, where the entry key is buyer-declared.
|
|
635
635
|
*
|
|
636
|
-
* **
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
* adcontextprotocol/adcp#7517.
|
|
636
|
+
* **Echo the selected release's identity anchor.** AdCP 3.2+ settings-update
|
|
637
|
+
* rows carry `account` instead of flat `brand` + `operator`; provisioning
|
|
638
|
+
* rows carry the natural key. Older releases require `brand` + `operator`
|
|
639
|
+
* on every row. Failed 3.2+ rows may omit an unknown lifecycle `status`.
|
|
641
640
|
*
|
|
642
641
|
* In AdCP 3.1 beta, adopters that need settings-update entries with
|
|
643
642
|
* `notification_configs[]` can read the full wire body from `ctx.input`
|
|
@@ -890,18 +889,26 @@ export type AccountFilter = ListAccountsRequest;
|
|
|
890
889
|
* returned rows — same MUST-NOT-LEAK rule the framework enforces on
|
|
891
890
|
* `Account.authInfo`.
|
|
892
891
|
*/
|
|
893
|
-
|
|
892
|
+
interface SyncAccountsResultFields {
|
|
894
893
|
account_id?: string;
|
|
895
|
-
|
|
896
|
-
|
|
894
|
+
/** Current canonical operator unit, distinct from the seller account ID. */
|
|
895
|
+
operator_unit?: SyncAccountsRow['operator_unit'];
|
|
896
|
+
/** Current persisted account revision, including during a dry-run preview. */
|
|
897
|
+
revision?: SyncAccountsRow['revision'];
|
|
898
|
+
/** Pending or rejected desired identity; canonical fields remain unchanged. */
|
|
899
|
+
identity_change?: SyncAccountsRow['identity_change'];
|
|
900
|
+
/** Non-persisted evaluation of an identity change requested in a dry run. */
|
|
901
|
+
identity_change_preview?: SyncAccountsRow['identity_change_preview'];
|
|
902
|
+
currency?: SyncAccountsRow['currency'];
|
|
903
|
+
timezone?: SyncAccountsRow['timezone'];
|
|
897
904
|
/** Human-readable account name assigned by the seller. */
|
|
898
905
|
name?: string;
|
|
899
|
-
action: 'created' | 'updated' | 'unchanged' | 'failed';
|
|
900
|
-
status: AdcpAccountStatus;
|
|
901
906
|
/** Invoiced-to party. Echoes the request's `billing` after seller acceptance. */
|
|
902
907
|
billing?: BillingParty;
|
|
903
908
|
/** Business entity invoiced. `bank` is stripped on emit (write-only). */
|
|
904
909
|
billing_entity?: BusinessEntity;
|
|
910
|
+
/** Request-only staging data. The entire field MUST NOT appear in responses. */
|
|
911
|
+
destination_billing_entity?: never;
|
|
905
912
|
account_scope?: AccountScope;
|
|
906
913
|
/** Setup payload for `pending_approval` accounts (URL/message/expiry). */
|
|
907
914
|
setup?: WireAccount['setup'];
|
|
@@ -926,6 +933,25 @@ export interface SyncAccountsResultRow {
|
|
|
926
933
|
warnings?: string[];
|
|
927
934
|
sandbox?: boolean;
|
|
928
935
|
}
|
|
936
|
+
/**
|
|
937
|
+
* Provisioning results use the natural key; 3.2+ settings-update results use
|
|
938
|
+
* account instead. Only failed results can omit an unknown lifecycle status.
|
|
939
|
+
*/
|
|
940
|
+
export type SyncAccountsResultRow = SyncAccountsResultFields & ({
|
|
941
|
+
account: NonNullable<SyncAccountsRow['account']>;
|
|
942
|
+
brand?: never;
|
|
943
|
+
operator?: never;
|
|
944
|
+
} | {
|
|
945
|
+
account?: never;
|
|
946
|
+
brand: BrandReference;
|
|
947
|
+
operator: string;
|
|
948
|
+
}) & ({
|
|
949
|
+
action: 'failed';
|
|
950
|
+
status?: AdcpAccountStatus;
|
|
951
|
+
} | {
|
|
952
|
+
action: 'created' | 'updated' | 'unchanged';
|
|
953
|
+
status: AdcpAccountStatus;
|
|
954
|
+
});
|
|
929
955
|
export type AdcpAccountStatus = 'active' | 'pending_approval' | 'rejected' | 'payment_required' | 'suspended' | 'closed';
|
|
930
956
|
/**
|
|
931
957
|
* Project a framework `Account<TCtxMeta>` to the wire `Account` shape.
|
|
@@ -30,6 +30,7 @@ __export(account_exports, {
|
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(account_exports);
|
|
32
32
|
var import_reporting_delivery_config = require('../reporting-delivery-config.js');
|
|
33
|
+
var import_account_response_identity = require('../account-response-identity.js');
|
|
33
34
|
const ACCOUNT_AUTHORIZATION_WIRE_KEYS = [
|
|
34
35
|
"allowed_tasks",
|
|
35
36
|
"field_scopes",
|
|
@@ -50,6 +51,30 @@ class AccountNotFoundError extends Error {
|
|
|
50
51
|
super(message);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
54
|
+
const SYNC_ACCOUNT_PASSTHROUGH_KEYS = [
|
|
55
|
+
"account_id",
|
|
56
|
+
"brand",
|
|
57
|
+
"operator",
|
|
58
|
+
"revision",
|
|
59
|
+
"currency",
|
|
60
|
+
"timezone",
|
|
61
|
+
"name",
|
|
62
|
+
"action",
|
|
63
|
+
"status",
|
|
64
|
+
"billing",
|
|
65
|
+
"account_scope",
|
|
66
|
+
"setup",
|
|
67
|
+
"rate_card",
|
|
68
|
+
"payment_terms",
|
|
69
|
+
"credit_limit",
|
|
70
|
+
"errors",
|
|
71
|
+
"warnings",
|
|
72
|
+
"sandbox"
|
|
73
|
+
];
|
|
74
|
+
const SYNC_ACCOUNTS_RESULT_KEY_COVERAGE = {};
|
|
75
|
+
void SYNC_ACCOUNTS_RESULT_KEY_COVERAGE;
|
|
76
|
+
const SYNC_ACCOUNTS_PROJECTION_KEY_COVERAGE = {};
|
|
77
|
+
void SYNC_ACCOUNTS_PROJECTION_KEY_COVERAGE;
|
|
53
78
|
function toWireAccount(account) {
|
|
54
79
|
const wire = {
|
|
55
80
|
account_id: account.id,
|
|
@@ -107,22 +132,19 @@ function projectAccountAuthorization(authorization) {
|
|
|
107
132
|
return projected;
|
|
108
133
|
}
|
|
109
134
|
function toWireSyncAccountRow(row) {
|
|
135
|
+
const identity = (0, import_account_response_identity.projectAccountResponseIdentityFields)(row);
|
|
110
136
|
const wire = {
|
|
111
|
-
brand: row.brand,
|
|
112
|
-
operator: row.operator,
|
|
113
137
|
action: row.action,
|
|
114
|
-
|
|
138
|
+
...identity
|
|
115
139
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
140
|
+
const source = row;
|
|
141
|
+
function copyField(key) {
|
|
142
|
+
const value = source[key];
|
|
143
|
+
if (value !== void 0) wire[key] = value;
|
|
144
|
+
}
|
|
145
|
+
for (const key of SYNC_ACCOUNT_PASSTHROUGH_KEYS) copyField(key);
|
|
119
146
|
const projectedEntity = projectBillingEntity(row.billing_entity);
|
|
120
147
|
if (projectedEntity !== void 0) wire.billing_entity = projectedEntity;
|
|
121
|
-
if (row.account_scope !== void 0) wire.account_scope = row.account_scope;
|
|
122
|
-
if (row.setup !== void 0) wire.setup = row.setup;
|
|
123
|
-
if (row.rate_card !== void 0) wire.rate_card = row.rate_card;
|
|
124
|
-
if (row.payment_terms !== void 0) wire.payment_terms = row.payment_terms;
|
|
125
|
-
if (row.credit_limit !== void 0) wire.credit_limit = row.credit_limit;
|
|
126
148
|
if (row.notification_configs !== void 0) {
|
|
127
149
|
wire.notification_configs = row.notification_configs.map(projectNotificationConfig);
|
|
128
150
|
}
|
|
@@ -134,9 +156,6 @@ function toWireSyncAccountRow(row) {
|
|
|
134
156
|
row.authorization
|
|
135
157
|
);
|
|
136
158
|
}
|
|
137
|
-
if (row.errors !== void 0) wire.errors = row.errors;
|
|
138
|
-
if (row.warnings !== void 0) wire.warnings = row.warnings;
|
|
139
|
-
if (row.sandbox !== void 0) wire.sandbox = row.sandbox;
|
|
140
159
|
return wire;
|
|
141
160
|
}
|
|
142
161
|
function projectNotificationConfig(config) {
|