@riddledc/riddle-proof 0.7.48 → 0.7.49
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-V2KNQTQD.js → chunk-Q3X6UTPP.js} +16 -1
- package/dist/cli.cjs +16 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +16 -1
- package/dist/index.js +1 -1
- package/dist/profile.cjs +16 -1
- package/dist/profile.d.cts +1 -0
- package/dist/profile.d.ts +1 -0
- package/dist/profile.js +1 -1
- package/package.json +1 -1
|
@@ -329,6 +329,7 @@ function normalizeNetworkMockResponsePayload(input, label, defaults = {}) {
|
|
|
329
329
|
headers: stringRecord(input.headers) || defaults.headers,
|
|
330
330
|
body,
|
|
331
331
|
body_json: hasJsonBody ? toJsonValue(input.body_json ?? input.bodyJson ?? input.json) : defaults.body_json,
|
|
332
|
+
delay_ms: normalizeNetworkMockDelay(input, label, defaults.delay_ms),
|
|
332
333
|
capture_request_body: requestBody.capture_request_body,
|
|
333
334
|
request_body_contains: requestBody.request_body_contains,
|
|
334
335
|
request_body_patterns: requestBody.request_body_patterns,
|
|
@@ -336,6 +337,16 @@ function normalizeNetworkMockResponsePayload(input, label, defaults = {}) {
|
|
|
336
337
|
request_body_not_patterns: requestBody.request_body_not_patterns
|
|
337
338
|
};
|
|
338
339
|
}
|
|
340
|
+
function normalizeNetworkMockDelay(input, label, defaultValue) {
|
|
341
|
+
const value = numberValue(
|
|
342
|
+
input.delay_ms ?? input.delayMs ?? input.wait_ms ?? input.waitMs ?? input.latency_ms ?? input.latencyMs
|
|
343
|
+
) ?? defaultValue;
|
|
344
|
+
if (value === void 0) return void 0;
|
|
345
|
+
if (!Number.isInteger(value) || value < 0 || value > 6e4) {
|
|
346
|
+
throw new Error(`${label}.delay_ms must be an integer from 0 to 60000.`);
|
|
347
|
+
}
|
|
348
|
+
return value;
|
|
349
|
+
}
|
|
339
350
|
function normalizeNetworkMockResponses(value, mockIndex, defaults) {
|
|
340
351
|
if (value === void 0) return void 0;
|
|
341
352
|
if (!Array.isArray(value)) throw new Error(`target.network_mocks[${mockIndex}].responses must be an array.`);
|
|
@@ -346,7 +357,8 @@ function normalizeNetworkMockResponses(value, mockIndex, defaults) {
|
|
|
346
357
|
content_type: defaults.content_type,
|
|
347
358
|
headers: defaults.headers,
|
|
348
359
|
body: defaults.body,
|
|
349
|
-
body_json: defaults.body_json
|
|
360
|
+
body_json: defaults.body_json,
|
|
361
|
+
delay_ms: defaults.delay_ms
|
|
350
362
|
};
|
|
351
363
|
return value.map((response, responseIndex) => {
|
|
352
364
|
if (!isRecord(response)) {
|
|
@@ -2045,6 +2057,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
2045
2057
|
const requestBody = shouldCaptureRequestBody && request.postData ? request.postData() || "" : "";
|
|
2046
2058
|
const requestBodyFailures = shouldCaptureRequestBody ? networkMockRequestBodyFailures(requestBody, mock, responseBodyContract) : [];
|
|
2047
2059
|
const status = response.status || mock.status || 200;
|
|
2060
|
+
const delayMs = numberValue(response.delay_ms) || 0;
|
|
2048
2061
|
const event = {
|
|
2049
2062
|
ok: true,
|
|
2050
2063
|
label: mock.label,
|
|
@@ -2057,6 +2070,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
2057
2070
|
method,
|
|
2058
2071
|
status,
|
|
2059
2072
|
};
|
|
2073
|
+
if (delayMs) event.delay_ms = delayMs;
|
|
2060
2074
|
if (shouldCaptureRequestBody) {
|
|
2061
2075
|
event.request_body_matches = requestBodyFailures.length === 0;
|
|
2062
2076
|
event.request_body_failures = requestBodyFailures;
|
|
@@ -2064,6 +2078,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
2064
2078
|
event.request_body_sample = compactNetworkMockRequestBody(requestBody);
|
|
2065
2079
|
}
|
|
2066
2080
|
networkMockEvents.push(event);
|
|
2081
|
+
if (delayMs) await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
2067
2082
|
await route.fulfill({
|
|
2068
2083
|
status,
|
|
2069
2084
|
headers,
|
package/dist/cli.cjs
CHANGED
|
@@ -7202,6 +7202,7 @@ function normalizeNetworkMockResponsePayload(input, label, defaults = {}) {
|
|
|
7202
7202
|
headers: stringRecord(input.headers) || defaults.headers,
|
|
7203
7203
|
body,
|
|
7204
7204
|
body_json: hasJsonBody ? toJsonValue(input.body_json ?? input.bodyJson ?? input.json) : defaults.body_json,
|
|
7205
|
+
delay_ms: normalizeNetworkMockDelay(input, label, defaults.delay_ms),
|
|
7205
7206
|
capture_request_body: requestBody.capture_request_body,
|
|
7206
7207
|
request_body_contains: requestBody.request_body_contains,
|
|
7207
7208
|
request_body_patterns: requestBody.request_body_patterns,
|
|
@@ -7209,6 +7210,16 @@ function normalizeNetworkMockResponsePayload(input, label, defaults = {}) {
|
|
|
7209
7210
|
request_body_not_patterns: requestBody.request_body_not_patterns
|
|
7210
7211
|
};
|
|
7211
7212
|
}
|
|
7213
|
+
function normalizeNetworkMockDelay(input, label, defaultValue) {
|
|
7214
|
+
const value = numberValue(
|
|
7215
|
+
input.delay_ms ?? input.delayMs ?? input.wait_ms ?? input.waitMs ?? input.latency_ms ?? input.latencyMs
|
|
7216
|
+
) ?? defaultValue;
|
|
7217
|
+
if (value === void 0) return void 0;
|
|
7218
|
+
if (!Number.isInteger(value) || value < 0 || value > 6e4) {
|
|
7219
|
+
throw new Error(`${label}.delay_ms must be an integer from 0 to 60000.`);
|
|
7220
|
+
}
|
|
7221
|
+
return value;
|
|
7222
|
+
}
|
|
7212
7223
|
function normalizeNetworkMockResponses(value, mockIndex, defaults) {
|
|
7213
7224
|
if (value === void 0) return void 0;
|
|
7214
7225
|
if (!Array.isArray(value)) throw new Error(`target.network_mocks[${mockIndex}].responses must be an array.`);
|
|
@@ -7219,7 +7230,8 @@ function normalizeNetworkMockResponses(value, mockIndex, defaults) {
|
|
|
7219
7230
|
content_type: defaults.content_type,
|
|
7220
7231
|
headers: defaults.headers,
|
|
7221
7232
|
body: defaults.body,
|
|
7222
|
-
body_json: defaults.body_json
|
|
7233
|
+
body_json: defaults.body_json,
|
|
7234
|
+
delay_ms: defaults.delay_ms
|
|
7223
7235
|
};
|
|
7224
7236
|
return value.map((response, responseIndex) => {
|
|
7225
7237
|
if (!isRecord(response)) {
|
|
@@ -8902,6 +8914,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
8902
8914
|
const requestBody = shouldCaptureRequestBody && request.postData ? request.postData() || "" : "";
|
|
8903
8915
|
const requestBodyFailures = shouldCaptureRequestBody ? networkMockRequestBodyFailures(requestBody, mock, responseBodyContract) : [];
|
|
8904
8916
|
const status = response.status || mock.status || 200;
|
|
8917
|
+
const delayMs = numberValue(response.delay_ms) || 0;
|
|
8905
8918
|
const event = {
|
|
8906
8919
|
ok: true,
|
|
8907
8920
|
label: mock.label,
|
|
@@ -8914,6 +8927,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
8914
8927
|
method,
|
|
8915
8928
|
status,
|
|
8916
8929
|
};
|
|
8930
|
+
if (delayMs) event.delay_ms = delayMs;
|
|
8917
8931
|
if (shouldCaptureRequestBody) {
|
|
8918
8932
|
event.request_body_matches = requestBodyFailures.length === 0;
|
|
8919
8933
|
event.request_body_failures = requestBodyFailures;
|
|
@@ -8921,6 +8935,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
8921
8935
|
event.request_body_sample = compactNetworkMockRequestBody(requestBody);
|
|
8922
8936
|
}
|
|
8923
8937
|
networkMockEvents.push(event);
|
|
8938
|
+
if (delayMs) await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
8924
8939
|
await route.fulfill({
|
|
8925
8940
|
status,
|
|
8926
8941
|
headers,
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -9043,6 +9043,7 @@ function normalizeNetworkMockResponsePayload(input, label, defaults = {}) {
|
|
|
9043
9043
|
headers: stringRecord(input.headers) || defaults.headers,
|
|
9044
9044
|
body,
|
|
9045
9045
|
body_json: hasJsonBody ? toJsonValue(input.body_json ?? input.bodyJson ?? input.json) : defaults.body_json,
|
|
9046
|
+
delay_ms: normalizeNetworkMockDelay(input, label, defaults.delay_ms),
|
|
9046
9047
|
capture_request_body: requestBody.capture_request_body,
|
|
9047
9048
|
request_body_contains: requestBody.request_body_contains,
|
|
9048
9049
|
request_body_patterns: requestBody.request_body_patterns,
|
|
@@ -9050,6 +9051,16 @@ function normalizeNetworkMockResponsePayload(input, label, defaults = {}) {
|
|
|
9050
9051
|
request_body_not_patterns: requestBody.request_body_not_patterns
|
|
9051
9052
|
};
|
|
9052
9053
|
}
|
|
9054
|
+
function normalizeNetworkMockDelay(input, label, defaultValue) {
|
|
9055
|
+
const value = numberValue3(
|
|
9056
|
+
input.delay_ms ?? input.delayMs ?? input.wait_ms ?? input.waitMs ?? input.latency_ms ?? input.latencyMs
|
|
9057
|
+
) ?? defaultValue;
|
|
9058
|
+
if (value === void 0) return void 0;
|
|
9059
|
+
if (!Number.isInteger(value) || value < 0 || value > 6e4) {
|
|
9060
|
+
throw new Error(`${label}.delay_ms must be an integer from 0 to 60000.`);
|
|
9061
|
+
}
|
|
9062
|
+
return value;
|
|
9063
|
+
}
|
|
9053
9064
|
function normalizeNetworkMockResponses(value, mockIndex, defaults) {
|
|
9054
9065
|
if (value === void 0) return void 0;
|
|
9055
9066
|
if (!Array.isArray(value)) throw new Error(`target.network_mocks[${mockIndex}].responses must be an array.`);
|
|
@@ -9060,7 +9071,8 @@ function normalizeNetworkMockResponses(value, mockIndex, defaults) {
|
|
|
9060
9071
|
content_type: defaults.content_type,
|
|
9061
9072
|
headers: defaults.headers,
|
|
9062
9073
|
body: defaults.body,
|
|
9063
|
-
body_json: defaults.body_json
|
|
9074
|
+
body_json: defaults.body_json,
|
|
9075
|
+
delay_ms: defaults.delay_ms
|
|
9064
9076
|
};
|
|
9065
9077
|
return value.map((response, responseIndex) => {
|
|
9066
9078
|
if (!isRecord2(response)) {
|
|
@@ -10759,6 +10771,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
10759
10771
|
const requestBody = shouldCaptureRequestBody && request.postData ? request.postData() || "" : "";
|
|
10760
10772
|
const requestBodyFailures = shouldCaptureRequestBody ? networkMockRequestBodyFailures(requestBody, mock, responseBodyContract) : [];
|
|
10761
10773
|
const status = response.status || mock.status || 200;
|
|
10774
|
+
const delayMs = numberValue(response.delay_ms) || 0;
|
|
10762
10775
|
const event = {
|
|
10763
10776
|
ok: true,
|
|
10764
10777
|
label: mock.label,
|
|
@@ -10771,6 +10784,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
10771
10784
|
method,
|
|
10772
10785
|
status,
|
|
10773
10786
|
};
|
|
10787
|
+
if (delayMs) event.delay_ms = delayMs;
|
|
10774
10788
|
if (shouldCaptureRequestBody) {
|
|
10775
10789
|
event.request_body_matches = requestBodyFailures.length === 0;
|
|
10776
10790
|
event.request_body_failures = requestBodyFailures;
|
|
@@ -10778,6 +10792,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
10778
10792
|
event.request_body_sample = compactNetworkMockRequestBody(requestBody);
|
|
10779
10793
|
}
|
|
10780
10794
|
networkMockEvents.push(event);
|
|
10795
|
+
if (delayMs) await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
10781
10796
|
await route.fulfill({
|
|
10782
10797
|
status,
|
|
10783
10798
|
headers,
|
package/dist/index.js
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
resolveRiddleProofProfileTimeoutSec,
|
|
59
59
|
slugifyRiddleProofProfileName,
|
|
60
60
|
summarizeRiddleProofProfileResult
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-Q3X6UTPP.js";
|
|
62
62
|
import {
|
|
63
63
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
64
64
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -372,6 +372,7 @@ function normalizeNetworkMockResponsePayload(input, label, defaults = {}) {
|
|
|
372
372
|
headers: stringRecord(input.headers) || defaults.headers,
|
|
373
373
|
body,
|
|
374
374
|
body_json: hasJsonBody ? toJsonValue(input.body_json ?? input.bodyJson ?? input.json) : defaults.body_json,
|
|
375
|
+
delay_ms: normalizeNetworkMockDelay(input, label, defaults.delay_ms),
|
|
375
376
|
capture_request_body: requestBody.capture_request_body,
|
|
376
377
|
request_body_contains: requestBody.request_body_contains,
|
|
377
378
|
request_body_patterns: requestBody.request_body_patterns,
|
|
@@ -379,6 +380,16 @@ function normalizeNetworkMockResponsePayload(input, label, defaults = {}) {
|
|
|
379
380
|
request_body_not_patterns: requestBody.request_body_not_patterns
|
|
380
381
|
};
|
|
381
382
|
}
|
|
383
|
+
function normalizeNetworkMockDelay(input, label, defaultValue) {
|
|
384
|
+
const value = numberValue(
|
|
385
|
+
input.delay_ms ?? input.delayMs ?? input.wait_ms ?? input.waitMs ?? input.latency_ms ?? input.latencyMs
|
|
386
|
+
) ?? defaultValue;
|
|
387
|
+
if (value === void 0) return void 0;
|
|
388
|
+
if (!Number.isInteger(value) || value < 0 || value > 6e4) {
|
|
389
|
+
throw new Error(`${label}.delay_ms must be an integer from 0 to 60000.`);
|
|
390
|
+
}
|
|
391
|
+
return value;
|
|
392
|
+
}
|
|
382
393
|
function normalizeNetworkMockResponses(value, mockIndex, defaults) {
|
|
383
394
|
if (value === void 0) return void 0;
|
|
384
395
|
if (!Array.isArray(value)) throw new Error(`target.network_mocks[${mockIndex}].responses must be an array.`);
|
|
@@ -389,7 +400,8 @@ function normalizeNetworkMockResponses(value, mockIndex, defaults) {
|
|
|
389
400
|
content_type: defaults.content_type,
|
|
390
401
|
headers: defaults.headers,
|
|
391
402
|
body: defaults.body,
|
|
392
|
-
body_json: defaults.body_json
|
|
403
|
+
body_json: defaults.body_json,
|
|
404
|
+
delay_ms: defaults.delay_ms
|
|
393
405
|
};
|
|
394
406
|
return value.map((response, responseIndex) => {
|
|
395
407
|
if (!isRecord(response)) {
|
|
@@ -2088,6 +2100,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
2088
2100
|
const requestBody = shouldCaptureRequestBody && request.postData ? request.postData() || "" : "";
|
|
2089
2101
|
const requestBodyFailures = shouldCaptureRequestBody ? networkMockRequestBodyFailures(requestBody, mock, responseBodyContract) : [];
|
|
2090
2102
|
const status = response.status || mock.status || 200;
|
|
2103
|
+
const delayMs = numberValue(response.delay_ms) || 0;
|
|
2091
2104
|
const event = {
|
|
2092
2105
|
ok: true,
|
|
2093
2106
|
label: mock.label,
|
|
@@ -2100,6 +2113,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
2100
2113
|
method,
|
|
2101
2114
|
status,
|
|
2102
2115
|
};
|
|
2116
|
+
if (delayMs) event.delay_ms = delayMs;
|
|
2103
2117
|
if (shouldCaptureRequestBody) {
|
|
2104
2118
|
event.request_body_matches = requestBodyFailures.length === 0;
|
|
2105
2119
|
event.request_body_failures = requestBodyFailures;
|
|
@@ -2107,6 +2121,7 @@ async function registerNetworkMocks(mocks) {
|
|
|
2107
2121
|
event.request_body_sample = compactNetworkMockRequestBody(requestBody);
|
|
2108
2122
|
}
|
|
2109
2123
|
networkMockEvents.push(event);
|
|
2124
|
+
if (delayMs) await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
2110
2125
|
await route.fulfill({
|
|
2111
2126
|
status,
|
|
2112
2127
|
headers,
|
package/dist/profile.d.cts
CHANGED
package/dist/profile.d.ts
CHANGED
package/dist/profile.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveRiddleProofProfileTimeoutSec,
|
|
20
20
|
slugifyRiddleProofProfileName,
|
|
21
21
|
summarizeRiddleProofProfileResult
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-Q3X6UTPP.js";
|
|
23
23
|
export {
|
|
24
24
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
25
25
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|