@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
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getValidator,
|
|
3
|
+
getValidatorDiagnosticOrigin,
|
|
4
|
+
getRegisteredSchemaIds
|
|
5
|
+
} from "./schema-loader.mjs";
|
|
2
6
|
import { findHint } from "./hints.mjs";
|
|
3
7
|
import { injectLegacyEnvelopeStatus } from "../utils/envelope-status-compat.mjs";
|
|
4
8
|
import { boundValidationIssues } from "./diagnostic-limits.mjs";
|
|
@@ -19,17 +23,18 @@ function extractSchemaId(schemaPath, rootSchema, registeredIds) {
|
|
|
19
23
|
}
|
|
20
24
|
function formatIssue(err, ctx) {
|
|
21
25
|
const instancePath = err.instancePath || "";
|
|
22
|
-
const missingProperty = err.keyword === "required" && err.params && typeof err.params.missingProperty === "string" ? `/${err.params.missingProperty}` : "";
|
|
26
|
+
const missingProperty = err.keyword === "required" && err.params && typeof err.params.missingProperty === "string" ? `/${err.params.missingProperty.replace(/~/g, "~0").replace(/\//g, "~1")}` : "";
|
|
23
27
|
const isEnum = err.keyword === "enum" && err.params != null && Array.isArray(err.params.allowedValues);
|
|
24
28
|
const allowedValues = isEnum ? err.params.allowedValues : void 0;
|
|
25
29
|
const message = isEnum ? `must be one of: ${allowedValues.map((v) => JSON.stringify(v)).join(", ")}` : err.message ?? "validation failed";
|
|
26
|
-
const
|
|
30
|
+
const origin = ctx.diagnosticOrigin?.(err.__adcp_originSchemaPath ?? err.schemaPath);
|
|
31
|
+
const schemaId = origin ? origin.schemaId : extractSchemaId(err.schemaPath, ctx.rootSchema, ctx.registeredIds) ?? ctx.rootSchemaId;
|
|
27
32
|
const discriminator = err.__adcp_discriminator;
|
|
28
33
|
const issue = {
|
|
29
34
|
pointer: `${instancePath}${missingProperty}` || "/",
|
|
30
35
|
message,
|
|
31
36
|
keyword: err.keyword,
|
|
32
|
-
schemaPath: err.schemaPath,
|
|
37
|
+
schemaPath: err.schemaPath === "" ? "" : origin?.schemaPath ?? err.schemaPath,
|
|
33
38
|
...schemaId !== void 0 && { schemaId },
|
|
34
39
|
...discriminator !== void 0 && discriminator.length > 0 && { discriminator },
|
|
35
40
|
...allowedValues !== void 0 && { allowedValues }
|
|
@@ -38,24 +43,19 @@ function formatIssue(err, ctx) {
|
|
|
38
43
|
if (hint !== void 0) issue.hint = hint;
|
|
39
44
|
return issue;
|
|
40
45
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (FORBIDDEN_SCHEMA_PATH_SEGMENTS.has(decoded)) return void 0;
|
|
51
|
-
if (!Object.prototype.hasOwnProperty.call(cursor, decoded)) return void 0;
|
|
52
|
-
cursor = cursor[decoded];
|
|
53
|
-
}
|
|
54
|
-
return cursor;
|
|
46
|
+
function createDiagnosticOriginResolver(validator) {
|
|
47
|
+
const memo = /* @__PURE__ */ new Map();
|
|
48
|
+
return (schemaPath) => {
|
|
49
|
+
if (memo.has(schemaPath)) return memo.get(schemaPath);
|
|
50
|
+
if (memo.size >= 1024) return void 0;
|
|
51
|
+
const resolved = getValidatorDiagnosticOrigin(validator, schemaPath);
|
|
52
|
+
memo.set(schemaPath, resolved);
|
|
53
|
+
return resolved;
|
|
54
|
+
};
|
|
55
55
|
}
|
|
56
|
-
function* expandNotErrors(errors,
|
|
56
|
+
function* expandNotErrors(errors, resolveDiagnosticPath, payload) {
|
|
57
57
|
for (const error of errors) {
|
|
58
|
-
const rule = error.keyword === "not" ?
|
|
58
|
+
const rule = error.keyword === "not" ? resolveDiagnosticPath(error.instancePath, error.schemaPath) : void 0;
|
|
59
59
|
const branches = rule && typeof rule === "object" ? rule.anyOf : void 0;
|
|
60
60
|
if (!Array.isArray(branches) || branches.length === 0 || Object.keys(rule).length !== 1) {
|
|
61
61
|
yield error;
|
|
@@ -99,47 +99,118 @@ function* expandNotErrors(errors, rootSchema, payload) {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
function formatValidationIssues(errors, ctx, payload) {
|
|
102
|
+
const resolveDiagnosticPath = (_instancePath, path) => ctx.diagnosticOrigin?.(path)?.schema;
|
|
102
103
|
function* formatted() {
|
|
103
|
-
for (const error of expandNotErrors(
|
|
104
|
-
|
|
104
|
+
for (const error of expandNotErrors(
|
|
105
|
+
compactUnionErrors(errors, resolveDiagnosticPath),
|
|
106
|
+
resolveDiagnosticPath,
|
|
107
|
+
payload
|
|
108
|
+
)) {
|
|
109
|
+
yield enrichWithVariants(
|
|
110
|
+
formatIssue(error, ctx),
|
|
111
|
+
(_instance, _publicPath) => resolveDiagnosticPath(error.instancePath, error.schemaPath)
|
|
112
|
+
);
|
|
105
113
|
}
|
|
106
114
|
}
|
|
107
115
|
return ctx.toolName === "sync_accounts" ? [...formatted()] : boundValidationIssues(formatted());
|
|
108
116
|
}
|
|
109
|
-
function
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
function inlineUnionOwner(error, unionPath, variants) {
|
|
118
|
+
const instance = error.instancePath ? error.instancePath.slice(1).split("/") : [];
|
|
119
|
+
let pointer;
|
|
120
|
+
try {
|
|
121
|
+
pointer = error.schemaPath.slice(unionPath.length + 1).split("/").map((segment) => decodeURIComponent(segment).replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
122
|
+
} catch {
|
|
123
|
+
return void 0;
|
|
124
|
+
}
|
|
125
|
+
let cursor = variants;
|
|
126
|
+
const consumed = [];
|
|
127
|
+
for (let index = 0; index < pointer.length - 1; index++) {
|
|
128
|
+
if (!cursor || typeof cursor !== "object") return void 0;
|
|
129
|
+
const keyword = pointer[index];
|
|
130
|
+
if (!Array.isArray(cursor) && ["properties", "patternProperties"].includes(keyword)) {
|
|
131
|
+
const property = pointer[++index];
|
|
132
|
+
if (property === void 0) return void 0;
|
|
133
|
+
consumed.push(keyword === "properties" ? property : void 0);
|
|
134
|
+
cursor = cursor[keyword]?.[property];
|
|
135
|
+
} else if (!Array.isArray(cursor) && [
|
|
136
|
+
"items",
|
|
137
|
+
"prefixItems",
|
|
138
|
+
"additionalItems",
|
|
139
|
+
"contains",
|
|
140
|
+
"additionalProperties",
|
|
141
|
+
"unevaluatedProperties",
|
|
142
|
+
"unevaluatedItems"
|
|
143
|
+
].includes(keyword)) {
|
|
144
|
+
consumed.push(void 0);
|
|
145
|
+
cursor = cursor[keyword];
|
|
146
|
+
if (Array.isArray(cursor)) cursor = cursor[Number(pointer[++index])];
|
|
147
|
+
} else cursor = cursor[keyword];
|
|
119
148
|
}
|
|
149
|
+
if (consumed.length > instance.length) return void 0;
|
|
150
|
+
for (let index = 0; index < consumed.length; index++) {
|
|
151
|
+
const expected = consumed[index];
|
|
152
|
+
const actual = instance[instance.length - consumed.length + index].replace(/~1/g, "/").replace(/~0/g, "~");
|
|
153
|
+
if (expected !== void 0 && actual !== expected) return void 0;
|
|
154
|
+
}
|
|
155
|
+
return consumed.length ? instance.length === consumed.length ? "" : "/" + instance.slice(0, -consumed.length).join("/") : error.instancePath;
|
|
156
|
+
}
|
|
157
|
+
function compactUnionErrors(errors, resolveDiagnosticPath) {
|
|
158
|
+
if (errors.length === 0) return [...errors];
|
|
120
159
|
const dropped = /* @__PURE__ */ new Set();
|
|
121
160
|
const added = [];
|
|
122
|
-
const unionRoots = errors.filter((e) => e.keyword === "oneOf" || e.keyword === "anyOf").slice().sort((a, b) => b.schemaPath.length - a.schemaPath.length);
|
|
161
|
+
const unionRoots = errors.filter((e) => e.keyword === "oneOf" || e.keyword === "anyOf").slice().sort((a, b) => b.instancePath.length - a.instancePath.length || b.schemaPath.length - a.schemaPath.length);
|
|
162
|
+
const unionOwners = /* @__PURE__ */ new Map();
|
|
163
|
+
for (const root of unionRoots) {
|
|
164
|
+
const owners = unionOwners.get(root.schemaPath) ?? /* @__PURE__ */ new Set();
|
|
165
|
+
owners.add(root.instancePath);
|
|
166
|
+
unionOwners.set(root.schemaPath, owners);
|
|
167
|
+
}
|
|
168
|
+
const errorsByOwner = /* @__PURE__ */ new Map();
|
|
169
|
+
for (const error of errors) {
|
|
170
|
+
const match = error.schemaPath.match(/^(.*\/(?:oneOf|anyOf))\/\d+(?:\/|$)/);
|
|
171
|
+
if (!match) continue;
|
|
172
|
+
const schemaPath = match[1];
|
|
173
|
+
const owners = unionOwners.get(schemaPath);
|
|
174
|
+
if (!owners) continue;
|
|
175
|
+
const variants = resolveDiagnosticPath(error.instancePath, schemaPath);
|
|
176
|
+
const nearest = inlineUnionOwner(error, schemaPath, variants);
|
|
177
|
+
if (nearest === void 0 || !owners.has(nearest)) continue;
|
|
178
|
+
const locations = errorsByOwner.get(schemaPath) ?? /* @__PURE__ */ new Map();
|
|
179
|
+
const bucket = locations.get(nearest) ?? [];
|
|
180
|
+
bucket.push(error);
|
|
181
|
+
locations.set(nearest, bucket);
|
|
182
|
+
errorsByOwner.set(schemaPath, locations);
|
|
183
|
+
}
|
|
184
|
+
const processedRoots = /* @__PURE__ */ new Map();
|
|
123
185
|
for (const root of unionRoots) {
|
|
124
186
|
if (dropped.has(root)) continue;
|
|
125
187
|
const oneOfPath = root.schemaPath;
|
|
126
188
|
const rootInstance = root.instancePath;
|
|
127
|
-
|
|
189
|
+
if (root.keyword === "oneOf" && Array.isArray(root.params.passingSchemas) && root.params.passingSchemas.length > 1)
|
|
190
|
+
continue;
|
|
191
|
+
const variantSchemas = resolveDiagnosticPath(rootInstance, oneOfPath);
|
|
192
|
+
if (!Array.isArray(variantSchemas)) continue;
|
|
193
|
+
const processed = processedRoots.get(oneOfPath) ?? /* @__PURE__ */ new Set();
|
|
194
|
+
if (processed.has(rootInstance)) {
|
|
195
|
+
dropped.add(root);
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
processed.add(rootInstance);
|
|
199
|
+
processedRoots.set(oneOfPath, processed);
|
|
200
|
+
const candidateErrors = errorsByOwner.get(oneOfPath)?.get(rootInstance) ?? [];
|
|
128
201
|
const byVariant = /* @__PURE__ */ new Map();
|
|
129
202
|
for (const e of candidateErrors) {
|
|
130
203
|
if (e === root || dropped.has(e)) continue;
|
|
131
204
|
const tail = e.schemaPath.slice(oneOfPath.length + 1);
|
|
132
205
|
const m = tail.match(/^(\d+)(?:\/|$)/);
|
|
133
206
|
if (!m) continue;
|
|
134
|
-
if (e.instancePath !== rootInstance && !e.instancePath.startsWith(rootInstance + "/")) continue;
|
|
135
207
|
const idx = parseInt(m[1], 10);
|
|
136
208
|
const bucket = byVariant.get(idx);
|
|
137
209
|
if (bucket) bucket.push(e);
|
|
138
210
|
else byVariant.set(idx, [e]);
|
|
139
211
|
}
|
|
140
212
|
if (byVariant.size === 0) continue;
|
|
141
|
-
const
|
|
142
|
-
const variantArr = Array.isArray(variantSchemas) ? variantSchemas : [];
|
|
213
|
+
const variantArr = variantSchemas;
|
|
143
214
|
const constAsserters = /* @__PURE__ */ new Map();
|
|
144
215
|
for (let i = 0; i < variantArr.length; i++) {
|
|
145
216
|
const variant = variantArr[i];
|
|
@@ -186,6 +257,7 @@ function compactUnionErrors(errors, rootSchema) {
|
|
|
186
257
|
...sample,
|
|
187
258
|
keyword: "enum",
|
|
188
259
|
schemaPath: "",
|
|
260
|
+
__adcp_originSchemaPath: sample.schemaPath,
|
|
189
261
|
message: `must be one of: ${allowedValues.map((v) => JSON.stringify(v)).join(", ")}`,
|
|
190
262
|
params: { allowedValues }
|
|
191
263
|
});
|
|
@@ -216,12 +288,23 @@ function compactUnionErrors(errors, rootSchema) {
|
|
|
216
288
|
}
|
|
217
289
|
}
|
|
218
290
|
}
|
|
219
|
-
const allVariantsHaveNot = variantsWithNotFailure.size ===
|
|
291
|
+
const allVariantsHaveNot = variantsWithNotFailure.size === variantSchemas.length && variantSchemas.length > 0;
|
|
292
|
+
const contradictedVariants = /* @__PURE__ */ new Set();
|
|
293
|
+
for (const [relativePath, asserters] of constAsserters) {
|
|
294
|
+
const emitted = /* @__PURE__ */ new Set();
|
|
295
|
+
for (const [index, residual] of residualByVariant) {
|
|
296
|
+
if (residual.some((error) => error.keyword === "const" && error.instancePath === rootInstance + relativePath))
|
|
297
|
+
emitted.add(index);
|
|
298
|
+
}
|
|
299
|
+
if ([...asserters.keys()].some((index) => !emitted.has(index))) {
|
|
300
|
+
for (const index of emitted) if (asserters.has(index)) contradictedVariants.add(index);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
220
303
|
let bestIdx = -1;
|
|
221
304
|
let bestCount = Infinity;
|
|
222
305
|
let bestConsts = Infinity;
|
|
223
306
|
for (const [idx, residual] of residualByVariant) {
|
|
224
|
-
if (!allVariantsHaveNot && variantsWithNotFailure.has(idx)) continue;
|
|
307
|
+
if (!allVariantsHaveNot && variantsWithNotFailure.has(idx) || contradictedVariants.has(idx)) continue;
|
|
225
308
|
const constCount = residual.reduce((n, e) => e.keyword === "const" ? n + 1 : n, 0);
|
|
226
309
|
if (residual.length < bestCount || residual.length === bestCount && constCount < bestConsts) {
|
|
227
310
|
bestIdx = idx;
|
|
@@ -251,9 +334,9 @@ function compactUnionErrors(errors, rootSchema) {
|
|
|
251
334
|
}
|
|
252
335
|
return [...errors.filter((e) => !dropped.has(e)), ...added];
|
|
253
336
|
}
|
|
254
|
-
function enrichWithVariants(issue,
|
|
337
|
+
function enrichWithVariants(issue, resolveDiagnosticPath) {
|
|
255
338
|
if (issue.keyword !== "oneOf" && issue.keyword !== "anyOf") return issue;
|
|
256
|
-
const resolved =
|
|
339
|
+
const resolved = resolveDiagnosticPath(issue.pointer === "/" ? "" : issue.pointer, issue.schemaPath);
|
|
257
340
|
if (!Array.isArray(resolved)) return issue;
|
|
258
341
|
const variants = resolved.map((variant, index) => {
|
|
259
342
|
if (variant == null || typeof variant !== "object") {
|
|
@@ -274,7 +357,13 @@ function validateRequest(toolName, payload, version) {
|
|
|
274
357
|
const rootSchemaId = rootSchema && typeof rootSchema === "object" && typeof rootSchema.$id === "string" ? rootSchema.$id : void 0;
|
|
275
358
|
if (valid) return { valid: true, issues: [], variant: "request", ...rootSchemaId && { schemaId: rootSchemaId } };
|
|
276
359
|
const registeredIds = getRegisteredSchemaIds(version);
|
|
277
|
-
const ctx = {
|
|
360
|
+
const ctx = {
|
|
361
|
+
rootSchema,
|
|
362
|
+
rootSchemaId,
|
|
363
|
+
registeredIds,
|
|
364
|
+
toolName,
|
|
365
|
+
diagnosticOrigin: createDiagnosticOriginResolver(validator)
|
|
366
|
+
};
|
|
278
367
|
return {
|
|
279
368
|
valid: false,
|
|
280
369
|
issues: formatValidationIssues(validator.errors ?? [], ctx, payload),
|
|
@@ -292,7 +381,7 @@ function selectResponseVariant(payload) {
|
|
|
292
381
|
return "sync";
|
|
293
382
|
}
|
|
294
383
|
function validateResponse(toolName, payload, version) {
|
|
295
|
-
const compatPayload = payload && typeof payload === "object" && !Array.isArray(payload) ? injectLegacyEnvelopeStatus(payload, { toolName }) : payload;
|
|
384
|
+
const compatPayload = payload && typeof payload === "object" && !Array.isArray(payload) ? injectLegacyEnvelopeStatus(payload, { toolName, adcpVersion: version }) : payload;
|
|
296
385
|
const variant = selectResponseVariant(compatPayload);
|
|
297
386
|
const validator = getValidator(toolName, variant, version);
|
|
298
387
|
const effective = validator ?? (variant !== "sync" ? getValidator(toolName, "sync", version) : void 0);
|
|
@@ -314,7 +403,13 @@ function validateResponse(toolName, payload, version) {
|
|
|
314
403
|
};
|
|
315
404
|
}
|
|
316
405
|
const registeredIds = getRegisteredSchemaIds(version);
|
|
317
|
-
const ctx = {
|
|
406
|
+
const ctx = {
|
|
407
|
+
rootSchema,
|
|
408
|
+
rootSchemaId,
|
|
409
|
+
registeredIds,
|
|
410
|
+
toolName,
|
|
411
|
+
diagnosticOrigin: createDiagnosticOriginResolver(effective)
|
|
412
|
+
};
|
|
318
413
|
return {
|
|
319
414
|
valid: false,
|
|
320
415
|
issues: formatValidationIssues(effective.errors ?? [], ctx, normalizedPayload),
|
|
@@ -347,6 +442,7 @@ function formatIssues(issues, limit = 3, options = {}) {
|
|
|
347
442
|
return rest > 0 ? `${head} (+${rest} more)` : head;
|
|
348
443
|
}
|
|
349
444
|
export {
|
|
445
|
+
compactUnionErrors,
|
|
350
446
|
formatDiscriminator,
|
|
351
447
|
formatIssueLine,
|
|
352
448
|
formatIssues,
|
|
@@ -13,7 +13,7 @@ export declare const SyncCreativesItemSchema: z.ZodObject<{
|
|
|
13
13
|
brand: z.ZodOptional<z.ZodObject<{
|
|
14
14
|
domain: z.ZodString;
|
|
15
15
|
brand_id: z.ZodOptional<z.ZodString>;
|
|
16
|
-
countries: z.ZodOptional<
|
|
16
|
+
countries: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
17
17
|
industries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
18
|
data_subject_contestation: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
19
19
|
brand_kit_override: z.ZodOptional<z.ZodObject<{
|
|
@@ -128,7 +128,7 @@ export declare const SyncCreativesItemSchema: z.ZodObject<{
|
|
|
128
128
|
notification_configs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
129
129
|
subscriber_id: z.ZodString;
|
|
130
130
|
url: z.ZodString;
|
|
131
|
-
event_types:
|
|
131
|
+
event_types: import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodUnion<readonly [z.ZodLiteral<"creative.status_changed">, z.ZodLiteral<"creative.assignment_changed">, z.ZodLiteral<"indicators.changed">, z.ZodLiteral<"creative.purged">, z.ZodLiteral<"account.status_changed">, z.ZodLiteral<"account.change_recorded">, z.ZodLiteral<"product.created">, z.ZodLiteral<"product.updated">, z.ZodLiteral<"product.priced">, z.ZodLiteral<"product.removed">, z.ZodLiteral<"signal.created">, z.ZodLiteral<"signal.updated">, z.ZodLiteral<"signal.priced">, z.ZodLiteral<"signal.removed">, z.ZodLiteral<"wholesale_feed.bulk_change">, z.ZodLiteral<"collection_card.updated">, z.ZodLiteral<"collection_card.removed">, z.ZodLiteral<"collection_catalog.bulk_change">, z.ZodLiteral<"reporting.delivery_ready">, z.ZodLiteral<"reporting.status_changed">, z.ZodLiteral<"reporting.ledger_changed">, z.ZodLiteral<"proposal.created">]>>;
|
|
132
132
|
product_payload_view: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"canonical">, z.ZodLiteral<"legacy">]>>;
|
|
133
133
|
authentication: z.ZodOptional<z.ZodObject<{
|
|
134
134
|
schemes: z.ZodTuple<[z.ZodUnion<readonly [z.ZodLiteral<"Bearer">, z.ZodLiteral<"HMAC-SHA256">]>], null>;
|
|
@@ -149,7 +149,7 @@ export declare const SyncCreativesItemSchema: z.ZodObject<{
|
|
|
149
149
|
reporting_profile: z.ZodString;
|
|
150
150
|
scope: z.ZodObject<{
|
|
151
151
|
all_media_buys: z.ZodOptional<z.ZodLiteral<true>>;
|
|
152
|
-
media_buy_ids: z.ZodOptional<
|
|
152
|
+
media_buy_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
153
153
|
}, z.core.$loose>;
|
|
154
154
|
coverage_requirement: z.ZodUnion<readonly [z.ZodLiteral<"full">, z.ZodLiteral<"allow_partial">]>;
|
|
155
155
|
required_finality: z.ZodUnion<readonly [z.ZodLiteral<"snapshot">, z.ZodLiteral<"official">]>;
|
|
@@ -237,7 +237,7 @@ export declare const SyncCreativesItemSchema: z.ZodObject<{
|
|
|
237
237
|
limitations: z.ZodArray<z.ZodObject<{
|
|
238
238
|
reason: z.ZodUnion<readonly [z.ZodLiteral<"offering_unsupported">, z.ZodLiteral<"account_entitlement_unavailable">, z.ZodLiteral<"credential_scope_insufficient">, z.ZodLiteral<"provider_limitation">, z.ZodLiteral<"capability_unknown">]>;
|
|
239
239
|
media_buy_id: z.ZodString;
|
|
240
|
-
package_ids: z.ZodOptional<
|
|
240
|
+
package_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
241
241
|
}, z.core.$strict>>;
|
|
242
242
|
}, z.core.$strict>>;
|
|
243
243
|
setup: z.ZodOptional<z.ZodObject<{
|
|
@@ -246,7 +246,7 @@ export declare const SyncCreativesItemSchema: z.ZodObject<{
|
|
|
246
246
|
url: z.ZodOptional<z.ZodString>;
|
|
247
247
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
248
248
|
}, z.core.$loose>>;
|
|
249
|
-
issues: z.ZodOptional<
|
|
249
|
+
issues: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodObject<{
|
|
250
250
|
issue_id: z.ZodString;
|
|
251
251
|
code: z.ZodUnion<readonly [z.ZodLiteral<"REPORT_OVERDUE">, z.ZodLiteral<"PRODUCTION_FAILED">, z.ZodLiteral<"DELIVERY_FAILED">, z.ZodLiteral<"ACCESS_REQUIRED">, z.ZodLiteral<"CONFIGURATION_REQUIRED">, z.ZodLiteral<"REPORTING_COVERAGE_INCOMPLETE">, z.ZodLiteral<"RESOURCE_EXPIRED">, z.ZodLiteral<"READER_INCOMPATIBLE">, z.ZodLiteral<"HISTORY_UNAVAILABLE">, z.ZodLiteral<"REVISION_UNREADABLE">, z.ZodLiteral<"RECEIPT_REQUIRED">, z.ZodLiteral<"RECEIPT_REJECTED">, z.ZodLiteral<"ADJUSTMENT_RECEIPT_REQUIRED">, z.ZodLiteral<"ADJUSTMENT_RECEIPT_REJECTED">, z.ZodLiteral<"CONSUMER_STATUS_MISMATCH">]>;
|
|
252
252
|
severity: z.ZodUnion<readonly [z.ZodLiteral<"delayed">, z.ZodLiteral<"action_required">]>;
|
|
@@ -262,8 +262,8 @@ export declare const SyncCreativesItemSchema: z.ZodObject<{
|
|
|
262
262
|
delivery_config_id: z.ZodOptional<z.ZodString>;
|
|
263
263
|
delivery_config_version: z.ZodOptional<z.ZodNumber>;
|
|
264
264
|
feed_purpose: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"pacing">, z.ZodLiteral<"analytics">, z.ZodLiteral<"billing">]>>;
|
|
265
|
-
media_buy_ids: z.ZodOptional<
|
|
266
|
-
package_ids: z.ZodOptional<
|
|
265
|
+
media_buy_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
266
|
+
package_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
267
267
|
period_start: z.ZodOptional<z.ZodString>;
|
|
268
268
|
period_end: z.ZodOptional<z.ZodString>;
|
|
269
269
|
expected_at: z.ZodOptional<z.ZodString>;
|
|
@@ -367,7 +367,7 @@ export declare const SyncCreativesSuccessStrictSchema: z.ZodObject<{
|
|
|
367
367
|
brand: z.ZodOptional<z.ZodObject<{
|
|
368
368
|
domain: z.ZodString;
|
|
369
369
|
brand_id: z.ZodOptional<z.ZodString>;
|
|
370
|
-
countries: z.ZodOptional<
|
|
370
|
+
countries: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
371
371
|
industries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
372
372
|
data_subject_contestation: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
373
373
|
brand_kit_override: z.ZodOptional<z.ZodObject<{
|
|
@@ -482,7 +482,7 @@ export declare const SyncCreativesSuccessStrictSchema: z.ZodObject<{
|
|
|
482
482
|
notification_configs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
483
483
|
subscriber_id: z.ZodString;
|
|
484
484
|
url: z.ZodString;
|
|
485
|
-
event_types:
|
|
485
|
+
event_types: import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodUnion<readonly [z.ZodLiteral<"creative.status_changed">, z.ZodLiteral<"creative.assignment_changed">, z.ZodLiteral<"indicators.changed">, z.ZodLiteral<"creative.purged">, z.ZodLiteral<"account.status_changed">, z.ZodLiteral<"account.change_recorded">, z.ZodLiteral<"product.created">, z.ZodLiteral<"product.updated">, z.ZodLiteral<"product.priced">, z.ZodLiteral<"product.removed">, z.ZodLiteral<"signal.created">, z.ZodLiteral<"signal.updated">, z.ZodLiteral<"signal.priced">, z.ZodLiteral<"signal.removed">, z.ZodLiteral<"wholesale_feed.bulk_change">, z.ZodLiteral<"collection_card.updated">, z.ZodLiteral<"collection_card.removed">, z.ZodLiteral<"collection_catalog.bulk_change">, z.ZodLiteral<"reporting.delivery_ready">, z.ZodLiteral<"reporting.status_changed">, z.ZodLiteral<"reporting.ledger_changed">, z.ZodLiteral<"proposal.created">]>>;
|
|
486
486
|
product_payload_view: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"canonical">, z.ZodLiteral<"legacy">]>>;
|
|
487
487
|
authentication: z.ZodOptional<z.ZodObject<{
|
|
488
488
|
schemes: z.ZodTuple<[z.ZodUnion<readonly [z.ZodLiteral<"Bearer">, z.ZodLiteral<"HMAC-SHA256">]>], null>;
|
|
@@ -503,7 +503,7 @@ export declare const SyncCreativesSuccessStrictSchema: z.ZodObject<{
|
|
|
503
503
|
reporting_profile: z.ZodString;
|
|
504
504
|
scope: z.ZodObject<{
|
|
505
505
|
all_media_buys: z.ZodOptional<z.ZodLiteral<true>>;
|
|
506
|
-
media_buy_ids: z.ZodOptional<
|
|
506
|
+
media_buy_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
507
507
|
}, z.core.$loose>;
|
|
508
508
|
coverage_requirement: z.ZodUnion<readonly [z.ZodLiteral<"full">, z.ZodLiteral<"allow_partial">]>;
|
|
509
509
|
required_finality: z.ZodUnion<readonly [z.ZodLiteral<"snapshot">, z.ZodLiteral<"official">]>;
|
|
@@ -591,7 +591,7 @@ export declare const SyncCreativesSuccessStrictSchema: z.ZodObject<{
|
|
|
591
591
|
limitations: z.ZodArray<z.ZodObject<{
|
|
592
592
|
reason: z.ZodUnion<readonly [z.ZodLiteral<"offering_unsupported">, z.ZodLiteral<"account_entitlement_unavailable">, z.ZodLiteral<"credential_scope_insufficient">, z.ZodLiteral<"provider_limitation">, z.ZodLiteral<"capability_unknown">]>;
|
|
593
593
|
media_buy_id: z.ZodString;
|
|
594
|
-
package_ids: z.ZodOptional<
|
|
594
|
+
package_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
595
595
|
}, z.core.$strict>>;
|
|
596
596
|
}, z.core.$strict>>;
|
|
597
597
|
setup: z.ZodOptional<z.ZodObject<{
|
|
@@ -600,7 +600,7 @@ export declare const SyncCreativesSuccessStrictSchema: z.ZodObject<{
|
|
|
600
600
|
url: z.ZodOptional<z.ZodString>;
|
|
601
601
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
602
602
|
}, z.core.$loose>>;
|
|
603
|
-
issues: z.ZodOptional<
|
|
603
|
+
issues: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodObject<{
|
|
604
604
|
issue_id: z.ZodString;
|
|
605
605
|
code: z.ZodUnion<readonly [z.ZodLiteral<"REPORT_OVERDUE">, z.ZodLiteral<"PRODUCTION_FAILED">, z.ZodLiteral<"DELIVERY_FAILED">, z.ZodLiteral<"ACCESS_REQUIRED">, z.ZodLiteral<"CONFIGURATION_REQUIRED">, z.ZodLiteral<"REPORTING_COVERAGE_INCOMPLETE">, z.ZodLiteral<"RESOURCE_EXPIRED">, z.ZodLiteral<"READER_INCOMPATIBLE">, z.ZodLiteral<"HISTORY_UNAVAILABLE">, z.ZodLiteral<"REVISION_UNREADABLE">, z.ZodLiteral<"RECEIPT_REQUIRED">, z.ZodLiteral<"RECEIPT_REJECTED">, z.ZodLiteral<"ADJUSTMENT_RECEIPT_REQUIRED">, z.ZodLiteral<"ADJUSTMENT_RECEIPT_REJECTED">, z.ZodLiteral<"CONSUMER_STATUS_MISMATCH">]>;
|
|
606
606
|
severity: z.ZodUnion<readonly [z.ZodLiteral<"delayed">, z.ZodLiteral<"action_required">]>;
|
|
@@ -616,8 +616,8 @@ export declare const SyncCreativesSuccessStrictSchema: z.ZodObject<{
|
|
|
616
616
|
delivery_config_id: z.ZodOptional<z.ZodString>;
|
|
617
617
|
delivery_config_version: z.ZodOptional<z.ZodNumber>;
|
|
618
618
|
feed_purpose: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"pacing">, z.ZodLiteral<"analytics">, z.ZodLiteral<"billing">]>>;
|
|
619
|
-
media_buy_ids: z.ZodOptional<
|
|
620
|
-
package_ids: z.ZodOptional<
|
|
619
|
+
media_buy_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
620
|
+
package_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
621
621
|
period_start: z.ZodOptional<z.ZodString>;
|
|
622
622
|
period_end: z.ZodOptional<z.ZodString>;
|
|
623
623
|
expected_at: z.ZodOptional<z.ZodString>;
|
|
@@ -733,7 +733,7 @@ export declare const SyncCreativesResponseStrictSchema: z.ZodUnion<readonly [z.Z
|
|
|
733
733
|
brand: z.ZodOptional<z.ZodObject<{
|
|
734
734
|
domain: z.ZodString;
|
|
735
735
|
brand_id: z.ZodOptional<z.ZodString>;
|
|
736
|
-
countries: z.ZodOptional<
|
|
736
|
+
countries: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
737
737
|
industries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
738
738
|
data_subject_contestation: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
739
739
|
brand_kit_override: z.ZodOptional<z.ZodObject<{
|
|
@@ -848,7 +848,7 @@ export declare const SyncCreativesResponseStrictSchema: z.ZodUnion<readonly [z.Z
|
|
|
848
848
|
notification_configs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
849
849
|
subscriber_id: z.ZodString;
|
|
850
850
|
url: z.ZodString;
|
|
851
|
-
event_types:
|
|
851
|
+
event_types: import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodUnion<readonly [z.ZodLiteral<"creative.status_changed">, z.ZodLiteral<"creative.assignment_changed">, z.ZodLiteral<"indicators.changed">, z.ZodLiteral<"creative.purged">, z.ZodLiteral<"account.status_changed">, z.ZodLiteral<"account.change_recorded">, z.ZodLiteral<"product.created">, z.ZodLiteral<"product.updated">, z.ZodLiteral<"product.priced">, z.ZodLiteral<"product.removed">, z.ZodLiteral<"signal.created">, z.ZodLiteral<"signal.updated">, z.ZodLiteral<"signal.priced">, z.ZodLiteral<"signal.removed">, z.ZodLiteral<"wholesale_feed.bulk_change">, z.ZodLiteral<"collection_card.updated">, z.ZodLiteral<"collection_card.removed">, z.ZodLiteral<"collection_catalog.bulk_change">, z.ZodLiteral<"reporting.delivery_ready">, z.ZodLiteral<"reporting.status_changed">, z.ZodLiteral<"reporting.ledger_changed">, z.ZodLiteral<"proposal.created">]>>;
|
|
852
852
|
product_payload_view: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"canonical">, z.ZodLiteral<"legacy">]>>;
|
|
853
853
|
authentication: z.ZodOptional<z.ZodObject<{
|
|
854
854
|
schemes: z.ZodTuple<[z.ZodUnion<readonly [z.ZodLiteral<"Bearer">, z.ZodLiteral<"HMAC-SHA256">]>], null>;
|
|
@@ -869,7 +869,7 @@ export declare const SyncCreativesResponseStrictSchema: z.ZodUnion<readonly [z.Z
|
|
|
869
869
|
reporting_profile: z.ZodString;
|
|
870
870
|
scope: z.ZodObject<{
|
|
871
871
|
all_media_buys: z.ZodOptional<z.ZodLiteral<true>>;
|
|
872
|
-
media_buy_ids: z.ZodOptional<
|
|
872
|
+
media_buy_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
873
873
|
}, z.core.$loose>;
|
|
874
874
|
coverage_requirement: z.ZodUnion<readonly [z.ZodLiteral<"full">, z.ZodLiteral<"allow_partial">]>;
|
|
875
875
|
required_finality: z.ZodUnion<readonly [z.ZodLiteral<"snapshot">, z.ZodLiteral<"official">]>;
|
|
@@ -957,7 +957,7 @@ export declare const SyncCreativesResponseStrictSchema: z.ZodUnion<readonly [z.Z
|
|
|
957
957
|
limitations: z.ZodArray<z.ZodObject<{
|
|
958
958
|
reason: z.ZodUnion<readonly [z.ZodLiteral<"offering_unsupported">, z.ZodLiteral<"account_entitlement_unavailable">, z.ZodLiteral<"credential_scope_insufficient">, z.ZodLiteral<"provider_limitation">, z.ZodLiteral<"capability_unknown">]>;
|
|
959
959
|
media_buy_id: z.ZodString;
|
|
960
|
-
package_ids: z.ZodOptional<
|
|
960
|
+
package_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
961
961
|
}, z.core.$strict>>;
|
|
962
962
|
}, z.core.$strict>>;
|
|
963
963
|
setup: z.ZodOptional<z.ZodObject<{
|
|
@@ -966,7 +966,7 @@ export declare const SyncCreativesResponseStrictSchema: z.ZodUnion<readonly [z.Z
|
|
|
966
966
|
url: z.ZodOptional<z.ZodString>;
|
|
967
967
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
968
968
|
}, z.core.$loose>>;
|
|
969
|
-
issues: z.ZodOptional<
|
|
969
|
+
issues: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodObject<{
|
|
970
970
|
issue_id: z.ZodString;
|
|
971
971
|
code: z.ZodUnion<readonly [z.ZodLiteral<"REPORT_OVERDUE">, z.ZodLiteral<"PRODUCTION_FAILED">, z.ZodLiteral<"DELIVERY_FAILED">, z.ZodLiteral<"ACCESS_REQUIRED">, z.ZodLiteral<"CONFIGURATION_REQUIRED">, z.ZodLiteral<"REPORTING_COVERAGE_INCOMPLETE">, z.ZodLiteral<"RESOURCE_EXPIRED">, z.ZodLiteral<"READER_INCOMPATIBLE">, z.ZodLiteral<"HISTORY_UNAVAILABLE">, z.ZodLiteral<"REVISION_UNREADABLE">, z.ZodLiteral<"RECEIPT_REQUIRED">, z.ZodLiteral<"RECEIPT_REJECTED">, z.ZodLiteral<"ADJUSTMENT_RECEIPT_REQUIRED">, z.ZodLiteral<"ADJUSTMENT_RECEIPT_REJECTED">, z.ZodLiteral<"CONSUMER_STATUS_MISMATCH">]>;
|
|
972
972
|
severity: z.ZodUnion<readonly [z.ZodLiteral<"delayed">, z.ZodLiteral<"action_required">]>;
|
|
@@ -982,8 +982,8 @@ export declare const SyncCreativesResponseStrictSchema: z.ZodUnion<readonly [z.Z
|
|
|
982
982
|
delivery_config_id: z.ZodOptional<z.ZodString>;
|
|
983
983
|
delivery_config_version: z.ZodOptional<z.ZodNumber>;
|
|
984
984
|
feed_purpose: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"pacing">, z.ZodLiteral<"analytics">, z.ZodLiteral<"billing">]>>;
|
|
985
|
-
media_buy_ids: z.ZodOptional<
|
|
986
|
-
package_ids: z.ZodOptional<
|
|
985
|
+
media_buy_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
986
|
+
package_ids: z.ZodOptional<import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodString>>;
|
|
987
987
|
period_start: z.ZodOptional<z.ZodString>;
|
|
988
988
|
period_end: z.ZodOptional<z.ZodString>;
|
|
989
989
|
expected_at: z.ZodOptional<z.ZodString>;
|
|
@@ -1075,7 +1075,7 @@ export declare const SyncCreativesResponseStrictSchema: z.ZodUnion<readonly [z.Z
|
|
|
1075
1075
|
context: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
1076
1076
|
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1077
1077
|
}, z.core.$loose>, z.ZodObject<{
|
|
1078
|
-
errors:
|
|
1078
|
+
errors: import("./nonempty-array.mjs").NonemptyArraySchema<z.ZodObject<{
|
|
1079
1079
|
code: z.ZodString;
|
|
1080
1080
|
message: z.ZodString;
|
|
1081
1081
|
buyer_reason: z.ZodOptional<z.ZodObject<{
|