@adcp/sdk 14.0.0-beta.27 → 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 (55) 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/index.d.mts +1 -0
  39. package/dist/lib/types/index.d.ts +1 -0
  40. package/dist/lib/types/schemas.generated.js +29 -2
  41. package/dist/lib/types/schemas.generated.mjs +29 -2
  42. package/dist/lib/utils/reporting-status-response.d.mts +2 -0
  43. package/dist/lib/utils/reporting-status-response.d.ts +2 -0
  44. package/dist/lib/utils/reporting-status-response.js +338 -0
  45. package/dist/lib/utils/reporting-status-response.mjs +319 -0
  46. package/dist/lib/utils/response-schemas.js +6 -1
  47. package/dist/lib/utils/response-schemas.mjs +6 -1
  48. package/dist/lib/version.d.mts +3 -3
  49. package/dist/lib/version.d.ts +3 -3
  50. package/dist/lib/version.js +3 -3
  51. package/dist/lib/version.mjs +3 -3
  52. package/docs/TYPE-SUMMARY.md +1 -1
  53. package/docs/guides/REPORTING-RECONCILIATION.md +107 -0
  54. package/docs/llms.txt +1 -1
  55. package/package.json +1 -1
@@ -0,0 +1,338 @@
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_status_response_exports = {};
20
+ __export(reporting_status_response_exports, {
21
+ GetReportingStatusResponseCurrentSchema: () => GetReportingStatusResponseCurrentSchema
22
+ });
23
+ module.exports = __toCommonJS(reporting_status_response_exports);
24
+ var import_zod = require("zod");
25
+ var import_evidence = require('../reporting/evidence.js');
26
+ var import_reconciliation = require('../reporting/reconciliation.js');
27
+ const SHA256_HEX = /^[A-Fa-f0-9]{64}$/;
28
+ function isRecord(value) {
29
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
30
+ }
31
+ function hasFields(value, fields) {
32
+ return fields.every((field) => value[field] !== void 0);
33
+ }
34
+ function isNonEmptyString(value) {
35
+ return typeof value === "string" && value.length > 0;
36
+ }
37
+ function isOffsetDateTime(value) {
38
+ return typeof value === "string" && value.includes("T") && /(?:Z|[+-]\d{2}:\d{2})$/.test(value) && Number.isFinite(Date.parse(value));
39
+ }
40
+ function nonnegativeInteger(value) {
41
+ return Number.isInteger(value) && Number(value) >= 0;
42
+ }
43
+ function stringArray(value) {
44
+ return Array.isArray(value) && value.every(isNonEmptyString);
45
+ }
46
+ function isReportingStatusIssue(value) {
47
+ if (!isRecord(value) || !hasFields(value, ["code", "severity", "responsible_party", "recommended_action"])) {
48
+ return false;
49
+ }
50
+ return [
51
+ "REPORT_OVERDUE",
52
+ "PRODUCTION_FAILED",
53
+ "DELIVERY_FAILED",
54
+ "ACCESS_REQUIRED",
55
+ "CONFIGURATION_REQUIRED",
56
+ "REPORTING_COVERAGE_INCOMPLETE",
57
+ "RESOURCE_EXPIRED",
58
+ "READER_INCOMPATIBLE",
59
+ "HISTORY_UNAVAILABLE"
60
+ ].includes(String(value.code)) && ["delayed", "action_required"].includes(String(value.severity)) && ["buyer", "seller", "provider"].includes(String(value.responsible_party)) && [
61
+ "wait_for_retry",
62
+ "contact_buyer",
63
+ "contact_seller",
64
+ "contact_provider",
65
+ "repair_access",
66
+ "update_configuration",
67
+ "change_reporting_scope",
68
+ "use_supported_reader"
69
+ ].includes(String(value.recommended_action));
70
+ }
71
+ function isReportingSchedule(value) {
72
+ if (!isRecord(value)) return false;
73
+ const required = ["period_duration", "alignment", "delivery_sla"];
74
+ const optional = ["period_anchor", "period_timezone"];
75
+ if (!hasFields(value, required) || !Object.keys(value).every((key) => [...required, ...optional].includes(key)))
76
+ return false;
77
+ const periodDuration = /^P(?=.*[1-9])(?=\d|T)(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/;
78
+ const deliverySla = /^P(?=\d|T)(?=.*\d)(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/;
79
+ if (typeof value.period_duration !== "string" || !periodDuration.test(value.period_duration) || !["utc", "account_timezone", "billing_cycle"].includes(String(value.alignment)) || typeof value.delivery_sla !== "string" || !deliverySla.test(value.delivery_sla))
80
+ return false;
81
+ return value.alignment === "billing_cycle" ? isOffsetDateTime(value.period_anchor) && isNonEmptyString(value.period_timezone) && value.period_timezone.length <= 255 : value.period_anchor === void 0 && value.period_timezone === void 0;
82
+ }
83
+ function isReportingResource(value) {
84
+ if (!isRecord(value)) return false;
85
+ const required = ["resource_ref", "kind", "location", "immutability", "expires_at"];
86
+ const optional = ["native_version_ref", "manifest_version", "manifest_sha256", "reader_compatibility"];
87
+ if (!hasFields(value, required) || !Object.keys(value).every((key) => [...required, ...optional].includes(key)))
88
+ return false;
89
+ if (!isNonEmptyString(value.resource_ref) || value.resource_ref.length > 255 || !["manifest", "dataset", "warehouse_relation"].includes(String(value.kind)) || !isNonEmptyString(value.location) || value.location.length > 2048 || !["immutable_location", "native_version"].includes(String(value.immutability)) || !isOffsetDateTime(value.expires_at) || value.reader_compatibility !== void 0 && (!Array.isArray(value.reader_compatibility) || !value.reader_compatibility.every(isNonEmptyString) || new Set(value.reader_compatibility).size !== value.reader_compatibility.length))
90
+ return false;
91
+ if (value.kind === "manifest" && (value.manifest_version !== "1.0" || typeof value.manifest_sha256 !== "string" || !SHA256_HEX.test(value.manifest_sha256)))
92
+ return false;
93
+ return value.immutability !== "native_version" || isNonEmptyString(value.native_version_ref);
94
+ }
95
+ function isReportingMaterialization(value) {
96
+ const allowed = /* @__PURE__ */ new Set([
97
+ "reporting_materialization_id",
98
+ "reporting_revision_id",
99
+ "reporting_obligation_id",
100
+ "delivery_config_id",
101
+ "delivery_config_version",
102
+ "destination_ref",
103
+ "feed_purpose",
104
+ "method",
105
+ "transport",
106
+ "attempt",
107
+ "status",
108
+ "ready_at",
109
+ "failed_at",
110
+ "failure_code",
111
+ "resource",
112
+ "verification",
113
+ "created_at"
114
+ ]);
115
+ if (!isRecord(value) || Object.keys(value).some((key) => !allowed.has(key)) || !hasFields(value, [
116
+ "reporting_materialization_id",
117
+ "reporting_revision_id",
118
+ "reporting_obligation_id",
119
+ "delivery_config_id",
120
+ "delivery_config_version",
121
+ "destination_ref",
122
+ "feed_purpose",
123
+ "method",
124
+ "attempt",
125
+ "status",
126
+ "created_at"
127
+ ])) {
128
+ return false;
129
+ }
130
+ if (!isNonEmptyString(value.reporting_materialization_id) || !isNonEmptyString(value.reporting_revision_id) || !isNonEmptyString(value.reporting_obligation_id) || !isNonEmptyString(value.delivery_config_id) || !Number.isSafeInteger(value.delivery_config_version) || Number(value.delivery_config_version) < 1 || !isNonEmptyString(value.destination_ref) || !["pacing", "analytics", "billing"].includes(String(value.feed_purpose)) || !["file_transfer", "dataset_share", "warehouse_materialization"].includes(String(value.method)) || value.transport !== void 0 && (typeof value.transport !== "string" || !/^[a-z][a-z0-9_.-]{0,63}$/.test(value.transport)) || !Number.isSafeInteger(value.attempt) || Number(value.attempt) < 1 || !isOffsetDateTime(value.created_at))
131
+ return false;
132
+ if (value.resource !== void 0 && !isReportingResource(value.resource) || value.verification !== void 0 && !(0, import_evidence.isReportingVerificationEvidence)(value.verification) || value.ready_at !== void 0 && !isOffsetDateTime(value.ready_at) || value.failed_at !== void 0 && !isOffsetDateTime(value.failed_at))
133
+ return false;
134
+ if (!["pending", "available", "delivered", "failed"].includes(String(value.status))) return false;
135
+ if (value.status === "failed") return isOffsetDateTime(value.failed_at) && isNonEmptyString(value.failure_code);
136
+ if (value.status === "pending") return true;
137
+ if (!isOffsetDateTime(value.ready_at) || !isReportingResource(value.resource) || !isRecord(value.verification) || !(0, import_evidence.isReportingVerificationEvidence)(value.verification))
138
+ return false;
139
+ const resource = value.resource;
140
+ const verification = value.verification;
141
+ if (resource.immutability === "native_version" && !isNonEmptyString(resource.native_version_ref)) return false;
142
+ if (value.method === "file_transfer") {
143
+ return resource.kind === "manifest" && resource.manifest_version === "1.0" && typeof resource.manifest_sha256 === "string" && SHA256_HEX.test(resource.manifest_sha256) && Array.isArray(verification.physical_checksums) && verification.physical_checksums.length > 0;
144
+ }
145
+ if (value.method === "dataset_share") {
146
+ return resource.kind === "dataset" && verification.verification_path === "representative_consumer";
147
+ }
148
+ if (value.method === "warehouse_materialization") {
149
+ return resource.kind === "warehouse_relation" && verification.verification_path === "destination";
150
+ }
151
+ return false;
152
+ }
153
+ function isReportingReceipt(value) {
154
+ return (0, import_evidence.isReportingReceiptEvidence)(value);
155
+ }
156
+ function isReportingPeriod(value) {
157
+ return isRecord(value) && Object.keys(value).every((key) => ["start", "end", "source_timezone"].includes(key)) && isOffsetDateTime(value.start) && isOffsetDateTime(value.end) && isNonEmptyString(value.source_timezone);
158
+ }
159
+ function isReportingObligation(value) {
160
+ const fields = [
161
+ "reporting_obligation_id",
162
+ "delivery_config_id",
163
+ "delivery_config_version",
164
+ "report_definition_id",
165
+ "feed_purpose",
166
+ "reporting_profile",
167
+ "account_id",
168
+ "scope_resolved_at",
169
+ "media_buy_ids",
170
+ "coverage",
171
+ "period",
172
+ "expected_at",
173
+ "schedule",
174
+ "destination_ref",
175
+ "required_finality",
176
+ "reconciliation_mode",
177
+ "reconciliation_status",
178
+ "health",
179
+ "production_status",
180
+ "revision_count",
181
+ "materialization_count",
182
+ "successful_materialization_count",
183
+ "receipt_count",
184
+ "accepted_receipt_count",
185
+ "issues"
186
+ ];
187
+ if (!isRecord(value) || !hasFields(value, fields)) return false;
188
+ return isNonEmptyString(value.reporting_obligation_id) && isNonEmptyString(value.delivery_config_id) && Number.isInteger(value.delivery_config_version) && Number(value.delivery_config_version) >= 1 && isNonEmptyString(value.report_definition_id) && ["pacing", "analytics", "billing"].includes(String(value.feed_purpose)) && isNonEmptyString(value.reporting_profile) && isNonEmptyString(value.account_id) && isOffsetDateTime(value.scope_resolved_at) && stringArray(value.media_buy_ids) && (0, import_reconciliation.isReportingCoverageEvidence)(value.coverage) && isReportingPeriod(value.period) && isOffsetDateTime(value.expected_at) && isReportingSchedule(value.schedule) && isNonEmptyString(value.destination_ref) && ["snapshot", "official"].includes(String(value.required_finality)) && ["delivery_only", "consumer_receipt"].includes(String(value.reconciliation_mode)) && ["not_required", "pending", "accepted", "rejected"].includes(String(value.reconciliation_status)) && ["waiting", "healthy", "delayed", "action_required", "complete"].includes(String(value.health)) && ["not_due", "pending", "published", "failed"].includes(String(value.production_status)) && [
189
+ "revision_count",
190
+ "materialization_count",
191
+ "successful_materialization_count",
192
+ "receipt_count",
193
+ "accepted_receipt_count"
194
+ ].every((field) => nonnegativeInteger(value[field])) && Array.isArray(value.issues) && value.issues.every(isReportingStatusIssue);
195
+ }
196
+ function isCanonicalDigest(value) {
197
+ return (0, import_evidence.isReportingCanonicalDigest)(value);
198
+ }
199
+ function isReportingRevision(value) {
200
+ const fields = [
201
+ "reporting_revision_id",
202
+ "report_definition_id",
203
+ "report_definition_uri",
204
+ "report_definition_sha256",
205
+ "reporting_profile",
206
+ "schema_version",
207
+ "schema_uri",
208
+ "schema_sha256",
209
+ "schema_dialect",
210
+ "schema_ref_policy",
211
+ "account_id",
212
+ "media_buy_ids",
213
+ "coverage",
214
+ "period",
215
+ "finality",
216
+ "observed_at",
217
+ "data_through",
218
+ "data_through_precision",
219
+ "row_count",
220
+ "control_totals",
221
+ "created_at"
222
+ ];
223
+ if (!isRecord(value) || !hasFields(value, fields)) return false;
224
+ const officialFields = ["finality_basis", "finality_policy_id", "finalized_at"];
225
+ const official = value.finality === "official";
226
+ if (official !== officialFields.every((field) => value[field] !== void 0)) return false;
227
+ if (!official && officialFields.some((field) => value[field] !== void 0)) return false;
228
+ if (official && (!["source_final", "contractual_cutoff", "stabilized"].includes(String(value.finality_basis)) || !isNonEmptyString(value.finality_policy_id) || !isOffsetDateTime(value.finalized_at))) {
229
+ return false;
230
+ }
231
+ const precision = String(value.data_through_precision);
232
+ if (!["exact", "lower_bound", "unknown"].includes(precision) || (precision === "unknown" ? value.data_through !== null : !isOffsetDateTime(value.data_through))) {
233
+ return false;
234
+ }
235
+ return isNonEmptyString(value.reporting_revision_id) && isNonEmptyString(value.report_definition_id) && isNonEmptyString(value.report_definition_uri) && typeof value.report_definition_sha256 === "string" && SHA256_HEX.test(value.report_definition_sha256) && isNonEmptyString(value.reporting_profile) && isNonEmptyString(value.schema_version) && isNonEmptyString(value.schema_uri) && typeof value.schema_sha256 === "string" && SHA256_HEX.test(value.schema_sha256) && value.schema_dialect === "https://json-schema.org/draft/2020-12/schema" && value.schema_ref_policy === "local_fragment_only" && isNonEmptyString(value.account_id) && stringArray(value.media_buy_ids) && (0, import_reconciliation.isReportingCoverageEvidence)(value.coverage) && isReportingPeriod(value.period) && ["snapshot", "official"].includes(String(value.finality)) && isOffsetDateTime(value.observed_at) && nonnegativeInteger(value.row_count) && (0, import_evidence.isReportingControlTotals)(value.control_totals) && isOffsetDateTime(value.created_at) && (value.canonical_content_digest === void 0 || isCanonicalDigest(value.canonical_content_digest));
236
+ }
237
+ const scopeKeys = [
238
+ "period_start",
239
+ "period_end",
240
+ "scope_closed",
241
+ "media_buy_ids",
242
+ "all_accessible_media_buys",
243
+ "delivery_config_generations",
244
+ "feed_purposes",
245
+ "finality",
246
+ "ledger_retained_from",
247
+ "coverage_complete"
248
+ ];
249
+ function isReportingScope(value) {
250
+ if (!isRecord(value) || !Object.keys(value).every((key) => scopeKeys.includes(key)) || !hasFields(
251
+ value,
252
+ scopeKeys.filter((key) => key !== "media_buy_ids")
253
+ )) {
254
+ return false;
255
+ }
256
+ const generations = value.delivery_config_generations;
257
+ return isOffsetDateTime(value.period_start) && isOffsetDateTime(value.period_end) && typeof value.scope_closed === "boolean" && typeof value.all_accessible_media_buys === "boolean" && (value.all_accessible_media_buys || stringArray(value.media_buy_ids)) && Array.isArray(generations) && generations.every(
258
+ (generation) => isRecord(generation) && Object.keys(generation).every(
259
+ (key) => ["delivery_config_id", "delivery_config_version", "feed_purpose"].includes(key)
260
+ ) && isNonEmptyString(generation.delivery_config_id) && Number.isInteger(generation.delivery_config_version) && Number(generation.delivery_config_version) >= 1 && ["pacing", "analytics", "billing"].includes(String(generation.feed_purpose))
261
+ ) && Array.isArray(value.feed_purposes) && value.feed_purposes.every((item) => ["pacing", "analytics", "billing"].includes(String(item))) && Array.isArray(value.finality) && value.finality.every((item) => ["snapshot", "official"].includes(String(item))) && isOffsetDateTime(value.ledger_retained_from) && typeof value.coverage_complete === "boolean";
262
+ }
263
+ function isPagination(value) {
264
+ return isRecord(value) && typeof value.has_more === "boolean" && nonnegativeInteger(value.total_count);
265
+ }
266
+ function lacksFields(value, fields) {
267
+ return fields.every((field) => value[field] === void 0);
268
+ }
269
+ function hasCompletedCommon(value) {
270
+ return value.status === "completed" && isNonEmptyString(value.ledger_snapshot_id) && isOffsetDateTime(value.ledger_as_of) && isNonEmptyString(value.account_id);
271
+ }
272
+ function isSummaryResponse(value) {
273
+ if (!isRecord(value.obligation_counts)) return false;
274
+ const obligationCounts = value.obligation_counts;
275
+ if (!hasCompletedCommon(value) || value.view !== "summary" || !isReportingScope(value.scope) || !(0, import_reconciliation.isReportingCoverageEvidence)(value.coverage) || !(value.data_through === null || isOffsetDateTime(value.data_through)) || !lacksFields(value, ["periods", "revisions", "pagination", "revision", "materializations", "receipts"]) || !["healthy", "waiting", "delayed", "action_required", "complete"].includes(String(value.health)) || !Array.isArray(value.issues) || !value.issues.every(isReportingStatusIssue) || !["total", "waiting", "healthy", "delayed", "action_required", "complete"].every(
276
+ (field) => nonnegativeInteger(obligationCounts[field])
277
+ )) {
278
+ return false;
279
+ }
280
+ const health = String(value.health);
281
+ if (health === "complete" && (!value.scope.scope_closed || !value.scope.coverage_complete || value.next_expected_at !== void 0)) {
282
+ return false;
283
+ }
284
+ if (["healthy", "waiting", "complete"].includes(health) && value.issues.length !== 0) return false;
285
+ if (health === "action_required" && !value.issues.some((issue) => isRecord(issue) && issue.severity === "action_required")) {
286
+ return false;
287
+ }
288
+ if (health === "delayed" && (value.issues.length === 0 || value.issues.some((issue) => !isRecord(issue) || issue.severity !== "delayed"))) {
289
+ return false;
290
+ }
291
+ if (!value.scope.coverage_complete && (health !== "action_required" || !value.issues.some(
292
+ (issue) => isRecord(issue) && issue.code === "HISTORY_UNAVAILABLE" && issue.severity === "action_required"
293
+ ))) {
294
+ return false;
295
+ }
296
+ return true;
297
+ }
298
+ function isGetReportingStatusResponse(value) {
299
+ if (!isRecord(value)) return false;
300
+ if (value.status === "failed") {
301
+ const allowed = /* @__PURE__ */ new Set([
302
+ "adcp_version",
303
+ "adcp_major_version",
304
+ "status",
305
+ "view",
306
+ "failure_kind",
307
+ "context_id",
308
+ "context",
309
+ "message",
310
+ "timestamp",
311
+ "replayed",
312
+ "adcp_error",
313
+ "errors"
314
+ ]);
315
+ if (Object.keys(value).some((key) => !allowed.has(key)) || !["summary", "periods", "revision"].includes(String(value.view)) || !["lookup_unavailable", "operational"].includes(String(value.failure_kind)) || !Array.isArray(value.errors) || value.errors.length === 0 || !value.errors.every((error) => isRecord(error) && isNonEmptyString(error.code) && isNonEmptyString(error.message)))
316
+ return false;
317
+ if (value.failure_kind === "lookup_unavailable") {
318
+ return value.errors.length === 1 && Object.keys(value.errors[0]).every((key) => ["code", "message"].includes(key)) && value.errors[0].code === "NOT_FOUND" && value.errors[0].message === "Reporting status resource is unavailable." && (value.message === void 0 || value.message === "Reporting status resource is unavailable.") && (value.adcp_error === void 0 || isRecord(value.adcp_error) && Object.keys(value.adcp_error).every((key) => ["code", "message"].includes(key)) && value.adcp_error.code === "NOT_FOUND" && value.adcp_error.message === "Reporting status resource is unavailable.");
319
+ }
320
+ return true;
321
+ }
322
+ if (value.status !== "completed") return false;
323
+ if (value.view === "summary") return isSummaryResponse(value);
324
+ if (value.view === "periods") {
325
+ return hasCompletedCommon(value) && isReportingScope(value.scope) && Array.isArray(value.periods) && value.periods.every(isReportingObligation) && Array.isArray(value.revisions) && value.revisions.every(isReportingRevision) && Array.isArray(value.materializations) && value.materializations.every(isReportingMaterialization) && Array.isArray(value.receipts) && value.receipts.every(isReportingReceipt) && isPagination(value.pagination) && lacksFields(value, ["revision"]);
326
+ }
327
+ if (value.view === "revision") {
328
+ return hasCompletedCommon(value) && isReportingRevision(value.revision) && Array.isArray(value.materializations) && value.materializations.every(isReportingMaterialization) && Array.isArray(value.receipts) && value.receipts.every(isReportingReceipt) && isPagination(value.pagination) && lacksFields(value, ["scope", "health", "periods", "revisions"]);
329
+ }
330
+ return false;
331
+ }
332
+ const GetReportingStatusResponseCurrentSchema = import_zod.z.custom(isGetReportingStatusResponse, {
333
+ message: "get_reporting_status response does not satisfy the current reporting protocol"
334
+ });
335
+ // Annotate the CommonJS export names for ESM import in node:
336
+ 0 && (module.exports = {
337
+ GetReportingStatusResponseCurrentSchema
338
+ });