@debugbundle/cli 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs +157 -40
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -64642,7 +64642,9 @@ var CaptureRuleEvaluationContextSchema = external_exports.object({
|
|
|
64642
64642
|
resource_url: CaptureRuleEvaluationUrlSchema.optional(),
|
|
64643
64643
|
request_url: CaptureRuleEvaluationUrlSchema.optional(),
|
|
64644
64644
|
status_code: external_exports.number().int().min(0).max(599).optional(),
|
|
64645
|
-
fingerprint: CaptureRuleFingerprintSchema.optional()
|
|
64645
|
+
fingerprint: CaptureRuleFingerprintSchema.optional(),
|
|
64646
|
+
// Server-derived prior versions keep installed exact-match rules effective.
|
|
64647
|
+
fingerprint_aliases: external_exports.array(CaptureRuleFingerprintSchema).max(2).optional()
|
|
64646
64648
|
});
|
|
64647
64649
|
function classifyCaptureRuleClientFromUserAgent(userAgent) {
|
|
64648
64650
|
if (userAgent === null || userAgent === void 0) {
|
|
@@ -84716,8 +84718,15 @@ function normalizeInstalledJavaEvent(candidate) {
|
|
|
84716
84718
|
};
|
|
84717
84719
|
}
|
|
84718
84720
|
|
|
84721
|
+
// ../../packages/event-normalizer/src/java-timer-message.ts
|
|
84722
|
+
var TIMER_DIAGNOSTIC = /^WFLYEJB002(?:0|2):[^\n]*\[id=[^\]\n]*\btimedObjectId=/;
|
|
84723
|
+
var JAVA_TIMER_DATE = /\b(previousRun|initialExpiration|nextExpiration)=((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s+(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+[A-Za-z][A-Za-z0-9:+-]{0,15}\s+\d{4})\b/g;
|
|
84724
|
+
function normalizeJavaTimerMessage(message3) {
|
|
84725
|
+
return TIMER_DIAGNOSTIC.test(message3) ? message3.replace(JAVA_TIMER_DATE, "$1={dynamic}") : message3;
|
|
84726
|
+
}
|
|
84727
|
+
|
|
84719
84728
|
// ../../packages/event-normalizer/src/index.ts
|
|
84720
|
-
var FINGERPRINT_VERSION = "
|
|
84729
|
+
var FINGERPRINT_VERSION = "v2";
|
|
84721
84730
|
var PAYLOAD_ALLOWED_KEYS = {
|
|
84722
84731
|
backend_exception: /* @__PURE__ */ new Set([
|
|
84723
84732
|
"name",
|
|
@@ -85051,12 +85060,12 @@ function normalizeKnownDatabaseMessage(message3) {
|
|
|
85051
85060
|
}
|
|
85052
85061
|
return null;
|
|
85053
85062
|
}
|
|
85054
|
-
function normalizeMessage(message3) {
|
|
85063
|
+
function normalizeMessage(message3, version2) {
|
|
85055
85064
|
const knownDatabaseMessage = normalizeKnownDatabaseMessage(message3);
|
|
85056
85065
|
if (knownDatabaseMessage !== null) {
|
|
85057
85066
|
return knownDatabaseMessage;
|
|
85058
85067
|
}
|
|
85059
|
-
return collapseWhitespace(normalizeScalarTokens(message3));
|
|
85068
|
+
return collapseWhitespace(normalizeScalarTokens(version2 === "v1" ? message3 : normalizeJavaTimerMessage(message3)));
|
|
85060
85069
|
}
|
|
85061
85070
|
function normalizeRoute(path) {
|
|
85062
85071
|
if (path === null || path.length === 0) {
|
|
@@ -85146,14 +85155,14 @@ function stableJson(value) {
|
|
|
85146
85155
|
function validateEvent(candidate) {
|
|
85147
85156
|
return EventEnvelopeSchema.safeParse(normalizeCompatibleEventCandidate(candidate));
|
|
85148
85157
|
}
|
|
85149
|
-
function normalizeEvent(event) {
|
|
85158
|
+
function normalizeEvent(event, version2 = FINGERPRINT_VERSION) {
|
|
85150
85159
|
const redactedPayload = redact(event.payload).redacted;
|
|
85151
85160
|
if (event.event_type === "backend_exception") {
|
|
85152
85161
|
return {
|
|
85153
85162
|
event_type: event.event_type,
|
|
85154
85163
|
environment: event.service.environment,
|
|
85155
85164
|
error_type: event.payload.name,
|
|
85156
|
-
normalized_message: normalizeMessage(event.payload.message),
|
|
85165
|
+
normalized_message: normalizeMessage(event.payload.message, version2),
|
|
85157
85166
|
route_template: normalizeRoute(event.payload.request.path),
|
|
85158
85167
|
http_method: event.payload.request.method,
|
|
85159
85168
|
http_status: event.payload.response.status_code,
|
|
@@ -85185,7 +85194,7 @@ function normalizeEvent(event) {
|
|
|
85185
85194
|
event_type: event.event_type,
|
|
85186
85195
|
environment: event.service.environment,
|
|
85187
85196
|
error_type: null,
|
|
85188
|
-
normalized_message: normalizeMessage(event.payload.message),
|
|
85197
|
+
normalized_message: normalizeMessage(event.payload.message, version2),
|
|
85189
85198
|
route_template: null,
|
|
85190
85199
|
http_method: null,
|
|
85191
85200
|
http_status: null,
|
|
@@ -85204,7 +85213,7 @@ function normalizeEvent(event) {
|
|
|
85204
85213
|
event_type: event.event_type,
|
|
85205
85214
|
environment: event.service.environment,
|
|
85206
85215
|
error_type: event.payload.name,
|
|
85207
|
-
normalized_message: normalizeMessage(event.payload.message),
|
|
85216
|
+
normalized_message: normalizeMessage(event.payload.message, version2),
|
|
85208
85217
|
route_template: normalizeRoute(event.payload.route ?? null),
|
|
85209
85218
|
http_method: null,
|
|
85210
85219
|
http_status: null,
|
|
@@ -85937,6 +85946,54 @@ var ANALYTICS_BOOTSTRAP_STATEMENTS = [
|
|
|
85937
85946
|
`
|
|
85938
85947
|
];
|
|
85939
85948
|
|
|
85949
|
+
// ../../packages/storage/src/schema-migration-definition.ts
|
|
85950
|
+
var import_node_crypto6 = require("node:crypto");
|
|
85951
|
+
function defineStorageSchemaMigration(input3) {
|
|
85952
|
+
return {
|
|
85953
|
+
...input3,
|
|
85954
|
+
checksum: (0, import_node_crypto6.createHash)("sha256").update(JSON.stringify(input3)).digest("hex")
|
|
85955
|
+
};
|
|
85956
|
+
}
|
|
85957
|
+
|
|
85958
|
+
// ../../packages/storage/src/worker-job-schema.ts
|
|
85959
|
+
var WORKER_JOB_SCHEMA_STATEMENTS = [
|
|
85960
|
+
`CREATE TABLE IF NOT EXISTS worker_jobs (
|
|
85961
|
+
id text PRIMARY KEY,
|
|
85962
|
+
job_name text NOT NULL,
|
|
85963
|
+
project_id uuid REFERENCES projects(id) ON DELETE CASCADE,
|
|
85964
|
+
payload jsonb,
|
|
85965
|
+
depends_on text REFERENCES worker_jobs(id) ON DELETE RESTRICT,
|
|
85966
|
+
status text NOT NULL DEFAULT 'pending' CHECK (status IN ('pending', 'running', 'completed', 'failed', 'skipped')),
|
|
85967
|
+
attempts integer NOT NULL DEFAULT 0 CHECK (attempts >= 0),
|
|
85968
|
+
operator_retries integer NOT NULL DEFAULT 0 CHECK (operator_retries >= 0),
|
|
85969
|
+
available_at timestamptz NOT NULL DEFAULT now(),
|
|
85970
|
+
lease_token uuid,
|
|
85971
|
+
lease_expires_at timestamptz,
|
|
85972
|
+
last_error_code text,
|
|
85973
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
85974
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
85975
|
+
expires_at timestamptz NOT NULL DEFAULT now() + interval '7 days',
|
|
85976
|
+
CHECK ((status = 'running') = (lease_token IS NOT NULL AND lease_expires_at IS NOT NULL)),
|
|
85977
|
+
CHECK (payload IS NULL OR jsonb_typeof(payload) = 'object')
|
|
85978
|
+
)`,
|
|
85979
|
+
`CREATE INDEX IF NOT EXISTS worker_jobs_pending_idx ON worker_jobs(job_name, available_at, created_at, id) WHERE status = 'pending'`,
|
|
85980
|
+
`CREATE INDEX IF NOT EXISTS worker_jobs_running_idx ON worker_jobs(lease_expires_at) WHERE status = 'running'`,
|
|
85981
|
+
`CREATE INDEX IF NOT EXISTS worker_jobs_expiry_idx ON worker_jobs(expires_at)`,
|
|
85982
|
+
`CREATE INDEX IF NOT EXISTS worker_jobs_project_idx ON worker_jobs(project_id)`,
|
|
85983
|
+
`CREATE INDEX IF NOT EXISTS worker_jobs_dependency_idx ON worker_jobs(depends_on) WHERE depends_on IS NOT NULL`,
|
|
85984
|
+
`CREATE INDEX IF NOT EXISTS worker_jobs_status_idx ON worker_jobs(status, created_at) WHERE status IN ('pending', 'running', 'failed')`
|
|
85985
|
+
];
|
|
85986
|
+
var WORKER_JOB_SCHEMA_MIGRATIONS = [
|
|
85987
|
+
defineStorageSchemaMigration({
|
|
85988
|
+
id: "202609130001_add_durable_worker_jobs",
|
|
85989
|
+
description: "Persist worker handoffs, bounded retries, and fenced processing leases",
|
|
85990
|
+
statements: WORKER_JOB_SCHEMA_STATEMENTS
|
|
85991
|
+
})
|
|
85992
|
+
];
|
|
85993
|
+
var WORKER_JOB_BOOTSTRAP_STATEMENTS = WORKER_JOB_SCHEMA_STATEMENTS.map(
|
|
85994
|
+
(statement) => statement.replaceAll(" IF NOT EXISTS", "")
|
|
85995
|
+
);
|
|
85996
|
+
|
|
85940
85997
|
// ../../packages/storage/src/openai-oauth-bootstrap-statements.ts
|
|
85941
85998
|
var OPENAI_OAUTH_BOOTSTRAP_STATEMENTS = [
|
|
85942
85999
|
`
|
|
@@ -87177,18 +87234,19 @@ var STORAGE_BOOTSTRAP_STATEMENTS2 = [
|
|
|
87177
87234
|
...STORAGE_BOOTSTRAP_STATEMENTS,
|
|
87178
87235
|
...OPENAI_OAUTH_BOOTSTRAP_STATEMENTS,
|
|
87179
87236
|
...AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS,
|
|
87180
|
-
...ANALYTICS_BOOTSTRAP_STATEMENTS
|
|
87237
|
+
...ANALYTICS_BOOTSTRAP_STATEMENTS,
|
|
87238
|
+
...WORKER_JOB_BOOTSTRAP_STATEMENTS
|
|
87181
87239
|
];
|
|
87182
87240
|
|
|
87183
87241
|
// ../../packages/storage/src/migrations.ts
|
|
87184
87242
|
var STORAGE_BOOTSTRAP_SQL = STORAGE_BOOTSTRAP_STATEMENTS2.join(";\n\n");
|
|
87185
87243
|
|
|
87186
87244
|
// ../../packages/storage/src/availability-check-schema-migrations.ts
|
|
87187
|
-
var
|
|
87245
|
+
var import_node_crypto7 = require("node:crypto");
|
|
87188
87246
|
function defineAvailabilityCheckStorageSchemaMigration(input3) {
|
|
87189
87247
|
return {
|
|
87190
87248
|
...input3,
|
|
87191
|
-
checksum: (0,
|
|
87249
|
+
checksum: (0, import_node_crypto7.createHash)("sha256").update(JSON.stringify(input3)).digest("hex")
|
|
87192
87250
|
};
|
|
87193
87251
|
}
|
|
87194
87252
|
var AVAILABILITY_CHECK_STORAGE_SCHEMA_MIGRATIONS = [
|
|
@@ -87432,11 +87490,11 @@ var AVAILABILITY_CHECK_STORAGE_SCHEMA_MIGRATIONS = [
|
|
|
87432
87490
|
];
|
|
87433
87491
|
|
|
87434
87492
|
// ../../packages/storage/src/analytics-schema-migrations.ts
|
|
87435
|
-
var
|
|
87493
|
+
var import_node_crypto8 = require("node:crypto");
|
|
87436
87494
|
function defineAnalyticsStorageSchemaMigration(input3) {
|
|
87437
87495
|
return {
|
|
87438
87496
|
...input3,
|
|
87439
|
-
checksum: (0,
|
|
87497
|
+
checksum: (0, import_node_crypto8.createHash)("sha256").update(JSON.stringify(input3)).digest("hex")
|
|
87440
87498
|
};
|
|
87441
87499
|
}
|
|
87442
87500
|
var analyticsAnalysisKindCheck2 = "('usage_summary', 'route_health', 'funnel_dropoff', 'journey_friction', 'feature_usage', 'incident_impact', 'deploy_comparison', 'conversion_path')";
|
|
@@ -88224,15 +88282,6 @@ var ANALYTICS_STORAGE_SCHEMA_MIGRATIONS = [
|
|
|
88224
88282
|
})
|
|
88225
88283
|
];
|
|
88226
88284
|
|
|
88227
|
-
// ../../packages/storage/src/schema-migration-definition.ts
|
|
88228
|
-
var import_node_crypto8 = require("node:crypto");
|
|
88229
|
-
function defineStorageSchemaMigration(input3) {
|
|
88230
|
-
return {
|
|
88231
|
-
...input3,
|
|
88232
|
-
checksum: (0, import_node_crypto8.createHash)("sha256").update(JSON.stringify(input3)).digest("hex")
|
|
88233
|
-
};
|
|
88234
|
-
}
|
|
88235
|
-
|
|
88236
88285
|
// ../../packages/storage/src/openai-oauth-schema-migrations.ts
|
|
88237
88286
|
var OPENAI_OAUTH_STORAGE_SCHEMA_MIGRATIONS = [
|
|
88238
88287
|
defineStorageSchemaMigration({
|
|
@@ -89328,7 +89377,8 @@ var STORAGE_SCHEMA_MIGRATIONS2 = [
|
|
|
89328
89377
|
...STORAGE_SCHEMA_MIGRATIONS,
|
|
89329
89378
|
...AVAILABILITY_CHECK_STORAGE_SCHEMA_MIGRATIONS,
|
|
89330
89379
|
...ANALYTICS_STORAGE_SCHEMA_MIGRATIONS,
|
|
89331
|
-
...OPENAI_OAUTH_STORAGE_SCHEMA_MIGRATIONS
|
|
89380
|
+
...OPENAI_OAUTH_STORAGE_SCHEMA_MIGRATIONS,
|
|
89381
|
+
...WORKER_JOB_SCHEMA_MIGRATIONS
|
|
89332
89382
|
].sort((left, right) => left.id.localeCompare(right.id));
|
|
89333
89383
|
|
|
89334
89384
|
// src/local-retrieval-store.ts
|
|
@@ -93695,6 +93745,18 @@ var import_node_crypto10 = require("node:crypto");
|
|
|
93695
93745
|
var import_promises10 = require("node:fs/promises");
|
|
93696
93746
|
var import_node_path11 = require("node:path");
|
|
93697
93747
|
|
|
93748
|
+
// ../../packages/bundle-engine/src/deployment-context.ts
|
|
93749
|
+
function selectScopedDeployments(input3) {
|
|
93750
|
+
const cutoff = Date.parse(input3.occurredAt);
|
|
93751
|
+
const configuredAt = Date.parse(input3.configuredDeployedAt ?? "");
|
|
93752
|
+
return input3.envelopes.filter(
|
|
93753
|
+
(event) => event.event_type === "deploy_metadata" && event.service.name === input3.service && event.service.environment === input3.environment && event.payload.environment === input3.environment && Date.parse(event.payload.deployed_at) <= cutoff && // A caller-provided workload history row can be newer than the raw window.
|
|
93754
|
+
(!(configuredAt <= cutoff) || Date.parse(event.payload.deployed_at) >= configuredAt)
|
|
93755
|
+
).sort(
|
|
93756
|
+
(left, right) => Date.parse(left.payload.deployed_at) - Date.parse(right.payload.deployed_at) || left.event_id.localeCompare(right.event_id)
|
|
93757
|
+
);
|
|
93758
|
+
}
|
|
93759
|
+
|
|
93698
93760
|
// ../../packages/bundle-engine/src/frontend-context.ts
|
|
93699
93761
|
function toIsoTimestamp(value) {
|
|
93700
93762
|
return new Date(value).toISOString();
|
|
@@ -94080,6 +94142,7 @@ function buildRequestContext(envelopes) {
|
|
|
94080
94142
|
if (exceptionEvent === null) {
|
|
94081
94143
|
return null;
|
|
94082
94144
|
}
|
|
94145
|
+
if (exceptionEvent.payload.request.method.toUpperCase() === "UNKNOWN") return null;
|
|
94083
94146
|
return {
|
|
94084
94147
|
version: 1,
|
|
94085
94148
|
method: exceptionEvent.payload.request.method,
|
|
@@ -94400,13 +94463,20 @@ function buildBundle(input3) {
|
|
|
94400
94463
|
const responseContext = buildResponseContext(sourceEnvelopes);
|
|
94401
94464
|
const logsContext = buildLogsContext(sourceEnvelopes);
|
|
94402
94465
|
const frontendContext = buildFrontendContext(sourceEnvelopes);
|
|
94466
|
+
const deploymentEnvelopes = selectScopedDeployments({
|
|
94467
|
+
envelopes: sourceEnvelopes,
|
|
94468
|
+
service: input3.incident.service_name,
|
|
94469
|
+
environment: input3.incident.environment,
|
|
94470
|
+
occurredAt: input3.bundleMetadata.source_occurred_at,
|
|
94471
|
+
configuredDeployedAt: input3.configuredDeploy?.deployed_at ?? null
|
|
94472
|
+
});
|
|
94403
94473
|
const deployContext = buildDeployContext(
|
|
94404
|
-
|
|
94474
|
+
deploymentEnvelopes,
|
|
94405
94475
|
input3.job.trigger,
|
|
94406
94476
|
input3.configuredDeploy
|
|
94407
94477
|
);
|
|
94408
94478
|
const runtimeContext = buildRuntimeContext(sourceEnvelopes);
|
|
94409
|
-
const gitContext = buildGitContext(
|
|
94479
|
+
const gitContext = buildGitContext(deploymentEnvelopes, input3.configuredDeploy);
|
|
94410
94480
|
const deviceContext = buildDeviceContext(sourceEnvelopes);
|
|
94411
94481
|
const dependenciesContext = buildDependenciesContext(
|
|
94412
94482
|
input3.incident,
|
|
@@ -94541,7 +94611,9 @@ function stableStringify(value) {
|
|
|
94541
94611
|
return `[${value.map((item) => stableStringify(item)).join(",")}]`;
|
|
94542
94612
|
}
|
|
94543
94613
|
if (value !== null && typeof value === "object") {
|
|
94544
|
-
const entries = Object.entries(value).sort(
|
|
94614
|
+
const entries = Object.entries(value).sort(
|
|
94615
|
+
([left], [right]) => left.localeCompare(right)
|
|
94616
|
+
);
|
|
94545
94617
|
return `{${entries.map(([key, entryValue]) => `${JSON.stringify(key)}:${stableStringify(entryValue)}`).join(",")}}`;
|
|
94546
94618
|
}
|
|
94547
94619
|
return JSON.stringify(value);
|
|
@@ -94620,7 +94692,10 @@ function normalizeReplayJsonValue(value) {
|
|
|
94620
94692
|
}
|
|
94621
94693
|
if (value !== null && typeof value === "object") {
|
|
94622
94694
|
return Object.fromEntries(
|
|
94623
|
-
Object.entries(value).map(([key, entryValue]) => [
|
|
94695
|
+
Object.entries(value).map(([key, entryValue]) => [
|
|
94696
|
+
key,
|
|
94697
|
+
normalizeReplayJsonValue(entryValue)
|
|
94698
|
+
])
|
|
94624
94699
|
);
|
|
94625
94700
|
}
|
|
94626
94701
|
return value;
|
|
@@ -94641,7 +94716,10 @@ function normalizeReplayQueryValue(value) {
|
|
|
94641
94716
|
}
|
|
94642
94717
|
if (value !== null && typeof value === "object") {
|
|
94643
94718
|
return Object.fromEntries(
|
|
94644
|
-
sortRecordEntries(value).map(([key, entryValue]) => [
|
|
94719
|
+
sortRecordEntries(value).map(([key, entryValue]) => [
|
|
94720
|
+
key,
|
|
94721
|
+
normalizeReplayQueryValue(entryValue)
|
|
94722
|
+
])
|
|
94645
94723
|
);
|
|
94646
94724
|
}
|
|
94647
94725
|
return value;
|
|
@@ -94657,7 +94735,9 @@ function hasStructuredQueryAmbiguity(value) {
|
|
|
94657
94735
|
return value.some((item) => hasStructuredQueryAmbiguity(item));
|
|
94658
94736
|
}
|
|
94659
94737
|
if (value !== null && typeof value === "object") {
|
|
94660
|
-
return Object.values(value).some(
|
|
94738
|
+
return Object.values(value).some(
|
|
94739
|
+
(item) => hasStructuredQueryAmbiguity(item)
|
|
94740
|
+
);
|
|
94661
94741
|
}
|
|
94662
94742
|
return false;
|
|
94663
94743
|
}
|
|
@@ -94668,7 +94748,9 @@ function buildStructuredReplayQuery(query) {
|
|
|
94668
94748
|
return hasStructuredQueryAmbiguity(normalizedQuery) ? normalizedQuery : void 0;
|
|
94669
94749
|
}
|
|
94670
94750
|
function buildReplayHeaders(headers) {
|
|
94671
|
-
const entries = sortRecordEntries(headers).filter(([headerName]) => !DROPPED_REPLAY_HEADERS.has(headerName.toLowerCase())).map(
|
|
94751
|
+
const entries = sortRecordEntries(headers).filter(([headerName]) => !DROPPED_REPLAY_HEADERS.has(headerName.toLowerCase())).map(
|
|
94752
|
+
([headerName, headerValue]) => [headerName, normalizeHeaderValue(headerValue)]
|
|
94753
|
+
);
|
|
94672
94754
|
entries.sort(([left], [right]) => {
|
|
94673
94755
|
const leftPriority = REPLAY_HEADER_PRIORITY.indexOf(left.toLowerCase());
|
|
94674
94756
|
const rightPriority = REPLAY_HEADER_PRIORITY.indexOf(right.toLowerCase());
|
|
@@ -94694,7 +94776,9 @@ function expandHeaderValues(headers) {
|
|
|
94694
94776
|
});
|
|
94695
94777
|
}
|
|
94696
94778
|
function getHeaderValues(headers, headerName) {
|
|
94697
|
-
const matchedEntry = sortRecordEntries(headers).find(
|
|
94779
|
+
const matchedEntry = sortRecordEntries(headers).find(
|
|
94780
|
+
([candidateName]) => candidateName.toLowerCase() === headerName.toLowerCase()
|
|
94781
|
+
);
|
|
94698
94782
|
if (matchedEntry === void 0) {
|
|
94699
94783
|
return [];
|
|
94700
94784
|
}
|
|
@@ -94756,6 +94840,9 @@ function buildDeterministicRequestUrl(request) {
|
|
|
94756
94840
|
const protocol = typeof protoHeader === "string" && protoHeader.length > 0 ? protoHeader : "https";
|
|
94757
94841
|
const host = typeof forwardedHostHeader === "string" && forwardedHostHeader.length > 0 ? forwardedHostHeader : typeof hostHeader === "string" && hostHeader.length > 0 ? hostHeader : "example.invalid";
|
|
94758
94842
|
const url = new URL(request.path, `${protocol}://${host}`);
|
|
94843
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password) {
|
|
94844
|
+
throw new Error("request_url_invalid");
|
|
94845
|
+
}
|
|
94759
94846
|
for (const [key, rawValue] of sortRecordEntries(request.query)) {
|
|
94760
94847
|
if (Array.isArray(rawValue)) {
|
|
94761
94848
|
for (const item of rawValue) {
|
|
@@ -94779,22 +94866,52 @@ function buildReproduction(bundle) {
|
|
|
94779
94866
|
};
|
|
94780
94867
|
}
|
|
94781
94868
|
const method = request.method.toUpperCase();
|
|
94782
|
-
|
|
94869
|
+
if (!/^[A-Z][A-Z0-9_-]{0,31}$/.test(method) || method === "UNKNOWN") {
|
|
94870
|
+
return {
|
|
94871
|
+
possible: false,
|
|
94872
|
+
confidence: 0.1,
|
|
94873
|
+
reason: "request_method_unavailable",
|
|
94874
|
+
artifacts: null,
|
|
94875
|
+
feasibility_reference: null
|
|
94876
|
+
};
|
|
94877
|
+
}
|
|
94878
|
+
let url;
|
|
94879
|
+
try {
|
|
94880
|
+
url = buildDeterministicRequestUrl(request);
|
|
94881
|
+
} catch {
|
|
94882
|
+
return {
|
|
94883
|
+
possible: false,
|
|
94884
|
+
confidence: 0.1,
|
|
94885
|
+
reason: "request_url_invalid",
|
|
94886
|
+
artifacts: null,
|
|
94887
|
+
feasibility_reference: null
|
|
94888
|
+
};
|
|
94889
|
+
}
|
|
94783
94890
|
const replayHeaders = buildReplayHeaders(request.headers);
|
|
94784
94891
|
const contentType = getPrimaryContentType(replayHeaders);
|
|
94785
94892
|
const structuredReplayQuery = buildStructuredReplayQuery(request.query);
|
|
94786
|
-
const headerParts = expandHeaderValues(replayHeaders).map(
|
|
94787
|
-
|
|
94893
|
+
const headerParts = expandHeaderValues(replayHeaders).map(
|
|
94894
|
+
([headerName, headerValue]) => `${headerName}:${headerValue}`
|
|
94895
|
+
);
|
|
94896
|
+
const curlHeaderParts = headerParts.map(
|
|
94897
|
+
(header2) => `-H ${shellQuote(header2.replace(":", ": "))}`
|
|
94898
|
+
);
|
|
94788
94899
|
const requestBody = buildReplayBody(request.body, replayHeaders);
|
|
94789
94900
|
const jsonSpecBody = contentType === "application/json" ? request.body === void 0 ? null : normalizeReplayJsonValue(request.body) : typeof request.body === "string" ? requestBody : request.body === null || request.body === void 0 ? null : request.body;
|
|
94790
94901
|
const curlBodyPart = requestBody === null ? [] : [`--data-raw ${shellQuote(requestBody)}`];
|
|
94791
|
-
const curl = [`curl -X ${method} ${shellQuote(url)}`, ...curlHeaderParts, ...curlBodyPart].join(
|
|
94792
|
-
|
|
94902
|
+
const curl = [`curl -X ${method} ${shellQuote(url)}`, ...curlHeaderParts, ...curlBodyPart].join(
|
|
94903
|
+
" "
|
|
94904
|
+
);
|
|
94905
|
+
const httpieBase = [
|
|
94906
|
+
`http ${method} ${shellQuote(url)}`,
|
|
94907
|
+
...headerParts.map((header2) => shellQuote(header2))
|
|
94908
|
+
].join(" ");
|
|
94793
94909
|
const httpie = requestBody === null ? httpieBase : `printf '%s' ${shellQuote(requestBody)} | ${httpieBase}`;
|
|
94910
|
+
const hasRequestTarget = new URL(url).hostname !== "example.invalid";
|
|
94794
94911
|
return {
|
|
94795
|
-
possible:
|
|
94796
|
-
confidence: 0.8,
|
|
94797
|
-
reason: "request_context_available",
|
|
94912
|
+
possible: hasRequestTarget,
|
|
94913
|
+
confidence: hasRequestTarget ? 0.8 : 0.1,
|
|
94914
|
+
reason: hasRequestTarget ? "request_context_available" : "request_target_unavailable",
|
|
94798
94915
|
artifacts: {
|
|
94799
94916
|
curl,
|
|
94800
94917
|
httpie,
|
|
@@ -107863,7 +107980,7 @@ async function handleCaptureRuleCommand2(parsedArgv, dependencies) {
|
|
|
107863
107980
|
// package.json
|
|
107864
107981
|
var package_default = {
|
|
107865
107982
|
name: "@debugbundle/cli",
|
|
107866
|
-
version: "1.8.
|
|
107983
|
+
version: "1.8.1",
|
|
107867
107984
|
private: false,
|
|
107868
107985
|
description: "Command-line interface for DebugBundle",
|
|
107869
107986
|
license: "Apache-2.0",
|