@riddledc/riddle-proof 0.7.152 → 0.7.154
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/{chunk-M3ZTY6PQ.js → chunk-PPZ5A5MC.js} +8 -0
- package/dist/{chunk-QJJ3ISMK.js → chunk-YB3LNLZB.js} +108 -0
- package/dist/cli.cjs +234 -33
- package/dist/cli.js +120 -35
- package/dist/index.cjs +116 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/profile.cjs +108 -0
- package/dist/profile.d.cts +10 -1
- package/dist/profile.d.ts +10 -1
- package/dist/profile.js +1 -1
- package/dist/riddle-client.cjs +8 -0
- package/dist/riddle-client.d.cts +3 -0
- package/dist/riddle-client.d.ts +3 -0
- package/dist/riddle-client.js +1 -1
- package/package.json +1 -1
package/dist/profile.cjs
CHANGED
|
@@ -527,6 +527,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
527
527
|
};
|
|
528
528
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
529
529
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
530
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
531
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
530
532
|
return receipt;
|
|
531
533
|
});
|
|
532
534
|
}
|
|
@@ -542,6 +544,40 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
542
544
|
};
|
|
543
545
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
544
546
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
547
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
548
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
549
|
+
return receipt;
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
function profileSetupReturnSummaryFields(result) {
|
|
553
|
+
const input = result.return_summary_fields;
|
|
554
|
+
if (!Array.isArray(input)) return [];
|
|
555
|
+
const fields = [];
|
|
556
|
+
for (const item of input) {
|
|
557
|
+
if (typeof item === "string") {
|
|
558
|
+
const path2 = item.trim();
|
|
559
|
+
if (path2) fields.push({ path: path2 });
|
|
560
|
+
continue;
|
|
561
|
+
}
|
|
562
|
+
if (!isRecord(item)) continue;
|
|
563
|
+
const path = stringValue(item.path) ?? stringValue(item.key) ?? stringValue(item.json_path) ?? stringValue(item.jsonPath);
|
|
564
|
+
if (!path) continue;
|
|
565
|
+
const label = stringValue(item.label) ?? stringValue(item.name) ?? stringValue(item.title);
|
|
566
|
+
fields.push(label ? { path, label } : { path });
|
|
567
|
+
}
|
|
568
|
+
return fields;
|
|
569
|
+
}
|
|
570
|
+
function profileSetupReturnSummary(result) {
|
|
571
|
+
if (result.returned === void 0) return [];
|
|
572
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
573
|
+
const resolved = resolveJsonPath(result.returned, field.path);
|
|
574
|
+
const receipt = {
|
|
575
|
+
label: field.label || field.path,
|
|
576
|
+
path: field.path,
|
|
577
|
+
exists: resolved.exists
|
|
578
|
+
};
|
|
579
|
+
if (resolved.exists) receipt.value = toJsonValue(resolved.value);
|
|
580
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
545
581
|
return receipt;
|
|
546
582
|
});
|
|
547
583
|
}
|
|
@@ -730,6 +766,37 @@ function normalizeSetupActionArgs(input, index) {
|
|
|
730
766
|
}
|
|
731
767
|
return argsInput.map(toJsonValue);
|
|
732
768
|
}
|
|
769
|
+
function normalizeReturnSummaryFields(input, index) {
|
|
770
|
+
const fieldsInput = valueFromOwn(
|
|
771
|
+
input,
|
|
772
|
+
"return_summary_fields",
|
|
773
|
+
"returnSummaryFields",
|
|
774
|
+
"summary_fields",
|
|
775
|
+
"summaryFields",
|
|
776
|
+
"receipt_fields",
|
|
777
|
+
"receiptFields",
|
|
778
|
+
"return_receipt_fields",
|
|
779
|
+
"returnReceiptFields"
|
|
780
|
+
);
|
|
781
|
+
if (fieldsInput === void 0) return void 0;
|
|
782
|
+
if (!Array.isArray(fieldsInput)) {
|
|
783
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields must be an array.`);
|
|
784
|
+
}
|
|
785
|
+
return fieldsInput.map((field, fieldIndex) => {
|
|
786
|
+
if (typeof field === "string") {
|
|
787
|
+
const path2 = field.trim();
|
|
788
|
+
if (!path2) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
789
|
+
return { path: path2 };
|
|
790
|
+
}
|
|
791
|
+
if (!isRecord(field)) {
|
|
792
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] must be a string path or object.`);
|
|
793
|
+
}
|
|
794
|
+
const path = stringFromOwn(field, "path", "key", "json_path", "jsonPath");
|
|
795
|
+
if (!path) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
796
|
+
const label = stringFromOwn(field, "label", "name", "title");
|
|
797
|
+
return label ? { path, label } : { path };
|
|
798
|
+
});
|
|
799
|
+
}
|
|
733
800
|
function normalizeSetupActionRepeat(input, index) {
|
|
734
801
|
const repeat = numberValue(valueFromOwn(input, "repeat", "repeat_count", "repeatCount", "times"));
|
|
735
802
|
if (repeat === void 0) return void 0;
|
|
@@ -951,6 +1018,7 @@ function normalizeSetupAction(input, index) {
|
|
|
951
1018
|
expect_return: hasExpectedReturn ? toJsonValue(valueFromOwn(input, "expect_return", "expectReturn", "expected_return", "expectedReturn")) : void 0,
|
|
952
1019
|
store_return_to: storeReturnTo,
|
|
953
1020
|
capture_return: captureReturn,
|
|
1021
|
+
return_summary_fields: normalizeReturnSummaryFields(input, index),
|
|
954
1022
|
until_path: untilPath,
|
|
955
1023
|
until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
|
|
956
1024
|
max_calls: maxCalls,
|
|
@@ -3989,6 +4057,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
3989
4057
|
};
|
|
3990
4058
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
3991
4059
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
4060
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
4061
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
3992
4062
|
return receipt;
|
|
3993
4063
|
});
|
|
3994
4064
|
}
|
|
@@ -4006,9 +4076,43 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
4006
4076
|
};
|
|
4007
4077
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
4008
4078
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
4079
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
4080
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
4009
4081
|
return receipt;
|
|
4010
4082
|
});
|
|
4011
4083
|
}
|
|
4084
|
+
function profileSetupReturnSummaryFields(result) {
|
|
4085
|
+
const input = result && result.return_summary_fields;
|
|
4086
|
+
if (!Array.isArray(input)) return [];
|
|
4087
|
+
const fields = [];
|
|
4088
|
+
for (const item of input) {
|
|
4089
|
+
if (typeof item === "string") {
|
|
4090
|
+
const path = item.trim();
|
|
4091
|
+
if (path) fields.push({ path });
|
|
4092
|
+
continue;
|
|
4093
|
+
}
|
|
4094
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
4095
|
+
const path = String(item.path || item.key || item.json_path || item.jsonPath || "").trim();
|
|
4096
|
+
if (!path) continue;
|
|
4097
|
+
const label = String(item.label || item.name || item.title || "").trim();
|
|
4098
|
+
fields.push(label ? { path, label } : { path });
|
|
4099
|
+
}
|
|
4100
|
+
return fields;
|
|
4101
|
+
}
|
|
4102
|
+
function profileSetupReturnSummary(result) {
|
|
4103
|
+
if (!result || result.returned === undefined) return [];
|
|
4104
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
4105
|
+
const resolved = resolveJsonProbePath(result.returned, field.path);
|
|
4106
|
+
const receipt = {
|
|
4107
|
+
label: field.label || field.path,
|
|
4108
|
+
path: field.path,
|
|
4109
|
+
exists: Boolean(resolved.exists),
|
|
4110
|
+
};
|
|
4111
|
+
if (resolved.exists) receipt.value = setupJsonValue(resolved.value);
|
|
4112
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
4113
|
+
return receipt;
|
|
4114
|
+
});
|
|
4115
|
+
}
|
|
4012
4116
|
function profileSetupRangeValueReceipts(results) {
|
|
4013
4117
|
return (results || [])
|
|
4014
4118
|
.filter((result) => result && profileSetupResultAction(result) === "set_range_value")
|
|
@@ -5743,6 +5847,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5743
5847
|
const script = String(action.script || action.code || action.source || action.body || "");
|
|
5744
5848
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
5745
5849
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
5850
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
5746
5851
|
if (!script.trim()) return { ...base, reason: "missing_script" };
|
|
5747
5852
|
const scope = await setupActionScope(action, timeout);
|
|
5748
5853
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -5772,6 +5877,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5772
5877
|
return_captured: captureReturn,
|
|
5773
5878
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
5774
5879
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
5880
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
5775
5881
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
5776
5882
|
store_reason: result.store_reason || undefined,
|
|
5777
5883
|
error: result.error || undefined,
|
|
@@ -5781,6 +5887,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5781
5887
|
const path = String(action.path || action.function_path || action.functionPath || "");
|
|
5782
5888
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
5783
5889
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
5890
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
5784
5891
|
if (!path) return { ...base, path, reason: "missing_path" };
|
|
5785
5892
|
const scope = await setupActionScope(action, timeout);
|
|
5786
5893
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -5810,6 +5917,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5810
5917
|
return_captured: captureReturn,
|
|
5811
5918
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
5812
5919
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
5920
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
5813
5921
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
5814
5922
|
store_reason: result.store_reason || undefined,
|
|
5815
5923
|
error: result.error || undefined,
|
package/dist/profile.d.cts
CHANGED
|
@@ -133,6 +133,7 @@ interface RiddleProofProfileSetupAction {
|
|
|
133
133
|
expect_return?: JsonValue;
|
|
134
134
|
store_return_to?: string;
|
|
135
135
|
capture_return?: boolean;
|
|
136
|
+
return_summary_fields?: RiddleProofProfileReturnSummaryField[];
|
|
136
137
|
until_path?: string;
|
|
137
138
|
until_expected_value?: JsonValue;
|
|
138
139
|
max_calls?: number;
|
|
@@ -159,6 +160,10 @@ interface RiddleProofProfileSetupAction {
|
|
|
159
160
|
optional?: boolean;
|
|
160
161
|
continue_on_failure?: boolean;
|
|
161
162
|
}
|
|
163
|
+
interface RiddleProofProfileReturnSummaryField {
|
|
164
|
+
path: string;
|
|
165
|
+
label?: string;
|
|
166
|
+
}
|
|
162
167
|
interface RiddleProofProfileNetworkMockResponse {
|
|
163
168
|
label?: string;
|
|
164
169
|
status: number;
|
|
@@ -391,6 +396,8 @@ interface RiddleProofProfileResult {
|
|
|
391
396
|
attempt?: number;
|
|
392
397
|
attempts?: number;
|
|
393
398
|
timed_out?: boolean;
|
|
399
|
+
retry_count?: number;
|
|
400
|
+
stale_job_ids?: string[];
|
|
394
401
|
artifact_recovery?: boolean;
|
|
395
402
|
split_jobs?: Array<{
|
|
396
403
|
viewport: string;
|
|
@@ -403,6 +410,8 @@ interface RiddleProofProfileResult {
|
|
|
403
410
|
attempt?: number;
|
|
404
411
|
attempts?: number;
|
|
405
412
|
timed_out?: boolean;
|
|
413
|
+
retry_count?: number;
|
|
414
|
+
stale_job_ids?: string[];
|
|
406
415
|
artifact_recovery?: boolean;
|
|
407
416
|
}>;
|
|
408
417
|
};
|
|
@@ -460,4 +469,4 @@ declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): str
|
|
|
460
469
|
declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
|
|
461
470
|
declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
|
|
462
471
|
|
|
463
|
-
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
|
472
|
+
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileReturnSummaryField, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
package/dist/profile.d.ts
CHANGED
|
@@ -133,6 +133,7 @@ interface RiddleProofProfileSetupAction {
|
|
|
133
133
|
expect_return?: JsonValue;
|
|
134
134
|
store_return_to?: string;
|
|
135
135
|
capture_return?: boolean;
|
|
136
|
+
return_summary_fields?: RiddleProofProfileReturnSummaryField[];
|
|
136
137
|
until_path?: string;
|
|
137
138
|
until_expected_value?: JsonValue;
|
|
138
139
|
max_calls?: number;
|
|
@@ -159,6 +160,10 @@ interface RiddleProofProfileSetupAction {
|
|
|
159
160
|
optional?: boolean;
|
|
160
161
|
continue_on_failure?: boolean;
|
|
161
162
|
}
|
|
163
|
+
interface RiddleProofProfileReturnSummaryField {
|
|
164
|
+
path: string;
|
|
165
|
+
label?: string;
|
|
166
|
+
}
|
|
162
167
|
interface RiddleProofProfileNetworkMockResponse {
|
|
163
168
|
label?: string;
|
|
164
169
|
status: number;
|
|
@@ -391,6 +396,8 @@ interface RiddleProofProfileResult {
|
|
|
391
396
|
attempt?: number;
|
|
392
397
|
attempts?: number;
|
|
393
398
|
timed_out?: boolean;
|
|
399
|
+
retry_count?: number;
|
|
400
|
+
stale_job_ids?: string[];
|
|
394
401
|
artifact_recovery?: boolean;
|
|
395
402
|
split_jobs?: Array<{
|
|
396
403
|
viewport: string;
|
|
@@ -403,6 +410,8 @@ interface RiddleProofProfileResult {
|
|
|
403
410
|
attempt?: number;
|
|
404
411
|
attempts?: number;
|
|
405
412
|
timed_out?: boolean;
|
|
413
|
+
retry_count?: number;
|
|
414
|
+
stale_job_ids?: string[];
|
|
406
415
|
artifact_recovery?: boolean;
|
|
407
416
|
}>;
|
|
408
417
|
};
|
|
@@ -460,4 +469,4 @@ declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): str
|
|
|
460
469
|
declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
|
|
461
470
|
declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
|
|
462
471
|
|
|
463
|
-
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
|
472
|
+
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileReturnSummaryField, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
package/dist/profile.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
resolveRiddleProofProfileTimeoutSec,
|
|
24
24
|
slugifyRiddleProofProfileName,
|
|
25
25
|
summarizeRiddleProofProfileResult
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YB3LNLZB.js";
|
|
27
27
|
export {
|
|
28
28
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
29
29
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
package/dist/riddle-client.cjs
CHANGED
|
@@ -341,12 +341,14 @@ async function pollRiddleJob(config, jobId, options = {}) {
|
|
|
341
341
|
const attempts = Math.max(1, Math.floor(options.attempts ?? (options.wait ? 300 : 1)));
|
|
342
342
|
const intervalMs = Math.max(0, Math.floor(options.intervalMs ?? 2e3));
|
|
343
343
|
const progressEveryMs = Math.max(0, Math.floor(options.progressEveryMs ?? 1e4));
|
|
344
|
+
const unsubmittedTimeoutMs = Math.max(0, Math.floor(options.unsubmittedTimeoutMs ?? 0));
|
|
344
345
|
const startedAt = Date.now();
|
|
345
346
|
let job = null;
|
|
346
347
|
let lastSnapshot = null;
|
|
347
348
|
let lastProgressAt = 0;
|
|
348
349
|
let lastProgressKey = "";
|
|
349
350
|
let preSubmissionElapsedMs = 0;
|
|
351
|
+
let unsubmittedTimedOut = false;
|
|
350
352
|
for (let index = 0; index < attempts; index += 1) {
|
|
351
353
|
job = await riddleRequestJson(config, `/v1/jobs/${jobId}`);
|
|
352
354
|
const observedAt = Date.now();
|
|
@@ -377,7 +379,11 @@ async function pollRiddleJob(config, jobId, options = {}) {
|
|
|
377
379
|
await options.onProgress(lastSnapshot);
|
|
378
380
|
}
|
|
379
381
|
}
|
|
382
|
+
unsubmittedTimedOut = Boolean(
|
|
383
|
+
options.wait && unsubmittedTimeoutMs > 0 && lastSnapshot.running_without_submission && !lastSnapshot.created_at && !lastSnapshot.submitted_at && preSubmissionElapsedMs >= unsubmittedTimeoutMs
|
|
384
|
+
);
|
|
380
385
|
if (lastSnapshot.terminal) break;
|
|
386
|
+
if (unsubmittedTimedOut) break;
|
|
381
387
|
if (index + 1 < attempts) {
|
|
382
388
|
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
383
389
|
}
|
|
@@ -402,6 +408,8 @@ async function pollRiddleJob(config, jobId, options = {}) {
|
|
|
402
408
|
...snapshot,
|
|
403
409
|
timed_out: timedOut,
|
|
404
410
|
interval_ms: intervalMs,
|
|
411
|
+
unsubmitted_timeout: unsubmittedTimedOut || void 0,
|
|
412
|
+
unsubmitted_timeout_ms: unsubmittedTimedOut ? unsubmittedTimeoutMs : void 0,
|
|
405
413
|
message: pollMessage(snapshot, timedOut)
|
|
406
414
|
}
|
|
407
415
|
};
|
package/dist/riddle-client.d.cts
CHANGED
|
@@ -24,6 +24,8 @@ interface RiddlePollProgressSnapshot {
|
|
|
24
24
|
interface RiddlePollSummary extends RiddlePollProgressSnapshot {
|
|
25
25
|
timed_out: boolean;
|
|
26
26
|
interval_ms: number;
|
|
27
|
+
unsubmitted_timeout?: boolean;
|
|
28
|
+
unsubmitted_timeout_ms?: number;
|
|
27
29
|
message?: string;
|
|
28
30
|
}
|
|
29
31
|
interface RiddlePollJobOptions {
|
|
@@ -31,6 +33,7 @@ interface RiddlePollJobOptions {
|
|
|
31
33
|
attempts?: number;
|
|
32
34
|
intervalMs?: number;
|
|
33
35
|
progressEveryMs?: number;
|
|
36
|
+
unsubmittedTimeoutMs?: number;
|
|
34
37
|
onProgress?: (snapshot: RiddlePollProgressSnapshot) => void | Promise<void>;
|
|
35
38
|
}
|
|
36
39
|
type RiddlePreviewFramework = "spa" | "static";
|
package/dist/riddle-client.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ interface RiddlePollProgressSnapshot {
|
|
|
24
24
|
interface RiddlePollSummary extends RiddlePollProgressSnapshot {
|
|
25
25
|
timed_out: boolean;
|
|
26
26
|
interval_ms: number;
|
|
27
|
+
unsubmitted_timeout?: boolean;
|
|
28
|
+
unsubmitted_timeout_ms?: number;
|
|
27
29
|
message?: string;
|
|
28
30
|
}
|
|
29
31
|
interface RiddlePollJobOptions {
|
|
@@ -31,6 +33,7 @@ interface RiddlePollJobOptions {
|
|
|
31
33
|
attempts?: number;
|
|
32
34
|
intervalMs?: number;
|
|
33
35
|
progressEveryMs?: number;
|
|
36
|
+
unsubmittedTimeoutMs?: number;
|
|
34
37
|
onProgress?: (snapshot: RiddlePollProgressSnapshot) => void | Promise<void>;
|
|
35
38
|
}
|
|
36
39
|
type RiddlePreviewFramework = "spa" | "static";
|
package/dist/riddle-client.js
CHANGED