@adcp/sdk 14.0.0-beta.26 → 14.0.0-beta.28

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 (66) hide show
  1. package/dist/lib/core/AgentClient.d.mts +5 -1
  2. package/dist/lib/core/AgentClient.d.ts +5 -1
  3. package/dist/lib/core/SingleAgentClient.js +2 -0
  4. package/dist/lib/core/SingleAgentClient.mjs +2 -0
  5. package/dist/lib/index.d.mts +1 -0
  6. package/dist/lib/index.d.ts +1 -0
  7. package/dist/lib/index.js +2 -0
  8. package/dist/lib/index.mjs +1 -0
  9. package/dist/lib/reporting/evidence.d.mts +4 -0
  10. package/dist/lib/reporting/evidence.d.ts +4 -0
  11. package/dist/lib/reporting/evidence.js +136 -0
  12. package/dist/lib/reporting/evidence.mjs +109 -0
  13. package/dist/lib/reporting/index.d.mts +4 -0
  14. package/dist/lib/reporting/index.d.ts +4 -0
  15. package/dist/lib/reporting/index.js +45 -0
  16. package/dist/lib/reporting/index.mjs +24 -0
  17. package/dist/lib/reporting/inspection.d.mts +88 -0
  18. package/dist/lib/reporting/inspection.d.ts +88 -0
  19. package/dist/lib/reporting/inspection.js +1125 -0
  20. package/dist/lib/reporting/inspection.mjs +1094 -0
  21. package/dist/lib/reporting/reconciliation.d.mts +199 -0
  22. package/dist/lib/reporting/reconciliation.d.ts +199 -0
  23. package/dist/lib/reporting/reconciliation.js +870 -0
  24. package/dist/lib/reporting/reconciliation.mjs +844 -0
  25. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  26. package/dist/lib/server/decisioning/runtime/protocol-for-tool.js +1 -0
  27. package/dist/lib/server/decisioning/runtime/protocol-for-tool.mjs +1 -0
  28. package/dist/lib/server/wire-spec-fields.generated.d.mts +11 -1
  29. package/dist/lib/server/wire-spec-fields.generated.d.ts +11 -1
  30. package/dist/lib/server/wire-spec-fields.generated.js +10 -0
  31. package/dist/lib/server/wire-spec-fields.generated.mjs +10 -0
  32. package/dist/lib/testing/storyboard/runner.js +13 -2
  33. package/dist/lib/testing/storyboard/runner.mjs +13 -2
  34. package/dist/lib/testing/storyboard/types.d.mts +8 -0
  35. package/dist/lib/testing/storyboard/types.d.ts +8 -0
  36. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  37. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  38. package/dist/lib/types/create-media-buy.d.ts +21 -16
  39. package/dist/lib/types/get-media-buys.d.ts +21 -16
  40. package/dist/lib/types/index.d.mts +1 -0
  41. package/dist/lib/types/index.d.ts +1 -0
  42. package/dist/lib/types/list-accounts.d.ts +21 -16
  43. package/dist/lib/types/list-creatives.d.ts +21 -16
  44. package/dist/lib/types/schemas.generated.d.ts +688 -952
  45. package/dist/lib/types/schemas.generated.js +542 -515
  46. package/dist/lib/types/schemas.generated.mjs +542 -515
  47. package/dist/lib/types/sync-accounts.d.ts +21 -16
  48. package/dist/lib/types/sync-creatives.d.ts +21 -16
  49. package/dist/lib/types/tools.generated.d.mts +2 -6
  50. package/dist/lib/types/tools.generated.d.ts +2 -6
  51. package/dist/lib/utils/reporting-status-response.d.mts +2 -0
  52. package/dist/lib/utils/reporting-status-response.d.ts +2 -0
  53. package/dist/lib/utils/reporting-status-response.js +338 -0
  54. package/dist/lib/utils/reporting-status-response.mjs +319 -0
  55. package/dist/lib/utils/response-schemas.js +6 -1
  56. package/dist/lib/utils/response-schemas.mjs +6 -1
  57. package/dist/lib/validation/sync-creatives.d.mts +42 -108
  58. package/dist/lib/validation/sync-creatives.d.ts +42 -108
  59. package/dist/lib/version.d.mts +3 -3
  60. package/dist/lib/version.d.ts +3 -3
  61. package/dist/lib/version.js +3 -3
  62. package/dist/lib/version.mjs +3 -3
  63. package/docs/TYPE-SUMMARY.md +2 -2
  64. package/docs/guides/REPORTING-RECONCILIATION.md +107 -0
  65. package/docs/llms.txt +2 -2
  66. package/package.json +1 -1
@@ -6,7 +6,7 @@ import { type CanonicalReadTaskOptions, type CreativeDeliveryTaskOptions, type S
6
6
  import type { InputHandler, TaskOptions, TaskResult, TaskInfo, Message } from './ConversationTypes.mjs';
7
7
  import type { AdcpCapabilities } from '../utils/capabilities.mjs';
8
8
  import type { WebhookHeaderValue } from '../webhooks/index.mjs';
9
- import type { GetProductsRequest, GetProductsResponse, ListProductsRequest, ListProductsResponse, RequestProposalsRequest, RequestProposalsResponse, DeclineProposalsRequest, DeclineProposalsResponse, BuyProductsRequest, BuyProductsResponse, AcceptProposalRequest, AcceptProposalResponse, ControlMediaBuyRequest, ControlMediaBuyResponse, ListCreativeFormatsRequest, ListCreativeFormatsResponse, CreateMediaBuyRequest, CreateMediaBuyResponse, UpdateMediaBuyRequest, UpdateMediaBuyResponse, SyncCreativesRequest, SyncCreativesResponse, ListCreativesRequest, ListCreativesResponse, GetMediaBuysRequest, GetMediaBuysResponse, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, PreviewCreativeRequest, PreviewCreativeResponse, BuildCreativeRequest, BuildCreativeResponse, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAudiencesRequest, SyncAudiencesResponse, CreatePropertyListRequest, CreatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, ListContentStandardsRequest, ListContentStandardsResponse, GetContentStandardsRequest, GetContentStandardsResponse, CalibrateContentRequest, CalibrateContentResponse, ValidateContentDeliveryRequest, ValidateContentDeliveryResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SyncPlansRequest, SyncPlansResponse, CheckGovernanceRequest, CheckGovernanceResponse, ReportPlanOutcomeRequest, ReportPlanOutcomeResponse, ReportPlanAdjustmentRequest, ReportPlanAdjustmentResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, ListTransformersRequest, ListTransformersResponse, SyncAgentNotificationConfigsRequest, SyncAgentNotificationConfigsResponse } from '../types/tools.generated.mjs';
9
+ import type { GetProductsRequest, GetProductsResponse, ListProductsRequest, ListProductsResponse, RequestProposalsRequest, RequestProposalsResponse, DeclineProposalsRequest, DeclineProposalsResponse, BuyProductsRequest, BuyProductsResponse, AcceptProposalRequest, AcceptProposalResponse, ControlMediaBuyRequest, ControlMediaBuyResponse, ListCreativeFormatsRequest, ListCreativeFormatsResponse, CreateMediaBuyRequest, CreateMediaBuyResponse, UpdateMediaBuyRequest, UpdateMediaBuyResponse, SyncCreativesRequest, SyncCreativesResponse, ListCreativesRequest, ListCreativesResponse, GetMediaBuysRequest, GetMediaBuysResponse, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, GetReportingStatusRequest, GetReportingStatusResponse, SyncReportingReceiptsRequest, SyncReportingReceiptsResponse, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, PreviewCreativeRequest, PreviewCreativeResponse, BuildCreativeRequest, BuildCreativeResponse, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAudiencesRequest, SyncAudiencesResponse, CreatePropertyListRequest, CreatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, ListContentStandardsRequest, ListContentStandardsResponse, GetContentStandardsRequest, GetContentStandardsResponse, CalibrateContentRequest, CalibrateContentResponse, ValidateContentDeliveryRequest, ValidateContentDeliveryResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SyncPlansRequest, SyncPlansResponse, CheckGovernanceRequest, CheckGovernanceResponse, ReportPlanOutcomeRequest, ReportPlanOutcomeResponse, ReportPlanAdjustmentRequest, ReportPlanAdjustmentResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, ListTransformersRequest, ListTransformersResponse, SyncAgentNotificationConfigsRequest, SyncAgentNotificationConfigsResponse } from '../types/tools.generated.mjs';
10
10
  import type { MutatingRequestInput } from '../utils/idempotency.mjs';
11
11
  import { MediaBuyLifecycleCoordinator, type MediaBuyLifecycleCoordinatorOptions } from '../media-buy/compatibility.mjs';
12
12
  import type { ProposalRefinementCapabilities, RefineProposalsInput, RefineProposalsResponse } from '../negotiation/types.mjs';
@@ -58,6 +58,8 @@ export type TaskResponseTypeMap = {
58
58
  list_creatives: CanonicalListCreativesResponse;
59
59
  get_media_buys: CanonicalCreativeResponse<GetMediaBuysResponse>;
60
60
  get_media_buy_delivery: CanonicalCreativeResponse<GetMediaBuyDeliveryResponse>;
61
+ get_reporting_status: GetReportingStatusResponse;
62
+ sync_reporting_receipts: SyncReportingReceiptsResponse;
61
63
  get_creative_delivery: CanonicalCreativeResponse<GetCreativeDeliveryResponse>;
62
64
  provide_performance_feedback: ProvidePerformanceFeedbackResponse;
63
65
  get_signals: GetSignalsResponse;
@@ -106,6 +108,8 @@ export type TaskRequestTypeMap = {
106
108
  list_creatives: CanonicalListCreativesRequest;
107
109
  get_media_buys: GetMediaBuysRequest;
108
110
  get_media_buy_delivery: GetMediaBuyDeliveryRequest;
111
+ get_reporting_status: GetReportingStatusRequest;
112
+ sync_reporting_receipts: MutatingRequestInput<SyncReportingReceiptsRequest>;
109
113
  get_creative_delivery: GetCreativeDeliveryRequest;
110
114
  provide_performance_feedback: MutatingRequestInput<ProvidePerformanceFeedbackRequest>;
111
115
  get_signals: GetSignalsRequest;
@@ -6,7 +6,7 @@ import { type CanonicalReadTaskOptions, type CreativeDeliveryTaskOptions, type S
6
6
  import type { InputHandler, TaskOptions, TaskResult, TaskInfo, Message } from './ConversationTypes';
7
7
  import type { AdcpCapabilities } from '../utils/capabilities';
8
8
  import type { WebhookHeaderValue } from '../webhooks';
9
- import type { GetProductsRequest, GetProductsResponse, ListProductsRequest, ListProductsResponse, RequestProposalsRequest, RequestProposalsResponse, DeclineProposalsRequest, DeclineProposalsResponse, BuyProductsRequest, BuyProductsResponse, AcceptProposalRequest, AcceptProposalResponse, ControlMediaBuyRequest, ControlMediaBuyResponse, ListCreativeFormatsRequest, ListCreativeFormatsResponse, CreateMediaBuyRequest, CreateMediaBuyResponse, UpdateMediaBuyRequest, UpdateMediaBuyResponse, SyncCreativesRequest, SyncCreativesResponse, ListCreativesRequest, ListCreativesResponse, GetMediaBuysRequest, GetMediaBuysResponse, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, PreviewCreativeRequest, PreviewCreativeResponse, BuildCreativeRequest, BuildCreativeResponse, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAudiencesRequest, SyncAudiencesResponse, CreatePropertyListRequest, CreatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, ListContentStandardsRequest, ListContentStandardsResponse, GetContentStandardsRequest, GetContentStandardsResponse, CalibrateContentRequest, CalibrateContentResponse, ValidateContentDeliveryRequest, ValidateContentDeliveryResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SyncPlansRequest, SyncPlansResponse, CheckGovernanceRequest, CheckGovernanceResponse, ReportPlanOutcomeRequest, ReportPlanOutcomeResponse, ReportPlanAdjustmentRequest, ReportPlanAdjustmentResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, ListTransformersRequest, ListTransformersResponse, SyncAgentNotificationConfigsRequest, SyncAgentNotificationConfigsResponse } from '../types/tools.generated';
9
+ import type { GetProductsRequest, GetProductsResponse, ListProductsRequest, ListProductsResponse, RequestProposalsRequest, RequestProposalsResponse, DeclineProposalsRequest, DeclineProposalsResponse, BuyProductsRequest, BuyProductsResponse, AcceptProposalRequest, AcceptProposalResponse, ControlMediaBuyRequest, ControlMediaBuyResponse, ListCreativeFormatsRequest, ListCreativeFormatsResponse, CreateMediaBuyRequest, CreateMediaBuyResponse, UpdateMediaBuyRequest, UpdateMediaBuyResponse, SyncCreativesRequest, SyncCreativesResponse, ListCreativesRequest, ListCreativesResponse, GetMediaBuysRequest, GetMediaBuysResponse, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, GetReportingStatusRequest, GetReportingStatusResponse, SyncReportingReceiptsRequest, SyncReportingReceiptsResponse, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, PreviewCreativeRequest, PreviewCreativeResponse, BuildCreativeRequest, BuildCreativeResponse, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAudiencesRequest, SyncAudiencesResponse, CreatePropertyListRequest, CreatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, ListContentStandardsRequest, ListContentStandardsResponse, GetContentStandardsRequest, GetContentStandardsResponse, CalibrateContentRequest, CalibrateContentResponse, ValidateContentDeliveryRequest, ValidateContentDeliveryResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SyncPlansRequest, SyncPlansResponse, CheckGovernanceRequest, CheckGovernanceResponse, ReportPlanOutcomeRequest, ReportPlanOutcomeResponse, ReportPlanAdjustmentRequest, ReportPlanAdjustmentResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, ListTransformersRequest, ListTransformersResponse, SyncAgentNotificationConfigsRequest, SyncAgentNotificationConfigsResponse } from '../types/tools.generated';
10
10
  import type { MutatingRequestInput } from '../utils/idempotency';
11
11
  import { MediaBuyLifecycleCoordinator, type MediaBuyLifecycleCoordinatorOptions } from '../media-buy/compatibility';
12
12
  import type { ProposalRefinementCapabilities, RefineProposalsInput, RefineProposalsResponse } from '../negotiation/types';
@@ -58,6 +58,8 @@ export type TaskResponseTypeMap = {
58
58
  list_creatives: CanonicalListCreativesResponse;
59
59
  get_media_buys: CanonicalCreativeResponse<GetMediaBuysResponse>;
60
60
  get_media_buy_delivery: CanonicalCreativeResponse<GetMediaBuyDeliveryResponse>;
61
+ get_reporting_status: GetReportingStatusResponse;
62
+ sync_reporting_receipts: SyncReportingReceiptsResponse;
61
63
  get_creative_delivery: CanonicalCreativeResponse<GetCreativeDeliveryResponse>;
62
64
  provide_performance_feedback: ProvidePerformanceFeedbackResponse;
63
65
  get_signals: GetSignalsResponse;
@@ -106,6 +108,8 @@ export type TaskRequestTypeMap = {
106
108
  list_creatives: CanonicalListCreativesRequest;
107
109
  get_media_buys: GetMediaBuysRequest;
108
110
  get_media_buy_delivery: GetMediaBuyDeliveryRequest;
111
+ get_reporting_status: GetReportingStatusRequest;
112
+ sync_reporting_receipts: MutatingRequestInput<SyncReportingReceiptsRequest>;
109
113
  get_creative_delivery: GetCreativeDeliveryRequest;
110
114
  provide_performance_feedback: MutatingRequestInput<ProvidePerformanceFeedbackRequest>;
111
115
  get_signals: GetSignalsRequest;
@@ -520,6 +520,8 @@ const PRIMARY_ADCP_TASK_NAMES = {
520
520
  list_creatives: true,
521
521
  get_media_buys: true,
522
522
  get_media_buy_delivery: true,
523
+ get_reporting_status: true,
524
+ sync_reporting_receipts: true,
523
525
  get_creative_delivery: true,
524
526
  provide_performance_feedback: true,
525
527
  get_signals: true,
@@ -574,6 +574,8 @@ const PRIMARY_ADCP_TASK_NAMES = {
574
574
  list_creatives: true,
575
575
  get_media_buys: true,
576
576
  get_media_buy_delivery: true,
577
+ get_reporting_status: true,
578
+ sync_reporting_receipts: true,
577
579
  get_creative_delivery: true,
578
580
  provide_performance_feedback: true,
579
581
  get_signals: true,
@@ -62,6 +62,7 @@ export { canonicalize, canonicalJsonSha256 } from './utils/jcs.mjs';
62
62
  export { rollupOptimizationMetricsFromProducts } from './utils/capability-rollups.mjs';
63
63
  export * from './negotiation/index.mjs';
64
64
  export type { RefineProposalsRequest, RefineProposalsResponse } from './negotiation/index.mjs';
65
+ export * from './reporting/index.mjs';
65
66
  export * from './types/index.mjs';
66
67
  export type { GetProductsRequest as LegacyGetProductsRequest, GetProductsResponse as LegacyGetProductsResponse, ListCreativeFormatsRequest as LegacyListCreativeFormatsRequest, ListCreativeFormatsResponse as LegacyListCreativeFormatsResponse, CreateMediaBuyRequest as LegacyCreateMediaBuyRequest, CreateMediaBuyResponse as LegacyCreateMediaBuyResponse, CreateMediaBuySuccess as LegacyCreateMediaBuySuccess, CreateMediaBuyError as LegacyCreateMediaBuyError, CreateMediaBuySubmitted as LegacyCreateMediaBuySubmitted, UpdateMediaBuyRequest as LegacyUpdateMediaBuyRequest, UpdateMediaBuyResponse as LegacyUpdateMediaBuyResponse, UpdateMediaBuySuccess as LegacyUpdateMediaBuySuccess, UpdateMediaBuyError as LegacyUpdateMediaBuyError, SyncCreativesRequest as LegacySyncCreativesRequest, SyncCreativesResponse as LegacySyncCreativesResponse, SyncCreativesSuccess as LegacySyncCreativesSuccess, SyncCreativesError as LegacySyncCreativesError, SyncCreativesSubmitted as LegacySyncCreativesSubmitted, SyncAudiencesRequest, SyncAudiencesResponse, SyncAudiencesSuccess, SyncAudiencesError, ListCreativesRequest as LegacyListCreativesRequest, ListCreativesResponse as LegacyListCreativesResponse, CreativeFilters as LegacyCreativeFilters, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse as LegacyGetMediaBuyDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, ProvidePerformanceFeedbackSuccess, ProvidePerformanceFeedbackError, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, ActivateSignalSuccess, ActivateSignalError, CpmPricing, PercentOfMediaPricing, FlatFeePricing, PerUnitPricing, CustomPricing, VendorPricing, VendorPricingOption, CPMPricingOption, VCPMPricingOption, CPCPricingOption, CPCVPricingOption, CPVPricingOption, CPPPricingOption, FlatRatePricingOption, TimeBasedPricingOption, CreatePropertyListRequest, CreatePropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, PropertyList, PropertyListFilters, ListContentStandardsRequest as LegacyListContentStandardsRequest, ListContentStandardsResponse as LegacyListContentStandardsResponse, GetContentStandardsRequest as LegacyGetContentStandardsRequest, GetContentStandardsResponse as LegacyGetContentStandardsResponse, CreateContentStandardsRequest as LegacyCreateContentStandardsRequest, CreateContentStandardsResponse as LegacyCreateContentStandardsResponse, UpdateContentStandardsRequest as LegacyUpdateContentStandardsRequest, UpdateContentStandardsResponse as LegacyUpdateContentStandardsResponse, UpdateContentStandardsSuccess as LegacyUpdateContentStandardsSuccess, UpdateContentStandardsError as LegacyUpdateContentStandardsError, CalibrateContentRequest as LegacyCalibrateContentRequest, CalibrateContentResponse as LegacyCalibrateContentResponse, ValidateContentDeliveryRequest as LegacyValidateContentDeliveryRequest, ValidateContentDeliveryResponse as LegacyValidateContentDeliveryResponse, ContentStandards as LegacyContentStandards, Artifact as LegacyArtifact, SyncPlansRequest, SyncPlansResponse, SyncGovernanceRequest, SyncGovernanceResponse, SyncGovernanceSuccess, SyncGovernanceError, CheckGovernanceRequest, CheckGovernanceResponse, ReportPlanOutcomeRequest, ReportPlanOutcomeResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, PlannedDelivery, GovernancePhase, EscalationSeverity, PolicyEnforcementLevel, OutcomeType, GetCreativeFeaturesRequest as LegacyGetCreativeFeaturesRequest, GetCreativeFeaturesResponse as LegacyGetCreativeFeaturesResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SICapabilities, SIIdentity, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, SyncEventSourcesRequest, SyncEventSourcesResponse, SyncEventSourcesSuccess, SyncEventSourcesError, LogEventRequest, LogEventResponse, LogEventSuccess, LogEventError, CanceledBy, Format as LegacyFormat, Product as LegacyProduct, Proposal, ProductAllocation, PackageRequest as LegacyPackageRequest, // Raw wire shape for migration/server tooling
67
68
  CreativeAsset as LegacyCompatibleCreativeAsset, CreativePolicy, BrandReference, BrandID, AccountReference, CPAPricingOption, EventType, ActionSource, OptimizationGoal, ReachUnit, TargetingOverlay, OutcomeMeasurementDeprecated, OutcomeMeasurementDeprecated as OutcomeMeasurement, Duration, DeviceType, DigitalSourceType, FrequencyCap, GeographicBreakdownSupport, Catalog, CatalogType, FeedFormat, UpdateFrequency, ContentIDType, CatalogFieldMapping, SyncCatalogsRequest, SyncCatalogsResponse, SyncCatalogsSuccess, SyncCatalogsError, Overlay, Placement as LegacyPlacement, CreativeManifest as LegacyCreativeManifest, CreativeVariable, BuildCreativeRequest as LegacyBuildCreativeRequest, BuildCreativeResponse as LegacyBuildCreativeResponse, BuildCreativeSuccess as LegacyBuildCreativeSuccess, BuildCreativeMultiSuccess as LegacyBuildCreativeMultiSuccess, BuildCreativeVariantSuccess as LegacyBuildCreativeVariantSuccess, BuildCreativeError as LegacyBuildCreativeError, PreviewCreativeRequest as LegacyPreviewCreativeRequest, PreviewCreativeResponse as LegacyPreviewCreativeResponse, GetMediaBuysRequest, GetMediaBuysResponse as LegacyGetMediaBuysResponse, ImageAsset, VideoAsset, AudioAsset, TextAsset, URLAsset, HTMLAsset, VASTAsset, DAASTAsset, JavaScriptAsset, WebhookAsset, CSSAsset, MarkdownAsset, CatalogAsset, BriefAsset, ReferenceAsset, Provenance, PreviewOutputFormat, DisclosurePosition, EventCustomData, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse as LegacyGetCreativeDeliveryResponse, Account, AccountChange, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAccountsSuccess, SyncAccountsError, GetAccountFinancialsRequest, GetAccountFinancialsResponse, GetAccountFinancialsSuccess, GetAccountFinancialsError, PaginationRequest, PaginationResponse, PackageUpdate as LegacyPackageUpdate, Package as LegacyPackage, Destination, SignalFilters, PricingOption, PriceGuidance, } from './types/tools.generated.mjs';
@@ -62,6 +62,7 @@ export { canonicalize, canonicalJsonSha256 } from './utils/jcs';
62
62
  export { rollupOptimizationMetricsFromProducts } from './utils/capability-rollups';
63
63
  export * from './negotiation';
64
64
  export type { RefineProposalsRequest, RefineProposalsResponse } from './negotiation';
65
+ export * from './reporting';
65
66
  export * from './types';
66
67
  export type { GetProductsRequest as LegacyGetProductsRequest, GetProductsResponse as LegacyGetProductsResponse, ListCreativeFormatsRequest as LegacyListCreativeFormatsRequest, ListCreativeFormatsResponse as LegacyListCreativeFormatsResponse, CreateMediaBuyRequest as LegacyCreateMediaBuyRequest, CreateMediaBuyResponse as LegacyCreateMediaBuyResponse, CreateMediaBuySuccess as LegacyCreateMediaBuySuccess, CreateMediaBuyError as LegacyCreateMediaBuyError, CreateMediaBuySubmitted as LegacyCreateMediaBuySubmitted, UpdateMediaBuyRequest as LegacyUpdateMediaBuyRequest, UpdateMediaBuyResponse as LegacyUpdateMediaBuyResponse, UpdateMediaBuySuccess as LegacyUpdateMediaBuySuccess, UpdateMediaBuyError as LegacyUpdateMediaBuyError, SyncCreativesRequest as LegacySyncCreativesRequest, SyncCreativesResponse as LegacySyncCreativesResponse, SyncCreativesSuccess as LegacySyncCreativesSuccess, SyncCreativesError as LegacySyncCreativesError, SyncCreativesSubmitted as LegacySyncCreativesSubmitted, SyncAudiencesRequest, SyncAudiencesResponse, SyncAudiencesSuccess, SyncAudiencesError, ListCreativesRequest as LegacyListCreativesRequest, ListCreativesResponse as LegacyListCreativesResponse, CreativeFilters as LegacyCreativeFilters, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse as LegacyGetMediaBuyDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, ProvidePerformanceFeedbackSuccess, ProvidePerformanceFeedbackError, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, ActivateSignalSuccess, ActivateSignalError, CpmPricing, PercentOfMediaPricing, FlatFeePricing, PerUnitPricing, CustomPricing, VendorPricing, VendorPricingOption, CPMPricingOption, VCPMPricingOption, CPCPricingOption, CPCVPricingOption, CPVPricingOption, CPPPricingOption, FlatRatePricingOption, TimeBasedPricingOption, CreatePropertyListRequest, CreatePropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, PropertyList, PropertyListFilters, ListContentStandardsRequest as LegacyListContentStandardsRequest, ListContentStandardsResponse as LegacyListContentStandardsResponse, GetContentStandardsRequest as LegacyGetContentStandardsRequest, GetContentStandardsResponse as LegacyGetContentStandardsResponse, CreateContentStandardsRequest as LegacyCreateContentStandardsRequest, CreateContentStandardsResponse as LegacyCreateContentStandardsResponse, UpdateContentStandardsRequest as LegacyUpdateContentStandardsRequest, UpdateContentStandardsResponse as LegacyUpdateContentStandardsResponse, UpdateContentStandardsSuccess as LegacyUpdateContentStandardsSuccess, UpdateContentStandardsError as LegacyUpdateContentStandardsError, CalibrateContentRequest as LegacyCalibrateContentRequest, CalibrateContentResponse as LegacyCalibrateContentResponse, ValidateContentDeliveryRequest as LegacyValidateContentDeliveryRequest, ValidateContentDeliveryResponse as LegacyValidateContentDeliveryResponse, ContentStandards as LegacyContentStandards, Artifact as LegacyArtifact, SyncPlansRequest, SyncPlansResponse, SyncGovernanceRequest, SyncGovernanceResponse, SyncGovernanceSuccess, SyncGovernanceError, CheckGovernanceRequest, CheckGovernanceResponse, ReportPlanOutcomeRequest, ReportPlanOutcomeResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, PlannedDelivery, GovernancePhase, EscalationSeverity, PolicyEnforcementLevel, OutcomeType, GetCreativeFeaturesRequest as LegacyGetCreativeFeaturesRequest, GetCreativeFeaturesResponse as LegacyGetCreativeFeaturesResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SICapabilities, SIIdentity, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, SyncEventSourcesRequest, SyncEventSourcesResponse, SyncEventSourcesSuccess, SyncEventSourcesError, LogEventRequest, LogEventResponse, LogEventSuccess, LogEventError, CanceledBy, Format as LegacyFormat, Product as LegacyProduct, Proposal, ProductAllocation, PackageRequest as LegacyPackageRequest, // Raw wire shape for migration/server tooling
67
68
  CreativeAsset as LegacyCompatibleCreativeAsset, CreativePolicy, BrandReference, BrandID, AccountReference, CPAPricingOption, EventType, ActionSource, OptimizationGoal, ReachUnit, TargetingOverlay, OutcomeMeasurementDeprecated, OutcomeMeasurementDeprecated as OutcomeMeasurement, Duration, DeviceType, DigitalSourceType, FrequencyCap, GeographicBreakdownSupport, Catalog, CatalogType, FeedFormat, UpdateFrequency, ContentIDType, CatalogFieldMapping, SyncCatalogsRequest, SyncCatalogsResponse, SyncCatalogsSuccess, SyncCatalogsError, Overlay, Placement as LegacyPlacement, CreativeManifest as LegacyCreativeManifest, CreativeVariable, BuildCreativeRequest as LegacyBuildCreativeRequest, BuildCreativeResponse as LegacyBuildCreativeResponse, BuildCreativeSuccess as LegacyBuildCreativeSuccess, BuildCreativeMultiSuccess as LegacyBuildCreativeMultiSuccess, BuildCreativeVariantSuccess as LegacyBuildCreativeVariantSuccess, BuildCreativeError as LegacyBuildCreativeError, PreviewCreativeRequest as LegacyPreviewCreativeRequest, PreviewCreativeResponse as LegacyPreviewCreativeResponse, GetMediaBuysRequest, GetMediaBuysResponse as LegacyGetMediaBuysResponse, ImageAsset, VideoAsset, AudioAsset, TextAsset, URLAsset, HTMLAsset, VASTAsset, DAASTAsset, JavaScriptAsset, WebhookAsset, CSSAsset, MarkdownAsset, CatalogAsset, BriefAsset, ReferenceAsset, Provenance, PreviewOutputFormat, DisclosurePosition, EventCustomData, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse as LegacyGetCreativeDeliveryResponse, Account, AccountChange, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAccountsSuccess, SyncAccountsError, GetAccountFinancialsRequest, GetAccountFinancialsResponse, GetAccountFinancialsSuccess, GetAccountFinancialsError, PaginationRequest, PaginationResponse, PackageUpdate as LegacyPackageUpdate, Package as LegacyPackage, Destination, SignalFilters, PricingOption, PriceGuidance, } from './types/tools.generated';
package/dist/lib/index.js CHANGED
@@ -732,6 +732,7 @@ var import_idempotency = require('./utils/idempotency.js');
732
732
  var import_jcs = require('./utils/jcs.js');
733
733
  var import_capability_rollups = require('./utils/capability-rollups.js');
734
734
  __reExport(index_exports, require('./negotiation/index.js'), module.exports);
735
+ __reExport(index_exports, require('./reporting/index.js'), module.exports);
735
736
  __reExport(index_exports, require('./types/index.js'), module.exports);
736
737
  var import_wellknown_schemas = require('./types/wellknown-schemas.generated.js');
737
738
  var import_schemas = require('./types/schemas.generated.js');
@@ -1479,6 +1480,7 @@ function createAdCPClientFromEnv() {
1479
1480
  withSpan,
1480
1481
  ...require('./handlers/types.js'),
1481
1482
  ...require('./negotiation/index.js'),
1483
+ ...require('./reporting/index.js'),
1482
1484
  ...require('./types/index.js'),
1483
1485
  ...require('./types/enums.generated.js'),
1484
1486
  ...require('./types/inline-enums.generated.js'),
@@ -260,6 +260,7 @@ import {
260
260
  import { canonicalize, canonicalJsonSha256 } from "./utils/jcs.mjs";
261
261
  import { rollupOptimizationMetricsFromProducts } from "./utils/capability-rollups.mjs";
262
262
  export * from "./negotiation/index.mjs";
263
+ export * from "./reporting/index.mjs";
263
264
  export * from "./types/index.mjs";
264
265
  import { BrandJsonSchema, AdagentsJsonSchema } from "./types/wellknown-schemas.generated.mjs";
265
266
  import { PlacementPresentationDocumentSchema, PlacementPresentationReferenceSchema } from "./types/schemas.generated.mjs";
@@ -0,0 +1,4 @@
1
+ export declare function isReportingControlTotals(value: unknown): boolean;
2
+ export declare function isReportingCanonicalDigest(value: unknown): boolean;
3
+ export declare function isReportingVerificationEvidence(value: unknown): boolean;
4
+ export declare function isReportingReceiptEvidence(value: unknown): boolean;
@@ -0,0 +1,4 @@
1
+ export declare function isReportingControlTotals(value: unknown): boolean;
2
+ export declare function isReportingCanonicalDigest(value: unknown): boolean;
3
+ export declare function isReportingVerificationEvidence(value: unknown): boolean;
4
+ export declare function isReportingReceiptEvidence(value: unknown): boolean;
@@ -0,0 +1,136 @@
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 evidence_exports = {};
20
+ __export(evidence_exports, {
21
+ isReportingCanonicalDigest: () => isReportingCanonicalDigest,
22
+ isReportingControlTotals: () => isReportingControlTotals,
23
+ isReportingReceiptEvidence: () => isReportingReceiptEvidence,
24
+ isReportingVerificationEvidence: () => isReportingVerificationEvidence
25
+ });
26
+ module.exports = __toCommonJS(evidence_exports);
27
+ const CONTROL_TOTAL_NAME = /^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/;
28
+ const CANONICAL_DECIMAL = /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$/;
29
+ const SHA256_HEX = /^[A-Fa-f0-9]{64}$/;
30
+ const SHA512_HEX = /^[A-Fa-f0-9]{128}$/;
31
+ const REPORTING_ID = /^[A-Za-z0-9_.:-]+$/;
32
+ function isRecord(value) {
33
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
34
+ }
35
+ function hasExactKeys(value, required, optional = []) {
36
+ const allowed = /* @__PURE__ */ new Set([...required, ...optional]);
37
+ return required.every((key) => value[key] !== void 0) && Object.keys(value).every((key) => allowed.has(key));
38
+ }
39
+ function isOffsetDateTime(value) {
40
+ return typeof value === "string" && value.includes("T") && /(?:Z|[+-]\d{2}:\d{2})$/.test(value) && Number.isFinite(Date.parse(value));
41
+ }
42
+ function isReportingControlTotals(value) {
43
+ if (!Array.isArray(value)) return false;
44
+ const names = /* @__PURE__ */ new Set();
45
+ for (const total of value) {
46
+ if (!isRecord(total) || !hasExactKeys(total, ["name", "value", "value_type"], ["unit"]) || typeof total.name !== "string" || !CONTROL_TOTAL_NAME.test(total.name) || names.has(total.name) || typeof total.value !== "string" || !CANONICAL_DECIMAL.test(total.value) || !["integer", "decimal"].includes(String(total.value_type)) || total.value_type === "integer" && total.value.includes(".") || total.unit !== void 0 && (typeof total.unit !== "string" || total.unit.length < 1 || total.unit.length > 32)) {
47
+ return false;
48
+ }
49
+ names.add(total.name);
50
+ }
51
+ return true;
52
+ }
53
+ function isReportingCanonicalDigest(value) {
54
+ return isRecord(value) && hasExactKeys(value, [
55
+ "algorithm",
56
+ "value",
57
+ "canonicalization_id",
58
+ "canonicalization_uri",
59
+ "canonicalization_sha256"
60
+ ]) && value.algorithm === "sha256" && typeof value.value === "string" && SHA256_HEX.test(value.value) && typeof value.canonicalization_id === "string" && value.canonicalization_id.length >= 1 && value.canonicalization_id.length <= 128 && typeof value.canonicalization_uri === "string" && value.canonicalization_uri.startsWith("https://") && typeof value.canonicalization_sha256 === "string" && SHA256_HEX.test(value.canonicalization_sha256);
61
+ }
62
+ function isPhysicalChecksums(value) {
63
+ return Array.isArray(value) && value.length > 0 && value.every(
64
+ (checksum) => isRecord(checksum) && hasExactKeys(checksum, ["object_ref", "algorithm", "value"]) && typeof checksum.object_ref === "string" && checksum.object_ref.length >= 1 && checksum.object_ref.length <= 1024 && (checksum.algorithm === "sha256" && typeof checksum.value === "string" && SHA256_HEX.test(checksum.value) || checksum.algorithm === "sha512" && typeof checksum.value === "string" && SHA512_HEX.test(checksum.value))
65
+ );
66
+ }
67
+ function isReportingVerificationEvidence(value) {
68
+ if (!isRecord(value) || !hasExactKeys(
69
+ value,
70
+ ["verified_at", "verification_path", "verification_profile", "row_count", "control_totals"],
71
+ ["canonical_content_digest", "physical_checksums", "native_commit_evidence"]
72
+ ) || !isOffsetDateTime(value.verified_at) || !["producer", "representative_consumer", "destination"].includes(String(value.verification_path)) || !["native_commit", "manifest_checksums", "canonical_digest"].includes(String(value.verification_profile)) || !Number.isSafeInteger(value.row_count) || Number(value.row_count) < 0 || !isReportingControlTotals(value.control_totals) || value.canonical_content_digest !== void 0 && !isReportingCanonicalDigest(value.canonical_content_digest) || value.physical_checksums !== void 0 && !isPhysicalChecksums(value.physical_checksums)) {
73
+ return false;
74
+ }
75
+ if (value.native_commit_evidence !== void 0) {
76
+ const native = value.native_commit_evidence;
77
+ if (!isRecord(native) || !hasExactKeys(native, ["native_version_ref", "observed_through"]) || typeof native.native_version_ref !== "string" || native.native_version_ref.length < 1 || native.native_version_ref.length > 512 || !["representative_consumer", "destination"].includes(String(native.observed_through))) {
78
+ return false;
79
+ }
80
+ }
81
+ if (value.verification_profile === "native_commit") return value.native_commit_evidence !== void 0;
82
+ if (value.verification_profile === "manifest_checksums") return isPhysicalChecksums(value.physical_checksums);
83
+ return isReportingCanonicalDigest(value.canonical_content_digest);
84
+ }
85
+ function isReportingReceiptEvidence(value) {
86
+ if (!isRecord(value) || !hasExactKeys(
87
+ value,
88
+ [
89
+ "reporting_receipt_id",
90
+ "reporting_obligation_id",
91
+ "reporting_revision_id",
92
+ "reporting_materialization_id",
93
+ "status",
94
+ "verification_profile",
95
+ "observed_row_count",
96
+ "observed_control_totals",
97
+ "observed_at"
98
+ ],
99
+ [
100
+ "observed_canonical_content_digest",
101
+ "observed_manifest_sha256",
102
+ "observed_native_version_ref",
103
+ "consumer_commit_ref",
104
+ "rejection_codes",
105
+ "received_at"
106
+ ]
107
+ )) {
108
+ return false;
109
+ }
110
+ const ids = [
111
+ value.reporting_receipt_id,
112
+ value.reporting_obligation_id,
113
+ value.reporting_revision_id,
114
+ value.reporting_materialization_id
115
+ ];
116
+ if (!ids.every((id) => typeof id === "string" && id.length >= 1 && id.length <= 255 && REPORTING_ID.test(id)) || typeof value.reporting_receipt_id !== "string" || value.reporting_receipt_id.length < 16 || !["accepted", "rejected"].includes(String(value.status)) || !["native_commit", "manifest_checksums", "canonical_digest"].includes(String(value.verification_profile)) || !Number.isSafeInteger(value.observed_row_count) || Number(value.observed_row_count) < 0 || !isReportingControlTotals(value.observed_control_totals) || !isOffsetDateTime(value.observed_at) || value.received_at !== void 0 && !isOffsetDateTime(value.received_at) || value.observed_canonical_content_digest !== void 0 && !isReportingCanonicalDigest(value.observed_canonical_content_digest) || value.observed_manifest_sha256 !== void 0 && (typeof value.observed_manifest_sha256 !== "string" || !SHA256_HEX.test(value.observed_manifest_sha256)) || value.observed_native_version_ref !== void 0 && (typeof value.observed_native_version_ref !== "string" || value.observed_native_version_ref.length < 1 || value.observed_native_version_ref.length > 512) || value.consumer_commit_ref !== void 0 && (typeof value.consumer_commit_ref !== "string" || value.consumer_commit_ref.length < 1 || value.consumer_commit_ref.length > 512)) {
117
+ return false;
118
+ }
119
+ if (value.status === "rejected") {
120
+ return Array.isArray(value.rejection_codes) && value.rejection_codes.length > 0 && new Set(value.rejection_codes).size === value.rejection_codes.length && value.rejection_codes.every((code) => typeof code === "string" && /^[A-Z][A-Z0-9_]{0,127}$/.test(code));
121
+ }
122
+ if (value.verification_profile === "canonical_digest") {
123
+ return isReportingCanonicalDigest(value.observed_canonical_content_digest);
124
+ }
125
+ if (value.verification_profile === "manifest_checksums") {
126
+ return typeof value.observed_manifest_sha256 === "string" && SHA256_HEX.test(value.observed_manifest_sha256);
127
+ }
128
+ return typeof value.observed_native_version_ref === "string" && value.observed_native_version_ref.length >= 1 && value.observed_native_version_ref.length <= 512;
129
+ }
130
+ // Annotate the CommonJS export names for ESM import in node:
131
+ 0 && (module.exports = {
132
+ isReportingCanonicalDigest,
133
+ isReportingControlTotals,
134
+ isReportingReceiptEvidence,
135
+ isReportingVerificationEvidence
136
+ });
@@ -0,0 +1,109 @@
1
+ const CONTROL_TOTAL_NAME = /^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/;
2
+ const CANONICAL_DECIMAL = /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$/;
3
+ const SHA256_HEX = /^[A-Fa-f0-9]{64}$/;
4
+ const SHA512_HEX = /^[A-Fa-f0-9]{128}$/;
5
+ const REPORTING_ID = /^[A-Za-z0-9_.:-]+$/;
6
+ function isRecord(value) {
7
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
8
+ }
9
+ function hasExactKeys(value, required, optional = []) {
10
+ const allowed = /* @__PURE__ */ new Set([...required, ...optional]);
11
+ return required.every((key) => value[key] !== void 0) && Object.keys(value).every((key) => allowed.has(key));
12
+ }
13
+ function isOffsetDateTime(value) {
14
+ return typeof value === "string" && value.includes("T") && /(?:Z|[+-]\d{2}:\d{2})$/.test(value) && Number.isFinite(Date.parse(value));
15
+ }
16
+ function isReportingControlTotals(value) {
17
+ if (!Array.isArray(value)) return false;
18
+ const names = /* @__PURE__ */ new Set();
19
+ for (const total of value) {
20
+ if (!isRecord(total) || !hasExactKeys(total, ["name", "value", "value_type"], ["unit"]) || typeof total.name !== "string" || !CONTROL_TOTAL_NAME.test(total.name) || names.has(total.name) || typeof total.value !== "string" || !CANONICAL_DECIMAL.test(total.value) || !["integer", "decimal"].includes(String(total.value_type)) || total.value_type === "integer" && total.value.includes(".") || total.unit !== void 0 && (typeof total.unit !== "string" || total.unit.length < 1 || total.unit.length > 32)) {
21
+ return false;
22
+ }
23
+ names.add(total.name);
24
+ }
25
+ return true;
26
+ }
27
+ function isReportingCanonicalDigest(value) {
28
+ return isRecord(value) && hasExactKeys(value, [
29
+ "algorithm",
30
+ "value",
31
+ "canonicalization_id",
32
+ "canonicalization_uri",
33
+ "canonicalization_sha256"
34
+ ]) && value.algorithm === "sha256" && typeof value.value === "string" && SHA256_HEX.test(value.value) && typeof value.canonicalization_id === "string" && value.canonicalization_id.length >= 1 && value.canonicalization_id.length <= 128 && typeof value.canonicalization_uri === "string" && value.canonicalization_uri.startsWith("https://") && typeof value.canonicalization_sha256 === "string" && SHA256_HEX.test(value.canonicalization_sha256);
35
+ }
36
+ function isPhysicalChecksums(value) {
37
+ return Array.isArray(value) && value.length > 0 && value.every(
38
+ (checksum) => isRecord(checksum) && hasExactKeys(checksum, ["object_ref", "algorithm", "value"]) && typeof checksum.object_ref === "string" && checksum.object_ref.length >= 1 && checksum.object_ref.length <= 1024 && (checksum.algorithm === "sha256" && typeof checksum.value === "string" && SHA256_HEX.test(checksum.value) || checksum.algorithm === "sha512" && typeof checksum.value === "string" && SHA512_HEX.test(checksum.value))
39
+ );
40
+ }
41
+ function isReportingVerificationEvidence(value) {
42
+ if (!isRecord(value) || !hasExactKeys(
43
+ value,
44
+ ["verified_at", "verification_path", "verification_profile", "row_count", "control_totals"],
45
+ ["canonical_content_digest", "physical_checksums", "native_commit_evidence"]
46
+ ) || !isOffsetDateTime(value.verified_at) || !["producer", "representative_consumer", "destination"].includes(String(value.verification_path)) || !["native_commit", "manifest_checksums", "canonical_digest"].includes(String(value.verification_profile)) || !Number.isSafeInteger(value.row_count) || Number(value.row_count) < 0 || !isReportingControlTotals(value.control_totals) || value.canonical_content_digest !== void 0 && !isReportingCanonicalDigest(value.canonical_content_digest) || value.physical_checksums !== void 0 && !isPhysicalChecksums(value.physical_checksums)) {
47
+ return false;
48
+ }
49
+ if (value.native_commit_evidence !== void 0) {
50
+ const native = value.native_commit_evidence;
51
+ if (!isRecord(native) || !hasExactKeys(native, ["native_version_ref", "observed_through"]) || typeof native.native_version_ref !== "string" || native.native_version_ref.length < 1 || native.native_version_ref.length > 512 || !["representative_consumer", "destination"].includes(String(native.observed_through))) {
52
+ return false;
53
+ }
54
+ }
55
+ if (value.verification_profile === "native_commit") return value.native_commit_evidence !== void 0;
56
+ if (value.verification_profile === "manifest_checksums") return isPhysicalChecksums(value.physical_checksums);
57
+ return isReportingCanonicalDigest(value.canonical_content_digest);
58
+ }
59
+ function isReportingReceiptEvidence(value) {
60
+ if (!isRecord(value) || !hasExactKeys(
61
+ value,
62
+ [
63
+ "reporting_receipt_id",
64
+ "reporting_obligation_id",
65
+ "reporting_revision_id",
66
+ "reporting_materialization_id",
67
+ "status",
68
+ "verification_profile",
69
+ "observed_row_count",
70
+ "observed_control_totals",
71
+ "observed_at"
72
+ ],
73
+ [
74
+ "observed_canonical_content_digest",
75
+ "observed_manifest_sha256",
76
+ "observed_native_version_ref",
77
+ "consumer_commit_ref",
78
+ "rejection_codes",
79
+ "received_at"
80
+ ]
81
+ )) {
82
+ return false;
83
+ }
84
+ const ids = [
85
+ value.reporting_receipt_id,
86
+ value.reporting_obligation_id,
87
+ value.reporting_revision_id,
88
+ value.reporting_materialization_id
89
+ ];
90
+ if (!ids.every((id) => typeof id === "string" && id.length >= 1 && id.length <= 255 && REPORTING_ID.test(id)) || typeof value.reporting_receipt_id !== "string" || value.reporting_receipt_id.length < 16 || !["accepted", "rejected"].includes(String(value.status)) || !["native_commit", "manifest_checksums", "canonical_digest"].includes(String(value.verification_profile)) || !Number.isSafeInteger(value.observed_row_count) || Number(value.observed_row_count) < 0 || !isReportingControlTotals(value.observed_control_totals) || !isOffsetDateTime(value.observed_at) || value.received_at !== void 0 && !isOffsetDateTime(value.received_at) || value.observed_canonical_content_digest !== void 0 && !isReportingCanonicalDigest(value.observed_canonical_content_digest) || value.observed_manifest_sha256 !== void 0 && (typeof value.observed_manifest_sha256 !== "string" || !SHA256_HEX.test(value.observed_manifest_sha256)) || value.observed_native_version_ref !== void 0 && (typeof value.observed_native_version_ref !== "string" || value.observed_native_version_ref.length < 1 || value.observed_native_version_ref.length > 512) || value.consumer_commit_ref !== void 0 && (typeof value.consumer_commit_ref !== "string" || value.consumer_commit_ref.length < 1 || value.consumer_commit_ref.length > 512)) {
91
+ return false;
92
+ }
93
+ if (value.status === "rejected") {
94
+ return Array.isArray(value.rejection_codes) && value.rejection_codes.length > 0 && new Set(value.rejection_codes).size === value.rejection_codes.length && value.rejection_codes.every((code) => typeof code === "string" && /^[A-Z][A-Z0-9_]{0,127}$/.test(code));
95
+ }
96
+ if (value.verification_profile === "canonical_digest") {
97
+ return isReportingCanonicalDigest(value.observed_canonical_content_digest);
98
+ }
99
+ if (value.verification_profile === "manifest_checksums") {
100
+ return typeof value.observed_manifest_sha256 === "string" && SHA256_HEX.test(value.observed_manifest_sha256);
101
+ }
102
+ return typeof value.observed_native_version_ref === "string" && value.observed_native_version_ref.length >= 1 && value.observed_native_version_ref.length <= 512;
103
+ }
104
+ export {
105
+ isReportingCanonicalDigest,
106
+ isReportingControlTotals,
107
+ isReportingReceiptEvidence,
108
+ isReportingVerificationEvidence
109
+ };
@@ -0,0 +1,4 @@
1
+ export { ReportingReconciliationError, buildReportingReceipt, evaluateReportingLedger, isReportingCoverageEvidence, loadReportingLedger, reconcileReporting, } from './reconciliation.mjs';
2
+ export { ReportingInspectionError, createHttpsReportingResourceReader, createReportingManifestInspector, } from './inspection.mjs';
3
+ export type { ExpectedReportingPeriod, ExpectedReportingCoverage, ObligationReconciliation, ReconcileReportingOptions, ReportingCheckpoint, ReportingCheckpointKey, ReportingCheckpointStore, ReportingCanonicalDigestEvidence, ReportingCoverageEvidence, ReportingCoverageLimitation, ReportingInspectionContext, ReportingLedger, ReportingLedgerLimits, ReportingObservation, ReportingReconciliationClient, ReportingReconciliationResult, } from './reconciliation.mjs';
4
+ export type { HttpsReportingResourceReaderOptions, ReportingCompressionDecoder, ReportingControlTotalCalculator, ReportingCredentialProvider, ReportingDecodedFileContext, ReportingFormatDecoder, ReportingHttpCredentials, ReportingInspectionErrorCode, ReportingManifestInspectorOptions, ReportingResourceReadRequest, ReportingResourceReadResult, ReportingResourceReadRole, ReportingResourceReader, } from './inspection.mjs';
@@ -0,0 +1,4 @@
1
+ export { ReportingReconciliationError, buildReportingReceipt, evaluateReportingLedger, isReportingCoverageEvidence, loadReportingLedger, reconcileReporting, } from './reconciliation';
2
+ export { ReportingInspectionError, createHttpsReportingResourceReader, createReportingManifestInspector, } from './inspection';
3
+ export type { ExpectedReportingPeriod, ExpectedReportingCoverage, ObligationReconciliation, ReconcileReportingOptions, ReportingCheckpoint, ReportingCheckpointKey, ReportingCheckpointStore, ReportingCanonicalDigestEvidence, ReportingCoverageEvidence, ReportingCoverageLimitation, ReportingInspectionContext, ReportingLedger, ReportingLedgerLimits, ReportingObservation, ReportingReconciliationClient, ReportingReconciliationResult, } from './reconciliation';
4
+ export type { HttpsReportingResourceReaderOptions, ReportingCompressionDecoder, ReportingControlTotalCalculator, ReportingCredentialProvider, ReportingDecodedFileContext, ReportingFormatDecoder, ReportingHttpCredentials, ReportingInspectionErrorCode, ReportingManifestInspectorOptions, ReportingResourceReadRequest, ReportingResourceReadResult, ReportingResourceReadRole, ReportingResourceReader, } from './inspection';
@@ -0,0 +1,45 @@
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 reporting_exports = {};
20
+ __export(reporting_exports, {
21
+ ReportingInspectionError: () => import_inspection.ReportingInspectionError,
22
+ ReportingReconciliationError: () => import_reconciliation.ReportingReconciliationError,
23
+ buildReportingReceipt: () => import_reconciliation.buildReportingReceipt,
24
+ createHttpsReportingResourceReader: () => import_inspection.createHttpsReportingResourceReader,
25
+ createReportingManifestInspector: () => import_inspection.createReportingManifestInspector,
26
+ evaluateReportingLedger: () => import_reconciliation.evaluateReportingLedger,
27
+ isReportingCoverageEvidence: () => import_reconciliation.isReportingCoverageEvidence,
28
+ loadReportingLedger: () => import_reconciliation.loadReportingLedger,
29
+ reconcileReporting: () => import_reconciliation.reconcileReporting
30
+ });
31
+ module.exports = __toCommonJS(reporting_exports);
32
+ var import_reconciliation = require('./reconciliation.js');
33
+ var import_inspection = require('./inspection.js');
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ ReportingInspectionError,
37
+ ReportingReconciliationError,
38
+ buildReportingReceipt,
39
+ createHttpsReportingResourceReader,
40
+ createReportingManifestInspector,
41
+ evaluateReportingLedger,
42
+ isReportingCoverageEvidence,
43
+ loadReportingLedger,
44
+ reconcileReporting
45
+ });
@@ -0,0 +1,24 @@
1
+ import {
2
+ ReportingReconciliationError,
3
+ buildReportingReceipt,
4
+ evaluateReportingLedger,
5
+ isReportingCoverageEvidence,
6
+ loadReportingLedger,
7
+ reconcileReporting
8
+ } from "./reconciliation.mjs";
9
+ import {
10
+ ReportingInspectionError,
11
+ createHttpsReportingResourceReader,
12
+ createReportingManifestInspector
13
+ } from "./inspection.mjs";
14
+ export {
15
+ ReportingInspectionError,
16
+ ReportingReconciliationError,
17
+ buildReportingReceipt,
18
+ createHttpsReportingResourceReader,
19
+ createReportingManifestInspector,
20
+ evaluateReportingLedger,
21
+ isReportingCoverageEvidence,
22
+ loadReportingLedger,
23
+ reconcileReporting
24
+ };
@@ -0,0 +1,88 @@
1
+ import { type CanonicalReferenceResolver } from '../canonical-references/index.mjs';
2
+ import { type SsrfFetchOptions } from '../net/ssrf-fetch.mjs';
3
+ import type { ReportingControlTotal } from '../types/tools.generated.mjs';
4
+ import type { ReportingInspectionContext, ReportingObservation } from './reconciliation.mjs';
5
+ export type ReportingInspectionErrorCode = 'UNSUPPORTED_RESOURCE' | 'RESOURCE_READ_FAILED' | 'RESOURCE_NOT_READY' | 'RESOURCE_TOO_LARGE' | 'INSPECTION_TIMEOUT' | 'MANIFEST_DIGEST_MISMATCH' | 'MANIFEST_INVALID' | 'MANIFEST_INCOMPLETE' | 'MANIFEST_IDENTITY_MISMATCH' | 'MANIFEST_TOTAL_MISMATCH' | 'OBJECT_DUPLICATE' | 'OBJECT_SIZE_MISMATCH' | 'OBJECT_DIGEST_MISMATCH' | 'OBJECT_ROW_COUNT_MISMATCH' | 'FORMAT_UNSUPPORTED' | 'COMPRESSION_UNSUPPORTED' | 'ROW_SCHEMA_FETCH_FAILED' | 'ROW_SCHEMA_INVALID' | 'ROW_SCHEMA_VIOLATION' | 'REPORT_DEFINITION_FETCH_FAILED' | 'REPORT_DEFINITION_INVALID' | 'CANONICALIZATION_FETCH_FAILED' | 'CANONICALIZATION_INVALID' | 'ROW_COUNT_MISMATCH' | 'CONTROL_TOTAL_UNSUPPORTED' | 'CONTROL_TOTAL_MISMATCH' | 'CANONICAL_DIGEST_MISMATCH';
6
+ export declare class ReportingInspectionError extends Error {
7
+ readonly code: ReportingInspectionErrorCode;
8
+ readonly retryable: boolean;
9
+ readonly details?: Record<string, unknown> | undefined;
10
+ readonly observation?: ReportingObservation | undefined;
11
+ constructor(code: ReportingInspectionErrorCode, message: string, retryable?: boolean, details?: Record<string, unknown> | undefined, options?: ErrorOptions, observation?: ReportingObservation | undefined);
12
+ }
13
+ export type ReportingResourceReadRole = 'manifest' | 'object';
14
+ export interface ReportingResourceReadRequest<TCredential = unknown> {
15
+ role: ReportingResourceReadRole;
16
+ location: string;
17
+ objectRef?: string;
18
+ expectedSizeBytes?: number;
19
+ maxBytes: number;
20
+ credential?: TCredential;
21
+ context: ReportingInspectionContext;
22
+ signal?: AbortSignal;
23
+ }
24
+ export interface ReportingResourceReadResult {
25
+ body: Uint8Array;
26
+ contentType?: string;
27
+ }
28
+ export interface ReportingResourceReader<TCredential = unknown> {
29
+ read(request: ReportingResourceReadRequest<TCredential>): Promise<ReportingResourceReadResult>;
30
+ }
31
+ export interface ReportingCredentialProvider<TCredential = unknown> {
32
+ getCredentials(context: ReportingInspectionContext): Promise<TCredential | undefined>;
33
+ }
34
+ export interface ReportingHttpCredentials {
35
+ /** Request headers such as Authorization. Values are never copied into errors or receipts. */
36
+ headers: Readonly<Record<string, string>>;
37
+ /** Exact HTTPS origins authorized to receive these headers. */
38
+ allowedOrigins: readonly string[];
39
+ }
40
+ export interface HttpsReportingResourceReaderOptions extends Pick<SsrfFetchOptions, 'allowPrivateIp' | 'timeoutMs' | 'trustedFetchFn' | 'tls'> {
41
+ maxBodyBytes?: number;
42
+ /** Exact HTTPS origins authorized to receive configured mTLS material. */
43
+ tlsAllowedOrigins?: readonly string[];
44
+ }
45
+ /**
46
+ * Reader for HTTPS manifests and same-origin objects. DNS pinning, private-IP
47
+ * refusal, redirect blocking, deadlines, and body caps come from ssrfSafeFetch.
48
+ */
49
+ export declare function createHttpsReportingResourceReader(options?: HttpsReportingResourceReaderOptions): ReportingResourceReader<ReportingHttpCredentials>;
50
+ type ReportingFileFormat = 'jsonl' | 'csv' | 'parquet' | 'avro' | 'orc';
51
+ type ReportingFileCompression = 'none' | 'gzip' | 'zstd' | 'snappy';
52
+ export interface ReportingDecodedFileContext {
53
+ format: ReportingFileFormat;
54
+ objectRef: string;
55
+ rowSchema: Record<string, unknown>;
56
+ inspection: ReportingInspectionContext;
57
+ /** Maximum rows this object may return without exceeding the inspection budget. */
58
+ maxRows: number;
59
+ }
60
+ export type ReportingFormatDecoder = (body: Uint8Array, context: ReportingDecodedFileContext) => Promise<Record<string, unknown>[]> | Record<string, unknown>[];
61
+ export type ReportingCompressionDecoder = (body: Uint8Array, maxOutputBytes: number) => Promise<Uint8Array> | Uint8Array;
62
+ export type ReportingControlTotalCalculator = (rows: readonly Record<string, unknown>[], expected: readonly ReportingControlTotal[], context: ReportingInspectionContext) => Promise<ReportingControlTotal[]> | ReportingControlTotal[];
63
+ export interface ReportingManifestInspectorOptions<TCredential = unknown> {
64
+ reader: ReportingResourceReader<TCredential>;
65
+ credentialProvider?: ReportingCredentialProvider<TCredential>;
66
+ referenceResolver?: CanonicalReferenceResolver;
67
+ /** Consumer-approved origins for schemas and pinned semantic contracts. */
68
+ referenceAllowedOrigins: readonly string[];
69
+ formatDecoders?: Partial<Record<ReportingFileFormat, ReportingFormatDecoder>>;
70
+ compressionDecoders?: Partial<Record<ReportingFileCompression, ReportingCompressionDecoder>>;
71
+ controlTotalCalculator?: ReportingControlTotalCalculator;
72
+ consumerCommitRef?: string | ((context: ReportingInspectionContext) => string | undefined);
73
+ maxManifestBytes?: number;
74
+ maxObjectBytes?: number;
75
+ maxDecodedObjectBytes?: number;
76
+ maxTotalBytes?: number;
77
+ maxDecodedTotalBytes?: number;
78
+ maxFiles?: number;
79
+ maxRows?: number;
80
+ maxRowBytes?: number;
81
+ /** Hard wall-clock budget for one inspection attempt, including custom adapters. */
82
+ maxInspectionMs?: number;
83
+ /** Maximum wall-clock time permitted for synchronous row-schema compilation. */
84
+ maxSchemaCompileMs?: number;
85
+ }
86
+ /** Build the SDK-managed manifest/file inspector used by reconcileReporting. */
87
+ export declare function createReportingManifestInspector<TCredential = unknown>(options: ReportingManifestInspectorOptions<TCredential>): (context: ReportingInspectionContext) => Promise<ReportingObservation>;
88
+ export {};