@adcp/sdk 14.1.0 → 14.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/lib/core/SingleAgentClient.d.mts +4 -1
  2. package/dist/lib/core/SingleAgentClient.d.ts +4 -1
  3. package/dist/lib/core/SingleAgentClient.js +25 -4
  4. package/dist/lib/core/SingleAgentClient.mjs +25 -4
  5. package/dist/lib/core/TaskExecutor.d.mts +3 -1
  6. package/dist/lib/core/TaskExecutor.d.ts +3 -1
  7. package/dist/lib/core/TaskExecutor.js +15 -11
  8. package/dist/lib/core/TaskExecutor.mjs +15 -11
  9. package/dist/lib/core/buyer-account-registry.d.mts +30 -2
  10. package/dist/lib/core/buyer-account-registry.d.ts +30 -2
  11. package/dist/lib/core/buyer-account-registry.js +126 -42
  12. package/dist/lib/core/buyer-account-registry.mjs +127 -43
  13. package/dist/lib/index.d.mts +3 -2
  14. package/dist/lib/index.d.ts +3 -2
  15. package/dist/lib/index.js +9 -0
  16. package/dist/lib/index.mjs +12 -1
  17. package/dist/lib/net/agent-transport-fetch.d.mts +4 -0
  18. package/dist/lib/net/agent-transport-fetch.d.ts +4 -0
  19. package/dist/lib/net/agent-transport-fetch.js +18 -5
  20. package/dist/lib/net/agent-transport-fetch.mjs +17 -5
  21. package/dist/lib/reporting/inspection.d.mts +3 -3
  22. package/dist/lib/reporting/inspection.d.ts +3 -3
  23. package/dist/lib/reporting/inspection.js +229 -84
  24. package/dist/lib/reporting/inspection.mjs +229 -84
  25. package/dist/lib/reporting/ledger/status-ingest.js +3 -19
  26. package/dist/lib/reporting/ledger/status-ingest.mjs +2 -18
  27. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  28. package/dist/lib/server/create-adcp-server.js +5 -2
  29. package/dist/lib/server/create-adcp-server.mjs +5 -2
  30. package/dist/lib/signing/agent-resolver/errors.d.mts +2 -0
  31. package/dist/lib/signing/agent-resolver/errors.d.ts +2 -0
  32. package/dist/lib/signing/agent-resolver/errors.js +6 -0
  33. package/dist/lib/signing/agent-resolver/errors.mjs +6 -0
  34. package/dist/lib/signing/agent-resolver/fetch-helpers.d.mts +9 -0
  35. package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts +9 -0
  36. package/dist/lib/signing/agent-resolver/fetch-helpers.js +35 -1
  37. package/dist/lib/signing/agent-resolver/fetch-helpers.mjs +38 -2
  38. package/dist/lib/signing/agent-resolver/legacy-brand.js +1 -1
  39. package/dist/lib/signing/agent-resolver/legacy-brand.mjs +2 -2
  40. package/dist/lib/signing/agent-resolver/resolve-agent.d.mts +1 -1
  41. package/dist/lib/signing/agent-resolver/resolve-agent.d.ts +1 -1
  42. package/dist/lib/signing/agent-resolver/resolve-agent.js +47 -5
  43. package/dist/lib/signing/agent-resolver/resolve-agent.mjs +55 -6
  44. package/dist/lib/signing/brand-jwks.d.mts +2 -0
  45. package/dist/lib/signing/brand-jwks.d.ts +2 -0
  46. package/dist/lib/signing/brand-jwks.js +10 -2
  47. package/dist/lib/signing/brand-jwks.mjs +10 -2
  48. package/dist/lib/signing/canonicalize.d.mts +2 -0
  49. package/dist/lib/signing/canonicalize.d.ts +2 -0
  50. package/dist/lib/signing/canonicalize.js +1 -1
  51. package/dist/lib/signing/canonicalize.mjs +1 -1
  52. package/dist/lib/signing/errors.d.mts +4 -2
  53. package/dist/lib/signing/errors.d.ts +4 -2
  54. package/dist/lib/signing/errors.js +3 -1
  55. package/dist/lib/signing/errors.mjs +3 -1
  56. package/dist/lib/signing/verifier.js +2 -2
  57. package/dist/lib/signing/verifier.mjs +2 -2
  58. package/dist/lib/signing/webhook-verifier.js +2 -2
  59. package/dist/lib/signing/webhook-verifier.mjs +3 -3
  60. package/dist/lib/testing/storyboard/request-signing/builder.js +13 -1
  61. package/dist/lib/testing/storyboard/request-signing/builder.mjs +13 -1
  62. package/dist/lib/testing/storyboard/request-signing/grader.js +1 -0
  63. package/dist/lib/testing/storyboard/request-signing/grader.mjs +1 -0
  64. package/dist/lib/testing/storyboard/request-signing/vector-loader.js +1 -1
  65. package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +1 -1
  66. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  67. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  68. package/dist/lib/types/accept-proposal.d.ts +19 -1
  69. package/dist/lib/types/buy-products.d.ts +19 -1
  70. package/dist/lib/types/check-governance.d.ts +19 -1
  71. package/dist/lib/types/comply-test-controller.d.ts +19 -1
  72. package/dist/lib/types/control-media-buy.d.ts +19 -1
  73. package/dist/lib/types/core.generated.d.mts +14 -1
  74. package/dist/lib/types/core.generated.d.ts +14 -1
  75. package/dist/lib/types/create-media-buy.d.ts +14 -1
  76. package/dist/lib/types/get-media-buys.d.ts +14 -1
  77. package/dist/lib/types/get-products.d.ts +19 -1
  78. package/dist/lib/types/list-products.d.ts +19 -1
  79. package/dist/lib/types/refine-proposals.d.ts +19 -1
  80. package/dist/lib/types/request-proposals.d.ts +19 -1
  81. package/dist/lib/types/schemas.generated.d.ts +12 -3
  82. package/dist/lib/types/schemas.generated.js +4 -1
  83. package/dist/lib/types/schemas.generated.mjs +4 -1
  84. package/dist/lib/types/tools.generated.d.mts +14 -1
  85. package/dist/lib/types/tools.generated.d.ts +14 -1
  86. package/dist/lib/types/update-media-buy.d.ts +14 -1
  87. package/dist/lib/utils/pointer-utils.d.mts +2 -0
  88. package/dist/lib/utils/pointer-utils.d.ts +2 -0
  89. package/dist/lib/utils/pointer-utils.js +43 -0
  90. package/dist/lib/utils/pointer-utils.mjs +19 -0
  91. package/dist/lib/validation/diagnostic-limits.d.mts +4 -0
  92. package/dist/lib/validation/diagnostic-limits.d.ts +4 -0
  93. package/dist/lib/validation/diagnostic-limits.js +57 -0
  94. package/dist/lib/validation/diagnostic-limits.mjs +32 -0
  95. package/dist/lib/validation/schema-errors.d.mts +3 -1
  96. package/dist/lib/validation/schema-errors.d.ts +3 -1
  97. package/dist/lib/validation/schema-errors.js +18 -3
  98. package/dist/lib/validation/schema-errors.mjs +18 -3
  99. package/dist/lib/validation/schema-validator.js +56 -4
  100. package/dist/lib/validation/schema-validator.mjs +56 -4
  101. package/dist/lib/version.d.mts +3 -3
  102. package/dist/lib/version.d.ts +3 -3
  103. package/dist/lib/version.js +3 -3
  104. package/dist/lib/version.mjs +3 -3
  105. package/dist/lib/webhooks/index.d.mts +24 -0
  106. package/dist/lib/webhooks/index.d.ts +24 -0
  107. package/dist/lib/webhooks/index.js +50 -24
  108. package/dist/lib/webhooks/index.mjs +49 -24
  109. package/dist/lib/wholesale-feed-sync/index.d.mts +2 -0
  110. package/dist/lib/wholesale-feed-sync/index.d.ts +2 -0
  111. package/dist/lib/wholesale-feed-sync/index.js +7 -0
  112. package/dist/lib/wholesale-feed-sync/index.mjs +4 -0
  113. package/dist/lib/wholesale-feed-sync/mirror.d.mts +97 -0
  114. package/dist/lib/wholesale-feed-sync/mirror.d.ts +97 -0
  115. package/dist/lib/wholesale-feed-sync/mirror.js +350 -0
  116. package/dist/lib/wholesale-feed-sync/mirror.mjs +322 -0
  117. package/dist/lib/wholesale-feed-sync/sync.d.mts +12 -29
  118. package/dist/lib/wholesale-feed-sync/sync.d.ts +12 -29
  119. package/dist/lib/wholesale-feed-sync/sync.js +153 -297
  120. package/dist/lib/wholesale-feed-sync/sync.mjs +158 -297
  121. package/docs/README.md +6 -0
  122. package/docs/TYPE-SUMMARY.md +2 -2
  123. package/docs/guides/BUYER-STORAGE.md +3 -0
  124. package/docs/guides/FIRST-CALL-TO-A-SELLER.md +3 -1
  125. package/docs/guides/account-resolution.md +46 -10
  126. package/docs/llms.txt +2 -2
  127. package/docs/migration-14.0-to-14.1.md +85 -0
  128. package/docs/migration-14.x-rc-worksheet.md +4 -4
  129. package/docs/migration-agent-resolution-3.3.md +5 -3
  130. package/docs/recipes/verifying-inbound-webhooks.md +4 -0
  131. package/package.json +3 -2
  132. package/skills/call-adcp-agent/SKILL.md +4 -1
  133. package/skills/adcp-brand.previous/SKILL.md +0 -200
  134. package/skills/adcp-creative.previous/SKILL.md +0 -305
  135. package/skills/adcp-governance.previous/SKILL.md +0 -566
  136. package/skills/adcp-measurement.previous/SKILL.md +0 -136
  137. package/skills/adcp-media-buy.previous/SKILL.md +0 -556
  138. package/skills/adcp-si.previous/SKILL.md +0 -206
  139. package/skills/adcp-signals.previous/SKILL.md +0 -204
@@ -29,6 +29,7 @@ var import_schema_loader = require('./schema-loader.js');
29
29
  var import_version = require('../version.js');
30
30
  var import_hints = require('./hints.js');
31
31
  var import_envelope_status_compat = require('../utils/envelope-status-compat.js');
32
+ var import_diagnostic_limits = require('./diagnostic-limits.js');
32
33
  const OK = Object.freeze({ valid: true, issues: [], variant: "skipped" });
33
34
  function extractSchemaId(schemaPath, rootSchema, registeredIds) {
34
35
  if (schemaPath.startsWith("#") || schemaPath === "") {
@@ -80,6 +81,59 @@ function resolveSchemaPath(rootSchema, schemaPath) {
80
81
  }
81
82
  return cursor;
82
83
  }
84
+ function* expandNotErrors(errors, rootSchema, payload) {
85
+ for (const error of errors) {
86
+ const rule = error.keyword === "not" ? resolveSchemaPath(rootSchema, error.schemaPath) : void 0;
87
+ const branches = rule && typeof rule === "object" ? rule.anyOf : void 0;
88
+ if (!Array.isArray(branches) || branches.length === 0 || Object.keys(rule).length !== 1) {
89
+ yield error;
90
+ continue;
91
+ }
92
+ let instance = payload;
93
+ if (error.instancePath) {
94
+ for (const encoded of error.instancePath.slice(1).split("/")) {
95
+ const key = encoded.replace(/~1/g, "/").replace(/~0/g, "~");
96
+ if (instance == null || typeof instance !== "object" || !Object.hasOwn(instance, key)) {
97
+ instance = void 0;
98
+ break;
99
+ }
100
+ instance = instance[key];
101
+ }
102
+ }
103
+ const keys = /* @__PURE__ */ new Set();
104
+ let opaqueBranch = false;
105
+ if (instance != null && typeof instance === "object" && !Array.isArray(instance)) {
106
+ for (const branch of branches) {
107
+ if (branch == null || typeof branch !== "object" || Object.keys(branch).length !== 1 || !Array.isArray(branch.required) || branch.required.length !== 1 || typeof branch.required[0] !== "string") {
108
+ opaqueBranch = true;
109
+ continue;
110
+ }
111
+ const key = branch.required[0];
112
+ if (Object.hasOwn(instance, key) && instance[key] !== void 0) keys.add(key);
113
+ }
114
+ }
115
+ if (keys.size === 0) {
116
+ yield error;
117
+ continue;
118
+ }
119
+ for (const key of keys) {
120
+ yield {
121
+ ...error,
122
+ instancePath: `${error.instancePath}/${key.replace(/~/g, "~0").replace(/\//g, "~1")}`,
123
+ message: `${key} cannot be set here`
124
+ };
125
+ }
126
+ if (opaqueBranch) yield error;
127
+ }
128
+ }
129
+ function formatValidationIssues(errors, ctx, payload) {
130
+ function* formatted() {
131
+ for (const error of expandNotErrors(compactUnionErrors(errors, ctx.rootSchema), ctx.rootSchema, payload)) {
132
+ yield enrichWithVariants(formatIssue(error, ctx), ctx.rootSchema);
133
+ }
134
+ }
135
+ return ctx.toolName === "sync_accounts" ? [...formatted()] : (0, import_diagnostic_limits.boundValidationIssues)(formatted());
136
+ }
83
137
  function compactUnionErrors(errors, rootSchema) {
84
138
  if (errors.length === 0) return [...errors];
85
139
  const errorsByOneOfPath = /* @__PURE__ */ new Map();
@@ -249,10 +303,9 @@ function validateRequest(toolName, payload, version) {
249
303
  if (valid) return { valid: true, issues: [], variant: "request", ...rootSchemaId && { schemaId: rootSchemaId } };
250
304
  const registeredIds = (0, import_schema_loader.getRegisteredSchemaIds)(version);
251
305
  const ctx = { rootSchema, registeredIds, toolName };
252
- const compacted = compactUnionErrors(validator.errors ?? [], rootSchema);
253
306
  return {
254
307
  valid: false,
255
- issues: compacted.map((e) => formatIssue(e, ctx)).map((i) => enrichWithVariants(i, rootSchema)),
308
+ issues: formatValidationIssues(validator.errors ?? [], ctx, payload),
256
309
  variant: "request",
257
310
  ...rootSchemaId && { schemaId: rootSchemaId }
258
311
  };
@@ -314,10 +367,9 @@ function validateResponse(toolName, payload, version) {
314
367
  }
315
368
  const registeredIds = (0, import_schema_loader.getRegisteredSchemaIds)(version);
316
369
  const ctx = { rootSchema, registeredIds, toolName };
317
- const compacted = compactUnionErrors(effective.errors ?? [], rootSchema);
318
370
  return {
319
371
  valid: false,
320
- issues: compacted.map((e) => formatIssue(e, ctx)).map((i) => enrichWithVariants(i, rootSchema)),
372
+ issues: formatValidationIssues(effective.errors ?? [], ctx, normalizedPayload),
321
373
  variant: usedVariant,
322
374
  ...rootSchemaId && { schemaId: rootSchemaId },
323
375
  ...fallbackFields
@@ -2,6 +2,7 @@ import { getValidator, getRegisteredSchemaIds } from "./schema-loader.mjs";
2
2
  import { parseAdcpMajorVersion } from "../version.mjs";
3
3
  import { findHint } from "./hints.mjs";
4
4
  import { injectLegacyEnvelopeStatus } from "../utils/envelope-status-compat.mjs";
5
+ import { boundValidationIssues } from "./diagnostic-limits.mjs";
5
6
  const OK = Object.freeze({ valid: true, issues: [], variant: "skipped" });
6
7
  function extractSchemaId(schemaPath, rootSchema, registeredIds) {
7
8
  if (schemaPath.startsWith("#") || schemaPath === "") {
@@ -53,6 +54,59 @@ function resolveSchemaPath(rootSchema, schemaPath) {
53
54
  }
54
55
  return cursor;
55
56
  }
57
+ function* expandNotErrors(errors, rootSchema, payload) {
58
+ for (const error of errors) {
59
+ const rule = error.keyword === "not" ? resolveSchemaPath(rootSchema, error.schemaPath) : void 0;
60
+ const branches = rule && typeof rule === "object" ? rule.anyOf : void 0;
61
+ if (!Array.isArray(branches) || branches.length === 0 || Object.keys(rule).length !== 1) {
62
+ yield error;
63
+ continue;
64
+ }
65
+ let instance = payload;
66
+ if (error.instancePath) {
67
+ for (const encoded of error.instancePath.slice(1).split("/")) {
68
+ const key = encoded.replace(/~1/g, "/").replace(/~0/g, "~");
69
+ if (instance == null || typeof instance !== "object" || !Object.hasOwn(instance, key)) {
70
+ instance = void 0;
71
+ break;
72
+ }
73
+ instance = instance[key];
74
+ }
75
+ }
76
+ const keys = /* @__PURE__ */ new Set();
77
+ let opaqueBranch = false;
78
+ if (instance != null && typeof instance === "object" && !Array.isArray(instance)) {
79
+ for (const branch of branches) {
80
+ if (branch == null || typeof branch !== "object" || Object.keys(branch).length !== 1 || !Array.isArray(branch.required) || branch.required.length !== 1 || typeof branch.required[0] !== "string") {
81
+ opaqueBranch = true;
82
+ continue;
83
+ }
84
+ const key = branch.required[0];
85
+ if (Object.hasOwn(instance, key) && instance[key] !== void 0) keys.add(key);
86
+ }
87
+ }
88
+ if (keys.size === 0) {
89
+ yield error;
90
+ continue;
91
+ }
92
+ for (const key of keys) {
93
+ yield {
94
+ ...error,
95
+ instancePath: `${error.instancePath}/${key.replace(/~/g, "~0").replace(/\//g, "~1")}`,
96
+ message: `${key} cannot be set here`
97
+ };
98
+ }
99
+ if (opaqueBranch) yield error;
100
+ }
101
+ }
102
+ function formatValidationIssues(errors, ctx, payload) {
103
+ function* formatted() {
104
+ for (const error of expandNotErrors(compactUnionErrors(errors, ctx.rootSchema), ctx.rootSchema, payload)) {
105
+ yield enrichWithVariants(formatIssue(error, ctx), ctx.rootSchema);
106
+ }
107
+ }
108
+ return ctx.toolName === "sync_accounts" ? [...formatted()] : boundValidationIssues(formatted());
109
+ }
56
110
  function compactUnionErrors(errors, rootSchema) {
57
111
  if (errors.length === 0) return [...errors];
58
112
  const errorsByOneOfPath = /* @__PURE__ */ new Map();
@@ -222,10 +276,9 @@ function validateRequest(toolName, payload, version) {
222
276
  if (valid) return { valid: true, issues: [], variant: "request", ...rootSchemaId && { schemaId: rootSchemaId } };
223
277
  const registeredIds = getRegisteredSchemaIds(version);
224
278
  const ctx = { rootSchema, registeredIds, toolName };
225
- const compacted = compactUnionErrors(validator.errors ?? [], rootSchema);
226
279
  return {
227
280
  valid: false,
228
- issues: compacted.map((e) => formatIssue(e, ctx)).map((i) => enrichWithVariants(i, rootSchema)),
281
+ issues: formatValidationIssues(validator.errors ?? [], ctx, payload),
229
282
  variant: "request",
230
283
  ...rootSchemaId && { schemaId: rootSchemaId }
231
284
  };
@@ -287,10 +340,9 @@ function validateResponse(toolName, payload, version) {
287
340
  }
288
341
  const registeredIds = getRegisteredSchemaIds(version);
289
342
  const ctx = { rootSchema, registeredIds, toolName };
290
- const compacted = compactUnionErrors(effective.errors ?? [], rootSchema);
291
343
  return {
292
344
  valid: false,
293
- issues: compacted.map((e) => formatIssue(e, ctx)).map((i) => enrichWithVariants(i, rootSchema)),
345
+ issues: formatValidationIssues(effective.errors ?? [], ctx, normalizedPayload),
294
346
  variant: usedVariant,
295
347
  ...rootSchemaId && { schemaId: rootSchemaId },
296
348
  ...fallbackFields
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AdCP SDK library version
3
3
  */
4
- export declare const LIBRARY_VERSION = "14.1.0";
4
+ export declare const LIBRARY_VERSION = "14.3.0";
5
5
  /**
6
6
  * AdCP specification version this library is built for
7
7
  */
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
33
33
  * Full version information
34
34
  */
35
35
  export declare const VERSION_INFO: {
36
- readonly library: "14.1.0";
36
+ readonly library: "14.3.0";
37
37
  readonly adcp: "3.2.1";
38
38
  readonly compatibleVersions: readonly ["v2.5", "v2.6", "v3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.1.19", "3.1.20", "3.1.21", "3.1.22", "3.1.23", "3.1.24", "3.2.1", "3.2"];
39
- readonly generatedAt: "2026-10-04T03:18:45.725Z";
39
+ readonly generatedAt: "2026-10-06T16:34:47.947Z";
40
40
  };
41
41
  /**
42
42
  * Get the AdCP specification version this library is built for
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AdCP SDK library version
3
3
  */
4
- export declare const LIBRARY_VERSION = "14.1.0";
4
+ export declare const LIBRARY_VERSION = "14.3.0";
5
5
  /**
6
6
  * AdCP specification version this library is built for
7
7
  */
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
33
33
  * Full version information
34
34
  */
35
35
  export declare const VERSION_INFO: {
36
- readonly library: "14.1.0";
36
+ readonly library: "14.3.0";
37
37
  readonly adcp: "3.2.1";
38
38
  readonly compatibleVersions: readonly ["v2.5", "v2.6", "v3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.1.19", "3.1.20", "3.1.21", "3.1.22", "3.1.23", "3.1.24", "3.2.1", "3.2"];
39
- readonly generatedAt: "2026-10-04T03:18:45.725Z";
39
+ readonly generatedAt: "2026-10-06T16:34:47.947Z";
40
40
  };
41
41
  /**
42
42
  * Get the AdCP specification version this library is built for
@@ -31,7 +31,7 @@ __export(version_exports, {
31
31
  toReleasePrecisionVersion: () => toReleasePrecisionVersion
32
32
  });
33
33
  module.exports = __toCommonJS(version_exports);
34
- const LIBRARY_VERSION = "14.1.0";
34
+ const LIBRARY_VERSION = "14.3.0";
35
35
  const ADCP_VERSION = "3.2.1";
36
36
  const ADCP_MAJOR_VERSION = 3;
37
37
  const COMPATIBLE_ADCP_VERSIONS = [
@@ -95,10 +95,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
95
95
  "3.2"
96
96
  ];
97
97
  const VERSION_INFO = {
98
- library: "14.1.0",
98
+ library: "14.3.0",
99
99
  adcp: "3.2.1",
100
100
  compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
101
- generatedAt: "2026-10-04T03:18:45.725Z"
101
+ generatedAt: "2026-10-06T16:34:47.947Z"
102
102
  };
103
103
  function getAdcpVersion() {
104
104
  return ADCP_VERSION;
@@ -1,4 +1,4 @@
1
- const LIBRARY_VERSION = "14.1.0";
1
+ const LIBRARY_VERSION = "14.3.0";
2
2
  const ADCP_VERSION = "3.2.1";
3
3
  const ADCP_MAJOR_VERSION = 3;
4
4
  const COMPATIBLE_ADCP_VERSIONS = [
@@ -62,10 +62,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
62
62
  "3.2"
63
63
  ];
64
64
  const VERSION_INFO = {
65
- library: "14.1.0",
65
+ library: "14.3.0",
66
66
  adcp: "3.2.1",
67
67
  compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
68
- generatedAt: "2026-10-04T03:18:45.725Z"
68
+ generatedAt: "2026-10-06T16:34:47.947Z"
69
69
  };
70
70
  function getAdcpVersion() {
71
71
  return ADCP_VERSION;
@@ -28,6 +28,8 @@ export interface VerifyWebhookRequestOptions {
28
28
  timestamp?: WebhookHeaderValue;
29
29
  /** Allowed absolute timestamp skew in seconds. Defaults to 300. */
30
30
  skewSeconds?: number;
31
+ /** Alias shared with preflight; takes precedence when both are provided. */
32
+ maxSkewSeconds?: number;
31
33
  /** Current unix time in seconds. Defaults to `Date.now() / 1000`. */
32
34
  now?: () => number;
33
35
  }
@@ -50,3 +52,25 @@ export type VerifyWebhookRequestResult = {
50
52
  * `@adcp/sdk/signing/server`.
51
53
  */
52
54
  export declare function verifyWebhookRequest(options: VerifyWebhookRequestOptions): VerifyWebhookRequestResult;
55
+ /** Input for a secret-less check of the deprecated HMAC webhook profile. */
56
+ export type PreflightWebhookRequest = Pick<VerifyWebhookRequestOptions, 'headers' | 'signature' | 'timestamp'>;
57
+ export interface PreflightWebhookRequestOptions {
58
+ /** Current unix time in seconds. */
59
+ now?: () => number;
60
+ /** Allowed absolute timestamp skew; defaults to 300 seconds. */
61
+ maxSkewSeconds?: number;
62
+ /** Alias shared with verifyWebhookRequest. */
63
+ skewSeconds?: number;
64
+ }
65
+ export type PreflightWebhookRequestResult = {
66
+ ok: true;
67
+ signature: string;
68
+ timestamp: number;
69
+ checkedAt: number;
70
+ } | {
71
+ ok: false;
72
+ reason: Exclude<VerifyWebhookFailureReason, 'missing_secret' | 'bad_signature'>;
73
+ message: string;
74
+ };
75
+ /** Validate headers and freshness before looking up a secret. Success does not authenticate the request. */
76
+ export declare function preflightWebhookRequest(request: PreflightWebhookRequest, options?: PreflightWebhookRequestOptions): PreflightWebhookRequestResult;
@@ -28,6 +28,8 @@ export interface VerifyWebhookRequestOptions {
28
28
  timestamp?: WebhookHeaderValue;
29
29
  /** Allowed absolute timestamp skew in seconds. Defaults to 300. */
30
30
  skewSeconds?: number;
31
+ /** Alias shared with preflight; takes precedence when both are provided. */
32
+ maxSkewSeconds?: number;
31
33
  /** Current unix time in seconds. Defaults to `Date.now() / 1000`. */
32
34
  now?: () => number;
33
35
  }
@@ -50,3 +52,25 @@ export type VerifyWebhookRequestResult = {
50
52
  * `@adcp/sdk/signing/server`.
51
53
  */
52
54
  export declare function verifyWebhookRequest(options: VerifyWebhookRequestOptions): VerifyWebhookRequestResult;
55
+ /** Input for a secret-less check of the deprecated HMAC webhook profile. */
56
+ export type PreflightWebhookRequest = Pick<VerifyWebhookRequestOptions, 'headers' | 'signature' | 'timestamp'>;
57
+ export interface PreflightWebhookRequestOptions {
58
+ /** Current unix time in seconds. */
59
+ now?: () => number;
60
+ /** Allowed absolute timestamp skew; defaults to 300 seconds. */
61
+ maxSkewSeconds?: number;
62
+ /** Alias shared with verifyWebhookRequest. */
63
+ skewSeconds?: number;
64
+ }
65
+ export type PreflightWebhookRequestResult = {
66
+ ok: true;
67
+ signature: string;
68
+ timestamp: number;
69
+ checkedAt: number;
70
+ } | {
71
+ ok: false;
72
+ reason: Exclude<VerifyWebhookFailureReason, 'missing_secret' | 'bad_signature'>;
73
+ message: string;
74
+ };
75
+ /** Validate headers and freshness before looking up a secret. Success does not authenticate the request. */
76
+ export declare function preflightWebhookRequest(request: PreflightWebhookRequest, options?: PreflightWebhookRequestOptions): PreflightWebhookRequestResult;
@@ -22,6 +22,7 @@ __export(webhooks_exports, {
22
22
  WholesaleFeedWebhookNotificationError: () => import_webhook_notification.WholesaleFeedWebhookNotificationError,
23
23
  normalizeWholesaleFeedWebhookNotification: () => import_webhook_notification.normalizeWholesaleFeedWebhookNotification,
24
24
  parseWholesaleFeedWebhookNotification: () => import_webhook_notification.parseWholesaleFeedWebhookNotification,
25
+ preflightWebhookRequest: () => preflightWebhookRequest,
25
26
  verifyWebhookRequest: () => verifyWebhookRequest
26
27
  });
27
28
  module.exports = __toCommonJS(webhooks_exports);
@@ -29,49 +30,73 @@ var import_crypto = require("crypto");
29
30
  __reExport(webhooks_exports, require('../notifications/account-change-recorded.js'), module.exports);
30
31
  var import_webhook_notification = require('../wholesale-feed-sync/webhook-notification.js');
31
32
  function verifyWebhookRequest(options) {
33
+ const preflight = preflightWebhookRequest(options, {
34
+ now: options.now,
35
+ maxSkewSeconds: options.maxSkewSeconds ?? options.skewSeconds
36
+ });
37
+ if (!preflight.ok) return preflight;
32
38
  const secret = options.secret ?? options.globalSecret;
33
39
  if (!secret) {
34
40
  return fail("missing_secret", "A webhook HMAC secret is required.");
35
41
  }
36
- const signature = resolveHeader("x-adcp-signature", options.signature, options.headers);
37
- if (signature.reason) return fail(signature.reason, signature.message);
38
- const timestamp = resolveHeader("x-adcp-timestamp", options.timestamp, options.headers);
39
- if (timestamp.reason) return fail(timestamp.reason, timestamp.message);
40
- if (!signature.value || !timestamp.value) {
41
- return fail("missing_headers", "Webhook is missing x-adcp-signature or x-adcp-timestamp.");
42
- }
43
- const parsedTimestamp = parseTimestamp(timestamp.value);
44
- if (parsedTimestamp === void 0) {
45
- return fail("invalid_timestamp", "x-adcp-timestamp must be an integer unix timestamp in seconds.");
46
- }
47
- const now = options.now ? Math.floor(options.now()) : Math.floor(Date.now() / 1e3);
48
- const skewSeconds = options.skewSeconds ?? 300;
49
- if (!Number.isFinite(skewSeconds) || skewSeconds < 0) {
50
- return fail("invalid_timestamp", "skewSeconds must be a non-negative number.");
51
- }
52
- if (Math.abs(now - parsedTimestamp) > skewSeconds) {
53
- return fail("stale_timestamp", `Webhook timestamp is outside the allowed ${skewSeconds}s skew window.`);
54
- }
55
- if (!/^sha256=[a-f0-9]{64}$/.test(signature.value)) {
56
- return fail("malformed_signature", "x-adcp-signature must match sha256=<64 lowercase hex chars>.");
57
- }
42
+ const { signature, timestamp: parsedTimestamp, checkedAt: now } = preflight;
58
43
  const hmac = (0, import_crypto.createHmac)("sha256", secret);
59
44
  hmac.update(String(parsedTimestamp), "utf8");
60
45
  hmac.update(".", "utf8");
61
46
  hmac.update(toBodyBytes(options.rawBody));
62
47
  const expected = `sha256=${hmac.digest("hex")}`;
63
48
  const expectedBytes = Buffer.from(expected, "utf8");
64
- const actualBytes = Buffer.from(signature.value, "utf8");
49
+ const actualBytes = Buffer.from(signature, "utf8");
65
50
  if (actualBytes.length !== expectedBytes.length || !(0, import_crypto.timingSafeEqual)(actualBytes, expectedBytes)) {
66
51
  return fail("bad_signature", "Webhook HMAC signature does not match the request body and timestamp.");
67
52
  }
68
53
  return {
69
54
  ok: true,
70
- signature: signature.value,
55
+ signature,
71
56
  timestamp: parsedTimestamp,
72
57
  verifiedAt: now
73
58
  };
74
59
  }
60
+ function preflightWebhookRequest(request, options = {}) {
61
+ const signature = resolveHeader("x-adcp-signature", request.signature, request.headers);
62
+ if (signature.reason) return { ok: false, reason: signature.reason, message: signature.message };
63
+ const timestamp = resolveHeader("x-adcp-timestamp", request.timestamp, request.headers);
64
+ if (timestamp.reason) return { ok: false, reason: timestamp.reason, message: timestamp.message };
65
+ if (!signature.value || !timestamp.value)
66
+ return {
67
+ ok: false,
68
+ reason: "missing_headers",
69
+ message: "Webhook is missing x-adcp-signature or x-adcp-timestamp."
70
+ };
71
+ const parsedTimestamp = parseTimestamp(timestamp.value);
72
+ if (parsedTimestamp === void 0)
73
+ return {
74
+ ok: false,
75
+ reason: "invalid_timestamp",
76
+ message: "x-adcp-timestamp must be an integer unix timestamp in seconds."
77
+ };
78
+ const now = Math.floor(options.now ? options.now() : Date.now() / 1e3);
79
+ const skewSeconds = options.maxSkewSeconds ?? options.skewSeconds ?? 300;
80
+ if (!Number.isFinite(now) || !Number.isFinite(skewSeconds) || skewSeconds < 0)
81
+ return {
82
+ ok: false,
83
+ reason: "invalid_timestamp",
84
+ message: "Clock and skew must be finite; skew must be non-negative."
85
+ };
86
+ if (Math.abs(now - parsedTimestamp) > skewSeconds)
87
+ return {
88
+ ok: false,
89
+ reason: "stale_timestamp",
90
+ message: `Webhook timestamp is outside the allowed ${skewSeconds}s skew window.`
91
+ };
92
+ if (!/^sha256=[a-f0-9]{64}$/.test(signature.value))
93
+ return {
94
+ ok: false,
95
+ reason: "malformed_signature",
96
+ message: "x-adcp-signature must match sha256=<64 lowercase hex chars>."
97
+ };
98
+ return { ok: true, signature: signature.value, timestamp: parsedTimestamp, checkedAt: now };
99
+ }
75
100
  function fail(reason, message) {
76
101
  return { ok: false, reason, message };
77
102
  }
@@ -148,6 +173,7 @@ function isHeaders(headers) {
148
173
  WholesaleFeedWebhookNotificationError,
149
174
  normalizeWholesaleFeedWebhookNotification,
150
175
  parseWholesaleFeedWebhookNotification,
176
+ preflightWebhookRequest,
151
177
  verifyWebhookRequest,
152
178
  ...require('../notifications/account-change-recorded.js')
153
179
  });
@@ -6,49 +6,73 @@ import {
6
6
  WholesaleFeedWebhookNotificationError
7
7
  } from "../wholesale-feed-sync/webhook-notification.mjs";
8
8
  function verifyWebhookRequest(options) {
9
+ const preflight = preflightWebhookRequest(options, {
10
+ now: options.now,
11
+ maxSkewSeconds: options.maxSkewSeconds ?? options.skewSeconds
12
+ });
13
+ if (!preflight.ok) return preflight;
9
14
  const secret = options.secret ?? options.globalSecret;
10
15
  if (!secret) {
11
16
  return fail("missing_secret", "A webhook HMAC secret is required.");
12
17
  }
13
- const signature = resolveHeader("x-adcp-signature", options.signature, options.headers);
14
- if (signature.reason) return fail(signature.reason, signature.message);
15
- const timestamp = resolveHeader("x-adcp-timestamp", options.timestamp, options.headers);
16
- if (timestamp.reason) return fail(timestamp.reason, timestamp.message);
17
- if (!signature.value || !timestamp.value) {
18
- return fail("missing_headers", "Webhook is missing x-adcp-signature or x-adcp-timestamp.");
19
- }
20
- const parsedTimestamp = parseTimestamp(timestamp.value);
21
- if (parsedTimestamp === void 0) {
22
- return fail("invalid_timestamp", "x-adcp-timestamp must be an integer unix timestamp in seconds.");
23
- }
24
- const now = options.now ? Math.floor(options.now()) : Math.floor(Date.now() / 1e3);
25
- const skewSeconds = options.skewSeconds ?? 300;
26
- if (!Number.isFinite(skewSeconds) || skewSeconds < 0) {
27
- return fail("invalid_timestamp", "skewSeconds must be a non-negative number.");
28
- }
29
- if (Math.abs(now - parsedTimestamp) > skewSeconds) {
30
- return fail("stale_timestamp", `Webhook timestamp is outside the allowed ${skewSeconds}s skew window.`);
31
- }
32
- if (!/^sha256=[a-f0-9]{64}$/.test(signature.value)) {
33
- return fail("malformed_signature", "x-adcp-signature must match sha256=<64 lowercase hex chars>.");
34
- }
18
+ const { signature, timestamp: parsedTimestamp, checkedAt: now } = preflight;
35
19
  const hmac = createHmac("sha256", secret);
36
20
  hmac.update(String(parsedTimestamp), "utf8");
37
21
  hmac.update(".", "utf8");
38
22
  hmac.update(toBodyBytes(options.rawBody));
39
23
  const expected = `sha256=${hmac.digest("hex")}`;
40
24
  const expectedBytes = Buffer.from(expected, "utf8");
41
- const actualBytes = Buffer.from(signature.value, "utf8");
25
+ const actualBytes = Buffer.from(signature, "utf8");
42
26
  if (actualBytes.length !== expectedBytes.length || !timingSafeEqual(actualBytes, expectedBytes)) {
43
27
  return fail("bad_signature", "Webhook HMAC signature does not match the request body and timestamp.");
44
28
  }
45
29
  return {
46
30
  ok: true,
47
- signature: signature.value,
31
+ signature,
48
32
  timestamp: parsedTimestamp,
49
33
  verifiedAt: now
50
34
  };
51
35
  }
36
+ function preflightWebhookRequest(request, options = {}) {
37
+ const signature = resolveHeader("x-adcp-signature", request.signature, request.headers);
38
+ if (signature.reason) return { ok: false, reason: signature.reason, message: signature.message };
39
+ const timestamp = resolveHeader("x-adcp-timestamp", request.timestamp, request.headers);
40
+ if (timestamp.reason) return { ok: false, reason: timestamp.reason, message: timestamp.message };
41
+ if (!signature.value || !timestamp.value)
42
+ return {
43
+ ok: false,
44
+ reason: "missing_headers",
45
+ message: "Webhook is missing x-adcp-signature or x-adcp-timestamp."
46
+ };
47
+ const parsedTimestamp = parseTimestamp(timestamp.value);
48
+ if (parsedTimestamp === void 0)
49
+ return {
50
+ ok: false,
51
+ reason: "invalid_timestamp",
52
+ message: "x-adcp-timestamp must be an integer unix timestamp in seconds."
53
+ };
54
+ const now = Math.floor(options.now ? options.now() : Date.now() / 1e3);
55
+ const skewSeconds = options.maxSkewSeconds ?? options.skewSeconds ?? 300;
56
+ if (!Number.isFinite(now) || !Number.isFinite(skewSeconds) || skewSeconds < 0)
57
+ return {
58
+ ok: false,
59
+ reason: "invalid_timestamp",
60
+ message: "Clock and skew must be finite; skew must be non-negative."
61
+ };
62
+ if (Math.abs(now - parsedTimestamp) > skewSeconds)
63
+ return {
64
+ ok: false,
65
+ reason: "stale_timestamp",
66
+ message: `Webhook timestamp is outside the allowed ${skewSeconds}s skew window.`
67
+ };
68
+ if (!/^sha256=[a-f0-9]{64}$/.test(signature.value))
69
+ return {
70
+ ok: false,
71
+ reason: "malformed_signature",
72
+ message: "x-adcp-signature must match sha256=<64 lowercase hex chars>."
73
+ };
74
+ return { ok: true, signature: signature.value, timestamp: parsedTimestamp, checkedAt: now };
75
+ }
52
76
  function fail(reason, message) {
53
77
  return { ok: false, reason, message };
54
78
  }
@@ -124,5 +148,6 @@ export {
124
148
  WholesaleFeedWebhookNotificationError,
125
149
  normalizeWholesaleFeedWebhookNotification,
126
150
  parseWholesaleFeedWebhookNotification,
151
+ preflightWebhookRequest,
127
152
  verifyWebhookRequest
128
153
  };
@@ -5,3 +5,5 @@ export { normalizeWholesaleFeedWebhookNotification, parseWholesaleFeedWebhookNot
5
5
  export type { WholesaleFeedSyncClient, WholesaleFeedSyncConfig, WholesaleFeedSyncEvents, WholesaleFeedSyncMode, WholesaleFeedSyncPersistedState, WholesaleFeedSyncPersistenceHooks, WholesaleFeedSyncState, ProductFilter, ResolvedCapabilities, SignalFilter, } from './types.mjs';
6
6
  export type { NormalizedWholesaleFeedWebhookNotification, WholesaleFeedWebhookAffectedEntityType, WholesaleFeedWebhookCacheScope, WholesaleFeedWebhookNotificationErrorCode, WholesaleFeedWebhookNotificationErrorDetails, WholesaleFeedWebhookNotificationType, } from './webhook-notification.mjs';
7
7
  export type { LegacyWholesaleFeedEvent, LegacyWholesaleFeedWebhook, LegacyWholesaleProduct, LegacyWholesaleSignal, } from './protocol-types.mjs';
8
+ export { refreshWholesaleFeed, applyWholesaleFeedWebhook, InMemoryWholesaleFeedMirrorStore } from './mirror.mjs';
9
+ export type { WholesaleFeedMirrorStore, WholesaleFeedMirrorScope, WholesaleFeedMirrorItem, WholesaleFeedMirrorSnapshot, WholesaleFeedMirrorCommit, WholesaleFeedRefreshOutcome, RefreshWholesaleFeedOptions, ApplyWholesaleFeedWebhookOptions, } from './mirror.mjs';
@@ -5,3 +5,5 @@ export { normalizeWholesaleFeedWebhookNotification, parseWholesaleFeedWebhookNot
5
5
  export type { WholesaleFeedSyncClient, WholesaleFeedSyncConfig, WholesaleFeedSyncEvents, WholesaleFeedSyncMode, WholesaleFeedSyncPersistedState, WholesaleFeedSyncPersistenceHooks, WholesaleFeedSyncState, ProductFilter, ResolvedCapabilities, SignalFilter, } from './types';
6
6
  export type { NormalizedWholesaleFeedWebhookNotification, WholesaleFeedWebhookAffectedEntityType, WholesaleFeedWebhookCacheScope, WholesaleFeedWebhookNotificationErrorCode, WholesaleFeedWebhookNotificationErrorDetails, WholesaleFeedWebhookNotificationType, } from './webhook-notification';
7
7
  export type { LegacyWholesaleFeedEvent, LegacyWholesaleFeedWebhook, LegacyWholesaleProduct, LegacyWholesaleSignal, } from './protocol-types';
8
+ export { refreshWholesaleFeed, applyWholesaleFeedWebhook, InMemoryWholesaleFeedMirrorStore } from './mirror';
9
+ export type { WholesaleFeedMirrorStore, WholesaleFeedMirrorScope, WholesaleFeedMirrorItem, WholesaleFeedMirrorSnapshot, WholesaleFeedMirrorCommit, WholesaleFeedRefreshOutcome, RefreshWholesaleFeedOptions, ApplyWholesaleFeedWebhookOptions, } from './mirror';
@@ -18,23 +18,30 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var wholesale_feed_sync_exports = {};
20
20
  __export(wholesale_feed_sync_exports, {
21
+ InMemoryWholesaleFeedMirrorStore: () => import_mirror.InMemoryWholesaleFeedMirrorStore,
21
22
  WholesaleFeedSync: () => import_sync.WholesaleFeedSync,
22
23
  WholesaleFeedWebhookNotificationError: () => import_webhook_notification.WholesaleFeedWebhookNotificationError,
23
24
  WholesaleFeedWebhookRegistrationError: () => import_register.WholesaleFeedWebhookRegistrationError,
25
+ applyWholesaleFeedWebhook: () => import_mirror.applyWholesaleFeedWebhook,
24
26
  normalizeWholesaleFeedWebhookNotification: () => import_webhook_notification.normalizeWholesaleFeedWebhookNotification,
25
27
  parseWholesaleFeedWebhookNotification: () => import_webhook_notification.parseWholesaleFeedWebhookNotification,
28
+ refreshWholesaleFeed: () => import_mirror.refreshWholesaleFeed,
26
29
  registerWholesaleFeedWebhooks: () => import_register.registerWholesaleFeedWebhooks
27
30
  });
28
31
  module.exports = __toCommonJS(wholesale_feed_sync_exports);
29
32
  var import_sync = require('./sync.js');
30
33
  var import_register = require('./register.js');
31
34
  var import_webhook_notification = require('./webhook-notification.js');
35
+ var import_mirror = require('./mirror.js');
32
36
  // Annotate the CommonJS export names for ESM import in node:
33
37
  0 && (module.exports = {
38
+ InMemoryWholesaleFeedMirrorStore,
34
39
  WholesaleFeedSync,
35
40
  WholesaleFeedWebhookNotificationError,
36
41
  WholesaleFeedWebhookRegistrationError,
42
+ applyWholesaleFeedWebhook,
37
43
  normalizeWholesaleFeedWebhookNotification,
38
44
  parseWholesaleFeedWebhookNotification,
45
+ refreshWholesaleFeed,
39
46
  registerWholesaleFeedWebhooks
40
47
  });
@@ -5,11 +5,15 @@ import {
5
5
  parseWholesaleFeedWebhookNotification,
6
6
  WholesaleFeedWebhookNotificationError
7
7
  } from "./webhook-notification.mjs";
8
+ import { refreshWholesaleFeed, applyWholesaleFeedWebhook, InMemoryWholesaleFeedMirrorStore } from "./mirror.mjs";
8
9
  export {
10
+ InMemoryWholesaleFeedMirrorStore,
9
11
  WholesaleFeedSync,
10
12
  WholesaleFeedWebhookNotificationError,
11
13
  WholesaleFeedWebhookRegistrationError,
14
+ applyWholesaleFeedWebhook,
12
15
  normalizeWholesaleFeedWebhookNotification,
13
16
  parseWholesaleFeedWebhookNotification,
17
+ refreshWholesaleFeed,
14
18
  registerWholesaleFeedWebhooks
15
19
  };