@adcp/sdk 14.2.0 → 14.4.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.
- package/bin/adcp.js +2 -4
- package/dist/lib/auth/oauth/MCPOAuthProvider.d.mts +6 -2
- package/dist/lib/auth/oauth/MCPOAuthProvider.d.ts +6 -2
- package/dist/lib/auth/oauth/MCPOAuthProvider.js +63 -3
- package/dist/lib/auth/oauth/MCPOAuthProvider.mjs +75 -3
- package/dist/lib/auth/oauth/diagnose.js +14 -0
- package/dist/lib/auth/oauth/diagnose.mjs +14 -0
- package/dist/lib/auth/oauth/file-storage.d.mts +4 -2
- package/dist/lib/auth/oauth/file-storage.d.ts +4 -2
- package/dist/lib/auth/oauth/file-storage.js +7 -1
- package/dist/lib/auth/oauth/file-storage.mjs +7 -1
- package/dist/lib/auth/oauth/types.d.mts +10 -0
- package/dist/lib/auth/oauth/types.d.ts +10 -0
- package/dist/lib/auth/oauth/types.js +39 -0
- package/dist/lib/auth/oauth/types.mjs +37 -0
- package/dist/lib/auth/oauth/web-flow.js +11 -1
- package/dist/lib/auth/oauth/web-flow.mjs +20 -2
- package/dist/lib/protocols/mcp.js +2 -0
- package/dist/lib/protocols/mcp.mjs +2 -0
- package/dist/lib/reporting/inspection.d.mts +3 -3
- package/dist/lib/reporting/inspection.d.ts +3 -3
- package/dist/lib/reporting/inspection.js +229 -84
- package/dist/lib/reporting/inspection.mjs +229 -84
- package/dist/lib/reporting/ledger/status-ingest.js +3 -19
- package/dist/lib/reporting/ledger/status-ingest.mjs +2 -18
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/create-adcp-server.js +5 -2
- package/dist/lib/server/create-adcp-server.mjs +5 -2
- package/dist/lib/signing/canonicalize.d.mts +2 -0
- package/dist/lib/signing/canonicalize.d.ts +2 -0
- package/dist/lib/signing/canonicalize.js +1 -1
- package/dist/lib/signing/canonicalize.mjs +1 -1
- package/dist/lib/signing/verifier.js +1 -1
- package/dist/lib/signing/verifier.mjs +1 -1
- package/dist/lib/testing/storyboard/request-signing/builder.js +13 -1
- package/dist/lib/testing/storyboard/request-signing/builder.mjs +13 -1
- package/dist/lib/testing/storyboard/request-signing/grader.js +1 -0
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +1 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +1 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +1 -1
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/types/adcp.d.mts +6 -0
- package/dist/lib/types/adcp.d.ts +6 -0
- package/dist/lib/utils/pointer-utils.d.mts +2 -0
- package/dist/lib/utils/pointer-utils.d.ts +2 -0
- package/dist/lib/utils/pointer-utils.js +43 -0
- package/dist/lib/utils/pointer-utils.mjs +19 -0
- package/dist/lib/validation/diagnostic-limits.d.mts +4 -0
- package/dist/lib/validation/diagnostic-limits.d.ts +4 -0
- package/dist/lib/validation/diagnostic-limits.js +57 -0
- package/dist/lib/validation/diagnostic-limits.mjs +32 -0
- package/dist/lib/validation/schema-errors.d.mts +3 -1
- package/dist/lib/validation/schema-errors.d.ts +3 -1
- package/dist/lib/validation/schema-errors.js +18 -3
- package/dist/lib/validation/schema-errors.mjs +18 -3
- package/dist/lib/validation/schema-validator.js +56 -4
- package/dist/lib/validation/schema-validator.mjs +56 -4
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +5 -5
- package/docs/migration-oauth-issuer-bindings.md +82 -0
- package/package.json +6 -6
- package/skills/call-adcp-agent/SKILL.md +4 -1
|
@@ -30,6 +30,7 @@ class OAuthTimeoutError extends OAuthError {
|
|
|
30
30
|
}
|
|
31
31
|
function toMCPTokens(tokens) {
|
|
32
32
|
return {
|
|
33
|
+
...tokens.issuer !== void 0 && tokens.issuer !== null && { issuer: tokens.issuer },
|
|
33
34
|
access_token: tokens.access_token,
|
|
34
35
|
refresh_token: tokens.refresh_token,
|
|
35
36
|
token_type: tokens.token_type || "Bearer",
|
|
@@ -39,6 +40,7 @@ function toMCPTokens(tokens) {
|
|
|
39
40
|
}
|
|
40
41
|
function fromMCPTokens(tokens) {
|
|
41
42
|
const result = {
|
|
43
|
+
...tokens.issuer !== void 0 && tokens.issuer !== null && { issuer: tokens.issuer },
|
|
42
44
|
access_token: tokens.access_token,
|
|
43
45
|
token_type: tokens.token_type,
|
|
44
46
|
scope: tokens.scope
|
|
@@ -54,6 +56,7 @@ function fromMCPTokens(tokens) {
|
|
|
54
56
|
}
|
|
55
57
|
function toMCPClientInfo(client) {
|
|
56
58
|
return {
|
|
59
|
+
...client.issuer !== void 0 && client.issuer !== null && { issuer: client.issuer },
|
|
57
60
|
client_id: client.client_id,
|
|
58
61
|
client_secret: client.client_secret,
|
|
59
62
|
client_secret_expires_at: client.client_secret_expires_at
|
|
@@ -61,16 +64,50 @@ function toMCPClientInfo(client) {
|
|
|
61
64
|
}
|
|
62
65
|
function fromMCPClientInfo(info) {
|
|
63
66
|
return {
|
|
67
|
+
...info.issuer !== void 0 && info.issuer !== null && { issuer: info.issuer },
|
|
64
68
|
client_id: info.client_id,
|
|
65
69
|
client_secret: info.client_secret,
|
|
66
70
|
client_secret_expires_at: info.client_secret_expires_at
|
|
67
71
|
};
|
|
68
72
|
}
|
|
73
|
+
function isOAuthIssuer(value) {
|
|
74
|
+
if (typeof value !== "string" || value.length === 0) return false;
|
|
75
|
+
try {
|
|
76
|
+
const url = new URL(value);
|
|
77
|
+
return (url.protocol === "https:" || url.protocol === "http:") && !url.username && !url.password && !url.search && !url.hash;
|
|
78
|
+
} catch {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function assertOAuthCredentialIssuer(credential, expectedIssuer, requireIssuer = false) {
|
|
83
|
+
const issuer = credential.issuer;
|
|
84
|
+
if ((issuer === void 0 || issuer === null) && !requireIssuer) return;
|
|
85
|
+
if (!isOAuthIssuer(issuer)) {
|
|
86
|
+
throw new OAuthError(
|
|
87
|
+
"Saved OAuth credentials need a valid issuer. Clear them and sign in again, or set their issuer from trusted configuration.",
|
|
88
|
+
"oauth_issuer_required"
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
if (expectedIssuer !== void 0 && issuer !== expectedIssuer && !(issuer.endsWith("/") && issuer.slice(0, -1) === expectedIssuer) && !(expectedIssuer.endsWith("/") && expectedIssuer.slice(0, -1) === issuer)) {
|
|
92
|
+
throw new OAuthError("OAuth credentials belong to a different authorization server.", "oauth_issuer_mismatch");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function assertOAuthServerIssuer(metadata, authorizationServerUrl) {
|
|
96
|
+
const issuer = metadata?.issuer;
|
|
97
|
+
if (!isOAuthIssuer(issuer) || issuer !== authorizationServerUrl && !(authorizationServerUrl.endsWith("/") && issuer === authorizationServerUrl.slice(0, -1))) {
|
|
98
|
+
throw new OAuthError(
|
|
99
|
+
"Authorization-server metadata does not match the discovered issuer.",
|
|
100
|
+
"oauth_issuer_mismatch"
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
69
104
|
export {
|
|
70
105
|
DEFAULT_CLIENT_METADATA,
|
|
71
106
|
OAuthCancelledError,
|
|
72
107
|
OAuthError,
|
|
73
108
|
OAuthTimeoutError,
|
|
109
|
+
assertOAuthCredentialIssuer,
|
|
110
|
+
assertOAuthServerIssuer,
|
|
74
111
|
fromMCPClientInfo,
|
|
75
112
|
fromMCPTokens,
|
|
76
113
|
toMCPClientInfo,
|
|
@@ -144,6 +144,7 @@ async function startWebOAuthFlow(opts) {
|
|
|
144
144
|
if (!asMetadata) {
|
|
145
145
|
throw new import_types.OAuthError(`No OAuth metadata at ${asUrl.toString()}`, "no_authorization_server_metadata", agent.id);
|
|
146
146
|
}
|
|
147
|
+
(0, import_types.assertOAuthServerIssuer)(asMetadata, asUrl.toString());
|
|
147
148
|
const resource = resourceOverride ? new URL(resourceOverride) : prm?.resource ? new URL(prm.resource) : (0, import_auth_utils.resourceUrlFromServerUrl)(new URL(agent.agent_uri));
|
|
148
149
|
const baseClientMetadata = {
|
|
149
150
|
...import_types.DEFAULT_CLIENT_METADATA,
|
|
@@ -230,6 +231,12 @@ async function completeWebOAuthFlow(opts) {
|
|
|
230
231
|
const asMetadata = await (0, import_auth.discoverAuthorizationServerMetadata)(flow.authorizationServerUrl, {
|
|
231
232
|
fetchFn: guardedFetch
|
|
232
233
|
});
|
|
234
|
+
(0, import_types.assertOAuthServerIssuer)(asMetadata, flow.authorizationServerUrl);
|
|
235
|
+
(0, import_types.assertOAuthCredentialIssuer)(
|
|
236
|
+
flow.clientInformation,
|
|
237
|
+
flow.authorizationServerUrl,
|
|
238
|
+
!!flow.clientInformation.client_secret
|
|
239
|
+
);
|
|
233
240
|
let tokens;
|
|
234
241
|
try {
|
|
235
242
|
tokens = await (0, import_auth.exchangeAuthorization)(flow.authorizationServerUrl, {
|
|
@@ -241,6 +248,7 @@ async function completeWebOAuthFlow(opts) {
|
|
|
241
248
|
resource: flow.resource ? new URL(flow.resource) : void 0,
|
|
242
249
|
fetchFn: guardedFetch
|
|
243
250
|
});
|
|
251
|
+
tokens = { ...tokens, issuer: flow.authorizationServerUrl };
|
|
244
252
|
} catch (err) {
|
|
245
253
|
throw wrapTokenExchangeError(err);
|
|
246
254
|
}
|
|
@@ -410,6 +418,7 @@ function createSsrfSafeOAuthFetch(trustedFetchFn, allowHttp) {
|
|
|
410
418
|
async function resolveClientInformation(args) {
|
|
411
419
|
const { agent, agentStorage, asUrl, asMetadata, clientMetadata, fetchFn, allowConfidentialClient } = args;
|
|
412
420
|
if (agent.oauth_client) {
|
|
421
|
+
(0, import_types.assertOAuthCredentialIssuer)(agent.oauth_client, asUrl.toString(), !!agent.oauth_client.client_secret);
|
|
413
422
|
return (0, import_types.toMCPClientInfo)(agent.oauth_client);
|
|
414
423
|
}
|
|
415
424
|
if (!asMetadata.registration_endpoint) {
|
|
@@ -419,11 +428,12 @@ async function resolveClientInformation(args) {
|
|
|
419
428
|
agent.id
|
|
420
429
|
);
|
|
421
430
|
}
|
|
422
|
-
const
|
|
431
|
+
const registration = await (0, import_auth.registerClient)(asUrl.toString(), {
|
|
423
432
|
metadata: asMetadata,
|
|
424
433
|
clientMetadata,
|
|
425
434
|
fetchFn
|
|
426
435
|
});
|
|
436
|
+
const registered = { ...registration, issuer: asUrl.toString() };
|
|
427
437
|
if (registered.client_secret && !allowConfidentialClient) {
|
|
428
438
|
throw new ConfidentialClientNotAllowedError(agent.id);
|
|
429
439
|
}
|
|
@@ -7,7 +7,15 @@ import {
|
|
|
7
7
|
startAuthorization
|
|
8
8
|
} from "@modelcontextprotocol/sdk/client/auth.js";
|
|
9
9
|
import { checkResourceAllowed, resourceUrlFromServerUrl } from "@modelcontextprotocol/sdk/shared/auth-utils.js";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
DEFAULT_CLIENT_METADATA,
|
|
12
|
+
fromMCPClientInfo,
|
|
13
|
+
fromMCPTokens,
|
|
14
|
+
OAuthError,
|
|
15
|
+
toMCPClientInfo,
|
|
16
|
+
assertOAuthCredentialIssuer,
|
|
17
|
+
assertOAuthServerIssuer
|
|
18
|
+
} from "./types.mjs";
|
|
11
19
|
import { validateOAuthResourceUrl } from "./resource-url.mjs";
|
|
12
20
|
import { ssrfSafeFetch } from "../../net/ssrf-fetch.mjs";
|
|
13
21
|
const DEFAULT_WEB_FLOW_TTL_MS = 10 * 60 * 1e3;
|
|
@@ -115,6 +123,7 @@ async function startWebOAuthFlow(opts) {
|
|
|
115
123
|
if (!asMetadata) {
|
|
116
124
|
throw new OAuthError(`No OAuth metadata at ${asUrl.toString()}`, "no_authorization_server_metadata", agent.id);
|
|
117
125
|
}
|
|
126
|
+
assertOAuthServerIssuer(asMetadata, asUrl.toString());
|
|
118
127
|
const resource = resourceOverride ? new URL(resourceOverride) : prm?.resource ? new URL(prm.resource) : resourceUrlFromServerUrl(new URL(agent.agent_uri));
|
|
119
128
|
const baseClientMetadata = {
|
|
120
129
|
...DEFAULT_CLIENT_METADATA,
|
|
@@ -201,6 +210,12 @@ async function completeWebOAuthFlow(opts) {
|
|
|
201
210
|
const asMetadata = await discoverAuthorizationServerMetadata(flow.authorizationServerUrl, {
|
|
202
211
|
fetchFn: guardedFetch
|
|
203
212
|
});
|
|
213
|
+
assertOAuthServerIssuer(asMetadata, flow.authorizationServerUrl);
|
|
214
|
+
assertOAuthCredentialIssuer(
|
|
215
|
+
flow.clientInformation,
|
|
216
|
+
flow.authorizationServerUrl,
|
|
217
|
+
!!flow.clientInformation.client_secret
|
|
218
|
+
);
|
|
204
219
|
let tokens;
|
|
205
220
|
try {
|
|
206
221
|
tokens = await exchangeAuthorization(flow.authorizationServerUrl, {
|
|
@@ -212,6 +227,7 @@ async function completeWebOAuthFlow(opts) {
|
|
|
212
227
|
resource: flow.resource ? new URL(flow.resource) : void 0,
|
|
213
228
|
fetchFn: guardedFetch
|
|
214
229
|
});
|
|
230
|
+
tokens = { ...tokens, issuer: flow.authorizationServerUrl };
|
|
215
231
|
} catch (err) {
|
|
216
232
|
throw wrapTokenExchangeError(err);
|
|
217
233
|
}
|
|
@@ -381,6 +397,7 @@ function createSsrfSafeOAuthFetch(trustedFetchFn, allowHttp) {
|
|
|
381
397
|
async function resolveClientInformation(args) {
|
|
382
398
|
const { agent, agentStorage, asUrl, asMetadata, clientMetadata, fetchFn, allowConfidentialClient } = args;
|
|
383
399
|
if (agent.oauth_client) {
|
|
400
|
+
assertOAuthCredentialIssuer(agent.oauth_client, asUrl.toString(), !!agent.oauth_client.client_secret);
|
|
384
401
|
return toMCPClientInfo(agent.oauth_client);
|
|
385
402
|
}
|
|
386
403
|
if (!asMetadata.registration_endpoint) {
|
|
@@ -390,11 +407,12 @@ async function resolveClientInformation(args) {
|
|
|
390
407
|
agent.id
|
|
391
408
|
);
|
|
392
409
|
}
|
|
393
|
-
const
|
|
410
|
+
const registration = await registerClient(asUrl.toString(), {
|
|
394
411
|
metadata: asMetadata,
|
|
395
412
|
clientMetadata,
|
|
396
413
|
fetchFn
|
|
397
414
|
});
|
|
415
|
+
const registered = { ...registration, issuer: asUrl.toString() };
|
|
398
416
|
if (registered.client_secret && !allowConfidentialClient) {
|
|
399
417
|
throw new ConfidentialClientNotAllowedError(agent.id);
|
|
400
418
|
}
|
|
@@ -34,6 +34,7 @@ var import_streamableHttp = require("@modelcontextprotocol/sdk/client/streamable
|
|
|
34
34
|
var import_sse = require("@modelcontextprotocol/sdk/client/sse.js");
|
|
35
35
|
var import_auth = require("@modelcontextprotocol/sdk/client/auth.js");
|
|
36
36
|
var import_node_crypto = require("node:crypto");
|
|
37
|
+
var import_MCPOAuthProvider = require('../auth/oauth/MCPOAuthProvider.js');
|
|
37
38
|
var import_auth2 = require('../auth/index.js');
|
|
38
39
|
var import_errors = require('../errors/index.js');
|
|
39
40
|
var import_tracing = require('../observability/tracing.js');
|
|
@@ -713,6 +714,7 @@ async function connectMCP(options) {
|
|
|
713
714
|
fetchFn,
|
|
714
715
|
allowPrivateIp
|
|
715
716
|
} = options;
|
|
717
|
+
if (authProvider) (0, import_MCPOAuthProvider.assertLegacyOAuthSdk)();
|
|
716
718
|
const baseUrl = new URL(agentUrl);
|
|
717
719
|
debugLogs.push({
|
|
718
720
|
type: "info",
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
12
12
|
import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
13
13
|
import { hkdfSync, randomBytes } from "node:crypto";
|
|
14
|
+
import { assertLegacyOAuthSdk } from "../auth/oauth/MCPOAuthProvider.mjs";
|
|
14
15
|
import { createMCPRequestHeaders } from "../auth/index.mjs";
|
|
15
16
|
import { is401Error } from "../errors/index.mjs";
|
|
16
17
|
import { withSpan, injectTraceHeaders } from "../observability/tracing.mjs";
|
|
@@ -700,6 +701,7 @@ async function connectMCP(options) {
|
|
|
700
701
|
fetchFn,
|
|
701
702
|
allowPrivateIp
|
|
702
703
|
} = options;
|
|
704
|
+
if (authProvider) assertLegacyOAuthSdk();
|
|
703
705
|
const baseUrl = new URL(agentUrl);
|
|
704
706
|
debugLogs.push({
|
|
705
707
|
type: "info",
|
|
@@ -2,7 +2,7 @@ import { type CanonicalReferenceResolver } from '../canonical-references/index.m
|
|
|
2
2
|
import { type SsrfFetchOptions } from '../net/ssrf-fetch.mjs';
|
|
3
3
|
import type { ReportingControlTotal } from '../types/tools.generated.mjs';
|
|
4
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';
|
|
5
|
+
export type ReportingInspectionErrorCode = 'CONSUMER_COMMIT_FAILED' | '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
6
|
export declare class ReportingInspectionError extends Error {
|
|
7
7
|
readonly code: ReportingInspectionErrorCode;
|
|
8
8
|
readonly retryable: boolean;
|
|
@@ -78,9 +78,9 @@ export interface ReportingManifestInspectorOptions<TCredential = unknown> {
|
|
|
78
78
|
maxFiles?: number;
|
|
79
79
|
maxRows?: number;
|
|
80
80
|
maxRowBytes?: number;
|
|
81
|
-
/**
|
|
81
|
+
/** Aggregate deadline for async work, checked cooperatively during synchronous work. Synchronous callbacks cannot be preempted. */
|
|
82
82
|
maxInspectionMs?: number;
|
|
83
|
-
/**
|
|
83
|
+
/** Reject synchronous schema compilation overruns after compilation returns. */
|
|
84
84
|
maxSchemaCompileMs?: number;
|
|
85
85
|
}
|
|
86
86
|
/** Build the SDK-managed manifest/file inspector used by reconcileReporting. */
|
|
@@ -2,7 +2,7 @@ import { type CanonicalReferenceResolver } from '../canonical-references';
|
|
|
2
2
|
import { type SsrfFetchOptions } from '../net/ssrf-fetch';
|
|
3
3
|
import type { ReportingControlTotal } from '../types/tools.generated';
|
|
4
4
|
import type { ReportingInspectionContext, ReportingObservation } from './reconciliation';
|
|
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';
|
|
5
|
+
export type ReportingInspectionErrorCode = 'CONSUMER_COMMIT_FAILED' | '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
6
|
export declare class ReportingInspectionError extends Error {
|
|
7
7
|
readonly code: ReportingInspectionErrorCode;
|
|
8
8
|
readonly retryable: boolean;
|
|
@@ -78,9 +78,9 @@ export interface ReportingManifestInspectorOptions<TCredential = unknown> {
|
|
|
78
78
|
maxFiles?: number;
|
|
79
79
|
maxRows?: number;
|
|
80
80
|
maxRowBytes?: number;
|
|
81
|
-
/**
|
|
81
|
+
/** Aggregate deadline for async work, checked cooperatively during synchronous work. Synchronous callbacks cannot be preempted. */
|
|
82
82
|
maxInspectionMs?: number;
|
|
83
|
-
/**
|
|
83
|
+
/** Reject synchronous schema compilation overruns after compilation returns. */
|
|
84
84
|
maxSchemaCompileMs?: number;
|
|
85
85
|
}
|
|
86
86
|
/** Build the SDK-managed manifest/file inspector used by reconcileReporting. */
|